@lumx/react 2.1.6-alpha.5 → 2.1.8

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 (85) hide show
  1. package/esm/_internal/DragHandle.js +1 -1
  2. package/esm/_internal/DragHandle.js.map +1 -1
  3. package/esm/_internal/Flag2.js +3 -1
  4. package/esm/_internal/Flag2.js.map +1 -1
  5. package/esm/_internal/Lightbox2.js +10 -4
  6. package/esm/_internal/Lightbox2.js.map +1 -1
  7. package/esm/_internal/List2.js.map +1 -1
  8. package/esm/_internal/Message2.js +2 -2
  9. package/esm/_internal/Message2.js.map +1 -1
  10. package/esm/_internal/TextField.js +2 -2
  11. package/esm/_internal/TextField.js.map +1 -1
  12. package/esm/_internal/UserBlock.js +1 -0
  13. package/esm/_internal/UserBlock.js.map +1 -1
  14. package/package.json +10 -15
  15. package/src/components/alert-dialog/AlertDialog.stories.tsx +9 -2
  16. package/src/components/autocomplete/AutocompleteMultiple.stories.tsx +1 -1
  17. package/src/components/avatar/__snapshots__/Avatar.test.tsx.snap +30 -30
  18. package/src/components/comment-block/__snapshots__/CommentBlock.test.tsx.snap +1 -1
  19. package/src/components/dialog/Dialog.stories.tsx +9 -2
  20. package/src/components/drag-handle/DragHandle.tsx +1 -5
  21. package/src/components/flag/Flag.test.tsx +2 -1
  22. package/src/components/flag/Flag.tsx +10 -2
  23. package/src/components/flag/__snapshots__/Flag.test.tsx.snap +15 -0
  24. package/src/components/image-block/ImageBlock.stories.tsx +2 -2
  25. package/src/components/image-block/__snapshots__/ImageBlock.test.tsx.snap +1 -1
  26. package/src/components/lightbox/Lightbox.stories.tsx +82 -0
  27. package/src/components/lightbox/Lightbox.tsx +12 -4
  28. package/src/components/message/Message.tsx +2 -2
  29. package/src/components/mosaic/__snapshots__/Mosaic.test.tsx.snap +18 -18
  30. package/src/components/notification/Notifications.stories.tsx +16 -10
  31. package/src/components/skeleton/SkeletonCircle.stories.tsx +1 -1
  32. package/src/components/skeleton/SkeletonRectangle.stories.tsx +1 -1
  33. package/src/components/skeleton/SkeletonTypography.stories.tsx +1 -1
  34. package/src/components/slideshow/__snapshots__/Slideshow.test.tsx.snap +12 -12
  35. package/src/components/text-field/TextField.stories.tsx +30 -0
  36. package/src/components/text-field/TextField.tsx +11 -9
  37. package/src/components/thumbnail/Thumbnail.stories.tsx +2 -2
  38. package/src/components/thumbnail/__snapshots__/Thumbnail.test.tsx.snap +5 -5
  39. package/src/components/user-block/UserBlock.stories.tsx +4 -1
  40. package/src/components/user-block/UserBlock.tsx +1 -0
  41. package/src/components/user-block/__snapshots__/UserBlock.test.tsx.snap +10 -10
  42. package/src/stories/chromaticForceScreenSize.tsx +7 -0
  43. package/src/stories/generated/Autocomplete/Demos.stories.tsx +1 -1
  44. package/src/stories/generated/Avatar/Demos.stories.tsx +1 -1
  45. package/src/stories/generated/Badge/Demos.stories.tsx +1 -1
  46. package/src/stories/generated/Button/Demos.stories.tsx +1 -1
  47. package/src/stories/generated/Checkbox/Demos.stories.tsx +1 -1
  48. package/src/stories/generated/Chip/Demos.stories.tsx +1 -1
  49. package/src/stories/generated/CommentBlock/Demos.stories.tsx +1 -1
  50. package/src/stories/generated/DatePicker/Demos.stories.tsx +1 -1
  51. package/src/stories/generated/Dialog/Demos.stories.tsx +1 -1
  52. package/src/stories/generated/Divider/Demos.stories.tsx +1 -1
  53. package/src/stories/generated/Dropdown/Demos.stories.tsx +1 -1
  54. package/src/stories/generated/ExpansionPanel/Demos.stories.tsx +1 -1
  55. package/src/stories/generated/Icon/Demos.stories.tsx +1 -1
  56. package/src/stories/generated/ImageBlock/Demos.stories.tsx +1 -1
  57. package/src/stories/generated/Lightbox/Demos.stories.tsx +1 -1
  58. package/src/stories/generated/Link/Demos.stories.tsx +1 -1
  59. package/src/stories/generated/LinkPreview/Demos.stories.tsx +1 -1
  60. package/src/stories/generated/List/Demos.stories.tsx +1 -1
  61. package/src/stories/generated/Message/Demos.stories.tsx +1 -1
  62. package/src/stories/generated/Mosaic/Demos.stories.tsx +1 -1
  63. package/src/stories/generated/Notification/Demos.stories.tsx +1 -1
  64. package/src/stories/generated/Popover/Demos.stories.tsx +1 -1
  65. package/src/stories/generated/PostBlock/Demos.stories.tsx +1 -1
  66. package/src/stories/generated/Progress/Demos.stories.tsx +1 -1
  67. package/src/stories/generated/ProgressTracker/Demos.stories.tsx +1 -1
  68. package/src/stories/generated/RadioButton/Demos.stories.tsx +1 -1
  69. package/src/stories/generated/Select/Demos.stories.tsx +1 -1
  70. package/src/stories/generated/SideNavigation/Demos.stories.tsx +1 -1
  71. package/src/stories/generated/Skeleton/Demos.stories.tsx +1 -1
  72. package/src/stories/generated/Slider/Demos.stories.tsx +1 -1
  73. package/src/stories/generated/Slideshow/Demos.stories.tsx +1 -1
  74. package/src/stories/generated/Switch/Demos.stories.tsx +1 -1
  75. package/src/stories/generated/Table/Demos.stories.tsx +1 -1
  76. package/src/stories/generated/Tabs/Demos.stories.tsx +1 -1
  77. package/src/stories/generated/TextField/Demos.stories.tsx +1 -1
  78. package/src/stories/generated/Thumbnail/Demos.stories.tsx +1 -1
  79. package/src/stories/generated/Toolbar/Demos.stories.tsx +1 -1
  80. package/src/stories/generated/Tooltip/Demos.stories.tsx +1 -1
  81. package/src/stories/generated/Uploader/Demos.stories.tsx +1 -1
  82. package/src/stories/generated/UserBlock/Demos.stories.tsx +1 -1
  83. package/src/stories/knobs/enumKnob.ts +1 -1
  84. package/src/stories/knobs/image.ts +12 -12
  85. package/src/untypped-modules.d.ts +2 -0
