Skip to content

feat: update typographies to new #165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 17, 2025
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
2 changes: 1 addition & 1 deletion src/lib/cards/base-card/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const CardHeader = styled(Box)(({ theme }) => ({
}));

export const CardContent = styled(Box)(({ theme }) => ({
...theme.typography.text12,
...theme.typography.caption12,
minHeight: '20px',
height: '100%',
overflow: 'auto',
Expand Down
6 changes: 3 additions & 3 deletions src/lib/cards/column-card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ export const ColumnCard: React.FC<IColumnCardProps> = ({
{columns.map((column, index) => (
<Grid item key={index} xs={index === columns.length - 1 ? 8 : 4}>
<Stack>
<S.ColumnTitleTypography variant="text12">{column.title}</S.ColumnTitleTypography>
<S.ColumnTitleTypography variant="caption12">{column.title}</S.ColumnTitleTypography>

{column.data.map((item, itemIndex) =>
tooltipColumnIndex === index ? (
<S.CustomTooltip title={item} placement="top-start" key={itemIndex}>
<S.ColumnDataTypography variant="text12">{item}</S.ColumnDataTypography>
<S.ColumnDataTypography variant="caption12">{item}</S.ColumnDataTypography>
</S.CustomTooltip>
) : (
<S.ColumnDataTypography variant="text12" key={itemIndex}>
<S.ColumnDataTypography variant="caption12" key={itemIndex}>
{item}
</S.ColumnDataTypography>
),
Expand Down
6 changes: 3 additions & 3 deletions src/lib/charts/line-chart/line-line-chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ const LineChart: FC<ILineChartProps> = memo(
padding: 8,
textStyle: {
color: theme.palette.text.text4,
fontFamily: theme.typography.mono1213.fontFamily,
fontSize: theme.typography.mono1213.fontSize,
fontWeight: theme.typography.mono1213.fontWeight as number,
fontFamily: theme.typography.paragraphSecondary.fontFamily,
fontSize: theme.typography.paragraphSecondary.fontSize,
fontWeight: theme.typography.paragraphSecondary.fontWeight as number,
},
shadowBlur: 20,
shadowOffsetX: 0,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/checkbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface ICheckboxProps extends CheckboxProps {
export const Checkbox: FC<ICheckboxProps> = ({
label,
variant = 'check',
labelTypographyVariant = 'text12',
labelTypographyVariant = 'caption12',
formControlLabelProps,
...props
}) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const Tooltip = ({
<TableTooltip
rows={[
[
<Typography key="date" color="text.text8" variant="text12">
<Typography key="date" color="text.text8" variant="caption12">
{dateString}
</Typography>,
],
Expand Down
2 changes: 1 addition & 1 deletion src/lib/chirp-widgets/widget-base/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export const WidgetBase: React.FC<WidgetBaseProps> = (props) => {
</Stack>
{date && (
<Box>
<Typography component="span" variant="caption10" color="text.text8">
<Typography component="span" variant="overline" color="text.text8">
Last update:
</Typography>

Expand Down
2 changes: 1 addition & 1 deletion src/lib/empty-fallback/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const EmptyFallback: FC<IEmptyFallbackProps> = ({ title, subTitle, withBa
</Typography>
)}
{subTitle && (
<Typography variant="text12" sx={{ color: theme.palette.text.text8 }}>
<Typography variant="caption12" sx={{ color: theme.palette.text.text8 }}>
{subTitle}
</Typography>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/image-preview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const ImagePreview: FC<IImagePreviewProps> = ({
sx={{
color: 'text.text8',
}}
variant="text12"
variant="caption12"
textAlign="center"
>
{subTitle}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/list-item/components/accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const AccordionItem: FC<IAccordionProps> = ({ title, children, secondaryA
{checkboxProps ? (
<Checkbox label={title} {...checkboxProps} />
) : (
<Typography className="title" variant="text14" color="text.text14">
<Typography className="title" variant="body1" color="text.text14">
{title}
</Typography>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/list-item/components/base-list-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const BaseListItem: FC<IListItemProps> = ({ title, subTitle, checkboxProp
/>
) : null}
<Stack>
<Typography variant="text14" color="text.text4">
<Typography variant="body1" color="text.text4">
{title}
</Typography>
{subTitle && (
Expand Down
4 changes: 2 additions & 2 deletions src/lib/list-item/style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const ListItem = styled(MUIListItem)(({ theme }) => ({
'&:hover': {
backgroundColor: theme.palette.background.background7,
borderRadius: '8px',
'.MuiTypography-text14': {
'.MuiTypography-body1': {
color: theme.palette.base.color6,
},
},
Expand Down Expand Up @@ -46,7 +46,7 @@ export const AccordionListItem = styled(MUIListItem)(({ theme }) => ({
},
},
'&:hover': {
'.MuiTypography-text14.title': {
'.MuiTypography-body1.title': {
color: theme.palette.base.color6,
},
'.accordion-summary-wrapper, .MuiCollapse-root': {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/logout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const Logout: FC<LogoutProps> = ({ onLogout }) => {
<ListItem onClick={handleLogout}>
<ListItemContent>
<LogoutIcon />
<Typography variant="mono1213" color="text.text8">
<Typography variant="paragraphSecondary" color="text.text8">
Logout
</Typography>
</ListItemContent>
Expand Down
8 changes: 4 additions & 4 deletions src/lib/map/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export const MapContainer = styled(Box, {

'.suggestions-wrapper': {
'.suggestions': {
...theme.typography.text12,
...theme.typography.caption12,
backgroundColor: theme.palette.background.background1,
border: `1px solid ${alpha(theme.palette.border.border3, 0.1)}`,
borderRadius: '12px',
Expand Down Expand Up @@ -274,7 +274,7 @@ export const MapContainer = styled(Box, {
},

'.mapboxgl-ctrl-geocoder--input': {
...theme.typography.text1402,
...theme.typography.body1,
color: theme.palette.text.text1 + '!important',
height: '28px',
padding: '10px 36px',
Expand Down Expand Up @@ -328,7 +328,7 @@ export const MapContainer = styled(Box, {
width: '92px',
height: '22px',
color: theme.palette.text.text4,
...theme.typography.caption10,
...theme.typography.overline,
'& svg': {
width: '22px',
height: '22px',
Expand Down Expand Up @@ -463,7 +463,7 @@ export const MapContainer = styled(Box, {
border: `1px solid ${alpha(theme.palette.border.border3, 0.1)} !important`,
backdropFilter: 'blur(20px)',
boxShadow: `0px 4px 20px 0px ${alpha('#5C5C5C', 0.14)}} !important`,
...theme.typography.mono1213,
...theme.typography.paragraphSecondary,

'& .speed': {
...theme.typography.mono10,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const Select: FC<SelectPropsType> = ({
left: 0,
top: '-5px',
color: theme.palette.text.titleInput,
...theme.typography.inputLabel,
...theme.typography.caption12,
},
}}
/>
Expand Down
6 changes: 3 additions & 3 deletions src/lib/system-widget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ export const SystemWidget: FC<Props> = ({ attributeName, title, value, units, da
return (
<S.Card>
<Stack direction="row" alignItems="center" justifyContent="space-between" mb="8px" spacing="16px">
<Typography variant="text12" color="text.text4" noWrap title={title}>
<Typography variant="caption12" color="text.text4" noWrap title={title}>
{title}
</Typography>
<Typography variant="text12" color="text.text8" flexShrink={0}>
<Typography variant="caption12" color="text.text8" flexShrink={0}>
Last update:
<Typography
component="span"
variant="text12"
variant="caption12"
color="text.text4"
sx={{ verticalAlign: 'bottom', ml: '4px' }}
>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/table/components/table-head/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const HeadCell = styled(MuiTableCell)(({ theme }) => ({
color: theme.palette.text.text8,
whiteSpace: 'nowrap',
cursor: 'auto',
...theme.typography.text14,
...theme.typography.body1,

span: {
svg: {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/table/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const Cell = styled(TableCell)(({ theme }) => ({
borderBottom: `1px solid ${alpha(theme.palette.border.border3, 0.1)}`,
opacity: 1,
color: `${theme.palette.text.text4} !important`,
...theme.typography.text14,
...theme.typography.body1,

[theme.breakpoints.down('lg')]: {
padding: '8px 6px',
Expand Down
2 changes: 1 addition & 1 deletion src/lib/text-field/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const TextField = styled(MuiTextField)<StandardTextFieldProps>(({ theme }
left: 0,
top: '-24px',
color: theme.palette.text.titleInput,
...theme.typography.inputLabel,
...theme.typography.caption12,
},

'.MuiFormControl-root.MuiTextField-root': {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/tree-select/style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const TreeItem = styled(MUITreeItem)<TreeItemProps>(({ theme, level = 0 }
color: theme.palette.text.textInput80,
background: 'transparent',
borderRadius: '0px',
...theme.typography.text14,
...theme.typography.body1,

svg: {
color: alpha(theme.palette?.text?.textInput80, 0.8),
Expand Down
4 changes: 2 additions & 2 deletions src/lib/user-popup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const UserPopup: FC<UserPopupProps> = ({ onLogout, onWalletConnect, onCha
sx={{ cursor: 'pointer' }}
>
<Avatar sx={{ width: '40px', height: '40px' }} />
<Typography variant="text1402" color="text.text4" sx={{ textOverflow: 'ellipsis', overflow: 'hidden' }}>
<Typography variant="body1" color="text.text4" sx={{ textOverflow: 'ellipsis', overflow: 'hidden' }}>
{name}
</Typography>
</Stack>
Expand Down Expand Up @@ -88,7 +88,7 @@ export const UserPopup: FC<UserPopupProps> = ({ onLogout, onWalletConnect, onCha
<Stack sx={{ marginLeft: '-4px' }}>
<ThemeSwitch onChange={onChangeMode} checked={isDarkMode} />
</Stack>
<Typography variant="mono1213" color="text.text8">
<Typography variant="paragraphSecondary" color="text.text8">
{theme.palette.mode === 'dark' ? 'Dark' : 'Light'}
</Typography>
</S.ListItemContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const BaseWidgetCustomHeader: FC<IBaseWidgetCustomHeaderProps> = ({ title
<Stack direction="row" justifyContent="space-between" alignItems="center">
<S.Title variant="title12">{title}</S.Title>
</Stack>
<S.WidgetTypeName variant="caption10">{typeText}</S.WidgetTypeName>
<S.WidgetTypeName variant="overline">{typeText}</S.WidgetTypeName>
</Stack>
</Stack>
);
Expand Down
4 changes: 1 addition & 3 deletions src/lib/widgets/base-widget/base-widget.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ export const Default: Story = {
type="online"
title="Geofences with units"
>
<Typography variant="caption10">
Lorem ipsum dolor sit amet consectetur adipisicing elit.
</Typography>
<Typography variant="overline">Lorem ipsum dolor sit amet consectetur adipisicing elit.</Typography>
</BaseWidget>
</Box>
);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/widgets/base-widget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const BaseWidget: FC<PropsWithChildren<IBaseWidgetProps>> = ({
<Stack direction="row" justifyContent="space-between" alignItems="flex-start">
<Stack gap={1}>
<S.Title variant="title12">{title}</S.Title>
<S.WidgetTypeName variant="caption10">{resolveWidgetTypName}</S.WidgetTypeName>
<S.WidgetTypeName variant="overline">{resolveWidgetTypName}</S.WidgetTypeName>
</Stack>
<Stack direction="row">
<IconButton size="small" variant="gray" onClick={onFavoriteClick}>
Expand Down
4 changes: 2 additions & 2 deletions src/lib/widgets/common/color-list-item/list-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ export const ColorListItem: FC<IColorListItemProps> = ({ color, name, value, onC
>
<Stack direction="row" gap={1} alignItems="center">
<S.Marker sx={{ backgroundColor: color }} />
<Typography variant="text12" sx={{ color: 'text.text1' }}>
<Typography variant="caption12" sx={{ color: 'text.text1' }}>
{name}
</Typography>
</Stack>
{value === null ? null : (
<Typography variant="text12" sx={{ color: 'text.text1' }}>
<Typography variant="caption12" sx={{ color: 'text.text1' }}>
{value}
</Typography>
)}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/widgets/list-widget-with-filters/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ export const ListWidgetWithFilters = <T,>(props: PropsWithChildren<IListWidgetPr
sx={{
color: 'text.text1',
}}
variant="text12"
variant="caption12"
>
{String(row[nameKey])}
</Typography>
<Typography
sx={{
color: 'text.text1',
}}
variant="text12"
variant="caption12"
textAlign="end"
>
{String(row[valueKey])}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export const Default: Story = {
sx={{
color: 'text.text8',
}}
variant="caption10"
variant="overline"
>
{name}
</Typography>
Expand All @@ -128,15 +128,15 @@ export const Default: Story = {
sx={{
color: 'text.text1',
}}
variant="text12"
variant="caption12"
>
{item.name}
</Typography>
<Typography
sx={{
color: 'text.text1',
}}
variant="text12"
variant="caption12"
textAlign="end"
>
{new Date().toISOString().split('T')[0]}
Expand Down
6 changes: 3 additions & 3 deletions src/lib/widgets/list-widget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const ListWidget = <T,>(props: PropsWithChildren<IListWidgetProps<T>>) =>
sx={{
color: 'text.text8',
}}
variant="caption10"
variant="overline"
>
{name}
</Typography>
Expand Down Expand Up @@ -69,15 +69,15 @@ export const ListWidget = <T,>(props: PropsWithChildren<IListWidgetProps<T>>) =>
sx={{
color: 'text.text1',
}}
variant="text12"
variant="caption12"
>
{String(row[nameKey])}
</Typography>
<Typography
sx={{
color: 'text.text1',
}}
variant="text12"
variant="caption12"
textAlign="end"
>
{String(row[valueKey])}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/widgets/stacked-line-widget/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ export const StyledMenuItem = styled(MenuItem)(({ theme }) => ({
'&.Mui-selected': {
background: 'transparent',
},
...theme.typography.text12,
...theme.typography.caption12,
color: theme.palette.text.text1,
}));
4 changes: 2 additions & 2 deletions src/lib/widgets/vertical-bars-widget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ export const VerticalBarsChartWidget = <T,>(props: PropsWithChildren<IVerticalBa
<Box>
<Stack direction="row" gap={4} justifyContent="space-between">
<Stack gap={1}>
<Typography sx={{ color: 'text.text8' }} variant="caption10">
<Typography sx={{ color: 'text.text8' }} variant="overline">
{listLabel}
</Typography>
{listData.map((elem) => (
<Typography sx={{ color: 'text.text1' }} key={elem} variant="text12">
<Typography sx={{ color: 'text.text1' }} key={elem} variant="caption12">
{elem}
</Typography>
))}
Expand Down
Loading
Loading