omnivore/packages/web/components/elements/Button.tsx

473 lines
11 KiB
TypeScript
Raw Normal View History

2022-02-11 17:24:33 +00:00
import { styled } from '../tokens/stitches.config'
export const Button = styled('button', {
fontFamily: 'inter',
fontSize: '$2',
lineHeight: '1.25',
color: '$grayText',
variants: {
style: {
ctaYellow: {
borderRadius: '$3',
px: '$3',
py: '$2',
border: '1px solid $yellow3',
bg: '$yellow3',
'&:hover': {
bg: '$yellow4',
border: '1px solid $grayBorderHover',
},
},
2024-05-07 04:10:33 +00:00
ctaOmnivoreYellow: {
borderRadius: '5px',
px: '20px',
py: '8px',
fontSize: '14px',
fontWeight: '500',
cursor: 'pointer',
border: '0px solid $yellow3',
bg: '$omnivoreYellow',
color: '#2A2A2A',
'&:hover': {
opacity: 1.0,
border: '0px solid #FFD800',
background: `#FFD800`,
},
},
2024-02-08 07:01:40 +00:00
ctaBlue: {
borderRadius: '5px',
px: '20px',
py: '8px',
fontSize: '14px',
fontWeight: '500',
cursor: 'pointer',
2024-05-07 02:33:51 +00:00
border: '0px solid $yellow3',
2024-02-08 07:01:40 +00:00
bg: '$ctaBlue',
2024-02-09 04:06:22 +00:00
color: 'white',
2024-02-08 07:01:40 +00:00
'&:hover': {
2024-05-07 02:33:51 +00:00
border: '0px solid #0056D2',
background: `#0056D2`,
2024-02-08 07:01:40 +00:00
},
},
2024-02-27 10:49:21 +00:00
tldr: {
gap: '10px',
display: 'flex',
alignItems: 'center',
2024-02-29 02:38:42 +00:00
borderRadius: '100px',
2024-02-27 10:49:21 +00:00
px: '10px',
2024-02-29 02:38:42 +00:00
py: '10px',
2024-02-27 10:49:21 +00:00
fontFamily: '$inter',
fontSize: '12px',
fontWeight: '500',
cursor: 'pointer',
color: '#EDEDED',
2024-02-29 06:08:01 +00:00
border: '1px solid $thLibraryMultiselectHover',
2024-02-27 10:49:21 +00:00
bg: 'transparent',
'&:hover': {
opacity: '0.6',
2024-02-29 06:08:01 +00:00
border: '1px solid $ctaBlue',
2024-02-27 10:49:21 +00:00
},
},
2024-02-08 07:01:40 +00:00
2022-02-11 17:24:33 +00:00
ctaDarkYellow: {
2023-03-02 04:59:31 +00:00
border: '1px solid transparent',
2023-09-04 05:47:24 +00:00
fontSize: '14px',
2022-02-11 17:24:33 +00:00
fontWeight: 500,
fontFamily: 'Inter',
2023-03-02 04:59:31 +00:00
borderRadius: '5px',
2022-02-11 17:24:33 +00:00
cursor: 'pointer',
2023-03-02 04:59:31 +00:00
color: '#3D3D3D',
bg: '#FFEA9F',
p: '10px 15px',
'&:hover, &:focus': {
2023-03-02 04:59:31 +00:00
bg: '$omnivoreCtaYellow',
outline: '1px solid $omnivoreCtaYellow',
2023-03-02 04:59:31 +00:00
},
},
landingCta: {
borderRadius: 10,
backgroundColor: '#1A1A1A',
padding: '12px 100px',
color: '#FFFFFF',
font: '$inter',
fontSize: '20px',
fontWeight: '500',
textDecoration: 'none',
transition: 'background-color ease-out 50ms',
2024-05-07 02:33:51 +00:00
boxShadow: `0px 4px 4px 0px rgba(0, 0, 0, 0.15)`,
'&:hover': {
backgroundColor: '#3D3D3D',
outline: '0px solid #1A1A1A',
},
},
landingSimple: {
borderRadius: 10,
backgroundColor: '#1A1A1A',
2024-05-07 02:33:51 +00:00
padding: '10px 20px',
color: '#FFFFFF',
font: '$inter',
fontSize: '20px',
fontWeight: '500',
textDecoration: 'none',
transition: 'background-color ease-out 50ms',
'&:hover': {
backgroundColor: '#1A1A1A',
outline: '0px solid #1A1A1A',
2024-05-07 02:33:51 +00:00
boxShadow: `0px 4px 4px 0px rgba(0, 0, 0, 0.15)`,
},
},
2023-03-02 04:59:31 +00:00
cancelGeneric: {
2023-03-03 06:44:06 +00:00
fontSize: '13px',
2023-03-02 04:59:31 +00:00
fontWeight: 500,
fontFamily: 'Inter',
cursor: 'pointer',
color: '#6A6968',
borderRadius: '5px',
border: '1px solid transparent',
p: '10px 15px',
2023-03-03 06:44:06 +00:00
bg: 'transparent',
'&:hover, &:focus': {
2023-03-02 04:59:31 +00:00
bg: '#EBEBEB',
outline: '1px solid $omnivoreCtaYellow',
2023-03-02 04:59:31 +00:00
},
2022-02-11 17:24:33 +00:00
},
2024-05-07 02:33:51 +00:00
cancelAuth: {
fontSize: '13px',
fontWeight: 500,
fontFamily: 'Inter',
cursor: 'pointer',
color: '#6A6968',
borderRadius: '5px',
border: '1px solid transparent',
p: '10px 15px',
bg: 'transparent',
'&:hover': {
backgroundColor: '#2A2A2A',
outline: '0px solid #2A2A2A',
},
},
2022-07-12 01:14:19 +00:00
ctaOutlineYellow: {
boxSizing: 'border-box',
borderColor: 'unset',
2022-07-12 01:14:19 +00:00
border: '1px solid $omnivoreCtaYellow',
fontSize: '14px',
2022-07-12 01:14:19 +00:00
fontWeight: 500,
fontStyle: 'normal',
fontFamily: 'Inter',
borderRadius: '8px',
cursor: 'pointer',
color: '$utilityTextDefault',
2022-07-12 01:14:19 +00:00
bg: 'transparent',
p: '9px 12px',
},
ctaLightGray: {
border: 0,
fontSize: '14px',
fontWeight: 500,
fontStyle: 'normal',
fontFamily: 'Inter',
borderRadius: '8px',
cursor: 'pointer',
p: '10px 12px',
2023-09-04 05:47:24 +00:00
color: '$thTextContrast2',
bg: 'rgb(125, 125, 125, 0.3)',
'&:hover': {
bg: 'rgb(47, 47, 47, 0.1)',
'.ctaButtonIcon': {
visibility: 'visible',
},
},
'.ctaButtonIcon': {
visibility: 'hidden',
2023-03-02 04:59:31 +00:00
},
},
2022-02-11 17:24:33 +00:00
ctaGray: {
border: 0,
fontSize: '14px',
fontWeight: 500,
fontStyle: 'normal',
fontFamily: 'Inter',
borderRadius: '8px',
cursor: 'pointer',
color: '$omnivoreGray',
bg: '$grayBgActive',
p: '10px 12px',
},
ctaWhite: {
borderRadius: '$3',
px: '$3',
py: '$2',
2023-06-07 10:12:19 +00:00
gap: '5px',
2022-02-11 17:24:33 +00:00
cursor: 'pointer',
border: '1px solid $grayBgSubtle',
bg: '$grayBgSubtle',
'&:hover': {
border: '1px solid $grayBorderHover',
},
},
2023-06-07 10:12:19 +00:00
outline: {
display: 'flex',
borderRadius: '5px',
alignItems: 'center',
px: '15px',
py: '5px',
gap: '10px',
fontSize: '12px',
fontWeight: '600',
fontFamily: '$inter',
cursor: 'pointer',
2023-06-21 05:55:20 +00:00
border: '1px solid $thBorderColor',
2023-06-07 10:12:19 +00:00
bg: 'transparent',
'&:hover': {
border: '1px solid $grayBorderHover',
},
},
cancel: {
display: 'flex',
borderRadius: '5px',
alignItems: 'center',
px: '15px',
py: '5px',
gap: '10px',
fontSize: '12px',
fontWeight: '600',
fontFamily: '$inter',
cursor: 'pointer',
bg: '$thBackground4',
border: '1px solid $thBackground4',
'&:hover': {
border: '1px solid $grayBorderHover',
},
},
2022-02-11 17:24:33 +00:00
modalOption: {
style: 'ghost',
height: '52px',
width: '100%',
textAlign: 'left',
verticalAlign: 'middle',
color: '#0A0806',
backgroundColor: 'unset',
outlineColor: 'rgba(0, 0, 0, 0)',
border: '1px solid rgba(0, 0, 0, 0.06)',
cursor: 'pointer',
},
ctaModal: {
height: '32px',
verticalAlign: 'middle',
2023-03-09 05:18:44 +00:00
color: '$thTextContrast',
backgroundColor: '$grayBase',
fontWeight: '600',
padding: '0px 12px',
fontSize: '16px',
border: '1px solid $grayBorder',
cursor: 'pointer',
borderRadius: '8px',
},
2022-02-11 17:24:33 +00:00
ctaSecondary: {
color: '$grayText',
border: 'none',
bg: 'transparent',
'&:hover': {
opacity: 0.8,
},
},
ctaPill: {
2023-11-06 09:43:23 +00:00
cursor: 'pointer',
borderRadius: '15px',
2023-11-08 03:27:21 +00:00
px: '12px',
py: '5px',
font: '$inter',
fontSize: '12px',
2024-02-08 11:03:22 +00:00
fontWeight: '500',
2023-11-08 03:27:21 +00:00
whiteSpace: 'nowrap',
color: '$thLibraryMenuPrimary',
border: '1px solid $thLeftMenuBackground',
2024-02-08 11:03:22 +00:00
bg: '$thBackgroundActive',
2022-02-11 17:24:33 +00:00
'&:hover': {
2023-11-08 03:27:21 +00:00
bg: '$thBackgroundActive',
border: '1px solid $thBackgroundActive',
2023-11-06 09:43:23 +00:00
},
},
ctaPillUnselected: {
cursor: 'pointer',
borderRadius: '15px',
2023-11-08 03:27:21 +00:00
px: '12px',
py: '5px',
2024-02-08 11:03:22 +00:00
bg: 'transparent',
2023-11-06 09:43:23 +00:00
font: '$inter',
fontSize: '12px',
2024-02-08 11:03:22 +00:00
fontWeight: '500',
2023-11-08 03:27:21 +00:00
whiteSpace: 'nowrap',
border: '1px solid $thBackground4',
2023-11-06 09:43:23 +00:00
'&:hover': {
2023-11-08 03:27:21 +00:00
bg: '$thBackgroundActive',
border: '1px solid $thBackgroundActive',
2022-02-11 17:24:33 +00:00
},
},
link: {
border: 'none',
bg: 'transparent',
2023-09-30 04:46:23 +00:00
fontSize: '14px',
fontWeight: 'regular',
fontFamily: '$display',
color: '$thLibraryMenuUnselected',
cursor: 'pointer',
},
2024-02-08 07:01:40 +00:00
tab: {
px: '15px',
py: '6px',
border: 'none',
bg: 'transparent',
fontSize: '12px',
fontWeight: '500',
fontFamily: '$inter',
2024-02-09 04:06:22 +00:00
color: '$tabTextUnselected',
2024-02-08 07:01:40 +00:00
cursor: 'pointer',
borderRadius: '5px',
'&:hover': {
color: '$thTextContrast',
},
},
tabSelected: {
px: '15px',
py: '6px',
border: 'none',
2024-02-09 04:06:22 +00:00
bg: '#6A6968',
2024-02-08 07:01:40 +00:00
fontSize: '12px',
fontWeight: '500',
fontFamily: '$inter',
2024-02-09 04:06:22 +00:00
color: 'white',
2024-02-08 07:01:40 +00:00
cursor: 'pointer',
borderRadius: '5px',
2024-02-09 04:06:22 +00:00
// '&:hover': {
// color: '$thTextContrast',
// },
2024-02-08 07:01:40 +00:00
},
2022-02-11 17:24:33 +00:00
squareIcon: {
mx: '$1',
display: 'flex',
alignItems: 'center',
fontWeight: 500,
height: 44,
width: 44,
justifyContent: 'center',
textAlign: 'center',
background: '$grayBase',
cursor: 'pointer',
border: 'none',
borderRight: '1px solid $grayText',
opacity: 0.9,
'&:hover': {
opacity: 1,
},
},
plainIcon: {
bg: 'transparent',
border: 'none',
cursor: 'pointer',
'&:hover': {
opacity: 0.7,
2022-02-11 17:24:33 +00:00
},
},
2023-08-24 04:00:35 +00:00
highlightBarIcon: {
p: '0px',
lineHeight: '0px',
bg: 'transparent',
border: 'none',
cursor: 'pointer',
'&:hover': {
opacity: 0.5,
},
},
articleActionIcon: {
bg: 'transparent',
border: 'none',
cursor: 'pointer',
padding: '4px',
borderRadius: '5px',
'&:hover': {
opacity: 0.7,
},
},
hoverActionIcon: {
bg: 'transparent',
border: 'none',
cursor: 'pointer',
padding: '4px',
2023-06-26 04:30:15 +00:00
height: '100%',
2023-08-01 09:44:21 +00:00
pt: '5px',
2023-06-27 03:51:12 +00:00
minWidth: '25px',
'&:hover': {
2023-06-26 04:30:15 +00:00
bg: '$grayBgHover',
},
},
2022-02-11 17:24:33 +00:00
ghost: {
color: 'transparent',
border: 'none',
bg: 'transparent',
cursor: 'pointer',
2022-02-11 17:24:33 +00:00
'&:hover': {
opacity: 0.8,
},
},
themeSwitch: {
p: '0px',
m: '0px',
2022-02-11 17:24:33 +00:00
ml: '0px',
width: '60px',
height: '48px',
2022-02-11 17:24:33 +00:00
fontSize: '14px',
border: 'unset',
borderRadius: '6px',
'&:hover': {
transform: 'scale(1.1)',
border: '2px solid #F9D354',
},
'&[data-state="selected"]': {
border: '2px solid #F9D354',
2023-03-02 04:59:31 +00:00
},
2022-02-11 17:24:33 +00:00
},
},
},
defaultVariants: {
style: 'ctaWhite',
},
})
2022-07-19 21:29:52 +00:00
export const IconButton = styled(Button, {
variants: {
style: {
ctaWhite: {
color: 'red',
padding: '10px',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
border: '1px solid $grayBorder',
boxSizing: 'border-box',
borderRadius: 6,
width: 40,
height: 40,
},
2023-03-06 07:39:03 +00:00
searchButton: {
2023-03-06 07:55:06 +00:00
cursor: 'pointer',
2023-03-06 07:39:03 +00:00
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
p: '0px',
mr: '5px',
width: '28px',
height: '28px',
color: '#898989',
border: 'unset',
2023-06-12 05:57:42 +00:00
background: 'transparent',
2023-03-06 07:39:03 +00:00
boxSizing: 'border-box',
borderRadius: 6,
},
2022-07-19 21:29:52 +00:00
},
},
2023-03-02 04:59:31 +00:00
})