@backstage/core-components 0.12.5-next.0 → 0.12.5-next.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @backstage/core-components
2
2
 
3
+ ## 0.12.5-next.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 8bbf95b5507: Button labels in the sidebar (previously displayed in uppercase) will be displayed in the case that is provided without any transformations.
8
+ For example, a sidebar button with the label "Search" will appear as Search, "search" will appear as search, "SEARCH" will appear as SEARCH etc.
9
+ This can potentially affect any overriding styles previously applied to change the appearance of Button labels in the Sidebar.
10
+ - fa004f66871: Use media queries to change layout instead of `isMobile` prop in `BackstagePage` component
11
+ - Updated dependencies
12
+ - @backstage/core-plugin-api@1.5.0-next.2
13
+ - @backstage/config@1.0.7-next.0
14
+
15
+ ## 0.12.5-next.1
16
+
17
+ ### Patch Changes
18
+
19
+ - cb8ec97cdeb: Change black & white colors to be theme aware
20
+ - c10384a9235: Switch to using `LinkButton` instead of the deprecated `Button`
21
+ - 52b0022dab7: Updated dependency `msw` to `^1.0.0`.
22
+ - e1aae2f5a0c: Updated the `aria-label` of the `HeaderTabs` component.
23
+ - Updated dependencies
24
+ - @backstage/errors@1.1.5-next.0
25
+ - @backstage/core-plugin-api@1.4.1-next.1
26
+ - @backstage/config@1.0.7-next.0
27
+ - @backstage/theme@0.2.18-next.0
28
+ - @backstage/version-bridge@1.0.3
29
+
3
30
  ## 0.12.5-next.0
4
31
 
5
32
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -120,12 +120,12 @@ declare type LinkButtonProps = ButtonProps$1 & Omit<LinkProps, 'variant' | 'colo
120
120
  * @public
121
121
  * @remarks
122
122
  */
123
- declare const LinkButton: (props: ButtonProps) => JSX.Element;
123
+ declare const LinkButton: (props: LinkButtonProps) => JSX.Element;
124
124
  /**
125
125
  * @public
126
126
  * @deprecated use LinkButton instead
127
127
  */
128
- declare const Button: (props: ButtonProps) => JSX.Element;
128
+ declare const Button: (props: LinkButtonProps) => JSX.Element;
129
129
  /**
130
130
  * @public
131
131
  * @deprecated use LinkButtonProps instead
package/dist/index.esm.js CHANGED
@@ -7,7 +7,7 @@ import { Alert } from '@material-ui/lab';
7
7
  import pluralize from 'pluralize';
8
8
  import React, { useState, useEffect, useRef, useCallback, useLayoutEffect, lazy, Suspense, useMemo, Component as Component$3, Children, isValidElement, useContext, Fragment, createContext, forwardRef } from 'react';
9
9
  import MaterialAvatar from '@material-ui/core/Avatar';
10
- import { makeStyles, createStyles, useTheme, darken, lighten, withStyles, styled, ThemeProvider } from '@material-ui/core/styles';
10
+ import { makeStyles, useTheme, darken, lighten, withStyles, createStyles, styled, ThemeProvider } from '@material-ui/core/styles';
11
11
  import Button$1 from '@material-ui/core/Button';
12
12
  import MaterialLink from '@material-ui/core/Link';
13
13
  import classNames from 'classnames';
@@ -206,11 +206,11 @@ function extractInitials(value) {
206
206
  }
207
207
 
208
208
  const useStyles$S = makeStyles(
209
- (theme) => createStyles({
209
+ (theme) => ({
210
210
  avatar: {
211
211
  width: "4rem",
212
212
  height: "4rem",
213
- color: "#fff"
213
+ color: theme.palette.common.white
214
214
  },
215
215
  avatarText: {
216
216
  fontWeight: theme.typography.fontWeightBold,
@@ -385,7 +385,9 @@ const Link = React.forwardRef(
385
385
  );
386
386
 
387
387
  const LinkWrapper = React.forwardRef((props, ref) => /* @__PURE__ */ React.createElement(Link, { ref, ...props, color: "initial" }));
388
- const LinkButton = React.forwardRef((props, ref) => /* @__PURE__ */ React.createElement(Button$1, { ref, component: LinkWrapper, ...props }));
388
+ const LinkButton = React.forwardRef(
389
+ (props, ref) => /* @__PURE__ */ React.createElement(Button$1, { ref, component: LinkWrapper, ...props })
390
+ );
389
391
  const Button = LinkButton;
390
392
 
