@firecms/core 3.0.0-canary.61 → 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.
@@ -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,4 @@
1
+ export * from "./Drawer";
2
+ export * from "./AppBar";
3
+ export * from "./Scaffold";
4
+ export * from "./useApp";
@@ -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 "./FireCMSAppBar";
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 FireCMSAppBarProps<ADDITIONAL_PROPS = object> = {
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 FireCMSAppBar: ({ title, endAdornment, startAdornment, drawerOpen, dropDownActions, includeDrawer, includeModeToggle, className, style, logo, user: userProp }: FireCMSAppBarProps) => import("react/jsx-runtime").JSX.Element;
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;
@@ -1,6 +1,6 @@
1
1
  export * from "./FireCMS";
2
- export * from "./Scaffold";
3
- export * from "./Drawer";
2
+ export * from "../app/Scaffold";
3
+ export * from "./DefaultDrawer";
4
4
  export * from "./DrawerNavigationItem";
5
5
  export * from "./field_configs";
6
6
  export * from "./SideDialogs";
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./core";
2
+ export * from "./app";
2
3
  export * from "./types";
3
4
  export * from "./form";
4
5
  export * from "./preview";