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

Commit 0d36308

Browse files
committed
fix: update import path
1 parent 520550f commit 0d36308

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

packages/layout/src/text.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,15 @@ export const CText = defineComponent({
4545
...vueThemingProps,
4646
},
4747
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)
4957

5058
const aliasedProps = computed(() =>
5159
filterUndefined({

tooling/auto-import/src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import kebabCase from 'lodash.kebabcase'
1+
import * as ChakraComponenets from '@chakra-ui/vue-next'
22

33
export const componentResolver = (name: string) => {
4-
if (kebabCase(name).startsWith('c-'))
4+
if (name in ChakraComponenets) {
55
return {
66
importName: name,
77
path: `@chakra-ui/vue-next`,
8+
}
89
}
910
}

tooling/auto-import/tests/vue-auto-import.test.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,23 @@ import { componentResolver } from '../src'
22

33
it('should resolve chakra components with import name and path', () => {
44
const components = [
5-
'CColorModeProvider',
5+
'CCloseButton',
66
'CBox',
7-
'CPortal'
7+
'CPortal',
8+
'CHStack',
9+
'CVStack',
10+
'CBox',
11+
'CCircle',
12+
'CSquare',
13+
'CKbd',
814
]
915

1016
const path = '@chakra-ui/vue-next'
1117

1218
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+
})

0 commit comments

Comments
 (0)