@atlaskit/status 3.0.2 → 3.0.4
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 +16 -0
- package/dist/cjs/components/Status.js +26 -43
- package/dist/cjs/components/StatusPicker.js +10 -17
- package/dist/cjs/components/analytics.js +1 -1
- package/dist/cjs/components/internal/color-palette.js +64 -62
- package/dist/cjs/components/internal/color.js +19 -30
- package/dist/cjs/element.js +7 -5
- package/dist/cjs/index.js +13 -7
- package/dist/cjs/picker.js +7 -5
- package/dist/es2019/components/Status.js +21 -44
- package/dist/es2019/components/StatusPicker.js +9 -18
- package/dist/es2019/components/analytics.js +1 -1
- package/dist/es2019/components/internal/color-palette.js +57 -60
- package/dist/es2019/components/internal/color.js +15 -38
- package/dist/es2019/element.js +1 -5
- package/dist/es2019/index.js +2 -8
- package/dist/es2019/picker.js +1 -5
- package/dist/esm/components/Status.js +21 -44
- package/dist/esm/components/StatusPicker.js +9 -18
- package/dist/esm/components/analytics.js +1 -1
- package/dist/esm/components/internal/color-palette.js +64 -63
- package/dist/esm/components/internal/color.js +19 -30
- package/dist/esm/element.js +1 -5
- package/dist/esm/index.js +2 -8
- package/dist/esm/picker.js +1 -5
- package/dist/types/components/internal/color-palette.d.ts +2 -2
- package/dist/types/components/internal/color.d.ts +2 -3
- package/dist/types/element.d.ts +1 -3
- package/dist/types/index.d.ts +2 -6
- package/dist/types/picker.d.ts +1 -5
- package/dist/types-ts4.5/components/internal/color-palette.d.ts +2 -2
- package/dist/types-ts4.5/components/internal/color.d.ts +2 -3
- package/dist/types-ts4.5/element.d.ts +1 -3
- package/dist/types-ts4.5/index.d.ts +2 -6
- package/dist/types-ts4.5/picker.d.ts +1 -5
- package/package.json +7 -4
- package/dist/cjs/components/compiled/Status.js +0 -132
- package/dist/cjs/components/compiled/StatusPicker.js +0 -116
- package/dist/cjs/components/compiled/internal/color-palette.js +0 -105
- package/dist/cjs/components/compiled/internal/color.js +0 -121
- package/dist/es2019/components/compiled/Status.js +0 -110
- package/dist/es2019/components/compiled/StatusPicker.js +0 -86
- package/dist/es2019/components/compiled/internal/color-palette.js +0 -78
- package/dist/es2019/components/compiled/internal/color.js +0 -90
- package/dist/esm/components/compiled/Status.js +0 -122
- package/dist/esm/components/compiled/StatusPicker.js +0 -106
- package/dist/esm/components/compiled/internal/color-palette.js +0 -95
- package/dist/esm/components/compiled/internal/color.js +0 -112
- package/dist/types/components/compiled/Status.d.ts +0 -16
- package/dist/types/components/compiled/StatusPicker.d.ts +0 -16
- package/dist/types/components/compiled/internal/color-palette.d.ts +0 -11
- package/dist/types/components/compiled/internal/color.d.ts +0 -22
- package/dist/types-ts4.5/components/compiled/Status.d.ts +0 -16
- package/dist/types-ts4.5/components/compiled/StatusPicker.d.ts +0 -16
- package/dist/types-ts4.5/components/compiled/internal/color-palette.d.ts +0 -11
- package/dist/types-ts4.5/components/compiled/internal/color.d.ts +0 -22
- /package/dist/cjs/components/{compiled/Status.compiled.css → Status.compiled.css} +0 -0
- /package/dist/cjs/components/{compiled/StatusPicker.compiled.css → StatusPicker.compiled.css} +0 -0
- /package/dist/cjs/components/{compiled/internal → internal}/color-palette.compiled.css +0 -0
- /package/dist/cjs/components/{compiled/internal → internal}/color.compiled.css +0 -0
- /package/dist/es2019/components/{compiled/Status.compiled.css → Status.compiled.css} +0 -0
- /package/dist/es2019/components/{compiled/StatusPicker.compiled.css → StatusPicker.compiled.css} +0 -0
- /package/dist/es2019/components/{compiled/internal → internal}/color-palette.compiled.css +0 -0
- /package/dist/es2019/components/{compiled/internal → internal}/color.compiled.css +0 -0
- /package/dist/esm/components/{compiled/Status.compiled.css → Status.compiled.css} +0 -0
- /package/dist/esm/components/{compiled/StatusPicker.compiled.css → StatusPicker.compiled.css} +0 -0
- /package/dist/esm/components/{compiled/internal → internal}/color-palette.compiled.css +0 -0
- /package/dist/esm/components/{compiled/internal → internal}/color.compiled.css +0 -0
|
@@ -1,22 +1,13 @@
|
|
|
1
|
+
/* StatusPicker.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* @jsx jsx
|
|
5
|
-
*/
|
|
3
|
+
import "./StatusPicker.compiled.css";
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
5
|
import TextField from '@atlaskit/textfield';
|
|
7
6
|
import React, { PureComponent } from 'react';
|
|
8
7
|
import { injectIntl } from 'react-intl-next';
|
|
9
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
|
-
import { css, jsx } from '@emotion/react';
|
|
11
8
|
import ColorPalette from './internal/color-palette';
|
|
12
9
|
import { messages } from './i18n';
|
|
13
|
-
const fieldTextWrapperStyles =
|
|
14
|
-
margin: `0 ${"var(--ds-space-100, 8px)"}`,
|
|
15
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
16
|
-
'& [data-ds--text-field--container]': {
|
|
17
|
-
borderColor: "var(--ds-border-bold, #758195)"
|
|
18
|
-
}
|
|
19
|
-
});
|
|
10
|
+
const fieldTextWrapperStyles = null;
|
|
20
11
|
class Picker extends PureComponent {
|
|
21
12
|
constructor(...args) {
|
|
22
13
|
super(...args);
|
|
@@ -59,10 +50,10 @@ class Picker extends PureComponent {
|
|
|
59
50
|
|
|
60
51
|
// Using <React.Fragment> instead of [] to workaround Enzyme
|
|
61
52
|
// (https://github.com/airbnb/enzyme/issues/1149)
|
|
62
|
-
return
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
},
|
|
53
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
key: this.fieldTextWrapperKey,
|
|
55
|
+
className: ax(["_19pkidpf _otyridpf _2hwxu2gc _18u0u2gc _n6347jlr"])
|
|
56
|
+
}, /*#__PURE__*/React.createElement(TextField, {
|
|
66
57
|
value: text,
|
|
67
58
|
isCompact: true,
|
|
68
59
|
ref: this.handleInputRef,
|
|
@@ -71,7 +62,7 @@ class Picker extends PureComponent {
|
|
|
71
62
|
spellCheck: false,
|
|
72
63
|
autoComplete: "off",
|
|
73
64
|
"aria-label": intl.formatMessage(messages.statusInputLabel)
|
|
74
|
-
})),
|
|
65
|
+
})), /*#__PURE__*/React.createElement(ColorPalette, {
|
|
75
66
|
key: this.colorPaletteKey,
|
|
76
67
|
onClick: onColorClick,
|
|
77
68
|
onHover: onColorHover,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const ELEMENTS_CHANNEL = 'fabric-elements';
|
|
2
2
|
const packageName = "@atlaskit/status";
|
|
3
|
-
const packageVersion = "3.0.
|
|
3
|
+
const packageVersion = "3.0.4";
|
|
4
4
|
export const createStatusAnalyticsAndFire = createAnalyticsEvent => payload => {
|
|
5
5
|
const statusPayload = {
|
|
6
6
|
...payload,
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
|
|
1
|
+
/* color-palette.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import "./color-palette.compiled.css";
|
|
3
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
4
|
import React, { useEffect, useRef, useCallback, useState } from 'react';
|
|
7
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
-
import { css, jsx } from '@emotion/react';
|
|
9
5
|
import Color from './color';
|
|
10
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
7
|
const paletteLegacy = [['neutral', "var(--ds-background-neutral, #091E420F)", "var(--ds-border-bold, #758195)", "var(--ds-icon, #44546F)"], ['purple', "var(--ds-background-discovery, #F3F0FF)", "var(--ds-border-discovery, #8270DB)", "var(--ds-icon-discovery, #8270DB)"], ['blue', "var(--ds-background-information, #E9F2FF)", "var(--ds-border-information, #1D7AFC)", "var(--ds-icon-information, #1D7AFC)"], ['red', "var(--ds-background-danger, #FFECEB)", "var(--ds-border-danger, #E2483D)", "var(--ds-icon-danger, #C9372C)"], ['yellow', "var(--ds-background-warning, #FFF7D6)", "var(--ds-border-warning, #E56910)", "var(--ds-icon-warning, #E56910)"], ['green', "var(--ds-background-success, #DCFFF1)", "var(--ds-border-success, #22A06B)", "var(--ds-icon-success, #22A06B)"]];
|
|
@@ -14,13 +10,7 @@ const getPalette = () => fg('platform-component-visual-refresh') ? paletteRefres
|
|
|
14
10
|
const palette = getPalette();
|
|
15
11
|
|
|
16
12
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/design-system/no-css-tagged-template-expression -- Ignored via go/DSP-18766
|
|
17
|
-
const colorPaletteWrapperStyles =
|
|
18
|
-
padding-left: 0px;
|
|
19
|
-
margin: ${"var(--ds-space-100, 8px)"} ${"var(--ds-space-100, 8px)"} 0 ${"var(--ds-space-100, 8px)"};
|
|
20
|
-
/* Firefox bug fix: https://product-fabric.atlassian.net/browse/ED-1789 */
|
|
21
|
-
display: flex;
|
|
22
|
-
flex-wrap: wrap;
|
|
23
|
-
`;
|
|
13
|
+
const colorPaletteWrapperStyles = null;
|
|
24
14
|
const VK_LEFT = 37; //ArrowLeft
|
|
25
15
|
const VK_RIGHT = 39; //ArrowRight
|
|
26
16
|
const VK_UP = 38; //ArrowUp
|
|
@@ -42,20 +32,38 @@ export default (({
|
|
|
42
32
|
let newColorIndex = null;
|
|
43
33
|
const nextColor = () => currentFocusedColor + 1 > palette.length - 1 ? 0 : currentFocusedColor + 1;
|
|
44
34
|
const previousColor = () => currentFocusedColor - 1 < 0 ? palette.length - 1 : currentFocusedColor - 1;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
35
|
+
if (fg('editor_a11y_arrow_key_status_colour_palette')) {
|
|
36
|
+
switch (e.key) {
|
|
37
|
+
case 'ArrowRight':
|
|
38
|
+
case 'ArrowDown':
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
newColorIndex = nextColor();
|
|
41
|
+
break;
|
|
42
|
+
case 'ArrowLeft':
|
|
43
|
+
case 'ArrowUp':
|
|
44
|
+
e.preventDefault();
|
|
45
|
+
newColorIndex = previousColor();
|
|
46
|
+
break;
|
|
47
|
+
case 'Tab':
|
|
48
|
+
setCurrentFocusedColor(0);
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
} else {
|
|
52
|
+
switch (e.keyCode) {
|
|
53
|
+
case VK_RIGHT:
|
|
54
|
+
case VK_DOWN:
|
|
55
|
+
e.preventDefault();
|
|
56
|
+
newColorIndex = nextColor();
|
|
57
|
+
break;
|
|
58
|
+
case VK_LEFT:
|
|
59
|
+
case VK_UP:
|
|
60
|
+
e.preventDefault();
|
|
61
|
+
newColorIndex = previousColor();
|
|
62
|
+
break;
|
|
63
|
+
case VK_TAB:
|
|
64
|
+
setCurrentFocusedColor(0);
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
59
67
|
}
|
|
60
68
|
if (newColorIndex === null) {
|
|
61
69
|
return;
|
|
@@ -64,36 +72,25 @@ export default (({
|
|
|
64
72
|
const newRef = colorRefs.current[newColorIndex];
|
|
65
73
|
newRef === null || newRef === void 0 ? void 0 : newRef.focus();
|
|
66
74
|
}, [currentFocusedColor, setCurrentFocusedColor, colorRefs]);
|
|
67
|
-
return (
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
backgroundColor: backgroundColor,
|
|
89
|
-
borderColor: borderColor,
|
|
90
|
-
iconColor: iconColor,
|
|
91
|
-
onClick: onClick,
|
|
92
|
-
onHover: onHover,
|
|
93
|
-
isSelected: colorValue === selectedColor,
|
|
94
|
-
tabIndex: i === 0 ? 0 : -1,
|
|
95
|
-
setRef: el => colorRefs.current[i] = el
|
|
96
|
-
});
|
|
97
|
-
}))
|
|
98
|
-
);
|
|
75
|
+
return /*#__PURE__*/React.createElement("ul", {
|
|
76
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
77
|
+
className: ax(["_19bvidpf _19pku2gc _2hwxu2gc _otyridpf _18u0u2gc _1e0c1txw _1n261g80", className]),
|
|
78
|
+
style: {
|
|
79
|
+
maxWidth: cols * 32
|
|
80
|
+
},
|
|
81
|
+
onKeyDown: memoizedHandleKeyDown
|
|
82
|
+
}, palette.map(([colorValue, backgroundColor, borderColor, iconColor], i) => {
|
|
83
|
+
return /*#__PURE__*/React.createElement(Color, {
|
|
84
|
+
key: colorValue,
|
|
85
|
+
value: colorValue,
|
|
86
|
+
backgroundColor: backgroundColor,
|
|
87
|
+
borderColor: borderColor,
|
|
88
|
+
iconColor: iconColor,
|
|
89
|
+
onClick: onClick,
|
|
90
|
+
onHover: onHover,
|
|
91
|
+
isSelected: colorValue === selectedColor,
|
|
92
|
+
tabIndex: i === 0 ? 0 : -1,
|
|
93
|
+
setRef: el => colorRefs.current[i] = el
|
|
94
|
+
});
|
|
95
|
+
}));
|
|
99
96
|
});
|
|
@@ -1,44 +1,21 @@
|
|
|
1
|
+
/* color.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
*/
|
|
3
|
+
import "./color.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import EditorDoneIcon from '@atlaskit/icon/core/migration/check-mark--editor-done';
|
|
7
|
-
import { Pressable
|
|
8
|
-
import
|
|
7
|
+
import { Pressable } from '@atlaskit/primitives/compiled';
|
|
8
|
+
import { PureComponent } from 'react';
|
|
9
9
|
import { FormattedMessage } from 'react-intl-next';
|
|
10
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
11
|
-
import { css, jsx } from '@emotion/react';
|
|
12
10
|
import { ANALYTICS_HOVER_DELAY } from '../constants';
|
|
13
11
|
import { messages } from '../i18n';
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
background: 'color.background.neutral',
|
|
18
|
-
padding: 'space.0',
|
|
19
|
-
borderRadius: 'border.radius',
|
|
20
|
-
borderWidth: 'border.width',
|
|
21
|
-
borderStyle: 'solid',
|
|
22
|
-
borderColor: 'color.border',
|
|
23
|
-
display: 'block',
|
|
24
|
-
overflow: 'hidden'
|
|
25
|
-
});
|
|
12
|
+
const styles = {
|
|
13
|
+
button: "_2rkoglpi _19it7r9e _1reo15vq _18m915vq _4t3i1tcg _1bsb1tcg _bfhkm7j4 _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _1e0c1ule"
|
|
14
|
+
};
|
|
26
15
|
|
|
27
16
|
// We have tried with changing border and padding from 1px to token near version 2px,
|
|
28
17
|
// the pop - up is being expanded to two lines.
|
|
29
|
-
|
|
30
|
-
const buttonWrapperStyles = css`
|
|
31
|
-
border: 1px solid transparent;
|
|
32
|
-
margin: 0 ${"var(--ds-space-025, 2px)"};
|
|
33
|
-
font-size: 0;
|
|
34
|
-
display: flex;
|
|
35
|
-
align-items: center;
|
|
36
|
-
padding: 1px;
|
|
37
|
-
border-radius: ${"var(--ds-space-075, 6px)"};
|
|
38
|
-
&:hover {
|
|
39
|
-
border: 1px solid ${"var(--ds-border, #091E4224)"};
|
|
40
|
-
}
|
|
41
|
-
`;
|
|
18
|
+
const buttonWrapperStyles = null;
|
|
42
19
|
export default class Color extends PureComponent {
|
|
43
20
|
constructor(...args) {
|
|
44
21
|
super(...args);
|
|
@@ -78,10 +55,10 @@ export default class Color extends PureComponent {
|
|
|
78
55
|
value,
|
|
79
56
|
setRef
|
|
80
57
|
} = this.props;
|
|
81
|
-
return
|
|
82
|
-
|
|
83
|
-
},
|
|
84
|
-
xcss:
|
|
58
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
59
|
+
className: ax(["_ca0qt94y _u5f3t94y _n3tdt94y _19bvt94y _2rko12x7 _189et94y _1dqonqa1 _1h6d1j28 _19pkidpf _2hwxv77o _otyridpf _18u0v77o _1e0c1txw _4cvr1h6o _bfw7zgxb"])
|
|
60
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, messages[`${value}Color`], labels => /*#__PURE__*/React.createElement(Pressable, {
|
|
61
|
+
xcss: styles.button,
|
|
85
62
|
onClick: this.onClick,
|
|
86
63
|
onMouseEnter: this.onMouseEnter,
|
|
87
64
|
onMouseLeave: this.onMouseLeave,
|
|
@@ -102,7 +79,7 @@ export default class Color extends PureComponent {
|
|
|
102
79
|
borderColor
|
|
103
80
|
},
|
|
104
81
|
ref: setRef
|
|
105
|
-
}, isSelected &&
|
|
82
|
+
}, isSelected && /*#__PURE__*/React.createElement(EditorDoneIcon, {
|
|
106
83
|
color: "currentColor",
|
|
107
84
|
label: labels[0]
|
|
108
85
|
}))));
|
package/dist/es2019/element.js
CHANGED
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { Status as EmotionStatus } from './components/Status';
|
|
3
|
-
import { Status as CompiledStatus } from './components/compiled/Status';
|
|
4
|
-
const Status = componentWithFG('platform_editor_css_migrate_stage_1', CompiledStatus, EmotionStatus);
|
|
5
|
-
export { Status };
|
|
1
|
+
export { Status } from './components/Status';
|
package/dist/es2019/index.js
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { Status as CompiledStatus } from './components/compiled/Status';
|
|
4
|
-
import { StatusPicker as EmotionStatusPicker } from './components/StatusPicker';
|
|
5
|
-
import { StatusPicker as CompiledStatusPicker } from './components/compiled/StatusPicker';
|
|
6
|
-
const Status = componentWithFG('platform_editor_css_migrate_stage_1', CompiledStatus, EmotionStatus);
|
|
7
|
-
const StatusPicker = componentWithFG('platform_editor_css_migrate_stage_1', CompiledStatusPicker, EmotionStatusPicker);
|
|
8
|
-
export { Status, StatusPicker };
|
|
1
|
+
export { Status } from './components/Status';
|
|
2
|
+
export { StatusPicker } from './components/StatusPicker';
|
package/dist/es2019/picker.js
CHANGED
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { StatusPicker as EmotionStatusPicker } from './components/StatusPicker';
|
|
3
|
-
import { StatusPicker as CompiledStatusPicker } from './components/compiled/StatusPicker';
|
|
4
|
-
const StatusPicker = componentWithFG('platform_editor_css_migrate_stage_1', CompiledStatusPicker, EmotionStatusPicker);
|
|
5
|
-
export { StatusPicker };
|
|
1
|
+
export { StatusPicker } from './components/StatusPicker';
|
|
@@ -1,27 +1,20 @@
|
|
|
1
|
+
/* Status.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
6
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
+
import "./Status.compiled.css";
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
7
11
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
12
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
-
/**
|
|
10
|
-
* @jsxRuntime classic
|
|
11
|
-
* @jsx jsx
|
|
12
|
-
*/
|
|
13
13
|
import { PureComponent } from 'react';
|
|
14
|
-
|
|
15
|
-
import { css, jsx } from '@emotion/react';
|
|
16
|
-
import Lozenge from '@atlaskit/lozenge';
|
|
14
|
+
import Lozenge from '@atlaskit/lozenge/compiled';
|
|
17
15
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
18
16
|
import { createStatusAnalyticsAndFire } from './analytics';
|
|
19
17
|
import { ANALYTICS_HOVER_DELAY } from './constants';
|
|
20
|
-
|
|
21
|
-
// Disabling linting for nextline since these values are used as text reference, but not used as part of the CSS
|
|
22
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/design-system/ensure-design-token-usage/preview
|
|
23
|
-
|
|
24
|
-
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage, @atlaskit/design-system/ensure-design-token-usage/preview */
|
|
25
18
|
var colorToLozengeAppearanceMap = {
|
|
26
19
|
neutral: 'default',
|
|
27
20
|
purple: 'new',
|
|
@@ -30,8 +23,6 @@ var colorToLozengeAppearanceMap = {
|
|
|
30
23
|
yellow: 'moved',
|
|
31
24
|
green: 'success'
|
|
32
25
|
};
|
|
33
|
-
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage, @atlaskit/design-system/ensure-design-token-usage/preview */
|
|
34
|
-
|
|
35
26
|
var DEFAULT_APPEARANCE = 'default';
|
|
36
27
|
var MAX_WIDTH = 200;
|
|
37
28
|
|
|
@@ -41,16 +32,7 @@ var MAX_WIDTH = 200;
|
|
|
41
32
|
*
|
|
42
33
|
* See DSP-7701 for additional context.
|
|
43
34
|
*/
|
|
44
|
-
var inlineBlockStyles =
|
|
45
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
46
|
-
'& > *': {
|
|
47
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
48
|
-
display: 'inline-block !important',
|
|
49
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
50
|
-
lineHeight: '16px',
|
|
51
|
-
verticalAlign: 'middle'
|
|
52
|
-
}
|
|
53
|
-
});
|
|
35
|
+
var inlineBlockStyles = null;
|
|
54
36
|
|
|
55
37
|
// eg. Version/4.0 Chrome/95.0.4638.50
|
|
56
38
|
var isAndroidChromium = typeof window !== 'undefined' && /Version\/.* Chrome\/.*/.test(window.navigator.userAgent);
|
|
@@ -97,26 +79,21 @@ var StatusInternal = /*#__PURE__*/function (_PureComponent) {
|
|
|
97
79
|
}
|
|
98
80
|
var appearance = colorToLozengeAppearanceMap[color] || DEFAULT_APPEARANCE;
|
|
99
81
|
// Note: ommitted data-local-id attribute to avoid copying/pasting the same localId
|
|
100
|
-
return (
|
|
101
|
-
// eslint-disable-next-line
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
appearance: appearance,
|
|
116
|
-
maxWidth: MAX_WIDTH,
|
|
117
|
-
isBold: isBold
|
|
118
|
-
}, text))
|
|
119
|
-
);
|
|
82
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
83
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
84
|
+
className: ax([isAndroidChromium && "_d0dzdf4r _1k0l7vkz _1frxnkob", "status-lozenge-span"]),
|
|
85
|
+
onClick: onClick,
|
|
86
|
+
onMouseEnter: this.handleMouseEnter,
|
|
87
|
+
onMouseLeave: this.handleMouseLeave,
|
|
88
|
+
"data-node-type": "status",
|
|
89
|
+
"data-color": color,
|
|
90
|
+
"data-style": style,
|
|
91
|
+
role: role
|
|
92
|
+
}, /*#__PURE__*/React.createElement(Lozenge, {
|
|
93
|
+
appearance: appearance,
|
|
94
|
+
maxWidth: MAX_WIDTH,
|
|
95
|
+
isBold: isBold
|
|
96
|
+
}, text));
|
|
120
97
|
}
|
|
121
98
|
}]);
|
|
122
99
|
}(PureComponent);
|
|
@@ -1,29 +1,20 @@
|
|
|
1
|
+
/* StatusPicker.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
6
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
+
import "./StatusPicker.compiled.css";
|
|
9
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
7
10
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
11
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
-
/**
|
|
10
|
-
* @jsxRuntime classic
|
|
11
|
-
* @jsx jsx
|
|
12
|
-
*/
|
|
13
12
|
import TextField from '@atlaskit/textfield';
|
|
14
13
|
import React, { PureComponent } from 'react';
|
|
15
14
|
import { injectIntl } from 'react-intl-next';
|
|
16
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
17
|
-
import { css, jsx } from '@emotion/react';
|
|
18
15
|
import ColorPalette from './internal/color-palette';
|
|
19
16
|
import { messages } from './i18n';
|
|
20
|
-
var fieldTextWrapperStyles =
|
|
21
|
-
margin: "0 ".concat("var(--ds-space-100, 8px)"),
|
|
22
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
23
|
-
'& [data-ds--text-field--container]': {
|
|
24
|
-
borderColor: "var(--ds-border-bold, #758195)"
|
|
25
|
-
}
|
|
26
|
-
});
|
|
17
|
+
var fieldTextWrapperStyles = null;
|
|
27
18
|
var Picker = /*#__PURE__*/function (_PureComponent) {
|
|
28
19
|
function Picker() {
|
|
29
20
|
var _this;
|
|
@@ -74,10 +65,10 @@ var Picker = /*#__PURE__*/function (_PureComponent) {
|
|
|
74
65
|
|
|
75
66
|
// Using <React.Fragment> instead of [] to workaround Enzyme
|
|
76
67
|
// (https://github.com/airbnb/enzyme/issues/1149)
|
|
77
|
-
return
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
},
|
|
68
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
key: this.fieldTextWrapperKey,
|
|
70
|
+
className: ax(["_19pkidpf _otyridpf _2hwxu2gc _18u0u2gc _n6347jlr"])
|
|
71
|
+
}, /*#__PURE__*/React.createElement(TextField, {
|
|
81
72
|
value: text,
|
|
82
73
|
isCompact: true,
|
|
83
74
|
ref: this.handleInputRef,
|
|
@@ -86,7 +77,7 @@ var Picker = /*#__PURE__*/function (_PureComponent) {
|
|
|
86
77
|
spellCheck: false,
|
|
87
78
|
autoComplete: "off",
|
|
88
79
|
"aria-label": intl.formatMessage(messages.statusInputLabel)
|
|
89
|
-
})),
|
|
80
|
+
})), /*#__PURE__*/React.createElement(ColorPalette, {
|
|
90
81
|
key: this.colorPaletteKey,
|
|
91
82
|
onClick: onColorClick,
|
|
92
83
|
onHover: onColorHover,
|
|
@@ -3,7 +3,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
export var ELEMENTS_CHANNEL = 'fabric-elements';
|
|
5
5
|
var packageName = "@atlaskit/status";
|
|
6
|
-
var packageVersion = "3.0.
|
|
6
|
+
var packageVersion = "3.0.4";
|
|
7
7
|
export var createStatusAnalyticsAndFire = function createStatusAnalyticsAndFire(createAnalyticsEvent) {
|
|
8
8
|
return function (payload) {
|
|
9
9
|
var statusPayload = _objectSpread(_objectSpread({}, payload), {}, {
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
+
/* color-palette.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @jsxRuntime classic
|
|
6
|
-
* @jsx jsx
|
|
7
|
-
*/
|
|
8
|
-
|
|
3
|
+
import "./color-palette.compiled.css";
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
9
5
|
import React, { useEffect, useRef, useCallback, useState } from 'react';
|
|
10
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
11
|
-
import { css, jsx } from '@emotion/react';
|
|
12
6
|
import Color from './color';
|
|
13
7
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
8
|
var paletteLegacy = [['neutral', "var(--ds-background-neutral, #091E420F)", "var(--ds-border-bold, #758195)", "var(--ds-icon, #44546F)"], ['purple', "var(--ds-background-discovery, #F3F0FF)", "var(--ds-border-discovery, #8270DB)", "var(--ds-icon-discovery, #8270DB)"], ['blue', "var(--ds-background-information, #E9F2FF)", "var(--ds-border-information, #1D7AFC)", "var(--ds-icon-information, #1D7AFC)"], ['red', "var(--ds-background-danger, #FFECEB)", "var(--ds-border-danger, #E2483D)", "var(--ds-icon-danger, #C9372C)"], ['yellow', "var(--ds-background-warning, #FFF7D6)", "var(--ds-border-warning, #E56910)", "var(--ds-icon-warning, #E56910)"], ['green', "var(--ds-background-success, #DCFFF1)", "var(--ds-border-success, #22A06B)", "var(--ds-icon-success, #22A06B)"]];
|
|
@@ -19,7 +13,7 @@ var getPalette = function getPalette() {
|
|
|
19
13
|
var palette = getPalette();
|
|
20
14
|
|
|
21
15
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/design-system/no-css-tagged-template-expression -- Ignored via go/DSP-18766
|
|
22
|
-
var colorPaletteWrapperStyles =
|
|
16
|
+
var colorPaletteWrapperStyles = null;
|
|
23
17
|
var VK_LEFT = 37; //ArrowLeft
|
|
24
18
|
var VK_RIGHT = 39; //ArrowRight
|
|
25
19
|
var VK_UP = 38; //ArrowUp
|
|
@@ -48,20 +42,38 @@ export default (function (_ref) {
|
|
|
48
42
|
var previousColor = function previousColor() {
|
|
49
43
|
return currentFocusedColor - 1 < 0 ? palette.length - 1 : currentFocusedColor - 1;
|
|
50
44
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
45
|
+
if (fg('editor_a11y_arrow_key_status_colour_palette')) {
|
|
46
|
+
switch (e.key) {
|
|
47
|
+
case 'ArrowRight':
|
|
48
|
+
case 'ArrowDown':
|
|
49
|
+
e.preventDefault();
|
|
50
|
+
newColorIndex = nextColor();
|
|
51
|
+
break;
|
|
52
|
+
case 'ArrowLeft':
|
|
53
|
+
case 'ArrowUp':
|
|
54
|
+
e.preventDefault();
|
|
55
|
+
newColorIndex = previousColor();
|
|
56
|
+
break;
|
|
57
|
+
case 'Tab':
|
|
58
|
+
setCurrentFocusedColor(0);
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
} else {
|
|
62
|
+
switch (e.keyCode) {
|
|
63
|
+
case VK_RIGHT:
|
|
64
|
+
case VK_DOWN:
|
|
65
|
+
e.preventDefault();
|
|
66
|
+
newColorIndex = nextColor();
|
|
67
|
+
break;
|
|
68
|
+
case VK_LEFT:
|
|
69
|
+
case VK_UP:
|
|
70
|
+
e.preventDefault();
|
|
71
|
+
newColorIndex = previousColor();
|
|
72
|
+
break;
|
|
73
|
+
case VK_TAB:
|
|
74
|
+
setCurrentFocusedColor(0);
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
65
77
|
}
|
|
66
78
|
if (newColorIndex === null) {
|
|
67
79
|
return;
|
|
@@ -70,43 +82,32 @@ export default (function (_ref) {
|
|
|
70
82
|
var newRef = colorRefs.current[newColorIndex];
|
|
71
83
|
newRef === null || newRef === void 0 || newRef.focus();
|
|
72
84
|
}, [currentFocusedColor, setCurrentFocusedColor, colorRefs]);
|
|
73
|
-
return (
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
iconColor: iconColor,
|
|
102
|
-
onClick: onClick,
|
|
103
|
-
onHover: onHover,
|
|
104
|
-
isSelected: colorValue === selectedColor,
|
|
105
|
-
tabIndex: i === 0 ? 0 : -1,
|
|
106
|
-
setRef: function setRef(el) {
|
|
107
|
-
return colorRefs.current[i] = el;
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
}))
|
|
111
|
-
);
|
|
85
|
+
return /*#__PURE__*/React.createElement("ul", {
|
|
86
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
87
|
+
className: ax(["_19bvidpf _19pku2gc _2hwxu2gc _otyridpf _18u0u2gc _1e0c1txw _1n261g80", className]),
|
|
88
|
+
style: {
|
|
89
|
+
maxWidth: cols * 32
|
|
90
|
+
},
|
|
91
|
+
onKeyDown: memoizedHandleKeyDown
|
|
92
|
+
}, palette.map(function (_ref2, i) {
|
|
93
|
+
var _ref3 = _slicedToArray(_ref2, 4),
|
|
94
|
+
colorValue = _ref3[0],
|
|
95
|
+
backgroundColor = _ref3[1],
|
|
96
|
+
borderColor = _ref3[2],
|
|
97
|
+
iconColor = _ref3[3];
|
|
98
|
+
return /*#__PURE__*/React.createElement(Color, {
|
|
99
|
+
key: colorValue,
|
|
100
|
+
value: colorValue,
|
|
101
|
+
backgroundColor: backgroundColor,
|
|
102
|
+
borderColor: borderColor,
|
|
103
|
+
iconColor: iconColor,
|
|
104
|
+
onClick: onClick,
|
|
105
|
+
onHover: onHover,
|
|
106
|
+
isSelected: colorValue === selectedColor,
|
|
107
|
+
tabIndex: i === 0 ? 0 : -1,
|
|
108
|
+
setRef: function setRef(el) {
|
|
109
|
+
return colorRefs.current[i] = el;
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}));
|
|
112
113
|
});
|