@atlaskit/media-avatar-picker 24.6.5 → 24.6.6
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 +6 -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 +14 -1
- 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 +14 -0
- 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 +14 -0
- 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/example-helpers/StatefulAvatarPickerDialog.tsx +2 -0
- package/example-helpers/styles.ts +9 -0
- package/package.json +77 -77
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import React from 'react';
|
|
4
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
4
5
|
import { jsx } from '@emotion/react';
|
|
5
6
|
import { Component } from 'react';
|
|
6
7
|
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
@@ -280,23 +281,27 @@ export class ImageNavigator extends Component {
|
|
|
280
281
|
errorMessage,
|
|
281
282
|
isLoading
|
|
282
283
|
} = this.props;
|
|
283
|
-
return
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
284
|
+
return (
|
|
285
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
286
|
+
jsx("div", {
|
|
287
|
+
id: "image-uploader",
|
|
288
|
+
css: imageUploaderStyles
|
|
289
|
+
}, this.renderDragZone(), isLoading ? null : jsx("div", null, jsx("p", {
|
|
290
|
+
id: "padded-break",
|
|
291
|
+
css: paddedBreakStyles
|
|
292
|
+
}, jsx(FormattedMessage, errorMessage ? messages.try_again : messages.or)), jsx(Button, {
|
|
293
|
+
onClick: this.onUploadButtonClick,
|
|
294
|
+
isDisabled: isLoading,
|
|
295
|
+
testId: "upload-button"
|
|
296
|
+
}, jsx(FormattedMessage, messages.upload_photo), jsx("input", {
|
|
297
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
298
|
+
css: fileInputStyles,
|
|
299
|
+
type: "file",
|
|
300
|
+
id: "image-input",
|
|
301
|
+
onChange: this.onFileChange,
|
|
302
|
+
accept: ACCEPT.join(',')
|
|
303
|
+
}))))
|
|
304
|
+
);
|
|
300
305
|
}
|
|
301
306
|
renderImageCropper(dataURI) {
|
|
302
307
|
const {
|
|
@@ -360,6 +365,8 @@ export class ImageNavigator extends Component {
|
|
|
360
365
|
dataURI
|
|
361
366
|
} = this;
|
|
362
367
|
const content = dataURI && !isLoading ? this.renderImageCropper(dataURI) : this.renderImageUploader();
|
|
368
|
+
|
|
369
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
363
370
|
return jsx("div", {
|
|
364
371
|
css: containerStyles
|
|
365
372
|
}, content);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
/** @jsx jsx */
|
|
3
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
4
|
import { jsx } from '@emotion/react';
|
|
4
5
|
import { Component } from 'react';
|
|
5
6
|
import FieldRange from '@atlaskit/range';
|
|
@@ -16,28 +17,31 @@ export class Slider extends Component {
|
|
|
16
17
|
value,
|
|
17
18
|
onChange
|
|
18
19
|
} = this.props;
|
|
19
|
-
return
|
|
20
|
-
css
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
20
|
+
return (
|
|
21
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
22
|
+
jsx("div", {
|
|
23
|
+
css: sliderWrapperStyles
|
|
24
|
+
}, jsx(Button
|
|
25
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
26
|
+
, {
|
|
27
|
+
className: "zoom_button zoom_button_small",
|
|
28
|
+
iconAfter: jsx(ScaleSmallIcon, {
|
|
29
|
+
label: "scale-small-icon"
|
|
30
|
+
}),
|
|
31
|
+
onClick: () => onChange(0)
|
|
32
|
+
}), jsx(FieldRange, {
|
|
33
|
+
value: value,
|
|
34
|
+
onChange: onChange
|
|
35
|
+
}), jsx(Button
|
|
36
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
37
|
+
, {
|
|
38
|
+
className: "zoom_button zoom_button_large",
|
|
39
|
+
iconAfter: jsx(ScaleLargeIcon, {
|
|
40
|
+
label: "scale-large-icon"
|
|
41
|
+
}),
|
|
42
|
+
onClick: () => onChange(100)
|
|
43
|
+
}))
|
|
44
|
+
);
|
|
41
45
|
}
|
|
42
46
|
}
|
|
43
47
|
_defineProperty(Slider, "defaultProps", defaultProps);
|
|
@@ -1,38 +1,52 @@
|
|
|
1
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
1
2
|
import { css, keyframes } from '@emotion/react';
|
|
2
3
|
import { N200 } from '@atlaskit/theme/colors';
|
|
3
4
|
import { checkeredBg } from './images';
|
|
4
5
|
import { AVATAR_DIALOG_WIDTH } from '../avatar-picker-dialog/layout-const';
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
5
8
|
export const imageBgStyles = css({
|
|
6
9
|
position: 'absolute',
|
|
7
10
|
top: 0,
|
|
8
11
|
left: 0,
|
|
9
12
|
width: '256px',
|
|
10
13
|
height: '256px',
|
|
14
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
11
15
|
background: `url('${checkeredBg}')`,
|
|
12
16
|
borderRadius: "var(--ds-border-radius, 3px)"
|
|
13
17
|
});
|
|
18
|
+
|
|
19
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
14
20
|
export const containerStyles = css({
|
|
15
21
|
boxSizing: 'border-box',
|
|
22
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
16
23
|
'*, *::before, *::after': {
|
|
17
24
|
boxSizing: 'border-box'
|
|
18
25
|
},
|
|
19
26
|
position: 'relative'
|
|
20
27
|
});
|
|
28
|
+
|
|
29
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
21
30
|
export const sliderContainerStyles = css({
|
|
22
31
|
alignItems: 'center',
|
|
23
32
|
justifyContent: 'center',
|
|
24
33
|
display: 'flex',
|
|
25
34
|
flexDirection: 'row',
|
|
26
35
|
marginTop: "var(--ds-space-100, 8px)",
|
|
36
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
27
37
|
input: {
|
|
28
38
|
boxSizing: 'content-box',
|
|
29
39
|
padding: 0
|
|
30
40
|
},
|
|
31
41
|
backgroundColor: "var(--ds-surface-overlay, #fff)"
|
|
32
42
|
});
|
|
43
|
+
|
|
44
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
33
45
|
export const fileInputStyles = css({
|
|
34
46
|
display: 'none'
|
|
35
47
|
});
|
|
48
|
+
|
|
49
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
36
50
|
export const imageUploaderStyles = css({
|
|
37
51
|
display: 'flex',
|
|
38
52
|
flexDirection: 'column',
|
|
@@ -55,6 +69,7 @@ const droppingAnimation = css({
|
|
|
55
69
|
const getBorder = showBorder => `${showBorder ? `2px dashed ${"var(--ds-border, #d0d6d0)"}` : 'none'}`;
|
|
56
70
|
const getDroppingAnimation = isDroppingFile => isDroppingFile ? css({
|
|
57
71
|
backgroundColor: "var(--ds-background-information-hovered, #ddecfe)",
|
|
72
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
58
73
|
'&:after': droppingAnimation
|
|
59
74
|
}) : '';
|
|
60
75
|
export const dragZoneStyles = props => css({
|
|
@@ -70,6 +85,7 @@ export const dragZoneStyles = props => css({
|
|
|
70
85
|
transition: 'background-color 0.3s cubic-bezier(0.215, 0.61, 0.355, 1)',
|
|
71
86
|
'&::after': {
|
|
72
87
|
content: "''",
|
|
88
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
73
89
|
border: getBorder(props.showBorder),
|
|
74
90
|
borderRadius: '100%',
|
|
75
91
|
position: 'absolute',
|
|
@@ -79,8 +95,12 @@ export const dragZoneStyles = props => css({
|
|
|
79
95
|
height: '100%',
|
|
80
96
|
transition: 'border-color 0.3s cubic-bezier(0.19, 1, 0.22, 1)'
|
|
81
97
|
}
|
|
82
|
-
},
|
|
98
|
+
},
|
|
99
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
100
|
+
getDroppingAnimation(props.isDroppingFile));
|
|
83
101
|
dragZoneStyles.displayName = 'DragZone';
|
|
102
|
+
|
|
103
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
84
104
|
export const dragZoneImageStyles = css({
|
|
85
105
|
width: '100px'
|
|
86
106
|
});
|
|
@@ -88,7 +108,11 @@ const getWidth = isFullSize => `${isFullSize ? `width: calc(${AVATAR_DIALOG_WIDT
|
|
|
88
108
|
export const dragZoneTextStyles = props => css({
|
|
89
109
|
textAlign: 'center',
|
|
90
110
|
color: `var(--ds-text-subtlest, ${N200})`
|
|
91
|
-
},
|
|
111
|
+
},
|
|
112
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
113
|
+
getWidth(props.isFullSize));
|
|
114
|
+
|
|
115
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
92
116
|
export const selectionBlockerStyles = css({
|
|
93
117
|
position: 'fixed',
|
|
94
118
|
left: 0,
|
|
@@ -98,15 +122,21 @@ export const selectionBlockerStyles = css({
|
|
|
98
122
|
backgroundColor: 'transparent',
|
|
99
123
|
userSelect: 'none'
|
|
100
124
|
});
|
|
125
|
+
|
|
126
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
101
127
|
export const paddedBreakStyles = css({
|
|
128
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
102
129
|
marginTop: `${"var(--ds-space-100, 10px)"} !important`,
|
|
103
130
|
marginBottom: "var(--ds-space-100, 10px)",
|
|
104
131
|
textAlign: 'center'
|
|
105
132
|
});
|
|
133
|
+
|
|
134
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
106
135
|
export const sliderWrapperStyles = css({
|
|
107
136
|
display: 'flex',
|
|
108
137
|
alignItems: 'center',
|
|
109
138
|
width: '100%',
|
|
139
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
110
140
|
'.zoom_button svg': {
|
|
111
141
|
position: 'relative',
|
|
112
142
|
left: "var(--ds-space-negative-025, -2px)"
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
/**@jsx jsx */
|
|
3
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
4
|
import { jsx } from '@emotion/react';
|
|
4
5
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
5
6
|
import { checkeredBg } from './styles';
|
|
6
7
|
const containerWrapperStyles = xcss({
|
|
8
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
7
9
|
background: `url('${checkeredBg}')`,
|
|
8
10
|
position: `relative`,
|
|
9
11
|
cursor: `move`,
|
|
@@ -18,7 +20,9 @@ export const ContainerWrapper = ({
|
|
|
18
20
|
...props
|
|
19
21
|
}) => {
|
|
20
22
|
const containerWrapperDimensions = xcss({
|
|
23
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
21
24
|
width: `${width !== undefined ? width + margin * 2 : 0}px`,
|
|
25
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
22
26
|
height: `${height !== undefined ? height + margin * 2 : 0}px`
|
|
23
27
|
});
|
|
24
28
|
return jsx(Box, _extends({
|
|
@@ -1,8 +1,11 @@
|
|
|
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 { imagePlacerErrorWrapperStyles } from './styles';
|
|
4
5
|
export const ImagePlacerErrorWrapper = ({
|
|
5
6
|
children
|
|
6
|
-
}) =>
|
|
7
|
+
}) =>
|
|
8
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
9
|
+
jsx("div", {
|
|
7
10
|
css: imagePlacerErrorWrapperStyles
|
|
8
11
|
}, children);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
/**@jsx jsx */
|
|
3
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
4
|
import { jsx } from '@emotion/react';
|
|
4
5
|
import { imageWrapperStyles } from './styles';
|
|
5
6
|
export const ImageWrapper = ({
|
|
@@ -8,7 +9,9 @@ export const ImageWrapper = ({
|
|
|
8
9
|
width,
|
|
9
10
|
height,
|
|
10
11
|
...props
|
|
11
|
-
}) =>
|
|
12
|
+
}) =>
|
|
13
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
14
|
+
jsx("img", _extends({
|
|
12
15
|
css: imageWrapperStyles({
|
|
13
16
|
x,
|
|
14
17
|
y,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
/**@jsx jsx */
|
|
3
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
4
|
import { jsx } from '@emotion/react';
|
|
4
5
|
import React from 'react';
|
|
5
6
|
import { Rectangle, Vector2, Bounds, dataURItoFile, getFileInfo, getFileInfoFromSrc } from '@atlaskit/media-ui';
|
|
@@ -468,31 +469,34 @@ export class ImagePlacer extends React.Component {
|
|
|
468
469
|
imageBounds
|
|
469
470
|
} = this;
|
|
470
471
|
const imgSrc = typeof src === 'string' ? src : undefined;
|
|
471
|
-
return
|
|
472
|
-
css
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
472
|
+
return (
|
|
473
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
474
|
+
jsx("div", {
|
|
475
|
+
css: imagePlacerWrapperStyles({
|
|
476
|
+
backgroundColor
|
|
477
|
+
})
|
|
478
|
+
}, jsx(ImagePlacerContainer, {
|
|
479
|
+
width: containerWidth,
|
|
480
|
+
height: containerHeight,
|
|
481
|
+
margin: margin,
|
|
482
|
+
onDragStart: this.onDragStart,
|
|
483
|
+
onDragMove: this.onDragMove,
|
|
484
|
+
onWheel: this.onWheel
|
|
485
|
+
}, errorMessage ? jsx(ImagePlacerErrorWrapper, null, onRenderError ? onRenderError(errorMessage) : errorMessage) : jsx("div", null, jsx(ImagePlacerImage, {
|
|
486
|
+
src: imgSrc,
|
|
487
|
+
x: imageBounds.x,
|
|
488
|
+
y: imageBounds.y,
|
|
489
|
+
width: imageBounds.width,
|
|
490
|
+
height: imageBounds.height,
|
|
491
|
+
onLoad: this.onImageLoad,
|
|
492
|
+
onError: this.onImageError
|
|
493
|
+
}), jsx(Margin, {
|
|
494
|
+
width: containerWidth,
|
|
495
|
+
height: containerHeight,
|
|
496
|
+
circular: isCircular,
|
|
497
|
+
size: margin
|
|
498
|
+
}))))
|
|
499
|
+
);
|
|
496
500
|
}
|
|
497
501
|
}
|
|
498
502
|
/* image element used to load */
|
|
@@ -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 React from 'react';
|
|
4
5
|
import { marginWrapperSquareStyles, marginWrapperCircleStyles } from './styles';
|
|
@@ -11,6 +12,8 @@ export class Margin extends React.Component {
|
|
|
11
12
|
circular
|
|
12
13
|
} = this.props;
|
|
13
14
|
const [id, styles] = circular ? ['marginWrapperCircle', marginWrapperCircleStyles] : ['marginWrapperSquare', marginWrapperSquareStyles];
|
|
15
|
+
|
|
16
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
14
17
|
return jsx("div", {
|
|
15
18
|
css: styles({
|
|
16
19
|
width,
|
|
@@ -1,10 +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 { R500 } from '@atlaskit/theme/colors';
|
|
3
4
|
export const checkeredBg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAA6hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyIKICAgICAgICAgICAgeG1sbnM6ZXhpZj0iaHR0cDovL25zLmFkb2JlLmNvbS9leGlmLzEuMC8iPgogICAgICAgICA8eG1wOk1vZGlmeURhdGU+MjAxOC0xMC0zMFQxMjoxMDo5MjwveG1wOk1vZGlmeURhdGU+CiAgICAgICAgIDx4bXA6Q3JlYXRvclRvb2w+UGl4ZWxtYXRvciAzLjcuNTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpDb21wcmVzc2lvbj4wPC90aWZmOkNvbXByZXNzaW9uPgogICAgICAgICA8dGlmZjpSZXNvbHV0aW9uVW5pdD4yPC90aWZmOlJlc29sdXRpb25Vbml0PgogICAgICAgICA8dGlmZjpZUmVzb2x1dGlvbj43MjwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPHRpZmY6WFJlc29sdXRpb24+NzI8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDxleGlmOlBpeGVsWERpbWVuc2lvbj4xMDwvZXhpZjpQaXhlbFhEaW1lbnNpb24+CiAgICAgICAgIDxleGlmOkNvbG9yU3BhY2U+MTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFlEaW1lbnNpb24+MTA8L2V4aWY6UGl4ZWxZRGltZW5zaW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KX+XPjwAAACtJREFUGBljPHv27H8GNGBsbMyIJsTAhC6Aiz+ACjEcDXIjNg8OoBuJthoAzy0HeT3Qcc0AAAAASUVORK5CYII=';
|
|
4
5
|
export const imagePlacerWrapperStyles = props => css({
|
|
6
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
5
7
|
backgroundColor: props.backgroundColor,
|
|
6
8
|
display: 'inline-block'
|
|
7
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
|
|
8
12
|
export const imagePlacerErrorWrapperStyles = css({
|
|
9
13
|
backgroundColor: `var(--ds-background-danger-bold, ${R500})`,
|
|
10
14
|
color: "var(--ds-text-inverse, white)",
|
|
@@ -22,10 +26,15 @@ export const imageWrapperStyles = ({
|
|
|
22
26
|
height,
|
|
23
27
|
transform
|
|
24
28
|
}) => css({
|
|
29
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
25
30
|
left: `${x}px`,
|
|
31
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
26
32
|
top: `${y}px`,
|
|
33
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
27
34
|
width: `${width}px`,
|
|
35
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
28
36
|
height: `${height}px`,
|
|
37
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
29
38
|
transform: transform,
|
|
30
39
|
position: 'absolute',
|
|
31
40
|
transition: `margin-left ${EASING}s ease-out, margin-top ${EASING}s ease-out, left ${EASING}s ease-out, top ${EASING}s ease-out, width ${EASING}s ease-out, height ${EASING}s ease-out`,
|
|
@@ -42,8 +51,11 @@ export const marginWrapperSquareStyles = ({
|
|
|
42
51
|
top: 0,
|
|
43
52
|
borderStyle: 'solid',
|
|
44
53
|
borderColor: "var(--ds-surface-overlay, rgba(255, 255, 255))",
|
|
54
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
45
55
|
borderWidth: `${size}px`,
|
|
56
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
46
57
|
width: `${width}px`,
|
|
58
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
47
59
|
height: `${height}px`,
|
|
48
60
|
opacity: "var(--ds-opacity-disabled, 0.3)"
|
|
49
61
|
});
|
|
@@ -56,15 +68,22 @@ export const marginWrapperCircleStyles = ({
|
|
|
56
68
|
overflow: 'hidden',
|
|
57
69
|
left: '0px',
|
|
58
70
|
top: '0px',
|
|
71
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
59
72
|
width: `${width + size * 2}px`,
|
|
73
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
60
74
|
height: `${height + size * 2}px`,
|
|
75
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
61
76
|
'&:after': {
|
|
62
77
|
content: "''",
|
|
63
78
|
position: 'absolute',
|
|
79
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
64
80
|
left: `${size}px`,
|
|
81
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
65
82
|
top: `${size}px`,
|
|
66
83
|
borderRadius: '100%',
|
|
84
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
67
85
|
width: `${width}px`,
|
|
86
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
68
87
|
height: `${height}px`,
|
|
69
88
|
boxShadow: `0px 0px 0px ${Math.max(width, height)}px ${"var(--ds-surface-overlay, rgba(255, 255, 255))"}`,
|
|
70
89
|
opacity: "var(--ds-opacity-disabled, 0.3)"
|
|
@@ -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',
|