Skip to content

Commit

Permalink
feat(components): add variant to Note
Browse files Browse the repository at this point in the history
  • Loading branch information
martykan committed Jan 31, 2025
1 parent 678de31 commit 7445765
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions packages/components/src/components/Note/Note.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,28 @@ import { spacings } from '@trezor/theme';

import { FrameProps, FramePropsKeys } from '../../utils/frameProps';
import { Row } from '../Flex/Flex';
import { Icon, IconName } from '../Icon/Icon';
import { Icon, IconName, IconVariant } from '../Icon/Icon';
import { Paragraph } from '../typography/Paragraph/Paragraph';

export const allowedNoteFrameProps = ['margin', 'gap'] as const satisfies FramePropsKeys[];
type AllowedFrameProps = Pick<FrameProps, (typeof allowedNoteFrameProps)[number]>;

export type NoteProps = AllowedFrameProps & {
iconName?: IconName;
variant?: IconVariant;
children: ReactNode;
};

export const Note = ({ children, iconName = 'info', margin, gap = spacings.xxs }: NoteProps) => (
export const Note = ({
children,
iconName = 'info',
margin,
gap = spacings.xxs,
variant = 'tertiary',
}: NoteProps) => (
<Row gap={gap} margin={margin}>
<Icon name={iconName} size={16} variant="tertiary" />
<Paragraph typographyStyle="hint" variant="tertiary">
<Icon name={iconName} size={16} variant={variant} />
<Paragraph typographyStyle="hint" variant={variant}>
{children}
</Paragraph>
</Row>
Expand Down

0 comments on commit 7445765

Please sign in to comment.