@atlaskit/icon 21.11.0 → 21.11.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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atlaskit/icon
2
2
 
3
+ ## 21.11.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`88a34a8c2dd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/88a34a8c2dd) - Remove redundant `role=presentation` on wrapping @atlaskit/icon and @atlaskit/logo spans.
8
+ - [`15d704e3090`](https://bitbucket.org/atlassian/atlassian-frontend/commits/15d704e3090) - For an SVG icon, do not render a `aria-label` when empty.
9
+
3
10
  ## 21.11.0
4
11
 
5
12
  ### 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.1",
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.1",
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.1",
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.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/"
@@ -15,7 +15,8 @@
15
15
  "typesVersions": {
16
16
  ">=4.0 <4.5": {
17
17
  "*": [
18
- "dist/types-ts4.0/*"
18
+ "dist/types-ts4.0/*",
19
+ "dist/types-ts4.0/index.d.ts"
19
20
  ]
20
21
  }
21
22
  },
@@ -23,6 +24,7 @@
23
24
  "atlaskit:src": "src/index.tsx",
24
25
  "homepage": "https://atlassian.design/components/icon/",
25
26
  "atlassian": {
27
+ "disableProductCI": true,
26
28
  "team": "Design System Team",
27
29
  "releaseModel": "scheduled",
28
30
  "website": {
@@ -53,7 +55,7 @@
53
55
  },
54
56
  "devDependencies": {
55
57
  "@af/icon-build-process": "^0.3.0",
56
- "@atlaskit/button": "^16.3.0",
58
+ "@atlaskit/button": "^16.4.0",
57
59
  "@atlaskit/docs": "*",
58
60
  "@atlaskit/ds-lib": "^2.1.1",
59
61
  "@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
  ```