Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
@@ -1,11 +1,13 @@
import type { BadgeIconPropsShared } from '@metamask/design-system-shared';
import type { ViewProps } from 'react-native';

import type { IconName, IconProps } from '../Icon';

/**
* BadgeIcon component props.
* BadgeIcon component props (React Native platform-specific)
* Extends shared props from @metamask/design-system-shared with React Native specific platform concerns
*/
export type BadgeIconProps = {
export type BadgeIconProps = Omit<BadgeIconPropsShared, 'iconName'> & {
/**
* Required prop to specify an icon to show
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
import type { BadgeIconPropsShared } from '@metamask/design-system-shared';
import type { ComponentProps } from 'react';

import type { IconName, IconProps } from '../Icon';

/**
* BadgeIcon component props.
* BadgeIcon component props (React platform-specific)
* Extends shared props from @metamask/design-system-shared with React-specific platform concerns
*/
export type BadgeIconProps = ComponentProps<'div'> & {
/**
* Required prop to specify an icon to show
*/
iconName: IconName;
/**
* Optional prop to pass additional properties to the icon
*/
iconProps?: Omit<IconProps, 'name'>;
/**
* Optional prop for additional CSS classes to be applied to the BadgeIcon component.
* These classes will be merged with the component's default classes using twMerge.
*/
className?: string;
/**
* Optional CSS styles to be applied to the component.
* Should be used sparingly and only for dynamic styles that can't be achieved with className.
*/
style?: React.CSSProperties;
};
export type BadgeIconProps = ComponentProps<'div'> &
Omit<BadgeIconPropsShared, 'iconName'> & {
/**
* Required prop to specify an icon to show
*/
iconName: IconName;
/**
* Optional prop to pass additional properties to the icon
*/
iconProps?: Omit<IconProps, 'name'>;
/**
* Optional prop for additional CSS classes to be applied to the BadgeIcon component.
* These classes will be merged with the component's default classes using twMerge.
*/
className?: string;
/**
* Optional CSS styles to be applied to the component.
* Should be used sparingly and only for dynamic styles that can't be achieved with className.
*/
style?: React.CSSProperties;
};
3 changes: 3 additions & 0 deletions packages/design-system-shared/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ export { type ButtonFilterPropsShared } from './types/ButtonFilter';
// AvatarNetwork types (ADR-0004)
export { type AvatarNetworkPropsShared } from './types/AvatarNetwork';

// BadgeIcon types (ADR-0004)
export { type BadgeIconPropsShared } from './types/BadgeIcon';

// BannerAlert types (ADR-0003 + ADR-0004)
export {
BannerAlertSeverity,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* BadgeIcon component shared props (ADR-0004)
* Platform-independent properties shared across React and React Native
*/
export type BadgeIconPropsShared = {
/**
* Required prop to specify an icon to show.
* Use the platform-specific `IconName` type to provide values.
*/
iconName: string;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { type BadgeIconPropsShared } from './BadgeIcon.types';
Loading