@conscience-technology/ovenn 0.7.3 → 0.7.5

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.
Files changed (150) hide show
  1. package/assets/components/AIMessage/AIMessage.module.css +10 -0
  2. package/assets/components/AIMessage/AIMessage.tsx +6 -2
  3. package/assets/components/Breadcrumb/Breadcrumb.module.css +82 -23
  4. package/assets/components/Breadcrumb/Breadcrumb.tsx +44 -26
  5. package/assets/components/Breadcrumb/index.ts +1 -0
  6. package/assets/components/Button/Button.module.css +2 -4
  7. package/assets/components/Callout/Callout.module.css +44 -18
  8. package/assets/components/Callout/Callout.tsx +9 -4
  9. package/assets/components/Callout/index.ts +1 -1
  10. package/assets/components/Canvas/Canvas.module.css +13 -0
  11. package/assets/components/Canvas/Canvas.tsx +378 -94
  12. package/assets/components/Canvas/clipboard.ts +5 -1
  13. package/assets/components/Canvas/collision.ts +5 -1
  14. package/assets/components/Canvas/graph.ts +14 -5
  15. package/assets/components/Canvas/history.ts +11 -4
  16. package/assets/components/Canvas/index.ts +2 -1
  17. package/assets/components/Canvas/types.ts +36 -1
  18. package/assets/components/CanvasEdge/tokens.css +14 -1
  19. package/assets/components/CanvasNode/tokens.css +13 -10
  20. package/assets/components/ChatInput/ChatInput.tsx +1 -1
  21. package/assets/components/ColorField/ColorField.module.css +6 -1
  22. package/assets/components/ColorPicker/ColorPicker.module.css +3 -0
  23. package/assets/components/CommandPalette/CommandPalette.module.css +115 -1
  24. package/assets/components/CommandPalette/CommandPalette.tsx +206 -21
  25. package/assets/components/CommandPalette/index.ts +1 -0
  26. package/assets/components/DatePicker/DatePicker.module.css +3 -2
  27. package/assets/components/Drawer/Drawer.module.css +30 -0
  28. package/assets/components/Drawer/Drawer.tsx +75 -16
  29. package/assets/components/Drawer/index.ts +1 -0
  30. package/assets/components/Icon/Icon.tsx +3 -0
  31. package/assets/components/Input/Input.module.css +4 -4
  32. package/assets/components/Select/Select.module.css +6 -2
  33. package/assets/components/SocialLoginButton/SocialLoginButton.module.css +198 -0
  34. package/assets/components/SocialLoginButton/SocialLoginButton.tsx +86 -0
  35. package/assets/components/SocialLoginButton/assets/amazon.svg +1 -0
  36. package/assets/components/SocialLoginButton/assets/apple.svg +3 -0
  37. package/assets/components/SocialLoginButton/assets/discord.svg +3 -0
  38. package/assets/components/SocialLoginButton/assets/facebook-white.png +0 -0
  39. package/assets/components/SocialLoginButton/assets/facebook.png +0 -0
  40. package/assets/components/SocialLoginButton/assets/github.svg +3 -0
  41. package/assets/components/SocialLoginButton/assets/google-mark.png +0 -0
  42. package/assets/components/SocialLoginButton/assets/kakao.svg +3 -0
  43. package/assets/components/SocialLoginButton/assets/line-icon.png +0 -0
  44. package/assets/components/SocialLoginButton/assets/line-white.png +0 -0
  45. package/assets/components/SocialLoginButton/assets/linkedin-white.png +0 -0
  46. package/assets/components/SocialLoginButton/assets/linkedin.png +0 -0
  47. package/assets/components/SocialLoginButton/assets/microsoft.svg +6 -0
  48. package/assets/components/SocialLoginButton/assets/naver.png +0 -0
  49. package/assets/components/SocialLoginButton/assets/slack.svg +17 -0
  50. package/assets/components/SocialLoginButton/assets/spotify.svg +3 -0
  51. package/assets/components/SocialLoginButton/assets/twitch.svg +21 -0
  52. package/assets/components/SocialLoginButton/assets/wechat.png +0 -0
  53. package/assets/components/SocialLoginButton/assets/x.svg +3 -0
  54. package/assets/components/SocialLoginButton/index.ts +2 -0
  55. package/assets/components/SocialLoginButton/provider-tokens.css +30 -0
  56. package/assets/components/SocialLoginButton/providers.ts +23 -0
  57. package/assets/components/TimePicker/TimePicker.module.css +3 -2
  58. package/assets/components/_data.ts +1 -1
  59. package/assets/components/_utils.css +2 -2
  60. package/assets/components/component-registry.json +30 -1
  61. package/assets/components/index.ts +1 -0
  62. package/assets/components/tokens.css +14 -15
  63. package/assets/prompts/ASSEMBLY.md +2 -0
  64. package/assets/prompts/CATALOG.md +1 -0
  65. package/assets/prompts/PRINCIPLES.md +1 -1
  66. package/assets/prompts/RULES.md +31 -0
  67. package/assets/prompts/axes/material.md +4 -4
  68. package/assets/prompts/axes/palette.md +1 -1
  69. package/assets/prompts/axes/shape.md +2 -2
  70. package/assets/prompts/axes/voice.md +2 -2
  71. package/assets/prompts/components/_variants.md +3 -3
  72. package/assets/prompts/components/accordion.md +1 -1
  73. package/assets/prompts/components/ai-message.md +6 -2
  74. package/assets/prompts/components/app-frame.md +2 -2
  75. package/assets/prompts/components/avatar.md +2 -2
  76. package/assets/prompts/components/badge.md +1 -1
  77. package/assets/prompts/components/breadcrumb.md +11 -5
  78. package/assets/prompts/components/button.md +2 -2
  79. package/assets/prompts/components/calendar.md +1 -1
  80. package/assets/prompts/components/callout.md +8 -4
  81. package/assets/prompts/components/canvas-edge.md +1 -1
  82. package/assets/prompts/components/canvas-node.md +2 -2
  83. package/assets/prompts/components/canvas.md +24 -8
  84. package/assets/prompts/components/chart-radial.md +1 -1
  85. package/assets/prompts/components/chart.md +1 -1
  86. package/assets/prompts/components/chat-reactions.md +1 -1
  87. package/assets/prompts/components/checkbox-card.md +3 -3
  88. package/assets/prompts/components/checkbox.md +1 -1
  89. package/assets/prompts/components/chip.md +4 -4
  90. package/assets/prompts/components/code-block.md +1 -1
  91. package/assets/prompts/components/combobox.md +3 -3
  92. package/assets/prompts/components/command-palette.md +52 -44
  93. package/assets/prompts/components/comment.md +2 -2
  94. package/assets/prompts/components/control-group.md +1 -1
  95. package/assets/prompts/components/data-table.md +1 -1
  96. package/assets/prompts/components/disclosure.md +1 -1
  97. package/assets/prompts/components/drawer.md +15 -1
  98. package/assets/prompts/components/dropdown-menu.md +1 -1
  99. package/assets/prompts/components/event-chip.md +2 -2
  100. package/assets/prompts/components/file-icon.md +1 -1
  101. package/assets/prompts/components/file-upload.md +1 -1
  102. package/assets/prompts/components/icon-button.md +1 -1
  103. package/assets/prompts/components/input.md +3 -3
  104. package/assets/prompts/components/list-item.md +1 -1
  105. package/assets/prompts/components/menu-item.md +2 -2
  106. package/assets/prompts/components/metric-card.md +1 -1
  107. package/assets/prompts/components/mini-calendar.md +1 -1
  108. package/assets/prompts/components/page-header.md +1 -1
  109. package/assets/prompts/components/segmented-chart.md +1 -1
  110. package/assets/prompts/components/sidebar.md +3 -3
  111. package/assets/prompts/components/skeleton.md +3 -3
  112. package/assets/prompts/components/social-login-button.md +117 -0
  113. package/assets/prompts/components/tab-strip.md +1 -1
  114. package/assets/prompts/components/table-cell.md +1 -1
  115. package/assets/prompts/components/table-header.md +1 -1
  116. package/assets/prompts/components/table-row-edit.md +3 -3
  117. package/assets/prompts/components/table-row.md +1 -1
  118. package/assets/prompts/components/table-toolbar.md +1 -1
  119. package/assets/prompts/components/timeline-view.md +2 -2
  120. package/assets/prompts/components/toast.md +1 -1
  121. package/assets/prompts/components/tooltip.md +3 -3
  122. package/assets/prompts/components/tree-nav.md +2 -2
  123. package/assets/prompts/design-examples/ai-chat-full-page.png +0 -0
  124. package/assets/prompts/design-examples/catalog.json +9 -9
  125. package/assets/prompts/design-examples/sources/ai-chat-full-page/ChatExperience.module.css +37 -1
  126. package/assets/prompts/design-examples/sources/ai-chat-full-page/ChatExperience.tsx +113 -18
  127. package/assets/prompts/design-examples/sources/ai-chat-full-page/FullPageChat.tsx +2 -2
  128. package/assets/prompts/design-examples/sources/ai-chat-full-page/REFERENCE.md +3 -1
  129. package/assets/prompts/design-examples/sources/ai-chat-full-page/useChatDemo.ts +99 -51
  130. package/assets/prompts/primitives/scroll.md +1 -1
  131. package/assets/prompts/tokens/color.md +4 -5
  132. package/assets/prompts/tokens/material.md +5 -2
  133. package/assets/prompts/tokens/radius.md +1 -1
  134. package/assets/prompts/use-cases/chat-chat-input.md +382 -74
  135. package/assets/prompts/use-cases/data-list-item.md +38 -431
  136. package/assets/prompts/use-cases/feedback-drawer.md +112 -33
  137. package/assets/prompts/use-cases/overlay-command-palette.md +2004 -0
  138. package/assets/prompts/use-cases/structure-canvas.md +1016 -0
  139. package/assets/skills/ovenn-validate/SKILL.md +1 -1
  140. package/assets/skills/ovenn-validate/scripts/lib/component-usage.js +27 -5
  141. package/assets/skills/ovenn-validate/scripts/rules/hard-rules.mjs +174 -0
  142. package/assets/skills/ovenn-validate/scripts/rules/hard-rules.test.mjs +57 -0
  143. package/assets/skills/ovenn-validate/scripts/validate.mjs +2 -0
  144. package/package.json +1 -1
  145. package/src/commands/info.js +5 -4
  146. package/src/commands/update.js +5 -1
  147. package/src/utils/agents.js +28 -17
  148. package/src/utils/client-bridges.js +4 -2
  149. package/src/utils/component-usage.js +27 -5
  150. package/src/utils/patch.js +2 -1
