@atlaskit/status 2.0.0 → 3.0.0

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/afm-cc/tsconfig.json +3 -0
  3. package/afm-jira/tsconfig.json +3 -0
  4. package/afm-post-office/tsconfig.json +3 -0
  5. package/dist/cjs/components/analytics.js +1 -1
  6. package/dist/cjs/components/compiled/Status.compiled.css +3 -0
  7. package/dist/cjs/components/compiled/Status.js +132 -0
  8. package/dist/cjs/components/compiled/StatusPicker.compiled.css +5 -0
  9. package/dist/cjs/components/compiled/StatusPicker.js +120 -0
  10. package/dist/cjs/components/compiled/internal/color-palette.compiled.css +7 -0
  11. package/dist/cjs/components/compiled/internal/color-palette.js +106 -0
  12. package/dist/cjs/components/compiled/internal/color.compiled.css +27 -0
  13. package/dist/cjs/components/compiled/internal/color.js +122 -0
  14. package/dist/cjs/element.js +5 -7
  15. package/dist/cjs/index.js +7 -13
  16. package/dist/cjs/picker.js +5 -7
  17. package/dist/es2019/components/analytics.js +1 -1
  18. package/dist/es2019/components/compiled/Status.compiled.css +3 -0
  19. package/dist/es2019/components/compiled/Status.js +110 -0
  20. package/dist/es2019/components/compiled/StatusPicker.compiled.css +5 -0
  21. package/dist/es2019/components/compiled/StatusPicker.js +87 -0
  22. package/dist/es2019/components/compiled/internal/color-palette.compiled.css +7 -0
  23. package/dist/es2019/components/compiled/internal/color-palette.js +79 -0
  24. package/dist/es2019/components/compiled/internal/color.compiled.css +27 -0
  25. package/dist/es2019/components/compiled/internal/color.js +91 -0
  26. package/dist/es2019/element.js +5 -1
  27. package/dist/es2019/index.js +8 -2
  28. package/dist/es2019/picker.js +5 -1
  29. package/dist/esm/components/analytics.js +1 -1
  30. package/dist/esm/components/compiled/Status.compiled.css +3 -0
  31. package/dist/esm/components/compiled/Status.js +122 -0
  32. package/dist/esm/components/compiled/StatusPicker.compiled.css +5 -0
  33. package/dist/esm/components/compiled/StatusPicker.js +110 -0
  34. package/dist/esm/components/compiled/internal/color-palette.compiled.css +7 -0
  35. package/dist/esm/components/compiled/internal/color-palette.js +96 -0
  36. package/dist/esm/components/compiled/internal/color.compiled.css +27 -0
  37. package/dist/esm/components/compiled/internal/color.js +113 -0
  38. package/dist/esm/element.js +5 -1
  39. package/dist/esm/index.js +8 -2
  40. package/dist/esm/picker.js +5 -1
  41. package/dist/types/components/compiled/Status.d.ts +16 -0
  42. package/dist/types/components/compiled/StatusPicker.d.ts +16 -0
  43. package/dist/types/components/compiled/internal/color-palette.d.ts +11 -0
  44. package/dist/types/components/compiled/internal/color.d.ts +22 -0
  45. package/dist/types/element.d.ts +3 -1
  46. package/dist/types/index.d.ts +6 -2
  47. package/dist/types/picker.d.ts +5 -1
  48. package/dist/types-ts4.5/components/compiled/Status.d.ts +16 -0
  49. package/dist/types-ts4.5/components/compiled/StatusPicker.d.ts +16 -0
  50. package/dist/types-ts4.5/components/compiled/internal/color-palette.d.ts +11 -0
  51. package/dist/types-ts4.5/components/compiled/internal/color.d.ts +22 -0
  52. package/dist/types-ts4.5/element.d.ts +3 -1
  53. package/dist/types-ts4.5/index.d.ts +6 -2
  54. package/dist/types-ts4.5/picker.d.ts +5 -1
  55. package/element/package.json +3 -0
  56. package/package.json +13 -4
  57. package/picker/package.json +3 -0
