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

Commit ab8c90b

Browse files
committed
feat(layout): export AspectRatio with theming props
1 parent e966bd7 commit ab8c90b

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

packages/layout/src/aspect-ratio.ts

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import { mapResponsive } from '@chakra-ui/utils'
2-
import { chakra, HTMLChakraProps, ResponsiveValue } from '@chakra-ui/vue-system'
3-
import { defineComponent, h, PropType } from '@vue/runtime-core'
2+
import {
3+
chakra,
4+
HTMLChakraProps,
5+
ResponsiveValue,
6+
DeepPartial,
7+
ComponentWithProps,
8+
} from '@chakra-ui/vue-system'
9+
import { defineComponent, h, PropType } from 'vue'
410

511
interface AspectRatioOptions {
612
/**
@@ -15,13 +21,7 @@ export interface AspectRatioProps
1521
extends HTMLChakraProps<'div'>,
1622
AspectRatioOptions {}
1723

18-
/**
19-
* Vue component used to cropping media (videos, images and maps)
20-
* to a desired aspect ratio.
21-
*
22-
* @see Docs https://vue.chakra-ui.com/docs/layout/aspect-ratio
23-
*/
24-
export const CAspectRatio = defineComponent({
24+
const CAspectRatioImpl = defineComponent({
2525
props: {
2626
ratio: {
2727
type: [Number] as PropType<AspectRatioProps['ratio']>,
@@ -68,3 +68,13 @@ export const CAspectRatio = defineComponent({
6868
}
6969
},
7070
})
71+
72+
/**
73+
* Vue component used to cropping media (videos, images and maps)
74+
* to a desired aspect ratio.
75+
*
76+
* @see Docs https://vue.chakra-ui.com/docs/layout/aspect-ratio
77+
*/
78+
export const CAspectRatio = CAspectRatioImpl as ComponentWithProps<
79+
DeepPartial<AspectRatioProps>
80+
>

0 commit comments

Comments
 (0)