@backstage/core-components 0.9.4 → 0.9.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,36 @@
1
1
  # @backstage/core-components
2
2
 
3
+ ## 0.9.5-next.2
4
+
5
+ ### Patch Changes
6
+
7
+ - ee2cd642c5: Updated dependency `rc-progress` to `3.3.3`.
8
+ - 1cf9caecd6: fix Sidebar Contexts deprecation message
9
+
10
+ ## 0.9.5-next.1
11
+
12
+ ### Patch Changes
13
+
14
+ - feb4e8de07: Fix EntityPage tab scrolling overflow bug on Firefox
15
+ - 8f7b1835df: Updated dependency `msw` to `^0.41.0`.
16
+ - bff65e6958: The `SidebarPinStateContext` and `SidebarContext` have been deprecated and will be removed in a future release. Instead, use `<SidebarPinStateProvider>` + `useSidebarPinState()` and/or `<SidebarOpenStateProvider>` + `useSidebarOpenState()`.
17
+
18
+ This was done to ensure that sidebar state can be shared successfully across components exported by different packages, regardless of what version of this package is resolved and installed for each individual package.
19
+
20
+ - Updated dependencies
21
+ - @backstage/core-plugin-api@1.0.3-next.0
22
+
23
+ ## 0.9.5-next.0
24
+
25
+ ### Patch Changes
26
+
27
+ - 65840b17be: Fix issue where right arrow icon was incorrectly added to side bar items without a sub-menu
28
+ - 6968b65ba1: Updated dependency `@react-hookz/web` to `^14.0.0`.
29
+ - 96d1e01641: Accessibility updates:
30
+
31
+ - Added `aria-label` to the `Select` component
32
+ - Changed heading level used in the header of `Table` component
33
+
3
34
  ## 0.9.4
4
35
 
5
36
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1421,17 +1421,6 @@ declare const sidebarConfig: {
1421
1421
  mobileSidebarHeight: number;
1422
1422
  };
1423
1423
  declare const SIDEBAR_INTRO_LOCAL_STORAGE = "@backstage/core/sidebar-intro-dismissed";
1424
- /**
1425
- * Types for the `SidebarContext`
1426
- */
1427
- declare type SidebarContextType = {
1428
- isOpen: boolean;
1429
- setOpen: (open: boolean) => void;
1430
- };
1431
- /**
1432
- * Context whether the `Sidebar` is open
1433
- */
1434
- declare const SidebarContext: React.Context<SidebarContextType>;
1435
1424
 
1436
1425
  /** @public */
1437
1426
  declare type SidebarClassKey = 'drawer' | 'drawerOpen';
