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

Commit

Permalink
feat(pseudobox): added pseudo props to pseudobox component
Browse files Browse the repository at this point in the history
  • Loading branch information
codebender828 committed Oct 21, 2019
1 parent 1d475dd commit fea44d1
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 7 deletions.
46 changes: 40 additions & 6 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<template>
<theme-provider :theme="theme">
{{ state.greeting }}
<Button variant="ghost" color="success" size="lg" @click="increment">{{ state.buttonText }}</Button>
{{ incrementState.greeting }}
<Button variant="ghost" color="success" size="lg" @click="increment">{{ incrementState.buttonText }}</Button>
<br>
<h1>{{ state.count }}</h1>
<h1>{{ incrementState.count }}</h1>
<br>
<Box bg="yellow.200" border-left="4px" font-family="body" rounded="md" mb="5" shadow="md" p="3" color="yellow.800">
<Box font-family="heading" font-size="3xl" mb="2">Random Title</Box>
Expand All @@ -28,6 +28,23 @@
>
Pseudobox here
</PseudoBox>
<Box
rounded="md"
overflow="hidden"
mt="4"
>
<PseudoBox
v-for="(box, index) in boxes"
:key="index"
px="4"
py="2"
bg="white"
:_hover="{ opacity: '80%' }"
:_odd="{ bg: 'gray.100' }"
>
{{ box.name }}
</PseudoBox>
</Box>
</theme-provider>
</template>

Expand All @@ -37,13 +54,30 @@ import Button from './components/Button'
import { Box, PseudoBox } from './lib/core/'
import theme from './lib/theme'
import { useIncrement } from './use-increment'
import { reactive } from '@vue/composition-api'
export default {
setup () {
const { state, increment } = useIncrement()
const { state: incrementState, increment } = useIncrement()
const state = reactive({
boxes: [
{
id: 1,
name: 'Box 1'
},
{
id: 2,
name: 'Box 2'
},
{
id: 3,
name: 'Box 3'
}
]
})
return {
state,
...state,
incrementState,
increment,
theme
}
Expand Down
1 change: 1 addition & 0 deletions src/lib/config/props/props.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const baseProps = {
fontSize: [String, Array],
textAlign: [String, Array],
textDecoration: [String, Array],
overflow: [String, Array],
overflowX: [String, Array],
overflowY: [String, Array],
textTransform: [String, Array],
Expand Down
23 changes: 22 additions & 1 deletion src/lib/config/props/pseudo.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
const pseudoProps = {
_hover: [Object, String, Array],
_active: [Object, String, Array],
_focus: [Object, String, Array]
_focus: [Object, String, Array],
_odd: [Object, String, Array],
_visited: [Object, String, Array],
_even: [Object, String, Array],
_disabled: [Object, String, Array],
_checked: [Object, String, Array],
_mixed: [Object, String, Array],
_selected: [Object, String, Array],
_invalid: [Object, String, Array],
_pressed: [Object, String, Array],
_readOnly: [Object, String, Array],
_first: [Object, String, Array],
_last: [Object, String, Array],
_expanded: [Object, String, Array],
_grabbed: [Object, String, Array],
_notFirst: [Object, String, Array],
_notLast: [Object, String, Array],
_groupHover: [Object, String, Array],
_before: [Object, String, Array],
_after: [Object, String, Array],
_focusWithin: [Object, String, Array],
_placeholder: [Object, String, Array]
}

export default pseudoProps

0 comments on commit fea44d1

Please # to comment.