@ceed/cds 1.28.0 → 1.29.0-next.1
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/CurrencyInput/CurrencyInput.d.ts +1 -1
- package/dist/components/CurrencyInput/hooks/use-currency-setting.d.ts +2 -2
- package/dist/components/DataTable/hooks.d.ts +2 -1
- package/dist/components/DataTable/utils.d.ts +1 -0
- package/dist/components/SearchBar/SearchBar.d.ts +21 -0
- package/dist/components/SearchBar/index.d.ts +3 -0
- package/dist/components/data-display/DataTable.md +1 -1
- package/dist/components/data-display/InfoSign.md +91 -74
- package/dist/components/data-display/Typography.md +94 -411
- package/dist/components/feedback/Dialog.md +62 -76
- package/dist/components/feedback/Modal.md +138 -430
- package/dist/components/feedback/llms.txt +0 -2
- package/dist/components/index.d.ts +2 -1
- package/dist/components/inputs/Autocomplete.md +107 -356
- package/dist/components/inputs/ButtonGroup.md +104 -115
- package/dist/components/inputs/CurrencyInput.md +5 -183
- package/dist/components/inputs/DatePicker.md +431 -108
- package/dist/components/inputs/DateRangePicker.md +492 -131
- package/dist/components/inputs/FilterableCheckboxGroup.md +19 -145
- package/dist/components/inputs/IconButton.md +88 -137
- package/dist/components/inputs/Input.md +73 -204
- package/dist/components/inputs/MonthPicker.md +422 -95
- package/dist/components/inputs/MonthRangePicker.md +466 -89
- package/dist/components/inputs/PercentageInput.md +16 -185
- package/dist/components/inputs/RadioButton.md +35 -163
- package/dist/components/inputs/SearchBar.md +44 -0
- package/dist/components/inputs/Select.md +326 -222
- package/dist/components/inputs/Switch.md +376 -143
- package/dist/components/inputs/Textarea.md +10 -213
- package/dist/components/inputs/Uploader/Uploader.md +66 -145
- package/dist/components/inputs/llms.txt +1 -4
- package/dist/components/navigation/Breadcrumbs.md +308 -57
- package/dist/components/navigation/Drawer.md +0 -180
- package/dist/components/navigation/Dropdown.md +215 -98
- package/dist/components/navigation/IconMenuButton.md +502 -40
- package/dist/components/navigation/InsetDrawer.md +650 -281
- package/dist/components/navigation/Link.md +348 -31
- package/dist/components/navigation/Menu.md +285 -92
- package/dist/components/navigation/MenuButton.md +448 -55
- package/dist/components/navigation/Pagination.md +338 -47
- package/dist/components/navigation/Stepper.md +28 -160
- package/dist/components/navigation/Tabs.md +316 -57
- package/dist/components/surfaces/Accordions.md +804 -49
- package/dist/components/surfaces/Card.md +157 -97
- package/dist/components/surfaces/Divider.md +234 -83
- package/dist/components/surfaces/Sheet.md +328 -153
- package/dist/index.cjs +435 -577
- package/dist/index.d.ts +1 -1
- package/dist/index.js +424 -510
- package/dist/llms.txt +1 -9
- package/framer/index.js +1 -1
- package/package.json +17 -22
- package/dist/chunks/rehype-accent-FZRUD7VI.js +0 -39
- package/dist/components/RadioTileGroup/RadioTileGroup.d.ts +0 -56
- package/dist/components/RadioTileGroup/index.d.ts +0 -3
- package/dist/components/feedback/CircularProgress.md +0 -257
- package/dist/components/feedback/Skeleton.md +0 -280
- package/dist/components/inputs/FormControl.md +0 -361
- package/dist/components/inputs/RadioList.md +0 -241
- package/dist/components/inputs/RadioTileGroup.md +0 -507
- package/dist/components/inputs/Slider.md +0 -334
- package/dist/guides/ThemeProvider.md +0 -89
- package/dist/guides/llms.txt +0 -9
- package/dist/index.browser.js +0 -224
- package/dist/index.browser.js.map +0 -7
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Introduction
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
CDS extends the default typography system with **marketing levels** (`marketing-lg`, `marketing-md`, `marketing-sm`) for landing pages and promotional content, and uses **Poppins** as the display font family.
|
|
5
|
+
Typography 컴포넌트는 텍스트를 표시하기 위한 핵심 컴포넌트입니다. Joy UI의 Typography를 기반으로 하며, 다양한 텍스트 레벨과 스타일을 제공합니다. 제목, 본문, 라벨 등 모든 텍스트 요소에 일관된 타이포그래피를 적용할 수 있습니다.
|
|
8
6
|
|
|
9
7
|
```tsx
|
|
10
8
|
<Typography children="Typography" />
|
|
@@ -23,10 +21,10 @@ import { Typography } from '@ceed/cds';
|
|
|
23
21
|
function MyComponent() {
|
|
24
22
|
return (
|
|
25
23
|
<div>
|
|
26
|
-
<Typography level="h1"
|
|
27
|
-
<Typography level="body-md"
|
|
24
|
+
<Typography level="h1">메인 제목</Typography>
|
|
25
|
+
<Typography level="body-md">본문 텍스트입니다.</Typography>
|
|
28
26
|
<Typography level="body-sm" color="neutral">
|
|
29
|
-
|
|
27
|
+
보조 설명 텍스트입니다.
|
|
30
28
|
</Typography>
|
|
31
29
|
</div>
|
|
32
30
|
);
|
|
@@ -35,126 +33,20 @@ function MyComponent() {
|
|
|
35
33
|
|
|
36
34
|
## Typography Levels
|
|
37
35
|
|
|
38
|
-
### Overview
|
|
39
|
-
|
|
40
|
-
Typography levels are divided into four groups: **Headings**, **Titles**, **Body**, and **Marketing**. The default level is `body-md`.
|
|
41
|
-
|
|
42
|
-
- **Headings** (`h1`–`h4`): Used for page and section headings. Uses the display font family (Poppins).
|
|
43
|
-
- **Titles** (`title-lg`, `title-md`, `title-sm`): Used for UI labels, card titles, and emphasized text. Uses the body font family (Inter).
|
|
44
|
-
- **Body** (`body-lg`, `body-md`, `body-sm`, `body-xs`): Used for readable content and descriptions. Uses the body font family (Inter).
|
|
45
|
-
- **Marketing** (`marketing-lg`, `marketing-md`, `marketing-sm`): Used for landing pages, hero banners, and promotional content. Uses the display font family (Poppins).
|
|
46
|
-
|
|
47
|
-
```tsx
|
|
48
|
-
<>
|
|
49
|
-
<Stack direction="row" spacing={2}>
|
|
50
|
-
<Typography level="h1">h1</Typography>
|
|
51
|
-
<Typography {...args} level="h1" />
|
|
52
|
-
</Stack>
|
|
53
|
-
<Stack direction="row" spacing={2}>
|
|
54
|
-
<Typography level="h2">h2</Typography>
|
|
55
|
-
<Typography {...args} level="h2" />
|
|
56
|
-
</Stack>
|
|
57
|
-
<Stack direction="row" spacing={2}>
|
|
58
|
-
<Typography level="h3">h3</Typography>
|
|
59
|
-
<Typography {...args} level="h3" />
|
|
60
|
-
</Stack>
|
|
61
|
-
<Stack direction="row" spacing={2}>
|
|
62
|
-
<Typography level="h4">h4</Typography>
|
|
63
|
-
<Typography {...args} level="h4" />
|
|
64
|
-
</Stack>
|
|
65
|
-
<Stack direction="row" spacing={2}>
|
|
66
|
-
<Typography level="title-lg">title-lg</Typography>
|
|
67
|
-
<Typography {...args} level="title-lg" />
|
|
68
|
-
</Stack>
|
|
69
|
-
<Stack direction="row" spacing={2}>
|
|
70
|
-
<Typography level="title-md">title-md</Typography>
|
|
71
|
-
<Typography {...args} level="title-md" />
|
|
72
|
-
</Stack>
|
|
73
|
-
<Stack direction="row" spacing={2}>
|
|
74
|
-
<Typography level="title-sm">title-sm</Typography>
|
|
75
|
-
<Typography {...args} level="title-sm" />
|
|
76
|
-
</Stack>
|
|
77
|
-
<Stack direction="row" spacing={2}>
|
|
78
|
-
<Typography level="body-lg">body-lg</Typography>
|
|
79
|
-
<Typography {...args} level="body-lg" />
|
|
80
|
-
</Stack>
|
|
81
|
-
<Stack direction="row" spacing={2}>
|
|
82
|
-
<Typography level="body-md">body-md</Typography>
|
|
83
|
-
<Typography {...args} level="body-md" />
|
|
84
|
-
</Stack>
|
|
85
|
-
<Stack direction="row" spacing={2}>
|
|
86
|
-
<Typography level="body-sm">body-sm</Typography>
|
|
87
|
-
<Typography {...args} level="body-sm" />
|
|
88
|
-
</Stack>
|
|
89
|
-
<Stack direction="row" spacing={2}>
|
|
90
|
-
<Typography level="body-xs">body-xs</Typography>
|
|
91
|
-
<Typography {...args} level="body-xs" />
|
|
92
|
-
</Stack>
|
|
93
|
-
<Stack direction="row" spacing={2}>
|
|
94
|
-
<Typography level="marketing-lg">marketing-lg</Typography>
|
|
95
|
-
<Typography {...args} level="marketing-lg" />
|
|
96
|
-
</Stack>
|
|
97
|
-
<Stack direction="row" spacing={2}>
|
|
98
|
-
<Typography level="marketing-md">marketing-md</Typography>
|
|
99
|
-
<Typography {...args} level="marketing-md" />
|
|
100
|
-
</Stack>
|
|
101
|
-
<Stack direction="row" spacing={2}>
|
|
102
|
-
<Typography level="marketing-sm">marketing-sm</Typography>
|
|
103
|
-
<Typography {...args} level="marketing-sm" />
|
|
104
|
-
</Stack>
|
|
105
|
-
</>
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
### Style Reference
|
|
109
|
-
|
|
110
|
-
| Level | Font Family | Font Size | Font Weight | Line Height | Letter Spacing | Default Color | HTML Tag |
|
|
111
|
-
| ------------ | ----------------- | --------------- | -------------- | ----------- | -------------- | -------------- | -------- |
|
|
112
|
-
| h1 | display (Poppins) | 2.25rem (36px) | 700 (Bold) | 1.333 | -0.025em | text.primary | `<h1>` |
|
|
113
|
-
| h2 | display (Poppins) | 1.875rem (30px) | 700 (Bold) | 1.333 | -0.025em | text.primary | `<h2>` |
|
|
114
|
-
| h3 | display (Poppins) | 1.5rem (24px) | 600 (SemiBold) | 1.333 | -0.025em | text.primary | `<h3>` |
|
|
115
|
-
| h4 | display (Poppins) | 1.25rem (20px) | 600 (SemiBold) | 1.5 | -0.025em | text.primary | `<h4>` |
|
|
116
|
-
| title-lg | body (Inter) | 1.125rem (18px) | 600 (SemiBold) | 1.333 | - | text.primary | `<p>` |
|
|
117
|
-
| title-md | body (Inter) | 1rem (16px) | 500 (Medium) | 1.5 | - | text.primary | `<p>` |
|
|
118
|
-
| title-sm | body (Inter) | 0.875rem (14px) | 500 (Medium) | 1.429 | - | text.primary | `<p>` |
|
|
119
|
-
| body-lg | body (Inter) | 1.125rem (18px) | inherit | 1.5 | - | text.secondary | `<p>` |
|
|
120
|
-
| body-md | body (Inter) | 1rem (16px) | inherit | 1.5 | - | text.secondary | `<p>` |
|
|
121
|
-
| body-sm | body (Inter) | 0.875rem (14px) | inherit | 1.5 | - | text.tertiary | `<p>` |
|
|
122
|
-
| body-xs | body (Inter) | 0.75rem (12px) | 500 (Medium) | 1.5 | - | text.tertiary | `<span>` |
|
|
123
|
-
| marketing-lg | display (Poppins) | 2.625rem (42px) | 600 (SemiBold) | 1.333 | -0.025em | text.primary | `<div>` |
|
|
124
|
-
| marketing-md | display (Poppins) | 2rem (32px) | 600 (SemiBold) | 1.333 | -0.025em | text.primary | `<div>` |
|
|
125
|
-
| marketing-sm | display (Poppins) | 1.5rem (24px) | 500 (Medium) | 1.333 | -0.025em | text.primary | `<div>` |
|
|
126
|
-
|
|
127
36
|
### Headings
|
|
128
37
|
|
|
129
|
-
|
|
38
|
+
제목을 위한 레벨들입니다. 페이지 구조를 명확하게 나타내는 데 사용됩니다.
|
|
130
39
|
|
|
131
40
|
```tsx
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
<Typography level="h4">h4 - Detail heading</Typography>
|
|
137
|
-
</>
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
```tsx
|
|
141
|
-
<Typography level="h1">H1 - Main page heading</Typography>
|
|
142
|
-
<Typography level="h2">H2 - Section heading</Typography>
|
|
143
|
-
<Typography level="h3">H3 - Subsection heading</Typography>
|
|
144
|
-
<Typography level="h4">H4 - Detail heading</Typography>
|
|
41
|
+
<Typography level="h1">H1 - 페이지 메인 제목</Typography>
|
|
42
|
+
<Typography level="h2">H2 - 섹션 제목</Typography>
|
|
43
|
+
<Typography level="h3">H3 - 하위 섹션 제목</Typography>
|
|
44
|
+
<Typography level="h4">H4 - 세부 제목</Typography>
|
|
145
45
|
```
|
|
146
46
|
|
|
147
47
|
### Titles
|
|
148
48
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
```tsx
|
|
152
|
-
<>
|
|
153
|
-
<Typography level="title-lg">title-lg - Large title</Typography>
|
|
154
|
-
<Typography level="title-md">title-md - Medium title</Typography>
|
|
155
|
-
<Typography level="title-sm">title-sm - Small title</Typography>
|
|
156
|
-
</>
|
|
157
|
-
```
|
|
49
|
+
중요한 제목이나 강조할 텍스트에 사용됩니다.
|
|
158
50
|
|
|
159
51
|
```tsx
|
|
160
52
|
<Typography level="title-lg">Large Title</Typography>
|
|
@@ -164,237 +56,13 @@ Title levels are used for UI labels, card titles, and other emphasized text that
|
|
|
164
56
|
|
|
165
57
|
### Body Text
|
|
166
58
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
```tsx
|
|
170
|
-
<>
|
|
171
|
-
<Typography level="body-lg">body-lg - Large body text</Typography>
|
|
172
|
-
<Typography level="body-md">body-md - Regular body text</Typography>
|
|
173
|
-
<Typography level="body-sm">body-sm - Small body text</Typography>
|
|
174
|
-
<Typography level="body-xs">body-xs - Extra small text</Typography>
|
|
175
|
-
</>
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
```tsx
|
|
179
|
-
<Typography level="body-lg">Large body text</Typography>
|
|
180
|
-
<Typography level="body-md">Regular body text</Typography>
|
|
181
|
-
<Typography level="body-sm">Small body text</Typography>
|
|
182
|
-
<Typography level="body-xs">Extra small text</Typography>
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
### Marketing Levels
|
|
186
|
-
|
|
187
|
-
Marketing levels are designed for landing pages, hero banners, and promotional content. They use the **Poppins** display font family for a distinctive marketing look.
|
|
188
|
-
|
|
189
|
-
```tsx
|
|
190
|
-
<>
|
|
191
|
-
<Typography level="marketing-lg">
|
|
192
|
-
marketing-lg - Large marketing text
|
|
193
|
-
</Typography>
|
|
194
|
-
<Typography level="marketing-md">
|
|
195
|
-
marketing-md - Medium marketing text
|
|
196
|
-
</Typography>
|
|
197
|
-
<Typography level="marketing-sm">
|
|
198
|
-
marketing-sm - Small marketing text
|
|
199
|
-
</Typography>
|
|
200
|
-
</>
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
```tsx
|
|
204
|
-
<Typography level="marketing-lg">Large marketing text</Typography>
|
|
205
|
-
<Typography level="marketing-md">Medium marketing text</Typography>
|
|
206
|
-
<Typography level="marketing-sm">Small marketing text</Typography>
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
## Design Token Reference
|
|
210
|
-
|
|
211
|
-
### Font Size Scale
|
|
212
|
-
|
|
213
|
-
| Token | Value |
|
|
214
|
-
| ----- | --------------- |
|
|
215
|
-
| xs | 0.75rem (12px) |
|
|
216
|
-
| sm | 0.875rem (14px) |
|
|
217
|
-
| md | 1rem (16px) |
|
|
218
|
-
| lg | 1.125rem (18px) |
|
|
219
|
-
| xl | 1.25rem (20px) |
|
|
220
|
-
| xl2 | 1.5rem (24px) |
|
|
221
|
-
| xl3 | 1.875rem (30px) |
|
|
222
|
-
| xl4 | 2.25rem (36px) |
|
|
223
|
-
|
|
224
|
-
### Font Weight Scale
|
|
225
|
-
|
|
226
|
-
| Token | Value |
|
|
227
|
-
| ----- | -------------- |
|
|
228
|
-
| sm | 300 (Light) |
|
|
229
|
-
| md | 500 (Medium) |
|
|
230
|
-
| lg | 600 (SemiBold) |
|
|
231
|
-
| xl | 700 (Bold) |
|
|
232
|
-
|
|
233
|
-
### Line Height Scale
|
|
234
|
-
|
|
235
|
-
| Token | Value |
|
|
236
|
-
| ----- | ----- |
|
|
237
|
-
| xs | 1.333 |
|
|
238
|
-
| sm | 1.429 |
|
|
239
|
-
| md | 1.5 |
|
|
240
|
-
| lg | 1.556 |
|
|
241
|
-
| xl | 1.667 |
|
|
242
|
-
|
|
243
|
-
### Font Families
|
|
244
|
-
|
|
245
|
-
- **body**: `"Inter"`, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif
|
|
246
|
-
- **display**: `"Poppins"`, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif
|
|
247
|
-
- **code**: `"Source Code Pro"`, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace
|
|
248
|
-
|
|
249
|
-
## Colors
|
|
250
|
-
|
|
251
|
-
Typography supports five semantic colors via the `color` prop. Use `textColor` to apply any palette color directly.
|
|
252
|
-
|
|
253
|
-
```tsx
|
|
254
|
-
<>
|
|
255
|
-
<Typography color="primary">Primary color</Typography>
|
|
256
|
-
<Typography color="neutral">Neutral color</Typography>
|
|
257
|
-
<Typography color="danger">Danger color</Typography>
|
|
258
|
-
<Typography color="success">Success color</Typography>
|
|
259
|
-
<Typography color="warning">Warning color</Typography>
|
|
260
|
-
</>
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
```tsx
|
|
264
|
-
<Typography color="primary">Primary color</Typography>
|
|
265
|
-
<Typography color="neutral">Neutral color</Typography>
|
|
266
|
-
<Typography color="danger">Danger color</Typography>
|
|
267
|
-
<Typography color="success">Success color</Typography>
|
|
268
|
-
<Typography color="warning">Warning color</Typography>
|
|
269
|
-
|
|
270
|
-
{/* Use textColor for specific palette values */}
|
|
271
|
-
<Typography textColor="neutral.600">Custom palette color</Typography>
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
## Component Prop
|
|
275
|
-
|
|
276
|
-
Use the `component` prop to render Typography as a different HTML element or React component. Each level has a default HTML tag mapping shown below.
|
|
277
|
-
|
|
278
|
-
```tsx
|
|
279
|
-
<>
|
|
280
|
-
<Typography level="h1" component="h2">
|
|
281
|
-
h1 style rendered as h2 tag
|
|
282
|
-
</Typography>
|
|
283
|
-
<Typography level="body-md" component="span">
|
|
284
|
-
body-md rendered as span
|
|
285
|
-
</Typography>
|
|
286
|
-
<Typography level="title-md" component="label">
|
|
287
|
-
title-md rendered as label
|
|
288
|
-
</Typography>
|
|
289
|
-
</>
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
```tsx
|
|
293
|
-
<Typography level="h1" component="h2">
|
|
294
|
-
h1 style rendered as an h2 tag
|
|
295
|
-
</Typography>
|
|
296
|
-
|
|
297
|
-
<Typography level="body-md" component="span">
|
|
298
|
-
Inline text
|
|
299
|
-
</Typography>
|
|
300
|
-
|
|
301
|
-
<Typography level="title-md" component="label">
|
|
302
|
-
Rendered as a label element
|
|
303
|
-
</Typography>
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
**Default HTML tag mapping:**
|
|
307
|
-
|
|
308
|
-
| Level | Default HTML Tag |
|
|
309
|
-
| ------------ | ---------------- |
|
|
310
|
-
| h1 | `<h1>` |
|
|
311
|
-
| h2 | `<h2>` |
|
|
312
|
-
| h3 | `<h3>` |
|
|
313
|
-
| h4 | `<h4>` |
|
|
314
|
-
| title-lg | `<p>` |
|
|
315
|
-
| title-md | `<p>` |
|
|
316
|
-
| title-sm | `<p>` |
|
|
317
|
-
| body-lg | `<p>` |
|
|
318
|
-
| body-md | `<p>` |
|
|
319
|
-
| body-sm | `<p>` |
|
|
320
|
-
| body-xs | `<span>` |
|
|
321
|
-
| marketing-lg | `<div>` |
|
|
322
|
-
| marketing-md | `<div>` |
|
|
323
|
-
| marketing-sm | `<div>` |
|
|
324
|
-
|
|
325
|
-
## Decorators
|
|
326
|
-
|
|
327
|
-
Use `startDecorator` and `endDecorator` to add icons or other elements before or after the text.
|
|
328
|
-
|
|
329
|
-
```tsx
|
|
330
|
-
<>
|
|
331
|
-
<Typography startDecorator={<InfoOutlined />}>
|
|
332
|
-
Text with start decorator
|
|
333
|
-
</Typography>
|
|
334
|
-
<Typography endDecorator={<ArrowForward />}>
|
|
335
|
-
Text with end decorator
|
|
336
|
-
</Typography>
|
|
337
|
-
<Typography startDecorator={<InfoOutlined />} endDecorator={<ArrowForward />}>
|
|
338
|
-
Text with both decorators
|
|
339
|
-
</Typography>
|
|
340
|
-
</>
|
|
341
|
-
```
|
|
342
|
-
|
|
343
|
-
```tsx
|
|
344
|
-
import InfoOutlined from '@mui/icons-material/InfoOutlined';
|
|
345
|
-
import ArrowForward from '@mui/icons-material/ArrowForward';
|
|
346
|
-
|
|
347
|
-
<Typography startDecorator={<InfoOutlined />}>
|
|
348
|
-
Text with start decorator
|
|
349
|
-
</Typography>
|
|
350
|
-
|
|
351
|
-
<Typography endDecorator={<ArrowForward />}>
|
|
352
|
-
Text with end decorator
|
|
353
|
-
</Typography>
|
|
354
|
-
|
|
355
|
-
<Typography startDecorator={<InfoOutlined />} endDecorator={<ArrowForward />}>
|
|
356
|
-
Text with both decorators
|
|
357
|
-
</Typography>
|
|
358
|
-
```
|
|
359
|
-
|
|
360
|
-
## Text Overflow (noWrap)
|
|
361
|
-
|
|
362
|
-
Use the `noWrap` prop to truncate overflowing text with an ellipsis. Pair it with a `maxWidth` to constrain the text width.
|
|
363
|
-
|
|
364
|
-
```tsx
|
|
365
|
-
<Typography noWrap sx={{
|
|
366
|
-
maxWidth: 200
|
|
367
|
-
}}>
|
|
368
|
-
This is a long text that will be truncated with an ellipsis when it
|
|
369
|
-
exceeds the maximum width of the container.
|
|
370
|
-
</Typography>
|
|
371
|
-
```
|
|
59
|
+
본문 텍스트를 위한 레벨들입니다. 대부분의 읽기 내용에 사용됩니다.
|
|
372
60
|
|
|
373
61
|
```tsx
|
|
374
|
-
<Typography
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
```
|
|
379
|
-
|
|
380
|
-
## Responsive Typography
|
|
381
|
-
|
|
382
|
-
You can pass a responsive object to the `level` prop, or use `sx` to set responsive font sizes.
|
|
383
|
-
|
|
384
|
-
```tsx
|
|
385
|
-
{/* Responsive level */}
|
|
386
|
-
<Typography level={{ xs: 'h3', sm: 'h2', md: 'h1' }}>
|
|
387
|
-
Responsive Heading
|
|
388
|
-
</Typography>
|
|
389
|
-
|
|
390
|
-
{/* Responsive font size via sx */}
|
|
391
|
-
<Typography
|
|
392
|
-
sx={{
|
|
393
|
-
fontSize: { xs: '1rem', sm: '1.25rem', md: '1.5rem' },
|
|
394
|
-
}}
|
|
395
|
-
>
|
|
396
|
-
Responsive text
|
|
397
|
-
</Typography>
|
|
62
|
+
<Typography level="body-lg">큰 본문 텍스트</Typography>
|
|
63
|
+
<Typography level="body-md">일반 본문 텍스트</Typography>
|
|
64
|
+
<Typography level="body-sm">작은 본문 텍스트</Typography>
|
|
65
|
+
<Typography level="body-xs">매우 작은 텍스트</Typography>
|
|
398
66
|
```
|
|
399
67
|
|
|
400
68
|
## Common Use Cases
|
|
@@ -406,25 +74,22 @@ function ArticlePage() {
|
|
|
406
74
|
return (
|
|
407
75
|
<article>
|
|
408
76
|
<Typography level="h1" sx={{ mb: 2 }}>
|
|
409
|
-
|
|
77
|
+
기사 제목
|
|
410
78
|
</Typography>
|
|
411
79
|
|
|
412
80
|
<Typography level="body-sm" color="neutral" sx={{ mb: 3 }}>
|
|
413
|
-
|
|
81
|
+
2024년 1월 15일 · 김철수 작성
|
|
414
82
|
</Typography>
|
|
415
83
|
|
|
416
84
|
<Typography level="body-md" sx={{ mb: 2 }}>
|
|
417
|
-
|
|
418
|
-
and line spacing.
|
|
85
|
+
기사의 본문 내용이 여기에 들어갑니다. 이 텍스트는 읽기 쉬운 크기와 줄 간격을 가지고 있습니다.
|
|
419
86
|
</Typography>
|
|
420
87
|
|
|
421
88
|
<Typography level="h2" sx={{ mt: 4, mb: 2 }}>
|
|
422
|
-
|
|
89
|
+
섹션 제목
|
|
423
90
|
</Typography>
|
|
424
91
|
|
|
425
|
-
<Typography level="body-md">
|
|
426
|
-
The section content continues here.
|
|
427
|
-
</Typography>
|
|
92
|
+
<Typography level="body-md">섹션의 내용이 계속됩니다.</Typography>
|
|
428
93
|
</article>
|
|
429
94
|
);
|
|
430
95
|
}
|
|
@@ -436,15 +101,15 @@ function ArticlePage() {
|
|
|
436
101
|
<Card>
|
|
437
102
|
<CardContent>
|
|
438
103
|
<Typography level="title-md" sx={{ mb: 1 }}>
|
|
439
|
-
|
|
104
|
+
제품명
|
|
440
105
|
</Typography>
|
|
441
106
|
|
|
442
107
|
<Typography level="body-sm" color="neutral" sx={{ mb: 2 }}>
|
|
443
|
-
|
|
108
|
+
카테고리: 전자제품
|
|
444
109
|
</Typography>
|
|
445
110
|
|
|
446
111
|
<Typography level="body-md" sx={{ mb: 2 }}>
|
|
447
|
-
|
|
112
|
+
제품에 대한 상세 설명이 여기에 들어갑니다.
|
|
448
113
|
</Typography>
|
|
449
114
|
|
|
450
115
|
<Typography level="title-lg" color="primary">
|
|
@@ -460,58 +125,41 @@ function ArticlePage() {
|
|
|
460
125
|
<Stack spacing={2}>
|
|
461
126
|
<FormControl>
|
|
462
127
|
<Typography level="title-sm" component="label">
|
|
463
|
-
|
|
128
|
+
사용자 이름
|
|
464
129
|
</Typography>
|
|
465
|
-
<Input placeholder="
|
|
130
|
+
<Input placeholder="이름을 입력하세요" />
|
|
466
131
|
<Typography level="body-xs" color="neutral">
|
|
467
|
-
|
|
132
|
+
실명으로 입력해 주세요.
|
|
468
133
|
</Typography>
|
|
469
134
|
</FormControl>
|
|
470
135
|
|
|
471
136
|
<FormControl error>
|
|
472
137
|
<Typography level="title-sm" component="label">
|
|
473
|
-
|
|
138
|
+
이메일 주소
|
|
474
139
|
</Typography>
|
|
475
140
|
<Input placeholder="email@example.com" />
|
|
476
141
|
<Typography level="body-xs" color="danger">
|
|
477
|
-
|
|
142
|
+
올바른 이메일 형식이 아닙니다.
|
|
478
143
|
</Typography>
|
|
479
144
|
</FormControl>
|
|
480
145
|
</Stack>
|
|
481
146
|
```
|
|
482
147
|
|
|
483
|
-
> 💡 **Tip: Use built-in form props instead**
|
|
484
|
-
>
|
|
485
|
-
> Input, Select, Textarea, DatePicker 등 Input 계열 컴포넌트는 `label`, `helperText` prop을 자체적으로 지원합니다.
|
|
486
|
-
> Form을 구성할 때는 Typography로 직접 label/helperText를 만드는 것보다 각 컴포넌트의 내장 prop을 사용하는 것이 권장됩니다.
|
|
487
|
-
>
|
|
488
|
-
> ```tsx
|
|
489
|
-
> // ✅ Recommended: 컴포넌트 내장 prop 사용
|
|
490
|
-
> <Input label="Username" helperText="Please enter your real name." />
|
|
491
|
-
>
|
|
492
|
-
> // ❌ Not recommended: Typography로 직접 구성
|
|
493
|
-
> <FormControl>
|
|
494
|
-
> <Typography level="title-sm" component="label">Username</Typography>
|
|
495
|
-
> <Input placeholder="Enter your name" />
|
|
496
|
-
> <Typography level="body-xs" color="neutral">Please enter your real name.</Typography>
|
|
497
|
-
> </FormControl>
|
|
498
|
-
> ```
|
|
499
|
-
|
|
500
148
|
### Status and Indicators
|
|
501
149
|
|
|
502
150
|
```tsx
|
|
503
151
|
<Stack spacing={2}>
|
|
504
152
|
<Box>
|
|
505
|
-
<Typography level="body-md"
|
|
153
|
+
<Typography level="body-md">서버 상태:</Typography>
|
|
506
154
|
<Typography level="body-md" color="success">
|
|
507
|
-
|
|
155
|
+
정상 운영 중
|
|
508
156
|
</Typography>
|
|
509
157
|
</Box>
|
|
510
158
|
|
|
511
159
|
<Box>
|
|
512
|
-
<Typography level="body-md"
|
|
160
|
+
<Typography level="body-md">마지막 업데이트:</Typography>
|
|
513
161
|
<Typography level="body-sm" color="neutral">
|
|
514
|
-
2
|
|
162
|
+
2분 전
|
|
515
163
|
</Typography>
|
|
516
164
|
</Box>
|
|
517
165
|
</Stack>
|
|
@@ -521,7 +169,7 @@ function ArticlePage() {
|
|
|
521
169
|
|
|
522
170
|
```tsx
|
|
523
171
|
<Stack spacing={1}>
|
|
524
|
-
<Typography level="title-md"
|
|
172
|
+
<Typography level="title-md">할 일 목록</Typography>
|
|
525
173
|
|
|
526
174
|
{todoItems.map((item) => (
|
|
527
175
|
<Box key={item.id} sx={{ pl: 2 }}>
|
|
@@ -542,44 +190,79 @@ function ArticlePage() {
|
|
|
542
190
|
</Stack>
|
|
543
191
|
```
|
|
544
192
|
|
|
545
|
-
##
|
|
193
|
+
## Colors
|
|
194
|
+
|
|
195
|
+
Typography는 다양한 색상을 지원합니다:
|
|
196
|
+
|
|
197
|
+
```tsx
|
|
198
|
+
<Stack spacing={1}>
|
|
199
|
+
<Typography color="primary">Primary 색상</Typography>
|
|
200
|
+
<Typography color="neutral">Neutral 색상</Typography>
|
|
201
|
+
<Typography color="danger">Danger 색상</Typography>
|
|
202
|
+
<Typography color="success">Success 색상</Typography>
|
|
203
|
+
<Typography color="warning">Warning 색상</Typography>
|
|
204
|
+
</Stack>
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Component Prop
|
|
546
208
|
|
|
547
|
-
|
|
209
|
+
다른 HTML 요소나 React 컴포넌트로 렌더링할 수 있습니다:
|
|
548
210
|
|
|
549
211
|
```tsx
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
212
|
+
<Typography level="h1" component="h2">
|
|
213
|
+
h2 태그로 렌더링되는 h1 스타일
|
|
214
|
+
</Typography>
|
|
215
|
+
|
|
216
|
+
<Typography level="body-md" component="span">
|
|
217
|
+
인라인 텍스트
|
|
218
|
+
</Typography>
|
|
219
|
+
|
|
220
|
+
<Typography level="title-md" component={Link} href="/page">
|
|
221
|
+
링크 컴포넌트로 렌더링
|
|
222
|
+
</Typography>
|
|
558
223
|
```
|
|
559
224
|
|
|
560
|
-
|
|
225
|
+
## Responsive Typography
|
|
226
|
+
|
|
227
|
+
반응형 레벨을 사용할 수 있습니다:
|
|
561
228
|
|
|
562
|
-
|
|
229
|
+
```tsx
|
|
230
|
+
<Typography
|
|
231
|
+
level={{ xs: 'h3', sm: 'h2', md: 'h1' }}
|
|
232
|
+
sx={{
|
|
233
|
+
fontSize: { xs: '1.5rem', sm: '2rem', md: '2.5rem' },
|
|
234
|
+
}}
|
|
235
|
+
>
|
|
236
|
+
반응형 제목
|
|
237
|
+
</Typography>
|
|
238
|
+
```
|
|
563
239
|
|
|
564
|
-
|
|
240
|
+
## Best Practices
|
|
565
241
|
|
|
566
|
-
|
|
567
|
-
- **Headings** (`h1`–`h4`): Use for document structure and section titles.
|
|
568
|
-
- **Titles** (`title-lg/md/sm`): Use for UI labels, card headers, and emphasized text.
|
|
569
|
-
- **Body** (`body-lg/md/sm/xs`): Use for content, descriptions, and supporting text.
|
|
570
|
-
- **Marketing** (`marketing-lg/md/sm`): Use exclusively for marketing and landing pages — not for general UI.
|
|
242
|
+
1. **의미적 구조**: 제목 레벨을 순서대로 사용하여 명확한 문서 구조를 만드세요.
|
|
571
243
|
|
|
572
|
-
|
|
244
|
+
```tsx
|
|
245
|
+
// ✅ 올바른 순서
|
|
246
|
+
<Typography level="h1">메인 제목</Typography>
|
|
247
|
+
<Typography level="h2">섹션 제목</Typography>
|
|
248
|
+
<Typography level="h3">하위 섹션</Typography>
|
|
249
|
+
|
|
250
|
+
// ❌ 잘못된 순서
|
|
251
|
+
<Typography level="h1">메인 제목</Typography>
|
|
252
|
+
<Typography level="h3">섹션 제목</Typography>
|
|
253
|
+
```
|
|
573
254
|
|
|
574
|
-
|
|
255
|
+
2. **일관성**: 같은 용도의 텍스트에는 같은 레벨을 사용하세요.
|
|
575
256
|
|
|
576
|
-
|
|
257
|
+
3. **가독성**: 본문 텍스트에는 적절한 줄 간격과 문단 구분을 제공하세요.
|
|
577
258
|
|
|
578
|
-
|
|
259
|
+
4. **색상 대비**: 충분한 색상 대비를 유지하여 접근성을 보장하세요.
|
|
579
260
|
|
|
580
261
|
## Accessibility
|
|
581
262
|
|
|
582
|
-
-
|
|
583
|
-
-
|
|
584
|
-
-
|
|
585
|
-
-
|
|
263
|
+
- 적절한 HTML 시맨틱 태그 사용
|
|
264
|
+
- 스크린 리더 지원
|
|
265
|
+
- 키보드 탐색 가능 (링크나 버튼으로 사용될 때)
|
|
266
|
+
- 충분한 색상 대비
|
|
267
|
+
|
|
268
|
+
Typography는 사용자 인터페이스에서 정보를 효과적으로 전달하고 시각적 계층 구조를 만드는 데 핵심적인 역할을 합니다. 적절한 레벨과 스타일을 선택하여 읽기 쉽고 접근 가능한 콘텐츠를 만들 수 있습니다.
|