@@ -1552,16 +1541,6 @@ declare type SidebarSubmenuProps = {
1552
1541
  declare const SidebarSubmenu: (props: SidebarSubmenuProps) => JSX.Element;
1553
1542
 
1554
1543
  declare type SidebarPageClassKey = 'root';
1555
- /**
1556
- * Type of `SidebarPinStateContext`
1557
- *
1558
- * @public
1559
- */
1560
- declare type SidebarPinStateContextType = {
1561
- isPinned: boolean;
1562
- toggleSidebarPinState: () => any;
1563
- isMobile?: boolean;
1564
- };
1565
1544
  /**
1566
1545
  * Props for SidebarPage
1567
1546
  *
@@ -1570,12 +1549,6 @@ declare type SidebarPinStateContextType = {
1570
1549
  declare type SidebarPageProps = {
1571
1550
  children?: React__default.ReactNode;
1572
1551
  };
1573
- /**
1574
- * Contains the state on how the `Sidebar` is rendered
1575
- *
1576
- * @public
1577
- */
1578
- declare const SidebarPinStateContext: React__default.Context<SidebarPinStateContextType>;
1579
1552
  declare function SidebarPage(props: SidebarPageProps): JSX.Element;
1580
1553
  /**
1581
1554
  * This hook provides a react ref to the main content.
@@ -1612,6 +1585,7 @@ declare type SidebarItemBaseProps = {
1612
1585
  icon: IconComponent;
1613
1586
  text?: string;
1614
1587
  hasNotifications?: boolean;
1588
+ hasSubmenu?: boolean;
1615
1589
  disableHighlight?: boolean;
1616
1590
  className?: string;
1617
1591
  };
@@ -1678,6 +1652,114 @@ declare type IntroCardProps = {
1678
1652
  declare function IntroCard(props: IntroCardProps): JSX.Element;
1679
1653
  declare function SidebarIntro(_props: {}): JSX.Element | null;
1680
1654
 
1655
+ /**
1656
+ * Types for the `SidebarContext`
1657
+ *
1658
+ * @public @deprecated
1659
+ * Use `SidebarOpenState` instead.
1660
+ */
1661
+ declare type SidebarContextType = {
1662
+ isOpen: boolean;
1663
+ setOpen: (open: boolean) => void;
1664
+ };
1665
+ /**
1666
+ * The open state of the sidebar.
1667
+ *
1668
+ * @public
1669
+ */
1670
+ declare type SidebarOpenState = {
1671
+ /**
1672
+ * Whether or not the sidebar is open and full-width. When `false`, the
1673
+ * sidebar is "closed" and typically only shows icons with no text.
1674
+ */
1675
+ isOpen: boolean;
1676
+ /**
1677
+ * A function to set whether or not the sidebar is open. Pass `true` to open
1678
+ * the sidebar. Pass `false` to close it.
1679
+ */
1680
+ setOpen: (open: boolean) => void;
1681
+ };
1682
+ /**
1683
+ * Context whether the `Sidebar` is open
1684
+ *
1685
+ * @public @deprecated
1686
+ * Use `<SidebarOpenStateProvider>` + `useSidebarOpenState()` instead.
1687
+ */
1688
+ declare const LegacySidebarContext: React__default.Context<SidebarContextType>;
1689
+ /**
1690
+ * Provides context for reading and updating sidebar state.
1691
+ *
1692
+ * @public
1693
+ */
1694
+ declare const SidebarOpenStateProvider: ({ children, value, }: {
1695
+ children: ReactNode;
1696
+ value: SidebarOpenState;
1697
+ }) => JSX.Element;
1698
+ /**
1699
+ * Hook to read and update the sidebar's open state, which controls whether or
1700
+ * not the sidebar is open and full-width, or closed and only displaying icons.
1701
+ *
1702
+ * @public
1703
+ */
1704
+ declare const useSidebarOpenState: () => SidebarOpenState;
1705
+
1706
+ /**
1707
+ * Type of `SidebarPinStateContext`
1708
+ *
1709
+ * @public @deprecated
1710
+ * Use `SidebarPinState` instead.
1711
+ */
1712
+ declare type SidebarPinStateContextType = {
1713
+ isPinned: boolean;
1714
+ toggleSidebarPinState: () => any;
1715
+ isMobile?: boolean;
1716
+ };
1717
+ /**
1718
+ * The pin state of the sidebar.
1719
+ *
1720
+ * @public
1721
+ */
1722
+ declare type SidebarPinState = {
1723
+ /**
1724
+ * Whether or not the sidebar is pinned to the `open` state. When `isPinned`
1725
+ * is `false`, the sidebar opens and closes on hover. When `true`, the
1726
+ * sidebar is permanently opened, regardless of user interaction.
1727
+ */
1728
+ isPinned: boolean;
1729
+ /**
1730
+ * A function to toggle the pin state of the sidebar.
1731
+ */
1732
+ toggleSidebarPinState: () => any;
1733
+ /**
1734
+ * Whether or not the sidebar is or should be rendered in a mobile-optimized
1735
+ * way.
1736
+ */
1737
+ isMobile?: boolean;
1738
+ };
1739
+ /**
1740
+ * Contains the state on how the `Sidebar` is rendered
1741
+ *
1742
+ * @public @deprecated
1743
+ * Use `<SidebarPinStateContextProvider>` + `useSidebarPinState()` instead.
1744
+ */
1745
+ declare const LegacySidebarPinStateContext: React__default.Context<SidebarPinStateContextType>;
1746
+ /**
1747
+ * Provides state for how the `Sidebar` is rendered
1748
+ *
1749
+ * @public
1750
+ */
1751
+ declare const SidebarPinStateProvider: ({ children, value, }: {
1752
+ children: ReactNode;
1753
+ value: SidebarPinStateContextType;
1754
+ }) => JSX.Element;
1755
+ /**
1756
+ * Hook to read and update sidebar pin state, which controls whether or not the
1757
+ * sidebar is pinned open.
1758
+ *
1759
+ * @public
1760
+ */
1761
+ declare const useSidebarPinState: () => SidebarPinState;
1762
+
1681
1763
  declare type SignInProviderConfig = {
1682
1764
  id: string;
1683
1765
  title: string;
@@ -1900,4 +1982,4 @@ declare type BackstageOverrides = Overrides & {
1900
1982
  [Name in keyof BackstageComponentsNameToClassKey]?: Partial<StyleRules<BackstageComponentsNameToClassKey[Name]>>;
1901
1983
  };
1902
1984
 
1903
- 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, HeaderClassKey, HeaderIconLinkRow, HeaderIconLinkRowClassKey, HeaderLabel, HeaderLabelClassKey, HeaderTabs, HeaderTabsClassKey, HelpIcon, HomepageTimer, 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, 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 };
1985
+ 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, HeaderClassKey, HeaderIconLinkRow, HeaderIconLinkRowClassKey, HeaderLabel, HeaderLabelClassKey, HeaderTabs, HeaderTabsClassKey, HelpIcon, HomepageTimer, 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 };
package/dist/index.esm.js CHANGED
@@ -91,6 +91,7 @@ import qs from 'qs';
91
91
  import MuiBrokenImageIcon from '@material-ui/icons/BrokenImage';
