@backstage/core-components 0.12.1-next.3 → 0.12.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,66 @@
1
1
  # @backstage/core-components
2
2
 
3
+ ## 0.12.1
4
+
5
+ ### Patch Changes
6
+
7
+ - a236a8830d: Update sidebar icon alignment
8
+ - d3fea4ae0a: Internal fixes to avoid implicit usage of globals
9
+ - b05dcd5530: Move the `zod` dependency to a version that does not collide with other libraries
10
+ - ea4a5be8f3: Create a variable for minimum height and add a prop named 'fit' for determining if the graph height should grow or be contained.
11
+ - 2e701b3796: Internal refactor to use `react-router-dom` rather than `react-router`.
12
+ - d2e3bf6737: Made AlertDisplay not crash on undefined messages
13
+ - 64a579a998: Add items prop to SupportButton. This prop can be used to override the items that would otherwise be grabbed from the config.
14
+ - 5d3058355d: Add `react/forbid-elements` linter rule for button, suggest MUI `Button`
15
+ - 3280711113: Updated dependency `msw` to `^0.49.0`.
16
+ - 19356df560: Updated dependency `zen-observable` to `^0.9.0`.
17
+ - c3fa90e184: Updated dependency `zen-observable` to `^0.10.0`.
18
+ - 5fb6d5e92e: Updated dependency `@react-hookz/web` to `^19.0.0`.
19
+ - 17a8e32f39: Updated dependency `rc-progress` to `3.4.1`.
20
+ - 146378c146: Updated dependency `@react-hookz/web` to `^20.0.0`.
21
+ - dfc8edf9c5: Internal refactor to avoid usage of deprecated symbols.
22
+ - 8015ff1258: Tweaked wording to use inclusive terminology
23
+ - 830687539f: Sync components in @backstage/core-components with the Component Design Guidelines
24
+ - 1ae86ab5fb: Added an option to allow the `AlertMessage` to be self-closing. This is done with a new `display` property that is set to `transient` on the `AlertMessage` when triggering a message to the `AlertApi`. The length of time that these transient messages stay open for can be set using the `transientTimeoutMs` prop on the `AlertDisplay` in the `App.tsx`. Here is an example:
25
+
26
+ ```diff
27
+ const App = () => (
28
+ <AppProvider>
29
+ + <AlertDisplay transientTimeoutMs={2500} />
30
+ <OAuthRequestDialog />
31
+ <AppRouter>
32
+ <Root>{routes}</Root>
33
+ </AppRouter>
34
+ </AppProvider>
35
+ );
36
+ ```
37
+
38
+ The above example will set the transient timeout to 2500ms from the default of 5000ms
39
+
40
+ - 16e31e690f: InfoCard - Remove subheader container when there is not a subheader or icon
41
+ - a5a2d12298: Added option to pass additional headers to `<ProxiedSignInPage />`, which are passed along with the request to the underlying provider
42
+ - 91bba69ef8: Internal refactor to remove deprecated symbols.
43
+ - Updated dependencies
44
+ - @backstage/core-plugin-api@1.2.0
45
+ - @backstage/version-bridge@1.0.3
46
+ - @backstage/errors@1.1.4
47
+ - @backstage/config@1.0.5
48
+ - @backstage/theme@0.2.16
49
+
50
+ ## 0.12.1-next.4
51
+
52
+ ### Patch Changes
53
+
54
+ - b05dcd5530: Move the `zod` dependency to a version that does not collide with other libraries
55
+ - 2e701b3796: Internal refactor to use `react-router-dom` rather than `react-router`.
56
+ - a5a2d12298: Added option to pass additional headers to `<ProxiedSignInPage />`, which are passed along with the request to the underlying provider
57
+ - Updated dependencies
58
+ - @backstage/config@1.0.5-next.1
59
+ - @backstage/core-plugin-api@1.2.0-next.2
60
+ - @backstage/errors@1.1.4-next.1
61
+ - @backstage/theme@0.2.16
62
+ - @backstage/version-bridge@1.0.3-next.0
63
+
3
64
  ## 0.12.1-next.3
