@atlaskit/color-picker 1.2.6 → 2.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.
- package/CHANGELOG.md +18 -0
- package/dist/cjs/components/ColorCard.js +2 -2
- package/dist/cjs/components/ColorPicker.js +1 -1
- package/dist/cjs/components/components.js +4 -2
- package/dist/cjs/constants.js +1 -1
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/styled/ColorCard.js +14 -11
- package/dist/cjs/styled/ColorPalette.js +4 -2
- package/dist/cjs/utils.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/ColorCard.js +4 -3
- package/dist/es2019/components/ColorPicker.js +1 -1
- package/dist/es2019/styled/ColorCard.js +14 -9
- package/dist/es2019/styled/ColorPalette.js +3 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/ColorCard.js +3 -3
- package/dist/esm/components/ColorPicker.js +1 -1
- package/dist/esm/components/components.js +2 -1
- package/dist/esm/styled/ColorCard.js +11 -11
- package/dist/esm/styled/ColorPalette.js +3 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/components/ColorPaletteMenu.d.ts +2 -2
- package/dist/types/components/ColorPicker.d.ts +2 -2
- package/dist/types/components/components.d.ts +1 -0
- package/dist/types/styled/ColorCard.d.ts +1 -0
- package/dist/types/styled/ColorPalette.d.ts +1 -1
- package/dist/types/styled/ColorPicker.d.ts +1 -1
- package/package.json +10 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/color-picker
|
|
2
2
|
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`80b9cc64aa2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/80b9cc64aa2) - [ux] Added tokens to color-picker
|
|
8
|
+
|
|
9
|
+
## 1.3.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade to TypeScript 4.2.4
|
|
14
|
+
|
|
15
|
+
## 1.3.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- [`10b517acfea`](https://bitbucket.org/atlassian/atlassian-frontend/commits/10b517acfea) - [ux] Updated how the darker border for each colour block is rendered by using css instead of `darken()`
|
|
20
|
+
|
|
3
21
|
## 1.2.6
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -103,10 +103,10 @@ var ColorCard = /*#__PURE__*/function (_PureComponent) {
|
|
|
103
103
|
onKeyDown: this.onKeyDown
|
|
104
104
|
}, /*#__PURE__*/_react.default.createElement(_ColorCard.ColorCardContent, {
|
|
105
105
|
color: value || 'transparent'
|
|
106
|
-
}, selected && /*#__PURE__*/_react.default.createElement(_done.default, {
|
|
106
|
+
}, selected && /*#__PURE__*/_react.default.createElement(_ColorCard.ColorCardContentCheckMark, null, /*#__PURE__*/_react.default.createElement(_done.default, {
|
|
107
107
|
primaryColor: checkMarkColor,
|
|
108
108
|
label: ""
|
|
109
|
-
})));
|
|
109
|
+
}))));
|
|
110
110
|
}
|
|
111
111
|
}]);
|
|
112
112
|
return ColorCard;
|
|
@@ -58,7 +58,7 @@ var defaultPopperProps = {
|
|
|
58
58
|
placement: 'bottom-start'
|
|
59
59
|
};
|
|
60
60
|
var packageName = "@atlaskit/color-picker";
|
|
61
|
-
var packageVersion = "
|
|
61
|
+
var packageVersion = "2.0.0";
|
|
62
62
|
|
|
63
63
|
var ColorPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
|
|
64
64
|
(0, _inherits2.default)(ColorPickerWithoutAnalytics, _React$Component);
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.Placeholder = exports.
|
|
8
|
+
exports.Placeholder = exports.Option = exports.MenuList = exports.DropdownIndicator = void 0;
|
|
9
9
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
|
|
@@ -19,11 +19,13 @@ var _utils = require("../utils");
|
|
|
19
19
|
|
|
20
20
|
var _ColorPalette = require("../styled/ColorPalette");
|
|
21
21
|
|
|
22
|
+
var _excluded = ["cx", "selectProps", "innerRef"];
|
|
23
|
+
|
|
22
24
|
var MenuList = function MenuList(props) {
|
|
23
25
|
var cx = props.cx,
|
|
24
26
|
cols = props.selectProps.cols,
|
|
25
27
|
innerRef = props.innerRef,
|
|
26
|
-
rest = (0, _objectWithoutProperties2.default)(props,
|
|
28
|
+
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
27
29
|
return /*#__PURE__*/_react.default.createElement(_ColorPalette.ColorPaletteContainer, (0, _extends2.default)({
|
|
28
30
|
role: "grid",
|
|
29
31
|
style: {
|
package/dist/cjs/constants.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.KEY_SPACE = exports.KEY_ENTER = exports.COLOR_CARD_SIZE = void 0;
|
|
7
7
|
var COLOR_CARD_SIZE = 30;
|
|
8
8
|
exports.COLOR_CARD_SIZE = COLOR_CARD_SIZE;
|
|
9
9
|
var KEY_SPACE = ' ';
|
package/dist/cjs/index.js
CHANGED
|
@@ -5,10 +5,10 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
Object.defineProperty(exports, "
|
|
8
|
+
Object.defineProperty(exports, "ColorPaletteMenu", {
|
|
9
9
|
enumerable: true,
|
|
10
10
|
get: function get() {
|
|
11
|
-
return
|
|
11
|
+
return _ColorPaletteMenu.default;
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "ColorPaletteMenuWithoutAnalytics", {
|
|
@@ -17,13 +17,13 @@ Object.defineProperty(exports, "ColorPaletteMenuWithoutAnalytics", {
|
|
|
17
17
|
return _ColorPaletteMenu.ColorPaletteMenuWithoutAnalytics;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
|
-
Object.defineProperty(exports, "
|
|
20
|
+
Object.defineProperty(exports, "ColorPickerWithoutAnalytics", {
|
|
21
21
|
enumerable: true,
|
|
22
22
|
get: function get() {
|
|
23
|
-
return
|
|
23
|
+
return _ColorPicker.ColorPickerWithoutAnalytics;
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
|
-
exports.
|
|
26
|
+
exports.default = exports.Standard = exports.Compact = void 0;
|
|
27
27
|
|
|
28
28
|
var _ColorPicker = _interopRequireWildcard(require("./components/ColorPicker"));
|
|
29
29
|
|
|
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.
|
|
10
|
+
exports.ColorCardOption = exports.ColorCardContentCheckMark = exports.ColorCardContent = exports.ColorCardButton = void 0;
|
|
11
11
|
|
|
12
12
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
13
|
|
|
@@ -17,20 +17,20 @@ var _theme = require("@atlaskit/theme");
|
|
|
17
17
|
|
|
18
18
|
var _constants = require("../constants");
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _tokens = require("@atlaskit/tokens");
|
|
21
21
|
|
|
22
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
22
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
23
23
|
|
|
24
24
|
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); }
|
|
25
25
|
|
|
26
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
27
|
|
|
28
|
-
var buttonFocusedBorder = "border-color: ".concat(_theme.colors.B100, ";");
|
|
29
|
-
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 &:hover,\n &:focus {\n border-color: ", ";\n }\n"])), _constants.COLOR_CARD_SIZE, _constants.COLOR_CARD_SIZE, (0, _theme.borderRadius)() * 2, _theme.colors.B75);
|
|
28
|
+
var buttonFocusedBorder = "border-color: ".concat((0, _tokens.token)('color.border.focused', _theme.colors.B100), ";");
|
|
29
|
+
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 &:hover,\n &:focus {\n border-color: ", ";\n }\n"])), _constants.COLOR_CARD_SIZE, _constants.COLOR_CARD_SIZE, (0, _theme.borderRadius)() * 2, (0, _tokens.token)('color.border.focused', _theme.colors.B75));
|
|
30
30
|
|
|
31
31
|
var ColorCardOption = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n\n ", ";\n"])), sharedColorContainerStyles, function (props) {
|
|
32
32
|
if (props.focused) {
|
|
33
|
-
return "border-color: ".concat(_theme.colors.B75);
|
|
33
|
+
return "border-color: ".concat((0, _tokens.token)('color.border.focused', _theme.colors.B75));
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
|
|
@@ -44,10 +44,13 @@ var ColorCardButton = _styledComponents.default.button(_templateObject3 || (_tem
|
|
|
44
44
|
|
|
45
45
|
exports.ColorCardButton = ColorCardButton;
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
48
|
+
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) {
|
|
48
49
|
return props.color;
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
}, (0, _tokens.token)('color.background.inverse.subtle', _theme.colors.DN600A));
|
|
51
|
+
|
|
52
|
+
exports.ColorCardContent = ColorCardContent;
|
|
53
|
+
|
|
54
|
+
var ColorCardContentCheckMark = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n margin: 1px;\n"])));
|
|
52
55
|
|
|
53
|
-
exports.
|
|
56
|
+
exports.ColorCardContentCheckMark = ColorCardContentCheckMark;
|
|
@@ -17,6 +17,8 @@ var _utils = require("../utils");
|
|
|
17
17
|
|
|
18
18
|
var _types = require("../types");
|
|
19
19
|
|
|
20
|
+
var _tokens = require("@atlaskit/tokens");
|
|
21
|
+
|
|
20
22
|
var _templateObject, _templateObject2, _templateObject3;
|
|
21
23
|
|
|
22
24
|
var ColorCardWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n margin: ", "px;\n"])), (0, _theme.gridSize)() / 4);
|
|
@@ -29,10 +31,10 @@ var ColorPaletteContainer = _styledComponents.default.div(_templateObject2 || (_
|
|
|
29
31
|
|
|
30
32
|
exports.ColorPaletteContainer = ColorPaletteContainer;
|
|
31
33
|
|
|
32
|
-
var ColorPaletteMenu = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n margin: 0;\n background-color: ", ";\n width: ", "px;\n ", "\n"])), _theme.colors.N0, function (props) {
|
|
34
|
+
var ColorPaletteMenu = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n margin: 0;\n background-color: ", ";\n width: ", "px;\n ", "\n"])), (0, _tokens.token)('elevation.surface.overlay', _theme.colors.N0), function (props) {
|
|
33
35
|
return (0, _utils.getWidth)(props.cols);
|
|
34
36
|
}, function (props) {
|
|
35
|
-
return props.mode && props.mode === _types.Mode.Standard && "\n box-radius: ".concat(_theme.borderRadius, "px;\n box-shadow: 0 0 0 1px "
|
|
37
|
+
return props.mode && props.mode === _types.Mode.Standard && "\n box-radius: ".concat(_theme.borderRadius, "px;\n box-shadow: ").concat((0, _tokens.token)('elevation.shadow.overlay', "0 0 0 1px ".concat(_theme.colors.N40, ", 0 0 8px ").concat(_theme.colors.N40)), ";\n width: ").concat((0, _utils.getWidth)(props.cols) + (0, _theme.gridSize)(), "px;\n ");
|
|
36
38
|
});
|
|
37
39
|
|
|
38
40
|
exports.ColorPaletteMenu = ColorPaletteMenu;
|
package/dist/cjs/utils.js
CHANGED
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.getWidth = exports.getOptions = void 0;
|
|
9
9
|
|
|
10
10
|
var _theme = require("@atlaskit/theme");
|
|
11
11
|
|
package/dist/cjs/version.json
CHANGED
|
@@ -5,7 +5,7 @@ import EditorDoneIcon from '@atlaskit/icon/glyph/editor/done'; // AFP-2532 TODO:
|
|
|
5
5
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
6
6
|
|
|
7
7
|
import { colors } from '@atlaskit/theme';
|
|
8
|
-
import { ColorCardOption, ColorCardContent } from '../styled/ColorCard';
|
|
8
|
+
import { ColorCardOption, ColorCardContent, ColorCardContentCheckMark } from '../styled/ColorCard';
|
|
9
9
|
import { KEY_SPACE, KEY_ENTER } from '../constants';
|
|
10
10
|
export default class ColorCard extends PureComponent {
|
|
11
11
|
constructor(...args) {
|
|
@@ -51,6 +51,7 @@ export default class ColorCard extends PureComponent {
|
|
|
51
51
|
label,
|
|
52
52
|
selected,
|
|
53
53
|
focused,
|
|
54
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
54
55
|
checkMarkColor = colors.N0
|
|
55
56
|
} = this.props;
|
|
56
57
|
return /*#__PURE__*/React.createElement(ColorCardOption, {
|
|
@@ -62,10 +63,10 @@ export default class ColorCard extends PureComponent {
|
|
|
62
63
|
onKeyDown: this.onKeyDown
|
|
63
64
|
}, /*#__PURE__*/React.createElement(ColorCardContent, {
|
|
64
65
|
color: value || 'transparent'
|
|
65
|
-
}, selected && /*#__PURE__*/React.createElement(EditorDoneIcon, {
|
|
66
|
+
}, selected && /*#__PURE__*/React.createElement(ColorCardContentCheckMark, null, /*#__PURE__*/React.createElement(EditorDoneIcon, {
|
|
66
67
|
primaryColor: checkMarkColor,
|
|
67
68
|
label: ""
|
|
68
|
-
})));
|
|
69
|
+
}))));
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
}
|
|
@@ -18,7 +18,7 @@ const defaultPopperProps = {
|
|
|
18
18
|
placement: 'bottom-start'
|
|
19
19
|
};
|
|
20
20
|
const packageName = "@atlaskit/color-picker";
|
|
21
|
-
const packageVersion = "
|
|
21
|
+
const packageVersion = "2.0.0";
|
|
22
22
|
export class ColorPickerWithoutAnalytics extends React.Component {
|
|
23
23
|
constructor(...args) {
|
|
24
24
|
super(...args);
|
|
@@ -2,10 +2,9 @@ import styled, { css } from 'styled-components'; // AFP-2532 TODO: Fix automatic
|
|
|
2
2
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
3
3
|
|
|
4
4
|
import { borderRadius, colors } from '@atlaskit/theme';
|
|
5
|
-
import { COLOR_CARD_SIZE } from '../constants';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const buttonFocusedBorder = `border-color: ${colors.B100};`;
|
|
5
|
+
import { COLOR_CARD_SIZE } from '../constants';
|
|
6
|
+
import { token } from '@atlaskit/tokens';
|
|
7
|
+
const buttonFocusedBorder = `border-color: ${token('color.border.focused', colors.B100)};`;
|
|
9
8
|
const sharedColorContainerStyles = css`
|
|
10
9
|
display: inline-block;
|
|
11
10
|
position: relative;
|
|
@@ -22,7 +21,7 @@ const sharedColorContainerStyles = css`
|
|
|
22
21
|
outline: none;
|
|
23
22
|
&:hover,
|
|
24
23
|
&:focus {
|
|
25
|
-
border-color: ${colors.B75};
|
|
24
|
+
border-color: ${token('color.border.focused', colors.B75)};
|
|
26
25
|
}
|
|
27
26
|
`;
|
|
28
27
|
export const ColorCardOption = styled.div`
|
|
@@ -30,7 +29,7 @@ export const ColorCardOption = styled.div`
|
|
|
30
29
|
|
|
31
30
|
${props => {
|
|
32
31
|
if (props.focused) {
|
|
33
|
-
return `border-color: ${colors.B75}`;
|
|
32
|
+
return `border-color: ${token('color.border.focused', colors.B75)}`;
|
|
34
33
|
}
|
|
35
34
|
}};
|
|
36
35
|
`;
|
|
@@ -50,13 +49,19 @@ export const ColorCardButton = styled.button`
|
|
|
50
49
|
}
|
|
51
50
|
}};
|
|
52
51
|
`;
|
|
52
|
+
|
|
53
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
53
54
|
export const ColorCardContent = styled.div`
|
|
54
55
|
position: absolute;
|
|
55
56
|
top: 1px;
|
|
56
57
|
left: 1px;
|
|
57
|
-
width:
|
|
58
|
-
height:
|
|
58
|
+
width: 24px;
|
|
59
|
+
height: 24px;
|
|
59
60
|
border-radius: ${borderRadius()}px;
|
|
60
61
|
background: ${props => props.color};
|
|
61
|
-
|
|
62
|
+
box-shadow: inset 0px 0px 0px 1px
|
|
63
|
+
${token('color.background.inverse.subtle', colors.DN600A)};
|
|
64
|
+
`;
|
|
65
|
+
export const ColorCardContentCheckMark = styled.div`
|
|
66
|
+
margin: 1px;
|
|
62
67
|
`;
|
|
@@ -4,6 +4,7 @@ import styled from 'styled-components'; // AFP-2532 TODO: Fix automatic suppress
|
|
|
4
4
|
import { gridSize, borderRadius, colors } from '@atlaskit/theme';
|
|
5
5
|
import { getWidth } from '../utils';
|
|
6
6
|
import { Mode } from '../types';
|
|
7
|
+
import { token } from '@atlaskit/tokens';
|
|
7
8
|
export const ColorCardWrapper = styled.div`
|
|
8
9
|
display: flex;
|
|
9
10
|
margin: ${gridSize() / 4}px;
|
|
@@ -16,11 +17,11 @@ export const ColorPaletteContainer = styled.div`
|
|
|
16
17
|
export const ColorPaletteMenu = styled.div`
|
|
17
18
|
position: relative;
|
|
18
19
|
margin: 0;
|
|
19
|
-
background-color: ${colors.N0};
|
|
20
|
+
background-color: ${token('elevation.surface.overlay', colors.N0)};
|
|
20
21
|
width: ${props => getWidth(props.cols)}px;
|
|
21
22
|
${props => props.mode && props.mode === Mode.Standard && `
|
|
22
23
|
box-radius: ${borderRadius}px;
|
|
23
|
-
box-shadow: 0 0 0 1px ${colors.N40}, 0 0 8px ${colors.N40};
|
|
24
|
+
box-shadow: ${token('elevation.shadow.overlay', `0 0 0 1px ${colors.N40}, 0 0 8px ${colors.N40}`)};
|
|
24
25
|
width: ${getWidth(props.cols) + gridSize()}px;
|
|
25
26
|
`}
|
|
26
27
|
`;
|
package/dist/es2019/version.json
CHANGED
|
@@ -16,7 +16,7 @@ import EditorDoneIcon from '@atlaskit/icon/glyph/editor/done'; // AFP-2532 TODO:
|
|
|
16
16
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
17
17
|
|
|
18
18
|
import { colors } from '@atlaskit/theme';
|
|
19
|
-
import { ColorCardOption, ColorCardContent } from '../styled/ColorCard';
|
|
19
|
+
import { ColorCardOption, ColorCardContent, ColorCardContentCheckMark } from '../styled/ColorCard';
|
|
20
20
|
import { KEY_SPACE, KEY_ENTER } from '../constants';
|
|
21
21
|
|
|
22
22
|
var ColorCard = /*#__PURE__*/function (_PureComponent) {
|
|
@@ -86,10 +86,10 @@ var ColorCard = /*#__PURE__*/function (_PureComponent) {
|
|
|
86
86
|
onKeyDown: this.onKeyDown
|
|
87
87
|
}, /*#__PURE__*/React.createElement(ColorCardContent, {
|
|
88
88
|
color: value || 'transparent'
|
|
89
|
-
}, selected && /*#__PURE__*/React.createElement(EditorDoneIcon, {
|
|
89
|
+
}, selected && /*#__PURE__*/React.createElement(ColorCardContentCheckMark, null, /*#__PURE__*/React.createElement(EditorDoneIcon, {
|
|
90
90
|
primaryColor: checkMarkColor,
|
|
91
91
|
label: ""
|
|
92
|
-
})));
|
|
92
|
+
}))));
|
|
93
93
|
}
|
|
94
94
|
}]);
|
|
95
95
|
|
|
@@ -29,7 +29,7 @@ var defaultPopperProps = {
|
|
|
29
29
|
placement: 'bottom-start'
|
|
30
30
|
};
|
|
31
31
|
var packageName = "@atlaskit/color-picker";
|
|
32
|
-
var packageVersion = "
|
|
32
|
+
var packageVersion = "2.0.0";
|
|
33
33
|
export var ColorPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
|
|
34
34
|
_inherits(ColorPickerWithoutAnalytics, _React$Component);
|
|
35
35
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["cx", "selectProps", "innerRef"];
|
|
3
4
|
import React from 'react';
|
|
4
5
|
import ColorCard from './ColorCard';
|
|
5
6
|
import { getWidth } from '../utils';
|
|
@@ -8,7 +9,7 @@ export var MenuList = function MenuList(props) {
|
|
|
8
9
|
var cx = props.cx,
|
|
9
10
|
cols = props.selectProps.cols,
|
|
10
11
|
innerRef = props.innerRef,
|
|
11
|
-
rest = _objectWithoutProperties(props,
|
|
12
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
12
13
|
|
|
13
14
|
return /*#__PURE__*/React.createElement(ColorPaletteContainer, _extends({
|
|
14
15
|
role: "grid",
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
|
|
3
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
3
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
4
4
|
|
|
5
5
|
import styled, { css } from 'styled-components'; // AFP-2532 TODO: Fix automatic suppressions below
|
|
6
6
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
7
7
|
|
|
8
8
|
import { borderRadius, colors } from '@atlaskit/theme';
|
|
9
|
-
import { COLOR_CARD_SIZE } from '../constants';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
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 &:hover,\n &:focus {\n border-color: ", ";\n }\n"])), COLOR_CARD_SIZE, COLOR_CARD_SIZE, borderRadius() * 2, colors.B75);
|
|
9
|
+
import { COLOR_CARD_SIZE } from '../constants';
|
|
10
|
+
import { token } from '@atlaskit/tokens';
|
|
11
|
+
var buttonFocusedBorder = "border-color: ".concat(token('color.border.focused', colors.B100), ";");
|
|
12
|
+
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 &:hover,\n &:focus {\n border-color: ", ";\n }\n"])), COLOR_CARD_SIZE, COLOR_CARD_SIZE, borderRadius() * 2, token('color.border.focused', colors.B75));
|
|
14
13
|
export var ColorCardOption = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", ";\n\n ", ";\n"])), sharedColorContainerStyles, function (props) {
|
|
15
14
|
if (props.focused) {
|
|
16
|
-
return "border-color: ".concat(colors.B75);
|
|
15
|
+
return "border-color: ".concat(token('color.border.focused', colors.B75));
|
|
17
16
|
}
|
|
18
17
|
});
|
|
19
18
|
export var ColorCardButton = styled.button(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", ";\n &:hover {\n border-color: transparent;\n }\n &:not(:focus):hover,\n &:focus {\n ", ";\n }\n\n ", ";\n"])), sharedColorContainerStyles, buttonFocusedBorder, function (props) {
|
|
@@ -21,8 +20,9 @@ export var ColorCardButton = styled.button(_templateObject3 || (_templateObject3
|
|
|
21
20
|
return buttonFocusedBorder;
|
|
22
21
|
}
|
|
23
22
|
});
|
|
24
|
-
|
|
23
|
+
|
|
24
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
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) {
|
|
25
26
|
return props.color;
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
});
|
|
27
|
+
}, token('color.background.inverse.subtle', colors.DN600A));
|
|
28
|
+
export var ColorCardContentCheckMark = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin: 1px;\n"])));
|
|
@@ -8,12 +8,13 @@ import styled from 'styled-components'; // AFP-2532 TODO: Fix automatic suppress
|
|
|
8
8
|
import { gridSize, borderRadius, colors } from '@atlaskit/theme';
|
|
9
9
|
import { getWidth } from '../utils';
|
|
10
10
|
import { Mode } from '../types';
|
|
11
|
+
import { token } from '@atlaskit/tokens';
|
|
11
12
|
export var ColorCardWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n margin: ", "px;\n"])), gridSize() / 4);
|
|
12
13
|
export var ColorPaletteContainer = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: wrap;\n padding: ", ";\n"])), function (props) {
|
|
13
14
|
return props.mode === Mode.Compact ? "0" : "".concat(gridSize() / 2, "px");
|
|
14
15
|
});
|
|
15
|
-
export var ColorPaletteMenu = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n margin: 0;\n background-color: ", ";\n width: ", "px;\n ", "\n"])), colors.N0, function (props) {
|
|
16
|
+
export var ColorPaletteMenu = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n margin: 0;\n background-color: ", ";\n width: ", "px;\n ", "\n"])), token('elevation.surface.overlay', colors.N0), function (props) {
|
|
16
17
|
return getWidth(props.cols);
|
|
17
18
|
}, function (props) {
|
|
18
|
-
return props.mode && props.mode === Mode.Standard && "\n box-radius: ".concat(borderRadius, "px;\n box-shadow: 0 0 0 1px "
|
|
19
|
+
return props.mode && props.mode === Mode.Standard && "\n box-radius: ".concat(borderRadius, "px;\n box-shadow: ").concat(token('elevation.shadow.overlay', "0 0 0 1px ".concat(colors.N40, ", 0 0 8px ").concat(colors.N40)), ";\n width: ").concat(getWidth(props.cols) + gridSize(), "px;\n ");
|
|
19
20
|
});
|
package/dist/esm/version.json
CHANGED
|
@@ -23,12 +23,12 @@ export declare class ColorPaletteMenuWithoutAnalytics extends React.Component<Pr
|
|
|
23
23
|
cols: number;
|
|
24
24
|
mode: Mode;
|
|
25
25
|
};
|
|
26
|
-
createAndFireEventOnAtlaskit: (payload:
|
|
26
|
+
createAndFireEventOnAtlaskit: (payload: import("@atlaskit/analytics-next").AnalyticsEventPayload) => (createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent) => import("@atlaskit/analytics-next").UIAnalyticsEvent;
|
|
27
27
|
changeAnalyticsCaller: () => import("@atlaskit/analytics-next").UIAnalyticsEvent | undefined;
|
|
28
28
|
onChange: (value: string) => void;
|
|
29
29
|
render(): JSX.Element;
|
|
30
30
|
}
|
|
31
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<
|
|
31
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<Props, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "label" | "onChange" | "checkMarkColor" | "palette" | "selectedColor"> & Partial<Pick<Omit<Props, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "cols" | "mode">> & Partial<Pick<{
|
|
32
32
|
cols: number;
|
|
33
33
|
mode: Mode;
|
|
34
34
|
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "label" | "key" | "onChange" | "checkMarkColor" | "cols" | "mode" | "palette" | "selectedColor" | "analyticsContext"> & React.RefAttributes<any>>;
|
|
@@ -20,10 +20,10 @@ export interface Props {
|
|
|
20
20
|
createAnalyticsEvent?: any;
|
|
21
21
|
}
|
|
22
22
|
export declare class ColorPickerWithoutAnalytics extends React.Component<Props> {
|
|
23
|
-
createAndFireEventOnAtlaskit: (payload:
|
|
23
|
+
createAndFireEventOnAtlaskit: (payload: import("@atlaskit/analytics-next").AnalyticsEventPayload) => (createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent) => import("@atlaskit/analytics-next").UIAnalyticsEvent;
|
|
24
24
|
changeAnalyticsCaller: () => import("@atlaskit/analytics-next").UIAnalyticsEvent | undefined;
|
|
25
25
|
onChange: (option: ValueType<Color>) => void;
|
|
26
26
|
render(): JSX.Element;
|
|
27
27
|
}
|
|
28
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<
|
|
28
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Omit<Props, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "label" | "key" | "onChange" | "checkMarkColor" | "cols" | "popperProps" | "palette" | "selectedColor" | "analyticsContext"> & React.RefAttributes<any>>;
|
|
29
29
|
export default _default;
|
|
@@ -8,4 +8,5 @@ declare type ColorCardContentProps = {
|
|
|
8
8
|
color: string;
|
|
9
9
|
};
|
|
10
10
|
export declare const ColorCardContent: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & ColorCardContentProps, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & ColorCardContentProps>;
|
|
11
|
+
export declare const ColorCardContentCheckMark: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>>;
|
|
11
12
|
export {};
|
|
@@ -7,7 +7,7 @@ declare type ColorPaletteMenuProps = {
|
|
|
7
7
|
cols: number;
|
|
8
8
|
mode?: Mode;
|
|
9
9
|
};
|
|
10
|
-
export declare const ColorCardWrapper: import("styled-components").StyledComponentClass<import("react").
|
|
10
|
+
export declare const ColorCardWrapper: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>>;
|
|
11
11
|
export declare const ColorPaletteContainer: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Props, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Props>;
|
|
12
12
|
export declare const ColorPaletteMenu: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & ColorPaletteMenuProps, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & ColorPaletteMenuProps>;
|
|
13
13
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const ColorCardWrapper: import("styled-components").StyledComponentClass<import("react").
|
|
2
|
+
export declare const ColorCardWrapper: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/color-picker",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Jira Color Picker Component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@atlaskit/analytics-next": "^8.2.0",
|
|
25
|
-
"@atlaskit/icon": "^21.
|
|
25
|
+
"@atlaskit/icon": "^21.10.0",
|
|
26
26
|
"@atlaskit/select": "^15.0.0",
|
|
27
|
-
"@atlaskit/theme": "^12.
|
|
27
|
+
"@atlaskit/theme": "^12.1.0",
|
|
28
|
+
"@atlaskit/tokens": "^0.9.0",
|
|
28
29
|
"@babel/runtime": "^7.0.0",
|
|
29
30
|
"memoize-one": "^6.0.0",
|
|
30
|
-
"polished": "1.9.3",
|
|
31
31
|
"styled-components": "^3.2.6"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"enzyme-adapter-react-16": "^1.15.1",
|
|
43
43
|
"jscodeshift": "^0.13.0",
|
|
44
44
|
"react": "^16.8.0",
|
|
45
|
-
"typescript": "
|
|
45
|
+
"typescript": "4.2.4"
|
|
46
46
|
},
|
|
47
47
|
"keywords": [
|
|
48
48
|
"ui",
|
|
@@ -54,5 +54,10 @@
|
|
|
54
54
|
"./ColorPaletteMenu": "./src/components/ColorPaletteMenu.tsx",
|
|
55
55
|
".": "./src/index.ts"
|
|
56
56
|
},
|
|
57
|
+
"techstack": {
|
|
58
|
+
"@repo/internal": {
|
|
59
|
+
"theming": "tokens"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
57
62
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
58
63
|
}
|