@x-plat/design-system 0.5.65 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordion/index.css +6 -6
- package/dist/components/AutoResizeTextArea/index.css +5 -5
- package/dist/components/Avatar/index.css +2 -2
- package/dist/components/Badge/index.css +1 -1
- package/dist/components/Box/index.css +5 -5
- package/dist/components/Breadcrumb/index.css +4 -4
- package/dist/components/Button/index.cjs +1 -2
- package/dist/components/Button/index.css +6 -6
- package/dist/components/Button/index.d.cts +1 -1
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Button/index.js +1 -2
- package/dist/components/Calendar/index.css +18 -18
- package/dist/components/CardTab/index.css +8 -8
- package/dist/components/Chart/index.css +11 -11
- package/dist/components/ChatInput/index.cjs +1 -2
- package/dist/components/ChatInput/index.css +16 -16
- package/dist/components/ChatInput/index.js +1 -2
- package/dist/components/CheckBox/index.css +2 -4
- package/dist/components/CheckBox/index.js +1 -1
- package/dist/components/Chip/index.css +5 -5
- package/dist/components/DatePicker/index.cjs +1 -2
- package/dist/components/DatePicker/index.css +36 -36
- package/dist/components/DatePicker/index.js +1 -2
- package/dist/components/Divider/index.css +2 -2
- package/dist/components/Drawer/index.css +5 -5
- package/dist/components/Dropdown/index.css +4 -4
- package/dist/components/Editor/index.css +36 -36
- package/dist/components/EmptyState/index.css +2 -2
- package/dist/components/FileUpload/index.css +4 -4
- package/dist/components/HtmlTypeWriter/index.css +1 -1
- package/dist/components/IconButton/index.cjs +1 -2
- package/dist/components/IconButton/index.css +5 -5
- package/dist/components/IconButton/index.d.cts +1 -1
- package/dist/components/IconButton/index.d.ts +1 -1
- package/dist/components/IconButton/index.js +1 -2
- package/dist/components/ImageSelector/index.css +7 -7
- package/dist/components/Input/index.css +7 -7
- package/dist/components/Modal/index.css +1 -1
- package/dist/components/Pagination/index.css +3 -3
- package/dist/components/PopOver/index.css +1 -1
- package/dist/components/Progress/index.css +1 -1
- package/dist/components/Radio/index.css +5 -5
- package/dist/components/Select/index.css +9 -9
- package/dist/components/Spinner/index.css +1 -1
- package/dist/components/Steps/index.css +3 -3
- package/dist/components/Swiper/index.css +3 -3
- package/dist/components/Switch/index.css +3 -3
- package/dist/components/Tab/index.css +4 -4
- package/dist/components/Table/index.css +10 -10
- package/dist/components/Tag/index.css +3 -3
- package/dist/components/TextArea/index.css +5 -5
- package/dist/components/Tooltip/index.css +4 -4
- package/dist/components/Video/index.css +1 -1
- package/dist/components/index.cjs +2 -4
- package/dist/components/index.css +624 -1018
- package/dist/components/index.js +3 -5
- package/dist/index.cjs +2 -6
- package/dist/index.css +624 -1018
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -6
- package/dist/layout/index.css +401 -793
- package/dist/tokens/index.cjs +0 -2
- package/dist/tokens/index.d.cts +9 -10
- package/dist/tokens/index.d.ts +9 -10
- package/dist/tokens/index.js +1 -2
- package/guidelines/AGENT_PROMPT.md +8 -9
- package/guidelines/Guidelines.md +1 -1
- package/guidelines/components/chart.md +1 -1
- package/guidelines/foundations/color.md +22 -23
- package/guidelines/foundations/typography.md +86 -36
- package/package.json +1 -1
package/dist/tokens/index.cjs
CHANGED
|
@@ -319,7 +319,6 @@ __export(tokens_exports, {
|
|
|
319
319
|
breakpoints: () => breakpoints,
|
|
320
320
|
cssVar: () => import_tokens_core2.cssVar,
|
|
321
321
|
gridColumns: () => gridColumns,
|
|
322
|
-
primitive: () => import_tokens_core.primitive,
|
|
323
322
|
semantic: () => import_tokens_core.semantic
|
|
324
323
|
});
|
|
325
324
|
module.exports = __toCommonJS(tokens_exports);
|
|
@@ -6111,6 +6110,5 @@ var import_tokens_core2 = require("@x-plat/tokens-core");
|
|
|
6111
6110
|
breakpoints,
|
|
6112
6111
|
cssVar,
|
|
6113
6112
|
gridColumns,
|
|
6114
|
-
primitive,
|
|
6115
6113
|
semantic
|
|
6116
6114
|
});
|
package/dist/tokens/index.d.cts
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
export { B as BREAKPOINT_KEYS_ORDERED, a as BreakpointKey, b as GridColumnConfig, G as GridSpanFor, c as breakpoints, g as gridColumns } from '../breakpoints-DsXkJgdl.cjs';
|
|
2
|
-
export { TokenVar, cssVar,
|
|
2
|
+
export { TokenVar, cssVar, semantic } from '@x-plat/tokens-core';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
5
|
-
type SemanticTextToken = "semantic-text-
|
|
5
|
+
type SemanticTextToken = "semantic-text-primary" | "semantic-text-secondary" | "semantic-text-tertiary" | "semantic-text-brand-primary" | "semantic-text-brand-secondary" | "semantic-text-disabled" | "semantic-text-inverse" | "semantic-text-success" | "semantic-text-error" | "semantic-text-warning" | "semantic-text-info" | "semantic-text-link" | "semantic-text-accent-red" | "semantic-text-accent-blue";
|
|
6
6
|
type SurfaceVariant = "subtle" | "default" | "strong";
|
|
7
|
-
type SurfaceGroup = "brand" | "success" | "error" | "warning" | "info";
|
|
8
|
-
type SemanticSurfaceToken = "semantic-surface-neutral-
|
|
9
|
-
type SemanticBorderToken = "semantic-border-
|
|
10
|
-
type SemanticIconToken = "semantic-icon-
|
|
11
|
-
type
|
|
12
|
-
type
|
|
13
|
-
type SemanticColorToken = SemanticTextToken | SemanticSurfaceToken | SemanticBorderToken | SemanticIconToken | SemanticEmphasisToken | SemanticInteractionToken;
|
|
7
|
+
type SurfaceGroup = "brand" | "brand-secondary" | "success" | "error" | "warning" | "info";
|
|
8
|
+
type SemanticSurfaceToken = "semantic-surface-neutral-primary" | "semantic-surface-neutral-secondary" | "semantic-surface-neutral-tertiary" | "semantic-surface-neutral-inverse" | "semantic-surface-neutral-disabled" | `semantic-surface-${SurfaceGroup}-${SurfaceVariant}`;
|
|
9
|
+
type SemanticBorderToken = "semantic-border-primary" | "semantic-border-secondary" | "semantic-border-tertiary" | "semantic-border-disabled" | "semantic-border-brand-primary" | "semantic-border-brand-secondary" | "semantic-border-success" | "semantic-border-error" | "semantic-border-warning" | "semantic-border-info";
|
|
10
|
+
type SemanticIconToken = "semantic-icon-primary" | "semantic-icon-secondary" | "semantic-icon-inverse" | "semantic-icon-brand" | "semantic-icon-brand-secondary" | "semantic-icon-success" | "semantic-icon-error" | "semantic-icon-warning" | "semantic-icon-info" | "semantic-icon-disabled";
|
|
11
|
+
type SemanticInteractionToken = `semantic-interaction-overlay-${5 | 10 | 25 | 50 | 75}` | "semantic-interaction-focus-ring";
|
|
12
|
+
type SemanticColorToken = SemanticTextToken | SemanticSurfaceToken | SemanticBorderToken | SemanticIconToken | SemanticInteractionToken;
|
|
14
13
|
type Shade = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
|
|
15
|
-
type BrandToken = `brand-primary-${Shade}` | `brand-secondary-${Shade}` | `brand-neutral-${Shade}` | "brand-base-white" |
|
|
14
|
+
type BrandToken = `brand-primary-${Shade}` | `brand-secondary-${Shade}` | `brand-neutral-${Shade}` | "brand-base-white" | `brand-base-overlay-${5 | 10 | 25 | 50 | 75 | 85}`;
|
|
16
15
|
type SystemToken = `system-success-${Shade}` | `system-error-${Shade}` | `system-warning-${Shade}` | `system-info-${Shade}` | `system-link-${400 | 500 | 600 | 700}`;
|
|
17
16
|
type ColorToken = SemanticColorToken | BrandToken | SystemToken | XplatColorTokenRegistry[keyof XplatColorTokenRegistry];
|
|
18
17
|
interface ColorProps {
|
package/dist/tokens/index.d.ts
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
export { B as BREAKPOINT_KEYS_ORDERED, a as BreakpointKey, b as GridColumnConfig, G as GridSpanFor, c as breakpoints, g as gridColumns } from '../breakpoints-DsXkJgdl.js';
|
|
2
|
-
export { TokenVar, cssVar,
|
|
2
|
+
export { TokenVar, cssVar, semantic } from '@x-plat/tokens-core';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
5
|
-
type SemanticTextToken = "semantic-text-
|
|
5
|
+
type SemanticTextToken = "semantic-text-primary" | "semantic-text-secondary" | "semantic-text-tertiary" | "semantic-text-brand-primary" | "semantic-text-brand-secondary" | "semantic-text-disabled" | "semantic-text-inverse" | "semantic-text-success" | "semantic-text-error" | "semantic-text-warning" | "semantic-text-info" | "semantic-text-link" | "semantic-text-accent-red" | "semantic-text-accent-blue";
|
|
6
6
|
type SurfaceVariant = "subtle" | "default" | "strong";
|
|
7
|
-
type SurfaceGroup = "brand" | "success" | "error" | "warning" | "info";
|
|
8
|
-
type SemanticSurfaceToken = "semantic-surface-neutral-
|
|
9
|
-
type SemanticBorderToken = "semantic-border-
|
|
10
|
-
type SemanticIconToken = "semantic-icon-
|
|
11
|
-
type
|
|
12
|
-
type
|
|
13
|
-
type SemanticColorToken = SemanticTextToken | SemanticSurfaceToken | SemanticBorderToken | SemanticIconToken | SemanticEmphasisToken | SemanticInteractionToken;
|
|
7
|
+
type SurfaceGroup = "brand" | "brand-secondary" | "success" | "error" | "warning" | "info";
|
|
8
|
+
type SemanticSurfaceToken = "semantic-surface-neutral-primary" | "semantic-surface-neutral-secondary" | "semantic-surface-neutral-tertiary" | "semantic-surface-neutral-inverse" | "semantic-surface-neutral-disabled" | `semantic-surface-${SurfaceGroup}-${SurfaceVariant}`;
|
|
9
|
+
type SemanticBorderToken = "semantic-border-primary" | "semantic-border-secondary" | "semantic-border-tertiary" | "semantic-border-disabled" | "semantic-border-brand-primary" | "semantic-border-brand-secondary" | "semantic-border-success" | "semantic-border-error" | "semantic-border-warning" | "semantic-border-info";
|
|
10
|
+
type SemanticIconToken = "semantic-icon-primary" | "semantic-icon-secondary" | "semantic-icon-inverse" | "semantic-icon-brand" | "semantic-icon-brand-secondary" | "semantic-icon-success" | "semantic-icon-error" | "semantic-icon-warning" | "semantic-icon-info" | "semantic-icon-disabled";
|
|
11
|
+
type SemanticInteractionToken = `semantic-interaction-overlay-${5 | 10 | 25 | 50 | 75}` | "semantic-interaction-focus-ring";
|
|
12
|
+
type SemanticColorToken = SemanticTextToken | SemanticSurfaceToken | SemanticBorderToken | SemanticIconToken | SemanticInteractionToken;
|
|
14
13
|
type Shade = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
|
|
15
|
-
type BrandToken = `brand-primary-${Shade}` | `brand-secondary-${Shade}` | `brand-neutral-${Shade}` | "brand-base-white" |
|
|
14
|
+
type BrandToken = `brand-primary-${Shade}` | `brand-secondary-${Shade}` | `brand-neutral-${Shade}` | "brand-base-white" | `brand-base-overlay-${5 | 10 | 25 | 50 | 75 | 85}`;
|
|
16
15
|
type SystemToken = `system-success-${Shade}` | `system-error-${Shade}` | `system-warning-${Shade}` | `system-info-${Shade}` | `system-link-${400 | 500 | 600 | 700}`;
|
|
17
16
|
type ColorToken = SemanticColorToken | BrandToken | SystemToken | XplatColorTokenRegistry[keyof XplatColorTokenRegistry];
|
|
18
17
|
interface ColorProps {
|
package/dist/tokens/index.js
CHANGED
|
@@ -12,7 +12,7 @@ var gridColumns = {
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
// src/tokens/colors.ts
|
|
15
|
-
import {
|
|
15
|
+
import { semantic } from "@x-plat/tokens-core";
|
|
16
16
|
|
|
17
17
|
// src/tokens/svg/action/CopyIcon.tsx
|
|
18
18
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -5784,6 +5784,5 @@ export {
|
|
|
5784
5784
|
breakpoints,
|
|
5785
5785
|
cssVar,
|
|
5786
5786
|
gridColumns,
|
|
5787
|
-
primitive,
|
|
5788
5787
|
semantic
|
|
5789
5788
|
};
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
1. 컴포넌트에 `color` / `className` / `style` prop **없음**. 색상·스타일은 내부 semantic 토큰으로 고정됨.
|
|
21
21
|
2. 컴포넌트는 `width: 100%` 로 부모를 채우므로 **반드시 GridItem 또는 wrapper 로 감싸서 너비를 제어**.
|
|
22
22
|
3. **CSS 로 DS 컴포넌트를 오버라이드하지 않는다**.
|
|
23
|
-
4. 색상·간격·타이포는 **semantic 토큰만** 사용.
|
|
23
|
+
4. 색상·간격·타이포는 **semantic 토큰만** 사용. brand / system / typo primitive 직접 참조 금지.
|
|
24
24
|
5. **모든 visible 그룹은 명시적 spacing 필수**. wrapper 의 `padding` / `gap` / 간격을 spacing 토큰으로 지정. 매직 넘버(`16px`, `1rem` 등) 금지.
|
|
25
25
|
|
|
26
26
|
---
|
|
@@ -430,7 +430,7 @@ import { ChatInput } from "@x-plat/design-system/components";
|
|
|
430
430
|
<Button>B</Button>
|
|
431
431
|
</div>
|
|
432
432
|
|
|
433
|
-
//
|
|
433
|
+
// 존재하지 않는 레이어 참조 (semantic 만 허용)
|
|
434
434
|
<div style={{ padding: "var(--spacing-size-4)" }}>...</div>
|
|
435
435
|
```
|
|
436
436
|
|
|
@@ -563,15 +563,14 @@ CSS 변수 `--semantic-{category}-{role}` 사용.
|
|
|
563
563
|
|
|
564
564
|
| 카테고리 | 키 |
|
|
565
565
|
|---|---|
|
|
566
|
-
| `text` |
|
|
567
|
-
| `surface` | neutral.{
|
|
568
|
-
| `border` |
|
|
569
|
-
| `icon` |
|
|
570
|
-
| `
|
|
571
|
-
| `interaction` | overlay-10 / overlay-25 / focus-ring |
|
|
566
|
+
| `text` | primary / secondary / tertiary / brand-primary / brand-secondary / disabled / inverse / success / error / warning / info / link / accent-red / accent-blue |
|
|
567
|
+
| `surface` | neutral.{primary/secondary/tertiary/inverse/disabled} / brand.{subtle/default/strong} / brand-secondary.{subtle/default/strong} / success/error/warning/info.{subtle/default/strong} |
|
|
568
|
+
| `border` | primary / secondary / tertiary / disabled / brand-primary / brand-secondary / success / error / warning / info |
|
|
569
|
+
| `icon` | primary / secondary / inverse / brand / brand-secondary / success / error / warning / info / disabled |
|
|
570
|
+
| `interaction` | overlay-5 / overlay-10 / overlay-25 / overlay-50 / overlay-75 / focus-ring |
|
|
572
571
|
| `categorical` | 1-8 × {bg / area / fill / text} |
|
|
573
572
|
|
|
574
|
-
예: `color: var(--semantic-text-
|
|
573
|
+
예: `color: var(--semantic-text-primary)`, `background: var(--semantic-surface-brand-default)`
|
|
575
574
|
|
|
576
575
|
### 스페이싱
|
|
577
576
|
|
package/guidelines/Guidelines.md
CHANGED
|
@@ -43,7 +43,7 @@ React 기반 디자인 시스템 라이브러리이다. Figma Make Kit과 1:1
|
|
|
43
43
|
|
|
44
44
|
1. **[설치 및 설정](./setup.md)** - CSS/컴포넌트 import, ToastProvider 설정
|
|
45
45
|
2. **파운데이션**
|
|
46
|
-
- [컬러](./foundations/color.md) -
|
|
46
|
+
- [컬러](./foundations/color.md) - 3레이어 semantic 토큰
|
|
47
47
|
- [스페이싱](./foundations/spacing.md) - space, radius, stroke
|
|
48
48
|
- [타이포그래피](./foundations/typography.md) - font, size, weight
|
|
49
49
|
- [아이콘](./foundations/icons.md) - import, 크기/색상, 카테고리
|
|
@@ -17,7 +17,7 @@ import { Chart } from "@xplat/design-system";
|
|
|
17
17
|
|
|
18
18
|
## 색상
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
semantic categorical 토큰 기반으로 시리즈별 색상을 자동 배정한다. line/bar는 `LINE_BAR_PALETTES`, pie/doughnut는 `PIE_PALETTES`를 사용한다.
|
|
21
21
|
|
|
22
22
|
---
|
|
23
23
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# 컬러 토큰 시스템
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 3레이어 구조
|
|
4
4
|
|
|
5
5
|
| 레이어 | 접두사 | 역할 |
|
|
6
6
|
|--------|--------|------|
|
|
7
|
-
|
|
|
8
|
-
|
|
|
9
|
-
| System | `--system-*` | 상태 색상 (success/error/warning/info) |
|
|
7
|
+
| Brand | `--brand-*` | 브랜드 색상 (hex 실값, 테마별 오버라이드) |
|
|
8
|
+
| System | `--system-*` | 상태 색상 (success/error/warning/info/link, hex 실값) |
|
|
10
9
|
| Semantic | `--semantic-*` | 용도 기반 최종 토큰 (brand+system 참조) |
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
Figma `brand` / `system` / `semantic` 컬렉션과 1:1 대응한다.
|
|
12
|
+
컴포넌트는 **semantic 토큰만** 소비한다. brand/system을 직접 참조하지 않는다.
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
|
|
@@ -19,16 +19,16 @@
|
|
|
19
19
|
|
|
20
20
|
```tsx
|
|
21
21
|
// 텍스트
|
|
22
|
-
<p className="text-semantic-text-
|
|
23
|
-
<p className="text-semantic-text-
|
|
22
|
+
<p className="text-semantic-text-primary">강조 텍스트</p>
|
|
23
|
+
<p className="text-semantic-text-secondary">보조 텍스트</p>
|
|
24
24
|
<p className="text-semantic-text-error">에러 메시지</p>
|
|
25
25
|
|
|
26
26
|
// 배경
|
|
27
|
-
<div className="bg-semantic-surface-neutral-
|
|
27
|
+
<div className="bg-semantic-surface-neutral-primary">기본 배경</div>
|
|
28
28
|
<div className="bg-semantic-surface-brand-subtle">브랜드 배경</div>
|
|
29
29
|
|
|
30
30
|
// 테두리
|
|
31
|
-
<div className="border border-semantic-border-
|
|
31
|
+
<div className="border border-semantic-border-primary">기본 테두리</div>
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
---
|
|
@@ -37,12 +37,13 @@
|
|
|
37
37
|
|
|
38
38
|
### Text
|
|
39
39
|
|
|
40
|
-
`--semantic-text-{
|
|
40
|
+
`--semantic-text-{primary, secondary, tertiary, brand-primary, brand-secondary, disabled, inverse, success, error, warning, info, link, accent-red, accent-blue}`
|
|
41
41
|
|
|
42
42
|
### Surface
|
|
43
43
|
|
|
44
|
-
- Neutral: `--semantic-surface-neutral-{
|
|
44
|
+
- Neutral: `--semantic-surface-neutral-{primary, secondary, tertiary, inverse, disabled}`
|
|
45
45
|
- Brand: `--semantic-surface-brand-{subtle, default, strong}`
|
|
46
|
+
- Brand Secondary: `--semantic-surface-brand-secondary-{subtle, default, strong}`
|
|
46
47
|
- Success: `--semantic-surface-success-{subtle, default, strong}`
|
|
47
48
|
- Error: `--semantic-surface-error-{subtle, default, strong}`
|
|
48
49
|
- Warning: `--semantic-surface-warning-{subtle, default, strong}`
|
|
@@ -50,32 +51,30 @@
|
|
|
50
51
|
|
|
51
52
|
### Border
|
|
52
53
|
|
|
53
|
-
`--semantic-border-{
|
|
54
|
+
`--semantic-border-{primary, secondary, tertiary, disabled, brand-primary, brand-secondary, success, error, warning, info}`
|
|
54
55
|
|
|
55
56
|
### Icon
|
|
56
57
|
|
|
57
|
-
`--semantic-icon-{
|
|
58
|
-
|
|
59
|
-
### Emphasis
|
|
60
|
-
|
|
61
|
-
`--semantic-emphasis-{brand, success, error, warning, info}`
|
|
58
|
+
`--semantic-icon-{primary, secondary, inverse, brand, brand-secondary, success, error, warning, info, disabled}`
|
|
62
59
|
|
|
63
60
|
### Interaction
|
|
64
61
|
|
|
65
|
-
`--semantic-interaction-{
|
|
62
|
+
`--semantic-interaction-{overlay-5, overlay-10, overlay-25, overlay-50, overlay-75, focus-ring}`
|
|
63
|
+
|
|
64
|
+
### Categorical (XPLAT 확장)
|
|
66
65
|
|
|
67
|
-
|
|
66
|
+
Figma 컬렉션에는 없고 차트/태그/아바타 시리즈 색으로 사용한다.
|
|
68
67
|
|
|
69
|
-
`--semantic-categorical-{1,
|
|
68
|
+
`--semantic-categorical-{1..8}-{bg, area, fill, text}`
|
|
70
69
|
|
|
71
70
|
---
|
|
72
71
|
|
|
73
72
|
## 잘못된 사용
|
|
74
73
|
|
|
75
74
|
```css
|
|
76
|
-
/* 금지:
|
|
77
|
-
color: var(--
|
|
75
|
+
/* 금지: brand/system 토큰 직접 사용 */
|
|
76
|
+
color: var(--brand-primary-500);
|
|
78
77
|
|
|
79
78
|
/* 올바른 방법: semantic 토큰 사용 */
|
|
80
|
-
color: var(--semantic-text-brand);
|
|
79
|
+
color: var(--semantic-text-brand-primary);
|
|
81
80
|
```
|
|
@@ -1,63 +1,113 @@
|
|
|
1
1
|
# 타이포그래피 토큰 시스템
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 2레이어 구조
|
|
4
4
|
|
|
5
|
-
| 레이어 | 역할 |
|
|
6
|
-
|
|
7
|
-
| Primitive | 기초 폰트 수치 |
|
|
8
|
-
|
|
|
9
|
-
|
|
5
|
+
| 레이어 | 접두사 | 역할 |
|
|
6
|
+
|--------|--------|------|
|
|
7
|
+
| Primitive | `--typo-*` | 기초 폰트 수치 (pc/tablet/mobile 반응형) |
|
|
8
|
+
| Semantic | `--semantic-typo-*` | 컴포넌트가 소비하는 합성 스타일 23종 |
|
|
9
|
+
|
|
10
|
+
Figma `typography` 컬렉션은 primitive 만 갖고, pc / tablet / mobile 을 **모드**로 둔다.
|
|
11
|
+
density(compact/airy) 축과 브랜드 오버라이드 레이어는 없다.
|
|
12
|
+
|
|
13
|
+
컴포넌트는 **semantic 만** 소비한다. `--typo-*` 를 직접 참조하지 않는다.
|
|
10
14
|
|
|
11
15
|
---
|
|
12
16
|
|
|
13
|
-
##
|
|
17
|
+
## 반응형 동작
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
primitive 의 size / line-height / letter-spacing 은 브레이크포인트별로 값이 다르다.
|
|
20
|
+
CSS 는 PC 기준값을 `:root` 에 두고 tablet/mobile 을 `@media` 로 덮는다.
|
|
21
|
+
|
|
22
|
+
| 모드 | 범위 |
|
|
16
23
|
|------|------|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
24
|
+
| pc | ≥ 1024px |
|
|
25
|
+
| tablet | 768 ~ 1023px |
|
|
26
|
+
| mobile | < 768px |
|
|
20
27
|
|
|
21
|
-
|
|
28
|
+
semantic 스타일은 primitive 를 `var()` 로 참조하므로 자동으로 반응형이 된다.
|
|
22
29
|
|
|
23
|
-
|
|
30
|
+
---
|
|
24
31
|
|
|
25
|
-
##
|
|
32
|
+
## Primitive
|
|
26
33
|
|
|
27
|
-
|
|
34
|
+
### Font Family
|
|
28
35
|
|
|
29
|
-
|
|
|
36
|
+
| 토큰 | 용도 |
|
|
30
37
|
|------|------|
|
|
31
|
-
|
|
|
32
|
-
|
|
|
33
|
-
| airy | 여유 있는 UI |
|
|
38
|
+
| `--typo-font-family-default` | 본문·라벨·캡션 |
|
|
39
|
+
| `--typo-font-family-brand` | display·title (브랜드 표현) |
|
|
34
40
|
|
|
35
|
-
|
|
41
|
+
### Size / Line Height
|
|
42
|
+
|
|
43
|
+
`--typo-size-{key}` · `--typo-lh-{key}`
|
|
44
|
+
|
|
45
|
+
key: `display-1` `display-2` `title-1` `title-2` `heading-1` `heading-2` `body-1` `body-2` `label-1` `label-2` `caption-1` `caption-2`
|
|
46
|
+
|
|
47
|
+
### Font Weight
|
|
36
48
|
|
|
37
49
|
| 토큰 | 값 |
|
|
38
50
|
|------|-----|
|
|
39
|
-
| `--
|
|
40
|
-
| `--
|
|
41
|
-
| `--
|
|
42
|
-
| `--
|
|
51
|
+
| `--typo-weight-regular` | 400 |
|
|
52
|
+
| `--typo-weight-medium` | 500 |
|
|
53
|
+
| `--typo-weight-semibold` | 600 |
|
|
54
|
+
| `--typo-weight-bold` | 700 |
|
|
43
55
|
|
|
44
|
-
|
|
56
|
+
### Letter Spacing
|
|
45
57
|
|
|
46
58
|
| 토큰 | 용도 |
|
|
47
59
|
|------|------|
|
|
48
|
-
| `--
|
|
49
|
-
| `--
|
|
50
|
-
| `--
|
|
60
|
+
| `--typo-ls-tight` | display·title·heading |
|
|
61
|
+
| `--typo-ls-normal` | body·label-1 |
|
|
62
|
+
| `--typo-ls-wide` | label-2·caption |
|
|
51
63
|
|
|
52
64
|
---
|
|
53
65
|
|
|
54
66
|
## Semantic Text Styles
|
|
55
67
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
|
60
|
-
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
68
|
+
스타일 하나가 5개 속성(`font` `size` `lh` `ls` `weight`)을 갖는다.
|
|
69
|
+
접미사는 weight — `b`=bold, `sb`=semibold, `m`=medium, `r`=regular.
|
|
70
|
+
|
|
71
|
+
| 계열 | 스타일 | 용도 |
|
|
72
|
+
|------|--------|------|
|
|
73
|
+
| display | `display-1-b` `display-1-sb` `display-2-b` `display-2-sb` | 대형 타이틀, 히어로 |
|
|
74
|
+
| title | `title-1-sb` `title-1-m` `title-2-sb` `title-2-m` | 페이지 타이틀 |
|
|
75
|
+
| heading | `heading-1-sb` `heading-1-m` `heading-2-m` | 섹션 타이틀 |
|
|
76
|
+
| body | `body-1-sb` `body-1-m` `body-1-r` `body-2-m` `body-2-r` | 본문 텍스트 |
|
|
77
|
+
| label | `label-1-sb` `label-1-m` `label-2-sb` `label-2-m` | 폼 라벨, 버튼 텍스트 |
|
|
78
|
+
| caption | `caption-1-sb` `caption-1-r` `caption-2-r` | 부가 설명, 힌트 |
|
|
79
|
+
|
|
80
|
+
### 사용법
|
|
81
|
+
|
|
82
|
+
속성별 변수로 참조한다.
|
|
83
|
+
|
|
84
|
+
```scss
|
|
85
|
+
.my-label {
|
|
86
|
+
font-family: var(--semantic-typo-label-2-m-font);
|
|
87
|
+
font-size: var(--semantic-typo-label-2-m-size);
|
|
88
|
+
line-height: var(--semantic-typo-label-2-m-lh);
|
|
89
|
+
letter-spacing: var(--semantic-typo-label-2-m-ls);
|
|
90
|
+
font-weight: var(--semantic-typo-label-2-m-weight);
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
또는 유틸리티 클래스로 한 번에 적용한다.
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
<span className="typo-label-2-m">라벨</span>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## 잘못된 사용
|
|
103
|
+
|
|
104
|
+
```scss
|
|
105
|
+
/* 금지: px 하드코딩 */
|
|
106
|
+
font-size: 14px;
|
|
107
|
+
|
|
108
|
+
/* 금지: primitive 직접 참조 */
|
|
109
|
+
font-size: var(--typo-size-label-2);
|
|
110
|
+
|
|
111
|
+
/* 올바른 방법: semantic 사용 */
|
|
112
|
+
font-size: var(--semantic-typo-label-2-m-size);
|
|
113
|
+
```
|