@@ -3,18 +3,14 @@ import {
3
3
DOMElements ,
4
4
SystemStyleObject ,
5
5
HTMLChakraProps ,
6
+ DeepPartial ,
7
+ ComponentWithProps ,
6
8
} from '@chakra-ui/vue-system'
7
9
import { computed , defineComponent , h , PropType } from '@vue/runtime-core'
8
10
9
11
export interface BoxProps extends HTMLChakraProps < 'div' > { }
10
12
11
- /**
12
- * Box is the most abstract component on top of which other chakra
13
- * components are built. It renders a `div` element by default.
14
- *
15
- * @see Docs https://vue.chakra-ui.com/docs/layout/box
16
- */
17
- export const CBox = defineComponent ( {
13
+ const CBoxImpl = defineComponent ( {
18
14
props : {
19
15
as : {
20
16
type : [ String , Object ] as PropType < DOMElements > ,
@@ -35,6 +31,14 @@ export const CBox = defineComponent({
35
31
} ,
36
32
} )
37
33
34
+ /**
35
+ * Box is the most abstract component on top of which other chakra
36
+ * components are built. It renders a `div` element by default.
37
+ *
38
+ * @see Docs https://vue.chakra-ui.com/docs/layout/box
39
+ */
40
+ export const CBox = CBoxImpl as ComponentWithProps < DeepPartial < BoxProps > >
41
+
38
42
/**
39
43
* As a constraint, you can't pass size related props
40
44
* Only `size` would be allowed
@@ -52,7 +56,7 @@ export interface SquareProps extends Omit<BoxProps, Omitted> {
52
56
centerContent ?: boolean
53
57
}
54
58
55
- export const CSquare = defineComponent ( {
59
+ const CSquareImpl = defineComponent ( {
56
60
props : {
57
61
size : [ Object , String , Number ] as PropType < SquareProps [ 'size' ] > ,
58
62
centerContent : {
@@ -85,7 +89,11 @@ export const CSquare = defineComponent({
85
89
} ,
86
90
} )
87
91
88
- export const CCircle = defineComponent ( {
92
+ export const CSquare = CSquareImpl as ComponentWithProps <
93
+ DeepPartial < SquareProps >
94
+ >
95
+
96
+ const CCircleImpl = defineComponent ( {
89
97
setup ( _ , { slots, attrs } ) {
90
98
return ( ) => {
91
99
return h (
@@ -100,3 +108,7 @@ export const CCircle = defineComponent({
100
108
}
101
109
} ,
102
110
} )
111
+
112
+ export const CCircle = CCircleImpl as ComponentWithProps <
113
+ DeepPartial < SquareProps >
114
+ >
0 commit comments