Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
refactor(props): moved props config to config dir
Browse files Browse the repository at this point in the history
  • Loading branch information
codebender828 committed Oct 20, 2019
1 parent 6f28861 commit 8de50d4
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 41 deletions.
7 changes: 3 additions & 4 deletions src/components/Box/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import styled from 'vue-styled-components'
import pickBy from 'lodash-es/pickBy'
import { background, border, color, borderRadius, flexbox, grid, layout, position, shadow, space, typography, compose } from 'styled-system'
import allProps from './props'
import styledConfig from './config'
import { baseProps, propsConfig } from '../../lib/config/props'

const baseEllipsis = {
overflow: 'hidden',
Expand Down Expand Up @@ -49,7 +48,7 @@ const system = compose(
shadow,
typography,
flexbox,
styledConfig,
propsConfig,
truncate,
clamp
)
Expand All @@ -72,7 +71,7 @@ function cleanProps (props) {
* TODO: Will need to revisit this for Image component.
*/
const Box = styled('div', {
...allProps
...baseProps
})`
${props => {
const sanitizedProps = cleanProps(props)
Expand Down
Empty file.
Empty file.
2 changes: 2 additions & 0 deletions src/lib/config/props/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as baseProps } from './props'
export { default as propsConfig } from './props.config'
File renamed without changes.
39 changes: 2 additions & 37 deletions src/components/Box/props.js → src/lib/config/props/props.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,4 @@
export const baseBoxProps = {
color: String,
w: [Number, String, Array],
minW: [String, Array],
maxW: [String, Array],
h: [Number, String, Array],
minH: [String, Array],
maxH: [String, Array],
d: [String, Array],
lineClamp: [String, Number, Array],
truncate: [Boolean, Number],
px: [Number, String, Array],
py: [Number, String, Array],
m: [Number, String, Array],
mt: [Number, String, Array],
mr: [Number, String, Array],
ml: [Number, String, Array],
mb: [Number, String, Array],
mx: [Number, String, Array],
my: [Number, String, Array],
rounded: [String, Array],
roundedTop: [String, Array],
roundedBottom: [String, Array],
roundedLeft: [String, Array],
roundedRight: [String, Array],
roundedTopRight: [String, Array],
roundedTopLeft: [String, Array],
roundedBottomRight: [String, Array],
roundedBottomLeft: [String, Array],
shadow: [Number, String, Array],
backgroundColor: String,
pos: [String, Array],
borderWidth: [String, Array]
}

const allProps = {
const baseProps = {
color: String,
bg: String,
w: [Number, String, Array],
Expand Down Expand Up @@ -123,4 +88,4 @@ const allProps = {
willChange: [String, Array]
}

export default allProps
export default baseProps
Empty file.
Empty file added src/lib/config/props/pseudo.js
Empty file.

0 comments on commit 8de50d4

Please # to comment.