@conscience-technology/ovenn 0.7.0 → 0.7.2
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/assets/components/AIMessage/AIMessage.module.css +21 -0
- package/assets/components/AIMessage/AIMessage.tsx +27 -7
- package/assets/components/AttachmentItem/AttachmentItem.module.css +41 -10
- package/assets/components/AttachmentItem/AttachmentItem.tsx +25 -8
- package/assets/components/AttachmentThumb/AttachmentThumb.module.css +9 -10
- package/assets/components/Callout/Callout.module.css +53 -7
- package/assets/components/Callout/Callout.tsx +26 -2
- package/assets/components/Callout/index.ts +1 -1
- package/assets/components/ChatComposer/ChatComposer.module.css +17 -0
- package/assets/components/ChatComposer/ChatComposer.tsx +131 -0
- package/assets/components/ChatComposer/index.ts +2 -0
- package/assets/components/ChatInput/ChatInput.module.css +192 -30
- package/assets/components/ChatInput/ChatInput.tsx +137 -45
- package/assets/components/ChatInput/SendButton.tsx +4 -1
- package/assets/components/ChatInput/index.ts +5 -0
- package/assets/components/ChatMessage/ChatMessage.module.css +19 -0
- package/assets/components/ChatMessage/ChatMessage.tsx +63 -0
- package/assets/components/ChatMessage/index.ts +2 -0
- package/assets/components/ChatReactions/ChatReactions.module.css +15 -0
- package/assets/components/ChatReactions/ChatReactions.tsx +58 -0
- package/assets/components/ChatReactions/index.ts +2 -0
- package/assets/components/CodeBlock/CodeBlock.module.css +106 -10
- package/assets/components/CodeBlock/CodeBlock.tsx +114 -29
- package/assets/components/CodeBlock/SyntaxHighlight.tsx +20 -0
- package/assets/components/CodeBlock/diff-lines.ts +21 -0
- package/assets/components/CodeBlock/index.ts +2 -1
- package/assets/components/CodeBlock/line-preview.ts +7 -0
- package/assets/components/CodeBlock/syntax-highlighter.ts +96 -0
- package/assets/components/CodeBlock/use-syntax-tokens.ts +17 -0
- package/assets/components/ColorField/ColorField.module.css +19 -196
- package/assets/components/ColorField/ColorField.tsx +116 -109
- package/assets/components/Combobox/Combobox.module.css +21 -4
- package/assets/components/Combobox/Combobox.tsx +37 -21
- package/assets/components/CommandPalette/CommandPalette.module.css +1 -1
- package/assets/components/ControlGroup/ControlGroup.module.css +13 -6
- package/assets/components/DatePicker/DateField.tsx +72 -25
- package/assets/components/DatePicker/DatePicker.module.css +28 -59
- package/assets/components/DatePicker/DatePicker.tsx +76 -40
- package/assets/components/Drawer/Drawer.module.css +12 -15
- package/assets/components/Drawer/Drawer.tsx +15 -23
- package/assets/components/EmojiPicker/EmojiGlyph.module.css +2 -0
- package/assets/components/EmojiPicker/EmojiGlyph.tsx +12 -0
- package/assets/components/EmojiPicker/EmojiPicker.module.css +43 -0
- package/assets/components/EmojiPicker/EmojiPicker.tsx +143 -0
- package/assets/components/EmojiPicker/UNICODE-LICENSE.txt +39 -0
- package/assets/components/EmojiPicker/data.ts +41 -0
- package/assets/components/EmojiPicker/emojiData-0.json +1 -0
- package/assets/components/EmojiPicker/emojiData-1.json +1 -0
- package/assets/components/EmojiPicker/emojiData-2.json +1 -0
- package/assets/components/EmojiPicker/emojiData-3.json +1 -0
- package/assets/components/EmojiPicker/emojiData.sources.json +35 -0
- package/assets/components/EmojiPicker/emojiData.ts +8 -0
- package/assets/components/EmojiPicker/emojiFallbacks.json +1 -0
- package/assets/components/EmojiPicker/index.ts +4 -0
- package/assets/components/EmptyState/EmptyState.module.css +2 -2
- package/assets/components/FileIcon/FileIcon.module.css +4 -6
- package/assets/components/Icon/LucideFamilyIcon.tsx +2 -0
- package/assets/components/Icon/SolarFamilyIcon.tsx +4 -0
- package/assets/components/Input/Input.module.css +33 -10
- package/assets/components/Input/Input.tsx +20 -9
- package/assets/components/MessageActions/MessageActions.module.css +2 -2
- package/assets/components/Onboarding/Onboarding.module.css +1 -1
- package/assets/components/ProgressBar/ProgressBar.module.css +38 -4
- package/assets/components/ProgressBar/ProgressBar.tsx +5 -1
- package/assets/components/RadioCard/RadioCard.module.css +18 -0
- package/assets/components/RadioCard/RadioCard.tsx +48 -7
- package/assets/components/Select/Select.module.css +9 -7
- package/assets/components/Select/Select.tsx +15 -2
- package/assets/components/Tabs/Tabs.module.css +1 -1
- package/assets/components/Tabs/Tabs.tsx +2 -2
- package/assets/components/Textarea/Textarea.module.css +28 -231
- package/assets/components/Textarea/Textarea.tsx +2 -2
- package/assets/components/TimePicker/TimePicker.module.css +16 -4
- package/assets/components/TimePicker/TimePicker.tsx +66 -8
- package/assets/components/Toast/Toast.module.css +18 -0
- package/assets/components/Toast/Toast.tsx +1 -1
- package/assets/components/Tooltip/Tooltip.tsx +33 -7
- package/assets/components/UserMessage/UserMessage.module.css +110 -1
- package/assets/components/UserMessage/UserMessage.tsx +138 -16
- package/assets/components/UserMessage/index.ts +4 -0
- package/assets/components/_data.ts +10 -5
- package/assets/components/_utils.css +31 -5
- package/assets/components/component-registry.json +1595 -107
- package/assets/components/index.ts +7 -0
- package/assets/components/tokens.css +83 -0
- package/assets/prompts/ASSEMBLY.md +11 -0
- package/assets/prompts/CATALOG.md +110 -106
- package/assets/prompts/PRINCIPLES.md +11 -1
- package/assets/prompts/TEMPLATE_PREVIEWS.md +21 -0
- package/assets/prompts/WORKFLOW_DESIGN.md +2 -0
- package/assets/prompts/axes/font.md +6 -0
- package/assets/prompts/axes/material.md +1 -1
- package/assets/prompts/axes/motion.md +2 -0
- package/assets/prompts/axes/palette.md +9 -2
- package/assets/prompts/axes/voice.md +4 -0
- package/assets/prompts/components/README.md +3 -3
- package/assets/prompts/components/_variants.md +35 -35
- package/assets/prompts/components/accordion.md +15 -15
- package/assets/prompts/components/ai-message.md +14 -12
- package/assets/prompts/components/app-frame.md +16 -16
- package/assets/prompts/components/attachment-item.md +36 -30
- package/assets/prompts/components/attachment-thumb.md +14 -12
- package/assets/prompts/components/avatar-upload.md +10 -10
- package/assets/prompts/components/avatar.md +16 -16
- package/assets/prompts/components/badge.md +4 -4
- package/assets/prompts/components/breadcrumb.md +24 -24
- package/assets/prompts/components/bubble.md +13 -13
- package/assets/prompts/components/button-group.md +1 -1
- package/assets/prompts/components/button.md +36 -36
- package/assets/prompts/components/calendar.md +29 -29
- package/assets/prompts/components/callout.md +39 -23
- package/assets/prompts/components/canvas-edge.md +5 -2
- package/assets/prompts/components/canvas-node.md +3 -3
- package/assets/prompts/components/canvas.md +5 -2
- package/assets/prompts/components/card.md +21 -21
- package/assets/prompts/components/chart-bar.md +7 -7
- package/assets/prompts/components/chart-pie.md +3 -3
- package/assets/prompts/components/chart-radar.md +3 -3
- package/assets/prompts/components/chart-radial.md +4 -4
- package/assets/prompts/components/chat-composer.md +71 -0
- package/assets/prompts/components/chat-input.md +82 -27
- package/assets/prompts/components/chat-message.md +48 -0
- package/assets/prompts/components/chat-reactions.md +38 -0
- package/assets/prompts/components/checkbox-card.md +3 -3
- package/assets/prompts/components/checkbox.md +17 -17
- package/assets/prompts/components/chip.md +32 -32
- package/assets/prompts/components/code-block.md +109 -66
- package/assets/prompts/components/code.md +4 -4
- package/assets/prompts/components/color-area.md +9 -9
- package/assets/prompts/components/color-field.md +17 -13
- package/assets/prompts/components/color-picker.md +6 -6
- package/assets/prompts/components/color-slider.md +8 -8
- package/assets/prompts/components/color-swatch-picker.md +8 -8
- package/assets/prompts/components/color-swatch.md +9 -9
- package/assets/prompts/components/combobox.md +5 -2
- package/assets/prompts/components/command-palette.md +26 -26
- package/assets/prompts/components/comment.md +5 -2
- package/assets/prompts/components/context-menu.md +22 -22
- package/assets/prompts/components/control-group.md +4 -4
- package/assets/prompts/components/date-picker.md +31 -23
- package/assets/prompts/components/disclosure.md +10 -10
- package/assets/prompts/components/drawer.md +19 -18
- package/assets/prompts/components/dropdown-menu.md +21 -21
- package/assets/prompts/components/emoji-picker.md +45 -0
- package/assets/prompts/components/empty-state.md +20 -18
- package/assets/prompts/components/event-chip.md +11 -11
- package/assets/prompts/components/event-list-item.md +21 -21
- package/assets/prompts/components/file-icon.md +18 -19
- package/assets/prompts/components/gallery-item.md +19 -19
- package/assets/prompts/components/generated-image.md +10 -10
- package/assets/prompts/components/hint.md +19 -19
- package/assets/prompts/components/icon-button.md +16 -16
- package/assets/prompts/components/icon.md +12 -9
- package/assets/prompts/components/input.md +49 -46
- package/assets/prompts/components/kanban.md +34 -34
- package/assets/prompts/components/list-item.md +39 -39
- package/assets/prompts/components/menu-item.md +41 -41
- package/assets/prompts/components/message-actions.md +6 -6
- package/assets/prompts/components/message-quote.md +7 -7
- package/assets/prompts/components/message-sources.md +10 -10
- package/assets/prompts/components/message-state.md +17 -17
- package/assets/prompts/components/message-table.md +5 -5
- package/assets/prompts/components/mini-calendar.md +6 -1
- package/assets/prompts/components/modal.md +39 -39
- package/assets/prompts/components/multi-select.md +4 -1
- package/assets/prompts/components/onboarding.md +19 -19
- package/assets/prompts/components/page-header.md +31 -31
- package/assets/prompts/components/pagination.md +17 -17
- package/assets/prompts/components/progress-bar.md +14 -11
- package/assets/prompts/components/quotation-bar.md +10 -10
- package/assets/prompts/components/radio-card.md +7 -6
- package/assets/prompts/components/radio.md +9 -9
- package/assets/prompts/components/select.md +28 -25
- package/assets/prompts/components/shortcut.md +11 -11
- package/assets/prompts/components/sidebar.md +56 -56
- package/assets/prompts/components/skeleton.md +7 -4
- package/assets/prompts/components/slider.md +18 -18
- package/assets/prompts/components/spinner.md +16 -16
- package/assets/prompts/components/stepper.md +14 -14
- package/assets/prompts/components/switch.md +19 -20
- package/assets/prompts/components/tab-strip.md +31 -31
- package/assets/prompts/components/table-cell.md +4 -4
- package/assets/prompts/components/table-header.md +16 -16
- package/assets/prompts/components/table-row-edit.md +19 -19
- package/assets/prompts/components/table-row-select.md +9 -9
- package/assets/prompts/components/table-row.md +18 -18
- package/assets/prompts/components/tabs.md +26 -25
- package/assets/prompts/components/tag.md +6 -6
- package/assets/prompts/components/textarea.md +16 -15
- package/assets/prompts/components/time-picker.md +21 -14
- package/assets/prompts/components/timeline-view.md +4 -4
- package/assets/prompts/components/toast.md +42 -41
- package/assets/prompts/components/toolbar.md +23 -23
- package/assets/prompts/components/tooltip.md +15 -14
- package/assets/prompts/components/top-loader.md +11 -11
- package/assets/prompts/components/topbar.md +35 -35
- package/assets/prompts/components/tree-nav.md +9 -9
- package/assets/prompts/components/user-message.md +23 -12
- package/assets/prompts/design-examples/README.md +1 -1
- package/assets/prompts/design-examples/ai-chat-full-page.png +0 -0
- package/assets/prompts/design-examples/catalog.json +124 -1
- package/assets/prompts/design-examples/sources/ai-chat-full-page/ChatExperience.module.css +346 -0
- package/assets/prompts/design-examples/sources/ai-chat-full-page/ChatExperience.tsx +375 -0
- package/assets/prompts/design-examples/sources/ai-chat-full-page/FullPageChat.tsx +8 -0
- package/assets/prompts/design-examples/sources/ai-chat-full-page/REFERENCE.md +19 -0
- package/assets/prompts/design-examples/sources/ai-chat-full-page/useChatDemo.ts +139 -0
- package/assets/prompts/design-examples/sources/ai-chat-full-page/useDemoTextStream.ts +30 -0
- package/assets/prompts/primitives/emerge.md +2 -0
- package/assets/prompts/templates/README.md +1 -1
- package/assets/prompts/templates/ains.md +7 -0
- package/assets/prompts/templates/minimal.md +6 -0
- package/assets/prompts/templates/onboarding.md +156 -0
- package/assets/prompts/templates/workspace.md +13 -8
- package/assets/prompts/tokens/color.md +7 -2
- package/assets/prompts/tokens/radius.md +22 -0
- package/assets/prompts/use-cases/chart-chart-area.md +40 -40
- package/assets/prompts/use-cases/chart-chart-bar.md +34 -34
- package/assets/prompts/use-cases/chart-chart-pie.md +14 -14
- package/assets/prompts/use-cases/chart-chart-radar.md +24 -24
- package/assets/prompts/use-cases/chart-chart-radial.md +14 -14
- package/assets/prompts/use-cases/chart-segmented-chart.md +32 -32
- package/assets/prompts/use-cases/chat-chat-composer.md +529 -0
- package/assets/prompts/use-cases/chat-chat-input.md +1766 -0
- package/assets/prompts/use-cases/data-comment.md +39 -39
- package/assets/prompts/use-cases/data-data-table.md +34 -34
- package/assets/prompts/use-cases/data-list-item.md +16 -16
- package/assets/prompts/use-cases/data-metric-card.md +18 -18
- package/assets/prompts/use-cases/data-table-row.md +19 -19
- package/assets/prompts/use-cases/data-table-toolbar.md +10 -10
- package/assets/prompts/use-cases/feedback-drawer.md +35 -30
- package/assets/prompts/use-cases/feedback-progress-bar.md +23 -18
- package/assets/prompts/use-cases/general-toolbar.md +16 -16
- package/assets/prompts/use-cases/general-tooltip.md +26 -26
- package/assets/prompts/use-cases/input-checkbox.md +27 -27
- package/assets/prompts/use-cases/structure-card.md +9 -9
- package/assets/prompts/use-cases/structure-page-header.md +17 -17
- package/assets/prompts/use-cases/structure-sidebar.md +20 -20
- package/assets/prompts/use-cases/structure-topbar.md +38 -42
- package/assets/skills/ovenn-wireframe/SKILL.md +17 -4
- package/package.json +6 -2
- package/src/utils/design-examples.js +3 -4
- package/assets/prompts/templates/glass-button.md +0 -337
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
Avatar + 파일 피커. 프로필·조직 로고 설정의 "현재 사진 보여주고 바꾸기" 자리. 평소엔 [[components/avatar]]와 동일하게 보이고, hover·focus에서 Avatar 전체가 scrim으로 덮이며 중앙에 카메라 아이콘. `src`가 있고 `onRemove`가 넘어왔으면 같은 hover 상태에서 우상단 X도 함께 등장. 설정 폼 전용 큰 자리이므로 size는 `lg`·`xl` 두 가지만.
|
|
5
5
|
|
|
6
6
|
### Do
|
|
7
|
-
- `size="xl"`
|
|
8
|
-
- `name`은 반드시
|
|
9
|
-
- `onRemove`를 넘길 때만 X 버튼이
|
|
7
|
+
- `size="xl"` 기본: 프로필 설정 폼의 가장 흔한 자리. 사이드 패널 등 좁은 자리에만 `lg`.
|
|
8
|
+
- `name`은 반드시 넘긴다: src가 없을 때 Avatar가 이니셜로 폴백. alt는 생략 시 name으로 폴백.
|
|
9
|
+
- `onRemove`를 넘길 때만 X 버튼이 렌더된다: 삭제 액션 자체를 제공할지 상위에서 결정.
|
|
10
10
|
- 허용 포맷은 `accept="image/*"` 유지. 특정 포맷만 받을 땐 `accept="image/png,image/jpeg"`.
|
|
11
11
|
|
|
12
12
|
### Don't
|
|
13
|
-
- 업로드 중 상태를 자체 prop으로 두지
|
|
14
|
-
- 로컬 파일 preview를 컴포넌트가 책임지지
|
|
15
|
-
- 작은 자리(xs·sm·md)에 쓰지
|
|
16
|
-
- X 버튼을 상시 노출하지
|
|
13
|
+
- 업로드 중 상태를 자체 prop으로 두지 않는다: 상위에서 Avatar 자리 Spinner로 교체하거나 `disabled`로 잠근다.
|
|
14
|
+
- 로컬 파일 preview를 컴포넌트가 책임지지 않는다: `onChange(file)` 받고 호출자가 FileReader·blob URL로 src 세팅.
|
|
15
|
+
- 작은 자리(xs·sm·md)에 쓰지 않는다: 그런 자리는 표시 전용 [[components/avatar]]를 쓰고 수정 액션은 별도 버튼으로 분리.
|
|
16
|
+
- X 버튼을 상시 노출하지 않는다: hover에서만 scrim과 함께 등장하는 패턴 유지. 평소 Avatar는 사진 자체에 집중.
|
|
17
17
|
|
|
18
18
|
### Fallback
|
|
19
19
|
규칙대로 판단 불가한 경우 사용자에게 확인.
|
|
@@ -52,9 +52,9 @@ const [src, setSrc] = useState<string | undefined>(user.avatarUrl);
|
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
### 관련
|
|
55
|
-
- [[components/avatar]]
|
|
56
|
-
- [[components/icon-button]]
|
|
57
|
-
- [[tokens/color]]
|
|
55
|
+
- [[components/avatar]]: 베이스 Avatar (업로드 없는 표시용)
|
|
56
|
+
- [[components/icon-button]]: remove X 버튼의 패턴
|
|
57
|
+
- [[tokens/color]]: overlay 색은 scrim 톤
|
|
58
58
|
|
|
59
59
|
<!-- component-contract -->
|
|
60
60
|
```json
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Avatar
|
|
2
2
|
|
|
3
3
|
### 원칙
|
|
4
|
-
사람·팀의 **식별 마커**. 이미지 → 이니셜 → 아이콘 순서로 자동 폴백. 10색 tint 팔레트에서 이름 해시 기반 안정
|
|
4
|
+
사람·팀의 **식별 마커**. 이미지 → 이니셜 → 아이콘 순서로 자동 폴백. 10색 tint 팔레트에서 이름 해시 기반 안정 매핑: 같은 사람은 항상 같은 색. shape으로 **사람/조직** 구분(circle/rounded), status로 **접속 상태** 뱃지. 축 영향 안 받는 고정 팔레트 (사용자 식별은 흔들리면 안 됨).
|
|
5
5
|
|
|
6
6
|
### Do
|
|
7
|
-
- 가능하면 `name`
|
|
7
|
+
- 가능하면 `name` 전달: 이니셜 폴백 + tint seed + aria 라벨 공용.
|
|
8
8
|
- `shape="circle"`은 사람·개인, `shape="rounded"`는 팀·조직·봇.
|
|
9
9
|
- `src` 로드 실패 시 자동으로 이니셜 폴백. `onError` 수동 처리 불필요.
|
|
10
10
|
- 접속 상태는 `status` prop. online/offline 두 값만.
|
|
@@ -14,18 +14,18 @@
|
|
|
14
14
|
- hex·custom 색으로 tint 덮지 않는다. 10색 팔레트가 자동.
|
|
15
15
|
- status에 커스텀 값 금지 (busy/away 아직 미지원).
|
|
16
16
|
- aria-label 생략 금지 (`alt` 또는 `name` 중 하나는 필수).
|
|
17
|
-
- Avatar 안에 그라데이션·이모지·텍스트 2글자 넘김
|
|
17
|
+
- Avatar 안에 그라데이션·이모지·텍스트 2글자 넘김 금지: 식별 신호 혼탁.
|
|
18
18
|
- 크기를 CSS로 override 금지. `size` prop만.
|
|
19
19
|
|
|
20
20
|
### Fallback
|
|
21
21
|
size 애매하면 `md`, shape 애매하면 `circle` (사람).
|
|
22
22
|
|
|
23
23
|
### 관련
|
|
24
|
-
- [[components/sidebar]]
|
|
25
|
-
- [[components/table-cell]]
|
|
26
|
-
- [[components/badge]]
|
|
27
|
-
- [[components/avatar-upload]]
|
|
28
|
-
- [[tokens/color]]
|
|
24
|
+
- [[components/sidebar]]: Sidebar.Profile 안쪽
|
|
25
|
+
- [[components/table-cell]]: TableCellAvatar 안쪽
|
|
26
|
+
- [[components/badge]]: status 뱃지 시각 쌍
|
|
27
|
+
- [[components/avatar-upload]]: 업로드 가능한 Avatar wrapper (별도)
|
|
28
|
+
- [[tokens/color]]: `--avatar-tint-N-bg`·`--avatar-tint-N-fg` 10색
|
|
29
29
|
|
|
30
30
|
### Props 시그니처
|
|
31
31
|
```tsx
|
|
@@ -44,11 +44,11 @@ size 애매하면 `md`, shape 애매하면 `circle` (사람).
|
|
|
44
44
|
### Size 가이드
|
|
45
45
|
| size | 쓰임 |
|
|
46
46
|
|---|---|
|
|
47
|
-
| `xs` | 10
|
|
48
|
-
| `sm` | 14
|
|
49
|
-
| `md` | 18
|
|
50
|
-
| `lg` | 24
|
|
51
|
-
| `xl` | 40
|
|
47
|
+
| `xs` | 10: Chip leftIcon, 밀도 극한 리스트 |
|
|
48
|
+
| `sm` | 14: TableCell.Avatar, 리스트 아이템 |
|
|
49
|
+
| `md` | 18: **기본**, Sidebar.Profile |
|
|
50
|
+
| `lg` | 24: 프로필 카드 |
|
|
51
|
+
| `xl` | 40: 설정 페이지의 큰 아바타 |
|
|
52
52
|
|
|
53
53
|
### 폴백 체인
|
|
54
54
|
1. `src`가 있고 로드 성공 → 이미지
|
|
@@ -64,10 +64,10 @@ size 애매하면 `md`, shape 애매하면 `circle` (사람).
|
|
|
64
64
|
|
|
65
65
|
### 조합 예시
|
|
66
66
|
```tsx
|
|
67
|
-
// 가장
|
|
67
|
+
// 가장 흔한: 이름 + 이미지 + 상태
|
|
68
68
|
<Avatar size="md" name="희영" src="/avatars/hy.jpg" status="online" />
|
|
69
69
|
|
|
70
|
-
//
|
|
70
|
+
// 조직·팀: rounded
|
|
71
71
|
<Avatar size="lg" name="디자인팀" shape="rounded" />
|
|
72
72
|
|
|
73
73
|
// 이미지 없고 이니셜만
|
|
@@ -76,7 +76,7 @@ size 애매하면 `md`, shape 애매하면 `circle` (사람).
|
|
|
76
76
|
// 커스텀 아이콘 (봇·시스템)
|
|
77
77
|
<Avatar size="md" shape="rounded" icon={<Icon name="robot" />} alt="시스템 봇" />
|
|
78
78
|
|
|
79
|
-
// TableCell.Avatar
|
|
79
|
+
// TableCell.Avatar 안: label·sublabel
|
|
80
80
|
<TableCellAvatar
|
|
81
81
|
src={user.avatar}
|
|
82
82
|
name={user.name}
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
size가 애매하면 sm, 수량 강조는 solid, 조용한 카운트는 soft. 분류·텍스트 상태는 Tag를 사용한다.
|
|
23
23
|
|
|
24
24
|
### 관련
|
|
25
|
-
- [[components/tag]]
|
|
26
|
-
- [[components/chip]]
|
|
27
|
-
- [[components/avatar]]
|
|
25
|
+
- [[components/tag]]: 분류·텍스트 상태
|
|
26
|
+
- [[components/chip]]: 선택·제거
|
|
27
|
+
- [[components/avatar]]: anchored 배치
|
|
28
28
|
|
|
29
29
|
### Props 시그니처
|
|
30
30
|
```tsx
|
|
@@ -50,7 +50,7 @@ size가 애매하면 sm, 수량 강조는 solid, 조용한 카운트는 soft.
|
|
|
50
50
|
```
|
|
51
51
|
|
|
52
52
|
### data-slot
|
|
53
|
-
- `badge-root
|
|
53
|
+
- `badge-root`: span. 자체 pill은 전역 Shape 설정으로 취급하지 않는다.
|
|
54
54
|
|
|
55
55
|
<!-- component-contract -->
|
|
56
56
|
```json
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
# Breadcrumb
|
|
2
2
|
|
|
3
3
|
### 원칙
|
|
4
|
-
현재 페이지가 계층 구조의 어디에 있는지 보여주고, **상위로 한 번에** 돌아가게 해주는 nav 컨트롤. 시각 무게는
|
|
4
|
+
현재 페이지가 계층 구조의 어디에 있는지 보여주고, **상위로 한 번에** 돌아가게 해주는 nav 컨트롤. 시각 무게는 최소: [[components/button]] `size=xs · variant=ghost`와 같은 톤. 페이지 헤더 위 얇은 한 줄로만 존재하고, 자기 자신을 스캔 대상으로 만들지 않는다.
|
|
5
5
|
|
|
6
6
|
### Do
|
|
7
7
|
- 경로 라벨은 `--label-sm-line-height`를 사용해 가로 말줄임 안에서도 글자 하단을 보존한다.
|
|
8
8
|
- 링크·현재 항목·메뉴 트리거의 텍스트 굵기는 regular(`--font-weight-regular`)를 사용한다. 현재 위치는 굵기 대신 텍스트 색으로 구분한다.
|
|
9
|
-
- **깊이 3 이상**일 때만
|
|
10
|
-
- **마지막 항목은 `Breadcrumb.Current
|
|
9
|
+
- **깊이 3 이상**일 때만 쓴다: 2단계면 상위 링크 하나로 충분하고, 브래드크럼은 노이즈가 된다.
|
|
10
|
+
- **마지막 항목은 `Breadcrumb.Current`**: 링크가 아닌 텍스트. `--fg-strong`로 자연스럽게 위계를 준다.
|
|
11
11
|
- **첫 항목은 워크스페이스/홈 아이콘** 하나까지 허용. 그 외 항목엔 아이콘 붙이지 않는다 (스캔 방해).
|
|
12
12
|
- **아이콘 단독 항목**: `Breadcrumb.Link`/`Current`에 `children` 없이 `leftIcon`만 넘기면 정사각 hit box 아이콘 버튼이 된다. `aria-label` 반드시 지정.
|
|
13
|
-
- **URL 계층이 그대로
|
|
14
|
-
- **모바일에서는
|
|
13
|
+
- **URL 계층이 그대로 라벨**: 사이트맵의 실제 위치를 그대로 반영. 계층에 없는 임의 카테고리를 만들어 붙이지 않는다.
|
|
14
|
+
- **모바일에서는 축약**: 첫 항목 + `Breadcrumb.Ellipsis` + 마지막 두 항목. 6개 이상이면 축약이 필수.
|
|
15
15
|
- **Next.js `<Link>` 등 라우터**는 `<Breadcrumb.Link asChild>`로 감싼다. 스타일 유지한 채 SPA 네비게이션 위임.
|
|
16
|
-
- **형제 전환이 필요한 segment**는 `Breadcrumb.Menu`로. ▾ caret이 붙은 트리거를 눌러 같은 레벨의 다른 페이지(프로젝트·워크스페이스·브랜치 등)로 바로 이동. 현재 페이지 자리에 쓸 때는 `active`
|
|
16
|
+
- **형제 전환이 필요한 segment**는 `Breadcrumb.Menu`로. ▾ caret이 붙은 트리거를 눌러 같은 레벨의 다른 페이지(프로젝트·워크스페이스·브랜치 등)로 바로 이동. 현재 페이지 자리에 쓸 때는 `active` 필수: `aria-current="page"`와 `--fg-strong` 톤을 자동으로 맞춘다.
|
|
17
17
|
- **접근성**: 루트가 자동으로 `<nav aria-label="Breadcrumb">` + `<ol>`, 마지막 항목에 `aria-current="page"`를 붙인다. separator는 `aria-hidden`.
|
|
18
18
|
|
|
19
19
|
### Don't
|
|
20
|
-
- **탭 전환용으로 쓰지
|
|
21
|
-
- **마지막 항목을 링크로 만들지
|
|
22
|
-
- **`Button size=xs`가 아닌 다른 사이즈**로 커스텀하지
|
|
23
|
-
- **활성 색을 `--primary`로 덮지
|
|
24
|
-
- **아이콘 남발
|
|
25
|
-
- **draggable/sortable 만들지
|
|
26
|
-
- **`Breadcrumb.Menu`를 탭/필터로 쓰지
|
|
20
|
+
- **탭 전환용으로 쓰지 않는다**: 그건 [[components/tabs]]. Breadcrumb은 URL 자체가 바뀌는 계층 이동 전용.
|
|
21
|
+
- **마지막 항목을 링크로 만들지 않는다**: 자기 페이지를 다시 링크하면 새로고침 트리거가 되고 사용자를 헷갈리게 한다.
|
|
22
|
+
- **`Button size=xs`가 아닌 다른 사이즈**로 커스텀하지 않는다: 페이지 헤더 위 최소 무게가 유일한 존재 이유.
|
|
23
|
+
- **활성 색을 `--primary`로 덮지 않는다**: 활성은 `--fg-strong`(무채). 브랜드 컬러를 여기 쓰면 CTA와 위계가 충돌.
|
|
24
|
+
- **아이콘 남발 금지**: 첫 항목 외에 아이콘 붙이면 라벨 스캔이 무너진다.
|
|
25
|
+
- **draggable/sortable 만들지 않는다**: 계층은 URL이 정한다. UI에서 조작할 대상이 아님.
|
|
26
|
+
- **`Breadcrumb.Menu`를 탭/필터로 쓰지 않는다**: Menu는 "같은 레벨의 다른 페이지로 URL 이동" 전용. 같은 페이지 안에서 뷰만 바꾸는 건 [[components/tabs]].
|
|
27
27
|
|
|
28
28
|
### Fallback
|
|
29
29
|
- 라우터 결정 애매하면 기본 `<a href>` 렌더. 프레임워크 붙일 때 `asChild`로 교체.
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
- 규칙대로 판단 불가한 경우 사용자에게 확인.
|
|
32
32
|
|
|
33
33
|
### 관련
|
|
34
|
-
- [[components/button]]
|
|
35
|
-
- [[components/tabs]]
|
|
36
|
-
- [[components/sidebar]]
|
|
37
|
-
- [[axes/density]]
|
|
38
|
-
- [[axes/shape]]
|
|
39
|
-
- [[tokens/color]]
|
|
34
|
+
- [[components/button]]: Link 시각을 그대로 상속 (`size=xs · variant=ghost`)
|
|
35
|
+
- [[components/tabs]]: 페이지 안 콘텐츠 전환은 Breadcrumb이 아니라 Tabs
|
|
36
|
+
- [[components/sidebar]]: 계층의 "전체 뷰"는 Sidebar, "현재 위치 트레일"은 Breadcrumb
|
|
37
|
+
- [[axes/density]]: `--control-h-xs`가 Link 높이에 매핑
|
|
38
|
+
- [[axes/shape]]: `--radius-xs`가 Link hover 표면 radius에 매핑
|
|
39
|
+
- [[tokens/color]]: `--fg-muted`(Link) → `--fg-strong`(Current) 대비, `--hover`(hover 표면)
|
|
40
40
|
|
|
41
41
|
### Props 시그니처
|
|
42
42
|
```tsx
|
|
@@ -63,12 +63,12 @@
|
|
|
63
63
|
|---|---|---|
|
|
64
64
|
| `Breadcrumb.Link` | 상위 계층 링크. Button xs · ghost 톤. hover 시 `--hover` 표면. | 마지막 항목엔 쓰지 않음. |
|
|
65
65
|
| `Breadcrumb.Current` | 현재 페이지. `--fg-strong` 텍스트, hover 반응 없음. | `href`·`onClick` 붙이지 않음. |
|
|
66
|
-
| `Breadcrumb.Ellipsis` | 축약 트리거. 항상 클릭 가능. [[components/select]]와 동일한 팝오버 표면으로 숨긴 항목 리스트를 연다. | `items`에 5개 이상 넣지
|
|
67
|
-
| `Breadcrumb.Menu` | 형제 전환 트리거. ▾ caret이 붙은 segment를 눌러 같은 레벨 페이지로 이동. `active=true`로 현재 페이지 자리에도 쓸 수 있다 (aria-current + fg-strong 자동). | 아이콘 단독 모드 지원 안
|
|
66
|
+
| `Breadcrumb.Ellipsis` | 축약 트리거. 항상 클릭 가능. [[components/select]]와 동일한 팝오버 표면으로 숨긴 항목 리스트를 연다. | `items`에 5개 이상 넣지 않는다: 그러면 축약이 아니라 실질적 서브메뉴가 됨. 정적(클릭 불가) 마커는 지원하지 않는다. |
|
|
67
|
+
| `Breadcrumb.Menu` | 형제 전환 트리거. ▾ caret이 붙은 segment를 눌러 같은 레벨 페이지로 이동. `active=true`로 현재 페이지 자리에도 쓸 수 있다 (aria-current + fg-strong 자동). | 아이콘 단독 모드 지원 안 함: 트리거 라벨 필수. 탭 전환용으로 쓰지 않는다. |
|
|
68
68
|
|
|
69
69
|
### 조합 예시
|
|
70
70
|
```tsx
|
|
71
|
-
//
|
|
71
|
+
// 표준: Next Link + 홈 아이콘 + 축약
|
|
72
72
|
<Breadcrumb aria-label="문서 경로">
|
|
73
73
|
<Breadcrumb.Link asChild leftIcon={<Icon name="house" />}>
|
|
74
74
|
<Link href="/">Home</Link>
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
<Breadcrumb.Current>Breadcrumb</Breadcrumb.Current>
|
|
86
86
|
</Breadcrumb>
|
|
87
87
|
|
|
88
|
-
// 프로젝트
|
|
88
|
+
// 프로젝트 스위처: Menu로 형제 전환
|
|
89
89
|
<Breadcrumb aria-label="프로젝트 경로">
|
|
90
90
|
<Breadcrumb.Link asChild leftIcon={<Icon name="user" />}>
|
|
91
91
|
<Link href="/">Workspace</Link>
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
<Breadcrumb.Current>Settings</Breadcrumb.Current>
|
|
103
103
|
</Breadcrumb>
|
|
104
104
|
|
|
105
|
-
// 현재 페이지 자체가
|
|
105
|
+
// 현재 페이지 자체가 메뉴: active=true로 aria-current="page" 유지
|
|
106
106
|
<Breadcrumb aria-label="브랜치 경로">
|
|
107
107
|
<Breadcrumb.Link href="/">Repo</Breadcrumb.Link>
|
|
108
108
|
<Breadcrumb.Menu
|
|
@@ -6,21 +6,21 @@
|
|
|
6
6
|
### Do
|
|
7
7
|
- UserMessage는 `shape=circular-drop fill=translucent tail=end` 조합이 기본.
|
|
8
8
|
- AI Quote 블록은 `shape=rounded fill=outline` 또는 `fill=none`.
|
|
9
|
-
- Shape 축 따라 radius
|
|
10
|
-
- circular-drop의 `tail` prop으로 꼬리 방향
|
|
9
|
+
- Shape 축 따라 radius 변화: rounded는 `radius-md` 토큰 사용 (soft/standard/crisp 반응 명확).
|
|
10
|
+
- circular-drop의 `tail` prop으로 꼬리 방향 지정: user는 end, assistant/quote는 start.
|
|
11
11
|
|
|
12
12
|
### Don't
|
|
13
|
-
- Bubble을 "일반 Card" 용도로 쓰지
|
|
14
|
-
- fill=`solid`는 user "강조" 메시지(선택된/하이라이트)
|
|
15
|
-
- 꼬리를 양쪽 다 각지게 하지
|
|
13
|
+
- Bubble을 "일반 Card" 용도로 쓰지 않는다: 그건 [[components/metric-card]] / 커스텀.
|
|
14
|
+
- fill=`solid`는 user "강조" 메시지(선택된/하이라이트)에만: 기본은 translucent.
|
|
15
|
+
- 꼬리를 양쪽 다 각지게 하지 않는다: tail은 한 방향만.
|
|
16
16
|
|
|
17
17
|
### Fallback
|
|
18
18
|
shape 애매하면 `rounded`, fill 애매하면 `translucent`, size 애매하면 `md`.
|
|
19
19
|
|
|
20
20
|
### 관련
|
|
21
|
-
- [[components/user-message]] / [[components/ai-message]]
|
|
22
|
-
- [[components/badge]]
|
|
23
|
-
- [[components/callout]]
|
|
21
|
+
- [[components/user-message]] / [[components/ai-message]]: 상위 소비처
|
|
22
|
+
- [[components/badge]]: 작은 라벨은 Badge
|
|
23
|
+
- [[components/callout]]: 안내 상자는 Callout
|
|
24
24
|
|
|
25
25
|
### Props 시그니처
|
|
26
26
|
```tsx
|
|
@@ -44,14 +44,14 @@ shape 애매하면 `rounded`, fill 애매하면 `translucent`, size 애매하면
|
|
|
44
44
|
|
|
45
45
|
| fill | bg | fg | border |
|
|
46
46
|
|---|---|---|---|
|
|
47
|
-
| none | transparent | fg-strong |
|
|
48
|
-
| solid | primary | primary-fg |
|
|
49
|
-
| translucent | primary-subtle (알파 8%) | fg-strong |
|
|
47
|
+
| none | transparent | fg-strong | |
|
|
48
|
+
| solid | primary | primary-fg | |
|
|
49
|
+
| translucent | primary-subtle (알파 8%) | fg-strong | |
|
|
50
50
|
| outline | bg | fg-strong | hairline border |
|
|
51
51
|
|
|
52
52
|
### Size
|
|
53
|
-
- `md` (기본): padding `space-2 space-3`, `text-base
|
|
54
|
-
- `lg`: padding `space-3 space-4`, `text-base
|
|
53
|
+
- `md` (기본): padding `space-2 space-3`, `text-base`: 일반 메시지 bubble.
|
|
54
|
+
- `lg`: padding `space-3 space-4`, `text-base`: 히어로/강조 bubble. 패딩만 넉넉, 폰트는 md와 동일.
|
|
55
55
|
|
|
56
56
|
소형 라벨이 필요하면 [[components/badge]] 사용.
|
|
57
57
|
|
|
@@ -27,7 +27,7 @@ import type { ButtonGroupProps, ButtonGroupVariant } from "@/components/ButtonGr
|
|
|
27
27
|
기존 호출은 유지한다. 새 버튼 조합은 ControlGroup composition="buttons"로 작성한다.
|
|
28
28
|
|
|
29
29
|
### 관련
|
|
30
|
-
- [[components/control-group]]
|
|
30
|
+
- [[components/control-group]]: 정식 API와 공통 계약
|
|
31
31
|
|
|
32
32
|
<!-- component-contract -->
|
|
33
33
|
```json
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
# Button
|
|
2
2
|
|
|
3
3
|
### 원칙
|
|
4
|
-
텍스트 액션의 최소 단위. 클릭 시 무언가 **일어나는**
|
|
4
|
+
텍스트 액션의 최소 단위. 클릭 시 무언가 **일어나는** 컨트롤: 페이지 이동은 [[components/link]]. size는 [[axes/density]] 축과 연동되고, variant는 semantic 역할(강조 위계)만 담당한다.
|
|
5
5
|
|
|
6
6
|
### Do
|
|
7
7
|
- `loading`은 접근 가능한 이름을 유지하고 `aria-busy`를 전달한다. 기본 Spinner는 Motion 축을 따르며 모션 축소에서도 정적인 로딩 표시를 유지한다. `asChild`의 disabled/loading도 클릭·키보드 활성화를 차단하고 탭 순서에서 제외한다.
|
|
8
|
-
- **중요=`primary`, 서브=`outline`**이 기본 쌍이다. 모달 하단, 폼 하단, 페이지 액션 영역 등 "확정 + 취소/이전" 구조의 기본값. `secondary`는 primary tint가 섞인 색조 액션이 필요한 특별
|
|
9
|
-
- **버튼 사이 gap은 언제나 `space-1`(4px) 고정.** footer action 쌍, 툴바 액션 묶음, 폼 하단 등 어느 자리든 동일. `space-2` 이상
|
|
8
|
+
- **중요=`primary`, 서브=`outline`**이 기본 쌍이다. 모달 하단, 폼 하단, 페이지 액션 영역 등 "확정 + 취소/이전" 구조의 기본값. `secondary`는 primary tint가 섞인 색조 액션이 필요한 특별 맥락에서만: 중립 서브 액션엔 `outline`이 먼저다.
|
|
9
|
+
- **버튼 사이 gap은 언제나 `space-1`(4px) 고정.** footer action 쌍, 툴바 액션 묶음, 폼 하단 등 어느 자리든 동일. `space-2` 이상 금지: 두 버튼이 하나의 액션 묶음으로 묶여 읽히는 밀도를 유지.
|
|
10
10
|
- **기본은 `size="md"`**. 90% 이상의 경우 md. 다른 사이즈로 갈 명확한 이유가 있을 때만 바꾼다.
|
|
11
|
-
- **폼·컨트롤과 나란히 놓일 때는 그 컨트롤의 size와
|
|
11
|
+
- **폼·컨트롤과 나란히 놓일 때는 그 컨트롤의 size와 맞춘다**: Input md 옆엔 Button md, Input sm 옆엔 Button sm. 미묘한 높이 차이가 정렬을 무너뜨린다.
|
|
12
12
|
- 한 작업 문맥의 대표 행동을 primary로 한다. 별도 모달과 같은 행동의 모바일 고정 CTA는 각 문맥에서 판단한다.
|
|
13
|
-
- **아이콘만 있는 버튼도 Button으로
|
|
13
|
+
- **아이콘만 있는 버튼도 Button으로 처리**: label 없이 `leftIcon`만 넣으면 자동으로 정사각(width = height = `--control-h-*`), `leftIcon` + `rightIcon`(예: 아이콘 + `caret-down`)이면 텍스트 없이 좁은 대칭 패딩. 어느 쪽이든 `aria-label` 필수. 별도 [[components/icon-button]] 컴포넌트는 legacy: 신규 사용은 지양.
|
|
14
14
|
- **파괴적 액션은 위계로 2단 분리한다.**
|
|
15
|
-
- `destructive
|
|
16
|
-
- `destructive-ghost
|
|
15
|
+
- `destructive`: **강한 위계.** 확인 모달의 "정말 삭제하시겠습니까?" 최종 확인, 되돌릴 수 없는 결정적 순간. 평상시 옅은 빨강 배경 + 빨강 텍스트, hover 시 solid 빨강으로 전환되며 위험을 예고.
|
|
16
|
+
- `destructive-ghost`: **약한 위계.** 테이블 행/헤더의 삭제, 페이지에 그냥 노출된 삭제 버튼 등 일상적 목록 조작. 평상시 fg(검정) 텍스트로 눈에 띄지 않다가 hover 시에만 빨강 톤(8% 배경 + 빨강 텍스트)이 나타남.
|
|
17
17
|
|
|
18
18
|
### Don't
|
|
19
19
|
- 같은 작업 문맥에서 경쟁하는 primary를 불필요하게 늘리지 않는다.
|
|
20
|
-
- 버튼 사이 gap에 `space-2`(8px) 이상
|
|
20
|
+
- 버튼 사이 gap에 `space-2`(8px) 이상 금지: 반드시 `space-1`(4px).
|
|
21
21
|
- height를 CSS로 덮어쓰지 않는다. `size` prop 경유.
|
|
22
|
-
- 페이지 이동에 Button 쓰지
|
|
23
|
-
- disabled 색을 variant별로 다르게 덮어쓰지 않는다. **모든 variant는 disabled 시 회색 배경(`--bg-muted`) + 실버 텍스트(`--fg-disabled`) + 투명 보더로
|
|
22
|
+
- 페이지 이동에 Button 쓰지 않는다: 시맨틱은 `<a>`.
|
|
23
|
+
- disabled 색을 variant별로 다르게 덮어쓰지 않는다. **모든 variant는 disabled 시 회색 배경(`--bg-muted`) + 실버 텍스트(`--fg-disabled`) + 투명 보더로 통일**: "지금은 못 누른다"가 variant 위계보다 우선 읽혀야 한다.
|
|
24
24
|
|
|
25
25
|
### 인터랙션
|
|
26
|
-
- **Press 피드백은 size별 scale 비율**로 다름. xs/sm은 `scale(0.98)`, md는 `scale(0.97)`, lg는 `scale(0.96)
|
|
27
|
-
- **`prefers-reduced-motion: reduce` 자동
|
|
28
|
-
- **Hover 시 아이콘 opacity 0.75 → 1.0
|
|
26
|
+
- **Press 피드백은 size별 scale 비율**로 다름. xs/sm은 `scale(0.98)`, md는 `scale(0.97)`, lg는 `scale(0.96)`: 큰 버튼일수록 더 많이 눌리는 체감으로 사이즈 리듬을 보조한다. translateY 금지: layout 흔들림·사이즈별 체감 균일 문제를 피하기 위해 scale로 통일.
|
|
27
|
+
- **`prefers-reduced-motion: reduce` 자동 대응**: 시스템에서 모션 축소를 켜면 transition·transform 전부 off된다. 접근성 요구를 꺾지 않도록 override 금지.
|
|
28
|
+
- **Hover 시 아이콘 opacity 0.75 → 1.0**: 평상시 Silver 톤이 hover 때만 완전 선명. 아이콘 fill을 다른 색으로 바꾸지 말고 이 투명도 리듬을 그대로 활용.
|
|
29
29
|
|
|
30
30
|
### Fallback
|
|
31
31
|
size 애매하면 `md`, variant 애매하면 서브 자리에선 `outline`·대표 자리에선 `primary`.
|
|
32
32
|
|
|
33
33
|
### 관련
|
|
34
|
-
- [[components/split-button]]
|
|
35
|
-
- [[components/icon-button]]
|
|
36
|
-
- [[components/input]] · [[components/select]]
|
|
37
|
-
- [[axes/density]]
|
|
38
|
-
- [[axes/shape]]
|
|
39
|
-
- [[tokens/color]]
|
|
34
|
+
- [[components/split-button]]: 메인 액션 + 부가 옵션(caret) 2-part 버튼
|
|
35
|
+
- [[components/icon-button]]: legacy, 신규는 Button icon-only 사용
|
|
36
|
+
- [[components/input]] · [[components/select]]: 같은 화면에서 size 맞춤
|
|
37
|
+
- [[axes/density]]: `--control-h-*`가 size에 매핑
|
|
38
|
+
- [[axes/shape]]: radius가 Shape 축에 반응
|
|
39
|
+
- [[tokens/color]]: `--primary`, `--destructive` 등 variant 매핑
|
|
40
40
|
|
|
41
41
|
### Props 시그니처
|
|
42
42
|
```tsx
|
|
@@ -55,18 +55,18 @@ size 애매하면 `md`, variant 애매하면 서브 자리에선 `outline`·대
|
|
|
55
55
|
|---|---|---|
|
|
56
56
|
| `primary` | **중요 액션의 기본값.** 페이지 대표 액션(가입·제출·확인·다음) | 한 화면 2개 이상 금지 |
|
|
57
57
|
| `inverse` | 현재 Mode의 반대편 `elevated`. 라이트에서는 다크 elevated, 다크에서는 라이트 elevated | Palette와 무관 |
|
|
58
|
-
| `outline` | **서브 액션의 기본값.** 취소·이전 등 primary와 짝 이루는 중립 액션. 툴바·필터에도 사용. 글자·아이콘은 `--fg-muted`로 조용하게, hover 시 `--fg`로 올라와 primary가 또렷하게 먼저 읽히도록 톤을 낮춘다 |
|
|
59
|
-
| `secondary` | primary tint가 섞인 색조 액션이 필요할 때만. 중립 서브엔 `outline`이 먼저 |
|
|
60
|
-
| `neutral` | **중성
|
|
61
|
-
| `elevated` | **표면 위로 은은히 떠 있는 느낌.** 솔리드 `bg-elev-1`(라이트=흰, 다크=어두움) + `shadow-md`. 본문 위에 "뜬 알림"처럼 올라앉은
|
|
62
|
-
| `ghost` | 최소 시각 무게. 인라인·툴바. |
|
|
63
|
-
| `destructive` | **강한** 위험
|
|
64
|
-
| `destructive-ghost` | **약한** 위험
|
|
58
|
+
| `outline` | **서브 액션의 기본값.** 취소·이전 등 primary와 짝 이루는 중립 액션. 툴바·필터에도 사용. 글자·아이콘은 `--fg-muted`로 조용하게, hover 시 `--fg`로 올라와 primary가 또렷하게 먼저 읽히도록 톤을 낮춘다 | |
|
|
59
|
+
| `secondary` | primary tint가 섞인 색조 액션이 필요할 때만. 중립 서브엔 `outline`이 먼저 | |
|
|
60
|
+
| `neutral` | **중성 솔리드**: 눈에 많이 안 튀는 서브 액션. `bg-subtle` 톤 + 중립 fg. 브랜드 색이 자리를 지배하면 안 되는 "조용한 보조 버튼" (코드 blocks·툴바·메타 액션)에 적합. secondary보다 더 중립. | |
|
|
61
|
+
| `elevated` | **표면 위로 은은히 떠 있는 느낌.** 솔리드 `bg-elev-1`(라이트=흰, 다크=어두움) + `shadow-md`. 본문 위에 "뜬 알림"처럼 올라앉은 자리: 닥스 CodeBlock 안 Expand 버튼, floating action, 카드 위 토글 등. | 평평한 UI 흐름 안엔 과함: 서브 액션엔 `outline`·`neutral` 먼저 |
|
|
62
|
+
| `ghost` | 최소 시각 무게. 인라인·툴바. | |
|
|
63
|
+
| `destructive` | **강한** 위험 위계: 확인 모달의 최종 삭제 버튼, 되돌릴 수 없는 결정 | 목록·툴바의 일상 삭제엔 과함 → `destructive-ghost` 사용 |
|
|
64
|
+
| `destructive-ghost` | **약한** 위험 위계: 테이블/페이지에 노출된 일상적 삭제 | 최종 확인 자리엔 부족 → `destructive` 사용 |
|
|
65
65
|
|
|
66
66
|
### Size 가이드
|
|
67
67
|
| size | height | 언제 |
|
|
68
68
|
|---|---|---|
|
|
69
|
-
| `xs` | 24 | **거의 쓸 일 없음.** 극한 밀도가 정말 필요한 예외적 상황(인라인 태그 액션, 셀 내부 미니 컨트롤)에서만. 쓴다면 **`variant="ghost"` 강력
|
|
69
|
+
| `xs` | 24 | **거의 쓸 일 없음.** 극한 밀도가 정말 필요한 예외적 상황(인라인 태그 액션, 셀 내부 미니 컨트롤)에서만. 쓴다면 **`variant="ghost"` 강력 권장**: filled/outline은 이 크기에서 시각 무게가 과해 튀고 답답함. |
|
|
70
70
|
| `sm` | 32 | 밀도 높은 관리 UI, 툴바, 테이블 행 액션 |
|
|
71
71
|
| `md` | 36 | **기본.** 폼·모달·페이지 액션 대부분 |
|
|
72
72
|
| `lg` | 40 | 랜딩·온보딩의 대표 CTA. 손가락 hitbox 필요한 터치 |
|
|
@@ -111,18 +111,18 @@ size 애매하면 `md`, variant 애매하면 서브 자리에선 `outline`·대
|
|
|
111
111
|
|
|
112
112
|
[[SLOTS]] 참고. 외부 참조·테스트·MCP 쿼리용 공식 API.
|
|
113
113
|
|
|
114
|
-
- `button-root
|
|
115
|
-
- `button-icon-start
|
|
116
|
-
- `button-label
|
|
117
|
-
- `button-badge
|
|
118
|
-
- `button-icon-end
|
|
119
|
-
- `button-spinner
|
|
114
|
+
- `button-root`: `<button>` 자체
|
|
115
|
+
- `button-icon-start`: leftIcon 슬롯
|
|
116
|
+
- `button-label`: children 담는 span
|
|
117
|
+
- `button-badge`: badge 슬롯
|
|
118
|
+
- `button-icon-end`: rightIcon 슬롯
|
|
119
|
+
- `button-spinner`: loading 상태 Spinner overlay
|
|
120
120
|
|
|
121
121
|
### state attributes
|
|
122
122
|
|
|
123
|
-
- `data-loading="true"
|
|
124
|
-
- `data-variant
|
|
125
|
-
- `data-icon-only="true"
|
|
123
|
+
- `data-loading="true"`: 로딩 중 (label·icon 숨기고 Spinner overlay). `disabled` 자동 세팅됨
|
|
124
|
+
- `data-variant`: `primary|inverse|secondary|outline|ghost|destructive|destructive-ghost` 중 하나
|
|
125
|
+
- `data-icon-only="true"`: 아이콘만 (children 없음)
|
|
126
126
|
|
|
127
127
|
<!-- component-contract -->
|
|
128
128
|
```json
|
|
@@ -21,52 +21,52 @@
|
|
|
21
21
|
- 날짜 셀은 labelled group이며 독립 날짜 선택 Button과 할 일 Checkbox가 형제 컨트롤이다. 할 일을 버튼·aria-hidden 안에 넣지 않는다. 체크로 날짜 선택을 바꾸지 않으며, 완료 후 초과 개수와 가려진 항목을 다시 계산한다.
|
|
22
22
|
- 날짜 버튼의 접근 가능한 요약에는 가려진 할 일의 제목·완료 상태·초과 개수까지 포함한다. 전체 날짜 목록에서 숨은 할 일도 처리하는 상세 UI가 필요하면 `onSelectedDateChange`의 날짜와 호스트의 events로 패널을 조립한다. Calendar 자체는 셀 안 스크롤이나 상세 팝업을 추가하지 않는다.
|
|
23
23
|
- 월에 필요한 자연스러운 주 수를 표시한다. 불필요한 빈 주를 추가하지 않는다. 일정 밀도를 유지하려면 호스트에서 주 수에 비례해 전체 높이를 조절하며, 주말 숨김은 행 수를 유지하고 5열로 표시한다.
|
|
24
|
-
- `month`는 controlled
|
|
25
|
-
- 이벤트 pill의 `tone`은 **의미**에 매핑. 색은 7개 토큰(default/accent/success/warning/danger/info/neutral)
|
|
24
|
+
- `month`는 controlled: 외부 상태로 쥔다. `onMonthChange` 짝. `selectedDate`도 controlled.
|
|
25
|
+
- 이벤트 pill의 `tone`은 **의미**에 매핑. 색은 7개 토큰(default/accent/success/warning/danger/info/neutral)만: Presto류 14색 팔레트 재현 금지.
|
|
26
26
|
- 셀을 넘치는 이벤트는 자동으로 초과 수량 표시로 접힌다. 일정 아래 별도 공간에 배경·테두리 없는 작은 수량 텍스트(`3 more` / `외 3개`)로 표시해 일정과 겹치지 않는다. 이 Calendar 초과 표시는 사용자가 Badge 대신 텍스트를 명시한 예외다. 내부 스크롤과 셀별 높이 증가는 금지한다.
|
|
27
|
-
- `weekStartsOn`은 기본 `1` (월요일)
|
|
27
|
+
- `weekStartsOn`은 기본 `1` (월요일): 업무 캘린더 관행. 생활 캘린더는 `0`으로 명시.
|
|
28
28
|
- 요일 헤더는 중립 muted 톤으로 통일한다. 현재 달 날짜는 과거여도 읽기 쉬운 대비를 유지하고 다른 달 날짜만 낮은 대비로 구별한다.
|
|
29
29
|
- 선택된 셀은 배경과 날짜 글자색을 바꾸지 않고 브랜드 색(`--primary`) 1px 안쪽 테두리와 `aria-pressed`로 표시한다. 선택 셀의 hover·키보드 포커스에서도 브랜드 색 테두리를 유지한다.
|
|
30
30
|
- 오늘 날짜는 날짜 줄 오른쪽에 작은 `Tag size="sm" variant="soft" status="neutral"`의 `today` 라벨로 표시하고 `aria-current="date"`를 제공한다. 날짜 숫자에 검정 원형 배경을 넣지 않는다. 오늘 복귀 버튼은 현재 달에서도 유지한다.
|
|
31
|
-
- 이벤트 밀도가 높고 라벨이 노이즈가 되는 월간 overview에는 `eventVariant="dot"
|
|
31
|
+
- 이벤트 밀도가 높고 라벨이 노이즈가 되는 월간 overview에는 `eventVariant="dot"`: 라벨 없이 색점만 가로 wrap. 기본 뷰는 `default`(라벨 바).
|
|
32
32
|
- 전체 Calendar를 테두리로 감싸지 않는다. 월 제목·날짜 이동 툴바는 프레임 밖에 두고, 요일 헤더부터 날짜 그리드까지만 하나의 외곽선으로 감싼다. 내부 가로·세로선과 5↔7열 전환은 유지한다. 각 행 마지막 칸의 오른쪽 선은 생략하고 프레임이 오른쪽 외곽선을 한 번만 그린다. 상단 월 제목과 이동 버튼 양끝은 아래 프레임 양끝에 맞추며 툴바 좌우 패딩을 추가하지 않는다.
|
|
33
33
|
|
|
34
34
|
### Don't
|
|
35
|
-
- Popover로 감싸지
|
|
36
|
-
- 셀 안에 "클릭 가능한 이벤트 pill"을 만들지
|
|
37
|
-
- 요일 헤더에 "월요일/화요일" 두 글자 표기
|
|
35
|
+
- Popover로 감싸지 않는다: 이건 DatePicker 자리. Calendar는 페이지 레이아웃의 블록 영역을 차지한다.
|
|
36
|
+
- 셀 안에 "클릭 가능한 이벤트 pill"을 만들지 않는다: 셀 전체가 하나의 클릭 타겟이고, 상세는 사이드 패널·Drawer에서 연다. pill 안에 또 버튼이 들어가면 클릭 영역이 미궁에 빠진다.
|
|
37
|
+
- 요일 헤더에 "월요일/화요일" 두 글자 표기 금지: "월·화" 한 글자. 두 글자는 가로 공간을 먹고 셀 수가 줄어든 느낌을 준다.
|
|
38
38
|
- 하루 셀에 라벨 일정은 최대 3개만 표시한다. 실제 공간에 맞춰 더 적게 표시할 수 있으며 넘치면 작은 수량 텍스트로 접는다.
|
|
39
|
-
- `showWeekend=false`일 때 토·일 셀 자리를 유지하지
|
|
40
|
-
- 이벤트 pill에 `pill` radius(완전 둥근) 쓰지
|
|
41
|
-
- Calendar 자체 상단바에 "주말 숨김" 류 **뷰 옵션 토글**을 넣지
|
|
39
|
+
- `showWeekend=false`일 때 토·일 셀 자리를 유지하지 않는다: 숨길 거면 열 자체를 5열로 접는다.
|
|
40
|
+
- 이벤트 pill에 `pill` radius(완전 둥근) 쓰지 않는다: Shape 축이 radius를 쥐고 있는데 pill로 고정하면 Soft/Standard/Crisp 신호가 셀 안에서 깨진다.
|
|
41
|
+
- Calendar 자체 상단바에 "주말 숨김" 류 **뷰 옵션 토글**을 넣지 않는다: Calendar는 콘텐츠 블록이고, 뷰 옵션은 호스트 화면의 툴바 영역이 담당한다. 외부 state로 `showWeekend`를 넘겨 조립할 것. (월 이동·오늘 복귀는 Calendar 내부: 뷰 옵션이 아니라 "지금 보는 좌표" 조작이므로 예외.)
|
|
42
42
|
|
|
43
43
|
### Fallback
|
|
44
|
-
`today` 생략하면 `new Date()`. `selectedDate` 없이도
|
|
44
|
+
`today` 생략하면 `new Date()`. `selectedDate` 없이도 성립: 그냥 뷰어로 쓸 수 있다. `events` 빈 배열이어도 그리드만 그려진다. `tone` 애매하면 `default`.
|
|
45
45
|
|
|
46
46
|
### 관련
|
|
47
|
-
- [[components/event-chip]]
|
|
48
|
-
- [[components/date-picker]]
|
|
47
|
+
- [[components/event-chip]]: 셀 안에 쌓이는 일정 블록. Calendar가 자동으로 그려주지만 톤·props 체계는 EventChip 문서를 1차 참조.
|
|
48
|
+
- [[components/date-picker]]: "날짜 입력"이 목적이면 그쪽. Popover + Input 트리거. Calendar와 utils(buildMonthGrid 등) 공유.
|
|
49
49
|
- 초과 일정 수는 작은 일반 텍스트로 표시한다. 배경·테두리·알약 모양의 Badge로 만들지 않는다.
|
|
50
|
-
- [[components/icon-button]]
|
|
51
|
-
- [[components/button]]
|
|
52
|
-
- [[axes/shape]]
|
|
53
|
-
- [[axes/density]]
|
|
54
|
-
- [[tokens/color]]
|
|
50
|
+
- [[components/icon-button]]: outline·md의 실제 IconButton으로 이전/다음 달 이동을 제공한다. 정사각형 36px로 오늘 버튼 높이와 맞추고 연도 이동 버튼은 표시하지 않는다.
|
|
51
|
+
- [[components/button]]: 오늘 복귀 버튼은 outline·md이며 현재 달에도 표시한다.
|
|
52
|
+
- [[axes/shape]]: 큰 요일·날짜 프레임은 Shape 곡선을 유지하되 반경을 `min(--radius-lg, --size-4)`로 제한한다. soft·standard의 큰 반경이 과하게 둥글어지지 않도록 Calendar 범위에서만 조정한다. 셀은 각진 격자이며 EventChip·Tag·버튼과 전역 Shape 토큰은 별도로 유지한다.
|
|
53
|
+
- [[axes/density]]: compact일수록 셀 padding이 줄고 EventChip이 더 많이 보임.
|
|
54
|
+
- [[tokens/color]]: `--primary`(선택), `--hover`(셀 hover), `--border`(hairline), `--info`/`--destructive`(요일 신호).
|
|
55
55
|
|
|
56
56
|
### Props 시그니처
|
|
57
57
|
|
|
58
58
|
```tsx
|
|
59
59
|
<Calendar
|
|
60
|
-
month={Date} // required
|
|
60
|
+
month={Date} // required: 현재 보여줄 달 (controlled)
|
|
61
61
|
today={Date} // default: new Date()
|
|
62
62
|
selectedDate={Date | null} // 셀 하이라이트
|
|
63
63
|
events={CalendarEvent[]} // id/date/title/time?/tone?
|
|
64
|
-
eventVariant={"default" | "time" | "dot"} // default: "default"
|
|
64
|
+
eventVariant={"default" | "time" | "dot"} // default: "default": 라벨 바. dot=색점만
|
|
65
65
|
showTime={boolean} // default: false
|
|
66
66
|
showCompletedTasks={boolean} // default: true
|
|
67
67
|
weekStartsOn={0 | 1} // default: 1 (월)
|
|
68
68
|
showWeekend={boolean} // default: true
|
|
69
|
-
leadingSlot={ReactNode} // 상단바
|
|
69
|
+
leadingSlot={ReactNode} // 상단바 왼쪽: Google 연결 뱃지 등
|
|
70
70
|
showTodayButton={boolean} // default: true
|
|
71
71
|
onMonthChange={(next: Date) => void}
|
|
72
72
|
onSelectedDateChange={(next: Date) => void}
|
|
@@ -90,17 +90,17 @@ type CalendarEvent = {
|
|
|
90
90
|
|
|
91
91
|
### Tone
|
|
92
92
|
|
|
93
|
-
이벤트 톤 7개(default/neutral/accent/success/warning/danger/info)
|
|
93
|
+
이벤트 톤 7개(default/neutral/accent/success/warning/danger/info): 상세 매트릭스는 [[components/event-chip]]에서 1차 정의한다. Calendar는 `event.tone`을 그대로 EventChip에 전달.
|
|
94
94
|
|
|
95
95
|
**금지 조합**
|
|
96
|
-
- `tone="danger"`를 "눈에 띄게" 쓰려고 전부 danger로
|
|
97
|
-
- Calendar를 작은 카드·좁은 사이드바에 축소해
|
|
98
|
-
- `showWeekend=false` + 월말 날짜가 토/일에 몰린
|
|
96
|
+
- `tone="danger"`를 "눈에 띄게" 쓰려고 전부 danger로 깔기: 색이 의미 신호를 잃는다. 셀당 1개가 danger라면 다른 셀은 default/accent여야 한다.
|
|
97
|
+
- Calendar를 작은 카드·좁은 사이드바에 축소해 넣기: 이 컴포넌트는 페이지의 큰 일정 작업 영역이다. 날짜 값 선택이 목적이면 DatePicker를 사용한다.
|
|
98
|
+
- `showWeekend=false` + 월말 날짜가 토/일에 몰린 달: 선택 가능한 셀이 사라져 "클릭이 안 되는 날짜"가 생긴다. 주말 숨김은 평일만 다루는 업무 캘린더 전용.
|
|
99
99
|
|
|
100
100
|
### 조합 예시
|
|
101
101
|
|
|
102
102
|
```tsx
|
|
103
|
-
//
|
|
103
|
+
// 기본: 페이지 메인에 깔리는 월간 뷰
|
|
104
104
|
const [month, setMonth] = useState(new Date());
|
|
105
105
|
const [selected, setSelected] = useState<Date | null>(new Date());
|
|
106
106
|
|
|
@@ -112,7 +112,7 @@ const [selected, setSelected] = useState<Date | null>(new Date());
|
|
|
112
112
|
onSelectedDateChange={setSelected}
|
|
113
113
|
/>
|
|
114
114
|
|
|
115
|
-
// 2단
|
|
115
|
+
// 2단 레이아웃: 선택 날짜 상세 패널과 짝. 리스트는 ListItem으로 조립.
|
|
116
116
|
<div className="flex min-h-0 flex-1">
|
|
117
117
|
<Calendar
|
|
118
118
|
month={month}
|
|
@@ -126,14 +126,14 @@ const [selected, setSelected] = useState<Date | null>(new Date());
|
|
|
126
126
|
</aside>
|
|
127
127
|
</div>
|
|
128
128
|
|
|
129
|
-
// 외부 상태 신호가 있는
|
|
129
|
+
// 외부 상태 신호가 있는 상단바: leadingSlot으로 Badge 꽂음
|
|
130
130
|
<Calendar
|
|
131
131
|
leadingSlot={<Tag variant="soft" status="info">Google 연결됨</Tag>}
|
|
132
132
|
month={month}
|
|
133
133
|
onMonthChange={setMonth}
|
|
134
134
|
/>
|
|
135
135
|
|
|
136
|
-
// 업무
|
|
136
|
+
// 업무 전용: 주말 숨김, 월요일 시작
|
|
137
137
|
<Calendar
|
|
138
138
|
month={month}
|
|
139
139
|
showWeekend={false}
|