This repository was archived by the owner on Sep 20, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +26
-8
lines changed Expand file tree Collapse file tree 3 files changed +26
-8
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,15 @@ export const CText = defineComponent({
45
45
...vueThemingProps ,
46
46
} ,
47
47
setup ( props , { slots, attrs } ) {
48
- const styles = useStyleConfig ( 'Text' , props )
48
+ const themingProps = computed < ThemingProps > ( ( ) =>
49
+ filterUndefined ( {
50
+ colorScheme : props . colorScheme ,
51
+ variant : props . variant ,
52
+ size : props . size ,
53
+ styleConfig : props . styleConfig ,
54
+ } )
55
+ )
56
+ const styles = useStyleConfig ( 'Text' , themingProps . value )
49
57
50
58
const aliasedProps = computed ( ( ) =>
51
59
filterUndefined ( {
Original file line number Diff line number Diff line change 1
- import kebabCase from 'lodash.kebabcase '
1
+ import * as ChakraComponenets from '@chakra-ui/vue-next '
2
2
3
3
export const componentResolver = ( name : string ) => {
4
- if ( kebabCase ( name ) . startsWith ( 'c-' ) )
4
+ if ( name in ChakraComponenets ) {
5
5
return {
6
6
importName : name ,
7
7
path : `@chakra-ui/vue-next` ,
8
+ }
8
9
}
9
10
}
Original file line number Diff line number Diff line change @@ -2,14 +2,23 @@ import { componentResolver } from '../src'
2
2
3
3
it ( 'should resolve chakra components with import name and path' , ( ) => {
4
4
const components = [
5
- 'CColorModeProvider ' ,
5
+ 'CCloseButton ' ,
6
6
'CBox' ,
7
- 'CPortal'
7
+ 'CPortal' ,
8
+ 'CHStack' ,
9
+ 'CVStack' ,
10
+ 'CBox' ,
11
+ 'CCircle' ,
12
+ 'CSquare' ,
13
+ 'CKbd' ,
8
14
]
9
15
10
16
const path = '@chakra-ui/vue-next'
11
17
12
18
components . forEach ( ( templateComponent : string ) => {
13
- expect ( componentResolver ( templateComponent ) ) . toEqual ( { importName : templateComponent , path } )
14
- } ) ;
15
- } )
19
+ expect ( componentResolver ( templateComponent ) ) . toEqual ( {
20
+ importName : templateComponent ,
21
+ path,
22
+ } )
23
+ } )
24
+ } )
You can’t perform that action at this time.
0 commit comments