@atlaskit/icon 21.10.7 → 21.11.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/base/package.json +8 -1
  3. package/codemods/__tests__/21.2.0-metadata-entry.test.tsx +0 -2
  4. package/constants/package.json +8 -1
  5. package/dist/cjs/components/icon.js +8 -8
  6. package/dist/cjs/components/skeleton.js +7 -7
  7. package/dist/cjs/components/styles.js +5 -5
  8. package/dist/cjs/components/svg.js +3 -3
  9. package/dist/cjs/version.json +1 -1
  10. package/dist/es2019/components/icon.js +1 -1
  11. package/dist/es2019/components/skeleton.js +1 -1
  12. package/dist/es2019/components/styles.js +1 -1
  13. package/dist/es2019/components/svg.js +1 -1
  14. package/dist/es2019/version.json +1 -1
  15. package/dist/esm/components/icon.js +1 -1
  16. package/dist/esm/components/skeleton.js +1 -1
  17. package/dist/esm/components/styles.js +1 -1
  18. package/dist/esm/components/svg.js +1 -1
  19. package/dist/esm/version.json +1 -1
  20. package/dist/types/components/styles.d.ts +5 -5
  21. package/dist/types-ts4.0/components/icon.d.ts +12 -0
  22. package/dist/types-ts4.0/components/skeleton.d.ts +7 -0
  23. package/dist/types-ts4.0/components/styles.d.ts +28 -0
  24. package/dist/types-ts4.0/components/svg.d.ts +12 -0
  25. package/dist/types-ts4.0/components/utils.d.ts +6 -0
  26. package/dist/types-ts4.0/constants.d.ts +21 -0
  27. package/dist/types-ts4.0/entry-points/base.d.ts +2 -0
  28. package/dist/types-ts4.0/entry-points/constants.d.ts +1 -0
  29. package/dist/types-ts4.0/entry-points/metadata.d.ts +1 -0
  30. package/dist/types-ts4.0/entry-points/svg.d.ts +2 -0
  31. package/dist/types-ts4.0/entry-points/types.d.ts +1 -0
  32. package/dist/types-ts4.0/extract-react-types/custom-glyph.d.ts +2 -0
  33. package/dist/types-ts4.0/extract-react-types/glyph-no-color-size.d.ts +2 -0
  34. package/dist/types-ts4.0/extract-react-types/glyph-no-color.d.ts +2 -0
  35. package/dist/types-ts4.0/extract-react-types/glyph.d.ts +2 -0
  36. package/dist/types-ts4.0/extract-react-types/svg.d.ts +2 -0
  37. package/dist/types-ts4.0/index.d.ts +5 -0
  38. package/dist/types-ts4.0/metadata.d.ts +16 -0
  39. package/dist/types-ts4.0/types.d.ts +82 -0
  40. package/metadata/package.json +8 -1
  41. package/package.json +23 -14
  42. package/report.api.md +138 -0
  43. package/svg/package.json +8 -1
  44. package/types/package.json +8 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/icon
2
2
 
