@backstage/core-components 0.7.2 → 0.7.3
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 +34 -0
- package/dist/index.d.ts +50 -37
- package/dist/index.esm.js +86 -56
- package/dist/index.esm.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @backstage/core-components
|
|
2
2
|
|
|
3
|
+
## 0.7.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c11a37710a: Added a warning variant to `DismissableBanner` component. If you are using a
|
|
8
|
+
custom theme, you will need to add the optional `palette.banner.warning` color,
|
|
9
|
+
otherwise this variant will fall back to the `palette.banner.error` color.
|
|
10
|
+
- 5826c17b7d: Allow for `cellStyle` property on `TableColumn` to be a function as well as `React.CSSProperties` as per the Material UI Table component
|
|
11
|
+
- e0861b92ff: Add new way to override color selection to progress bar/gauge components.
|
|
12
|
+
|
|
13
|
+
`Gauge`, `LinearGauge` and `GaugeCard` all accept a `getColor` prop,
|
|
14
|
+
which is a function of the type:
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
export type GaugePropsGetColor = (args: {
|
|
18
|
+
palette: Palette;
|
|
19
|
+
value: number;
|
|
20
|
+
inverse?: boolean;
|
|
21
|
+
max?: number;
|
|
22
|
+
}) => string;
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Return a standard CSS color string (e.g. "red", "#f02020"), and the gauge will
|
|
26
|
+
be set to that color.
|
|
27
|
+
|
|
28
|
+
If the prop is omitted, the default implementation is unchanged from previous
|
|
29
|
+
versions.
|
|
30
|
+
|
|
31
|
+
- 021986e8a3: fixed route resolving (issue #7741) when user cannot select a tab in any of the tabbed pages (like the Catalog page) if it shares the same initial letters as a preceding tab. (i.e. where tab with a path of /ci is followed by a path of /ci-2, user cannot select /ci-2 as /ci will always be selected first).
|
|
32
|
+
- a39a2105ef: Add Theme Overrides for Sidebar
|
|
33
|
+
- Updated dependencies
|
|
34
|
+
- @backstage/theme@0.2.13
|
|
35
|
+
- @backstage/core-plugin-api@0.1.13
|
|
36
|
+
|
|
3
37
|
## 0.7.2
|
|
4
38
|
|
|
5
39
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { TooltipProps } from '@material-ui/core/Tooltip';
|
|
|
9
9
|
import { TextTruncateProps } from 'react-text-truncate';
|
|
10
10
|
import { LinearProgressProps } from '@material-ui/core/LinearProgress';
|
|
11
11
|
import { CardHeaderProps } from '@material-ui/core/CardHeader';
|
|
12
|
+
import { BackstagePalette, BackstageTheme } from '@backstage/theme';
|
|
12
13
|
import { TabProps as TabProps$1 } from '@material-ui/core/Tab';
|
|
13
14
|
import { Column, MaterialTableProps } from '@material-table/core';
|
|
14
15
|
import { SparklinesProps, SparklinesLineProps } from 'react-sparklines';
|
|
@@ -16,7 +17,6 @@ import { IconComponent, ApiRef, ProfileInfoApi, BackstageIdentityApi, SessionApi
|
|
|
16
17
|
import * as _material_ui_styles from '@material-ui/styles';
|
|
17
18
|
import * as _material_ui_core_styles from '@material-ui/core/styles';
|
|
18
19
|
import { WithStyles, Theme } from '@material-ui/core/styles';
|
|
19
|
-
import { BackstageTheme } from '@backstage/theme';
|
|
20
20
|
import MaterialBreadcrumbs from '@material-ui/core/Breadcrumbs';
|
|
21
21
|
import { Overrides } from '@material-ui/core/styles/overrides';
|
|
22
22
|
import { StyleRules } from '@material-ui/core/styles/withStyles';
|
|
@@ -507,34 +507,34 @@ declare type DismissableBannerClassKey = 'root' | 'topPosition' | 'icon' | 'cont
|
|
|
507
507
|
* @deprecated This type contained a typo, please use DismissableBannerClassKey instead
|
|
508
508
|
*/
|
|
509
509
|
declare type DismissbleBannerClassKey = DismissableBannerClassKey;
|
|
510
|
-
declare type Props$
|
|
511
|
-
variant: 'info' | 'error';
|
|
510
|
+
declare type Props$j = {
|
|
511
|
+
variant: 'info' | 'error' | 'warning';
|
|
512
512
|
message: ReactNode;
|
|
513
513
|
id: string;
|
|
514
514
|
fixed?: boolean;
|
|
515
515
|
};
|
|
516
516
|
/** @public */
|
|
517
|
-
declare const DismissableBanner: (props: Props$
|
|
517
|
+
declare const DismissableBanner: (props: Props$j) => JSX.Element;
|
|
518
518
|
|
|
519
519
|
/** @public */
|
|
520
520
|
declare type EmptyStateClassKey = 'root' | 'action' | 'imageContainer';
|
|
521
|
-
declare type Props$
|
|
521
|
+
declare type Props$i = {
|
|
522
522
|
title: string;
|
|
523
523
|
description?: string | JSX.Element;
|
|
524
524
|
missing: 'field' | 'info' | 'content' | 'data';
|
|
525
525
|
action?: JSX.Element;
|
|
526
526
|
};
|
|
527
527
|
/** @public */
|
|
528
|
-
declare function EmptyState(props: Props$
|
|
528
|
+
declare function EmptyState(props: Props$i): JSX.Element;
|
|
529
529
|
|
|
530
530
|
/** @public */
|
|
531
531
|
declare type EmptyStateImageClassKey = 'generalImg';
|
|
532
532
|
|
|
533
|
-
declare type Props$
|
|
533
|
+
declare type Props$h = {
|
|
534
534
|
annotation: string;
|
|
535
535
|
};
|
|
536
536
|
declare type MissingAnnotationEmptyStateClassKey = 'code';
|
|
537
|
-
declare function MissingAnnotationEmptyState(props: Props$
|
|
537
|
+
declare function MissingAnnotationEmptyState(props: Props$h): JSX.Element;
|
|
538
538
|
|
|
539
539
|
/** @public */
|
|
540
540
|
declare type ErrorPanelClassKey = 'text' | 'divider';
|
|
@@ -562,13 +562,13 @@ declare function ResponseErrorPanel(props: ErrorPanelProps): JSX.Element;
|
|
|
562
562
|
|
|
563
563
|
/** @public */
|
|
564
564
|
declare type FeatureCalloutCircleClassKey = '@keyframes pulsateSlightly' | '@keyframes pulsateAndFade' | 'featureWrapper' | 'backdrop' | 'dot' | 'pulseCircle' | 'text';
|
|
565
|
-
declare type Props$
|
|
565
|
+
declare type Props$g = {
|
|
566
566
|
featureId: string;
|
|
567
567
|
title: string;
|
|
568
568
|
description: string;
|
|
569
569
|
};
|
|
570
570
|
/** @public */
|
|
571
|
-
declare function FeatureCalloutCircular(props: PropsWithChildren<Props$
|
|
571
|
+
declare function FeatureCalloutCircular(props: PropsWithChildren<Props$g>): JSX.Element;
|
|
572
572
|
|
|
573
573
|
declare type IconLinkVerticalProps = {
|
|
574
574
|
color?: 'primary' | 'secondary';
|
|
@@ -584,13 +584,13 @@ declare type IconLinkVerticalClassKey = 'link' | 'disabled' | 'primary' | 'secon
|
|
|
584
584
|
|
|
585
585
|
/** @public */
|
|
586
586
|
declare type HeaderIconLinkRowClassKey = 'links';
|
|
587
|
-
declare type Props$
|
|
587
|
+
declare type Props$f = {
|
|
588
588
|
links: IconLinkVerticalProps[];
|
|
589
589
|
};
|
|
590
590
|
/** @public */
|
|
591
|
-
declare function HeaderIconLinkRow(props: Props$
|
|
591
|
+
declare function HeaderIconLinkRow(props: Props$f): JSX.Element;
|
|
592
592
|
|
|
593
|
-
declare type Props$
|
|
593
|
+
declare type Props$e = {
|
|
594
594
|
scrollStep?: number;
|
|
595
595
|
scrollSpeed?: number;
|
|
596
596
|
minScrollDistance?: number;
|
|
@@ -598,17 +598,17 @@ declare type Props$f = {
|
|
|
598
598
|
/** @public */
|
|
599
599
|
declare type HorizontalScrollGridClassKey = 'root' | 'container' | 'fade' | 'fadeLeft' | 'fadeRight' | 'fadeHidden' | 'button' | 'buttonLeft' | 'buttonRight';
|
|
600
600
|
/** @public */
|
|
601
|
-
declare function HorizontalScrollGrid(props: PropsWithChildren<Props$
|
|
601
|
+
declare function HorizontalScrollGrid(props: PropsWithChildren<Props$e>): JSX.Element;
|
|
602
602
|
|
|
603
|
-
declare type Props$
|
|
603
|
+
declare type Props$d = CSS.Properties & {
|
|
604
604
|
shorthand?: boolean;
|
|
605
605
|
alpha?: boolean;
|
|
606
606
|
};
|
|
607
607
|
declare type LifecycleClassKey = 'alpha' | 'beta';
|
|
608
|
-
declare function Lifecycle(props: Props$
|
|
608
|
+
declare function Lifecycle(props: Props$d): JSX.Element;
|
|
609
609
|
|
|
610
610
|
declare type MarkdownContentClassKey = 'markdown';
|
|
611
|
-
declare type Props$
|
|
611
|
+
declare type Props$c = {
|
|
612
612
|
content: string;
|
|
613
613
|
dialect?: 'gfm' | 'common-mark';
|
|
614
614
|
};
|
|
@@ -618,14 +618,14 @@ declare type Props$d = {
|
|
|
618
618
|
* Renders markdown with the default dialect [gfm - GitHub flavored Markdown](https://github.github.com/gfm/) to backstage theme styled HTML.
|
|
619
619
|
* If you just want to render to plain [CommonMark](https://commonmark.org/), set the dialect to `'common-mark'`
|
|
620
620
|
*/
|
|
621
|
-
declare function MarkdownContent(props: Props$
|
|
621
|
+
declare function MarkdownContent(props: Props$c): JSX.Element;
|
|
622
622
|
|
|
623
623
|
declare type OAuthRequestDialogClassKey = 'dialog' | 'title' | 'contentList' | 'actionButtons';
|
|
624
624
|
declare function OAuthRequestDialog(_props: {}): JSX.Element;
|
|
625
625
|
|
|
626
626
|
declare type LoginRequestListItemClassKey = 'root';
|
|
627
627
|
|
|
628
|
-
declare type Props$
|
|
628
|
+
declare type Props$b = {
|
|
629
629
|
text: TextTruncateProps['text'];
|
|
630
630
|
line?: TextTruncateProps['line'];
|
|
631
631
|
element?: TextTruncateProps['element'];
|
|
@@ -633,7 +633,7 @@ declare type Props$c = {
|
|
|
633
633
|
placement?: TooltipProps['placement'];
|
|
634
634
|
};
|
|
635
635
|
declare type OverflowTooltipClassKey = 'container';
|
|
636
|
-
declare function OverflowTooltip(props: Props$
|
|
636
|
+
declare function OverflowTooltip(props: Props$b): JSX.Element;
|
|
637
637
|
|
|
638
638
|
declare function Progress(props: PropsWithChildren<LinearProgressProps>): JSX.Element;
|
|
639
639
|
|
|
@@ -688,7 +688,7 @@ declare type InfoCardVariants = 'flex' | 'fullHeight' | 'gridItem';
|
|
|
688
688
|
*
|
|
689
689
|
* `<InfoCard variant="gridItem">...</InfoCard>`
|
|
690
690
|
*/
|
|
691
|
-
declare type Props$
|
|
691
|
+
declare type Props$a = {
|
|
692
692
|
title?: ReactNode;
|
|
693
693
|
subheader?: ReactNode;
|
|
694
694
|
divider?: boolean;
|
|
@@ -710,9 +710,32 @@ declare type Props$b = {
|
|
|
710
710
|
titleTypographyProps?: object;
|
|
711
711
|
};
|
|
712
712
|
/** @public */
|
|
713
|
-
declare function InfoCard(props: Props$
|
|
713
|
+
declare function InfoCard(props: Props$a): JSX.Element;
|
|
714
714
|
|
|
715
|
-
|
|
715
|
+
/** @public */
|
|
716
|
+
declare type GaugeClassKey = 'root' | 'overlay' | 'circle' | 'colorUnknown';
|
|
717
|
+
/** @public */
|
|
718
|
+
declare type GaugeProps = {
|
|
719
|
+
value: number;
|
|
720
|
+
fractional?: boolean;
|
|
721
|
+
inverse?: boolean;
|
|
722
|
+
unit?: string;
|
|
723
|
+
max?: number;
|
|
724
|
+
getColor?: GaugePropsGetColor;
|
|
725
|
+
};
|
|
726
|
+
/** @public */
|
|
727
|
+
declare type GaugePropsGetColorOptions = {
|
|
728
|
+
palette: BackstagePalette;
|
|
729
|
+
value: number;
|
|
730
|
+
inverse?: boolean;
|
|
731
|
+
max?: number;
|
|
732
|
+
};
|
|
733
|
+
/** @public */
|
|
734
|
+
declare type GaugePropsGetColor = (args: GaugePropsGetColorOptions) => string;
|
|
735
|
+
/** @public */
|
|
736
|
+
declare function Gauge(props: GaugeProps): JSX.Element;
|
|
737
|
+
|
|
738
|
+
declare type Props$9 = {
|
|
716
739
|
title: string;
|
|
717
740
|
subheader?: string;
|
|
718
741
|
variant?: InfoCardVariants;
|
|
@@ -720,29 +743,19 @@ declare type Props$a = {
|
|
|
720
743
|
progress: number;
|
|
721
744
|
inverse?: boolean;
|
|
722
745
|
deepLink?: BottomLinkProps;
|
|
746
|
+
getColor?: GaugePropsGetColor;
|
|
723
747
|
};
|
|
724
748
|
/** @public */
|
|
725
749
|
declare type GaugeCardClassKey = 'root';
|
|
726
750
|
/** @public */
|
|
727
|
-
declare function GaugeCard(props: Props$
|
|
728
|
-
|
|
729
|
-
/** @public */
|
|
730
|
-
declare type GaugeClassKey = 'root' | 'overlay' | 'circle' | 'colorUnknown';
|
|
731
|
-
declare type Props$9 = {
|
|
732
|
-
value: number;
|
|
733
|
-
fractional?: boolean;
|
|
734
|
-
inverse?: boolean;
|
|
735
|
-
unit?: string;
|
|
736
|
-
max?: number;
|
|
737
|
-
};
|
|
738
|
-
/** @public */
|
|
739
|
-
declare function Gauge(props: Props$9): JSX.Element;
|
|
751
|
+
declare function GaugeCard(props: Props$9): JSX.Element;
|
|
740
752
|
|
|
741
753
|
declare type Props$8 = {
|
|
742
754
|
/**
|
|
743
755
|
* Progress value between 0.0 - 1.0.
|
|
744
756
|
*/
|
|
745
757
|
value: number;
|
|
758
|
+
getColor?: GaugePropsGetColor;
|
|
746
759
|
};
|
|
747
760
|
declare function LinearGauge(props: Props$8): JSX.Element | null;
|
|
748
761
|
|
|
@@ -1420,4 +1433,4 @@ declare type BackstageOverrides = Overrides & {
|
|
|
1420
1433
|
[Name in keyof BackstageComponentsNameToClassKey]?: Partial<StyleRules<BackstageComponentsNameToClassKey[Name]>>;
|
|
1421
1434
|
};
|
|
1422
1435
|
|
|
1423
|
-
export { AlertDisplay, Avatar, AvatarClassKey, AvatarProps, BackstageContentClassKey, BackstageOverrides, BoldHeaderClassKey, BottomLink, BottomLinkClassKey, BottomLinkProps, Breadcrumbs, BreadcrumbsClickableTextClassKey, BreadcrumbsStyledBoxClassKey, BrokenImageIcon, ActualButton as 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, GitHubIcon, GroupIcon, Header, HeaderClassKey, HeaderIconLinkRow, HeaderIconLinkRowClassKey, HeaderLabel, HeaderLabelClassKey, HeaderTabs, HeaderTabsClassKey, HelpIcon, HomepageTimer, HorizontalScrollGrid, HorizontalScrollGridClassKey, IconLinkVerticalClassKey, IconLinkVerticalProps, InfoCard, InfoCardClassKey, InfoCardVariants, IntroCard, ItemCard, ItemCardGrid, ItemCardGridClassKey, ItemCardGridProps, ItemCardHeader, ItemCardHeaderClassKey, ItemCardHeaderProps, Lifecycle, LifecycleClassKey, LinearGauge, ActualLink as Link, LinkProps, LoginRequestListItemClassKey, MarkdownContent, MarkdownContentClassKey, MetadataTableCellClassKey, MetadataTableListClassKey, MetadataTableListItemClassKey, MetadataTableTitleCellClassKey, MicDropClassKey, MissingAnnotationEmptyState, MissingAnnotationEmptyStateClassKey, OAuthRequestDialog, OAuthRequestDialogClassKey, OpenedDropdownClassKey, OverflowTooltip, OverflowTooltipClassKey, Page, PageClassKey, PageWithHeader, Progress, ResponseErrorPanel, ResponseErrorPanelClassKey, RoutedTabs, SIDEBAR_INTRO_LOCAL_STORAGE, SelectComponent as Select, SelectClassKey, SelectInputBaseClassKey, Sidebar, SidebarClassKey, SidebarContext, SidebarContextType, SidebarDivider, SidebarIntro, SidebarIntroClassKey, SidebarItem, SidebarItemClassKey, SidebarPage, SidebarPageClassKey, SidebarPinStateContext, SidebarPinStateContextType, SidebarScrollWrapper, SidebarSearchField, SidebarSpace, SidebarSpacer, SignInPage, SignInPageClassKey, SignInProviderConfig, SimpleStepper, SimpleStepperFooterClassKey, SimpleStepperStep, SimpleStepperStepClassKey, StatusAborted, StatusClassKey, StatusError, StatusOK, StatusPending, StatusRunning, StatusWarning, StructuredMetadataTable, StructuredMetadataTableListClassKey, StructuredMetadataTableNestedListClassKey, SubvalueCell, SubvalueCellClassKey, SupportButton, SupportButtonClassKey, SupportConfig, SupportItem, SupportItemLink, Tab, TabBarClassKey, TabIconClassKey, TabbedCard, TabbedCardClassKey, TabbedLayout, Table, TableClassKey, TableColumn, TableFilter, TableFiltersClassKey, TableHeaderClassKey, TableProps, TableState, TableToolbarClassKey, Tabs, TabsClassKey, TrendLine, UserIcon, WarningIcon, WarningPanel, WarningPanelClassKey, sidebarConfig, useQueryParamState, useSupportConfig };
|
|
1436
|
+
export { AlertDisplay, Avatar, AvatarClassKey, AvatarProps, BackstageContentClassKey, BackstageOverrides, BoldHeaderClassKey, BottomLink, BottomLinkClassKey, BottomLinkProps, Breadcrumbs, BreadcrumbsClickableTextClassKey, BreadcrumbsStyledBoxClassKey, BrokenImageIcon, ActualButton as 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, HeaderClassKey, HeaderIconLinkRow, HeaderIconLinkRowClassKey, HeaderLabel, HeaderLabelClassKey, HeaderTabs, HeaderTabsClassKey, HelpIcon, HomepageTimer, HorizontalScrollGrid, HorizontalScrollGridClassKey, IconLinkVerticalClassKey, IconLinkVerticalProps, InfoCard, InfoCardClassKey, InfoCardVariants, IntroCard, ItemCard, ItemCardGrid, ItemCardGridClassKey, ItemCardGridProps, ItemCardHeader, ItemCardHeaderClassKey, ItemCardHeaderProps, Lifecycle, LifecycleClassKey, LinearGauge, ActualLink as Link, LinkProps, LoginRequestListItemClassKey, MarkdownContent, MarkdownContentClassKey, MetadataTableCellClassKey, MetadataTableListClassKey, MetadataTableListItemClassKey, MetadataTableTitleCellClassKey, MicDropClassKey, MissingAnnotationEmptyState, MissingAnnotationEmptyStateClassKey, OAuthRequestDialog, OAuthRequestDialogClassKey, OpenedDropdownClassKey, OverflowTooltip, OverflowTooltipClassKey, Page, PageClassKey, PageWithHeader, Progress, ResponseErrorPanel, ResponseErrorPanelClassKey, RoutedTabs, SIDEBAR_INTRO_LOCAL_STORAGE, SelectComponent as Select, SelectClassKey, SelectInputBaseClassKey, Sidebar, SidebarClassKey, SidebarContext, SidebarContextType, SidebarDivider, SidebarIntro, SidebarIntroClassKey, SidebarItem, SidebarItemClassKey, SidebarPage, SidebarPageClassKey, SidebarPinStateContext, SidebarPinStateContextType, SidebarScrollWrapper, SidebarSearchField, SidebarSpace, SidebarSpacer, SignInPage, SignInPageClassKey, SignInProviderConfig, SimpleStepper, SimpleStepperFooterClassKey, SimpleStepperStep, SimpleStepperStepClassKey, StatusAborted, StatusClassKey, StatusError, StatusOK, StatusPending, StatusRunning, StatusWarning, StructuredMetadataTable, StructuredMetadataTableListClassKey, StructuredMetadataTableNestedListClassKey, SubvalueCell, SubvalueCellClassKey, SupportButton, SupportButtonClassKey, SupportConfig, SupportItem, SupportItemLink, Tab, TabBarClassKey, TabIconClassKey, TabbedCard, TabbedCardClassKey, TabbedLayout, Table, TableClassKey, TableColumn, TableFilter, TableFiltersClassKey, TableHeaderClassKey, TableProps, TableState, TableToolbarClassKey, Tabs, TabsClassKey, TrendLine, UserIcon, WarningIcon, WarningPanel, WarningPanelClassKey, sidebarConfig, useQueryParamState, useSupportConfig };
|
package/dist/index.esm.js
CHANGED
|
@@ -711,43 +711,49 @@ function DependencyGraph(props) {
|
|
|
711
711
|
}))));
|
|
712
712
|
}
|
|
713
713
|
|
|
714
|
-
const useStyles$H = makeStyles((theme) =>
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
color: theme.palette.banner.
|
|
714
|
+
const useStyles$H = makeStyles((theme) => {
|
|
715
|
+
var _a;
|
|
716
|
+
return {
|
|
717
|
+
root: {
|
|
718
|
+
padding: theme.spacing(0),
|
|
719
|
+
marginBottom: theme.spacing(0),
|
|
720
|
+
marginTop: theme.spacing(0),
|
|
721
|
+
display: "flex",
|
|
722
|
+
flexFlow: "row nowrap"
|
|
723
|
+
},
|
|
724
|
+
topPosition: {
|
|
725
|
+
position: "relative",
|
|
726
|
+
marginBottom: theme.spacing(6),
|
|
727
|
+
marginTop: -theme.spacing(3),
|
|
728
|
+
zIndex: "unset"
|
|
729
|
+
},
|
|
730
|
+
icon: {
|
|
731
|
+
fontSize: 20
|
|
732
|
+
},
|
|
733
|
+
content: {
|
|
734
|
+
width: "100%",
|
|
735
|
+
maxWidth: "inherit",
|
|
736
|
+
flexWrap: "nowrap"
|
|
737
|
+
},
|
|
738
|
+
message: {
|
|
739
|
+
display: "flex",
|
|
740
|
+
alignItems: "center",
|
|
741
|
+
color: theme.palette.banner.text,
|
|
742
|
+
"& a": {
|
|
743
|
+
color: theme.palette.banner.link
|
|
744
|
+
}
|
|
745
|
+
},
|
|
746
|
+
info: {
|
|
747
|
+
backgroundColor: theme.palette.banner.info
|
|
748
|
+
},
|
|
749
|
+
error: {
|
|
750
|
+
backgroundColor: theme.palette.banner.error
|
|
751
|
+
},
|
|
752
|
+
warning: {
|
|
753
|
+
backgroundColor: (_a = theme.palette.banner.warning) != null ? _a : theme.palette.banner.error
|
|
742
754
|
}
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
backgroundColor: theme.palette.banner.info
|
|
746
|
-
},
|
|
747
|
-
error: {
|
|
748
|
-
backgroundColor: theme.palette.banner.error
|
|
749
|
-
}
|
|
750
|
-
}), {name: "BackstageDismissableBanner"});
|
|
755
|
+
};
|
|
756
|
+
}, {name: "BackstageDismissableBanner"});
|
|
751
757
|
const DismissableBanner = (props) => {
|
|
752
758
|
var _a;
|
|
753
759
|
const {variant, message, id, fixed = false} = props;
|
|
@@ -1988,17 +1994,22 @@ const useStyles$r = makeStyles((theme) => ({
|
|
|
1988
1994
|
},
|
|
1989
1995
|
colorUnknown: {}
|
|
1990
1996
|
}), {name: "BackstageGauge"});
|
|
1991
|
-
const
|
|
1997
|
+
const defaultGaugeProps = {
|
|
1992
1998
|
fractional: true,
|
|
1993
1999
|
inverse: false,
|
|
1994
2000
|
unit: "%",
|
|
1995
2001
|
max: 100
|
|
1996
2002
|
};
|
|
1997
|
-
|
|
2003
|
+
const getProgressColor = ({
|
|
2004
|
+
palette,
|
|
2005
|
+
value,
|
|
2006
|
+
inverse,
|
|
2007
|
+
max
|
|
2008
|
+
}) => {
|
|
1998
2009
|
if (isNaN(value)) {
|
|
1999
2010
|
return "#ddd";
|
|
2000
2011
|
}
|
|
2001
|
-
const actualMax = max ? max :
|
|
2012
|
+
const actualMax = max ? max : defaultGaugeProps.max;
|
|
2002
2013
|
const actualValue = inverse ? actualMax - value : value;
|
|
2003
2014
|
if (actualValue < actualMax / 3) {
|
|
2004
2015
|
return palette.status.error;
|
|
@@ -2006,12 +2017,13 @@ function getProgressColor(palette, value, inverse, max) {
|
|
|
2006
2017
|
return palette.status.warning;
|
|
2007
2018
|
}
|
|
2008
2019
|
return palette.status.ok;
|
|
2009
|
-
}
|
|
2020
|
+
};
|
|
2010
2021
|
function Gauge(props) {
|
|
2022
|
+
const {getColor = getProgressColor} = props;
|
|
2011
2023
|
const classes = useStyles$r(props);
|
|
2012
|
-
const
|
|
2024
|
+
const {palette} = useTheme();
|
|
2013
2025
|
const {value, fractional, inverse, unit, max} = {
|
|
2014
|
-
...
|
|
2026
|
+
...defaultGaugeProps,
|
|
2015
2027
|
...props
|
|
2016
2028
|
};
|
|
2017
2029
|
const asPercentage = fractional ? Math.round(value * max) : value;
|
|
@@ -2023,7 +2035,7 @@ function Gauge(props) {
|
|
|
2023
2035
|
percent: asPercentage,
|
|
2024
2036
|
strokeWidth: 12,
|
|
2025
2037
|
trailWidth: 12,
|
|
2026
|
-
strokeColor:
|
|
2038
|
+
strokeColor: getColor({palette, value: asActual, inverse, max}),
|
|
2027
2039
|
className: classes.circle
|
|
2028
2040
|
}), /* @__PURE__ */ React.createElement("div", {
|
|
2029
2041
|
className: classes.overlay
|
|
@@ -2038,7 +2050,12 @@ const useStyles$q = makeStyles({
|
|
|
2038
2050
|
}, {name: "BackstageGaugeCard"});
|
|
2039
2051
|
function GaugeCard(props) {
|
|
2040
2052
|
const classes = useStyles$q(props);
|
|
2041
|
-
const {title, subheader, progress, inverse, deepLink, variant} = props;
|
|
2053
|
+
const {title, subheader, progress, inverse, deepLink, variant, getColor} = props;
|
|
2054
|
+
const gaugeProps = {
|
|
2055
|
+
inverse,
|
|
2056
|
+
getColor,
|
|
2057
|
+
value: progress
|
|
2058
|
+
};
|
|
2042
2059
|
return /* @__PURE__ */ React.createElement("div", {
|
|
2043
2060
|
className: classes.root
|
|
2044
2061
|
}, /* @__PURE__ */ React.createElement(InfoCard, {
|
|
@@ -2047,14 +2064,13 @@ function GaugeCard(props) {
|
|
|
2047
2064
|
deepLink,
|
|
2048
2065
|
variant
|
|
2049
2066
|
}, /* @__PURE__ */ React.createElement(Gauge, {
|
|
2050
|
-
|
|
2051
|
-
inverse
|
|
2067
|
+
...gaugeProps
|
|
2052
2068
|
})));
|
|
2053
2069
|
}
|
|
2054
2070
|
|
|
2055
2071
|
function LinearGauge(props) {
|
|
2056
|
-
const {value} = props;
|
|
2057
|
-
const
|
|
2072
|
+
const {value, getColor = getProgressColor} = props;
|
|
2073
|
+
const {palette} = useTheme();
|
|
2058
2074
|
if (isNaN(value)) {
|
|
2059
2075
|
return null;
|
|
2060
2076
|
}
|
|
@@ -2062,7 +2078,12 @@ function LinearGauge(props) {
|
|
|
2062
2078
|
if (percent > 100) {
|
|
2063
2079
|
percent = 100;
|
|
2064
2080
|
}
|
|
2065
|
-
const strokeColor =
|
|
2081
|
+
const strokeColor = getColor({
|
|
2082
|
+
palette,
|
|
2083
|
+
value: percent,
|
|
2084
|
+
inverse: false,
|
|
2085
|
+
max: 100
|
|
2086
|
+
});
|
|
2066
2087
|
return /* @__PURE__ */ React.createElement(Tooltip, {
|
|
2067
2088
|
title: `${percent}%`
|
|
2068
2089
|
}, /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement(Line, {
|
|
@@ -2963,8 +2984,9 @@ function useSelectedSubRoute(subRoutes) {
|
|
|
2963
2984
|
path: `${path}/*`,
|
|
2964
2985
|
element: children
|
|
2965
2986
|
}));
|
|
2966
|
-
const
|
|
2967
|
-
const
|
|
2987
|
+
const sortedRoutes = routes.sort((a, b) => b.path.replace(/\/\*$/, "").localeCompare(a.path.replace(/\/\*$/, "")));
|
|
2988
|
+
const element = (_a = useRoutes(sortedRoutes)) != null ? _a : subRoutes[0].children;
|
|
2989
|
+
const [matchedRoute] = (_b = matchRoutes(sortedRoutes, `/${params["*"]}`)) != null ? _b : [];
|
|
2968
2990
|
const foundIndex = matchedRoute ? subRoutes.findIndex((t) => `${t.path}/*` === matchedRoute.route.path) : 0;
|
|
2969
2991
|
return {
|
|
2970
2992
|
index: foundIndex === -1 ? 0 : foundIndex,
|
|
@@ -3231,10 +3253,18 @@ const useTableStyles = makeStyles(() => ({
|
|
|
3231
3253
|
function convertColumns(columns, theme) {
|
|
3232
3254
|
return columns.map((column) => {
|
|
3233
3255
|
const headerStyle = {};
|
|
3234
|
-
|
|
3256
|
+
let cellStyle = column.cellStyle || {};
|
|
3235
3257
|
if (column.highlight) {
|
|
3236
3258
|
headerStyle.color = theme.palette.textContrast;
|
|
3237
|
-
cellStyle
|
|
3259
|
+
if (typeof cellStyle === "object") {
|
|
3260
|
+
cellStyle.fontWeight = theme.typography.fontWeightBold;
|
|
3261
|
+
} else {
|
|
3262
|
+
const cellStyleFn = cellStyle;
|
|
3263
|
+
cellStyle = (data, rowData, rowColumn) => {
|
|
3264
|
+
const style = cellStyleFn(data, rowData, rowColumn);
|
|
3265
|
+
return {...style, fontWeight: theme.typography.fontWeightBold};
|
|
3266
|
+
};
|
|
3267
|
+
}
|
|
3238
3268
|
}
|
|
3239
3269
|
return {
|
|
3240
3270
|
...column,
|
|
@@ -4603,17 +4633,17 @@ function SidebarSearchField(props) {
|
|
|
4603
4633
|
}
|
|
4604
4634
|
const SidebarSpace = styled("div")({
|
|
4605
4635
|
flex: 1
|
|
4606
|
-
});
|
|
4636
|
+
}, {name: "BackstageSidebarSpace"});
|
|
4607
4637
|
const SidebarSpacer = styled("div")({
|
|
4608
4638
|
height: 8
|
|
4609
|
-
});
|
|
4639
|
+
}, {name: "BackstageSidebarSpacer"});
|
|
4610
4640
|
const SidebarDivider = styled("hr")({
|
|
4611
4641
|
height: 1,
|
|
4612
4642
|
width: "100%",
|
|
4613
4643
|
background: "#383838",
|
|
4614
4644
|
border: "none",
|
|
4615
4645
|
margin: "12px 0px"
|
|
4616
|
-
});
|
|
4646
|
+
}, {name: "BackstageSidebarDivider"});
|
|
4617
4647
|
const styledScrollbar = (theme) => ({
|
|
4618
4648
|
overflowY: "auto",
|
|
4619
4649
|
"&::-webkit-scrollbar": {
|