@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
|
@@ -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>
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
1
2
|
import { Box, Flex, Grid, HStack, Text, VStack } from '@chakra-ui/react';
|
|
2
3
|
import { Meta, StoryObj } from '@storybook/react';
|
|
3
4
|
|
|
5
|
+
import { T } from '../../guidelines/_components/Lang';
|
|
6
|
+
import { TokenTable } from '../../guidelines/_components/TokenTable';
|
|
7
|
+
import { Card } from '../Card';
|
|
4
8
|
import { Sparkles, TrashIcon } from '../Icon';
|
|
5
|
-
import { Button, buttonVariants } from '.';
|
|
9
|
+
import { Button, buttonVariants, buttonVariantStyles } from '.';
|
|
6
10
|
import { ButtonVariant } from './Button.types';
|
|
7
11
|
|
|
8
12
|
const meta = {
|
|
@@ -12,11 +16,13 @@ const meta = {
|
|
|
12
16
|
variant: {
|
|
13
17
|
control: 'select',
|
|
14
18
|
options: buttonVariants,
|
|
15
|
-
description:
|
|
19
|
+
description:
|
|
20
|
+
'Role (fill, border and text together). `primary`: the one main action of a screen. `action`: run — black fill, coral icon. `accent`: the coloured CTA of a landing page or hero, one per view. `secondary`: an alternative or a way out. `subtle` (default): low emphasis with a shape. `ghost`: toolbars and inline actions. `danger`: confirms a destructive step.',
|
|
16
21
|
},
|
|
17
22
|
isDestructive: {
|
|
18
23
|
control: 'boolean',
|
|
19
|
-
description:
|
|
24
|
+
description:
|
|
25
|
+
'Danger-coloured label (`danger.fg`) on `secondary` / `subtle` / `ghost` for a destructive action that does not deserve a red fill. Ignored on filled roles.',
|
|
20
26
|
},
|
|
21
27
|
},
|
|
22
28
|
} satisfies Meta<typeof Button>;
|
|
@@ -257,3 +263,257 @@ export const AsLink: Story = {
|
|
|
257
263
|
</Flex>
|
|
258
264
|
),
|
|
259
265
|
};
|
|
266
|
+
|
|
267
|
+
// ───────────────────────── Usage-page specimens ─────────────────────────
|
|
268
|
+
// Pulled into `Button.usage.mdx` with <Canvas of={…} />. Hidden from the
|
|
269
|
+
// sidebar (`!dev`); being stories, they type-check with the rest of the code.
|
|
270
|
+
// `tags` is written out on each story: the indexer reads CSF statically.
|
|
271
|
+
|
|
272
|
+
/** A dialog-like panel: title, one line of body, a right-aligned footer. */
|
|
273
|
+
const Panel = ({
|
|
274
|
+
title,
|
|
275
|
+
body,
|
|
276
|
+
children,
|
|
277
|
+
}: {
|
|
278
|
+
title: string;
|
|
279
|
+
body: string;
|
|
280
|
+
children: ReactNode;
|
|
281
|
+
}) => (
|
|
282
|
+
<Card p={5} maxW="420px" bg="bg.surface">
|
|
283
|
+
<Text fontWeight="bold" mb={1} color="fg.default">
|
|
284
|
+
{title}
|
|
285
|
+
</Text>
|
|
286
|
+
<Text fontSize="sm" color="fg.muted" mb={5}>
|
|
287
|
+
{body}
|
|
288
|
+
</Text>
|
|
289
|
+
<Flex gap={2} justify="flex-end">
|
|
290
|
+
{children}
|
|
291
|
+
</Flex>
|
|
292
|
+
</Card>
|
|
293
|
+
);
|
|
294
|
+
|
|
295
|
+
export const DoOnePrimary: Story = {
|
|
296
|
+
tags: ['!dev'],
|
|
297
|
+
parameters: { layout: 'padded' },
|
|
298
|
+
name: 'Usage / Do: one primary, secondary to its left',
|
|
299
|
+
render: () => (
|
|
300
|
+
<Panel title="그룹 이름 변경" body="변경한 이름은 모든 멤버에게 보입니다.">
|
|
301
|
+
<Button variant="secondary">취소</Button>
|
|
302
|
+
<Button variant="primary">저장</Button>
|
|
303
|
+
</Panel>
|
|
304
|
+
),
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
export const DontTwoPrimaries: Story = {
|
|
308
|
+
tags: ['!dev'],
|
|
309
|
+
parameters: { layout: 'padded' },
|
|
310
|
+
name: "Usage / Don't: two primaries side by side",
|
|
311
|
+
render: () => (
|
|
312
|
+
<Panel title="그룹 이름 변경" body="변경한 이름은 모든 멤버에게 보입니다.">
|
|
313
|
+
<Button variant="primary">취소</Button>
|
|
314
|
+
<Button variant="primary">저장</Button>
|
|
315
|
+
</Panel>
|
|
316
|
+
),
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
export const DoDangerToConfirm: Story = {
|
|
320
|
+
tags: ['!dev'],
|
|
321
|
+
parameters: { layout: 'padded' },
|
|
322
|
+
name: 'Usage / Do: danger fill only on the confirming button',
|
|
323
|
+
render: () => (
|
|
324
|
+
<Panel
|
|
325
|
+
title="챗봇을 삭제할까요?"
|
|
326
|
+
body="삭제한 챗봇과 대화 기록은 되돌릴 수 없습니다."
|
|
327
|
+
>
|
|
328
|
+
<Button variant="secondary">취소</Button>
|
|
329
|
+
<Button variant="danger">삭제</Button>
|
|
330
|
+
</Panel>
|
|
331
|
+
),
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
const ROWS = ['마케팅 챗봇', '영업 챗봇', '사내 규정 챗봇'];
|
|
335
|
+
|
|
336
|
+
const Row = ({ name, action }: { name: string; action: ReactNode }) => (
|
|
337
|
+
<Flex
|
|
338
|
+
justify="space-between"
|
|
339
|
+
align="center"
|
|
340
|
+
py={2}
|
|
341
|
+
borderBottomWidth="1px"
|
|
342
|
+
borderColor="border.subtle"
|
|
343
|
+
>
|
|
344
|
+
<Text fontSize="sm" color="fg.default">
|
|
345
|
+
{name}
|
|
346
|
+
</Text>
|
|
347
|
+
{action}
|
|
348
|
+
</Flex>
|
|
349
|
+
);
|
|
350
|
+
|
|
351
|
+
export const DoQuietDestructiveInRows: Story = {
|
|
352
|
+
tags: ['!dev'],
|
|
353
|
+
parameters: { layout: 'padded' },
|
|
354
|
+
name: 'Usage / Do: isDestructive on a quiet button in a list',
|
|
355
|
+
render: () => (
|
|
356
|
+
<Box maxW="420px">
|
|
357
|
+
{ROWS.map((name) => (
|
|
358
|
+
<Row
|
|
359
|
+
key={name}
|
|
360
|
+
name={name}
|
|
361
|
+
action={
|
|
362
|
+
<Button variant="ghost" size="sm" isDestructive>
|
|
363
|
+
<TrashIcon />
|
|
364
|
+
삭제
|
|
365
|
+
</Button>
|
|
366
|
+
}
|
|
367
|
+
/>
|
|
368
|
+
))}
|
|
369
|
+
</Box>
|
|
370
|
+
),
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
export const DontDangerFillInRows: Story = {
|
|
374
|
+
tags: ['!dev'],
|
|
375
|
+
parameters: { layout: 'padded' },
|
|
376
|
+
name: "Usage / Don't: a red fill on every row",
|
|
377
|
+
render: () => (
|
|
378
|
+
<Box maxW="420px">
|
|
379
|
+
{ROWS.map((name) => (
|
|
380
|
+
<Row
|
|
381
|
+
key={name}
|
|
382
|
+
name={name}
|
|
383
|
+
action={
|
|
384
|
+
<Button variant="danger" size="sm">
|
|
385
|
+
삭제
|
|
386
|
+
</Button>
|
|
387
|
+
}
|
|
388
|
+
/>
|
|
389
|
+
))}
|
|
390
|
+
</Box>
|
|
391
|
+
),
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
export const DoPrimaryForUpgrade: Story = {
|
|
395
|
+
tags: ['!dev'],
|
|
396
|
+
parameters: { layout: 'padded' },
|
|
397
|
+
name: 'Usage / Do: primary for upgrade and payment',
|
|
398
|
+
render: () => (
|
|
399
|
+
<Panel
|
|
400
|
+
title="크레딧이 부족합니다"
|
|
401
|
+
body="요금제를 올리면 이번 달 남은 기간에도 바로 쓸 수 있습니다."
|
|
402
|
+
>
|
|
403
|
+
<Button variant="secondary">나중에</Button>
|
|
404
|
+
<Button variant="primary">요금제 업그레이드</Button>
|
|
405
|
+
</Panel>
|
|
406
|
+
),
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
export const DontAccentForUpgrade: Story = {
|
|
410
|
+
tags: ['!dev'],
|
|
411
|
+
parameters: { layout: 'padded' },
|
|
412
|
+
name: "Usage / Don't: coral accent for upgrade in the product",
|
|
413
|
+
render: () => (
|
|
414
|
+
<Panel
|
|
415
|
+
title="크레딧이 부족합니다"
|
|
416
|
+
body="요금제를 올리면 이번 달 남은 기간에도 바로 쓸 수 있습니다."
|
|
417
|
+
>
|
|
418
|
+
<Button variant="secondary">나중에</Button>
|
|
419
|
+
<Button variant="accent">요금제 업그레이드</Button>
|
|
420
|
+
</Panel>
|
|
421
|
+
),
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
export const DoLoadingText: Story = {
|
|
425
|
+
tags: ['!dev'],
|
|
426
|
+
parameters: { layout: 'padded' },
|
|
427
|
+
name: 'Usage / Do: loadingText while the action runs',
|
|
428
|
+
render: () => (
|
|
429
|
+
<HStack gap={4}>
|
|
430
|
+
<Button variant="primary" loading loadingText="저장 중">
|
|
431
|
+
저장
|
|
432
|
+
</Button>
|
|
433
|
+
<Button variant="action" loading loadingText="실행 중">
|
|
434
|
+
<Sparkles />
|
|
435
|
+
실행
|
|
436
|
+
</Button>
|
|
437
|
+
</HStack>
|
|
438
|
+
),
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
export const DontSpinnerOnly: Story = {
|
|
442
|
+
tags: ['!dev'],
|
|
443
|
+
parameters: { layout: 'padded' },
|
|
444
|
+
name: "Usage / Don't: a spinner with no words",
|
|
445
|
+
render: () => (
|
|
446
|
+
<HStack gap={4}>
|
|
447
|
+
<Button variant="primary" loading>
|
|
448
|
+
저장
|
|
449
|
+
</Button>
|
|
450
|
+
</HStack>
|
|
451
|
+
),
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
type StateStyles = {
|
|
455
|
+
bgColor?: unknown;
|
|
456
|
+
borderColor?: unknown;
|
|
457
|
+
color?: unknown;
|
|
458
|
+
_hover?: unknown;
|
|
459
|
+
_active?: unknown;
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
const STATE_LABELS = {
|
|
463
|
+
bgColor: { en: 'fill', ko: '바탕' },
|
|
464
|
+
borderColor: { en: 'border', ko: '테두리' },
|
|
465
|
+
color: { en: 'label', ko: '글자' },
|
|
466
|
+
hover: { en: 'hover fill', ko: '마우스 올림' },
|
|
467
|
+
active: { en: 'pressed fill', ko: '누름' },
|
|
468
|
+
} as const;
|
|
469
|
+
|
|
470
|
+
type Use = { en: string; ko: string };
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* One row per token, listing every role and state that reads it. Read from
|
|
474
|
+
* `buttonVariantStyles`, so a recipe change shows up here on the next build.
|
|
475
|
+
*/
|
|
476
|
+
const buttonTokenRows = () => {
|
|
477
|
+
const uses = new Map<string, Use[]>();
|
|
478
|
+
const add = (token: unknown, use: Use) => {
|
|
479
|
+
if (typeof token !== 'string' || token === 'transparent') return;
|
|
480
|
+
uses.set(token, [...(uses.get(token) ?? []), use]);
|
|
481
|
+
};
|
|
482
|
+
buttonVariants.forEach((variant) => {
|
|
483
|
+
const s = buttonVariantStyles[variant] as StateStyles;
|
|
484
|
+
const label = (key: keyof typeof STATE_LABELS) => ({
|
|
485
|
+
en: `${variant} ${STATE_LABELS[key].en}`,
|
|
486
|
+
ko: `${variant} ${STATE_LABELS[key].ko}`,
|
|
487
|
+
});
|
|
488
|
+
add(s.bgColor, label('bgColor'));
|
|
489
|
+
add(s.borderColor, label('borderColor'));
|
|
490
|
+
add(s.color, label('color'));
|
|
491
|
+
add((s._hover as StateStyles | undefined)?.bgColor, label('hover'));
|
|
492
|
+
add((s._active as StateStyles | undefined)?.bgColor, label('active'));
|
|
493
|
+
});
|
|
494
|
+
add('action.iconOnSolid', { en: 'action icon', ko: 'action 아이콘' });
|
|
495
|
+
add('danger.fg', {
|
|
496
|
+
en: 'isDestructive label',
|
|
497
|
+
ko: 'isDestructive 글자',
|
|
498
|
+
});
|
|
499
|
+
add('disabled.bg', { en: 'disabled fill', ko: '비활성 바탕' });
|
|
500
|
+
add('disabled.fg', { en: 'disabled label', ko: '비활성 글자' });
|
|
501
|
+
add('focus.ring', { en: 'keyboard focus ring', ko: '키보드 초점 링' });
|
|
502
|
+
return [...uses].map(([token, list]) => ({
|
|
503
|
+
token,
|
|
504
|
+
use: (
|
|
505
|
+
<T
|
|
506
|
+
en={list.map((u) => u.en).join(', ')}
|
|
507
|
+
ko={list.map((u) => u.ko).join(', ')}
|
|
508
|
+
/>
|
|
509
|
+
),
|
|
510
|
+
}));
|
|
511
|
+
};
|
|
512
|
+
|
|
513
|
+
/** Every token a role reads at rest, on hover and on press. */
|
|
514
|
+
export const UsageTokens: Story = {
|
|
515
|
+
tags: ['!dev'],
|
|
516
|
+
parameters: { layout: 'padded' },
|
|
517
|
+
name: 'Usage / Tokens',
|
|
518
|
+
render: () => <TokenTable rows={buttonTokenRows()} />,
|
|
519
|
+
};
|