@@ -0,0 +1,110 @@
1
+ /* StatusPicker.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/createClass";
4
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
+ import _inherits from "@babel/runtime/helpers/inherits";
7
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
+ import "./StatusPicker.compiled.css";
9
+ import { ax, ix } from "@compiled/react/runtime";
10
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
11
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
12
+ import TextField from '@atlaskit/textfield';
13
+ import React, { PureComponent } from 'react';
14
+ import { injectIntl } from 'react-intl-next';
15
+ import ColorPalette from './internal/color-palette';
16
+ import { messages } from '../i18n';
17
+ import { N80A } from '@atlaskit/theme/colors';
18
+ var fieldTextWrapperStyles = null;
19
+ var Picker = /*#__PURE__*/function (_PureComponent) {
20
+ function Picker() {
21
+ var _this;
22
+ _classCallCheck(this, Picker);
23
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
24
+ args[_key] = arguments[_key];
25
+ }
26
+ _this = _callSuper(this, Picker, [].concat(args));
27
+ _defineProperty(_this, "fieldTextWrapperKey", Math.random().toString());
28
+ _defineProperty(_this, "colorPaletteKey", Math.random().toString());
29
+ _defineProperty(_this, "onChange", function (evt) {
30
+ // @ts-ignore
31
+ _this.props.onTextChanged(evt.target.value);
32
+ });
33
+ _defineProperty(_this, "onKeyPress", function (event) {
34
+ if (event.key === 'Enter') {
35
+ _this.props.onEnter();
36
+ }
37
+ });
38
+ _defineProperty(_this, "handleInputRef", function (ref) {
39
+ _this.inputRef = ref;
40
+ if (ref && _this.props.autoFocus) {
41
+ _this.focusInput();
42
+ }
43
+ });
44
+ _defineProperty(_this, "focusInput", function () {
45
+ if (!_this.inputRef) {
46
+ return;
47
+ }
48
+ // Defer to prevent editor scrolling to top
49
+ _this.autofocusTimeout = setTimeout(function () {
50
+ var _this$inputRef;
51
+ (_this$inputRef = _this.inputRef) === null || _this$inputRef === void 0 || _this$inputRef.focus();
52
+ });
53
+ });
54
+ return _this;
55
+ }
56
+ _inherits(Picker, _PureComponent);
57
+ return _createClass(Picker, [{
58
+ key: "render",
59
+ value: function render() {
60
+ var _this$props = this.props,
61
+ text = _this$props.text,
62
+ selectedColor = _this$props.selectedColor,
63
+ onColorClick = _this$props.onColorClick,
64
+ onColorHover = _this$props.onColorHover,
65
+ intl = _this$props.intl;
66
+
67
+ // Using <React.Fragment> instead of [] to workaround Enzyme
68
+ // (https://github.com/airbnb/enzyme/issues/1149)
69
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
70
+ key: this.fieldTextWrapperKey,
71
+ className: ax(["_19pkidpf _otyridpf _2hwxu2gc _18u0u2gc _n6346qow"]),
72
+ style: {
73
+ "--_wxcsqj": ix("var(--ds-border-bold, ".concat(N80A, ")"))
74
+ }
75
+ }, /*#__PURE__*/React.createElement(TextField, {
76
+ value: text,
77
+ isCompact: true,
78
+ ref: this.handleInputRef,
79
+ onChange: this.onChange,
80
+ onKeyPress: this.onKeyPress,
81
+ spellCheck: false,
82
+ autoComplete: "off",
83
+ "aria-label": intl.formatMessage(messages.statusInputLabel)
84
+ })), /*#__PURE__*/React.createElement(ColorPalette, {
85
+ key: this.colorPaletteKey,
86
+ onClick: onColorClick,
87
+ onHover: onColorHover,
88
+ selectedColor: selectedColor
89
+ }));
90
+ }
91
+ }, {
92
+ key: "componentDidUpdate",
93
+ value: function componentDidUpdate() {
94
+ if (this.inputRef && this.props.autoFocus) {
95
+ this.focusInput();
96
+ }
97
+ }
98
+ }, {
99
+ key: "componentWillUnmount",
100
+ value: function componentWillUnmount() {
101
+ if (this.autofocusTimeout !== undefined) {
102
+ clearTimeout(this.autofocusTimeout);
103
+ }
104
+ }
105
+ }]);
106
+ }(PureComponent);
107
+ _defineProperty(Picker, "defaultProps", {
108
+ autoFocus: true
109
+ });
110
+ export var StatusPicker = injectIntl(Picker);
@@ -0,0 +1,7 @@
1
+ ._18u0u2gc{margin-left:var(--ds-space-100,8px)}
2
+ ._19bvidpf{padding-left:0}
3
+ ._19pku2gc{margin-top:var(--ds-space-100,8px)}
4
+ ._1e0c1txw{display:flex}
5
+ ._1n261g80{flex-wrap:wrap}
6
+ ._2hwxu2gc{margin-right:var(--ds-space-100,8px)}
7
+ ._otyridpf{margin-bottom:0}
@@ -0,0 +1,96 @@
1
+ /* color-palette.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
+ import "./color-palette.compiled.css";
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ import * as colors from '@atlaskit/theme/colors';
6
+ import React, { useEffect, useRef, useCallback, useState } from 'react';
7
+ import Color from './color';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
9
+ var paletteLegacy = [['neutral', "var(--ds-background-neutral, ".concat(colors.N40, ")"), "var(--ds-border-bold, ".concat(colors.N400, ")"), "var(--ds-icon, ".concat(colors.N400, ")")], ['purple', "var(--ds-background-discovery, ".concat(colors.P50, ")"), "var(--ds-border-discovery, ".concat(colors.P400, ")"), "var(--ds-icon-discovery, ".concat(colors.P400, ")")], ['blue', "var(--ds-background-information, ".concat(colors.B50, ")"), "var(--ds-border-information, ".concat(colors.B400, ")"), "var(--ds-icon-information, ".concat(colors.B400, ")")], ['red', "var(--ds-background-danger, ".concat(colors.R50, ")"), "var(--ds-border-danger, ".concat(colors.R400, ")"), "var(--ds-icon-danger, ".concat(colors.R400, ")")], ['yellow', "var(--ds-background-warning, ".concat(colors.Y50, ")"), "var(--ds-border-warning, ".concat(colors.Y400, ")"), "var(--ds-icon-warning, ".concat(colors.Y400, ")")], ['green', "var(--ds-background-success, ".concat(colors.G50, ")"), "var(--ds-border-success, ".concat(colors.G400, ")"), "var(--ds-icon-success, ".concat(colors.G400, ")")]];
10
+ var paletteRefreshed = [['neutral', "var(--ds-background-accent-gray-subtler, ".concat(colors.N300, ")"), "var(--ds-border-bold, ".concat(colors.N400, ")"), "var(--ds-icon, ".concat(colors.N400, ")")], ['blue', "var(--ds-background-information-pressed, ".concat(colors.B300, ")"), "var(--ds-border-information, ".concat(colors.B400, ")"), "var(--ds-icon, ".concat(colors.N400, ")")], ['green', "var(--ds-background-success-pressed, ".concat(colors.G300, ")"), "var(--ds-border-success, ".concat(colors.G400, ")"), "var(--ds-icon, ".concat(colors.N400, ")")], ['yellow', "var(--ds-background-warning-pressed, ".concat(colors.Y300, ")"), "var(--ds-border-warning, ".concat(colors.Y400, ")"), "var(--ds-icon, ".concat(colors.N400, ")")], ['red', "var(--ds-background-danger-pressed, ".concat(colors.R300, ")"), "var(--ds-border-danger, ".concat(colors.R400, ")"), "var(--ds-icon, ".concat(colors.R400, ")")], ['purple', "var(--ds-background-discovery-pressed, ".concat(colors.P300, ")"), "var(--ds-border-discovery, ".concat(colors.P400, ")"), "var(--ds-icon, ".concat(colors.N400, ")")]];
11
+ var getPalette = function getPalette() {
12
+ return fg('platform-component-visual-refresh') ? paletteRefreshed : paletteLegacy;
13
+ };
14
+ var palette = getPalette();
15
+
16
+ // 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
+ var colorPaletteWrapperStyles = null;
18
+ var VK_LEFT = 37; //ArrowLeft
19
+ var VK_RIGHT = 39; //ArrowRight
20
+ var VK_UP = 38; //ArrowUp
21
+ var VK_DOWN = 40; //ArrowDown
22
+ var VK_TAB = 9;
23
+ export default (function (_ref) {
24
+ var _ref$cols = _ref.cols,
25
+ cols = _ref$cols === void 0 ? 7 : _ref$cols,
26
+ onClick = _ref.onClick,
27
+ selectedColor = _ref.selectedColor,
28
+ className = _ref.className,
29
+ onHover = _ref.onHover;
30
+ var colorRefs = useRef([]);
31
+ var _useState = useState(0),
32
+ _useState2 = _slicedToArray(_useState, 2),
33
+ currentFocusedColor = _useState2[0],
34
+ setCurrentFocusedColor = _useState2[1];
35
+ useEffect(function () {
36
+ colorRefs.current = colorRefs.current.slice(0, palette.length);
37
+ }, []);
38
+ var memoizedHandleKeyDown = useCallback(function (e) {
39
+ var newColorIndex = null;
40
+ var nextColor = function nextColor() {
41
+ return currentFocusedColor + 1 > palette.length - 1 ? 0 : currentFocusedColor + 1;
42
+ };
43
+ var previousColor = function previousColor() {
44
+ return currentFocusedColor - 1 < 0 ? palette.length - 1 : currentFocusedColor - 1;
45
+ };
46
+ switch (e.keyCode) {
47
+ case VK_RIGHT:
48
+ case VK_DOWN:
49
+ e.preventDefault();
50
+ newColorIndex = nextColor();
51
+ break;
52
+ case VK_LEFT:
53
+ case VK_UP:
54
+ e.preventDefault();
55
+ newColorIndex = previousColor();
56
+ break;
57
+ case VK_TAB:
58
+ setCurrentFocusedColor(0);
59
+ break;
60
+ }
61
+ if (newColorIndex === null) {
62
+ return;
63
+ }
64
+ setCurrentFocusedColor(newColorIndex);
65
+ var newRef = colorRefs.current[newColorIndex];
66
+ newRef === null || newRef === void 0 || newRef.focus();
67
+ }, [currentFocusedColor, setCurrentFocusedColor, colorRefs]);
68
+ return /*#__PURE__*/React.createElement("ul", {
69
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
70
+ className: ax(["_19bvidpf _19pku2gc _2hwxu2gc _otyridpf _18u0u2gc _1e0c1txw _1n261g80", className]),
71
+ style: {
72
+ maxWidth: cols * 32
73
+ },
74
+ onKeyDown: memoizedHandleKeyDown
75
+ }, palette.map(function (_ref2, i) {
76
+ var _ref3 = _slicedToArray(_ref2, 4),
77
+ colorValue = _ref3[0],
78
+ backgroundColor = _ref3[1],
79
+ borderColor = _ref3[2],
80
+ iconColor = _ref3[3];
81
+ return /*#__PURE__*/React.createElement(Color, {
82
+ key: colorValue,
83
+ value: colorValue,
84
+ backgroundColor: backgroundColor,
85
+ borderColor: borderColor,
86
+ iconColor: iconColor,
87
+ onClick: onClick,
88
+ onHover: onHover,
89
+ isSelected: colorValue === selectedColor,
90
+ tabIndex: i === 0 ? 0 : -1,
91
+ setRef: function setRef(el) {
92
+ return colorRefs.current[i] = el;
93
+ }
94
+ });
95
+ }));
96
+ });
@@ -0,0 +1,27 @@
1
+
2
+ ._19it7r9e{border:var(--ds-border-width,1px) solid var(--ds-border,#091e4224)}
3
+ ._2rko12x7{border-radius:var(--ds-space-075,6px)}
4
+ ._2rkoglpi{border-radius:var(--ds-border-radius,4px)}._189et94y{border-width:1px}
5
+ ._1dqonqa1{border-style:solid}
6
+ ._1h6d1j28{border-color:transparent}
7
+ ._18m915vq{overflow-y:hidden}
8
+ ._18u0v77o{margin-left:var(--ds-space-025,2px)}
9
+ ._19bvt94y{padding-left:1px}
10
+ ._19bvze3t{padding-left:var(--ds-space-0,0)}
11
+ ._19pkidpf{margin-top:0}
12
+ ._1bsb1tcg{width:24px}
13
+ ._1e0c1txw{display:flex}
14
+ ._1e0c1ule{display:block}
15
+ ._1reo15vq{overflow-x:hidden}
16
+ ._2hwxv77o{margin-right:var(--ds-space-025,2px)}
17
+ ._4cvr1h6o{align-items:center}
18
+ ._4t3i1tcg{height:24px}
19
+ ._bfhkm7j4{background-color:var(--ds-background-neutral,#091e420f)}
20
+ ._ca0qt94y{padding-top:1px}
21
+ ._ca0qze3t{padding-top:var(--ds-space-0,0)}
22
+ ._n3tdt94y{padding-bottom:1px}
23
+ ._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
24
+ ._otyridpf{margin-bottom:0}
25
+ ._u5f3t94y{padding-right:1px}
26
+ ._u5f3ze3t{padding-right:var(--ds-space-0,0)}
27
+ ._bfw7fovk:hover{border:var(--_9mxir2)}
@@ -0,0 +1,113 @@
1
+ /* color.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/createClass";
4
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
+ import _inherits from "@babel/runtime/helpers/inherits";
7
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
+ import "./color.compiled.css";
9
+ import * as React from 'react';
10
+ import { ax, ix } from "@compiled/react/runtime";
11
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
12
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
13
+ import EditorDoneIcon from '@atlaskit/icon/core/migration/check-mark--editor-done';
14
+ import { N50 } from '@atlaskit/theme/colors';
15
+ import { Pressable } from '@atlaskit/primitives/compiled';
16
+ import { PureComponent } from 'react';
17
+ import { FormattedMessage } from 'react-intl-next';
18
+ import { ANALYTICS_HOVER_DELAY } from '../../constants';
19
+ import { messages } from '../../i18n';
20
+ var styles = {
21
+ button: "_2rkoglpi _19it7r9e _1reo15vq _18m915vq _4t3i1tcg _1bsb1tcg _bfhkm7j4 _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _1e0c1ule"
22
+ };
23
+
24
+ // We have tried with changing border and padding from 1px to token near version 2px,
25
+ // the pop - up is being expanded to two lines.
26
+ var buttonWrapperStyles = null;
27
+ var Color = /*#__PURE__*/function (_PureComponent) {
28
+ function Color() {
29
+ var _this;
30
+ _classCallCheck(this, Color);
31
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
32
+ args[_key] = arguments[_key];
33
+ }
34
+ _this = _callSuper(this, Color, [].concat(args));
35
+ _defineProperty(_this, "hoverStartTime", 0);
36
+ _defineProperty(_this, "onMouseEnter", function () {
37
+ _this.hoverStartTime = Date.now();
38
+ });
39
+ _defineProperty(_this, "onMouseLeave", function () {
40
+ var onHover = _this.props.onHover;
41
+ var delay = Date.now() - _this.hoverStartTime;
42
+ if (delay >= ANALYTICS_HOVER_DELAY && onHover) {
43
+ onHover(_this.props.value);
44
+ }
45
+ _this.hoverStartTime = 0;
46
+ });
47
+ _defineProperty(_this, "onMouseDown", function (e) {
48
+ e.preventDefault();
49
+ });
50
+ _defineProperty(_this, "onClick", function (e) {
51
+ var _this$props = _this.props,
52
+ onClick = _this$props.onClick,
53
+ value = _this$props.value;
54
+ e.preventDefault();
55
+ onClick(value);
56
+ });
57
+ return _this;
58
+ }
59
+ _inherits(Color, _PureComponent);
60
+ return _createClass(Color, [{
61
+ key: "render",
62
+ value: function render() {
63
+ var _this2 = this;
64
+ var _this$props2 = this.props,
65
+ tabIndex = _this$props2.tabIndex,
66
+ backgroundColor = _this$props2.backgroundColor,
67
+ isSelected = _this$props2.isSelected,
68
+ borderColor = _this$props2.borderColor,
69
+ iconColor = _this$props2.iconColor,
70
+ value = _this$props2.value,
71
+ setRef = _this$props2.setRef;
72
+ return /*#__PURE__*/React.createElement("li", {
73
+ className: ax(["_ca0qt94y _u5f3t94y _n3tdt94y _19bvt94y _2rko12x7 _189et94y _1dqonqa1 _1h6d1j28 _19pkidpf _2hwxv77o _otyridpf _18u0v77o _1e0c1txw _4cvr1h6o _bfw7fovk"]),
74
+ style: {
75
+ "--_9mxir2": ix("1px solid ".concat("var(--ds-border, ".concat(N50, ")")))
76
+ }
77
+ }, /*#__PURE__*/React.createElement(FormattedMessage, messages["".concat(value, "Color")], function (labels) {
78
+ return /*#__PURE__*/React.createElement(Pressable, {
79
+ xcss: styles.button,
80
+ onClick: _this2.onClick,
81
+ onMouseEnter: _this2.onMouseEnter,
82
+ onMouseLeave: _this2.onMouseLeave,
83
+ onMouseDown: _this2.onMouseDown,
84
+ tabIndex: tabIndex,
85
+ title: labels[0]
86
+ // button element does not support aria-selected.
87
+ // For button selected (to be precise pressed) or not
88
+ // use aria-pressed as per
89
+ // https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/button_role#associated_aria_roles_states_and_properties
90
+ ,
91
+ "aria-pressed": isSelected,
92
+ style: {
93
+ backgroundColor: backgroundColor || 'transparent',
94
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
95
+ color: iconColor,
96
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
97
+ borderColor: borderColor
98
+ },
99
+ ref: setRef
100
+ }, isSelected && /*#__PURE__*/React.createElement(EditorDoneIcon, {
101
+ color: "currentColor",
102
+ label: labels[0]
103
+ }));
104
+ }));
105
+ }
106
+ }, {
107
+ key: "componentWillUnmount",
108
+ value: function componentWillUnmount() {
109
+ this.hoverStartTime = 0;
110
+ }
111
+ }]);
112
+ }(PureComponent);
113
+ export { Color as default };
@@ -1 +1,5 @@
1
- export { Status } from './components/Status';
1
+ import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
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 };
package/dist/esm/index.js CHANGED
@@ -1,2 +1,8 @@
1
- export { Status } from './components/Status';
2
- export { StatusPicker } from './components/StatusPicker';
1
+ import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
2
+ import { Status as EmotionStatus } from './components/Status';
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 +1,5 @@
1
- export { StatusPicker } from './components/StatusPicker';
1
+ import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
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 };
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
+ export type Color = 'neutral' | 'purple' | 'blue' | 'red' | 'yellow' | 'green';
4
+ export type StatusStyle = 'bold' | 'subtle';
5
+ export interface OwnProps {
6
+ text: string;
7
+ color: Color;
8
+ style?: StatusStyle;
9
+ localId?: string;
10
+ onClick?: (event: React.SyntheticEvent<any>) => void;
11
+ onHover?: () => void;
12
+ role?: string;
13
+ isBold?: boolean;
14
+ }
15
+ export type Props = OwnProps & WithAnalyticsEventsProps;
16
+ export declare const Status: import("react").ForwardRefExoticComponent<Omit<OwnProps, keyof WithAnalyticsEventsProps> & import("react").RefAttributes<any>>;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { type WrappedComponentProps } from 'react-intl-next';
3
+ import { type Color } from './Status';
4
+ export type ColorType = Color;
5
+ export interface Props {
6
+ selectedColor: ColorType;
7
+ text: string;
8
+ onEnter: () => void;
9
+ onColorClick: (value: ColorType) => void;
10
+ onColorHover?: (value: ColorType) => void;
11
+ onTextChanged: (value: string) => void;
12
+ autoFocus?: boolean;
13
+ }
14
+ export declare const StatusPicker: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
15
+ WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
16
+ };
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { type Color as ColorType } from '../Status';
3
+ interface ColorPaletteProps {
4
+ selectedColor?: ColorType;
5
+ onClick: (value: ColorType) => void;
6
+ onHover?: (value: ColorType) => void;
7
+ cols?: number;
8
+ className?: string;
9
+ }
10
+ declare const _default: ({ cols, onClick, selectedColor, className, onHover }: ColorPaletteProps) => JSX.Element;
11
+ export default _default;
@@ -0,0 +1,22 @@
1
+ import { PureComponent } from 'react';
2
+ import { type Color as ColorType } from '../Status';
3
+ export interface ColorProps {
4
+ value: ColorType;
5
+ tabIndex?: number;
6
+ isSelected?: boolean;
7
+ onClick: (value: ColorType) => void;
8
+ onHover?: (value: ColorType) => void;
9
+ backgroundColor: string;
10
+ borderColor: string;
11
+ iconColor: string;
12
+ setRef?: (value: HTMLButtonElement) => HTMLButtonElement;
13
+ }
14
+ export default class Color extends PureComponent<ColorProps> {
15
+ private hoverStartTime;
16
+ render(): JSX.Element;
17
+ componentWillUnmount(): void;
18
+ onMouseEnter: () => void;
19
+ onMouseLeave: () => void;
20
+ onMouseDown: React.MouseEventHandler<HTMLButtonElement>;
21
+ onClick: React.MouseEventHandler<HTMLButtonElement>;
22
+ }
@@ -1,2 +1,4 @@
1
- export { Status } from './components/Status';
1
+ /// <reference types="react" />
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 };
2
4
  export type { StatusStyle, Props, Color } from './components/Status';
