File tree 8 files changed +26
-8
lines changed
8 files changed +26
-8
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,13 @@ const iconMap = {
16
16
alert
17
17
}
18
18
19
+ type ReactAlertProps = {
20
+ Element ?: keyof JSX . IntrinsicElements
21
+ TitleTag ?: keyof JSX . IntrinsicElements
22
+ children : React . ReactNode
23
+ icon ?: string
24
+ }
25
+
19
26
const Alert = ( {
20
27
Element = 'section' ,
21
28
title,
@@ -25,7 +32,7 @@ const Alert = ({
25
32
children,
26
33
icon,
27
34
...rest
28
- } : AlertProps & { icon ?: any } ) => {
35
+ } : AlertProps & ReactAlertProps ) => {
29
36
const classes = [
30
37
'w-alert' ,
31
38
( ! icon && ! theme ) && 'col' ,
Original file line number Diff line number Diff line change @@ -9,5 +9,4 @@ export type AlertProps = {
9
9
| 'warning'
10
10
| 'alert'
11
11
| null
12
- [ key : string ] : any
13
12
}
Original file line number Diff line number Diff line change @@ -2,7 +2,11 @@ import React from 'react'
2
2
import type { BadgeProps } from './badge'
3
3
import './badge.scss'
4
4
5
- const Badge = ( { theme, onClick, children } : BadgeProps ) => {
5
+ type ReactBadgeProps = {
6
+ children : React . ReactNode
7
+ } & BadgeProps
8
+
9
+ const Badge = ( { theme, onClick, children } : ReactBadgeProps ) => {
6
10
const classes = [
7
11
'w-badge' ,
8
12
theme || null ,
Original file line number Diff line number Diff line change @@ -8,5 +8,4 @@ export type BadgeProps = {
8
8
| 'alert'
9
9
| null
10
10
onClick ?: ( ) => any
11
- [ key : string ] : any
12
11
}
Original file line number Diff line number Diff line change @@ -2,14 +2,18 @@ import React from 'react'
2
2
import type { ButtonProps } from './button'
3
3
import './button.scss'
4
4
5
+ type ReactButtonProps = {
6
+ children : React . ReactNode
7
+ }
8
+
5
9
const Button = ( {
6
10
theme,
7
11
bold,
8
12
href,
9
13
children,
10
14
onClick,
11
15
...rest
12
- } : ButtonProps ) => {
16
+ } : ButtonProps & ReactButtonProps ) => {
13
17
const classes = [
14
18
'w-button' ,
15
19
bold && 'bold' ,
Original file line number Diff line number Diff line change @@ -9,6 +9,6 @@ export type ButtonProps = {
9
9
| null
10
10
bold ?: boolean
11
11
href ?: string
12
+ target ?: string
12
13
onClick ?: ( ) => any
13
- [ key : string ] : any
14
14
}
Original file line number Diff line number Diff line change @@ -2,6 +2,12 @@ import React from 'react'
2
2
import type { CardProps } from './card'
3
3
import './card.scss'
4
4
5
+ type ReactCardProps = {
6
+ Element ?: keyof JSX . IntrinsicElements
7
+ TitleTag ?: keyof JSX . IntrinsicElements
8
+ children : React . ReactNode
9
+ }
10
+
5
11
const Card = ( {
6
12
Element = 'section' ,
7
13
title,
@@ -11,7 +17,7 @@ const Card = ({
11
17
secondary,
12
18
children,
13
19
...rest
14
- } : CardProps ) => {
20
+ } : CardProps & ReactCardProps ) => {
15
21
const classes = [
16
22
'w-card' ,
17
23
className ,
Original file line number Diff line number Diff line change @@ -4,5 +4,4 @@ export type CardProps = {
4
4
compact ?: boolean
5
5
className ?: string
6
6
secondary ?: boolean
7
- [ key : string ] : any
8
7
}
You can’t perform that action at this time.
0 commit comments