@atlaskit/icon 22.26.0 → 22.28.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 CHANGED
@@ -1,5 +1,26 @@
1
1
  # @atlaskit/icon
2
2
 
3
+ ## 22.28.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#169436](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/169436)
8
+ [`e52faf54c03cd`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e52faf54c03cd) -
9
+ Adds `testId` to Icon Tile. Fixes bug where icon tiles could render incorrectly when placed inside
10
+ headings.
11
+
12
+ ## 22.27.0
13
+
14
+ ### Minor Changes
15
+
16
+ - [#168743](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/168743)
17
+ [`b27dba8a5f3cd`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b27dba8a5f3cd) -
18
+ Update types to improve compatibility with React 18.
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies
23
+
3
24
  ## 22.26.0
4
25
 
5
26
  ### Minor Changes
@@ -129,7 +129,8 @@ var iconTileStyles = (0, _react.css)({
129
129
  display: 'inline-flex',
130
130
  boxSizing: 'border-box',
131
131
  alignItems: 'center',
132
- justifyContent: 'center'
132
+ justifyContent: 'center',
133
+ fontSize: 0 /* Prevents parent font-size from affecting the container */
133
134
  });
134
135
 
135
136
  /**
@@ -149,12 +150,14 @@ function IconTile(props) {
149
150
  size = _props$size === void 0 ? '24' : _props$size,
150
151
  _props$shape = props.shape,
151
152
  shape = _props$shape === void 0 ? 'square' : _props$shape,
152
- LEGACY_fallbackComponent = props.LEGACY_fallbackComponent;
153
+ LEGACY_fallbackComponent = props.LEGACY_fallbackComponent,
154
+ testId = props.testId;
153
155
  var ExpandedIcon = Icon;
154
156
  if (LEGACY_fallbackComponent && !(0, _platformFeatureFlags.fg)('platform-visual-refresh-icons')) {
155
157
  return LEGACY_fallbackComponent;
156
158
  } else {
157
159
  return (0, _react.jsx)("span", {
160
+ "data-testid": testId,
158
161
  css: [iconTileStyles, appearanceMap[appearance], sizeMap[size], shapeMap[shape]]
159
162
  }, (0, _react.jsx)(ExpandedIcon, {
160
163
  color: "currentColor",
@@ -122,7 +122,8 @@ const iconTileStyles = css({
122
122
  display: 'inline-flex',
123
123
  boxSizing: 'border-box',
124
124
  alignItems: 'center',
125
- justifyContent: 'center'
125
+ justifyContent: 'center',
126
+ fontSize: 0 /* Prevents parent font-size from affecting the container */
126
127
  });
127
128
 
128
129
  /**
@@ -141,13 +142,15 @@ export default function IconTile(props) {
141
142
  appearance,
142
143
  size = '24',
143
144
  shape = 'square',
144
- LEGACY_fallbackComponent
145
+ LEGACY_fallbackComponent,
146
+ testId
145
147
  } = props;
146
148
  const ExpandedIcon = Icon;
147
149
  if (LEGACY_fallbackComponent && !fg('platform-visual-refresh-icons')) {
148
150
  return LEGACY_fallbackComponent;
149
151
  } else {
150
152
  return jsx("span", {
153
+ "data-testid": testId,
151
154
  css: [iconTileStyles, appearanceMap[appearance], sizeMap[size], shapeMap[shape]]
152
155
  }, jsx(ExpandedIcon, {
153
156
  color: "currentColor",
@@ -122,7 +122,8 @@ var iconTileStyles = css({
122
122
  display: 'inline-flex',
123
123
  boxSizing: 'border-box',
124
124
  alignItems: 'center',
125
- justifyContent: 'center'
125
+ justifyContent: 'center',
126
+ fontSize: 0 /* Prevents parent font-size from affecting the container */
126
127
  });
127
128
 
128
129
  /**
@@ -142,12 +143,14 @@ export default function IconTile(props) {
142
143
  size = _props$size === void 0 ? '24' : _props$size,
143
144
  _props$shape = props.shape,
144
145
  shape = _props$shape === void 0 ? 'square' : _props$shape,
145
- LEGACY_fallbackComponent = props.LEGACY_fallbackComponent;
146
+ LEGACY_fallbackComponent = props.LEGACY_fallbackComponent,
147
+ testId = props.testId;
146
148
  var ExpandedIcon = Icon;
147
149
  if (LEGACY_fallbackComponent && !fg('platform-visual-refresh-icons')) {
148
150
  return LEGACY_fallbackComponent;
149
151
  } else {
150
152
  return jsx("span", {
153
+ "data-testid": testId,
151
154
  css: [iconTileStyles, appearanceMap[appearance], sizeMap[size], shapeMap[shape]]
152
155
  }, jsx(ExpandedIcon, {
153
156
  color: "currentColor",
@@ -84,6 +84,30 @@ export interface OtherGlyphProps {
84
84
  */
85
85
  isFacadeDisabled?: boolean;
86
86
  }
