@atlaskit/color-picker 3.0.6 → 3.0.7

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/color-picker
2
2
 
3
+ ## 3.0.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`6455cf006b3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6455cf006b3) - Builds for this package now pass through a tokens babel plugin, removing runtime invocations of the tokens() function and improving performance.
8
+
3
9
  ## 3.0.6
4
10
 
5
11
  ### Patch Changes
@@ -60,7 +60,7 @@ var defaultPopperProps = {
60
60
  placement: 'bottom-start'
61
61
  };
62
62
  var packageName = "@atlaskit/color-picker";
63
- var packageVersion = "3.0.6";
63
+ var packageVersion = "3.0.7";
64
64
 
65
65
  var ColorPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
66
66
  (0, _inherits2.default)(ColorPickerWithoutAnalytics, _React$Component);
@@ -17,24 +17,22 @@ var _theme = require("@atlaskit/theme");
17
17
 
18
18
  var _constants = require("../constants");
19
19
 
20
- var _tokens = require("@atlaskit/tokens");
21
-
22
20
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
23
21
 
24
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); }
25
23
 
26
24
  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
25
 
28
- var buttonFocusedBorder = "border-color: ".concat((0, _tokens.token)('color.border.focused', _theme.colors.B100), ";");
26
+ var buttonFocusedBorder = "border-color: ".concat("var(--ds-border-focused, ".concat(_theme.colors.B100, ")"), ";");
29
27
  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);
30
28
 
31
29
  var ColorCardOption = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n\n ", "\n\n ", ";\n"])), sharedColorContainerStyles, function (props) {
32
30
  if (props.isTabbing === undefined || props.isTabbing) {
33
- return "&:hover,\n &:focus {\n border-color: ".concat((0, _tokens.token)('color.border.focused', _theme.colors.B75), ";\n }");
31
+ return "&:hover,\n &:focus {\n border-color: ".concat("var(--ds-border-focused, ".concat(_theme.colors.B75, ")"), ";\n }");
34
32
  }
35
33
  }, function (props) {
36
34
  if (props.focused && !props.isTabbing) {
37
- return "border-color: ".concat((0, _tokens.token)('color.border.focused', _theme.colors.B75));
35
+ return "border-color: ".concat("var(--ds-border-focused, ".concat(_theme.colors.B75, ")"));
38
36
  }
39
37
  });
40
38
 
@@ -51,7 +49,7 @@ exports.ColorCardButton = ColorCardButton;
51
49
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
52
50
  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) {
53
51
  return props.color;
54
- }, (0, _tokens.token)('color.background.inverse.subtle', _theme.colors.DN600A));
52
+ }, "var(--ds-background-inverse-subtle, ".concat(_theme.colors.DN600A, ")"));
55
53
 
56
54
  exports.ColorCardContent = ColorCardContent;
57
55
 
@@ -17,8 +17,6 @@ var _utils = require("../utils");
17
17
 
18
18
  var _types = require("../types");
19
19
 
20
- var _tokens = require("@atlaskit/tokens");
21
-
22
20
  var _templateObject, _templateObject2, _templateObject3;
23
21
 
24
22
  var ColorCardWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n margin: ", "px;\n"])), (0, _theme.gridSize)() / 4);
@@ -31,10 +29,10 @@ var ColorPaletteContainer = _styledComponents.default.div(_templateObject2 || (_
31
29
 
32
30
  exports.ColorPaletteContainer = ColorPaletteContainer;
33
31
 
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) {
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"])), "var(--ds-surface-overlay, ".concat(_theme.colors.N0, ")"), function (props) {
35
33
  return (0, _utils.getWidth)(props.cols);
36
34
  }, function (props) {
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 ");
35
+ return props.mode && props.mode === _types.Mode.Standard && "\n box-radius: ".concat(_theme.borderRadius, "px;\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: ").concat((0, _utils.getWidth)(props.cols) + (0, _theme.gridSize)(), "px;\n ");
38
36
  });
39
37
 
40
38
  exports.ColorPaletteMenu = ColorPaletteMenu;
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/color-picker",
3
- "version": "3.0.6"
3
+ "version": "3.0.7"
4
4
  }
@@ -19,7 +19,7 @@ const defaultPopperProps = {
19
19
  placement: 'bottom-start'
20
20
  };
21
21
  const packageName = "@atlaskit/color-picker";
22
- const packageVersion = "3.0.6";
22
+ const packageVersion = "3.0.7";
23
23
  export class ColorPickerWithoutAnalytics extends React.Component {
24
24
  constructor(...args) {
25
25
  super(...args);
@@ -3,8 +3,7 @@ import styled, { css } from 'styled-components'; // AFP-2532 TODO: Fix automatic
3
3
 
4
4
  import { borderRadius, colors } from '@atlaskit/theme';
5
5
  import { COLOR_CARD_SIZE } from '../constants';
6
- import { token } from '@atlaskit/tokens';
7
- const buttonFocusedBorder = `border-color: ${token('color.border.focused', colors.B100)};`;
6
+ const buttonFocusedBorder = `border-color: ${`var(--ds-border-focused, ${colors.B100})`};`;
8
7
  const sharedColorContainerStyles = css`
9
8
  display: inline-block;
10
9
  position: relative;
@@ -27,14 +26,14 @@ export const ColorCardOption = styled.div`
27
26
  if (props.isTabbing === undefined || props.isTabbing) {
28
27
  return `&:hover,
29
28
  &:focus {
30
- border-color: ${token('color.border.focused', colors.B75)};
29
+ border-color: ${`var(--ds-border-focused, ${colors.B75})`};
31
30
  }`;
32
31
  }
33
32
  }}
34
33
 
