@backstage/core-components 0.12.3 → 0.12.4-next.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,19 @@
1
1
  # @backstage/core-components
2
2
 
3
+ ## 0.12.4-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 910015f5b7: The Button component has been deprecated in favor of the LinkButton component
8
+ - 20840b36b4: Adds new type, TableOptions, extending Material Table Options.
9
+ - 85b04f659a: Internal refactor to not use deprecated `substr`
10
+ - Updated dependencies
11
+ - @backstage/config@1.0.6
12
+ - @backstage/core-plugin-api@1.3.0
13
+ - @backstage/errors@1.1.4
14
+ - @backstage/theme@0.2.16
15
+ - @backstage/version-bridge@1.0.3
16
+
3
17
  ## 0.12.3
4
18
 
5
19
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -12,7 +12,7 @@ import { LinearProgressProps } from '@material-ui/core/LinearProgress';
12
12
  import { CardHeaderProps } from '@material-ui/core/CardHeader';
13
13
  import { BackstagePalette, BackstageTheme } from '@backstage/theme';
14
14
  import { TabProps as TabProps$1 } from '@material-ui/core/Tab';
15
- import { Column, MaterialTableProps, Icons } from '@material-table/core';
15
+ import { Column, MaterialTableProps, Options as Options$1, Icons } from '@material-table/core';
16
16
  import { SparklinesProps, SparklinesLineProps } from 'react-sparklines';
17
17
  import { IconComponent, SignInPageProps, ApiRef, ProfileInfoApi, BackstageIdentityApi, SessionApi, IdentityApi, ProfileInfo, BackstageUserIdentity } from '@backstage/core-plugin-api';
18
18
  import { ListItemTextProps } from '@material-ui/core/ListItemText';
