File tree Expand file tree Collapse file tree 8 files changed +26
-8
lines changed Expand file tree Collapse file tree 8 files changed +26
-8
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,13 @@ const iconMap = {
1616 alert
1717}
1818
19+ type ReactAlertProps = {
20+ Element ?: keyof JSX . IntrinsicElements
21+ TitleTag ?: keyof JSX . IntrinsicElements
22+ children : React . ReactNode
23+ icon ?: string
24+ }
25+
1926const Alert = ( {
2027 Element = 'section' ,
2128 title,
@@ -25,7 +32,7 @@ const Alert = ({
2532 children,
2633 icon,
2734 ...rest
28- } : AlertProps & { icon ?: any } ) => {
35+ } : AlertProps & ReactAlertProps ) => {
2936 const classes = [
3037 'w-alert' ,
3138 ( ! icon && ! theme ) && 'col' ,
Original file line number Diff line number Diff line change @@ -9,5 +9,4 @@ export type AlertProps = {
99 | 'warning'
1010 | 'alert'
1111 | null
12- [ key : string ] : any
1312}
Original file line number Diff line number Diff line change @@ -2,7 +2,11 @@ import React from 'react'
22import type { BadgeProps } from './badge'
33import './badge.scss'
44
5- const Badge = ( { theme, onClick, children } : BadgeProps ) => {
5+ type ReactBadgeProps = {
6+ children : React . ReactNode
7+ } & BadgeProps
8+
9+ const Badge = ( { theme, onClick, children } : ReactBadgeProps ) => {
610 const classes = [
711 'w-badge' ,
812 theme || null ,
Original file line number Diff line number Diff line change @@ -8,5 +8,4 @@ export type BadgeProps = {
88 | 'alert'
99 | null
1010 onClick ?: ( ) => any
11- [ key : string ] : any
1211}
Original file line number Diff line number Diff line change @@ -2,14 +2,18 @@ import React from 'react'
22import type { ButtonProps } from './button'
33import './button.scss'
44
5+ type ReactButtonProps = {
6+ children : React . ReactNode
7+ }
8+
59const Button = ( {
610 theme,
711 bold,
812 href,
913 children,
1014 onClick,
1115 ...rest
12- } : ButtonProps ) => {
16+ } : ButtonProps & ReactButtonProps ) => {
1317 const classes = [
1418 'w-button' ,
1519 bold && 'bold' ,
Original file line number Diff line number Diff line change @@ -9,6 +9,6 @@ export type ButtonProps = {
99 | null
1010 bold ?: boolean
1111 href ?: string
12+ target ?: string
1213 onClick ?: ( ) => any
13- [ key : string ] : any
1414}
Original file line number Diff line number Diff line change @@ -2,6 +2,12 @@ import React from 'react'
22import type { CardProps } from './card'
33import './card.scss'
44
5+ type ReactCardProps = {
6+ Element ?: keyof JSX . IntrinsicElements
7+ TitleTag ?: keyof JSX . IntrinsicElements
8+ children : React . ReactNode
9+ }
10+
511const Card = ( {
612 Element = 'section' ,
713 title,
@@ -11,7 +17,7 @@ const Card = ({
1117 secondary,
1218 children,
1319 ...rest
14- } : CardProps ) => {
20+ } : CardProps & ReactCardProps ) => {
1521 const classes = [
1622 'w-card' ,
1723 className ,
Original file line number Diff line number Diff line change @@ -4,5 +4,4 @@ export type CardProps = {
44 compact ?: boolean
55 className ?: string
66 secondary ?: boolean
7- [ key : string ] : any
87}
You can’t perform that action at this time.
0 commit comments