@atlaskit/icon 22.5.1 → 22.6.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,12 @@
1
1
  # @atlaskit/icon
2
2
 
3
+ ## 22.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`c1a3f0e0f18e2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c1a3f0e0f18e2) -
8
+ Adds LEGACY_primaryColor to the icon API, to assist with user migration.
9
+
3
10
  ## 22.5.1
4
11
 
5
12
  ### Patch Changes
@@ -100,6 +100,7 @@ var Icon = exports.Icon = /*#__PURE__*/(0, _react.memo)(function Icon(props) {
100
100
  providedSpacing = _ref$spacing === void 0 ? 'none' : _ref$spacing,
101
101
  testId = _ref.testId,
102
102
  label = _ref.label,
103
+ LEGACY_primaryColor = _ref.LEGACY_primaryColor,
103
104
  LEGACY_secondaryColor = _ref.LEGACY_secondaryColor,
104
105
  LEGACY_size = _ref.LEGACY_size,
105
106
  FallbackIcon = _ref.LEGACY_fallbackIcon,
@@ -112,10 +113,10 @@ var Icon = exports.Icon = /*#__PURE__*/(0, _react.memo)(function Icon(props) {
112
113
  } : undefined;
113
114
 
114
115
  // Fall back to old icon
115
- if (FallbackIcon && !(0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.enable-new-icons')) {
116
+ if (FallbackIcon && !(0, _platformFeatureFlags.fg)('platform.design-system-team.enable-new-icons')) {
116
117
  // parse out unnecessary props
117
118
  return (0, _react2.jsx)(FallbackIcon, {
118
- primaryColor: color,
119
+ primaryColor: LEGACY_primaryColor !== null && LEGACY_primaryColor !== void 0 ? LEGACY_primaryColor : color,
119
120
  secondaryColor: LEGACY_secondaryColor,
120
121
  size: LEGACY_size,
121
122
  label: label,
@@ -31,7 +31,7 @@ var largeStyles = (0, _react.css)(_constants.dimensions.large);
31
31
  var xlargeStyles = (0, _react.css)(_constants.dimensions.xlarge);
32
32
 
33
33
  // pre-built css style-size map
34
- // eslint-disable-next-line @atlaskit/design-system/no-exported-css, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
34
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
35
35
  var sizeStyleMap = exports.sizeStyleMap = {
36
36
  small: smallStyles,
37
37
  medium: mediumStyles,
@@ -5,7 +5,7 @@
5
5
  import { memo } from 'react';
6
6
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
7
  import { css, jsx } from '@emotion/react';
8
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
9
9
 
10
10
  /**
11
11
  * We are hiding this props from consumers as it's reserved
@@ -91,6 +91,7 @@ export const Icon = /*#__PURE__*/memo(function Icon(props) {
91
91
  spacing: providedSpacing = 'none',
92
92
  testId,
93
93
  label,
94
+ LEGACY_primaryColor,
94
95
  LEGACY_secondaryColor,
95
96
  LEGACY_size,
96
97
  LEGACY_fallbackIcon: FallbackIcon,
@@ -106,10 +107,10 @@ export const Icon = /*#__PURE__*/memo(function Icon(props) {
106
107
  } : undefined;
107
108
 
108
109
  // Fall back to old icon
109
- if (FallbackIcon && !getBooleanFF('platform.design-system-team.enable-new-icons')) {
110
+ if (FallbackIcon && !fg('platform.design-system-team.enable-new-icons')) {
110
111
  // parse out unnecessary props
111
112
  return jsx(FallbackIcon, {
112
- primaryColor: color,
113
+ primaryColor: LEGACY_primaryColor !== null && LEGACY_primaryColor !== void 0 ? LEGACY_primaryColor : color,
113
114
  secondaryColor: LEGACY_secondaryColor,
114
115
  size: LEGACY_size,
115
116
  label: label,
@@ -24,7 +24,7 @@ const largeStyles = css(dimensions.large);
24
24
  const xlargeStyles = css(dimensions.xlarge);
25
25
 
26
26
  // pre-built css style-size map
27
- // eslint-disable-next-line @atlaskit/design-system/no-exported-css, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
27
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
28
28
  export const sizeStyleMap = {
29
29
  small: smallStyles,
30
30
  medium: mediumStyles,
@@ -5,7 +5,7 @@
5
5
  import { memo } from 'react';
6
6
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
7
  import { css, jsx } from '@emotion/react';
8
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
9
9
 
10
10
  /**
11
11
  * We are hiding this props from consumers as it's reserved
@@ -93,6 +93,7 @@ export var Icon = /*#__PURE__*/memo(function Icon(props) {
93
93
  providedSpacing = _ref$spacing === void 0 ? 'none' : _ref$spacing,
94
94
  testId = _ref.testId,
95
95
  label = _ref.label,
96
+ LEGACY_primaryColor = _ref.LEGACY_primaryColor,
96
97
  LEGACY_secondaryColor = _ref.LEGACY_secondaryColor,
97
98
  LEGACY_size = _ref.LEGACY_size,
98
99
  FallbackIcon = _ref.LEGACY_fallbackIcon,
@@ -105,10 +106,10 @@ export var Icon = /*#__PURE__*/memo(function Icon(props) {
105
106
  } : undefined;
106
107
 
107
108
  // Fall back to old icon
108
- if (FallbackIcon && !getBooleanFF('platform.design-system-team.enable-new-icons')) {
109
+ if (FallbackIcon && !fg('platform.design-system-team.enable-new-icons')) {
109
110
  // parse out unnecessary props
110
111
  return jsx(FallbackIcon, {
111
- primaryColor: color,
112
+ primaryColor: LEGACY_primaryColor !== null && LEGACY_primaryColor !== void 0 ? LEGACY_primaryColor : color,
112
113
  secondaryColor: LEGACY_secondaryColor,
113
114
  size: LEGACY_size,
114
115
  label: label,
@@ -24,7 +24,7 @@ var largeStyles = css(dimensions.large);
24
24
  var xlargeStyles = css(dimensions.xlarge);
25
25
 
26
26
  // pre-built css style-size map
27
- // eslint-disable-next-line @atlaskit/design-system/no-exported-css, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
27
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
28
28
  export var sizeStyleMap = {
29
29
  small: smallStyles,
30
30
  medium: mediumStyles,
@@ -94,6 +94,11 @@ export interface NewIconProps extends NewGlyphProps, IconInternalGlyphProps {
94
94
  * The legacy icon defaults to "medium" size, with `primaryColor` set to the value of the `color` prop.
95
95
  */
96
96
  LEGACY_fallbackIcon?: ComponentType<IconProps>;
97
+ /**
98
+ * Optional custom primary color to be rendered by the fallback icon, only to be use when a different color than the `color` prop is required.
99
+ * @default Use the `color` prop value.
100
+ */
101
+ LEGACY_primaryColor?: string;
97
102
  /**
98
103
  * Secondary color to be rendered by the legacy fallback icon
99
104
  */
@@ -94,6 +94,11 @@ export interface NewIconProps extends NewGlyphProps, IconInternalGlyphProps {
94
94
  * The legacy icon defaults to "medium" size, with `primaryColor` set to the value of the `color` prop.
95
95
  */
96
96
  LEGACY_fallbackIcon?: ComponentType<IconProps>;
97
+ /**
98
+ * Optional custom primary color to be rendered by the fallback icon, only to be use when a different color than the `color` prop is required.
99
+ * @default Use the `color` prop value.
100
+ */
101
+ LEGACY_primaryColor?: string;
97
102
  /**
98
103
  * Secondary color to be rendered by the legacy fallback icon
99
104
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/icon",
3
- "version": "22.5.1",
3
+ "version": "22.6.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/"
@@ -42,10 +42,10 @@
42
42
  "@af/accessibility-testing": "*",
43
43
  "@af/icon-build-process": "^1.0.0",
44
44
  "@af/visual-regression": "*",
45
- "@atlaskit/code": "^15.3.0",
45
+ "@atlaskit/code": "^15.4.0",
46
46
  "@atlaskit/ds-lib": "^2.3.0",
47
47
  "@atlaskit/logo": "^14.1.0",
48
- "@atlaskit/primitives": "^10.0.0",
48
+ "@atlaskit/primitives": "^10.1.0",
49
49
  "@atlaskit/ssr": "*",
50
50
  "@atlaskit/textfield": "^6.4.0",
51
51
  "@atlaskit/theme": "^12.11.0",