UNPKG

baseui

Version:

A React Component library implementing the Base design language

86 lines (83 loc) 2.38 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StyledRow = exports.StyledRoot = void 0; var _styles = require("../styles"); /* Copyright (c) Uber Technologies, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. */ // @ts-ignore function getAnimationColor(props) { const { $theme } = props; return `linear-gradient(135deg, ${$theme.colors.backgroundTertiary}, ${$theme.colors.backgroundTertiary}, ${$theme.colors.backgroundTertiary}, ${$theme.colors.backgroundTertiary}, ${$theme.colors.backgroundTertiary}, ${$theme.colors.backgroundTertiary}, ${$theme.colors.backgroundSecondary}, ${$theme.colors.backgroundTertiary}, ${$theme.colors.backgroundTertiary}, ${$theme.colors.backgroundTertiary}, ${$theme.colors.backgroundTertiary}, ${$theme.colors.backgroundTertiary}, ${$theme.colors.backgroundTertiary})`; } const animationStyle = { animationTimingFunction: 'ease-out', animationDuration: '1.5s', animationIterationCount: 'infinite', backgroundSize: '400% 100%', animationName: { '0%': { backgroundPosition: '100% 50%' }, '100%': { backgroundPosition: '0% 50%' } } }; const StyledRoot = exports.StyledRoot = (0, _styles.styled)('div', props => { if (typeof props.$rows === 'number' && props.$rows !== 0) { return { display: 'flex', flexDirection: 'column', height: props.$height, width: props.$width }; } return { ...(props.$animation ? { ...animationStyle, backgroundImage: getAnimationColor(props) } : { backgroundColor: props.$theme.colors.backgroundTertiary }), height: props.$height, width: props.$width }; }); StyledRoot.displayName = "StyledRoot"; StyledRoot.displayName = 'StyledRoot'; const StyledRow = exports.StyledRow = (0, _styles.styled)('div', props => { return { ...(props.$animation ? { ...animationStyle, backgroundImage: getAnimationColor(props) } : { backgroundColor: props.$theme.colors.backgroundTertiary }), width: '100%', flexBasis: '15px', flexGrow: props.$autoSizeRows ? 1 : 0, marginBottom: props.$isLastRow ? '0px' : '10px' }; }); StyledRow.displayName = "StyledRow"; StyledRow.displayName = 'StyledRow';