@canonical/maas-react-components 2.4.0 → 2.6.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 +1857 -1703
- package/dist/@canonical/maas-react-components.umd.js +17 -17
- package/dist/maas-react-components.css +1 -1
- package/dist/src/lib/sections/Layout/Layout.d.ts +18 -0
- package/dist/src/lib/sections/Layout/Layout.test.d.ts +1 -0
- package/dist/src/lib/sections/Layout/components/DocumentTitle/DocumentTitle.d.ts +4 -0
- package/dist/src/lib/sections/Layout/components/DocumentTitle/index.d.ts +0 -0
- package/dist/src/lib/sections/Layout/index.d.ts +1 -0
- package/dist/src/lib/sections/SidePanel/SidePanel.d.ts +6 -1
- package/dist/src/lib/sections/SidePanel/SidePanel.stories.d.ts +2 -0
- package/dist/src/lib/sections/SidePanel/utils.d.ts +22 -0
- package/dist/src/lib/sections/index.d.ts +1 -0
- package/package.json +7 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
type LayoutProps = {
|
|
3
|
+
className?: string;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
pageTitle: string;
|
|
6
|
+
view: "settings" | "table";
|
|
7
|
+
isSecondaryNavVisible: boolean;
|
|
8
|
+
navigation: ReactNode;
|
|
9
|
+
secondaryNavigation: ReactNode;
|
|
10
|
+
statusBar?: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
export declare const Layout: {
|
|
13
|
+
({ className, children, pageTitle, view, isSecondaryNavVisible, navigation, secondaryNavigation, statusBar, }: LayoutProps): ReactElement;
|
|
14
|
+
Skeleton: ({ view, }: {
|
|
15
|
+
view: "settings" | "table";
|
|
16
|
+
}) => ReactElement;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Layout } from './Layout';
|
|
@@ -34,4 +34,9 @@ import { ReactElement } from 'react';
|
|
|
34
34
|
* openSidePanel({ component: EditForm, title: "Edit item", size: "wide" });
|
|
35
35
|
* ```
|
|
36
36
|
*/
|
|
37
|
-
export declare const SidePanel:
|
|
37
|
+
export declare const SidePanel: {
|
|
38
|
+
(): ReactElement;
|
|
39
|
+
Skeleton: ({ hasTitle }: {
|
|
40
|
+
hasTitle?: boolean;
|
|
41
|
+
}) => ReactElement;
|
|
42
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Lazily loads a side panel component wrapped in its own Suspense boundary.
|
|
4
|
+
* Define the panel at module scope in the file that opens it and pass it
|
|
5
|
+
* straight to `openSidePanel`:
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* const AddUser = lazySidePanel(() => import("./UserAddForm"));
|
|
9
|
+
* // ...
|
|
10
|
+
* openSidePanel({ component: AddUser, title: "Add user" });
|
|
11
|
+
*
|
|
12
|
+
* The `<SidePanel />` component from `@canonical/maas-react-components` renders
|
|
13
|
+
* the panel component directly, so a bare `React.lazy` panel would suspend the
|
|
14
|
+
* whole `<SidePanel />` on first open. That remounts `<SidePanel />`, and on
|
|
15
|
+
* remount its internal "close on navigation" effect runs and immediately closes
|
|
16
|
+
* the panel that was just opened. Giving each panel its own Suspense boundary
|
|
17
|
+
* keeps `<SidePanel />` mounted (and open) while the chunk loads, and shows the
|
|
18
|
+
* spinner inside the panel.
|
|
19
|
+
*/
|
|
20
|
+
export declare const lazyLoadSidePanel: (loader: () => Promise<{
|
|
21
|
+
default: ComponentType;
|
|
22
|
+
}>, showSkeletonTitle?: boolean) => ComponentType;
|
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.
|
|
4
|
+
"version": "2.6.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/canonical/maas-react-components.git"
|
|
@@ -92,6 +92,12 @@
|
|
|
92
92
|
"vite-plugin-dts": "^4.5.3",
|
|
93
93
|
"vitest": "^3.0.8"
|
|
94
94
|
},
|
|
95
|
+
"overrides": {
|
|
96
|
+
"@canonical/react-components": {
|
|
97
|
+
"@types/react": "$@types/react",
|
|
98
|
+
"@types/react-dom": "$@types/react-dom"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
95
101
|
"peerDependencies": {
|
|
96
102
|
"@canonical/react-components": "^4.5.0",
|
|
97
103
|
"@tanstack/react-table": "^8.15.3",
|