@atlaskit/media-avatar-picker 24.6.5 → 24.6.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/CHANGELOG.md +12 -0
- package/compass.yml +3 -2
- package/dist/cjs/avatar-list/index.js +4 -1
- package/dist/cjs/avatar-list/styles.js +6 -0
- package/dist/cjs/avatar-picker-dialog/SubmitErrorDialog.js +17 -13
- package/dist/cjs/avatar-picker-dialog/index.js +9 -6
- package/dist/cjs/avatar-picker-dialog/styles.js +10 -0
- package/dist/cjs/image-cropper/index.js +36 -36
- package/dist/cjs/image-navigator/dragZone.js +2 -0
- package/dist/cjs/image-navigator/index.js +24 -18
- package/dist/cjs/image-navigator/slider.js +30 -27
- package/dist/cjs/image-navigator/styles.js +32 -2
- package/dist/cjs/image-placer/containerWrapper.js +4 -0
- package/dist/cjs/image-placer/imagePlacerErrorWrapper.js +7 -3
- package/dist/cjs/image-placer/imageWrapper.js +12 -8
- package/dist/cjs/image-placer/index.js +29 -26
- package/dist/cjs/image-placer/margin.js +3 -1
- package/dist/cjs/image-placer/styles.js +20 -0
- package/dist/cjs/predefined-avatar-list/index.js +24 -20
- package/dist/cjs/predefined-avatar-list/styles.js +2 -2
- package/dist/cjs/predefined-avatar-view/index.js +27 -23
- package/dist/cjs/predefined-avatar-view/styles.js +13 -0
- package/dist/cjs/styles.js +9 -0
- package/dist/es2019/avatar-list/index.js +4 -1
- package/dist/es2019/avatar-list/styles.js +6 -0
- package/dist/es2019/avatar-picker-dialog/SubmitErrorDialog.js +17 -13
- package/dist/es2019/avatar-picker-dialog/index.js +9 -5
- package/dist/es2019/avatar-picker-dialog/styles.js +10 -0
- package/dist/es2019/image-cropper/index.js +31 -35
- package/dist/es2019/image-navigator/dragZone.js +2 -0
- package/dist/es2019/image-navigator/index.js +24 -17
- package/dist/es2019/image-navigator/slider.js +26 -22
- package/dist/es2019/image-navigator/styles.js +32 -2
- package/dist/es2019/image-placer/containerWrapper.js +4 -0
- package/dist/es2019/image-placer/imagePlacerErrorWrapper.js +4 -1
- package/dist/es2019/image-placer/imageWrapper.js +4 -1
- package/dist/es2019/image-placer/index.js +29 -25
- package/dist/es2019/image-placer/margin.js +3 -0
- package/dist/es2019/image-placer/styles.js +19 -0
- package/dist/es2019/predefined-avatar-list/index.js +24 -20
- package/dist/es2019/predefined-avatar-list/styles.js +2 -1
- package/dist/es2019/predefined-avatar-view/index.js +27 -23
- package/dist/es2019/predefined-avatar-view/styles.js +13 -0
- package/dist/es2019/styles.js +9 -0
- package/dist/esm/avatar-list/index.js +4 -1
- package/dist/esm/avatar-list/styles.js +6 -0
- package/dist/esm/avatar-picker-dialog/SubmitErrorDialog.js +17 -13
- package/dist/esm/avatar-picker-dialog/index.js +9 -5
- package/dist/esm/avatar-picker-dialog/styles.js +10 -0
- package/dist/esm/image-cropper/index.js +33 -35
- package/dist/esm/image-navigator/dragZone.js +2 -0
- package/dist/esm/image-navigator/index.js +24 -17
- package/dist/esm/image-navigator/slider.js +30 -26
- package/dist/esm/image-navigator/styles.js +32 -2
- package/dist/esm/image-placer/containerWrapper.js +4 -0
- package/dist/esm/image-placer/imagePlacerErrorWrapper.js +7 -3
- package/dist/esm/image-placer/imageWrapper.js +12 -8
- package/dist/esm/image-placer/index.js +29 -25
- package/dist/esm/image-placer/margin.js +3 -0
- package/dist/esm/image-placer/styles.js +19 -0
- package/dist/esm/predefined-avatar-list/index.js +24 -20
- package/dist/esm/predefined-avatar-list/styles.js +2 -1
- package/dist/esm/predefined-avatar-view/index.js +27 -23
- package/dist/esm/predefined-avatar-view/styles.js +13 -0
- package/dist/esm/styles.js +9 -0
- package/dist/types/image-cropper/index.d.ts +1 -3
- package/dist/types-ts4.5/image-cropper/index.d.ts +1 -3
- package/example-helpers/StatefulAvatarPickerDialog.tsx +2 -0
- package/example-helpers/styles.ts +9 -0
- package/package.json +77 -77
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/**@jsx jsx */
|
|
2
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
2
3
|
import { jsx } from '@emotion/react';
|
|
3
4
|
import { AvatarList } from '../avatar-list';
|
|
4
5
|
import EditorMoreIcon from '@atlaskit/icon/glyph/editor/more';
|
|
@@ -15,24 +16,27 @@ export const PredefinedAvatarList = ({
|
|
|
15
16
|
showMoreAvatarsButtonLabel
|
|
16
17
|
}) => {
|
|
17
18
|
const intl = useIntl();
|
|
18
|
-
return
|
|
19
|
-
css
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
19
|
+
return (
|
|
20
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
21
|
+
jsx("div", {
|
|
22
|
+
css: predefinedAvatarsWrapperStyles,
|
|
23
|
+
id: "predefined-avatar-wrapper"
|
|
24
|
+
}, jsx(AvatarList, {
|
|
25
|
+
avatars: avatars,
|
|
26
|
+
selectedAvatar: selectedAvatar,
|
|
27
|
+
onItemClick: onAvatarSelected,
|
|
28
|
+
selectAvatarLabel: selectAvatarLabel
|
|
29
|
+
}), jsx(Button, {
|
|
30
|
+
"aria-label": showMoreAvatarsButtonLabel || intl.formatMessage(messages.show_more_avatars_btn_label)
|
|
31
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
32
|
+
,
|
|
33
|
+
className: "show-more-button",
|
|
34
|
+
appearance: "subtle",
|
|
35
|
+
iconAfter: jsx(EditorMoreIcon, {
|
|
36
|
+
label: "",
|
|
37
|
+
size: "large"
|
|
38
|
+
}),
|
|
39
|
+
onClick: onShowMore
|
|
40
|
+
}))
|
|
41
|
+
);
|
|
38
42
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
1
2
|
import { css } from '@emotion/react';
|
|
2
3
|
import { visuallyHiddenRadioStyles, selectedShadow, focusedShadow } from '../styles';
|
|
3
4
|
|
|
4
|
-
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression --
|
|
5
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
5
6
|
export const predefinedAvatarsWrapperStyles = css`
|
|
6
7
|
display: flex;
|
|
7
8
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/**@jsx jsx */
|
|
2
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
2
3
|
import { jsx } from '@emotion/react';
|
|
3
4
|
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
4
5
|
import { messages } from '@atlaskit/media-ui';
|
|
@@ -38,27 +39,30 @@ export const PredefinedAvatarView = ({
|
|
|
38
39
|
alt: ""
|
|
39
40
|
}));
|
|
40
41
|
});
|
|
41
|
-
return
|
|
42
|
-
css
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
42
|
+
return (
|
|
43
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
44
|
+
jsx("div", {
|
|
45
|
+
css: predefinedAvatarViewWrapperStyles,
|
|
46
|
+
id: "predefined-avatar-view-wrapper"
|
|
47
|
+
}, jsx("div", {
|
|
48
|
+
className: "header"
|
|
49
|
+
}, jsx(Button, {
|
|
50
|
+
"aria-label": intl.formatMessage(messages.avatar_picker_back_btn_label)
|
|
51
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
52
|
+
,
|
|
53
|
+
className: "back-button",
|
|
54
|
+
iconAfter: jsx(ArrowLeftIcon, {
|
|
55
|
+
label: ""
|
|
56
|
+
}),
|
|
57
|
+
onClick: onGoBack
|
|
58
|
+
}), jsx("h2", {
|
|
59
|
+
className: "description"
|
|
60
|
+
}, predefinedAvatarsText || jsx(FormattedMessage, messages.default_avatars))), jsx("div", {
|
|
61
|
+
role: "radiogroup",
|
|
62
|
+
"aria-label": selectAvatarLabel || intl.formatMessage(messages.select_an_avatar)
|
|
63
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
64
|
+
,
|
|
65
|
+
className: "body"
|
|
66
|
+
}, cards))
|
|
67
|
+
);
|
|
64
68
|
};
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
1
2
|
import { css } from '@emotion/react';
|
|
2
3
|
import { visuallyHiddenRadioStyles, selectedShadow, focusedShadow, avatarImageStyles } from '../styles';
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css, @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
3
6
|
export const largeAvatarImageStyles = css(avatarImageStyles, {
|
|
4
7
|
width: '72px',
|
|
5
8
|
height: '72px'
|
|
6
9
|
});
|
|
10
|
+
|
|
11
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
7
12
|
export const predefinedAvatarViewWrapperStyles = css({
|
|
13
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
8
14
|
'.body': {
|
|
9
15
|
display: 'flex',
|
|
10
16
|
flexFlow: 'row wrap',
|
|
@@ -14,26 +20,33 @@ export const predefinedAvatarViewWrapperStyles = css({
|
|
|
14
20
|
padding: `${"var(--ds-space-100, 8px)"} 0 0`,
|
|
15
21
|
margin: 0
|
|
16
22
|
},
|
|
23
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
17
24
|
input: visuallyHiddenRadioStyles,
|
|
25
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
18
26
|
'input:checked + img': selectedShadow,
|
|
27
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
19
28
|
'input:focus + img': focusedShadow,
|
|
29
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
20
30
|
label: {
|
|
21
31
|
paddingRight: "var(--ds-space-050, 4px)",
|
|
22
32
|
paddingLeft: "var(--ds-space-050, 4px)",
|
|
23
33
|
paddingBottom: "var(--ds-space-100, 8px)",
|
|
24
34
|
display: 'inline-flex'
|
|
25
35
|
},
|
|
36
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
26
37
|
'.header': {
|
|
27
38
|
display: 'flex',
|
|
28
39
|
alignItems: 'center',
|
|
29
40
|
paddingTop: "var(--ds-space-050, 4px)",
|
|
30
41
|
paddingBottom: "var(--ds-space-100, 8px)",
|
|
42
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
31
43
|
'.description': {
|
|
32
44
|
paddingLeft: "var(--ds-space-100, 8px)",
|
|
33
45
|
margin: 0,
|
|
34
46
|
fontSize: '14px',
|
|
35
47
|
fontWeight: 400
|
|
36
48
|
},
|
|
49
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
37
50
|
'.back-button': {
|
|
38
51
|
width: '32px',
|
|
39
52
|
height: '32px',
|
package/dist/es2019/styles.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
1
2
|
import { css } from '@emotion/react';
|
|
2
3
|
import { B200, B100 } from '@atlaskit/theme/colors';
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
3
6
|
export const avatarImageStyles = css({
|
|
4
7
|
borderRadius: "var(--ds-border-radius-100, 3px)",
|
|
5
8
|
cursor: 'pointer'
|
|
6
9
|
});
|
|
10
|
+
|
|
11
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
7
12
|
export const visuallyHiddenRadioStyles = css({
|
|
8
13
|
width: '1px',
|
|
9
14
|
height: '1px',
|
|
@@ -14,9 +19,13 @@ export const visuallyHiddenRadioStyles = css({
|
|
|
14
19
|
overflow: 'hidden',
|
|
15
20
|
whiteSpace: 'nowrap'
|
|
16
21
|
});
|
|
22
|
+
|
|
23
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
17
24
|
export const selectedShadow = css({
|
|
18
25
|
boxShadow: `0px 0px 0px 1px ${"var(--ds-border-inverse, white)"}, 0px 0px 0px 3px ${`var(--ds-border-selected, ${B200})`}`
|
|
19
26
|
});
|
|
27
|
+
|
|
28
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
20
29
|
export const focusedShadow = css({
|
|
21
30
|
boxShadow: `0px 0px 0px 1px ${"var(--ds-border-inverse, white)"}, 0px 0px 0px 3px ${`var(--ds-border-focused, ${B100})`}`
|
|
22
31
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
2
3
|
import { jsx } from '@emotion/react';
|
|
3
4
|
import { useIntl } from 'react-intl-next';
|
|
4
5
|
import { messages } from '@atlaskit/media-ui';
|
|
@@ -36,7 +37,9 @@ export var AvatarList = function AvatarList(_ref) {
|
|
|
36
37
|
});
|
|
37
38
|
return jsx("div", {
|
|
38
39
|
role: "radiogroup",
|
|
39
|
-
"aria-label": selectAvatarLabel || intl.formatMessage(messages.select_an_avatar)
|
|
40
|
+
"aria-label": selectAvatarLabel || intl.formatMessage(messages.select_an_avatar)
|
|
41
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
42
|
+
,
|
|
40
43
|
css: avatarListWrapperStyles
|
|
41
44
|
}, cards);
|
|
42
45
|
};
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
1
2
|
import { css } from '@emotion/react';
|
|
2
3
|
import { avatarImageStyles } from '../styles';
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css, @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
3
6
|
export var smallAvatarImageStyles = css(avatarImageStyles, {
|
|
4
7
|
width: "var(--ds-space-500, 40px)",
|
|
5
8
|
height: "var(--ds-space-500, 40px)"
|
|
6
9
|
});
|
|
10
|
+
|
|
11
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
7
12
|
export var avatarListWrapperStyles = css({
|
|
8
13
|
display: 'flex',
|
|
14
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
9
15
|
label: {
|
|
10
16
|
paddingRight: "var(--ds-space-050, 4px)",
|
|
11
17
|
display: 'inline-flex'
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
2
3
|
import { jsx } from '@emotion/react';
|
|
3
4
|
import { useRef, useEffect } from 'react';
|
|
4
5
|
import { R400 } from '@atlaskit/theme/colors';
|
|
@@ -15,17 +16,20 @@ export var SubmitErrorDialog = function SubmitErrorDialog() {
|
|
|
15
16
|
flagContainerRef.current.children[0].focus();
|
|
16
17
|
}
|
|
17
18
|
}, []);
|
|
18
|
-
return
|
|
19
|
-
css
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
return (
|
|
20
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
21
|
+
jsx("div", {
|
|
22
|
+
css: avatarPickerErrorStyles,
|
|
23
|
+
ref: flagContainerRef
|
|
24
|
+
}, jsx(Flag, {
|
|
25
|
+
appearance: "error",
|
|
26
|
+
icon: jsx(ErrorIcon, {
|
|
27
|
+
label: "Error",
|
|
28
|
+
secondaryColor: "var(--ds-background-danger-bold, ".concat(R400, ")")
|
|
29
|
+
}),
|
|
30
|
+
id: "avatar-picker-error",
|
|
31
|
+
key: "error",
|
|
32
|
+
title: intl.formatMessage(messages.or_select_default_avatars)
|
|
33
|
+
}))
|
|
34
|
+
);
|
|
31
35
|
};
|
|
@@ -12,6 +12,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
12
12
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
13
|
/** @jsx jsx */
|
|
14
14
|
import React, { Fragment } from 'react';
|
|
15
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
15
16
|
import { jsx } from '@emotion/react';
|
|
16
17
|
import { PureComponent } from 'react';
|
|
17
18
|
import ModalDialog, { ModalFooter, ModalBody, useModal } from '@atlaskit/modal-dialog';
|
|
@@ -47,11 +48,14 @@ export var fixedCrop = {
|
|
|
47
48
|
var HeaderContent = function HeaderContent(_ref) {
|
|
48
49
|
var title = _ref.title;
|
|
49
50
|
var modal = useModal();
|
|
50
|
-
return
|
|
51
|
-
css
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
return (
|
|
52
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
53
|
+
jsx("h1", {
|
|
54
|
+
css: modalHeaderStyles,
|
|
55
|
+
"data-test-id": "modal-header",
|
|
56
|
+
id: modal.titleId
|
|
57
|
+
}, title || jsx(FormattedMessage, messages.upload_an_avatar))
|
|
58
|
+
);
|
|
55
59
|
};
|
|
56
60
|
var altTextFieldStyles = xcss({
|
|
57
61
|
paddingTop: 'space.100',
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
1
2
|
import { css } from '@emotion/react';
|
|
3
|
+
|
|
4
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
2
5
|
export var avatarPickerErrorStyles = css({
|
|
3
6
|
margin: "0 ".concat("var(--ds-space-200, 16px)", " ", "var(--ds-space-200, 16px)")
|
|
4
7
|
});
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
5
10
|
export var formStyles = css({
|
|
6
11
|
margin: 0
|
|
7
12
|
});
|
|
13
|
+
|
|
14
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
8
15
|
export var avatarPickerViewWrapperStyles = css({
|
|
9
16
|
display: 'flex',
|
|
10
17
|
justifyContent: 'center',
|
|
@@ -12,8 +19,11 @@ export var avatarPickerViewWrapperStyles = css({
|
|
|
12
19
|
textAlign: 'center',
|
|
13
20
|
minHeight: '339px'
|
|
14
21
|
});
|
|
22
|
+
|
|
23
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
15
24
|
export var modalHeaderStyles = css({
|
|
16
25
|
// Using `&` twice to increase specificity
|
|
26
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
17
27
|
'&&': {
|
|
18
28
|
margin: "var(--ds-space-200, 16px)",
|
|
19
29
|
fontWeight: 500,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
4
|
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
@@ -7,8 +8,6 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
7
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
9
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
|
-
/** @jsx jsx */
|
|
11
|
-
import { jsx } from '@emotion/react';
|
|
12
11
|
import React from 'react';
|
|
13
12
|
import { Component } from 'react';
|
|
14
13
|
import CrossIcon from '@atlaskit/icon/glyph/cross';
|
|
@@ -16,28 +15,10 @@ import { injectIntl } from 'react-intl-next';
|
|
|
16
15
|
import { messages, MediaImage } from '@atlaskit/media-ui';
|
|
17
16
|
import { isImageRemote } from './isImageRemote';
|
|
18
17
|
import { CONTAINER_PADDING } from './styles';
|
|
19
|
-
import {
|
|
20
|
-
import { css } from '@emotion/react';
|
|
18
|
+
import { IconButton } from '@atlaskit/button/new';
|
|
21
19
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
22
20
|
import { ERROR } from '../avatar-picker-dialog';
|
|
23
21
|
import { CONTAINER_INNER_SIZE } from '../avatar-picker-dialog/layout-const';
|
|
24
|
-
var removeImageButtonStyles = css({
|
|
25
|
-
borderRadius: "var(--ds-border-radius-050, 3px)",
|
|
26
|
-
backgroundColor: 'transparent',
|
|
27
|
-
width: '24px',
|
|
28
|
-
height: '24px',
|
|
29
|
-
border: 'none',
|
|
30
|
-
cursor: 'pointer',
|
|
31
|
-
padding: 0,
|
|
32
|
-
svg: {
|
|
33
|
-
position: 'absolute',
|
|
34
|
-
top: "var(--ds-space-050, 4px)",
|
|
35
|
-
left: "var(--ds-space-050, 4px)"
|
|
36
|
-
},
|
|
37
|
-
'&:hover': {
|
|
38
|
-
backgroundColor: "var(--ds-background-neutral-hovered, ".concat(N50A, ")")
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
22
|
var removeImageContainerStyles = xcss({
|
|
42
23
|
position: 'absolute',
|
|
43
24
|
right: 'space.050',
|
|
@@ -54,9 +35,13 @@ var maskShadow = {
|
|
|
54
35
|
};
|
|
55
36
|
var maskStyles = xcss({
|
|
56
37
|
position: 'absolute',
|
|
38
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
57
39
|
top: "".concat(CONTAINER_PADDING, "px"),
|
|
40
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
58
41
|
bottom: "".concat(CONTAINER_PADDING, "px"),
|
|
42
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
59
43
|
left: "".concat(CONTAINER_PADDING, "px"),
|
|
44
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
60
45
|
right: "".concat(CONTAINER_PADDING, "px"),
|
|
61
46
|
opacity: 'opacity.disabled'
|
|
62
47
|
});
|
|
@@ -127,16 +112,23 @@ export var ImageCropper = /*#__PURE__*/function (_Component) {
|
|
|
127
112
|
onImageLoaded = _this$props3.onImageLoaded,
|
|
128
113
|
formatMessage = _this$props3.intl.formatMessage;
|
|
129
114
|
var containerDimensions = xcss({
|
|
115
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
130
116
|
width: "".concat(containerSize, "px"),
|
|
117
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
131
118
|
height: "".concat(containerSize, "px")
|
|
132
119
|
});
|
|
133
120
|
var width = imageWidth ? "".concat(imageWidth, "px") : 'auto';
|
|
134
121
|
var height = imageHeight ? "".concat(imageHeight, "px") : 'auto';
|
|
135
122
|
var imageContainerDynamicStyles = xcss({
|
|
123
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
136
124
|
width: width,
|
|
125
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
137
126
|
height: height,
|
|
127
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
138
128
|
display: width === 'auto' ? 'none' : 'block',
|
|
129
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
139
130
|
top: "".concat(top, "px"),
|
|
131
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
140
132
|
left: "".concat(left, "px")
|
|
141
133
|
});
|
|
142
134
|
var crossOrigin;
|
|
@@ -145,13 +137,13 @@ export var ImageCropper = /*#__PURE__*/function (_Component) {
|
|
|
145
137
|
} catch (e) {
|
|
146
138
|
return null;
|
|
147
139
|
}
|
|
148
|
-
return
|
|
140
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
149
141
|
id: "container",
|
|
150
142
|
xcss: [containerStyles, containerDimensions]
|
|
151
|
-
},
|
|
143
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
152
144
|
id: "image-container",
|
|
153
145
|
xcss: [imageContainerStyles, imageContainerDynamicStyles]
|
|
154
|
-
},
|
|
146
|
+
}, /*#__PURE__*/React.createElement(MediaImage, {
|
|
155
147
|
crossOrigin: crossOrigin,
|
|
156
148
|
dataURI: imageSource,
|
|
157
149
|
crop: false,
|
|
@@ -160,30 +152,36 @@ export var ImageCropper = /*#__PURE__*/function (_Component) {
|
|
|
160
152
|
onImageLoad: onImageLoaded,
|
|
161
153
|
onImageError: this.onImageError
|
|
162
154
|
})), isCircularMask ?
|
|
155
|
+
/*#__PURE__*/
|
|
163
156
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
164
|
-
|
|
157
|
+
React.createElement(Box, {
|
|
165
158
|
xcss: [maskStyles, circularMaskStyles],
|
|
166
159
|
style: maskShadow
|
|
167
160
|
}) :
|
|
161
|
+
/*#__PURE__*/
|
|
168
162
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
169
|
-
|
|
163
|
+
React.createElement(Box, {
|
|
170
164
|
xcss: [maskStyles, rectMaskStyles],
|
|
171
165
|
style: maskShadow
|
|
172
|
-
}),
|
|
166
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
173
167
|
id: "drag-overlay",
|
|
174
168
|
xcss: dragOverlayStyles,
|
|
175
169
|
onMouseDown: this.onDragStarted
|
|
176
|
-
}),
|
|
170
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
177
171
|
id: "remove-image-container",
|
|
178
172
|
xcss: removeImageContainerStyles
|
|
179
|
-
},
|
|
173
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
180
174
|
id: "remove-image-button",
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
175
|
+
icon: function icon(iconProps) {
|
|
176
|
+
return /*#__PURE__*/React.createElement(CrossIcon, _extends({}, iconProps, {
|
|
177
|
+
size: "small"
|
|
178
|
+
}));
|
|
179
|
+
},
|
|
180
|
+
onClick: onRemoveImage,
|
|
181
|
+
label: formatMessage(messages.remove_image),
|
|
182
|
+
spacing: "compact",
|
|
183
|
+
appearance: "subtle"
|
|
184
|
+
})));
|
|
187
185
|
}
|
|
188
186
|
}]);
|
|
189
187
|
return ImageCropper;
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["showBorder", "isDroppingFile", "children"];
|
|
4
4
|
/**@jsx jsx */
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
5
6
|
import { jsx } from '@emotion/react';
|
|
6
7
|
import { dragZoneStyles } from './styles';
|
|
7
8
|
export var DragZone = function DragZone(_ref) {
|
|
@@ -10,6 +11,7 @@ export var DragZone = function DragZone(_ref) {
|
|
|
10
11
|
children = _ref.children,
|
|
11
12
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
12
13
|
return jsx("div", _extends({
|
|
14
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
13
15
|
css: dragZoneStyles({
|
|
14
16
|
showBorder: showBorder,
|
|
15
17
|
isDroppingFile: isDroppingFile
|
|
@@ -12,6 +12,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
12
12
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
13
|
/** @jsx jsx */
|
|
14
14
|
import React from 'react';
|
|
15
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
15
16
|
import { jsx } from '@emotion/react';
|
|
16
17
|
import { Component } from 'react';
|
|
17
18
|
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
@@ -311,23 +312,27 @@ export var ImageNavigator = /*#__PURE__*/function (_Component) {
|
|
|
311
312
|
var _this$props3 = this.props,
|
|
312
313
|
errorMessage = _this$props3.errorMessage,
|
|
313
314
|
isLoading = _this$props3.isLoading;
|
|
314
|
-
return
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
315
|
+
return (
|
|
316
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
317
|
+
jsx("div", {
|
|
318
|
+
id: "image-uploader",
|
|
319
|
+
css: imageUploaderStyles
|
|
320
|
+
}, this.renderDragZone(), isLoading ? null : jsx("div", null, jsx("p", {
|
|
321
|
+
id: "padded-break",
|
|
322
|
+
css: paddedBreakStyles
|
|
323
|
+
}, jsx(FormattedMessage, errorMessage ? messages.try_again : messages.or)), jsx(Button, {
|
|
324
|
+
onClick: this.onUploadButtonClick,
|
|
325
|
+
isDisabled: isLoading,
|
|
326
|
+
testId: "upload-button"
|
|
327
|
+
}, jsx(FormattedMessage, messages.upload_photo), jsx("input", {
|
|
328
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
329
|
+
css: fileInputStyles,
|
|
330
|
+
type: "file",
|
|
331
|
+
id: "image-input",
|
|
332
|
+
onChange: this.onFileChange,
|
|
333
|
+
accept: ACCEPT.join(',')
|
|
334
|
+
}))))
|
|
335
|
+
);
|
|
331
336
|
}
|
|
332
337
|
}, {
|
|
333
338
|
key: "renderImageCropper",
|
|
@@ -383,6 +388,8 @@ export var ImageNavigator = /*#__PURE__*/function (_Component) {
|
|
|
383
388
|
var isLoading = this.props.isLoading;
|
|
384
389
|
var dataURI = this.dataURI;
|
|
385
390
|
var content = dataURI && !isLoading ? this.renderImageCropper(dataURI) : this.renderImageUploader();
|
|
391
|
+
|
|
392
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
386
393
|
return jsx("div", {
|
|
387
394
|
css: containerStyles
|
|
388
395
|
}, content);
|
|
@@ -7,6 +7,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
7
7
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
8
8
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
9
|
/** @jsx jsx */
|
|
10
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
11
|
import { jsx } from '@emotion/react';
|
|
11
12
|
import { Component } from 'react';
|
|
12
13
|
import FieldRange from '@atlaskit/range';
|
|
@@ -30,32 +31,35 @@ export var Slider = /*#__PURE__*/function (_Component) {
|
|
|
30
31
|
var _this$props = this.props,
|
|
31
32
|
value = _this$props.value,
|
|
32
33
|
onChange = _this$props.onChange;
|
|
33
|
-
return
|
|
34
|
-
css
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
34
|
+
return (
|
|
35
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
36
|
+
jsx("div", {
|
|
37
|
+
css: sliderWrapperStyles
|
|
38
|
+
}, jsx(Button
|
|
39
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
40
|
+
, {
|
|
41
|
+
className: "zoom_button zoom_button_small",
|
|
42
|
+
iconAfter: jsx(ScaleSmallIcon, {
|
|
43
|
+
label: "scale-small-icon"
|
|
44
|
+
}),
|
|
45
|
+
onClick: function onClick() {
|
|
46
|
+
return onChange(0);
|
|
47
|
+
}
|
|
48
|
+
}), jsx(FieldRange, {
|
|
49
|
+
value: value,
|
|
50
|
+
onChange: onChange
|
|
51
|
+
}), jsx(Button
|
|
52
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
53
|
+
, {
|
|
54
|
+
className: "zoom_button zoom_button_large",
|
|
55
|
+
iconAfter: jsx(ScaleLargeIcon, {
|
|
56
|
+
label: "scale-large-icon"
|
|
57
|
+
}),
|
|
58
|
+
onClick: function onClick() {
|
|
59
|
+
return onChange(100);
|
|
60
|
+
}
|
|
61
|
+
}))
|
|
62
|
+
);
|
|
59
63
|
}
|
|
60
64
|
}]);
|
|
61
65
|
return Slider;
|