This repository was archived by the owner on Mar 4, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 427
feat: add chakra-ui-vue #573
Merged
Merged
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
2de9969
add chakra-ui-vue
Easybuoy b75cb81
fix linting errors
Easybuoy 31b1236
fix failing tests
Easybuoy b8eabce
fix failing tests
Easybuoy 2ae4f72
fix lint warnings
Easybuoy 44ad4e3
implement feedback
Easybuoy 2c23786
fix tests
Easybuoy 6a980b3
fix tests
Easybuoy c054b4a
Merge remote-tracking branch 'origin/master' into feat/add-chakra-ui-vue
clarkdo a33b05f
fix inindentation
clarkdo 8c8fab5
fix test
clarkdo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
packages/cna-template/template/frameworks/chakra-ui/layouts/default.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<template> | ||
<div class="container"> | ||
<CThemeProvider> | ||
<CColorModeProvider> | ||
<CBox font-family="body" as="main"> | ||
<CReset /> | ||
<Nuxt /> | ||
</CBox> | ||
</CColorModeProvider> | ||
</CThemeProvider> | ||
</div> | ||
</template> | ||
<script> | ||
import { | ||
CThemeProvider, | ||
CColorModeProvider, | ||
CReset, | ||
CBox | ||
} from '@chakra-ui/vue' | ||
|
||
export default { | ||
name: 'App', | ||
components: { | ||
CThemeProvider, | ||
CColorModeProvider, | ||
CReset, | ||
CBox | ||
} | ||
} | ||
</script> |
6 changes: 6 additions & 0 deletions
6
packages/cna-template/template/frameworks/chakra-ui/package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"dependencies": { | ||
"@chakra-ui/nuxt": "^0.0.7", | ||
"@nuxtjs/emotion": "^0.0.1" | ||
} | ||
} |
168 changes: 168 additions & 0 deletions
168
packages/cna-template/template/frameworks/chakra-ui/pages/index.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
<template> | ||
<div class="container"> | ||
<CBox | ||
v-bind="mainStyles[colorMode]" | ||
d="flex" | ||
w="100vw" | ||
h="100vh" | ||
flex-dir="column" | ||
justify-content="center" | ||
> | ||
<CHeading text-align="center" mb="4"> | ||
⚡️ Hello chakra-ui/vue | ||
</CHeading> | ||
<CFlex justify="center" direction="column" align="center"> | ||
<CBox mb="3"> | ||
<CIconButton | ||
mr="3" | ||
:icon="colorMode === 'light' ? 'moon' : 'sun'" | ||
:aria-label="`Switch to ${ | ||
colorMode === 'light' ? 'dark' : 'light' | ||
} mode`" | ||
@click="toggleColorMode" | ||
/> | ||
<CButton | ||
left-icon="info" | ||
variant-color="blue" | ||
@click="showToast" | ||
> | ||
Show Toast | ||
</CButton> | ||
</CBox> | ||
<CAvatarGroup> | ||
<CAvatar | ||
name="Evan You" | ||
alt="Evan You" | ||
src="https://pbs.twimg.com/profile_images/1206997998900850688/cTXTQiHm_400x400.jpg" | ||
> | ||
<CAvatarBadge size="1.0em" bg="green.500" /> | ||
</CAvatar> | ||
<CAvatar | ||
name="Jonathan Bakebwa" | ||
alt="Jonathan Bakebwa" | ||
src="https://res.cloudinary.com/xtellar/image/upload/v1572857445/me_zqos4e.jpg" | ||
> | ||
<CAvatarBadge size="1.0em" bg="green.500" /> | ||
</CAvatar> | ||
<CAvatar | ||
name="Segun Adebayo" | ||
alt="Segun Adebayo" | ||
src="https://pbs.twimg.com/profile_images/1169353373012897802/skPUWd6e_400x400.jpg" | ||
> | ||
<CAvatarBadge size="1.0em" bg="green.500" /> | ||
</CAvatar> | ||
<CAvatar src="pop"> | ||
<CAvatarBadge size="1.0em" border-color="papayawhip" bg="tomato" /> | ||
</CAvatar> | ||
</CAvatarGroup> | ||
<CButton | ||
left-icon="close" | ||
variant-color="red" | ||
mt="3" | ||
@click="showModal = true" | ||
> | ||
Delete Account | ||
</CButton> | ||
<CModal :is-open="showModal"> | ||
<CModalOverlay /> | ||
<CModalContent> | ||
<CModalHeader>Are you sure?</CModalHeader> | ||
<CModalBody>Deleting user cannot be undone</CModalBody> | ||
<CModalFooter> | ||
<CButton @click="showModal = false"> | ||
Cancel | ||
</CButton> | ||
<CButton | ||
margin-left="3" | ||
variant-color="red" | ||
@click="showModal = false" | ||
> | ||
Delete User | ||
</CButton> | ||
</CModalFooter> | ||
<CModalCloseButton @click="showModal = false" /> | ||
</CModalContent> | ||
</CModal> | ||
</CFlex> | ||
</CBox> | ||
</div> | ||
</template> | ||
|
||
<script lang="js"> | ||
import { | ||
CBox, | ||
CButton, | ||
CAvatarGroup, | ||
CAvatar, | ||
CAvatarBadge, | ||
CModal, | ||
CModalContent, | ||
CModalOverlay, | ||
CModalHeader, | ||
CModalFooter, | ||
CModalBody, | ||
CModalCloseButton, | ||
CIconButton, | ||
CFlex, | ||
CHeading | ||
} from '@chakra-ui/vue' | ||
|
||
export default { | ||
name: 'App', | ||
inject: ['$chakraColorMode', '$toggleColorMode'], | ||
components: { | ||
CBox, | ||
CButton, | ||
CAvatarGroup, | ||
CAvatar, | ||
CAvatarBadge, | ||
CModal, | ||
CModalContent, | ||
CModalOverlay, | ||
CModalHeader, | ||
CModalFooter, | ||
CModalBody, | ||
CModalCloseButton, | ||
CIconButton, | ||
CFlex, | ||
CHeading | ||
}, | ||
data () { | ||
return { | ||
showModal: false, | ||
mainStyles: { | ||
dark: { | ||
bg: 'gray.700', | ||
color: 'whiteAlpha.900' | ||
}, | ||
light: { | ||
bg: 'white', | ||
color: 'gray.900' | ||
} | ||
} | ||
} | ||
}, | ||
computed: { | ||
colorMode () { | ||
return this.$chakraColorMode() | ||
}, | ||
theme () { | ||
return this.$chakraTheme() | ||
}, | ||
toggleColorMode () { | ||
return this.$toggleColorMode | ||
} | ||
}, | ||
methods: { | ||
showToast () { | ||
this.$toast({ | ||
title: 'Account created.', | ||
description: "We've created your account for you.", | ||
status: 'success', | ||
duration: 10000, | ||
isClosable: true | ||
}) | ||
} | ||
} | ||
} | ||
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+273 Bytes
(100%)
packages/create-nuxt-app/test/snapshots/index.test.js.snap
Binary file not shown.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This comment was marked as resolved.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.