@atlaskit/icon 21.11.0 → 21.11.2

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 (31) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/components/icon.js +1 -1
  3. package/dist/cjs/components/svg.js +1 -1
  4. package/dist/cjs/version.json +1 -1
  5. package/dist/es2019/components/icon.js +1 -1
  6. package/dist/es2019/components/svg.js +1 -1
  7. package/dist/es2019/version.json +1 -1
  8. package/dist/esm/components/icon.js +1 -1
  9. package/dist/esm/components/svg.js +1 -1
  10. package/dist/esm/version.json +1 -1
  11. package/package.json +4 -10
  12. package/report.api.md +43 -89
  13. package/dist/types-ts4.0/components/icon.d.ts +0 -12
  14. package/dist/types-ts4.0/components/skeleton.d.ts +0 -7
  15. package/dist/types-ts4.0/components/styles.d.ts +0 -28
  16. package/dist/types-ts4.0/components/svg.d.ts +0 -12
  17. package/dist/types-ts4.0/components/utils.d.ts +0 -6
  18. package/dist/types-ts4.0/constants.d.ts +0 -21
  19. package/dist/types-ts4.0/entry-points/base.d.ts +0 -2
  20. package/dist/types-ts4.0/entry-points/constants.d.ts +0 -1
  21. package/dist/types-ts4.0/entry-points/metadata.d.ts +0 -1
  22. package/dist/types-ts4.0/entry-points/svg.d.ts +0 -2
  23. package/dist/types-ts4.0/entry-points/types.d.ts +0 -1
  24. package/dist/types-ts4.0/extract-react-types/custom-glyph.d.ts +0 -2
  25. package/dist/types-ts4.0/extract-react-types/glyph-no-color-size.d.ts +0 -2
  26. package/dist/types-ts4.0/extract-react-types/glyph-no-color.d.ts +0 -2
  27. package/dist/types-ts4.0/extract-react-types/glyph.d.ts +0 -2
  28. package/dist/types-ts4.0/extract-react-types/svg.d.ts +0 -2
  29. package/dist/types-ts4.0/index.d.ts +0 -5
  30. package/dist/types-ts4.0/metadata.d.ts +0 -16
  31. package/dist/types-ts4.0/types.d.ts +0 -82
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/icon
2
2
 
