@lumx/react 2.1.6-alpha.3 → 2.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/_internal/Lightbox2.js +10 -4
- package/esm/_internal/Lightbox2.js.map +1 -1
- package/esm/_internal/List2.js.map +1 -1
- package/esm/_internal/TextField.js +2 -2
- package/esm/_internal/TextField.js.map +1 -1
- package/esm/_internal/UserBlock.js +1 -0
- package/esm/_internal/UserBlock.js.map +1 -1
- package/package.json +10 -15
- package/src/components/alert-dialog/AlertDialog.stories.tsx +9 -2
- package/src/components/autocomplete/AutocompleteMultiple.stories.tsx +1 -1
- package/src/components/avatar/__snapshots__/Avatar.test.tsx.snap +30 -30
- package/src/components/comment-block/__snapshots__/CommentBlock.test.tsx.snap +1 -1
- package/src/components/dialog/Dialog.stories.tsx +9 -2
- package/src/components/image-block/ImageBlock.stories.tsx +2 -2
- package/src/components/image-block/__snapshots__/ImageBlock.test.tsx.snap +1 -1
- package/src/components/lightbox/Lightbox.stories.tsx +82 -0
- package/src/components/lightbox/Lightbox.tsx +12 -4
- package/src/components/mosaic/__snapshots__/Mosaic.test.tsx.snap +18 -18
- package/src/components/notification/Notifications.stories.tsx +16 -10
- package/src/components/skeleton/SkeletonCircle.stories.tsx +1 -1
- package/src/components/skeleton/SkeletonRectangle.stories.tsx +1 -1
- package/src/components/skeleton/SkeletonTypography.stories.tsx +1 -1
- package/src/components/slideshow/__snapshots__/Slideshow.test.tsx.snap +12 -12
- package/src/components/text-field/TextField.stories.tsx +30 -0
- package/src/components/text-field/TextField.tsx +11 -9
- package/src/components/thumbnail/Thumbnail.stories.tsx +2 -2
- package/src/components/thumbnail/__snapshots__/Thumbnail.test.tsx.snap +5 -5
- package/src/components/user-block/UserBlock.stories.tsx +4 -1
- package/src/components/user-block/UserBlock.tsx +1 -0
- package/src/components/user-block/__snapshots__/UserBlock.test.tsx.snap +10 -10
- package/src/stories/chromaticForceScreenSize.tsx +7 -0
- package/src/stories/generated/Autocomplete/Demos.stories.tsx +1 -1
- package/src/stories/generated/Avatar/Demos.stories.tsx +1 -1
- package/src/stories/generated/Badge/Demos.stories.tsx +1 -1
- package/src/stories/generated/Button/Demos.stories.tsx +1 -1
- package/src/stories/generated/Checkbox/Demos.stories.tsx +1 -1
- package/src/stories/generated/Chip/Demos.stories.tsx +1 -1
- package/src/stories/generated/CommentBlock/Demos.stories.tsx +1 -1
- package/src/stories/generated/DatePicker/Demos.stories.tsx +1 -1
- package/src/stories/generated/Dialog/Demos.stories.tsx +1 -1
- package/src/stories/generated/Divider/Demos.stories.tsx +1 -1
- package/src/stories/generated/Dropdown/Demos.stories.tsx +1 -1
- package/src/stories/generated/ExpansionPanel/Demos.stories.tsx +1 -1
- package/src/stories/generated/Icon/Demos.stories.tsx +1 -1
- package/src/stories/generated/ImageBlock/Demos.stories.tsx +1 -1
- package/src/stories/generated/Lightbox/Demos.stories.tsx +1 -1
- package/src/stories/generated/Link/Demos.stories.tsx +1 -1
- package/src/stories/generated/LinkPreview/Demos.stories.tsx +1 -1
- package/src/stories/generated/List/Demos.stories.tsx +1 -1
- package/src/stories/generated/Message/Demos.stories.tsx +1 -1
- package/src/stories/generated/Mosaic/Demos.stories.tsx +1 -1
- package/src/stories/generated/Notification/Demos.stories.tsx +1 -1
- package/src/stories/generated/Popover/Demos.stories.tsx +1 -1
- package/src/stories/generated/PostBlock/Demos.stories.tsx +1 -1
- package/src/stories/generated/Progress/Demos.stories.tsx +1 -1
- package/src/stories/generated/ProgressTracker/Demos.stories.tsx +1 -1
- package/src/stories/generated/RadioButton/Demos.stories.tsx +1 -1
- package/src/stories/generated/Select/Demos.stories.tsx +1 -1
- package/src/stories/generated/SideNavigation/Demos.stories.tsx +1 -1
- package/src/stories/generated/Skeleton/Demos.stories.tsx +1 -1
- package/src/stories/generated/Slider/Demos.stories.tsx +1 -1
- package/src/stories/generated/Slideshow/Demos.stories.tsx +1 -1
- package/src/stories/generated/Switch/Demos.stories.tsx +1 -1
- package/src/stories/generated/Table/Demos.stories.tsx +1 -1
- package/src/stories/generated/Tabs/Demos.stories.tsx +1 -1
- package/src/stories/generated/TextField/Demos.stories.tsx +1 -1
- package/src/stories/generated/Thumbnail/Demos.stories.tsx +1 -1
- package/src/stories/generated/Toolbar/Demos.stories.tsx +1 -1
- package/src/stories/generated/Tooltip/Demos.stories.tsx +1 -1
- package/src/stories/generated/Uploader/Demos.stories.tsx +1 -1
- package/src/stories/generated/UserBlock/Demos.stories.tsx +1 -1
- package/src/stories/knobs/enumKnob.ts +1 -1
- package/src/stories/knobs/image.ts +12 -12
- package/src/untypped-modules.d.ts +2 -0
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.
|
|
11
|
-
"@lumx/icons": "^2.1.
|
|
10
|
+
"@lumx/core": "^2.1.7",
|
|
11
|
+
"@lumx/icons": "^2.1.7",
|
|
12
12
|
"@popperjs/core": "^2.5.4",
|
|
13
13
|
"body-scroll-lock": "^3.1.5",
|
|
14
14
|
"classnames": "^2.2.6",
|
|
@@ -23,18 +23,13 @@
|
|
|
23
23
|
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3",
|
|
24
24
|
"@babel/plugin-proposal-object-rest-spread": "^7.8.3",
|
|
25
25
|
"@babel/plugin-proposal-optional-chaining": "^7.8.3",
|
|
26
|
+
"@babel/plugin-proposal-private-methods": "^7.16.0",
|
|
27
|
+
"@babel/plugin-proposal-private-property-in-object": "^7.16.0",
|
|
26
28
|
"@babel/preset-env": "^7.8.3",
|
|
27
29
|
"@babel/preset-react": "^7.8.3",
|
|
28
30
|
"@babel/preset-typescript": "^7.12.7",
|
|
29
31
|
"@rollup/plugin-commonjs": "^15.0.0",
|
|
30
32
|
"@rollup/plugin-node-resolve": "9.0.0",
|
|
31
|
-
"@storybook/addon-a11y": "^5.3.21",
|
|
32
|
-
"@storybook/addon-actions": "^5.3.21",
|
|
33
|
-
"@storybook/addon-knobs": "^5.3.21",
|
|
34
|
-
"@storybook/addon-storysource": "^5.3.21",
|
|
35
|
-
"@storybook/addon-viewport": "^5.3.21",
|
|
36
|
-
"@storybook/core": "^5.3.21",
|
|
37
|
-
"@storybook/react": "^5.3.21",
|
|
38
33
|
"@types/body-scroll-lock": "^2.6.1",
|
|
39
34
|
"@types/classnames": "^2.2.9",
|
|
40
35
|
"@types/enzyme": "^3.10.5",
|
|
@@ -45,7 +40,7 @@
|
|
|
45
40
|
"@types/react-is": "^16.7.1",
|
|
46
41
|
"autoprefixer": "^9.7.4",
|
|
47
42
|
"babel-loader": "^8.0.6",
|
|
48
|
-
"chromatic": "^
|
|
43
|
+
"chromatic": "^6.0.6",
|
|
49
44
|
"core-js": "^3.6.4",
|
|
50
45
|
"dts-bundle-generator": "^5.5.0",
|
|
51
46
|
"enzyme": "^3.11.0",
|
|
@@ -120,11 +115,11 @@
|
|
|
120
115
|
"prepare": "install-peers || exit 0",
|
|
121
116
|
"prepublishOnly": "yarn build",
|
|
122
117
|
"test": "jest --config jest/index.js --coverage --notify --passWithNoTests --detectOpenHandles --runInBand",
|
|
123
|
-
"
|
|
124
|
-
"storybook": "
|
|
125
|
-
"build:storybook": "
|
|
118
|
+
"storybook": "yarn start:storybook",
|
|
119
|
+
"start:storybook": "cd storybook && ./start",
|
|
120
|
+
"build:storybook": "cd storybook && ./build"
|
|
126
121
|
},
|
|
127
122
|
"sideEffects": false,
|
|
128
|
-
"version": "2.1.
|
|
129
|
-
"gitHead": "
|
|
123
|
+
"version": "2.1.7",
|
|
124
|
+
"gitHead": "b025a4e7e397ec0e725430120007f9ac8433fadb"
|
|
130
125
|
}
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import React, { RefObject, useRef, useState } from 'react';
|
|
2
2
|
import { Button, Theme, Link } from '@lumx/react';
|
|
3
|
+
import { DIALOG_TRANSITION_DURATION } from '@lumx/core/js/constants';
|
|
4
|
+
import { chromaticForceScreenSize } from '../../stories/chromaticForceScreenSize';
|
|
3
5
|
import { AlertDialog } from './AlertDialog';
|
|
4
6
|
|
|
5
7
|
export default {
|
|
6
8
|
title: 'LumX components/alert-dialog/AlertDialog',
|
|
7
9
|
parameters: {
|
|
8
|
-
//
|
|
9
|
-
chromatic: {
|
|
10
|
+
// Delay Chromatic snapshot to wait for dialog to open.
|
|
11
|
+
chromatic: {
|
|
12
|
+
pauseAnimationAtEnd: true,
|
|
13
|
+
delay: DIALOG_TRANSITION_DURATION,
|
|
14
|
+
},
|
|
10
15
|
},
|
|
16
|
+
// Force minimum chromatic screen size to make sure the dialog appears in view.
|
|
17
|
+
decorators: [chromaticForceScreenSize],
|
|
11
18
|
};
|
|
12
19
|
|
|
13
20
|
const defaultProps = {
|
|
@@ -6,7 +6,7 @@ import { mdiClose, mdiFlag } from '@lumx/icons';
|
|
|
6
6
|
|
|
7
7
|
import { CITIES } from './__mockData__';
|
|
8
8
|
|
|
9
|
-
export default { title: 'LumX components/autocomplete/
|
|
9
|
+
export default { title: 'LumX components/autocomplete/AutocompleteMultiple' };
|
|
10
10
|
|
|
11
11
|
interface City {
|
|
12
12
|
id: string;
|
|
@@ -10,7 +10,7 @@ Array [
|
|
|
10
10
|
aspectRatio="square"
|
|
11
11
|
className="lumx-avatar__thumbnail"
|
|
12
12
|
fallback="M21,5V11.59L18,8.58L14,12.59L10,8.59L6,12.59L3,9.58V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5M18,11.42L21,14.43V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V12.42L6,15.41L10,11.41L14,15.41"
|
|
13
|
-
image="avatar2.jpg"
|
|
13
|
+
image="/demo-assets/avatar2.jpg"
|
|
14
14
|
loading="lazy"
|
|
15
15
|
onClick={[Function]}
|
|
16
16
|
size="xs"
|
|
@@ -25,7 +25,7 @@ Array [
|
|
|
25
25
|
aspectRatio="square"
|
|
26
26
|
className="lumx-avatar__thumbnail"
|
|
27
27
|
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"
|
|
28
|
-
image="avatar2.jpg"
|
|
28
|
+
image="/demo-assets/avatar2.jpg"
|
|
29
29
|
loading="lazy"
|
|
30
30
|
onClick={[Function]}
|
|
31
31
|
size="s"
|
|
@@ -40,7 +40,7 @@ Array [
|
|
|
40
40
|
aspectRatio="square"
|
|
41
41
|
className="lumx-avatar__thumbnail"
|
|
42
42
|
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"
|
|
43
|
-
image="avatar2.jpg"
|
|
43
|
+
image="/demo-assets/avatar2.jpg"
|
|
44
44
|
loading="lazy"
|
|
45
45
|
onClick={[Function]}
|
|
46
46
|
size="m"
|
|
@@ -55,7 +55,7 @@ Array [
|
|
|
55
55
|
aspectRatio="square"
|
|
56
56
|
className="lumx-avatar__thumbnail"
|
|
57
57
|
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"
|
|
58
|
-
image="avatar2.jpg"
|
|
58
|
+
image="/demo-assets/avatar2.jpg"
|
|
59
59
|
loading="lazy"
|
|
60
60
|
onClick={[Function]}
|
|
61
61
|
size="l"
|
|
@@ -70,7 +70,7 @@ Array [
|
|
|
70
70
|
aspectRatio="square"
|
|
71
71
|
className="lumx-avatar__thumbnail"
|
|
72
72
|
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"
|
|
73
|
-
image="avatar2.jpg"
|
|
73
|
+
image="/demo-assets/avatar2.jpg"
|
|
74
74
|
loading="lazy"
|
|
75
75
|
onClick={[Function]}
|
|
76
76
|
size="xl"
|
|
@@ -85,7 +85,7 @@ Array [
|
|
|
85
85
|
aspectRatio="square"
|
|
86
86
|
className="lumx-avatar__thumbnail"
|
|
87
87
|
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"
|
|
88
|
-
image="avatar2.jpg"
|
|
88
|
+
image="/demo-assets/avatar2.jpg"
|
|
89
89
|
loading="lazy"
|
|
90
90
|
onClick={[Function]}
|
|
91
91
|
size="xxl"
|
|
@@ -105,7 +105,7 @@ Array [
|
|
|
105
105
|
aspectRatio="square"
|
|
106
106
|
className="lumx-avatar__thumbnail"
|
|
107
107
|
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"
|
|
108
|
-
image="avatar1.jpg"
|
|
108
|
+
image="/demo-assets/avatar1.jpg"
|
|
109
109
|
loading="lazy"
|
|
110
110
|
size="xs"
|
|
111
111
|
theme="light"
|
|
@@ -119,7 +119,7 @@ Array [
|
|
|
119
119
|
aspectRatio="square"
|
|
120
120
|
className="lumx-avatar__thumbnail"
|
|
121
121
|
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"
|
|
122
|
-
image="avatar1.jpg"
|
|
122
|
+
image="/demo-assets/avatar1.jpg"
|
|
123
123
|
loading="lazy"
|
|
124
124
|
size="s"
|
|
125
125
|
theme="light"
|
|
@@ -133,7 +133,7 @@ Array [
|
|
|
133
133
|
aspectRatio="square"
|
|
134
134
|
className="lumx-avatar__thumbnail"
|
|
135
135
|
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"
|
|
136
|
-
image="avatar1.jpg"
|
|
136
|
+
image="/demo-assets/avatar1.jpg"
|
|
137
137
|
loading="lazy"
|
|
138
138
|
size="m"
|
|
139
139
|
theme="light"
|
|
@@ -147,7 +147,7 @@ Array [
|
|
|
147
147
|
aspectRatio="square"
|
|
148
148
|
className="lumx-avatar__thumbnail"
|
|
149
149
|
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"
|
|
150
|
-
image="avatar1.jpg"
|
|
150
|
+
image="/demo-assets/avatar1.jpg"
|
|
151
151
|
loading="lazy"
|
|
152
152
|
size="l"
|
|
153
153
|
theme="light"
|
|
@@ -161,7 +161,7 @@ Array [
|
|
|
161
161
|
aspectRatio="square"
|
|
162
162
|
className="lumx-avatar__thumbnail"
|
|
163
163
|
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"
|
|
164
|
-
image="avatar1.jpg"
|
|
164
|
+
image="/demo-assets/avatar1.jpg"
|
|
165
165
|
loading="lazy"
|
|
166
166
|
size="xl"
|
|
167
167
|
theme="light"
|
|
@@ -175,7 +175,7 @@ Array [
|
|
|
175
175
|
aspectRatio="square"
|
|
176
176
|
className="lumx-avatar__thumbnail"
|
|
177
177
|
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"
|
|
178
|
-
image="avatar1.jpg"
|
|
178
|
+
image="/demo-assets/avatar1.jpg"
|
|
179
179
|
loading="lazy"
|
|
180
180
|
size="xxl"
|
|
181
181
|
theme="light"
|
|
@@ -194,7 +194,7 @@ Array [
|
|
|
194
194
|
aspectRatio="square"
|
|
195
195
|
className="lumx-avatar__thumbnail"
|
|
196
196
|
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"
|
|
197
|
-
image="avatar2.jpg"
|
|
197
|
+
image="/demo-assets/avatar2.jpg"
|
|
198
198
|
loading="lazy"
|
|
199
199
|
size="xs"
|
|
200
200
|
theme="light"
|
|
@@ -258,7 +258,7 @@ Array [
|
|
|
258
258
|
aspectRatio="square"
|
|
259
259
|
className="lumx-avatar__thumbnail"
|
|
260
260
|
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"
|
|
261
|
-
image="avatar2.jpg"
|
|
261
|
+
image="/demo-assets/avatar2.jpg"
|
|
262
262
|
loading="lazy"
|
|
263
263
|
size="s"
|
|
264
264
|
theme="light"
|
|
@@ -322,7 +322,7 @@ Array [
|
|
|
322
322
|
aspectRatio="square"
|
|
323
323
|
className="lumx-avatar__thumbnail"
|
|
324
324
|
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"
|
|
325
|
-
image="avatar2.jpg"
|
|
325
|
+
image="/demo-assets/avatar2.jpg"
|
|
326
326
|
loading="lazy"
|
|
327
327
|
size="m"
|
|
328
328
|
theme="light"
|
|
@@ -386,7 +386,7 @@ Array [
|
|
|
386
386
|
aspectRatio="square"
|
|
387
387
|
className="lumx-avatar__thumbnail"
|
|
388
388
|
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"
|
|
389
|
-
image="avatar2.jpg"
|
|
389
|
+
image="/demo-assets/avatar2.jpg"
|
|
390
390
|
loading="lazy"
|
|
391
391
|
size="l"
|
|
392
392
|
theme="light"
|
|
@@ -450,7 +450,7 @@ Array [
|
|
|
450
450
|
aspectRatio="square"
|
|
451
451
|
className="lumx-avatar__thumbnail"
|
|
452
452
|
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"
|
|
453
|
-
image="avatar2.jpg"
|
|
453
|
+
image="/demo-assets/avatar2.jpg"
|
|
454
454
|
loading="lazy"
|
|
455
455
|
size="xl"
|
|
456
456
|
theme="light"
|
|
@@ -514,7 +514,7 @@ Array [
|
|
|
514
514
|
aspectRatio="square"
|
|
515
515
|
className="lumx-avatar__thumbnail"
|
|
516
516
|
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"
|
|
517
|
-
image="avatar2.jpg"
|
|
517
|
+
image="/demo-assets/avatar2.jpg"
|
|
518
518
|
loading="lazy"
|
|
519
519
|
size="xxl"
|
|
520
520
|
theme="light"
|
|
@@ -583,7 +583,7 @@ Array [
|
|
|
583
583
|
aspectRatio="square"
|
|
584
584
|
className="lumx-avatar__thumbnail"
|
|
585
585
|
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"
|
|
586
|
-
image="avatar3.jpg"
|
|
586
|
+
image="/demo-assets/avatar3.jpg"
|
|
587
587
|
loading="lazy"
|
|
588
588
|
size="xs"
|
|
589
589
|
theme="light"
|
|
@@ -608,7 +608,7 @@ Array [
|
|
|
608
608
|
aspectRatio="square"
|
|
609
609
|
className="lumx-avatar__thumbnail"
|
|
610
610
|
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"
|
|
611
|
-
image="avatar3.jpg"
|
|
611
|
+
image="/demo-assets/avatar3.jpg"
|
|
612
612
|
loading="lazy"
|
|
613
613
|
size="s"
|
|
614
614
|
theme="light"
|
|
@@ -633,7 +633,7 @@ Array [
|
|
|
633
633
|
aspectRatio="square"
|
|
634
634
|
className="lumx-avatar__thumbnail"
|
|
635
635
|
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"
|
|
636
|
-
image="avatar3.jpg"
|
|
636
|
+
image="/demo-assets/avatar3.jpg"
|
|
637
637
|
loading="lazy"
|
|
638
638
|
size="m"
|
|
639
639
|
theme="light"
|
|
@@ -658,7 +658,7 @@ Array [
|
|
|
658
658
|
aspectRatio="square"
|
|
659
659
|
className="lumx-avatar__thumbnail"
|
|
660
660
|
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"
|
|
661
|
-
image="avatar3.jpg"
|
|
661
|
+
image="/demo-assets/avatar3.jpg"
|
|
662
662
|
loading="lazy"
|
|
663
663
|
size="l"
|
|
664
664
|
theme="light"
|
|
@@ -683,7 +683,7 @@ Array [
|
|
|
683
683
|
aspectRatio="square"
|
|
684
684
|
className="lumx-avatar__thumbnail"
|
|
685
685
|
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"
|
|
686
|
-
image="avatar3.jpg"
|
|
686
|
+
image="/demo-assets/avatar3.jpg"
|
|
687
687
|
loading="lazy"
|
|
688
688
|
size="xl"
|
|
689
689
|
theme="light"
|
|
@@ -708,7 +708,7 @@ Array [
|
|
|
708
708
|
aspectRatio="square"
|
|
709
709
|
className="lumx-avatar__thumbnail"
|
|
710
710
|
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"
|
|
711
|
-
image="avatar3.jpg"
|
|
711
|
+
image="/demo-assets/avatar3.jpg"
|
|
712
712
|
loading="lazy"
|
|
713
713
|
size="xxl"
|
|
714
714
|
theme="light"
|
|
@@ -738,7 +738,7 @@ Array [
|
|
|
738
738
|
aspectRatio="square"
|
|
739
739
|
className="lumx-avatar__thumbnail"
|
|
740
740
|
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"
|
|
741
|
-
image="portrait3.jpg"
|
|
741
|
+
image="/demo-assets/portrait3.jpg"
|
|
742
742
|
loading="lazy"
|
|
743
743
|
size="xs"
|
|
744
744
|
theme="light"
|
|
@@ -752,7 +752,7 @@ Array [
|
|
|
752
752
|
aspectRatio="square"
|
|
753
753
|
className="lumx-avatar__thumbnail"
|
|
754
754
|
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"
|
|
755
|
-
image="portrait3.jpg"
|
|
755
|
+
image="/demo-assets/portrait3.jpg"
|
|
756
756
|
loading="lazy"
|
|
757
757
|
size="s"
|
|
758
758
|
theme="light"
|
|
@@ -766,7 +766,7 @@ Array [
|
|
|
766
766
|
aspectRatio="square"
|
|
767
767
|
className="lumx-avatar__thumbnail"
|
|
768
768
|
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"
|
|
769
|
-
image="portrait3.jpg"
|
|
769
|
+
image="/demo-assets/portrait3.jpg"
|
|
770
770
|
loading="lazy"
|
|
771
771
|
size="m"
|
|
772
772
|
theme="light"
|
|
@@ -780,7 +780,7 @@ Array [
|
|
|
780
780
|
aspectRatio="square"
|
|
781
781
|
className="lumx-avatar__thumbnail"
|
|
782
782
|
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"
|
|
783
|
-
image="portrait3.jpg"
|
|
783
|
+
image="/demo-assets/portrait3.jpg"
|
|
784
784
|
loading="lazy"
|
|
785
785
|
size="l"
|
|
786
786
|
theme="light"
|
|
@@ -794,7 +794,7 @@ Array [
|
|
|
794
794
|
aspectRatio="square"
|
|
795
795
|
className="lumx-avatar__thumbnail"
|
|
796
796
|
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"
|
|
797
|
-
image="portrait3.jpg"
|
|
797
|
+
image="/demo-assets/portrait3.jpg"
|
|
798
798
|
loading="lazy"
|
|
799
799
|
size="xl"
|
|
800
800
|
theme="light"
|
|
@@ -808,7 +808,7 @@ Array [
|
|
|
808
808
|
aspectRatio="square"
|
|
809
809
|
className="lumx-avatar__thumbnail"
|
|
810
810
|
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"
|
|
811
|
-
image="portrait3.jpg"
|
|
811
|
+
image="/demo-assets/portrait3.jpg"
|
|
812
812
|
loading="lazy"
|
|
813
813
|
size="xxl"
|
|
814
814
|
theme="light"
|
|
@@ -15,17 +15,24 @@ import {
|
|
|
15
15
|
Theme,
|
|
16
16
|
Toolbar,
|
|
17
17
|
} from '@lumx/react';
|
|
18
|
+
import { DIALOG_TRANSITION_DURATION } from '@lumx/core/js/constants';
|
|
18
19
|
import { select } from '@storybook/addon-knobs';
|
|
19
20
|
import React, { RefObject, useRef, useState } from 'react';
|
|
20
21
|
import { Dialog, DialogSizes } from './Dialog';
|
|
21
22
|
import { loremIpsum } from '../../stories/knobs/lorem';
|
|
23
|
+
import { chromaticForceScreenSize } from '../../stories/chromaticForceScreenSize';
|
|
22
24
|
|
|
23
25
|
export default {
|
|
24
26
|
title: 'LumX components/dialog/Dialog',
|
|
25
27
|
parameters: {
|
|
26
|
-
//
|
|
27
|
-
chromatic: {
|
|
28
|
+
// Delay Chromatic snapshot to wait for dialog to open.
|
|
29
|
+
chromatic: {
|
|
30
|
+
pauseAnimationAtEnd: true,
|
|
31
|
+
delay: DIALOG_TRANSITION_DURATION,
|
|
32
|
+
},
|
|
28
33
|
},
|
|
34
|
+
// Force minimum chromatic screen size to make sure the dialog appears in view.
|
|
35
|
+
decorators: [chromaticForceScreenSize],
|
|
29
36
|
};
|
|
30
37
|
|
|
31
38
|
const header = <header className="lumx-spacing-padding lumx-typography-title">Dialog header</header>;
|
|
@@ -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
|
|
15
|
-
const aspectRatio = select
|
|
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);
|
|
@@ -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
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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
|