@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
|
@@ -9,23 +9,23 @@
|
|
|
9
9
|
- `invalid`는 개별 라디오의 시각 상태다. 유효성 오류는 상위 radiogroup의 `aria-invalid`와 설명 연결로 전달한다. 모션 축소 또는 motion=none에서는 눌림 상태의 도트 확대를 적용하지 않는다.
|
|
10
10
|
- **같은 name으로 묶는다**: 그룹 전체가 하나의 `name` 속성을 공유. 시맨틱 그룹은 `role="radiogroup"` 래퍼 권장.
|
|
11
11
|
- **옵션 2개 이상**: 라디오는 최소 2개일 때 의미가 성립. 1개면 [[components/checkbox]]나 [[components/switch]].
|
|
12
|
-
- **선택 취소가 필요하면 Radio가 아니다**: radio는 한 번 선택되면 다시
|
|
12
|
+
- **선택 취소가 필요하면 Radio가 아니다**: radio는 한 번 선택되면 다시 아무것도 선택 안 함으로 못 돌아온다. 그런 UX가 필요하면 checkbox + 그룹 로직.
|
|
13
13
|
|
|
14
14
|
### Don't
|
|
15
|
-
- 옵션이 5개를 넘기면 Select를 검토. 라디오는
|
|
15
|
+
- 옵션이 5개를 넘기면 Select를 검토. 라디오는 한눈에 보이는 소수의 선택지용.
|
|
16
16
|
- SVG 도트를 직접 그리지 않는다. CSS `background`/`transform: scale`로 이미 checked 애니메이션까지 처리됨.
|
|
17
17
|
|
|
18
18
|
### Fallback
|
|
19
19
|
size `md`, status 없음.
|
|
20
20
|
|
|
21
21
|
### 관련
|
|
22
|
-
- [[components/checkbox]]
|
|
23
|
-
- [[tokens/color]]
|
|
22
|
+
- [[components/checkbox]]: 다중 선택 버전. Props/스타일 스펙 형제.
|
|
23
|
+
- [[tokens/color]]: `--primary` · 상태 토큰
|
|
24
24
|
|
|
25
25
|
### Props 시그니처
|
|
26
26
|
```tsx
|
|
27
27
|
<Radio
|
|
28
|
-
invalid={boolean} // 폼 검증
|
|
28
|
+
invalid={boolean} // 폼 검증 실패: border·checked dot destructive
|
|
29
29
|
size="sm | md" // default: md
|
|
30
30
|
status="success | warning | destructive | info" // optional
|
|
31
31
|
name / value / checked / defaultChecked / onChange / disabled ... // native input
|
|
@@ -40,15 +40,15 @@ size `md`, status 없음.
|
|
|
40
40
|
| unchecked | `--border-strong` | scale(0) (숨김) |
|
|
41
41
|
| hover | `--selected-fg` | scale(0) |
|
|
42
42
|
| checked | `--selected-fg` | scale(1) · `--selected-fg` |
|
|
43
|
-
| checked + pressed | `--selected-fg` | **scale(1.2)
|
|
43
|
+
| checked + pressed | `--selected-fg` | **scale(1.2)**: 꽉 차는 체감 |
|
|
44
44
|
| **invalid** (unchecked) | `--destructive` | scale(0) |
|
|
45
45
|
| **invalid** (checked) | `--destructive` | scale(1) · `--destructive` |
|
|
46
46
|
| disabled | 그대로 | 그대로 · opacity 0.5 |
|
|
47
47
|
|
|
48
48
|
### 인터랙션
|
|
49
|
-
- **Scale-in
|
|
50
|
-
- **Pressed
|
|
51
|
-
- **2줄 라벨 윗 줄
|
|
49
|
+
- **Scale-in 도트**: unchecked scale(0) → checked scale(1). `--duration-base` + `--ease-emphasized`로 Motion 축 반응(bouncy=overshoot, standard=매끈한 pop-in).
|
|
50
|
+
- **Pressed 확장**: checked 상태에서 누르면 도트가 scale(1.2)로 미세하게 커짐. "눌렸다"는 체감 보강.
|
|
51
|
+
- **2줄 라벨 윗 줄 정렬**: `align-items: flex-start` + indicator `margin-top: calc((--lh-base - --space-4) / 2)`. 긴 설명이 와도 도트가 라벨 블록 가운데로 내려가지 않음.
|
|
52
52
|
|
|
53
53
|
<!-- component-contract -->
|
|
54
54
|
```json
|
|
@@ -1,37 +1,39 @@
|
|
|
1
1
|
# Select
|
|
2
2
|
|
|
3
3
|
### 원칙
|
|
4
|
-
단일 값 선택 콤보. Radix Select 위의 compound 어댑터. **Trigger 시각은 [[components/input]]과 100% 동일** (variant/size/invalid/label/description/warning 전부 공유), **Content/Item 시각은 [[components/context-menu]]와 동일** (팝오버 표면 + MenuItem 어댑터). 즉 이 컴포넌트는 두 계층을 잇는 **얇은
|
|
4
|
+
단일 값 선택 콤보. Radix Select 위의 compound 어댑터. **Trigger 시각은 [[components/input]]과 100% 동일** (variant/size/invalid/label/description/warning 전부 공유), **Content/Item 시각은 [[components/context-menu]]와 동일** (팝오버 표면 + MenuItem 어댑터). 즉 이 컴포넌트는 두 계층을 잇는 **얇은 어댑터**: 자체 시각 규칙 금지.
|
|
5
5
|
|
|
6
6
|
**구조는 Radix 호환 compound**: `Select.Trigger` + `Select.Content` + `Select.Item`이 **모두 필수**. 셋 중 하나라도 빠지면 Radix가 런타임에 throw. Item만 넣는 간이 형태는 지원하지 않는다.
|
|
7
7
|
|
|
8
8
|
### Do
|
|
9
|
+
- 읽기 전용 상태에 배경색을 추가하지 않는다. `line`은 모든 상태에서 배경을 투명하게 유지하고 테두리 변화로 상태를 전달한다.
|
|
10
|
+
- `readOnly`는 값·폼 제출 의미·키보드 포커스를 유지하면서 열기·타이핑 선택·변경을 막는다. `disabled`로 대체하지 않는다.
|
|
9
11
|
- 시각 속성의 선택 옵션은 [[PRINCIPLES]] §5d **선택 옵션 시각화**를 적용한다.
|
|
10
|
-
- Trigger에 전달한 외부 `aria-describedby`를 Root의 설명·오류 ID와 합친다. warning이 있으면 invalid를 유지한다. Trigger의 키보드 포커스는
|
|
12
|
+
- Trigger에 전달한 외부 `aria-describedby`를 Root의 설명·오류 ID와 합친다. warning이 있으면 invalid를 유지한다. Trigger의 키보드 포커스는 Input과 같은 테두리 변화로 표시하며 외곽 링을 추가하지 않는다.
|
|
11
13
|
- Input 옆에 나란히 놓을 땐 size·variant를 **반드시 통일**.
|
|
12
14
|
- `width`는 Input의 InputWidth 규약 그대로: `"fill" | "md" | "lg" | number`.
|
|
13
|
-
- `label`·`description`·`warning`은 Root
|
|
15
|
+
- `label`·`description`·`warning`은 Root에: 트리거 아래 자동 렌더.
|
|
14
16
|
- Group + Label로 논리 묶음. 긴 리스트는 Separator로 끊음.
|
|
15
17
|
- Item에 `leadingActions`로 아이콘·국기·색 스와치 삽입.
|
|
16
|
-
- **Typeahead**: 열린 Select에서 키를 누르면 해당 글자로 시작하는 Item으로 포커스 점프 (Radix 기본). children이 string이면 자동 매칭, 복잡한 ReactNode면 `textValue` prop으로
|
|
18
|
+
- **Typeahead**: 열린 Select에서 키를 누르면 해당 글자로 시작하는 Item으로 포커스 점프 (Radix 기본). children이 string이면 자동 매칭, 복잡한 ReactNode면 `textValue` prop으로 명시: `<Select.Item value="kr" textValue="한국">`.
|
|
17
19
|
|
|
18
20
|
### Don't
|
|
19
|
-
- Trigger에 custom CSS로 Input 시각을 벗어나지
|
|
20
|
-
- Trigger/Content를 생략하지
|
|
21
|
+
- Trigger에 custom CSS로 Input 시각을 벗어나지 않는다: 두 컴포넌트가 다르게 보이면 폼 전체 시각이 깨짐.
|
|
22
|
+
- Trigger/Content를 생략하지 않는다: Radix 요구사항이라 structural throw.
|
|
21
23
|
- 소수 옵션이라도 폼 값 선택이면 Select를 사용한다. 동일 문맥의 뷰 전환일 때만 [[components/tabs]]를 검토한다. 옵션 수만으로 native select로 우회하지 않는다.
|
|
22
24
|
- 다중 선택에 쓰지 않는다. 그건 [[components/multi-select]].
|
|
23
|
-
- Content에 자체 애니메이션 재정의
|
|
25
|
+
- Content에 자체 애니메이션 재정의 금지: `.m-float` 유틸이 Radix in/out 담당.
|
|
24
26
|
|
|
25
27
|
### Fallback
|
|
26
28
|
size 애매하면 `md`, variant 애매하면 `outline`, width 애매하면 `"fill"`.
|
|
27
29
|
|
|
28
30
|
### 관련
|
|
29
|
-
- [[components/input]]
|
|
30
|
-
- [[components/menu-item]]
|
|
31
|
-
- [[components/context-menu]] · [[components/dropdown-menu]]
|
|
32
|
-
- [[components/form-field]]
|
|
33
|
-
- [[axes/density]]
|
|
34
|
-
- [[axes/shape]]
|
|
31
|
+
- [[components/input]]: Trigger 시각·width·label 규약 공유
|
|
32
|
+
- [[components/menu-item]]: Content 안쪽 Item 어댑터
|
|
33
|
+
- [[components/context-menu]] · [[components/dropdown-menu]]: 팝오버 표면 공유
|
|
34
|
+
- [[components/form-field]]: label/description/warning 자리
|
|
35
|
+
- [[axes/density]]: control-h가 Trigger에, menu-item-h가 Item에
|
|
36
|
+
- [[axes/shape]]: radius가 Shape 축에 반응
|
|
35
37
|
|
|
36
38
|
### Props 시그니처
|
|
37
39
|
```tsx
|
|
@@ -42,6 +44,7 @@ size 애매하면 `md`, variant 애매하면 `outline`, width 애매하면 `"fil
|
|
|
42
44
|
value={string} defaultValue={string}
|
|
43
45
|
onValueChange={(v: string) => void}
|
|
44
46
|
disabled={boolean}
|
|
47
|
+
readOnly={boolean}
|
|
45
48
|
invalid={boolean}
|
|
46
49
|
label={ReactNode}
|
|
47
50
|
description={ReactNode}
|
|
@@ -67,7 +70,7 @@ size 애매하면 `md`, variant 애매하면 `outline`, width 애매하면 `"fil
|
|
|
67
70
|
| Trigger size | Item size | 쓰임 |
|
|
68
71
|
|---|---|---|
|
|
69
72
|
| `sm` | `sm` | 밀도 높은 폼·툴바 |
|
|
70
|
-
| `md` | `sm` |
|
|
73
|
+
| `md` | `sm` | **기본**: 트리거는 보통, 메뉴는 조밀 |
|
|
71
74
|
| `lg` | `md` | 랜딩·온보딩의 큰 입력 |
|
|
72
75
|
|
|
73
76
|
> 트리거가 lg여도 메뉴는 과하게 커지지 않도록 한 단계 작게 매핑. 실전에서 자연스러움.
|
|
@@ -78,13 +81,13 @@ size 애매하면 `md`, variant 애매하면 `outline`, width 애매하면 `"fil
|
|
|
78
81
|
| default | Input default |
|
|
79
82
|
| hover | Input hover (border-strong) |
|
|
80
83
|
| focus-visible | Input focus (ring) |
|
|
81
|
-
| open | Content
|
|
84
|
+
| open | Content 열림: `.m-float` emerge |
|
|
82
85
|
| disabled | opacity 0.5, cursor not-allowed |
|
|
83
86
|
| invalid / warning | border destructive, warning 텍스트 노출 |
|
|
84
87
|
|
|
85
88
|
### 조합 예시
|
|
86
89
|
```tsx
|
|
87
|
-
// 폼 안 Select
|
|
90
|
+
// 폼 안 Select: label + description, Input 옆에 나란히
|
|
88
91
|
<Select
|
|
89
92
|
size="md"
|
|
90
93
|
label="국가"
|
|
@@ -122,18 +125,18 @@ size 애매하면 `md`, variant 애매하면 `outline`, width 애매하면 `"fil
|
|
|
122
125
|
|
|
123
126
|
[[SLOTS]] 참고.
|
|
124
127
|
|
|
125
|
-
- `select-trigger
|
|
126
|
-
- `select-icon-start
|
|
127
|
-
- `select-value
|
|
128
|
-
- `select-indicator
|
|
129
|
-
- `select-content
|
|
128
|
+
- `select-trigger`: 트리거 버튼
|
|
129
|
+
- `select-icon-start`: leftIcon 슬롯
|
|
130
|
+
- `select-value`: 선택된 값 표시
|
|
131
|
+
- `select-indicator`: chevron 아이콘
|
|
132
|
+
- `select-content`: Portal 안쪽 Content
|
|
130
133
|
|
|
131
134
|
### state attributes
|
|
132
135
|
|
|
133
|
-
- `data-state="open|closed"
|
|
134
|
-
- `data-invalid="true"
|
|
135
|
-
- `data-disabled="true"
|
|
136
|
-
- `data-variant
|
|
136
|
+
- `data-state="open|closed"`: Radix 자동 공급 (trigger & content)
|
|
137
|
+
- `data-invalid="true"`: 폼 검증 실패
|
|
138
|
+
- `data-disabled="true"`: disabled
|
|
139
|
+
- `data-variant`: 적용된 variant 값
|
|
137
140
|
|
|
138
141
|
`Select.Content`의 선택적 `container` prop은 Portal의 마운트 요소를 지정한다. 모달 안의 Select는 해당 모달 내부 요소를 전달해 포커스·포인터 접근 범위 안에 메뉴를 유지한다.
|
|
139
142
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Shortcut
|
|
2
2
|
|
|
3
3
|
### 원칙
|
|
4
|
-
키보드 단축키를 표시하는 최소 시각 라벨. Menu Item의 trailing 슬롯, Tooltip 힌트, Command Palette 결과 행이 공유한다. 얕은 표면(`--hover`) + hairline border의
|
|
4
|
+
키보드 단축키를 표시하는 최소 시각 라벨. Menu Item의 trailing 슬롯, Tooltip 힌트, Command Palette 결과 행이 공유한다. 얕은 표면(`--hover`) + hairline border의 한 덩어리 키캡 안에 각 심볼이 얕은 gap으로 떨어져 있는 구조. 상호작용·상태 없음: 순수 시각 라벨이다.
|
|
5
5
|
|
|
6
6
|
`<kbd>` 태그로 렌더해 시맨틱을 유지한다. Menu Item의 `shortcut` prop이 문자열을 받아 내부에서 Shortcut을 자동 렌더링하므로, 대부분의 경우 직접 조합할 필요 없이 Menu Item 경유로 쓴다.
|
|
7
7
|
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
- **다글자 키는 배열로**: `["Ctrl", "K"]` · `["Shift", "⏎"]` 처럼 원소 하나가 한 키. Windows/Linux 표기가 필요한 서비스 대응.
|
|
11
11
|
- **실제 심볼을 우선**: `⌘` · `⇧` · `⌥` · `⌃` · `⏎` · `⌫` · `⇥` · `␣` · `⎋` · `⇪` · `⇞` · `⇟` · `↖` · `↘`. 대문자 축약(`CMD`·`SHIFT`)은 [[feedback_no_uppercase]] 원칙상 금지. 각 심볼은 내부적으로 `<abbr title="Command">⌘</abbr>` 식으로 감싸져 스크린리더에 단어로 전달됨("Command K"로 읽힘, "cloverleaf K" 아님).
|
|
12
12
|
- **size는 붙는 곳에 맞춘다**: Menu Item `sm` 옆이면 `sm`, `md` 옆이면 `md`. 라벨 폰트보다 커지지 않게 한 단계 낮게 짝지음. Menu Item에서 렌더할 땐 자동으로 사이즈가 짝지어짐.
|
|
13
|
-
- **가장 흔한 사용처는 Menu Item**: `<MenuItem shortcut="⌘K"
|
|
13
|
+
- **가장 흔한 사용처는 Menu Item**: `<MenuItem shortcut="⌘K">`: trailing 슬롯 맨 앞에 자동 삽입된다. 직접 `trailingActions`에 넣지 않는다.
|
|
14
14
|
|
|
15
15
|
### Don't
|
|
16
|
-
- 인터랙션을 붙이지 않는다. Shortcut은
|
|
16
|
+
- 인터랙션을 붙이지 않는다. Shortcut은 표기일 뿐 실제 키 핸들링은 상위 컴포넌트(Menu Item, Command Palette, 페이지 전역 훅) 책임.
|
|
17
17
|
- 문장이나 아이콘을 넣지 않는다. 심볼 단위 표기 전용.
|
|
18
18
|
- 색을 hex/tailwind로 직접 지정하지 않는다. 표면·텍스트·border 모두 토큰 경유.
|
|
19
19
|
- 대문자 축약 + wide letter-spacing 조합 금지 ([[feedback_no_uppercase]]).
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
size 애매하면 `sm`. Menu Item 안에서 쓸 때는 Menu Item이 자동으로 짝지어주므로 신경 쓰지 않아도 됨.
|
|
24
24
|
|
|
25
25
|
### 관련
|
|
26
|
-
- [[components/menu-item]]
|
|
27
|
-
- [[components/tooltip]] · [[components/command-palette]]
|
|
28
|
-
- [[axes/density]]
|
|
29
|
-
- [[axes/shape]]
|
|
30
|
-
- [[tokens/color]]
|
|
31
|
-
- [[feedback_no_uppercase]]
|
|
26
|
+
- [[components/menu-item]]: 가장 흔한 사용처. `shortcut` prop이 내부에서 Shortcut 렌더링.
|
|
27
|
+
- [[components/tooltip]] · [[components/command-palette]]: 힌트/결과 행에서 함께 등장.
|
|
28
|
+
- [[axes/density]]: 폰트·padding이 Density 축에 반응.
|
|
29
|
+
- [[axes/shape]]: radius가 Shape 축에 반응.
|
|
30
|
+
- [[tokens/color]]: `--hover`(표면) · `--border`(hairline) · `--fg-subtle`(텍스트).
|
|
31
|
+
- [[feedback_no_uppercase]]: 대문자 축약 대신 심볼 사용.
|
|
32
32
|
|
|
33
33
|
### Props 시그니처
|
|
34
34
|
```tsx
|
|
@@ -52,7 +52,7 @@ size 애매하면 `sm`. Menu Item 안에서 쓸 때는 Menu Item이 자동으로
|
|
|
52
52
|
|
|
53
53
|
### 조합 예시
|
|
54
54
|
```tsx
|
|
55
|
-
// 가장 흔한
|
|
55
|
+
// 가장 흔한 사용: Menu Item shortcut prop 경유
|
|
56
56
|
<MenuItem leadingActions={[<Icon name="search" />]} shortcut="⌘K">
|
|
57
57
|
검색
|
|
58
58
|
</MenuItem>
|
|
@@ -61,7 +61,7 @@ size 애매하면 `sm`. Menu Item 안에서 쓸 때는 Menu Item이 자동으로
|
|
|
61
61
|
계정 설정
|
|
62
62
|
</MenuItem>
|
|
63
63
|
|
|
64
|
-
// 직접
|
|
64
|
+
// 직접 사용: Tooltip 힌트
|
|
65
65
|
<Tooltip content={<>붙여넣기 <Shortcut>⌘V</Shortcut></>}>
|
|
66
66
|
<IconButton icon={<Icon name="clipboard" />} aria-label="붙여넣기" />
|
|
67
67
|
</Tooltip>
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
# Sidebar
|
|
4
4
|
|
|
5
5
|
### 원칙
|
|
6
|
-
좌측 세로 nav. **라우팅
|
|
6
|
+
좌측 세로 nav. **라우팅 전용**: Tabs/필터는 쓸 곳이 아님. Header(고정) + Body(스크롤) + Footer(고정) 3영역 세로 쉘에, Brand + Section + Item + Separator + Profile을 compound로 조합. `collapsed`로 icon-only 축소. Item은 [[components/menu-item]]을 그대로 어댑트: 시각·상태 규칙 공유.
|
|
7
7
|
|
|
8
|
-
**2단 쉘(Rail + Main)**: VS Code·Linear 스타일 "활동 바 + 사이드 패널" 조합이 필요할 땐 `<Sidebar.Rail>` + `<Sidebar.Main>`을 쓴다. Rail은 좁은 세로 아이콘 트랙(영구 collapsed 어휘), Main은 기존 Header/Body/Footer를 담는 wrapper. Rail 없이 쓰면 Main도 생략해 지금처럼 Header/Body/Footer를 Sidebar 직속에 둘 수 있다(기존 호환). **구 `SidebarSplit`은
|
|
8
|
+
**2단 쉘(Rail + Main)**: VS Code·Linear 스타일 "활동 바 + 사이드 패널" 조합이 필요할 땐 `<Sidebar.Rail>` + `<Sidebar.Main>`을 쓴다. Rail은 좁은 세로 아이콘 트랙(영구 collapsed 어휘), Main은 기존 Header/Body/Footer를 담는 wrapper. Rail 없이 쓰면 Main도 생략해 지금처럼 Header/Body/Footer를 Sidebar 직속에 둘 수 있다(기존 호환). **구 `SidebarSplit`은 폐기**: 섹션들이 flex-shrink로 뭉개지는 함정이 있어 `Sidebar.Rail`로 완전 대체.
|
|
9
9
|
|
|
10
10
|
### 좌우/상하 축 공급 (중요)
|
|
11
11
|
**벤더 Sidebar는 좌우/상하 padding을 공급하지 않는다**. `.root/.header/.body/.footer` 어디에도 `padding-inline`·`padding-block`을 깔지 않음. preset(`.brand/.profile/.section`)도 자체 padding 없음. `--sidebar-pad-x`·`--sidebar-pad-y` 토큰은 폐기.
|
|
@@ -17,31 +17,31 @@
|
|
|
17
17
|
|
|
18
18
|
**금지**:
|
|
19
19
|
- Sidebar 큰 컨테이너(root/Header/Body/Footer wrapper)에 `padding-inline` 금지. 벤더가 공급 안 하므로 중첩 함정은 없지만, "큰 컨테이너에 padding" 자체가 스크롤 트랙·안쪽 요소 정렬을 틀어뜨리는 패턴.
|
|
20
|
-
- Body에 직접 `padding-inline`
|
|
20
|
+
- Body에 직접 `padding-inline` 금지: 스크롤바가 가장자리와 떨어진다. Body 안쪽에 inner div 두고 거기에.
|
|
21
21
|
|
|
22
22
|
### 섹션 묶음 룰 (중요)
|
|
23
23
|
|
|
24
24
|
Section은 Favorites·Projects 같은 분류 제목에 사용한다. 프로젝트·폴더처럼 개별 탐색 대상인 행은 일반 md MenuItem으로 구현한다. 폴더를 섹션 헤더로 바꾼 뒤 크기를 CSS로 보정하지 않는다. 즐겨찾기 해제 별은 장식 Icon이 아니라 IconButton이며, 항목 이동과 클릭·키보드 이벤트를 분리한다.
|
|
25
|
-
Body 안 메뉴 리스트는 **반드시 `MenuItem.Section`으로 묶어서** 쓴다. `MenuItem variant="section"` 헤더 + 그 아래 아이템 열을 **flat하게 나열하는 조립
|
|
25
|
+
Body 안 메뉴 리스트는 **반드시 `MenuItem.Section`으로 묶어서** 쓴다. `MenuItem variant="section"` 헤더 + 그 아래 아이템 열을 **flat하게 나열하는 조립 금지**: DOM이 평면이면 "섹션 안 간격 vs 섹션 간 간격"의 책임이 헤더 margin 하나에만 걸려 리듬이 쉽게 깨진다. `MenuItem.Section`은 wrapper `<div class="sectionGroup">`을 자동으로 깔아 Gestalt proximity를 구조에 박는다.
|
|
26
26
|
|
|
27
27
|
사이드바 안쪽 세로 간격 (고정):
|
|
28
28
|
- **섹션 제목 ↔ 첫 아이템**: 2~4px(기본 4px), MenuItem.Section의 `--menu-section-gap`이 담당한다. 제목 margin을 추가해 이중 간격을 만들지 않는다.
|
|
29
|
-
- **그룹 사이** (다음 섹션과의 거리): `--space-3
|
|
30
|
-
- 비율 3:1 유지. 라벨 톤 다운만으론 섹션 identity
|
|
31
|
-
- 이중 여백 금지 ([[feedback_no_double_spacing]])
|
|
29
|
+
- **그룹 사이** (다음 섹션과의 거리): `--space-3`: Body 안쪽 콘텐츠 wrapper의 flex gap이 담당.
|
|
30
|
+
- 비율 3:1 유지. 라벨 톤 다운만으론 섹션 identity 부족: 간격 비율이 결정적.
|
|
31
|
+
- 이중 여백 금지 ([[feedback_no_double_spacing]]): 그룹 wrapper에 추가 margin 공급 금지, 부모 gap 하나만 쓸 것.
|
|
32
32
|
|
|
33
33
|
### 사이드바 안의 Input
|
|
34
|
-
사이드바 내부 Input(검색 등)은 **`variant="outline"` 기본**. 흰색·연한 배경에서는 `filled`를 사용하지 않는다([[PRINCIPLES]] §5c). `line`도
|
|
34
|
+
사이드바 내부 Input(검색 등)은 **`variant="outline"` 기본**. 흰색·연한 배경에서는 `filled`를 사용하지 않는다([[PRINCIPLES]] §5c). `line`도 금지: ghost MenuItem 사이에서 밑줄이 흐름에 섞여 검색창의 경계가 불분명해진다.
|
|
35
35
|
|
|
36
|
-
**size는 `md` 기본**. 사이드바가 narrow라서 sm으로 좁히지 말
|
|
36
|
+
**size는 `md` 기본**. 사이드바가 narrow라서 sm으로 좁히지 말 것: 사이드바 밀도는 Item 쪽이 담당하고(ghost 리듬), 검색 Input은 "쓰기·읽기 둘 다 자연스러운" md가 더 어울림. Ovenn 전체 컴포넌트가 md 기본이라 그 리듬과도 어긋나지 않음.
|
|
37
37
|
|
|
38
38
|
### Body에 fade mask 금지 (중요)
|
|
39
|
-
`Sidebar.Body`에 `mask-image: linear-gradient(...)` 류의 상단 fade **금지**. "스크롤 콘텐츠가 Header 아래로 자연스럽게 사라지도록" 넣는 fade지만, 소비처는 Body 안 최상단에 **고정 블록**(예: primary "새 대화" 버튼 + 검색 Input)을 꽂는 경우가 흔하다. 이때 fade가 그 블록 상단 ~10
|
|
39
|
+
`Sidebar.Body`에 `mask-image: linear-gradient(...)` 류의 상단 fade **금지**. "스크롤 콘텐츠가 Header 아래로 자연스럽게 사라지도록" 넣는 fade지만, 소비처는 Body 안 최상단에 **고정 블록**(예: primary "새 대화" 버튼 + 검색 Input)을 꽂는 경우가 흔하다. 이때 fade가 그 블록 상단 ~10~15px를 투명하게 깎아 **primary solid 버튼 위에 "흰 입체 바"가 올라간 착시**를 만든다. computed style엔 shadow·gradient 하나도 없는데 입체감이 보이면 100% 이 원인. Header와 Body의 분리는 Header padding-bottom과 border로만 처리.
|
|
40
40
|
|
|
41
41
|
### Footer 위 분리선 (조건부)
|
|
42
|
-
`Sidebar.Footer`는 **기본은 상단 border
|
|
42
|
+
`Sidebar.Footer`는 **기본은 상단 border 없음**: 사이드바 안쪽은 ghost 리듬이라 가로선 하나가 들어가면 구획이 과해져 밸런스가 깨짐. **Body가 스크롤 가능할 때만**(`SidebarRoot`가 ResizeObserver로 감지해 Footer에 `data-overflow` 토글) 상단 hairline이 자동으로 켜진다: 스크롤되는 콘텐츠가 Footer 뒤로 깔릴 때만 분리가 필요하기 때문. 짧은 메뉴에서는 선 없이 깔끔. 소비처가 수동으로 `border-top`을 꽂지 말 것.
|
|
43
43
|
|
|
44
|
-
line-heavy 톤(spare 같은 콘솔형 Theme)에서 Footer 분리선을 항상 보여주고 싶으면 Theme CSS에서 `.sidebar-footer { border-top: ... }` 같은 override로
|
|
44
|
+
line-heavy 톤(spare 같은 콘솔형 Theme)에서 Footer 분리선을 항상 보여주고 싶으면 Theme CSS에서 `.sidebar-footer { border-top: ... }` 같은 override로 해결: 컴포넌트 기본은 조건부 유지.
|
|
45
45
|
|
|
46
46
|
### Profile trailing에 IconButton 허용
|
|
47
47
|
`Sidebar.Profile`은 MenuItem(role="button" div) preset이라 **`trailing`에 `IconButton`을 자유롭게** 넣을 수 있다 (nested button 아님). 내부 액션 클릭은 `e.stopPropagation()`으로 root click과 분리. 전체를 DropdownMenu로 열려면 Profile 자체를 `DropdownMenu.Trigger asChild`로 감쌈.
|
|
@@ -77,7 +77,7 @@ Header는 **가로 행**이기 때문에 Section을 넣으면 nav 전체가 가
|
|
|
77
77
|
</Sidebar.Body>
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
- **`<Sidebar.Item>` 과 `<Sidebar.Section>`** export도 존재하지만 **일반 메뉴에는 쓰지
|
|
80
|
+
- **`<Sidebar.Item>` 과 `<Sidebar.Section>`** export도 존재하지만 **일반 메뉴에는 쓰지 않는다**: brand/profile preset의 뼈대 공유용 내부 요소. 일반 네비게이션 자리는 `MenuItem.Section` + `MenuItem` 하나로 통일 ([[components/menu-item]]).
|
|
81
81
|
- Section 안 Item 사이 세로 리듬·active 톤·leading/trailing 슬롯이 전부 MenuItem에 녹아 있어 수작업 조립이 불필요.
|
|
82
82
|
|
|
83
83
|
### AppFrame.Sidebar 슬롯 안에 넣는다 (중요)
|
|
@@ -85,43 +85,43 @@ Header는 **가로 행**이기 때문에 Section을 넣으면 nav 전체가 가
|
|
|
85
85
|
|
|
86
86
|
```tsx
|
|
87
87
|
<AppFrame layout="topbar-first" variant="outlined">
|
|
88
|
-
<AppFrame.Topbar><Topbar
|
|
88
|
+
<AppFrame.Topbar><Topbar>콘텐츠</Topbar></AppFrame.Topbar>
|
|
89
89
|
<AppFrame.Sidebar>
|
|
90
|
-
<Sidebar
|
|
90
|
+
<Sidebar>콘텐츠</Sidebar> {/* 벤더가 자동으로 폭·높이·overflow 받음 */}
|
|
91
91
|
</AppFrame.Sidebar>
|
|
92
|
-
<AppFrame.Content
|
|
92
|
+
<AppFrame.Content>콘텐츠</AppFrame.Content>
|
|
93
93
|
</AppFrame>
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
AppFrame 밖에서 바깥 수제 grid(`grid-template-columns: 260px 1fr` 등)에 Sidebar를 그대로
|
|
96
|
+
AppFrame 밖에서 바깥 수제 grid(`grid-template-columns: 260px 1fr` 등)에 Sidebar를 그대로 꽂으면: Body가 자기 scroll container 높이를 못 잡아 **섹션들이 flex-shrink로 뭉개지거나, Body가 0 높이로 접혀 메뉴 전체가 안 보임**. [[feedback_sidebar_scroll]] 함정 그대로.
|
|
97
97
|
|
|
98
|
-
**2단 쉘(Rail + Main)**: `<Sidebar>` 안에서 `<Sidebar.Rail>`과 `<Sidebar.Main>`을 compound로 조합. AppFrame.Sidebar 슬롯이 Sidebar를 그대로 담고, Sidebar 벤더가 자체 `.root:has(.rail)` CSS로 flex row 전환·폭 합산을 처리. 과거 바깥 수제 flex 조립은
|
|
98
|
+
**2단 쉘(Rail + Main)**: `<Sidebar>` 안에서 `<Sidebar.Rail>`과 `<Sidebar.Main>`을 compound로 조합. AppFrame.Sidebar 슬롯이 Sidebar를 그대로 담고, Sidebar 벤더가 자체 `.root:has(.rail)` CSS로 flex row 전환·폭 합산을 처리. 과거 바깥 수제 flex 조립은 폐기: 이젠 Sidebar 자체가 2단을 안다.
|
|
99
99
|
|
|
100
100
|
### Do
|
|
101
101
|
- 파일함·다단계 탐색 본문은 [[components/tree-nav]]를 조합한다. TreeNav가 MenuItem 행·펼침·선택·들여쓰기 가이드선을 관리하고 Sidebar는 헤더·본문·하단 셸을 맡는다.
|
|
102
|
-
- **Header/Footer의 워크스페이스·프로필·조직 트리거는 반드시 [[components/menu-item]] (avatar + description + align="center" preset)
|
|
103
|
-
- Section·Separator는 반드시 **`Sidebar.Body` 안에**
|
|
104
|
-
- 라우트 이동은 Item에 `asChild` + Next `<Link>`. 단, `asChild`일 땐 라벨 truncation이 `<Link>` 쪽 책임이 된다 ([[components/menu-item]] Slot 동작)
|
|
102
|
+
- **Header/Footer의 워크스페이스·프로필·조직 트리거는 반드시 [[components/menu-item]] (avatar + description + align="center" preset)**: Select·Input Dropdown·수제 Button+span 조합 전부 금지. Avatar + 2줄 라벨 + trailing 뼈대가 고정. Footer 프로필은 `Sidebar.Profile`(=이 preset의 래퍼) 사용.
|
|
103
|
+
- Section·Separator는 반드시 **`Sidebar.Body` 안에** 둔다: Body만 스크롤되는 영역.
|
|
104
|
+
- 라우트 이동은 Item에 `asChild` + Next `<Link>`. 단, `asChild`일 땐 라벨 truncation이 `<Link>` 쪽 책임이 된다 ([[components/menu-item]] Slot 동작): 긴 라벨이면 Link에 `truncate` 유틸 또는 `title` 속성을 걸 것.
|
|
105
105
|
- 현재 라우트는 `active`로 명시 (MenuItem의 active 시각 그대로).
|
|
106
106
|
- Brand는 Home 링크 자리로. `symbol`(항상 노출) + `wordmark`(expanded만).
|
|
107
107
|
- Section 묶음은 `title`로 그룹. collapsed일 땐 title 자동 숨김.
|
|
108
108
|
- `collapsed` 상태에서는 `aria-label`과 `title`을 자동으로 걸어 접근성 유지.
|
|
109
|
-
- 콘텐츠 영역과의 **경계선은 [[components/app-frame]] `variant="outlined"`** 가
|
|
109
|
+
- 콘텐츠 영역과의 **경계선은 [[components/app-frame]] `variant="outlined"`** 가 그린다: Sidebar 자체는 border를 그리지 않음. 사이드바가 녹아 보이면 AppFrame variant부터 확인.
|
|
110
110
|
|
|
111
111
|
### Don't
|
|
112
|
-
- **워크스페이스/프로필 트리거에 Select·Input Dropdown
|
|
113
|
-
- **수제 Button + span 조립
|
|
114
|
-
- **Header에 Section·Item·nav를 넣지
|
|
115
|
-
- 페이지 안 뷰 전환에 쓰지
|
|
112
|
+
- **워크스페이스/프로필 트리거에 Select·Input Dropdown 금지**: 폼 값 선택과 네비게이션 액션은 다른 역할. MenuItem(avatar + align="center") + DropdownMenu 조합이 유일한 표준 ([[antipattern_workspace_switcher]]).
|
|
113
|
+
- **수제 Button + span 조립 금지**: 매번 레이아웃·폰트·collapsed 전환이 어긋나서 일관성이 깨짐. MenuItem preset 하나로 끝.
|
|
114
|
+
- **Header에 Section·Item·nav를 넣지 않는다**: Header는 가로 flex 행이라 세로 nav가 깔리면 전부 눌려 겹친다. Brand 전용.
|
|
115
|
+
- 페이지 안 뷰 전환에 쓰지 않는다: 그건 [[components/tabs]].
|
|
116
116
|
- Item 안에 variant로 다른 톤을 쓰지 않는다. active 외의 강조 금지.
|
|
117
117
|
- Sidebar 자체에 padding/width를 CSS로 덮지 않는다. `--sidebar-w*` 토큰 경유.
|
|
118
|
-
- `.root`에 padding을 꽂지
|
|
118
|
+
- `.root`에 padding을 꽂지 않는다: Body가 스크롤 컨테이너라 스크롤바가 안쪽으로 밀려 가장자리에 안 붙는다 ([[project_scroll_rule]]).
|
|
119
119
|
- **Sidebar 큰 컨테이너(root/Header/Body/Footer wrapper)에 좌우 패딩 금지**. 좌우/상하 축은 preset slot(`data-sidebar-slot`) 또는 안쪽 콘텐츠 래퍼에 공급. `--sidebar-pad-x`·`--sidebar-pad-y` 토큰 사용 금지(벤더에서 폐기됨).
|
|
120
|
-
- **Sidebar 내부 Input은 `outline`
|
|
120
|
+
- **Sidebar 내부 Input은 `outline` 기본**: `line` 금지, 흰색·연한 배경의 `filled` 금지.
|
|
121
121
|
- **액티브바는 기본적으로 사용하지 않는다.** 선택 표면·텍스트 위계로 표시한다. 필요한 바를 둥근 행의 border·inset shadow에 붙여 곡선으로 만드는 구현은 금지한다([[PRINCIPLES]] §5c).
|
|
122
122
|
- Brand symbol·wordmark 크기 override 금지. `--sidebar-brand-symbol-max`·`--sidebar-brand-wordmark-max` 상한 안에서만.
|
|
123
123
|
- **Body 안 섹션 리스트가 길어서 스크롤이 필요할 때**, 섹션들에 `flex-shrink`를 그대로 두지 않는다. Body는 `display:flex column`이라 자식(Section)이 기본 `flex-shrink:1`로 수축되어 header가 몇 px로 뭉개지고 아이템이 사라져 보인다. 해결: Body 직속 자식에 `flex: 0 0 auto`를 걸어 각 섹션이 자기 콘텐츠 전체 높이를 유지하게 하고, 스크롤은 Body의 `overflow-y:auto`가 담당하게 한다.
|
|
124
|
-
- **2단 쉘(아이콘 Rail + Sidebar) 조립 시 바깥 수제 flex
|
|
124
|
+
- **2단 쉘(아이콘 Rail + Sidebar) 조립 시 바깥 수제 flex 금지**: `<Sidebar.Rail>` + `<Sidebar.Main>` compound를 쓴다. `.root:has(.rail)` CSS가 자동으로 flex row로 전환하고 Rail/Main 폭·경계선·높이를 벤더가 공급. 과거 `SidebarSplit`는 panel이 자체 flex 체인으로 섹션들을 짓눌러 header가 4px로 뭉개지는 함정이 있어 폐기됨.
|
|
125
125
|
|
|
126
126
|
### Fallback
|
|
127
127
|
collapsed 결정 애매하면 `false`. Section title 애매하면 생략. 경계선 애매하면 AppFrame `variant="outlined"`.
|
|
@@ -131,47 +131,47 @@ collapsed 결정 애매하면 `false`. Section title 애매하면 생략. 경계
|
|
|
131
131
|
Rail은 "영구적으로 collapsed인 영역"이란 의미. 안쪽 Sidebar.Item·Sidebar.Brand는 자동으로 icon-only + Tooltip 모드로 전환된다 (Context가 `railCollapsed: true` 공급). 그래서 Rail 안쪽 어휘는 **엄격히 제한**된다.
|
|
132
132
|
|
|
133
133
|
**Rail 안에 들어갈 수 있는 것**
|
|
134
|
-
- `Sidebar.Brand
|
|
135
|
-
- `Sidebar.RailGroup
|
|
136
|
-
- `Sidebar.Item
|
|
137
|
-
- `Sidebar.RailDivider
|
|
138
|
-
- `Sidebar.RailFooter
|
|
134
|
+
- `Sidebar.Brand`: Rail 상단 로고(symbol만 자동 노출, wordmark 자동 숨김)
|
|
135
|
+
- `Sidebar.RailGroup`: Item 묶음 (role="group" 자동). 2개 이상 그룹을 둘 땐 `aria-label`로 구분
|
|
136
|
+
- `Sidebar.Item`: icon + label(Tooltip로 자동 노출) + active + onClick. label은 꼭 지정(aria-label·Tooltip 콘텐츠로 쓰임)
|
|
137
|
+
- `Sidebar.RailDivider`: 그룹 사이 hairline
|
|
138
|
+
- `Sidebar.RailFooter`: 바닥 고정 영역(collapse 토글·설정 등)
|
|
139
139
|
|
|
140
140
|
**Rail 안에 넣지 않는 것**
|
|
141
141
|
- 라벨 텍스트(Tooltip로만 노출됨), Input/SearchField, 2줄 요소(Sidebar.Profile 등 avatar+description preset)
|
|
142
|
-
- `Sidebar.Header/Body/Footer
|
|
142
|
+
- `Sidebar.Header/Body/Footer`: 이건 Main 안쪽 자리
|
|
143
143
|
- Trailing badge 가로 배치(세로 트랙 리듬에 안 맞음). Badge anchored(모서리) 1개는 OK
|
|
144
144
|
|
|
145
|
-
**아이콘 자리에 글자/이니셜도 OK**: 워크스페이스 스위처처럼 `icon={<span>T</span>}` 또는 Avatar 넣을 수
|
|
145
|
+
**아이콘 자리에 글자/이니셜도 OK**: 워크스페이스 스위처처럼 `icon={<span>T</span>}` 또는 Avatar 넣을 수 있음: Sidebar.Item leading은 ReactNode라 자유.
|
|
146
146
|
|
|
147
147
|
### Rail 생략 가능
|
|
148
148
|
`<Sidebar.Rail>` 없이 `<Sidebar>` 바로 아래 Header/Body/Footer를 두는 1단 패턴은 기존 그대로 작동한다. Rail은 **활동 바가 필요할 때만 추가**하는 선택적 compound.
|
|
149
149
|
|
|
150
150
|
### 관련
|
|
151
|
-
- [[components/menu-item]]
|
|
152
|
-
- [[components/avatar]]
|
|
153
|
-
- [[components/app-frame]]
|
|
154
|
-
- [[axes/density]]
|
|
155
|
-
- [[tokens/color]]
|
|
151
|
+
- [[components/menu-item]]: Item·Profile(avatar + description + align="center" preset) 시각·상태 전부 재사용
|
|
152
|
+
- [[components/avatar]]: Profile 왼쪽 아바타
|
|
153
|
+
- [[components/app-frame]]: Sidebar를 담는 grid 쉘
|
|
154
|
+
- [[axes/density]]: `--sidebar-w*` 토큰·control-h가 Density에 반응
|
|
155
|
+
- [[tokens/color]]: `--fg`·`--primary`·active 상태 매핑
|
|
156
156
|
|
|
157
157
|
### Props 시그니처
|
|
158
158
|
```tsx
|
|
159
159
|
<Sidebar collapsed={boolean}> // default: false
|
|
160
160
|
|
|
161
|
-
{/* ─ 선택: 2단
|
|
161
|
+
{/* ─ 선택: 2단 쉘: Rail(활동 바) + Main(기존 3영역).
|
|
162
162
|
Rail 없이 쓸 땐 Rail/Main 블록 둘 다 생략하고 Header/Body/Footer를
|
|
163
163
|
Sidebar 직속으로 두면 됨. */}
|
|
164
164
|
<Sidebar.Rail>
|
|
165
165
|
<Sidebar.Brand symbol={<Icon />} /> // wordmark 자동 숨김
|
|
166
166
|
|
|
167
167
|
<Sidebar.RailGroup aria-label="프로덕트">
|
|
168
|
-
<Sidebar.Item icon={<Icon />} label="
|
|
168
|
+
<Sidebar.Item icon={<Icon />} label="항목 이름" active />
|
|
169
169
|
</Sidebar.RailGroup>
|
|
170
170
|
|
|
171
171
|
<Sidebar.RailDivider />
|
|
172
172
|
|
|
173
173
|
<Sidebar.RailGroup role="tablist">
|
|
174
|
-
<Sidebar.Item icon={<Icon />} label="
|
|
174
|
+
<Sidebar.Item icon={<Icon />} label="항목 이름" />
|
|
175
175
|
</Sidebar.RailGroup>
|
|
176
176
|
|
|
177
177
|
<Sidebar.RailFooter>
|
|
@@ -182,12 +182,12 @@ Rail은 "영구적으로 collapsed인 영역"이란 의미. 안쪽 Sidebar.Item
|
|
|
182
182
|
<Sidebar.Main>
|
|
183
183
|
{/* ─ 또는 Rail 없이 Sidebar 직속으로 ─ */}
|
|
184
184
|
|
|
185
|
-
{/* Header
|
|
185
|
+
{/* Header: 고정, 가로 행. Brand 전용. */}
|
|
186
186
|
<Sidebar.Header>
|
|
187
187
|
<Sidebar.Brand symbol={<Icon />} wordmark={<Logo /> | "Ovenn"} />
|
|
188
188
|
</Sidebar.Header>
|
|
189
189
|
|
|
190
|
-
{/* Body
|
|
190
|
+
{/* Body: 세로 스크롤 트랙. Section·Separator 전부 여기. 여러 개 두면 각자 독립 스크롤. */}
|
|
191
191
|
<Sidebar.Body>
|
|
192
192
|
<Sidebar.Section title="워크스페이스">
|
|
193
193
|
<Sidebar.Item
|
|
@@ -206,13 +206,13 @@ Rail은 "영구적으로 collapsed인 영역"이란 의미. 안쪽 Sidebar.Item
|
|
|
206
206
|
<Sidebar.Separator />
|
|
207
207
|
</Sidebar.Body>
|
|
208
208
|
|
|
209
|
-
{/* Footer
|
|
209
|
+
{/* Footer: 고정, 하단. Profile 또는 보조 액션. */}
|
|
210
210
|
<Sidebar.Footer>
|
|
211
211
|
<Sidebar.Profile
|
|
212
212
|
name="희영"
|
|
213
213
|
sub="admin@ovenn.dev"
|
|
214
214
|
avatar={{ src, status }} // Avatar props 패스스루
|
|
215
|
-
trailing={<Icon name="caret-up" />} // non-interactive
|
|
215
|
+
trailing={<Icon name="caret-up" />} // non-interactive만: IconButton 중첩 금지
|
|
216
216
|
/>
|
|
217
217
|
</Sidebar.Footer>
|
|
218
218
|
</Sidebar.Main>
|
|
@@ -224,7 +224,7 @@ Rail은 "영구적으로 collapsed인 영역"이란 의미. 안쪽 Sidebar.Item
|
|
|
224
224
|
|---|---|
|
|
225
225
|
| expanded (기본) | 폭 `--sidebar-w`, 모든 자식 라벨·wordmark·trailing 노출 |
|
|
226
226
|
| collapsed | 폭 `--sidebar-w-collapsed`, Item은 icon-only, wordmark·Section title·Profile 텍스트·trailing 숨김 |
|
|
227
|
-
| Item active | MenuItem active
|
|
227
|
+
| Item active | MenuItem active 그대로: `--bg-muted` 배경 + `fg-strong` + medium weight |
|
|
228
228
|
|
|
229
229
|
### 조합 예시
|
|
230
230
|
```tsx
|
|
@@ -299,7 +299,7 @@ Rail은 "영구적으로 collapsed인 영역"이란 의미. 안쪽 Sidebar.Item
|
|
|
299
299
|
</DropdownMenu>
|
|
300
300
|
</Sidebar.Footer>
|
|
301
301
|
|
|
302
|
-
// 4. Collapsed
|
|
302
|
+
// 4. Collapsed: icon-only (Sidebar.Profile 자동으로 아바타만 남음)
|
|
303
303
|
<Sidebar collapsed>
|
|
304
304
|
<Sidebar.Header>
|
|
305
305
|
<Sidebar.Brand symbol={<Icon name="rocket-launch" />} />
|
|
@@ -311,7 +311,7 @@ Rail은 "영구적으로 collapsed인 영역"이란 의미. 안쪽 Sidebar.Item
|
|
|
311
311
|
</Sidebar.Body>
|
|
312
312
|
</Sidebar>
|
|
313
313
|
|
|
314
|
-
// 5. 2단
|
|
314
|
+
// 5. 2단 쉘: Rail(활동 바) + Main (VS Code·Linear 스타일)
|
|
315
315
|
<Sidebar>
|
|
316
316
|
<Sidebar.Rail>
|
|
317
317
|
<Sidebar.Brand symbol={<Icon name="rocket-launch" />} />
|
|
@@ -374,13 +374,13 @@ Rail은 "영구적으로 collapsed인 영역"이란 의미. 안쪽 Sidebar.Item
|
|
|
374
374
|
</Sidebar.RailGroup>
|
|
375
375
|
</Sidebar.Rail>
|
|
376
376
|
|
|
377
|
-
<Sidebar.Main
|
|
377
|
+
<Sidebar.Main>콘텐츠</Sidebar.Main>
|
|
378
378
|
</Sidebar>
|
|
379
379
|
```
|
|
380
380
|
|
|
381
381
|
### 사용 사례
|
|
382
382
|
|
|
383
|
-
#### AI
|
|
383
|
+
#### AI 챗: 대화 이력
|
|
384
384
|
```jsx
|
|
385
385
|
<AppFrame variant="flat" className={`${styles.useCaseFrame} ${styles.chatLayout}`}>
|
|
386
386
|
<AppFrame.Sidebar>
|
|
@@ -425,7 +425,7 @@ Rail은 "영구적으로 collapsed인 영역"이란 의미. 안쪽 Sidebar.Item
|
|
|
425
425
|
</AppFrame>
|
|
426
426
|
```
|
|
427
427
|
|
|
428
|
-
####
|
|
428
|
+
#### 워크스페이스: 팀과 프로젝트
|
|
429
429
|
```jsx
|
|
430
430
|
<AppFrame variant="flat" className={`${styles.useCaseFrame} ${styles.workspaceLayout}`}>
|
|
431
431
|
<AppFrame.Sidebar>
|
|
@@ -487,7 +487,7 @@ Rail은 "영구적으로 collapsed인 영역"이란 의미. 안쪽 Sidebar.Item
|
|
|
487
487
|
</AppFrame>
|
|
488
488
|
```
|
|
489
489
|
|
|
490
|
-
####
|
|
490
|
+
#### 파일함: 폴더 계층
|
|
491
491
|
```jsx
|
|
492
492
|
<AppFrame variant="flat" className={`${styles.useCaseFrame} ${styles.fileLayout}`}>
|
|
493
493
|
<AppFrame.Sidebar>
|
|
@@ -530,7 +530,7 @@ Rail은 "영구적으로 collapsed인 영역"이란 의미. 안쪽 Sidebar.Item
|
|
|
530
530
|
<!-- generated-use-cases:start -->
|
|
531
531
|
### 사용 사례 연결
|
|
532
532
|
|
|
533
|
-
- AI chat
|
|
533
|
+
- AI chat: conversations · Workspace: teams and projects · File cabinet: folder hierarchy
|
|
534
534
|
- 문서: /en/components/structure/sidebar#use-cases
|
|
535
535
|
- 참조 원본: [Sidebar 사례](../use-cases/structure-sidebar.md)
|
|
536
536
|
- AI 조회: `get_guide(topic="use-cases/structure-sidebar", sections=["사례 목록", "파일 목록"])` 후 필요한 `Section:` / `Source:` 헤딩을 선택한다.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Skeleton
|
|
2
2
|
|
|
3
3
|
### 원칙
|
|
4
|
-
|
|
4
|
+
로딩할 콘텐츠의 크기와 배치를 미리 확보하는 장식 요소다. 원형, 사각형, 텍스트 줄을 조합하며 오류나 빈 결과를 대신하지 않는다.
|
|
5
5
|
|
|
6
6
|
### Props
|
|
7
7
|
- `shape?: 'rect' | 'circle' | 'text'`: 기본 rect. circle은 정사각 크기, text는 얇은 줄이다.
|
|
@@ -33,10 +33,13 @@ Skeleton은 aria-hidden인 span이며 포커스나 로딩 상태를 따로 만
|
|
|
33
33
|
</div>
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
+
### Fallback
|
|
37
|
+
구조를 미리 정하기 어려운 짧은 로딩에는 Spinner를 사용한다. 로딩이 끝나면 실제 콘텐츠로 바꾸며, 오류나 빈 결과는 별도 상태로 안내한다.
|
|
38
|
+
|
|
36
39
|
### 관련
|
|
37
|
-
- [[components/card]]
|
|
38
|
-
- [[components/canvas-node]]
|
|
39
|
-
- [[components/spinner]]
|
|
40
|
+
- [[components/card]]: 콘텐츠 조합
|
|
41
|
+
- [[components/canvas-node]]: 미디어·텍스트 로딩 소비처
|
|
42
|
+
- [[components/spinner]]: 자리를 미리 그릴 수 없는 짧은 작업
|
|
40
43
|
|
|
41
44
|
<!-- component-contract -->
|
|
42
45
|
```json
|