@mindlogic-ai/logician-ui 5.0.0-alpha.2 → 5.0.0-alpha.4
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/Badge/Badge.d.ts.map +1 -1
- package/dist/components/Badge/Badge.js +5 -3
- package/dist/components/Badge/Badge.js.map +1 -1
- package/dist/components/Badge/Badge.mjs +5 -3
- package/dist/components/Badge/Badge.mjs.map +1 -1
- package/dist/components/Badge/Badge.types.d.ts +7 -5
- package/dist/components/Badge/Badge.types.d.ts.map +1 -1
- package/dist/components/Banner/Banner.types.d.ts +24 -1
- package/dist/components/Banner/Banner.types.d.ts.map +1 -1
- package/dist/components/Card/Card.types.d.ts +12 -0
- package/dist/components/Card/Card.types.d.ts.map +1 -1
- package/dist/components/ColorMode/ColorModeToggle.d.ts +7 -2
- package/dist/components/ColorMode/ColorModeToggle.d.ts.map +1 -1
- package/dist/components/ColorMode/ColorModeToggle.js +8 -3
- package/dist/components/ColorMode/ColorModeToggle.js.map +1 -1
- package/dist/components/ColorMode/ColorModeToggle.mjs +8 -3
- package/dist/components/ColorMode/ColorModeToggle.mjs.map +1 -1
- package/dist/components/Confetti/Confetti.types.d.ts +5 -1
- package/dist/components/Confetti/Confetti.types.d.ts.map +1 -1
- package/dist/components/Confetti/confettiColors.d.ts +5 -5
- package/dist/components/Confetti/confettiColors.js +5 -5
- package/dist/components/Confetti/confettiColors.mjs +5 -5
- package/dist/components/ErrorFallback/ErrorFallback.types.d.ts +6 -0
- package/dist/components/ErrorFallback/ErrorFallback.types.d.ts.map +1 -1
- package/dist/components/Form/FormModalFooter/FormModalFooter.types.d.ts +4 -1
- package/dist/components/Form/FormModalFooter/FormModalFooter.types.d.ts.map +1 -1
- package/dist/components/LineGraph/LineGraph.d.ts.map +1 -1
- package/dist/components/LineGraph/LineGraph.js +4 -5
- package/dist/components/LineGraph/LineGraph.js.map +1 -1
- package/dist/components/LineGraph/LineGraph.mjs +5 -6
- package/dist/components/LineGraph/LineGraph.mjs.map +1 -1
- package/dist/components/LineGraph/LineGraph.types.d.ts +12 -2
- package/dist/components/LineGraph/LineGraph.types.d.ts.map +1 -1
- package/dist/components/LineGraph/seriesColors.d.ts +12 -8
- package/dist/components/LineGraph/seriesColors.d.ts.map +1 -1
- package/dist/components/LineGraph/seriesColors.js +8 -7
- package/dist/components/LineGraph/seriesColors.js.map +1 -1
- package/dist/components/LineGraph/seriesColors.mjs +8 -7
- package/dist/components/LineGraph/seriesColors.mjs.map +1 -1
- package/dist/components/Masonry/Masonry.types.d.ts +8 -3
- package/dist/components/Masonry/Masonry.types.d.ts.map +1 -1
- package/dist/components/Menu/MenuItem.types.d.ts +8 -0
- package/dist/components/Menu/MenuItem.types.d.ts.map +1 -1
- package/dist/components/Modal/ModalCloseButton.d.ts +1 -1
- package/dist/components/Modal/ModalCloseButton.js +1 -1
- package/dist/components/Modal/ModalCloseButton.mjs +1 -1
- package/dist/components/Pagination/Pagination.d.ts +11 -10
- package/dist/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.js +11 -10
- package/dist/components/Pagination/Pagination.js.map +1 -1
- package/dist/components/Pagination/Pagination.mjs +11 -10
- package/dist/components/Pagination/Pagination.mjs.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.types.d.ts +9 -0
- package/dist/components/ProgressBar/ProgressBar.types.d.ts.map +1 -1
- package/dist/components/RadialProgress/RadialProgress.types.d.ts +21 -1
- package/dist/components/RadialProgress/RadialProgress.types.d.ts.map +1 -1
- package/dist/components/SeeMoreButton/SeeMoreButton.types.d.ts +8 -0
- package/dist/components/SeeMoreButton/SeeMoreButton.types.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.js +6 -7
- package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.mjs +6 -7
- package/dist/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
- package/dist/components/SegmentedProgressBar/SegmentedProgressBar.types.d.ts +2 -0
- package/dist/components/SegmentedProgressBar/SegmentedProgressBar.types.d.ts.map +1 -1
- package/dist/components/Toast/Toast.styles.d.ts +6 -2
- package/dist/components/Toast/Toast.styles.d.ts.map +1 -1
- package/dist/components/Toast/Toast.styles.js +18 -10
- package/dist/components/Toast/Toast.styles.js.map +1 -1
- package/dist/components/Toast/Toast.styles.mjs +18 -10
- package/dist/components/Toast/Toast.styles.mjs.map +1 -1
- package/dist/theme/colors.d.ts +2 -2
- package/dist/theme/colors.d.ts.map +1 -1
- package/dist/theme/colors.js +22 -2
- package/dist/theme/colors.js.map +1 -1
- package/dist/theme/colors.mjs +23 -3
- package/dist/theme/colors.mjs.map +1 -1
- package/dist/theme/palette.generated.d.ts +98 -0
- package/dist/theme/palette.generated.d.ts.map +1 -1
- package/dist/theme/palette.generated.js +99 -0
- package/dist/theme/palette.generated.js.map +1 -1
- package/dist/theme/palette.generated.mjs +99 -1
- package/dist/theme/palette.generated.mjs.map +1 -1
- package/dist/theme/paletteSwatches.d.ts +20 -0
- package/dist/theme/paletteSwatches.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Accordion/Accordion.stories.tsx +85 -0
- package/src/components/Accordion/Accordion.usage.mdx +200 -0
- package/src/components/Appear/Appear.usage.mdx +107 -0
- package/src/components/Avatar/Avatar.stories.tsx +71 -1
- package/src/components/Avatar/Avatar.usage.mdx +166 -0
- package/src/components/Badge/Badge.stories.tsx +193 -3
- package/src/components/Badge/Badge.tsx +5 -3
- package/src/components/Badge/Badge.types.ts +7 -5
- package/src/components/Badge/Badge.usage.mdx +265 -0
- package/src/components/Banner/Banner.stories.tsx +152 -2
- package/src/components/Banner/Banner.types.ts +30 -1
- package/src/components/Banner/Banner.usage.mdx +233 -0
- package/src/components/BottomSheet/BottomSheet.stories.tsx +168 -1
- package/src/components/BottomSheet/BottomSheet.usage.mdx +216 -0
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +59 -0
- package/src/components/Breadcrumb/Breadcrumb.usage.mdx +181 -0
- package/src/components/Button/Button.stories.tsx +263 -3
- package/src/components/Button/Button.usage.mdx +342 -0
- package/src/components/Card/Card.stories.tsx +106 -0
- package/src/components/Card/Card.types.ts +12 -0
- package/src/components/Card/Card.usage.mdx +216 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +140 -13
- package/src/components/Checkbox/Checkbox.usage.mdx +214 -0
- package/src/components/Chip/Chip.usage.mdx +78 -0
- package/src/components/Code/Code.stories.tsx +60 -0
- package/src/components/Code/Code.usage.mdx +187 -0
- package/src/components/CodeTabs/CodeTabs.stories.tsx +53 -0
- package/src/components/CodeTabs/CodeTabs.usage.mdx +176 -0
- package/src/components/Collapsible/Collapsible.stories.tsx +58 -0
- package/src/components/Collapsible/Collapsible.usage.mdx +173 -0
- package/src/components/ColorMode/ColorMode.stories.tsx +50 -0
- package/src/components/ColorMode/ColorMode.usage.mdx +135 -0
- package/src/components/ColorMode/ColorModeToggle.tsx +10 -3
- package/src/components/Confetti/Confetti.types.ts +5 -1
- package/src/components/Confetti/Confetti.usage.mdx +111 -0
- package/src/components/Confetti/confettiColors.ts +5 -5
- package/src/components/Container/Container.stories.tsx +32 -0
- package/src/components/Container/Container.usage.mdx +130 -0
- package/src/components/CopyableCode/CopyableCode.stories.tsx +62 -0
- package/src/components/CopyableCode/CopyableCode.usage.mdx +168 -0
- package/src/components/CountBadge/CountBadge.stories.tsx +69 -0
- package/src/components/CountBadge/CountBadge.usage.mdx +215 -0
- package/src/components/CountUp/CountUp.usage.mdx +107 -0
- package/src/components/DatePicker/DatePicker.usage.mdx +177 -0
- package/src/components/DatePicker/RangeDatePicker.stories.tsx +87 -3
- package/src/components/ErrorFallback/ErrorFallback.types.ts +6 -0
- package/src/components/ErrorFallback/ErrorFallback.usage.mdx +127 -0
- package/src/components/ExpandableText/ExpandableText.stories.tsx +55 -0
- package/src/components/ExpandableText/ExpandableText.usage.mdx +176 -0
- package/src/components/FileInput/FileInput.stories.tsx +38 -1
- package/src/components/FileInput/FileInput.usage.mdx +178 -0
- package/src/components/FileItem/FileItem.stories.tsx +71 -0
- package/src/components/FileItem/FileItem.usage.mdx +180 -0
- package/src/components/FileList/FileList.stories.tsx +25 -0
- package/src/components/FileList/FileList.usage.mdx +165 -0
- package/src/components/FlyTo/FlyTo.usage.mdx +99 -0
- package/src/components/Form/Form.stories.tsx +149 -0
- package/src/components/Form/Form.usage.mdx +201 -0
- package/src/components/Form/FormModalFooter/FormModalFooter.types.ts +4 -1
- package/src/components/FormControl/FormControl.stories.tsx +35 -0
- package/src/components/FormControl/FormControl.usage.mdx +128 -0
- package/src/components/FormIntegration/FormIntegration.usage.mdx +158 -0
- package/src/components/FormLabel/FormLabel.stories.tsx +71 -0
- package/src/components/FormLabel/FormLabel.usage.mdx +125 -0
- package/src/components/Icon/Icon.stories.tsx +61 -1
- package/src/components/Icon/Icon.usage.mdx +158 -0
- package/src/components/IconButton/IconButton.stories.tsx +209 -5
- package/src/components/IconButton/IconButton.usage.mdx +273 -0
- package/src/components/InfoSprinkle/InfoSprinkle.stories.tsx +77 -1
- package/src/components/InfoSprinkle/InfoSprinkle.usage.mdx +189 -0
- package/src/components/InlineCode/InlineCode.stories.tsx +75 -0
- package/src/components/InlineCode/InlineCode.usage.mdx +142 -0
- package/src/components/Input/Input.stories.tsx +180 -0
- package/src/components/Input/Input.usage.mdx +278 -0
- package/src/components/LineGraph/LineGraph.stories.tsx +112 -0
- package/src/components/LineGraph/LineGraph.tsx +4 -5
- package/src/components/LineGraph/LineGraph.types.ts +12 -2
- package/src/components/LineGraph/LineGraph.usage.mdx +186 -0
- package/src/components/LineGraph/seriesColors.test.ts +11 -10
- package/src/components/LineGraph/seriesColors.ts +18 -16
- package/src/components/Loaders/Loaders.stories.tsx +93 -0
- package/src/components/Loaders/Loaders.usage.mdx +180 -0
- package/src/components/LogicianProvider/LogicianProvider.usage.mdx +98 -0
- package/src/components/Markdown/Markdown.stories.tsx +53 -0
- package/src/components/Markdown/Markdown.usage.mdx +182 -0
- package/src/components/Masonry/Masonry.stories.tsx +63 -1
- package/src/components/Masonry/Masonry.types.ts +8 -3
- package/src/components/Masonry/Masonry.usage.mdx +142 -0
- package/src/components/MaxLengthIndicator/MaxLengthIndicator.stories.tsx +57 -0
- package/src/components/MaxLengthIndicator/MaxLengthIndicator.usage.mdx +125 -0
- package/src/components/Menu/Menu.stories.tsx +146 -2
- package/src/components/Menu/Menu.usage.mdx +230 -0
- package/src/components/Menu/MenuItem.types.ts +8 -0
- package/src/components/Modal/Modal.stories.tsx +177 -1
- package/src/components/Modal/Modal.usage.mdx +262 -0
- package/src/components/Modal/ModalCloseButton.tsx +1 -1
- package/src/components/MonthPicker/MonthPicker.stories.tsx +30 -0
- package/src/components/MonthPicker/MonthPicker.usage.mdx +191 -0
- package/src/components/Pagination/Pagination.stories.tsx +90 -1
- package/src/components/Pagination/Pagination.tsx +11 -10
- package/src/components/Pagination/Pagination.usage.mdx +186 -0
- package/src/components/PasswordInput/PasswordInput.stories.tsx +51 -0
- package/src/components/PasswordInput/PasswordInput.usage.mdx +193 -0
- package/src/components/PinInput/PinInput.stories.tsx +91 -0
- package/src/components/PinInput/PinInput.usage.mdx +194 -0
- package/src/components/Popover/Popover.stories.tsx +104 -1
- package/src/components/Popover/Popover.usage.mdx +197 -0
- package/src/components/ProgressBar/ProgressBar.stories.tsx +92 -1
- package/src/components/ProgressBar/ProgressBar.types.ts +9 -0
- package/src/components/ProgressBar/ProgressBar.usage.mdx +210 -0
- package/src/components/Pulse/Pulse.usage.mdx +102 -0
- package/src/components/RadialProgress/RadialProgress.stories.tsx +74 -1
- package/src/components/RadialProgress/RadialProgress.types.ts +21 -1
- package/src/components/RadialProgress/RadialProgress.usage.mdx +153 -0
- package/src/components/Radio/Radio.stories.tsx +119 -0
- package/src/components/Radio/Radio.usage.mdx +187 -0
- package/src/components/Reveal/Reveal.usage.mdx +105 -0
- package/src/components/ScaledContext/ScaledContext.usage.mdx +111 -0
- package/src/components/SeeMoreButton/SeeMoreButton.stories.tsx +146 -2
- package/src/components/SeeMoreButton/SeeMoreButton.types.ts +8 -0
- package/src/components/SeeMoreButton/SeeMoreButton.usage.mdx +213 -0
- package/src/components/SegmentedControl/SegmentedControl.stories.tsx +69 -0
- package/src/components/SegmentedControl/SegmentedControl.tsx +6 -7
- package/src/components/SegmentedControl/SegmentedControl.usage.mdx +209 -0
- package/src/components/SegmentedProgressBar/SegmentedProgressBar.stories.tsx +54 -0
- package/src/components/SegmentedProgressBar/SegmentedProgressBar.types.ts +2 -0
- package/src/components/SegmentedProgressBar/SegmentedProgressBar.usage.mdx +145 -0
- package/src/components/Select/Select.stories.tsx +209 -1
- package/src/components/Select/Select.usage.mdx +278 -0
- package/src/components/Shake/Shake.usage.mdx +107 -0
- package/src/components/Slider/Slider.stories.tsx +116 -0
- package/src/components/Slider/Slider.usage.mdx +179 -0
- package/src/components/Spinner/Spinner.stories.tsx +64 -0
- package/src/components/Spinner/Spinner.usage.mdx +136 -0
- package/src/components/SwapTransition/SwapTransition.usage.mdx +102 -0
- package/src/components/Switch/Switch.stories.tsx +131 -6
- package/src/components/Switch/Switch.usage.mdx +199 -0
- package/src/components/Table/Table.stories.tsx +159 -1
- package/src/components/Table/Table.usage.mdx +235 -0
- package/src/components/Tabs/Tabs.stories.tsx +86 -0
- package/src/components/Tabs/Tabs.usage.mdx +219 -0
- package/src/components/Tag/Tag.stories.tsx +181 -4
- package/src/components/Tag/Tag.usage.mdx +257 -0
- package/src/components/Textarea/Textarea.stories.tsx +113 -0
- package/src/components/Textarea/Textarea.usage.mdx +186 -0
- package/src/components/Toast/Toast.stories.tsx +185 -3
- package/src/components/Toast/Toast.styles.ts +18 -10
- package/src/components/Toast/Toast.usage.mdx +265 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +86 -1
- package/src/components/Tooltip/Tooltip.usage.mdx +211 -0
- package/src/components/Tree/Tree.stories.tsx +89 -0
- package/src/components/Tree/Tree.usage.mdx +207 -0
- package/src/components/Typography/Typography.stories.tsx +117 -0
- package/src/components/Typography/Typography.usage.mdx +251 -0
- package/src/components/Workflow/Workflow.usage.mdx +199 -0
- package/src/components/noRawScales.test.ts +5 -1
- package/src/foundations/BrandColour.mdx +364 -0
- package/src/foundations/BrandColour.stories.tsx +334 -0
- package/src/guidelines/ComponentPageTemplate.mdx +84 -0
- package/src/guidelines/FeedbackActions.mdx +162 -23
- package/src/guidelines/_components/Lang.tsx +175 -0
- package/src/guidelines/_components/TokenTable.tsx +136 -0
- package/src/theme/BazePalette.stories.tsx +111 -1
- package/src/theme/Palette.stories.tsx +2 -2
- package/src/theme/SemanticTokens.mdx +75 -16
- package/src/theme/claude.md +15 -9
- package/src/theme/colors.ts +33 -3
- package/src/theme/contrast.test.ts +32 -0
- package/src/theme/palette.generated.ts +99 -0
- package/src/theme/paletteSwatches.ts +35 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { Canvas, Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import { En, Ko, LangToggle, Verdict } from '../../guidelines/_components/Lang';
|
|
4
|
+
import * as TreeStories from './Tree.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={TreeStories} name="Usage" />
|
|
7
|
+
|
|
8
|
+
<LangToggle />
|
|
9
|
+
|
|
10
|
+
<En>
|
|
11
|
+
|
|
12
|
+
# Tree
|
|
13
|
+
|
|
14
|
+
A hierarchy the user browses and selects from, such as an organisation's
|
|
15
|
+
groups: 본사 › 개발본부 › 백엔드그룹 › API팀. Built on Chakra's TreeView, with
|
|
16
|
+
the house hover, selection and focus styles.
|
|
17
|
+
|
|
18
|
+
Data comes in through `createTreeCollection`; `Tree.Node` renders each node
|
|
19
|
+
with your `render` function, as a `Tree.BranchControl` (has children) or a
|
|
20
|
+
`Tree.Item` (leaf).
|
|
21
|
+
|
|
22
|
+
## When to use
|
|
23
|
+
|
|
24
|
+
- Data that really nests, more than one level deep, where the parent matters:
|
|
25
|
+
groups and sub-groups, folders.
|
|
26
|
+
- When the user picks one node (`selectionMode="single"`, the default) or
|
|
27
|
+
several (`"multiple"`), or expands branches to find one.
|
|
28
|
+
|
|
29
|
+
## When not to use
|
|
30
|
+
|
|
31
|
+
- A flat list → a plain list, `Select`, or `Table`.
|
|
32
|
+
- Two levels where the parent is only a heading → a list with section headings,
|
|
33
|
+
or `Accordion`.
|
|
34
|
+
- Records with several attributes to compare → `Table`.
|
|
35
|
+
- Site navigation → links in a nav landmark. A tree is a widget, not a
|
|
36
|
+
navigation menu.
|
|
37
|
+
|
|
38
|
+
## Options
|
|
39
|
+
|
|
40
|
+
| Option | Means |
|
|
41
|
+
| --- | --- |
|
|
42
|
+
| `selectionMode` | `single` (default) or `multiple` (Ctrl/Cmd-click, Shift-click for a range) |
|
|
43
|
+
| `defaultExpandedValue` / `expandedValue` | Branches open at start, or controlled |
|
|
44
|
+
| `defaultSelectedValue` / `selectedValue` | Selected nodes at start, or controlled |
|
|
45
|
+
| `size` | `xs` / `sm` / `md`: text, padding, indent and icon scale together |
|
|
46
|
+
| `Tree.BranchIndentGuide elbow` | `├` / `└` guide lines instead of a plain rail; `guideColor` (default `border.default`) and `footLength` tune it |
|
|
47
|
+
| `Tree.BranchIndicator` children | Replace the chevron, e.g. with a folder icon |
|
|
48
|
+
|
|
49
|
+
## Do / Don't
|
|
50
|
+
|
|
51
|
+
</En>
|
|
52
|
+
|
|
53
|
+
<Ko>
|
|
54
|
+
|
|
55
|
+
# Tree
|
|
56
|
+
|
|
57
|
+
사용자가 펼쳐 보며 고르는 계층 구조입니다. 예를 들어 기관의 그룹(본사 › 개발본부 ›
|
|
58
|
+
백엔드그룹 › API팀)을 보여 줍니다. Chakra의 TreeView 위에 이 디자인 시스템의 호버,
|
|
59
|
+
선택, 초점 스타일을 얹었습니다.
|
|
60
|
+
|
|
61
|
+
데이터는 `createTreeCollection`으로 넘기고, `Tree.Node`가 넘겨받은 `render` 함수로
|
|
62
|
+
노드를 하나씩 그립니다. 자식이 있으면 `Tree.BranchControl`, 없으면 `Tree.Item`으로
|
|
63
|
+
그립니다.
|
|
64
|
+
|
|
65
|
+
## 언제 쓰나요
|
|
66
|
+
|
|
67
|
+
- 실제로 두 단계 넘게 중첩되고 상위 항목이 의미를 가지는 데이터: 그룹과 하위 그룹,
|
|
68
|
+
폴더.
|
|
69
|
+
- 사용자가 노드 하나(`selectionMode="single"`, 기본값)나 여러 개(`"multiple"`)를
|
|
70
|
+
고르거나, 가지를 펼쳐 가며 찾을 때.
|
|
71
|
+
|
|
72
|
+
## 언제 쓰지 않나요
|
|
73
|
+
|
|
74
|
+
- 단계가 없는 목록이라면 일반 목록, `Select`, `Table`을 씁니다.
|
|
75
|
+
- 상위 항목이 제목 역할만 하는 두 단계라면 섹션 제목이 있는 목록이나 `Accordion`을
|
|
76
|
+
씁니다.
|
|
77
|
+
- 여러 속성을 비교하는 기록이라면 `Table`을 씁니다.
|
|
78
|
+
- 사이트 내비게이션에는 nav 랜드마크 안의 링크를 씁니다. 트리는 위젯이지 탐색 메뉴가
|
|
79
|
+
아닙니다.
|
|
80
|
+
|
|
81
|
+
## 옵션
|
|
82
|
+
|
|
83
|
+
| 옵션 | 뜻 |
|
|
84
|
+
| --- | --- |
|
|
85
|
+
| `selectionMode` | `single`(기본값) 또는 `multiple`(Ctrl/Cmd 클릭, 범위는 Shift 클릭) |
|
|
86
|
+
| `defaultExpandedValue` / `expandedValue` | 처음 펼쳐 둘 가지, 또는 제어 값 |
|
|
87
|
+
| `defaultSelectedValue` / `selectedValue` | 처음 선택할 노드, 또는 제어 값 |
|
|
88
|
+
| `size` | `xs` / `sm` / `md`. 글자, 여백, 들여쓰기, 아이콘 크기가 함께 바뀝니다 |
|
|
89
|
+
| `Tree.BranchIndentGuide elbow` | 세로줄 대신 `├` / `└` 안내선. `guideColor`(기본 `border.default`)와 `footLength`로 조정합니다 |
|
|
90
|
+
| `Tree.BranchIndicator`의 children | 화살표 대신 폴더 아이콘 같은 다른 표시를 넣습니다 |
|
|
91
|
+
|
|
92
|
+
## 이렇게 하세요 / 이렇게 하지 마세요
|
|
93
|
+
|
|
94
|
+
</Ko>
|
|
95
|
+
|
|
96
|
+
<Canvas of={TreeStories.DoNamedWithElbows} />
|
|
97
|
+
<Verdict
|
|
98
|
+
kind="do"
|
|
99
|
+
en="Name the tree with Tree.Label (or aria-label on Tree.Root), and use elbow guides when it goes three or more levels deep."
|
|
100
|
+
ko="Tree.Label(또는 Tree.Root의 aria-label)로 트리에 이름을 붙이고, 세 단계 넘게 깊어지면 elbow 안내선을 씁니다."
|
|
101
|
+
/>
|
|
102
|
+
|
|
103
|
+
<Canvas of={TreeStories.DontFlatList} />
|
|
104
|
+
<Verdict
|
|
105
|
+
kind="dont"
|
|
106
|
+
en="Use a tree for a flat list. It adds tree keyboard rules and announcements for no hierarchy; a list or Select is simpler."
|
|
107
|
+
ko="단계가 없는 목록에 트리를 쓰지 마세요. 계층이 없는데도 트리 키보드 규칙과 낭독이 붙습니다. 목록이나 Select가 더 단순합니다."
|
|
108
|
+
/>
|
|
109
|
+
|
|
110
|
+
<En>
|
|
111
|
+
|
|
112
|
+
## Content
|
|
113
|
+
|
|
114
|
+
- Node names are short nouns, the name the user knows the thing by.
|
|
115
|
+
- Do not repeat the parent in the child: 백엔드그룹 › API팀, not 백엔드그룹 ›
|
|
116
|
+
백엔드그룹 API팀.
|
|
117
|
+
- Long names wrap; keep the tree in a column wide enough that most names fit
|
|
118
|
+
on one line.
|
|
119
|
+
|
|
120
|
+
## Accessibility
|
|
121
|
+
|
|
122
|
+
What Tree does for you:
|
|
123
|
+
|
|
124
|
+
- Chakra/Ark render the tree pattern: `role="tree"` on the tree, `treeitem`
|
|
125
|
+
on each node, with `aria-expanded` on branches and `aria-selected` on
|
|
126
|
+
selected nodes (WCAG 4.1.2).
|
|
127
|
+
- It is one tab stop. Arrow keys move between nodes and open or close
|
|
128
|
+
branches, Home/End jump to the first and last node, and typing a letter
|
|
129
|
+
moves to a matching name (WCAG 2.1.1).
|
|
130
|
+
- Rows and branch triggers show the shared focus ring on keyboard focus
|
|
131
|
+
(WCAG 2.4.7).
|
|
132
|
+
|
|
133
|
+
What you still have to do:
|
|
134
|
+
|
|
135
|
+
- **Give the tree a name**: `Tree.Label` inside `Tree.Root`, or `aria-label`
|
|
136
|
+
on `Tree.Root` (WCAG 4.1.2).
|
|
137
|
+
- **Keep interactive content out of rows.** A row is already the control; a
|
|
138
|
+
button inside a `treeitem` is a nested interactive control
|
|
139
|
+
(`ACCESSIBILITY.md` §3). Put row actions in a toolbar outside the tree, or
|
|
140
|
+
use `Tree.NodeCheckbox` for checkable trees.
|
|
141
|
+
- A custom `BranchIndicator` icon is decorative; the expanded state is
|
|
142
|
+
already announced.
|
|
143
|
+
|
|
144
|
+
## Tokens
|
|
145
|
+
|
|
146
|
+
The colours the Tree parts set on top of the Chakra recipe.
|
|
147
|
+
|
|
148
|
+
</En>
|
|
149
|
+
|
|
150
|
+
<Ko>
|
|
151
|
+
|
|
152
|
+
## 문구
|
|
153
|
+
|
|
154
|
+
- 노드 이름은 사용자가 그 대상을 부르는 짧은 명사로 씁니다.
|
|
155
|
+
- 하위 항목에 상위 이름을 되풀이하지 않습니다. '백엔드그룹 › 백엔드그룹 API팀'이
|
|
156
|
+
아니라 '백엔드그룹 › API팀'으로 씁니다.
|
|
157
|
+
- 긴 이름은 줄바꿈됩니다. 이름 대부분이 한 줄에 들어갈 만큼 넓은 열에 트리를 둡니다.
|
|
158
|
+
|
|
159
|
+
## 접근성
|
|
160
|
+
|
|
161
|
+
Tree가 알아서 하는 일
|
|
162
|
+
|
|
163
|
+
- Chakra/Ark가 트리 패턴을 그립니다. 트리에는 `role="tree"`, 노드마다 `treeitem`을
|
|
164
|
+
주고, 가지에는 `aria-expanded`, 선택된 노드에는 `aria-selected`를 붙입니다(WCAG
|
|
165
|
+
4.1.2).
|
|
166
|
+
- 탭 한 번으로 들어가는 하나의 정지점입니다. 화살표 키로 노드를 오가며 가지를 열고
|
|
167
|
+
닫고, Home/End로 처음과 끝 노드로 가고, 글자를 입력하면 그 글자로 시작하는 이름으로
|
|
168
|
+
이동합니다(WCAG 2.1.1).
|
|
169
|
+
- 키보드로 초점이 오면 행과 가지 트리거에 공통 초점 링이 나타납니다(WCAG 2.4.7).
|
|
170
|
+
|
|
171
|
+
직접 챙겨야 하는 일
|
|
172
|
+
|
|
173
|
+
- **트리에 이름을 붙입니다.** `Tree.Root` 안에 `Tree.Label`을 두거나 `Tree.Root`에
|
|
174
|
+
`aria-label`을 줍니다(WCAG 4.1.2).
|
|
175
|
+
- **행 안에 상호작용 요소를 넣지 않습니다.** 행 자체가 이미 컨트롤이라, `treeitem`
|
|
176
|
+
안의 버튼은 상호작용 요소 중첩이 됩니다(`ACCESSIBILITY.md` 3절). 행 동작은 트리 밖의
|
|
177
|
+
도구 모음에 두고, 체크가 필요하면 `Tree.NodeCheckbox`를 씁니다.
|
|
178
|
+
- 직접 넣은 `BranchIndicator` 아이콘은 장식입니다. 펼침 상태는 이미 읽어 줍니다.
|
|
179
|
+
|
|
180
|
+
## 토큰
|
|
181
|
+
|
|
182
|
+
Chakra 레시피 위에 Tree 파트들이 정하는 색입니다.
|
|
183
|
+
|
|
184
|
+
</Ko>
|
|
185
|
+
|
|
186
|
+
<Canvas of={TreeStories.UsageTokens} sourceState="none" />
|
|
187
|
+
|
|
188
|
+
<En>
|
|
189
|
+
|
|
190
|
+
## Related
|
|
191
|
+
|
|
192
|
+
- **Table**: flat records with columns.
|
|
193
|
+
- **Accordion** / **Collapsible**: sections that open, not a selectable
|
|
194
|
+
hierarchy.
|
|
195
|
+
- **Checkbox**: checkable trees use `Tree.NodeCheckbox`.
|
|
196
|
+
|
|
197
|
+
</En>
|
|
198
|
+
|
|
199
|
+
<Ko>
|
|
200
|
+
|
|
201
|
+
## 관련 컴포넌트
|
|
202
|
+
|
|
203
|
+
- **Table**: 열이 있는 평평한 기록.
|
|
204
|
+
- **Accordion** / **Collapsible**: 고르는 계층이 아니라 여닫는 섹션.
|
|
205
|
+
- **Checkbox**: 체크할 수 있는 트리에는 `Tree.NodeCheckbox`를 씁니다.
|
|
206
|
+
|
|
207
|
+
</Ko>
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { Stack } from '@chakra-ui/react';
|
|
1
2
|
import { Meta, StoryObj } from '@storybook/react';
|
|
2
3
|
|
|
4
|
+
import { T } from '../../guidelines/_components/Lang';
|
|
5
|
+
import { TokenTable } from '../../guidelines/_components/TokenTable';
|
|
6
|
+
import { Card } from '../Card';
|
|
3
7
|
import { InlineCode } from '../InlineCode';
|
|
4
8
|
|
|
5
9
|
import {
|
|
@@ -14,6 +18,7 @@ import {
|
|
|
14
18
|
Subtext,
|
|
15
19
|
Subtitle,
|
|
16
20
|
Text,
|
|
21
|
+
LINK_RAMP,
|
|
17
22
|
} from '.';
|
|
18
23
|
|
|
19
24
|
const meta = {
|
|
@@ -119,3 +124,115 @@ export const AsElement: Story = {
|
|
|
119
124
|
</>
|
|
120
125
|
),
|
|
121
126
|
};
|
|
127
|
+
|
|
128
|
+
// ───────────────────────── Usage-page specimens ─────────────────────────
|
|
129
|
+
// Pulled into `Typography.usage.mdx` with <Canvas of={…} />. Hidden from the
|
|
130
|
+
// sidebar (`!dev`); `tags` is written out on each story because the indexer
|
|
131
|
+
// reads CSF statically.
|
|
132
|
+
|
|
133
|
+
export const DoLevelFromOutline: Story = {
|
|
134
|
+
tags: ['!dev'],
|
|
135
|
+
parameters: { layout: 'padded' },
|
|
136
|
+
name: 'Usage / Do: size by layout, level by outline',
|
|
137
|
+
render: () => (
|
|
138
|
+
<Card p={6} maxW="420px">
|
|
139
|
+
<H3 as="h2" mb={1}>
|
|
140
|
+
사용량
|
|
141
|
+
</H3>
|
|
142
|
+
<Subtext color="fg.muted">이번 달 1일부터 오늘까지의 합계입니다.</Subtext>
|
|
143
|
+
</Card>
|
|
144
|
+
),
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export const DontSubtitleAsHeading: Story = {
|
|
148
|
+
tags: ['!dev'],
|
|
149
|
+
parameters: { layout: 'padded' },
|
|
150
|
+
name: "Usage / Don't: a heading tag for helper copy",
|
|
151
|
+
render: () => (
|
|
152
|
+
<Card p={6} maxW="420px">
|
|
153
|
+
<H2 mb={1}>사용량</H2>
|
|
154
|
+
<Subtitle as="h6">이번 달 1일부터 오늘까지의 합계입니다.</Subtitle>
|
|
155
|
+
</Card>
|
|
156
|
+
),
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
export const DoLinkSaysWhere: Story = {
|
|
160
|
+
tags: ['!dev'],
|
|
161
|
+
parameters: { layout: 'padded' },
|
|
162
|
+
name: 'Usage / Do: the link text names the destination',
|
|
163
|
+
render: () => (
|
|
164
|
+
<Text>
|
|
165
|
+
팀 요금제는 인원 수에 따라 달라집니다.{' '}
|
|
166
|
+
<Link href="#plans">요금제 비교 보기</Link>
|
|
167
|
+
</Text>
|
|
168
|
+
),
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
export const DontLinkHere: Story = {
|
|
172
|
+
tags: ['!dev'],
|
|
173
|
+
parameters: { layout: 'padded' },
|
|
174
|
+
name: "Usage / Don't: “click here” and no underline",
|
|
175
|
+
render: () => (
|
|
176
|
+
<Text>
|
|
177
|
+
팀 요금제가 궁금하다면{' '}
|
|
178
|
+
<Link href="#plans" textDecoration="none">
|
|
179
|
+
여기
|
|
180
|
+
</Link>
|
|
181
|
+
를 누르세요.
|
|
182
|
+
</Text>
|
|
183
|
+
),
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
export const DoCaptionForMetadata: Story = {
|
|
187
|
+
tags: ['!dev'],
|
|
188
|
+
parameters: { layout: 'padded' },
|
|
189
|
+
name: 'Usage / Do: Caption for metadata only',
|
|
190
|
+
render: () => (
|
|
191
|
+
<Stack gap={1} maxW="420px">
|
|
192
|
+
<Text>회의록 요약이 준비되었습니다.</Text>
|
|
193
|
+
<Caption>오후 3:42 · 12분 분량</Caption>
|
|
194
|
+
</Stack>
|
|
195
|
+
),
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
export const DontCaptionForErrors: Story = {
|
|
199
|
+
tags: ['!dev'],
|
|
200
|
+
parameters: { layout: 'padded' },
|
|
201
|
+
name: "Usage / Don't: Caption for something the user must act on",
|
|
202
|
+
render: () => (
|
|
203
|
+
<Stack gap={1} maxW="420px">
|
|
204
|
+
<Text>회의록 요약이 준비되지 않았습니다.</Text>
|
|
205
|
+
<Caption>녹음 파일이 손상되어 다시 올려야 합니다.</Caption>
|
|
206
|
+
</Stack>
|
|
207
|
+
),
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
const TEXT_TOKENS = [
|
|
211
|
+
{ token: 'fg.emphasized', en: 'H1–H5', ko: 'H1–H5' },
|
|
212
|
+
{ token: 'fg.default', en: 'Text, Subtext', ko: 'Text, Subtext' },
|
|
213
|
+
{ token: 'fg.muted', en: 'Subtitle, Overline', ko: 'Subtitle, Overline' },
|
|
214
|
+
{ token: 'fg.subtle', en: 'Caption', ko: 'Caption' },
|
|
215
|
+
];
|
|
216
|
+
|
|
217
|
+
/** Text colours each tier sets by default, and the link ramp (`LINK_RAMP`). */
|
|
218
|
+
export const UsageTokens: Story = {
|
|
219
|
+
tags: ['!dev'],
|
|
220
|
+
parameters: { layout: 'padded' },
|
|
221
|
+
name: 'Usage / Tokens',
|
|
222
|
+
render: () => (
|
|
223
|
+
<TokenTable
|
|
224
|
+
rows={[
|
|
225
|
+
...TEXT_TOKENS.map(({ token, en, ko }) => ({
|
|
226
|
+
token,
|
|
227
|
+
use: <T en={en} ko={ko} />,
|
|
228
|
+
})),
|
|
229
|
+
// `errorHover` is the same token as `error` (no darker danger token
|
|
230
|
+
// exists), so it is not listed twice.
|
|
231
|
+
...(['default', 'defaultHover', 'error'] as const).map((state) => ({
|
|
232
|
+
token: LINK_RAMP[state],
|
|
233
|
+
use: <T en={`Link · ${state}`} ko={`Link · ${state}`} />,
|
|
234
|
+
})),
|
|
235
|
+
]}
|
|
236
|
+
/>
|
|
237
|
+
),
|
|
238
|
+
};
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { Canvas, Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import { En, Ko, LangToggle, Verdict } from '../../guidelines/_components/Lang';
|
|
4
|
+
import * as TypographyStories from './Typography.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={TypographyStories} name="Usage" />
|
|
7
|
+
|
|
8
|
+
<LangToggle />
|
|
9
|
+
|
|
10
|
+
<En>
|
|
11
|
+
|
|
12
|
+
# Typography
|
|
13
|
+
|
|
14
|
+
The type scale: headings (`H1`–`H5`), body text (`Text`), supporting text
|
|
15
|
+
(`Subtitle`, `Subtext`, `Caption`, `Overline`) and inline links (`Link`).
|
|
16
|
+
Each tier sets a size, a colour and Korean word breaking (`keep-all`).
|
|
17
|
+
|
|
18
|
+
## When to use
|
|
19
|
+
|
|
20
|
+
- `H1`–`H5` for headings that belong in the page outline: a page title, a
|
|
21
|
+
section, a card or modal title.
|
|
22
|
+
- `Text` for body copy. `Subtext` for the secondary line under a title or
|
|
23
|
+
value. `Caption` for metadata (time, count, length). `Overline` for a short
|
|
24
|
+
uppercase eyebrow above a heading.
|
|
25
|
+
- `Link` for navigation inside a sentence.
|
|
26
|
+
|
|
27
|
+
## When not to use
|
|
28
|
+
|
|
29
|
+
- An action that changes something (save, delete, open a modal) → `Button`
|
|
30
|
+
(`variant="ghost"` if it has to look light). A link goes somewhere.
|
|
31
|
+
- A status label next to a title → `Badge`.
|
|
32
|
+
- Code inside a sentence → `InlineCode`. Formatted content from a model or an
|
|
33
|
+
author → `Markdown`, which maps to these same components.
|
|
34
|
+
|
|
35
|
+
## The scale and what each tier means
|
|
36
|
+
|
|
37
|
+
| Component | Renders | Default colour | Use for |
|
|
38
|
+
| --- | --- | --- | --- |
|
|
39
|
+
| `H1`–`H5` | `<h1>`–`<h5>` | `fg.emphasized` | Headings in the outline |
|
|
40
|
+
| `Text` | `<p>` | `fg.default` | Body copy |
|
|
41
|
+
| `Subtitle` | `<p>` | `fg.muted` | Helper copy under a heading |
|
|
42
|
+
| `Subtext` | `<p>` | `fg.default` | A step smaller than body: secondary lines, dense lists |
|
|
43
|
+
| `Caption` | `<p>` | `fg.subtle` | Timestamps, counts, file sizes |
|
|
44
|
+
| `Overline` | `<p>` | `fg.muted` | Uppercase eyebrow above a heading |
|
|
45
|
+
| `Link` | `<a>` | `fg.link` (`variant="error"`: `danger.fg`) | Inline navigation |
|
|
46
|
+
|
|
47
|
+
**Size and level are separate choices.** Every component takes `as`, and the
|
|
48
|
+
props of that element come with it. Pick the size for the layout, then set
|
|
49
|
+
the level the outline needs: `<H3 as="h2">`. `Subtitle` used to render
|
|
50
|
+
`<h6>`; it is a paragraph now, and says `as="h2"` only where it really is the
|
|
51
|
+
next heading. Passing `fontSize` turns off the tier's `textStyle`, so an
|
|
52
|
+
explicit size wins.
|
|
53
|
+
|
|
54
|
+
## Do / Don't
|
|
55
|
+
|
|
56
|
+
</En>
|
|
57
|
+
|
|
58
|
+
<Ko>
|
|
59
|
+
|
|
60
|
+
# Typography
|
|
61
|
+
|
|
62
|
+
글자 체계입니다. 제목(`H1`–`H5`), 본문(`Text`), 보조 문구(`Subtitle`, `Subtext`,
|
|
63
|
+
`Caption`, `Overline`), 문장 안 링크(`Link`)로 나뉩니다. 각 단계는 크기와 색을
|
|
64
|
+
정하고, 한국어가 단어 중간에서 끊기지 않도록 `keep-all`을 겁니다.
|
|
65
|
+
|
|
66
|
+
## 언제 쓰나요
|
|
67
|
+
|
|
68
|
+
- 페이지 구조에 들어가는 제목에는 `H1`–`H5`를 씁니다. 페이지 제목, 섹션, 카드나
|
|
69
|
+
모달의 제목이 여기에 해당합니다.
|
|
70
|
+
- 본문은 `Text`, 제목이나 값 아래의 보조 줄은 `Subtext`, 시간·개수·길이 같은
|
|
71
|
+
메타데이터는 `Caption`, 제목 위의 짧은 대문자 머리말은 `Overline`을 씁니다.
|
|
72
|
+
- 문장 안에서 다른 곳으로 이동할 때는 `Link`를 씁니다.
|
|
73
|
+
|
|
74
|
+
## 언제 쓰지 않나요
|
|
75
|
+
|
|
76
|
+
- 무언가를 바꾸는 동작(저장, 삭제, 모달 열기)에는 `Button`을 씁니다. 가벼워 보여야
|
|
77
|
+
한다면 `variant="ghost"`를 씁니다. 링크는 어딘가로 이동할 때만 씁니다.
|
|
78
|
+
- 제목 옆의 상태 라벨은 `Badge`를 씁니다.
|
|
79
|
+
- 문장 안의 코드는 `InlineCode`를 씁니다. 모델이나 작성자가 쓴 서식 있는 글은
|
|
80
|
+
`Markdown`을 쓰면 같은 컴포넌트로 그려집니다.
|
|
81
|
+
|
|
82
|
+
## 단계와 뜻
|
|
83
|
+
|
|
84
|
+
| 컴포넌트 | 그리는 요소 | 기본 색 | 쓰는 곳 |
|
|
85
|
+
| --- | --- | --- | --- |
|
|
86
|
+
| `H1`–`H5` | `<h1>`–`<h5>` | `fg.emphasized` | 문서 구조 안의 제목 |
|
|
87
|
+
| `Text` | `<p>` | `fg.default` | 본문 |
|
|
88
|
+
| `Subtitle` | `<p>` | `fg.muted` | 제목 아래의 도움말 |
|
|
89
|
+
| `Subtext` | `<p>` | `fg.default` | 본문보다 한 단계 작은 글: 보조 줄, 촘촘한 목록 |
|
|
90
|
+
| `Caption` | `<p>` | `fg.subtle` | 시각, 개수, 파일 크기 |
|
|
91
|
+
| `Overline` | `<p>` | `fg.muted` | 제목 위의 대문자 머리말 |
|
|
92
|
+
| `Link` | `<a>` | `fg.link` (`variant="error"`이면 `danger.fg`) | 문장 안의 이동 |
|
|
93
|
+
|
|
94
|
+
**크기와 제목 수준은 따로 고릅니다.** 모든 컴포넌트가 `as`를 받고, 그 요소의
|
|
95
|
+
속성도 함께 받습니다. 크기는 레이아웃에 맞춰 고르고, 수준은 문서 구조에 맞춰
|
|
96
|
+
`<H3 as="h2">`처럼 정합니다. `Subtitle`은 예전에 `<h6>`로 그려졌지만 지금은
|
|
97
|
+
문단이며, 정말 다음 수준의 제목일 때만 `as="h2"`를 붙입니다. `fontSize`를 넘기면
|
|
98
|
+
그 단계의 `textStyle`이 꺼지고 지정한 크기가 적용됩니다.
|
|
99
|
+
|
|
100
|
+
## 이렇게 하세요 / 이렇게 하지 마세요
|
|
101
|
+
|
|
102
|
+
</Ko>
|
|
103
|
+
|
|
104
|
+
<Canvas of={TypographyStories.DoLevelFromOutline} />
|
|
105
|
+
<Verdict
|
|
106
|
+
kind="do"
|
|
107
|
+
en="Choose H3 for its size and render it as h2 because it is the first heading under the page title."
|
|
108
|
+
ko="크기 때문에 H3를 고르고, 페이지 제목 바로 아래의 첫 제목이므로 h2로 그립니다."
|
|
109
|
+
/>
|
|
110
|
+
|
|
111
|
+
<Canvas of={TypographyStories.DontSubtitleAsHeading} />
|
|
112
|
+
<Verdict
|
|
113
|
+
kind="dont"
|
|
114
|
+
en="Give helper copy a heading tag. A screen reader lists it as a heading, and the outline jumps from h2 to h6."
|
|
115
|
+
ko="도움말 문구에 제목 태그를 주지 마세요. 화면 낭독기가 제목 목록에 넣고, 문서 구조가 h2에서 h6로 건너뜁니다."
|
|
116
|
+
/>
|
|
117
|
+
|
|
118
|
+
<Canvas of={TypographyStories.DoLinkSaysWhere} />
|
|
119
|
+
<Verdict
|
|
120
|
+
kind="do"
|
|
121
|
+
en="Write link text that names where it goes, so it makes sense when read on its own."
|
|
122
|
+
ko="링크 문구에는 이동할 곳을 적어서, 링크만 따로 읽어도 뜻이 통하게 합니다."
|
|
123
|
+
/>
|
|
124
|
+
|
|
125
|
+
<Canvas of={TypographyStories.DontLinkHere} />
|
|
126
|
+
<Verdict
|
|
127
|
+
kind="dont"
|
|
128
|
+
en="Use “여기” as the link text, or remove the underline. A link list full of “여기” tells nobody anything, and without the underline only colour marks the link."
|
|
129
|
+
ko="'여기'를 링크 문구로 쓰거나 밑줄을 없애지 마세요. '여기'만 늘어선 링크 목록은 아무것도 알려 주지 못하고, 밑줄이 없으면 색만으로 링크를 구분해야 합니다."
|
|
130
|
+
/>
|
|
131
|
+
|
|
132
|
+
<Canvas of={TypographyStories.DoCaptionForMetadata} />
|
|
133
|
+
<Verdict
|
|
134
|
+
kind="do"
|
|
135
|
+
en="Keep Caption for metadata the reader can skip."
|
|
136
|
+
ko="Caption은 읽지 않고 넘어가도 되는 메타데이터에만 씁니다."
|
|
137
|
+
/>
|
|
138
|
+
|
|
139
|
+
<Canvas of={TypographyStories.DontCaptionForErrors} />
|
|
140
|
+
<Verdict
|
|
141
|
+
kind="dont"
|
|
142
|
+
en="Put something the user must act on in Caption. It is the faintest tier; use Text, or a Banner for a real error."
|
|
143
|
+
ko="사용자가 조치해야 하는 내용을 Caption에 넣지 마세요. 가장 흐린 단계이므로 Text를 쓰고, 실제 오류라면 Banner를 씁니다."
|
|
144
|
+
/>
|
|
145
|
+
|
|
146
|
+
<En>
|
|
147
|
+
|
|
148
|
+
## Content
|
|
149
|
+
|
|
150
|
+
- Headings in sentence case, no full stop. Keep them short enough for one
|
|
151
|
+
line on mobile.
|
|
152
|
+
- Do not set long body copy in `Subtext` or `Caption` to make it fit. Cut
|
|
153
|
+
the copy instead.
|
|
154
|
+
- Link text is the destination or the thing you get: 요금제 비교 보기, not
|
|
155
|
+
여기 or 자세히.
|
|
156
|
+
|
|
157
|
+
## Accessibility
|
|
158
|
+
|
|
159
|
+
What the components do for you:
|
|
160
|
+
|
|
161
|
+
- `H1`–`H5` render real heading elements, and the body tiers render
|
|
162
|
+
paragraphs, so the outline only contains what you mark as a heading.
|
|
163
|
+
- `Link` is underlined (1px, 2px on hover) and medium weight, so it does not
|
|
164
|
+
rely on colour alone (WCAG 1.4.1). `fg.link` and `fg.linkHover` are tuned
|
|
165
|
+
against the canvas in both modes (WCAG 1.4.3).
|
|
166
|
+
- The markdown `h6` keeps `as="h6"`, because a heading the author wrote must
|
|
167
|
+
stay in the outline.
|
|
168
|
+
|
|
169
|
+
What you still have to do:
|
|
170
|
+
|
|
171
|
+
- **Keep the heading levels in order** (WCAG 1.3.1, 2.4.6; KWCAG 5.2.4.2 제목
|
|
172
|
+
제공). Use `as` to fix the level, never a smaller component to fix the size.
|
|
173
|
+
- **Do not remove the link underline** in running text (WCAG 1.4.1).
|
|
174
|
+
- **Name the destination** in the link text (WCAG 2.4.4). If a link opens a
|
|
175
|
+
new tab, say so in the text or with a visually hidden note.
|
|
176
|
+
- The error link keeps `danger.fg` on hover; only the underline thickens.
|
|
177
|
+
- An action is a `<button>`, not a link with an `onClick` (WCAG 4.1.2).
|
|
178
|
+
`<Link as="button">` is fine when it must look like a link.
|
|
179
|
+
|
|
180
|
+
## Tokens
|
|
181
|
+
|
|
182
|
+
Default colour of each tier, and the link states from `LINK_RAMP` in
|
|
183
|
+
`Link.tsx`.
|
|
184
|
+
|
|
185
|
+
</En>
|
|
186
|
+
|
|
187
|
+
<Ko>
|
|
188
|
+
|
|
189
|
+
## 문구
|
|
190
|
+
|
|
191
|
+
- 제목은 문장형 대소문자로 쓰고 마침표를 찍지 않습니다. 모바일에서 한 줄에 들어갈
|
|
192
|
+
만큼 짧게 씁니다.
|
|
193
|
+
- 긴 본문을 화면에 맞추려고 `Subtext`나 `Caption`으로 줄이지 않습니다. 문구를
|
|
194
|
+
줄입니다.
|
|
195
|
+
- 링크 문구에는 이동할 곳이나 얻을 것을 씁니다. '여기', '자세히'가 아니라 '요금제
|
|
196
|
+
비교 보기'처럼 씁니다.
|
|
197
|
+
|
|
198
|
+
## 접근성
|
|
199
|
+
|
|
200
|
+
컴포넌트가 알아서 하는 일
|
|
201
|
+
|
|
202
|
+
- `H1`–`H5`는 실제 제목 요소로, 본문 단계는 문단으로 그려집니다. 그래서 제목으로
|
|
203
|
+
지정한 것만 문서 구조에 들어갑니다.
|
|
204
|
+
- `Link`는 밑줄(평소 1px, 마우스를 올리면 2px)과 중간 굵기를 가지므로 색에만
|
|
205
|
+
기대지 않습니다(WCAG 1.4.1). `fg.link`와 `fg.linkHover`는 두 모드 모두에서 바탕과
|
|
206
|
+
대비가 맞도록 정해져 있습니다(WCAG 1.4.3).
|
|
207
|
+
- 마크다운의 `h6`는 `as="h6"`를 유지합니다. 작성자가 쓴 제목은 문서 구조에 남아야
|
|
208
|
+
하기 때문입니다.
|
|
209
|
+
|
|
210
|
+
직접 챙겨야 하는 일
|
|
211
|
+
|
|
212
|
+
- **제목 수준을 차례대로 씁니다**(WCAG 1.3.1, 2.4.6, KWCAG 5.2.4.2 제목 제공).
|
|
213
|
+
수준은 `as`로 맞추고, 크기를 맞추려고 더 작은 컴포넌트를 고르지 않습니다.
|
|
214
|
+
- 본문 안 링크의 **밑줄을 없애지 않습니다**(WCAG 1.4.1).
|
|
215
|
+
- 링크 문구에 **이동할 곳을 적습니다**(WCAG 2.4.4). 새 탭에서 열린다면 문구나
|
|
216
|
+
시각적으로 숨긴 안내로 알립니다.
|
|
217
|
+
- 오류 링크는 마우스를 올려도 `danger.fg`를 유지하고 밑줄만 굵어집니다.
|
|
218
|
+
- 동작은 `onClick`을 단 링크가 아니라 `<button>`으로 만듭니다(WCAG 4.1.2). 링크처럼
|
|
219
|
+
보여야 한다면 `<Link as="button">`을 씁니다.
|
|
220
|
+
|
|
221
|
+
## 토큰
|
|
222
|
+
|
|
223
|
+
각 단계의 기본 색과 `Link.tsx`의 `LINK_RAMP`에 있는 링크 상태입니다.
|
|
224
|
+
|
|
225
|
+
</Ko>
|
|
226
|
+
|
|
227
|
+
<Canvas of={TypographyStories.UsageTokens} sourceState="none" />
|
|
228
|
+
|
|
229
|
+
<En>
|
|
230
|
+
|
|
231
|
+
## Related
|
|
232
|
+
|
|
233
|
+
- **Markdown**: renders authored or generated text with these components.
|
|
234
|
+
- **InlineCode**: code inside a sentence.
|
|
235
|
+
- **ExpandableText**: body text clipped to a few lines.
|
|
236
|
+
- **Badge**: a status label next to a heading.
|
|
237
|
+
- **Foundations/Brand & colour usage**: which `fg.*` role to use where.
|
|
238
|
+
|
|
239
|
+
</En>
|
|
240
|
+
|
|
241
|
+
<Ko>
|
|
242
|
+
|
|
243
|
+
## 관련 컴포넌트
|
|
244
|
+
|
|
245
|
+
- **Markdown**: 작성하거나 생성한 글을 이 컴포넌트들로 그립니다.
|
|
246
|
+
- **InlineCode**: 문장 안의 코드.
|
|
247
|
+
- **ExpandableText**: 몇 줄만 보여 주고 접어 두는 본문.
|
|
248
|
+
- **Badge**: 제목 옆의 상태 라벨.
|
|
249
|
+
- **Foundations/Brand & colour usage**: 어느 자리에 어떤 `fg.*` 역할을 쓰는지.
|
|
250
|
+
|
|
251
|
+
</Ko>
|