Skip to content

Commit f7ee823

Browse files
committed
Add as typing
1 parent d830b7e commit f7ee823

File tree

11 files changed

+67
-18
lines changed

11 files changed

+67
-18
lines changed

.changeset/twelve-dryers-sing.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@devup-ui/react": patch
3+
---
4+
5+
Support props and custom component in as
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
import type { DevupComponentProps } from '../types/props'
1+
import type {
2+
DevupComponentBaseProps,
3+
DevupComponentProps,
4+
} from '../types/props'
25
import type { Merge } from '../types/utils'
36

47
export function Box<T extends React.ElementType = 'div'>(
58
// eslint-disable-next-line @typescript-eslint/no-unused-vars
6-
props: Merge<React.ComponentProps<T>, DevupComponentProps<T>>,
9+
props: Merge<DevupComponentBaseProps<T>, DevupComponentProps<T>>,
710
): React.ReactElement {
811
throw new Error('Cannot run on the runtime')
912
}
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
import type { DevupComponentProps } from '../types/props'
1+
import type {
2+
DevupComponentBaseProps,
3+
DevupComponentProps,
4+
} from '../types/props'
25
import type { Merge } from '../types/utils'
36

47
export function Button<T extends React.ElementType = 'button'>(
58
// eslint-disable-next-line @typescript-eslint/no-unused-vars
6-
props: Merge<React.ComponentProps<T>, DevupComponentProps<T>>,
9+
props: Merge<DevupComponentBaseProps<T>, DevupComponentProps<T>>,
710
): React.ReactElement {
811
throw new Error('Cannot run on the runtime')
912
}
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
import type { DevupComponentProps } from '../types/props'
1+
import type {
2+
DevupComponentBaseProps,
3+
DevupComponentProps,
4+
} from '../types/props'
25
import type { Merge } from '../types/utils'
36

47
export function Center<T extends React.ElementType = 'div'>(
58
// eslint-disable-next-line @typescript-eslint/no-unused-vars
6-
props: Merge<React.ComponentProps<T>, DevupComponentProps<T>>,
9+
props: Merge<DevupComponentBaseProps<T>, DevupComponentProps<T>>,
710
): React.ReactElement {
811
throw new Error('Cannot run on the runtime')
912
}
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
import type { DevupComponentProps } from '../types/props'
1+
import type {
2+
DevupComponentBaseProps,
3+
DevupComponentProps,
4+
} from '../types/props'
25
import type { Merge } from '../types/utils'
36

47
export function Flex<T extends React.ElementType = 'div'>(
58
// eslint-disable-next-line @typescript-eslint/no-unused-vars
6-
props: Merge<React.ComponentProps<T>, DevupComponentProps<T>>,
9+
props: Merge<DevupComponentBaseProps<T>, DevupComponentProps<T>>,
710
): React.ReactElement {
811
throw new Error('Cannot run on the runtime')
912
}
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
import type { DevupComponentProps } from '../types/props'
1+
import type {
2+
DevupComponentBaseProps,
3+
DevupComponentProps,
4+
} from '../types/props'
25
import type { Merge } from '../types/utils'
36

47
export function Grid<T extends React.ElementType = 'div'>(
58
// eslint-disable-next-line @typescript-eslint/no-unused-vars
6-
props: Merge<React.ComponentProps<T>, DevupComponentProps<T>>,
9+
props: Merge<DevupComponentBaseProps<T>, DevupComponentProps<T>>,
710
): React.ReactElement {
811
throw new Error('Cannot run on the runtime')
912
}
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
import type { DevupComponentProps } from '../types/props'
1+
import type {
2+
DevupComponentBaseProps,
3+
DevupComponentProps,
4+
} from '../types/props'
25
import type { Merge } from '../types/utils'
36

47
export function Image<T extends React.ElementType = 'img'>(
58
// eslint-disable-next-line @typescript-eslint/no-unused-vars
6-
props: Merge<React.ComponentProps<T>, DevupComponentProps<T>>,
9+
props: Merge<DevupComponentBaseProps<T>, DevupComponentProps<T>>,
710
): React.ReactElement {
811
throw new Error('Cannot run on the runtime')
912
}
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
import type { DevupComponentProps } from '../types/props'
1+
import type {
2+
DevupComponentBaseProps,
3+
DevupComponentProps,
4+
} from '../types/props'
25
import type { Merge } from '../types/utils'
36

47
export function Input<T extends React.ElementType = 'input'>(
58
// eslint-disable-next-line @typescript-eslint/no-unused-vars
6-
props: Merge<React.ComponentProps<T>, DevupComponentProps<T>>,
9+
props: Merge<DevupComponentBaseProps<T>, DevupComponentProps<T>>,
710
): React.ReactElement {
811
throw new Error('Cannot run on the runtime')
912
}
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
import type { DevupComponentProps } from '../types/props'
1+
import type {
2+
DevupComponentBaseProps,
3+
DevupComponentProps,
4+
} from '../types/props'
25
import type { Merge } from '../types/utils'
36

47
export function Text<T extends React.ElementType = 'span'>(
58
// eslint-disable-next-line @typescript-eslint/no-unused-vars
6-
props: Merge<React.ComponentProps<T>, DevupComponentProps<T>>,
9+
props: Merge<DevupComponentBaseProps<T>, DevupComponentProps<T>>,
710
): React.ReactElement {
811
throw new Error('Cannot run on the runtime')
912
}
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
import type { DevupComponentProps } from '../types/props'
1+
import type {
2+
DevupComponentBaseProps,
3+
DevupComponentProps,
4+
} from '../types/props'
25
import type { Merge } from '../types/utils'
36

47
export function VStack<T extends React.ElementType = 'div'>(
58
// eslint-disable-next-line @typescript-eslint/no-unused-vars
6-
props: Merge<React.ComponentProps<T>, DevupComponentProps<T>>,
9+
props: Merge<DevupComponentBaseProps<T>, DevupComponentProps<T>>,
710
): React.ReactElement {
811
throw new Error('Cannot run on the runtime')
912
}

0 commit comments

Comments
 (0)