Skip to content

Commit

Permalink
added corner edge
Browse files Browse the repository at this point in the history
  • Loading branch information
opensrc0 committed Dec 7, 2023
1 parent 0708c27 commit 0c6ff8c
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ theme.fontFamily = {};
theme.fontSize = {};
theme.fontWeight = {};
theme.display = {};
theme.borderRadius = '';
theme.cornerEdge = '';
theme.pxScale = '';

export default theme;
Expand Down
22 changes: 12 additions & 10 deletions __application/component/Button/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ const styles = {
},
borderRadius(props) {
if (props.shape === 'bluntEdged') {
return props.theme.borderRadius;
return props.theme.cornerEdge;
}
if (props.shape === 'sharpEdged') {
return '2px';
return '0';
}
if (props.shape === 'capsular') {
return props.theme.px(10);
Expand Down Expand Up @@ -178,27 +178,29 @@ function Button({ label, disabled, className, onClick, spin, ...props }) {
Button.propTypes = {
label: PropTypes.string,
onClick: PropTypes.func,
type: PropTypes.oneOf(['submit', 'button']),
kind: PropTypes.oneOf(['filled', 'outlined']),
size: PropTypes.oneOf(['small', 'medium', 'large']),
shape: PropTypes.oneOf(['bluntEdged', 'sharpEdged', 'capsular', 'circular']),
fluid: PropTypes.bool,
disabled: PropTypes.bool,
spin: PropTypes.bool,
className: PropTypes.string,
type: PropTypes.oneOf(['submit', 'button']),
variant: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'quaternary']),
shape: PropTypes.oneOf(['bluntEdged', 'sharpEdged', 'capsular', 'circular']),
size: PropTypes.oneOf(['small', 'medium', 'large']),

// kind: PropTypes.oneOf(['filled', 'outlined']),
};

Button.defaultProps = {
label: 'Button',
onClick: () => {},
type: 'submit',
kind: 'filled',
size: 'medium',
shape: 'bluntEdged',
fluid: false,
disabled: false,
spin: false,
className: '',
type: 'submit',
variant: 'primary',
size: 'medium',
shape: 'bluntEdged',
};

export default Button;
2 changes: 1 addition & 1 deletion __application/component/Init/Init.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function Init(userTheme) {
...userTheme?.display,
},

borderRadius: userTheme?.borderRadius || defaultTheme.color,
cornerEdge: userTheme?.cornerEdge || defaultTheme.cornerEdge,

pxScale: userTheme?.pxScale || defaultTheme.pxScale,

Expand Down
2 changes: 1 addition & 1 deletion __application/component/Input/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import theme from '../theme';
const styles = {
borderRadius(props) {
if (props.shape === 'bluntEdged') {
return theme.borderRadius;
return theme.cornerEdge;
}
if (props.shape === 'sharpEdged') {
return '2px';
Expand Down
2 changes: 1 addition & 1 deletion __application/component/WIP-Chip/Chip.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const styles = {
},
borderRadius(props) {
if (props.shape === 'bluntEdged') {
return props.theme.borderRadius;
return props.theme.cornerEdge;
}
if (props.shape === 'sharpEdged') {
return '0';
Expand Down
2 changes: 1 addition & 1 deletion __application/component/theme/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ theme.display = {
none: 'none',
};

theme.borderRadius = '8px';
theme.cornerEdge = '8px';

theme.pxScale = 8;

Expand Down
2 changes: 1 addition & 1 deletion sample-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ theme.fontFamily = {};
theme.fontSize = {};
theme.fontWeight = {};
theme.display = {};
theme.borderRadius = '';
theme.cornerEdge = '';
theme.pxScale = '';

export default theme;

0 comments on commit 0c6ff8c

Please sign in to comment.