@backstage/core-components 0.10.0-next.3 → 0.10.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,30 @@
1
1
  # @backstage/core-components
2
2
 
3
+ ## 0.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 32204fa794: Add `transformLinkUri` and `transformImageUri` to `MarkdownContent`
8
+
9
+ ### Patch Changes
10
+
11
+ - 3c440ea77e: Change BackstageIconLinkVertical style to use pallette instead of explicit color
12
+ - c3cfc83af2: Updated JSDoc to be MDX compatible.
13
+ - b4b711bcc2: Fix the EntityLayout header style so that EntityContextMenu button can display in correct shape when user hover on it
14
+ - 944af7f2a8: Work around a bug calling `onChange` twice in `mui` for `RoutedTab` so you don't have to press back twice to navigate through tabs
15
+ - 7f5e79961d: Fix relative `sub-paths` by concatenating the app's base path with them.
16
+ - a70869e775: Updated dependency `msw` to `^0.43.0`.
17
+ - 693990d4fe: Updated dependency `@react-hookz/web` to `^15.0.0`.
18
+ - 8006d0f9bf: Updated dependency `msw` to `^0.44.0`.
19
+ - 15201b1032: Updated dependency `rc-progress` to `3.4.0`.
20
+ - 7e115d42f9: Support displaying subtitle text in `SidebarSubmenuItem`
21
+ - ae746946f7: Improve accessibility for CopyTextButton
22
+ - 385389d23c: Updated to remove usage of the `bursts` object in the theme palette
23
+ - Updated dependencies
24
+ - @backstage/core-plugin-api@1.0.4
25
+ - @backstage/theme@0.2.16
26
+ - @backstage/errors@1.1.0
27
+
3
28
  ## 0.10.0-next.3
4
29
 
5
30
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -177,6 +177,14 @@ interface CopyTextButtonProps {
177
177
  * Default: "Text copied to clipboard"
178
178
  */
179
179
  tooltipText?: string;
180
+ /**
181
+ * Text to use as aria-label prop on the button
182
+ *
183
+ * @remarks
184
+ *
185
+ * Default: "Copy text"
186
+ */
187
+ 'aria-label'?: string;
180
188
  }
181
189
  /**
182
190
  * Copy text button with visual feedback
@@ -191,7 +199,11 @@ interface CopyTextButtonProps {
191
199
  *
192
200
  * @example
193
201
  *
194
- * `<CopyTextButton text="My text that I want to be copied to the clipboard" />`
202
+ * ```
203
+ * <CopyTextButton
204
+ * text="My text that I want to be copied to the clipboard"
205
+ * arial-label="Accessible label for this button" />
206
+ * ```
195
207
  */
196
208
  declare function CopyTextButton(props: CopyTextButtonProps): JSX.Element;
197
209
 
package/dist/index.esm.js CHANGED
@@ -308,7 +308,8 @@ function CopyTextButton(props) {
308
308
  const {
309
309
  text,
310
310
  tooltipDelay = 1e3,
311
- tooltipText = "Text copied to clipboard"
311
+ tooltipText = "Text copied to clipboard",
312
+ "aria-label": ariaLabel = "Copy text"
312
313
  } = props;
313
314
  const errorApi = useApi(errorApiRef);
314
315
  const [open, setOpen] = useState(false);
@@ -331,7 +332,8 @@ function CopyTextButton(props) {
331
332
  onClose: () => setOpen(false),
332
333
  open
333
334
  }, /* @__PURE__ */ React.createElement(IconButton, {
334
- onClick: handleCopyClick
335
+ onClick: handleCopyClick,
336
+ "aria-label": ariaLabel
335
337
  }, /* @__PURE__ */ React.createElement(CopyIcon, null))));
336
338
  }
337
339
 
@@ -4399,13 +4401,13 @@ function HeaderTabs(props) {
4399
4401
  const { tabs, onChange, selectedIndex } = props;
4400
4402
  const [selectedTab, setSelectedTab] = useState(selectedIndex != null ? selectedIndex : 0);
4401
4403
  const styles = useStyles$d();
4402
- const handleChange = (_, index) => {
4404
+ const handleChange = useCallback((_, index) => {
4403
4405
  if (selectedIndex === void 0) {
4404
4406
  setSelectedTab(index);
4405
4407
  }
4406
- if (onChange)
4408
+ if (onChange && selectedIndex !== index)
4407
4409
  onChange(index);
4408
- };
4410
+ }, [selectedIndex, onChange]);
4409
4411
  useEffect(() => {
4410
4412
  if (selectedIndex !== void 0) {
4411
4413
  setSelectedTab(selectedIndex);