92
92
  import { Helmet } from 'react-helmet';
93
93
  import { useLocation as useLocation$1, useNavigate, useParams, useRoutes, matchRoutes } from 'react-router';
94
+ import { createVersionedContext, createVersionedValueMap } from '@backstage/version-bridge';
94
95
  import BottomNavigation from '@material-ui/core/BottomNavigation';
95
96
  import Drawer from '@material-ui/core/Drawer';
96
97
  import MenuIcon from '@material-ui/icons/Menu';
@@ -2360,6 +2361,7 @@ function SelectComponent(props) {
2360
2361
  }, /* @__PURE__ */ React.createElement(InputLabel, {
2361
2362
  className: classes.formLabel
2362
2363
  }, label), /* @__PURE__ */ React.createElement(Select, {
2364
+ "aria-label": label,
2363
2365
  value,
2364
2366
  native,
2365
2367
  disabled,
@@ -3054,11 +3056,6 @@ const makeSidebarSubmenuConfig = (customSubmenuConfig) => ({
3054
3056
  ...customSubmenuConfig
3055
3057
  });
3056
3058
  const SIDEBAR_INTRO_LOCAL_STORAGE = "@backstage/core/sidebar-intro-dismissed";
3057
- const SidebarContext = createContext({
3058
- isOpen: false,
3059
- setOpen: () => {
3060
- }
3061
- });
3062
3059
  const SidebarConfigContext = createContext({
3063
3060
  sidebarConfig,
3064
3061
  submenuConfig
@@ -3084,6 +3081,35 @@ const LocalStorage = {
3084
3081
  }
3085
3082
  };
3086
3083
 
3084
+ const defaultSidebarPinStateContext = {
3085
+ isPinned: true,
3086
+ toggleSidebarPinState: () => {
3087
+ },
3088
+ isMobile: false
3089
+ };
3090
+ const LegacySidebarPinStateContext = createContext(defaultSidebarPinStateContext);
3091
+ const VersionedSidebarPinStateContext = createVersionedContext("sidebar-pin-state-context");
3092
+ const SidebarPinStateProvider = ({
3093
+ children,
3094
+ value
3095
+ }) => /* @__PURE__ */ React.createElement(LegacySidebarPinStateContext.Provider, {
3096
+ value
3097
+ }, /* @__PURE__ */ React.createElement(VersionedSidebarPinStateContext.Provider, {
3098
+ value: createVersionedValueMap({ 1: value })
3099
+ }, children));
3100
+ const useSidebarPinState = () => {
3101
+ const versionedPinStateContext = useContext(VersionedSidebarPinStateContext);
3102
+ const legacyPinStateContext = useContext(LegacySidebarPinStateContext);
3103
+ if (versionedPinStateContext === void 0) {
3104
+ return legacyPinStateContext || defaultSidebarPinStateContext;
3105
+ }
3106
+ const pinStateContext = versionedPinStateContext.atVersion(1);
3107
+ if (pinStateContext === void 0) {
3108
+ throw new Error("No context found for version 1.");
3109
+ }
3110
+ return pinStateContext;
3111
+ };
3112
+
3087
3113
  const useStyles$n = makeStyles((theme) => ({
3088
3114
  root: {
3089
3115
  width: "100%",
@@ -3104,12 +3130,6 @@ const useStyles$n = makeStyles((theme) => ({
3104
3130
  }
3105
3131
  }
3106
3132
  }), { name: "BackstageSidebarPage" });
3107
- const SidebarPinStateContext = createContext({
3108
- isPinned: true,
3109
- toggleSidebarPinState: () => {
3110
- },
3111
- isMobile: false
3112
- });
3113
3133
  const PageContext = createContext({
3114
3134
  content: {
3115
3135
  contentRef: void 0
@@ -3130,7 +3150,7 @@ function SidebarPage(props) {
3130
3150
  const isMobile = useMediaQuery((theme) => theme.breakpoints.down("xs"), { noSsr: true });
3131
3151
  const toggleSidebarPinState = () => setIsPinned(!isPinned);
3132
3152
  const classes = useStyles$n({ isPinned, sidebarConfig });
3133
- return /* @__PURE__ */ React.createElement(SidebarPinStateContext.Provider, {
3153
+ return /* @__PURE__ */ React.createElement(SidebarPinStateProvider, {
3134
3154
  value: {
3135
3155
  isPinned,
3136
3156
  toggleSidebarPinState,
@@ -3151,6 +3171,34 @@ function useContent() {
3151
3171
  return { focusContent, contentRef: content == null ? void 0 : content.contentRef };
3152
3172
  }
3153
3173
 
3174
+ const defaultSidebarOpenStateContext = {
3175
+ isOpen: false,
3176
+ setOpen: () => {
3177
+ }
3178
+ };
3179
+ const LegacySidebarContext = createContext(defaultSidebarOpenStateContext);
3180
+ const VersionedSidebarContext = createVersionedContext("sidebar-open-state-context");
3181
+ const SidebarOpenStateProvider = ({
3182
+ children,
3183
+ value
3184
+ }) => /* @__PURE__ */ React.createElement(LegacySidebarContext.Provider, {
3185
+ value
3186
+ }, /* @__PURE__ */ React.createElement(VersionedSidebarContext.Provider, {
3187
+ value: createVersionedValueMap({ 1: value })
3188
+ }, children));
3189
+ const useSidebarOpenState = () => {
3190
+ const versionedOpenStateContext = useContext(VersionedSidebarContext);
3191
+ const legacyOpenStateContext = useContext(LegacySidebarContext);
3192
+ if (versionedOpenStateContext === void 0) {
3193
+ return legacyOpenStateContext || defaultSidebarOpenStateContext;
3194
+ }
3195
+ const openStateContext = versionedOpenStateContext.atVersion(1);
3196
+ if (openStateContext === void 0) {
3197
+ throw new Error("No context found for version 1.");
3198
+ }
3199
+ return openStateContext;
3200
+ };
3201
+
3154
3202
  const useStyles$m = makeStyles((theme) => ({
3155
3203
  root: {
3156
3204
  flexGrow: 0,
@@ -3193,7 +3241,7 @@ const MobileSidebarGroup = (props) => {
3193
3241
  };
3194
3242
  const SidebarGroup = (props) => {
3195
3243
  const { children, to, label, icon, value } = props;
3196
- const { isMobile } = useContext(SidebarPinStateContext);
3244
+ const { isMobile } = useSidebarPinState();
3197
3245
  return isMobile ? /* @__PURE__ */ React.createElement(MobileSidebarGroup, {
3198
3246
  to,
3199
3247
  label,
@@ -3293,7 +3341,7 @@ const MobileSidebar = (props) => {
3293
3341
  sidebarGroups = sortSidebarGroupsForPriority(sidebarGroups);
3294
3342
  }
3295
3343
  const shouldShowGroupChildren = selectedMenuItemIndex >= 0 && !sidebarGroups[selectedMenuItemIndex].props.to;
3296
- return /* @__PURE__ */ React.createElement(SidebarContext.Provider, {
3344
+ return /* @__PURE__ */ React.createElement(SidebarOpenStateProvider, {
3297
3345
  value: { isOpen: true, setOpen: () => {
3298
3346
  } }
3299
3347
  }, /* @__PURE__ */ React.createElement(MobileSidebarContext.Provider, {
@@ -3364,7 +3412,7 @@ const DesktopSidebar = (props) => {
3364
3412
  const isSmallScreen = useMediaQuery((theme) => theme.breakpoints.down("md"), { noSsr: true });
3365
3413
  const [state, setState] = useState(0 /* Closed */);
3366
3414
  const hoverTimerRef = useRef();
3367
- const { isPinned, toggleSidebarPinState } = useContext(SidebarPinStateContext);
3415
+ const { isPinned, toggleSidebarPinState } = useSidebarPinState();
3368
3416
  const handleOpen = () => {
3369
3417
  if (isPinned || disableExpandOnHover) {
3370
3418
  return;
@@ -3411,7 +3459,7 @@ const DesktopSidebar = (props) => {
3411
3459
  return /* @__PURE__ */ React.createElement("nav", {
3412
3460
  style: {},
3413
3461
  "aria-label": "sidebar nav"
3414
- }, /* @__PURE__ */ React.createElement(A11ySkipSidebar, null), /* @__PURE__ */ React.createElement(SidebarContext.Provider, {
3462
+ }, /* @__PURE__ */ React.createElement(A11ySkipSidebar, null), /* @__PURE__ */ React.createElement(SidebarOpenStateProvider, {
3415
3463
  value: { isOpen, setOpen }
3416
3464
  }, /* @__PURE__ */ React.createElement("div", {
3417
3465
  className: classes.root,
@@ -3435,7 +3483,7 @@ const Sidebar = (props) => {
3435
3483
  const sidebarConfig = makeSidebarConfig((_a = props.sidebarOptions) != null ? _a : {});
3436
3484
  const submenuConfig = makeSidebarSubmenuConfig((_b = props.submenuOptions) != null ? _b : {});
3437
3485
  const { children, disableExpandOnHover, openDelayMs, closeDelayMs } = props;
3438
- const { isMobile } = useContext(SidebarPinStateContext);
3486
+ const { isMobile } = useSidebarPinState();
3439
3487
  return isMobile ? /* @__PURE__ */ React.createElement(MobileSidebar, null, children) : /* @__PURE__ */ React.createElement(SidebarConfigContext.Provider, {
3440
3488
  value: { sidebarConfig, submenuConfig }
3441
3489
  }, /* @__PURE__ */ React.createElement(DesktopSidebar, {
@@ -3662,7 +3710,7 @@ const useStyles$i = makeStyles((theme) => ({
3662
3710
  }
3663
3711
  }), { name: "BackstageSidebarSubmenu" });
3664
3712
  const SidebarSubmenu = (props) => {
3665
- const { isOpen } = useContext(SidebarContext);
3713
+ const { isOpen } = useSidebarOpenState();
3666
3714
  const { sidebarConfig, submenuConfig } = useContext(SidebarConfigContext);
3667
3715
  const left = isOpen ? sidebarConfig.drawerWidthOpen : sidebarConfig.drawerWidthClosed;
3668
3716
  const classes = useStyles$i({ left, submenuConfig });
@@ -3904,6 +3952,7 @@ const SidebarItemBase = forwardRef((props, ref) => {
3904
3952
  icon: Icon,
3905
3953
  text,
3906
3954
  hasNotifications = false,
3955
+ hasSubmenu = false,
3907
3956
  disableHighlight = false,
3908
3957
  onClick,
3909
3958
  children,
@@ -3912,13 +3961,13 @@ const SidebarItemBase = forwardRef((props, ref) => {
3912
3961
  } = props;
3913
3962
  const { sidebarConfig } = useContext(SidebarConfigContext);
3914
3963
  const classes = useMemoStyles(sidebarConfig);
3915
- const { isOpen } = useContext(SidebarContext);
3916
- const divStyle = !isOpen && children ? { display: "flex", marginLeft: "24px" } : {};
3964
+ const { isOpen } = useSidebarOpenState();
3965
+ const divStyle = !isOpen && hasSubmenu ? { display: "flex", marginLeft: "24px" } : {};
3917
3966
  const displayItemIcon = /* @__PURE__ */ React.createElement("div", {
3918
3967
  style: divStyle
3919
3968
  }, /* @__PURE__ */ React.createElement(Icon, {
3920
3969
  fontSize: "small"
3921
- }), !isOpen && children ? /* @__PURE__ */ React.createElement(ArrowRightIcon, null) : /* @__PURE__ */ React.createElement(React.Fragment, null));
3970
+ }), !isOpen && hasSubmenu ? /* @__PURE__ */ React.createElement(ArrowRightIcon, null) : /* @__PURE__ */ React.createElement(React.Fragment, null));
3922
3971
  const itemIcon = /* @__PURE__ */ React.createElement(Badge, {
3923
3972
  color: "secondary",
3924
3973
  variant: "dot",
@@ -3999,6 +4048,7 @@ const SidebarItemWithSubmenu = ({
3999
4048
  onMouseEnter: handleMouseEnter,
4000
4049
  className: classNames(isHoveredOn && classes.highlighted)
4001
4050
  }, /* @__PURE__ */ React.createElement(SidebarItemBase, {
4051
+ hasSubmenu: true,
4002
4052
  className: isActive ? classes.selected : "",
4003
4053
  ...props
4004
4054
  }, arrowIcon()), isHoveredOn && children));
@@ -4104,7 +4154,7 @@ const SidebarScrollWrapper = styled("div")(({ theme }) => {
4104
4154
  const SidebarExpandButton = () => {
4105
4155
  const { sidebarConfig } = useContext(SidebarConfigContext);
4106
4156
  const classes = useMemoStyles(sidebarConfig);
4107
- const { isOpen, setOpen } = useContext(SidebarContext);
4157
+ const { isOpen, setOpen } = useSidebarOpenState();
4108
4158
  const isSmallScreen = useMediaQuery((theme) => theme.breakpoints.down("md"), { noSsr: true });
4109
4159
  if (isSmallScreen) {
4110
4160
  return null;
@@ -4204,7 +4254,7 @@ const starredIntroText = `Fun fact! As you explore all the awesome plugins in Ba
4204
4254
  Keep an eye out for the little star icon (\u2B50) next to the plugin name and give it a click!`;
4205
4255
  const recentlyViewedIntroText = "And your recently viewed plugins will pop up here!";
4206
4256
  function SidebarIntro(_props) {
4207
- const { isOpen } = useContext(SidebarContext);
4257
+ const { isOpen } = useSidebarOpenState();
4208
4258
  const defaultValue = {
4209
4259
  starredItemsDismissed: false,
4210
4260
  recentlyViewedItemsDismissed: false
@@ -4278,7 +4328,8 @@ const useStyles$d = makeStyles((theme) => ({
4278
4328
  tabsWrapper: {
4279
4329
  gridArea: "pageSubheader",
4280
4330
  backgroundColor: theme.palette.background.paper,
4281
- paddingLeft: theme.spacing(3)
4331
+ paddingLeft: theme.spacing(3),
4332
+ minWidth: 0
4282
4333
  },
4283
4334
  defaultTab: {
4284
4335
  padding: theme.spacing(3, 3),
@@ -4823,7 +4874,7 @@ function Table(props) {
4823
4874
  icons: tableIcons,
4824
4875
  title: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Typography, {
4825
4876
  variant: "h5",
4826
- component: "h3"
4877
+ component: "h2"
4827
4878
  }, title), subtitle && /* @__PURE__ */ React.createElement(Typography, {
4828
4879
  color: "textSecondary",
4829
4880
  variant: "body1"
@@ -5577,7 +5628,7 @@ const useStyles$1 = makeStyles(() => ({
5577
5628
  }), { name: "BackstagePage" });
5578
5629
  function Page(props) {
5579
5630
  const { themeId, children } = props;
5580
- const { isMobile } = useContext(SidebarPinStateContext);
5631
+ const { isMobile } = useSidebarPinState();
5581
5632
  const classes = useStyles$1({ isMobile });
5582
5633
  return /* @__PURE__ */ React.createElement(ThemeProvider, {
5583
5634
  theme: (baseTheme) => ({
@@ -6377,5 +6428,5 @@ function CardTab(props) {
6377
6428
  });
6378
6429
  }
6379
6430
 
6380
- 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, HeaderIconLinkRow, HeaderLabel, HeaderTabs, HelpIcon, HomepageTimer, 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, SidebarContext, SidebarDivider, SidebarExpandButton, SidebarGroup, SidebarIntro, SidebarItem, SidebarPage, SidebarPinStateContext, 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, useSupportConfig };
6431
+ 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, HeaderIconLinkRow, HeaderLabel, HeaderTabs, HelpIcon, HomepageTimer, 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 };
6381
6432
  //# sourceMappingURL=index.esm.js.map