@@ -1,4 +1,8 @@
1
- export { Status } from './components/Status';
1
+ /// <reference types="react" />
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
+ 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 };
2
7
  export type { StatusStyle, Props, Color } from './components/Status';
3
- export { StatusPicker } from './components/StatusPicker';
4
8
  export type { Props as StatusPickerProps } from './components/StatusPicker';
@@ -1,2 +1,6 @@
1
- export { StatusPicker } from './components/StatusPicker';
1
+ /// <reference types="react" />
2
+ declare const StatusPicker: import("react").FC<Omit<import("./components/compiled/StatusPicker").Props & import("react-intl-next").WrappedComponentProps, "intl"> & {
3
+ forwardedRef?: import("react").Ref<any> | undefined;
4
+ } & Omit<import("./components/StatusPicker").Props & import("react-intl-next").WrappedComponentProps, "intl">>;
5
+ export { StatusPicker };
2
6
  export type { Props, ColorType } from './components/StatusPicker';
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
+ export type Color = 'neutral' | 'purple' | 'blue' | 'red' | 'yellow' | 'green';
4
+ export type StatusStyle = 'bold' | 'subtle';
5
+ export interface OwnProps {
6
+ text: string;
7
+ color: Color;
8
+ style?: StatusStyle;
9
+ localId?: string;
10
+ onClick?: (event: React.SyntheticEvent<any>) => void;
11
+ onHover?: () => void;
12
+ role?: string;
13
+ isBold?: boolean;
14
+ }
15
+ export type Props = OwnProps & WithAnalyticsEventsProps;
16
+ export declare const Status: import("react").ForwardRefExoticComponent<Omit<OwnProps, keyof WithAnalyticsEventsProps> & import("react").RefAttributes<any>>;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { type WrappedComponentProps } from 'react-intl-next';
3
+ import { type Color } from './Status';
4
+ export type ColorType = Color;
5
+ export interface Props {
6
+ selectedColor: ColorType;
7
+ text: string;
8
+ onEnter: () => void;
9
+ onColorClick: (value: ColorType) => void;
10
+ onColorHover?: (value: ColorType) => void;
11
+ onTextChanged: (value: string) => void;
12
+ autoFocus?: boolean;
13
+ }
14
+ export declare const StatusPicker: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
15
+ WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
16
+ };
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { type Color as ColorType } from '../Status';
3
+ interface ColorPaletteProps {
4
+ selectedColor?: ColorType;
5
+ onClick: (value: ColorType) => void;
6
+ onHover?: (value: ColorType) => void;
7
+ cols?: number;
8
+ className?: string;
9
+ }
10
+ declare const _default: ({ cols, onClick, selectedColor, className, onHover }: ColorPaletteProps) => JSX.Element;
11
+ export default _default;
@@ -0,0 +1,22 @@
1
+ import { PureComponent } from 'react';
2
+ import { type Color as ColorType } from '../Status';
3
+ export interface ColorProps {
4
+ value: ColorType;
5
+ tabIndex?: number;
6
+ isSelected?: boolean;
7
+ onClick: (value: ColorType) => void;
8
+ onHover?: (value: ColorType) => void;
9
+ backgroundColor: string;
10
+ borderColor: string;
11
+ iconColor: string;
12
+ setRef?: (value: HTMLButtonElement) => HTMLButtonElement;
13
+ }
14
+ export default class Color extends PureComponent<ColorProps> {
15
+ private hoverStartTime;
16
+ render(): JSX.Element;
17
+ componentWillUnmount(): void;
18
+ onMouseEnter: () => void;
19
+ onMouseLeave: () => void;
20
+ onMouseDown: React.MouseEventHandler<HTMLButtonElement>;
21
+ onClick: React.MouseEventHandler<HTMLButtonElement>;
22
+ }
@@ -1,2 +1,4 @@
1
- export { Status } from './components/Status';
1
+ /// <reference types="react" />
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 };
2
4
  export type { StatusStyle, Props, Color } from './components/Status';
