Skip to content

Commit

Permalink
feat: slightly more detailed types for <Chip/ChipIcon> - per review
Browse files Browse the repository at this point in the history
  • Loading branch information
bradenmacdonald committed Jul 5, 2024
1 parent 4cd7029 commit 4aee81f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Chip/ChipIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { STYLE_VARIANTS } from './constants';
export type ChipIconProps = {
className: string,
src: React.ComponentType,
variant: string,
variant: typeof STYLE_VARIANTS[keyof typeof STYLE_VARIANTS],
disabled?: boolean,
} & (
// Either _both_ onClick and alt are provided, or neither is:
| { onClick: KeyboardEventHandler & MouseEventHandler, alt: string }
| { onClick: KeyboardEventHandler<HTMLButtonElement> & MouseEventHandler<HTMLButtonElement>, alt: string }
| { onClick?: undefined, alt?: undefined }
);

Expand Down
2 changes: 1 addition & 1 deletion src/Chip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface IChip {
children: React.ReactNode,
onClick?: KeyboardEventHandler & MouseEventHandler,
className?: string,
variant?: string,
variant?: typeof STYLE_VARIANTS[keyof typeof STYLE_VARIANTS],
iconBefore?: React.ComponentType,
iconBeforeAlt?: string,
iconAfter?: React.ComponentType,
Expand Down

0 comments on commit 4aee81f

Please sign in to comment.