@mindlogic-ai/logician-ui 5.0.0-alpha.3 → 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/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/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 +65 -2
- 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,125 @@
|
|
|
1
|
+
import { Canvas, Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import { En, Ko, LangToggle, Verdict } from '../../guidelines/_components/Lang';
|
|
4
|
+
import * as FormLabelStories from './FormLabel.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={FormLabelStories} name="Usage" />
|
|
7
|
+
|
|
8
|
+
<LangToggle />
|
|
9
|
+
|
|
10
|
+
<En>
|
|
11
|
+
|
|
12
|
+
# FormLabel
|
|
13
|
+
|
|
14
|
+
The visible label of a field. Inside `FormControl` it is associated with the
|
|
15
|
+
control and shows the required asterisk on its own.
|
|
16
|
+
|
|
17
|
+
## When to use
|
|
18
|
+
|
|
19
|
+
- Inside `FormControl`, when you compose a field by hand. `FieldRow` (through
|
|
20
|
+
`FieldLabel`) already renders one.
|
|
21
|
+
|
|
22
|
+
## When not to use
|
|
23
|
+
|
|
24
|
+
- A section title → `FormSection` `title`.
|
|
25
|
+
- A label for a checkbox, radio or switch option → `Checkbox.Label`,
|
|
26
|
+
`Radio.Text`, `Switch.Label`.
|
|
27
|
+
|
|
28
|
+
## Do / Don't
|
|
29
|
+
|
|
30
|
+
</En>
|
|
31
|
+
|
|
32
|
+
<Ko>
|
|
33
|
+
|
|
34
|
+
# FormLabel
|
|
35
|
+
|
|
36
|
+
필드의 보이는 라벨입니다. `FormControl` 안에서는 컨트롤과 연결되고 필수 별표도 알아서
|
|
37
|
+
보여 줍니다.
|
|
38
|
+
|
|
39
|
+
## 언제 쓰나요
|
|
40
|
+
|
|
41
|
+
- 필드를 직접 조합할 때 `FormControl` 안에서 씁니다. `FieldRow`는 `FieldLabel`을 통해
|
|
42
|
+
이미 FormLabel을 그립니다.
|
|
43
|
+
|
|
44
|
+
## 언제 쓰지 않나요
|
|
45
|
+
|
|
46
|
+
- 섹션 제목은 `FormSection`의 `title`을 씁니다.
|
|
47
|
+
- 체크박스, 라디오, 스위치 선택지의 라벨은 `Checkbox.Label`, `Radio.Text`,
|
|
48
|
+
`Switch.Label`을 씁니다.
|
|
49
|
+
|
|
50
|
+
## 이렇게 하세요 / 이렇게 하지 마세요
|
|
51
|
+
|
|
52
|
+
</Ko>
|
|
53
|
+
|
|
54
|
+
<Canvas of={FormLabelStories.DoNounLabels} />
|
|
55
|
+
<Verdict
|
|
56
|
+
kind="do"
|
|
57
|
+
en="Write short nouns and let FormControl required add the asterisk."
|
|
58
|
+
ko="짧은 명사로 쓰고, 별표는 FormControl의 required가 붙이게 둡니다."
|
|
59
|
+
/>
|
|
60
|
+
|
|
61
|
+
<Canvas of={FormLabelStories.DontSentenceLabels} />
|
|
62
|
+
<Verdict
|
|
63
|
+
kind="dont"
|
|
64
|
+
en="Write an instruction with a colon and type '(필수)' by hand. The asterisk already says it, so the label says it twice."
|
|
65
|
+
ko="쌍점을 붙인 지시문으로 쓰거나 '(필수)'를 직접 적지 마세요. 별표가 이미 알려 주므로 두 번 말하게 됩니다."
|
|
66
|
+
/>
|
|
67
|
+
|
|
68
|
+
<En>
|
|
69
|
+
|
|
70
|
+
## Content
|
|
71
|
+
|
|
72
|
+
- A noun phrase in sentence case, no colon, no "(required)".
|
|
73
|
+
- Keep it under about four words; anything longer goes in `FieldRow`
|
|
74
|
+
`description` or helper text.
|
|
75
|
+
|
|
76
|
+
## Accessibility
|
|
77
|
+
|
|
78
|
+
- It renders Chakra's `Field.Label`, a `<label>` whose `for` is the field's
|
|
79
|
+
control id, so clicking it focuses the control and screen readers read it as
|
|
80
|
+
the control's name (WCAG 1.3.1, 4.1.2; KWCAG 5.3.4.1 레이블 제공).
|
|
81
|
+
- Outside `FormControl` there is no id to point at: pass `htmlFor` yourself.
|
|
82
|
+
- Composed controls (`SelectField`, `ComboboxField`, `Slider`) are not named
|
|
83
|
+
by it; give them `label` or `ariaLabel`.
|
|
84
|
+
|
|
85
|
+
## Tokens
|
|
86
|
+
|
|
87
|
+
The label text is `fg.muted` from its wrapper (`FieldLabel` overrides it to
|
|
88
|
+
`fg.default`, semibold). The asterisk is `danger.fg`.
|
|
89
|
+
|
|
90
|
+
## Related
|
|
91
|
+
|
|
92
|
+
- **FormControl**: the field it labels.
|
|
93
|
+
- **FieldRow** / **FieldLabel**: the laid-out label with description and an
|
|
94
|
+
end slot.
|
|
95
|
+
|
|
96
|
+
</En>
|
|
97
|
+
|
|
98
|
+
<Ko>
|
|
99
|
+
|
|
100
|
+
## 문구
|
|
101
|
+
|
|
102
|
+
- 문장형 대소문자의 명사구로 쓰고, 쌍점이나 "(필수)"를 붙이지 않습니다.
|
|
103
|
+
- 네 단어 안팎으로 씁니다. 더 긴 설명은 `FieldRow`의 `description`이나 도움말에
|
|
104
|
+
넣습니다.
|
|
105
|
+
|
|
106
|
+
## 접근성
|
|
107
|
+
|
|
108
|
+
- Chakra `Field.Label`을 그립니다. `for`가 필드 컨트롤의 id인 `<label>`이라, 누르면
|
|
109
|
+
컨트롤로 초점이 가고 화면 낭독기는 이를 컨트롤의 이름으로 읽습니다(WCAG 1.3.1, 4.1.2,
|
|
110
|
+
KWCAG 5.3.4.1 레이블 제공).
|
|
111
|
+
- `FormControl` 밖에서는 가리킬 id가 없으므로 `htmlFor`를 직접 넘깁니다.
|
|
112
|
+
- 부품을 조합한 컨트롤(`SelectField`, `ComboboxField`, `Slider`)에는 이 라벨이 이름으로
|
|
113
|
+
닿지 않습니다. `label`이나 `ariaLabel`을 줍니다.
|
|
114
|
+
|
|
115
|
+
## 토큰
|
|
116
|
+
|
|
117
|
+
라벨 글자는 감싸는 요소의 `fg.muted`를 씁니다(`FieldLabel`은 `fg.default` 굵은
|
|
118
|
+
글자로 바꿉니다). 별표는 `danger.fg`입니다.
|
|
119
|
+
|
|
120
|
+
## 관련 컴포넌트
|
|
121
|
+
|
|
122
|
+
- **FormControl**: 라벨이 붙는 필드.
|
|
123
|
+
- **FieldRow** / **FieldLabel**: 설명과 끝 자리가 있는 배치된 라벨.
|
|
124
|
+
|
|
125
|
+
</Ko>
|
|
@@ -13,9 +13,18 @@ import { useMemo } from 'react';
|
|
|
13
13
|
import { FaBuildingUser } from 'react-icons/fa6';
|
|
14
14
|
import { MdDashboard } from 'react-icons/md';
|
|
15
15
|
|
|
16
|
+
import { TokenTable } from '../../guidelines/_components/TokenTable';
|
|
17
|
+
import { Button } from '../Button';
|
|
18
|
+
import { IconButton } from '../IconButton';
|
|
16
19
|
import { Icons } from './_constants/iconList';
|
|
17
20
|
import { createIcon } from './_utils/createIcon';
|
|
18
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
Analytics,
|
|
23
|
+
CheckIcon,
|
|
24
|
+
CloseIcon,
|
|
25
|
+
DownloadIcon,
|
|
26
|
+
TrashIcon,
|
|
27
|
+
} from './index';
|
|
19
28
|
|
|
20
29
|
const meta = {
|
|
21
30
|
title: 'Components/Icon',
|
|
@@ -423,3 +432,54 @@ const MyCustomIcon = createIcon(
|
|
|
423
432
|
</VStack>
|
|
424
433
|
),
|
|
425
434
|
};
|
|
435
|
+
|
|
436
|
+
// ───────────────────────── Usage-page specimens ─────────────────────────
|
|
437
|
+
// Pulled into `Icon.usage.mdx` with <Canvas of={…} />. Hidden from the
|
|
438
|
+
// sidebar (`!dev`); `tags` is written out on each story because the indexer
|
|
439
|
+
// reads CSF statically.
|
|
440
|
+
|
|
441
|
+
export const DoIconWithLabel: Story = {
|
|
442
|
+
tags: ['!dev'],
|
|
443
|
+
parameters: { layout: 'padded' },
|
|
444
|
+
name: 'Usage / Do: decorative next to a label, named when alone',
|
|
445
|
+
render: () => (
|
|
446
|
+
<HStack gap={3}>
|
|
447
|
+
<Button variant="secondary">
|
|
448
|
+
<DownloadIcon boxSize="xs" aria-hidden />
|
|
449
|
+
내려받기
|
|
450
|
+
</Button>
|
|
451
|
+
<IconButton aria-label="삭제" variant="ghost">
|
|
452
|
+
<TrashIcon boxSize="xs" aria-hidden />
|
|
453
|
+
</IconButton>
|
|
454
|
+
</HStack>
|
|
455
|
+
),
|
|
456
|
+
};
|
|
457
|
+
|
|
458
|
+
export const DontIconAsStatus: Story = {
|
|
459
|
+
tags: ['!dev'],
|
|
460
|
+
parameters: { layout: 'padded' },
|
|
461
|
+
name: "Usage / Don't: a coloured icon as the only status",
|
|
462
|
+
render: () => (
|
|
463
|
+
<HStack gap={4}>
|
|
464
|
+
<Text>결제 1</Text>
|
|
465
|
+
<CheckIcon boxSize="xs" color="success.fg" />
|
|
466
|
+
<Text>결제 2</Text>
|
|
467
|
+
<CloseIcon boxSize="xs" color="danger.fg" />
|
|
468
|
+
</HStack>
|
|
469
|
+
),
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
export const UsageTokens: Story = {
|
|
473
|
+
tags: ['!dev'],
|
|
474
|
+
parameters: { layout: 'padded' },
|
|
475
|
+
name: 'Usage / Tokens',
|
|
476
|
+
render: () => (
|
|
477
|
+
<TokenTable
|
|
478
|
+
rows={[
|
|
479
|
+
{ token: 'fg.icon', use: 'icons on their own (stories default)' },
|
|
480
|
+
{ token: 'fg.default', use: 'icon in running text' },
|
|
481
|
+
{ token: 'fg.muted', use: 'secondary icon' },
|
|
482
|
+
]}
|
|
483
|
+
/>
|
|
484
|
+
),
|
|
485
|
+
};
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { Canvas, Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import { En, Ko, LangToggle, Verdict } from '../../guidelines/_components/Lang';
|
|
4
|
+
import * as IconStories from './Icon.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={IconStories} name="Usage" />
|
|
7
|
+
|
|
8
|
+
<LangToggle />
|
|
9
|
+
|
|
10
|
+
<En>
|
|
11
|
+
|
|
12
|
+
# Icon
|
|
13
|
+
|
|
14
|
+
The icon set: named exports such as `DownloadIcon`, `TrashIcon` and
|
|
15
|
+
`CheckIcon`, wrapped from react-icons and custom SVGs with `createIcon`.
|
|
16
|
+
Every icon takes `boxSize` (`2xs` 14px, `xs` 16px, `sm` 20px, `md` 24px
|
|
17
|
+
default, `lg` 32px, `xl` 40px) and paints `currentColor`, so it takes the
|
|
18
|
+
text colour around it unless you pass `color`.
|
|
19
|
+
|
|
20
|
+
## When to use
|
|
21
|
+
|
|
22
|
+
- To help recognise an action or item next to its label.
|
|
23
|
+
- Inside an `IconButton`, where the button carries the name.
|
|
24
|
+
|
|
25
|
+
## When not to use
|
|
26
|
+
|
|
27
|
+
- As the only way to say something (a status, an error) → words, with the
|
|
28
|
+
icon as support (`Badge`, `Banner`).
|
|
29
|
+
- As a decorative illustration → an image.
|
|
30
|
+
- A new icon from another set inline at the call site → add it to the set
|
|
31
|
+
(see `ICON_MANAGEMENT.md`) so every app gets the same one.
|
|
32
|
+
|
|
33
|
+
## Do / Don't
|
|
34
|
+
|
|
35
|
+
</En>
|
|
36
|
+
|
|
37
|
+
<Ko>
|
|
38
|
+
|
|
39
|
+
# Icon
|
|
40
|
+
|
|
41
|
+
아이콘 모음입니다. `DownloadIcon`, `TrashIcon`, `CheckIcon` 같은 이름으로 내보내며,
|
|
42
|
+
react-icons와 직접 만든 SVG를 `createIcon`으로 감쌌습니다. 모든 아이콘은
|
|
43
|
+
`boxSize`(`2xs` 14px, `xs` 16px, `sm` 20px, 기본 `md` 24px, `lg` 32px, `xl` 40px)를 받고
|
|
44
|
+
`currentColor`로 칠하므로, `color`를 넘기지 않으면 주변 글자색을 따릅니다.
|
|
45
|
+
|
|
46
|
+
## 언제 쓰나요
|
|
47
|
+
|
|
48
|
+
- 라벨 옆에서 동작이나 항목을 알아보기 쉽게 할 때.
|
|
49
|
+
- `IconButton` 안에서. 이름은 버튼이 가집니다.
|
|
50
|
+
|
|
51
|
+
## 언제 쓰지 않나요
|
|
52
|
+
|
|
53
|
+
- 아이콘만으로 무언가(상태, 오류)를 알리지 않습니다. 문구를 쓰고 아이콘은 거들게
|
|
54
|
+
합니다(`Badge`, `Banner`).
|
|
55
|
+
- 장식용 그림에는 이미지를 씁니다.
|
|
56
|
+
- 다른 아이콘 모음의 아이콘을 호출부에서 바로 쓰지 않습니다. 모든 앱이 같은 아이콘을
|
|
57
|
+
쓰도록 모음에 추가합니다(`ICON_MANAGEMENT.md` 참고).
|
|
58
|
+
|
|
59
|
+
## 이렇게 하세요 / 이렇게 하지 마세요
|
|
60
|
+
|
|
61
|
+
</Ko>
|
|
62
|
+
|
|
63
|
+
<Canvas of={IconStories.DoIconWithLabel} />
|
|
64
|
+
<Verdict
|
|
65
|
+
kind="do"
|
|
66
|
+
en="Next to a label the icon is decorative (aria-hidden). On its own, the IconButton carries the name (aria-label)."
|
|
67
|
+
ko="라벨 옆의 아이콘은 장식이므로 aria-hidden을 붙입니다. 아이콘만 있다면 IconButton이 이름(aria-label)을 가집니다."
|
|
68
|
+
/>
|
|
69
|
+
|
|
70
|
+
<Canvas of={IconStories.DontIconAsStatus} />
|
|
71
|
+
<Verdict
|
|
72
|
+
kind="dont"
|
|
73
|
+
en="Use a green check and a red cross as the only status. Without words the meaning rests on colour and shape alone."
|
|
74
|
+
ko="초록 체크와 빨간 X만으로 상태를 알리지 마세요. 문구가 없으면 색과 모양에만 뜻이 실립니다."
|
|
75
|
+
/>
|
|
76
|
+
|
|
77
|
+
<En>
|
|
78
|
+
|
|
79
|
+
## Content
|
|
80
|
+
|
|
81
|
+
- Use the same icon for the same action everywhere (`TrashIcon` is always
|
|
82
|
+
delete).
|
|
83
|
+
- Match the icon size to the text: `xs` beside body text and small buttons,
|
|
84
|
+
`sm`–`md` on their own.
|
|
85
|
+
|
|
86
|
+
## Accessibility
|
|
87
|
+
|
|
88
|
+
What Icon does for you:
|
|
89
|
+
|
|
90
|
+
- It renders an inline SVG in `currentColor`, so it follows the text colour
|
|
91
|
+
in light, dark and high-contrast modes.
|
|
92
|
+
|
|
93
|
+
What you still have to do:
|
|
94
|
+
|
|
95
|
+
- **Mark decorative icons `aria-hidden`.** The icon does not hide itself.
|
|
96
|
+
- **Name icon-only controls** with `aria-label` on the button (WCAG 4.1.2),
|
|
97
|
+
and keep the label the same as any visible tooltip (WCAG 2.5.3).
|
|
98
|
+
- **Icons do not replace words** (WCAG 1.4.1). A standalone icon that means
|
|
99
|
+
something needs at least 3:1 against its background (WCAG 1.4.11);
|
|
100
|
+
`fg.icon` is tuned for that.
|
|
101
|
+
|
|
102
|
+
## Tokens
|
|
103
|
+
|
|
104
|
+
The icon paints `currentColor`; these are the roles to set when you pass
|
|
105
|
+
`color`.
|
|
106
|
+
|
|
107
|
+
</En>
|
|
108
|
+
|
|
109
|
+
<Ko>
|
|
110
|
+
|
|
111
|
+
## 문구
|
|
112
|
+
|
|
113
|
+
- 같은 동작에는 어디서나 같은 아이콘을 씁니다(`TrashIcon`은 언제나 삭제).
|
|
114
|
+
- 아이콘 크기는 글자에 맞춥니다. 본문과 작은 버튼 옆에는 `xs`, 아이콘만 있을 때는
|
|
115
|
+
`sm`–`md`를 씁니다.
|
|
116
|
+
|
|
117
|
+
## 접근성
|
|
118
|
+
|
|
119
|
+
Icon이 알아서 하는 일
|
|
120
|
+
|
|
121
|
+
- `currentColor`로 칠하는 인라인 SVG라서 라이트, 다크, 고대비 모드에서 글자색을
|
|
122
|
+
따릅니다.
|
|
123
|
+
|
|
124
|
+
직접 챙겨야 하는 일
|
|
125
|
+
|
|
126
|
+
- **장식 아이콘에는 `aria-hidden`을 붙입니다.** 아이콘이 스스로 숨지 않습니다.
|
|
127
|
+
- **아이콘만 있는 컨트롤에는 버튼에 `aria-label`로 이름을 붙이고**(WCAG 4.1.2), 보이는
|
|
128
|
+
툴팁이 있다면 같은 말을 씁니다(WCAG 2.5.3).
|
|
129
|
+
- **아이콘이 문구를 대신하지 않습니다**(WCAG 1.4.1). 뜻을 가진 아이콘이 혼자 있다면
|
|
130
|
+
바탕과 3:1 이상이어야 하며(WCAG 1.4.11), `fg.icon`이 그 기준에 맞춰져 있습니다.
|
|
131
|
+
|
|
132
|
+
## 토큰
|
|
133
|
+
|
|
134
|
+
아이콘은 `currentColor`로 칠합니다. 아래는 `color`를 넘길 때 쓰는 역할입니다.
|
|
135
|
+
|
|
136
|
+
</Ko>
|
|
137
|
+
|
|
138
|
+
<Canvas of={IconStories.UsageTokens} sourceState="none" />
|
|
139
|
+
|
|
140
|
+
<En>
|
|
141
|
+
|
|
142
|
+
## Related
|
|
143
|
+
|
|
144
|
+
- **IconButton**: an icon-only control with a name.
|
|
145
|
+
- **Badge** / **Banner**: status in words, with an icon as support.
|
|
146
|
+
- `ICON_MANAGEMENT.md`: adding an icon to the set.
|
|
147
|
+
|
|
148
|
+
</En>
|
|
149
|
+
|
|
150
|
+
<Ko>
|
|
151
|
+
|
|
152
|
+
## 관련 컴포넌트
|
|
153
|
+
|
|
154
|
+
- **IconButton**: 이름이 있는 아이콘 전용 컨트롤.
|
|
155
|
+
- **Badge** / **Banner**: 아이콘이 거드는 문구 상태.
|
|
156
|
+
- `ICON_MANAGEMENT.md`: 아이콘 추가 방법.
|
|
157
|
+
|
|
158
|
+
</Ko>
|
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
|
|
3
|
-
import { Grid, HStack, Text, VStack } from '@chakra-ui/react';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { Box, Flex, Grid, HStack, Text, VStack } from '@chakra-ui/react';
|
|
4
|
+
import { T } from '../../guidelines/_components/Lang';
|
|
5
|
+
import { TokenTable } from '../../guidelines/_components/TokenTable';
|
|
6
|
+
import { Button } from '../Button';
|
|
7
|
+
import {
|
|
8
|
+
CopyIcon,
|
|
9
|
+
DownloadIcon,
|
|
10
|
+
EditIcon,
|
|
11
|
+
FaUniversity,
|
|
12
|
+
PlusIcon,
|
|
13
|
+
SendIcon,
|
|
14
|
+
ShareIcon,
|
|
15
|
+
TrashIcon,
|
|
16
|
+
} from '../Icon';
|
|
17
|
+
import { Tooltip } from '../Tooltip';
|
|
18
|
+
import { IconButton, iconButtonVariants, iconButtonVariantStyles } from '.';
|
|
6
19
|
import { IconButtonVariant } from './IconButton.types';
|
|
7
20
|
|
|
8
21
|
const meta = {
|
|
@@ -16,11 +29,13 @@ const meta = {
|
|
|
16
29
|
variant: {
|
|
17
30
|
control: 'select',
|
|
18
31
|
options: iconButtonVariants,
|
|
19
|
-
description:
|
|
32
|
+
description:
|
|
33
|
+
'Role. `ghost` (default): toolbars and row actions, glyph in `fg.icon`. `secondary`: ghost with an outline, for a control that must read as a button on its own. `primary`: black fill, the one main icon action. `danger`: red fill, confirms a destructive step. `action`: the coral send button of a chat composer.',
|
|
20
34
|
},
|
|
21
35
|
isDestructive: {
|
|
22
36
|
control: 'boolean',
|
|
23
|
-
description:
|
|
37
|
+
description:
|
|
38
|
+
'Danger-coloured glyph (`danger.fg`) on `ghost` / `secondary`, for a delete icon in a row. Ignored on filled roles.',
|
|
24
39
|
},
|
|
25
40
|
children: {
|
|
26
41
|
table: { disable: true },
|
|
@@ -121,3 +136,192 @@ export const ActionSend: Story = {
|
|
|
121
136
|
</HStack>
|
|
122
137
|
),
|
|
123
138
|
};
|
|
139
|
+
|
|
140
|
+
// ───────────────────────── Usage-page specimens ─────────────────────────
|
|
141
|
+
// Pulled into `IconButton.usage.mdx` with <Canvas of={…} />. Hidden from the
|
|
142
|
+
// sidebar (`!dev`); `tags` is written out on each story because the indexer
|
|
143
|
+
// reads CSF statically.
|
|
144
|
+
|
|
145
|
+
/** A chat message's action row: copy, edit, share, delete. */
|
|
146
|
+
export const DoGhostToolbar: Story = {
|
|
147
|
+
tags: ['!dev'],
|
|
148
|
+
parameters: { layout: 'padded' },
|
|
149
|
+
name: 'Usage / Do: ghost icon buttons in a toolbar',
|
|
150
|
+
render: () => (
|
|
151
|
+
<HStack gap={1}>
|
|
152
|
+
<Tooltip content="복사">
|
|
153
|
+
<IconButton aria-label="복사" size="sm">
|
|
154
|
+
<CopyIcon />
|
|
155
|
+
</IconButton>
|
|
156
|
+
</Tooltip>
|
|
157
|
+
<Tooltip content="수정">
|
|
158
|
+
<IconButton aria-label="수정" size="sm">
|
|
159
|
+
<EditIcon />
|
|
160
|
+
</IconButton>
|
|
161
|
+
</Tooltip>
|
|
162
|
+
<Tooltip content="공유">
|
|
163
|
+
<IconButton aria-label="공유" size="sm">
|
|
164
|
+
<ShareIcon />
|
|
165
|
+
</IconButton>
|
|
166
|
+
</Tooltip>
|
|
167
|
+
<Tooltip content="삭제">
|
|
168
|
+
<IconButton aria-label="삭제" size="sm" isDestructive>
|
|
169
|
+
<TrashIcon />
|
|
170
|
+
</IconButton>
|
|
171
|
+
</Tooltip>
|
|
172
|
+
</HStack>
|
|
173
|
+
),
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
export const DontFilledToolbar: Story = {
|
|
177
|
+
tags: ['!dev'],
|
|
178
|
+
parameters: { layout: 'padded' },
|
|
179
|
+
name: "Usage / Don't: filled icon buttons in a toolbar",
|
|
180
|
+
render: () => (
|
|
181
|
+
<HStack gap={1}>
|
|
182
|
+
<IconButton aria-label="복사" size="sm" variant="primary">
|
|
183
|
+
<CopyIcon />
|
|
184
|
+
</IconButton>
|
|
185
|
+
<IconButton aria-label="수정" size="sm" variant="primary">
|
|
186
|
+
<EditIcon />
|
|
187
|
+
</IconButton>
|
|
188
|
+
<IconButton aria-label="공유" size="sm" variant="primary">
|
|
189
|
+
<ShareIcon />
|
|
190
|
+
</IconButton>
|
|
191
|
+
<IconButton aria-label="삭제" size="sm" variant="danger">
|
|
192
|
+
<TrashIcon />
|
|
193
|
+
</IconButton>
|
|
194
|
+
</HStack>
|
|
195
|
+
),
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
/** A chat composer: the coral send button is the one run signal. */
|
|
199
|
+
export const DoActionForSend: Story = {
|
|
200
|
+
tags: ['!dev'],
|
|
201
|
+
parameters: { layout: 'padded' },
|
|
202
|
+
name: 'Usage / Do: action only for send',
|
|
203
|
+
render: () => (
|
|
204
|
+
<Flex
|
|
205
|
+
align="center"
|
|
206
|
+
gap={2}
|
|
207
|
+
maxW="420px"
|
|
208
|
+
px={4}
|
|
209
|
+
py={2}
|
|
210
|
+
borderWidth="1px"
|
|
211
|
+
borderColor="border.default"
|
|
212
|
+
borderRadius="xl"
|
|
213
|
+
bg="bg.surface"
|
|
214
|
+
>
|
|
215
|
+
<Tooltip content="파일 첨부">
|
|
216
|
+
<IconButton aria-label="파일 첨부" size="sm">
|
|
217
|
+
<PlusIcon />
|
|
218
|
+
</IconButton>
|
|
219
|
+
</Tooltip>
|
|
220
|
+
<Text flex={1} fontSize="sm" color="fg.default">
|
|
221
|
+
지난달 사용량을 요약해 줘
|
|
222
|
+
</Text>
|
|
223
|
+
<IconButton aria-label="보내기" size="sm" variant="action">
|
|
224
|
+
<SendIcon />
|
|
225
|
+
</IconButton>
|
|
226
|
+
</Flex>
|
|
227
|
+
),
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
export const DontActionForAdd: Story = {
|
|
231
|
+
tags: ['!dev'],
|
|
232
|
+
parameters: { layout: 'padded' },
|
|
233
|
+
name: "Usage / Don't: the coral action button for a non-send action",
|
|
234
|
+
render: () => (
|
|
235
|
+
<Flex align="center" justify="space-between" maxW="420px">
|
|
236
|
+
<Text fontWeight="bold" color="fg.default">
|
|
237
|
+
멤버
|
|
238
|
+
</Text>
|
|
239
|
+
<IconButton aria-label="멤버 추가" size="sm" variant="action">
|
|
240
|
+
<PlusIcon />
|
|
241
|
+
</IconButton>
|
|
242
|
+
</Flex>
|
|
243
|
+
),
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
export const DoTextWhenUnclear: Story = {
|
|
247
|
+
tags: ['!dev'],
|
|
248
|
+
parameters: { layout: 'padded' },
|
|
249
|
+
name: 'Usage / Do: a labelled Button when the icon is not obvious',
|
|
250
|
+
render: () => (
|
|
251
|
+
<Box>
|
|
252
|
+
<Button variant="secondary" size="sm">
|
|
253
|
+
<DownloadIcon />
|
|
254
|
+
사용 내역 내려받기
|
|
255
|
+
</Button>
|
|
256
|
+
</Box>
|
|
257
|
+
),
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
export const DontUnclearIcon: Story = {
|
|
261
|
+
tags: ['!dev'],
|
|
262
|
+
parameters: { layout: 'padded' },
|
|
263
|
+
name: "Usage / Don't: an icon only you can read",
|
|
264
|
+
render: () => (
|
|
265
|
+
<HStack gap={1}>
|
|
266
|
+
<IconButton aria-label="사용 내역 내려받기" variant="secondary" size="sm">
|
|
267
|
+
<FaUniversity />
|
|
268
|
+
</IconButton>
|
|
269
|
+
</HStack>
|
|
270
|
+
),
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
type StateStyles = {
|
|
274
|
+
bgColor?: unknown;
|
|
275
|
+
borderColor?: unknown;
|
|
276
|
+
color?: unknown;
|
|
277
|
+
_hover?: { bgColor?: unknown; color?: unknown };
|
|
278
|
+
_active?: { bgColor?: unknown };
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
type Use = { en: string; ko: string };
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* One row per token, listing every role and state that reads it. Read from
|
|
285
|
+
* `iconButtonVariantStyles`, so a recipe change shows up on the next build.
|
|
286
|
+
*/
|
|
287
|
+
const iconButtonTokenRows = () => {
|
|
288
|
+
const uses = new Map<string, Use[]>();
|
|
289
|
+
const add = (token: unknown, use: Use) => {
|
|
290
|
+
if (typeof token !== 'string' || token === 'transparent') return;
|
|
291
|
+
uses.set(token, [...(uses.get(token) ?? []), use]);
|
|
292
|
+
};
|
|
293
|
+
iconButtonVariants.forEach((variant) => {
|
|
294
|
+
const s = iconButtonVariantStyles[variant] as StateStyles;
|
|
295
|
+
const at = (en: string, ko: string) => ({
|
|
296
|
+
en: `${variant} ${en}`,
|
|
297
|
+
ko: `${variant} ${ko}`,
|
|
298
|
+
});
|
|
299
|
+
add(s.bgColor, at('fill', '바탕'));
|
|
300
|
+
add(s.borderColor, at('border', '테두리'));
|
|
301
|
+
add(s.color, at('icon', '아이콘'));
|
|
302
|
+
add(s._hover?.bgColor, at('hover fill', '마우스 올림 바탕'));
|
|
303
|
+
add(s._hover?.color, at('hover icon', '마우스 올림 아이콘'));
|
|
304
|
+
add(s._active?.bgColor, at('pressed fill', '누름 바탕'));
|
|
305
|
+
});
|
|
306
|
+
add('danger.fg', { en: 'isDestructive icon', ko: 'isDestructive 아이콘' });
|
|
307
|
+
add('disabled.bg', { en: 'disabled fill', ko: '비활성 바탕' });
|
|
308
|
+
add('disabled.fg', { en: 'disabled icon', ko: '비활성 아이콘' });
|
|
309
|
+
add('focus.ring', { en: 'keyboard focus ring', ko: '키보드 초점 링' });
|
|
310
|
+
return [...uses].map(([token, list]) => ({
|
|
311
|
+
token,
|
|
312
|
+
use: (
|
|
313
|
+
<T
|
|
314
|
+
en={list.map((u) => u.en).join(', ')}
|
|
315
|
+
ko={list.map((u) => u.ko).join(', ')}
|
|
316
|
+
/>
|
|
317
|
+
),
|
|
318
|
+
}));
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
/** Tokens each role reads, resolved from `IconButton.styles.ts` and the theme. */
|
|
322
|
+
export const UsageTokens: Story = {
|
|
323
|
+
tags: ['!dev'],
|
|
324
|
+
parameters: { layout: 'padded' },
|
|
325
|
+
name: 'Usage / Tokens',
|
|
326
|
+
render: () => <TokenTable rows={iconButtonTokenRows()} />,
|
|
327
|
+
};
|