@@ -8,7 +8,10 @@ import { IconButton } from "@/components/ovenn/IconButton";
8
8
  import { Modal } from "@/components/ovenn/Modal";
9
9
  import { UserMessage } from "@/components/ovenn/UserMessage";
10
10
  import { AIMessage } from "@/components/ovenn/AIMessage";
11
- import { useChatDemo } from "./useChatDemo";
11
+ import { AttachmentItem } from "@/components/ovenn/AttachmentItem";
12
+ import { AttachmentThumb } from "@/components/ovenn/AttachmentThumb";
13
+ import { Callout } from "@/components/ovenn/Callout";
14
+ import { useChatDemo, type ChatDemoMessage } from "./useChatDemo";
12
15
  import { Card } from "@/components/ovenn/Card";
13
16
  import { AppFrame } from "@/components/ovenn/AppFrame";
14
17
  import { Topbar } from "@/components/ovenn/Topbar";
@@ -31,6 +34,26 @@ const content = {
31
34
  switchThread: "Switch thread",
32
35
  createThread: "New chat",
33
36
  messagesLabel: "Conversation",
37
+ composerLabel: "Write a message",
38
+ tokenWarning: "You’ve used 90% of your token limit.",
39
+ viewUsage: "View usage",
40
+ hideUsage: "Hide usage",
41
+ usage: "Example budget: 9,000 of 10,000 tokens used. 1,000 left.",
42
+ sample: [
43
+ "Can you organize the launch meeting notes?",
44
+ "Send the notes and I’ll separate the decisions, owners, and open questions.",
45
+ "The release is next Thursday. Design will finish the empty screens on Monday. Engineering needs the final copy by Tuesday. Support wants a checklist for common questions.",
46
+ "Decision: release next Thursday.\n\nDesign: finish empty screens on Monday.\nEngineering: confirm final copy on Tuesday.\nSupport: draft a checklist for common questions.\n\nThe checklist still needs an owner and a due date.",
47
+ "What should we cover in the review?",
48
+ "Open the empty screens with a fresh account and check that each screen explains the next step. Read the copy alongside the screens so the team can spot inconsistencies.\n\nWalk through one support question from start to finish. Bring unresolved issues to the review with the person who can decide what to do next.",
49
+ "Jin owns the checklist. Add a short review on Wednesday and write a message I can send to the team.",
50
+ "We’re planning to release next Thursday. Design will finish the empty screens on Monday, and Engineering needs the final copy by Tuesday.\n\nJin will prepare the support checklist. We’ll review the copy, empty screens, and checklist together on Wednesday.\n\nPlease flag anything that could move the release date before the review.",
51
+ ],
52
+ failed: "Couldn’t generate a response.",
53
+ stopped: "Response stopped.",
54
+ retry: "Try again",
55
+ attachmentReply: "I received your attachments. Paste the part you want to work on and tell me what you need.",
56
+ retryReply: "The demo response is working again. Tell me what you’d like help with.",
34
57
  threadTitles: ["Meeting notes", "Follow-up email", "Document summary"],
35
58
  replies: [
36
59
  "Share your meeting notes and I’ll organize them into decisions and action items.\n\nFor each action, include the task, owner, and due date when available.",
@@ -54,6 +77,26 @@ const content = {
54
77
  switchThread: "대화 전환",
55
78
  createThread: "새 대화",
56
79
  messagesLabel: "대화 내용",
80
+ composerLabel: "메시지 작성",
81
+ tokenWarning: "토큰 한도의 90%를 사용했어요.",
82
+ viewUsage: "사용량 보기",
83
+ hideUsage: "사용량 닫기",
84
+ usage: "예시 사용량은 10,000 토큰 중 9,000개예요. 1,000개 남았어요.",
85
+ sample: [
86
+ "출시 회의 메모를 정리해 주세요.",
87
+ "메모를 보내주시면 결정 사항과 담당자, 아직 확인할 내용을 나눠 정리할게요.",
88
+ "다음 주 목요일에 출시해요. 디자인은 월요일까지 빈 화면을 마무리하고, 개발은 화요일까지 최종 문구가 필요해요. 고객지원팀은 자주 묻는 질문을 체크리스트로 정리하기로 했어요.",
89
+ "다음 주 목요일에 출시하기로 했어요.\n\n디자인팀은 월요일까지 빈 화면을 마무리해요.\n개발팀은 화요일까지 최종 문구를 확인해요.\n고객지원팀은 자주 묻는 질문을 정리해요.\n\n체크리스트 담당자와 마감일을 정하면 돼요.",
90
+ "검토할 때는 뭘 보면 좋을까요?",
91
+ "새 계정으로 빈 화면을 열고, 다음에 할 일이 분명한지 확인해요. 화면에 들어갈 문구도 같이 읽으면서 용어가 일관적인지 살펴보면 좋아요.\n\n고객 문의 하나를 골라 체크리스트를 처음부터 따라가 보세요. 결정이 필요한 항목은 담당자와 함께 수요일 검토에 가져오면 돼요.",
92
+ "체크리스트는 진이 맡기로 했어요. 수요일에 같이 검토하기로 한 내용도 넣어서 팀에 보낼 메시지를 써 주세요.",
93
+ "다음 주 목요일에 출시할 예정이에요. 디자인팀은 월요일까지 빈 화면을 마무리하고, 개발팀은 화요일까지 최종 문구를 확인해 주세요.\n\n진은 고객지원 체크리스트를 준비해 주세요. 수요일에는 문구, 빈 화면, 체크리스트를 함께 검토할게요.\n\n출시 일정에 영향을 줄 일이 있으면 수요일 검토 전에 알려주세요.",
94
+ ],
95
+ failed: "응답을 생성하지 못했어요.",
96
+ stopped: "응답 생성을 중지했어요.",
97
+ retry: "다시 시도",
98
+ attachmentReply: "첨부를 받았어요. 작업할 내용을 붙여 넣고 어떤 도움이 필요한지 알려주세요.",
99
+ retryReply: "데모 응답이 다시 작동해요. 어떤 일이 필요한지 알려주세요.",
57
100
  threadTitles: ["회의 메모 정리", "후속 메일 초안", "문서 요약"],
58
101
  replies: [
59
102
  "정리할 회의 메모를 보내주세요. 결정 사항과 실행 항목을 구분해 정리할게요.\n\n실행 항목마다 할 일, 담당자, 기한이 있다면 함께 알려주세요.",
@@ -69,7 +112,7 @@ const content = {
69
112
  },
70
113
  };
71
114
 
72
- export function ChatExperience({ lang, presentation = "card" }: { lang: "en" | "ko"; presentation?: "card" | "page" }) {
115
+ export function ChatExperience({ lang, presentation = "card", material }: { lang: "en" | "ko"; presentation?: "card" | "page"; material?: "glass" | "solid" }) {
73
116
  const isPage = presentation === "page";
74
117
  const t = content[lang];
75
118
  const [threadMenuOpen, setThreadMenuOpen] = useState(false);
@@ -97,9 +140,19 @@ export function ChatExperience({ lang, presentation = "card" }: { lang: "en" | "
97
140
  focusConversation.current = false;
98
141
  }
99
142
  }, [isMobile, mobileView]);
100
- const getReply = (text: string) => t.replies[t.questions.indexOf(text)] ?? t.fallbackReply;
143
+ const getReply = (text: string, hasAttachments: boolean) => {
144
+ if (text === "/fail") return t.retryReply;
145
+ if (hasAttachments) return t.attachmentReply;
146
+ return t.replies[t.questions.indexOf(text)] ?? t.fallbackReply;
147
+ };
101
148
  const getTitle = (text: string) => t.threadTitles[t.questions.indexOf(text)] ?? Array.from(text).slice(0, 18).join("");
102
- const { threads, activeThread, setActiveId, createThread, renameThread, deleteThread, setDraft, send, stop, edit, regenerate, isStreaming } = useChatDemo(getReply, getTitle);
149
+ const initialMessages = useRef<ChatDemoMessage[]>(isPage ? t.sample.map((text, index) => ({
150
+ id: `sample-${index}`, role: index % 2 === 0 ? "user" : "assistant", text,
151
+ })) : []);
152
+ const { threads, activeThread, setActiveId, createThread, renameThread, deleteThread, setDraft, attach, removeAttachment, send, stop, edit, regenerate, retry, isStreaming } = useChatDemo(getReply, getTitle, initialMessages.current);
153
+ const [noticeDismissed, setNoticeDismissed] = useState(false);
154
+ const showNotice = isPage && activeThread.id === "chat-0" && !noticeDismissed;
155
+ const [showUsage, setShowUsage] = useState(false);
103
156
  const viewportRef = useRef<HTMLDivElement>(null);
104
157
  const pageRef = useRef<HTMLDivElement>(null);
105
158
  useLayoutEffect(() => {
@@ -147,18 +200,18 @@ export function ChatExperience({ lang, presentation = "card" }: { lang: "en" | "
147
200
  composerRef.current?.querySelector("textarea")?.focus({ preventScroll: true });
148
201
  focusAfterSend.current = false;
149
202
  }
150
- }, [activeThread.id, activeThread.messages, isPage, isMobile, mobileView]);
203
+ }, [activeThread.id, activeThread.messages, activeThread.attachments, isPage, isMobile, mobileView]);
151
204
 
152
205
  const saveScroll = () => {
153
206
  newMessageIds.current.clear();
154
207
  if (viewportRef.current && !(isPage && isMobile && mobileView === "threads")) scrollPositions.current.set(activeThread.id, viewportRef.current.scrollTop);
155
208
  };
156
- const sendPrompt = (text: string, focusInput = true) => {
157
- if (!text.trim() || isStreaming) return;
209
+ const sendPrompt = (text: string, focusInput = true, useDraft = true) => {
210
+ if ((!text.trim() && !(useDraft && activeThread.attachments.length)) || isStreaming) return;
158
211
  followLatest.current = true;
159
212
  focusAfterSend.current = focusInput;
160
213
  newMessageIds.current.add(`${activeThread.id}-${activeThread.messages.length}-user`);
161
- send(text);
214
+ send(text, useDraft);
162
215
  };
163
216
 
164
217
  const toggleHistory = () => {
@@ -173,8 +226,13 @@ export function ChatExperience({ lang, presentation = "card" }: { lang: "en" | "
173
226
  setMobileView("chat");
174
227
  };
175
228
  const normalizedSearch = threadSearch.trim().toLocaleLowerCase();
176
- const historyThreads = [...threads].reverse().filter((thread) => thread.title || thread.messages.length > 0 || thread.draft.trim());
177
- const visibleThreads = historyThreads.filter((thread) => [thread.title, thread.draft, ...thread.messages.map((message) => message.text)].join(" ").toLocaleLowerCase().includes(normalizedSearch));
229
+ const historyThreads = [...threads].reverse().filter((thread) => thread.title || thread.messages.length || thread.draft.trim() || thread.attachments.length);
230
+ const attachmentName = (item: (typeof activeThread.attachments)[number]) => item.kind === "file" ? item.filename : item.alt;
231
+ const threadLabel = (thread: typeof activeThread) => thread.title || getTitle(thread.draft.trim() || thread.attachments.map(attachmentName).find(Boolean) || t.title);
232
+ const visibleThreads = historyThreads.filter((thread) => [
233
+ thread.title, thread.draft, ...thread.attachments.map(attachmentName),
234
+ ...thread.messages.flatMap((message) => [message.text, ...(message.attachments ?? []).map(attachmentName)]),
235
+ ].join(" ").toLocaleLowerCase().includes(normalizedSearch));
178
236
 
179
237
  const header = (
180
238
  <div className={styles.header}>
@@ -197,18 +255,16 @@ export function ChatExperience({ lang, presentation = "card" }: { lang: "en" | "
197
255
  >
198
256
  {t.createThread}
199
257
  </DropdownMenu.Item>
200
- {threads.some((thread) => thread.messages.length > 0 || thread.draft.trim()) && (
258
+ {historyThreads.length > 0 && (
201
259
  <>
202
260
  <DropdownMenu.Separator />
203
261
  <DropdownMenu.Group>
204
- {[...threads].reverse()
205
- .filter((thread) => thread.messages.length > 0 || thread.draft.trim())
206
- .map((thread) => (
262
+ {historyThreads.map((thread) => (
207
263
  <DropdownMenu.Item
208
264
  key={thread.id}
209
265
  onSelect={() => { saveScroll(); setActiveId(thread.id); setThreadMenuOpen(false); }}
210
266
  >
211
- {thread.title || Array.from(thread.draft.trim()).slice(0, 18).join("")}
267
+ {threadLabel(thread)}
212
268
  </DropdownMenu.Item>
213
269
  ))}
214
270
  </DropdownMenu.Group>
@@ -236,9 +292,28 @@ export function ChatExperience({ lang, presentation = "card" }: { lang: "en" | "
236
292
  <div className={styles.messages} role="log" aria-live="polite" aria-relevant="additions text" aria-label={t.messagesLabel}>
237
293
  {activeThread.messages.map((message) => message.role === "user" ? (
238
294
  <UserMessage key={message.id} actionsVisibility="hover" textValue={message.text}
295
+ actions={message.text ? undefined : []}
296
+ className={message.text ? undefined : styles.attachmentOnly}
297
+ before={message.attachments?.length ? (
298
+ <div className={styles.sentAttachments}>
299
+ {message.attachments.map((item) => item.kind === "file" ? (
300
+ <AttachmentItem key={item.id} filename={item.filename} />
301
+ ) : (
302
+ <AttachmentThumb key={item.id} src={item.src} alt={item.alt} size="lg" />
303
+ ))}
304
+ </div>
305
+ ) : undefined}
239
306
  onEdit={(text) => edit(message.id, text)} animate={newMessageIds.current.has(message.id)}>
240
307
  <span className={styles.messageText}>{message.text}</span>
241
308
  </UserMessage>
309
+ ) : message.interruption ? (
310
+ <Callout key={message.id} layout="inline"
311
+ tone={message.interruption === "failed" ? "destructive" : "neutral"}
312
+ title={t[message.interruption]}
313
+ actions={<Button size="sm" variant="ghost" disabled={isStreaming} onClick={() => {
314
+ viewportRef.current?.focus({ preventScroll: true });
315
+ retry(message.id);
316
+ }}>{t.retry}</Button>} />
242
317
  ) : (
243
318
  <AIMessage key={message.id} actionsVisibility="hover" actions={[
244
319
  { kind: "copy", onClick: () => navigator.clipboard.writeText(message.text), successLabel: lang === "ko" ? "복사됨" : "Copied", errorLabel: lang === "ko" ? "복사 실패" : "Copy failed" },
@@ -258,13 +333,29 @@ export function ChatExperience({ lang, presentation = "card" }: { lang: "en" | "
258
333
  );
259
334
  const bottom = (
260
335
  <div className={styles.bottom}>
336
+ {showNotice && (
337
+ <Callout layout="inline" size="sm" variant="fill" tone="neutral"
338
+ icon={<Icon name="warning-circle" className={styles.tokenNoticeIcon} />} title={t.tokenWarning} className={styles.tokenNotice}
339
+ dismissible
340
+ dismissLabel={lang === "ko" ? "토큰 경고 닫기" : "Dismiss token warning"}
341
+ onDismiss={() => {
342
+ composerRef.current?.querySelector("textarea")?.focus({ preventScroll: true });
343
+ setNoticeDismissed(true);
344
+ }}
345
+ actions={<Button size="xs" variant="ghost" aria-expanded={showUsage} aria-controls="page-token-usage"
346
+ onClick={() => setShowUsage((open) => !open)}>
347
+ {showUsage ? t.hideUsage : t.viewUsage}
348
+ </Button>}>
349
+ <span id="page-token-usage" hidden={!showUsage}><br />{t.usage}</span>
350
+ </Callout>
351
+ )}
261
352
  {!isPage && !hasMessages && (
262
353
  <div className={styles.questions} role="group" aria-label={t.suggestionsLabel}>
263
354
  {t.questions.map((question) => (
264
355
  <RadioCard
265
356
  key={question}
266
357
  mode="button"
267
- onClick={(event) => sendPrompt(question, event.detail === 0)}
358
+ onClick={(event) => sendPrompt(question, event.detail === 0, false)}
268
359
  onFocus={(event) => event.currentTarget.scrollIntoView({ block: "nearest", inline: "nearest" })}
269
360
  align="start"
270
361
  size="md"
@@ -281,18 +372,22 @@ export function ChatExperience({ lang, presentation = "card" }: { lang: "en" | "
281
372
  separateSend={!isPage}
282
373
  value={activeThread.draft}
283
374
  onChange={setDraft}
375
+ attachments={activeThread.attachments}
376
+ onAttach={attach}
377
+ onRemoveAttachment={removeAttachment}
284
378
  onSend={() => sendPrompt(activeThread.draft)}
285
379
  isStreaming={isStreaming}
286
380
  onStop={stop}
287
381
  sendVariant="solid"
288
382
  placeholder={t.placeholder}
383
+ inputProps={{ "aria-label": t.composerLabel }}
289
384
  className={styles.composer}
290
385
  />
291
386
  </div>
292
387
  );
293
388
 
294
389
  if (isPage) return (
295
- <AppFrame ref={pageRef} variant="flat" layout="sidebar-first" className={styles.fullPage} data-ai-chat-page data-chat-thread={activeThread.id} data-mobile-view={mobileView} lang={lang}>
390
+ <AppFrame ref={pageRef} variant="flat" layout="sidebar-first" className={styles.fullPage} data-ai-chat-page data-chat-thread={activeThread.id} data-mobile-view={mobileView} data-material={material} lang={lang}>
296
391
  <AppFrame.Topbar>
297
392
  <Topbar size="sm">
298
393
  <Topbar.Leading className={styles.threadHeading}>
@@ -354,7 +449,7 @@ export function ChatExperience({ lang, presentation = "card" }: { lang: "en" | "
354
449
  setActiveId(thread.id);
355
450
  focusConversation.current = isMobile;
356
451
  setMobileView("chat");
357
- }}>{thread.title || Array.from(thread.draft.trim()).slice(0, 18).join("")}</MenuItem>
452
+ }}>{threadLabel(thread)}</MenuItem>
358
453
  ))}
359
454
  </MenuItem.Section>
360
455
  {visibleThreads.length === 0 && <EmptyState className={styles.historyEmpty} size="sm" icon={normalizedSearch ? "search" : "chat-circle"} title={normalizedSearch ? t.noResults : t.noChats} role="status" />}
@@ -3,6 +3,6 @@
3
3
  import { ThemeLocaleProvider } from "@/components/ovenn/ThemeController";
4
4
  import { ChatExperience } from "./ChatExperience";
5
5
 
6
- export function FullPageChat({ lang = "ko" }: { lang?: "ko" | "en" }) {
7
- return <ThemeLocaleProvider lang={lang}><ChatExperience lang={lang} presentation="page" /></ThemeLocaleProvider>;
6
+ export function FullPageChat({ lang = "ko", material }: { lang?: "ko" | "en"; material?: "glass" | "solid" }) {
7
+ return <ThemeLocaleProvider lang={lang}><ChatExperience lang={lang} presentation="page" material={material} /></ThemeLocaleProvider>;
8
8
  }
@@ -10,10 +10,12 @@
10
10
  - 본문만 스크롤하고 하단 ChatInput을 유지하는 구성. 풀페이지에는 인사말·추천 질문을 넣지 않는다.
11
11
  - 모바일에서는 제목의 caret으로 쓰레드 목록과 대화 화면을 전환한다. Drawer를 사용하지 않는다.
12
12
 
13
+ - 첫 스레드는 예시 대화와 토큰 잔량 경고를 보여준다. 경고는 메시지 영역과 입력창 사이에 배치한다. `sm` 크기의 중립 `fill` Callout으로 예시 사용량 90%를 표시한다.
14
+
13
15
  ## 소스와 의존성
14
16
 
15
17
  catalog.json의 files.source가 저장소 원본이다. FullPageChat → ChatExperience → useChatDemo → useDemoTextStream 순으로 연결된다. 공유 Ovenn 컴포넌트와 tokens.css는 별도 의존성이며, 참고 코드를 복사할 때 현재 설치 API와 테마를 확인한다. ChatExperience의 카드 분기는 공용 소스에 포함되지만 이 승인 사례의 주 범위는 풀페이지다.
16
18
 
17
19
  ## 확인 한계
18
20
 
19
- 응답은 로컬 시나리오이며 실제 AI API·저장소·인증에 연결되어 있지 않다. 새로고침하면 대화가 초기화된다. 첨부 버튼은 연결되지 않았다. 이름 변경·삭제·검색·모바일 전환은 구현되어 있으나 이 등록이 모든 동작·테마·보조기술 검증을 뜻하지 않는다. 대표 캡처는 1440×900 라이트 모드의 한 쓰레드 대화 상태다.
21
+ 응답은 로컬 시나리오이며 실제 AI API·저장소·인증에 연결되어 있지 않다. 새로고침하면 대화가 초기화된다. 파일과 이미지 첨부는 브라우저 안에서만 표시하며 파일 내용을 분석하지 않는다. `/fail`을 보내면 실패와 재시도를 확인할 수 있다. 이름 변경·삭제·검색·모바일 전환은 구현되어 있으나 이 등록이 모든 동작·테마·보조기술 검증을 뜻하지 않는다. 대표 캡처는 1440×900 라이트 모드의 한 쓰레드 대화 상태다.
@@ -1,22 +1,31 @@
1
1
  "use client";
2
2
 
3
- import { useRef, useState } from "react";
3
+ import { useEffect, useRef, useState } from "react";
4
+ import type { ChatAttachment } from "@/components/ovenn/ChatInput";
4
5
  import { useDemoTextStream } from "./useDemoTextStream";
5
6
 
6
- export type ChatDemoMessage = { id: string; role: "user" | "assistant"; text: string; isStreaming?: boolean };
7
+ export type ChatDemoMessage = {
8
+ id: string;
9
+ role: "user" | "assistant";
10
+ text: string;
11
+ isStreaming?: boolean;
12
+ interruption?: "failed" | "stopped";
13
+ attachments?: ChatAttachment[];
14
+ };
7
15
  export type ChatDemoThread = {
8
16
  id: string;
9
17
  title: string;
10
18
  draft: string;
19
+ attachments: ChatAttachment[];
11
20
  messages: ChatDemoMessage[];
12
21
  };
13
22
 
14
- export function useChatDemo(getReply: (text: string) => string, getTitle: (text: string) => string) {
23
+ export function useChatDemo(getReply: (text: string, hasAttachments: boolean) => string, getTitle: (text: string) => string, initialMessages: ChatDemoMessage[] = []) {
15
24
  const sequence = useRef(1);
16
25
  const delivery = useDemoTextStream();
17
26
  const pendingThreads = useRef(new Set<string>());
18
27
  const [threads, setThreads] = useState<ChatDemoThread[]>([
19
- { id: "chat-0", title: "", draft: "", messages: [] },
28
+ { id: "chat-0", title: initialMessages.length ? getTitle(initialMessages[0].text) : "", draft: "", attachments: [], messages: initialMessages },
20
29
  ]);
21
30
  const [activeId, setActiveId] = useState("chat-0");
22
31
  const activeThread = threads.find((thread) => thread.id === activeId) ?? threads[0];
@@ -25,41 +34,87 @@ export function useChatDemo(getReply: (text: string) => string, getTitle: (text:
25
34
  setThreads((previous) => previous.map((thread) => thread.id === activeId ? { ...thread, draft } : thread));
26
35
  };
27
36
 
28
- const send = (text: string) => {
29
- const value = text.trim();
30
- if (!value || pendingThreads.current.has(activeId)) return;
31
- const targetId = activeId;
32
- const baseMessages = activeThread.messages;
33
- const messageId = `${targetId}-${baseMessages.length}`;
34
- const assistantId = `${messageId}-assistant`;
35
- pendingThreads.current.add(targetId);
36
- setThreads((previous) => previous.map((thread) => {
37
- if (thread.id !== activeId) return thread;
38
- return {
39
- ...thread,
40
- title: thread.title || getTitle(value),
41
- draft: "",
42
- messages: [
43
- ...baseMessages,
44
- { id: `${messageId}-user`, role: "user", text: value },
45
- { id: `${messageId}-assistant`, role: "assistant", text: "", isStreaming: true },
46
- ],
47
- };
48
- }));
49
- delivery.start(targetId, getReply(value), (reply, isStreaming) => {
50
- if (!isStreaming) pendingThreads.current.delete(targetId);
51
- setThreads((previous) => previous.map((thread) => thread.id === targetId ? {
37
+ const imageUrls = useRef(new Set<string>());
38
+ useEffect(() => {
39
+ const used = new Set<string>();
40
+ for (const thread of threads) {
41
+ for (const attachment of [...thread.attachments, ...thread.messages.flatMap((message) => message.attachments ?? [])]) {
42
+ if (attachment.kind === "image" && attachment.src) used.add(attachment.src);
43
+ }
44
+ }
45
+ for (const url of imageUrls.current) {
46
+ if (used.has(url)) continue;
47
+ URL.revokeObjectURL(url);
48
+ imageUrls.current.delete(url);
49
+ }
50
+ }, [threads]);
51
+ useEffect(() => {
52
+ const urls = imageUrls.current;
53
+ return () => { urls.forEach((url) => URL.revokeObjectURL(url)); urls.clear(); };
54
+ }, []);
55
+
56
+ const attach = (files: File[]) => {
57
+ const attachments = files.map((file): ChatAttachment => {
58
+ const id = `attachment-${sequence.current++}`;
59
+ if (!file.type.startsWith("image/")) return { id, kind: "file", filename: file.name };
60
+ const src = URL.createObjectURL(file);
61
+ imageUrls.current.add(src);
62
+ return { id, kind: "image", src, alt: file.name };
63
+ });
64
+ setThreads((previous) => previous.map((thread) => thread.id === activeId ? {
65
+ ...thread, attachments: [...thread.attachments, ...attachments],
66
+ } : thread));
67
+ };
68
+
69
+ const removeAttachment = (id: string) => {
70
+ setThreads((previous) => previous.map((thread) => thread.id === activeId ? {
71
+ ...thread, attachments: thread.attachments.filter((attachment) => attachment.id !== id),
72
+ } : thread));
73
+ };
74
+
75
+ const streamReply = (threadId: string, assistantId: string, prompt: ChatDemoMessage) => {
76
+ pendingThreads.current.add(threadId);
77
+ delivery.start(threadId, getReply(prompt.text, !!prompt.attachments?.length), (text, isStreaming) => {
78
+ if (!isStreaming) pendingThreads.current.delete(threadId);
79
+ setThreads((previous) => previous.map((thread) => thread.id === threadId ? {
52
80
  ...thread,
53
- messages: thread.messages.map((message) => message.id === assistantId ? { ...message, text: reply, isStreaming } : message),
81
+ messages: thread.messages.map((message) => message.id === assistantId ? {
82
+ ...message, text, isStreaming, interruption: undefined,
83
+ } : message),
54
84
  } : thread));
55
85
  });
56
86
  };
57
87
 
88
+ const send = (text: string, useDraft = true) => {
89
+ const value = text.trim();
90
+ const attachments = useDraft ? activeThread.attachments : [];
91
+ if ((!value && !attachments.length) || pendingThreads.current.has(activeId)) return;
92
+ const messageId = `${activeId}-${activeThread.messages.length}`;
93
+ const assistantId = `${messageId}-assistant`;
94
+ const prompt: ChatDemoMessage = { id: `${messageId}-user`, role: "user", text: value, attachments };
95
+ const failed = value === "/fail";
96
+ const firstFile = attachments[0];
97
+ const title = value || (firstFile?.kind === "file" ? firstFile.filename : firstFile?.alt) || "";
98
+ setThreads((previous) => previous.map((thread) => thread.id === activeId ? {
99
+ ...thread,
100
+ title: thread.title || getTitle(title),
101
+ draft: useDraft ? "" : thread.draft,
102
+ attachments: useDraft ? [] : thread.attachments,
103
+ messages: [...thread.messages, prompt, {
104
+ id: assistantId, role: "assistant", text: "",
105
+ interruption: failed ? "failed" : undefined, isStreaming: !failed,
106
+ }],
107
+ } : thread));
108
+ if (!failed) streamReply(activeId, assistantId, prompt);
109
+ };
110
+
58
111
  const stop = () => {
59
112
  delivery.stop(activeId);
60
113
  pendingThreads.current.delete(activeId);
61
114
  setThreads((previous) => previous.map((thread) => thread.id === activeId ? {
62
- ...thread, messages: thread.messages.map((message) => message.isStreaming ? { ...message, isStreaming: false } : message),
115
+ ...thread, messages: thread.messages.map((message) => message.isStreaming ? {
116
+ ...message, isStreaming: false, interruption: message.text ? undefined : "stopped",
117
+ } : message),
63
118
  } : thread));
64
119
  };
65
120
 
@@ -70,22 +125,22 @@ export function useChatDemo(getReply: (text: string) => string, getTitle: (text:
70
125
  const targetId = activeId;
71
126
  const assistantId = `${targetId}-${index}-assistant`;
72
127
  delivery.stop(targetId);
73
- pendingThreads.current.add(targetId);
74
128
  setThreads((previous) => previous.map((thread) => thread.id === targetId ? {
75
129
  ...thread,
76
130
  messages: [
77
131
  ...thread.messages.slice(0, index),
78
- { id: messageId, role: "user", text: value },
132
+ { ...thread.messages[index], text: value },
79
133
  { id: assistantId, role: "assistant", text: "", isStreaming: true },
80
134
  ],
81
135
  } : thread));
82
- delivery.start(targetId, getReply(value), (reply, streaming) => {
83
- if (!streaming) pendingThreads.current.delete(targetId);
84
- setThreads((previous) => previous.map((thread) => thread.id === targetId ? {
85
- ...thread,
86
- messages: thread.messages.map((message) => message.id === assistantId ? { ...message, text: reply, isStreaming: streaming } : message),
87
- } : thread));
88
- });
136
+ streamReply(targetId, assistantId, { ...activeThread.messages[index], text: value });
137
+ };
138
+
139
+ const retry = (messageId: string) => {
140
+ if (pendingThreads.current.has(activeId)) return;
141
+ const index = activeThread.messages.findIndex((message) => message.id === messageId && message.interruption);
142
+ const prompt = activeThread.messages[index - 1];
143
+ if (prompt?.role === "user") streamReply(activeId, messageId, prompt);
89
144
  };
90
145
 
91
146
  const regenerate = (messageId: string) => {
@@ -94,28 +149,21 @@ export function useChatDemo(getReply: (text: string) => string, getTitle: (text:
94
149
  const prompt = activeThread.messages[index - 1];
95
150
  if (index < 1 || prompt?.role !== "user") return;
96
151
  const targetId = activeId;
97
- pendingThreads.current.add(targetId);
98
152
  setThreads((previous) => previous.map((thread) => thread.id === targetId ? {
99
153
  ...thread,
100
154
  messages: [...thread.messages.slice(0, index), { id: messageId, role: "assistant", text: "", isStreaming: true }],
101
155
  } : thread));
102
- delivery.start(targetId, getReply(prompt.text), (text, streaming) => {
103
- if (!streaming) pendingThreads.current.delete(targetId);
104
- setThreads((previous) => previous.map((thread) => thread.id === targetId ? {
105
- ...thread,
106
- messages: thread.messages.map((message) => message.id === messageId ? { ...message, text, isStreaming: streaming } : message),
107
- } : thread));
108
- });
156
+ streamReply(targetId, messageId, prompt);
109
157
  };
110
158
 
111
159
  const createThread = () => {
112
- const empty = threads.find((thread) => thread.messages.length === 0 && !thread.draft && !thread.title);
160
+ const empty = threads.find((thread) => thread.messages.length === 0 && !thread.draft.trim() && !thread.title && !thread.attachments.length);
113
161
  if (empty) {
114
162
  setActiveId(empty.id);
115
163
  return;
116
164
  }
117
165
  const id = `chat-${sequence.current++}`;
118
- setThreads((previous) => [...previous, { id, title: "", draft: "", messages: [] }]);
166
+ setThreads((previous) => [...previous, { id, title: "", draft: "", attachments: [], messages: [] }]);
119
167
  setActiveId(id);
120
168
  };
121
169
 
@@ -129,11 +177,11 @@ export function useChatDemo(getReply: (text: string) => string, getTitle: (text:
129
177
  pendingThreads.current.delete(id);
130
178
  const remaining = threads.filter((thread) => thread.id !== id);
131
179
  if (!remaining.length) {
132
- remaining.push({ id: `chat-${sequence.current++}`, title: "", draft: "", messages: [] });
180
+ remaining.push({ id: `chat-${sequence.current++}`, title: "", draft: "", attachments: [], messages: [] });
133
181
  }
134
182
  setThreads(remaining);
135
183
  if (activeId === id) setActiveId(remaining[remaining.length - 1].id);
136
184
  };
137
185
 
138
- return { threads, activeThread, setActiveId, createThread, renameThread, deleteThread, setDraft, send, stop, edit, regenerate, isStreaming: activeThread.messages.some((message) => message.isStreaming) };
186
+ return { threads, activeThread, setActiveId, createThread, renameThread, deleteThread, setDraft, attach, removeAttachment, send, stop, edit, regenerate, retry, isStreaming: activeThread.messages.some((message) => message.isStreaming) };
139
187
  }
@@ -19,7 +19,7 @@
19
19
  ### Don't
20
20
  - 스크롤 컨테이너 자체에 `padding`을 걸지 않는다 → thumb이 콘텐츠와 겹쳐 보임.
21
21
  - items에 `margin: first-child/last-child` 트릭으로 여백 흉내내지 않는다 → 정렬 깨지고 유지보수 어려움.
22
- - `overflow: hidden` 위에 scrollTop을 JS로 조작하는 커스텀 스크롤은 접근성 무너짐. 반드시 네이티브 `overflow: auto`.
22
+ - [HARD] `overflow: hidden` 위에 scrollTop을 JS로 조작하는 커스텀 스크롤은 접근성 무너짐. 반드시 네이티브 `overflow: auto`.
23
23
 
24
24
  ### Fallback
25
25
  스크롤 필요 없는 경우엔 안쪽 트랙 패딩만으로도 무해. 그러니 규약을 컴포넌트 기본으로 두는 게 안전.
@@ -6,7 +6,7 @@ Semantic 이름으로 참조. 실제 색은 Palette(brand hex + paletteSet + mon
6
6
 
7
7
  ### Do
8
8
  - **브랜드 색은 하나 — `--primary`**. 주 액션(CTA·submit·confirm)·링크·활성 상태·강조 전부 primary로. 브랜드 톤이 둘로 쪼개지지 않게.
9
- - 텍스트 위계: 본문 `--fg`, 보조 `--fg-muted`, 메타 `--fg-subtle`, 플레이스홀더 `--fg-placeholder`. 플레이스홀더는 Select·날짜/시간 필드처럼 실제 텍스트로 렌더되는 자리가 있으므로 subtle보다 진한 알파로 AA 4.5:1을 지키되 본문보다 옅게 유지한다.
9
+ - 텍스트 위계: 본문 `--fg`, 보조 `--fg-muted`, 메타·플레이스홀더 `--fg-subtle`. 플레이스홀더는 기존 색 위에 공통 `--placeholder-opacity`를 적용하여 한 단계 옅게 표시한다.
10
10
  - 표면 위계: 페이지 `--bg`, 카드/영역 `--bg-subtle`, 코드/hover `--bg-muted`.
11
11
  - 앱 탑바와 본문 페이지 바탕은 언제나 같은 색을 쓴다. AppFrame은 공통 `--app-frame-bg`(기본 `--bg`)로 Topbar·Tabs·Content를 연결한다. 프로젝트에서 바탕을 바꾸면 이 매핑과 페이지 바탕을 함께 바꾼다. 사이드바와 카드의 표면 구분은 [[components/app-frame]]의 배경 계약을 따른다.
12
12
  - 다크의 일반 `--border`는 밝은 전경18% 알파, `--border-strong`은26% 알파로 구분한다. 전용 테이블 경계는 별도 토큰을 따른다.
@@ -16,7 +16,7 @@ Semantic 이름으로 참조. 실제 색은 Palette(brand hex + paletteSet + mon
16
16
  ### Don't
17
17
  - hex/rgb/oklch 리터럴 금지. 모든 색은 CSS 변수 경유.
18
18
  - Status hue를 재정의하지 않는다 (성공은 항상 초록, 경고는 항상 주황).
19
- - 밝은 배경에 흰 텍스트, 어두운 배경에 검은 텍스트 금지 — 항상 semantic pair 사용.
19
+ - [HARD] 밝은 배경에 흰 텍스트, 어두운 배경에 검은 텍스트 금지 — 항상 semantic pair 사용.
20
20
  - **`--accent`를 쓰지 않는다** — Ovenn은 Palette 축이 "한 프로젝트 = 한 brand hex"로 설계돼 primary 외의 별도 브랜드 색이 존재하지 않는다. 과거 `--accent` 참조는 `--primary`로 교체.
21
21
 
22
22
  ### Fallback
@@ -43,8 +43,7 @@ Semantic 이름으로 참조. 실제 색은 Palette(brand hex + paletteSet + mon
43
43
  |---|---|
44
44
  | `--fg` | 본문 |
45
45
  | `--fg-muted` | 보조 텍스트 |
46
- | `--fg-subtle` | 메타 |
47
- | `--fg-placeholder` | 플레이스홀더. 실제 텍스트로 렌더되는 자리표시도 AA 대비를 지킴 |
46
+ | `--fg-subtle` | 메타·플레이스홀더 |
48
47
 
49
48
  **경계**
50
49
  | Token | 용도 |
@@ -107,4 +106,4 @@ mono에서는 모든 chart token의 chroma가 0이다. 단순 등간격 그레
107
106
 
108
107
  ### 플레이스홀더 표현
109
108
 
110
- `--fg-placeholder`는 native input/textarea의 `::placeholder`와 Select·날짜/시간 필드·검색 트리거의 자리표시 라벨에 공통으로 쓴다. 투명도로 옅게 만들지 않는다. 본문·라벨·도움말·disabled 토큰은 변경하지 않는다.
109
+ `--placeholder-opacity`는 기본 0.85다. native input/textarea는 전역 유틸에서 적용하며 Select·날짜/시간 필드의 자리표시 라벨에도 동일하게 적용한다. 본문·라벨·도움말·disabled 토큰은 변경하지 않는다.
@@ -10,6 +10,8 @@
10
10
  |---|---|
11
11
  | `--surface-glass-bg` | Mode별 tint와 불투명도로 합성한 딤드 표면 |
12
12
  | `--surface-glass-border` | `--fg` 라이트5%/다크10% + `--bg`, `--hairline` 두께 |
13
+ | `--surface-glass-field-opacity` | 박스 입력 컨트롤과 메뉴 배경의 불투명도45% |
14
+ | `--surface-glass-field-bg/filled-bg/active-bg` | 기본·채움·활성 입력 배경을45%로 합성 |
13
15
  | `--surface-glass-blur` | 8px backdrop blur |
14
16
  | `--surface-glass-radius` | `--radius-lg` |
15
17
  | `--surface-glass-selected-bg` | `--fg` 8% + `--bg` 92% |
@@ -21,12 +23,13 @@
21
23
  | 딤드 있음 | 72% | 40% | 8px | dim/blur Modal·Drawer |
22
24
  | CommandPalette | 70% | 70% | 8px | 전역 명령 창 |
23
25
  | 일반 딤드 없음 | 80% | 58% | 16px | DatePicker, transparent Modal·none Drawer |
26
+ | 박스 입력 컨트롤 | 45% | 45% | 별도 추가 없음 | Input·Textarea·Select/Combobox 트리거 |
24
27
  | ColorPicker | 42% | 42% | 10px | 색상판/입력은 읽을 수 있게 유지, 외곽은 5% 중성 경계 |
25
- | 메뉴 | 92% | 92% | 16px | ContextMenu·DropdownMenu·Select의 공통 표면 |
28
+ | 메뉴 | 45% | 45% | 16px | ContextMenu·DropdownMenu·Select의 공통 표면 |
26
29
 
27
30
  다크는 `--surface-glass-tint`로 전경4%를 배경에 섞고, `--surface-glass-border-contrast`를10%로 높여 검은 바탕과 표면의 경계를 구분한다. 라이트는 각각0%·5%다. 불투명도는 `--surface-glass-opacity`·`--surface-glass-floating-opacity`에 저장하며, 로컬 Mode/Material scope도 이 값을 따른다.
28
31
 
29
- 딤드가 없는 화면은 배경의 색·텍스트가 직접 간섭하므로 불투명도와 블러를 높인다. `--surface-glass-floating-bg`·`--surface-glass-floating-blur`에 값을 저장하고 `--material-floating-bg/filter`로 활성화한다. 색상판·수치 입력은 불투명하게 유지한다.
32
+ 딤드가 없는 화면은 배경의 색·텍스트가 직접 간섭하므로 불투명도와 블러를 높인다. `--surface-glass-floating-bg`·`--surface-glass-floating-blur`에 값을 저장하고 `--material-floating-bg/filter`로 활성화한다. ColorPicker 색상판과 색상 수치 입력은 불투명하게 유지한다. 박스 입력 컨트롤은 `--material-field-bg/filled-bg/active-bg`로 활성화하며 Solid·로컬 Solid·투명도 감소에서는 기존 불투명 표면으로 돌아간다. line과 readOnly의 투명 배경은 그대로 유지한다.
30
33
 
31
34
  ### 사용
32
35
  - 전역 재질 전환은 [[axes/material]]의 `solid | glass`를 사용한다. `--surface-glass-*`는 재질 원본이며, 활성 표면은 `--material-*` 별칭을 참조한다.
@@ -6,7 +6,7 @@ Tooltip < Button < Card < Modal 순서는 어떤 프로젝트에서도 유지.
6
6
 
7
7
  모서리 형태는 `corner-shape: var(--corner-shape)`로 연결한다. 반경을 상속하는 내부 표면은 `corner-shape: inherit`도 함께 쓴다. 미니 Checkbox·Badge는 `corner-shape-mini`를 사용한다. Switch는 자체 soft/crisp variant의 로컬 토큰을 유지하며 전역 Shape와 독립적이다.
8
8
 
9
- Squircle 보정 배율은 `radius-scale`(standard·pill1.8, soft1.72, crisp1)이다. standard의 기준 반경 10% 축소와 soft의 큰 단계 축소는 배율 이전 기준값에 유지한다. none/full은 배율을 적용하지 않는다. soft의 액션 컨트롤 radius-pill-sm/md/lg는 해당 control 높이의 44%를 상한으로 두어 pill처럼 차는 것을 막는다. 작은 부품은 높이 절반 정규화 때문에 같은 모양이 될 수 있으므로 실제 화면에서 축별 곡선 차이를 확인한다.
9
+ Squircle 보정 배율은 `radius-scale`(standard 1.75, soft 1.72, pill 1.8, crisp 1)이다. standard의 기준 반경 10% 축소와 soft의 큰 단계 축소는 배율 이전 기준값에 유지한다. none/full은 배율을 적용하지 않는다. soft의 액션 컨트롤 radius-pill-sm/md/lg는 해당 control 높이의 44%를 상한으로 두어 pill처럼 차는 것을 막는다. 작은 부품은 높이 절반 정규화 때문에 같은 모양이 될 수 있으므로 실제 화면에서 축별 곡선 차이를 확인한다.
10
10
 
11
11
  - 표면 위 SVG 외곽선은 CSS의 radius·corner-shape에서 같은 경로를 생성한다. 별도 rect rx로 일반 원호를 겹치면 squircle과 어긋난다. border/outline 같은 동일 요소의 네이티브 경계와 구분한다.
12
12