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

Commit 00e708a

Browse files
committed
feat(vue-layout): update Box Circle and Square type definitions
1 parent 12000a1 commit 00e708a

File tree

1 file changed

+12
-18
lines changed

1 file changed

+12
-18
lines changed

packages/layout/src/box.ts

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ import { computed, defineComponent, h, PropType } from '@vue/runtime-core'
1010

1111
export interface BoxProps extends HTMLChakraProps<'div'> {}
1212

13-
const CBoxImpl = defineComponent({
13+
/**
14+
* Box is the most abstract component on top of which other chakra
15+
* components are built. It renders a `div` element by default.
16+
*
17+
* @see Docs https://vue.chakra-ui.com/docs/layout/box
18+
*/
19+
export const CBox: ComponentWithProps<DeepPartial<BoxProps>> = defineComponent({
1420
props: {
1521
as: {
1622
type: [String, Object] as PropType<DOMElements>,
@@ -31,14 +37,6 @@ const CBoxImpl = defineComponent({
3137
},
3238
})
3339

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-
4240
/**
4341
* As a constraint, you can't pass size related props
4442
* Only `size` would be allowed
@@ -56,7 +54,9 @@ export interface SquareProps extends Omit<BoxProps, Omitted> {
5654
centerContent?: boolean
5755
}
5856

59-
const CSquareImpl = defineComponent({
57+
export const CSquare: ComponentWithProps<
58+
DeepPartial<SquareProps>
59+
> = defineComponent({
6060
props: {
6161
size: [Object, String, Number] as PropType<SquareProps['size']>,
6262
centerContent: {
@@ -89,11 +89,9 @@ const CSquareImpl = defineComponent({
8989
},
9090
})
9191

92-
export const CSquare = CSquareImpl as ComponentWithProps<
92+
export const CCircle: ComponentWithProps<
9393
DeepPartial<SquareProps>
94-
>
95-
96-
const CCircleImpl = defineComponent({
94+
> = defineComponent({
9795
setup(_, { slots, attrs }) {
9896
return () => {
9997
return h(
@@ -108,7 +106,3 @@ const CCircleImpl = defineComponent({
108106
}
109107
},
110108
})
111-
112-
export const CCircle = CCircleImpl as ComponentWithProps<
113-
DeepPartial<SquareProps>
114-
>

0 commit comments

Comments
 (0)