87
+ /**
88
+ * Props for legacy icons –– including the children prop to resolve R18 type errors
89
+ */
90
+ export interface LegacyOtherGlyphProps {
91
+ /**
92
+ * Text used to describe what the icon is in context.
93
+ */
94
+ label: string;
95
+ /**
96
+ * A `testId` prop is provided for specified elements,
97
+ */
98
+ testId?: string;
99
+ /**
100
+ * Used to opt out of the icon facade.
101
+ */
102
+ isFacadeDisabled?: boolean;
103
+ /**
104
+ * The content to be rendered inside the glyph component.
105
+ * Only for legacy icons that used R16's implicit children prop.
106
+ * It doesn't actually serve any purpose, but is required to resolve R18 type errors
107
+ * without updating all the legacy icon usages.
108
+ */
109
+ children?: ReactNode;
110
+ }
87
111
  interface IconInternalGlyphProps {
88
112
  /**
89
113
  * @deprecated
@@ -93,7 +117,7 @@ interface IconInternalGlyphProps {
93
117
  */
94
118
  dangerouslySetGlyph?: string;
95
119
  }
96
- export interface GlyphProps extends OtherGlyphProps, GlyphSizeProps, GlyphColorProps {
120
+ export interface GlyphProps extends LegacyOtherGlyphProps, GlyphSizeProps, GlyphColorProps {
97
121
  }
98
122
  export interface NewCoreGlyphProps extends OtherGlyphProps, NewCoreGlyphSpacingProps, NewGlyphColorProps {
99
123
  }
@@ -165,6 +189,11 @@ export interface IconTileProps {
165
189
  * Legacy component to render when the icon refresh feature flag is turned off.
166
190
  */
167
191
  LEGACY_fallbackComponent?: ReactElement;
192
+ /**
193
+ * A unique string that appears as a data attribute `data-testid` in the rendered code,
194
+ * serving as a hook for automated tests.
195
+ */
196
+ testId?: string;
168
197
  }
169
198
  export interface SkeletonProps {
170
199
  color?: string;
@@ -84,6 +84,30 @@ export interface OtherGlyphProps {
84
84
  */
85
85
  isFacadeDisabled?: boolean;
86
86
  }
87
+ /**
88
+ * Props for legacy icons –– including the children prop to resolve R18 type errors
89
+ */
90
+ export interface LegacyOtherGlyphProps {
91
+ /**
92
+ * Text used to describe what the icon is in context.
93
+ */
94
+ label: string;
95
+ /**
96
+ * A `testId` prop is provided for specified elements,
97
+ */
98
+ testId?: string;
99
+ /**
100
+ * Used to opt out of the icon facade.
101
+ */
102
+ isFacadeDisabled?: boolean;
103
+ /**
104
+ * The content to be rendered inside the glyph component.
105
+ * Only for legacy icons that used R16's implicit children prop.
106
+ * It doesn't actually serve any purpose, but is required to resolve R18 type errors
107
+ * without updating all the legacy icon usages.
108
+ */
109
+ children?: ReactNode;
110
+ }
87
111
  interface IconInternalGlyphProps {
88
112
  /**
89
113
  * @deprecated
@@ -93,7 +117,7 @@ interface IconInternalGlyphProps {
93
117
  */
94
118
  dangerouslySetGlyph?: string;
95
119
  }
96
- export interface GlyphProps extends OtherGlyphProps, GlyphSizeProps, GlyphColorProps {
120
+ export interface GlyphProps extends LegacyOtherGlyphProps, GlyphSizeProps, GlyphColorProps {
97
121
  }
98
122
  export interface NewCoreGlyphProps extends OtherGlyphProps, NewCoreGlyphSpacingProps, NewGlyphColorProps {
99
123
  }
@@ -165,6 +189,11 @@ export interface IconTileProps {
165
189
  * Legacy component to render when the icon refresh feature flag is turned off.
166
190
  */
167
191
  LEGACY_fallbackComponent?: ReactElement;
192
+ /**
193
+ * A unique string that appears as a data attribute `data-testid` in the rendered code,
194
+ * serving as a hook for automated tests.
195
+ */
196
+ testId?: string;
168
197
  }
169
198
  export interface SkeletonProps {
170
199
  color?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/icon",
3
- "version": "22.26.0",
3
+ "version": "22.28.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/"
@@ -68,7 +68,7 @@
68
68
  },
69
69
  "dependencies": {
70
70
  "@atlaskit/platform-feature-flags": "^0.3.0",
71
- "@atlaskit/tokens": "^2.3.0",
71
+ "@atlaskit/tokens": "^2.4.0",
72
72
  "@babel/runtime": "^7.0.0",
73
73
  "@emotion/react": "^11.7.1"
74
74
  },
@@ -77,14 +77,14 @@
77
77
  },
78
78
  "devDependencies": {
79
79
  "@af/accessibility-testing": "*",
80
- "@af/icon-build-process": "^2.2.0",
80
+ "@af/icon-build-process": "^2.3.0",
81
81
  "@af/visual-regression": "*",
82
82
  "@atlaskit/code": "^15.6.0",
83
- "@atlaskit/ds-lib": "^3.2.0",
83
+ "@atlaskit/ds-lib": "^3.3.0",
84
84
  "@atlaskit/logo": "^14.3.0",
85
- "@atlaskit/primitives": "^13.2.0",
85
+ "@atlaskit/primitives": "^13.3.0",
86
86
  "@atlaskit/ssr": "*",
87
- "@atlaskit/textfield": "^6.5.0",
87
+ "@atlaskit/textfield": "^6.6.0",
88
88
  "@atlaskit/theme": "^14.0.0",
89
89
  "@atlaskit/toggle": "^13.4.0",
90
90
  "@atlaskit/tooltip": "^18.9.0",