Skip to content

Commit fc06451

Browse files
committed
fix(InfoViewer): add size_s
1 parent 1d1e4db commit fc06451

File tree

2 files changed

+35
-9
lines changed

2 files changed

+35
-9
lines changed

src/components/InfoViewer/InfoViewer.scss

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
.info-viewer {
2-
font-size: var(--yc-text-body-2-font-size);
3-
line-height: var(--yc-text-body-2-line-height);
2+
--ydb-info-viewer-font-size: var(--yc-text-body-2-font-size);
3+
--ydb-info-viewer-line-height: var(--yc-text-body-2-line-height);
4+
--ydb-info-viewer-title-font-weight: 600;
5+
--ydb-info-viewer-title-margin: 15px 0 10px;
6+
--ydb-info-viewer-items-gap: 7px;
7+
8+
font-size: var(--ydb-info-viewer-font-size);
9+
line-height: var(--ydb-info-viewer-line-height);
10+
411
&__title {
5-
margin: 15px 0 10px;
12+
margin: var(--ydb-info-viewer-title-margin);
613

7-
font-size: var(--yc-text-body-2-font-size);
8-
font-weight: 600;
9-
line-height: var(--yc-text-body-2-line-height);
14+
font-weight: var(--ydb-info-viewer-title-font-weight);
1015
}
1116

1217
&__items {
1318
display: flex;
1419
flex-direction: column;
15-
gap: 7px;
20+
gap: var(--ydb-info-viewer-items-gap);
1621

1722
max-width: 100%;
1823
}
@@ -51,4 +56,24 @@
5156

5257
white-space: nowrap;
5358
}
59+
60+
&_size {
61+
&_s {
62+
--ydb-info-viewer-font-size: var(--yc-text-body-1-font-size);
63+
--ydb-info-viewer-line-height: var(--yc-text-body-1-line-height);
64+
--ydb-info-viewer-title-font-weight: 500;
65+
--ydb-info-viewer-title-margin: 0 0 4px;
66+
--ydb-info-viewer-items-gap: 4px;
67+
68+
.info-viewer {
69+
&__row {
70+
height: auto;
71+
}
72+
73+
&__label {
74+
min-width: 85px;
75+
}
76+
}
77+
}
78+
}
5479
}

src/components/InfoViewer/InfoViewer.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ interface InfoViewerProps {
1212
title?: string;
1313
info?: InfoViewerItem[];
1414
dots?: boolean;
15+
size?: 's';
1516
className?: string;
1617
}
1718

1819
const b = cn('info-viewer');
1920

20-
const InfoViewer = ({title, info, dots = true, className}: InfoViewerProps) => (
21-
<div className={b(null, className)}>
21+
const InfoViewer = ({title, info, dots = true, size, className}: InfoViewerProps) => (
22+
<div className={b({size}, className)}>
2223
{title && <div className={b('title')}>{title}</div>}
2324
{info && info.length > 0 ? (
2425
<div className={b('items')}>

0 commit comments

Comments
 (0)