@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,7 +1,11 @@
|
|
|
1
1
|
import { Box, HStack, VStack } from '@chakra-ui/react';
|
|
2
2
|
import { Meta, StoryObj } from '@storybook/react';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { T } from '../../guidelines/_components/Lang';
|
|
5
|
+
import { TokenTable } from '../../guidelines/_components/TokenTable';
|
|
6
|
+
import { Card } from '../Card';
|
|
7
|
+
import { Input } from '../Input';
|
|
8
|
+
import { Subtext, Subtitle, Text } from '../Typography';
|
|
5
9
|
import { InfoSprinkle } from './InfoSprinkle';
|
|
6
10
|
|
|
7
11
|
const meta = {
|
|
@@ -39,3 +43,75 @@ export const LargerBaseFontSize: Story = {
|
|
|
39
43
|
baseFontSize: '18px',
|
|
40
44
|
},
|
|
41
45
|
};
|
|
46
|
+
|
|
47
|
+
// ───────────────────────── Usage-page specimens ─────────────────────────
|
|
48
|
+
// Pulled into `InfoSprinkle.usage.mdx` with <Canvas of={…} />. Hidden from the
|
|
49
|
+
// sidebar (`!dev`). Each card is held open (`open`) so the page shows it
|
|
50
|
+
// without a hover.
|
|
51
|
+
|
|
52
|
+
export const DoDefineALabel: Story = {
|
|
53
|
+
tags: ['!dev'],
|
|
54
|
+
parameters: { layout: 'padded' },
|
|
55
|
+
name: 'Usage / Do: define the label next to it',
|
|
56
|
+
render: () => (
|
|
57
|
+
<Box pt="96px" px={16}>
|
|
58
|
+
<Card p={4} w="240px">
|
|
59
|
+
<HStack gap={1}>
|
|
60
|
+
<Subtext>활성 멤버</Subtext>
|
|
61
|
+
<InfoSprinkle
|
|
62
|
+
open
|
|
63
|
+
iconButtonProps={{ size: 'xs', 'aria-label': '활성 멤버 설명' }}
|
|
64
|
+
>
|
|
65
|
+
<Text maxW="220px">
|
|
66
|
+
최근 30일 동안 한 번 이상 대화한 멤버 수입니다.
|
|
67
|
+
</Text>
|
|
68
|
+
</InfoSprinkle>
|
|
69
|
+
</HStack>
|
|
70
|
+
<Text fontWeight="bold" fontSize="lg">
|
|
71
|
+
128
|
|
72
|
+
</Text>
|
|
73
|
+
</Card>
|
|
74
|
+
</Box>
|
|
75
|
+
),
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const DontHideTheRule: Story = {
|
|
79
|
+
tags: ['!dev'],
|
|
80
|
+
parameters: { layout: 'padded' },
|
|
81
|
+
name: "Usage / Don't: hide a rule the user must follow",
|
|
82
|
+
render: () => (
|
|
83
|
+
<Box pt="96px" px={16}>
|
|
84
|
+
<VStack align="stretch" gap={1} w="260px">
|
|
85
|
+
<HStack gap={1}>
|
|
86
|
+
<Text as="label" htmlFor="usage-password" fontWeight="semibold">
|
|
87
|
+
새 비밀번호
|
|
88
|
+
</Text>
|
|
89
|
+
<InfoSprinkle
|
|
90
|
+
open
|
|
91
|
+
iconButtonProps={{ size: 'xs', 'aria-label': '비밀번호 규칙' }}
|
|
92
|
+
>
|
|
93
|
+
<Text maxW="220px">
|
|
94
|
+
8자 이상, 숫자와 특수문자를 포함해야 합니다.
|
|
95
|
+
</Text>
|
|
96
|
+
</InfoSprinkle>
|
|
97
|
+
</HStack>
|
|
98
|
+
<Input id="usage-password" type="password" />
|
|
99
|
+
</VStack>
|
|
100
|
+
</Box>
|
|
101
|
+
),
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/** Tokens the trigger and card read: the icon colour from `InfoSprinkle.tsx`, the card from the Chakra HoverCard recipe. */
|
|
105
|
+
export const UsageTokens: Story = {
|
|
106
|
+
tags: ['!dev'],
|
|
107
|
+
parameters: { layout: 'padded' },
|
|
108
|
+
name: 'Usage / Tokens',
|
|
109
|
+
render: () => (
|
|
110
|
+
<TokenTable
|
|
111
|
+
rows={[
|
|
112
|
+
{ token: 'fg.muted', use: <T en="Icon" ko="아이콘" /> },
|
|
113
|
+
{ token: 'bg.panel', use: <T en="Card" ko="카드" /> },
|
|
114
|
+
]}
|
|
115
|
+
/>
|
|
116
|
+
),
|
|
117
|
+
};
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { ArgTypes, Canvas, Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import { En, Ko, LangToggle, Verdict } from '../../guidelines/_components/Lang';
|
|
4
|
+
import * as InfoSprinkleStories from './InfoSprinkle.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={InfoSprinkleStories} name="Usage" />
|
|
7
|
+
|
|
8
|
+
<LangToggle />
|
|
9
|
+
|
|
10
|
+
<En>
|
|
11
|
+
|
|
12
|
+
# InfoSprinkle
|
|
13
|
+
|
|
14
|
+
A small info icon next to a label that opens a card with a definition or a
|
|
15
|
+
short explanation, on hover, on focus, or on tap.
|
|
16
|
+
|
|
17
|
+
## When to use
|
|
18
|
+
|
|
19
|
+
- To define a term on a stat card or a table header: what "활성 멤버" counts,
|
|
20
|
+
whether a member count includes subgroups.
|
|
21
|
+
- To explain how a number is calculated, such as rounding.
|
|
22
|
+
- To say when something runs, such as an analysis schedule.
|
|
23
|
+
|
|
24
|
+
## When not to use
|
|
25
|
+
|
|
26
|
+
- A rule the user must follow to succeed (password rules, file limits) → put it
|
|
27
|
+
in visible helper text under the field.
|
|
28
|
+
- The name of an icon-only button → `Tooltip`.
|
|
29
|
+
- Content with links or controls → `Popover`.
|
|
30
|
+
- A warning or a status → `Banner` or `Badge`.
|
|
31
|
+
|
|
32
|
+
## Variants and what they mean
|
|
33
|
+
|
|
34
|
+
InfoSprinkle has no visual variants. Set the size and name of the icon with
|
|
35
|
+
`iconButtonProps`, the card's padding with `contentProps`, and its placement
|
|
36
|
+
with `positioning` (default `top`).
|
|
37
|
+
|
|
38
|
+
</En>
|
|
39
|
+
|
|
40
|
+
<Ko>
|
|
41
|
+
|
|
42
|
+
# InfoSprinkle
|
|
43
|
+
|
|
44
|
+
라벨 옆의 작은 정보 아이콘입니다. 포인터를 올리거나, 초점이 닿거나, 누르면 용어 설명이나
|
|
45
|
+
짧은 해설을 담은 카드가 열립니다.
|
|
46
|
+
|
|
47
|
+
## 언제 쓰나요
|
|
48
|
+
|
|
49
|
+
- 통계 카드나 표 머리글의 용어를 설명할 때: "활성 멤버"가 무엇을 세는지, 멤버 수에 하위
|
|
50
|
+
그룹이 들어가는지.
|
|
51
|
+
- 반올림처럼 숫자를 계산하는 방식을 설명할 때.
|
|
52
|
+
- 분석 일정처럼 무언가가 언제 실행되는지 알릴 때.
|
|
53
|
+
|
|
54
|
+
## 언제 쓰지 않나요
|
|
55
|
+
|
|
56
|
+
- 비밀번호 규칙이나 파일 제한처럼 사용자가 꼭 지켜야 하는 규칙은 입력란 아래에 눈에 보이는
|
|
57
|
+
도움말로 씁니다.
|
|
58
|
+
- 아이콘만 있는 버튼의 이름은 `Tooltip`으로 보입니다.
|
|
59
|
+
- 링크나 컨트롤이 들어가는 내용은 `Popover`에 넣습니다.
|
|
60
|
+
- 경고나 상태는 `Banner`나 `Badge`로 알립니다.
|
|
61
|
+
|
|
62
|
+
## 변형과 뜻
|
|
63
|
+
|
|
64
|
+
InfoSprinkle에는 모양 변형이 없습니다. 아이콘의 크기와 이름은 `iconButtonProps`로,
|
|
65
|
+
카드 여백은 `contentProps`로, 위치는 `positioning`(기본 `top`)으로 정합니다.
|
|
66
|
+
|
|
67
|
+
</Ko>
|
|
68
|
+
|
|
69
|
+
<ArgTypes of={InfoSprinkleStories} include={['iconButtonProps', 'contentProps', 'baseFontSize']} />
|
|
70
|
+
|
|
71
|
+
<En>
|
|
72
|
+
|
|
73
|
+
## Do / Don't
|
|
74
|
+
|
|
75
|
+
</En>
|
|
76
|
+
|
|
77
|
+
<Ko>
|
|
78
|
+
|
|
79
|
+
## 이렇게 하세요 / 이렇게 하지 마세요
|
|
80
|
+
|
|
81
|
+
</Ko>
|
|
82
|
+
|
|
83
|
+
<Canvas of={InfoSprinkleStories.DoDefineALabel} />
|
|
84
|
+
<Verdict
|
|
85
|
+
kind="do"
|
|
86
|
+
en="Put it right after the label it explains, and name the icon after that label ('활성 멤버 설명')."
|
|
87
|
+
ko="설명하는 라벨 바로 뒤에 두고, 아이콘 이름도 그 라벨을 따라 붙입니다('활성 멤버 설명')."
|
|
88
|
+
/>
|
|
89
|
+
|
|
90
|
+
<Canvas of={InfoSprinkleStories.DontHideTheRule} />
|
|
91
|
+
<Verdict
|
|
92
|
+
kind="dont"
|
|
93
|
+
en="Hide a rule the user must follow behind the icon. Most people will not open it, and they find out only when the form is rejected. Show the rule under the field."
|
|
94
|
+
ko="꼭 지켜야 하는 규칙을 아이콘 뒤에 숨기지 마세요. 대부분은 열어 보지 않고, 양식이 거부된 뒤에야 알게 됩니다. 규칙은 입력란 아래에 보이게 씁니다."
|
|
95
|
+
/>
|
|
96
|
+
|
|
97
|
+
<En>
|
|
98
|
+
|
|
99
|
+
## Content
|
|
100
|
+
|
|
101
|
+
- One or two sentences that define or explain. Full stops, sentence case.
|
|
102
|
+
- Start with the answer: "최근 30일 동안 한 번 이상 대화한 멤버 수입니다.", not
|
|
103
|
+
"이 숫자는 …를 뜻합니다".
|
|
104
|
+
- No links or buttons inside; the card closes as soon as the pointer or focus
|
|
105
|
+
leaves the icon.
|
|
106
|
+
|
|
107
|
+
## Accessibility
|
|
108
|
+
|
|
109
|
+
What InfoSprinkle does for you:
|
|
110
|
+
|
|
111
|
+
- The trigger is a real `IconButton`, so it is reachable with `Tab`
|
|
112
|
+
(WCAG 2.1.1). The card opens on hover and on focus, and on tap on touch
|
|
113
|
+
devices that have no hover.
|
|
114
|
+
- The card is portalled and closes when the pointer or focus moves away.
|
|
115
|
+
|
|
116
|
+
What you still have to do:
|
|
117
|
+
|
|
118
|
+
- **Name each icon.** The default `aria-label` is the English "Info", and every
|
|
119
|
+
icon on the screen gets the same one. Pass a name through `iconButtonProps`
|
|
120
|
+
that says what it explains: `'aria-label': '활성 멤버 설명'` (WCAG 2.4.6,
|
|
121
|
+
4.1.2).
|
|
122
|
+
- **Do not rely on screen readers reading the card.** It is a Chakra
|
|
123
|
+
`HoverCard`: the trigger has no `aria-describedby` or `aria-expanded`
|
|
124
|
+
pointing at it, and the card sits at the end of the page. Keep the
|
|
125
|
+
information a screen reader user needs in visible text or in the label.
|
|
126
|
+
- Do not put the only copy of required information in it.
|
|
127
|
+
|
|
128
|
+
## Tokens
|
|
129
|
+
|
|
130
|
+
The icon colour is set in `InfoSprinkle.tsx`; the card colour comes from
|
|
131
|
+
Chakra's HoverCard recipe.
|
|
132
|
+
|
|
133
|
+
</En>
|
|
134
|
+
|
|
135
|
+
<Ko>
|
|
136
|
+
|
|
137
|
+
## 문구
|
|
138
|
+
|
|
139
|
+
- 용어를 정의하거나 해설하는 한두 문장을 씁니다. 마침표를 찍습니다.
|
|
140
|
+
- 답부터 씁니다. "이 숫자는 …를 뜻합니다"가 아니라 "최근 30일 동안 한 번 이상 대화한
|
|
141
|
+
멤버 수입니다."처럼 씁니다.
|
|
142
|
+
- 안에 링크나 버튼을 넣지 않습니다. 포인터나 초점이 아이콘을 떠나면 카드가 바로 닫힙니다.
|
|
143
|
+
|
|
144
|
+
## 접근성
|
|
145
|
+
|
|
146
|
+
InfoSprinkle이 알아서 하는 일
|
|
147
|
+
|
|
148
|
+
- 여는 요소가 실제 `IconButton`이라 `Tab`으로 닿을 수 있습니다(WCAG 2.1.1). 포인터를
|
|
149
|
+
올리거나 초점이 닿으면 카드가 열리고, 마우스 올리기가 없는 터치 기기에서는 누르면
|
|
150
|
+
열립니다.
|
|
151
|
+
- 카드는 포털로 그려지며, 포인터나 초점이 떠나면 닫힙니다.
|
|
152
|
+
|
|
153
|
+
직접 챙겨야 하는 일
|
|
154
|
+
|
|
155
|
+
- **아이콘마다 이름을 붙입니다.** 기본 `aria-label`은 영어 "Info"라서 화면의 모든 아이콘이
|
|
156
|
+
같은 이름을 갖게 됩니다. `iconButtonProps`로 무엇을 설명하는지 밝힌 이름을 넘깁니다.
|
|
157
|
+
예: `'aria-label': '활성 멤버 설명'`(WCAG 2.4.6, 4.1.2).
|
|
158
|
+
- **화면 낭독기가 카드를 읽어 줄 것이라 기대하지 않습니다.** Chakra `HoverCard`라서
|
|
159
|
+
여는 버튼에 카드를 가리키는 `aria-describedby`나 `aria-expanded`가 없고, 카드는 페이지
|
|
160
|
+
맨 끝에 붙습니다. 화면 낭독기 사용자에게 필요한 정보는 보이는 문구나 라벨에 둡니다.
|
|
161
|
+
- 꼭 필요한 정보를 이 카드에만 두지 않습니다.
|
|
162
|
+
|
|
163
|
+
## 토큰
|
|
164
|
+
|
|
165
|
+
아이콘 색은 `InfoSprinkle.tsx`에서, 카드 색은 Chakra HoverCard 레시피에서 정합니다.
|
|
166
|
+
|
|
167
|
+
</Ko>
|
|
168
|
+
|
|
169
|
+
<Canvas of={InfoSprinkleStories.UsageTokens} sourceState="none" />
|
|
170
|
+
|
|
171
|
+
<En>
|
|
172
|
+
|
|
173
|
+
## Related
|
|
174
|
+
|
|
175
|
+
- **Tooltip**: the name of an icon-only button.
|
|
176
|
+
- **Popover**: a panel with links or controls.
|
|
177
|
+
- **FormControl**: helper text under a field, for rules the user must follow.
|
|
178
|
+
|
|
179
|
+
</En>
|
|
180
|
+
|
|
181
|
+
<Ko>
|
|
182
|
+
|
|
183
|
+
## 관련 컴포넌트
|
|
184
|
+
|
|
185
|
+
- **Tooltip**: 아이콘만 있는 버튼의 이름.
|
|
186
|
+
- **Popover**: 링크나 컨트롤이 있는 패널.
|
|
187
|
+
- **FormControl**: 사용자가 지켜야 하는 규칙을 담는 입력란 아래 도움말.
|
|
188
|
+
|
|
189
|
+
</Ko>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
import { T } from '../../guidelines/_components/Lang';
|
|
4
|
+
import { TokenTable } from '../../guidelines/_components/TokenTable';
|
|
5
|
+
import { Text } from '../Typography';
|
|
6
|
+
import { InlineCode } from './InlineCode';
|
|
7
|
+
|
|
8
|
+
const meta = {
|
|
9
|
+
title: 'Components/InlineCode',
|
|
10
|
+
component: InlineCode,
|
|
11
|
+
args: {
|
|
12
|
+
children: 'model_id',
|
|
13
|
+
},
|
|
14
|
+
} satisfies Meta<typeof InlineCode>;
|
|
15
|
+
|
|
16
|
+
export default meta;
|
|
17
|
+
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
|
|
20
|
+
export const Basic: Story = {};
|
|
21
|
+
|
|
22
|
+
/** In running text, where it is meant to be used. */
|
|
23
|
+
export const InSentence: Story = {
|
|
24
|
+
render: (args) => (
|
|
25
|
+
<Text>
|
|
26
|
+
요청 본문의 <InlineCode {...args} /> 칸에 모델 이름을 넣습니다.
|
|
27
|
+
</Text>
|
|
28
|
+
),
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// ───────────────────────── Usage-page specimens ─────────────────────────
|
|
32
|
+
// Pulled into `InlineCode.usage.mdx` with <Canvas of={…} />. Hidden from the
|
|
33
|
+
// sidebar (`!dev`); `tags` is written out on each story because the indexer
|
|
34
|
+
// reads CSF statically.
|
|
35
|
+
|
|
36
|
+
export const DoIdentifierInSentence: Story = {
|
|
37
|
+
tags: ['!dev'],
|
|
38
|
+
parameters: { layout: 'padded' },
|
|
39
|
+
name: 'Usage / Do: names the user types or sees in code',
|
|
40
|
+
render: () => (
|
|
41
|
+
<Text>
|
|
42
|
+
응답이 끊기면 <InlineCode>finish_reason</InlineCode> 값이{' '}
|
|
43
|
+
<InlineCode>length</InlineCode>인지 확인하세요.
|
|
44
|
+
</Text>
|
|
45
|
+
),
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const DontEmphasis: Story = {
|
|
49
|
+
tags: ['!dev'],
|
|
50
|
+
parameters: { layout: 'padded' },
|
|
51
|
+
name: "Usage / Don't: code styling for emphasis",
|
|
52
|
+
render: () => (
|
|
53
|
+
<Text>
|
|
54
|
+
이 작업은 <InlineCode>되돌릴 수 없습니다</InlineCode>.
|
|
55
|
+
</Text>
|
|
56
|
+
),
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const UsageTokens: Story = {
|
|
60
|
+
tags: ['!dev'],
|
|
61
|
+
parameters: { layout: 'padded' },
|
|
62
|
+
name: 'Usage / Tokens',
|
|
63
|
+
render: () => (
|
|
64
|
+
<TokenTable
|
|
65
|
+
rows={[
|
|
66
|
+
{ token: 'bg.subtle', use: <T en="Chip fill" ko="칩 배경" /> },
|
|
67
|
+
{ token: 'fg.default', use: <T en="Text" ko="글자" /> },
|
|
68
|
+
{
|
|
69
|
+
token: 'border.subtle',
|
|
70
|
+
use: <T en="1px ring (box-shadow)" ko="1px 테두리(box-shadow)" />,
|
|
71
|
+
},
|
|
72
|
+
]}
|
|
73
|
+
/>
|
|
74
|
+
),
|
|
75
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { Canvas, Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import { En, Ko, LangToggle, Verdict } from '../../guidelines/_components/Lang';
|
|
4
|
+
import * as InlineCodeStories from './InlineCode.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={InlineCodeStories} name="Usage" />
|
|
7
|
+
|
|
8
|
+
<LangToggle />
|
|
9
|
+
|
|
10
|
+
<En>
|
|
11
|
+
|
|
12
|
+
# InlineCode
|
|
13
|
+
|
|
14
|
+
Code inside a sentence: a field name, a value, a shortcut. A small chip one
|
|
15
|
+
size below the text around it (`textStyle="subtext"`, em-relative), with a
|
|
16
|
+
`bg.subtle` fill and a hairline ring.
|
|
17
|
+
|
|
18
|
+
## When to use
|
|
19
|
+
|
|
20
|
+
- Identifiers the user types or will see in code or settings:
|
|
21
|
+
`finish_reason`, `model_id`, a file name.
|
|
22
|
+
|
|
23
|
+
## When not to use
|
|
24
|
+
|
|
25
|
+
- More than one line → `Code`.
|
|
26
|
+
- A value the user only needs to copy → `CopyableCode`.
|
|
27
|
+
- Emphasis or warnings → plain text, bold if it must stand out.
|
|
28
|
+
- Keyboard keys in instructions → write them out (Ctrl + C); the chip says
|
|
29
|
+
"code", not "key".
|
|
30
|
+
|
|
31
|
+
## Do / Don't
|
|
32
|
+
|
|
33
|
+
</En>
|
|
34
|
+
|
|
35
|
+
<Ko>
|
|
36
|
+
|
|
37
|
+
# InlineCode
|
|
38
|
+
|
|
39
|
+
문장 안의 코드입니다. 필드 이름, 값, 단축키 같은 것을 씁니다. 주변 글자보다 한 단계
|
|
40
|
+
작은 칩으로 그려지고(`textStyle="subtext"`, em 단위), `bg.subtle` 배경과 얇은 테두리가
|
|
41
|
+
있습니다.
|
|
42
|
+
|
|
43
|
+
## 언제 쓰나요
|
|
44
|
+
|
|
45
|
+
- 사용자가 직접 입력하거나 코드·설정에서 보게 될 식별자: `finish_reason`,
|
|
46
|
+
`model_id`, 파일 이름.
|
|
47
|
+
|
|
48
|
+
## 언제 쓰지 않나요
|
|
49
|
+
|
|
50
|
+
- 두 줄 이상이라면 `Code`를 씁니다.
|
|
51
|
+
- 복사만 하면 되는 값은 `CopyableCode`를 씁니다.
|
|
52
|
+
- 강조나 경고에는 일반 글자를 쓰고, 꼭 눈에 띄어야 하면 굵게 씁니다.
|
|
53
|
+
- 안내문의 키보드 키는 글자로 씁니다(Ctrl + C). 이 칩은 '코드'라는 뜻이지 '키'라는
|
|
54
|
+
뜻이 아닙니다.
|
|
55
|
+
|
|
56
|
+
## 이렇게 하세요 / 이렇게 하지 마세요
|
|
57
|
+
|
|
58
|
+
</Ko>
|
|
59
|
+
|
|
60
|
+
<Canvas of={InlineCodeStories.DoIdentifierInSentence} />
|
|
61
|
+
<Verdict
|
|
62
|
+
kind="do"
|
|
63
|
+
en="Mark names and values the user will meet in code."
|
|
64
|
+
ko="사용자가 코드에서 만나게 될 이름과 값을 표시합니다."
|
|
65
|
+
/>
|
|
66
|
+
|
|
67
|
+
<Canvas of={InlineCodeStories.DontEmphasis} />
|
|
68
|
+
<Verdict
|
|
69
|
+
kind="dont"
|
|
70
|
+
en="Use code styling to make words stand out. It tells the reader the words are code."
|
|
71
|
+
ko="말을 돋보이게 하려고 코드 모양을 쓰지 마세요. 읽는 사람은 그 말을 코드로 받아들입니다."
|
|
72
|
+
/>
|
|
73
|
+
|
|
74
|
+
<En>
|
|
75
|
+
|
|
76
|
+
## Content
|
|
77
|
+
|
|
78
|
+
- Write the identifier exactly as it appears, including case.
|
|
79
|
+
- Keep Korean particles outside the chip: `length`인지, not `length인지`.
|
|
80
|
+
|
|
81
|
+
## Accessibility
|
|
82
|
+
|
|
83
|
+
What InlineCode does for you:
|
|
84
|
+
|
|
85
|
+
- It renders `<code>`, so assistive technology that reports code can, and
|
|
86
|
+
the chip ring keeps it visible on `bg.sunken`, where the fill alone would
|
|
87
|
+
vanish.
|
|
88
|
+
|
|
89
|
+
What you still have to do:
|
|
90
|
+
|
|
91
|
+
- Nothing in the chip is read differently by most screen readers. Do not
|
|
92
|
+
rely on the code styling to carry meaning (WCAG 1.3.1); the sentence must
|
|
93
|
+
make sense on its own.
|
|
94
|
+
|
|
95
|
+
## Tokens
|
|
96
|
+
|
|
97
|
+
</En>
|
|
98
|
+
|
|
99
|
+
<Ko>
|
|
100
|
+
|
|
101
|
+
## 문구
|
|
102
|
+
|
|
103
|
+
- 식별자는 대소문자까지 보이는 그대로 씁니다.
|
|
104
|
+
- 한국어 조사는 칩 밖에 둡니다. `length인지`가 아니라 `length`인지로 씁니다.
|
|
105
|
+
|
|
106
|
+
## 접근성
|
|
107
|
+
|
|
108
|
+
InlineCode가 알아서 하는 일
|
|
109
|
+
|
|
110
|
+
- `<code>`로 그리므로 코드를 구분해 알려 주는 보조 기술은 그렇게 읽습니다. 배경만으로는
|
|
111
|
+
`bg.sunken` 위에서 칩이 사라지기 때문에 테두리를 둡니다.
|
|
112
|
+
|
|
113
|
+
직접 챙겨야 하는 일
|
|
114
|
+
|
|
115
|
+
- 대부분의 화면 낭독기는 칩 안의 글자를 다르게 읽지 않습니다. 코드 모양에 뜻을 맡기지
|
|
116
|
+
말고(WCAG 1.3.1), 문장만으로 뜻이 통하게 씁니다.
|
|
117
|
+
|
|
118
|
+
## 토큰
|
|
119
|
+
|
|
120
|
+
</Ko>
|
|
121
|
+
|
|
122
|
+
<Canvas of={InlineCodeStories.UsageTokens} sourceState="none" />
|
|
123
|
+
|
|
124
|
+
<En>
|
|
125
|
+
|
|
126
|
+
## Related
|
|
127
|
+
|
|
128
|
+
- **Code**: multi-line code.
|
|
129
|
+
- **CopyableCode**: a value with a copy button.
|
|
130
|
+
- **Typography**: the text InlineCode sits in.
|
|
131
|
+
|
|
132
|
+
</En>
|
|
133
|
+
|
|
134
|
+
<Ko>
|
|
135
|
+
|
|
136
|
+
## 관련 컴포넌트
|
|
137
|
+
|
|
138
|
+
- **Code**: 여러 줄 코드.
|
|
139
|
+
- **CopyableCode**: 복사 버튼이 있는 값.
|
|
140
|
+
- **Typography**: InlineCode가 들어가는 본문.
|
|
141
|
+
|
|
142
|
+
</Ko>
|
|
@@ -3,6 +3,9 @@ import { Meta, StoryObj } from '@storybook/react';
|
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
|
|
5
5
|
import { PhoneFilledIcon, SearchIcon, MailIcon } from '@/components/Icon';
|
|
6
|
+
import { T } from '../../guidelines/_components/Lang';
|
|
7
|
+
import { TokenTable } from '../../guidelines/_components/TokenTable';
|
|
8
|
+
import { FieldRow } from '../Form';
|
|
6
9
|
import { MaxLengthIndicator } from '../MaxLengthIndicator';
|
|
7
10
|
|
|
8
11
|
import { Input } from './Input';
|
|
@@ -257,3 +260,180 @@ export const FocusState: Story = {
|
|
|
257
260
|
);
|
|
258
261
|
},
|
|
259
262
|
};
|
|
263
|
+
|
|
264
|
+
// ───────────────────────── Usage-page specimens ─────────────────────────
|
|
265
|
+
// Pulled into `Input.usage.mdx` with <Canvas of={…} />. Hidden from the
|
|
266
|
+
// sidebar (`!dev`); `tags` is written out on each story because the indexer
|
|
267
|
+
// reads CSF statically.
|
|
268
|
+
|
|
269
|
+
export const DoLabelAbove: Story = {
|
|
270
|
+
tags: ['!dev'],
|
|
271
|
+
parameters: { layout: 'padded' },
|
|
272
|
+
name: 'Usage / Do: a label above the field',
|
|
273
|
+
render: () => (
|
|
274
|
+
<Box maxW="360px">
|
|
275
|
+
<FieldRow
|
|
276
|
+
label="업무용 이메일"
|
|
277
|
+
helperText="초대 메일이 이 주소로 갑니다."
|
|
278
|
+
required
|
|
279
|
+
>
|
|
280
|
+
<Input
|
|
281
|
+
type="email"
|
|
282
|
+
autoComplete="email"
|
|
283
|
+
placeholder="name@company.com"
|
|
284
|
+
/>
|
|
285
|
+
</FieldRow>
|
|
286
|
+
</Box>
|
|
287
|
+
),
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
export const DontPlaceholderAsLabel: Story = {
|
|
291
|
+
tags: ['!dev'],
|
|
292
|
+
parameters: { layout: 'padded' },
|
|
293
|
+
name: "Usage / Don't: the placeholder as the label",
|
|
294
|
+
render: () => (
|
|
295
|
+
<Box maxW="360px">
|
|
296
|
+
<Input type="email" placeholder="업무용 이메일" />
|
|
297
|
+
</Box>
|
|
298
|
+
),
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
export const DoErrorInWords: Story = {
|
|
302
|
+
tags: ['!dev'],
|
|
303
|
+
parameters: { layout: 'padded' },
|
|
304
|
+
name: 'Usage / Do: say what is wrong, under the field',
|
|
305
|
+
render: () => (
|
|
306
|
+
<Box maxW="360px">
|
|
307
|
+
<FieldRow label="업무용 이메일" error="이메일 주소 형식이 아닙니다.">
|
|
308
|
+
<Input type="email" value="name@company" onChange={() => {}} />
|
|
309
|
+
</FieldRow>
|
|
310
|
+
</Box>
|
|
311
|
+
),
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
export const DontBorderOnly: Story = {
|
|
315
|
+
tags: ['!dev'],
|
|
316
|
+
parameters: { layout: 'padded' },
|
|
317
|
+
name: "Usage / Don't: a red border and nothing else",
|
|
318
|
+
render: () => (
|
|
319
|
+
<Box maxW="360px">
|
|
320
|
+
<Input type="email" value="name@company" onChange={() => {}} invalid />
|
|
321
|
+
</Box>
|
|
322
|
+
),
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
export const DoMaskedAmount: Story = {
|
|
326
|
+
tags: ['!dev'],
|
|
327
|
+
parameters: { layout: 'padded' },
|
|
328
|
+
name: 'Usage / Do: maskNumber for amounts',
|
|
329
|
+
render: () => {
|
|
330
|
+
const [value, setValue] = useState('2000000');
|
|
331
|
+
return (
|
|
332
|
+
<Box maxW="360px">
|
|
333
|
+
<FieldRow
|
|
334
|
+
label="월 크레딧 한도"
|
|
335
|
+
helperText={`저장되는 값: ${value || '(비어 있음)'}`}
|
|
336
|
+
>
|
|
337
|
+
<Input
|
|
338
|
+
type="number"
|
|
339
|
+
maskNumber
|
|
340
|
+
value={value}
|
|
341
|
+
onChange={(e) => setValue(e.target.value)}
|
|
342
|
+
/>
|
|
343
|
+
</FieldRow>
|
|
344
|
+
</Box>
|
|
345
|
+
);
|
|
346
|
+
},
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
export const DoCountWithLimit: Story = {
|
|
350
|
+
tags: ['!dev'],
|
|
351
|
+
parameters: { layout: 'padded' },
|
|
352
|
+
name: 'Usage / Do: show the limit next to maxLength',
|
|
353
|
+
render: () => {
|
|
354
|
+
const [value, setValue] = useState('마케팅팀');
|
|
355
|
+
return (
|
|
356
|
+
<Box maxW="360px">
|
|
357
|
+
<FieldRow
|
|
358
|
+
label="그룹 이름"
|
|
359
|
+
endAdornment={
|
|
360
|
+
<MaxLengthIndicator value={value.length} maxLength={20} />
|
|
361
|
+
}
|
|
362
|
+
>
|
|
363
|
+
<Input
|
|
364
|
+
maxLength={20}
|
|
365
|
+
value={value}
|
|
366
|
+
onChange={(e) => setValue(e.target.value)}
|
|
367
|
+
/>
|
|
368
|
+
</FieldRow>
|
|
369
|
+
</Box>
|
|
370
|
+
);
|
|
371
|
+
},
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Tokens Input reads. Input has no styles file — the values are written in
|
|
376
|
+
* `Input.tsx` (and mirrored by `Select.styles.ts`); this list follows that file.
|
|
377
|
+
*/
|
|
378
|
+
export const UsageTokens: Story = {
|
|
379
|
+
tags: ['!dev'],
|
|
380
|
+
parameters: { layout: 'padded' },
|
|
381
|
+
name: 'Usage / Tokens',
|
|
382
|
+
render: () => (
|
|
383
|
+
<TokenTable
|
|
384
|
+
rows={[
|
|
385
|
+
{
|
|
386
|
+
token: 'bg.surface',
|
|
387
|
+
use: <T en="Field background" ko="입력란 배경" />,
|
|
388
|
+
},
|
|
389
|
+
{ token: 'fg.default', use: <T en="Typed text" ko="입력한 글자" /> },
|
|
390
|
+
{
|
|
391
|
+
token: 'border.control',
|
|
392
|
+
use: (
|
|
393
|
+
<T
|
|
394
|
+
en="Border at rest (3:1 against the page)"
|
|
395
|
+
ko="평소 테두리(배경과 3:1)"
|
|
396
|
+
/>
|
|
397
|
+
),
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
token: 'fg.icon',
|
|
401
|
+
use: <T en="Border on hover" ko="마우스를 올렸을 때 테두리" />,
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
token: 'primary.main',
|
|
405
|
+
use: (
|
|
406
|
+
<T
|
|
407
|
+
en="Border and 1px ring on focus"
|
|
408
|
+
ko="초점을 받았을 때 테두리와 1px 링"
|
|
409
|
+
/>
|
|
410
|
+
),
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
token: 'danger.solid',
|
|
414
|
+
use: <T en="Border when invalid" ko="오류 상태 테두리" />,
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
token: 'bg.subtle',
|
|
418
|
+
use: <T en="Read-only background" ko="읽기 전용 배경" />,
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
token: 'fg.muted',
|
|
422
|
+
use: <T en="Read-only text" ko="읽기 전용 글자" />,
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
token: 'border.subtle',
|
|
426
|
+
use: <T en="Read-only border" ko="읽기 전용 테두리" />,
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
token: 'disabled.bg',
|
|
430
|
+
use: <T en="Disabled background" ko="비활성 배경" />,
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
token: 'disabled.fg',
|
|
434
|
+
use: <T en="Disabled text" ko="비활성 글자" />,
|
|
435
|
+
},
|
|
436
|
+
]}
|
|
437
|
+
/>
|
|
438
|
+
),
|
|
439
|
+
};
|