3
+ ## 21.11.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 21.11.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`88a34a8c2dd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/88a34a8c2dd) - Remove redundant `role=presentation` on wrapping @atlaskit/icon and @atlaskit/logo spans.
14
+ - [`15d704e3090`](https://bitbucket.org/atlassian/atlassian-frontend/commits/15d704e3090) - For an SVG icon, do not render a `aria-label` when empty.
15
+
3
16
  ## 21.11.0
4
17
 
5
18
  ### Minor Changes
@@ -116,7 +116,7 @@ var Icon = /*#__PURE__*/(0, _react.memo)(function Icon(props) {
116
116
 
117
117
  return (0, _react2.jsx)("span", (0, _extends2.default)({
118
118
  "data-testid": testId,
119
- role: label ? 'img' : 'presentation',
119
+ role: label ? 'img' : undefined,
120
120
  "aria-label": label ? label : undefined,
121
121
  "aria-hidden": label ? undefined : true,
122
122
  style: {
@@ -48,7 +48,7 @@ var SVG = /*#__PURE__*/(0, _react.memo)(function SVG(_ref) {
48
48
  },
49
49
  css: [svgStyles, _styles.sizeStyleMap[size]],
50
50
  "data-testid": testId,
51
- "aria-label": label,
51
+ "aria-label": label || undefined,
52
52
  role: label ? 'img' : 'presentation'
53
53
  }, children);
54
54
  });
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/icon",
3
- "version": "21.11.0",
3
+ "version": "21.11.2",
4
4
  "sideEffects": false
5
5
  }
@@ -101,7 +101,7 @@ export const Icon = /*#__PURE__*/memo(function Icon(props) {
101
101
  } = useGlobalTheme();
102
102
  return jsx("span", _extends({
103
103
  "data-testid": testId,
104
- role: label ? 'img' : 'presentation',
104
+ role: label ? 'img' : undefined,
105
105
  "aria-label": label ? label : undefined,
106
106
  "aria-hidden": label ? undefined : true,
107
107
  style: {
@@ -34,7 +34,7 @@ const SVG = /*#__PURE__*/memo(function SVG({
34
34
  },
35
35
  css: [svgStyles, sizeStyleMap[size]],
36
36
  "data-testid": testId,
37
- "aria-label": label,
37
+ "aria-label": label || undefined,
38
38
  role: label ? 'img' : 'presentation'
39
39
  }, children);
40
40
  });
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/icon",
3
- "version": "21.11.0",
3
+ "version": "21.11.2",
4
4
  "sideEffects": false
5
5
  }
@@ -107,7 +107,7 @@ export var Icon = /*#__PURE__*/memo(function Icon(props) {
107
107
 
108
108
  return jsx("span", _extends({
109
109
  "data-testid": testId,
110
- role: label ? 'img' : 'presentation',
110
+ role: label ? 'img' : undefined,
111
111
  "aria-label": label ? label : undefined,
112
112
  "aria-hidden": label ? undefined : true,
113
113
  style: {
@@ -36,7 +36,7 @@ var SVG = /*#__PURE__*/memo(function SVG(_ref) {
36
36
  },
37
37
  css: [svgStyles, sizeStyleMap[size]],
38
38
  "data-testid": testId,
39
- "aria-label": label,
39
+ "aria-label": label || undefined,
40
40
  role: label ? 'img' : 'presentation'
41
41
  }, children);
42
42
  });
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/icon",
3
- "version": "21.11.0",
3
+ "version": "21.11.2",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/icon",
3
- "version": "21.11.0",
3
+ "version": "21.11.2",
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/"
@@ -12,17 +12,11 @@
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
- },
22
15
  "sideEffects": false,
23
16
  "atlaskit:src": "src/index.tsx",
24
17
  "homepage": "https://atlassian.design/components/icon/",
25
18
  "atlassian": {
19
+ "disableProductCI": true,
26
20
  "team": "Design System Team",
27
21
  "releaseModel": "scheduled",
28
22
  "website": {
@@ -44,7 +38,7 @@
44
38
  },
45
39
  "dependencies": {
46
40
  "@atlaskit/theme": "^12.2.0",
47
- "@atlaskit/tokens": "^0.10.0",
41
+ "@atlaskit/tokens": "^0.11.0",
48
42
  "@babel/runtime": "^7.0.0",
49
43
  "@emotion/react": "^11.7.1"
50
44
  },
@@ -53,7 +47,7 @@
53
47
  },
54
48
  "devDependencies": {
55
49
  "@af/icon-build-process": "^0.3.0",
56
- "@atlaskit/button": "^16.3.0",
50
+ "@atlaskit/button": "^16.4.0",
57
51
  "@atlaskit/docs": "*",
58
52
  "@atlaskit/ds-lib": "^2.1.1",
59
53
  "@atlaskit/dynamic-table": "^14.8.0",
package/report.api.md CHANGED
@@ -1,6 +1,10 @@
1
- ## API Report File for "@atlaskit/icon".
1
+ ## API Report File for "@atlaskit/icon"
2
2
 
3
- > Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ <!--
6
+ Generated API Report version: 2.0
7
+ -->
4
8
 
5
9
  [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
6
10
 
@@ -12,127 +16,77 @@ import { NamedExoticComponent } from 'react';
12
16
  import type { ReactNode } from 'react';
13
17
  import type { SVGProps as SVGProps_2 } from 'react';
14
18
 
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
- */
19
+ // @public (undocumented)
20
+ export interface CustomGlyphProps extends SVGProps_2<SVGSVGElement> {
23
21
  'aria-label'?: string;
24
- /**
25
- * provided classname for custom glyph to match ADG styles
26
- */
22
+ 'data-testid'?: string;
27
23
  className?: string;
28
24
  }
29
25
 
30
- declare interface GlyphColorProps {
31
- /**
32
- * Primary color for the icon.
33
- * Inherits the current font color by default.
34
- */
26
+ // @public (undocumented)
27
+ interface GlyphColorProps {
35
28
  primaryColor?: string;
36
- /**
37
- * Secondary color for the icon.
38
- * Defaults to the page background for an icon that supports two colors.
39
- */
40
29
  secondaryColor?: string;
41
30
  }
42
31
 
43
- export declare interface GlyphProps
32
+ // @public (undocumented)
33
+ export interface GlyphProps
44
34
  extends OtherGlyphProps,
45
35
  GlyphSizeProps,
46
36
  GlyphColorProps {}
47
37
 
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
- */
38
+ // @public (undocumented)
39
+ interface GlyphSizeProps {
54
40
  size?: Size;
55
41
  }
56
42
 
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>;
43
+ // @public
44
+ const Icon: NamedExoticComponent<IconProps>;
66
45
  export default Icon;
67
46
 
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
- */
47
+ // @public (undocumented)
48
+ export interface IconProps extends GlyphProps {
49
+ // @deprecated (undocumented)
80
50
  dangerouslySetGlyph?: string;
51
+ glyph?: ComponentType<CustomGlyphProps>;
81
52
  }
82
53
 
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
- */
54
+ // @public (undocumented)
55
+ interface OtherGlyphProps {
89
56
  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
57
  testId?: string;
96
58
  }
97
59
 
98
- export declare type Size = 'small' | 'medium' | 'large' | 'xlarge';
60
+ // @public (undocumented)
61
+ export type Size = 'small' | 'medium' | 'large' | 'xlarge';
99
62
 
100
- export declare const size: Record<Size, Size>;
63
+ // @public (undocumented)
64
+ export const size: Record<Size, Size>;
101
65
 
102
- export declare const sizes: Record<Size, string>;
66
+ // @public (undocumented)
67
+ export const sizes: Record<Size, string>;
103
68
 
104
- /**
105
- * __Skeleton__
106
- */
107
- export declare const Skeleton: NamedExoticComponent<SkeletonProps>;
69
+ // @public
70
+ export const Skeleton: NamedExoticComponent<SkeletonProps>;
108
71
 
109
- export declare interface SkeletonProps {
72
+ // @public (undocumented)
73
+ export interface SkeletonProps {
74
+ // (undocumented)
110
75
  color?: string;
76
+ // (undocumented)
111
77
  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
78
  testId?: string;
79
+ // (undocumented)
80
+ weight?: 'normal' | 'strong';
118
81
  }
119
82
 
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
- */
83
+ // @public
84
+ export const SVG: NamedExoticComponent<SVGProps>;
85
+
86
+ // @public (undocumented)
87
+ export interface SVGProps extends GlyphProps {
134
88
  children?: ReactNode;
135
89
  }
136
90
 
137
- export {};
91
+ // (No @packageDocumentation comment for this package)
138
92
  ```
@@ -1,12 +0,0 @@
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;
@@ -1,7 +0,0 @@
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;
@@ -1,28 +0,0 @@
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;
@@ -1,12 +0,0 @@
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;
@@ -1,6 +0,0 @@
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)";
@@ -1,21 +0,0 @@
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
- };
@@ -1,2 +0,0 @@
1
- export { default, Icon } from '../components/icon';
2
- export type { IconProps } from '../types';
@@ -1 +0,0 @@
1
- export { sizeMap, sizes } from '../constants';
@@ -1 +0,0 @@
1
- export { default } from '../metadata';
@@ -1,2 +0,0 @@
1
- export { default } from '../components/svg';
2
- export type { SVGProps } from '../types';
@@ -1 +0,0 @@
1
- export type { CustomGlyphProps, GlyphProps, IconProps, Size, SkeletonProps, SVGProps, } from '../types';
@@ -1,2 +0,0 @@
1
- import type { CustomGlyphProps as Props } from '../types';
2
- export default function CustomGlyphProps(props: Props): null;
@@ -1,2 +0,0 @@
1
- import type { OtherGlyphProps } from '../types';
2
- export default function (_: OtherGlyphProps): void;
@@ -1,2 +0,0 @@
1
- import type { OtherGlyphProps, GlyphSizeProps } from '../types';
2
- export default function (_: OtherGlyphProps & GlyphSizeProps): void;
@@ -1,2 +0,0 @@
1
- import type { GlyphProps } from '../types';
2
- export default function (_: GlyphProps): void;
@@ -1,2 +0,0 @@
1
- import type { SVGProps as Props } from '../types';
2
- export default function SVGProps(props: Props): null;
@@ -1,5 +0,0 @@
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';
@@ -1,16 +0,0 @@
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;
@@ -1,82 +0,0 @@
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
- }