@atlaskit/icon 22.16.0 → 22.17.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 +16 -0
- package/codemods/22.14.0-new-icon-migrate-color-prop.tsx +1 -1
- package/codemods/__tests__/next-new-icon-migrate-color-prop.test.tsx +2 -2
- package/dist/cjs/components/icon-facade.js +3 -3
- package/dist/cjs/entry-points/base-new.js +1 -1
- package/dist/cjs/entry-points/base.js +1 -1
- package/dist/cjs/entry-points/migration-map.js +1 -1
- package/dist/cjs/migration-map.js +1 -1
- package/dist/es2019/components/icon-facade.js +2 -2
- package/dist/es2019/migration-map.js +1 -1
- package/dist/esm/components/icon-facade.js +2 -2
- package/dist/esm/migration-map.js +1 -1
- package/dist/types/types.d.ts +4 -0
- package/dist/types-ts4.5/types.d.ts +4 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/icon
|
|
2
2
|
|
|
3
|
+
## 22.17.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#139873](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/139873)
|
|
8
|
+
[`141a2cdfda71c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/141a2cdfda71c) -
|
|
9
|
+
Add support to opt out of icon facade via the `isFacadeDisabled` prop.
|
|
10
|
+
|
|
11
|
+
## 22.16.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#137821](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/137821)
|
|
16
|
+
[`bcca6c1789a37`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bcca6c1789a37) -
|
|
17
|
+
Rename of `@atlassian/icon-lab` to `@atlaskit/icon-lab`
|
|
18
|
+
|
|
3
19
|
## 22.16.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
|
@@ -9,7 +9,7 @@ describe('Migrate color API', () => {
|
|
|
9
9
|
`
|
|
10
10
|
import AddIcon from '@atlaskit/icon/core/add';
|
|
11
11
|
import ChevronDownIcon from '@atlaskit/icon/utility/add';
|
|
12
|
-
import BitbucketBranchIcon from '@
|
|
12
|
+
import BitbucketBranchIcon from '@atlaskit/icon-lab/core/bitbucket-branch';
|
|
13
13
|
|
|
14
14
|
const App = () => (
|
|
15
15
|
<>
|
|
@@ -24,7 +24,7 @@ describe('Migrate color API', () => {
|
|
|
24
24
|
import { token } from "@atlaskit/tokens";
|
|
25
25
|
import AddIcon from '@atlaskit/icon/core/add';
|
|
26
26
|
import ChevronDownIcon from '@atlaskit/icon/utility/add';
|
|
27
|
-
import BitbucketBranchIcon from '@
|
|
27
|
+
import BitbucketBranchIcon from '@atlaskit/icon-lab/core/bitbucket-branch';
|
|
28
28
|
|
|
29
29
|
const App = () => (
|
|
30
30
|
<>
|
|
@@ -13,7 +13,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
13
13
|
var _icon = _interopRequireDefault(require("./icon"));
|
|
14
14
|
var _excluded = ["dangerouslySetGlyph"];
|
|
15
15
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
16
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
17
|
var sizesEligibleForNewIcons = ['small', 'medium'];
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -33,9 +33,9 @@ var IconFacade = exports.IconFacade = /*#__PURE__*/(0, _react.memo)(function Ico
|
|
|
33
33
|
// By default, the icon size will be medium and spacing will be none for small icons
|
|
34
34
|
var size = (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : 'medium';
|
|
35
35
|
var spacing = size === 'small' ? 'none' : 'spacious';
|
|
36
|
-
|
|
36
|
+
var useNewIcon = !props.isFacadeDisabled &&
|
|
37
37
|
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
38
|
-
|
|
38
|
+
(0, _platformFeatureFlags.fg)('platform-visual-refresh-icons-legacy-facade') && sizesEligibleForNewIcons.includes(size);
|
|
39
39
|
if (useNewIcon && NewIcon) {
|
|
40
40
|
return /*#__PURE__*/_react.default.createElement(NewIcon, (0, _extends2.default)({}, props, {
|
|
41
41
|
spacing: spacing,
|
|
@@ -18,4 +18,4 @@ Object.defineProperty(exports, "default", {
|
|
|
18
18
|
});
|
|
19
19
|
var _iconNew = _interopRequireWildcard(require("../components/icon-new"));
|
|
20
20
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
21
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
21
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -25,4 +25,4 @@ Object.defineProperty(exports, "default", {
|
|
|
25
25
|
var _icon = _interopRequireWildcard(require("../components/icon"));
|
|
26
26
|
var _iconFacade = require("../components/icon-facade");
|
|
27
27
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
28
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
28
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -18,4 +18,4 @@ Object.defineProperty(exports, "migrationOutcomeDescriptionMap", {
|
|
|
18
18
|
});
|
|
19
19
|
var _migrationMap = _interopRequireWildcard(require("../migration-map"));
|
|
20
20
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
21
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
21
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -12,7 +12,7 @@ var migrationOutcomeDescriptionMap = exports.migrationOutcomeDescriptionMap = {
|
|
|
12
12
|
'no-larger-size': 'This icon should not be used with a larger size; please shift to a smaller size.',
|
|
13
13
|
'not-recommended': 'No equivalent icon in new set. This icon is not recommended.',
|
|
14
14
|
'product-icon': 'Product icons are not supported; please use the custom SVG component from `@atlaskit/icon/svg`.',
|
|
15
|
-
'icon-lab': 'Find an alternative icon, or create an updated icon in the new style, and contribute it to `@
|
|
15
|
+
'icon-lab': 'Find an alternative icon, or create an updated icon in the new style, and contribute it to `@atlaskit/icon-lab`.',
|
|
16
16
|
'top-nav': 'This icon is only for use for top navigation; please choose a different icon if used elsewhere.',
|
|
17
17
|
'icon-tile': 'Switch to Icon Tile, use a smaller size or remove.',
|
|
18
18
|
'16-icon-tile': "This icon can be re-created using an Icon tile with size='16'.",
|
|
@@ -22,9 +22,9 @@ export const IconFacade = /*#__PURE__*/memo(function IconFacade({
|
|
|
22
22
|
// By default, the icon size will be medium and spacing will be none for small icons
|
|
23
23
|
const size = (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : 'medium';
|
|
24
24
|
const spacing = size === 'small' ? 'none' : 'spacious';
|
|
25
|
-
|
|
25
|
+
const useNewIcon = !props.isFacadeDisabled &&
|
|
26
26
|
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
27
|
-
|
|
27
|
+
fg('platform-visual-refresh-icons-legacy-facade') && sizesEligibleForNewIcons.includes(size);
|
|
28
28
|
if (useNewIcon && NewIcon) {
|
|
29
29
|
return /*#__PURE__*/React.createElement(NewIcon, _extends({}, props, {
|
|
30
30
|
spacing: spacing,
|
|
@@ -6,7 +6,7 @@ export const migrationOutcomeDescriptionMap = {
|
|
|
6
6
|
'no-larger-size': 'This icon should not be used with a larger size; please shift to a smaller size.',
|
|
7
7
|
'not-recommended': 'No equivalent icon in new set. This icon is not recommended.',
|
|
8
8
|
'product-icon': 'Product icons are not supported; please use the custom SVG component from `@atlaskit/icon/svg`.',
|
|
9
|
-
'icon-lab': 'Find an alternative icon, or create an updated icon in the new style, and contribute it to `@
|
|
9
|
+
'icon-lab': 'Find an alternative icon, or create an updated icon in the new style, and contribute it to `@atlaskit/icon-lab`.',
|
|
10
10
|
'top-nav': 'This icon is only for use for top navigation; please choose a different icon if used elsewhere.',
|
|
11
11
|
'icon-tile': 'Switch to Icon Tile, use a smaller size or remove.',
|
|
12
12
|
'16-icon-tile': "This icon can be re-created using an Icon tile with size='16'.",
|
|
@@ -23,9 +23,9 @@ export var IconFacade = /*#__PURE__*/memo(function IconFacade(_ref) {
|
|
|
23
23
|
// By default, the icon size will be medium and spacing will be none for small icons
|
|
24
24
|
var size = (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : 'medium';
|
|
25
25
|
var spacing = size === 'small' ? 'none' : 'spacious';
|
|
26
|
-
|
|
26
|
+
var useNewIcon = !props.isFacadeDisabled &&
|
|
27
27
|
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
28
|
-
|
|
28
|
+
fg('platform-visual-refresh-icons-legacy-facade') && sizesEligibleForNewIcons.includes(size);
|
|
29
29
|
if (useNewIcon && NewIcon) {
|
|
30
30
|
return /*#__PURE__*/React.createElement(NewIcon, _extends({}, props, {
|
|
31
31
|
spacing: spacing,
|
|
@@ -6,7 +6,7 @@ export var migrationOutcomeDescriptionMap = {
|
|
|
6
6
|
'no-larger-size': 'This icon should not be used with a larger size; please shift to a smaller size.',
|
|
7
7
|
'not-recommended': 'No equivalent icon in new set. This icon is not recommended.',
|
|
8
8
|
'product-icon': 'Product icons are not supported; please use the custom SVG component from `@atlaskit/icon/svg`.',
|
|
9
|
-
'icon-lab': 'Find an alternative icon, or create an updated icon in the new style, and contribute it to `@
|
|
9
|
+
'icon-lab': 'Find an alternative icon, or create an updated icon in the new style, and contribute it to `@atlaskit/icon-lab`.',
|
|
10
10
|
'top-nav': 'This icon is only for use for top navigation; please choose a different icon if used elsewhere.',
|
|
11
11
|
'icon-tile': 'Switch to Icon Tile, use a smaller size or remove.',
|
|
12
12
|
'16-icon-tile': "This icon can be re-created using an Icon tile with size='16'.",
|
package/dist/types/types.d.ts
CHANGED
|
@@ -67,6 +67,10 @@ export interface OtherGlyphProps {
|
|
|
67
67
|
* serving as a hook for automated tests.
|
|
68
68
|
*/
|
|
69
69
|
testId?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Used to opt out of the icon facade and only display the legacy icon regardless of the feature flag.
|
|
72
|
+
*/
|
|
73
|
+
isFacadeDisabled?: boolean;
|
|
70
74
|
}
|
|
71
75
|
interface IconInternalGlyphProps {
|
|
72
76
|
/**
|
|
@@ -67,6 +67,10 @@ export interface OtherGlyphProps {
|
|
|
67
67
|
* serving as a hook for automated tests.
|
|
68
68
|
*/
|
|
69
69
|
testId?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Used to opt out of the icon facade and only display the legacy icon regardless of the feature flag.
|
|
72
|
+
*/
|
|
73
|
+
isFacadeDisabled?: boolean;
|
|
70
74
|
}
|
|
71
75
|
interface IconInternalGlyphProps {
|
|
72
76
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/icon",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.17.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/"
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@atlaskit/toggle": "^13.4.0",
|
|
49
49
|
"@atlaskit/tooltip": "^18.7.0",
|
|
50
50
|
"@atlaskit/visual-regression": "*",
|
|
51
|
-
"@babel/core": "
|
|
51
|
+
"@babel/core": "7.24.9",
|
|
52
52
|
"@emotion/babel-preset-css-prop": "^10.0.7",
|
|
53
53
|
"@testing-library/react": "^12.1.5",
|
|
54
54
|
"classnames": "^2.2.5",
|