@atlaskit/icon 21.11.4 → 21.12.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 (34) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/components/icon.js +23 -31
  3. package/dist/cjs/components/skeleton.js +8 -11
  4. package/dist/cjs/components/styles.js +5 -13
  5. package/dist/cjs/components/svg.js +10 -17
  6. package/dist/cjs/components/utils.js +1 -2
  7. package/dist/cjs/entry-points/base.js +0 -4
  8. package/dist/cjs/entry-points/constants.js +0 -1
  9. package/dist/cjs/entry-points/metadata.js +0 -2
  10. package/dist/cjs/entry-points/svg.js +0 -2
  11. package/dist/cjs/extract-react-types/custom-glyph.js +0 -1
  12. package/dist/cjs/extract-react-types/glyph-no-color-size.js +0 -1
  13. package/dist/cjs/extract-react-types/glyph-no-color.js +0 -1
  14. package/dist/cjs/extract-react-types/glyph.js +0 -1
  15. package/dist/cjs/extract-react-types/svg.js +0 -1
  16. package/dist/cjs/index.js +0 -5
  17. package/dist/cjs/metadata.js +1 -2
  18. package/dist/cjs/version.json +1 -1
  19. package/dist/es2019/components/icon.js +10 -9
  20. package/dist/es2019/components/skeleton.js +1 -1
  21. package/dist/es2019/components/styles.js +3 -5
  22. package/dist/es2019/components/svg.js +3 -2
  23. package/dist/es2019/components/utils.js +1 -1
  24. package/dist/es2019/metadata.js +1 -1
  25. package/dist/es2019/version.json +1 -1
  26. package/dist/esm/components/icon.js +19 -23
  27. package/dist/esm/components/skeleton.js +7 -7
  28. package/dist/esm/components/styles.js +5 -8
  29. package/dist/esm/components/svg.js +11 -12
  30. package/dist/esm/components/utils.js +1 -1
  31. package/dist/esm/metadata.js +1 -1
  32. package/dist/esm/version.json +1 -1
  33. package/package.json +17 -16
  34. package/report.api.md +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/icon
2
2
 
3
+ ## 21.12.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+
13
+ ## 21.11.5
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies
18
+
3
19
  ## 21.11.4
4
20
 
5
21
  ### Patch Changes
@@ -1,29 +1,23 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = exports.Icon = void 0;
9
-
10
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
-
12
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
-
14
10
  var _react = require("react");
15
-
16
11
  var _react2 = require("@emotion/react");
17
-
18
12
  var _components = require("@atlaskit/theme/components");
19
-
20
13
  var _utils = require("./utils");
21
-
22
14
  var _styles = require("./styles");
23
-
24
15
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
25
-
26
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } /** @jsx jsx */
17
+ /**
18
+ * We are hiding these props from consumers as they're used to
19
+ * hack around icon sizing specifically for icon-file-type.
20
+ */
27
21
 
