UNPKG

@braineet/ui

Version:

Braineet design system

42 lines 1.61 kB
import _shouldForwardProp from '@styled-system/should-forward-prop'; import styled, { css } from 'styled-components'; import { compose, space, typography, layout, flexbox, grid, border, position, shadow, color, background, variant } from 'styled-system'; import { acceptedProperties, additionalProperties } from './cssProperties'; var clearFix = function clearFix(props) { return props.clearFix && css(["&::after{content:'';display:table;clear:both;}"]); }; var styleProps = css(["", " ", " ", ""], clearFix, compose(typography, space, layout, flexbox, grid, border, position, shadow, color, background, additionalProperties), variant({ prop: 'isTruncated', variants: { true: { textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' } } })); export var DefaultBox = styled('div').withConfig({ displayName: "styled__DefaultBox", componentId: "sc-1f7hj3q-0" })(["", ""], styleProps); export var Box = styled('div').withConfig({ shouldForwardProp: function shouldForwardProp(props, defaultValidatorFn) { return _shouldForwardProp(props) && !acceptedProperties.includes(props) && defaultValidatorFn(props); } }).withConfig({ displayName: "styled__Box", componentId: "sc-1f7hj3q-1" })(["", ""], styleProps); export var getCssProperties = function getCssProperties(cssProps) { var properties = {}; if (cssProps) { var keys = Object.keys(cssProps); keys.forEach(function (property) { if (acceptedProperties.includes(property)) { properties[property] = cssProps[property]; } }); } return properties; }; export default {};