@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
|
@@ -4,12 +4,16 @@ import { SYSTEM_HUES } from '@/theme/palette.generated';
|
|
|
4
4
|
/**
|
|
5
5
|
* Default stroke order for multi-series charts.
|
|
6
6
|
*
|
|
7
|
-
* Series 1 is the
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
7
|
+
* Series 1 is the data blue (`blue.base`): blue means data (SemanticTokens.mdx,
|
|
8
|
+
* "Blue means data and links"), and a single-measure chart draws in the same
|
|
9
|
+
* blue, so adding a second series does not repaint the first. It used to be
|
|
10
|
+
* the ink `primary.main`, which read as body text rather than as data.
|
|
11
|
+
*
|
|
12
|
+
* The rest cycle hues that carry no meaning in the system, alternating cool
|
|
13
|
+
* and warm so neighbouring lines separate. Red, yellow and green are the
|
|
14
|
+
* danger, warning and success colours, so none of them may colour a series by
|
|
15
|
+
* default — a red "UV" line reads as an error. Brown comes late: next to the
|
|
16
|
+
* other dusty warm hues it reads as mud.
|
|
13
17
|
*
|
|
14
18
|
* Every stroke clears 3:1 against the page in both modes. Cyan, mint and
|
|
15
19
|
* orange are too light at their base value in light mode (≈1.9:1), so they
|
|
@@ -21,23 +25,21 @@ type SeriesHue = {
|
|
|
21
25
|
};
|
|
22
26
|
|
|
23
27
|
export const CHART_SERIES_HUES: readonly SeriesHue[] = [
|
|
24
|
-
{ hue: 'brown', light: 'base' },
|
|
25
|
-
{ hue: 'indigo', light: 'base' },
|
|
26
|
-
{ hue: 'pink', light: 'base' },
|
|
27
28
|
{ hue: 'teal', light: 'base' },
|
|
29
|
+
{ hue: 'pink', light: 'base' },
|
|
30
|
+
{ hue: 'indigo', light: 'base' },
|
|
28
31
|
{ hue: 'purple', light: 'base' },
|
|
32
|
+
{ hue: 'brown', light: 'base' },
|
|
29
33
|
{ hue: 'cyan', light: 'hc' },
|
|
30
34
|
{ hue: 'mint', light: 'hc' },
|
|
31
35
|
{ hue: 'orange', light: 'hc' },
|
|
32
36
|
];
|
|
33
37
|
|
|
34
|
-
/** Stroke for series `index` (0-based); index 0 is the
|
|
35
|
-
export const seriesColor = (
|
|
36
|
-
index
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
): string => {
|
|
40
|
-
if (index === 0) return primary;
|
|
38
|
+
/** Stroke for series `index` (0-based); index 0 is the data blue. */
|
|
39
|
+
export const seriesColor = (index: number, isDark: boolean): string => {
|
|
40
|
+
if (index === 0) {
|
|
41
|
+
return isDark ? SYSTEM_HUES.blue.baseDark : SYSTEM_HUES.blue.base;
|
|
42
|
+
}
|
|
41
43
|
const { hue, light } =
|
|
42
44
|
CHART_SERIES_HUES[(index - 1) % CHART_SERIES_HUES.length];
|
|
43
45
|
return isDark ? SYSTEM_HUES[hue].baseDark : SYSTEM_HUES[hue][light];
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { Box } from '@chakra-ui/react';
|
|
3
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
4
|
+
|
|
5
|
+
import { T } from '../../guidelines/_components/Lang';
|
|
6
|
+
import { TokenTable } from '../../guidelines/_components/TokenTable';
|
|
7
|
+
import { Card } from '../Card';
|
|
8
|
+
import { Subtext, Text } from '../Typography';
|
|
9
|
+
import { SectionLoader } from './SectionLoader';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Specimens for `Loaders.usage.mdx`, which covers `PageLoader`,
|
|
13
|
+
* `SectionLoader` and `ThinkingDots` together. Every story here is hidden
|
|
14
|
+
* (`!dev`): the components' own stories stay under Components/PageLoader and
|
|
15
|
+
* Components/SectionLoader.
|
|
16
|
+
*/
|
|
17
|
+
const meta = {
|
|
18
|
+
title: 'Components/Loaders',
|
|
19
|
+
component: SectionLoader,
|
|
20
|
+
args: { isLoading: true },
|
|
21
|
+
} satisfies Meta<typeof SectionLoader>;
|
|
22
|
+
|
|
23
|
+
export default meta;
|
|
24
|
+
|
|
25
|
+
type Story = StoryObj<typeof meta>;
|
|
26
|
+
|
|
27
|
+
/** A card whose body is loading; the card is the positioned parent. */
|
|
28
|
+
const LoadingCard = ({ children }: { children: ReactNode }) => (
|
|
29
|
+
<Card p={4} w="320px">
|
|
30
|
+
<Text fontWeight="bold" mb={2}>
|
|
31
|
+
멤버
|
|
32
|
+
</Text>
|
|
33
|
+
<Box position="relative" h="120px" borderRadius="md" overflow="hidden">
|
|
34
|
+
<Subtext>홍길동, 김철수, 이영희</Subtext>
|
|
35
|
+
{children}
|
|
36
|
+
</Box>
|
|
37
|
+
</Card>
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
export const DoSectionLoaderInParent: Story = {
|
|
41
|
+
tags: ['!dev'],
|
|
42
|
+
parameters: { layout: 'padded' },
|
|
43
|
+
name: 'Usage / Do: SectionLoader inside a positioned parent',
|
|
44
|
+
render: () => (
|
|
45
|
+
<LoadingCard>
|
|
46
|
+
<SectionLoader isLoading label="멤버 목록을 불러오는 중" />
|
|
47
|
+
</LoadingCard>
|
|
48
|
+
),
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const DoThinkingForAI: Story = {
|
|
52
|
+
tags: ['!dev'],
|
|
53
|
+
parameters: { layout: 'padded' },
|
|
54
|
+
name: 'Usage / Do: thinking dots while the AI works',
|
|
55
|
+
render: () => (
|
|
56
|
+
<LoadingCard>
|
|
57
|
+
<SectionLoader
|
|
58
|
+
isLoading
|
|
59
|
+
variant="thinking"
|
|
60
|
+
label="답변을 준비하는 중"
|
|
61
|
+
/>
|
|
62
|
+
</LoadingCard>
|
|
63
|
+
),
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/** Tokens the loaders read. */
|
|
67
|
+
export const UsageTokens: Story = {
|
|
68
|
+
tags: ['!dev'],
|
|
69
|
+
parameters: { layout: 'padded' },
|
|
70
|
+
name: 'Usage / Tokens',
|
|
71
|
+
render: () => (
|
|
72
|
+
<TokenTable
|
|
73
|
+
rows={[
|
|
74
|
+
{
|
|
75
|
+
token: 'bg.canvas',
|
|
76
|
+
use: <T en="overlay (PageLoader at 50% opacity)" ko="덮개(PageLoader는 불투명도 50%)" />,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
token: 'primary.main',
|
|
80
|
+
use: <T en="spinner (default variant)" ko="스피너(기본 변형)" />,
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
token: 'bg.track',
|
|
84
|
+
use: <T en="spinner track" ko="스피너 트랙" />,
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
token: 'action.mark',
|
|
88
|
+
use: <T en="thinking dots" ko="thinking 점" />,
|
|
89
|
+
},
|
|
90
|
+
]}
|
|
91
|
+
/>
|
|
92
|
+
),
|
|
93
|
+
};
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { Canvas, Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import { En, Ko, LangToggle, Verdict } from '../../guidelines/_components/Lang';
|
|
4
|
+
import * as LoadersStories from './Loaders.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={LoadersStories} name="Usage" />
|
|
7
|
+
|
|
8
|
+
<LangToggle />
|
|
9
|
+
|
|
10
|
+
<En>
|
|
11
|
+
|
|
12
|
+
# Loaders
|
|
13
|
+
|
|
14
|
+
Overlays that cover a page (`PageLoader`) or one region (`SectionLoader`) while
|
|
15
|
+
its content loads, with a spinner or, for AI work, three pulsing coral dots.
|
|
16
|
+
|
|
17
|
+
## When to use
|
|
18
|
+
|
|
19
|
+
- `SectionLoader`: one card, panel or list is loading and the rest of the page
|
|
20
|
+
is usable.
|
|
21
|
+
- `PageLoader`: nothing on the page can be used yet, such as while access is
|
|
22
|
+
being checked.
|
|
23
|
+
- `variant="thinking"`: the wait is the AI working, not data loading.
|
|
24
|
+
`ThinkingDots` is the same mark without the overlay.
|
|
25
|
+
|
|
26
|
+
## When not to use
|
|
27
|
+
|
|
28
|
+
- A short wait inside a button → the button's own `loading` state.
|
|
29
|
+
- Inline next to text → `Spinner`.
|
|
30
|
+
- Work with a known length → `ProgressBar`.
|
|
31
|
+
- The layout of the coming content is known → a skeleton keeps the page from
|
|
32
|
+
jumping.
|
|
33
|
+
|
|
34
|
+
## How they behave
|
|
35
|
+
|
|
36
|
+
| | `PageLoader` | `SectionLoader` |
|
|
37
|
+
| --- | --- | --- |
|
|
38
|
+
| Covers | The whole viewport (`position: fixed`, `100dvh`) | Its nearest positioned parent (`position: absolute`, 100% × 100%) |
|
|
39
|
+
| Background | `bg.canvas` at 50% opacity | `bg.canvas`, opaque |
|
|
40
|
+
| `isLoading={false}` | Stays mounted at opacity 0 and exposes no status | Renders nothing |
|
|
41
|
+
| `variant` | `default` (spinner) or `thinking` (dots) | Same |
|
|
42
|
+
| `label` | Spoken text, default 로딩 중 (translated) | Same |
|
|
43
|
+
|
|
44
|
+
## Do / Don't
|
|
45
|
+
|
|
46
|
+
</En>
|
|
47
|
+
|
|
48
|
+
<Ko>
|
|
49
|
+
|
|
50
|
+
# Loaders
|
|
51
|
+
|
|
52
|
+
내용을 불러오는 동안 페이지 전체(`PageLoader`)나 한 영역(`SectionLoader`)을 덮는
|
|
53
|
+
화면입니다. 스피너를 보여 주거나, AI가 일하는 중이라면 코럴 점 세 개가 차례로
|
|
54
|
+
깜박입니다.
|
|
55
|
+
|
|
56
|
+
## 언제 쓰나요
|
|
57
|
+
|
|
58
|
+
- `SectionLoader`: 카드, 패널, 목록 하나만 불러오는 중이고 나머지 페이지는 쓸 수 있을 때.
|
|
59
|
+
- `PageLoader`: 권한을 확인하는 동안처럼 페이지에서 아무것도 쓸 수 없을 때.
|
|
60
|
+
- `variant="thinking"`: 데이터를 불러오는 것이 아니라 AI가 일하는 동안 기다릴 때.
|
|
61
|
+
덮개 없이 같은 표시만 필요하다면 `ThinkingDots`를 씁니다.
|
|
62
|
+
|
|
63
|
+
## 언제 쓰지 않나요
|
|
64
|
+
|
|
65
|
+
- 버튼 안의 짧은 대기는 그 버튼의 `loading` 상태를 씁니다.
|
|
66
|
+
- 글자 옆에 작게 둘 때는 `Spinner`를 씁니다.
|
|
67
|
+
- 길이를 아는 작업은 `ProgressBar`를 씁니다.
|
|
68
|
+
- 나올 내용의 배치를 안다면 스켈레톤을 써서 화면이 밀리지 않게 합니다.
|
|
69
|
+
|
|
70
|
+
## 동작 방식
|
|
71
|
+
|
|
72
|
+
| | `PageLoader` | `SectionLoader` |
|
|
73
|
+
| --- | --- | --- |
|
|
74
|
+
| 덮는 범위 | 화면 전체(`position: fixed`, `100dvh`) | 가장 가까운 위치 지정 부모(`position: absolute`, 100% × 100%) |
|
|
75
|
+
| 배경 | 불투명도 50%의 `bg.canvas` | 불투명한 `bg.canvas` |
|
|
76
|
+
| `isLoading={false}` | 불투명도 0으로 남아 있고 상태를 알리지 않음 | 아무것도 그리지 않음 |
|
|
77
|
+
| `variant` | `default`(스피너) 또는 `thinking`(점) | 같음 |
|
|
78
|
+
| `label` | 화면 낭독기가 읽는 문구, 기본값 "로딩 중"(번역됨) | 같음 |
|
|
79
|
+
|
|
80
|
+
## 이렇게 하세요 / 이렇게 하지 마세요
|
|
81
|
+
|
|
82
|
+
</Ko>
|
|
83
|
+
|
|
84
|
+
<Canvas of={LoadersStories.DoSectionLoaderInParent} />
|
|
85
|
+
<Verdict
|
|
86
|
+
kind="do"
|
|
87
|
+
en="Give SectionLoader a parent with position: relative and say what is loading in label. Without the positioned parent it covers the nearest positioned ancestor, which may be the whole page."
|
|
88
|
+
ko="SectionLoader의 부모에는 position: relative를 주고, label에는 무엇을 불러오는지 씁니다. 위치 지정 부모가 없으면 가장 가까운 위치 지정 조상을 덮고, 그것이 페이지 전체일 수도 있습니다."
|
|
89
|
+
/>
|
|
90
|
+
|
|
91
|
+
<Canvas of={LoadersStories.DoThinkingForAI} />
|
|
92
|
+
<Verdict
|
|
93
|
+
kind="do"
|
|
94
|
+
en="Use the thinking variant only while the AI is working. Coral is the AI-working mark; on an ordinary data load it means nothing."
|
|
95
|
+
ko="thinking 변형은 AI가 일하는 동안에만 씁니다. 코럴은 AI 작업 표시이며, 평범한 데이터 로딩에서는 아무 뜻도 전하지 못합니다."
|
|
96
|
+
/>
|
|
97
|
+
|
|
98
|
+
<En>
|
|
99
|
+
|
|
100
|
+
## Content
|
|
101
|
+
|
|
102
|
+
- `label` says what is loading, as a noun phrase: 멤버 목록을 불러오는 중,
|
|
103
|
+
답변을 준비하는 중. The default 로딩 중 says nothing about what.
|
|
104
|
+
- Pass the translated string; `label` is used as given.
|
|
105
|
+
|
|
106
|
+
## Accessibility
|
|
107
|
+
|
|
108
|
+
What the loaders do for you:
|
|
109
|
+
|
|
110
|
+
- While loading, the overlay is `role="status"` with `aria-live="polite"` and
|
|
111
|
+
the label as visually hidden text, so screen readers announce it
|
|
112
|
+
(WCAG 4.1.3). When idle it exposes no status at all.
|
|
113
|
+
- The spinner and the dots are decorative; the label carries the meaning.
|
|
114
|
+
- The dots stop under `prefers-reduced-motion`; the spinner slows down instead,
|
|
115
|
+
because a frozen spinner reads as a hung request.
|
|
116
|
+
|
|
117
|
+
What you still have to do:
|
|
118
|
+
|
|
119
|
+
- **Keep focus out of what is covered.** The overlay does not trap or move
|
|
120
|
+
focus; controls underneath stay reachable with Tab. Disable them, or do not
|
|
121
|
+
render them, until loading ends (WCAG 2.4.3).
|
|
122
|
+
- After a long load, move focus or announce the result when it matters.
|
|
123
|
+
|
|
124
|
+
## Tokens
|
|
125
|
+
|
|
126
|
+
</En>
|
|
127
|
+
|
|
128
|
+
<Ko>
|
|
129
|
+
|
|
130
|
+
## 문구
|
|
131
|
+
|
|
132
|
+
- `label`에는 무엇을 불러오는지 명사구로 씁니다: 멤버 목록을 불러오는 중, 답변을
|
|
133
|
+
준비하는 중. 기본값 "로딩 중"은 무엇을 불러오는지 알려 주지 않습니다.
|
|
134
|
+
- 번역된 문자열을 넘깁니다. `label`은 받은 그대로 씁니다.
|
|
135
|
+
|
|
136
|
+
## 접근성
|
|
137
|
+
|
|
138
|
+
Loaders가 알아서 하는 일
|
|
139
|
+
|
|
140
|
+
- 불러오는 동안 덮개에 `role="status"`와 `aria-live="polite"`가 붙고, label이
|
|
141
|
+
화면에 보이지 않는 글자로 들어가서 화면 낭독기가 읽습니다(WCAG 4.1.3). 쉬는 동안에는
|
|
142
|
+
상태를 전혀 알리지 않습니다.
|
|
143
|
+
- 스피너와 점은 장식이고, 뜻은 label이 전합니다.
|
|
144
|
+
- `prefers-reduced-motion`에서는 점이 멈추고, 스피너는 멈추지 않고 느려집니다. 멈춘
|
|
145
|
+
스피너는 요청이 멈춘 것처럼 보이기 때문입니다.
|
|
146
|
+
|
|
147
|
+
직접 챙겨야 하는 일
|
|
148
|
+
|
|
149
|
+
- **덮인 영역으로 초점이 가지 않게 합니다.** 덮개는 초점을 가두거나 옮기지 않으므로,
|
|
150
|
+
아래에 있는 컨트롤에 Tab으로 여전히 닿습니다. 다 불러올 때까지 비활성으로 두거나
|
|
151
|
+
그리지 않습니다(WCAG 2.4.3).
|
|
152
|
+
- 오래 걸린 로딩이 끝난 뒤 결과가 중요하다면 초점을 옮기거나 결과를 알립니다.
|
|
153
|
+
|
|
154
|
+
## 토큰
|
|
155
|
+
|
|
156
|
+
</Ko>
|
|
157
|
+
|
|
158
|
+
<Canvas of={LoadersStories.UsageTokens} sourceState="none" />
|
|
159
|
+
|
|
160
|
+
<En>
|
|
161
|
+
|
|
162
|
+
## Related
|
|
163
|
+
|
|
164
|
+
- **Spinner**: the spinner on its own, inline.
|
|
165
|
+
- **ProgressBar**: work whose length is known.
|
|
166
|
+
- **Button**: `loading` for a busy button.
|
|
167
|
+
- **Foundations/Brand & colour usage**: coral is the AI-working mark.
|
|
168
|
+
|
|
169
|
+
</En>
|
|
170
|
+
|
|
171
|
+
<Ko>
|
|
172
|
+
|
|
173
|
+
## 관련 컴포넌트
|
|
174
|
+
|
|
175
|
+
- **Spinner**: 글자 옆에 두는 스피너 단독형.
|
|
176
|
+
- **ProgressBar**: 길이를 아는 작업.
|
|
177
|
+
- **Button**: 작업 중인 버튼은 `loading`.
|
|
178
|
+
- **Foundations/Brand & colour usage**: 코럴은 AI 작업 표시입니다.
|
|
179
|
+
|
|
180
|
+
</Ko>
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { ArgTypes, Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import { En, Ko, LangToggle } from '../../guidelines/_components/Lang';
|
|
4
|
+
import * as LogicianProviderStories from './LogicianProvider.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={LogicianProviderStories} name="Usage" />
|
|
7
|
+
|
|
8
|
+
<LangToggle />
|
|
9
|
+
|
|
10
|
+
<En>
|
|
11
|
+
|
|
12
|
+
# LogicianProvider
|
|
13
|
+
|
|
14
|
+
The root provider: it gives every component below it the Logician theme, the
|
|
15
|
+
colour-mode runtime and the language for locale-aware parts.
|
|
16
|
+
|
|
17
|
+
## When to use
|
|
18
|
+
|
|
19
|
+
- Once, at the root of the app, around everything that renders Logician
|
|
20
|
+
components. Put it inside your styling registry (for example the Emotion
|
|
21
|
+
registry in a Next.js app) and outside your own providers.
|
|
22
|
+
- With `config` to extend the theme, `language` from the user's locale, and
|
|
23
|
+
`defaultColorMode="system"` so a first visit follows the OS.
|
|
24
|
+
- With `forcedColorMode` during a staged rollout, to pin one mode while
|
|
25
|
+
screens are migrated.
|
|
26
|
+
|
|
27
|
+
## When not to use
|
|
28
|
+
|
|
29
|
+
- A second LogicianProvider deeper in the tree to change density → use
|
|
30
|
+
`ScaledContext`.
|
|
31
|
+
- To recolour one area → use semantic tokens on that area. A nested provider
|
|
32
|
+
builds a new Chakra system.
|
|
33
|
+
- When the host already mounts its own `next-themes` provider → pass
|
|
34
|
+
`enableColorMode={false}` instead of mounting two.
|
|
35
|
+
|
|
36
|
+
## Accessibility
|
|
37
|
+
|
|
38
|
+
- `language` only feeds the date and month pickers and other locale-aware
|
|
39
|
+
parts. It does not set `<html lang>`; the app must do that (WCAG 3.1.1).
|
|
40
|
+
- With `loadFonts` (on by default) it adds Pretendard Variable and Inter
|
|
41
|
+
stylesheets from public CDNs to `<head>`. Set it to `false` if the app loads
|
|
42
|
+
them itself, or if those hosts are blocked.
|
|
43
|
+
- Colour mode follows the reader's OS setting by default and can be stored per
|
|
44
|
+
device. See **Setup/ColorMode/Usage** for the contract.
|
|
45
|
+
|
|
46
|
+
## Props
|
|
47
|
+
|
|
48
|
+
</En>
|
|
49
|
+
|
|
50
|
+
<Ko>
|
|
51
|
+
|
|
52
|
+
# LogicianProvider
|
|
53
|
+
|
|
54
|
+
최상위 프로바이더입니다. 그 아래 모든 컴포넌트에 Logician 테마, 컬러 모드 동작, 날짜처럼
|
|
55
|
+
지역 설정을 따르는 파트에 쓸 언어를 넘겨줍니다.
|
|
56
|
+
|
|
57
|
+
## 언제 쓰나요
|
|
58
|
+
|
|
59
|
+
- 앱의 최상위에서 한 번, Logician 컴포넌트를 그리는 모든 것을 감싸도록 둡니다. 스타일
|
|
60
|
+
레지스트리(예: Next.js 앱의 Emotion 레지스트리) 안쪽, 앱 자체 프로바이더 바깥쪽에 둡니다.
|
|
61
|
+
- 테마를 넓힐 때는 `config`, 사용자 지역 설정에는 `language`, 첫 방문에서 운영체제 설정을
|
|
62
|
+
따르게 하려면 `defaultColorMode="system"`을 넘깁니다.
|
|
63
|
+
- 화면을 단계적으로 옮기는 동안 한 모드로 고정하려면 `forcedColorMode`를 씁니다.
|
|
64
|
+
|
|
65
|
+
## 언제 쓰지 않나요
|
|
66
|
+
|
|
67
|
+
- 촘촘함을 바꾸려고 트리 안쪽에 LogicianProvider를 하나 더 두지 않습니다.
|
|
68
|
+
`ScaledContext`를 씁니다.
|
|
69
|
+
- 한 영역의 색만 바꾸려면 그 영역에 시맨틱 토큰을 씁니다. 프로바이더를 겹치면 Chakra
|
|
70
|
+
시스템을 새로 만듭니다.
|
|
71
|
+
- 호스트 앱이 이미 자체 `next-themes` 프로바이더를 마운트한다면 둘을 겹치지 말고
|
|
72
|
+
`enableColorMode={false}`를 넘깁니다.
|
|
73
|
+
|
|
74
|
+
## 접근성
|
|
75
|
+
|
|
76
|
+
- `language`는 날짜·월 선택기처럼 지역 설정을 따르는 파트에만 쓰입니다. `<html lang>`은
|
|
77
|
+
정하지 않으므로 앱이 직접 정해야 합니다(WCAG 3.1.1).
|
|
78
|
+
- `loadFonts`(기본값 켜짐)는 Pretendard Variable과 Inter 스타일시트를 공개 CDN에서
|
|
79
|
+
`<head>`에 추가합니다. 앱이 직접 글꼴을 불러오거나 그 주소가 막혀 있다면 `false`로 둡니다.
|
|
80
|
+
- 컬러 모드는 기본적으로 운영체제 설정을 따르고, 기기마다 저장될 수 있습니다. 자세한
|
|
81
|
+
약속은 **Setup/ColorMode/Usage**에 있습니다.
|
|
82
|
+
|
|
83
|
+
## 속성
|
|
84
|
+
|
|
85
|
+
</Ko>
|
|
86
|
+
|
|
87
|
+
<ArgTypes
|
|
88
|
+
of={LogicianProviderStories}
|
|
89
|
+
include={[
|
|
90
|
+
'config',
|
|
91
|
+
'theme',
|
|
92
|
+
'language',
|
|
93
|
+
'loadFonts',
|
|
94
|
+
'defaultColorMode',
|
|
95
|
+
'forcedColorMode',
|
|
96
|
+
'enableColorMode',
|
|
97
|
+
]}
|
|
98
|
+
/>
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
|
|
3
|
+
import { T } from '../../guidelines/_components/Lang';
|
|
4
|
+
import { TokenTable } from '../../guidelines/_components/TokenTable';
|
|
3
5
|
import { Markdown } from './Markdown';
|
|
4
6
|
|
|
5
7
|
const meta = {
|
|
@@ -216,3 +218,54 @@ The quadratic formula: $x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}$
|
|
|
216
218
|
*Markdown component with full GFM support!*`,
|
|
217
219
|
},
|
|
218
220
|
};
|
|
221
|
+
|
|
222
|
+
// ───────────────────────── Usage-page specimens ─────────────────────────
|
|
223
|
+
// Pulled into `Markdown.usage.mdx` with <Canvas of={…} />. Hidden from the
|
|
224
|
+
// sidebar (`!dev`); `tags` is written out on each story because the indexer
|
|
225
|
+
// reads CSF statically.
|
|
226
|
+
|
|
227
|
+
export const DoGeneratedAnswer: Story = {
|
|
228
|
+
tags: ['!dev'],
|
|
229
|
+
parameters: { layout: 'padded' },
|
|
230
|
+
name: 'Usage / Do: authored or generated long-form text',
|
|
231
|
+
args: {
|
|
232
|
+
children: `요청하신 내용을 정리했습니다.
|
|
233
|
+
|
|
234
|
+
### 바꿀 점
|
|
235
|
+
1. 요청 본문의 \`model\` 값을 확인합니다.
|
|
236
|
+
2. 응답이 끊기면 \`max_tokens\`를 늘립니다.
|
|
237
|
+
|
|
238
|
+
| 항목 | 값 |
|
|
239
|
+
| --- | --- |
|
|
240
|
+
| 모델 | gpt-4o |
|
|
241
|
+
| 최대 토큰 | 4,096 |
|
|
242
|
+
|
|
243
|
+
자세한 내용은 [API 문서](https://example.com/docs)를 보세요.`,
|
|
244
|
+
},
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
export const DontUiCopy: Story = {
|
|
248
|
+
tags: ['!dev'],
|
|
249
|
+
parameters: { layout: 'padded' },
|
|
250
|
+
name: "Usage / Don't: Markdown for a fixed UI string",
|
|
251
|
+
args: { children: '**저장되었습니다.**' },
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
export const UsageTokens: Story = {
|
|
255
|
+
tags: ['!dev'],
|
|
256
|
+
parameters: { layout: 'padded' },
|
|
257
|
+
name: 'Usage / Tokens',
|
|
258
|
+
render: () => (
|
|
259
|
+
<TokenTable
|
|
260
|
+
rows={[
|
|
261
|
+
{
|
|
262
|
+
token: 'fg.default',
|
|
263
|
+
use: <T en="Container text colour" ko="컨테이너 글자색" />,
|
|
264
|
+
},
|
|
265
|
+
{ token: 'fg.emphasized', use: <T en="Headings" ko="제목" /> },
|
|
266
|
+
{ token: 'fg.link', use: <T en="Links" ko="링크" /> },
|
|
267
|
+
{ token: 'bg.subtle', use: <T en="Inline code" ko="인라인 코드" /> },
|
|
268
|
+
]}
|
|
269
|
+
/>
|
|
270
|
+
),
|
|
271
|
+
};
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { Canvas, Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import { En, Ko, LangToggle, Verdict } from '../../guidelines/_components/Lang';
|
|
4
|
+
import * as MarkdownStories from './Markdown.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={MarkdownStories} name="Usage" />
|
|
7
|
+
|
|
8
|
+
<LangToggle />
|
|
9
|
+
|
|
10
|
+
<En>
|
|
11
|
+
|
|
12
|
+
# Markdown
|
|
13
|
+
|
|
14
|
+
Renders a Markdown string with the design system's own components: headings
|
|
15
|
+
become `H1`–`H5` (and `h6` a `Subtitle as="h6"`), paragraphs `Text`, links
|
|
16
|
+
`Link`, code `InlineCode` or `Code`, tables `Table`. GitHub-flavoured
|
|
17
|
+
Markdown, line breaks, highlight markers and KaTeX maths are on.
|
|
18
|
+
|
|
19
|
+
## When to use
|
|
20
|
+
|
|
21
|
+
- Long-form text written by someone else or generated: model answers,
|
|
22
|
+
announcements, release notes, help articles.
|
|
23
|
+
|
|
24
|
+
## When not to use
|
|
25
|
+
|
|
26
|
+
- A fixed UI string (a label, a toast, an error message) → `Text`. Markdown is
|
|
27
|
+
for content you do not control at build time.
|
|
28
|
+
- A chat message with app-specific blocks (citations, tool output) → the
|
|
29
|
+
app's own renderer, passing overrides through `components`.
|
|
30
|
+
|
|
31
|
+
## Props
|
|
32
|
+
|
|
33
|
+
| Prop | Means |
|
|
34
|
+
| --- | --- |
|
|
35
|
+
| `children` | The Markdown string. |
|
|
36
|
+
| `components` | Overrides merged over the built-in mapping (`baseMarkdownComponents`, exported). Use it to change heading levels or add custom blocks. |
|
|
37
|
+
| `className` | Added to the wrapper next to the built-in spacing styles. |
|
|
38
|
+
| Other `react-markdown` options | Passed through. Plugins you pass replace the built-in plugin lists. |
|
|
39
|
+
|
|
40
|
+
## Do / Don't
|
|
41
|
+
|
|
42
|
+
</En>
|
|
43
|
+
|
|
44
|
+
<Ko>
|
|
45
|
+
|
|
46
|
+
# Markdown
|
|
47
|
+
|
|
48
|
+
마크다운 글을 이 디자인 시스템의 컴포넌트로 그립니다. 제목은 `H1`–`H5`(`h6`는
|
|
49
|
+
`Subtitle as="h6"`), 문단은 `Text`, 링크는 `Link`, 코드는 `InlineCode`나 `Code`, 표는
|
|
50
|
+
`Table`이 됩니다. GitHub식 마크다운, 줄바꿈, 형광펜 표시, KaTeX 수식이 켜져 있습니다.
|
|
51
|
+
|
|
52
|
+
## 언제 쓰나요
|
|
53
|
+
|
|
54
|
+
- 다른 사람이 썼거나 생성된 긴 글: 모델 답변, 공지, 릴리스 노트, 도움말.
|
|
55
|
+
|
|
56
|
+
## 언제 쓰지 않나요
|
|
57
|
+
|
|
58
|
+
- 고정된 화면 문구(라벨, 토스트, 오류 메시지)는 `Text`를 씁니다. Markdown은 빌드할 때
|
|
59
|
+
내용을 알 수 없는 글에 씁니다.
|
|
60
|
+
- 인용, 도구 결과처럼 앱 고유의 블록이 있는 채팅 메시지는 앱의 렌더러를 쓰고,
|
|
61
|
+
`components`로 덮어씁니다.
|
|
62
|
+
|
|
63
|
+
## 속성
|
|
64
|
+
|
|
65
|
+
| 속성 | 뜻 |
|
|
66
|
+
| --- | --- |
|
|
67
|
+
| `children` | 마크다운 글. |
|
|
68
|
+
| `components` | 기본 매핑(`baseMarkdownComponents`, 내보냄) 위에 덮어쓸 컴포넌트. 제목 수준을 바꾸거나 블록을 추가할 때 씁니다. |
|
|
69
|
+
| `className` | 기본 간격 스타일과 함께 바깥 요소에 붙습니다. |
|
|
70
|
+
| 그 밖의 `react-markdown` 옵션 | 그대로 넘깁니다. 플러그인을 넘기면 기본 플러그인 목록을 대신합니다. |
|
|
71
|
+
|
|
72
|
+
## 이렇게 하세요 / 이렇게 하지 마세요
|
|
73
|
+
|
|
74
|
+
</Ko>
|
|
75
|
+
|
|
76
|
+
<Canvas of={MarkdownStories.DoGeneratedAnswer} />
|
|
77
|
+
<Verdict
|
|
78
|
+
kind="do"
|
|
79
|
+
en="Render authored or generated long-form text. Lists, code, tables and links all come out as design-system components."
|
|
80
|
+
ko="작성하거나 생성된 긴 글을 그립니다. 목록, 코드, 표, 링크가 모두 디자인 시스템 컴포넌트로 나옵니다."
|
|
81
|
+
/>
|
|
82
|
+
|
|
83
|
+
<Canvas of={MarkdownStories.DontUiCopy} />
|
|
84
|
+
<Verdict
|
|
85
|
+
kind="dont"
|
|
86
|
+
en="Pass a fixed UI string through Markdown to make it bold. Use Text with fontWeight; the copy belongs in your translations, not in Markdown."
|
|
87
|
+
ko="고정된 화면 문구를 굵게 하려고 Markdown을 거치지 마세요. fontWeight를 준 Text를 쓰고, 문구는 마크다운이 아니라 번역 파일에 둡니다."
|
|
88
|
+
/>
|
|
89
|
+
|
|
90
|
+
<En>
|
|
91
|
+
|
|
92
|
+
## Content
|
|
93
|
+
|
|
94
|
+
- Write headings in order, starting from the level that fits under the
|
|
95
|
+
page's own heading.
|
|
96
|
+
- Write link text that names the destination, and alt text for every image.
|
|
97
|
+
|
|
98
|
+
## Accessibility
|
|
99
|
+
|
|
100
|
+
What Markdown does for you:
|
|
101
|
+
|
|
102
|
+
- Headings stay real headings, including `######` (`as="h6"`), so the
|
|
103
|
+
author's structure reaches the outline (KWCAG 5.2.4.2 제목 제공).
|
|
104
|
+
- Tables are real tables, links are underlined `Link`s, and code blocks get
|
|
105
|
+
`Code`'s copy button.
|
|
106
|
+
|
|
107
|
+
What you still have to do:
|
|
108
|
+
|
|
109
|
+
- **Fit the heading levels to the page.** `#` becomes an `<h1>`. If the page
|
|
110
|
+
already has an `h1`, map the levels down with `components` (WCAG 1.3.1,
|
|
111
|
+
2.4.6).
|
|
112
|
+
- **Images need alt text from the author.** An image written without alt in
|
|
113
|
+
raw HTML gets the placeholder "chat-image", which describes nothing (WCAG
|
|
114
|
+
1.1.1).
|
|
115
|
+
- **Links open in a new tab** (`target="_blank"`) with no warning. Say so near
|
|
116
|
+
the content if it matters, or override `a` in `components` (WCAG 3.2.5).
|
|
117
|
+
- **Raw HTML is rendered** (`rehype-raw`) and not sanitised. Sanitise
|
|
118
|
+
untrusted input before you pass it in.
|
|
119
|
+
|
|
120
|
+
## Tokens
|
|
121
|
+
|
|
122
|
+
The wrapper sets `fg.default`; everything else comes from the components it
|
|
123
|
+
maps to.
|
|
124
|
+
|
|
125
|
+
</En>
|
|
126
|
+
|
|
127
|
+
<Ko>
|
|
128
|
+
|
|
129
|
+
## 문구
|
|
130
|
+
|
|
131
|
+
- 제목은 차례대로 쓰고, 페이지 제목 아래에 맞는 수준에서 시작합니다.
|
|
132
|
+
- 링크 문구에는 이동할 곳을 적고, 모든 이미지에 대체 글을 씁니다.
|
|
133
|
+
|
|
134
|
+
## 접근성
|
|
135
|
+
|
|
136
|
+
Markdown이 알아서 하는 일
|
|
137
|
+
|
|
138
|
+
- 제목은 `######`(`as="h6"`)까지 실제 제목으로 남으므로, 작성자가 만든 구조가 문서
|
|
139
|
+
구조에 그대로 들어갑니다(KWCAG 5.2.4.2 제목 제공).
|
|
140
|
+
- 표는 실제 표로, 링크는 밑줄이 있는 `Link`로 그려지고, 코드 블록에는 `Code`의 복사
|
|
141
|
+
버튼이 붙습니다.
|
|
142
|
+
|
|
143
|
+
직접 챙겨야 하는 일
|
|
144
|
+
|
|
145
|
+
- **제목 수준을 페이지에 맞춥니다.** `#`은 `<h1>`이 됩니다. 페이지에 이미 `h1`이
|
|
146
|
+
있다면 `components`로 수준을 한 단계씩 내립니다(WCAG 1.3.1, 2.4.6).
|
|
147
|
+
- **이미지 대체 글은 작성자가 써야 합니다.** HTML로 쓴 이미지에 alt가 없으면 아무것도
|
|
148
|
+
설명하지 않는 "chat-image"가 들어갑니다(WCAG 1.1.1).
|
|
149
|
+
- **링크는 안내 없이 새 탭에서 열립니다**(`target="_blank"`). 중요하다면 내용 근처에
|
|
150
|
+
알리거나 `components`에서 `a`를 덮어씁니다(WCAG 3.2.5).
|
|
151
|
+
- **HTML이 그대로 그려지고**(`rehype-raw`) 정제되지 않습니다. 믿을 수 없는 입력은
|
|
152
|
+
넘기기 전에 정제합니다.
|
|
153
|
+
|
|
154
|
+
## 토큰
|
|
155
|
+
|
|
156
|
+
바깥 요소는 `fg.default`를 쓰고, 나머지는 매핑된 컴포넌트에서 옵니다.
|
|
157
|
+
|
|
158
|
+
</Ko>
|
|
159
|
+
|
|
160
|
+
<Canvas of={MarkdownStories.UsageTokens} sourceState="none" />
|
|
161
|
+
|
|
162
|
+
<En>
|
|
163
|
+
|
|
164
|
+
## Related
|
|
165
|
+
|
|
166
|
+
- **Typography**: the heading and text components Markdown maps to.
|
|
167
|
+
- **Code** / **InlineCode**: code blocks and inline code.
|
|
168
|
+
- **Table**: Markdown tables.
|
|
169
|
+
- **ExpandableText**: clip long text to a few lines.
|
|
170
|
+
|
|
171
|
+
</En>
|
|
172
|
+
|
|
173
|
+
<Ko>
|
|
174
|
+
|
|
175
|
+
## 관련 컴포넌트
|
|
176
|
+
|
|
177
|
+
- **Typography**: Markdown이 매핑하는 제목·본문 컴포넌트.
|
|
178
|
+
- **Code** / **InlineCode**: 코드 블록과 인라인 코드.
|
|
179
|
+
- **Table**: 마크다운 표.
|
|
180
|
+
- **ExpandableText**: 긴 글을 몇 줄로 접어 둘 때.
|
|
181
|
+
|
|
182
|
+
</Ko>
|