Skip to content

Commit

Permalink
fix(Icon): icon property typing should accept FormStatus icons (#4091)
Browse files Browse the repository at this point in the history
Fixes #4083
  • Loading branch information
langz authored Oct 9, 2024
1 parent b58b9db commit f49eb34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,9 @@ export interface MarketingIconProps {
title?: string;
}
export declare const MarketingIcon: React.FC<MarketingIconProps>;

export type FormStatusIconTypes =
| typeof ErrorIcon
| typeof WarnIcon
| typeof InfoIcon
| typeof MarketingIcon;
3 changes: 2 additions & 1 deletion packages/dnb-eufemia/src/components/icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { createSkeletonClass } from '../skeleton/SkeletonHelper'
import { iconCase } from './IconHelpers'
import { SpacingProps } from '../../shared/types'
import { SkeletonShow } from '../Skeleton'
import { FormStatusIconTypes } from '../FormStatus'

export const DefaultIconSize = 16
export const DefaultIconSizes = {
Expand Down Expand Up @@ -47,7 +48,7 @@ type IconType =
| false

/** For external usage */
export type IconIcon = IconType | React.FC<unknown>
export type IconIcon = IconType | FormStatusIconTypes | React.FC<unknown>

export type IconSize =
| ValidIconNumericSize
Expand Down

0 comments on commit f49eb34

Please sign in to comment.