Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Icon): icon property typing should accept FormStatus icons #4091

Merged
merged 3 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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<any>
langz marked this conversation as resolved.
Show resolved Hide resolved
langz marked this conversation as resolved.
Show resolved Hide resolved

export type IconSize =
| ValidIconNumericSize
Expand Down
Loading