@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.
- package/dist/@canonical/maas-react-components.es.js +2 -2
- package/dist/{lib-BEVV6FLF.mjs → lib-qz4Dneh_.mjs} +67 -67
- package/dist/maas-react-components.css +1 -1
- package/dist/sections/Layout/Layout.d.ts +3 -1
- package/dist/sections/SidePanel/SidePanel.d.ts +8 -4
- package/dist/sections/SidePanel/index.d.ts +1 -1
- package/dist/testing/index.es.js +1 -1
- package/package.json +1 -1
|
@@ -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
|
-
*
|
|
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
|
|
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
|
-
(
|
|
39
|
-
|
|
40
|
+
({ sidePanelTitles, }: {
|
|
41
|
+
sidePanelTitles?: SidePanelTitles;
|
|
42
|
+
}): ReactElement;
|
|
43
|
+
Skeleton: ({ hasTitle, }: {
|
|
40
44
|
hasTitle?: boolean;
|
|
41
45
|
}) => ReactElement;
|
|
42
46
|
};
|
package/dist/testing/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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