@canonical/maas-react-components 2.7.2 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  import { ReactElement, ReactNode } from 'react';
2
+ import { SidePanelTitles } from '../SidePanel';
2
3
  type LayoutProps = {
3
4
  className?: string;
4
5
  children: ReactNode;
@@ -7,10 +8,11 @@ type LayoutProps = {
7
8
  isSecondaryNavVisible: boolean;
8
9
  navigation: ReactNode;
9
10
  secondaryNavigation: ReactNode;
11
+ sidePanelTitles?: SidePanelTitles;
10
12
  statusBar?: ReactNode;
11
13
  };
12
14
  export declare const Layout: {
13
- ({ className, children, pageTitle, view, isSecondaryNavVisible, navigation, secondaryNavigation, statusBar, }: LayoutProps): ReactElement;
15
+ ({ className, children, pageTitle, view, isSecondaryNavVisible, navigation, secondaryNavigation, sidePanelTitles, statusBar, }: LayoutProps): ReactElement;
14
16
  Skeleton: ({ view, }: {
15
17
  view: "settings" | "table";
16
18
  }) => ReactElement;
@@ -1,9 +1,11 @@
1
1
  import { ReactElement } from 'react';
2
+ export type SidePanelTitles = "auto" | "custom";
2
3
  /**
3
4
  * Slide-in aside panel rendered at the edge of the page.
4
5
  *
5
6
  * Reads all state from the nearest `SidePanelContextProvider` via `useSidePanel`.
6
- * The panel has no props of its own — open it by calling `openSidePanel` from the hook.
7
+ * Open it by calling `openSidePanel` from the hook. Use `sidePanelTitles="custom"`
8
+ * when the rendered panel component provides its own visible title.
7
9
  *
8
10
  * Behaviour:
9
11
  * - Collapses automatically when the current route changes
@@ -17,7 +19,7 @@ import { ReactElement } from 'react';
17
19
  * - `"large"` — adds the `is-large` CSS modifier
18
20
  *
19
21
  * @requires SidePanelContextProvider — must be present higher in the tree
20
- * @requires A React Router context — must be rendered inside a Router
22
+ * @requires _ React Router context — must be rendered inside a Router
21
23
  *
22
24
  * @example
23
25
  * ```tsx
@@ -35,8 +37,10 @@ import { ReactElement } from 'react';
35
37
  * ```
36
38
  */
37
39
  export declare const SidePanel: {
38
- (): ReactElement;
39
- Skeleton: ({ hasTitle }: {
40
+ ({ sidePanelTitles, }: {
41
+ sidePanelTitles?: SidePanelTitles;
42
+ }): ReactElement;
43
+ Skeleton: ({ hasTitle, }: {
40
44
  hasTitle?: boolean;
41
45
  }) => ReactElement;
42
46
  };
@@ -1,3 +1,3 @@
1
- export { SidePanel } from './SidePanel';
1
+ export { SidePanel, type SidePanelTitles } from './SidePanel';
2
2
  export { SidePanelContextProvider, useSidePanel } from './SidePanelContextProvider/SidePanelContextProvider';
3
3
  export { lazyLoadSidePanel } from './utils';
@@ -1,4 +1,4 @@
1
- import { y as e } from "../lib-BEVV6FLF.mjs";
1
+ import { v as e } from "../lib-qz4Dneh_.mjs";
2
2
  import { jsx as t } from "react/jsx-runtime";
3
3
  import { RouterProvider as n, createMemoryRouter as r } from "react-router";
4
4
  import { render as i, renderHook as a, screen as o } from "@testing-library/react";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@canonical/maas-react-components",
3
3
  "description": "React components for use in MAAS UI projects.",
4
- "version": "2.7.2",
4
+ "version": "2.8.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/canonical/maas-react-components.git"