@lumx/react 2.1.9 → 2.2.1
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/Avatar2.js +7 -2
- package/esm/_internal/Avatar2.js.map +1 -1
- package/esm/_internal/Slider2.js +21 -2
- package/esm/_internal/Slider2.js.map +1 -1
- package/esm/_internal/Thumbnail2.js +181 -782
- package/esm/_internal/Thumbnail2.js.map +1 -1
- package/esm/_internal/Tooltip2.js +0 -5
- package/esm/_internal/Tooltip2.js.map +1 -1
- package/esm/_internal/UserBlock.js +41 -17
- package/esm/_internal/UserBlock.js.map +1 -1
- package/esm/_internal/avatar.js +0 -3
- package/esm/_internal/avatar.js.map +1 -1
- package/esm/_internal/comment-block.js +0 -3
- package/esm/_internal/comment-block.js.map +1 -1
- package/esm/_internal/image-block.js +0 -3
- package/esm/_internal/image-block.js.map +1 -1
- package/esm/_internal/link-preview.js +0 -3
- package/esm/_internal/link-preview.js.map +1 -1
- package/esm/_internal/mdi.js +2 -2
- package/esm/_internal/mdi.js.map +1 -1
- package/esm/_internal/mosaic.js +0 -3
- package/esm/_internal/mosaic.js.map +1 -1
- package/esm/_internal/post-block.js +0 -3
- package/esm/_internal/post-block.js.map +1 -1
- package/esm/_internal/slider.js +1 -2
- package/esm/_internal/slider.js.map +1 -1
- package/esm/_internal/thumbnail.js +1 -4
- package/esm/_internal/thumbnail.js.map +1 -1
- package/esm/_internal/types.js +1 -0
- package/esm/_internal/types.js.map +1 -1
- package/esm/_internal/user-block.js +2 -3
- package/esm/_internal/user-block.js.map +1 -1
- package/esm/index.js +2 -4
- package/esm/index.js.map +1 -1
- package/package.json +4 -4
- package/src/components/avatar/Avatar.stories.tsx +30 -53
- package/src/components/avatar/Avatar.tsx +9 -0
- package/src/components/avatar/__snapshots__/Avatar.test.tsx.snap +220 -357
- package/src/components/image-block/__snapshots__/ImageBlock.test.tsx.snap +1 -1
- package/src/components/mosaic/__snapshots__/Mosaic.test.tsx.snap +30 -30
- package/src/components/post-block/__snapshots__/PostBlock.test.tsx.snap +1 -1
- package/src/components/slideshow/__snapshots__/Slideshow.test.tsx.snap +10 -10
- package/src/components/table/__snapshots__/Table.test.tsx.snap +3 -3
- package/src/components/thumbnail/Thumbnail.stories.tsx +428 -52
- package/src/components/thumbnail/Thumbnail.test.tsx +8 -2
- package/src/components/thumbnail/Thumbnail.tsx +84 -47
- package/src/components/thumbnail/__snapshots__/Thumbnail.test.tsx.snap +28 -81
- package/src/components/thumbnail/index.ts +1 -0
- package/src/components/thumbnail/useFocusPointStyle.tsx +89 -0
- package/src/components/thumbnail/useImageLoad.ts +24 -23
- package/src/components/tooltip/Tooltip.stories.tsx +7 -4
- package/src/components/tooltip/useInjectTooltipRef.tsx +1 -3
- package/src/components/user-block/UserBlock.stories.tsx +65 -105
- package/src/components/user-block/UserBlock.test.tsx +6 -0
- package/src/components/user-block/UserBlock.tsx +50 -25
- package/src/components/user-block/__snapshots__/UserBlock.test.tsx.snap +113 -144
- package/src/stories/generated/Badge/Demos.stories.tsx +1 -0
- package/src/stories/generated/Flag/Demos.stories.tsx +6 -0
- package/src/stories/generated/List/Demos.stories.tsx +2 -0
- package/src/stories/generated/Thumbnail/Demos.stories.tsx +1 -0
- package/src/stories/knobs/focusKnob.ts +1 -1
- package/src/stories/knobs/image.ts +35 -3
- package/src/stories/utils/CustomLink.tsx +7 -0
- package/types.d.ts +21 -4
- package/esm/_internal/clamp.js +0 -22
- package/esm/_internal/clamp.js.map +0 -1
- package/src/components/thumbnail/useClickable.ts +0 -26
- package/src/components/thumbnail/useFocusPoint.ts +0 -154
|
@@ -1,116 +1,76 @@
|
|
|
1
|
-
import { mdiStar } from '@lumx/icons';
|
|
2
|
-
import { Badge, ColorPalette, Icon, List, ListItem, Size } from '@lumx/react';
|
|
3
|
-
import { AVATAR_IMAGES, avatarImageKnob } from '@lumx/react/stories/knobs/image';
|
|
4
1
|
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { mdiStar } from '@lumx/icons';
|
|
4
|
+
import { Badge, ColorPalette, Icon, Size } from '@lumx/react';
|
|
5
|
+
import { avatarImageKnob } from '@lumx/react/stories/knobs/image';
|
|
6
|
+
import { CustomLink } from '@lumx/react/stories/utils/CustomLink';
|
|
7
|
+
|
|
5
8
|
import { UserBlock } from './UserBlock';
|
|
6
9
|
|
|
7
10
|
export default { title: 'LumX components/user-block/UserBlock' };
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
const logAction = (action: string) => () => console.log(action);
|
|
13
|
+
const sizes = [Size.s, Size.m, Size.l];
|
|
14
|
+
|
|
15
|
+
export const Default = ({ theme }: any) => (
|
|
16
|
+
<UserBlock
|
|
17
|
+
theme={theme}
|
|
18
|
+
name="Emmitt O. Lum"
|
|
19
|
+
fields={['Creative developer', 'Denpasar']}
|
|
20
|
+
avatarProps={{ image: avatarImageKnob(), alt: 'Avatar' }}
|
|
21
|
+
onMouseEnter={logAction('Mouse entered')}
|
|
22
|
+
onMouseLeave={logAction('Mouse left')}
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
export const Sizes = ({ theme }: any) =>
|
|
27
|
+
sizes.map((size) => (
|
|
28
|
+
<UserBlock
|
|
29
|
+
key={size}
|
|
30
|
+
theme={theme}
|
|
31
|
+
name="Emmitt O. Lum"
|
|
32
|
+
fields={['Creative developer', 'Denpasar']}
|
|
33
|
+
avatarProps={{ image: avatarImageKnob(), alt: 'Avatar' }}
|
|
34
|
+
size={size}
|
|
35
|
+
onMouseEnter={logAction('Mouse entered')}
|
|
36
|
+
onMouseLeave={logAction('Mouse left')}
|
|
37
|
+
/>
|
|
23
38
|
));
|
|
24
|
-
};
|
|
25
39
|
|
|
26
|
-
export const
|
|
27
|
-
const
|
|
40
|
+
export const Clickable = ({ theme }: any) => {
|
|
41
|
+
const baseProps = {
|
|
42
|
+
theme,
|
|
43
|
+
name: 'Emmitt O. Lum',
|
|
44
|
+
fields: ['Creative developer', 'Denpasar'],
|
|
45
|
+
avatarProps: { image: avatarImageKnob(), alt: 'Avatar' },
|
|
46
|
+
} as any;
|
|
28
47
|
return (
|
|
29
|
-
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
fields={['Creative developer', 'Denpasar']}
|
|
33
|
-
avatarProps={{
|
|
34
|
-
image: avatarImageKnob(),
|
|
35
|
-
alt: 'Avatar',
|
|
36
|
-
badge: (
|
|
37
|
-
<Badge color={ColorPalette.blue}>
|
|
38
|
-
<Icon icon={mdiStar} />
|
|
39
|
-
</Badge>
|
|
40
|
-
),
|
|
41
|
-
}}
|
|
42
|
-
size={Size.m}
|
|
43
|
-
onMouseEnter={logAction('Mouse entered')}
|
|
44
|
-
onMouseLeave={logAction('Mouse left')}
|
|
45
|
-
onClick={logAction('UserBlock clicked')}
|
|
46
|
-
/>
|
|
47
|
-
</div>
|
|
48
|
-
);
|
|
49
|
-
};
|
|
48
|
+
<>
|
|
49
|
+
<p>As a button</p>
|
|
50
|
+
<UserBlock {...baseProps} onClick={logAction('UserBlock clicked')} />
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
<UserBlock
|
|
58
|
-
name="Emmitt O. Lum"
|
|
59
|
-
fields={['Creative developer', 'Denpasar']}
|
|
60
|
-
avatarProps={{
|
|
61
|
-
image: avatarImageKnob('Avatar 1', AVATAR_IMAGES.avatar1),
|
|
62
|
-
alt: 'Avatar',
|
|
63
|
-
badge: (
|
|
64
|
-
<Badge color={ColorPalette.blue}>
|
|
65
|
-
<Icon icon={mdiStar} />
|
|
66
|
-
</Badge>
|
|
67
|
-
),
|
|
68
|
-
}}
|
|
69
|
-
size={Size.m}
|
|
70
|
-
onMouseEnter={logAction('Mouse entered')}
|
|
71
|
-
onMouseLeave={logAction('Mouse left')}
|
|
72
|
-
onClick={logAction('UserBlock clicked')}
|
|
73
|
-
/>
|
|
74
|
-
</ListItem>
|
|
75
|
-
<ListItem className="lumx-color-background-dark-L6" size={Size.big}>
|
|
76
|
-
<UserBlock
|
|
77
|
-
name="Emmitt O. Lum"
|
|
78
|
-
fields={['Creative developer', 'Denpasar']}
|
|
79
|
-
avatarProps={{
|
|
80
|
-
image: avatarImageKnob('Avatar 2', AVATAR_IMAGES.avatar2),
|
|
81
|
-
alt: 'Avatar',
|
|
82
|
-
badge: (
|
|
83
|
-
<Badge color={ColorPalette.blue}>
|
|
84
|
-
<Icon icon={mdiStar} />
|
|
85
|
-
</Badge>
|
|
86
|
-
),
|
|
87
|
-
}}
|
|
88
|
-
size={Size.m}
|
|
89
|
-
onMouseEnter={logAction('Mouse entered')}
|
|
90
|
-
onMouseLeave={logAction('Mouse left')}
|
|
91
|
-
onClick={logAction('UserBlock clicked')}
|
|
92
|
-
/>
|
|
93
|
-
</ListItem>
|
|
94
|
-
<ListItem className="lumx-color-background-dark-L6" size={Size.big}>
|
|
95
|
-
<UserBlock
|
|
96
|
-
name="Emmitt O. Lum"
|
|
97
|
-
fields={['Creative developer', 'Denpasar']}
|
|
98
|
-
avatarProps={{
|
|
99
|
-
image: avatarImageKnob('Avatar 3', AVATAR_IMAGES.avatar3),
|
|
100
|
-
alt: 'Avatar',
|
|
101
|
-
badge: (
|
|
102
|
-
<Badge color={ColorPalette.blue}>
|
|
103
|
-
<Icon icon={mdiStar} />
|
|
104
|
-
</Badge>
|
|
105
|
-
),
|
|
106
|
-
}}
|
|
107
|
-
size={Size.m}
|
|
108
|
-
onMouseEnter={logAction('Mouse entered')}
|
|
109
|
-
onMouseLeave={logAction('Mouse left')}
|
|
110
|
-
onClick={logAction('UserBlock clicked')}
|
|
111
|
-
/>
|
|
112
|
-
</ListItem>
|
|
113
|
-
</List>
|
|
114
|
-
</div>
|
|
52
|
+
<p>As a link</p>
|
|
53
|
+
<UserBlock {...baseProps} linkProps={{ href: 'https://example.com' }} />
|
|
54
|
+
|
|
55
|
+
<p>As a custom link component</p>
|
|
56
|
+
<UserBlock {...baseProps} linkAs={CustomLink} />
|
|
57
|
+
</>
|
|
115
58
|
);
|
|
116
59
|
};
|
|
60
|
+
|
|
61
|
+
export const WithBadge = ({ theme }: any) => (
|
|
62
|
+
<UserBlock
|
|
63
|
+
theme={theme}
|
|
64
|
+
name="Emmitt O. Lum"
|
|
65
|
+
fields={['Creative developer', 'Denpasar']}
|
|
66
|
+
avatarProps={{
|
|
67
|
+
image: avatarImageKnob(),
|
|
68
|
+
alt: 'Avatar',
|
|
69
|
+
badge: (
|
|
70
|
+
<Badge color={ColorPalette.blue}>
|
|
71
|
+
<Icon icon={mdiStar} />
|
|
72
|
+
</Badge>
|
|
73
|
+
),
|
|
74
|
+
}}
|
|
75
|
+
/>
|
|
76
|
+
);
|
|
@@ -25,6 +25,12 @@ describe(`<${UserBlock.displayName}>`, () => {
|
|
|
25
25
|
// 1. Test render via snapshot.
|
|
26
26
|
describe('Snapshots and structure', () => {
|
|
27
27
|
itShouldRenderStories(stories, UserBlock);
|
|
28
|
+
|
|
29
|
+
it('should forward name props', () => {
|
|
30
|
+
const { wrapper } = setup({ name: 'John Doe', nameProps: { 'data-custom-attribute': true } });
|
|
31
|
+
|
|
32
|
+
expect(wrapper.find('.lumx-user-block__name[data-custom-attribute]')).toHaveLength(1);
|
|
33
|
+
});
|
|
28
34
|
});
|
|
29
35
|
|
|
30
36
|
// Common tests suite.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { forwardRef, ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
import isEmpty from 'lodash/isEmpty';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
|
|
5
|
-
import { Avatar, Orientation, Size, Theme } from '@lumx/react';
|
|
6
|
-
|
|
5
|
+
import { Avatar, ColorPalette, Link, Orientation, Size, Theme } from '@lumx/react';
|
|
7
6
|
import { Comp, GenericProps, getRootClassName, handleBasicClasses } from '@lumx/react/utils';
|
|
7
|
+
|
|
8
8
|
import { AvatarProps } from '../avatar/Avatar';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -18,16 +18,22 @@ export type UserBlockSize = Extract<Size, 's' | 'm' | 'l'>;
|
|
|
18
18
|
export interface UserBlockProps extends GenericProps {
|
|
19
19
|
/** Props to pass to the avatar. */
|
|
20
20
|
avatarProps?: AvatarProps;
|
|
21
|
-
/** Simple action toolbar content. */
|
|
22
|
-
simpleAction?: ReactNode;
|
|
23
|
-
/** Multiple action toolbar content. */
|
|
24
|
-
multipleActions?: ReactNode;
|
|
25
21
|
/** Additional fields used to describe the user. */
|
|
26
22
|
fields?: string[];
|
|
23
|
+
/** Props to pass to the link wrapping the avatar thumbnail. */
|
|
24
|
+
linkProps?: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
|
|
25
|
+
/** Custom react component for the link (can be used to inject react router Link). */
|
|
26
|
+
linkAs?: 'a' | any;
|
|
27
|
+
/** Multiple action toolbar content. */
|
|
28
|
+
multipleActions?: ReactNode;
|
|
27
29
|
/** User name. */
|
|
28
30
|
name?: string;
|
|
31
|
+
/** Props to pass to the name block. */
|
|
32
|
+
nameProps?: GenericProps;
|
|
29
33
|
/** Orientation. */
|
|
30
34
|
orientation?: Orientation;
|
|
35
|
+
/** Simple action toolbar content. */
|
|
36
|
+
simpleAction?: ReactNode;
|
|
31
37
|
/** Size variant. */
|
|
32
38
|
size?: UserBlockSize;
|
|
33
39
|
/** Theme adapting the component to light or dark background. */
|
|
@@ -71,8 +77,11 @@ export const UserBlock: Comp<UserBlockProps, HTMLDivElement> = forwardRef((props
|
|
|
71
77
|
avatarProps,
|
|
72
78
|
className,
|
|
73
79
|
fields,
|
|
80
|
+
linkProps,
|
|
81
|
+
linkAs,
|
|
74
82
|
multipleActions,
|
|
75
83
|
name,
|
|
84
|
+
nameProps,
|
|
76
85
|
onClick,
|
|
77
86
|
onMouseEnter,
|
|
78
87
|
onMouseLeave,
|
|
@@ -91,18 +100,34 @@ export const UserBlock: Comp<UserBlockProps, HTMLDivElement> = forwardRef((props
|
|
|
91
100
|
|
|
92
101
|
const shouldDisplayActions: boolean = orientation === Orientation.vertical;
|
|
93
102
|
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
103
|
+
const isLink = Boolean(linkProps?.href || linkAs);
|
|
104
|
+
const isClickable = !!onClick || isLink;
|
|
105
|
+
|
|
106
|
+
const nameBlock: ReactNode = React.useMemo(() => {
|
|
107
|
+
if (isEmpty(name)) {
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
let NameComponent: any = 'span';
|
|
111
|
+
const nProps: any = {
|
|
112
|
+
...nameProps,
|
|
113
|
+
className: classNames(`${CLASSNAME}__name`, linkProps?.className, nameProps?.className),
|
|
114
|
+
};
|
|
115
|
+
if (isClickable) {
|
|
116
|
+
NameComponent = Link;
|
|
117
|
+
Object.assign(nProps, {
|
|
118
|
+
...linkProps,
|
|
119
|
+
linkAs,
|
|
120
|
+
color: ColorPalette.dark,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
return <NameComponent {...nProps}>{name}</NameComponent>;
|
|
124
|
+
}, [isClickable, linkAs, linkProps, name, nameProps]);
|
|
100
125
|
|
|
101
126
|
const fieldsBlock: ReactNode = fields && componentSize !== Size.s && (
|
|
102
127
|
<div className={`${CLASSNAME}__fields`}>
|
|
103
|
-
{fields.map((
|
|
128
|
+
{fields.map((field: string, idx: number) => (
|
|
104
129
|
<span key={idx} className={`${CLASSNAME}__field`}>
|
|
105
|
-
{
|
|
130
|
+
{field}
|
|
106
131
|
</span>
|
|
107
132
|
))}
|
|
108
133
|
</div>
|
|
@@ -114,21 +139,21 @@ export const UserBlock: Comp<UserBlockProps, HTMLDivElement> = forwardRef((props
|
|
|
114
139
|
{...forwardedProps}
|
|
115
140
|
className={classNames(
|
|
116
141
|
className,
|
|
117
|
-
handleBasicClasses({ prefix: CLASSNAME, orientation, size: componentSize, theme }),
|
|
142
|
+
handleBasicClasses({ prefix: CLASSNAME, orientation, size: componentSize, theme, isClickable }),
|
|
118
143
|
)}
|
|
119
144
|
onMouseLeave={onMouseLeave}
|
|
120
145
|
onMouseEnter={onMouseEnter}
|
|
121
146
|
>
|
|
122
147
|
{avatarProps && (
|
|
123
|
-
<
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
148
|
+
<Avatar
|
|
149
|
+
linkAs={linkAs}
|
|
150
|
+
linkProps={linkProps}
|
|
151
|
+
{...avatarProps}
|
|
152
|
+
className={classNames(`${CLASSNAME}__avatar`, avatarProps.className)}
|
|
153
|
+
size={componentSize}
|
|
154
|
+
onClick={onClick}
|
|
155
|
+
theme={theme}
|
|
156
|
+
/>
|
|
132
157
|
)}
|
|
133
158
|
{(fields || name) && (
|
|
134
159
|
<div className={`${CLASSNAME}__wrapper`}>
|
|
@@ -1,43 +1,27 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`<UserBlock> Snapshots and structure should render story '
|
|
3
|
+
exports[`<UserBlock> Snapshots and structure should render story 'Clickable' 1`] = `
|
|
4
4
|
Array [
|
|
5
5
|
<div
|
|
6
|
-
className="lumx-user-block lumx-user-block--orientation-horizontal lumx-user-block--size-m lumx-user-block--theme-light"
|
|
7
|
-
onMouseEnter={[Function]}
|
|
8
|
-
onMouseLeave={[Function]}
|
|
6
|
+
className="lumx-user-block lumx-user-block--orientation-horizontal lumx-user-block--size-m lumx-user-block--theme-light lumx-user-block--is-clickable"
|
|
9
7
|
>
|
|
10
|
-
<
|
|
8
|
+
<Avatar
|
|
9
|
+
alt="Avatar"
|
|
11
10
|
className="lumx-user-block__avatar"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
color="blue"
|
|
18
|
-
>
|
|
19
|
-
<Icon
|
|
20
|
-
icon="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z"
|
|
21
|
-
/>
|
|
22
|
-
</Badge>
|
|
23
|
-
}
|
|
24
|
-
image="/demo-assets/avatar1.jpg"
|
|
25
|
-
onClick={[Function]}
|
|
26
|
-
size="m"
|
|
27
|
-
tabIndex={0}
|
|
28
|
-
theme="light"
|
|
29
|
-
/>
|
|
30
|
-
</div>
|
|
11
|
+
image="/demo-assets/avatar1.jpg"
|
|
12
|
+
onClick={[Function]}
|
|
13
|
+
size="m"
|
|
14
|
+
theme="light"
|
|
15
|
+
/>
|
|
31
16
|
<div
|
|
32
17
|
className="lumx-user-block__wrapper"
|
|
33
18
|
>
|
|
34
|
-
<
|
|
19
|
+
<Link
|
|
35
20
|
className="lumx-user-block__name"
|
|
36
|
-
|
|
37
|
-
tabIndex={0}
|
|
21
|
+
color="dark"
|
|
38
22
|
>
|
|
39
23
|
Emmitt O. Lum
|
|
40
|
-
</
|
|
24
|
+
</Link>
|
|
41
25
|
<div
|
|
42
26
|
className="lumx-user-block__fields"
|
|
43
27
|
>
|
|
@@ -57,41 +41,30 @@ Array [
|
|
|
57
41
|
</div>
|
|
58
42
|
</div>,
|
|
59
43
|
<div
|
|
60
|
-
className="lumx-user-block lumx-user-block--orientation-horizontal lumx-user-block--size-m lumx-user-block--theme-light"
|
|
61
|
-
onMouseEnter={[Function]}
|
|
62
|
-
onMouseLeave={[Function]}
|
|
44
|
+
className="lumx-user-block lumx-user-block--orientation-horizontal lumx-user-block--size-m lumx-user-block--theme-light lumx-user-block--is-clickable"
|
|
63
45
|
>
|
|
64
|
-
<
|
|
46
|
+
<Avatar
|
|
47
|
+
alt="Avatar"
|
|
65
48
|
className="lumx-user-block__avatar"
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<Badge
|
|
71
|
-
color="blue"
|
|
72
|
-
>
|
|
73
|
-
<Icon
|
|
74
|
-
icon="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z"
|
|
75
|
-
/>
|
|
76
|
-
</Badge>
|
|
49
|
+
image="/demo-assets/avatar1.jpg"
|
|
50
|
+
linkProps={
|
|
51
|
+
Object {
|
|
52
|
+
"href": "https://example.com",
|
|
77
53
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
theme="light"
|
|
83
|
-
/>
|
|
84
|
-
</div>
|
|
54
|
+
}
|
|
55
|
+
size="m"
|
|
56
|
+
theme="light"
|
|
57
|
+
/>
|
|
85
58
|
<div
|
|
86
59
|
className="lumx-user-block__wrapper"
|
|
87
60
|
>
|
|
88
|
-
<
|
|
61
|
+
<Link
|
|
89
62
|
className="lumx-user-block__name"
|
|
90
|
-
|
|
91
|
-
|
|
63
|
+
color="dark"
|
|
64
|
+
href="https://example.com"
|
|
92
65
|
>
|
|
93
66
|
Emmitt O. Lum
|
|
94
|
-
</
|
|
67
|
+
</Link>
|
|
95
68
|
<div
|
|
96
69
|
className="lumx-user-block__fields"
|
|
97
70
|
>
|
|
@@ -111,41 +84,26 @@ Array [
|
|
|
111
84
|
</div>
|
|
112
85
|
</div>,
|
|
113
86
|
<div
|
|
114
|
-
className="lumx-user-block lumx-user-block--orientation-horizontal lumx-user-block--size-m lumx-user-block--theme-light"
|
|
115
|
-
onMouseEnter={[Function]}
|
|
116
|
-
onMouseLeave={[Function]}
|
|
87
|
+
className="lumx-user-block lumx-user-block--orientation-horizontal lumx-user-block--size-m lumx-user-block--theme-light lumx-user-block--is-clickable"
|
|
117
88
|
>
|
|
118
|
-
<
|
|
89
|
+
<Avatar
|
|
90
|
+
alt="Avatar"
|
|
119
91
|
className="lumx-user-block__avatar"
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
color="blue"
|
|
126
|
-
>
|
|
127
|
-
<Icon
|
|
128
|
-
icon="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z"
|
|
129
|
-
/>
|
|
130
|
-
</Badge>
|
|
131
|
-
}
|
|
132
|
-
image="/demo-assets/avatar3.jpg"
|
|
133
|
-
onClick={[Function]}
|
|
134
|
-
size="m"
|
|
135
|
-
tabIndex={0}
|
|
136
|
-
theme="light"
|
|
137
|
-
/>
|
|
138
|
-
</div>
|
|
92
|
+
image="/demo-assets/avatar1.jpg"
|
|
93
|
+
linkAs={[Function]}
|
|
94
|
+
size="m"
|
|
95
|
+
theme="light"
|
|
96
|
+
/>
|
|
139
97
|
<div
|
|
140
98
|
className="lumx-user-block__wrapper"
|
|
141
99
|
>
|
|
142
|
-
<
|
|
100
|
+
<Link
|
|
143
101
|
className="lumx-user-block__name"
|
|
144
|
-
|
|
145
|
-
|
|
102
|
+
color="dark"
|
|
103
|
+
linkAs={[Function]}
|
|
146
104
|
>
|
|
147
105
|
Emmitt O. Lum
|
|
148
|
-
</
|
|
106
|
+
</Link>
|
|
149
107
|
<div
|
|
150
108
|
className="lumx-user-block__fields"
|
|
151
109
|
>
|
|
@@ -167,6 +125,47 @@ Array [
|
|
|
167
125
|
]
|
|
168
126
|
`;
|
|
169
127
|
|
|
128
|
+
exports[`<UserBlock> Snapshots and structure should render story 'Default' 1`] = `
|
|
129
|
+
<div
|
|
130
|
+
className="lumx-user-block lumx-user-block--orientation-horizontal lumx-user-block--size-m lumx-user-block--theme-light"
|
|
131
|
+
onMouseEnter={[Function]}
|
|
132
|
+
onMouseLeave={[Function]}
|
|
133
|
+
>
|
|
134
|
+
<Avatar
|
|
135
|
+
alt="Avatar"
|
|
136
|
+
className="lumx-user-block__avatar"
|
|
137
|
+
image="/demo-assets/avatar1.jpg"
|
|
138
|
+
size="m"
|
|
139
|
+
theme="light"
|
|
140
|
+
/>
|
|
141
|
+
<div
|
|
142
|
+
className="lumx-user-block__wrapper"
|
|
143
|
+
>
|
|
144
|
+
<span
|
|
145
|
+
className="lumx-user-block__name"
|
|
146
|
+
>
|
|
147
|
+
Emmitt O. Lum
|
|
148
|
+
</span>
|
|
149
|
+
<div
|
|
150
|
+
className="lumx-user-block__fields"
|
|
151
|
+
>
|
|
152
|
+
<span
|
|
153
|
+
className="lumx-user-block__field"
|
|
154
|
+
key="0"
|
|
155
|
+
>
|
|
156
|
+
Creative developer
|
|
157
|
+
</span>
|
|
158
|
+
<span
|
|
159
|
+
className="lumx-user-block__field"
|
|
160
|
+
key="1"
|
|
161
|
+
>
|
|
162
|
+
Denpasar
|
|
163
|
+
</span>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
`;
|
|
168
|
+
|
|
170
169
|
exports[`<UserBlock> Snapshots and structure should render story 'Sizes' 1`] = `
|
|
171
170
|
Array [
|
|
172
171
|
<div
|
|
@@ -174,25 +173,18 @@ Array [
|
|
|
174
173
|
onMouseEnter={[Function]}
|
|
175
174
|
onMouseLeave={[Function]}
|
|
176
175
|
>
|
|
177
|
-
<
|
|
176
|
+
<Avatar
|
|
177
|
+
alt="Avatar"
|
|
178
178
|
className="lumx-user-block__avatar"
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
onClick={[Function]}
|
|
184
|
-
size="s"
|
|
185
|
-
tabIndex={0}
|
|
186
|
-
theme="light"
|
|
187
|
-
/>
|
|
188
|
-
</div>
|
|
179
|
+
image="/demo-assets/avatar1.jpg"
|
|
180
|
+
size="s"
|
|
181
|
+
theme="light"
|
|
182
|
+
/>
|
|
189
183
|
<div
|
|
190
184
|
className="lumx-user-block__wrapper"
|
|
191
185
|
>
|
|
192
186
|
<span
|
|
193
187
|
className="lumx-user-block__name"
|
|
194
|
-
onClick={[Function]}
|
|
195
|
-
tabIndex={0}
|
|
196
188
|
>
|
|
197
189
|
Emmitt O. Lum
|
|
198
190
|
</span>
|
|
@@ -203,25 +195,18 @@ Array [
|
|
|
203
195
|
onMouseEnter={[Function]}
|
|
204
196
|
onMouseLeave={[Function]}
|
|
205
197
|
>
|
|
206
|
-
<
|
|
198
|
+
<Avatar
|
|
199
|
+
alt="Avatar"
|
|
207
200
|
className="lumx-user-block__avatar"
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
onClick={[Function]}
|
|
213
|
-
size="m"
|
|
214
|
-
tabIndex={0}
|
|
215
|
-
theme="light"
|
|
216
|
-
/>
|
|
217
|
-
</div>
|
|
201
|
+
image="/demo-assets/avatar1.jpg"
|
|
202
|
+
size="m"
|
|
203
|
+
theme="light"
|
|
204
|
+
/>
|
|
218
205
|
<div
|
|
219
206
|
className="lumx-user-block__wrapper"
|
|
220
207
|
>
|
|
221
208
|
<span
|
|
222
209
|
className="lumx-user-block__name"
|
|
223
|
-
onClick={[Function]}
|
|
224
|
-
tabIndex={0}
|
|
225
210
|
>
|
|
226
211
|
Emmitt O. Lum
|
|
227
212
|
</span>
|
|
@@ -248,25 +233,18 @@ Array [
|
|
|
248
233
|
onMouseEnter={[Function]}
|
|
249
234
|
onMouseLeave={[Function]}
|
|
250
235
|
>
|
|
251
|
-
<
|
|
236
|
+
<Avatar
|
|
237
|
+
alt="Avatar"
|
|
252
238
|
className="lumx-user-block__avatar"
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
onClick={[Function]}
|
|
258
|
-
size="l"
|
|
259
|
-
tabIndex={0}
|
|
260
|
-
theme="light"
|
|
261
|
-
/>
|
|
262
|
-
</div>
|
|
239
|
+
image="/demo-assets/avatar1.jpg"
|
|
240
|
+
size="l"
|
|
241
|
+
theme="light"
|
|
242
|
+
/>
|
|
263
243
|
<div
|
|
264
244
|
className="lumx-user-block__wrapper"
|
|
265
245
|
>
|
|
266
246
|
<span
|
|
267
247
|
className="lumx-user-block__name"
|
|
268
|
-
onClick={[Function]}
|
|
269
|
-
tabIndex={0}
|
|
270
248
|
>
|
|
271
249
|
Emmitt O. Lum
|
|
272
250
|
</span>
|
|
@@ -294,37 +272,28 @@ Array [
|
|
|
294
272
|
exports[`<UserBlock> Snapshots and structure should render story 'WithBadge' 1`] = `
|
|
295
273
|
<div
|
|
296
274
|
className="lumx-user-block lumx-user-block--orientation-horizontal lumx-user-block--size-m lumx-user-block--theme-light"
|
|
297
|
-
onMouseEnter={[Function]}
|
|
298
|
-
onMouseLeave={[Function]}
|
|
299
275
|
>
|
|
300
|
-
<
|
|
276
|
+
<Avatar
|
|
277
|
+
alt="Avatar"
|
|
278
|
+
badge={
|
|
279
|
+
<Badge
|
|
280
|
+
color="blue"
|
|
281
|
+
>
|
|
282
|
+
<Icon
|
|
283
|
+
icon="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z"
|
|
284
|
+
/>
|
|
285
|
+
</Badge>
|
|
286
|
+
}
|
|
301
287
|
className="lumx-user-block__avatar"
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
<Badge
|
|
307
|
-
color="blue"
|
|
308
|
-
>
|
|
309
|
-
<Icon
|
|
310
|
-
icon="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z"
|
|
311
|
-
/>
|
|
312
|
-
</Badge>
|
|
313
|
-
}
|
|
314
|
-
image="/demo-assets/avatar1.jpg"
|
|
315
|
-
onClick={[Function]}
|
|
316
|
-
size="m"
|
|
317
|
-
tabIndex={0}
|
|
318
|
-
theme="light"
|
|
319
|
-
/>
|
|
320
|
-
</div>
|
|
288
|
+
image="/demo-assets/avatar1.jpg"
|
|
289
|
+
size="m"
|
|
290
|
+
theme="light"
|
|
291
|
+
/>
|
|
321
292
|
<div
|
|
322
293
|
className="lumx-user-block__wrapper"
|
|
323
294
|
>
|
|
324
295
|
<span
|
|
325
296
|
className="lumx-user-block__name"
|
|
326
|
-
onClick={[Function]}
|
|
327
|
-
tabIndex={0}
|
|
328
297
|
>
|
|
329
298
|
Emmitt O. Lum
|
|
330
299
|
</span>
|