35
34
  ${props => {
36
35
  if (props.focused && !props.isTabbing) {
37
- return `border-color: ${token('color.border.focused', colors.B75)}`;
36
+ return `border-color: ${`var(--ds-border-focused, ${colors.B75})`}`;
38
37
  }
39
38
  }};
40
39
  `;
@@ -65,7 +64,7 @@ export const ColorCardContent = styled.div`
65
64
  border-radius: ${borderRadius()}px;
66
65
  background: ${props => props.color};
67
66
  box-shadow: inset 0px 0px 0px 1px
68
- ${token('color.background.inverse.subtle', colors.DN600A)};
67
+ ${`var(--ds-background-inverse-subtle, ${colors.DN600A})`};
69
68
  `;
70
69
  export const ColorCardContentCheckMark = styled.div`
71
70
  margin: 1px;
@@ -4,7 +4,6 @@ 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';
8
7
  export const ColorCardWrapper = styled.div`
9
8
  display: flex;
10
9
  margin: ${gridSize() / 4}px;
@@ -17,11 +16,11 @@ export const ColorPaletteContainer = styled.div`
17
16
  export const ColorPaletteMenu = styled.div`
18
17
  position: relative;
19
18
  margin: 0;
20
- background-color: ${token('elevation.surface.overlay', colors.N0)};
19
+ background-color: ${`var(--ds-surface-overlay, ${colors.N0})`};
21
20
  width: ${props => getWidth(props.cols)}px;
22
21
  ${props => props.mode && props.mode === Mode.Standard && `
23
22
  box-radius: ${borderRadius}px;
24
- box-shadow: ${token('elevation.shadow.overlay', `0 0 0 1px ${colors.N40}, 0 0 8px ${colors.N40}`)};
23
+ box-shadow: ${`var(--ds-shadow-overlay, ${`0 0 0 1px ${colors.N40}, 0 0 8px ${colors.N40}`})`};
25
24
  width: ${getWidth(props.cols) + gridSize()}px;
26
25
  `}
27
26
  `;
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/color-picker",
3
- "version": "3.0.6"
3
+ "version": "3.0.7"
4
4
  }
@@ -30,7 +30,7 @@ var defaultPopperProps = {
30
30
  placement: 'bottom-start'
31
31
  };
32
32
  var packageName = "@atlaskit/color-picker";
33
- var packageVersion = "3.0.6";
33
+ var packageVersion = "3.0.7";
34
34
  export var ColorPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
35
35
  _inherits(ColorPickerWithoutAnalytics, _React$Component);
36
36
 
@@ -7,16 +7,15 @@ import styled, { css } from 'styled-components'; // AFP-2532 TODO: Fix automatic
7
7
 
8
8
  import { borderRadius, colors } from '@atlaskit/theme';
9
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), ";");
10
+ var buttonFocusedBorder = "border-color: ".concat("var(--ds-border-focused, ".concat(colors.B100, ")"), ";");
12
11
  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);
13
12
  export var ColorCardOption = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", ";\n\n ", "\n\n ", ";\n"])), sharedColorContainerStyles, function (props) {
14
13
  if (props.isTabbing === undefined || props.isTabbing) {
15
- return "&:hover,\n &:focus {\n border-color: ".concat(token('color.border.focused', colors.B75), ";\n }");
14
+ return "&:hover,\n &:focus {\n border-color: ".concat("var(--ds-border-focused, ".concat(colors.B75, ")"), ";\n }");
16
15
  }
17
16
  }, function (props) {
18
17
  if (props.focused && !props.isTabbing) {
19
- return "border-color: ".concat(token('color.border.focused', colors.B75));
18
+ return "border-color: ".concat("var(--ds-border-focused, ".concat(colors.B75, ")"));
20
19
  }
21
20
  });
22
21
  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) {
@@ -28,5 +27,5 @@ export var ColorCardButton = styled.button(_templateObject3 || (_templateObject3
28
27
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
29
28
  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) {
30
29
  return props.color;
31
- }, token('color.background.inverse.subtle', colors.DN600A));
30
+ }, "var(--ds-background-inverse-subtle, ".concat(colors.DN600A, ")"));
32
31
  export var ColorCardContentCheckMark = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin: 1px;\n"])));
@@ -8,13 +8,12 @@ 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';
12
11
  export var ColorCardWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n margin: ", "px;\n"])), gridSize() / 4);
13
12
  export var ColorPaletteContainer = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: wrap;\n padding: ", ";\n"])), function (props) {
14
13
  return props.mode === Mode.Compact ? "0" : "".concat(gridSize() / 2, "px");
15
14
  });
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) {
15
+ 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) {
17
16
  return getWidth(props.cols);
18
17
  }, function (props) {
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 ");
18
+ return props.mode && props.mode === Mode.Standard && "\n box-radius: ".concat(borderRadius, "px;\n box-shadow: ", "var(--ds-shadow-overlay, ".concat("0 0 0 1px ".concat(colors.N40, ", 0 0 8px ").concat(colors.N40), ")"), ";\n width: ").concat(getWidth(props.cols) + gridSize(), "px;\n ");
20
19
  });
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/color-picker",
3
- "version": "3.0.6"
3
+ "version": "3.0.7"
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/color-picker",
3
- "version": "3.0.6",
3
+ "version": "3.0.7",
4
4
  "description": "Jira Color Picker Component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -23,7 +23,7 @@
23
23
  "dependencies": {
24
24
  "@atlaskit/analytics-next": "^8.2.0",
25
25
  "@atlaskit/icon": "^21.11.0",
26
- "@atlaskit/select": "^16.0.0",
26
+ "@atlaskit/select": "^16.1.0",
27
27
  "@atlaskit/theme": "^12.2.0",
28
28
  "@atlaskit/tokens": "^0.13.0",
29
29
  "@babel/runtime": "^7.0.0",