Skip to content
Merged
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
13 changes: 12 additions & 1 deletion packages/snaps-sdk/src/jsx/components/Icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,17 @@ export enum IconName {
X = 'x',
}

/**
* The colors available to the {@link Link} component.
*/
export type IconColor =
| 'default'
| 'primary'
| 'muted'
| 'error'
| 'success'
| 'warning';

/**
* The props of the {@link Icon} component.
*
Expand All @@ -288,7 +299,7 @@ export enum IconName {
*/
export type IconProps = {
name: `${IconName}`;
color?: 'default' | 'primary' | 'muted' | undefined;
color?: IconColor | undefined;
size?: 'md' | 'inherit' | undefined;
};

Expand Down
9 changes: 8 additions & 1 deletion packages/snaps-sdk/src/jsx/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,14 @@ const IconNameStruct: Struct<`${IconName}`, null> = nullUnion(
export const IconStruct: Describe<IconElement> = element('Icon', {
name: IconNameStruct,
color: optional(
nullUnion([literal('default'), literal('primary'), literal('muted')]),
nullUnion([
literal('default'),
literal('primary'),
literal('muted'),
literal('error'),
literal('success'),
literal('warning'),
]),
),
size: optional(nullUnion([literal('md'), literal('inherit')])),
});
Expand Down
Loading