fix: `<Button/>` types of `StartIcon`/`EndIcon` (#562)
parent
adff0d0176
commit
ab33cbde4c
|
@ -2,14 +2,16 @@ import classNames from "@lib/classNames";
|
||||||
import Link, { LinkProps } from "next/link";
|
import Link, { LinkProps } from "next/link";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
|
type SVGComponent = React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
||||||
|
|
||||||
export type ButtonProps = {
|
export type ButtonProps = {
|
||||||
color?: "primary" | "secondary" | "minimal";
|
color?: "primary" | "secondary" | "minimal";
|
||||||
size?: "base" | "sm" | "lg" | "fab";
|
size?: "base" | "sm" | "lg" | "fab";
|
||||||
loading?: boolean;
|
loading?: boolean;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
||||||
StartIcon?: JSX.IntrinsicElements["svg"];
|
StartIcon?: SVGComponent;
|
||||||
EndIcon?: JSX.IntrinsicElements["svg"];
|
EndIcon?: SVGComponent;
|
||||||
} & (
|
} & (
|
||||||
| (Omit<JSX.IntrinsicElements["a"], "href"> & { href: LinkProps["href"] })
|
| (Omit<JSX.IntrinsicElements["a"], "href"> & { href: LinkProps["href"] })
|
||||||
| (JSX.IntrinsicElements["button"] & { href?: never })
|
| (JSX.IntrinsicElements["button"] & { href?: never })
|
||||||
|
|
Loading…
Reference in New Issue