@atlaskit/color-picker 3.1.3 → 3.1.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 +6 -0
- package/dist/cjs/components/ColorCard.js +8 -3
- package/dist/cjs/components/ColorPaletteMenu.js +2 -1
- package/dist/cjs/components/ColorPicker.js +1 -1
- package/dist/cjs/components/Trigger.js +5 -3
- package/dist/cjs/components/components.js +1 -1
- package/dist/cjs/styled/ColorCard.js +3 -3
- package/dist/cjs/styled/ColorPalette.js +3 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/ColorCard.js +8 -3
- package/dist/es2019/components/ColorPaletteMenu.js +2 -1
- package/dist/es2019/components/ColorPicker.js +1 -1
- package/dist/es2019/components/Trigger.js +5 -3
- package/dist/es2019/components/components.js +1 -1
- package/dist/es2019/styled/ColorCard.js +3 -3
- package/dist/es2019/styled/ColorPalette.js +3 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/ColorCard.js +8 -3
- package/dist/esm/components/ColorPaletteMenu.js +2 -1
- package/dist/esm/components/ColorPicker.js +1 -1
- package/dist/esm/components/Trigger.js +5 -3
- package/dist/esm/components/components.js +1 -1
- package/dist/esm/styled/ColorCard.js +3 -3
- package/dist/esm/styled/ColorPalette.js +3 -2
- package/dist/esm/version.json +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -16,6 +16,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
16
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
17
|
var _done = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/done"));
|
|
18
18
|
var _theme = require("@atlaskit/theme");
|
|
19
|
+
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
19
20
|
var _ColorCard = require("../styled/ColorCard");
|
|
20
21
|
var _constants = require("../constants");
|
|
21
22
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -73,11 +74,15 @@ var ColorCard = /*#__PURE__*/function (_PureComponent) {
|
|
|
73
74
|
_this$props3$checkMar = _this$props3.checkMarkColor,
|
|
74
75
|
checkMarkColor = _this$props3$checkMar === void 0 ? _theme.colors.N0 : _this$props3$checkMar,
|
|
75
76
|
isTabbing = _this$props3.isTabbing;
|
|
76
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
77
|
+
return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
78
|
+
content: label
|
|
79
|
+
}, /*#__PURE__*/_react.default.createElement(_ColorCard.ColorCardOption, {
|
|
77
80
|
onClick: this.onClick,
|
|
78
81
|
onMouseDown: this.onMouseDown,
|
|
79
82
|
focused: focused,
|
|
80
|
-
|
|
83
|
+
role: "radio",
|
|
84
|
+
"aria-checked": selected,
|
|
85
|
+
"aria-label": label,
|
|
81
86
|
tabIndex: 0,
|
|
82
87
|
onKeyDown: this.onKeyDown,
|
|
83
88
|
isTabbing: isTabbing
|
|
@@ -86,7 +91,7 @@ var ColorCard = /*#__PURE__*/function (_PureComponent) {
|
|
|
86
91
|
}, selected && /*#__PURE__*/_react.default.createElement(_ColorCard.ColorCardContentCheckMark, null, /*#__PURE__*/_react.default.createElement(_done.default, {
|
|
87
92
|
primaryColor: checkMarkColor,
|
|
88
93
|
label: ""
|
|
89
|
-
}))));
|
|
94
|
+
})))));
|
|
90
95
|
}
|
|
91
96
|
}]);
|
|
92
97
|
return ColorCard;
|
|
@@ -71,7 +71,8 @@ var ColorPaletteMenuWithoutAnalytics = /*#__PURE__*/function (_React$Component)
|
|
|
71
71
|
return /*#__PURE__*/_react.default.createElement(_ColorPalette.ColorPaletteMenu, {
|
|
72
72
|
cols: cols,
|
|
73
73
|
"aria-label": fullLabel,
|
|
74
|
-
mode: mode
|
|
74
|
+
mode: mode,
|
|
75
|
+
role: "radiogroup"
|
|
75
76
|
}, /*#__PURE__*/_react.default.createElement(_ColorPalette.ColorPaletteContainer, {
|
|
76
77
|
mode: mode
|
|
77
78
|
}, options.map(function (_ref) {
|
|
@@ -37,7 +37,7 @@ var defaultPopperProps = {
|
|
|
37
37
|
placement: 'bottom-start'
|
|
38
38
|
};
|
|
39
39
|
var packageName = "@atlaskit/color-picker";
|
|
40
|
-
var packageVersion = "3.1.
|
|
40
|
+
var packageVersion = "3.1.4";
|
|
41
41
|
var ColorPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
|
|
42
42
|
(0, _inherits2.default)(ColorPickerWithoutAnalytics, _React$Component);
|
|
43
43
|
var _super = _createSuper(ColorPickerWithoutAnalytics);
|
|
@@ -14,6 +14,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
var _react = _interopRequireDefault(require("react"));
|
|
16
16
|
var _ColorCard = require("../styled/ColorCard");
|
|
17
|
+
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
17
18
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
18
19
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
19
20
|
var ColorCard = /*#__PURE__*/function (_React$PureComponent) {
|
|
@@ -46,8 +47,9 @@ var ColorCard = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
46
47
|
value = _this$props.value,
|
|
47
48
|
label = _this$props.label,
|
|
48
49
|
expanded = _this$props.expanded;
|
|
49
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
50
|
-
|
|
50
|
+
return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
51
|
+
content: label
|
|
52
|
+
}, /*#__PURE__*/_react.default.createElement(_ColorCard.ColorCardButton, {
|
|
51
53
|
onClick: this.onClick,
|
|
52
54
|
onMouseDown: this.onMouseDown,
|
|
53
55
|
focused: expanded,
|
|
@@ -57,7 +59,7 @@ var ColorCard = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
57
59
|
type: "button"
|
|
58
60
|
}, /*#__PURE__*/_react.default.createElement(_ColorCard.ColorCardContent, {
|
|
59
61
|
color: value || 'transparent'
|
|
60
|
-
}));
|
|
62
|
+
})));
|
|
61
63
|
}
|
|
62
64
|
}]);
|
|
63
65
|
return ColorCard;
|
|
@@ -18,7 +18,7 @@ var MenuList = function MenuList(props) {
|
|
|
18
18
|
innerRef = props.innerRef,
|
|
19
19
|
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
20
20
|
return /*#__PURE__*/_react.default.createElement(_ColorPalette.ColorPaletteContainer, (0, _extends2.default)({
|
|
21
|
-
role: "
|
|
21
|
+
role: "radiogroup",
|
|
22
22
|
style: {
|
|
23
23
|
maxWidth: cols ? (0, _utils.getWidth)(cols) : undefined
|
|
24
24
|
},
|
|
@@ -18,7 +18,7 @@ var buttonFocusedBorder = "border-color: ".concat("var(--ds-border-focused, ".co
|
|
|
18
18
|
var sharedColorContainerStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: inline-block;\n position: relative;\n width: ", "px;\n height: ", "px;\n border: 2px solid transparent;\n box-sizing: border-box;\n border-radius: ", "px;\n transition: border-color 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38);\n background-color: transparent;\n border-color: transparent;\n padding: 0;\n cursor: pointer;\n outline: none;\n"])), _constants.COLOR_CARD_SIZE, _constants.COLOR_CARD_SIZE, (0, _theme.borderRadius)() * 2);
|
|
19
19
|
var ColorCardOption = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n\n ", "\n\n ", ";\n"])), sharedColorContainerStyles, function (props) {
|
|
20
20
|
if (props.isTabbing === undefined || props.isTabbing) {
|
|
21
|
-
return "&:hover,\n
|
|
21
|
+
return "&:hover,\n &:focus {\n border-color: ".concat("var(--ds-border-focused, ".concat(_theme.colors.B75, ")"), ";\n }");
|
|
22
22
|
}
|
|
23
23
|
}, function (props) {
|
|
24
24
|
if (props.focused && !props.isTabbing) {
|
|
@@ -33,12 +33,12 @@ var ColorCardButton = _styledComponents.default.button(_templateObject3 || (_tem
|
|
|
33
33
|
});
|
|
34
34
|
exports.ColorCardButton = ColorCardButton;
|
|
35
35
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
36
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
36
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
37
37
|
var ColorCardContent = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n top: 1px;\n left: 1px;\n width: 24px;\n height: 24px;\n border-radius: ", "px;\n background: ", ";\n box-shadow: inset 0px 0px 0px 1px\n ", ";\n"])), (0, _theme.borderRadius)(), function (props) {
|
|
38
38
|
return props.color;
|
|
39
39
|
}, "var(--ds-background-inverse-subtle, ".concat(_theme.colors.DN600A, ")"));
|
|
40
40
|
|
|
41
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
41
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
42
42
|
exports.ColorCardContent = ColorCardContent;
|
|
43
43
|
var ColorCardContentCheckMark = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n margin: 1px;\n"])));
|
|
44
44
|
exports.ColorCardContentCheckMark = ColorCardContentCheckMark;
|
|
@@ -10,9 +10,10 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
10
10
|
var _theme = require("@atlaskit/theme");
|
|
11
11
|
var _utils = require("../utils");
|
|
12
12
|
var _types = require("../types");
|
|
13
|
+
var _constants = require("../constants");
|
|
13
14
|
var _templateObject, _templateObject2, _templateObject3; // AFP-2532 TODO: Fix automatic suppressions below
|
|
14
15
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
15
|
-
var ColorCardWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n margin: ", ";\n"])), "var(--ds-space-025, 2px)");
|
|
16
|
+
var ColorCardWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n margin: ", ";\n height: ", "px;\n"])), "var(--ds-space-025, 2px)", _constants.COLOR_CARD_SIZE);
|
|
16
17
|
exports.ColorCardWrapper = ColorCardWrapper;
|
|
17
18
|
var ColorPaletteContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-wrap: wrap;\n padding: ", ";\n"])), function (props) {
|
|
18
19
|
return props.mode === _types.Mode.Compact ? "0" : "var(--ds-space-050, 4px)";
|
|
@@ -21,6 +22,6 @@ exports.ColorPaletteContainer = ColorPaletteContainer;
|
|
|
21
22
|
var ColorPaletteMenu = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n margin: 0;\n background-color: ", ";\n width: ", "px;\n ", "\n"])), "var(--ds-surface-overlay, ".concat(_theme.colors.N0, ")"), function (props) {
|
|
22
23
|
return (0, _utils.getWidth)(props.cols);
|
|
23
24
|
}, function (props) {
|
|
24
|
-
return props.mode && props.mode === _types.Mode.Standard && "\n box-radius: ".concat("var(--ds-radius-100, 3px)", ";\n box-shadow: ", "var(--ds-shadow-overlay, ".concat("0 0 0 1px ".concat(_theme.colors.N40, ", 0 0 8px ").concat(_theme.colors.N40), ")"), ";\n width: ", (0, _utils.getWidth)(props.cols) + (0, _theme.gridSize)(), "px;\n ");
|
|
25
|
+
return props.mode && props.mode === _types.Mode.Standard && "\n box-radius: ".concat("var(--ds-border-radius-100, 3px)", ";\n box-shadow: ", "var(--ds-shadow-overlay, ".concat("0 0 0 1px ".concat(_theme.colors.N40, ", 0 0 8px ").concat(_theme.colors.N40), ")"), ";\n width: ", (0, _utils.getWidth)(props.cols) + (0, _theme.gridSize)(), "px;\n ");
|
|
25
26
|
});
|
|
26
27
|
exports.ColorPaletteMenu = ColorPaletteMenu;
|
package/dist/cjs/version.json
CHANGED
|
@@ -5,6 +5,7 @@ import EditorDoneIcon from '@atlaskit/icon/glyph/editor/done';
|
|
|
5
5
|
// AFP-2532 TODO: Fix automatic suppressions below
|
|
6
6
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
7
7
|
import { colors } from '@atlaskit/theme';
|
|
8
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
8
9
|
import { ColorCardOption, ColorCardContent, ColorCardContentCheckMark } from '../styled/ColorCard';
|
|
9
10
|
import { KEY_SPACE, KEY_ENTER } from '../constants';
|
|
10
11
|
export default class ColorCard extends PureComponent {
|
|
@@ -52,11 +53,15 @@ export default class ColorCard extends PureComponent {
|
|
|
52
53
|
checkMarkColor = colors.N0,
|
|
53
54
|
isTabbing
|
|
54
55
|
} = this.props;
|
|
55
|
-
return /*#__PURE__*/React.createElement(
|
|
56
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
57
|
+
content: label
|
|
58
|
+
}, /*#__PURE__*/React.createElement(ColorCardOption, {
|
|
56
59
|
onClick: this.onClick,
|
|
57
60
|
onMouseDown: this.onMouseDown,
|
|
58
61
|
focused: focused,
|
|
59
|
-
"
|
|
62
|
+
role: "radio",
|
|
63
|
+
"aria-checked": selected,
|
|
64
|
+
"aria-label": label,
|
|
60
65
|
tabIndex: 0,
|
|
61
66
|
onKeyDown: this.onKeyDown,
|
|
62
67
|
isTabbing: isTabbing
|
|
@@ -65,6 +70,6 @@ export default class ColorCard extends PureComponent {
|
|
|
65
70
|
}, selected && /*#__PURE__*/React.createElement(ColorCardContentCheckMark, null, /*#__PURE__*/React.createElement(EditorDoneIcon, {
|
|
66
71
|
primaryColor: checkMarkColor,
|
|
67
72
|
label: ""
|
|
68
|
-
}))));
|
|
73
|
+
})))));
|
|
69
74
|
}
|
|
70
75
|
}
|
|
@@ -48,7 +48,8 @@ export class ColorPaletteMenuWithoutAnalytics extends React.Component {
|
|
|
48
48
|
return /*#__PURE__*/React.createElement(ColorPaletteMenu, {
|
|
49
49
|
cols: cols,
|
|
50
50
|
"aria-label": fullLabel,
|
|
51
|
-
mode: mode
|
|
51
|
+
mode: mode,
|
|
52
|
+
role: "radiogroup"
|
|
52
53
|
}, /*#__PURE__*/React.createElement(ColorPaletteContainer, {
|
|
53
54
|
mode: mode
|
|
54
55
|
}, options.map(({
|
|
@@ -19,7 +19,7 @@ const defaultPopperProps = {
|
|
|
19
19
|
placement: 'bottom-start'
|
|
20
20
|
};
|
|
21
21
|
const packageName = "@atlaskit/color-picker";
|
|
22
|
-
const packageVersion = "3.1.
|
|
22
|
+
const packageVersion = "3.1.4";
|
|
23
23
|
export class ColorPickerWithoutAnalytics extends React.Component {
|
|
24
24
|
constructor(...args) {
|
|
25
25
|
super(...args);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ColorCardButton, ColorCardContent } from '../styled/ColorCard';
|
|
4
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
4
5
|
export default class ColorCard extends React.PureComponent {
|
|
5
6
|
constructor(...args) {
|
|
6
7
|
super(...args);
|
|
@@ -24,8 +25,9 @@ export default class ColorCard extends React.PureComponent {
|
|
|
24
25
|
label,
|
|
25
26
|
expanded
|
|
26
27
|
} = this.props;
|
|
27
|
-
return /*#__PURE__*/React.createElement(
|
|
28
|
-
|
|
28
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
29
|
+
content: label
|
|
30
|
+
}, /*#__PURE__*/React.createElement(ColorCardButton, {
|
|
29
31
|
onClick: this.onClick,
|
|
30
32
|
onMouseDown: this.onMouseDown,
|
|
31
33
|
focused: expanded,
|
|
@@ -35,6 +37,6 @@ export default class ColorCard extends React.PureComponent {
|
|
|
35
37
|
type: "button"
|
|
36
38
|
}, /*#__PURE__*/React.createElement(ColorCardContent, {
|
|
37
39
|
color: value || 'transparent'
|
|
38
|
-
}));
|
|
40
|
+
})));
|
|
39
41
|
}
|
|
40
42
|
}
|
|
@@ -25,7 +25,7 @@ export const ColorCardOption = styled.div`
|
|
|
25
25
|
${props => {
|
|
26
26
|
if (props.isTabbing === undefined || props.isTabbing) {
|
|
27
27
|
return `&:hover,
|
|
28
|
-
|
|
28
|
+
&:focus {
|
|
29
29
|
border-color: ${`var(--ds-border-focused, ${colors.B75})`};
|
|
30
30
|
}`;
|
|
31
31
|
}
|
|
@@ -53,7 +53,7 @@ export const ColorCardButton = styled.button`
|
|
|
53
53
|
}
|
|
54
54
|
}};
|
|
55
55
|
`;
|
|
56
|
-
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
56
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
57
57
|
export const ColorCardContent = styled.div`
|
|
58
58
|
position: absolute;
|
|
59
59
|
top: 1px;
|
|
@@ -66,7 +66,7 @@ export const ColorCardContent = styled.div`
|
|
|
66
66
|
${`var(--ds-background-inverse-subtle, ${colors.DN600A})`};
|
|
67
67
|
`;
|
|
68
68
|
|
|
69
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
69
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
70
70
|
export const ColorCardContentCheckMark = styled.div`
|
|
71
71
|
margin: 1px;
|
|
72
72
|
`;
|
|
@@ -4,9 +4,11 @@ import styled from 'styled-components';
|
|
|
4
4
|
import { gridSize, colors } from '@atlaskit/theme';
|
|
5
5
|
import { getWidth } from '../utils';
|
|
6
6
|
import { Mode } from '../types';
|
|
7
|
+
import { COLOR_CARD_SIZE } from '../constants';
|
|
7
8
|
export const ColorCardWrapper = styled.div`
|
|
8
9
|
display: flex;
|
|
9
10
|
margin: ${"var(--ds-space-025, 2px)"};
|
|
11
|
+
height: ${COLOR_CARD_SIZE}px;
|
|
10
12
|
`;
|
|
11
13
|
export const ColorPaletteContainer = styled.div`
|
|
12
14
|
display: flex;
|
|
@@ -19,7 +21,7 @@ export const ColorPaletteMenu = styled.div`
|
|
|
19
21
|
background-color: ${`var(--ds-surface-overlay, ${colors.N0})`};
|
|
20
22
|
width: ${props => getWidth(props.cols)}px;
|
|
21
23
|
${props => props.mode && props.mode === Mode.Standard && `
|
|
22
|
-
box-radius: ${"var(--ds-radius-100, 3px)"};
|
|
24
|
+
box-radius: ${"var(--ds-border-radius-100, 3px)"};
|
|
23
25
|
box-shadow: ${`var(--ds-shadow-overlay, ${`0 0 0 1px ${colors.N40}, 0 0 8px ${colors.N40}`})`};
|
|
24
26
|
width: ${getWidth(props.cols) + gridSize()}px;
|
|
25
27
|
`}
|
package/dist/es2019/version.json
CHANGED
|
@@ -13,6 +13,7 @@ import EditorDoneIcon from '@atlaskit/icon/glyph/editor/done';
|
|
|
13
13
|
// AFP-2532 TODO: Fix automatic suppressions below
|
|
14
14
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
15
15
|
import { colors } from '@atlaskit/theme';
|
|
16
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
16
17
|
import { ColorCardOption, ColorCardContent, ColorCardContentCheckMark } from '../styled/ColorCard';
|
|
17
18
|
import { KEY_SPACE, KEY_ENTER } from '../constants';
|
|
18
19
|
var ColorCard = /*#__PURE__*/function (_PureComponent) {
|
|
@@ -65,11 +66,15 @@ var ColorCard = /*#__PURE__*/function (_PureComponent) {
|
|
|
65
66
|
_this$props3$checkMar = _this$props3.checkMarkColor,
|
|
66
67
|
checkMarkColor = _this$props3$checkMar === void 0 ? colors.N0 : _this$props3$checkMar,
|
|
67
68
|
isTabbing = _this$props3.isTabbing;
|
|
68
|
-
return /*#__PURE__*/React.createElement(
|
|
69
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
70
|
+
content: label
|
|
71
|
+
}, /*#__PURE__*/React.createElement(ColorCardOption, {
|
|
69
72
|
onClick: this.onClick,
|
|
70
73
|
onMouseDown: this.onMouseDown,
|
|
71
74
|
focused: focused,
|
|
72
|
-
|
|
75
|
+
role: "radio",
|
|
76
|
+
"aria-checked": selected,
|
|
77
|
+
"aria-label": label,
|
|
73
78
|
tabIndex: 0,
|
|
74
79
|
onKeyDown: this.onKeyDown,
|
|
75
80
|
isTabbing: isTabbing
|
|
@@ -78,7 +83,7 @@ var ColorCard = /*#__PURE__*/function (_PureComponent) {
|
|
|
78
83
|
}, selected && /*#__PURE__*/React.createElement(ColorCardContentCheckMark, null, /*#__PURE__*/React.createElement(EditorDoneIcon, {
|
|
79
84
|
primaryColor: checkMarkColor,
|
|
80
85
|
label: ""
|
|
81
|
-
}))));
|
|
86
|
+
})))));
|
|
82
87
|
}
|
|
83
88
|
}]);
|
|
84
89
|
return ColorCard;
|
|
@@ -64,7 +64,8 @@ export var ColorPaletteMenuWithoutAnalytics = /*#__PURE__*/function (_React$Comp
|
|
|
64
64
|
return /*#__PURE__*/React.createElement(ColorPaletteMenu, {
|
|
65
65
|
cols: cols,
|
|
66
66
|
"aria-label": fullLabel,
|
|
67
|
-
mode: mode
|
|
67
|
+
mode: mode,
|
|
68
|
+
role: "radiogroup"
|
|
68
69
|
}, /*#__PURE__*/React.createElement(ColorPaletteContainer, {
|
|
69
70
|
mode: mode
|
|
70
71
|
}, options.map(function (_ref) {
|
|
@@ -27,7 +27,7 @@ var defaultPopperProps = {
|
|
|
27
27
|
placement: 'bottom-start'
|
|
28
28
|
};
|
|
29
29
|
var packageName = "@atlaskit/color-picker";
|
|
30
|
-
var packageVersion = "3.1.
|
|
30
|
+
var packageVersion = "3.1.4";
|
|
31
31
|
export var ColorPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
|
|
32
32
|
_inherits(ColorPickerWithoutAnalytics, _React$Component);
|
|
33
33
|
var _super = _createSuper(ColorPickerWithoutAnalytics);
|
|
@@ -9,6 +9,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
9
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { ColorCardButton, ColorCardContent } from '../styled/ColorCard';
|
|
12
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
12
13
|
var ColorCard = /*#__PURE__*/function (_React$PureComponent) {
|
|
13
14
|
_inherits(ColorCard, _React$PureComponent);
|
|
14
15
|
var _super = _createSuper(ColorCard);
|
|
@@ -39,8 +40,9 @@ var ColorCard = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
39
40
|
value = _this$props.value,
|
|
40
41
|
label = _this$props.label,
|
|
41
42
|
expanded = _this$props.expanded;
|
|
42
|
-
return /*#__PURE__*/React.createElement(
|
|
43
|
-
|
|
43
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
44
|
+
content: label
|
|
45
|
+
}, /*#__PURE__*/React.createElement(ColorCardButton, {
|
|
44
46
|
onClick: this.onClick,
|
|
45
47
|
onMouseDown: this.onMouseDown,
|
|
46
48
|
focused: expanded,
|
|
@@ -50,7 +52,7 @@ var ColorCard = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
50
52
|
type: "button"
|
|
51
53
|
}, /*#__PURE__*/React.createElement(ColorCardContent, {
|
|
52
54
|
color: value || 'transparent'
|
|
53
|
-
}));
|
|
55
|
+
})));
|
|
54
56
|
}
|
|
55
57
|
}]);
|
|
56
58
|
return ColorCard;
|
|
@@ -11,7 +11,7 @@ export var MenuList = function MenuList(props) {
|
|
|
11
11
|
innerRef = props.innerRef,
|
|
12
12
|
rest = _objectWithoutProperties(props, _excluded);
|
|
13
13
|
return /*#__PURE__*/React.createElement(ColorPaletteContainer, _extends({
|
|
14
|
-
role: "
|
|
14
|
+
role: "radiogroup",
|
|
15
15
|
style: {
|
|
16
16
|
maxWidth: cols ? getWidth(cols) : undefined
|
|
17
17
|
},
|
|
@@ -9,7 +9,7 @@ var buttonFocusedBorder = "border-color: ".concat("var(--ds-border-focused, ".co
|
|
|
9
9
|
var sharedColorContainerStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-block;\n position: relative;\n width: ", "px;\n height: ", "px;\n border: 2px solid transparent;\n box-sizing: border-box;\n border-radius: ", "px;\n transition: border-color 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38);\n background-color: transparent;\n border-color: transparent;\n padding: 0;\n cursor: pointer;\n outline: none;\n"])), COLOR_CARD_SIZE, COLOR_CARD_SIZE, borderRadius() * 2);
|
|
10
10
|
export var ColorCardOption = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", ";\n\n ", "\n\n ", ";\n"])), sharedColorContainerStyles, function (props) {
|
|
11
11
|
if (props.isTabbing === undefined || props.isTabbing) {
|
|
12
|
-
return "&:hover,\n
|
|
12
|
+
return "&:hover,\n &:focus {\n border-color: ".concat("var(--ds-border-focused, ".concat(colors.B75, ")"), ";\n }");
|
|
13
13
|
}
|
|
14
14
|
}, function (props) {
|
|
15
15
|
if (props.focused && !props.isTabbing) {
|
|
@@ -21,10 +21,10 @@ export var ColorCardButton = styled.button(_templateObject3 || (_templateObject3
|
|
|
21
21
|
return buttonFocusedBorder;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
24
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
25
25
|
export var ColorCardContent = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n top: 1px;\n left: 1px;\n width: 24px;\n height: 24px;\n border-radius: ", "px;\n background: ", ";\n box-shadow: inset 0px 0px 0px 1px\n ", ";\n"])), borderRadius(), function (props) {
|
|
26
26
|
return props.color;
|
|
27
27
|
}, "var(--ds-background-inverse-subtle, ".concat(colors.DN600A, ")"));
|
|
28
28
|
|
|
29
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
29
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
30
30
|
export var ColorCardContentCheckMark = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin: 1px;\n"])));
|
|
@@ -6,12 +6,13 @@ import styled from 'styled-components';
|
|
|
6
6
|
import { gridSize, colors } from '@atlaskit/theme';
|
|
7
7
|
import { getWidth } from '../utils';
|
|
8
8
|
import { Mode } from '../types';
|
|
9
|
-
|
|
9
|
+
import { COLOR_CARD_SIZE } from '../constants';
|
|
10
|
+
export var ColorCardWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n margin: ", ";\n height: ", "px;\n"])), "var(--ds-space-025, 2px)", COLOR_CARD_SIZE);
|
|
10
11
|
export var ColorPaletteContainer = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: wrap;\n padding: ", ";\n"])), function (props) {
|
|
11
12
|
return props.mode === Mode.Compact ? "0" : "var(--ds-space-050, 4px)";
|
|
12
13
|
});
|
|
13
14
|
export var ColorPaletteMenu = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n margin: 0;\n background-color: ", ";\n width: ", "px;\n ", "\n"])), "var(--ds-surface-overlay, ".concat(colors.N0, ")"), function (props) {
|
|
14
15
|
return getWidth(props.cols);
|
|
15
16
|
}, function (props) {
|
|
16
|
-
return props.mode && props.mode === Mode.Standard && "\n box-radius: ".concat("var(--ds-radius-100, 3px)", ";\n box-shadow: ", "var(--ds-shadow-overlay, ".concat("0 0 0 1px ".concat(colors.N40, ", 0 0 8px ").concat(colors.N40), ")"), ";\n width: ", getWidth(props.cols) + gridSize(), "px;\n ");
|
|
17
|
+
return props.mode && props.mode === Mode.Standard && "\n box-radius: ".concat("var(--ds-border-radius-100, 3px)", ";\n box-shadow: ", "var(--ds-shadow-overlay, ".concat("0 0 0 1px ".concat(colors.N40, ", 0 0 8px ").concat(colors.N40), ")"), ";\n width: ", getWidth(props.cols) + gridSize(), "px;\n ");
|
|
17
18
|
});
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/color-picker",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.4",
|
|
4
4
|
"description": "Jira Color Picker Component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -31,9 +31,10 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
33
33
|
"@atlaskit/icon": "^21.12.0",
|
|
34
|
-
"@atlaskit/select": "^16.
|
|
34
|
+
"@atlaskit/select": "^16.5.0",
|
|
35
35
|
"@atlaskit/theme": "^12.5.0",
|
|
36
|
-
"@atlaskit/tokens": "^1.
|
|
36
|
+
"@atlaskit/tokens": "^1.14.0",
|
|
37
|
+
"@atlaskit/tooltip": "^17.8.0",
|
|
37
38
|
"@babel/runtime": "^7.0.0",
|
|
38
39
|
"memoize-one": "^6.0.0",
|
|
39
40
|
"styled-components": "^3.2.6"
|
|
@@ -42,12 +43,11 @@
|
|
|
42
43
|
"react": "^16.8.0"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
45
|
-
"@atlaskit/docs": "*",
|
|
46
46
|
"@atlaskit/visual-regression": "*",
|
|
47
47
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
48
|
+
"@testing-library/react": "^12.1.5",
|
|
49
|
+
"@testing-library/user-event": "^14.4.3",
|
|
48
50
|
"ast-types": "^0.13.3",
|
|
49
|
-
"enzyme": "^3.10.0",
|
|
50
|
-
"enzyme-adapter-react-16": "^1.15.1",
|
|
51
51
|
"jscodeshift": "^0.13.0",
|
|
52
52
|
"react": "^16.8.0",
|
|
53
53
|
"typescript": "~4.9.5"
|