diff --git a/src/scripts/Badge.tsx b/src/scripts/Badge.tsx index bea07a967..044440d96 100644 --- a/src/scripts/Badge.tsx +++ b/src/scripts/Badge.tsx @@ -4,13 +4,9 @@ import classnames from 'classnames'; export type BadgeProps = { type?: 'default' | 'shade' | 'inverse'; label?: string; -}; +} & HTMLAttributes; -export const Badge: React.FC> = ({ - type, - label, - ...props -}) => { +export const Badge: React.FC = ({ type, label, ...props }) => { const typeClassName = type ? `slds-theme--${type}` : null; const badgeClassNames = classnames('slds-badge', typeClassName); return ( diff --git a/src/scripts/BreadCrumbs.tsx b/src/scripts/BreadCrumbs.tsx index 22b62c88f..467b69f2d 100644 --- a/src/scripts/BreadCrumbs.tsx +++ b/src/scripts/BreadCrumbs.tsx @@ -4,9 +4,9 @@ import classnames from 'classnames'; export type CrumbProps = { className?: string; href?: string; -}; +} & HTMLAttributes; -export const Crumb: React.FC> = ({ +export const Crumb: React.FC = ({ className, href, children, @@ -28,11 +28,14 @@ export const Crumb: React.FC> = ({ export type BreadCrumbsProps = { label?: string; className?: string; -}; +} & HTMLAttributes; -export const BreadCrumbs: React.FC< - BreadCrumbsProps & HTMLAttributes -> = ({ label, className, children, ...props }) => { +export const BreadCrumbs: React.FC = ({ + label, + className, + children, + ...props +}) => { const oClassName = classnames( 'slds-breadcrumb slds-list--horizontal', className diff --git a/src/scripts/Button.tsx b/src/scripts/Button.tsx index 843dba9ef..e28061d2a 100644 --- a/src/scripts/Button.tsx +++ b/src/scripts/Button.tsx @@ -1,7 +1,7 @@ import React, { Component, ReactNode, ButtonHTMLAttributes } from 'react'; import classnames from 'classnames'; import Icon from './Icon'; -import Spinner from './Spinner'; +import { Spinner } from './Spinner'; type Omit = Pick>; @@ -43,12 +43,9 @@ export type ButtonProps = { iconMoreSize?: ButtonIconMoreSize; onClick?: (e: React.MouseEvent) => void; buttonRef?: (node?: HTMLButtonElement) => void; -}; +} & Omit, 'type'>; -export class Button extends Component< - ButtonProps & Omit, 'type'>, - {} -> { +export class Button extends Component { // eslint-disable-next-line react/sort-comp private node: HTMLButtonElement | null; diff --git a/src/scripts/Container.tsx b/src/scripts/Container.tsx index db3d7e27a..b307560d2 100644 --- a/src/scripts/Container.tsx +++ b/src/scripts/Container.tsx @@ -5,11 +5,15 @@ export type ContainerProps = { className: string; size: 'small' | 'medium' | 'large'; align: 'left' | 'center' | 'right'; -}; +} & HTMLAttributes; -export const Container: React.FC< - ContainerProps & HTMLAttributes -> = ({ className, size, align, children, ...props }) => { +export const Container: React.FC = ({ + className, + size, + align, + children, + ...props +}) => { const ctClassNames = classnames( className, `slds-container--${size || 'fluid'}`, diff --git a/src/scripts/Form.tsx b/src/scripts/Form.tsx index e4a91772e..255bacfe3 100644 --- a/src/scripts/Form.tsx +++ b/src/scripts/Form.tsx @@ -6,12 +6,9 @@ import { uuid } from './util'; export type FormProps = { className?: string; type?: 'stacked' | 'horizontal' | 'inline' | 'compound'; -}; +} & FormHTMLAttributes; -export class Form extends Component< - FormProps & FormHTMLAttributes, - {} -> { +export class Form extends Component { static defaultProps: Pick = { type: 'stacked', }; diff --git a/src/scripts/Lookup.js b/src/scripts/Lookup.js index 5ff5add70..598ba2065 100644 --- a/src/scripts/Lookup.js +++ b/src/scripts/Lookup.js @@ -5,7 +5,7 @@ import autoAlign from './AutoAlign'; import { FormElement } from './FormElement'; import Input from './Input'; import Icon from './Icon'; -import Spinner from './Spinner'; +import { Spinner } from './Spinner'; import Pill from './Pill'; import DropdownButton from './DropdownButton'; import { DropdownMenuItem } from './DropdownMenu'; diff --git a/src/scripts/Radio.tsx b/src/scripts/Radio.tsx index cd9181f54..bed525fc8 100644 --- a/src/scripts/Radio.tsx +++ b/src/scripts/Radio.tsx @@ -8,11 +8,17 @@ export type RadioProps = { value?: string | number; checked?: boolean; defaultChecked?: boolean; -}; +} & InputHTMLAttributes; -export const Radio: React.FC< - RadioProps & InputHTMLAttributes -> = ({ className, label, name, value, checked, defaultChecked, ...props }) => { +export const Radio: React.FC = ({ + className, + label, + name, + value, + checked, + defaultChecked, + ...props +}) => { const radioClassNames = classnames(className, 'slds-radio'); return (