3
+ ## 21.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`a3973745679`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a3973745679) - Updates `@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behavior change.
8
+
9
+ ## 21.10.8
10
+
11
+ ### Patch Changes
12
+
13
+ - [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
14
+
3
15
  ## 21.10.7
4
16
 
5
17
  ### Patch Changes
package/base/package.json CHANGED
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/entry-points/base.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/base.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/base.d.ts"
7
+ "types": "../dist/types/entry-points/base.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/entry-points/base.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
@@ -115,13 +115,11 @@ describe('Update imports', () => {
115
115
  import { metadata } from '@atlaskit/icon';
116
116
  import { metadata as objectIconMetadata } from '@atlaskit/icon-object';
117
117
  import { metadata as fileTypeIconMetadata } from '@atlaskit/icon-file-type';
118
- import { metadata as priorityIconMetadata } from '@atlaskit/icon-priority';
119
118
  `,
120
119
  `
121
120
  import metadata from '@atlaskit/icon/metadata';
122
121
  import { metadata as objectIconMetadata } from '@atlaskit/icon-object';
123
122
  import { metadata as fileTypeIconMetadata } from '@atlaskit/icon-file-type';
124
- import { metadata as priorityIconMetadata } from '@atlaskit/icon-priority';
125
123
  `,
126
124
  'should work as expected on a real-world case',
127
125
  );
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/entry-points/constants.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/constants.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/constants.d.ts"
7
+ "types": "../dist/types/entry-points/constants.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/entry-points/constants.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
@@ -13,7 +13,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
13
13
 
14
14
  var _react = require("react");
15
15
 
16
- var _core = require("@emotion/core");
16
+ var _react2 = require("@emotion/react");
17
17
 
18
18
  var _components = require("@atlaskit/theme/components");
19
19
 
@@ -25,7 +25,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
25
25
 
26
26
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
27
27
 
28
- var iconStyles = (0, _core.css)({
28
+ var iconStyles = (0, _react2.css)({
29
29
  display: 'inline-block',
30
30
  flexShrink: 0,
31
31
  lineHeight: 1,
@@ -42,7 +42,7 @@ var iconStyles = (0, _core.css)({
42
42
  * For windows high contrast mode
43
43
  */
44
44
 
45
- var baseHcmStyles = (0, _core.css)({
45
+ var baseHcmStyles = (0, _react2.css)({
46
46
  '@media screen and (forced-colors: active)': {
47
47
  // eslint-disable-next-line @repo/internal/styles/no-nested-styles
48
48
  '> svg': {
@@ -54,7 +54,7 @@ var baseHcmStyles = (0, _core.css)({
54
54
  }
55
55
  }
56
56
  });
57
- var primaryEqualsSecondaryHcmStyles = (0, _core.css)({
57
+ var primaryEqualsSecondaryHcmStyles = (0, _react2.css)({
58
58
  '@media screen and (forced-colors: active)': {
59
59
  // eslint-disable-next-line @repo/internal/styles/no-nested-styles
60
60
  '> svg': {
@@ -66,7 +66,7 @@ var primaryEqualsSecondaryHcmStyles = (0, _core.css)({
66
66
  }
67
67
  }
68
68
  });
69
- var secondaryTransparentHcmStyles = (0, _core.css)({
69
+ var secondaryTransparentHcmStyles = (0, _react2.css)({
70
70
  '@media screen and (forced-colors: active)': {
71
71
  // eslint-disable-next-line @repo/internal/styles/no-nested-styles
72
72
  '> svg': {
@@ -101,7 +101,7 @@ var Icon = /*#__PURE__*/(0, _react.memo)(function Icon(props) {
101
101
  __html: dangerouslySetGlyph
102
102
  }
103
103
  } : {
104
- children: Glyph ? (0, _core.jsx)(Glyph, {
104
+ children: Glyph ? (0, _react2.jsx)(Glyph, {
105
105
  role: "presentation"
106
106
  }) : null
107
107
  };
@@ -114,7 +114,7 @@ var Icon = /*#__PURE__*/(0, _react.memo)(function Icon(props) {
114
114
  var _useGlobalTheme = (0, _components.useGlobalTheme)(),
115
115
  mode = _useGlobalTheme.mode;
116
116
 
117
- return (0, _core.jsx)("span", (0, _extends2.default)({
117
+ return (0, _react2.jsx)("span", (0, _extends2.default)({
118
118
  "data-testid": testId,
119
119
  role: label ? 'img' : 'presentation',
120
120
  "aria-label": label ? label : undefined,
@@ -128,7 +128,7 @@ var Icon = /*#__PURE__*/(0, _react.memo)(function Icon(props) {
128
128
  // We could then simplify how common styles are dealt with simply by encapsualting them
129
129
  // at their appropriate level and/or having a singular approach to css variables in the package
130
130
  dimensions && // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
131
- (0, _core.css)({
131
+ (0, _react2.css)({
132
132
  width: dimensions.width,
133
133
  height: dimensions.height,
134
134
  '> svg': dimensions
@@ -5,28 +5,28 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var _core = require("@emotion/core");
8
+ var _react = require("@emotion/react");
9
9
 
10
- var _react = require("react");
10
+ var _react2 = require("react");
11
11
 
12
12
  var _styles = require("./styles");
13
13
 
14
14
  /** @jsx jsx */
15
- var skeletonStyles = (0, _core.css)({
15
+ var skeletonStyles = (0, _react.css)({
16
16
  display: 'inline-block',
17
17
  borderRadius: '50%'
18
18
  });
19
- var subtleOpacityStyles = (0, _core.css)({
19
+ var subtleOpacityStyles = (0, _react.css)({
20
20
  opacity: 0.15
21
21
  });
22
- var strongOpacityStyles = (0, _core.css)({
22
+ var strongOpacityStyles = (0, _react.css)({
23
23
  opacity: 0.3
24
24
  });
25
25
  /**
26
26
  * __Skeleton__
27
27
  */
28
28
 
29
- var Skeleton = /*#__PURE__*/(0, _react.memo)(function Skeleton(_ref) {
29
+ var Skeleton = /*#__PURE__*/(0, _react2.memo)(function Skeleton(_ref) {
30
30
  var testId = _ref.testId,
31
31
  _ref$size = _ref.size,
32
32
  size = _ref$size === void 0 ? 'medium' : _ref$size,
@@ -34,7 +34,7 @@ var Skeleton = /*#__PURE__*/(0, _react.memo)(function Skeleton(_ref) {
34
34
  color = _ref$color === void 0 ? 'currentColor' : _ref$color,
35
35
  _ref$weight = _ref.weight,
36
36
  weight = _ref$weight === void 0 ? 'normal' : _ref$weight;
37
- return (0, _core.jsx)("div", {
37
+ return (0, _react.jsx)("div", {
38
38
  "data-testid": testId,
39
39
  style: {
40
40
  backgroundColor: color
@@ -7,7 +7,7 @@ exports.sizeStyleMap = exports.getIconSize = exports.commonSVGStyles = void 0;
7
7
 
8
8
  var _constants = require("../constants");
9
9
 
10
- var _core = require("@emotion/core");
10
+ var _react = require("@emotion/react");
11
11
 
12
12
  var commonSVGStyles = {
13
13
  overflow: 'hidden',
@@ -23,10 +23,10 @@ var commonSVGStyles = {
23
23
  }
24
24
  };
25
25
  exports.commonSVGStyles = commonSVGStyles;
26
- var smallStyles = (0, _core.css)(_constants.dimensions.small);
27
- var mediumStyles = (0, _core.css)(_constants.dimensions.medium);
28
- var largeStyles = (0, _core.css)(_constants.dimensions.large);
29
- var xlargeStyles = (0, _core.css)(_constants.dimensions.xlarge); // pre-built css style-size map
26
+ var smallStyles = (0, _react.css)(_constants.dimensions.small);
27
+ var mediumStyles = (0, _react.css)(_constants.dimensions.medium);
28
+ var largeStyles = (0, _react.css)(_constants.dimensions.large);
29
+ var xlargeStyles = (0, _react.css)(_constants.dimensions.xlarge); // pre-built css style-size map
30
30
 
31
31
  var sizeStyleMap = {
32
32
  small: smallStyles,
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
 
8
8
  var _react = require("react");
9
9
 
10
- var _core = require("@emotion/core");
10
+ var _react2 = require("@emotion/react");
11
11
 
12
12
  var _components = require("@atlaskit/theme/components");
13
13
 
@@ -17,7 +17,7 @@ var _styles = require("./styles");
17
17
 
18
18
  /** @jsx jsx */
19
19
  // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
20
- var svgStyles = (0, _core.css)(_styles.commonSVGStyles);
20
+ var svgStyles = (0, _react2.css)(_styles.commonSVGStyles);
21
21
  /**
22
22
  * __SVG__
23
23
  *
@@ -40,7 +40,7 @@ var SVG = /*#__PURE__*/(0, _react.memo)(function SVG(_ref) {
40
40
  var _useGlobalTheme = (0, _components.useGlobalTheme)(),
41
41
  mode = _useGlobalTheme.mode;
42
42
 
43
- return (0, _core.jsx)("svg", {
43
+ return (0, _react2.jsx)("svg", {
44
44
  viewBox: "0 0 24 24",
45
45
  style: {
46
46
  color: primaryColor,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/icon",
3
- "version": "21.10.7",
3
+ "version": "21.11.0",
4
4
  "sideEffects": false
5
5
  }
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
 
3
3
  /** @jsx jsx */
4
4
  import { memo } from 'react';
5
- import { css, jsx } from '@emotion/core';
5
+ import { css, jsx } from '@emotion/react';
6
6
  import { useGlobalTheme } from '@atlaskit/theme/components';
7
7
  import { getBackground } from './utils';
8
8
  import { commonSVGStyles, getIconSize } from './styles';
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { css, jsx } from '@emotion/core';
2
+ import { css, jsx } from '@emotion/react';
3
3
  import { memo } from 'react';
4
4
  import { sizeStyleMap } from './styles';
5
5
  const skeletonStyles = css({
@@ -1,5 +1,5 @@
1
1
  import { dimensions } from '../constants';
2
- import { css } from '@emotion/core';
2
+ import { css } from '@emotion/react';
3
3
  export const commonSVGStyles = {
4
4
  overflow: 'hidden',
5
5
  pointerEvents: 'none',
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { memo } from 'react';
3
- import { css, jsx } from '@emotion/core';
3
+ import { css, jsx } from '@emotion/react';
4
4
  import { useGlobalTheme } from '@atlaskit/theme/components';
5
5
  import { getBackground } from './utils';
6
6
  import { commonSVGStyles, sizeStyleMap } from './styles'; // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/icon",
3
- "version": "21.10.7",
3
+ "version": "21.11.0",
4
4
  "sideEffects": false
5
5
  }
@@ -7,7 +7,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
7
7
 
8
8
  /** @jsx jsx */
9
9
  import { memo } from 'react';
10
- import { css, jsx } from '@emotion/core';
10
+ import { css, jsx } from '@emotion/react';
11
11
  import { useGlobalTheme } from '@atlaskit/theme/components';
12
12
  import { getBackground } from './utils';
13
13
  import { commonSVGStyles, getIconSize } from './styles';
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { css, jsx } from '@emotion/core';
2
+ import { css, jsx } from '@emotion/react';
3
3
  import { memo } from 'react';
4
4
  import { sizeStyleMap } from './styles';
5
5
  var skeletonStyles = css({
@@ -1,5 +1,5 @@
1
1
  import { dimensions } from '../constants';
2
- import { css } from '@emotion/core';
2
+ import { css } from '@emotion/react';
3
3
  export var commonSVGStyles = {
4
4
  overflow: 'hidden',
5
5
  pointerEvents: 'none',
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { memo } from 'react';
3
- import { css, jsx } from '@emotion/core';
3
+ import { css, jsx } from '@emotion/react';
4
4
  import { useGlobalTheme } from '@atlaskit/theme/components';
5
5
  import { getBackground } from './utils';
6
6
  import { commonSVGStyles, sizeStyleMap } from './styles'; // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/icon",
3
- "version": "21.10.7",
3
+ "version": "21.11.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,11 +1,11 @@
1
1
  import type { Size } from '../types';
2
- import { CSSObject } from '@emotion/core';
2
+ import { CSSObject } from '@emotion/react';
3
3
  export declare const commonSVGStyles: CSSObject;
4
4
  export declare const sizeStyleMap: {
5
- small: import("@emotion/utils").SerializedStyles;
6
- medium: import("@emotion/utils").SerializedStyles;
7
- large: import("@emotion/utils").SerializedStyles;
8
- xlarge: import("@emotion/utils").SerializedStyles;
5
+ small: import("@emotion/react").SerializedStyles;
6
+ medium: import("@emotion/react").SerializedStyles;
7
+ large: import("@emotion/react").SerializedStyles;
8
+ xlarge: import("@emotion/react").SerializedStyles;
9
9
  };
10
10
  /**
11
11
  * Returns the width of the icon's parent span. This function has
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import type { IconProps } from '../types';
3
+ /**
4
+ * __Icon__
5
+ *
6
+ * An icon is used as a visual representation of common actions and commands to provide context.
7
+ *
8
+ * - [Examples](https://atlaskit.atlassian.com/packages/design-system/icon)
9
+ * - [Code](https://atlaskit.atlassian.com/packages/design-system/icon/docs/custom-icons)
10
+ */
11
+ export declare const Icon: import("react").NamedExoticComponent<IconProps>;
12
+ export default Icon;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import type { SkeletonProps } from '../types';
3
+ /**
4
+ * __Skeleton__
5
+ */
6
+ declare const Skeleton: import("react").NamedExoticComponent<SkeletonProps>;
7
+ export default Skeleton;
@@ -0,0 +1,28 @@
1
+ import type { Size } from '../types';
2
+ import { CSSObject } from '@emotion/react';
3
+ export declare const commonSVGStyles: CSSObject;
4
+ export declare const sizeStyleMap: {
5
+ small: import("@emotion/react").SerializedStyles;
6
+ medium: import("@emotion/react").SerializedStyles;
7
+ large: import("@emotion/react").SerializedStyles;
8
+ xlarge: import("@emotion/react").SerializedStyles;
9
+ };
10
+ /**
11
+ * Returns the width of the icon's parent span. This function has
12
+ * special behaviour to deal with icon-file-type specifically.
13
+ *
14
+ * The reality is the SVG still has its own dimensions, so this is
15
+ * a secondary fallback which in 95% of cases is not required.
16
+ * It's only really being kept to maintain backward compatability.
17
+ */
18
+ export declare const getIconSize: ({ width, height, size, }: {
19
+ size?: Size | undefined;
20
+ width?: number | undefined;
21
+ height?: number | undefined;
22
+ }) => {
23
+ readonly width: string;
24
+ readonly height: string;
25
+ } | {
26
+ width: number;
27
+ height: number;
28
+ } | undefined;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import type { SVGProps } from '../types';
3
+ /**
4
+ * __SVG__
5
+ *
6
+ * An icon is used as a visual representation of common actions and commands to provide context.
7
+ *
8
+ * - [Examples](https://atlaskit.atlassian.com/packages/design-system/icon)
9
+ * - [Code](https://atlaskit.atlassian.com/packages/design-system/icon/docs/custom-svgs)
10
+ */
11
+ declare const SVG: import("react").NamedExoticComponent<SVGProps>;
12
+ export default SVG;
@@ -0,0 +1,6 @@
1
+ import type { ThemeModes } from '@atlaskit/theme/types';
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)";
@@ -0,0 +1,21 @@
1
+ import type { Size } from './types';
2
+ export declare const sizes: Record<Size, string>;
3
+ export declare const sizeMap: Record<Size, Size>;
4
+ export declare const dimensions: {
5
+ readonly small: {
6
+ readonly width: string;
7
+ readonly height: string;
8
+ };
9
+ readonly medium: {
10
+ readonly width: string;
11
+ readonly height: string;
12
+ };
13
+ readonly large: {
14
+ readonly width: string;
15
+ readonly height: string;
16
+ };
17
+ readonly xlarge: {
18
+ readonly width: string;
19
+ readonly height: string;
20
+ };
21
+ };
@@ -0,0 +1,2 @@
1
+ export { default, Icon } from '../components/icon';
2
+ export type { IconProps } from '../types';
@@ -0,0 +1 @@
1
+ export { sizeMap, sizes } from '../constants';
@@ -0,0 +1 @@
1
+ export { default } from '../metadata';
@@ -0,0 +1,2 @@
1
+ export { default } from '../components/svg';
2
+ export type { SVGProps } from '../types';
@@ -0,0 +1 @@
1
+ export type { CustomGlyphProps, GlyphProps, IconProps, Size, SkeletonProps, SVGProps, } from '../types';
@@ -0,0 +1,2 @@
1
+ import type { CustomGlyphProps as Props } from '../types';
2
+ export default function CustomGlyphProps(props: Props): null;
@@ -0,0 +1,2 @@
1
+ import type { OtherGlyphProps } from '../types';
2
+ export default function (_: OtherGlyphProps): void;
@@ -0,0 +1,2 @@
1
+ import type { OtherGlyphProps, GlyphSizeProps } from '../types';
2
+ export default function (_: OtherGlyphProps & GlyphSizeProps): void;
@@ -0,0 +1,2 @@
1
+ import type { GlyphProps } from '../types';
2
+ export default function (_: GlyphProps): void;
@@ -0,0 +1,2 @@
1
+ import type { SVGProps as Props } from '../types';
2
+ export default function SVGProps(props: Props): null;
@@ -0,0 +1,5 @@
1
+ export { default } from './components/icon';
2
+ export { default as SVG } from './components/svg';
3
+ export { sizeMap as size, sizes } from './constants';
4
+ export { default as Skeleton } from './components/skeleton';
5
+ export type { Size, SkeletonProps, IconProps, GlyphProps, CustomGlyphProps, SVGProps, } from './types';
@@ -0,0 +1,16 @@
1
+ /**
2
+ * NOTE:
3
+ *
4
+ * This file is automatically generated by the build process.
5
+ * DO NOT CHANGE IT BY HAND or your changes will be lost.
6
+ *
7
+ * To change the format of this file, modify build/icon/createIconDocs.js.
8
+ * Add synonyms in icon/icons/synonyms.js.
9
+ */
10
+ interface Data {
11
+ keywords: string[];
12
+ componentName: string;
13
+ package: string;
14
+ }
15
+ declare const metaData: Record<string, Data>;
16
+ export default metaData;
@@ -0,0 +1,82 @@
1
+ import type { ComponentType, SVGProps as ReactSVGProps, ReactNode } from 'react';
2
+ export declare type Size = 'small' | 'medium' | 'large' | 'xlarge';
3
+ export interface CustomGlyphProps extends ReactSVGProps<SVGSVGElement> {
4
+ /**
5
+ * provided to a custom glyph
6
+ */
7
+ 'data-testid'?: string;
8
+ /**
9
+ * provided to a custom glyph
10
+ */
11
+ 'aria-label'?: string;
12
+ /**
13
+ * provided classname for custom glyph to match ADG styles
14
+ */
15
+ className?: string;
16
+ }
17
+ export interface GlyphColorProps {
18
+ /**
19
+ * Primary color for the icon.
20
+ * Inherits the current font color by default.
21
+ */
22
+ primaryColor?: string;
23
+ /**
24
+ * Secondary color for the icon.
25
+ * Defaults to the page background for an icon that supports two colors.
26
+ */
27
+ secondaryColor?: string;
28
+ }
29
+ export interface GlyphSizeProps {
30
+ /**
31
+ * There are three icon sizes – small (16px), medium (24px), and large (32px).
32
+ * This pixel size refers to the canvas the icon sits on,
33
+ * not the size of the icon shape itself.
34
+ */
35
+ size?: Size;
36
+ }
37
+ export interface OtherGlyphProps {
38
+ /**
39
+ * Text used to describe what the icon is in context.
40
+ * A label is needed when there is no pairing visible text next to the icon.
41
+ * An empty string marks the icon as presentation only.
42
+ */
43
+ label: string;
44
+ /**
45
+ * A `testId` prop is provided for specified elements,
46
+ * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
47
+ * serving as a hook for automated tests.
48
+ */
49
+ testId?: string;
50
+ }
51
+ export interface GlyphProps extends OtherGlyphProps, GlyphSizeProps, GlyphColorProps {
52
+ }
53
+ export interface IconProps extends GlyphProps {
54
+ /**
55
+ * Custom icon component that returns an SVG element with set `viewBox`,
56
+ * `width`, and `height` props.
57
+ */
58
+ glyph?: ComponentType<CustomGlyphProps>;
59
+ /**
60
+ * @deprecated
61
+ * Custom icon string that should contain an SVG element with set `viewBox`,
62
+ * `width`, and `height` attributes.
63
+ * It's recommended to use the `glyph` prop instead.
64
+ */
65
+ dangerouslySetGlyph?: string;
66
+ }
67
+ export interface SkeletonProps {
68
+ color?: string;
69
+ size?: Size;
70
+ weight?: 'normal' | 'strong';
71
+ /**
72
+ * A unique string that appears as a data attribute `data-testid` in the rendered code,
73
+ * serving as a hook for automated tests.
74
+ */
75
+ testId?: string;
76
+ }
77
+ export interface SVGProps extends GlyphProps {
78
+ /**
79
+ * The children of the SVG, should still honour the constraints of icons
80
+ */
81
+ children?: ReactNode;
82
+ }
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/entry-points/metadata.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/metadata.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/metadata.d.ts"
7
+ "types": "../dist/types/entry-points/metadata.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/entry-points/metadata.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
package/package.json CHANGED
@@ -1,17 +1,24 @@
1
1
  {
2
2
  "name": "@atlaskit/icon",
3
- "version": "21.10.7",
3
+ "version": "21.11.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/"
7
7
  },
8
- "repository": "https://bitbucket.org/atlassian/atlassian-frontend",
8
+ "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
9
9
  "author": "Atlassian Pty Ltd",
10
10
  "license": "Apache-2.0",
11
11
  "main": "dist/cjs/index.js",
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
+ "typesVersions": {
16
+ ">=4.0 <4.5": {
17
+ "*": [
18
+ "dist/types-ts4.0/*"
19
+ ]
20
+ }
21
+ },
15
22
  "sideEffects": false,
16
23
  "atlaskit:src": "src/index.tsx",
17
24
  "homepage": "https://atlassian.design/components/icon/",
@@ -19,7 +26,8 @@
19
26
  "team": "Design System Team",
20
27
  "releaseModel": "scheduled",
21
28
  "website": {
22
- "name": "Icon"
29
+ "name": "Icon",
30
+ "category": "Components"
23
31
  }
24
32
  },
25
33
  "af:exports": {
@@ -35,10 +43,10 @@
35
43
  "build-glyphs": "ts-node --project ../../../tsconfig.node.json ./build/index.tsx"
36
44
  },
37
45
  "dependencies": {
38
- "@atlaskit/theme": "^12.1.0",
46
+ "@atlaskit/theme": "^12.2.0",
39
47
  "@atlaskit/tokens": "^0.10.0",
40
48
  "@babel/runtime": "^7.0.0",
41
- "@emotion/core": "^10.0.9"
49
+ "@emotion/react": "^11.7.1"
42
50
  },
43
51
  "peerDependencies": {
44
52
  "react": "^16.8.0"
@@ -47,21 +55,21 @@
47
55
  "@af/icon-build-process": "^0.3.0",
48
56
  "@atlaskit/button": "^16.3.0",
49
57
  "@atlaskit/docs": "*",
50
- "@atlaskit/dynamic-table": "^14.5.0",
58
+ "@atlaskit/ds-lib": "^2.1.1",
59
+ "@atlaskit/dynamic-table": "^14.8.0",
51
60
  "@atlaskit/icon-file-type": "^6.3.0",
52
61
  "@atlaskit/icon-object": "^6.2.0",
53
- "@atlaskit/icon-priority": "^6.3.0",
54
- "@atlaskit/logo": "^13.6.0",
55
- "@atlaskit/modal-dialog": "^12.2.0",
56
- "@atlaskit/section-message": "^6.1.0",
62
+ "@atlaskit/logo": "^13.10.0",
63
+ "@atlaskit/modal-dialog": "^12.4.0",
64
+ "@atlaskit/section-message": "^6.3.0",
57
65
  "@atlaskit/ssr": "*",
58
- "@atlaskit/textfield": "^5.1.0",
59
- "@atlaskit/tooltip": "^17.5.0",
66
+ "@atlaskit/textfield": "^5.3.0",
67
+ "@atlaskit/tooltip": "^17.6.0",
60
68
  "@atlaskit/visual-regression": "*",
61
69
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
62
70
  "@babel/core": "^7.12.3",
63
71
  "@emotion/babel-preset-css-prop": "^10.0.7",
64
- "@testing-library/react": "^8.0.1",
72
+ "@testing-library/react": "^12.1.5",
65
73
  "classnames": "^2.2.5",
66
74
  "fs-extra": "^4.0.2",
67
75
  "jest-emotion": "^10.0.32",
@@ -70,7 +78,7 @@
70
78
  "nullthrows": "^1.1.1",
71
79
  "pkg-dir": "^4.2.0",
72
80
  "react-dom": "^16.8.0",
73
- "ts-node": "^10.0.0",
81
+ "ts-node": "^10.9.1",
74
82
  "wait-for-expect": "^1.2.0"
75
83
  },
76
84
  "keywords": [
@@ -79,6 +87,7 @@
79
87
  ],
80
88
  "techstack": {
81
89
  "@repo/internal": {
90
+ "dom-events": "use-bind-event-listener",
82
91
  "design-system": "v1",
83
92
  "styling": [
84
93
  "static",
package/report.api.md ADDED
@@ -0,0 +1,138 @@
1
+ ## API Report File for "@atlaskit/icon".
2
+
3
+ > Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
6
+
7
+ ```ts
8
+ /// <reference types="react" />
9
+
10
+ import type { ComponentType } from 'react';
11
+ import { NamedExoticComponent } from 'react';
12
+ import type { ReactNode } from 'react';
13
+ import type { SVGProps as SVGProps_2 } from 'react';
14
+
15
+ export declare interface CustomGlyphProps extends SVGProps_2<SVGSVGElement> {
16
+ /**
17
+ * provided to a custom glyph
18
+ */
19
+ 'data-testid'?: string;
20
+ /**
21
+ * provided to a custom glyph
22
+ */
23
+ 'aria-label'?: string;
24
+ /**
25
+ * provided classname for custom glyph to match ADG styles
26
+ */
27
+ className?: string;
28
+ }
29
+
30
+ declare interface GlyphColorProps {
31
+ /**
32
+ * Primary color for the icon.
33
+ * Inherits the current font color by default.
34
+ */
35
+ primaryColor?: string;
36
+ /**
37
+ * Secondary color for the icon.
38
+ * Defaults to the page background for an icon that supports two colors.
39
+ */
40
+ secondaryColor?: string;
41
+ }
42
+
43
+ export declare interface GlyphProps
44
+ extends OtherGlyphProps,
45
+ GlyphSizeProps,
46
+ GlyphColorProps {}
47
+
48
+ declare interface GlyphSizeProps {
49
+ /**
50
+ * There are three icon sizes – small (16px), medium (24px), and large (32px).
51
+ * This pixel size refers to the canvas the icon sits on,
52
+ * not the size of the icon shape itself.
53
+ */
54
+ size?: Size;
55
+ }
56
+
57
+ /**
58
+ * __Icon__
59
+ *
60
+ * An icon is used as a visual representation of common actions and commands to provide context.
61
+ *
62
+ * - [Examples](https://atlaskit.atlassian.com/packages/design-system/icon)
63
+ * - [Code](https://atlaskit.atlassian.com/packages/design-system/icon/docs/custom-icons)
64
+ */
65
+ declare const Icon: NamedExoticComponent<IconProps>;
66
+ export default Icon;
67
+
68
+ export declare interface IconProps extends GlyphProps {
69
+ /**
70
+ * Custom icon component that returns an SVG element with set `viewBox`,
71
+ * `width`, and `height` props.
72
+ */
73
+ glyph?: ComponentType<CustomGlyphProps>;
74
+ /**
75
+ * @deprecated
76
+ * Custom icon string that should contain an SVG element with set `viewBox`,
77
+ * `width`, and `height` attributes.
78
+ * It's recommended to use the `glyph` prop instead.
79
+ */
80
+ dangerouslySetGlyph?: string;
81
+ }
82
+
83
+ declare interface OtherGlyphProps {
84
+ /**
85
+ * Text used to describe what the icon is in context.
86
+ * A label is needed when there is no pairing visible text next to the icon.
87
+ * An empty string marks the icon as presentation only.
88
+ */
89
+ label: string;
90
+ /**
91
+ * A `testId` prop is provided for specified elements,
92
+ * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
93
+ * serving as a hook for automated tests.
94
+ */
95
+ testId?: string;
96
+ }
97
+
98
+ export declare type Size = 'small' | 'medium' | 'large' | 'xlarge';
99
+
100
+ export declare const size: Record<Size, Size>;
101
+
102
+ export declare const sizes: Record<Size, string>;
103
+
104
+ /**
105
+ * __Skeleton__
106
+ */
107
+ export declare const Skeleton: NamedExoticComponent<SkeletonProps>;
108
+
109
+ export declare interface SkeletonProps {
110
+ color?: string;
111
+ size?: Size;
112
+ weight?: 'normal' | 'strong';
113
+ /**
114
+ * A unique string that appears as a data attribute `data-testid` in the rendered code,
115
+ * serving as a hook for automated tests.
116
+ */
117
+ testId?: string;
118
+ }
119
+
120
+ /**
121
+ * __SVG__
122
+ *
123
+ * An icon is used as a visual representation of common actions and commands to provide context.
124
+ *
125
+ * - [Examples](https://atlaskit.atlassian.com/packages/design-system/icon)
126
+ * - [Code](https://atlaskit.atlassian.com/packages/design-system/icon/docs/custom-svgs)
127
+ */
128
+ export declare const SVG: NamedExoticComponent<SVGProps>;
129
+
130
+ export declare interface SVGProps extends GlyphProps {
131
+ /**
132
+ * The children of the SVG, should still honour the constraints of icons
133
+ */
134
+ children?: ReactNode;
135
+ }
136
+
137
+ export {};
138
+ ```
package/svg/package.json CHANGED
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/entry-points/svg.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/svg.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/svg.d.ts"
7
+ "types": "../dist/types/entry-points/svg.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/entry-points/svg.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/entry-points/types.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/types.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/types.d.ts"
7
+ "types": "../dist/types/entry-points/types.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/entry-points/types.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }