@atlaskit/icon 21.12.8 → 22.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/icon
2
2
 
3
+ ## 22.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#41812](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41812) [`48b3b440f51`](https://bitbucket.org/atlassian/atlassian-frontend/commits/48b3b440f51) - Removed all remaining legacy theming logic from the Icon and ProgressIndicator components.
8
+
3
9
  ## 21.12.8
4
10
 
5
11
  ### Patch Changes
@@ -9,7 +9,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
10
  var _react = require("react");
11
11
  var _react2 = require("@emotion/react");
12
- var _components = require("@atlaskit/theme/components");
13
12
  var _utils = require("./utils");
14
13
  var _styles = require("./styles");
15
14
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -102,8 +101,6 @@ var Icon = exports.Icon = /*#__PURE__*/(0, _react.memo)(function Icon(props) {
102
101
  height: height,
103
102
  size: size
104
103
  });
105
- var _useGlobalTheme = (0, _components.useGlobalTheme)(),
106
- mode = _useGlobalTheme.mode;
107
104
  return (0, _react2.jsx)("span", (0, _extends2.default)({
108
105
  "data-testid": testId,
109
106
  role: label ? 'img' : undefined,
@@ -111,7 +108,7 @@ var Icon = exports.Icon = /*#__PURE__*/(0, _react.memo)(function Icon(props) {
111
108
  "aria-hidden": label ? undefined : true,
112
109
  style: {
113
110
  '--icon-primary-color': primaryColor,
114
- '--icon-secondary-color': secondaryColor || (0, _utils.getBackground)(mode)
111
+ '--icon-secondary-color': secondaryColor || (0, _utils.getBackground)()
115
112
  }
116
113
  }, glyphProps, {
117
114
  css: [iconStyles, baseHcmStyles, primaryColor === secondaryColor && primaryEqualsSecondaryHcmStyles, secondaryColor === 'transparent' && secondaryTransparentHcmStyles,
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _react = require("react");
8
8
  var _react2 = require("@emotion/react");
9
- var _components = require("@atlaskit/theme/components");
10
9
  var _utils = require("./utils");
11
10
  var _styles = require("./styles");
12
11
  /** @jsx jsx */
@@ -31,13 +30,11 @@ var SVG = /*#__PURE__*/(0, _react.memo)(function SVG(_ref) {
31
30
  secondaryColor = _ref.secondaryColor,
32
31
  testId = _ref.testId,
33
32
  children = _ref.children;
34
- var _useGlobalTheme = (0, _components.useGlobalTheme)(),
35
- mode = _useGlobalTheme.mode;
36
33
  return (0, _react2.jsx)("svg", {
37
34
  viewBox: "0 0 24 24",
38
35
  style: {
39
36
  color: primaryColor,
40
- fill: secondaryColor || (0, _utils.getBackground)(mode)
37
+ fill: secondaryColor || (0, _utils.getBackground)()
41
38
  },
42
39
  css: [svgStyles, _styles.sizeStyleMap[size]],
43
40
  "data-testid": testId,
@@ -4,16 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getBackground = void 0;
7
- var themedBackground = {
8
- light: "var(--ds-surface, #FFFFFF)",
9
- dark: "var(--ds-surface, #1B2638)"
10
- };
11
-
12
- /**
13
- * Returns the background color depending on the passed through mode.
14
- * @param mode
15
- */
16
7
  var getBackground = exports.getBackground = function getBackground() {
17
- var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'light';
18
- return themedBackground[mode];
8
+ return "var(--ds-surface, #FFFFFF)";
19
9
  };
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- /* eslint-disable global-require */
8
7
  /**
9
8
  * NOTE:
10
9
  *
@@ -2,7 +2,6 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  /** @jsx jsx */
3
3
  import { memo } from 'react';
4
4
  import { css, jsx } from '@emotion/react';
5
- import { useGlobalTheme } from '@atlaskit/theme/components';
6
5
  import { getBackground } from './utils';
7
6
  import { commonSVGStyles, getIconSize } from './styles';
8
7
 
@@ -95,9 +94,6 @@ export const Icon = /*#__PURE__*/memo(function Icon(props) {
95
94
  height,
96
95
  size
97
96
  });
98
- const {
99
- mode
100
- } = useGlobalTheme();
101
97
  return jsx("span", _extends({
102
98
  "data-testid": testId,
103
99
  role: label ? 'img' : undefined,
@@ -105,7 +101,7 @@ export const Icon = /*#__PURE__*/memo(function Icon(props) {
105
101
  "aria-hidden": label ? undefined : true,
106
102
  style: {
107
103
  '--icon-primary-color': primaryColor,
108
- '--icon-secondary-color': secondaryColor || getBackground(mode)
104
+ '--icon-secondary-color': secondaryColor || getBackground()
109
105
  }
110
106
  }, glyphProps, {
111
107
  css: [iconStyles, baseHcmStyles, primaryColor === secondaryColor && primaryEqualsSecondaryHcmStyles, secondaryColor === 'transparent' && secondaryTransparentHcmStyles,
@@ -1,7 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { memo } from 'react';
3
3
  import { css, jsx } from '@emotion/react';
4
- import { useGlobalTheme } from '@atlaskit/theme/components';
5
4
  import { getBackground } from './utils';
6
5
  import { commonSVGStyles, sizeStyleMap } from './styles';
7
6
 
@@ -24,14 +23,11 @@ const SVG = /*#__PURE__*/memo(function SVG({
24
23
  testId,
25
24
  children
26
25
  }) {
27
- const {
28
- mode
29
- } = useGlobalTheme();
30
26
  return jsx("svg", {
31
27
  viewBox: "0 0 24 24",
32
28
  style: {
33
29
  color: primaryColor,
34
- fill: secondaryColor || getBackground(mode)
30
+ fill: secondaryColor || getBackground()
35
31
  },
36
32
  css: [svgStyles, sizeStyleMap[size]],
37
33
  "data-testid": testId,
@@ -1,10 +1 @@
1
- const themedBackground = {
2
- light: "var(--ds-surface, #FFFFFF)",
3
- dark: "var(--ds-surface, #1B2638)"
4
- };
5
-
6
- /**
7
- * Returns the background color depending on the passed through mode.
8
- * @param mode
9
- */
10
- export const getBackground = (mode = 'light') => themedBackground[mode];
1
+ export const getBackground = () => "var(--ds-surface, #FFFFFF)";
@@ -1,4 +1,3 @@
1
- /* eslint-disable global-require */
2
1
  /**
3
2
  * NOTE:
4
3
  *
@@ -5,7 +5,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
5
5
  /** @jsx jsx */
6
6
  import { memo } from 'react';
7
7
  import { css, jsx } from '@emotion/react';
8
- import { useGlobalTheme } from '@atlaskit/theme/components';
9
8
  import { getBackground } from './utils';
10
9
  import { commonSVGStyles, getIconSize } from './styles';
11
10
 
@@ -97,8 +96,6 @@ export var Icon = /*#__PURE__*/memo(function Icon(props) {
97
96
  height: height,
98
97
  size: size
99
98
  });
100
- var _useGlobalTheme = useGlobalTheme(),
101
- mode = _useGlobalTheme.mode;
102
99
  return jsx("span", _extends({
103
100
  "data-testid": testId,
104
101
  role: label ? 'img' : undefined,
@@ -106,7 +103,7 @@ export var Icon = /*#__PURE__*/memo(function Icon(props) {
106
103
  "aria-hidden": label ? undefined : true,
107
104
  style: {
108
105
  '--icon-primary-color': primaryColor,
109
- '--icon-secondary-color': secondaryColor || getBackground(mode)
106
+ '--icon-secondary-color': secondaryColor || getBackground()
110
107
  }
111
108
  }, glyphProps, {
112
109
  css: [iconStyles, baseHcmStyles, primaryColor === secondaryColor && primaryEqualsSecondaryHcmStyles, secondaryColor === 'transparent' && secondaryTransparentHcmStyles,
@@ -1,7 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { memo } from 'react';
3
3
  import { css, jsx } from '@emotion/react';
4
- import { useGlobalTheme } from '@atlaskit/theme/components';
5
4
  import { getBackground } from './utils';
6
5
  import { commonSVGStyles, sizeStyleMap } from './styles';
7
6
 
@@ -25,13 +24,11 @@ var SVG = /*#__PURE__*/memo(function SVG(_ref) {
25
24
  secondaryColor = _ref.secondaryColor,
26
25
  testId = _ref.testId,
27
26
  children = _ref.children;
28
- var _useGlobalTheme = useGlobalTheme(),
29
- mode = _useGlobalTheme.mode;
30
27
  return jsx("svg", {
31
28
  viewBox: "0 0 24 24",
32
29
  style: {
33
30
  color: primaryColor,
34
- fill: secondaryColor || getBackground(mode)
31
+ fill: secondaryColor || getBackground()
35
32
  },
36
33
  css: [svgStyles, sizeStyleMap[size]],
37
34
  "data-testid": testId,
@@ -1,13 +1,3 @@
1
- var themedBackground = {
2
- light: "var(--ds-surface, #FFFFFF)",
3
- dark: "var(--ds-surface, #1B2638)"
4
- };
5
-
6
- /**
7
- * Returns the background color depending on the passed through mode.
8
- * @param mode
9
- */
10
1
  export var getBackground = function getBackground() {
11
- var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'light';
12
- return themedBackground[mode];
2
+ return "var(--ds-surface, #FFFFFF)";
13
3
  };
@@ -1,4 +1,3 @@
1
- /* eslint-disable global-require */
2
1
  /**
3
2
  * NOTE:
4
3
  *
@@ -1,6 +1 @@
1
- import type { ThemeModes } from '@atlaskit/theme/types';
2
- /**
3
- * Returns the background color depending on the passed through mode.
4
- * @param mode
5
- */
6
- export declare const getBackground: (mode?: ThemeModes) => "var(--ds-surface)";
1
+ export declare const getBackground: () => "var(--ds-surface)";
@@ -1,6 +1 @@
1
- import type { ThemeModes } from '@atlaskit/theme/types';
2
- /**
3
- * Returns the background color depending on the passed through mode.
4
- * @param mode
5
- */
6
- export declare const getBackground: (mode?: ThemeModes) => "var(--ds-surface)";
1
+ export declare const getBackground: () => "var(--ds-surface)";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/icon",
3
- "version": "21.12.8",
3
+ "version": "22.0.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/"
@@ -29,7 +29,6 @@
29
29
  "build-glyphs": "ts-node --project ../../../tsconfig.node.json ./build/index.tsx"
30
30
  },
31
31
  "dependencies": {
32
- "@atlaskit/theme": "^12.6.0",
33
32
  "@atlaskit/tokens": "^1.28.0",
34
33
  "@babel/runtime": "^7.0.0",
35
34
  "@emotion/react": "^11.7.1"
@@ -40,9 +39,11 @@
40
39
  "devDependencies": {
41
40
  "@af/accessibility-testing": "*",
42
41
  "@af/icon-build-process": "^0.3.0",
42
+ "@af/visual-regression": "*",
43
43
  "@atlaskit/ds-lib": "^2.2.0",
44
44
  "@atlaskit/logo": "^13.14.0",
45
45
  "@atlaskit/ssr": "*",
46
+ "@atlaskit/theme": "^12.6.0",
46
47
  "@atlaskit/visual-regression": "*",
47
48
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
48
49
  "@babel/core": "^7.20.0",