diff --git a/src/components/Breadcrumb/breadcrumb.ts b/src/components/Breadcrumb/breadcrumb.ts index c536959..72174c6 100644 --- a/src/components/Breadcrumb/breadcrumb.ts +++ b/src/components/Breadcrumb/breadcrumb.ts @@ -1,9 +1,11 @@ +import type { ButtonProps } from '../Button/button' + export type BreadcrumbProps = { items: { icon?: string label?: string href?: string - target?: '_self' | '_blank' | '_parent' | '_top' | '_unfencedTop' + target?: ButtonProps['target'] }[] separator?: string className?: string diff --git a/src/components/Button/button.ts b/src/components/Button/button.ts index 0b4f761..a8b90ad 100644 --- a/src/components/Button/button.ts +++ b/src/components/Button/button.ts @@ -8,15 +8,16 @@ export type ButtonProps = { | 'alert' | null href?: string + target?: '_self' | '_blank' | '_parent' | '_top' | '_unfencedTop' | undefined className?: string [key: string]: any } export type SvelteButtonProps = { - onClick?: (() => any) | null + onClick?: ((event: MouseEvent) => void) | null } & ButtonProps export type ReactButtonProps = { - onClick?: (() => any) | null + onClick?: (event: React.MouseEvent) => void children: React.ReactNode } & ButtonProps diff --git a/src/components/Checkbox/checkbox.ts b/src/components/Checkbox/checkbox.ts index f085501..e14b871 100644 --- a/src/components/Checkbox/checkbox.ts +++ b/src/components/Checkbox/checkbox.ts @@ -8,9 +8,9 @@ export type CheckboxProps = { } export type SvelteCheckboxProps = { - onClick?: (key: any) => any + onClick?: ((event: MouseEvent) => void) | null } & CheckboxProps export type ReactCheckboxProps = { - onClick?: (key: any) => any + onClick?: (event: React.MouseEvent) => void } & CheckboxProps diff --git a/src/components/Footer/footer.ts b/src/components/Footer/footer.ts index 3eb31fe..1bea3a4 100644 --- a/src/components/Footer/footer.ts +++ b/src/components/Footer/footer.ts @@ -1,3 +1,5 @@ +import type { ButtonProps } from '../Button/button' + export type FooterProps = { logo?: { url?: string @@ -12,7 +14,7 @@ export type FooterProps = { items: { href: string name: string - target?: '_self' | '_blank' | '_parent' | '_top' | '_unfencedTop' + target?: ButtonProps['target'] active?: boolean }[] }[] diff --git a/src/components/List/list.ts b/src/components/List/list.ts index ff7b5e2..38c7ab7 100644 --- a/src/components/List/list.ts +++ b/src/components/List/list.ts @@ -1,3 +1,5 @@ +import type { ButtonProps } from '../Button/button' + export type ListEventType = { value: string name: string @@ -19,7 +21,7 @@ export type ListProps = { name: string value?: string href?: string - target?: '_self' | '_blank' | '_parent' | '_top' | '_unfencedTop' + target?: ButtonProps['target'] selected?: boolean disabled?: boolean icon?: string diff --git a/src/components/Menu/menu.ts b/src/components/Menu/menu.ts index e004bac..4b292e3 100644 --- a/src/components/Menu/menu.ts +++ b/src/components/Menu/menu.ts @@ -1,8 +1,10 @@ +import type { ButtonProps } from '../Button/button' + export type MenuProps = { items?: { href: string name: string - target?: string + target?: ButtonProps['target'] active?: boolean }[] logo?: { diff --git a/src/components/Rating/rating.ts b/src/components/Rating/rating.ts index ceabec2..2908310 100644 --- a/src/components/Rating/rating.ts +++ b/src/components/Rating/rating.ts @@ -1,3 +1,5 @@ +import type { ButtonProps } from '../Button/button' + export type RatingProps = { score: number total?: number @@ -8,7 +10,7 @@ export type RatingProps = { reviewCount?: number reviewText?: string reviewLink?: string - reviewTarget?: string + reviewTarget?: ButtonProps['target'] color?: string emptyColor?: string size?: number diff --git a/src/components/Switch/switch.ts b/src/components/Switch/switch.ts index 9561ab8..8dc69e8 100644 --- a/src/components/Switch/switch.ts +++ b/src/components/Switch/switch.ts @@ -11,9 +11,9 @@ export type SwitchProps = { } export type SvelteSwitchProps = { - onClick?: (key: any) => any + onClick?: ((event: MouseEvent) => void) | null } & SwitchProps export type ReactSwitchProps = { - onClick?: (key: any) => any + onClick?: (event: React.MouseEvent) => void } & SwitchProps