|
1 |
| -import AppBarMain from './AppBarMain'; |
2 |
| -import AppBarDrawer from './AppBarDrawer'; |
3 |
| -import AppBarNav from './AppBarNav'; |
4 |
| -import AppBarRoot from './AppBarRoot'; |
| 1 | +import { AppBarMain } from './AppBarMain'; |
| 2 | +import { AppBarDrawer } from './AppBarDrawer'; |
| 3 | +import { AppBarNav } from './AppBarNav'; |
| 4 | +import { AppBarRoot } from './AppBarRoot'; |
5 | 5 |
|
6 |
| -const AppBar = { |
| 6 | +/** |
| 7 | + * The AppBar component is a wrapper for the page content, that renders a |
| 8 | + * lateral menu containing the list of pages rendered by the app and a top |
| 9 | + * navigation bar containing information related to the current user with a |
| 10 | + * dropdown menu with a list of actions. |
| 11 | + * |
| 12 | + * It is composed by the {@link AppBarRoot}, {@link AppBarDrawer}, |
| 13 | + * {@link AppBarMain} and {@link AppBarNav} components. |
| 14 | + * |
| 15 | + * A sandbox of this componet is available on our |
| 16 | + * [AppBar Story](https://storybook.rockets.tools/?path=/docs/appbar) |
| 17 | + * |
| 18 | + * @example The following example describes the full composition that mounts the AppBar component: |
| 19 | + * |
| 20 | + * ```tsx |
| 21 | + * import { AppBar } from '@concepta/react-material-ui'; |
| 22 | + * |
| 23 | + * <AppBar.Root key={pathname}> |
| 24 | + * <AppBar.Drawer |
| 25 | + * currentId={pathname} |
| 26 | + * logo="/logo.svg" |
| 27 | + * collapsable |
| 28 | + * items={[ |
| 29 | + * { |
| 30 | + * id: '/users', |
| 31 | + * icon: <GroupsOutlinedIcon />, |
| 32 | + * text: 'Users', |
| 33 | + * onClick: () => router.push('/users'), |
| 34 | + * }, |
| 35 | + * { |
| 36 | + * id: '/profile', |
| 37 | + * icon: <PersonOutlinedIcon />, |
| 38 | + * text: 'Profile', |
| 39 | + * onClick: () => router.push('/profile'), |
| 40 | + * }, |
| 41 | + * ]} |
| 42 | + * expandedWidth={120} |
| 43 | + * /> |
| 44 | + * <AppBar.Main> |
| 45 | + * <AppBar.Nav |
| 46 | + * text={user.fullName} |
| 47 | + * avatar="https://source.unsplash.com/random" |
| 48 | + * headerMenuOptions={(handleClose) => ( |
| 49 | + * <MenuItem |
| 50 | + * onClick={() => { |
| 51 | + * handleClose(); |
| 52 | + * doLogout(); |
| 53 | + * router.replace('/login'); |
| 54 | + * }} |
| 55 | + * > |
| 56 | + * Sign Out |
| 57 | + * </MenuItem> |
| 58 | + * )} |
| 59 | + * /> |
| 60 | + * <Container>{children}</Container> |
| 61 | + * </AppBar.Main> |
| 62 | + * </AppBar.Root>; |
| 63 | + * ``` |
| 64 | + * |
| 65 | + * @see {@link AppBarMain} |
| 66 | + * @see {@link AppBarDrawer} |
| 67 | + * @see {@link AppBarNav} |
| 68 | + * @see {@link AppBarRoot} |
| 69 | + * @see [Storybook - AppBar](https://storybook.rockets.tools/?path=/docs/appbar) |
| 70 | + */ |
| 71 | +export const AppBar = { |
7 | 72 | Main: AppBarMain,
|
8 | 73 | Drawer: AppBarDrawer,
|
9 | 74 | Nav: AppBarNav,
|
10 | 75 | Root: AppBarRoot,
|
11 | 76 | };
|
12 |
| - |
13 |
| -export default AppBar; |
|
0 commit comments