@firecms/core 3.0.0-canary.60 → 3.0.0-canary.62
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/app/AppBar.d.ts +12 -0
- package/dist/app/Drawer.d.ts +17 -0
- package/dist/app/Scaffold.d.ts +26 -0
- package/dist/app/index.d.ts +4 -0
- package/dist/app/useApp.d.ts +16 -0
- package/dist/components/index.d.ts +1 -1
- package/dist/{components/FireCMSAppBar.d.ts → core/DefaultAppBar.d.ts} +2 -7
- package/dist/core/DefaultDrawer.d.ts +19 -0
- package/dist/core/index.d.ts +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +2113 -2093
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +5 -5
- package/dist/index.umd.js.map +1 -1
- package/package.json +4 -4
- package/src/app/AppBar.tsx +18 -0
- package/src/app/Drawer.tsx +25 -0
- package/src/{core → app}/Scaffold.tsx +59 -109
- package/src/app/index.ts +4 -0
- package/src/app/useApp.tsx +32 -0
- package/src/components/index.tsx +1 -1
- package/src/{components/FireCMSAppBar.tsx → core/DefaultAppBar.tsx} +17 -25
- package/src/core/DefaultDrawer.tsx +177 -0
- package/src/core/index.tsx +2 -2
- package/src/form/EntityForm.tsx +6 -7
- package/src/index.ts +1 -0
- package/dist/core/Drawer.d.ts +0 -16
- package/dist/core/Scaffold.d.ts +0 -51
- package/src/core/Drawer.tsx +0 -139
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DefaultAppBarProps } from "../core/DefaultAppBar";
|
|
2
|
+
/**
|
|
3
|
+
* This component renders the main app bar of FireCMS.
|
|
4
|
+
*/
|
|
5
|
+
export declare function AppBar({ children, ...props }: {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
style?: React.CSSProperties;
|
|
9
|
+
} & DefaultAppBarProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare namespace AppBar {
|
|
11
|
+
var componentType: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This component is in charge of rendering the drawer.
|
|
3
|
+
* If you add this component under your {@link Scaffold}, it will be rendered
|
|
4
|
+
* as a drawer, and the open and close functionality will be handled automatically.
|
|
5
|
+
* If you want to customise the drawer, you can create your own component and pass it as a child.
|
|
6
|
+
* For custom drawers, you can use the {@link useApp} to open and close the drawer.
|
|
7
|
+
*
|
|
8
|
+
* @constructor
|
|
9
|
+
*/
|
|
10
|
+
export declare function Drawer({ children, className, style }: {
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
style?: React.CSSProperties;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare namespace Drawer {
|
|
16
|
+
var componentType: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const DRAWER_WIDTH = 280;
|
|
3
|
+
/**
|
|
4
|
+
* @group Core
|
|
5
|
+
*/
|
|
6
|
+
export interface ScaffoldProps {
|
|
7
|
+
/**
|
|
8
|
+
* Open the drawer on hover
|
|
9
|
+
*/
|
|
10
|
+
autoOpenDrawer?: boolean;
|
|
11
|
+
logo?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
style?: React.CSSProperties;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* This view acts as a scaffold for FireCMS.
|
|
17
|
+
*
|
|
18
|
+
* It is in charge of displaying the navigation drawer, top bar and main
|
|
19
|
+
* collection views.
|
|
20
|
+
* This component needs a parent {@link FireCMS}
|
|
21
|
+
*
|
|
22
|
+
* @param props
|
|
23
|
+
* @constructor
|
|
24
|
+
* @group Core
|
|
25
|
+
*/
|
|
26
|
+
export declare const Scaffold: React.NamedExoticComponent<React.PropsWithChildren<ScaffoldProps>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* This context represents the state of the app in terms of layout.
|
|
4
|
+
* @group Core
|
|
5
|
+
*/
|
|
6
|
+
export type DrawerState = {
|
|
7
|
+
hasDrawer: boolean;
|
|
8
|
+
drawerHovered: boolean;
|
|
9
|
+
drawerOpen: boolean;
|
|
10
|
+
openDrawer: () => void;
|
|
11
|
+
closeDrawer: () => void;
|
|
12
|
+
autoOpenDrawer?: boolean;
|
|
13
|
+
logo?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const AppContext: React.Context<DrawerState>;
|
|
16
|
+
export declare function useApp(): DrawerState;
|
|
@@ -19,7 +19,7 @@ export * from "./VirtualTable";
|
|
|
19
19
|
export * from "./ErrorBoundary";
|
|
20
20
|
export * from "./DeleteConfirmationDialog";
|
|
21
21
|
export * from "./FireCMSLogo";
|
|
22
|
-
export * from "
|
|
22
|
+
export * from "../core/DefaultAppBar";
|
|
23
23
|
export * from "./ArrayContainer";
|
|
24
24
|
export * from "./ReferenceWidget";
|
|
25
25
|
export * from "./SearchIconsView";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { User } from "../types";
|
|
3
|
-
export type
|
|
3
|
+
export type DefaultAppBarProps<ADDITIONAL_PROPS = object> = {
|
|
4
4
|
title?: React.ReactNode;
|
|
5
5
|
/**
|
|
6
6
|
* A component that gets rendered on the upper side of the main toolbar
|
|
@@ -8,9 +8,7 @@ export type FireCMSAppBarProps<ADDITIONAL_PROPS = object> = {
|
|
|
8
8
|
endAdornment?: React.ReactNode;
|
|
9
9
|
startAdornment?: React.ReactNode;
|
|
10
10
|
dropDownActions?: React.ReactNode;
|
|
11
|
-
includeDrawer?: boolean;
|
|
12
11
|
includeModeToggle?: boolean;
|
|
13
|
-
drawerOpen: boolean;
|
|
14
12
|
className?: string;
|
|
15
13
|
style?: React.CSSProperties;
|
|
16
14
|
logo?: string;
|
|
@@ -20,9 +18,6 @@ export type FireCMSAppBarProps<ADDITIONAL_PROPS = object> = {
|
|
|
20
18
|
* This component renders the main app bar of FireCMS.
|
|
21
19
|
* You will likely not need to use this component directly.
|
|
22
20
|
*
|
|
23
|
-
* @param title
|
|
24
|
-
* @param toolbarExtraWidget
|
|
25
|
-
* @param drawerOpen
|
|
26
21
|
* @constructor
|
|
27
22
|
*/
|
|
28
|
-
export declare const
|
|
23
|
+
export declare const DefaultAppBar: ({ title, endAdornment, startAdornment, dropDownActions, includeModeToggle, className, style, user: userProp }: DefaultAppBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Default drawer used in the CMS
|
|
4
|
+
* @group Core
|
|
5
|
+
*/
|
|
6
|
+
export declare function DefaultDrawer({ className, style, }: {
|
|
7
|
+
className?: string;
|
|
8
|
+
style?: React.CSSProperties;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
/**
|
|
11
|
+
* This is the logo displayed in the drawer
|
|
12
|
+
* It expands when the drawer is open.
|
|
13
|
+
*
|
|
14
|
+
* @param logo
|
|
15
|
+
* @constructor
|
|
16
|
+
*/
|
|
17
|
+
export declare function DrawerLogo({ logo }: {
|
|
18
|
+
logo?: string;
|
|
19
|
+
}): import("react/jsx-runtime").JSX.Element;
|
package/dist/core/index.d.ts
CHANGED