This repository was archived by the owner on Sep 20, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-23
lines changed Expand file tree Collapse file tree 2 files changed +7
-23
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ import { css as _css, CSSObject } from '@emotion/css'
23
23
import { extractStyleAttrs } from './system.attrs'
24
24
import { domElements , DOMElements } from './system.utils'
25
25
import { useTheme } from './composables/use-chakra'
26
- import { Theme } from '@chakra-ui/vue-theme'
26
+ // import { Theme } from '@chakra-ui/vue-theme'
27
27
28
28
interface StyleResolverProps extends SystemProps {
29
29
__css ?: SystemStyleObject
@@ -45,7 +45,7 @@ interface StyleResolverProps extends SystemProps {
45
45
46
46
interface StyleResolverOptions extends StyleResolverProps {
47
47
truncateStyle ?: CSSObject
48
- theme ?: Theme
48
+ theme ?: any
49
49
}
50
50
51
51
interface ChakraFactoryOptions extends StyleResolverProps { }
@@ -149,7 +149,7 @@ export const chakra: IChakraFactory = (
149
149
...rest ,
150
150
} )
151
151
152
- const theme = useTheme ( ) as Theme
152
+ const theme = useTheme ( )
153
153
154
154
const layerStyle$ = computed (
155
155
( ) => props . layerStyle || options ?. layerStyle
Original file line number Diff line number Diff line change 1
- import { ColorMode , Theme } from '@chakra-ui/vue-theme '
1
+ import { useColorMode } from '@chakra-ui/c-color-mode '
2
2
import { inject , ref } from 'vue'
3
+ import { Dict } from '@chakra-ui/vue-utils'
3
4
4
5
/** Provides theme object in component context */
5
- export const useTheme = ( ) : Theme => {
6
- const theme = inject ( '$chakraTheme' ) as Theme
6
+ export const useTheme = < T extends object = Dict > ( ) : T => {
7
+ const theme = inject ( '$chakraTheme' ) as T
7
8
return theme
8
9
}
9
10
10
- /** Injects color mode into component instance */
11
- export const useColorMode = ( ) => {
12
- const _colorMode = inject ( '$chakraColorMode' ) as ColorMode
13
- const colorMode = ref ( _colorMode )
14
-
15
- const toggleColorMode = ( ) => {
16
- colorMode . value = 'light'
17
- ? ( colorMode . value = 'dark' )
18
- : ( colorMode . value = 'light' )
19
- }
20
-
21
- return {
22
- colorMode,
23
- toggleColorMode,
24
- }
25
- }
26
-
27
11
/** Single hook to provide theme and color mode values */
28
12
export const useChakra = ( ) => {
29
13
const theme = useTheme ( )
You can’t perform that action at this time.
0 commit comments