Skip to content

Commit 9bee84c

Browse files
committed
feat: 디자인 시스템 에셋 추가
1 parent fb1ccda commit 9bee84c

19 files changed

Lines changed: 235 additions & 2 deletions

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,34 @@ packages/
1313
design-system/ # design tokens and brand constants
1414
```
1515

16+
## Assets
17+
18+
Figma에서 export한 공통 에셋은 디자인 시스템 패키지에 저장합니다.
19+
20+
```txt
21+
packages/design-system/assets/
22+
logos/
23+
```
24+
25+
앱에서는 `designAssets` manifest를 통해 사용합니다.
26+
27+
```ts
28+
import { designAssets } from '@comma/design-system';
29+
30+
const logo = designAssets.logos.symbolDefault.src;
31+
```
32+
33+
## Fonts
34+
35+
디자인 시스템에서 사용하는 공개 폰트는 로컬 파일로 저장하고 `@font-face`로 로드합니다.
36+
37+
```txt
38+
packages/design-system/assets/fonts/
39+
kepler-std/
40+
outfit/
41+
pretendard/
42+
```
43+
1644
## Bridge
1745

1846
WebView 통신은 `@webview-bridge/web`, `@webview-bridge/react-native`, `zod` 기반으로 구성되어 있습니다.
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
import { designAssets, radii, themeClass, typography, vars } from '@comma/design-system';
2+
import type { Meta, StoryObj } from '@storybook/react-vite';
3+
4+
const meta = {
5+
title: 'Design System/Assets'
6+
} satisfies Meta;
7+
8+
export default meta;
9+
10+
type Story = StoryObj<typeof meta>;
11+
12+
const groups = Object.entries(designAssets);
13+
14+
export const Assets: Story = {
15+
render: () => (
16+
<div
17+
className={themeClass}
18+
style={{
19+
minHeight: '100vh',
20+
padding: 32,
21+
background: vars.color.backgroundPrimary,
22+
color: vars.color.textPrimary,
23+
fontFamily: vars.font.body
24+
}}
25+
>
26+
<div style={{ display: 'grid', gap: 32 }}>
27+
{groups.map(([groupName, assets]) => (
28+
<section key={groupName} style={{ display: 'grid', gap: 12 }}>
29+
<h2 style={{ margin: 0, ...typography.systemSection }}>{groupName}</h2>
30+
<div
31+
style={{
32+
display: 'grid',
33+
gridTemplateColumns: 'repeat(auto-fill, minmax(260px, 1fr))',
34+
gap: 12
35+
}}
36+
>
37+
{Object.entries(assets).map(([assetName, asset]) => (
38+
<article
39+
key={assetName}
40+
style={{
41+
display: 'grid',
42+
gap: 10,
43+
padding: 12,
44+
borderRadius: radii.md,
45+
border: `1px solid ${vars.color.lineTertiary}`,
46+
background: vars.color.backgroundFill
47+
}}
48+
>
49+
<div
50+
style={{
51+
display: 'grid',
52+
placeItems: 'center',
53+
overflow: 'auto',
54+
borderRadius: radii.sm,
55+
background: vars.color.backgroundPrimary
56+
}}
57+
>
58+
<img
59+
src={asset.src}
60+
alt={asset.description}
61+
style={{
62+
display: 'block',
63+
width: asset.width,
64+
height: asset.height,
65+
objectFit: 'contain'
66+
}}
67+
/>
68+
</div>
69+
<div style={{ display: 'grid', gap: 4 }}>
70+
<strong style={typography.labelNormalB}>{assetName}</strong>
71+
<span style={{ ...typography.captionR, color: vars.color.textSecondary }}>
72+
{asset.width}x{asset.height} · {asset.figmaNodeId}
73+
</span>
74+
</div>
75+
</article>
76+
))}
77+
</div>
78+
</section>
79+
))}
80+
</div>
81+
</div>
82+
)
83+
};

apps/storybook/src/DesignTokens.stories.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ const typographyTokenNames = [
3434
'labelReadingB',
3535
'labelReadingR',
3636
'captionB',
37-
'captionR'
37+
'captionR',
38+
'engNum',
39+
'systemEyebrow',
40+
'systemSection'
3841
] as const;
3942

4043
const tokenGroupStyle: React.CSSProperties = {
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)