Replace numeric prop values with named react-zen values.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Mike Cao 2026-02-05 23:41:10 -08:00
parent f66a508892
commit 7cafc3e61d
23 changed files with 65 additions and 46 deletions

View file

@ -38,7 +38,7 @@ export function MobileNav() {
]; ];
return ( return (
<Grid columns="auto 1fr" flexGrow={1} backgroundColor="3" borderRadius> <Grid columns="auto 1fr" flexGrow={1} backgroundColor="surface-sunken" borderRadius>
<MobileMenuButton> <MobileMenuButton>
{({ close }) => { {({ close }) => {
return ( return (

View file

@ -16,7 +16,12 @@ export function TopNav() {
style={{ position: 'sticky', top: 0 }} style={{ position: 'sticky', top: 0 }}
zIndex={1} zIndex={1}
> >
<Row alignItems="center" justifyContent="flex-end" backgroundColor="2" borderRadius> <Row
alignItems="center"
justifyContent="flex-end"
backgroundColor="surface-raised"
borderRadius
>
<ThemeButton /> <ThemeButton />
<LanguageButton /> <LanguageButton />
<ProfileButton /> <ProfileButton />

View file

@ -93,7 +93,7 @@ function BoardEditHeader() {
autoComplete="off" autoComplete="off"
style={{ fontSize: '2rem', fontWeight: 700, width: '100%' }} style={{ fontSize: '2rem', fontWeight: 700, width: '100%' }}
> >
<Heading size="4">{board?.name}</Heading> <Heading size="xl">{board?.name}</Heading>
</TextField> </TextField>
</Row> </Row>
<Row> <Row>

View file

@ -20,7 +20,7 @@ export function LinkPanels({ linkId }: { linkId: string }) {
<Grid gap="3"> <Grid gap="3">
<GridRow layout="two" {...rowProps}> <GridRow layout="two" {...rowProps}>
<Panel> <Panel>
<Heading size="2">{formatMessage(labels.sources)}</Heading> <Heading size="base">{formatMessage(labels.sources)}</Heading>
<Tabs> <Tabs>
<TabList> <TabList>
<Tab id="referrer">{formatMessage(labels.referrers)}</Tab> <Tab id="referrer">{formatMessage(labels.referrers)}</Tab>
@ -35,7 +35,7 @@ export function LinkPanels({ linkId }: { linkId: string }) {
</Tabs> </Tabs>
</Panel> </Panel>
<Panel> <Panel>
<Heading size="2">{formatMessage(labels.environment)}</Heading> <Heading size="base">{formatMessage(labels.environment)}</Heading>
<Tabs> <Tabs>
<TabList> <TabList>
<Tab id="browser">{formatMessage(labels.browsers)}</Tab> <Tab id="browser">{formatMessage(labels.browsers)}</Tab>
@ -59,7 +59,7 @@ export function LinkPanels({ linkId }: { linkId: string }) {
<WorldMap websiteId={linkId} /> <WorldMap websiteId={linkId} />
</Panel> </Panel>
<Panel> <Panel>
<Heading size="2">{formatMessage(labels.location)}</Heading> <Heading size="base">{formatMessage(labels.location)}</Heading>
<Tabs> <Tabs>
<TabList> <TabList>
<Tab id="country">{formatMessage(labels.countries)}</Tab> <Tab id="country">{formatMessage(labels.countries)}</Tab>

View file

@ -20,7 +20,7 @@ export function PixelPanels({ pixelId }: { pixelId: string }) {
<Grid gap="3"> <Grid gap="3">
<GridRow layout="two" {...rowProps}> <GridRow layout="two" {...rowProps}>
<Panel> <Panel>
<Heading size="2">{formatMessage(labels.sources)}</Heading> <Heading size="base">{formatMessage(labels.sources)}</Heading>
<Tabs> <Tabs>
<TabList> <TabList>
<Tab id="referrer">{formatMessage(labels.referrers)}</Tab> <Tab id="referrer">{formatMessage(labels.referrers)}</Tab>
@ -35,7 +35,7 @@ export function PixelPanels({ pixelId }: { pixelId: string }) {
</Tabs> </Tabs>
</Panel> </Panel>
<Panel> <Panel>
<Heading size="2">{formatMessage(labels.environment)}</Heading> <Heading size="base">{formatMessage(labels.environment)}</Heading>
<Tabs> <Tabs>
<TabList> <TabList>
<Tab id="browser">{formatMessage(labels.browsers)}</Tab> <Tab id="browser">{formatMessage(labels.browsers)}</Tab>
@ -59,7 +59,7 @@ export function PixelPanels({ pixelId }: { pixelId: string }) {
<WorldMap websiteId={pixelId} /> <WorldMap websiteId={pixelId} />
</Panel> </Panel>
<Panel> <Panel>
<Heading size="2">{formatMessage(labels.location)}</Heading> <Heading size="base">{formatMessage(labels.location)}</Heading>
<Tabs> <Tabs>
<TabList> <TabList>
<Tab id="country">{formatMessage(labels.countries)}</Tab> <Tab id="country">{formatMessage(labels.countries)}</Tab>

View file

@ -41,7 +41,7 @@ export function TeamSettings({ teamId }: { teamId: string }) {
</Panel> </Panel>
<Panel> <Panel>
<Row alignItems="center" justifyContent="space-between"> <Row alignItems="center" justifyContent="space-between">
<Heading size="2">{formatMessage(labels.members)}</Heading> <Heading size="base">{formatMessage(labels.members)}</Heading>
{isAdmin && <TeamsMemberAddButton teamId={teamId} />} {isAdmin && <TeamsMemberAddButton teamId={teamId} />}
</Row> </Row>
<TeamMembersDataTable teamId={teamId} allowEdit={canEdit} /> <TeamMembersDataTable teamId={teamId} allowEdit={canEdit} />

View file

@ -33,7 +33,7 @@ export function Funnel({ id, name, type, parameters, websiteId }) {
<Grid columns="1fr auto" gap> <Grid columns="1fr auto" gap>
<Column gap> <Column gap>
<Row> <Row>
<Text size="4" weight="bold"> <Text size="lg" weight="bold">
{name} {name}
</Text> </Text>
</Row> </Row>
@ -66,21 +66,21 @@ export function Funnel({ id, name, type, parameters, websiteId }) {
<Column alignItems="center" position="relative"> <Column alignItems="center" position="relative">
<Row <Row
borderRadius="full" borderRadius="full"
backgroundColor="3" backgroundColor="surface-sunken"
width="40px" width="40px"
height="40px" height="40px"
justifyContent="center" justifyContent="center"
alignItems="center" alignItems="center"
style={{ zIndex: 1 }} style={{ zIndex: 1 }}
> >
<Text weight="bold" size="3"> <Text weight="bold" size="base">
{index + 1} {index + 1}
</Text> </Text>
</Row> </Row>
{index > 0 && ( {index > 0 && (
<Box <Box
position="absolute" position="absolute"
backgroundColor="3" backgroundColor="surface-sunken"
width="2px" width="2px"
height="120px" height="120px"
top="-100%" top="-100%"
@ -121,7 +121,7 @@ export function Funnel({ id, name, type, parameters, websiteId }) {
style={{ width: '100%' }} style={{ width: '100%' }}
/> />
<Row minWidth="90px" justifyContent="end"> <Row minWidth="90px" justifyContent="end">
<Text weight="bold" size="7"> <Text weight="bold" size="4xl">
{Math.round(remaining * 100)}% {Math.round(remaining * 100)}%
</Text> </Text>
</Row> </Row>

View file

@ -42,7 +42,7 @@ export function Goal({ id, name, type, parameters, websiteId, startDate, endDate
<Grid columns="1fr auto" gap> <Grid columns="1fr auto" gap>
<Column gap> <Column gap>
<Row> <Row>
<Text size="4" weight="bold"> <Text size="lg" weight="bold">
{name} {name}
</Text> </Text>
</Row> </Row>
@ -92,7 +92,7 @@ export function Goal({ id, name, type, parameters, websiteId, startDate, endDate
maxValue={data?.total || 1} maxValue={data?.total || 1}
style={{ width: '100%' }} style={{ width: '100%' }}
/> />
<Text weight="bold" size="7"> <Text weight="bold" size="4xl">
{data?.total ? Math.round((+data?.num / +data?.total) * 100) : '0'}% {data?.total ? Math.round((+data?.num / +data?.total) * 100) : '0'}%
</Text> </Text>
</Row> </Row>

View file

@ -131,7 +131,7 @@ const Cell = ({ children }: { children: ReactNode }) => {
alignItems="center" alignItems="center"
width="100px" width="100px"
height="100px" height="100px"
backgroundColor="2" backgroundColor="surface-raised"
borderRadius borderRadius
> >
{children} {children}

View file

@ -21,7 +21,7 @@ export function WebsitePanels({ websiteId }: { websiteId: string }) {
<Grid gap="3"> <Grid gap="3">
<GridRow layout="two" {...rowProps}> <GridRow layout="two" {...rowProps}>
<Panel> <Panel>
<Heading size="2">{formatMessage(labels.pages)}</Heading> <Heading size="base">{formatMessage(labels.pages)}</Heading>
<Tabs> <Tabs>
<TabList> <TabList>
<Tab id="path">{formatMessage(labels.path)}</Tab> <Tab id="path">{formatMessage(labels.path)}</Tab>
@ -40,7 +40,7 @@ export function WebsitePanels({ websiteId }: { websiteId: string }) {
</Tabs> </Tabs>
</Panel> </Panel>
<Panel> <Panel>
<Heading size="2">{formatMessage(labels.sources)}</Heading> <Heading size="base">{formatMessage(labels.sources)}</Heading>
<Tabs> <Tabs>
<TabList> <TabList>
<Tab id="referrer">{formatMessage(labels.referrers)}</Tab> <Tab id="referrer">{formatMessage(labels.referrers)}</Tab>
@ -62,7 +62,7 @@ export function WebsitePanels({ websiteId }: { websiteId: string }) {
<GridRow layout="two" {...rowProps}> <GridRow layout="two" {...rowProps}>
<Panel> <Panel>
<Heading size="2">{formatMessage(labels.environment)}</Heading> <Heading size="base">{formatMessage(labels.environment)}</Heading>
<Tabs> <Tabs>
<TabList> <TabList>
<Tab id="browser">{formatMessage(labels.browsers)}</Tab> <Tab id="browser">{formatMessage(labels.browsers)}</Tab>
@ -82,7 +82,7 @@ export function WebsitePanels({ websiteId }: { websiteId: string }) {
</Panel> </Panel>
<Panel> <Panel>
<Heading size="2">{formatMessage(labels.location)}</Heading> <Heading size="base">{formatMessage(labels.location)}</Heading>
<Tabs> <Tabs>
<TabList> <TabList>
<Tab id="country">{formatMessage(labels.countries)}</Tab> <Tab id="country">{formatMessage(labels.countries)}</Tab>
@ -108,7 +108,7 @@ export function WebsitePanels({ websiteId }: { websiteId: string }) {
</Panel> </Panel>
<Panel> <Panel>
<Heading size="2">{formatMessage(labels.traffic)}</Heading> <Heading size="base">{formatMessage(labels.traffic)}</Heading>
<Row border="bottom" marginBottom="4" /> <Row border="bottom" marginBottom="4" />
<WeeklyTraffic websiteId={websiteId} /> <WeeklyTraffic websiteId={websiteId} />
</Panel> </Panel>

View file

@ -169,7 +169,7 @@ export function CompareTables({ websiteId }: { websiteId: string }) {
<Grid columns={{ xs: '1fr', lg: '1fr 1fr' }} gap="6" height="100%"> <Grid columns={{ xs: '1fr', lg: '1fr 1fr' }} gap="6" height="100%">
<Column gap="6"> <Column gap="6">
<Row alignItems="center" justifyContent="space-between"> <Row alignItems="center" justifyContent="space-between">
<Heading size="2">{formatMessage(labels.previous)}</Heading> <Heading size="base">{formatMessage(labels.previous)}</Heading>
<DateDisplay startDate={startDate} endDate={endDate} /> <DateDisplay startDate={startDate} endDate={endDate} />
</Row> </Row>
<MetricsTable <MetricsTable
@ -183,7 +183,7 @@ export function CompareTables({ websiteId }: { websiteId: string }) {
</Column> </Column>
<Column border="left" paddingLeft="6" gap="6"> <Column border="left" paddingLeft="6" gap="6">
<Row alignItems="center" justifyContent="space-between"> <Row alignItems="center" justifyContent="space-between">
<Heading size="2"> {formatMessage(labels.current)}</Heading> <Heading size="base"> {formatMessage(labels.current)}</Heading>
<DateDisplay startDate={dateRange.startDate} endDate={dateRange.endDate} /> <DateDisplay startDate={dateRange.startDate} endDate={dateRange.endDate} />
</Row> </Row>
<MetricsTable <MetricsTable

View file

@ -183,7 +183,7 @@ export function RealtimeLog({ data }: { data: any }) {
return ( return (
<Column gap> <Column gap>
<Heading size="2">{formatMessage(labels.activity)}</Heading> <Heading size="base">{formatMessage(labels.activity)}</Heading>
{isPhone ? ( {isPhone ? (
<> <>
<Row> <Row>

View file

@ -61,7 +61,7 @@ export function SessionActivity({
return ( return (
<Column key={eventId} gap> <Column key={eventId} gap>
{showHeader && <Heading size="1">{formatTimezoneDate(createdAt, 'PPPP')}</Heading>} {showHeader && <Heading size="sm">{formatTimezoneDate(createdAt, 'PPPP')}</Heading>}
<Row alignItems="center" gap="6" height="40px"> <Row alignItems="center" gap="6" height="40px">
<StatusLight color={`#${visitId?.substring(0, 6)}`}> <StatusLight color={`#${visitId?.substring(0, 6)}`}>
<Text wrap="nowrap">{formatTimezoneDate(createdAt, 'pp')}</Text> <Text wrap="nowrap">{formatTimezoneDate(createdAt, 'pp')}</Text>

View file

@ -17,8 +17,8 @@ export function SessionData({ websiteId, sessionId }: { websiteId: string; sessi
<Label>{dataKey}</Label> <Label>{dataKey}</Label>
<Row alignItems="center" gap> <Row alignItems="center" gap>
<Text>{stringValue}</Text> <Text>{stringValue}</Text>
<Box paddingY="1" paddingX="2" border borderRadius borderColor="5"> <Box paddingY="1" paddingX="2" border borderRadius borderColor="muted">
<Text color="muted" size="1"> <Text color="muted" size="xs">
{DATA_TYPES[dataType]} {DATA_TYPES[dataType]}
</Text> </Text>
</Box> </Box>

View file

@ -4,7 +4,7 @@ import { LoginForm } from './LoginForm';
export function LoginPage() { export function LoginPage() {
return ( return (
<Column alignItems="center" height="100vh" backgroundColor="2" paddingTop="12"> <Column alignItems="center" height="100vh" backgroundColor="surface-raised" paddingTop="12">
<LoginForm /> <LoginForm />
</Column> </Column>
); );

View file

@ -1,4 +1,4 @@
import { Column, FloatingTooltip, Row, StatusLight } from '@umami/react-zen'; import { Column, FloatingTooltip, Row, StatusLight, Text } from '@umami/react-zen';
import type { ReactNode } from 'react'; import type { ReactNode } from 'react';
export function ChartTooltip({ export function ChartTooltip({
@ -12,10 +12,18 @@ export function ChartTooltip({
}) { }) {
return ( return (
<FloatingTooltip> <FloatingTooltip>
<Column gap="3" fontSize="1"> <Column
{title && <Row alignItems="center">{title}</Row>} gap="3"
backgroundColor="surface-inverted"
color="inverted"
padding="4"
borderRadius="md"
>
{title && <Text size="sm">{title}</Text>}
<Row alignItems="center"> <Row alignItems="center">
<StatusLight color={color}>{value}</StatusLight> <StatusLight color={color}>
<Text size="sm">{value}</Text>
</StatusLight>
</Row> </Row>
</Column> </Column>
</FloatingTooltip> </FloatingTooltip>

View file

@ -12,12 +12,12 @@ export function EmptyPlaceholder({ title, description, icon, children }: EmptyPl
return ( return (
<Column alignItems="center" justifyContent="center" gap="5" height="100%" width="100%"> <Column alignItems="center" justifyContent="center" gap="5" height="100%" width="100%">
{icon && ( {icon && (
<Icon color="10" size="xl"> <Icon color="muted" size="xl">
{icon} {icon}
</Icon> </Icon>
)} )}
{title && ( {title && (
<Text weight="bold" size="4"> <Text weight="bold" size="lg">
{title} {title}
</Text> </Text>
)} )}

View file

@ -19,7 +19,7 @@ export function SectionHeader({
<Row {...props} justifyContent="space-between" alignItems="center" height="60px"> <Row {...props} justifyContent="space-between" alignItems="center" height="60px">
<Row gap="3" alignItems="center"> <Row gap="3" alignItems="center">
{icon && <Icon size="md">{icon}</Icon>} {icon && <Icon size="md">{icon}</Icon>}
{title && <Heading size="3">{title}</Heading>} {title && <Heading size="lg">{title}</Heading>}
{description && <Text color="muted">{description}</Text>} {description && <Text color="muted">{description}</Text>}
</Row> </Row>
<Row justifyContent="flex-end">{children}</Row> <Row justifyContent="flex-end">{children}</Row>

View file

@ -51,7 +51,13 @@ export function FilterBar({ websiteId }: { websiteId: string }) {
} }
return ( return (
<Row gap alignItems="center" justifyContent="space-between" padding="2" backgroundColor="3"> <Row
gap
alignItems="center"
justifyContent="space-between"
padding="2"
backgroundColor="surface-sunken"
>
<Row alignItems="center" gap="2" wrap="wrap"> <Row alignItems="center" gap="2" wrap="wrap">
{segment && !isLoading && ( {segment && !isLoading && (
<FilterItem <FilterItem
@ -138,11 +144,11 @@ const FilterItem = ({ name, label, operator, value, onRemove }) => {
> >
<Row alignItems="center" gap="4"> <Row alignItems="center" gap="4">
<Row alignItems="center" gap="2"> <Row alignItems="center" gap="2">
<Text color="12" weight="bold"> <Text color="primary" weight="bold">
{label} {label}
</Text> </Text>
<Text color="11">{operator}</Text> <Text color="muted">{operator}</Text>
<Text color="12" weight="bold"> <Text color="primary" weight="bold">
{value} {value}
</Text> </Text>
</Row> </Row>

View file

@ -30,7 +30,7 @@ export function ActiveUsers({
return ( return (
<LinkButton href={`/websites/${websiteId}/realtime`} variant="quiet"> <LinkButton href={`/websites/${websiteId}/realtime`} variant="quiet">
<StatusLight variant="success"> <StatusLight variant="success">
<Text size="2" weight="medium"> <Text size="sm" weight="medium">
{count} {formatMessage(labels.online)} {count} {formatMessage(labels.online)}
</Text> </Text>
</StatusLight> </StatusLight>

View file

@ -23,7 +23,7 @@ export function Legend({
<Row key={text} onClick={() => onClick(item)}> <Row key={text} onClick={() => onClick(item)}>
<StatusLight color={color.alpha(color.alpha() + 0.2).toHex()}> <StatusLight color={color.alpha(color.alpha() + 0.2).toHex()}>
<Text <Text
size="2" size="sm"
color={hidden ? 'disabled' : undefined} color={hidden ? 'disabled' : undefined}
truncate={true} truncate={true}
style={{ maxWidth: '300px' }} style={{ maxWidth: '300px' }}

View file

@ -133,7 +133,7 @@ const AnimatedRow = ({
justifyContent="flex-start" justifyContent="flex-start"
position="relative" position="relative"
border="left" border="left"
borderColor="8" borderColor="strong"
color="muted" color="muted"
paddingLeft="3" paddingLeft="3"
> >

View file

@ -49,7 +49,7 @@ export function WeeklyTraffic({ websiteId }: { websiteId: string }) {
}); });
return ( return (
<Row key={i} justifyContent="flex-end"> <Row key={i} justifyContent="flex-end">
<Text color="muted" size="2"> <Text color="muted" size="sm">
{label} {label}
</Text> </Text>
</Row> </Row>
@ -79,7 +79,7 @@ export function WeeklyTraffic({ websiteId }: { websiteId: string }) {
<Row <Row
alignItems="center" alignItems="center"
justifyContent="center" justifyContent="center"
backgroundColor="2" backgroundColor="surface-raised"
width="16px" width="16px"
height="16px" height="16px"
borderRadius="full" borderRadius="full"