@atlaskit/icon 22.18.1 → 22.19.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.19.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`318191402c2ad`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/318191402c2ad) -
8
+ Add LEGACY_fallbackComponent prop to Icon Tile
9
+
3
10
  ## 22.18.1
4
11
 
5
12
  ### Patch Changes
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = IconTile;
7
7
  var _react = require("@emotion/react");
8
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
8
9
  /**
9
10
  * @jsxRuntime classic
10
11
  * @jsx jsx
@@ -147,14 +148,19 @@ function IconTile(props) {
147
148
  _props$size = props.size,
148
149
  size = _props$size === void 0 ? '24' : _props$size,
149
150
  _props$shape = props.shape,
150
- shape = _props$shape === void 0 ? 'square' : _props$shape;
151
+ shape = _props$shape === void 0 ? 'square' : _props$shape,
152
+ LEGACY_fallbackComponent = props.LEGACY_fallbackComponent;
151
153
  var ExpandedIcon = Icon;
152
- return (0, _react.jsx)("span", {
153
- css: [iconTileStyles, appearanceMap[appearance], sizeMap[size], shapeMap[shape]]
154
- }, (0, _react.jsx)(ExpandedIcon, {
155
- color: "currentColor",
156
- label: label,
157
- spacing: "spacious",
158
- shouldScale: true
159
- }));
154
+ if (LEGACY_fallbackComponent && !(0, _platformFeatureFlags.fg)('platform.design-system-team.enable-new-icons')) {
155
+ return LEGACY_fallbackComponent;
156
+ } else {
157
+ return (0, _react.jsx)("span", {
158
+ css: [iconTileStyles, appearanceMap[appearance], sizeMap[size], shapeMap[shape]]
159
+ }, (0, _react.jsx)(ExpandedIcon, {
160
+ color: "currentColor",
161
+ label: label,
162
+ spacing: "spacious",
163
+ shouldScale: true
164
+ }));
165
+ }
160
166
  }
@@ -5,6 +5,7 @@
5
5
 
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 { fg } from '@atlaskit/platform-feature-flags';
8
9
  const sizeMap = {
9
10
  '16': css({
10
11
  width: '16px',
@@ -139,15 +140,20 @@ export default function IconTile(props) {
139
140
  label,
140
141
  appearance,
141
142
  size = '24',
142
- shape = 'square'
143
+ shape = 'square',
144
+ LEGACY_fallbackComponent
143
145
  } = props;
144
146
  const ExpandedIcon = Icon;
145
- return jsx("span", {
146
- css: [iconTileStyles, appearanceMap[appearance], sizeMap[size], shapeMap[shape]]
147
- }, jsx(ExpandedIcon, {
148
- color: "currentColor",
149
- label: label,
150
- spacing: "spacious",
151
- shouldScale: true
152
- }));
147
+ if (LEGACY_fallbackComponent && !fg('platform.design-system-team.enable-new-icons')) {
148
+ return LEGACY_fallbackComponent;
149
+ } else {
150
+ return jsx("span", {
151
+ css: [iconTileStyles, appearanceMap[appearance], sizeMap[size], shapeMap[shape]]
152
+ }, jsx(ExpandedIcon, {
153
+ color: "currentColor",
154
+ label: label,
155
+ spacing: "spacious",
156
+ shouldScale: true
157
+ }));
158
+ }
153
159
  }
@@ -5,6 +5,7 @@
5
5
 
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 { fg } from '@atlaskit/platform-feature-flags';
8
9
  var sizeMap = {
9
10
  '16': css({
10
11
  width: '16px',
@@ -140,14 +141,19 @@ export default function IconTile(props) {
140
141
  _props$size = props.size,
141
142
  size = _props$size === void 0 ? '24' : _props$size,
142
143
  _props$shape = props.shape,
143
- shape = _props$shape === void 0 ? 'square' : _props$shape;
144
+ shape = _props$shape === void 0 ? 'square' : _props$shape,
145
+ LEGACY_fallbackComponent = props.LEGACY_fallbackComponent;
144
146
  var ExpandedIcon = Icon;
145
- return jsx("span", {
146
- css: [iconTileStyles, appearanceMap[appearance], sizeMap[size], shapeMap[shape]]
147
- }, jsx(ExpandedIcon, {
148
- color: "currentColor",
149
- label: label,
150
- spacing: "spacious",
151
- shouldScale: true
152
- }));
147
+ if (LEGACY_fallbackComponent && !fg('platform.design-system-team.enable-new-icons')) {
148
+ return LEGACY_fallbackComponent;
149
+ } else {
150
+ return jsx("span", {
151
+ css: [iconTileStyles, appearanceMap[appearance], sizeMap[size], shapeMap[shape]]
152
+ }, jsx(ExpandedIcon, {
153
+ color: "currentColor",
154
+ label: label,
155
+ spacing: "spacious",
156
+ shouldScale: true
157
+ }));
158
+ }
153
159
  }
@@ -1,4 +1,4 @@
1
- import type { ComponentType, ReactNode, SVGProps as ReactSVGProps } from 'react';
1
+ import type { ComponentType, ReactElement, ReactNode, SVGProps as ReactSVGProps } from 'react';
2
2
  import type { IconColor, IconColorPressed, TextColor, TextColorPressed } from '@atlaskit/tokens/css-type-schema';
3
3
  export type Size = 'small' | 'medium' | 'large' | 'xlarge';
4
4
  export interface CustomGlyphProps extends ReactSVGProps<SVGSVGElement> {
@@ -94,7 +94,7 @@ export interface IconProps extends GlyphProps, IconInternalGlyphProps {
94
94
  }
95
95
  export interface NewIconProps extends NewGlyphProps, IconInternalGlyphProps {
96
96
  /**
97
- * Legacy icon component to render when feature flag turned off.
97
+ * Legacy icon component to render when the icon refresh feature flag is turned off.
98
98
  * The legacy icon defaults to "medium" size, with `primaryColor` set to the value of the `color` prop.
99
99
  */
