@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
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
# CommandPalette
|
|
2
2
|
|
|
3
3
|
### 원칙
|
|
4
|
-
⌘K로 열리는 **전역 명령·검색 창**. 페이지 이동과 자주 쓰는 액션을 키보드만으로 끝내는 자리. 사이드바·메뉴·설정을 뒤지지 않고 "이름으로 바로 간다". VSCode·Linear·Notion·Figma가 공유하는 관용. Ovenn은 쉘(Radix Dialog)·검색/필터/네비(cmdk)·시각(MenuItem)을 **얇게 묶은 어댑터**. 상호작용·접근성·fuzzy 매칭은 라이브러리에 맡기고, Ovenn은 스킨과 API 다듬기에 집중한다. [[components/context-menu]]·[[components/dropdown-menu]]와 같은 메뉴
|
|
4
|
+
⌘K로 열리는 **전역 명령·검색 창**. 페이지 이동과 자주 쓰는 액션을 키보드만으로 끝내는 자리. 사이드바·메뉴·설정을 뒤지지 않고 "이름으로 바로 간다". VSCode·Linear·Notion·Figma가 공유하는 관용. Ovenn은 쉘(Radix Dialog)·검색/필터/네비(cmdk)·시각(MenuItem)을 **얇게 묶은 어댑터**. 상호작용·접근성·fuzzy 매칭은 라이브러리에 맡기고, Ovenn은 스킨과 API 다듬기에 집중한다. [[components/context-menu]]·[[components/dropdown-menu]]와 같은 메뉴 패밀리: 아이템 시각 규칙은 [[components/menu-item]] 하나로 수렴.
|
|
5
5
|
|
|
6
6
|
### Do
|
|
7
7
|
- **팔레트 비례를 조밀하게 유지한다.** 최대 폭560px·입력48px·목록 여백8px. 결과 행은 공용 MenuItem `md`(최소36px)를 그대로 사용한다. Material `glass`에서 표면은 72% 배경색과8px blur의 은은한 글래스로 처리하며 미지원/투명도 감소 설정에서는 불투명 배경으로 대체한다. 선택 표면은 기본 hover보다 또렷하게 유지한다. 라이트 모드의 외곽·입력·하단 경계는 반투명 `--border`를 사용해 글래스 위에서 흰 선처럼 뜨지 않게 한다. 다크 모드는 공용 글래스 경계를 유지한다.
|
|
8
8
|
- **결과 아이템 기본 크기는 `md`.** `sm`은 명시적으로 밀도를 낮출 때 사용한다.
|
|
9
9
|
- **설명은 본문 매치의 근거로만 표시한다.** 비어 있지 않은 검색어가 문자열 제목에는 없고 문자열 `description`에 포함될 때만 한 줄로 표시한다(앞뒤 공백 제거·대소문자 무시). 빈 입력·제목 매치·키워드만 매치에는 숨긴다. 검색용 `value`/`keywords`는 설명 표시와 독립적으로 유지한다. 문자열이 아닌 제목·설명은 포함 여부를 판정하지 않고 설명을 숨긴다.
|
|
10
10
|
- **데이터·관리 UI에선 거의 필수로 넣는다.** 페이지 수가 10개 넘고 액션이 반복될수록 ⌘K 하나로 사용자 숙련도의 천장이 올라간다. 콘텐츠 사이트에선 선택적.
|
|
11
|
-
- **두 종류를
|
|
12
|
-
- **라벨은 동사·명사 짧게.** 리스트 폭이 넓긴 하지만 한 줄에 자연스레 읽히는 길이로. "선택한 항목을 휴지통으로 이동" 같은 문장형
|
|
13
|
-
- **아이콘은 의미가 명확할 때만**. [[components/context-menu]]와 같은
|
|
14
|
-
- **단축키는 실제 심볼로 표시.** `⌘N` · `⇧⌘P` · `⌫`. uppercase
|
|
11
|
+
- **두 종류를 섞는다: 페이지 이동 + 액션.** 그룹 heading으로 명시 분리하면 사용자는 "어디로 갈까"와 "뭘 할까"를 같은 입구에서 결정한다.
|
|
12
|
+
- **라벨은 동사·명사 짧게.** 리스트 폭이 넓긴 하지만 한 줄에 자연스레 읽히는 길이로. "선택한 항목을 휴지통으로 이동" 같은 문장형 금지: 동사 하나로 압축.
|
|
13
|
+
- **아이콘은 의미가 명확할 때만**. [[components/context-menu]]와 같은 규칙: 억지 아이콘보다 라벨만 두는 게 낫다. 아이콘 이름은 [[web/components/Icon/Icon.tsx]] 세트에서만.
|
|
14
|
+
- **단축키는 실제 심볼로 표시.** `⌘N` · `⇧⌘P` · `⌫`. uppercase 금지: [[feedback_no_uppercase]].
|
|
15
15
|
- **선택 후 자동 닫힘.** `onSelect` 안에서 라우팅/액션을 실행한 다음 `onOpenChange(false)`를 명시적으로 호출. cmdk는 자동으로 닫지 않는다.
|
|
16
|
-
- **열기는 Hook으로 위임.** `useCommandPaletteHotkey(() => setOpen((v) => !v))` 한 줄이면 ⌘K/Ctrl+K가 어디서든 토글된다. 입력 중에도
|
|
16
|
+
- **열기는 Hook으로 위임.** `useCommandPaletteHotkey(() => setOpen((v) => !v))` 한 줄이면 ⌘K/Ctrl+K가 어디서든 토글된다. 입력 중에도 발화: 검색은 어디서나 열려야.
|
|
17
17
|
- **Empty state는 꼭 넣는다.** 결과 0일 때 그냥 사라지면 사용자는 "뭐가 잘못됐나" 혼란. 짧은 한 줄로 "결과 없음" 명시, 필요하면 "다른 검색어" 유도.
|
|
18
18
|
- **최근 사용·즐겨찾기는 상단 그룹**. 입력이 비었을 때만 노출. 입력이 생기면 그 그룹은 숨기거나 가중치 낮게.
|
|
19
19
|
- **그룹은 3~5개 이하로.** 더 많으면 스캐닝이 무너진다. "페이지 / 액션 / 설정" 정도가 상한.
|
|
20
20
|
|
|
21
21
|
### Don't
|
|
22
22
|
- **핵심 플로우를 ⌘K 뒤에만 두지 말 것.** 신규 가입·결제 같은 CTA는 눈에 보이는 자리에. 팔레트는 **알고 있는 사용자용 지름길**이지 발견 입구가 아니다.
|
|
23
|
-
- 아이템에 큰 썸네일·멀티라인 설명 금지. 리스트 밀도가
|
|
24
|
-
- 트리거 버튼을 "Open Palette"라고 라벨 붙이지 말 것. 사용자는 그 용어를 모른다.
|
|
25
|
-
- 열림 상태로 영구 고정 금지 (`defaultOpen` 패턴 등). 팔레트는 **임시
|
|
23
|
+
- 아이템에 큰 썸네일·멀티라인 설명 금지. 리스트 밀도가 핵심: 설명이 필요하면 `description` prop 한 줄까지. 그보다 길면 결과 페이지로.
|
|
24
|
+
- 트리거 버튼을 "Open Palette"라고 라벨 붙이지 말 것. 사용자는 그 용어를 모른다. **검색 + ⌘K 힌트**가 관용.
|
|
25
|
+
- 열림 상태로 영구 고정 금지 (`defaultOpen` 패턴 등). 팔레트는 **임시 입구**: 상주하는 UI는 사이드바·툴바.
|
|
26
26
|
- Modal과 혼용 금지. 결정·입력 다이얼로그는 [[components/modal]], 전역 명령 검색은 Palette. 서로 포커스 레벨이 다르다.
|
|
27
|
-
- 색·radius·shadow 하드코딩
|
|
27
|
+
- 색·radius·shadow 하드코딩 금지: [[feedback_no_hardcoded_values]]. 쉘 시각은 CommandPalette CSS가 토큰 경유로 이미 처리.
|
|
28
28
|
|
|
29
29
|
### Fallback
|
|
30
30
|
size 애매하면 `md`. 그룹 분류 애매하면 "액션" 하나로.
|
|
@@ -38,24 +38,24 @@ size 애매하면 `md`. 그룹 분류 애매하면 "액션" 하나로.
|
|
|
38
38
|
| **Soft pill 트리거** | 상단 Topbar 중앙·헤더 등 "항상 보이는 전역 입구". bg-subtle로 연하게 깔아 **열림 상태(Input 흐름)**와 자연스레 이어집니다. | `background: var(--bg-subtle)` + `color: var(--fg-subtle)` + `border-radius: var(--radius-md)` + `padding: 0 var(--space-4)` + hover 시 `background: var(--hover)` · `color: var(--fg)`. 내용은 좌측 돋보기 아이콘 + 라벨(플레이스홀더 문구) + 우측 Shortcut. |
|
|
39
39
|
|
|
40
40
|
- Soft pill은 폭을 넉넉히(`calc(var(--space-2) * 48)` 전후) 둬서 플레이스홀더 문구가 숨 쉬게 합니다. 아이콘·라벨·Shortcut이 꽉 차 보이면 pill 아닌 outline 쪽을 쓰세요.
|
|
41
|
-
- 라벨은
|
|
42
|
-
- 둘 다 색·radius·spacing은 토큰
|
|
41
|
+
- 라벨은 **검색 / 무엇을 찾으세요?** 같은 플레이스홀더 톤. "Open Palette"처럼 UI 용어 금지: 사용자는 그 단어를 모릅니다.
|
|
42
|
+
- 둘 다 색·radius·spacing은 토큰 경유: [[feedback_no_hardcoded_values]].
|
|
43
43
|
|
|
44
44
|
### 관련
|
|
45
|
-
- [[tokens/material]]
|
|
46
|
-
- [[components/menu-item]]
|
|
47
|
-
- [[components/modal]]
|
|
48
|
-
- [[components/dropdown-menu]] · [[components/context-menu]]
|
|
49
|
-
- [[components/shortcut]]
|
|
50
|
-
- [[components/input]]
|
|
51
|
-
- [[tokens/color]] · [[tokens/shadow]]
|
|
45
|
+
- [[tokens/material]]: 공용 `--surface-glass-*` 재질. Material 축이 Solid/Glass 적용을 결정한다.
|
|
46
|
+
- [[components/menu-item]]: 아이템 시각·슬롯·active 규칙의 원본. CommandPalette.Item은 이 위에 cmdk `data-selected`를 매핑.
|
|
47
|
+
- [[components/modal]]: 쉘 상호작용 비교군. Modal은 바깥 클릭 안 닫힘·중앙 배치, Palette는 바깥 클릭 닫힘·상단 배치.
|
|
48
|
+
- [[components/dropdown-menu]] · [[components/context-menu]]: 같은 메뉴 패밀리. 트리거만 다름(클릭 vs 우클릭 vs 전역 단축키).
|
|
49
|
+
- [[components/shortcut]]: ⌘K 힌트는 Shortcut 컴포넌트로.
|
|
50
|
+
- [[components/input]]: Palette의 Input은 전용 스타일. 일반 폼 Input과 섞지 말 것.
|
|
51
|
+
- [[tokens/color]] · [[tokens/shadow]]: `--bg` · `--border` · `--shadow-xl` · `--scrim`이 쉘 시각을 만든다.
|
|
52
52
|
|
|
53
53
|
### Props 시그니처
|
|
54
54
|
```tsx
|
|
55
55
|
<CommandPalette
|
|
56
56
|
open={boolean}
|
|
57
57
|
onOpenChange={(open: boolean) => void}
|
|
58
|
-
size="sm | md" // default: md
|
|
58
|
+
size="sm | md" // default: md: 아이템 기본 size
|
|
59
59
|
label="명령 검색" // 스크린리더용. 다이얼로그 접근성 네임
|
|
60
60
|
>
|
|
61
61
|
<CommandPalette.Input
|
|
@@ -71,7 +71,7 @@ size 애매하면 `md`. 그룹 분류 애매하면 "액션" 하나로.
|
|
|
71
71
|
shortcut="⌘,"
|
|
72
72
|
description="보조 설명 한 줄"
|
|
73
73
|
disabled={boolean}
|
|
74
|
-
onSelect={() => void} // 자동 닫힘
|
|
74
|
+
onSelect={() => void} // 자동 닫힘 ❌: 안에서 onOpenChange(false) 명시
|
|
75
75
|
>
|
|
76
76
|
대시보드
|
|
77
77
|
</CommandPalette.Item>
|
|
@@ -96,7 +96,7 @@ useCommandPaletteHotkey(
|
|
|
96
96
|
| 열림 · 닫힘 | 쉘은 Radix Dialog 애니메이션(scale 0.98→1 + fade). 상단 20vh 고정 배치. |
|
|
97
97
|
| 아이템 highlight (↑↓·마우스) | cmdk `[data-selected="true"]` → MenuItem fill 스타일(`--hover` 배경 + `fg-strong`) 자동 매핑 |
|
|
98
98
|
| 입력 필터링 | cmdk fuzzy 매칭. 매치되는 아이템만 표시, 그룹 heading은 매치된 아이템이 있을 때만 노출 |
|
|
99
|
-
| Empty | 매치 0일 때 `Empty` children
|
|
99
|
+
| Empty | 매치 0일 때 `Empty` children 렌더: 다른 아이템 전부 숨김 |
|
|
100
100
|
| disabled 아이템 | `fg-disabled` + 선택/엔터 모두 꺼짐 (cmdk + MenuItem 공통 처리) |
|
|
101
101
|
|
|
102
102
|
### Size 가이드
|
|
@@ -107,7 +107,7 @@ useCommandPaletteHotkey(
|
|
|
107
107
|
|
|
108
108
|
### 조합 예시
|
|
109
109
|
```tsx
|
|
110
|
-
//
|
|
110
|
+
// 기본: 페이지 + 액션 두 그룹
|
|
111
111
|
const [open, setOpen] = useState(false);
|
|
112
112
|
const router = useRouter();
|
|
113
113
|
useCommandPaletteHotkey(() => setOpen((v) => !v));
|
|
@@ -138,7 +138,7 @@ function go(path: string) {
|
|
|
138
138
|
</CommandPalette.List>
|
|
139
139
|
</CommandPalette>
|
|
140
140
|
|
|
141
|
-
// 트리거 A
|
|
141
|
+
// 트리거 A: Outline (툴바 안 보조 입구)
|
|
142
142
|
<Button
|
|
143
143
|
variant="outline" size="sm"
|
|
144
144
|
leftIcon={<Icon name="search" />}
|
|
@@ -148,7 +148,7 @@ function go(path: string) {
|
|
|
148
148
|
검색
|
|
149
149
|
</Button>
|
|
150
150
|
|
|
151
|
-
// 트리거 B
|
|
151
|
+
// 트리거 B: Soft pill (Topbar 중앙 전역 입구)
|
|
152
152
|
// bg-subtle로 연하게 깔아 열렸을 때의 Input 흐름과 이어진다.
|
|
153
153
|
<button
|
|
154
154
|
type="button"
|
|
@@ -173,7 +173,7 @@ function go(path: string) {
|
|
|
173
173
|
<Shortcut size="sm" variant="solid">⌘K</Shortcut>
|
|
174
174
|
</button>
|
|
175
175
|
|
|
176
|
-
// 최근
|
|
176
|
+
// 최근 사용: 입력이 비었을 때만
|
|
177
177
|
<CommandPalette.List>
|
|
178
178
|
{query === "" && (
|
|
179
179
|
<CommandPalette.Group heading="최근">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Comment
|
|
2
2
|
|
|
3
3
|
### 원칙
|
|
4
|
-
|
|
4
|
+
작성자, 시간, 본문과 액션을 표시하는 댓글이다. CommentList로 목록과 답글을 구성하고, CommentComposer로 댓글과 답글을 작성한다.
|
|
5
5
|
|
|
6
6
|
### Do
|
|
7
7
|
- CommentComposer와 CommentEditor의 `variant="line" | "box"`는 기본 line이다. box는 투명 배경·테마 border/radius/corner-shape를 따르는 하나의 외곽 프레임에 입력과 액션을 묶는다. 작성·답글·수정에 같은 variant를 전달하며 상태/키보드/멘션/Undo 계약은 동일하다. 좁은 box 답글의 대상 Tag는 프레임 안 첫 줄에 배치한다.
|
|
@@ -46,9 +46,12 @@
|
|
|
46
46
|
- `CommentList`: native ul attributes and children. 항목의 안정적인 React key는 소비자가 제공한다.
|
|
47
47
|
- 아바타는 md(32px), 내부 ListItem은 sm/top. 액션 종류와 라벨은 MessageActions를 따른다.
|
|
48
48
|
|
|
49
|
+
### Fallback
|
|
50
|
+
사용 가능한 액션이 없으면 actions를 생략한다. 작성·수정·삭제 권한과 실패 안내는 데이터를 관리하는 사용처에서 처리한다.
|
|
51
|
+
|
|
49
52
|
### 관련
|
|
50
53
|
- [[components/list-item]] · [[components/avatar]] · [[components/message-actions]]
|
|
51
|
-
- [[components/tag]] · [[components/input]] · [[components/button]]
|
|
54
|
+
- [[components/tag]] · [[components/input]] · [[components/button]]: 편집·작성 폼 조립
|
|
52
55
|
|
|
53
56
|
### data-slot
|
|
54
57
|
- `comment-root`, `comment-body`, `comment-actions`, `comment-list`, `comment-replies`, `comment-composer`, `comment-editor`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# ContextMenu
|
|
2
2
|
|
|
3
3
|
### 원칙
|
|
4
|
-
우클릭·롱프레스로 열리는 **한 객체에 대한 2차 액션 메뉴**. 컨텐츠 상단 툴바나 상단 nav에 놓지 못한 부가 기능(잘라내기/복사/이름 변경/삭제/공유 등)이 여기 모인다. 시각·상태·슬롯은 [[components/menu-item]]이 이미 갖고 있으므로 ContextMenu는 그 위에 얹은 **얇은
|
|
4
|
+
우클릭·롱프레스로 열리는 **한 객체에 대한 2차 액션 메뉴**. 컨텐츠 상단 툴바나 상단 nav에 놓지 못한 부가 기능(잘라내기/복사/이름 변경/삭제/공유 등)이 여기 모인다. 시각·상태·슬롯은 [[components/menu-item]]이 이미 갖고 있으므로 ContextMenu는 그 위에 얹은 **얇은 어댑터**: 열림/닫힘·포커스 트랩·화살표 네비게이션·서브메뉴 안전지연·뷰포트 flip만 담당한다. Radix `@radix-ui/react-context-menu`를 감싼 compound 컴포넌트.
|
|
5
5
|
|
|
6
6
|
### Do
|
|
7
7
|
- 시각 속성의 선택 옵션은 [[PRINCIPLES]] §5d **선택 옵션 시각화**를 적용한다.
|
|
@@ -10,45 +10,45 @@
|
|
|
10
10
|
- **트리거는 객체를 감싼다**: 파일 아이템·캔버스 셀·리스트 행처럼 "이 메뉴가 걸리는 객체"의 시각 경계와 트리거 영역이 정확히 일치해야 한다. 애매하면 사용자가 어디에 대한 메뉴인지 모른다.
|
|
11
11
|
- **2차 액션만**: 핵심 CTA는 페이지 상단·인라인 버튼에. 컨텍스트 메뉴는 자주 쓰지 않지만 있을 때 반가운 옵션 자리.
|
|
12
12
|
- **논리 그룹화**: 관련된 액션끼리 묶고 `Separator`로 나눈다. 파괴적 액션은 항상 맨 아래 그룹, `variant="destructive"`.
|
|
13
|
-
- **키보드 접근 보장**: Radix가 화살표·Home/End·타이핑 서치·Esc·Tab을 이미 처리한다. 자체 키 핸들러를 얹지 말
|
|
13
|
+
- **키보드 접근 보장**: Radix가 화살표·Home/End·타이핑 서치·Esc·Tab을 이미 처리한다. 자체 키 핸들러를 얹지 말 것: 충돌 원인.
|
|
14
14
|
- **선택 후 자동 닫힘 활용**: `onSelect`가 발화하면 Radix가 자동으로 닫는다. 계속 열려 있어야 하면 `e.preventDefault()` (예: 다중 체크박스 토글).
|
|
15
15
|
- **상태 있는 아이템**: 토글은 `CheckboxItem`, 배타 선택은 `RadioGroup` + `RadioItem`. 인디케이터(체크마크·dot)는 컴포넌트가 자동으로 그린다.
|
|
16
16
|
- **중첩은 `Sub` 트리오**: `Sub` / `SubTrigger` / `SubContent`. SubTrigger는 자동으로 `hasSubmenu` caret이 붙는다.
|
|
17
17
|
- **트리거 아이콘 힌트**: 리스트 행의 케밥(⋮)·미트볼(⋯) 아이콘으로 "메뉴가 있음"을 사전에 암시하면 발견성이 크게 오른다.
|
|
18
18
|
- **`asChild`로 임의 요소에 위임**: `<ContextMenu.Trigger asChild>`로 카드·이미지·행 어느 것이든 트리거로 만든다.
|
|
19
|
-
- **단축키는 실제 심볼**: `⌘K` · `⇧⌘P` · `⌫`. uppercase
|
|
20
|
-
- **아이콘은 액션 의미와 정확히 일치할 때만 붙인다.** 아이콘 슬롯은 스캐닝 속도를 높이는 힌트인데 의미 어긋난 아이콘은 오히려 라벨 해석을 방해한다. 유효한 아이콘 이름은 [[web/components/Icon/Icon.tsx]]에 정의된 세트에서만 골라야
|
|
19
|
+
- **단축키는 실제 심볼**: `⌘K` · `⇧⌘P` · `⌫`. uppercase 금지: [[feedback_no_uppercase]].
|
|
20
|
+
- **아이콘은 액션 의미와 정확히 일치할 때만 붙인다.** 아이콘 슬롯은 스캐닝 속도를 높이는 힌트인데 의미 어긋난 아이콘은 오히려 라벨 해석을 방해한다. 유효한 아이콘 이름은 [[web/components/Icon/Icon.tsx]]에 정의된 세트에서만 골라야 한다: 없는 이름을 상상으로 지어내지 말 것(그 순간 렌더 실패). **적절한 매치가 없으면 아이콘을 붙이지 않고 라벨만 둔다.** 예: 잘라내기/붙여넣기는 우리 세트에 정확한 매치가 없으므로 라벨 + 단축키만으로 표현. 리스트 안에서 아이콘 있는 행과 없는 행이 섞여도 괜찮다: 억지 아이콘보다 낫다.
|
|
21
21
|
- 자주 쓰이는 안전 매핑: 열기 → `arrow-square-out` (외부로 나가는 화살표) · 문서 아이템 → `article` · 이름 변경/편집 → `pencil-simple` · 잘라내기 → `scissors` · 복사 → `copy` · 붙여넣기 → `clipboard-text` · 복제 → `copy-simple` (겹친 문서 = 같은 걸 하나 더) · 태그 → `tag` · 정보 → `info` · 삭제 → `trash` · 공유 → `share-network` (연결된 노드) · 방송/알림 뉘앙스 → `broadcast` · 이메일 → `envelope` · 메시지 → `chat-text` · 설정 → `gear` · 검색 → `search` · 즐겨찾기 → `star` · 새로 만들기 → `article` (문서) 또는 라벨만.
|
|
22
|
-
- **라벨은
|
|
22
|
+
- **라벨은 짧게: 한 줄에 자연스레 읽히는 길이(대략 한글 8~12자 · 영문 12~20자 이내).** ContextMenu 폭은 표준 224px로 고정되어 있고, 넘칠 땐 최대 한 스텝(+48px)만 늘어나며 그 뒤엔 잘린다. "선택한 항목을 휴지통으로 이동하고 30일 후 영구 삭제" 같은 문장형은 금지: 동사 위주로 압축하고 세부 조건은 확인 다이얼로그로 넘긴다. 이 규칙은 매우 강한 권장 사항이며, 라벨을 짧게 만들 수 없으면 그 액션은 컨텍스트 메뉴 자리가 아니라는 신호다.
|
|
23
23
|
|
|
24
24
|
### Don't
|
|
25
25
|
- 핵심 플로우를 컨텍스트 메뉴 안으로 숨기지 말 것. "우클릭해야만 보이는" CTA는 발견 실패로 이어진다.
|
|
26
|
-
- 한 메뉴에 12개 이상 아이템 나열
|
|
26
|
+
- 한 메뉴에 12개 이상 아이템 나열 금지: 스캔이 무너지고 실수 클릭이 급증한다. 넘치면 `Sub`로 접기.
|
|
27
27
|
- **긴 라벨을 두 줄로 감싸지 말 것.** ContextMenu는 `white-space: nowrap` + 표준 폭(224px) 고정이 시각 계약. 두 줄 라벨은 리듬을 무너뜨리고 아이템 높이가 들쭉날쭉해진다. 짧게 못 쓰겠으면 라벨 자체를 재설계할 것.
|
|
28
|
-
- 서로 다른 객체에 대한 액션을 한 메뉴에 섞지 말
|
|
28
|
+
- 서로 다른 객체에 대한 액션을 한 메뉴에 섞지 말 것: 컨텍스트 = 하나의 대상.
|
|
29
29
|
- 시각을 위해 root · content에 hard-coded 색·radius·shadow를 얹지 말 것. 모두 토큰 경유 ([[PRINCIPLES]] §6, [[feedback_no_hardcoded_values]]).
|
|
30
30
|
- Radix의 포지셔닝을 뒤흔들지 말 것 (Content에 `position: fixed`/`transform` 강제 금지). `collisionPadding`만 조절.
|
|
31
|
-
- 트리거 위에서 `onContextMenu`를 자체 처리하지 말
|
|
31
|
+
- 트리거 위에서 `onContextMenu`를 자체 처리하지 말 것: Radix가 이미 preventDefault로 브라우저 기본 메뉴를 눌러준다.
|
|
32
32
|
|
|
33
33
|
### Fallback
|
|
34
34
|
컨텍스트 메뉴에는 `sm`을 권장한다. size를 생략하면 공용 기본값 `md`를 사용한다. Item variant 애매하면 `default`. 액션이 파괴적인지 확실치 않으면 destructive 대신 default + 확인 다이얼로그([[components/alert-dialog]]).
|
|
35
35
|
|
|
36
36
|
### 관련
|
|
37
|
-
- [[components/menu-item]]
|
|
38
|
-
- [[components/dropdown-menu]]
|
|
39
|
-
- [[components/icon-button]]
|
|
40
|
-
- [[components/alert-dialog]]
|
|
41
|
-
- [[axes/shape]] · [[axes/density]]
|
|
42
|
-
- [[tokens/color]]
|
|
37
|
+
- [[components/menu-item]]: 시각·슬롯·상태 규칙의 원본. ContextMenu는 이 위에 얇게 얹은 어댑터.
|
|
38
|
+
- [[components/dropdown-menu]]: 트리거만 다름(클릭 vs 우클릭). Content 이하는 거의 동일 패턴 공유.
|
|
39
|
+
- [[components/icon-button]]: 케밥(⋮)/미트볼(⋯) 트리거 아이콘. 발견성 힌트.
|
|
40
|
+
- [[components/alert-dialog]]: 파괴적 액션의 최종 확인은 여기.
|
|
41
|
+
- [[axes/shape]] · [[axes/density]]: Content radius·아이템 min-height가 이 축에 반응.
|
|
42
|
+
- [[tokens/color]]: `--bg` · `--border` · `--shadow-lg` · `--hover` 등이 시각을 만든다.
|
|
43
43
|
|
|
44
44
|
### Props 시그니처
|
|
45
45
|
```tsx
|
|
46
|
-
<ContextMenu> // Radix Root
|
|
46
|
+
<ContextMenu> // Radix Root: open/onOpenChange 등 전부 통과
|
|
47
47
|
<ContextMenu.Trigger asChild> // 우클릭·롱프레스 감지 영역
|
|
48
48
|
{trigger}
|
|
49
49
|
</ContextMenu.Trigger>
|
|
50
50
|
<ContextMenu.Content
|
|
51
|
-
size="sm | md" // default: md
|
|
51
|
+
size="sm | md" // default: md: 하위 아이템 기본 size
|
|
52
52
|
collisionPadding={number} // default: 8
|
|
53
53
|
>
|
|
54
54
|
<ContextMenu.Label>...</ContextMenu.Label>
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
trailingActions={MenuItemAction[]}
|
|
60
60
|
shortcut="⌘C"
|
|
61
61
|
disabled={boolean}
|
|
62
|
-
onSelect={(e) => void} // 발화 후 자동
|
|
62
|
+
onSelect={(e) => void} // 발화 후 자동 닫힘: e.preventDefault()로 유지
|
|
63
63
|
>
|
|
64
64
|
...
|
|
65
65
|
</ContextMenu.Item>
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
| 상태 | 시각 |
|
|
84
84
|
|---|---|
|
|
85
85
|
| 열림 · 닫힘 | Content in/out은 전역 유틸 `.m-float` 담당 (open: emerge-from-* + base + emphasized, close: recede-to-* + fast + ease-in). 자체 애니메이션 재정의 금지. |
|
|
86
|
-
| 아이템 highlight (마우스·키보드) | `--hover` 배경, `fg-strong
|
|
86
|
+
| 아이템 highlight (마우스·키보드) | `--hover` 배경, `fg-strong`: MenuItem 규칙 그대로 |
|
|
87
87
|
| checked (Checkbox) | leading 맨 앞에 checkmark 자동 삽입 |
|
|
88
88
|
| checked (Radio) | leading 맨 앞에 dot 인디케이터, fill=currentColor |
|
|
89
89
|
| disabled | `fg-disabled`, 커서 not-allowed, 키보드 순환에서 자동 제외 |
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
|
|
98
98
|
### 조합 예시
|
|
99
99
|
```tsx
|
|
100
|
-
// 캔버스 셀
|
|
100
|
+
// 캔버스 셀 우클릭: 잘라내기/복사/붙여넣기 + 삭제
|
|
101
101
|
<ContextMenu>
|
|
102
102
|
<ContextMenu.Trigger asChild>
|
|
103
103
|
<Cell />
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
</ContextMenu.Content>
|
|
112
112
|
</ContextMenu>
|
|
113
113
|
|
|
114
|
-
// 뷰
|
|
114
|
+
// 뷰 옵션: Label + Checkbox + Radio
|
|
115
115
|
<ContextMenu.Content>
|
|
116
116
|
<ContextMenu.Label>보기</ContextMenu.Label>
|
|
117
117
|
<ContextMenu.CheckboxItem checked={grid} onCheckedChange={setGrid} shortcut="⌘G">
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
</ContextMenu.RadioGroup>
|
|
126
126
|
</ContextMenu.Content>
|
|
127
127
|
|
|
128
|
-
// 중첩
|
|
128
|
+
// 중첩 서브메뉴: 공유 대상 세분화
|
|
129
129
|
<ContextMenu.Content>
|
|
130
130
|
<ContextMenu.Item onSelect={open}>열기</ContextMenu.Item>
|
|
131
131
|
<ContextMenu.Sub>
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
</ContextMenu.Sub>
|
|
138
138
|
</ContextMenu.Content>
|
|
139
139
|
|
|
140
|
-
// 다중 토글
|
|
140
|
+
// 다중 토글 유지: onSelect에서 preventDefault로 열림 유지
|
|
141
141
|
<ContextMenu.CheckboxItem
|
|
142
142
|
checked={pinned}
|
|
143
143
|
onCheckedChange={setPinned}
|
|
@@ -56,10 +56,10 @@ type ControlGroupVariant = "primary" | "inverse" | "secondary" | "outline" | "gh
|
|
|
56
56
|
혼합 여부가 애매하면 controls/outline/md로 시작한다. 서로 다른 작업이면 결합하지 않고 개별 컨트롤로 배치한다.
|
|
57
57
|
|
|
58
58
|
### 관련
|
|
59
|
-
- [[components/button]] · [[components/input]] · [[components/select]] · [[components/date-picker]]
|
|
60
|
-
- [[components/button-group]]
|
|
61
|
-
- [[components/dropdown-menu]]
|
|
62
|
-
- [[tokens/spacing]] · [[tokens/radius]]
|
|
59
|
+
- [[components/button]] · [[components/input]] · [[components/select]] · [[components/date-picker]]: 실제 행동을 유지하는 내부 컨트롤
|
|
60
|
+
- [[components/button-group]]: 기존 코드 호환
|
|
61
|
+
- [[components/dropdown-menu]]: 스플릿 액션의 메뉴
|
|
62
|
+
- [[tokens/spacing]] · [[tokens/radius]]: 공통 높이와 외곽 형태
|
|
63
63
|
|
|
64
64
|
<!-- component-contract -->
|
|
65
65
|
```json
|
|
@@ -2,24 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
### 원칙
|
|
4
4
|
|
|
5
|
-
날짜·기간·시간 선택을 **하나의 컴포넌트**로 커버한다. props 조합으로 유즈케이스를
|
|
5
|
+
날짜·기간·시간 선택을 **하나의 컴포넌트**로 커버한다. props 조합으로 유즈케이스를 조립한다: 별도의 `DateRangePicker` / `TimePicker` 컴포넌트를 만들지 않는다. 컴포넌트 분화보다 prop 표면이 예측 가능성이 높다.
|
|
6
6
|
|
|
7
7
|
### Do
|
|
8
|
+
- 기본 입력창과 `withSegmentedInput`의 DateField는 Input의 `size`, `variant`, `width`, 라벨·설명·오류 규약을 공유한다. `width` 기본값은 `fill`이며 지정 폭도 부모 폭을 넘지 않는다.
|
|
9
|
+
- `label`, `description`, `warning`, `required`, `invalid`, `readOnly`, 외부 `aria-describedby`를 지원한다. `warning`은 설명 대신 표시하고 입력에 오류 ID와 `aria-invalid`를 연결한다.
|
|
10
|
+
- `readOnly`는 입력 포커스를 유지하면서 숫자 변경과 달력 열기를 막는다. `disabled`는 입력 포커스도 막는다. 포커스는 외곽 링 없이 기존 테두리와 옅은 표면 변화로 표시한다.
|
|
8
11
|
- 떠 있는 표면은 [[axes/material]]의 `solid | glass`를 따른다. 입력·색상판·inline 표면과 기존 동작은 유지한다.
|
|
9
|
-
- `mode` 하나로 단일/기간을
|
|
12
|
+
- `mode` 하나로 단일/기간을 결정한다: `mode="single"` 또는 `mode="range"`.
|
|
10
13
|
- `range`는 기본 `months=2` (양옆 두 달). 좁은 자리는 `months=1`로 명시.
|
|
11
14
|
- 시간이 필요하면 `withTime` 활성 + `timeMode`로 UI 방식 지정.
|
|
12
15
|
- 자주 쓰는 기간이 있으면 `withPresets`로 사이드바 노출. 기본 프리셋은 mode에 맞게 자동 선택됨.
|
|
13
16
|
- 값은 항상 통제형(controlled). `value`/`rangeValue` + `onChange`/`onRangeChange`로 다룬다.
|
|
14
17
|
- 대시보드 사이드바처럼 항상 노출해야 하면 `inline`을 켜서 Popover 없이 렌더링.
|
|
15
|
-
- **키보드 입력이 자연스러운 자리(생년월일·마감일 수기 입력 등)엔 `withSegmentedInput
|
|
16
|
-
- **임의 날짜를 비활성화해야 할 때는 `isDateUnavailable
|
|
17
|
-
- **긴 과거·미래 날짜가 필요한 자리는 Year Picker 사용
|
|
18
|
+
- **키보드 입력이 자연스러운 자리(생년월일·마감일 수기 입력 등)엔 `withSegmentedInput`**: YYYY/MM/DD 세그먼트로 숫자만 치면 자동 세그먼트 이동. `single` 모드 전용.
|
|
19
|
+
- **임의 날짜를 비활성화해야 할 때는 `isDateUnavailable`**: 주말·공휴일·예약된 날짜 등. 비활성 셀은 strike-through로 보이고 선택 불가.
|
|
20
|
+
- **긴 과거·미래 날짜가 필요한 자리는 Year Picker 사용 안내**: 달력 상단 월 라벨을 클릭하면 연도 그리드가 열림(모든 DatePicker에 기본 포함).
|
|
18
21
|
|
|
19
22
|
### Don't
|
|
20
|
-
- 시간만 단독으로 필요한 화면에 이 컴포넌트를 쓰지
|
|
21
|
-
- `mode="single"`에 `months=2`를 함께 쓰지
|
|
22
|
-
- `timeMode="grid30"`은 30분 슬롯 예약/미팅 UI가 아닌 경우
|
|
23
|
+
- 시간만 단독으로 필요한 화면에 이 컴포넌트를 쓰지 않는다: 날짜가 없이는 의미 없음. 순수 시간 입력은 [[components/time-picker]]를 사용한다.
|
|
24
|
+
- `mode="single"`에 `months=2`를 함께 쓰지 않는다: 시각적 낭비.
|
|
25
|
+
- `timeMode="grid30"`은 30분 슬롯 예약/미팅 UI가 아닌 경우 피한다: 세로로 길어져 Popover가 뷰포트를 밀어낸다.
|
|
23
26
|
- 하드코딩된 min/max width를 CSS로 덮어쓰지 않는다. 크기 조정은 `size` prop 경유.
|
|
24
27
|
|
|
25
28
|
### Fallback
|
|
@@ -31,13 +34,13 @@ mode가 명확하지 않으면 `single`. 시간 필요 여부가 명확하지
|
|
|
31
34
|
- DatePicker는 폼의 날짜·기간 입력과 선택에 집중한다.
|
|
32
35
|
|
|
33
36
|
### 관련
|
|
34
|
-
- [[components/input]]
|
|
35
|
-
- [[components/form-field]]
|
|
36
|
-
- [[axes/density]]
|
|
37
|
-
- [[axes/motion]]
|
|
38
|
-
- [[axes/shape]]
|
|
39
|
-
- [[tokens/color]]
|
|
40
|
-
- [[components/popover]]
|
|
37
|
+
- [[components/input]]: 트리거로 `<Input readOnly role="combobox">`를 재사용. 별도 트리거 스타일 없음.
|
|
38
|
+
- [[components/form-field]]: 라벨/에러 필요 시 DatePicker를 FormField로 감쌀 수 있음.
|
|
39
|
+
- [[axes/density]]: 트리거·달력 셀 높이가 `--control-h-sm/md/lg` 경유로 자동 반응.
|
|
40
|
+
- [[axes/motion]]: Popover in/out은 전역 유틸 `.m-float` 하나로 통일. 자체 keyframe 만들지 않는다. 자세히는 `axes/motion.md` §플로팅 서페이스 In/Out.
|
|
41
|
+
- [[axes/shape]]: 트리거·Popover의 radius가 Shape 축에 반응.
|
|
42
|
+
- [[tokens/color]]: `--primary`(선택), `--hover`(범위 하이라이트), `--border`(경계) 경유.
|
|
43
|
+
- [[components/popover]]: 트리거+오버레이 패턴 공유 (Radix Popover 기반).
|
|
41
44
|
|
|
42
45
|
### Props 시그니처
|
|
43
46
|
|
|
@@ -66,6 +69,11 @@ mode가 명확하지 않으면 `single`. 시간 필요 여부가 명확하지
|
|
|
66
69
|
weekStartsOn={0..6} // default: 0 (일)
|
|
67
70
|
|
|
68
71
|
size="sm | md | lg"
|
|
72
|
+
variant="outline | filled | line" // default: outline
|
|
73
|
+
width="fill | md | lg | number" // default: fill
|
|
74
|
+
label={ReactNode} description={ReactNode} warning={ReactNode}
|
|
75
|
+
invalid={boolean} required={boolean} readOnly={boolean}
|
|
76
|
+
aria-describedby={string}
|
|
69
77
|
disabled={boolean}
|
|
70
78
|
inline={boolean} // Popover 없이 인라인
|
|
71
79
|
trigger={ReactNode} // asChild 커스텀 트리거
|
|
@@ -75,22 +83,22 @@ mode가 명확하지 않으면 `single`. 시간 필요 여부가 명확하지
|
|
|
75
83
|
|
|
76
84
|
### Variant 매트릭스
|
|
77
85
|
|
|
78
|
-
`variant
|
|
86
|
+
입력창 표면은 `variant`로 정하고, 달력의 구성은 prop 조합으로 정한다. 자주 쓰는 조합:
|
|
79
87
|
|
|
80
88
|
| 조합 | 용도 | 금지 조합 |
|
|
81
89
|
|---|---|---|
|
|
82
90
|
| `mode="single"` | 하나의 날짜 선택 (생일, 만료일) | `months=2` |
|
|
83
|
-
| `mode="single"` + `withTime` | 예약 시각, 게시 예약 |
|
|
84
|
-
| `mode="range"` + `months=1` | 좁은 자리의 짧은 기간 |
|
|
85
|
-
| `mode="range"` + `months=2` (기본) | 대시보드 조회 기간, 장기 일정 |
|
|
86
|
-
| `mode="range"` + `withPresets` | 애널리틱스/리포트 조회 필터 |
|
|
91
|
+
| `mode="single"` + `withTime` | 예약 시각, 게시 예약 | |
|
|
92
|
+
| `mode="range"` + `months=1` | 좁은 자리의 짧은 기간 | |
|
|
93
|
+
| `mode="range"` + `months=2` (기본) | 대시보드 조회 기간, 장기 일정 | |
|
|
94
|
+
| `mode="range"` + `withPresets` | 애널리틱스/리포트 조회 필터 | |
|
|
87
95
|
| `mode="range"` + `withTime` + `timeMode="grid30"` | 회의실 예약 (30분 슬롯) | 뷰포트가 좁을 때 |
|
|
88
96
|
| `inline` | 사이드바에 상시 노출된 달력 | `trigger` |
|
|
89
97
|
|
|
90
98
|
**timeMode 선택:**
|
|
91
|
-
- `grid30
|
|
92
|
-
- `dropdown
|
|
93
|
-
- `input
|
|
99
|
+
- `grid30`: 예약/미팅. 30분 단위 그리드. 세로로 길어지므로 공간 여유 확인.
|
|
100
|
+
- `dropdown`: 범용. 시/분 각각의 select. 밀도 좋음.
|
|
101
|
+
- `input`: HH:MM 직접 타이핑. 자유도 최고, 실수 여지도 최고.
|
|
94
102
|
|
|
95
103
|
### 조합 예시
|
|
96
104
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
# Disclosure
|
|
2
2
|
|
|
3
3
|
### 원칙
|
|
4
|
-
|
|
4
|
+
트리거와 본문으로 구성하는 접기 영역이다. 트리거를 눌러 본문을 펼치거나 접는다.
|
|
5
5
|
|
|
6
6
|
### Do
|
|
7
|
-
- compound(`.Trigger` + `.Body`) 조합을 쓴다. flat API
|
|
7
|
+
- compound(`.Trigger` + `.Body`) 조합을 쓴다. flat API 없음: 명시적으로 Trigger·Body 2단 조립.
|
|
8
8
|
- `defaultOpen`으로 초기 상태만 지정하고 uncontrolled로 두는 게 가장 흔함. 외부에서 열림 추적이 필요할 때만 `open` + `onOpenChange`.
|
|
9
|
-
- 하나의 섹션 안에 **여러 Disclosure**를 쌓을 때 각각
|
|
9
|
+
- 하나의 섹션 안에 **여러 Disclosure**를 쌓을 때 각각 독립: accordion처럼 "한 번에 하나만 열림"이 필요하면 상위에서 상태로 조율.
|
|
10
10
|
- `aria-expanded`·`aria-controls`가 자동 세팅됨. 소비자가 수동 추가할 필요 없음.
|
|
11
11
|
|
|
12
12
|
### Don't
|
|
13
|
-
- Modal·Drawer 안의 "숨겨진 설정" 자리에 Disclosure를 과용하지
|
|
14
|
-
- Trigger 안에 `<button>`·`<a>` 중첩하지
|
|
13
|
+
- Modal·Drawer 안의 "숨겨진 설정" 자리에 Disclosure를 과용하지 않는다: 모달 안 모달 느낌. 그 자리엔 섹션 구분(hairline + heading)이 먼저.
|
|
14
|
+
- Trigger 안에 `<button>`·`<a>` 중첩하지 않는다: Trigger 자체가 button.
|
|
15
15
|
- Body의 콘텐츠 높이가 매번 뒤바뀌는 경우(실시간 스트림) grid-rows 애니메이션이 뚝뚝 끊김. 그 경우엔 `open` 토글 애니메이션을 쓰지 말거나 Disclosure 밖으로.
|
|
16
16
|
|
|
17
17
|
### Fallback
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
### Props 시그니처
|
|
21
21
|
```tsx
|
|
22
22
|
<Disclosure defaultOpen?={boolean} open?={boolean} onOpenChange?={(open: boolean) => void}>
|
|
23
|
-
<Disclosure.Trigger
|
|
24
|
-
<Disclosure.Body
|
|
23
|
+
<Disclosure.Trigger>라벨</Disclosure.Trigger>
|
|
24
|
+
<Disclosure.Body>접히는 콘텐츠</Disclosure.Body>
|
|
25
25
|
</Disclosure>
|
|
26
26
|
```
|
|
27
27
|
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
</Disclosure.Body>
|
|
37
37
|
</Disclosure>
|
|
38
38
|
|
|
39
|
-
// 섹션
|
|
39
|
+
// 섹션 리스트: 각자 독립 open
|
|
40
40
|
{faqs.map((f) => (
|
|
41
41
|
<Disclosure key={f.id}>
|
|
42
42
|
<Disclosure.Trigger>{f.q}</Disclosure.Trigger>
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
### 관련
|
|
49
|
-
- [[components/sidebar]]
|
|
50
|
-
- [[axes/motion]]
|
|
49
|
+
- [[components/sidebar]]: 섹션 접기 UI는 Sidebar.Section의 collapsible 사용
|
|
50
|
+
- [[axes/motion]]: Disclosure 애니메이션은 `--duration-base` × Motion 축에 반응
|
|
51
51
|
|
|
52
52
|
<!-- component-contract -->
|
|
53
53
|
```json
|
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
화면 좌/우 가장자리에서 밀고 들어오는 세로 full-height 패널. **흐름을 끊지 않고** 본문과 연관된 보조 작업을 띄울 때. 결정 하나에 집중시키는 중앙 자리는 [[components/modal]], 가벼운 미리보기는 [[components/popover]].
|
|
5
5
|
|
|
6
6
|
### Do
|
|
7
|
+
- 공통 헤더는 실제 `Topbar size="sm"`의 Leading(제목)·Trailing(닫기)으로 조합한다. 설명은 한 줄 탑바 아래에 두고, 본문만 스크롤한다. 제목의 다이얼로그 접근성 연결은 유지한다.
|
|
7
8
|
- 떠 있는 표면은 [[axes/material]]의 `solid | glass`를 따른다. 입력·색상판·inline 표면과 기존 동작은 유지한다.
|
|
8
9
|
- **본문과 연결된 보조 작업**에 쓴다. Modal처럼 흐름을 끊는 자리와 구분.
|
|
9
10
|
- `title` 필수. 명사형 짧게. 질문형은 `description`으로.
|
|
10
|
-
- 설명 문구는 `description` prop
|
|
11
|
-
- **`children`은 완전
|
|
11
|
+
- 설명 문구는 `description` prop: 헤더 안에서 title 바로 아래 바짝 붙어 하나의 "소개" 묶음으로 읽힘. `children`에 `<p>`로 설명 넣지 않는다.
|
|
12
|
+
- **`children`은 완전 자유**: 호출부가 원하는 어떤 ReactNode든. Drawer는 자리와 축만 담당하고 콘텐츠 타입에 간섭하지 않는다. 세로 스크롤은 body가 담당.
|
|
12
13
|
- `footer`는 액션 Button. **우측 정렬 · 최대 2~3개**. 순서는 **좌: outline(취소/닫기), 우: primary(저장/적용)**.
|
|
13
14
|
- 방향(`side`)은 한 제품/맥락 안에서 **하나로 통일**. right가 기본, 특별한 이유 있을 때만 left.
|
|
14
15
|
- `backdrop`은 **뒤 배경 타입만** 담당. `none`(기본)은 배경 없이 상주하는 non-modal 사이드 패널, `dim`은 scrim으로 뒤 영역을 어둡게, `blur`는 scrim + 뒤 배경 블러로 흐름을 더 강하게 끊는 자리.
|
|
@@ -16,13 +17,13 @@
|
|
|
16
17
|
- dismiss는 **헤더 우측 X · ESC 키 · backdrop 클릭** 세 가지. 각각 `dismissible` · `disableEscape` · `dismissOnBackdropClick`로 독립 제어.
|
|
17
18
|
|
|
18
19
|
### Don't
|
|
19
|
-
- Modal 자리에 Drawer
|
|
20
|
+
- Modal 자리에 Drawer 금지: 결정 하나에 집중시키는 자리는 Modal.
|
|
20
21
|
- Drawer 안에 Drawer 금지.
|
|
21
|
-
- 짧은 알림에 Drawer
|
|
22
|
+
- 짧은 알림에 Drawer 금지: [[components/toast]] 자리.
|
|
22
23
|
- footer에 primary 2개 금지.
|
|
23
24
|
- 사이즈 조절한다고 `width` 인라인 override 금지. `size` prop만 사용. 더 넓게 필요하면 그건 페이지 자리.
|
|
24
25
|
- title을 `text-transform: uppercase`로 꾸미지 않는다.
|
|
25
|
-
- 같은 페이지에서 right/left Drawer
|
|
26
|
+
- 같은 페이지에서 right/left Drawer 혼용: 방향 통일.
|
|
26
27
|
- children 안의 "콘텐츠 타입"을 Drawer가 미리 제한하지 않는다 (알림 전용·폼 전용 variant 같은 거 만들지 말 것).
|
|
27
28
|
|
|
28
29
|
### Fallback
|
|
@@ -32,13 +33,13 @@
|
|
|
32
33
|
- 애매하면 `side="right"`, `size="md"`, `backdrop="none"`.
|
|
33
34
|
|
|
34
35
|
### 관련
|
|
35
|
-
- [[components/modal]]
|
|
36
|
-
- [[components/toast]]
|
|
37
|
-
- [[components/button]]
|
|
38
|
-
- [[primitives/slide]]
|
|
39
|
-
- [[primitives/fade]]
|
|
40
|
-
- [[axes/motion]]
|
|
41
|
-
- [[tokens/z-index]]
|
|
36
|
+
- [[components/modal]]: 흐름 중단·결정 집중.
|
|
37
|
+
- [[components/toast]]: 휘발성 알림.
|
|
38
|
+
- [[components/button]]: footer 액션. 파괴적 확인은 `destructive` variant.
|
|
39
|
+
- [[primitives/slide]]: 가장자리 등장 애니. `--motion-distance-scale`로 축 스왑.
|
|
40
|
+
- [[primitives/fade]]: overlay fade 조합.
|
|
41
|
+
- [[axes/motion]]: slide 거리·duration 스왑.
|
|
42
|
+
- [[tokens/z-index]]: overlay는 `z-overlay`, content는 `z-modal`.
|
|
42
43
|
|
|
43
44
|
### Props 시그니처
|
|
44
45
|
```tsx
|
|
@@ -57,7 +58,7 @@
|
|
|
57
58
|
size="sm" | "md" | "lg" // default: md
|
|
58
59
|
backdrop="none" | "dim" | "blur" // default: none. 배경 타입만
|
|
59
60
|
>
|
|
60
|
-
{children} // 자유 ReactNode
|
|
61
|
+
{children} // 자유 ReactNode: 콘텐츠 타입 제한 없음
|
|
61
62
|
</Drawer>
|
|
62
63
|
```
|
|
63
64
|
|
|
@@ -83,16 +84,16 @@
|
|
|
83
84
|
| `md` | 50vw | **기본.** 뷰포트의 절반. 대부분의 경우. |
|
|
84
85
|
| `lg` | 67vw | 복잡한 편집·탭 포함 보조 뷰. 이보다 넓어야 하면 페이지 자리. |
|
|
85
86
|
|
|
86
|
-
> 좁은 화면에선 `min-width`(space-2 × 40)와 `max-width`(100vw − space-8)가 자동
|
|
87
|
+
> 좁은 화면에선 `min-width`(space-2 × 40)와 `max-width`(100vw − space-8)가 자동 보정: 좌/우 가장자리 여백 유지.
|
|
87
88
|
|
|
88
89
|
**금지 조합**
|
|
89
|
-
- `backdrop="none"` + `size="lg"
|
|
90
|
-
- `dismissible=false` + `disableEscape=true` + `dismissOnBackdropClick=false` + `footer`
|
|
90
|
+
- `backdrop="none"` + `size="lg"`: 뒤 영역을 거의 가려놓고 non-modal 흉내. `dim` 또는 `blur`로 올리거나 `size`를 줄일 것.
|
|
91
|
+
- `dismissible=false` + `disableEscape=true` + `dismissOnBackdropClick=false` + `footer` 없음: 사용자가 Drawer를 닫을 방법이 전혀 없음.
|
|
91
92
|
- 같은 페이지에서 서로 다른 `side` 혼용.
|
|
92
93
|
|
|
93
94
|
### 조합 예시
|
|
94
95
|
```tsx
|
|
95
|
-
//
|
|
96
|
+
// 기본: 우측 보조 패널
|
|
96
97
|
<Drawer
|
|
97
98
|
open={open}
|
|
98
99
|
onOpenChange={setOpen}
|
|
@@ -105,7 +106,7 @@
|
|
|
105
106
|
</>
|
|
106
107
|
}
|
|
107
108
|
>
|
|
108
|
-
{/* children
|
|
109
|
+
{/* children 자유: 리스트·탭·폼·이미지 어떤 것이든 */}
|
|
109
110
|
</Drawer>
|
|
110
111
|
|
|
111
112
|
// 상주형 사이드 패널 (non-modal)
|