Skip to content

Commit

Permalink
feat: app bar design system
Browse files Browse the repository at this point in the history
Signed-off-by: hxtree <[email protected]>
  • Loading branch information
hxtree committed Dec 6, 2023
1 parent 5129c34 commit 8a78b3e
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 6 deletions.
6 changes: 2 additions & 4 deletions services/design-system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@
},
"scripts": {
"deploy": "gh-pages -d build",
"storybook": "storybook dev -p 6006 -s public",
"dev": "storybook dev -p 6006",
"build": "tsc",
"build:sb": "storybook build",
"dev": "storybook dev -p 6006 -s public",
"build": "tsc && storybook build",
"build:all": "rush build -t .",
"test": "",
"watch": "tsc -w",
Expand Down
9 changes: 9 additions & 0 deletions services/design-system/src/Mui/AppBar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';
import MUIAppBar, { AppBarProps as MUIAppBarProps } from '@mui/material/AppBar';

export type AppBarProps = {} & MUIAppBarProps;

export const AppBar = (props: AppBarProps) => {
const { ...muiProps } = props;
return <MUIAppBar {...muiProps} />;
};
3 changes: 1 addition & 2 deletions services/design-system/src/Mui/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export * from './LoadingButton';
export * from './Link';
export * from './Layout';
export * from './Alert';
export * from './AppBar';

export type SelectChangeEvent<T = string> =
| (Event & {
Expand Down Expand Up @@ -42,7 +43,5 @@ export {
ListItemIcon,
ListItemText,
styled,
AppBar,
// AppBarProps,
useTheme,
} from '@mui/material';
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import React from 'react';
import { Meta } from '@storybook/react';
import { AppBar, AppBarProps } from '../../../src';
import {Toolbar} from '../../../src';
import { FontAwesomeIcon, faBars, faGithub } from '../../../src';
import { IconButton } from '../../../src';
import { Typography } from '../../../src';

export default {
title: 'Molecules/AppBar',
component: AppBar,
} as Meta<typeof AppBar>;

export const AppBarLight = (args: AppBarProps) =>
<AppBar {...args}>
<Toolbar>
<IconButton
color="inherit"
aria-label="open drawer"
edge="start"
>
<FontAwesomeIcon icon={faBars} />
</IconButton>
<Typography variant="h6" noWrap component="div" sx={{ flexGrow: 1 }}>
LOGO
</Typography>
<IconButton
href="https://github.com/hxtree/cats-cradle"
color="inherit"
>
<FontAwesomeIcon icon={faGithub} />
</IconButton>
</Toolbar>
</AppBar>;

AppBarLight.args = {
position:"fixed",
style: {
backgroundColor: ''
}
};

export const AppBarDark = (args: AppBarProps) =>
<AppBar {...args}>
<Toolbar>
<IconButton
color="inherit"
aria-label="open drawer"
edge="start"
>
<FontAwesomeIcon icon={faBars} />
</IconButton>
<Typography variant="h6" noWrap component="div" sx={{ flexGrow: 1 }}>
LOGO
</Typography>
<IconButton
href="https://github.com/hxtree/cats-cradle"
color="inherit"
>
<FontAwesomeIcon icon={faGithub} />
</IconButton>
</Toolbar>
</AppBar>;

AppBarDark.args = {
position:"fixed",
style: {
backgroundColor: '#000'
}
};

0 comments on commit 8a78b3e

Please sign in to comment.