100
100
  LEGACY_fallbackIcon?: ComponentType<IconProps>;
@@ -144,6 +144,10 @@ export interface IconTileProps {
144
144
  * Shape of the tile background. Defaults to "square"
145
145
  */
146
146
  shape?: 'square' | 'circle';
147
+ /**
148
+ * Legacy component to render when the icon refresh feature flag is turned off.
149
+ */
150
+ LEGACY_fallbackComponent?: ReactElement;
147
151
  }
148
152
  export interface SkeletonProps {
149
153
  color?: string;
@@ -1,4 +1,4 @@
1
- import type { ComponentType, ReactNode, SVGProps as ReactSVGProps } from 'react';
1
+ import type { ComponentType, ReactElement, ReactNode, SVGProps as ReactSVGProps } from 'react';
2
2
  import type { IconColor, IconColorPressed, TextColor, TextColorPressed } from '@atlaskit/tokens/css-type-schema';
3
3
  export type Size = 'small' | 'medium' | 'large' | 'xlarge';
4
4
  export interface CustomGlyphProps extends ReactSVGProps<SVGSVGElement> {
@@ -94,7 +94,7 @@ export interface IconProps extends GlyphProps, IconInternalGlyphProps {
94
94
  }
95
95
  export interface NewIconProps extends NewGlyphProps, IconInternalGlyphProps {
96
96
  /**
97
- * Legacy icon component to render when feature flag turned off.
97
+ * Legacy icon component to render when the icon refresh feature flag is turned off.
98
98
  * The legacy icon defaults to "medium" size, with `primaryColor` set to the value of the `color` prop.
99
99
  */
100
100
  LEGACY_fallbackIcon?: ComponentType<IconProps>;
@@ -144,6 +144,10 @@ export interface IconTileProps {
144
144
  * Shape of the tile background. Defaults to "square"
145
145
  */
146
146
  shape?: 'square' | 'circle';
147
+ /**
148
+ * Legacy component to render when the icon refresh feature flag is turned off.
149
+ */
150
+ LEGACY_fallbackComponent?: ReactElement;
147
151
  }
148
152
  export interface SkeletonProps {
149
153
  color?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/icon",
3
- "version": "22.18.1",
3
+ "version": "22.19.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/"