@chayns-components/core
Version:
A set of beautiful React components for developing your own applications with chayns.
110 lines (105 loc) • 2.55 kB
JavaScript
import { motion } from 'motion/react';
import styled, { css } from 'styled-components';
export const StyledMotionButton = styled(motion.button)`
${_ref => {
let {
$shouldShowTextAsRobotoMedium,
$shouldShowAsSelectButton
} = _ref;
return $shouldShowTextAsRobotoMedium && !$shouldShowAsSelectButton && css`
font-size: 110%;
font-family: 'Roboto Medium', serif;
`;
}}
align-items: center;
${_ref2 => {
let {
$isSecondary,
$shouldShowAsSelectButton,
theme
} = _ref2;
if ($isSecondary || $shouldShowAsSelectButton) {
return css`
color: ${theme.text};
`;
}
return css`
color: ${theme.buttonDesign === '2' ? theme.buttonColor ?? theme.buttonBackgroundColor ?? 'white' : theme.buttonColor ?? 'white'};
`;
}}
${_ref3 => {
let {
theme,
$isSecondary,
$shouldShowAsSelectButton
} = _ref3;
if (theme.buttonDesign === '2' && !$shouldShowAsSelectButton) {
return css`
border: 1px solid ${$isSecondary ? theme['202'] : theme.buttonBackgroundColor};
box-shadow: none;
`;
}
return css`
border: none;
box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.2);
`;
}}
border-radius: 3px;
cursor: ${_ref4 => {
let {
$isDisabled
} = _ref4;
return $isDisabled ? 'default' : 'pointer';
}};
display: inline-flex;
line-height: 22px;
min-height: 32px;
position: relative;
user-select: none;
${_ref5 => {
let {
$hasIcon,
$hasChildren,
$shouldShowWaitCursor
} = _ref5;
if ($shouldShowWaitCursor) {
return css`
padding: 4px 12px;
`;
}
if ($hasIcon) {
if ($hasChildren) {
return css`
padding: 6px 12px 6px 42px;
`;
}
return css`
padding: 6px 12px 6px 18px;
`;
}
return css`
padding: 6px 12px 6px 12px;
`;
}}
`;
//
export const StyledIconWrapper = styled.span`
align-items: center;
background-color: rgba(255, 255, 255, 0.2);
bottom: 0;
display: flex;
justify-content: center;
left: 0;
position: absolute;
top: 0;
width: 30px;
`;
export const StyledMotionChildrenWrapper = styled(motion.div)`
will-change: unset !important;
`;
export const StyledMotionWaitCursorWrapper = styled(motion.div)`
align-items: center;
display: flex;
justify-content: center;
`;
//# sourceMappingURL=Button.styles.js.map