ui phase 6
This commit is contained in:
@@ -36,4 +36,9 @@ describe('<Money/>', () => {
|
||||
);
|
||||
expect(container.querySelector('[data-money][data-deduction="true"]')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders the xl size as an h4 for the checkout/confirmation prominent-total hero', () => {
|
||||
wrap(<Money amountIrr="45000000" size="xl" />);
|
||||
expect(screen.getByText(/4,500,000/).closest('.MuiTypography-h4')).not.toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -5,13 +5,16 @@ import Box from '@mui/material/Box';
|
||||
import Typography, { TypographyProps } from '@mui/material/Typography';
|
||||
import { formatIrrToToman } from '@/utils';
|
||||
|
||||
export type MoneySize = 'sm' | 'md' | 'lg';
|
||||
export type MoneySize = 'sm' | 'md' | 'lg' | 'xl';
|
||||
export type MoneyTone = 'default' | 'emphasis' | 'muted' | 'error';
|
||||
|
||||
const SIZE_VARIANT: Record<MoneySize, TypographyProps['variant']> = {
|
||||
sm: 'body2',
|
||||
md: 'body1',
|
||||
lg: 'h6',
|
||||
// The C6/confirmation "prominent total" hero figure — the single most important number on a payment
|
||||
// screen gets its own weight class, above the existing card/row emphasis.
|
||||
xl: 'h4',
|
||||
};
|
||||
|
||||
// House weight system has no 600 face (see typography.ts) — 700 for the strong tones, 500/400 otherwise.
|
||||
|
||||
Reference in New Issue
Block a user