@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,216 @@
|
|
|
1
|
+
import { Canvas, Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import { En, Ko, LangToggle, Verdict } from '../../guidelines/_components/Lang';
|
|
4
|
+
import * as BottomSheetStories from './BottomSheet.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={BottomSheetStories} name="Usage" />
|
|
7
|
+
|
|
8
|
+
<LangToggle />
|
|
9
|
+
|
|
10
|
+
<En>
|
|
11
|
+
|
|
12
|
+
# BottomSheet
|
|
13
|
+
|
|
14
|
+
A panel that rises from the bottom edge of a phone screen. The user can drag it
|
|
15
|
+
between snap points or swipe it away.
|
|
16
|
+
|
|
17
|
+
## When to use
|
|
18
|
+
|
|
19
|
+
- On a phone, to pick one item from a list: a node palette in the workflow
|
|
20
|
+
editor, an answer to a question the assistant asks.
|
|
21
|
+
- On a phone, for a few related choices the user applies together, such as
|
|
22
|
+
filters.
|
|
23
|
+
- Next to a canvas the user keeps working on: a non-modal sheet
|
|
24
|
+
(`modal={false}`) resting on a snap point leaves the page usable.
|
|
25
|
+
|
|
26
|
+
## When not to use
|
|
27
|
+
|
|
28
|
+
- On a desktop layout → `Modal` for a task, `Menu` or `Popover` for options
|
|
29
|
+
next to their trigger.
|
|
30
|
+
- To confirm something that cannot be undone → `Modal`. A swipe should never
|
|
31
|
+
be the only thing between the user and a deletion.
|
|
32
|
+
- For a result or status → `Toast` or `Banner`.
|
|
33
|
+
- For a long form → a page. The sheet is capped at 85% of the screen height.
|
|
34
|
+
|
|
35
|
+
## Variants and what they mean
|
|
36
|
+
|
|
37
|
+
The sheet has no visual variants. These props decide how it behaves:
|
|
38
|
+
|
|
39
|
+
</En>
|
|
40
|
+
|
|
41
|
+
<Ko>
|
|
42
|
+
|
|
43
|
+
# BottomSheet
|
|
44
|
+
|
|
45
|
+
휴대폰 화면 아래 가장자리에서 올라오는 패널입니다. 사용자가 끌어서 멈춤 지점 사이를
|
|
46
|
+
오가거나 쓸어내려 닫을 수 있습니다.
|
|
47
|
+
|
|
48
|
+
## 언제 쓰나요
|
|
49
|
+
|
|
50
|
+
- 휴대폰에서 목록 중 하나를 고르게 할 때: 워크플로 편집기의 노드 팔레트, 어시스턴트가
|
|
51
|
+
묻는 질문의 답.
|
|
52
|
+
- 휴대폰에서 함께 적용하는 몇 가지 선택지를 보일 때: 필터.
|
|
53
|
+
- 사용자가 계속 작업하는 캔버스 옆에 둘 때: 멈춤 지점에 걸쳐 둔 비모달 시트
|
|
54
|
+
(`modal={false}`)는 뒤의 페이지를 그대로 쓸 수 있게 둡니다.
|
|
55
|
+
|
|
56
|
+
## 언제 쓰지 않나요
|
|
57
|
+
|
|
58
|
+
- 데스크톱 화면에서는 작업에 `Modal`을, 버튼 옆 선택지에 `Menu`나 `Popover`를 씁니다.
|
|
59
|
+
- 되돌릴 수 없는 동작의 확인은 `Modal`로 받습니다. 쓸어내리는 동작 하나만으로 삭제가
|
|
60
|
+
일어나서는 안 됩니다.
|
|
61
|
+
- 결과나 상태는 `Toast`나 `Banner`로 알립니다.
|
|
62
|
+
- 긴 양식은 페이지에 둡니다. 시트 높이는 화면의 85%까지만 늘어납니다.
|
|
63
|
+
|
|
64
|
+
## 변형과 뜻
|
|
65
|
+
|
|
66
|
+
시트에는 모양 변형이 없습니다. 동작을 정하는 속성은 다음과 같습니다.
|
|
67
|
+
|
|
68
|
+
</Ko>
|
|
69
|
+
|
|
70
|
+
<En>
|
|
71
|
+
|
|
72
|
+
| Prop | Effect | Use for |
|
|
73
|
+
| --- | --- | --- |
|
|
74
|
+
| `modal` (default `true`) | Scrim, focus trap and scroll lock. | Most sheets: a pick or a set of choices. |
|
|
75
|
+
| `modal={false}` | No scrim, no focus trap, no scroll lock; the page behind stays usable. | A palette beside a canvas, usually with `snapPoints`. |
|
|
76
|
+
| `snapPoints` / `defaultSnapPoint` | Heights the sheet rests at. Numbers up to 1 are fractions of the viewport (`[0.4, 1]`); strings take `px` or `rem`. | A sheet that opens half-way and expands. |
|
|
77
|
+
| `BottomSheetContent showGrabber` (default `true`) | Draws the drag handle. | Leave it on; turn it off only when the sheet cannot be dragged. |
|
|
78
|
+
|
|
79
|
+
## Do / Don't
|
|
80
|
+
|
|
81
|
+
</En>
|
|
82
|
+
|
|
83
|
+
<Ko>
|
|
84
|
+
|
|
85
|
+
| 속성 | 효과 | 쓰는 곳 |
|
|
86
|
+
| --- | --- | --- |
|
|
87
|
+
| `modal` (기본 `true`) | 배경 막, 초점 가두기, 스크롤 잠금. | 대부분의 시트: 하나 고르기, 선택지 묶음. |
|
|
88
|
+
| `modal={false}` | 배경 막, 초점 가두기, 스크롤 잠금이 모두 없어 뒤의 페이지를 쓸 수 있습니다. | 캔버스 옆의 팔레트. 보통 `snapPoints`와 함께 씁니다. |
|
|
89
|
+
| `snapPoints` / `defaultSnapPoint` | 시트가 멈추는 높이. 1 이하의 숫자는 화면 높이의 비율(`[0.4, 1]`)이고, 문자열은 `px`나 `rem` 값입니다. | 반쯤 열렸다가 더 펼치는 시트. |
|
|
90
|
+
| `BottomSheetContent`의 `showGrabber` (기본 `true`) | 끌기 손잡이를 그립니다. | 켜 둡니다. 시트를 끌 수 없을 때만 끕니다. |
|
|
91
|
+
|
|
92
|
+
## 이렇게 하세요 / 이렇게 하지 마세요
|
|
93
|
+
|
|
94
|
+
</Ko>
|
|
95
|
+
|
|
96
|
+
<Canvas of={BottomSheetStories.DoPickFromList} />
|
|
97
|
+
<Verdict
|
|
98
|
+
kind="do"
|
|
99
|
+
en="Give the sheet a header and a close button, and keep each row a single button."
|
|
100
|
+
ko="시트에 헤더와 닫기 버튼을 두고, 목록의 한 줄은 버튼 하나로 만듭니다."
|
|
101
|
+
/>
|
|
102
|
+
|
|
103
|
+
<Canvas of={BottomSheetStories.DontNoHeader} />
|
|
104
|
+
<Verdict
|
|
105
|
+
kind="dont"
|
|
106
|
+
en="Leave out the header. The header is the sheet's accessible name; without it a screen reader announces an unnamed dialog, and nobody sees what the list is for."
|
|
107
|
+
ko="헤더를 빼지 마세요. 헤더가 시트의 접근 가능한 이름입니다. 헤더가 없으면 화면 낭독기는 이름 없는 대화상자로 읽고, 보는 사람도 목록이 무엇인지 알 수 없습니다."
|
|
108
|
+
/>
|
|
109
|
+
|
|
110
|
+
<Canvas of={BottomSheetStories.DoFooterToApply} />
|
|
111
|
+
<Verdict
|
|
112
|
+
kind="do"
|
|
113
|
+
en="Add BottomSheetFooter only when the choices apply together. For a single pick, the row itself is the action."
|
|
114
|
+
ko="선택지를 한꺼번에 적용할 때만 BottomSheetFooter를 둡니다. 하나만 고르는 시트에서는 줄을 누르는 것이 곧 동작입니다."
|
|
115
|
+
/>
|
|
116
|
+
|
|
117
|
+
<En>
|
|
118
|
+
|
|
119
|
+
## Content
|
|
120
|
+
|
|
121
|
+
- **Header:** a noun or a short task name, no full stop: "노드 추가", "필터".
|
|
122
|
+
- **Rows:** a label and, if needed, one line of hint in `fg.muted`.
|
|
123
|
+
- **Footer buttons:** verbs ("적용", "초기화"), at most two.
|
|
124
|
+
|
|
125
|
+
## Accessibility
|
|
126
|
+
|
|
127
|
+
What BottomSheet does for you:
|
|
128
|
+
|
|
129
|
+
- `BottomSheetHeader` becomes the sheet's title, which the content's
|
|
130
|
+
`aria-labelledby` points at (WCAG 4.1.2).
|
|
131
|
+
- When modal, it traps focus in the sheet and locks the page's scroll.
|
|
132
|
+
`Escape` closes it (WCAG 2.1.1).
|
|
133
|
+
- `BottomSheetCloseButton` carries a translated `aria-label` (닫기 / Close).
|
|
134
|
+
- The grabber is `aria-hidden`: it is a pointer affordance, and dragging is
|
|
135
|
+
never the only way to close the sheet (WCAG 2.5.1).
|
|
136
|
+
- `BottomSheetBody` scrolls inside the sheet; a drag starts from the body only
|
|
137
|
+
when the list is scrolled to the top, so scrolling never drags the sheet.
|
|
138
|
+
|
|
139
|
+
What you still have to do:
|
|
140
|
+
|
|
141
|
+
- **Always render `BottomSheetHeader`.** Without it the sheet has no name.
|
|
142
|
+
- **Keep a close button or a footer action.** A swipe or an outside tap is not
|
|
143
|
+
available to keyboard and switch users.
|
|
144
|
+
- Put `BottomSheetCloseButton` directly inside `BottomSheetContent`, next to
|
|
145
|
+
the header, not inside it.
|
|
146
|
+
- A non-modal sheet does not trap focus: `Tab` can leave it for the page
|
|
147
|
+
behind. Check that the tab order between the two still makes sense.
|
|
148
|
+
|
|
149
|
+
## Tokens
|
|
150
|
+
|
|
151
|
+
The table is generated from `bottomSheetSlotRecipe` in `BottomSheet.styles.ts`.
|
|
152
|
+
The scrim is `blackAlpha.500`, a fixed value rather than a semantic token.
|
|
153
|
+
|
|
154
|
+
</En>
|
|
155
|
+
|
|
156
|
+
<Ko>
|
|
157
|
+
|
|
158
|
+
## 문구
|
|
159
|
+
|
|
160
|
+
- **헤더:** 명사나 짧은 작업 이름을 쓰고 마침표를 찍지 않습니다. "노드 추가", "필터".
|
|
161
|
+
- **목록 한 줄:** 라벨 하나와, 필요하면 `fg.muted`로 쓴 도움말 한 줄.
|
|
162
|
+
- **푸터 버튼:** 동사("적용", "초기화")로 두 개까지 씁니다.
|
|
163
|
+
|
|
164
|
+
## 접근성
|
|
165
|
+
|
|
166
|
+
BottomSheet가 알아서 하는 일
|
|
167
|
+
|
|
168
|
+
- `BottomSheetHeader`가 시트의 제목이 되고, 콘텐츠의 `aria-labelledby`가 이 제목을
|
|
169
|
+
가리킵니다(WCAG 4.1.2).
|
|
170
|
+
- 모달일 때는 초점을 시트 안에 가두고 페이지 스크롤을 막습니다. `Escape`로 닫힙니다
|
|
171
|
+
(WCAG 2.1.1).
|
|
172
|
+
- `BottomSheetCloseButton`에는 번역된 `aria-label`(닫기 / Close)이 붙어 있습니다.
|
|
173
|
+
- 손잡이는 `aria-hidden`입니다. 포인터용 표시일 뿐이고, 끌기만이 시트를 닫는 유일한
|
|
174
|
+
방법이 되지 않습니다(WCAG 2.5.1).
|
|
175
|
+
- `BottomSheetBody`는 시트 안에서 스크롤됩니다. 목록이 맨 위에 있을 때만 본문에서 끌기가
|
|
176
|
+
시작되므로, 목록을 스크롤하다가 시트가 끌려 내려가지 않습니다.
|
|
177
|
+
|
|
178
|
+
직접 챙겨야 하는 일
|
|
179
|
+
|
|
180
|
+
- **`BottomSheetHeader`를 언제나 둡니다.** 헤더가 없으면 시트에 이름이 없습니다.
|
|
181
|
+
- **닫기 버튼이나 푸터 동작을 남깁니다.** 쓸어내리기나 바깥 누르기는 키보드나 스위치
|
|
182
|
+
사용자가 쓸 수 없습니다.
|
|
183
|
+
- `BottomSheetCloseButton`은 헤더 안이 아니라 헤더 옆, `BottomSheetContent`의 바로
|
|
184
|
+
아래에 둡니다.
|
|
185
|
+
- 비모달 시트는 초점을 가두지 않으므로 `Tab`으로 뒤의 페이지로 나갈 수 있습니다. 시트와
|
|
186
|
+
페이지 사이의 탭 순서가 자연스러운지 확인합니다.
|
|
187
|
+
|
|
188
|
+
## 토큰
|
|
189
|
+
|
|
190
|
+
아래 표는 `BottomSheet.styles.ts`의 `bottomSheetSlotRecipe`에서 자동으로 만듭니다. 배경
|
|
191
|
+
막은 의미 토큰이 아니라 고정값 `blackAlpha.500`입니다.
|
|
192
|
+
|
|
193
|
+
</Ko>
|
|
194
|
+
|
|
195
|
+
<Canvas of={BottomSheetStories.UsageTokens} sourceState="none" />
|
|
196
|
+
|
|
197
|
+
<En>
|
|
198
|
+
|
|
199
|
+
## Related
|
|
200
|
+
|
|
201
|
+
- **Modal**: the same job on a wide screen, and every destructive confirmation.
|
|
202
|
+
- **Menu**: a short list of actions next to its trigger.
|
|
203
|
+
- **Popover**: a small panel of controls anchored to its trigger.
|
|
204
|
+
|
|
205
|
+
</En>
|
|
206
|
+
|
|
207
|
+
<Ko>
|
|
208
|
+
|
|
209
|
+
## 관련 컴포넌트
|
|
210
|
+
|
|
211
|
+
- **Modal**: 넓은 화면에서 같은 일을 하며, 되돌릴 수 없는 동작의 확인은 모두 Modal로
|
|
212
|
+
받습니다.
|
|
213
|
+
- **Menu**: 버튼 옆에 여는 짧은 동작 목록.
|
|
214
|
+
- **Popover**: 버튼에 붙어 열리는 작은 컨트롤 패널.
|
|
215
|
+
|
|
216
|
+
</Ko>
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Stack, Text } from '@chakra-ui/react';
|
|
2
2
|
import { Meta, StoryObj } from '@storybook/react';
|
|
3
3
|
|
|
4
|
+
import { T } from '../../guidelines/_components/Lang';
|
|
5
|
+
import { TokenTable } from '../../guidelines/_components/TokenTable';
|
|
6
|
+
|
|
4
7
|
import { Breadcrumb } from './Breadcrumb';
|
|
5
8
|
import { BreadcrumbItem } from './BreadcrumbItem';
|
|
6
9
|
import { BreadcrumbLink } from './BreadcrumbLink';
|
|
@@ -74,3 +77,59 @@ export const CustomSeparator: Story = {
|
|
|
74
77
|
</Stack>
|
|
75
78
|
),
|
|
76
79
|
};
|
|
80
|
+
|
|
81
|
+
// ───────────────────────── Usage-page specimens ─────────────────────────
|
|
82
|
+
// Pulled into `Breadcrumb.usage.mdx` with <Canvas of={…} />. Hidden from the
|
|
83
|
+
// sidebar (`!dev`).
|
|
84
|
+
|
|
85
|
+
export const DoCurrentPageIsText: Story = {
|
|
86
|
+
tags: ['!dev'],
|
|
87
|
+
parameters: { layout: 'padded' },
|
|
88
|
+
name: 'Usage / Do: ancestors are links, the current page is text',
|
|
89
|
+
render: () => (
|
|
90
|
+
<Breadcrumb aria-label="현재 위치">
|
|
91
|
+
<BreadcrumbItem>
|
|
92
|
+
<BreadcrumbLink href="#">전체 조직</BreadcrumbLink>
|
|
93
|
+
</BreadcrumbItem>
|
|
94
|
+
<BreadcrumbItem>
|
|
95
|
+
<BreadcrumbLink href="#">영업본부</BreadcrumbLink>
|
|
96
|
+
</BreadcrumbItem>
|
|
97
|
+
<BreadcrumbItem>
|
|
98
|
+
<Text as="span" aria-current="page" fontWeight="semibold">
|
|
99
|
+
영업 1팀
|
|
100
|
+
</Text>
|
|
101
|
+
</BreadcrumbItem>
|
|
102
|
+
</Breadcrumb>
|
|
103
|
+
),
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const DontEveryCrumbALink: Story = {
|
|
107
|
+
tags: ['!dev'],
|
|
108
|
+
parameters: { layout: 'padded' },
|
|
109
|
+
name: "Usage / Don't: the current page as a link to itself",
|
|
110
|
+
render: () => (
|
|
111
|
+
<Breadcrumb>
|
|
112
|
+
<BreadcrumbItem>
|
|
113
|
+
<BreadcrumbLink href="#">전체 조직</BreadcrumbLink>
|
|
114
|
+
</BreadcrumbItem>
|
|
115
|
+
<BreadcrumbItem>
|
|
116
|
+
<BreadcrumbLink href="#">영업본부</BreadcrumbLink>
|
|
117
|
+
</BreadcrumbItem>
|
|
118
|
+
<BreadcrumbItem>
|
|
119
|
+
<BreadcrumbLink href="#">영업 1팀</BreadcrumbLink>
|
|
120
|
+
</BreadcrumbItem>
|
|
121
|
+
</Breadcrumb>
|
|
122
|
+
),
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
/** Tokens the trail reads, as set in `BreadcrumbLink.tsx`. */
|
|
126
|
+
export const UsageTokens: Story = {
|
|
127
|
+
tags: ['!dev'],
|
|
128
|
+
parameters: { layout: 'padded' },
|
|
129
|
+
name: 'Usage / Tokens',
|
|
130
|
+
render: () => (
|
|
131
|
+
<TokenTable
|
|
132
|
+
rows={[{ token: 'fg.default', use: <T en="Link" ko="링크" /> }]}
|
|
133
|
+
/>
|
|
134
|
+
),
|
|
135
|
+
};
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { ArgTypes, Canvas, Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import { En, Ko, LangToggle, Verdict } from '../../guidelines/_components/Lang';
|
|
4
|
+
import * as BreadcrumbStories from './Breadcrumb.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={BreadcrumbStories} name="Usage" />
|
|
7
|
+
|
|
8
|
+
<LangToggle />
|
|
9
|
+
|
|
10
|
+
<En>
|
|
11
|
+
|
|
12
|
+
# Breadcrumb
|
|
13
|
+
|
|
14
|
+
A trail of links that shows where the current page sits in a hierarchy and
|
|
15
|
+
lets the user go back up it.
|
|
16
|
+
|
|
17
|
+
## When to use
|
|
18
|
+
|
|
19
|
+
- In a hierarchy more than two levels deep: a group inside a group inside the
|
|
20
|
+
organisation, a folder in a file picker.
|
|
21
|
+
- At the top of a course or a detail view, to lead back to the level above.
|
|
22
|
+
|
|
23
|
+
## When not to use
|
|
24
|
+
|
|
25
|
+
- For a flat app section with one level → the page title is enough.
|
|
26
|
+
- For the user's history ("where I was before") → the browser's back button.
|
|
27
|
+
A breadcrumb shows the hierarchy, not the path taken.
|
|
28
|
+
- To switch between siblings of the same level → `Tabs` or a navigation list.
|
|
29
|
+
- For the steps of a flow → a stepper.
|
|
30
|
+
|
|
31
|
+
## Variants and what they mean
|
|
32
|
+
|
|
33
|
+
Breadcrumb has no visual variants. `separator` (default `›`) and
|
|
34
|
+
`separatorGap` (default `2`) set the mark between items and the space around
|
|
35
|
+
it.
|
|
36
|
+
|
|
37
|
+
</En>
|
|
38
|
+
|
|
39
|
+
<Ko>
|
|
40
|
+
|
|
41
|
+
# Breadcrumb
|
|
42
|
+
|
|
43
|
+
지금 페이지가 계층의 어디에 있는지 보이고, 위 단계로 돌아갈 수 있게 하는 링크
|
|
44
|
+
경로입니다.
|
|
45
|
+
|
|
46
|
+
## 언제 쓰나요
|
|
47
|
+
|
|
48
|
+
- 두 단계보다 깊은 계층에서: 조직 안의 그룹 안의 그룹, 파일 선택기의 폴더.
|
|
49
|
+
- 강의나 상세 화면 맨 위에서 한 단계 위로 돌아가는 길을 보일 때.
|
|
50
|
+
|
|
51
|
+
## 언제 쓰지 않나요
|
|
52
|
+
|
|
53
|
+
- 한 단계뿐인 평평한 화면에서는 페이지 제목으로 충분합니다.
|
|
54
|
+
- 사용자가 지나온 기록("방금 있던 곳")은 브라우저의 뒤로 가기가 맡습니다. Breadcrumb는
|
|
55
|
+
거쳐 온 길이 아니라 계층을 보입니다.
|
|
56
|
+
- 같은 단계의 형제 사이를 오가는 것은 `Tabs`나 내비게이션 목록을 씁니다.
|
|
57
|
+
- 흐름의 단계는 단계 표시를 씁니다.
|
|
58
|
+
|
|
59
|
+
## 변형과 뜻
|
|
60
|
+
|
|
61
|
+
Breadcrumb에는 모양 변형이 없습니다. `separator`(기본 `›`)와 `separatorGap`(기본
|
|
62
|
+
`2`)으로 항목 사이의 표시와 간격을 정합니다.
|
|
63
|
+
|
|
64
|
+
</Ko>
|
|
65
|
+
|
|
66
|
+
<ArgTypes of={BreadcrumbStories} include={['separator', 'separatorGap']} />
|
|
67
|
+
|
|
68
|
+
<En>
|
|
69
|
+
|
|
70
|
+
## Do / Don't
|
|
71
|
+
|
|
72
|
+
</En>
|
|
73
|
+
|
|
74
|
+
<Ko>
|
|
75
|
+
|
|
76
|
+
## 이렇게 하세요 / 이렇게 하지 마세요
|
|
77
|
+
|
|
78
|
+
</Ko>
|
|
79
|
+
|
|
80
|
+
<Canvas of={BreadcrumbStories.DoCurrentPageIsText} />
|
|
81
|
+
<Verdict
|
|
82
|
+
kind="do"
|
|
83
|
+
en="Link the ancestors and render the current page as text with aria-current='page'. Name the trail in the user's language."
|
|
84
|
+
ko="위 단계는 링크로, 지금 페이지는 aria-current='page'를 단 글자로 둡니다. 경로의 이름은 사용자의 언어로 붙입니다."
|
|
85
|
+
/>
|
|
86
|
+
|
|
87
|
+
<Canvas of={BreadcrumbStories.DontEveryCrumbALink} />
|
|
88
|
+
<Verdict
|
|
89
|
+
kind="dont"
|
|
90
|
+
en="Make the current page a link to itself. It looks clickable, does nothing, and a screen reader cannot tell which crumb is the current page."
|
|
91
|
+
ko="지금 페이지를 자기 자신으로 가는 링크로 만들지 마세요. 누를 수 있어 보이지만 아무 일도 하지 않고, 화면 낭독기는 어느 항목이 지금 페이지인지 알 수 없습니다."
|
|
92
|
+
/>
|
|
93
|
+
|
|
94
|
+
<En>
|
|
95
|
+
|
|
96
|
+
## Content
|
|
97
|
+
|
|
98
|
+
- Each crumb is the title of that level, exactly as the page itself shows it.
|
|
99
|
+
- Leave out the app's home if every page starts there.
|
|
100
|
+
- In a very deep tree, keep the root and the last two or three levels and
|
|
101
|
+
collapse the middle.
|
|
102
|
+
|
|
103
|
+
## Accessibility
|
|
104
|
+
|
|
105
|
+
What Breadcrumb does for you:
|
|
106
|
+
|
|
107
|
+
- Renders a `<nav>` with an ordered list, so the trail is a landmark and its
|
|
108
|
+
length is announced.
|
|
109
|
+
- Separators are `aria-hidden`; a screen reader reads only the crumbs.
|
|
110
|
+
- `BreadcrumbLink` shows the focus ring (WCAG 2.4.7). It renders through
|
|
111
|
+
`next/link` when Next.js is installed.
|
|
112
|
+
|
|
113
|
+
What you still have to do:
|
|
114
|
+
|
|
115
|
+
- **Name the landmark in the user's language.** Chakra's default `aria-label`
|
|
116
|
+
is the English "breadcrumb". Pass `aria-label="현재 위치"` or a translation
|
|
117
|
+
(WCAG 2.4.6).
|
|
118
|
+
- **Mark the current page.** Render it as text with `aria-current="page"`, not
|
|
119
|
+
as a `BreadcrumbLink`.
|
|
120
|
+
- Truncated crumbs need their full text available, for example as the link's
|
|
121
|
+
visible text with CSS truncation and a `Tooltip`.
|
|
122
|
+
|
|
123
|
+
## Tokens
|
|
124
|
+
|
|
125
|
+
The table lists the tokens set in `BreadcrumbLink.tsx`. The separator colour
|
|
126
|
+
comes from Chakra's Breadcrumb recipe.
|
|
127
|
+
|
|
128
|
+
</En>
|
|
129
|
+
|
|
130
|
+
<Ko>
|
|
131
|
+
|
|
132
|
+
## 문구
|
|
133
|
+
|
|
134
|
+
- 각 항목은 그 단계의 페이지 제목을 화면에 보이는 그대로 씁니다.
|
|
135
|
+
- 모든 페이지가 같은 홈에서 시작한다면 홈은 뺍니다.
|
|
136
|
+
- 아주 깊은 트리에서는 맨 위와 마지막 두세 단계만 두고 가운데는 접습니다.
|
|
137
|
+
|
|
138
|
+
## 접근성
|
|
139
|
+
|
|
140
|
+
Breadcrumb가 알아서 하는 일
|
|
141
|
+
|
|
142
|
+
- `<nav>`와 순서 있는 목록으로 그려지므로 경로가 랜드마크가 되고 항목 수가 읽힙니다.
|
|
143
|
+
- 구분 표시는 `aria-hidden`이라 화면 낭독기는 항목만 읽습니다.
|
|
144
|
+
- `BreadcrumbLink`에는 초점 테두리가 보입니다(WCAG 2.4.7). Next.js가 설치되어 있으면
|
|
145
|
+
`next/link`로 그립니다.
|
|
146
|
+
|
|
147
|
+
직접 챙겨야 하는 일
|
|
148
|
+
|
|
149
|
+
- **랜드마크 이름을 사용자의 언어로 붙입니다.** Chakra의 기본 `aria-label`은 영어
|
|
150
|
+
"breadcrumb"입니다. `aria-label="현재 위치"`나 번역 문자열을 넘깁니다(WCAG 2.4.6).
|
|
151
|
+
- **지금 페이지를 표시합니다.** `BreadcrumbLink`가 아니라 `aria-current="page"`를 단
|
|
152
|
+
글자로 그립니다.
|
|
153
|
+
- 잘린 항목은 전체 문구를 볼 방법이 있어야 합니다. 예를 들어 링크 글자는 CSS로 자르고
|
|
154
|
+
`Tooltip`으로 전체를 보입니다.
|
|
155
|
+
|
|
156
|
+
## 토큰
|
|
157
|
+
|
|
158
|
+
아래 표는 `BreadcrumbLink.tsx`에서 정한 토큰입니다. 구분 표시의 색은 Chakra Breadcrumb
|
|
159
|
+
레시피에서 옵니다.
|
|
160
|
+
|
|
161
|
+
</Ko>
|
|
162
|
+
|
|
163
|
+
<Canvas of={BreadcrumbStories.UsageTokens} sourceState="none" />
|
|
164
|
+
|
|
165
|
+
<En>
|
|
166
|
+
|
|
167
|
+
## Related
|
|
168
|
+
|
|
169
|
+
- **Tabs**: siblings of the same level.
|
|
170
|
+
- **Menu**: the collapsed middle of a long trail.
|
|
171
|
+
|
|
172
|
+
</En>
|
|
173
|
+
|
|
174
|
+
<Ko>
|
|
175
|
+
|
|
176
|
+
## 관련 컴포넌트
|
|
177
|
+
|
|
178
|
+
- **Tabs**: 같은 단계의 형제 사이 이동.
|
|
179
|
+
- **Menu**: 긴 경로의 접힌 가운데 부분.
|
|
180
|
+
|
|
181
|
+
</Ko>
|