28
22
  var iconStyles = (0, _react2.css)({
29
23
  display: 'inline-block',
@@ -41,7 +35,6 @@ var iconStyles = (0, _react2.css)({
41
35
  /**
42
36
  * For windows high contrast mode
43
37
  */
44
-
45
38
  var baseHcmStyles = (0, _react2.css)({
46
39
  '@media screen and (forced-colors: active)': {
47
40
  // eslint-disable-next-line @repo/internal/styles/no-nested-styles
@@ -50,10 +43,10 @@ var baseHcmStyles = (0, _react2.css)({
50
43
  '--icon-primary-color': 'CanvasText',
51
44
  // foreground
52
45
  '--icon-secondary-color': 'Canvas' // background
53
-
54
46
  }
55
47
  }
56
48
  });
49
+
57
50
  var primaryEqualsSecondaryHcmStyles = (0, _react2.css)({
58
51
  '@media screen and (forced-colors: active)': {
59
52
  // eslint-disable-next-line @repo/internal/styles/no-nested-styles
@@ -62,19 +55,19 @@ var primaryEqualsSecondaryHcmStyles = (0, _react2.css)({
62
55
  // set the --icon-primary-color to Canvas
63
56
  // this is usually to convey state i.e. Checkbox checked -> not checked
64
57
  '--icon-primary-color': 'Canvas' // foreground
65
-
66
58
  }
67
59
  }
68
60
  });
61
+
69
62
  var secondaryTransparentHcmStyles = (0, _react2.css)({
70
63
  '@media screen and (forced-colors: active)': {
71
64
  // eslint-disable-next-line @repo/internal/styles/no-nested-styles
72
65
  '> svg': {
73
66
  '--icon-secondary-color': 'transparent' // background
74
-
75
67
  }
76
68
  }
77
69
  });
70
+
78
71
  /**
79
72
  * __Icon__
80
73
  *
@@ -83,19 +76,18 @@ var secondaryTransparentHcmStyles = (0, _react2.css)({
83
76
  * - [Examples](https://atlaskit.atlassian.com/packages/design-system/icon)
84
77
  * - [Code](https://atlaskit.atlassian.com/packages/design-system/icon/docs/custom-icons)
85
78
  */
86
-
87
79
  var Icon = /*#__PURE__*/(0, _react.memo)(function Icon(props) {
88
80
  var _ref = props,
89
- Glyph = _ref.glyph,
90
- dangerouslySetGlyph = _ref.dangerouslySetGlyph,
91
- _ref$primaryColor = _ref.primaryColor,
92
- primaryColor = _ref$primaryColor === void 0 ? 'currentColor' : _ref$primaryColor,
93
- secondaryColor = _ref.secondaryColor,
94
- size = _ref.size,
95
- testId = _ref.testId,
96
- label = _ref.label,
97
- width = _ref.width,
98
- height = _ref.height;
81
+ Glyph = _ref.glyph,
82
+ dangerouslySetGlyph = _ref.dangerouslySetGlyph,
83
+ _ref$primaryColor = _ref.primaryColor,
84
+ primaryColor = _ref$primaryColor === void 0 ? 'currentColor' : _ref$primaryColor,
85
+ secondaryColor = _ref.secondaryColor,
86
+ size = _ref.size,
87
+ testId = _ref.testId,
88
+ label = _ref.label,
89
+ width = _ref.width,
90
+ height = _ref.height;
99
91
  var glyphProps = dangerouslySetGlyph ? {
100
92
  dangerouslySetInnerHTML: {
101
93
  __html: dangerouslySetGlyph
@@ -110,10 +102,8 @@ var Icon = /*#__PURE__*/(0, _react.memo)(function Icon(props) {
110
102
  height: height,
111
103
  size: size
112
104
  });
113
-
114
105
  var _useGlobalTheme = (0, _components.useGlobalTheme)(),
115
- mode = _useGlobalTheme.mode;
116
-
106
+ mode = _useGlobalTheme.mode;
117
107
  return (0, _react2.jsx)("span", (0, _extends2.default)({
118
108
  "data-testid": testId,
119
109
  role: label ? 'img' : undefined,
@@ -124,10 +114,12 @@ var Icon = /*#__PURE__*/(0, _react.memo)(function Icon(props) {
124
114
  '--icon-secondary-color': secondaryColor || (0, _utils.getBackground)(mode)
125
115
  }
126
116
  }, glyphProps, {
127
- css: [iconStyles, baseHcmStyles, primaryColor === secondaryColor && primaryEqualsSecondaryHcmStyles, secondaryColor === 'transparent' && secondaryTransparentHcmStyles, // NB: This can be resolved if this component, composes base SVG / and/or skeleton
117
+ css: [iconStyles, baseHcmStyles, primaryColor === secondaryColor && primaryEqualsSecondaryHcmStyles, secondaryColor === 'transparent' && secondaryTransparentHcmStyles,
118
+ // NB: This can be resolved if this component, composes base SVG / and/or skeleton
128
119
  // We could then simplify how common styles are dealt with simply by encapsualting them
129
120
  // at their appropriate level and/or having a singular approach to css variables in the package
130
- dimensions && // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
121
+ dimensions &&
122
+ // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
131
123
  (0, _react2.css)({
132
124
  width: dimensions.width,
133
125
  height: dimensions.height,
@@ -4,14 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = require("@emotion/react");
9
-
10
8
  var _react2 = require("react");
11
-
12
9
  var _styles = require("./styles");
13
-
14
10
  /** @jsx jsx */
11
+
15
12
  var skeletonStyles = (0, _react.css)({
16
13
  display: 'inline-block',
17
14
  borderRadius: '50%'
@@ -22,18 +19,18 @@ var subtleOpacityStyles = (0, _react.css)({
22
19
  var strongOpacityStyles = (0, _react.css)({
23
20
  opacity: 0.3
24
21
  });
22
+
25
23
  /**
26
24
  * __Skeleton__
27
25
  */
28
-
29
26
  var Skeleton = /*#__PURE__*/(0, _react2.memo)(function Skeleton(_ref) {
30
27
  var testId = _ref.testId,
31
- _ref$size = _ref.size,
32
- size = _ref$size === void 0 ? 'medium' : _ref$size,
33
- _ref$color = _ref.color,
34
- color = _ref$color === void 0 ? 'currentColor' : _ref$color,
35
- _ref$weight = _ref.weight,
36
- weight = _ref$weight === void 0 ? 'normal' : _ref$weight;
28
+ _ref$size = _ref.size,
29
+ size = _ref$size === void 0 ? 'medium' : _ref$size,
30
+ _ref$color = _ref.color,
31
+ color = _ref$color === void 0 ? 'currentColor' : _ref$color,
32
+ _ref$weight = _ref.weight,
33
+ weight = _ref$weight === void 0 ? 'normal' : _ref$weight;
37
34
  return (0, _react.jsx)("div", {
38
35
  "data-testid": testId,
39
36
  style: {
@@ -4,15 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.sizeStyleMap = exports.getIconSize = exports.commonSVGStyles = void 0;
7
-
8
7
  var _constants = require("../constants");
9
-
10
8
  var _react = require("@emotion/react");
11
-
12
9
  var commonSVGStyles = {
13
10
  overflow: 'hidden',
14
11
  pointerEvents: 'none',
15
-
16
12
  /**
17
13
  * Stop-color doesn't properly apply in chrome when the inherited/current color changes.
18
14
  * We have to initially set stop-color to inherit (either via DOM attribute or an initial CSS
@@ -26,14 +22,16 @@ exports.commonSVGStyles = commonSVGStyles;
26
22
  var smallStyles = (0, _react.css)(_constants.dimensions.small);
27
23
  var mediumStyles = (0, _react.css)(_constants.dimensions.medium);
28
24
  var largeStyles = (0, _react.css)(_constants.dimensions.large);
29
- var xlargeStyles = (0, _react.css)(_constants.dimensions.xlarge); // pre-built css style-size map
25
+ var xlargeStyles = (0, _react.css)(_constants.dimensions.xlarge);
30
26
 
27
+ // pre-built css style-size map
31
28
  var sizeStyleMap = {
32
29
  small: smallStyles,
33
30
  medium: mediumStyles,
34
31
  large: largeStyles,
35
32
  xlarge: xlargeStyles
36
33
  };
34
+
37
35
  /**
38
36
  * Returns the width of the icon's parent span. This function has
39
37
  * special behaviour to deal with icon-file-type specifically.
@@ -42,26 +40,20 @@ var sizeStyleMap = {
42
40
  * a secondary fallback which in 95% of cases is not required.
43
41
  * It's only really being kept to maintain backward compatability.
44
42
  */
45
-
46
43
  exports.sizeStyleMap = sizeStyleMap;
47
-
48
44
  var getIconSize = function getIconSize(_ref) {
49
45
  var width = _ref.width,
50
- height = _ref.height,
51
- size = _ref.size;
52
-
46
+ height = _ref.height,
47
+ size = _ref.size;
53
48
  if (width && height) {
54
49
  return {
55
50
  width: width,
56
51
  height: height
57
52
  };
58
53
  }
59
-
60
54
  if (size) {
61
55
  return _constants.dimensions[size];
62
56
  }
63
-
64
57
  return undefined;
65
58
  };
66
-
67
59
  exports.getIconSize = getIconSize;
@@ -4,20 +4,16 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = require("react");
9
-
10
8
  var _react2 = require("@emotion/react");
11
-
12
9
  var _components = require("@atlaskit/theme/components");
13
-
14
10
  var _utils = require("./utils");
15
-
16
11
  var _styles = require("./styles");
17
-
18
12
  /** @jsx jsx */
13
+
19
14
  // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
20
15
  var svgStyles = (0, _react2.css)(_styles.commonSVGStyles);
16
+
21
17
  /**
22
18
  * __SVG__
23
19
  *
@@ -26,20 +22,17 @@ var svgStyles = (0, _react2.css)(_styles.commonSVGStyles);
26
22
  * - [Examples](https://atlaskit.atlassian.com/packages/design-system/icon)
27
23
  * - [Code](https://atlaskit.atlassian.com/packages/design-system/icon/docs/custom-svgs)
28
24
  */
29
-
30
25
  var SVG = /*#__PURE__*/(0, _react.memo)(function SVG(_ref) {
31
26
  var _ref$size = _ref.size,
32
- size = _ref$size === void 0 ? 'medium' : _ref$size,
33
- label = _ref.label,
34
- _ref$primaryColor = _ref.primaryColor,
35
- primaryColor = _ref$primaryColor === void 0 ? 'currentColor' : _ref$primaryColor,
36
- secondaryColor = _ref.secondaryColor,
37
- testId = _ref.testId,
38
- children = _ref.children;
39
-
27
+ size = _ref$size === void 0 ? 'medium' : _ref$size,
28
+ label = _ref.label,
29
+ _ref$primaryColor = _ref.primaryColor,
30
+ primaryColor = _ref$primaryColor === void 0 ? 'currentColor' : _ref$primaryColor,
31
+ secondaryColor = _ref.secondaryColor,
32
+ testId = _ref.testId,
33
+ children = _ref.children;
40
34
  var _useGlobalTheme = (0, _components.useGlobalTheme)(),
41
- mode = _useGlobalTheme.mode;
42
-
35
+ mode = _useGlobalTheme.mode;
43
36
  return (0, _react2.jsx)("svg", {
44
37
  viewBox: "0 0 24 24",
45
38
  style: {
@@ -8,14 +8,13 @@ var themedBackground = {
8
8
  light: "var(--ds-surface, #FFFFFF)",
9
9
  dark: "var(--ds-surface, #1B2638)"
10
10
  };
11
+
11
12
  /**
12
13
  * Returns the background color depending on the passed through mode.
13
14
  * @param mode
14
15
  */
15
-
16
16
  var getBackground = function getBackground() {
17
17
  var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'light';
18
18
  return themedBackground[mode];
19
19
  };
20
-
21
20
  exports.getBackground = getBackground;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _typeof = require("@babel/runtime/helpers/typeof");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
@@ -17,9 +16,6 @@ Object.defineProperty(exports, "default", {
17
16
  return _icon.default;
18
17
  }
19
18
  });
20
-
21
19
  var _icon = _interopRequireWildcard(require("../components/icon"));
22
-
23
20
  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); }
24
-
25
21
  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; }
@@ -15,5 +15,4 @@ Object.defineProperty(exports, "sizes", {
15
15
  return _constants.sizes;
16
16
  }
17
17
  });
18
-
19
18
  var _constants = require("../constants");
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
@@ -11,5 +10,4 @@ Object.defineProperty(exports, "default", {
11
10
  return _metadata.default;
12
11
  }
13
12
  });
14
-
15
13
  var _metadata = _interopRequireDefault(require("../metadata"));
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
@@ -11,5 +10,4 @@ Object.defineProperty(exports, "default", {
11
10
  return _svg.default;
12
11
  }
13
12
  });
14
-
15
13
  var _svg = _interopRequireDefault(require("../components/svg"));
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = CustomGlyphProps;
7
-
8
7
  function CustomGlyphProps(props) {
9
8
  return null;
10
9
  }
@@ -4,5 +4,4 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = _default;
7
-
8
7
  function _default(_) {}
@@ -4,5 +4,4 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = _default;
7
-
8
7
  function _default(_) {}
@@ -4,5 +4,4 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = _default;
7
-
8
7
  function _default(_) {}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = SVGProps;
7
-
8
7
  function SVGProps(props) {
9
8
  return null;
10
9
  }
package/dist/cjs/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
@@ -35,11 +34,7 @@ Object.defineProperty(exports, "sizes", {
35
34
  return _constants.sizes;
36
35
  }
37
36
  });
38
-
39
37
  var _icon = _interopRequireDefault(require("./components/icon"));
40
-
41
38
  var _svg = _interopRequireDefault(require("./components/svg"));
42
-
43
39
  var _constants = require("./constants");
44
-
45
40
  var _skeleton = _interopRequireDefault(require("./components/skeleton"));
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  /* eslint-disable global-require */
9
-
10
8
  /**
11
9
  * NOTE:
12
10
  *
@@ -16,6 +14,7 @@ exports.default = void 0;
16
14
  * To change the format of this file, modify build/icon/createIconDocs.js.
17
15
  * Add synonyms in icon/icons/synonyms.js.
18
16
  */
17
+
19
18
  var metaData = {
20
19
  activity: {
21
20
  keywords: ['activity', 'window', 'icon', 'core'],
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/icon",
3
- "version": "21.11.4",
3
+ "version": "21.12.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,11 +1,11 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
-
3
2
  /** @jsx jsx */
4
3
  import { memo } from 'react';
5
4
  import { css, jsx } from '@emotion/react';
6
5
  import { useGlobalTheme } from '@atlaskit/theme/components';
7
6
  import { getBackground } from './utils';
8
7
  import { commonSVGStyles, getIconSize } from './styles';
8
+
9
9
  /**
10
10
  * We are hiding these props from consumers as they're used to
11
11
  * hack around icon sizing specifically for icon-file-type.
@@ -16,7 +16,8 @@ const iconStyles = css({
16
16
  flexShrink: 0,
17
17
  lineHeight: 1,
18
18
  // eslint-disable-next-line @repo/internal/styles/no-nested-styles
19
- '> svg': { ...commonSVGStyles,
19
+ '> svg': {
20
+ ...commonSVGStyles,
20
21
  maxWidth: '100%',
21
22
  maxHeight: '100%',
22
23
  color: 'var(--icon-primary-color)',
@@ -27,7 +28,6 @@ const iconStyles = css({
27
28
  /**
28
29
  * For windows high contrast mode
29
30
  */
30
-
31
31
  const baseHcmStyles = css({
32
32
  '@media screen and (forced-colors: active)': {
33
33
  // eslint-disable-next-line @repo/internal/styles/no-nested-styles
@@ -36,10 +36,10 @@ const baseHcmStyles = css({
36
36
  '--icon-primary-color': 'CanvasText',
37
37
  // foreground
38
38
  '--icon-secondary-color': 'Canvas' // background
39
-
40
39
  }
41
40
  }
42
41
  });
42
+
43
43
  const primaryEqualsSecondaryHcmStyles = css({
44
44
  '@media screen and (forced-colors: active)': {
45
45
  // eslint-disable-next-line @repo/internal/styles/no-nested-styles
@@ -48,19 +48,19 @@ const primaryEqualsSecondaryHcmStyles = css({
48
48
  // set the --icon-primary-color to Canvas
49
49
  // this is usually to convey state i.e. Checkbox checked -> not checked
50
50
  '--icon-primary-color': 'Canvas' // foreground
51
-
52
51
  }
53
52
  }
54
53
  });
54
+
55
55
  const secondaryTransparentHcmStyles = css({
56
56
  '@media screen and (forced-colors: active)': {
57
57
  // eslint-disable-next-line @repo/internal/styles/no-nested-styles
58
58
  '> svg': {
59
59
  '--icon-secondary-color': 'transparent' // background
60
-
61
60
  }
62
61
  }
63
62
  });
63
+
64
64
  /**
65
65
  * __Icon__
66
66
  *
@@ -69,7 +69,6 @@ const secondaryTransparentHcmStyles = css({
69
69
  * - [Examples](https://atlaskit.atlassian.com/packages/design-system/icon)
70
70
  * - [Code](https://atlaskit.atlassian.com/packages/design-system/icon/docs/custom-icons)
71
71
  */
72
-
73
72
  export const Icon = /*#__PURE__*/memo(function Icon(props) {
74
73
  const {
75
74
  glyph: Glyph,
@@ -109,10 +108,12 @@ export const Icon = /*#__PURE__*/memo(function Icon(props) {
109
108
  '--icon-secondary-color': secondaryColor || getBackground(mode)
110
109
  }
111
110
  }, glyphProps, {
112
- css: [iconStyles, baseHcmStyles, primaryColor === secondaryColor && primaryEqualsSecondaryHcmStyles, secondaryColor === 'transparent' && secondaryTransparentHcmStyles, // NB: This can be resolved if this component, composes base SVG / and/or skeleton
111
+ css: [iconStyles, baseHcmStyles, primaryColor === secondaryColor && primaryEqualsSecondaryHcmStyles, secondaryColor === 'transparent' && secondaryTransparentHcmStyles,
112
+ // NB: This can be resolved if this component, composes base SVG / and/or skeleton
113
113
  // We could then simplify how common styles are dealt with simply by encapsualting them
114
114
  // at their appropriate level and/or having a singular approach to css variables in the package
115
- dimensions && // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
115
+ dimensions &&
116
+ // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
116
117
  css({
117
118
  width: dimensions.width,
118
119
  height: dimensions.height,
@@ -12,10 +12,10 @@ const subtleOpacityStyles = css({
12
12
  const strongOpacityStyles = css({
13
13
  opacity: 0.3
14
14
  });
15
+
15
16
  /**
16
17
  * __Skeleton__
17
18
  */
18
-
19
19
  const Skeleton = /*#__PURE__*/memo(function Skeleton({
20
20
  testId,
21
21
  size = 'medium',
@@ -3,7 +3,6 @@ import { css } from '@emotion/react';
3
3
  export const commonSVGStyles = {
4
4
  overflow: 'hidden',
5
5
  pointerEvents: 'none',
6
-
7
6
  /**
8
7
  * Stop-color doesn't properly apply in chrome when the inherited/current color changes.
9
8
  * We have to initially set stop-color to inherit (either via DOM attribute or an initial CSS
@@ -16,14 +15,16 @@ export const commonSVGStyles = {
16
15
  const smallStyles = css(dimensions.small);
17
16
  const mediumStyles = css(dimensions.medium);
18
17
  const largeStyles = css(dimensions.large);
19
- const xlargeStyles = css(dimensions.xlarge); // pre-built css style-size map
18
+ const xlargeStyles = css(dimensions.xlarge);
20
19
 
20
+ // pre-built css style-size map
21
21
  export const sizeStyleMap = {
22
22
  small: smallStyles,
23
23
  medium: mediumStyles,
24
24
  large: largeStyles,
25
25
  xlarge: xlargeStyles
26
26
  };
27
+
27
28
  /**
28
29
  * Returns the width of the icon's parent span. This function has
29
30
  * special behaviour to deal with icon-file-type specifically.
@@ -32,7 +33,6 @@ export const sizeStyleMap = {
32
33
  * a secondary fallback which in 95% of cases is not required.
33
34
  * It's only really being kept to maintain backward compatability.
34
35
  */
35
-
36
36
  export const getIconSize = ({
37
37
  width,
38
38
  height,
@@ -44,10 +44,8 @@ export const getIconSize = ({
44
44
  height
45
45
  };
46
46
  }
47
-
48
47
  if (size) {
49
48
  return dimensions[size];
50
49
  }
51
-
52
50
  return undefined;
53
51
  };
@@ -3,9 +3,11 @@ import { memo } from 'react';
3
3
  import { css, jsx } from '@emotion/react';
4
4
  import { useGlobalTheme } from '@atlaskit/theme/components';
5
5
  import { getBackground } from './utils';
6
- import { commonSVGStyles, sizeStyleMap } from './styles'; // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
6
+ import { commonSVGStyles, sizeStyleMap } from './styles';
7
7
 
8
+ // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
8
9
  const svgStyles = css(commonSVGStyles);
10
+
9
11
  /**
10
12
  * __SVG__
11
13
  *
@@ -14,7 +16,6 @@ const svgStyles = css(commonSVGStyles);
14
16
  * - [Examples](https://atlaskit.atlassian.com/packages/design-system/icon)
15
17
  * - [Code](https://atlaskit.atlassian.com/packages/design-system/icon/docs/custom-svgs)
16
18
  */
17
-
18
19
  const SVG = /*#__PURE__*/memo(function SVG({
19
20
  size = 'medium',
20
21
  label,
@@ -2,9 +2,9 @@ const themedBackground = {
2
2
  light: "var(--ds-surface, #FFFFFF)",
3
3
  dark: "var(--ds-surface, #1B2638)"
4
4
  };
5
+
5
6
  /**
6
7
  * Returns the background color depending on the passed through mode.
7
8
  * @param mode
8
9
  */
9
-
10
10
  export const getBackground = (mode = 'light') => themedBackground[mode];
@@ -1,5 +1,4 @@
1
1
  /* eslint-disable global-require */
2
-
3
2
  /**
4
3
  * NOTE:
5
4
  *
@@ -9,6 +8,7 @@
9
8
  * To change the format of this file, modify build/icon/createIconDocs.js.
10
9
  * Add synonyms in icon/icons/synonyms.js.
11
10
  */
11
+
12
12
  const metaData = {
13
13
  activity: {
14
14
  keywords: ['activity', 'window', 'icon', 'core'],
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/icon",
3
- "version": "21.11.4",
3
+ "version": "21.12.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,16 +1,14 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
-
4
3
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
-
6
4
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
-
8
5
  /** @jsx jsx */
9
6
  import { memo } from 'react';
10
7
  import { css, jsx } from '@emotion/react';
11
8
  import { useGlobalTheme } from '@atlaskit/theme/components';
12
9
  import { getBackground } from './utils';
13
10
  import { commonSVGStyles, getIconSize } from './styles';
11
+
14
12
  /**
15
13
  * We are hiding these props from consumers as they're used to
16
14
  * hack around icon sizing specifically for icon-file-type.
@@ -32,7 +30,6 @@ var iconStyles = css({
32
30
  /**
33
31
  * For windows high contrast mode
34
32
  */
35
-
36
33
  var baseHcmStyles = css({
37
34
  '@media screen and (forced-colors: active)': {
38
35
  // eslint-disable-next-line @repo/internal/styles/no-nested-styles
@@ -41,10 +38,10 @@ var baseHcmStyles = css({
41
38
  '--icon-primary-color': 'CanvasText',
42
39
  // foreground
43
40
  '--icon-secondary-color': 'Canvas' // background
44
-
45
41
  }
46
42
  }
47
43
  });
44
+
48
45
  var primaryEqualsSecondaryHcmStyles = css({
49
46
  '@media screen and (forced-colors: active)': {
50
47
  // eslint-disable-next-line @repo/internal/styles/no-nested-styles
@@ -53,19 +50,19 @@ var primaryEqualsSecondaryHcmStyles = css({
53
50
  // set the --icon-primary-color to Canvas
54
51
  // this is usually to convey state i.e. Checkbox checked -> not checked
55
52
  '--icon-primary-color': 'Canvas' // foreground
56
-
57
53
  }
58
54
  }
59
55
  });
56
+
60
57
  var secondaryTransparentHcmStyles = css({
61
58
  '@media screen and (forced-colors: active)': {
62
59
  // eslint-disable-next-line @repo/internal/styles/no-nested-styles
63
60
  '> svg': {
64
61
  '--icon-secondary-color': 'transparent' // background
65
-
66
62
  }
67
63
  }
68
64
  });
65
+
69
66
  /**
70
67
  * __Icon__
71
68
  *
@@ -74,19 +71,18 @@ var secondaryTransparentHcmStyles = css({
74
71
  * - [Examples](https://atlaskit.atlassian.com/packages/design-system/icon)
75
72
  * - [Code](https://atlaskit.atlassian.com/packages/design-system/icon/docs/custom-icons)
76
73
  */
77
-
78
74
  export var Icon = /*#__PURE__*/memo(function Icon(props) {
79
75
  var _ref = props,
80
- Glyph = _ref.glyph,
81
- dangerouslySetGlyph = _ref.dangerouslySetGlyph,
82
- _ref$primaryColor = _ref.primaryColor,
83
- primaryColor = _ref$primaryColor === void 0 ? 'currentColor' : _ref$primaryColor,
84
- secondaryColor = _ref.secondaryColor,
85
- size = _ref.size,
86
- testId = _ref.testId,
87
- label = _ref.label,
88
- width = _ref.width,
89
- height = _ref.height;
76
+ Glyph = _ref.glyph,
77
+ dangerouslySetGlyph = _ref.dangerouslySetGlyph,
78
+ _ref$primaryColor = _ref.primaryColor,
79
+ primaryColor = _ref$primaryColor === void 0 ? 'currentColor' : _ref$primaryColor,
80
+ secondaryColor = _ref.secondaryColor,
81
+ size = _ref.size,
82
+ testId = _ref.testId,
83
+ label = _ref.label,
84
+ width = _ref.width,
85
+ height = _ref.height;
90
86
  var glyphProps = dangerouslySetGlyph ? {
91
87
  dangerouslySetInnerHTML: {
92
88
  __html: dangerouslySetGlyph
@@ -101,10 +97,8 @@ export var Icon = /*#__PURE__*/memo(function Icon(props) {
101
97
  height: height,
102
98
  size: size
103
99
  });
104
-
105
100
  var _useGlobalTheme = useGlobalTheme(),
106
- mode = _useGlobalTheme.mode;
107
-
101
+ mode = _useGlobalTheme.mode;
108
102
  return jsx("span", _extends({
109
103
  "data-testid": testId,
110
104
  role: label ? 'img' : undefined,
@@ -115,10 +109,12 @@ export var Icon = /*#__PURE__*/memo(function Icon(props) {
115
109
  '--icon-secondary-color': secondaryColor || getBackground(mode)
116
110
  }
117
111
  }, glyphProps, {
118
- css: [iconStyles, baseHcmStyles, primaryColor === secondaryColor && primaryEqualsSecondaryHcmStyles, secondaryColor === 'transparent' && secondaryTransparentHcmStyles, // NB: This can be resolved if this component, composes base SVG / and/or skeleton
112
+ css: [iconStyles, baseHcmStyles, primaryColor === secondaryColor && primaryEqualsSecondaryHcmStyles, secondaryColor === 'transparent' && secondaryTransparentHcmStyles,
113
+ // NB: This can be resolved if this component, composes base SVG / and/or skeleton
119
114
  // We could then simplify how common styles are dealt with simply by encapsualting them
120
115
  // at their appropriate level and/or having a singular approach to css variables in the package
121
- dimensions && // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
116
+ dimensions &&
117
+ // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
122
118
  css({
123
119
  width: dimensions.width,
124
120
  height: dimensions.height,
@@ -12,18 +12,18 @@ var subtleOpacityStyles = css({
12
12
  var strongOpacityStyles = css({
13
13
  opacity: 0.3
14
14
  });
15
+
15
16
  /**
16
17
  * __Skeleton__
17
18
  */
18
-
19
19
  var Skeleton = /*#__PURE__*/memo(function Skeleton(_ref) {
20
20
  var testId = _ref.testId,
21
- _ref$size = _ref.size,
22
- size = _ref$size === void 0 ? 'medium' : _ref$size,
23
- _ref$color = _ref.color,
24
- color = _ref$color === void 0 ? 'currentColor' : _ref$color,
25
- _ref$weight = _ref.weight,
26
- weight = _ref$weight === void 0 ? 'normal' : _ref$weight;
21
+ _ref$size = _ref.size,
22
+ size = _ref$size === void 0 ? 'medium' : _ref$size,
23
+ _ref$color = _ref.color,
24
+ color = _ref$color === void 0 ? 'currentColor' : _ref$color,
25
+ _ref$weight = _ref.weight,
26
+ weight = _ref$weight === void 0 ? 'normal' : _ref$weight;
27
27
  return jsx("div", {
28
28
  "data-testid": testId,
29
29
  style: {
@@ -3,7 +3,6 @@ import { css } from '@emotion/react';
3
3
  export var commonSVGStyles = {
4
4
  overflow: 'hidden',
5
5
  pointerEvents: 'none',
6
-
7
6
  /**
8
7
  * Stop-color doesn't properly apply in chrome when the inherited/current color changes.
9
8
  * We have to initially set stop-color to inherit (either via DOM attribute or an initial CSS
@@ -16,14 +15,16 @@ export var commonSVGStyles = {
16
15
  var smallStyles = css(dimensions.small);
17
16
  var mediumStyles = css(dimensions.medium);
18
17
  var largeStyles = css(dimensions.large);
19
- var xlargeStyles = css(dimensions.xlarge); // pre-built css style-size map
18
+ var xlargeStyles = css(dimensions.xlarge);
20
19
 
20
+ // pre-built css style-size map
21
21
  export var sizeStyleMap = {
22
22
  small: smallStyles,
23
23
  medium: mediumStyles,
24
24
  large: largeStyles,
25
25
  xlarge: xlargeStyles
26
26
  };
27
+
27
28
  /**
28
29
  * Returns the width of the icon's parent span. This function has
29
30
  * special behaviour to deal with icon-file-type specifically.
@@ -32,22 +33,18 @@ export var sizeStyleMap = {
32
33
  * a secondary fallback which in 95% of cases is not required.
33
34
  * It's only really being kept to maintain backward compatability.
34
35
  */
35
-
36
36
  export var getIconSize = function getIconSize(_ref) {
37
37
  var width = _ref.width,
38
- height = _ref.height,
39
- size = _ref.size;
40
-
38
+ height = _ref.height,
39
+ size = _ref.size;
41
40
  if (width && height) {
42
41
  return {
43
42
  width: width,
44
43
  height: height
45
44
  };
46
45
  }
47
-
48
46
  if (size) {
49
47
  return dimensions[size];
50
48
  }
51
-
52
49
  return undefined;
53
50
  };
@@ -3,9 +3,11 @@ import { memo } from 'react';
3
3
  import { css, jsx } from '@emotion/react';
4
4
  import { useGlobalTheme } from '@atlaskit/theme/components';
5
5
  import { getBackground } from './utils';
6
- import { commonSVGStyles, sizeStyleMap } from './styles'; // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
6
+ import { commonSVGStyles, sizeStyleMap } from './styles';
7
7
 
8
+ // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
8
9
  var svgStyles = css(commonSVGStyles);
10
+
9
11
  /**
10
12
  * __SVG__
11
13
  *
@@ -14,20 +16,17 @@ var svgStyles = css(commonSVGStyles);
14
16
  * - [Examples](https://atlaskit.atlassian.com/packages/design-system/icon)
15
17
  * - [Code](https://atlaskit.atlassian.com/packages/design-system/icon/docs/custom-svgs)
16
18
  */
17
-
18
19
  var SVG = /*#__PURE__*/memo(function SVG(_ref) {
19
20
  var _ref$size = _ref.size,
20
- size = _ref$size === void 0 ? 'medium' : _ref$size,
21
- label = _ref.label,
22
- _ref$primaryColor = _ref.primaryColor,
23
- primaryColor = _ref$primaryColor === void 0 ? 'currentColor' : _ref$primaryColor,
24
- secondaryColor = _ref.secondaryColor,
25
- testId = _ref.testId,
26
- children = _ref.children;
27
-
21
+ size = _ref$size === void 0 ? 'medium' : _ref$size,
22
+ label = _ref.label,
23
+ _ref$primaryColor = _ref.primaryColor,
24
+ primaryColor = _ref$primaryColor === void 0 ? 'currentColor' : _ref$primaryColor,
25
+ secondaryColor = _ref.secondaryColor,
26
+ testId = _ref.testId,
27
+ children = _ref.children;
28
28
  var _useGlobalTheme = useGlobalTheme(),
29
- mode = _useGlobalTheme.mode;
30
-
29
+ mode = _useGlobalTheme.mode;
31
30
  return jsx("svg", {
32
31
  viewBox: "0 0 24 24",
33
32
  style: {
@@ -2,11 +2,11 @@ var themedBackground = {
2
2
  light: "var(--ds-surface, #FFFFFF)",
3
3
  dark: "var(--ds-surface, #1B2638)"
4
4
  };
5
+
5
6
  /**
6
7
  * Returns the background color depending on the passed through mode.
7
8
  * @param mode
8
9
  */
9
-
10
10
  export var getBackground = function getBackground() {
11
11
  var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'light';
12
12
  return themedBackground[mode];
@@ -1,5 +1,4 @@
1
1
  /* eslint-disable global-require */
2
-
3
2
  /**
4
3
  * NOTE:
5
4
  *
@@ -9,6 +8,7 @@
9
8
  * To change the format of this file, modify build/icon/createIconDocs.js.
10
9
  * Add synonyms in icon/icons/synonyms.js.
11
10
  */
11
+
12
12
  var metaData = {
13
13
  activity: {
14
14
  keywords: ['activity', 'window', 'icon', 'core'],
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/icon",
3
- "version": "21.11.4",
3
+ "version": "21.12.0",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/icon",
3
- "version": "21.11.4",
3
+ "version": "21.12.0",
4
4
  "description": "An icon is a visual representation of a command, device, directory, or common action.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -16,7 +16,6 @@
16
16
  "atlaskit:src": "src/index.tsx",
17
17
  "homepage": "https://atlassian.design/components/icon/",
18
18
  "atlassian": {
19
- "disableProductCI": true,
20
19
  "team": "Design System Team",
21
20
  "releaseModel": "scheduled",
22
21
  "website": {
@@ -37,8 +36,8 @@
37
36
  "build-glyphs": "ts-node --project ../../../tsconfig.node.json ./build/index.tsx"
38
37
  },
39
38
  "dependencies": {
40
- "@atlaskit/theme": "^12.2.0",
41
- "@atlaskit/tokens": "^0.13.0",
39
+ "@atlaskit/theme": "^12.5.0",
40
+ "@atlaskit/tokens": "^1.3.0",
42
41
  "@babel/runtime": "^7.0.0",
43
42
  "@emotion/react": "^11.7.1"
44
43
  },
@@ -47,21 +46,21 @@
47
46
  },
48
47
  "devDependencies": {
49
48
  "@af/icon-build-process": "^0.3.0",
50
- "@atlaskit/button": "^16.5.0",
49
+ "@atlaskit/button": "^16.7.0",
51
50
  "@atlaskit/docs": "*",
52
- "@atlaskit/ds-lib": "^2.1.1",
53
- "@atlaskit/dynamic-table": "^14.8.0",
54
- "@atlaskit/icon-file-type": "^6.3.0",
55
- "@atlaskit/icon-object": "^6.2.0",
56
- "@atlaskit/logo": "^13.10.0",
57
- "@atlaskit/modal-dialog": "^12.4.0",
58
- "@atlaskit/section-message": "^6.3.0",
51
+ "@atlaskit/ds-lib": "^2.2.0",
52
+ "@atlaskit/dynamic-table": "^14.9.0",
53
+ "@atlaskit/icon-file-type": "^6.4.0",
54
+ "@atlaskit/icon-object": "^6.3.0",
55
+ "@atlaskit/logo": "^13.14.0",
56
+ "@atlaskit/modal-dialog": "^12.5.0",
57
+ "@atlaskit/section-message": "^6.4.0",
59
58
  "@atlaskit/ssr": "*",
60
- "@atlaskit/textfield": "^5.3.0",
61
- "@atlaskit/tooltip": "^17.6.0",
59
+ "@atlaskit/textfield": "^5.4.0",
60
+ "@atlaskit/tooltip": "^17.8.0",
62
61
  "@atlaskit/visual-regression": "*",
63
62
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
64
- "@babel/core": "^7.12.3",
63
+ "@babel/core": "^7.20.0",
65
64
  "@emotion/babel-preset-css-prop": "^10.0.7",
66
65
  "@testing-library/react": "^12.1.5",
67
66
  "classnames": "^2.2.5",
@@ -89,7 +88,9 @@
89
88
  ],
90
89
  "ui-components": "lite-mode",
91
90
  "analytics": "analytics-next",
92
- "theming": "tokens",
91
+ "design-tokens": [
92
+ "color"
93
+ ],
93
94
  "deprecation": "no-deprecated-imports"
94
95
  }
95
96
  },
package/report.api.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- API Report Version: 2.2 -->
1
+ <!-- API Report Version: 2.3 -->
2
2
 
3
3
  ## API Report File for "@atlaskit/icon"
4
4