4
65
 
5
66
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1468,6 +1468,11 @@ declare type ProxiedSignInPageProps = SignInPageProps & {
1468
1468
  * a properly configured auth provider ID in the auth backend.
1469
1469
  */
1470
1470
  provider: string;
1471
+ /**
1472
+ * Optional headers which are passed along with the request to the
1473
+ * underlying provider
1474
+ */
1475
+ headers?: HeadersInit | (() => HeadersInit) | (() => Promise<HeadersInit>);
1471
1476
  };
1472
1477
  /**
1473
1478
  * A sign-in page that has no user interface of its own. Instead, it relies on
package/dist/index.esm.js CHANGED
@@ -12,7 +12,7 @@ import Button$1 from '@material-ui/core/Button';
12
12
  import MaterialLink from '@material-ui/core/Link';
13
13
  import classNames from 'classnames';
14
14
  import { trimEnd, isEqual, orderBy, isMatch, transform } from 'lodash';
15
- import { Link as Link$1, createRoutesFromChildren, Route as Route$1, useSearchParams, useLocation, useResolvedPath as useResolvedPath$1, resolvePath } from 'react-router-dom';
15
+ import { Link as Link$1, createRoutesFromChildren, Route as Route$1, useSearchParams, useLocation, useResolvedPath as useResolvedPath$1, resolvePath, useNavigate, useParams, useRoutes, matchRoutes } from 'react-router-dom';
16
16
  import Box from '@material-ui/core/Box';
17
17
  import LightAsync from 'react-syntax-highlighter/dist/esm/light-async';
18
18
  import dark from 'react-syntax-highlighter/dist/esm/styles/hljs/dark';
@@ -90,7 +90,6 @@ import Popover from '@material-ui/core/Popover';
90
90
  import qs from 'qs';
91
91
  import MuiBrokenImageIcon from '@material-ui/icons/BrokenImage';
92
92
  import { Helmet } from 'react-helmet';
93
- import { useLocation as useLocation$1, useNavigate, useParams, useRoutes, matchRoutes } from 'react-router';
94
93
  import BottomNavigation from '@material-ui/core/BottomNavigation';
95
94
  import Drawer from '@material-ui/core/Drawer';
96
95
  import MenuIcon from '@material-ui/icons/Menu';
@@ -3601,7 +3600,7 @@ const MobileSidebar = (props) => {
3601
3600
  const { sidebarConfig } = useContext(SidebarConfigContext);
3602
3601
  const { children } = props;
3603
3602
  const classes = useStyles$m({ sidebarConfig });
3604
- const location = useLocation$1();
3603
+ const location = useLocation();
3605
3604
  const [selectedMenuItemIndex, setSelectedMenuItemIndex] = useState(-1);
3606
3605
  useEffect(() => {
3607
3606
  setSelectedMenuItemIndex(-1);
@@ -4008,8 +4007,9 @@ const SidebarSubmenuItem = (props) => {
4008
4007
  return isActive;
4009
4008
  });
4010
4009
  return /* @__PURE__ */ React.createElement(Box, { className: classes.itemContainer }, /* @__PURE__ */ React.createElement(Tooltip, { title, enterDelay: 500, enterNextDelay: 500 }, /* @__PURE__ */ React.createElement(
4011
- "button",
4010
+ Button$1,
4012
4011
  {
4012
+ role: "button",
4013
4013
  onClick: handleClickDropdown,
4014
4014
  onTouchStart: (e) => e.stopPropagation(),
4015
4015
  className: classNames(
@@ -4228,7 +4228,8 @@ const makeSidebarStyles = (sidebarConfig) => makeStyles(
4228
4228
  marginRight: -theme.spacing(2),
4229
4229
  display: "flex",
4230
4230
  alignItems: "center",
4231
- justifyContent: "center"
4231
+ justifyContent: "center",
4232
+ lineHeight: "0"
4232
4233
  },
4233
4234
  searchRoot: {
4234
4235
  marginBottom: 12
@@ -4376,8 +4377,8 @@ const SidebarItemBase = forwardRef((props, ref) => {
4376
4377
  const { sidebarConfig } = useContext(SidebarConfigContext);
4377
4378
  const classes = useMemoStyles(sidebarConfig);
4378
4379
  const { isOpen } = useSidebarOpenState();
4379
- const divStyle = !isOpen && hasSubmenu ? { display: "flex", marginLeft: "24px" } : {};
4380
- const displayItemIcon = /* @__PURE__ */ React.createElement(Box, { style: divStyle }, /* @__PURE__ */ React.createElement(Icon, { fontSize: "small" }), !isOpen && hasSubmenu ? /* @__PURE__ */ React.createElement(ArrowRightIcon, null) : /* @__PURE__ */ React.createElement(React.Fragment, null));
4380
+ const divStyle = !isOpen && hasSubmenu ? { display: "flex", marginLeft: "20px" } : { lineHeight: "0" };
4381
+ const displayItemIcon = /* @__PURE__ */ React.createElement(Box, { style: divStyle }, /* @__PURE__ */ React.createElement(Icon, { fontSize: "small" }), !isOpen && hasSubmenu ? /* @__PURE__ */ React.createElement(ArrowRightIcon, { fontSize: "small" }) : /* @__PURE__ */ React.createElement(React.Fragment, null));
4381
4382
  const itemIcon = /* @__PURE__ */ React.createElement(
4382
4383
  Badge,
4383
4384
  {
@@ -4402,7 +4403,7 @@ const SidebarItemBase = forwardRef((props, ref) => {
4402
4403
  )
4403
4404
  };
4404
4405
  if (isButtonItem(props)) {
4405
- return /* @__PURE__ */ React.createElement("button", { "aria-label": text, ...childProps, ref }, content);
4406
+ return /* @__PURE__ */ React.createElement(Button$1, { role: "button", "aria-label": text, ...childProps, ref }, content);
4406
4407
  }
4407
4408
  return /* @__PURE__ */ React.createElement(
4408
4409
  WorkaroundNavLink,
@@ -4596,8 +4597,9 @@ const SidebarExpandButton = () => {
4596
4597
  setOpen(!isOpen);
4597
4598
  };
4598
4599
  return /* @__PURE__ */ React.createElement(
4599
- "button",
4600
+ Button$1,
4600
4601
  {
4602
+ role: "button",
4601
4603
  onClick: handleClick,
4602
4604
  className: classes.expandButton,
4603
4605
  "aria-label": "Expand Sidebar",
@@ -6164,11 +6166,14 @@ class ProxiedSignInIdentity {
6164
6166
  }
6165
6167
  async fetchSession() {
6166
6168
  const baseUrl = await this.options.discoveryApi.getBaseUrl("auth");
6169
+ const headers = typeof this.options.headers === "function" ? await this.options.headers() : this.options.headers;
6170
+ const mergedHeaders = new Headers(headers);
6171
+ mergedHeaders.set("X-Requested-With", "XMLHttpRequest");
6167
6172
  const response = await fetch(
6168
6173
  `${baseUrl}/${this.options.provider}/refresh`,
6169
6174
  {
6170
6175
  signal: this.abortController.signal,
6171
- headers: { "x-requested-with": "XMLHttpRequest" },
6176
+ headers: mergedHeaders,
6172
6177
  credentials: "include"
6173
6178
  }
6174
6179
  );
@@ -6184,7 +6189,8 @@ const ProxiedSignInPage = (props) => {
6184
6189
  const [{ status, error }, { execute }] = useAsync(async () => {
6185
6190
  const identity = new ProxiedSignInIdentity({
6186
6191
  provider: props.provider,
6187
- discoveryApi
6192
+ discoveryApi,
6193
+ headers: props.headers
6188
6194
  });
6189
6195
  await identity.start();
6190
6196
  props.onSignInSuccess(identity);