diff --git a/src/Button/Button.stories.tsx b/src/Button/Button.stories.tsx index a952fc24..ad4f91b3 100644 --- a/src/Button/Button.stories.tsx +++ b/src/Button/Button.stories.tsx @@ -63,6 +63,47 @@ Default.story = { name: 'default' }; +export function Raised() { + return ( +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
+ ); +} + +Raised.story = { + name: 'raised' +}; + export function Flat() { return ( diff --git a/src/Button/Button.tsx b/src/Button/Button.tsx index 6cbf6aa0..cd555af2 100644 --- a/src/Button/Button.tsx +++ b/src/Button/Button.tsx @@ -25,7 +25,7 @@ type ButtonProps = { type?: string; } & ( | { - variant?: 'default' | 'flat' | 'thin'; + variant?: 'default' | 'raised' | 'flat' | 'thin'; } | { /** @deprecated Use `thin` */ @@ -146,11 +146,21 @@ export const StyledButton = styled.button` `} ${active - ? createBorderStyles({ invert: true }) - : createBorderStyles({ invert: false })} + ? createBorderStyles({ + style: variant === 'raised' ? 'window' : 'button', + invert: true + }) + : createBorderStyles({ + style: variant === 'raised' ? 'window' : 'button', + invert: false + })} } &:active:before { - ${!disabled && createBorderStyles({ invert: true })} + ${!disabled && + createBorderStyles({ + style: variant === 'raised' ? 'window' : 'button', + invert: true + })} } &:focus:after, &:active:after { diff --git a/src/NumberInput/NumberInput.tsx b/src/NumberInput/NumberInput.tsx index e6f646b0..57960b85 100644 --- a/src/NumberInput/NumberInput.tsx +++ b/src/NumberInput/NumberInput.tsx @@ -28,7 +28,7 @@ const StyledNumberInputWrapper = styled.div` align-items: center; `; -const StyledButton = styled(Button)>` +const StyledButton = styled(Button)` width: 30px; padding: 0; flex-shrink: 0; @@ -40,13 +40,6 @@ const StyledButton = styled(Button)>` ` : css` height: 50%; - &:before { - border-left-color: ${({ theme }) => theme.borderLight}; - border-top-color: ${({ theme }) => theme.borderLight}; - box-shadow: inset 1px 1px 0px 1px - ${({ theme }) => theme.borderLightest}, - inset -1px -1px 0 1px ${({ theme }) => theme.borderDark}; - } `} `; @@ -159,6 +152,7 @@ const NumberInput = forwardRef( handleClick(-step); }, [handleClick, step]); + const buttonVariant = variant === 'flat' ? 'flat' : 'raised'; return ( ( @@ -189,7 +183,7 @@ const NumberInput = forwardRef( diff --git a/src/Select/Select.styles.tsx b/src/Select/Select.styles.tsx index 5ff251d1..4697e4f6 100644 --- a/src/Select/Select.styles.tsx +++ b/src/Select/Select.styles.tsx @@ -109,7 +109,7 @@ export const StyledNativeSelect = styled.select` export const StyledDropdownButton = styled(Button).attrs(() => ({ 'aria-hidden': 'true' -}))` +}))>` width: 30px; padding: 0; flex-shrink: 0; @@ -121,13 +121,6 @@ export const StyledDropdownButton = styled(Button).attrs(() => ({ ` : css` height: 100%; - &:before { - border-left-color: ${({ theme }) => theme.borderLight}; - border-top-color: ${({ theme }) => theme.borderLight}; - box-shadow: inset 1px 1px 0px 1px - ${({ theme }) => theme.borderLightest}, - inset -1px -1px 0 1px ${({ theme }) => theme.borderDark}; - } `} ${({ native = false, variant = 'default' }) => native && diff --git a/src/Select/useSelectCommon.tsx b/src/Select/useSelectCommon.tsx index 9a76db8f..3919e44b 100644 --- a/src/Select/useSelectCommon.tsx +++ b/src/Select/useSelectCommon.tsx @@ -54,7 +54,7 @@ export const useSelectCommon = ({ $disabled={disabled} native={native} tabIndex={-1} - variant={variant} + variant={variant === 'flat' ? 'flat' : 'raised'} >