@@ -106,23 +106,31 @@ declare type LinkProps = Omit<LinkProps$1, 'to'> & Omit<LinkProps$2, 'to'> & {
106
106
  declare const Link: (props: LinkProps) => JSX.Element;
107
107
 
108
108
  /**
109
- * Properties for {@link Button}
109
+ * Properties for {@link LinkButton}
110
110
  *
111
111
  * @public
112
112
  * @remarks
113
113
  *
114
114
  * See {@link https://v4.mui.com/api/button/#props | Material-UI Button Props} for all properties
115
115
  */
116
- declare type ButtonProps = ButtonProps$1 & Omit<LinkProps, 'variant' | 'color'>;
116
+ declare type LinkButtonProps = ButtonProps$1 & Omit<LinkProps, 'variant' | 'color'>;
117
117
  /**
118
118
  * Thin wrapper on top of material-ui's {@link https://v4.mui.com/components/buttons/ | Button} component
119
119
  *
120
120
  * @public
121
121
  * @remarks
122
- *
123
- * Makes the Button to utilize react-router
122
+ */
123
+ declare const LinkButton: (props: ButtonProps) => JSX.Element;
124
+ /**
125
+ * @public
126
+ * @deprecated use LinkButton instead
124
127
  */
125
128
  declare const Button: (props: ButtonProps) => JSX.Element;
129
+ /**
130
+ * @public
131
+ * @deprecated use LinkButtonProps instead
132
+ */
133
+ declare type ButtonProps = LinkButtonProps;
126
134
 
127
135
  /**
128
136
  * Properties for {@link CodeSnippet}
@@ -1117,6 +1125,8 @@ interface TableProps<T extends object = {}> extends MaterialTableProps<T> {
1117
1125
  emptyContent?: ReactNode;
1118
1126
  onStateChange?: (state: TableState) => any;
1119
1127
  }
1128
+ interface TableOptions<T extends object = {}> extends Options$1<T> {
1129
+ }
1120
1130
  /**
1121
1131
  * @public
1122
1132
  */
@@ -2086,4 +2096,4 @@ declare type BackstageOverrides = Overrides & {
2086
2096
  [Name in keyof BackstageComponentsNameToClassKey]?: Partial<StyleRules<BackstageComponentsNameToClassKey[Name]>>;
2087
2097
  };
2088
2098
 
2089
- export { AlertDisplay, AlertDisplayProps, Avatar, AvatarClassKey, AvatarProps, BackstageContentClassKey, BackstageOverrides, BoldHeaderClassKey, BottomLink, BottomLinkClassKey, BottomLinkProps, Breadcrumbs, BreadcrumbsClickableTextClassKey, BreadcrumbsStyledBoxClassKey, BrokenImageIcon, Button, ButtonProps, CardActionsTopRightClassKey, CardTab, CardTabClassKey, CatalogIcon, ChatIcon, ClosedDropdownClassKey, CodeSnippet, CodeSnippetProps, Content, ContentHeader, ContentHeaderClassKey, CopyTextButton, CopyTextButtonProps, CreateButton, CreateButtonProps, CustomProviderClassKey, DashboardIcon, DependencyGraph, DependencyGraphDefaultLabelClassKey, DependencyGraphDefaultNodeClassKey, DependencyGraphEdgeClassKey, DependencyGraphNodeClassKey, DependencyGraphProps, types_d as DependencyGraphTypes, DismissableBanner, DismissableBannerClassKey, DismissbleBannerClassKey, DocsIcon, EmailIcon, EmptyState, EmptyStateClassKey, EmptyStateImageClassKey, ErrorBoundary, ErrorBoundaryProps, ErrorPage, ErrorPageClassKey, ErrorPanel, ErrorPanelClassKey, ErrorPanelProps, FeatureCalloutCircleClassKey, FeatureCalloutCircular, FiltersContainerClassKey, Gauge, GaugeCard, GaugeCardClassKey, GaugeClassKey, GaugeProps, GaugePropsGetColor, GaugePropsGetColorOptions, GitHubIcon, GroupIcon, Header, HeaderActionMenu, HeaderActionMenuItem, HeaderActionMenuProps, HeaderClassKey, HeaderIconLinkRow, HeaderIconLinkRowClassKey, HeaderLabel, HeaderLabelClassKey, HeaderTabs, HeaderTabsClassKey, HelpIcon, HorizontalScrollGrid, HorizontalScrollGridClassKey, IconLinkVerticalClassKey, IconLinkVerticalProps, IdentityProviders, InfoCard, InfoCardClassKey, InfoCardVariants, IntroCard, ItemCard, ItemCardGrid, ItemCardGridClassKey, ItemCardGridProps, ItemCardHeader, ItemCardHeaderClassKey, ItemCardHeaderProps, Lifecycle, LifecycleClassKey, LinearGauge, Link, LinkProps, LogViewer, LogViewerClassKey, LogViewerProps, LoginRequestListItemClassKey, MarkdownContent, MarkdownContentClassKey, MetadataTableCellClassKey, MetadataTableListClassKey, MetadataTableListItemClassKey, MetadataTableTitleCellClassKey, MicDropClassKey, MissingAnnotationEmptyState, MissingAnnotationEmptyStateClassKey, MobileSidebar, MobileSidebarProps, OAuthRequestDialog, OAuthRequestDialogClassKey, OpenedDropdownClassKey, OverflowTooltip, OverflowTooltipClassKey, Page, PageClassKey, PageWithHeader, Progress, ProxiedSignInPage, ProxiedSignInPageProps, ResponseErrorPanel, ResponseErrorPanelClassKey, RoutedTabs, SIDEBAR_INTRO_LOCAL_STORAGE, SelectComponent as Select, SelectClassKey, SelectInputBaseClassKey, SelectItem, SelectedItems, Sidebar, SidebarClassKey, LegacySidebarContext as SidebarContext, SidebarContextType, SidebarDivider, SidebarDividerClassKey, SidebarExpandButton, SidebarGroup, SidebarGroupProps, SidebarIntro, SidebarIntroClassKey, SidebarItem, SidebarItemClassKey, SidebarOpenState, SidebarOpenStateProvider, SidebarOptions, SidebarPage, SidebarPageClassKey, SidebarPageProps, SidebarPinState, LegacySidebarPinStateContext as SidebarPinStateContext, SidebarPinStateContextType, SidebarPinStateProvider, SidebarProps, SidebarScrollWrapper, SidebarSearchField, SidebarSpace, SidebarSpaceClassKey, SidebarSpacer, SidebarSpacerClassKey, SidebarSubmenu, SidebarSubmenuItem, SidebarSubmenuItemDropdownItem, SidebarSubmenuItemProps, SidebarSubmenuProps, SignInPage, SignInPageClassKey, SignInProviderConfig, SimpleStepper, SimpleStepperFooterClassKey, SimpleStepperStep, SimpleStepperStepClassKey, StatusAborted, StatusClassKey, StatusError, StatusOK, StatusPending, StatusRunning, StatusWarning, StructuredMetadataTable, StructuredMetadataTableListClassKey, StructuredMetadataTableNestedListClassKey, SubmenuOptions, SubvalueCell, SubvalueCellClassKey, SupportButton, SupportButtonClassKey, SupportConfig, SupportItem, SupportItemLink, Tab, TabBarClassKey, TabClassKey, TabIconClassKey, TabbedCard, TabbedCardClassKey, TabbedLayout, Table, TableClassKey, TableColumn, TableFilter, TableFiltersClassKey, TableHeaderClassKey, TableProps, TableState, TableToolbarClassKey, Tabs, TabsClassKey, TrendLine, UserIcon, UserIdentity, WarningIcon, WarningPanel, WarningPanelClassKey, sidebarConfig, useContent, useQueryParamState, useSidebarOpenState, useSidebarPinState, useSupportConfig };
2099
+ export { AlertDisplay, AlertDisplayProps, Avatar, AvatarClassKey, AvatarProps, BackstageContentClassKey, BackstageOverrides, BoldHeaderClassKey, BottomLink, BottomLinkClassKey, BottomLinkProps, Breadcrumbs, BreadcrumbsClickableTextClassKey, BreadcrumbsStyledBoxClassKey, BrokenImageIcon, Button, ButtonProps, CardActionsTopRightClassKey, CardTab, CardTabClassKey, CatalogIcon, ChatIcon, ClosedDropdownClassKey, CodeSnippet, CodeSnippetProps, Content, ContentHeader, ContentHeaderClassKey, CopyTextButton, CopyTextButtonProps, CreateButton, CreateButtonProps, CustomProviderClassKey, DashboardIcon, DependencyGraph, DependencyGraphDefaultLabelClassKey, DependencyGraphDefaultNodeClassKey, DependencyGraphEdgeClassKey, DependencyGraphNodeClassKey, DependencyGraphProps, types_d as DependencyGraphTypes, DismissableBanner, DismissableBannerClassKey, DismissbleBannerClassKey, DocsIcon, EmailIcon, EmptyState, EmptyStateClassKey, EmptyStateImageClassKey, ErrorBoundary, ErrorBoundaryProps, ErrorPage, ErrorPageClassKey, ErrorPanel, ErrorPanelClassKey, ErrorPanelProps, FeatureCalloutCircleClassKey, FeatureCalloutCircular, FiltersContainerClassKey, Gauge, GaugeCard, GaugeCardClassKey, GaugeClassKey, GaugeProps, GaugePropsGetColor, GaugePropsGetColorOptions, GitHubIcon, GroupIcon, Header, HeaderActionMenu, HeaderActionMenuItem, HeaderActionMenuProps, HeaderClassKey, HeaderIconLinkRow, HeaderIconLinkRowClassKey, HeaderLabel, HeaderLabelClassKey, HeaderTabs, HeaderTabsClassKey, HelpIcon, HorizontalScrollGrid, HorizontalScrollGridClassKey, IconLinkVerticalClassKey, IconLinkVerticalProps, IdentityProviders, InfoCard, InfoCardClassKey, InfoCardVariants, IntroCard, ItemCard, ItemCardGrid, ItemCardGridClassKey, ItemCardGridProps, ItemCardHeader, ItemCardHeaderClassKey, ItemCardHeaderProps, Lifecycle, LifecycleClassKey, LinearGauge, Link, LinkButton, LinkButtonProps, LinkProps, LogViewer, LogViewerClassKey, LogViewerProps, LoginRequestListItemClassKey, MarkdownContent, MarkdownContentClassKey, MetadataTableCellClassKey, MetadataTableListClassKey, MetadataTableListItemClassKey, MetadataTableTitleCellClassKey, MicDropClassKey, MissingAnnotationEmptyState, MissingAnnotationEmptyStateClassKey, MobileSidebar, MobileSidebarProps, OAuthRequestDialog, OAuthRequestDialogClassKey, OpenedDropdownClassKey, OverflowTooltip, OverflowTooltipClassKey, Page, PageClassKey, PageWithHeader, Progress, ProxiedSignInPage, ProxiedSignInPageProps, ResponseErrorPanel, ResponseErrorPanelClassKey, RoutedTabs, SIDEBAR_INTRO_LOCAL_STORAGE, SelectComponent as Select, SelectClassKey, SelectInputBaseClassKey, SelectItem, SelectedItems, Sidebar, SidebarClassKey, LegacySidebarContext as SidebarContext, SidebarContextType, SidebarDivider, SidebarDividerClassKey, SidebarExpandButton, SidebarGroup, SidebarGroupProps, SidebarIntro, SidebarIntroClassKey, SidebarItem, SidebarItemClassKey, SidebarOpenState, SidebarOpenStateProvider, SidebarOptions, SidebarPage, SidebarPageClassKey, SidebarPageProps, SidebarPinState, LegacySidebarPinStateContext as SidebarPinStateContext, SidebarPinStateContextType, SidebarPinStateProvider, SidebarProps, SidebarScrollWrapper, SidebarSearchField, SidebarSpace, SidebarSpaceClassKey, SidebarSpacer, SidebarSpacerClassKey, SidebarSubmenu, SidebarSubmenuItem, SidebarSubmenuItemDropdownItem, SidebarSubmenuItemProps, SidebarSubmenuProps, SignInPage, SignInPageClassKey, SignInProviderConfig, SimpleStepper, SimpleStepperFooterClassKey, SimpleStepperStep, SimpleStepperStepClassKey, StatusAborted, StatusClassKey, StatusError, StatusOK, StatusPending, StatusRunning, StatusWarning, StructuredMetadataTable, StructuredMetadataTableListClassKey, StructuredMetadataTableNestedListClassKey, SubmenuOptions, SubvalueCell, SubvalueCellClassKey, SupportButton, SupportButtonClassKey, SupportConfig, SupportItem, SupportItemLink, Tab, TabBarClassKey, TabClassKey, TabIconClassKey, TabbedCard, TabbedCardClassKey, TabbedLayout, Table, TableClassKey, TableColumn, TableFilter, TableFiltersClassKey, TableHeaderClassKey, TableOptions, TableProps, TableState, TableToolbarClassKey, Tabs, TabsClassKey, TrendLine, UserIcon, UserIdentity, WarningIcon, WarningPanel, WarningPanelClassKey, sidebarConfig, useContent, useQueryParamState, useSidebarOpenState, useSidebarPinState, useSupportConfig };
package/dist/index.esm.js CHANGED
@@ -196,13 +196,13 @@ function stringToColor(str) {
196
196
  let color = "#";
197
197
  for (let i = 0; i < 3; i++) {
198
198
  const value = hash >> i * 8 & 255;
199
- color += `00${value.toString(16)}`.substr(-2);
199
+ color += `00${value.toString(16)}`.slice(-2);
200
200
  }
201
201
  return color;
202
202
  }
203
203
  function extractInitials(value) {
204
204
  var _a;
205
- return (_a = value.match(/\b\w/g)) == null ? void 0 : _a.join("").substring(0, 2);
205
+ return (_a = value.match(/\b\w/g)) == null ? void 0 : _a.join("").slice(0, 2);
206
206
  }
207
207
 
208
208
  const useStyles$S = makeStyles(
@@ -362,7 +362,8 @@ const Link = React.forwardRef(
362
362
  );
363
363
 
364
364
  const LinkWrapper = React.forwardRef((props, ref) => /* @__PURE__ */ React.createElement(Link, { ref, ...props, color: "initial" }));
365
- const Button = React.forwardRef((props, ref) => /* @__PURE__ */ React.createElement(Button$1, { ref, component: LinkWrapper, ...props }));
365
+ const LinkButton = React.forwardRef((props, ref) => /* @__PURE__ */ React.createElement(Button$1, { ref, component: LinkWrapper, ...props }));
366
+ const Button = LinkButton;
366
367
 
367
368
  function CopyTextButton(props) {
368
369
  const {
@@ -4496,11 +4497,13 @@ const SidebarItemWithSubmenu = ({
4496
4497
  const SidebarItem = forwardRef((props, ref) => {
4497
4498
  const [submenu] = useElementFilter(
4498
4499
  props.children,
4499
- (elements) => // Directly comparing child.type with SidebarSubmenu will not work with in
4500
- // combination with react-hot-loader
4501
- //
4502
- // https://github.com/gaearon/react-hot-loader/issues/304#issuecomment-456569720
4503
- elements.getElements().filter((child) => child.type === sidebarSubmenuType)
4500
+ (elements) => (
4501
+ // Directly comparing child.type with SidebarSubmenu will not work with in
4502
+ // combination with react-hot-loader
4503
+ //
4504
+ // https://github.com/gaearon/react-hot-loader/issues/304#issuecomment-456569720
4505
+ elements.getElements().filter((child) => child.type === sidebarSubmenuType)
4506
+ )
4504
4507
  );
4505
4508
  if (submenu) {
4506
4509
  return /* @__PURE__ */ React.createElement(SidebarItemWithSubmenu, { ...props }, submenu);
@@ -4866,8 +4869,10 @@ function useSelectedSubRoute(subRoutes) {
4866
4869
  element: children
4867
4870
  }));
4868
4871
  const sortedRoutes = routes.sort(
4869
- (a, b) => // remove "/*" symbols from path end before comparing
4870
- b.path.replace(/\/\*$/, "").localeCompare(a.path.replace(/\/\*$/, ""))
4872
+ (a, b) => (
4873
+ // remove "/*" symbols from path end before comparing
4874
+ b.path.replace(/\/\*$/, "").localeCompare(a.path.replace(/\/\*$/, ""))
4875
+ )
4871
4876
  );
4872
4877
  const element = (_a = useRoutes(sortedRoutes)) != null ? _a : subRoutes[0].children;
4873
4878
  let currentRoute = (_b = params["*"]) != null ? _b : "";
@@ -6182,7 +6187,7 @@ class ProxiedSignInIdentity {
6182
6187
  async getSessionAsync() {
6183
6188
  if (this.state.type === "fetching") {
6184
6189
  return this.state.promise;
6185
- } else if (this.state.type === "active" && new Date() < this.state.expiresAt) {
6190
+ } else if (this.state.type === "active" && /* @__PURE__ */ new Date() < this.state.expiresAt) {
6186
6191
  return this.state.session;
6187
6192
  }
6188
6193
  const previous = this.state.type === "active" ? this.state.session : void 0;
@@ -6951,5 +6956,5 @@ function CardTab(props) {
6951
6956
  return /* @__PURE__ */ React.createElement(Tab, { disableRipple: true, classes, ...restProps });
6952
6957
  }
6953
6958
 
6954
- export { AlertDisplay, Avatar, BottomLink, Breadcrumbs, BrokenImageIcon, Button, CardTab, CatalogIcon, ChatIcon, CodeSnippet, Content, ContentHeader, CopyTextButton, CreateButton, DashboardIcon, DependencyGraph, types as DependencyGraphTypes, DismissableBanner, DocsIcon, EmailIcon, EmptyState, ErrorBoundary, ErrorPage, ErrorPanel, FeatureCalloutCircular, Gauge, GaugeCard, GitHubIcon, GroupIcon, Header, HeaderActionMenu, HeaderIconLinkRow, HeaderLabel, HeaderTabs, HelpIcon, HorizontalScrollGrid, InfoCard, IntroCard, ItemCard, ItemCardGrid, ItemCardHeader, Lifecycle, LinearGauge, Link, LogViewer, MarkdownContent, MissingAnnotationEmptyState, MobileSidebar, OAuthRequestDialog, OverflowTooltip, Page, PageWithHeader, Progress, ProxiedSignInPage, ResponseErrorPanel, RoutedTabs, SIDEBAR_INTRO_LOCAL_STORAGE, SelectComponent as Select, Sidebar, LegacySidebarContext as SidebarContext, SidebarDivider, SidebarExpandButton, SidebarGroup, SidebarIntro, SidebarItem, SidebarOpenStateProvider, SidebarPage, LegacySidebarPinStateContext as SidebarPinStateContext, SidebarPinStateProvider, SidebarScrollWrapper, SidebarSearchField, SidebarSpace, SidebarSpacer, SidebarSubmenu, SidebarSubmenuItem, SignInPage, SimpleStepper, SimpleStepperStep, StatusAborted, StatusError, StatusOK, StatusPending, StatusRunning, StatusWarning, StructuredMetadataTable, SubvalueCell, SupportButton, TabbedCard, TabbedLayout, Table, Tabs, TrendLine, UserIcon, UserIdentity, WarningIcon, WarningPanel, sidebarConfig, useContent, useQueryParamState, useSidebarOpenState, useSidebarPinState, useSupportConfig };
6959
+ export { AlertDisplay, Avatar, BottomLink, Breadcrumbs, BrokenImageIcon, Button, CardTab, CatalogIcon, ChatIcon, CodeSnippet, Content, ContentHeader, CopyTextButton, CreateButton, DashboardIcon, DependencyGraph, types as DependencyGraphTypes, DismissableBanner, DocsIcon, EmailIcon, EmptyState, ErrorBoundary, ErrorPage, ErrorPanel, FeatureCalloutCircular, Gauge, GaugeCard, GitHubIcon, GroupIcon, Header, HeaderActionMenu, HeaderIconLinkRow, HeaderLabel, HeaderTabs, HelpIcon, HorizontalScrollGrid, InfoCard, IntroCard, ItemCard, ItemCardGrid, ItemCardHeader, Lifecycle, LinearGauge, Link, LinkButton, LogViewer, MarkdownContent, MissingAnnotationEmptyState, MobileSidebar, OAuthRequestDialog, OverflowTooltip, Page, PageWithHeader, Progress, ProxiedSignInPage, ResponseErrorPanel, RoutedTabs, SIDEBAR_INTRO_LOCAL_STORAGE, SelectComponent as Select, Sidebar, LegacySidebarContext as SidebarContext, SidebarDivider, SidebarExpandButton, SidebarGroup, SidebarIntro, SidebarItem, SidebarOpenStateProvider, SidebarPage, LegacySidebarPinStateContext as SidebarPinStateContext, SidebarPinStateProvider, SidebarScrollWrapper, SidebarSearchField, SidebarSpace, SidebarSpacer, SidebarSubmenu, SidebarSubmenuItem, SignInPage, SimpleStepper, SimpleStepperStep, StatusAborted, StatusError, StatusOK, StatusPending, StatusRunning, StatusWarning, StructuredMetadataTable, SubvalueCell, SupportButton, TabbedCard, TabbedLayout, Table, Tabs, TrendLine, UserIcon, UserIdentity, WarningIcon, WarningPanel, sidebarConfig, useContent, useQueryParamState, useSidebarOpenState, useSidebarPinState, useSupportConfig };
6955
6960
  //# sourceMappingURL=index.esm.js.map