Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
18470a9
docs: add vite-plugin-mdx-vue and vite-plugin-components
koca Apr 8, 2021
6165f33
chore: update yarn.lock
koca Apr 8, 2021
579e0a0
feat(color-mode): add useColorModeValue
koca Apr 8, 2021
441f9f2
docs: add mdx layout component and init layouts
koca Apr 8, 2021
742b116
feat(layout): add layout package and link component
koca Apr 9, 2021
5a16f7c
refactor(badge): move badge component to layout
koca Apr 9, 2021
110d0d6
fix(theme-tools): change warn
koca Apr 9, 2021
f679297
chore(playground): add padding bottom to sidebar
koca Apr 9, 2021
26f59e4
chore: change deps
koca Apr 9, 2021
d41091f
chore: add ts-ignore to icon button
koca Apr 9, 2021
f7b25d3
chore: update yarn.lock
koca Apr 9, 2021
60cba50
feat(chakra): resolve global components like router-link
koca Apr 9, 2021
de30073
chore(link): update jsdoc and example
koca Apr 9, 2021
4f40fb9
test(chakra): add anchor check
koca Apr 9, 2021
51e019d
feat(core): export layout components
koca Apr 10, 2021
ca8b1d7
chore: remove manual imports
koca Apr 10, 2021
c816e59
build: ignore dist folders
koca Apr 10, 2021
44b4295
fix(color-mode): reactive useColorModeValue
koca Apr 10, 2021
596f622
fix(test): fix a11y tests warning ( [Vue warn]: Component is missing …
koca Apr 10, 2021
64a3acf
test: add typing for tests
koca Apr 10, 2021
6210c1f
fix(close-button): fix aria-hidden and refactor tests
koca Apr 10, 2021
59dc24a
fix(playground): fix warnings and refactor sidebar
koca Apr 10, 2021
6f07f65
fix(close-button): fix slot warning
koca Apr 10, 2021
3f881a6
fix(spinner): fix slot warning
koca Apr 10, 2021
47c4801
feat(playground): add padding to sidebar again :D
koca Apr 10, 2021
59492fe
chore: remove vue-layout dep
koca Apr 10, 2021
1f466f4
feat(vue-utils): add reusable themingProps
koca Apr 10, 2021
cbc55a0
test(layout): refactor tests
koca Apr 10, 2021
31a83aa
chore(layout): rename stuff
koca Apr 10, 2021
56ac6dc
chore(layout): add labels
koca Apr 10, 2021
f651213
chore: update snapshots
koca Apr 10, 2021
5b5bc35
feat(system): export styled system from vue-system package
koca Apr 10, 2021
5eca8fd
feat(utils): add getValidChildren helper
koca Apr 10, 2021
fb44384
feat(layout): add stack component, tests, examples
koca Apr 10, 2021
e13d388
feat(layout): add AspectRatio component, tests, example
koca Apr 10, 2021
bd51723
chore(layout): add jsdoc
koca Apr 10, 2021
99e37c1
feat(layout): add Box, Square, Circle component, tests, examples
koca Apr 10, 2021
7a6a2e2
feat(layout): add Center component, test, example
koca Apr 10, 2021
51d59eb
chore: remove unnessary export
koca Apr 11, 2021
ee085d9
feat(types): add HTMLChakraProps typings
koca Apr 11, 2021
1177234
types(box): fix typing
koca Apr 11, 2021
e27efac
refactor(stack): change types
koca Apr 11, 2021
2715911
chore: ups autoimport
koca Apr 11, 2021
360b787
refactor(types): update ThemingProps
koca Apr 11, 2021
4554515
refactor: fix type errors
koca Apr 11, 2021
fcbc71f
fix(theme): add missing imports exports
koca Apr 11, 2021
13df44d
feat(layout): add Container component, test, example
koca Apr 11, 2021
3c5e4f0
feat(layout): add divider component, test, examples
koca Apr 11, 2021
15f7e41
chore: update container jsdoc
koca Apr 11, 2021
506c584
chore: remove unused stuff, eslint hello?
koca Apr 11, 2021
2ccd903
feat(layout): add Grid component, test, examples
koca Apr 11, 2021
7aeb7b3
fix(stack): remove default direction
koca Apr 11, 2021
507b65e
feat(layout): add Heading component, test, examples
koca Apr 11, 2021
7d2c954
feat(layout): add Kbd component, test, example
koca Apr 11, 2021
4aa2d9a
fix(layout): add missing theme props
koca Apr 11, 2021
5966d90
feat(link): add types
koca Apr 12, 2021
61a82eb
feat(layout): add LinkBox and LinkOverlay component, test, example
koca Apr 12, 2021
42fb4af
feat(layout): add Badge types
koca Apr 12, 2021
680c805
chore(divider): remove unnecessary stuff
koca Apr 12, 2021
8ed8f57
feat(layout): add AspectRatio types
koca Apr 12, 2021
89c045d
fix(layout): remove label from BoxProps
koca Apr 12, 2021
bec11ff
refactor(layout): refactor box, square, circle label
koca Apr 12, 2021
d6713c9
feat(icon): add types
koca Apr 12, 2021
bee8a00
feat(layout): add List, ListItem, ListIcon, OrderedList, UnorderedLis…
koca Apr 12, 2021
acc7e3a
chore(layout): update list example
koca Apr 12, 2021
1194dbf
chore: various fixes
koca Apr 13, 2021
8fd3546
chore: change class to label
koca Apr 13, 2021
efc2a80
feat(system): add short version of prop types
koca Apr 13, 2021
f4d7b0a
refactor(layout): refactor Grid component
koca Apr 13, 2021
474ea57
feat(layout): add SimpleGrid component, test, examples
koca Apr 13, 2021
2438b3f
chore: remove console.log
koca Apr 13, 2021
9152bd8
feat(layout): add Spacer component, test, example
koca Apr 13, 2021
13dd4bf
chore: rename props
koca Apr 13, 2021
ffb10cc
chore: update types
koca Apr 13, 2021
df6d7aa
fix(system): remove userStyleConfig and add optional chaining
koca Apr 13, 2021
ab083d4
feat(layout): add Text component, test, examples
koca Apr 13, 2021
2449f4d
chore: remove unnecessary file
koca Apr 13, 2021
53f551d
fix(system): fix chakraProps typings
koca Apr 13, 2021
8195e4f
chore(types): update types
koca Apr 13, 2021
e72d94b
chore(layout): move code block
koca Apr 13, 2021
5161d28
fix(layout): fix box issues and cleanup
koca Apr 13, 2021
619e65a
fix(layout): refactor divider and fix orientation
koca Apr 13, 2021
3b11d0b
fix(layout): fix kebab case prop
koca Apr 13, 2021
d9eb505
chore: fix eslint stuff
koca Apr 13, 2021
ff2bc6b
chore(layout): update examples
koca Apr 13, 2021
9b35c96
test(button): update snapshots
koca Apr 13, 2021
4997293
Merge branch 'develop' of https://github.com/chakra-ui/chakra-ui-vue-…
codebender828 Apr 14, 2021
520550f
ci: create changeset
codebender828 Apr 14, 2021
0d36308
fix: update import path
codebender828 Apr 14, 2021
ecbbc1b
ci: include component resolver changeset
codebender828 Apr 14, 2021
4c5aaec
chore: fix dependencies for tooling auto-import
codebender828 Apr 14, 2021
47c0cbd
fix(c-popper): build depenency management for vite
codebender828 Apr 14, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions packages/c-badge/CHANGELOG.md

This file was deleted.

11 changes: 0 additions & 11 deletions packages/c-badge/README.md

This file was deleted.

3 changes: 0 additions & 3 deletions packages/c-badge/examples/base-badge.vue

This file was deleted.

19 changes: 0 additions & 19 deletions packages/c-badge/examples/outline-badges.vue

This file was deleted.

19 changes: 0 additions & 19 deletions packages/c-badge/examples/solid-badge.vue

This file was deleted.

19 changes: 0 additions & 19 deletions packages/c-badge/examples/subtle-badges.vue

This file was deleted.

1 change: 0 additions & 1 deletion packages/c-badge/src/index.ts

This file was deleted.

11 changes: 0 additions & 11 deletions packages/c-badge/tests/__snapshots__/c-badge.test.ts.snap

This file was deleted.

22 changes: 0 additions & 22 deletions packages/c-badge/tests/c-badge.test.ts

This file was deleted.

2 changes: 2 additions & 0 deletions packages/c-button/src/icon-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ const CIconButton = defineComponent({
...props,
},
() => [
// whats the problem here?
// @ts-ignore
h(CIcon, {
name: props.icon,
}),
Expand Down
31 changes: 21 additions & 10 deletions packages/c-color-mode/src/color-mode-provider.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
import { __DEV__ } from '@chakra-ui/utils'
import { createContext } from '@chakra-ui/vue-utils'
import {
defineComponent,
Fragment,
getCurrentInstance,
h,
inject,
isRef,
ref,
} from 'vue'
import { inject, isRef, ref } from 'vue'
import { ColorMode } from './color-mode.utils'

export type { ColorMode }
Expand Down Expand Up @@ -41,3 +32,23 @@ export const useColorMode = (): ColorModeContext => {
toggleColorMode,
}
}

/**
* Change value based on color mode.
*
* @param light the light mode value
* @param dark the dark mode value
*
* @example
*
* ```js
* const Icon = useColorModeValue(MoonIcon, SunIcon)
* ```
*/
export function useColorModeValue<TLight = unknown, TDark = unknown>(
light: TLight,
dark: TDark
) {
const { colorMode } = useColorMode()
return colorMode.value === 'dark' ? dark : light
}
1 change: 0 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"dependencies": {
"@chakra-ui/c-accordion": "0.1.0-alpha.1",
"@chakra-ui/c-alert": "1.0.0-alpha.1",
"@chakra-ui/c-badge": "1.0.0-alpha.1",
"@chakra-ui/c-button": "1.0.0-alpha.1",
"@chakra-ui/c-close-button": "0.1.0-alpha.1",
"@chakra-ui/c-color-mode": "0.1.0-alpha.1",
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export * from '@chakra-ui/c-alert'

// B
export const CBox = chakra.div
export * from '@chakra-ui/c-badge'
export * from '@chakra-ui/c-button'

// C
Expand Down
11 changes: 11 additions & 0 deletions packages/layout/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# @chakra-ui/layout

Chakra ui layout components that give you massive speed

## Installation

```sh
yarn add @chakra-ui/layout
# or
npm i @chakra-ui/layout
```
48 changes: 48 additions & 0 deletions packages/layout/examples/base-badge.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<template>
<chakra.div py="4">
<chakra.h3>Default Badge</chakra.h3>
<c-badge> New ! </c-badge>
</chakra.div>
<chakra.div py="4">
<chakra.h3>Outline Badges</chakra.h3>
<c-badge
v-for="(color, i) in colorSchemes"
:key="i"
:color-scheme="color"
variant="outline"
mr="2"
>
{{ color }}
</c-badge>
</chakra.div>
<chakra.div py="4">
<chakra.h3>Solid Badges</chakra.h3>
<c-badge
v-for="(color, i) in colorSchemes"
:key="i"
:color-scheme="color"
variant="solid"
mr="2"
>
{{ color }}
</c-badge>
</chakra.div>
<chakra.div py="4">
<chakra.h3>Subtle Badges</chakra.h3>
<c-badge
v-for="(color, i) in colorSchemes"
:key="i"
:color-scheme="color"
variant="subtle"
mr="2"
>
{{ color }}
</c-badge>
</chakra.div>
</template>
<script setup>
import { CBadge } from '@chakra-ui/vue-layout'
import { ref } from 'vue'

const colorSchemes = ref(['gray', 'green', 'red', 'orange', 'purple', 'teal'])
</script>
13 changes: 13 additions & 0 deletions packages/layout/examples/base-link.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<template>
<chakra.div py="4">
<chakra.h3>Link</chakra.h3>
<chakra.div py="4">
<!-- prettier-ignore -->
<c-link as="router-link" to="/" pr="4" color="blue.400" color-scheme="red">CLink with as="router-link"</c-link>
<c-link is-external href="/" color-scheme="red">CLink</c-link>
</chakra.div>
</chakra.div>
</template>
<script setup>
import { CLink } from '@chakra-ui/vue-layout'
</script>
File renamed without changes.
23 changes: 12 additions & 11 deletions packages/c-badge/package.json → packages/layout/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@chakra-ui/c-badge",
"description": "Chakra UI Vue | Badges are used to highlight an item s status for quick recognition component",
"version": "1.0.0-alpha.1",
"name": "@chakra-ui/vue-layout",
"description": "Chakra UI Vue | Chakra ui layout components that give you massive speed component",
"version": "0.1.0-alpha.1",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "dist/types/index.d.ts",
Expand All @@ -21,7 +21,10 @@
"publishConfig": {
"access": "public"
},
"repository": "https://github.com/chakra-ui/chakra-ui-vue-next/tree/master/packages/c-badge",
"repository": {
"type": "git",
"url": "git+https://github.com/chakra-ui/chakra-ui-vue-next.git"
},
"bugs": {
"url": "https://github.com/chakra-ui/chakra-ui-vue-next/issues"
},
Expand All @@ -37,14 +40,12 @@
"watch:types": "cross-env tsc --emitDeclarationOnly --declaration --declarationDir dist/types --watch --incremental"
},
"dependencies": {
"@chakra-ui/utils": "^1.5.0",
"@chakra-ui/vue-system": "0.1.0-alpha.1"
},
"devDependencies": {
"vue": ">=3.0.5"
"@chakra-ui/styled-system": "^1.9.0",
"@chakra-ui/vue-system": "0.1.0-alpha.1",
"@chakra-ui/vue-utils": "0.1.0-alpha.1",
"@chakra-ui/vue-layout": "0.1.0-alpha.1"
},
"peerDependencies": {
"@chakra-ui/vue-system": "0.1.0-alpha.1",
"vue": "^3.0.5"
"vue": ">=3.0.5"
}
}
10 changes: 3 additions & 7 deletions packages/c-badge/src/badge.ts → packages/layout/src/badge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ import {
useStyleConfig,
} from '@chakra-ui/vue-system'
import { filterUndefined } from '@chakra-ui/utils'
import { vueThemingProps } from './utils'

const CBadge = defineComponent({
export const CBadge = defineComponent({
props: {
as: {
type: [Object, String] as PropType<DOMElements>,
default: 'div',
},
colorScheme: String as PropType<ThemingProps['colorScheme']>,
variant: String as PropType<ThemingProps['variant']>,
size: String as PropType<ThemingProps['size']>,
styleConfig: String as PropType<ThemingProps['styleConfig']>,
...vueThemingProps,
},
setup(props, { slots, attrs }) {
return () => {
Expand Down Expand Up @@ -46,5 +44,3 @@ const CBadge = defineComponent({
}
},
})

export default CBadge
2 changes: 2 additions & 0 deletions packages/layout/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './link'
export * from './badge'
Loading