generated from hackforla/.github-hackforla-base-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
5,341 additions
and
7,900 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const path = require("path"); | ||
|
||
module.exports = { | ||
stories: ["../src/components/UI/**/*.stories.js"], | ||
addons: [ | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
"@storybook/preset-create-react-app", | ||
"@storybook/addon-controls", | ||
"storybook-addon-material-ui", | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { muiTheme } from "storybook-addon-material-ui"; | ||
import { theme as adminTheme } from "../src/theme/adminTheme.js"; | ||
import clientTheme from "../src/theme/clientTheme.js"; | ||
|
||
export const decorators = [muiTheme([adminTheme, clientTheme])]; | ||
export const parameters = { | ||
actions: { argTypesRegex: "^on[A-Z].*" }, | ||
}; |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from "react"; | ||
import MaterialBox from "@material-ui/core/Box"; | ||
import PropTypes from "prop-types"; | ||
|
||
const Box = ({ color = "#313233", bgcolor = "#F9F9F9", children, ...rest }) => { | ||
return ( | ||
<MaterialBox color={color} bgcolor="#F9F9F9" p={3} {...rest}> | ||
{children} | ||
</MaterialBox> | ||
); | ||
}; | ||
|
||
Box.propTypes = { | ||
color: PropTypes.string, | ||
bgcolor: PropTypes.string, | ||
children: PropTypes.element.isRequired, | ||
}; | ||
|
||
export default Box; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import React from "react"; | ||
import { Button as MaterialButton } from "@material-ui/core"; | ||
import PropTypes from "prop-types"; | ||
import { ICON_DICT } from "./IconButton"; | ||
|
||
const Base = ({ children, color = "primary", ...props }) => { | ||
return ( | ||
<MaterialButton variant="contained" color={color} {...props}> | ||
{children} | ||
</MaterialButton> | ||
); | ||
}; | ||
|
||
Base.propTypes = { | ||
children: PropTypes.string.isRequired, | ||
onChange: PropTypes.func, | ||
color: PropTypes.string, | ||
}; | ||
|
||
const Button = ({ icon, children, ...props }) => { | ||
const Icon = ICON_DICT[icon]; | ||
if (icon) { | ||
return ( | ||
<Base startIcon={<Icon />} {...props}> | ||
{children} | ||
</Base> | ||
); | ||
} | ||
return <Base {...props}>{children}</Base>; | ||
}; | ||
|
||
export default Button; | ||
|
||
Button.propTypes = { | ||
kind: PropTypes.string, | ||
icon: PropTypes.oneOf([ | ||
"add", | ||
"delete", | ||
"check", | ||
"close", | ||
"save", | ||
"edit", | ||
"cancel", | ||
"search", | ||
"details", | ||
"remove", | ||
]), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import React from "react"; | ||
import { IconButton as MaterialIconButton } from "@material-ui/core"; | ||
import PropTypes from "prop-types"; | ||
import { | ||
Add, | ||
ArrowDownward, | ||
ArrowUpward, | ||
Cancel, | ||
Check, | ||
Close, | ||
Delete, | ||
Details, | ||
Edit, | ||
Remove, | ||
Save, | ||
Search, | ||
} from "@material-ui/icons"; | ||
|
||
const IconButton = ({ kind, ...props }) => { | ||
const Icon = ICON_DICT[kind]; | ||
return ( | ||
<MaterialIconButton | ||
variant="contained" | ||
color="default" | ||
aria-label={props.ariaLabel} | ||
{...props} | ||
> | ||
<Icon /> | ||
</MaterialIconButton> | ||
); | ||
}; | ||
|
||
IconButton.propTypes = { | ||
ariaLabel: PropTypes.string.isRequired, | ||
kind: PropTypes.string.isRequired, | ||
onChange: PropTypes.func, | ||
}; | ||
|
||
export default IconButton; | ||
|
||
export const ICON_DICT = { | ||
add: Add, | ||
arrowUp: ArrowUpward, | ||
arrowDown: ArrowDownward, | ||
delete: Delete, | ||
check: Check, | ||
close: Close, | ||
save: Save, | ||
edit: Edit, | ||
cancel: Cancel, | ||
search: Search, | ||
details: Details, | ||
remove: Remove, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from "react"; | ||
import TextField from "@material-ui/core/TextField"; | ||
import PropTypes from "prop-types"; | ||
|
||
const Input = (props) => { | ||
return ( | ||
<TextField | ||
{...props} | ||
label={props.label} | ||
onChange={(e) => props.onChange(e.target.value)} | ||
/> | ||
); | ||
}; | ||
|
||
Input.propTypes = { | ||
label: PropTypes.string.isRequired, | ||
onChange: PropTypes.func.isRequired, | ||
value: PropTypes.string.isRequired, | ||
}; | ||
|
||
export default Input; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { muiTheme } from "storybook-addon-material-ui"; | ||
import { theme as adminTheme } from "../../theme/adminTheme"; | ||
import clientTheme from "../../theme/clientTheme"; | ||
|
||
export const decorators = muiTheme([adminTheme, clientTheme]); |
Oops, something went wrong.