@@ -1,4 +1,8 @@
1
- export { Status } from './components/Status';
1
+ /// <reference types="react" />
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
+ 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 };
2
7
  export type { StatusStyle, Props, Color } from './components/Status';
3
- export { StatusPicker } from './components/StatusPicker';
4
8
  export type { Props as StatusPickerProps } from './components/StatusPicker';
@@ -1,2 +1,6 @@
1
- export { StatusPicker } from './components/StatusPicker';
1
+ /// <reference types="react" />
2
+ declare const StatusPicker: import("react").FC<Omit<import("./components/compiled/StatusPicker").Props & import("react-intl-next").WrappedComponentProps, "intl"> & {
3
+ forwardedRef?: import("react").Ref<any> | undefined;
4
+ } & Omit<import("./components/StatusPicker").Props & import("react-intl-next").WrappedComponentProps, "intl">>;
5
+ export { StatusPicker };
2
6
  export type { Props, ColorType } from './components/StatusPicker';
@@ -3,6 +3,9 @@
3
3
  "main": "../dist/cjs/element.js",
4
4
  "module": "../dist/esm/element.js",
5
5
  "module:es2019": "../dist/es2019/element.js",
6
+ "sideEffects": [
7
+ "*.compiled.css"
8
+ ],
6
9
  "types": "../dist/types/element.d.ts",
7
10
  "typesVersions": {
8
11
  ">=4.5 <5.4": {