@backstage/core-components 0.9.3-next.0 → 0.9.3-next.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,14 @@
1
1
  # @backstage/core-components
2
2
 
3
+ ## 0.9.3-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 25b8e8d5b5: Add BackstageTab to overridableComponents so can override styles in a theme
8
+ - a13604b8f7: Adding a name to the core-components Tab styles so can customise in the theme settings
9
+ - 72f3dfd05a: Updated ProxiedSignInPageProps docs
10
+ - 7741e47eae: `<Sidebar />` now accepts additional props `sidebarOptions` and `submenuOptions` to allow further customization
11
+
3
12
  ## 0.9.3-next.0
4
13
 
5
14
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1036,6 +1036,9 @@ interface TabsProps {
1036
1036
  declare type TabsClassKey = 'root' | 'styledTabs' | 'appbar';
1037
1037
  declare function Tabs(props: TabsProps): JSX.Element;
1038
1038
 
1039
+ /** @public */
1040
+ declare type TabClassKey = 'root' | 'selected';
1041
+
1039
1042
  declare type TabBarClassKey = 'indicator' | 'flexContainer' | 'root';
1040
1043
 
1041
1044
  declare type TabIconClassKey = 'root';
@@ -1362,7 +1365,7 @@ declare function PageWithHeader(props: PropsWithChildren<PageWithHeaderProps>):
1362
1365
  */
1363
1366
  declare type ProxiedSignInPageProps = SignInPageProps & {
1364
1367
  /**
1365
- * The provider to use, e.g. "gcp-iap" or "aws-alb". This must correspond to
1368
+ * The provider to use, e.g. "gcp-iap" or "awsalb". This must correspond to
1366
1369
  * a properly configured auth provider ID in the auth backend.
1367
1370
  */
1368
1371
  provider: string;
@@ -1384,12 +1387,52 @@ declare type ProxiedSignInPageProps = SignInPageProps & {
1384
1387
  */
1385
1388
  declare const ProxiedSignInPage: (props: ProxiedSignInPageProps) => JSX.Element | null;
1386
1389
 
1390
+ /** @public **/
1391
+ declare type SidebarOptions = {
1392
+ drawerWidthClosed?: number;
1393
+ drawerWidthOpen?: number;
1394
+ };
1395
+ /** @public **/
1396
+ declare type SubmenuOptions = {
1397
+ drawerWidthClosed?: number;
1398
+ drawerWidthOpen?: number;
1399
+ };
1400
+ declare const sidebarConfig: {
1401
+ drawerWidthClosed: number;
1402
+ drawerWidthOpen: number;
1403
+ defaultOpenDelayMs: number;
1404
+ defaultCloseDelayMs: number;
1405
+ defaultFadeDuration: number;
1406
+ logoHeight: number;
1407
+ iconContainerWidth: number;
1408
+ iconSize: number;
1409
+ iconPadding: number;
1410
+ selectedIndicatorWidth: number;
1411
+ userBadgePadding: number;
1412
+ userBadgeDiameter: number;
1413
+ mobileSidebarHeight: number;
1414
+ };
1415
+ declare const SIDEBAR_INTRO_LOCAL_STORAGE = "@backstage/core/sidebar-intro-dismissed";
1416
+ /**
1417
+ * Types for the `SidebarContext`
1418
+ */
1419
+ declare type SidebarContextType = {
1420
+ isOpen: boolean;
1421
+ setOpen: (open: boolean) => void;
1422
+ };
1423
+ /**
1424
+ * Context whether the `Sidebar` is open
1425
+ */
1426
+ declare const SidebarContext: React.Context<SidebarContextType>;
1427
+
1387
1428
  /** @public */
1388
1429
  declare type SidebarClassKey = 'drawer' | 'drawerOpen';
1389
1430
  /** @public */
1390
1431
  declare type SidebarProps = {
1391
1432
  openDelayMs?: number;
1392
1433
  closeDelayMs?: number;
1434
+ sidebarOptions?: SidebarOptions;
1435
+ submenuOptions?: SubmenuOptions;
1393
1436
  disableExpandOnHover?: boolean;
1394
1437
  children?: React__default.ReactNode;
1395
1438
  };
@@ -1627,34 +1670,6 @@ declare type IntroCardProps = {
1627
1670
  declare function IntroCard(props: IntroCardProps): JSX.Element;
1628
1671
  declare function SidebarIntro(_props: {}): JSX.Element | null;
1629
1672
 
1630
- declare const sidebarConfig: {
1631
- drawerWidthClosed: number;
1632
- drawerWidthOpen: number;
1633
- defaultOpenDelayMs: number;
1634
- defaultCloseDelayMs: number;
1635
- defaultFadeDuration: number;
1636
- logoHeight: number;
1637
- iconContainerWidth: number;
1638
- iconSize: number;
1639
- iconPadding: number;
1640
- selectedIndicatorWidth: number;
1641
- userBadgePadding: number;
1642
- userBadgeDiameter: number;
1643
- mobileSidebarHeight: number;
1644
- };
1645
- declare const SIDEBAR_INTRO_LOCAL_STORAGE = "@backstage/core/sidebar-intro-dismissed";
1646
- /**
1647
- * Types for the `SidebarContext`
1648
- */
1649
- declare type SidebarContextType = {
1650
- isOpen: boolean;
1651
- setOpen: (open: boolean) => void;
1652
- };
1653
- /**
1654
- * Context whether the `Sidebar` is open
1655
- */
1656
- declare const SidebarContext: React.Context<SidebarContextType>;
1657
-
1658
1673
  declare type SignInProviderConfig = {
1659
1674
  id: string;
1660
1675
  title: string;
@@ -1841,6 +1856,7 @@ declare type BackstageComponentsNameToClassKey = {
1841
1856
  BackstageTabBar: TabBarClassKey;
1842
1857
  BackstageTabIcon: TabIconClassKey;
1843
1858
  BackstageTabs: TabsClassKey;
1859
+ BackstageTab: TabClassKey;
1844
1860
  BackstageWarningPanel: WarningPanelClassKey;
1845
1861
  BackstageBottomLink: BottomLinkClassKey;
1846
1862
  BackstageBreadcrumbsClickableText: BreadcrumbsClickableTextClassKey;
@@ -1875,4 +1891,4 @@ declare type BackstageOverrides = Overrides & {
1875
1891
  [Name in keyof BackstageComponentsNameToClassKey]?: Partial<StyleRules<BackstageComponentsNameToClassKey[Name]>>;
1876
1892
  };
1877
1893
 
1878
- export { AlertDisplay, 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, 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, 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, SidebarContext, SidebarContextType, SidebarDivider, SidebarDividerClassKey, SidebarExpandButton, SidebarGroup, SidebarGroupProps, SidebarIntro, SidebarIntroClassKey, SidebarItem, SidebarItemClassKey, SidebarPage, SidebarPageClassKey, SidebarPageProps, SidebarPinStateContext, SidebarPinStateContextType, 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, 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, UserIdentity, WarningIcon, WarningPanel, WarningPanelClassKey, sidebarConfig, useContent, useQueryParamState, useSupportConfig };
1894
+ export { AlertDisplay, 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, 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, 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, SidebarContext, SidebarContextType, SidebarDivider, SidebarDividerClassKey, SidebarExpandButton, SidebarGroup, SidebarGroupProps, SidebarIntro, SidebarIntroClassKey, SidebarItem, SidebarItemClassKey, SidebarOptions, SidebarPage, SidebarPageClassKey, SidebarPageProps, SidebarPinStateContext, SidebarPinStateContextType, 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, useSupportConfig };
package/dist/index.esm.js CHANGED
@@ -2992,17 +2992,32 @@ const sidebarConfig = {
2992
2992
  userBadgeDiameter: drawerWidthClosed - userBadgePadding * 2,
2993
2993
  mobileSidebarHeight: 56
2994
2994
  };
2995
+ const makeSidebarConfig = (customSidebarConfig) => ({
2996
+ ...sidebarConfig,
2997
+ ...customSidebarConfig,
2998
+ iconContainerWidth: sidebarConfig.drawerWidthClosed,
2999
+ iconSize: sidebarConfig.drawerWidthClosed - sidebarConfig.iconPadding * 2,
3000
+ userBadgeDiameter: sidebarConfig.drawerWidthClosed - sidebarConfig.userBadgePadding * 2
3001
+ });
2995
3002
  const submenuConfig = {
2996
3003
  drawerWidthClosed: 0,
2997
3004
  drawerWidthOpen: 202,
2998
3005
  defaultOpenDelayMs: sidebarConfig.defaultOpenDelayMs + 200
2999
3006
  };
3007
+ const makeSidebarSubmenuConfig = (customSubmenuConfig) => ({
3008
+ ...submenuConfig,
3009
+ ...customSubmenuConfig
3010
+ });
3000
3011
  const SIDEBAR_INTRO_LOCAL_STORAGE = "@backstage/core/sidebar-intro-dismissed";
3001
3012
  const SidebarContext = createContext({
3002
3013
  isOpen: false,
3003
3014
  setOpen: () => {
3004
3015
  }
3005
3016
  });
3017
+ const SidebarConfigContext = createContext({
3018
+ sidebarConfig,
3019
+ submenuConfig
3020
+ });
3006
3021
  const SidebarItemWithSubmenuContext = createContext({
3007
3022
  isHoveredOn: false,
3008
3023
  setIsHoveredOn: () => {
@@ -3025,17 +3040,17 @@ const LocalStorage = {
3025
3040
  };
3026
3041
 
3027
3042
  const useStyles$o = makeStyles((theme) => ({
3028
- root: {
3043
+ root: (props) => ({
3029
3044
  width: "100%",
3030
3045
  transition: "padding-left 0.1s ease-out",
3031
3046
  isolation: "isolate",
3032
3047
  [theme.breakpoints.up("sm")]: {
3033
- paddingLeft: ({ isPinned }) => isPinned ? sidebarConfig.drawerWidthOpen : sidebarConfig.drawerWidthClosed
3048
+ paddingLeft: () => props.isPinned ? props.sidebarConfig.drawerWidthOpen : props.sidebarConfig.drawerWidthClosed
3034
3049
  },
3035
3050
  [theme.breakpoints.down("xs")]: {
3036
- paddingBottom: sidebarConfig.mobileSidebarHeight
3051
+ paddingBottom: props.sidebarConfig.mobileSidebarHeight
3037
3052
  }
3038
- },
3053
+ }),
3039
3054
  content: {
3040
3055
  zIndex: 0,
3041
3056
  isolation: "isolate",
@@ -3057,6 +3072,7 @@ const PageContext = createContext({
3057
3072
  });
3058
3073
  function SidebarPage(props) {
3059
3074
  const [isPinned, setIsPinned] = useState(() => LocalStorage.getSidebarPinState());
3075
+ const { sidebarConfig } = useContext(SidebarConfigContext);
3060
3076
  const contentRef = useRef(null);
3061
3077
  const pageContext = useMemo(() => ({
3062
3078
  content: {
@@ -3068,7 +3084,7 @@ function SidebarPage(props) {
3068
3084
  }, [isPinned]);
3069
3085
  const isMobile = useMediaQuery((theme) => theme.breakpoints.down("xs"), { noSsr: true });
3070
3086
  const toggleSidebarPinState = () => setIsPinned(!isPinned);
3071
- const classes = useStyles$o({ isPinned });
3087
+ const classes = useStyles$o({ isPinned, sidebarConfig });
3072
3088
  return /* @__PURE__ */ React.createElement(SidebarPinStateContext.Provider, {
3073
3089
  value: {
3074
3090
  isPinned,
@@ -3096,18 +3112,19 @@ const useStyles$n = makeStyles((theme) => ({
3096
3112
  margin: theme.spacing(0, 2),
3097
3113
  color: theme.palette.navigation.color
3098
3114
  },
3099
- selected: {
3115
+ selected: (props) => ({
3100
3116
  color: `${theme.palette.navigation.selectedColor}!important`,
3101
- borderTop: `solid ${sidebarConfig.selectedIndicatorWidth}px ${theme.palette.navigation.indicator}`,
3117
+ borderTop: `solid ${props.sidebarConfig.selectedIndicatorWidth}px ${theme.palette.navigation.indicator}`,
3102
3118
  marginTop: "-1px"
3103
- },
3119
+ }),
3104
3120
  label: {
3105
3121
  display: "none"
3106
3122
  }
3107
3123
  }));
3108
3124
  const MobileSidebarGroup = (props) => {
3109
3125
  const { to, label, icon, value } = props;
3110
- const classes = useStyles$n();
3126
+ const { sidebarConfig } = useContext(SidebarConfigContext);
3127
+ const classes = useStyles$n({ sidebarConfig });
3111
3128
  const location = useLocation();
3112
3129
  const { selectedMenuItemIndex, setSelectedMenuItemIndex } = useContext(MobileSidebarContext);
3113
3130
  const onChange = (_, value2) => {
@@ -3151,14 +3168,14 @@ const useStyles$m = makeStyles((theme) => ({
3151
3168
  zIndex: theme.zIndex.snackbar,
3152
3169
  borderTop: "1px solid #383838"
3153
3170
  },
3154
- overlay: {
3171
+ overlay: (props) => ({
3155
3172
  background: theme.palette.navigation.background,
3156
3173
  width: "100%",
3157
- bottom: `${sidebarConfig.mobileSidebarHeight}px`,
3158
- height: `calc(100% - ${sidebarConfig.mobileSidebarHeight}px)`,
3174
+ bottom: `${props.sidebarConfig.mobileSidebarHeight}px`,
3175
+ height: `calc(100% - ${props.sidebarConfig.mobileSidebarHeight}px)`,
3159
3176
  flex: "0 1 auto",
3160
3177
  overflow: "auto"
3161
- },
3178
+ }),
3162
3179
  overlayHeader: {
3163
3180
  display: "flex",
3164
3181
  color: theme.palette.bursts.fontColor,
@@ -3169,9 +3186,9 @@ const useStyles$m = makeStyles((theme) => ({
3169
3186
  overlayHeaderClose: {
3170
3187
  color: theme.palette.bursts.fontColor
3171
3188
  },
3172
- marginMobileSidebar: {
3173
- marginBottom: `${sidebarConfig.mobileSidebarHeight}px`
3174
- }
3189
+ marginMobileSidebar: (props) => ({
3190
+ marginBottom: `${props.sidebarConfig.mobileSidebarHeight}px`
3191
+ })
3175
3192
  }));
3176
3193
  const sortSidebarGroupsForPriority = (children) => orderBy(children, ({ props: { priority } }) => Number.isInteger(priority) ? priority : -1, "desc");
3177
3194
  const sidebarGroupType = React.createElement(SidebarGroup).type;
@@ -3181,7 +3198,8 @@ const OverlayMenu = ({
3181
3198
  open,
3182
3199
  onClose
3183
3200
  }) => {
3184
- const classes = useStyles$m();
3201
+ const { sidebarConfig } = useContext(SidebarConfigContext);
3202
+ const classes = useStyles$m({ sidebarConfig });
3185
3203
  return /* @__PURE__ */ React.createElement(Drawer, {
3186
3204
  anchor: "bottom",
3187
3205
  open,
@@ -3208,8 +3226,9 @@ const MobileSidebarContext = createContext({
3208
3226
  }
3209
3227
  });
3210
3228
  const MobileSidebar = (props) => {
3229
+ const { sidebarConfig } = useContext(SidebarConfigContext);
3211
3230
  const { children } = props;
3212
- const classes = useStyles$m();
3231
+ const classes = useStyles$m({ sidebarConfig });
3213
3232
  const location = useLocation$1();
3214
3233
  const [selectedMenuItemIndex, setSelectedMenuItemIndex] = useState(-1);
3215
3234
  useEffect(() => {
@@ -3243,7 +3262,7 @@ const MobileSidebar = (props) => {
3243
3262
  };
3244
3263
 
3245
3264
  const useStyles$l = makeStyles((theme) => ({
3246
- drawer: {
3265
+ drawer: (props) => ({
3247
3266
  display: "flex",
3248
3267
  flexFlow: "column nowrap",
3249
3268
  alignItems: "flex-start",
@@ -3256,7 +3275,7 @@ const useStyles$l = makeStyles((theme) => ({
3256
3275
  overflowX: "hidden",
3257
3276
  msOverflowStyle: "none",
3258
3277
  scrollbarWidth: "none",
3259
- width: sidebarConfig.drawerWidthClosed,
3278
+ width: props.sidebarConfig.drawerWidthClosed,
3260
3279
  transition: theme.transitions.create("width", {
3261
3280
  easing: theme.transitions.easing.sharp,
3262
3281
  duration: theme.transitions.duration.shortest
@@ -3267,14 +3286,14 @@ const useStyles$l = makeStyles((theme) => ({
3267
3286
  "&::-webkit-scrollbar": {
3268
3287
  display: "none"
3269
3288
  }
3270
- },
3271
- drawerOpen: {
3272
- width: sidebarConfig.drawerWidthOpen,
3289
+ }),
3290
+ drawerOpen: (props) => ({
3291
+ width: props.sidebarConfig.drawerWidthOpen,
3273
3292
  transition: theme.transitions.create("width", {
3274
3293
  easing: theme.transitions.easing.sharp,
3275
3294
  duration: theme.transitions.duration.shorter
3276
3295
  })
3277
- },
3296
+ }),
3278
3297
  visuallyHidden: {
3279
3298
  top: 0,
3280
3299
  position: "absolute",
@@ -3286,13 +3305,14 @@ const useStyles$l = makeStyles((theme) => ({
3286
3305
  }
3287
3306
  }), { name: "BackstageSidebar" });
3288
3307
  const DesktopSidebar = (props) => {
3308
+ const { sidebarConfig } = useContext(SidebarConfigContext);
3289
3309
  const {
3290
3310
  openDelayMs = sidebarConfig.defaultOpenDelayMs,
3291
3311
  closeDelayMs = sidebarConfig.defaultCloseDelayMs,
3292
3312
  disableExpandOnHover,
3293
3313
  children
3294
3314
  } = props;
3295
- const classes = useStyles$l();
3315
+ const classes = useStyles$l({ sidebarConfig });
3296
3316
  const isSmallScreen = useMediaQuery((theme) => theme.breakpoints.down("md"), { noSsr: true });
3297
3317
  const [state, setState] = useState(0 /* Closed */);
3298
3318
  const hoverTimerRef = useRef();
@@ -3343,10 +3363,7 @@ const DesktopSidebar = (props) => {
3343
3363
  return /* @__PURE__ */ React.createElement("div", {
3344
3364
  style: {}
3345
3365
  }, /* @__PURE__ */ React.createElement(A11ySkipSidebar, null), /* @__PURE__ */ React.createElement(SidebarContext.Provider, {
3346
- value: {
3347
- isOpen,
3348
- setOpen
3349
- }
3366
+ value: { isOpen, setOpen }
3350
3367
  }, /* @__PURE__ */ React.createElement("div", {
3351
3368
  className: classes.root,
3352
3369
  "data-testid": "sidebar-root",
@@ -3365,17 +3382,23 @@ const DesktopSidebar = (props) => {
3365
3382
  }, children))));
3366
3383
  };
3367
3384
  const Sidebar = (props) => {
3368
- const { children, openDelayMs, closeDelayMs, disableExpandOnHover } = props;
3385
+ var _a, _b;
3386
+ const sidebarConfig = makeSidebarConfig((_a = props.sidebarOptions) != null ? _a : {});
3387
+ const submenuConfig = makeSidebarSubmenuConfig((_b = props.submenuOptions) != null ? _b : {});
3388
+ const { children, disableExpandOnHover, openDelayMs, closeDelayMs } = props;
3369
3389
  const { isMobile } = useContext(SidebarPinStateContext);
3370
- return isMobile ? /* @__PURE__ */ React.createElement(MobileSidebar, null, children) : /* @__PURE__ */ React.createElement(DesktopSidebar, {
3390
+ return isMobile ? /* @__PURE__ */ React.createElement(MobileSidebar, null, children) : /* @__PURE__ */ React.createElement(SidebarConfigContext.Provider, {
3391
+ value: { sidebarConfig, submenuConfig }
3392
+ }, /* @__PURE__ */ React.createElement(DesktopSidebar, {
3371
3393
  openDelayMs,
3372
3394
  closeDelayMs,
3373
3395
  disableExpandOnHover
3374
- }, children);
3396
+ }, children));
3375
3397
  };
3376
3398
  function A11ySkipSidebar() {
3399
+ const { sidebarConfig } = useContext(SidebarConfigContext);
3377
3400
  const { focusContent, contentRef } = useContent();
3378
- const classes = useStyles$l();
3401
+ const classes = useStyles$l({ sidebarConfig });
3379
3402
  if (!(contentRef == null ? void 0 : contentRef.current)) {
3380
3403
  return null;
3381
3404
  }
@@ -3512,16 +3535,16 @@ const SidebarSubmenuItem = (props) => {
3512
3535
  }, title)));
3513
3536
  };
3514
3537
 
3515
- const useStyles$j = (props) => makeStyles((theme) => {
3516
- var _a, _b;
3517
- return {
3518
- root: {
3519
- zIndex: 1e3,
3520
- position: "relative",
3521
- overflow: "visible",
3522
- width: theme.spacing(7) + 1
3523
- },
3524
- drawer: {
3538
+ const useStyles$j = makeStyles((theme) => ({
3539
+ root: {
3540
+ zIndex: 1e3,
3541
+ position: "relative",
3542
+ overflow: "visible",
3543
+ width: theme.spacing(7) + 1
3544
+ },
3545
+ drawer: (props) => {
3546
+ var _a, _b;
3547
+ return {
3525
3548
  display: "flex",
3526
3549
  flexFlow: "column nowrap",
3527
3550
  alignItems: "flex-start",
@@ -3541,40 +3564,41 @@ const useStyles$j = (props) => makeStyles((theme) => {
3541
3564
  msOverflowStyle: "none",
3542
3565
  scrollbarWidth: "none",
3543
3566
  cursor: "default",
3544
- width: submenuConfig.drawerWidthClosed,
3545
- transitionDelay: `${submenuConfig.defaultOpenDelayMs}ms`,
3567
+ width: props.submenuConfig.drawerWidthClosed,
3568
+ transitionDelay: `${props.submenuConfig.defaultOpenDelayMs}ms`,
3546
3569
  "& > *": {
3547
3570
  flexShrink: 0
3548
3571
  },
3549
3572
  "&::-webkit-scrollbar": {
3550
3573
  display: "none"
3551
3574
  }
3552
- },
3553
- drawerOpen: {
3554
- width: submenuConfig.drawerWidthOpen,
3555
- [theme.breakpoints.down("xs")]: {
3556
- width: "100%",
3557
- position: "relative",
3558
- paddingLeft: theme.spacing(3),
3559
- left: 0,
3560
- top: 0
3561
- }
3562
- },
3563
- title: {
3564
- fontSize: 24,
3565
- fontWeight: 500,
3566
- color: "#FFF",
3567
- padding: 20,
3568
- [theme.breakpoints.down("xs")]: {
3569
- display: "none"
3570
- }
3575
+ };
3576
+ },
3577
+ drawerOpen: (props) => ({
3578
+ width: props.submenuConfig.drawerWidthOpen,
3579
+ [theme.breakpoints.down("xs")]: {
3580
+ width: "100%",
3581
+ position: "relative",
3582
+ paddingLeft: theme.spacing(3),
3583
+ left: 0,
3584
+ top: 0
3571
3585
  }
3572
- };
3573
- }, { name: "BackstageSidebarSubmenu" });
3586
+ }),
3587
+ title: {
3588
+ fontSize: 24,
3589
+ fontWeight: 500,
3590
+ color: "#FFF",
3591
+ padding: 20,
3592
+ [theme.breakpoints.down("xs")]: {
3593
+ display: "none"
3594
+ }
3595
+ }
3596
+ }), { name: "BackstageSidebarSubmenu" });
3574
3597
  const SidebarSubmenu = (props) => {
3575
3598
  const { isOpen } = useContext(SidebarContext);
3599
+ const { sidebarConfig, submenuConfig } = useContext(SidebarConfigContext);
3576
3600
  const left = isOpen ? sidebarConfig.drawerWidthOpen : sidebarConfig.drawerWidthClosed;
3577
- const classes = useStyles$j({ left })();
3601
+ const classes = useStyles$j({ left, submenuConfig });
3578
3602
  const { isHoveredOn } = useContext(SidebarItemWithSubmenuContext);
3579
3603
  const [isSubmenuOpen, setIsSubmenuOpen] = useState(false);
3580
3604
  useEffect(() => {
@@ -3640,12 +3664,6 @@ const DoubleArrowRight = () => {
3640
3664
 
3641
3665
  const useStyles$g = makeStyles((theme) => {
3642
3666
  var _a, _b, _c, _d;
3643
- const {
3644
- selectedIndicatorWidth,
3645
- drawerWidthClosed,
3646
- drawerWidthOpen,
3647
- iconContainerWidth
3648
- } = sidebarConfig;
3649
3667
  return {
3650
3668
  root: {
3651
3669
  color: theme.palette.navigation.color,
@@ -3664,15 +3682,15 @@ const useStyles$g = makeStyles((theme) => {
3664
3682
  textAlign: "inherit",
3665
3683
  font: "inherit"
3666
3684
  },
3667
- closed: {
3668
- width: drawerWidthClosed,
3685
+ closed: (props) => ({
3686
+ width: props.sidebarConfig.drawerWidthClosed,
3669
3687
  justifyContent: "center"
3670
- },
3671
- open: {
3688
+ }),
3689
+ open: (props) => ({
3672
3690
  [theme.breakpoints.up("sm")]: {
3673
- width: drawerWidthOpen
3691
+ width: props.sidebarConfig.drawerWidthOpen
3674
3692
  }
3675
- },
3693
+ }),
3676
3694
  highlightable: {
3677
3695
  "&:hover": {
3678
3696
  background: (_b = (_a = theme.palette.navigation.navItem) == null ? void 0 : _a.hoverBackground) != null ? _b : "#404040"
@@ -3690,15 +3708,15 @@ const useStyles$g = makeStyles((theme) => {
3690
3708
  overflow: "hidden",
3691
3709
  "text-overflow": "ellipsis"
3692
3710
  },
3693
- iconContainer: {
3711
+ iconContainer: (props) => ({
3694
3712
  boxSizing: "border-box",
3695
3713
  height: "100%",
3696
- width: iconContainerWidth,
3714
+ width: props.sidebarConfig.iconContainerWidth,
3697
3715
  marginRight: -theme.spacing(2),
3698
3716
  display: "flex",
3699
3717
  alignItems: "center",
3700
3718
  justifyContent: "center"
3701
- },
3719
+ }),
3702
3720
  searchRoot: {
3703
3721
  marginBottom: 12
3704
3722
  },
@@ -3710,9 +3728,9 @@ const useStyles$g = makeStyles((theme) => {
3710
3728
  searchFieldHTMLInput: {
3711
3729
  padding: theme.spacing(2, 0, 2)
3712
3730
  },
3713
- searchContainer: {
3714
- width: drawerWidthOpen - iconContainerWidth
3715
- },
3731
+ searchContainer: (props) => ({
3732
+ width: props.sidebarConfig.drawerWidthOpen - props.sidebarConfig.iconContainerWidth
3733
+ }),
3716
3734
  secondaryAction: {
3717
3735
  width: theme.spacing(6),
3718
3736
  textAlign: "center",
@@ -3738,21 +3756,21 @@ const useStyles$g = makeStyles((theme) => {
3738
3756
  position: "absolute",
3739
3757
  right: 10
3740
3758
  },
3741
- selected: {
3759
+ selected: (props) => ({
3742
3760
  "&$root": {
3743
- borderLeft: `solid ${selectedIndicatorWidth}px ${theme.palette.navigation.indicator}`,
3761
+ borderLeft: `solid ${props.sidebarConfig.selectedIndicatorWidth}px ${theme.palette.navigation.indicator}`,
3744
3762
  color: theme.palette.navigation.selectedColor
3745
3763
  },
3746
3764
  "&$closed": {
3747
- width: drawerWidthClosed
3765
+ width: props.sidebarConfig.drawerWidthClosed
3748
3766
  },
3749
3767
  "& $closedItemIcon": {
3750
- paddingRight: selectedIndicatorWidth
3768
+ paddingRight: props.sidebarConfig.selectedIndicatorWidth
3751
3769
  },
3752
3770
  "& $iconContainer": {
3753
- marginLeft: -selectedIndicatorWidth
3771
+ marginLeft: -props.sidebarConfig.selectedIndicatorWidth
3754
3772
  }
3755
- }
3773
+ })
3756
3774
  };
3757
3775
  }, { name: "BackstageSidebarItem" });
3758
3776
  const useLocationMatch = (submenu, location) => useElementFilter(submenu.props.children, (elements) => {
@@ -3821,7 +3839,8 @@ const SidebarItemBase = forwardRef((props, ref) => {
3821
3839
  className,
3822
3840
  ...navLinkProps
3823
3841
  } = props;
3824
- const classes = useStyles$g();
3842
+ const { sidebarConfig } = useContext(SidebarConfigContext);
3843
+ const classes = useStyles$g({ sidebarConfig });
3825
3844
  const { isOpen } = useContext(SidebarContext);
3826
3845
  const itemIcon = /* @__PURE__ */ React.createElement(Badge, {
3827
3846
  color: "secondary",
@@ -3866,7 +3885,8 @@ const SidebarItemWithSubmenu = ({
3866
3885
  children,
3867
3886
  ...props
3868
3887
  }) => {
3869
- const classes = useStyles$g();
3888
+ const { sidebarConfig } = useContext(SidebarConfigContext);
3889
+ const classes = useStyles$g({ sidebarConfig });
3870
3890
  const [isHoveredOn, setIsHoveredOn] = useState(false);
3871
3891
  const location = useLocation();
3872
3892
  const isActive = useLocationMatch(children, location);
@@ -3921,8 +3941,9 @@ const SidebarItem = forwardRef((props, ref) => {
3921
3941
  });
3922
3942
  });
3923
3943
  function SidebarSearchField(props) {
3944
+ const { sidebarConfig } = useContext(SidebarConfigContext);
3924
3945
  const [input, setInput] = useState("");
3925
- const classes = useStyles$g();
3946
+ const classes = useStyles$g({ sidebarConfig });
3926
3947
  const Icon = props.icon ? props.icon : SearchIcon;
3927
3948
  const search = () => {
3928
3949
  props.onSearch(input);
@@ -4006,7 +4027,8 @@ const SidebarScrollWrapper = styled("div")(({ theme }) => {
4006
4027
  };
4007
4028
  });
4008
4029
  const SidebarExpandButton = () => {
4009
- const classes = useStyles$g();
4030
+ const { sidebarConfig } = useContext(SidebarConfigContext);
4031
+ const classes = useStyles$g({ sidebarConfig });
4010
4032
  const { isOpen, setOpen } = useContext(SidebarContext);
4011
4033
  const isSmallScreen = useMediaQuery((theme) => theme.breakpoints.down("md"), { noSsr: true });
4012
4034
  if (isSmallScreen) {
@@ -4026,15 +4048,15 @@ const SidebarExpandButton = () => {
4026
4048
  };
4027
4049
 
4028
4050
  const useStyles$f = makeStyles((theme) => ({
4029
- introCard: {
4051
+ introCard: (props) => ({
4030
4052
  color: "#b5b5b5",
4031
4053
  fontSize: 12,
4032
- width: sidebarConfig.drawerWidthOpen,
4054
+ width: props.sidebarConfig.drawerWidthOpen,
4033
4055
  marginTop: 18,
4034
4056
  marginBottom: 12,
4035
- paddingLeft: sidebarConfig.iconPadding,
4036
- paddingRight: sidebarConfig.iconPadding
4037
- },
4057
+ paddingLeft: props.sidebarConfig.iconPadding,
4058
+ paddingRight: props.sidebarConfig.iconPadding
4059
+ }),
4038
4060
  introDismiss: {
4039
4061
  display: "flex",
4040
4062
  justifyContent: "flex-end",
@@ -4067,7 +4089,8 @@ const useStyles$f = makeStyles((theme) => ({
4067
4089
  }
4068
4090
  }), { name: "BackstageSidebarIntro" });
4069
4091
  function IntroCard(props) {
4070
- const classes = useStyles$f();
4092
+ const { sidebarConfig } = useContext(SidebarConfigContext);
4093
+ const classes = useStyles$f({ sidebarConfig });
4071
4094
  const { text, onClose } = props;
4072
4095
  const handleClose = () => onClose();
4073
4096
  return /* @__PURE__ */ React.createElement("div", {
@@ -4814,12 +4837,12 @@ const useStyles$b = makeStyles((theme) => ({
4814
4837
  color: theme.palette.textSubtle
4815
4838
  }
4816
4839
  }
4817
- }));
4840
+ }), { name: "BackstageTab" });
4818
4841
  const StyledTab = (props) => {
4819
4842
  const classes = useStyles$b(props);
4820
4843
  const { isFirstNav, isFirstIndex, ...rest } = props;
4821
4844
  return /* @__PURE__ */ React.createElement(Tab, {
4822
- className: classes.root,
4845
+ classes,
4823
4846
  disableRipple: true,
4824
4847
  ...rest
4825
4848
  });