@atlaskit/icon 21.12.8 → 22.0.1
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 +12 -0
- package/afm-cc/tsconfig.json +25 -0
- package/dist/cjs/components/icon.js +1 -4
- package/dist/cjs/components/svg.js +1 -4
- package/dist/cjs/components/utils.js +1 -11
- package/dist/cjs/metadata.js +0 -1
- package/dist/es2019/components/icon.js +1 -5
- package/dist/es2019/components/svg.js +1 -5
- package/dist/es2019/components/utils.js +1 -10
- package/dist/es2019/metadata.js +0 -1
- package/dist/esm/components/icon.js +1 -4
- package/dist/esm/components/svg.js +1 -4
- package/dist/esm/components/utils.js +1 -11
- package/dist/esm/metadata.js +0 -1
- package/dist/types/components/utils.d.ts +1 -6
- package/dist/types-ts4.5/components/utils.d.ts +1 -6
- package/package.json +5 -4
- package/tmp/api-report-tmp.d.ts +0 -86
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/icon
|
|
2
2
|
|
|
3
|
+
## 22.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#72130](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/72130) [`b037e5451037`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b037e5451037) - Update new button text color fallback for default theme (non-token) to match that of old button current text color
|
|
8
|
+
|
|
9
|
+
## 22.0.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- [#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.
|
|
14
|
+
|
|
3
15
|
## 21.12.8
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../../tsconfig.entry-points.confluence.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"target": "es5",
|
|
6
|
+
"composite": true,
|
|
7
|
+
"outDir": "../dist",
|
|
8
|
+
"rootDir": "../",
|
|
9
|
+
"baseUrl": "../"
|
|
10
|
+
},
|
|
11
|
+
"include": [
|
|
12
|
+
"../src/**/*.ts",
|
|
13
|
+
"../src/**/*.tsx"
|
|
14
|
+
],
|
|
15
|
+
"exclude": [
|
|
16
|
+
"../src/**/__tests__/*",
|
|
17
|
+
"../src/**/*.test.*",
|
|
18
|
+
"../src/**/test.*"
|
|
19
|
+
],
|
|
20
|
+
"references": [
|
|
21
|
+
{
|
|
22
|
+
"path": "../../tokens/afm-cc/tsconfig.json"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -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)(
|
|
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)(
|
|
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
|
|
18
|
-
return themedBackground[mode];
|
|
8
|
+
return "var(--ds-surface, #FFFFFF)";
|
|
19
9
|
};
|
package/dist/cjs/metadata.js
CHANGED
|
@@ -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(
|
|
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(
|
|
30
|
+
fill: secondaryColor || getBackground()
|
|
35
31
|
},
|
|
36
32
|
css: [svgStyles, sizeStyleMap[size]],
|
|
37
33
|
"data-testid": testId,
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
const
|
|
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)";
|
package/dist/es2019/metadata.js
CHANGED
|
@@ -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(
|
|
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(
|
|
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
|
|
12
|
-
return themedBackground[mode];
|
|
2
|
+
return "var(--ds-surface, #FFFFFF)";
|
|
13
3
|
};
|
package/dist/esm/metadata.js
CHANGED
|
@@ -1,6 +1 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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": "
|
|
3
|
+
"version": "22.0.1",
|
|
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,8 +29,7 @@
|
|
|
29
29
|
"build-glyphs": "ts-node --project ../../../tsconfig.node.json ./build/index.tsx"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@atlaskit/
|
|
33
|
-
"@atlaskit/tokens": "^1.28.0",
|
|
32
|
+
"@atlaskit/tokens": "^1.37.0",
|
|
34
33
|
"@babel/runtime": "^7.0.0",
|
|
35
34
|
"@emotion/react": "^11.7.1"
|
|
36
35
|
},
|
|
@@ -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
|
-
"@atlaskit/logo": "^13.
|
|
44
|
+
"@atlaskit/logo": "^13.15.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",
|
package/tmp/api-report-tmp.d.ts
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
## API Report File for "@atlaskit/icon"
|
|
2
|
-
|
|
3
|
-
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
|
|
7
|
-
/// <reference types="react" />
|
|
8
|
-
|
|
9
|
-
import type { ComponentType } from 'react';
|
|
10
|
-
import { NamedExoticComponent } from 'react';
|
|
11
|
-
import type { ReactNode } from 'react';
|
|
12
|
-
import type { SVGProps as SVGProps_2 } from 'react';
|
|
13
|
-
|
|
14
|
-
// @public (undocumented)
|
|
15
|
-
export interface CustomGlyphProps extends SVGProps_2<SVGSVGElement> {
|
|
16
|
-
'aria-label'?: string;
|
|
17
|
-
'data-testid'?: string;
|
|
18
|
-
className?: string;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// @public (undocumented)
|
|
22
|
-
interface GlyphColorProps {
|
|
23
|
-
primaryColor?: string;
|
|
24
|
-
secondaryColor?: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// @public (undocumented)
|
|
28
|
-
export interface GlyphProps extends OtherGlyphProps, GlyphSizeProps, GlyphColorProps {
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// @public (undocumented)
|
|
32
|
-
interface GlyphSizeProps {
|
|
33
|
-
size?: Size;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// @public
|
|
37
|
-
const Icon: NamedExoticComponent<IconProps>;
|
|
38
|
-
export default Icon;
|
|
39
|
-
|
|
40
|
-
// @public (undocumented)
|
|
41
|
-
export interface IconProps extends GlyphProps {
|
|
42
|
-
// @deprecated (undocumented)
|
|
43
|
-
dangerouslySetGlyph?: string;
|
|
44
|
-
glyph?: ComponentType<CustomGlyphProps>;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// @public (undocumented)
|
|
48
|
-
interface OtherGlyphProps {
|
|
49
|
-
label: string;
|
|
50
|
-
testId?: string;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// @public (undocumented)
|
|
54
|
-
export type Size = 'large' | 'medium' | 'small' | 'xlarge';
|
|
55
|
-
|
|
56
|
-
// @public (undocumented)
|
|
57
|
-
export const size: Record<Size, Size>;
|
|
58
|
-
|
|
59
|
-
// @public (undocumented)
|
|
60
|
-
export const sizes: Record<Size, string>;
|
|
61
|
-
|
|
62
|
-
// @public
|
|
63
|
-
export const Skeleton: NamedExoticComponent<SkeletonProps>;
|
|
64
|
-
|
|
65
|
-
// @public (undocumented)
|
|
66
|
-
export interface SkeletonProps {
|
|
67
|
-
// (undocumented)
|
|
68
|
-
color?: string;
|
|
69
|
-
// (undocumented)
|
|
70
|
-
size?: Size;
|
|
71
|
-
testId?: string;
|
|
72
|
-
// (undocumented)
|
|
73
|
-
weight?: 'normal' | 'strong';
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// @public
|
|
77
|
-
export const SVG: NamedExoticComponent<SVGProps>;
|
|
78
|
-
|
|
79
|
-
// @public (undocumented)
|
|
80
|
-
export interface SVGProps extends GlyphProps {
|
|
81
|
-
children?: ReactNode;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// (No @packageDocumentation comment for this package)
|
|
85
|
-
|
|
86
|
-
```
|