@@ -1,7 +1,7 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import classNames from 'classnames';
3
3
 
4
- import { ColorPalette, Icon, Size, Theme } from '@lumx/react';
4
+ import { ColorPalette, ColorVariant, Icon, Size, Theme } from '@lumx/react';
5
5
  import { Comp, GenericProps, getRootClassName, handleBasicClasses } from '@lumx/react/utils';
6
6
 
7
7
  export interface FlagProps extends GenericProps {
@@ -38,7 +38,15 @@ export const Flag: Comp<FlagProps, HTMLDivElement> = forwardRef((props, ref) =>
38
38
  className={classNames(className, handleBasicClasses({ prefix: CLASSNAME, color: flagColor }))}
39
39
  ref={ref}
40
40
  >
41
- {icon && <Icon icon={icon} size={Size.xxs} className={`${CLASSNAME}__icon`} />}
41
+ {icon && (
42
+ <Icon
43
+ icon={icon}
44
+ color={color}
45
+ colorVariant={ColorVariant.D2}
46
+ size={Size.xxs}
47
+ className={`${CLASSNAME}__icon`}
48
+ />
49
+ )}
42
50
  <span className={`${CLASSNAME}__label`}>{label}</span>
43
51
  </div>
44
52
  );
@@ -19,6 +19,8 @@ Array [
19
19
  >
20
20
  <Icon
21
21
  className="lumx-flag__icon"
22
+ color="blue"
23
+ colorVariant="D2"
22
24
  icon="M12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.08C13.09,3.81 14.76,3 16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.03L12,21.35Z"
23
25
  size="xxs"
24
26
  />
@@ -33,6 +35,8 @@ Array [
33
35
  >
34
36
  <Icon
35
37
  className="lumx-flag__icon"
38
+ color="dark"
39
+ colorVariant="D2"
36
40
  icon="M12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.08C13.09,3.81 14.76,3 16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.03L12,21.35Z"
37
41
  size="xxs"
38
42
  />
@@ -47,6 +51,8 @@ Array [
47
51
  >
48
52
  <Icon
49
53
  className="lumx-flag__icon"
54
+ color="green"
55
+ colorVariant="D2"
50
56
  icon="M12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.08C13.09,3.81 14.76,3 16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.03L12,21.35Z"
51
57
  size="xxs"
52
58
  />
@@ -61,6 +67,8 @@ Array [
61
67
  >
62
68
  <Icon
63
69
  className="lumx-flag__icon"
70
+ color="primary"
71
+ colorVariant="D2"
64
72
  icon="M12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.08C13.09,3.81 14.76,3 16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.03L12,21.35Z"
65
73
  size="xxs"
66
74
  />
@@ -75,6 +83,8 @@ Array [
75
83
  >
76
84
  <Icon
77
85
  className="lumx-flag__icon"
86
+ color="red"
87
+ colorVariant="D2"
78
88
  icon="M12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.08C13.09,3.81 14.76,3 16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.03L12,21.35Z"
79
89
  size="xxs"
80
90
  />
@@ -89,6 +99,8 @@ Array [
89
99
  >
90
100
  <Icon
91
101
  className="lumx-flag__icon"
102
+ color="secondary"
103
+ colorVariant="D2"
92
104
  icon="M12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.08C13.09,3.81 14.76,3 16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.03L12,21.35Z"
93
105
  size="xxs"
94
106
  />
@@ -103,6 +115,8 @@ Array [
103
115
  >
104
116
  <Icon
105
117
  className="lumx-flag__icon"
118
+ color="yellow"
119
+ colorVariant="D2"
106
120
  icon="M12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.08C13.09,3.81 14.76,3 16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.03L12,21.35Z"
107
121
  size="xxs"
108
122
  />
@@ -121,6 +135,7 @@ exports[`<Flag /> Snapshots and structure should render story 'withIcon' 1`] = `
121
135
  >
122
136
  <Icon
123
137
  className="lumx-flag__icon"
138
+ colorVariant="D2"
124
139
  icon="M12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.08C13.09,3.81 14.76,3 16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.03L12,21.35Z"
125
140
  size="xxs"
126
141
  />
@@ -11,8 +11,8 @@ export default { title: 'LumX components/image-block/Image Block' };
11
11
 
12
12
  export const DefaultImageBlock = ({ theme }: any) => {
13
13
  const alt = text('Alternative text', 'Image alt text');
14
- const align = select<Alignment>('Alignment', Alignment, Alignment.center) as any;
15
- const aspectRatio = select<AspectRatio>('Aspect ratio', AspectRatio, AspectRatio.square);
14
+ const align = select('Alignment', Alignment, Alignment.center) as any;
15
+ const aspectRatio = select('Aspect ratio', AspectRatio, AspectRatio.square);
16
16
  const title = text('Title', 'Hello world');
17
17
  const description = text('Description', 'My awesome description');
18
18
  const crossOrigin = enumKnob('CORS', [undefined, 'anonymous', 'use-credentials'], undefined);
@@ -16,7 +16,7 @@ exports[`<ImageBlock> Snapshots and structure should render story 'DefaultImageB
16
16
  "y": 0,
17
17
  }
18
18
  }
19
- image="landscape1.jpg"
19
+ image="/demo-assets/landscape1.jpg"
20
20
  loading="lazy"
21
21
  onClick={false}
22
22
  theme="light"
@@ -0,0 +1,82 @@
1
+ import React from 'react';
2
+ import {
3
+ ImageBlock,
4
+ Slideshow,
5
+ SlideshowItem,
6
+ Toolbar,
7
+ Divider,
8
+ Alignment,
9
+ TextField,
10
+ Typography,
11
+ Link,
12
+ Lightbox,
13
+ ThumbnailProps,
14
+ } from '@lumx/react';
15
+ import { thumbnailsKnob } from '@lumx/react/stories/knobs/thumbnailsKnob';
16
+
17
+ export default { title: 'LumX components/lightbox/Lightbox' };
18
+
19
+ interface RowItemProps {
20
+ image: ThumbnailProps;
21
+ }
22
+
23
+ const RowItem: React.FC<RowItemProps> = ({ image }) => {
24
+ const [isOpen, setOpen] = React.useState(false);
25
+ const { image: url, alt: name } = image;
26
+ const linkRef = React.useRef(null);
27
+
28
+ return (
29
+ <>
30
+ <Toolbar
31
+ label={
32
+ <Link ref={linkRef} typography={Typography.subtitle1} onClick={() => setOpen(true)}>
33
+ {name}
34
+ </Link>
35
+ }
36
+ />
37
+ <Lightbox
38
+ closeButtonProps={{ label: 'Close' }}
39
+ isOpen={isOpen}
40
+ onClose={() => setOpen(false)}
41
+ parentElement={linkRef}
42
+ >
43
+ <Slideshow
44
+ activeIndex={0}
45
+ fillHeight
46
+ slideshowControlsProps={{
47
+ nextButtonProps: { label: 'Next' },
48
+ previousButtonProps: { label: 'Previous' },
49
+ }}
50
+ >
51
+ <SlideshowItem key={name}>
52
+ <ImageBlock align={Alignment.center} alt={name} fillHeight image={url} />
53
+ </SlideshowItem>
54
+ </Slideshow>
55
+ </Lightbox>
56
+ </>
57
+ );
58
+ };
59
+
60
+ export const Focus = () => {
61
+ const [textFieldValue, setTextFieldValue] = React.useState('');
62
+ const images: ThumbnailProps[] = thumbnailsKnob(12);
63
+
64
+ return (
65
+ <>
66
+ <TextField
67
+ value={textFieldValue}
68
+ onChange={setTextFieldValue}
69
+ className="lumx-spacing-margin-vertical-big"
70
+ />
71
+ {images.map((image, index) => {
72
+ const itemPosition = index + 1;
73
+ return (
74
+ <div key={itemPosition}>
75
+ <RowItem image={image} />
76
+ <Divider />
77
+ </div>
78
+ );
79
+ })}
80
+ </>
81
+ );
82
+ };
@@ -10,7 +10,6 @@ import { Comp, GenericProps, getRootClassName, handleBasicClasses } from '@lumx/
10
10
 
11
11
  import { useFocusTrap } from '@lumx/react/hooks/useFocusTrap';
12
12
  import { useDelayedVisibility } from '@lumx/react/hooks/useDelayedVisibility';
13
- import { useFocus } from '@lumx/react/hooks/useFocus';
14
13
  import { useDisableBodyScroll } from '@lumx/react/hooks/useDisableBodyScroll';
15
14
  import { ClickAwayProvider } from '@lumx/react/utils/ClickAwayProvider';
16
15
  import { mergeRefs } from '@lumx/react/utils/mergeRefs';
@@ -90,9 +89,18 @@ export const Lightbox: Comp<LightboxProps, HTMLDivElement> = forwardRef((props,
90
89
  // eslint-disable-next-line react-hooks/rules-of-hooks
91
90
  useFocusTrap(wrapperRef.current, childrenRef.current?.firstChild);
92
91
 
93
- // Focus the parent element on close.
94
- // eslint-disable-next-line react-hooks/rules-of-hooks
95
- useFocus(parentElement?.current, !isOpen);
92
+ const previousOpen = React.useRef(isOpen);
93
+
94
+ React.useEffect(() => {
95
+ if (isOpen !== previousOpen.current) {
96
+ previousOpen.current = isOpen;
97
+
98
+ // Focus the parent element on close.
99
+ if (!isOpen && parentElement && parentElement.current) {
100
+ parentElement.current.focus();
101
+ }
102
+ }
103
+ }, [isOpen, parentElement]);
96
104
 
97
105
  // Close lightbox on escape key pressed.
98
106
  // eslint-disable-next-line react-hooks/rules-of-hooks
@@ -62,8 +62,8 @@ export const Message: Comp<MessageProps, HTMLDivElement> = forwardRef((props, re
62
62
  )}
63
63
  {...forwardedProps}
64
64
  >
65
- {(customIcon || icon) && <Icon className={`${CLASSNAME}__icon`} icon={customIcon || icon} size={Size.xs} />}
66
- <div className={`${CLASSNAME}__text`}>{children}</div>
65
+ {(customIcon || icon) && <Icon className="lumx-message__icon" icon={customIcon || icon} size={Size.xs} />}
66
+ <div className="lumx-message__text">{children}</div>
67
67
  </div>
68
68
  );
69
69
  });
@@ -17,7 +17,7 @@ exports[`<Mosaic> Snapshots and structure should render story FiveThumbnails 1`]
17
17
  aspectRatio="free"
18
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"
19
19
  fillHeight={true}
20
- image="landscape1.jpg"
20
+ image="/demo-assets/landscape1.jpg"
21
21
  loading="lazy"
22
22
  theme="light"
23
23
  />
@@ -32,7 +32,7 @@ exports[`<Mosaic> Snapshots and structure should render story FiveThumbnails 1`]
32
32
  aspectRatio="free"
33
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"
34
34
  fillHeight={true}
35
- image="landscape2.jpg"
35
+ image="/demo-assets/landscape2.jpg"
36
36
  loading="lazy"
37
37
  theme="light"
38
38
  />
@@ -47,7 +47,7 @@ exports[`<Mosaic> Snapshots and structure should render story FiveThumbnails 1`]
47
47
  aspectRatio="free"
48
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"
49
49
  fillHeight={true}
50
- image="landscape3.jpg"
50
+ image="/demo-assets/landscape3.jpg"
51
51
  loading="lazy"
52
52
  theme="light"
53
53
  />
@@ -62,7 +62,7 @@ exports[`<Mosaic> Snapshots and structure should render story FiveThumbnails 1`]
62
62
  aspectRatio="free"
63
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"
64
64
  fillHeight={true}
65
- image="portrait1.jpg"
65
+ image="/demo-assets/portrait1.jpg"
66
66
  loading="lazy"
67
67
  theme="light"
68
68
  />
@@ -96,7 +96,7 @@ exports[`<Mosaic> Snapshots and structure should render story FourThumbnails 1`]
96
96
  aspectRatio="free"
97
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"
98
98
  fillHeight={true}
99
- image="landscape1.jpg"
99
+ image="/demo-assets/landscape1.jpg"
100
100
  loading="lazy"
101
101
  theme="light"
102
102
  />
@@ -111,7 +111,7 @@ exports[`<Mosaic> Snapshots and structure should render story FourThumbnails 1`]
111
111
  aspectRatio="free"
112
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"
113
113
  fillHeight={true}
114
- image="landscape2.jpg"
114
+ image="/demo-assets/landscape2.jpg"
115
115
  loading="lazy"
116
116
  theme="light"
117
117
  />
@@ -126,7 +126,7 @@ exports[`<Mosaic> Snapshots and structure should render story FourThumbnails 1`]
126
126
  aspectRatio="free"
127
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"
128
128
  fillHeight={true}
129
- image="landscape3.jpg"
129
+ image="/demo-assets/landscape3.jpg"
130
130
  loading="lazy"
131
131
  theme="light"
132
132
  />
@@ -141,7 +141,7 @@ exports[`<Mosaic> Snapshots and structure should render story FourThumbnails 1`]
141
141
  aspectRatio="free"
142
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"
143
143
  fillHeight={true}
144
- image="portrait1.jpg"
144
+ image="/demo-assets/portrait1.jpg"
145
145
  loading="lazy"
146
146
  theme="light"
147
147
  />
@@ -167,7 +167,7 @@ exports[`<Mosaic> Snapshots and structure should render story OneThumbnail 1`] =
167
167
  aspectRatio="free"
168
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"
169
169
  fillHeight={true}
170
- image="landscape1.jpg"
170
+ image="/demo-assets/landscape1.jpg"
171
171
  loading="lazy"
172
172
  theme="light"
173
173
  />
@@ -193,7 +193,7 @@ exports[`<Mosaic> Snapshots and structure should render story SixThumbnails 1`]
193
193
  aspectRatio="free"
194
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"
195
195
  fillHeight={true}
196
- image="landscape1.jpg"
196
+ image="/demo-assets/landscape1.jpg"
197
197
  loading="lazy"
198
198
  onClick={[Function]}
199
199
  theme="light"
@@ -209,7 +209,7 @@ exports[`<Mosaic> Snapshots and structure should render story SixThumbnails 1`]
209
209
  aspectRatio="free"
210
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"
211
211
  fillHeight={true}
212
- image="landscape2.jpg"
212
+ image="/demo-assets/landscape2.jpg"
213
213
  loading="lazy"
214
214
  onClick={[Function]}
215
215
  theme="light"
@@ -225,7 +225,7 @@ exports[`<Mosaic> Snapshots and structure should render story SixThumbnails 1`]
225
225
  aspectRatio="free"
226
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"
227
227
  fillHeight={true}
228
- image="landscape3.jpg"
228
+ image="/demo-assets/landscape3.jpg"
229
229
  loading="lazy"
230
230
  onClick={[Function]}
231
231
  theme="light"
@@ -241,7 +241,7 @@ exports[`<Mosaic> Snapshots and structure should render story SixThumbnails 1`]
241
241
  aspectRatio="free"
242
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"
243
243
  fillHeight={true}
244
- image="portrait1.jpg"
244
+ image="/demo-assets/portrait1.jpg"
245
245
  loading="lazy"
246
246
  onClick={[Function]}
247
247
  theme="light"
@@ -276,7 +276,7 @@ exports[`<Mosaic> Snapshots and structure should render story ThreeThumbnails 1`
276
276
  aspectRatio="free"
277
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"
278
278
  fillHeight={true}
279
- image="landscape1.jpg"
279
+ image="/demo-assets/landscape1.jpg"
280
280
  loading="lazy"
281
281
  theme="light"
282
282
  />
@@ -291,7 +291,7 @@ exports[`<Mosaic> Snapshots and structure should render story ThreeThumbnails 1`
291
291
  aspectRatio="free"
292
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"
293
293
  fillHeight={true}
294
- image="landscape2.jpg"
294
+ image="/demo-assets/landscape2.jpg"
295
295
  loading="lazy"
296
296
  theme="light"
297
297
  />
@@ -306,7 +306,7 @@ exports[`<Mosaic> Snapshots and structure should render story ThreeThumbnails 1`
306
306
  aspectRatio="free"
307
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"
308
308
  fillHeight={true}
309
- image="landscape3.jpg"
309
+ image="/demo-assets/landscape3.jpg"
310
310
  loading="lazy"
311
311
  theme="light"
312
312
  />
@@ -332,7 +332,7 @@ exports[`<Mosaic> Snapshots and structure should render story TwoThumbnails 1`]
332
332
  aspectRatio="free"
333
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"
334
334
  fillHeight={true}
335
- image="landscape1.jpg"
335
+ image="/demo-assets/landscape1.jpg"
336
336
  loading="lazy"
337
337
  theme="light"
338
338
  />
@@ -347,7 +347,7 @@ exports[`<Mosaic> Snapshots and structure should render story TwoThumbnails 1`]
347
347
  aspectRatio="free"
348
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"
349
349
  fillHeight={true}
350
- image="landscape2.jpg"
350
+ image="/demo-assets/landscape2.jpg"
351
351
  loading="lazy"
352
352
  theme="light"
353
353
  />
@@ -1,48 +1,54 @@
1
1
  import React, { useState } from 'react';
2
2
 
3
3
  import { Button, Notification, Kind } from '@lumx/react';
4
-
5
- import noop from 'lodash/noop';
4
+ import { NOTIFICATION_TRANSITION_DURATION } from '@lumx/core/js/constants';
5
+ import { action } from '@storybook/addon-actions';
6
+ import { chromaticForceScreenSize } from '../../stories/chromaticForceScreenSize';
6
7
 
7
8
  export default {
8
9
  title: 'LumX components/notification/Notification',
9
10
  parameters: {
10
- // Notifies Chromatic to pause the animations when they finish for the specific story.
11
- chromatic: { pauseAnimationAtEnd: true },
11
+ // Delay Chromatic snapshot to wait for notification to open.
12
+ chromatic: {
13
+ pauseAnimationAtEnd: true,
14
+ delay: NOTIFICATION_TRANSITION_DURATION,
15
+ },
12
16
  },
17
+ // Force minimum chromatic screen size to make sure the dialog appears in view.
18
+ decorators: [chromaticForceScreenSize],
13
19
  };
14
20
 
15
21
  const properties = {
16
22
  error: {
17
23
  content: 'Error',
18
- onClick: noop,
24
+ onClick: action('onClick'),
19
25
  isOpen: true,
20
26
  type: Kind.error,
21
27
  },
22
28
  info: {
23
29
  content: 'Info',
24
- onClick: noop,
30
+ onClick: action('onClick'),
25
31
  isOpen: true,
26
32
  type: Kind.info,
27
33
  },
28
34
  infoWithCallback: {
29
- onActionClick: noop,
35
+ onActionClick: action('onClick'),
30
36
  actionLabel: 'Undo',
31
37
  content: 'Info with callback',
32
- onClick: noop,
38
+ onClick: action('onClick'),
33
39
  isOpen: true,
34
40
  type: Kind.info,
35
41
  },
36
42
  success: {
37
43
  content: 'Success',
38
- onClick: noop,
44
+ onClick: action('onClick'),
39
45
  isOpen: true,
40
46
  type: Kind.success,
41
47
  },
42
48
 
43
49
  warning: {
44
50
  content: 'Warning',
45
- onClick: noop,
51
+ onClick: action('onClick'),
46
52
  isOpen: true,
47
53
  type: Kind.warning,
48
54
  },
@@ -2,7 +2,7 @@ import React from 'react';
2
2
 
3
3
  import { FlexBox, Orientation, Size, SkeletonCircle, ColorPalette } from '@lumx/react';
4
4
 
5
- export default { title: 'LumX components/skeleton/Skeleton' };
5
+ export default { title: 'LumX components/skeleton/Skeleton Circle' };
6
6
 
7
7
  const sizes = [Size.xxs, Size.xs, Size.s, Size.m, Size.l, Size.xl, Size.xxl] as const;
8
8
  const colors = Object.values(ColorPalette);
@@ -14,7 +14,7 @@ import {
14
14
  } from '@lumx/react';
15
15
  import { imageKnob } from '@lumx/react/stories/knobs/image';
16
16
 
17
- export default { title: 'LumX components/skeleton/Skeleton' };
17
+ export default { title: 'LumX components/skeleton/Skeleton Rectangle' };
18
18
 
19
19
  const variants = [
20
20
  SkeletonRectangleVariant.squared,
@@ -2,7 +2,7 @@ import React from 'react';
2
2
 
3
3
  import { SkeletonTypography, Typography, ColorPalette } from '@lumx/react';
4
4
 
5
- export default { title: 'LumX components/skeleton/Skeleton' };
5
+ export default { title: 'LumX components/skeleton/Skeleton Typography' };
6
6
 
7
7
  const colors = Object.values(ColorPalette);
8
8
 
@@ -23,13 +23,13 @@ Array [
23
23
  }
24
24
  >
25
25
  <SlideshowItem
26
- key="landscape1.jpg-0"
26
+ key="/demo-assets/landscape1.jpg-0"
27
27
  >
28
28
  <ImageBlock
29
29
  align="left"
30
30
  alt="Image 1"
31
31
  captionPosition="below"
32
- image="landscape1.jpg"
32
+ image="/demo-assets/landscape1.jpg"
33
33
  theme="light"
34
34
  thumbnailProps={
35
35
  Object {
@@ -39,13 +39,13 @@ Array [
39
39
  />
40
40
  </SlideshowItem>
41
41
  <SlideshowItem
42
- key="landscape2.jpg-1"
42
+ key="/demo-assets/landscape2.jpg-1"
43
43
  >
44
44
  <ImageBlock
45
45
  align="left"
46
46
  alt="Image 2"
47
47
  captionPosition="below"
48
- image="landscape2.jpg"
48
+ image="/demo-assets/landscape2.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="landscape3.jpg-2"
58
+ key="/demo-assets/landscape3.jpg-2"
59
59
  >
60
60
  <ImageBlock
61
61
  align="left"
62
62
  alt="Image 3"
63
63
  captionPosition="below"
64
- image="landscape3.jpg"
64
+ image="/demo-assets/landscape3.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="portrait1.jpg-3"
74
+ key="/demo-assets/portrait1.jpg-3"
75
75
  >
76
76
  <ImageBlock
77
77
  align="left"
78
78
  alt="Image 4"
79
79
  captionPosition="below"
80
- image="portrait1.jpg"
80
+ image="/demo-assets/portrait1.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="portrait2.jpg-4"
90
+ key="/demo-assets/portrait2.jpg-4"
91
91
  >
92
92
  <ImageBlock
93
93
  align="left"
94
94
  alt="Image 5"
95
95
  captionPosition="below"
96
- image="portrait2.jpg"
96
+ image="/demo-assets/portrait2.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="portrait3.jpg-5"
106
+ key="/demo-assets/portrait3.jpg-5"
107
107
  >
108
108
  <ImageBlock
109
109
  align="left"
110
110
  alt="Image 6"
111
111
  captionPosition="below"
112
- image="portrait3.jpg"
112
+ image="/demo-assets/portrait3.jpg"
113
113
  theme="light"
114
114
  thumbnailProps={
115
115
  Object {
@@ -137,3 +137,33 @@ export const WithAfterElement = ({ theme }: any) => {
137
137
  />
138
138
  );
139
139
  };
140
+
141
+ export const WithMaxLengthNoLabel = ({ theme }: any) => {
142
+ const [value, onChange] = React.useState('Value');
143
+ const multiline = boolean('Multiline', true);
144
+ const minimumRows = number('Minimum number of rows', 2, { min: 0, max: 100 });
145
+ const isClearable = boolean('Clearable', true);
146
+ const hasError = boolean('Has error', true);
147
+ return (
148
+ <TextField
149
+ value={value}
150
+ placeholder={text('Placeholder', 'Placeholder')}
151
+ theme={theme}
152
+ onChange={onChange}
153
+ multiline={multiline}
154
+ minimumRows={minimumRows}
155
+ hasError={hasError}
156
+ maxLength={200}
157
+ clearButtonProps={isClearable ? { label: 'Clear' } : undefined}
158
+ helper={<span>{text('Helper', 'Helper')}</span>}
159
+ afterElement={
160
+ <IconButton
161
+ label="foo"
162
+ emphasis={emphasis('Button emphasis', Emphasis.medium, 'After element')}
163
+ size={buttonSize('Button size', Size.s, 'After element')}
164
+ icon={mdiTranslate}
165
+ />
166
+ }
167
+ />
168
+ );
169
+ };
@@ -307,16 +307,18 @@ export const TextField: Comp<TextFieldProps, HTMLDivElement> = forwardRef((props
307
307
  }),
308
308
  )}
309
309
  >
310
- {label && (
310
+ {(label || maxLength) && (
311
311
  <div className={`${CLASSNAME}__header`}>
312
- <InputLabel
313
- htmlFor={textFieldId}
314
- className={`${CLASSNAME}__label`}
315
- isRequired={isRequired}
316
- theme={theme}
317
- >
318
- {label}
319
- </InputLabel>
312
+ {label && (
313
+ <InputLabel
314
+ htmlFor={textFieldId}
315
+ className={`${CLASSNAME}__label`}
316
+ isRequired={isRequired}
317
+ theme={theme}
318
+ >
319
+ {label}
320
+ </InputLabel>
321
+ )}
320
322
 
321
323
  {maxLength && (
322
324
  <div className={`${CLASSNAME}__char-counter`}>