@atlaskit/status 3.0.2 → 3.0.3
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 +8 -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 +32 -48
- 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 +25 -46
- 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 +32 -49
- 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 +2 -2
- 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,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
|
|
@@ -64,36 +54,25 @@ export default (({
|
|
|
64
54
|
const newRef = colorRefs.current[newColorIndex];
|
|
65
55
|
newRef === null || newRef === void 0 ? void 0 : newRef.focus();
|
|
66
56
|
}, [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
|
-
);
|
|
57
|
+
return /*#__PURE__*/React.createElement("ul", {
|
|
58
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
59
|
+
className: ax(["_19bvidpf _19pku2gc _2hwxu2gc _otyridpf _18u0u2gc _1e0c1txw _1n261g80", className]),
|
|
60
|
+
style: {
|
|
61
|
+
maxWidth: cols * 32
|
|
62
|
+
},
|
|
63
|
+
onKeyDown: memoizedHandleKeyDown
|
|
64
|
+
}, palette.map(([colorValue, backgroundColor, borderColor, iconColor], i) => {
|
|
65
|
+
return /*#__PURE__*/React.createElement(Color, {
|
|
66
|
+
key: colorValue,
|
|
67
|
+
value: colorValue,
|
|
68
|
+
backgroundColor: backgroundColor,
|
|
69
|
+
borderColor: borderColor,
|
|
70
|
+
iconColor: iconColor,
|
|
71
|
+
onClick: onClick,
|
|
72
|
+
onHover: onHover,
|
|
73
|
+
isSelected: colorValue === selectedColor,
|
|
74
|
+
tabIndex: i === 0 ? 0 : -1,
|
|
75
|
+
setRef: el => colorRefs.current[i] = el
|
|
76
|
+
});
|
|
77
|
+
}));
|
|
99
78
|
});
|
|
@@ -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.3";
|
|
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
|
|
@@ -70,43 +64,32 @@ export default (function (_ref) {
|
|
|
70
64
|
var newRef = colorRefs.current[newColorIndex];
|
|
71
65
|
newRef === null || newRef === void 0 || newRef.focus();
|
|
72
66
|
}, [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
|
-
);
|
|
67
|
+
return /*#__PURE__*/React.createElement("ul", {
|
|
68
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
69
|
+
className: ax(["_19bvidpf _19pku2gc _2hwxu2gc _otyridpf _18u0u2gc _1e0c1txw _1n261g80", className]),
|
|
70
|
+
style: {
|
|
71
|
+
maxWidth: cols * 32
|
|
72
|
+
},
|
|
73
|
+
onKeyDown: memoizedHandleKeyDown
|
|
74
|
+
}, palette.map(function (_ref2, i) {
|
|
75
|
+
var _ref3 = _slicedToArray(_ref2, 4),
|
|
76
|
+
colorValue = _ref3[0],
|
|
77
|
+
backgroundColor = _ref3[1],
|
|
78
|
+
borderColor = _ref3[2],
|
|
79
|
+
iconColor = _ref3[3];
|
|
80
|
+
return /*#__PURE__*/React.createElement(Color, {
|
|
81
|
+
key: colorValue,
|
|
82
|
+
value: colorValue,
|
|
83
|
+
backgroundColor: backgroundColor,
|
|
84
|
+
borderColor: borderColor,
|
|
85
|
+
iconColor: iconColor,
|
|
86
|
+
onClick: onClick,
|
|
87
|
+
onHover: onHover,
|
|
88
|
+
isSelected: colorValue === selectedColor,
|
|
89
|
+
tabIndex: i === 0 ? 0 : -1,
|
|
90
|
+
setRef: function setRef(el) {
|
|
91
|
+
return colorRefs.current[i] = el;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}));
|
|
112
95
|
});
|
|
@@ -1,42 +1,28 @@
|
|
|
1
|
+
/* color.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";
|
|
7
|
-
import
|
|
8
|
-
|
|
8
|
+
import "./color.compiled.css";
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
9
11
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10
12
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
|
-
/**
|
|
12
|
-
* @jsxRuntime classic
|
|
13
|
-
* @jsx jsx
|
|
14
|
-
*/
|
|
15
13
|
import EditorDoneIcon from '@atlaskit/icon/core/migration/check-mark--editor-done';
|
|
16
|
-
import { Pressable
|
|
17
|
-
import
|
|
14
|
+
import { Pressable } from '@atlaskit/primitives/compiled';
|
|
15
|
+
import { PureComponent } from 'react';
|
|
18
16
|
import { FormattedMessage } from 'react-intl-next';
|
|
19
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
20
|
-
import { css, jsx } from '@emotion/react';
|
|
21
17
|
import { ANALYTICS_HOVER_DELAY } from '../constants';
|
|
22
18
|
import { messages } from '../i18n';
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
background: 'color.background.neutral',
|
|
27
|
-
padding: 'space.0',
|
|
28
|
-
borderRadius: 'border.radius',
|
|
29
|
-
borderWidth: 'border.width',
|
|
30
|
-
borderStyle: 'solid',
|
|
31
|
-
borderColor: 'color.border',
|
|
32
|
-
display: 'block',
|
|
33
|
-
overflow: 'hidden'
|
|
34
|
-
});
|
|
19
|
+
var styles = {
|
|
20
|
+
button: "_2rkoglpi _19it7r9e _1reo15vq _18m915vq _4t3i1tcg _1bsb1tcg _bfhkm7j4 _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _1e0c1ule"
|
|
21
|
+
};
|
|
35
22
|
|
|
36
23
|
// We have tried with changing border and padding from 1px to token near version 2px,
|
|
37
24
|
// the pop - up is being expanded to two lines.
|
|
38
|
-
|
|
39
|
-
var buttonWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tborder: 1px solid transparent;\n\tmargin: 0 ", ";\n\tfont-size: 0;\n\tdisplay: flex;\n\talign-items: center;\n\tpadding: 1px;\n\tborder-radius: ", ";\n\t&:hover {\n\t\tborder: 1px solid ", ";\n\t}\n"])), "var(--ds-space-025, 2px)", "var(--ds-space-075, 6px)", "var(--ds-border, #091E4224)");
|
|
25
|
+
var buttonWrapperStyles = null;
|
|
40
26
|
var Color = /*#__PURE__*/function (_PureComponent) {
|
|
41
27
|
function Color() {
|
|
42
28
|
var _this;
|
|
@@ -82,11 +68,14 @@ var Color = /*#__PURE__*/function (_PureComponent) {
|
|
|
82
68
|
iconColor = _this$props2.iconColor,
|
|
83
69
|
value = _this$props2.value,
|
|
84
70
|
setRef = _this$props2.setRef;
|
|
85
|
-
return
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
71
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
72
|
+
className: ax(["_ca0qt94y _u5f3t94y _n3tdt94y _19bvt94y _2rko12x7 _189et94y _1dqonqa1 _1h6d1j28 _19pkidpf _2hwxv77o _otyridpf _18u0v77o _1e0c1txw _4cvr1h6o _bfw7pp12"]),
|
|
73
|
+
style: {
|
|
74
|
+
"--_18x9sjc": ix("1px solid ".concat("var(--ds-border, #091E4224)"))
|
|
75
|
+
}
|
|
76
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, messages["".concat(value, "Color")], function (labels) {
|
|
77
|
+
return /*#__PURE__*/React.createElement(Pressable, {
|
|
78
|
+
xcss: styles.button,
|
|
90
79
|
onClick: _this2.onClick,
|
|
91
80
|
onMouseEnter: _this2.onMouseEnter,
|
|
92
81
|
onMouseLeave: _this2.onMouseLeave,
|
|
@@ -107,7 +96,7 @@ var Color = /*#__PURE__*/function (_PureComponent) {
|
|
|
107
96
|
borderColor: borderColor
|
|
108
97
|
},
|
|
109
98
|
ref: setRef
|
|
110
|
-
}, isSelected &&
|
|
99
|
+
}, isSelected && /*#__PURE__*/React.createElement(EditorDoneIcon, {
|
|
111
100
|
color: "currentColor",
|
|
112
101
|
label: labels[0]
|
|
113
102
|
}));
|
package/dist/esm/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
|
-
var Status = componentWithFG('platform_editor_css_migrate_stage_1', CompiledStatus, EmotionStatus);
|
|
5
|
-
export { Status };
|
|
1
|
+
export { Status } from './components/Status';
|
package/dist/esm/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
|
-
var Status = componentWithFG('platform_editor_css_migrate_stage_1', CompiledStatus, EmotionStatus);
|
|
7
|
-
var 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/esm/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
|
-
var StatusPicker = componentWithFG('platform_editor_css_migrate_stage_1', CompiledStatusPicker, EmotionStatusPicker);
|
|
5
|
-
export { StatusPicker };
|
|
1
|
+
export { StatusPicker } from './components/StatusPicker';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { type Color as ColorType } from '../Status';
|
|
3
3
|
interface ColorPaletteProps {
|
|
4
4
|
selectedColor?: ColorType;
|
|
@@ -7,5 +7,5 @@ interface ColorPaletteProps {
|
|
|
7
7
|
cols?: number;
|
|
8
8
|
className?: string;
|
|
9
9
|
}
|
|
10
|
-
declare const _default: ({ cols, onClick, selectedColor, className, onHover }: ColorPaletteProps) =>
|
|
10
|
+
declare const _default: ({ cols, onClick, selectedColor, className, onHover }: ColorPaletteProps) => JSX.Element;
|
|
11
11
|
export default _default;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { jsx } from '@emotion/react';
|
|
1
|
+
import { PureComponent } from 'react';
|
|
3
2
|
import { type Color as ColorType } from '../Status';
|
|
4
3
|
export interface ColorProps {
|
|
5
4
|
value: ColorType;
|
|
@@ -14,7 +13,7 @@ export interface ColorProps {
|
|
|
14
13
|
}
|
|
15
14
|
export default class Color extends PureComponent<ColorProps> {
|
|
16
15
|
private hoverStartTime;
|
|
17
|
-
render():
|
|
16
|
+
render(): JSX.Element;
|
|
18
17
|
componentWillUnmount(): void;
|
|
19
18
|
onMouseEnter: () => void;
|
|
20
19
|
onMouseLeave: () => void;
|
package/dist/types/element.d.ts
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
declare const Status: import("react").FC<Omit<Omit<import("./components/compiled/Status").OwnProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & import("react").RefAttributes<any>, "ref"> & Omit<Omit<import("./components/Status").OwnProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & import("react").RefAttributes<any>, "ref"> & import("react").RefAttributes<any>>;
|
|
3
|
-
export { Status };
|
|
1
|
+
export { Status } from './components/Status';
|
|
4
2
|
export type { StatusStyle, Props, Color } from './components/Status';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare const StatusPicker: import("react").FC<Omit<import("./components/compiled/StatusPicker").Props & import("react-intl-next").WrappedComponentProps, "intl"> & {
|
|
4
|
-
forwardedRef?: import("react").Ref<any> | undefined;
|
|
5
|
-
} & Omit<import("./components/StatusPicker").Props & import("react-intl-next").WrappedComponentProps, "intl">>;
|
|
6
|
-
export { Status, StatusPicker };
|
|
1
|
+
export { Status } from './components/Status';
|
|
2
|
+
export { StatusPicker } from './components/StatusPicker';
|
|
7
3
|
export type { StatusStyle, Props, Color } from './components/Status';
|
|
8
4
|
export type { Props as StatusPickerProps } from './components/StatusPicker';
|