UNPKG

@chayns-components/date

Version:

A set of beautiful React components for developing your own applications with chayns.

123 lines (120 loc) 2.71 kB
import styled, { css } from 'styled-components'; export const StyledDay = styled.div` position: relative; cursor: ${_ref => { let { $isSameMonth, $isDisabled } = _ref; return $isSameMonth && !$isDisabled ? 'pointer' : 'default'; }}; color: ${_ref2 => { let { theme } = _ref2; return theme.text; }}; opacity: ${_ref3 => { let { $isSameMonth, $isDisabled } = _ref3; if ($isSameMonth && !$isDisabled) { return '1'; } if ($isDisabled) { return '0.2'; } return '0.5'; }}; display: flex; flex-direction: column; align-items: center; justify-content: center; aspect-ratio: 1; pointer-events: ${_ref4 => { let { $isSameMonth, $isDisabled } = _ref4; return $isSameMonth && !$isDisabled ? 'auto' : 'none'; }}; ${_ref5 => { let { $backgroundColor, $textColor } = _ref5; return $backgroundColor && $textColor && css` color: ${$textColor}; background-color: ${$backgroundColor}; `; }} `; export const StyledDayNumber = styled.div` border-radius: 50%; display: flex; align-items: center; justify-content: center; width: 80%; height: 80%; font-size: 90%; ${_ref6 => { let { $isSelected, $isIntervalEnd, $isIntervalStart, $isWithinIntervalSelection, $customThumbColors, theme } = _ref6; return !!($isSelected || $isIntervalStart || $isIntervalEnd || $isWithinIntervalSelection) && css` background-color: ${$customThumbColors?.mainBackgroundColor ?? theme['404']}; color: ${$customThumbColors?.mainTextColor ?? theme['409']}; `; }} ${_ref7 => { let { $isIntervalStart, $isIntervalEnd, $isWithinIntervalSelection, $customThumbColors, theme } = _ref7; if ($isIntervalStart && $isIntervalEnd) { return css` border-radius: 5px; width: 100%; `; } if ($isIntervalStart) { return css` border-radius: 5px 0 0 5px; width: 100%; `; } if ($isIntervalEnd) { return css` border-radius: 0 5px 5px 0; width: 100%; `; } if ($isWithinIntervalSelection) { return css` border-radius: 0; width: 100%; background-color: ${$customThumbColors?.secondaryBackgroundColor ?? theme['403']}; `; } return ''; }} `; export const StyledDayCategoryWrapper = styled.div` display: flex; align-items: center; justify-content: center; gap: 6%; width: 100%; position: absolute; bottom: 2px; `; //# sourceMappingURL=Day.styles.js.map