391
393
  function CopyTextButton(props) {
@@ -1149,7 +1151,7 @@ const useStyles$J = makeStyles(
1149
1151
  code: {
1150
1152
  borderRadius: 6,
1151
1153
  margin: `${theme.spacing(2)}px 0px`,
1152
- background: theme.palette.type === "dark" ? "#444" : "#fff"
1154
+ background: theme.palette.type === "dark" ? "#444" : theme.palette.common.white
1153
1155
  }
1154
1156
  }),
1155
1157
  { name: "BackstageMissingAnnotationEmptyState" }
@@ -1488,7 +1490,7 @@ function useShowCallout(featureId) {
1488
1490
  }
1489
1491
 
1490
1492
  const useStyles$F = makeStyles(
1491
- {
1493
+ (theme) => ({
1492
1494
  "@keyframes pulsateSlightly": {
1493
1495
  "0%": { transform: "scale(1.0)" },
1494
1496
  "100%": { transform: "scale(1.1)" }
@@ -1524,17 +1526,17 @@ const useStyles$F = makeStyles(
1524
1526
  height: "100%",
1525
1527
  backgroundColor: "transparent",
1526
1528
  borderRadius: "100%",
1527
- border: "2px solid white",
1529
+ border: `2px solid ${theme.palette.common.white}`,
1528
1530
  zIndex: 2001,
1529
1531
  transformOrigin: "center center",
1530
1532
  animation: "$pulsateAndFade 872ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite"
1531
1533
  },
1532
1534
  text: {
1533
1535
  position: "absolute",
1534
- color: "white",
1536
+ color: theme.palette.common.white,
1535
1537
  zIndex: 2003
1536
1538
  }
1537
- },
1539
+ }),
1538
1540
  { name: "BackstageFeatureCalloutCircular" }
1539
1541
  );
1540
1542
  function FeatureCalloutCircular(props) {
@@ -1880,9 +1882,9 @@ function HorizontalScrollGrid(props) {
1880
1882
  }
1881
1883
 
1882
1884
  const useStyles$C = makeStyles(
1883
- {
1885
+ (theme) => ({
1884
1886
  alpha: {
1885
- color: "#ffffff",
1887
+ color: theme.palette.common.white,
1886
1888
  fontFamily: "serif",
1887
1889
  fontWeight: "normal",
1888
1890
  fontStyle: "italic"
@@ -1893,7 +1895,7 @@ const useStyles$C = makeStyles(
1893
1895
  fontWeight: "normal",
1894
1896
  fontStyle: "italic"
1895
1897
  }
1896
- },
1898
+ }),
1897
1899
  { name: "BackstageLifecycle" }
1898
1900
  );
1899
1901
  function Lifecycle(props) {
@@ -2177,7 +2179,7 @@ const SlackLink = (props) => {
2177
2179
  } else if (!slackChannel.href) {
2178
2180
  return /* @__PURE__ */ React.createElement(Typography, null, "Please contact ", slackChannel.name, " for help.");
2179
2181
  }
2180
- return /* @__PURE__ */ React.createElement(Button, { to: slackChannel.href, variant: "contained" }, slackChannel.name);
2182
+ return /* @__PURE__ */ React.createElement(LinkButton, { to: slackChannel.href, variant: "contained" }, slackChannel.name);
2181
2183
  };
2182
2184
  const ErrorBoundary = class ErrorBoundary2 extends Component$3 {
2183
2185
  constructor(props) {
@@ -3814,9 +3816,6 @@ const useStyles$k = makeStyles(
3814
3816
  },
3815
3817
  "&::-webkit-scrollbar": {
3816
3818
  display: "none"
3817
- },
3818
- "& .MuiButtonBase-root": {
3819
- textTransform: "none"
3820
3819
  }
3821
3820
  }),
3822
3821
  drawerOpen: (props) => ({
@@ -3972,72 +3971,75 @@ function isLocationMatch(currentLocation, toLocation) {
3972
3971
  }
3973
3972
 
3974
3973
  const useStyles$j = makeStyles(
3975
- (theme) => ({
3976
- item: {
3977
- height: 48,
3978
- width: "100%",
3979
- "&:hover": {
3980
- background: "#6f6f6f",
3981
- color: theme.palette.navigation.selectedColor
3974
+ (theme) => {
3975
+ var _a, _b;
3976
+ return {
3977
+ item: {
3978
+ height: 48,
3979
+ width: "100%",
3980
+ "&:hover": {
3981
+ background: ((_a = theme.palette.navigation.navItem) == null ? void 0 : _a.hoverBackground) || "#6f6f6f",
3982
+ color: theme.palette.navigation.selectedColor
3983
+ },
3984
+ display: "flex",
3985
+ alignItems: "center",
3986
+ color: theme.palette.navigation.color,
3987
+ padding: theme.spacing(2.5),
3988
+ cursor: "pointer",
3989
+ position: "relative",
3990
+ background: "none",
3991
+ border: "none"
3982
3992
  },
3983
- display: "flex",
3984
- alignItems: "center",
3985
- color: theme.palette.navigation.color,
3986
- padding: theme.spacing(2.5),
3987
- cursor: "pointer",
3988
- position: "relative",
3989
- background: "none",
3990
- border: "none"
3991
- },
3992
- itemContainer: {
3993
- width: "100%"
3994
- },
3995
- selected: {
3996
- background: "#6f6f6f",
3997
- color: "#FFF"
3998
- },
3999
- label: {
4000
- margin: theme.spacing(1.75),
4001
- marginLeft: theme.spacing(1),
4002
- fontSize: theme.typography.body2.fontSize,
4003
- whiteSpace: "nowrap",
4004
- overflow: "hidden",
4005
- "text-overflow": "ellipsis",
4006
- lineHeight: 1
4007
- },
4008
- subtitle: {
4009
- fontSize: 10,
4010
- whiteSpace: "nowrap",
4011
- overflow: "hidden",
4012
- "text-overflow": "ellipsis"
4013
- },
4014
- dropdownArrow: {
4015
- position: "absolute",
4016
- right: 21
4017
- },
4018
- dropdown: {
4019
- display: "flex",
4020
- flexDirection: "column",
4021
- alignItems: "end"
4022
- },
4023
- dropdownItem: {
4024
- width: "100%",
4025
- padding: "10px 0 10px 0",
4026
- "&:hover": {
3993
+ itemContainer: {
3994
+ width: "100%"
3995
+ },
3996
+ selected: {
4027
3997
  background: "#6f6f6f",
4028
- color: theme.palette.navigation.selectedColor
3998
+ color: theme.palette.common.white
3999
+ },
4000
+ label: {
4001
+ margin: theme.spacing(1.75),
4002
+ marginLeft: theme.spacing(1),
4003
+ fontSize: theme.typography.body2.fontSize,
4004
+ whiteSpace: "nowrap",
4005
+ overflow: "hidden",
4006
+ "text-overflow": "ellipsis",
4007
+ lineHeight: 1
4008
+ },
4009
+ subtitle: {
4010
+ fontSize: 10,
4011
+ whiteSpace: "nowrap",
4012
+ overflow: "hidden",
4013
+ "text-overflow": "ellipsis"
4014
+ },
4015
+ dropdownArrow: {
4016
+ position: "absolute",
4017
+ right: 21
4018
+ },
4019
+ dropdown: {
4020
+ display: "flex",
4021
+ flexDirection: "column",
4022
+ alignItems: "end"
4023
+ },
4024
+ dropdownItem: {
4025
+ width: "100%",
4026
+ padding: "10px 0 10px 0",
4027
+ "&:hover": {
4028
+ background: ((_b = theme.palette.navigation.navItem) == null ? void 0 : _b.hoverBackground) || "#6f6f6f",
4029
+ color: theme.palette.navigation.selectedColor
4030
+ }
4031
+ },
4032
+ textContent: {
4033
+ color: theme.palette.navigation.color,
4034
+ paddingLeft: theme.spacing(4),
4035
+ paddingRight: theme.spacing(1),
4036
+ fontSize: theme.typography.body2.fontSize,
4037
+ whiteSpace: "nowrap",
4038
+ overflow: "hidden",
4039
+ "text-overflow": "ellipsis"
4029
4040
  }
4030
- },
4031
- textContent: {
4032
- color: theme.palette.navigation.color,
4033
- paddingLeft: theme.spacing(4),
4034
- paddingRight: theme.spacing(1),
4035
- fontSize: theme.typography.body2.fontSize,
4036
- whiteSpace: "nowrap",
4037
- overflow: "hidden",
4038
- "text-overflow": "ellipsis"
4039
- }
4040
- }),
4041
+ };
4042
+ },
4041
4043
  { name: "BackstageSidebarSubmenuItem" }
4042
4044
  );
4043
4045
  const SidebarSubmenuItem = (props) => {
@@ -4165,7 +4167,7 @@ const useStyles$i = makeStyles(
4165
4167
  title: {
4166
4168
  fontSize: theme.typography.h5.fontSize,
4167
4169
  fontWeight: theme.typography.fontWeightMedium,
4168
- color: "#FFF",
4170
+ color: theme.palette.common.white,
4169
4171
  padding: theme.spacing(2.5),
4170
4172
  [theme.breakpoints.down("xs")]: {
4171
4173
  display: "none"
@@ -4247,7 +4249,8 @@ const makeSidebarStyles = (sidebarConfig) => makeStyles(
4247
4249
  margin: 0,
4248
4250
  padding: 0,
4249
4251
  textAlign: "inherit",
4250
- font: "inherit"
4252
+ font: "inherit",
4253
+ textTransform: "none"
4251
4254
  },
4252
4255
  closed: {
4253
4256
  width: sidebarConfig.drawerWidthClosed,
@@ -4874,7 +4877,7 @@ function HeaderTabs(props) {
4874
4877
  textColor: "inherit",
4875
4878
  variant: "scrollable",
4876
4879
  scrollButtons: "auto",
4877
- "aria-label": "scrollable auto tabs example",
4880
+ "aria-label": "tabs",
4878
4881
  onChange: handleChange,
4879
4882
  value: selectedTab
4880
4883
  },
@@ -5984,6 +5987,11 @@ const ActionItem = ({
5984
5987
  ));
5985
5988
  };
5986
5989
  function HeaderActionMenu(props) {
5990
+ const {
5991
+ palette: {
5992
+ common: { white }
5993
+ }
5994
+ } = useTheme();
5987
5995
  const { actionItems } = props;
5988
5996
  const [open, setOpen] = React.useState(false);
5989
5997
  const anchorElRef = React.useRef(null);
@@ -5994,7 +6002,7 @@ function HeaderActionMenu(props) {
5994
6002
  "data-testid": "header-action-menu",
5995
6003
  ref: anchorElRef,
5996
6004
  style: {
5997
- color: "white",
6005
+ color: white,
5998
6006
  height: 56,
5999
6007
  width: 56,
6000
6008
  marginRight: -4,
@@ -6070,7 +6078,7 @@ function ItemCardHeader(props) {
6070
6078
 
6071
6079
  function ItemCard(props) {
6072
6080
  const { description, tags, title, type, subtitle, label, onClick, href } = props;
6073
- return /* @__PURE__ */ React.createElement(Card, null, /* @__PURE__ */ React.createElement(CardMedia, null, /* @__PURE__ */ React.createElement(ItemCardHeader, { title, subtitle: subtitle || type })), /* @__PURE__ */ React.createElement(CardContent, null, (tags == null ? void 0 : tags.length) ? /* @__PURE__ */ React.createElement(Box, null, tags.map((tag, i) => /* @__PURE__ */ React.createElement(Chip, { size: "small", label: tag, key: i }))) : null, description), /* @__PURE__ */ React.createElement(CardActions, null, !href && /* @__PURE__ */ React.createElement(Button, { to: "#", onClick, color: "primary" }, label), href && /* @__PURE__ */ React.createElement(Button, { to: href, color: "primary" }, label)));
6081
+ return /* @__PURE__ */ React.createElement(Card, null, /* @__PURE__ */ React.createElement(CardMedia, null, /* @__PURE__ */ React.createElement(ItemCardHeader, { title, subtitle: subtitle || type })), /* @__PURE__ */ React.createElement(CardContent, null, (tags == null ? void 0 : tags.length) ? /* @__PURE__ */ React.createElement(Box, null, tags.map((tag, i) => /* @__PURE__ */ React.createElement(Chip, { size: "small", label: tag, key: i }))) : null, description), /* @__PURE__ */ React.createElement(CardActions, null, !href && /* @__PURE__ */ React.createElement(LinkButton, { to: "#", onClick, color: "primary" }, label), href && /* @__PURE__ */ React.createElement(LinkButton, { to: href, color: "primary" }, label)));
6074
6082
  }
6075
6083
 
6076
6084
  const styles = (theme) => createStyles({
@@ -6089,22 +6097,24 @@ function ItemCardGrid(props) {
6089
6097
  }
6090
6098
 
6091
6099
  const useStyles$1 = makeStyles(
6092
- () => ({
6093
- root: ({ isMobile }) => ({
6100
+ (theme) => ({
6101
+ root: {
6094
6102
  display: "grid",
6095
6103
  gridTemplateAreas: "'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",
6096
6104
  gridTemplateRows: "max-content auto 1fr",
6097
6105
  gridTemplateColumns: "auto 1fr auto",
6098
- height: isMobile ? "100%" : "100vh",
6099
- overflowY: "auto"
6100
- })
6106
+ overflowY: "auto",
6107
+ height: "100vh",
6108
+ [theme.breakpoints.down("xs")]: {
6109
+ height: "100%"
6110
+ }
6111
+ }
6101
6112
  }),
6102
6113
  { name: "BackstagePage" }
6103
6114
  );
6104
6115
  function Page(props) {
6105
6116
  const { themeId, children } = props;
6106
- const { isMobile } = useSidebarPinState();
6107
- const classes = useStyles$1({ isMobile });
6117
+ const classes = useStyles$1();
6108
6118
  return /* @__PURE__ */ React.createElement(
6109
6119
  ThemeProvider,
6110
6120
  {