@atlaskit/icon 22.5.1 → 22.7.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 +22 -0
- package/dist/cjs/components/icon-new.js +9 -4
- package/dist/cjs/components/icon-tile.js +1 -1
- package/dist/cjs/components/icon.js +9 -6
- package/dist/cjs/components/skeleton.js +1 -1
- package/dist/cjs/components/styles.js +1 -1
- package/dist/cjs/components/svg.js +1 -1
- package/dist/es2019/components/icon-new.js +11 -5
- package/dist/es2019/components/icon-tile.js +1 -1
- package/dist/es2019/components/icon.js +10 -4
- package/dist/es2019/components/skeleton.js +1 -1
- package/dist/es2019/components/styles.js +1 -1
- package/dist/es2019/components/svg.js +1 -1
- package/dist/esm/components/icon-new.js +11 -5
- package/dist/esm/components/icon-tile.js +1 -1
- package/dist/esm/components/icon.js +9 -6
- package/dist/esm/components/skeleton.js +1 -1
- package/dist/esm/components/styles.js +1 -1
- package/dist/esm/components/svg.js +1 -1
- package/dist/types/types.d.ts +10 -1
- package/dist/types-ts4.5/types.d.ts +10 -1
- package/package.json +4 -4
- package/dist/cjs/extract-react-types/custom-glyph.js +0 -9
- package/dist/cjs/extract-react-types/glyph-no-color-size.js +0 -7
- package/dist/cjs/extract-react-types/glyph-no-color.js +0 -7
- package/dist/cjs/extract-react-types/glyph.js +0 -7
- package/dist/cjs/extract-react-types/svg.js +0 -9
- package/dist/es2019/extract-react-types/custom-glyph.js +0 -3
- package/dist/es2019/extract-react-types/glyph-no-color-size.js +0 -1
- package/dist/es2019/extract-react-types/glyph-no-color.js +0 -1
- package/dist/es2019/extract-react-types/glyph.js +0 -1
- package/dist/es2019/extract-react-types/svg.js +0 -3
- package/dist/esm/extract-react-types/custom-glyph.js +0 -3
- package/dist/esm/extract-react-types/glyph-no-color-size.js +0 -1
- package/dist/esm/extract-react-types/glyph-no-color.js +0 -1
- package/dist/esm/extract-react-types/glyph.js +0 -1
- package/dist/esm/extract-react-types/svg.js +0 -3
- package/dist/types/extract-react-types/custom-glyph.d.ts +0 -2
- package/dist/types/extract-react-types/glyph-no-color-size.d.ts +0 -2
- package/dist/types/extract-react-types/glyph-no-color.d.ts +0 -2
- package/dist/types/extract-react-types/glyph.d.ts +0 -2
- package/dist/types/extract-react-types/svg.d.ts +0 -2
- package/dist/types-ts4.5/extract-react-types/custom-glyph.d.ts +0 -2
- package/dist/types-ts4.5/extract-react-types/glyph-no-color-size.d.ts +0 -2
- package/dist/types-ts4.5/extract-react-types/glyph-no-color.d.ts +0 -2
- package/dist/types-ts4.5/extract-react-types/glyph.d.ts +0 -2
- package/dist/types-ts4.5/extract-react-types/svg.d.ts +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @atlaskit/icon
|
|
2
2
|
|
|
3
|
+
## 22.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#122612](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/122612)
|
|
8
|
+
[`0c9d2190a14f2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0c9d2190a14f2) -
|
|
9
|
+
Adds a new prop, LEGACY_margin, to the new icon API to allow for spacing adjustments between old
|
|
10
|
+
and new icons API.
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#122977](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/122977)
|
|
15
|
+
[`41748db2c12de`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/41748db2c12de) -
|
|
16
|
+
[ux]ED-24225 add wrap button inside editor-plugin-block
|
|
17
|
+
|
|
18
|
+
## 22.6.0
|
|
19
|
+
|
|
20
|
+
### Minor Changes
|
|
21
|
+
|
|
22
|
+
- [`c1a3f0e0f18e2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c1a3f0e0f18e2) -
|
|
23
|
+
Adds LEGACY_primaryColor to the icon API, to assist with user migration.
|
|
24
|
+
|
|
3
25
|
## 22.5.1
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
@@ -9,8 +9,8 @@ var _react2 = require("@emotion/react");
|
|
|
9
9
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
10
|
/**
|
|
11
11
|
* @jsxRuntime classic
|
|
12
|
+
* @jsx jsx
|
|
12
13
|
*/
|
|
13
|
-
/** @jsx jsx */
|
|
14
14
|
|
|
15
15
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
16
16
|
|
|
@@ -100,26 +100,31 @@ 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,
|
|
106
107
|
_ref$type = _ref.type,
|
|
107
108
|
type = _ref$type === void 0 ? 'global' : _ref$type,
|
|
108
109
|
dangerouslySetGlyph = _ref.dangerouslySetGlyph,
|
|
109
|
-
shouldScale = _ref.shouldScale
|
|
110
|
+
shouldScale = _ref.shouldScale,
|
|
111
|
+
LEGACY_margin = _ref.LEGACY_margin;
|
|
110
112
|
var dangerouslySetInnerHTML = dangerouslySetGlyph ? {
|
|
111
113
|
__html: dangerouslySetGlyph
|
|
112
114
|
} : undefined;
|
|
113
115
|
|
|
114
116
|
// Fall back to old icon
|
|
115
|
-
if (FallbackIcon && !(0, _platformFeatureFlags.
|
|
117
|
+
if (FallbackIcon && !(0, _platformFeatureFlags.fg)('platform.design-system-team.enable-new-icons')) {
|
|
116
118
|
// parse out unnecessary props
|
|
117
119
|
return (0, _react2.jsx)(FallbackIcon, {
|
|
118
|
-
primaryColor: color,
|
|
120
|
+
primaryColor: LEGACY_primaryColor !== null && LEGACY_primaryColor !== void 0 ? LEGACY_primaryColor : color,
|
|
119
121
|
secondaryColor: LEGACY_secondaryColor,
|
|
120
122
|
size: LEGACY_size,
|
|
121
123
|
label: label,
|
|
122
124
|
testId: testId
|
|
125
|
+
// @ts-ignore-next-line
|
|
126
|
+
,
|
|
127
|
+
UNSAFE_margin: LEGACY_margin
|
|
123
128
|
});
|
|
124
129
|
}
|
|
125
130
|
|
|
@@ -9,12 +9,13 @@ 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 _utils = require("./utils");
|
|
13
12
|
var _styles = require("./styles");
|
|
13
|
+
var _utils = require("./utils");
|
|
14
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; }
|
|
15
15
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /**
|
|
16
16
|
* @jsxRuntime classic
|
|
17
|
-
|
|
17
|
+
* @jsx jsx
|
|
18
|
+
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
18
19
|
/**
|
|
19
20
|
* We are hiding these props from consumers as they're used to
|
|
20
21
|
* hack around icon sizing specifically for icon-file-type.
|
|
@@ -86,7 +87,8 @@ var Icon = exports.Icon = /*#__PURE__*/(0, _react.memo)(function Icon(props) {
|
|
|
86
87
|
testId = _ref.testId,
|
|
87
88
|
label = _ref.label,
|
|
88
89
|
width = _ref.width,
|
|
89
|
-
height = _ref.height
|
|
90
|
+
height = _ref.height,
|
|
91
|
+
UNSAFE_margin = _ref.UNSAFE_margin;
|
|
90
92
|
var glyphProps = dangerouslySetGlyph ? {
|
|
91
93
|
dangerouslySetInnerHTML: {
|
|
92
94
|
__html: dangerouslySetGlyph
|
|
@@ -108,12 +110,13 @@ var Icon = exports.Icon = /*#__PURE__*/(0, _react.memo)(function Icon(props) {
|
|
|
108
110
|
"aria-hidden": label ? undefined : true
|
|
109
111
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
110
112
|
,
|
|
111
|
-
style: {
|
|
113
|
+
style: _objectSpread({
|
|
112
114
|
'--icon-primary-color': primaryColor,
|
|
113
115
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
114
116
|
'--icon-secondary-color': secondaryColor || (0, _utils.getBackground)()
|
|
115
|
-
|
|
116
|
-
|
|
117
|
+
}, UNSAFE_margin ? {
|
|
118
|
+
margin: UNSAFE_margin
|
|
119
|
+
} : {})
|
|
117
120
|
}, glyphProps, {
|
|
118
121
|
css: [iconStyles, baseHcmStyles, primaryColor === secondaryColor && primaryEqualsSecondaryHcmStyles, secondaryColor === 'transparent' && secondaryTransparentHcmStyles,
|
|
119
122
|
// NB: This can be resolved if this component, composes base SVG / and/or skeleton
|
|
@@ -9,8 +9,8 @@ var _react2 = require("react");
|
|
|
9
9
|
var _styles = require("./styles");
|
|
10
10
|
/**
|
|
11
11
|
* @jsxRuntime classic
|
|
12
|
+
* @jsx jsx
|
|
12
13
|
*/
|
|
13
|
-
/** @jsx jsx */
|
|
14
14
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
15
15
|
|
|
16
16
|
var skeletonStyles = (0, _react.css)({
|
|
@@ -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/
|
|
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,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
3
4
|
*/
|
|
4
|
-
/** @jsx jsx */
|
|
5
5
|
import { memo } from 'react';
|
|
6
|
+
|
|
6
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
8
|
import { css, jsx } from '@emotion/react';
|
|
8
|
-
import {
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* We are hiding this props from consumers as it's reserved
|
|
@@ -91,6 +92,7 @@ export const Icon = /*#__PURE__*/memo(function Icon(props) {
|
|
|
91
92
|
spacing: providedSpacing = 'none',
|
|
92
93
|
testId,
|
|
93
94
|
label,
|
|
95
|
+
LEGACY_primaryColor,
|
|
94
96
|
LEGACY_secondaryColor,
|
|
95
97
|
LEGACY_size,
|
|
96
98
|
LEGACY_fallbackIcon: FallbackIcon,
|
|
@@ -99,21 +101,25 @@ export const Icon = /*#__PURE__*/memo(function Icon(props) {
|
|
|
99
101
|
// Used to set icon glyphs in codegen
|
|
100
102
|
dangerouslySetGlyph,
|
|
101
103
|
// Used with iconTile to scale icon up and down
|
|
102
|
-
shouldScale
|
|
104
|
+
shouldScale,
|
|
105
|
+
LEGACY_margin
|
|
103
106
|
} = props;
|
|
104
107
|
const dangerouslySetInnerHTML = dangerouslySetGlyph ? {
|
|
105
108
|
__html: dangerouslySetGlyph
|
|
106
109
|
} : undefined;
|
|
107
110
|
|
|
108
111
|
// Fall back to old icon
|
|
109
|
-
if (FallbackIcon && !
|
|
112
|
+
if (FallbackIcon && !fg('platform.design-system-team.enable-new-icons')) {
|
|
110
113
|
// parse out unnecessary props
|
|
111
114
|
return jsx(FallbackIcon, {
|
|
112
|
-
primaryColor: color,
|
|
115
|
+
primaryColor: LEGACY_primaryColor !== null && LEGACY_primaryColor !== void 0 ? LEGACY_primaryColor : color,
|
|
113
116
|
secondaryColor: LEGACY_secondaryColor,
|
|
114
117
|
size: LEGACY_size,
|
|
115
118
|
label: label,
|
|
116
119
|
testId: testId
|
|
120
|
+
// @ts-ignore-next-line
|
|
121
|
+
,
|
|
122
|
+
UNSAFE_margin: LEGACY_margin
|
|
117
123
|
});
|
|
118
124
|
}
|
|
119
125
|
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
/**
|
|
3
3
|
* @jsxRuntime classic
|
|
4
|
+
* @jsx jsx
|
|
4
5
|
*/
|
|
5
|
-
/** @jsx jsx */
|
|
6
6
|
import { memo } from 'react';
|
|
7
|
+
|
|
7
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
9
|
import { css, jsx } from '@emotion/react';
|
|
9
|
-
import { getBackground } from './utils';
|
|
10
10
|
import { commonSVGStyles, getIconSize } from './styles';
|
|
11
|
+
import { getBackground } from './utils';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* We are hiding these props from consumers as they're used to
|
|
@@ -81,7 +82,8 @@ export const Icon = /*#__PURE__*/memo(function Icon(props) {
|
|
|
81
82
|
testId,
|
|
82
83
|
label,
|
|
83
84
|
width,
|
|
84
|
-
height
|
|
85
|
+
height,
|
|
86
|
+
UNSAFE_margin
|
|
85
87
|
} = props;
|
|
86
88
|
const glyphProps = dangerouslySetGlyph ? {
|
|
87
89
|
dangerouslySetInnerHTML: {
|
|
@@ -107,7 +109,11 @@ export const Icon = /*#__PURE__*/memo(function Icon(props) {
|
|
|
107
109
|
style: {
|
|
108
110
|
'--icon-primary-color': primaryColor,
|
|
109
111
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
110
|
-
'--icon-secondary-color': secondaryColor || getBackground()
|
|
112
|
+
'--icon-secondary-color': secondaryColor || getBackground(),
|
|
113
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
114
|
+
...(UNSAFE_margin ? {
|
|
115
|
+
margin: UNSAFE_margin
|
|
116
|
+
} : {})
|
|
111
117
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
112
118
|
}
|
|
113
119
|
}, glyphProps, {
|
|
@@ -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/
|
|
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,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
3
4
|
*/
|
|
4
|
-
/** @jsx jsx */
|
|
5
5
|
import { memo } from 'react';
|
|
6
|
+
|
|
6
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
8
|
import { css, jsx } from '@emotion/react';
|
|
8
|
-
import {
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* We are hiding this props from consumers as it's reserved
|
|
@@ -93,26 +94,31 @@ export var Icon = /*#__PURE__*/memo(function Icon(props) {
|
|
|
93
94
|
providedSpacing = _ref$spacing === void 0 ? 'none' : _ref$spacing,
|
|
94
95
|
testId = _ref.testId,
|
|
95
96
|
label = _ref.label,
|
|
97
|
+
LEGACY_primaryColor = _ref.LEGACY_primaryColor,
|
|
96
98
|
LEGACY_secondaryColor = _ref.LEGACY_secondaryColor,
|
|
97
99
|
LEGACY_size = _ref.LEGACY_size,
|
|
98
100
|
FallbackIcon = _ref.LEGACY_fallbackIcon,
|
|
99
101
|
_ref$type = _ref.type,
|
|
100
102
|
type = _ref$type === void 0 ? 'global' : _ref$type,
|
|
101
103
|
dangerouslySetGlyph = _ref.dangerouslySetGlyph,
|
|
102
|
-
shouldScale = _ref.shouldScale
|
|
104
|
+
shouldScale = _ref.shouldScale,
|
|
105
|
+
LEGACY_margin = _ref.LEGACY_margin;
|
|
103
106
|
var dangerouslySetInnerHTML = dangerouslySetGlyph ? {
|
|
104
107
|
__html: dangerouslySetGlyph
|
|
105
108
|
} : undefined;
|
|
106
109
|
|
|
107
110
|
// Fall back to old icon
|
|
108
|
-
if (FallbackIcon && !
|
|
111
|
+
if (FallbackIcon && !fg('platform.design-system-team.enable-new-icons')) {
|
|
109
112
|
// parse out unnecessary props
|
|
110
113
|
return jsx(FallbackIcon, {
|
|
111
|
-
primaryColor: color,
|
|
114
|
+
primaryColor: LEGACY_primaryColor !== null && LEGACY_primaryColor !== void 0 ? LEGACY_primaryColor : color,
|
|
112
115
|
secondaryColor: LEGACY_secondaryColor,
|
|
113
116
|
size: LEGACY_size,
|
|
114
117
|
label: label,
|
|
115
118
|
testId: testId
|
|
119
|
+
// @ts-ignore-next-line
|
|
120
|
+
,
|
|
121
|
+
UNSAFE_margin: LEGACY_margin
|
|
116
122
|
});
|
|
117
123
|
}
|
|
118
124
|
|
|
@@ -4,13 +4,14 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
/**
|
|
6
6
|
* @jsxRuntime classic
|
|
7
|
+
* @jsx jsx
|
|
7
8
|
*/
|
|
8
|
-
/** @jsx jsx */
|
|
9
9
|
import { memo } from 'react';
|
|
10
|
+
|
|
10
11
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
11
12
|
import { css, jsx } from '@emotion/react';
|
|
12
|
-
import { getBackground } from './utils';
|
|
13
13
|
import { commonSVGStyles, getIconSize } from './styles';
|
|
14
|
+
import { getBackground } from './utils';
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* We are hiding these props from consumers as they're used to
|
|
@@ -83,7 +84,8 @@ export var Icon = /*#__PURE__*/memo(function Icon(props) {
|
|
|
83
84
|
testId = _ref.testId,
|
|
84
85
|
label = _ref.label,
|
|
85
86
|
width = _ref.width,
|
|
86
|
-
height = _ref.height
|
|
87
|
+
height = _ref.height,
|
|
88
|
+
UNSAFE_margin = _ref.UNSAFE_margin;
|
|
87
89
|
var glyphProps = dangerouslySetGlyph ? {
|
|
88
90
|
dangerouslySetInnerHTML: {
|
|
89
91
|
__html: dangerouslySetGlyph
|
|
@@ -105,12 +107,13 @@ export var Icon = /*#__PURE__*/memo(function Icon(props) {
|
|
|
105
107
|
"aria-hidden": label ? undefined : true
|
|
106
108
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
107
109
|
,
|
|
108
|
-
style: {
|
|
110
|
+
style: _objectSpread({
|
|
109
111
|
'--icon-primary-color': primaryColor,
|
|
110
112
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
111
113
|
'--icon-secondary-color': secondaryColor || getBackground()
|
|
112
|
-
|
|
113
|
-
|
|
114
|
+
}, UNSAFE_margin ? {
|
|
115
|
+
margin: UNSAFE_margin
|
|
116
|
+
} : {})
|
|
114
117
|
}, glyphProps, {
|
|
115
118
|
css: [iconStyles, baseHcmStyles, primaryColor === secondaryColor && primaryEqualsSecondaryHcmStyles, secondaryColor === 'transparent' && secondaryTransparentHcmStyles,
|
|
116
119
|
// NB: This can be resolved if this component, composes base SVG / and/or skeleton
|
|
@@ -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/
|
|
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,
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentType, SVGProps as ReactSVGProps
|
|
1
|
+
import type { ComponentType, ReactNode, SVGProps as ReactSVGProps } from 'react';
|
|
2
2
|
import type { IconColor, IconColorPressed } from '@atlaskit/tokens/css-type-schema';
|
|
3
3
|
export type Size = 'small' | 'medium' | 'large' | 'xlarge';
|
|
4
4
|
export interface CustomGlyphProps extends ReactSVGProps<SVGSVGElement> {
|
|
@@ -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
|
*/
|
|
@@ -106,6 +111,10 @@ export interface NewIconProps extends NewGlyphProps, IconInternalGlyphProps {
|
|
|
106
111
|
* Icon type. Used in icon build process.
|
|
107
112
|
*/
|
|
108
113
|
type?: 'utility' | 'global';
|
|
114
|
+
/**
|
|
115
|
+
* Sets a margin on the fallback legacy icon.
|
|
116
|
+
*/
|
|
117
|
+
LEGACY_margin?: string;
|
|
109
118
|
}
|
|
110
119
|
export type IconTileAppearance = 'gray' | 'blue' | 'teal' | 'green' | 'lime' | 'yellow' | 'orange' | 'red' | 'magenta' | 'purple' | 'grayBold' | 'blueBold' | 'tealBold' | 'greenBold' | 'limeBold' | 'yellowBold' | 'orangeBold' | 'redBold' | 'magentaBold' | 'purpleBold';
|
|
111
120
|
export type IconTileSize = '16' | '24' | '32' | '40' | '48';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentType, SVGProps as ReactSVGProps
|
|
1
|
+
import type { ComponentType, ReactNode, SVGProps as ReactSVGProps } from 'react';
|
|
2
2
|
import type { IconColor, IconColorPressed } from '@atlaskit/tokens/css-type-schema';
|
|
3
3
|
export type Size = 'small' | 'medium' | 'large' | 'xlarge';
|
|
4
4
|
export interface CustomGlyphProps extends ReactSVGProps<SVGSVGElement> {
|
|
@@ -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
|
*/
|
|
@@ -106,6 +111,10 @@ export interface NewIconProps extends NewGlyphProps, IconInternalGlyphProps {
|
|
|
106
111
|
* Icon type. Used in icon build process.
|
|
107
112
|
*/
|
|
108
113
|
type?: 'utility' | 'global';
|
|
114
|
+
/**
|
|
115
|
+
* Sets a margin on the fallback legacy icon.
|
|
116
|
+
*/
|
|
117
|
+
LEGACY_margin?: string;
|
|
109
118
|
}
|
|
110
119
|
export type IconTileAppearance = 'gray' | 'blue' | 'teal' | 'green' | 'lime' | 'yellow' | 'orange' | 'red' | 'magenta' | 'purple' | 'grayBold' | 'blueBold' | 'tealBold' | 'greenBold' | 'limeBold' | 'yellowBold' | 'orangeBold' | 'redBold' | 'magentaBold' | 'purpleBold';
|
|
111
120
|
export type IconTileSize = '16' | '24' | '32' | '40' | '48';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/icon",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.7.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/"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
34
|
-
"@atlaskit/tokens": "^1.
|
|
34
|
+
"@atlaskit/tokens": "^1.56.0",
|
|
35
35
|
"@babel/runtime": "^7.0.0",
|
|
36
36
|
"@emotion/react": "^11.7.1"
|
|
37
37
|
},
|
|
@@ -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.
|
|
45
|
+
"@atlaskit/code": "^15.4.0",
|
|
46
46
|
"@atlaskit/ds-lib": "^2.3.0",
|
|
47
47
|
"@atlaskit/logo": "^14.1.0",
|
|
48
|
-
"@atlaskit/primitives": "^
|
|
48
|
+
"@atlaskit/primitives": "^11.0.0",
|
|
49
49
|
"@atlaskit/ssr": "*",
|
|
50
50
|
"@atlaskit/textfield": "^6.4.0",
|
|
51
51
|
"@atlaskit/theme": "^12.11.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function (_) {}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function (_) {}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function (_) {}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function (_) {}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function (_) {}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function (_) {}
|