@conscience-technology/ovenn 0.7.4 → 0.7.6

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 (185) hide show
  1. package/README.md +43 -4
  2. package/assets/components/AIMessage/AIMessage.module.css +10 -0
  3. package/assets/components/AIMessage/AIMessage.tsx +6 -2
  4. package/assets/components/AttachmentThumb/AttachmentThumb.tsx +1 -0
  5. package/assets/components/Breadcrumb/Breadcrumb.module.css +82 -23
  6. package/assets/components/Breadcrumb/Breadcrumb.tsx +44 -26
  7. package/assets/components/Breadcrumb/index.ts +1 -0
  8. package/assets/components/Button/Button.module.css +2 -4
  9. package/assets/components/Callout/Callout.module.css +44 -18
  10. package/assets/components/Callout/Callout.tsx +9 -4
  11. package/assets/components/Callout/index.ts +1 -1
  12. package/assets/components/Canvas/Canvas.module.css +13 -0
  13. package/assets/components/Canvas/Canvas.tsx +378 -94
  14. package/assets/components/Canvas/clipboard.ts +5 -1
  15. package/assets/components/Canvas/collision.ts +5 -1
  16. package/assets/components/Canvas/graph.ts +14 -5
  17. package/assets/components/Canvas/history.ts +11 -4
  18. package/assets/components/Canvas/index.ts +2 -1
  19. package/assets/components/Canvas/types.ts +36 -1
  20. package/assets/components/CanvasEdge/tokens.css +14 -1
  21. package/assets/components/CanvasNode/tokens.css +13 -10
  22. package/assets/components/ChatComposer/ChatComposer.tsx +1 -1
  23. package/assets/components/ChatInput/ChatInput.tsx +1 -1
  24. package/assets/components/ColorField/ColorField.module.css +6 -1
  25. package/assets/components/ColorPicker/ColorPicker.module.css +3 -0
  26. package/assets/components/CommandPalette/CommandPalette.module.css +114 -0
  27. package/assets/components/CommandPalette/CommandPalette.tsx +206 -21
  28. package/assets/components/CommandPalette/index.ts +1 -0
  29. package/assets/components/Drawer/Drawer.module.css +30 -0
  30. package/assets/components/Drawer/Drawer.tsx +75 -16
  31. package/assets/components/Drawer/index.ts +1 -0
  32. package/assets/components/FileIcon/FileIcon.tsx +1 -0
  33. package/assets/components/FileIcon/fileExtMap.ts +1 -0
  34. package/assets/components/Icon/Icon.tsx +3 -0
  35. package/assets/components/Input/Input.module.css +3 -3
  36. package/assets/components/Onboarding/OnboardingAxisPanel.tsx +1 -1
  37. package/assets/components/Onboarding/OnboardingPage.tsx +13 -11
  38. package/assets/components/Onboarding/actions.ts +9 -9
  39. package/assets/components/Select/Select.module.css +1 -1
  40. package/assets/components/SocialLoginButton/SocialLoginButton.module.css +198 -0
  41. package/assets/components/SocialLoginButton/SocialLoginButton.tsx +86 -0
  42. package/assets/components/SocialLoginButton/assets/amazon.svg +1 -0
  43. package/assets/components/SocialLoginButton/assets/apple.svg +3 -0
  44. package/assets/components/SocialLoginButton/assets/discord.svg +3 -0
  45. package/assets/components/SocialLoginButton/assets/facebook-white.png +0 -0
  46. package/assets/components/SocialLoginButton/assets/facebook.png +0 -0
  47. package/assets/components/SocialLoginButton/assets/github.svg +3 -0
  48. package/assets/components/SocialLoginButton/assets/google-mark.png +0 -0
  49. package/assets/components/SocialLoginButton/assets/kakao.svg +3 -0
  50. package/assets/components/SocialLoginButton/assets/line-icon.png +0 -0
  51. package/assets/components/SocialLoginButton/assets/line-white.png +0 -0
  52. package/assets/components/SocialLoginButton/assets/linkedin-white.png +0 -0
  53. package/assets/components/SocialLoginButton/assets/linkedin.png +0 -0
  54. package/assets/components/SocialLoginButton/assets/microsoft.svg +6 -0
  55. package/assets/components/SocialLoginButton/assets/naver.png +0 -0
  56. package/assets/components/SocialLoginButton/assets/slack.svg +17 -0
  57. package/assets/components/SocialLoginButton/assets/spotify.svg +3 -0
  58. package/assets/components/SocialLoginButton/assets/twitch.svg +21 -0
  59. package/assets/components/SocialLoginButton/assets/wechat.png +0 -0
  60. package/assets/components/SocialLoginButton/assets/x.svg +3 -0
  61. package/assets/components/SocialLoginButton/index.ts +2 -0
  62. package/assets/components/SocialLoginButton/provider-tokens.css +30 -0
  63. package/assets/components/SocialLoginButton/providers.ts +23 -0
  64. package/assets/components/TableRowEdit/TableRowEdit.tsx +2 -2
  65. package/assets/components/ThemeController.tsx +2 -2
  66. package/assets/components/TimelineView/TimelineView.tsx +4 -2
  67. package/assets/components/Tooltip/Tooltip.module.css +1 -0
  68. package/assets/components/_data.ts +1 -1
  69. package/assets/components/_utils.css +1 -0
  70. package/assets/components/component-registry.json +30 -1
  71. package/assets/components/index.ts +1 -0
  72. package/assets/components/side-effect-css.d.ts +5 -0
  73. package/assets/components/themeBootScript.ts +7 -1
  74. package/assets/components/tokens.css +14 -6
  75. package/assets/prompts/ASSEMBLY.md +4 -0
  76. package/assets/prompts/CASCADE.md +2 -2
  77. package/assets/prompts/CATALOG.md +2 -1
  78. package/assets/prompts/PRINCIPLES.md +4 -8
  79. package/assets/prompts/RULES.md +19 -1
  80. package/assets/prompts/SLOTS.md +2 -4
  81. package/assets/prompts/WORKFLOW_DESIGN.md +0 -4
  82. package/assets/prompts/axes/icon.md +1 -1
  83. package/assets/prompts/axes/material.md +4 -4
  84. package/assets/prompts/axes/motion.md +1 -1
  85. package/assets/prompts/axes/shape.md +2 -2
  86. package/assets/prompts/axes/voice.md +1 -1
  87. package/assets/prompts/components/_variants.md +4 -4
  88. package/assets/prompts/components/accordion.md +4 -4
  89. package/assets/prompts/components/ai-message.md +6 -2
  90. package/assets/prompts/components/attachment-item.md +2 -2
  91. package/assets/prompts/components/breadcrumb.md +11 -5
  92. package/assets/prompts/components/button.md +3 -3
  93. package/assets/prompts/components/callout.md +8 -4
  94. package/assets/prompts/components/canvas-edge.md +1 -1
  95. package/assets/prompts/components/canvas-node.md +1 -1
  96. package/assets/prompts/components/canvas.md +24 -8
  97. package/assets/prompts/components/card.md +1 -2
  98. package/assets/prompts/components/chart-bar.md +1 -1
  99. package/assets/prompts/components/chat-input.md +1 -1
  100. package/assets/prompts/components/checkbox.md +5 -5
  101. package/assets/prompts/components/color-field.md +2 -2
  102. package/assets/prompts/components/command-palette.md +55 -47
  103. package/assets/prompts/components/context-menu.md +5 -5
  104. package/assets/prompts/components/date-picker.md +2 -2
  105. package/assets/prompts/components/drawer.md +17 -3
  106. package/assets/prompts/components/dropdown-menu.md +3 -3
  107. package/assets/prompts/components/event-list-item.md +4 -4
  108. package/assets/prompts/components/file-icon.md +2 -2
  109. package/assets/prompts/components/gallery-item.md +1 -1
  110. package/assets/prompts/components/hint.md +3 -3
  111. package/assets/prompts/components/kanban.md +2 -3
  112. package/assets/prompts/components/list-item.md +12 -12
  113. package/assets/prompts/components/menu-item.md +2 -2
  114. package/assets/prompts/components/message-table.md +4 -4
  115. package/assets/prompts/components/onboarding.md +3 -3
  116. package/assets/prompts/components/page-header.md +6 -7
  117. package/assets/prompts/components/quotation-bar.md +1 -1
  118. package/assets/prompts/components/select.md +1 -1
  119. package/assets/prompts/components/shortcut.md +3 -3
  120. package/assets/prompts/components/sidebar.md +5 -4
  121. package/assets/prompts/components/social-login-button.md +117 -0
  122. package/assets/prompts/components/stepper.md +1 -1
  123. package/assets/prompts/components/tab-strip.md +2 -2
  124. package/assets/prompts/components/table-row-edit.md +6 -6
  125. package/assets/prompts/components/table-row-select.md +1 -1
  126. package/assets/prompts/components/tabs.md +5 -2
  127. package/assets/prompts/components/textarea.md +1 -1
  128. package/assets/prompts/components/toast.md +3 -3
  129. package/assets/prompts/components/tooltip.md +3 -3
  130. package/assets/prompts/components/topbar.md +1 -1
  131. package/assets/prompts/design-examples/ai-chat-full-page.png +0 -0
  132. package/assets/prompts/design-examples/catalog.json +9 -9
  133. package/assets/prompts/design-examples/sources/ai-chat-full-page/ChatExperience.module.css +37 -1
  134. package/assets/prompts/design-examples/sources/ai-chat-full-page/ChatExperience.tsx +113 -18
  135. package/assets/prompts/design-examples/sources/ai-chat-full-page/FullPageChat.tsx +2 -2
  136. package/assets/prompts/design-examples/sources/ai-chat-full-page/REFERENCE.md +3 -1
  137. package/assets/prompts/design-examples/sources/ai-chat-full-page/useChatDemo.ts +99 -51
  138. package/assets/prompts/primitives/scroll.md +1 -1
  139. package/assets/prompts/recipes/README.md +5 -6
  140. package/assets/prompts/recipes/meta-line.md +2 -2
  141. package/assets/prompts/recipes/page-header.md +2 -2
  142. package/assets/prompts/recipes/section-header.md +1 -1
  143. package/assets/prompts/themes/_SCHEMA.md +2 -2
  144. package/assets/prompts/tokens/material.md +5 -2
  145. package/assets/prompts/tokens/radius.md +1 -1
  146. package/assets/prompts/use-cases/chat-chat-input.md +382 -74
  147. package/assets/prompts/use-cases/data-list-item.md +38 -431
  148. package/assets/prompts/use-cases/feedback-drawer.md +112 -33
  149. package/assets/prompts/use-cases/overlay-command-palette.md +2004 -0
  150. package/assets/prompts/use-cases/structure-canvas.md +1016 -0
  151. package/assets/skills/ovenn-validate/SKILL.md +1 -1
  152. package/assets/skills/ovenn-validate/scripts/lib/component-usage.js +7 -1
  153. package/assets/skills/ovenn-validate/scripts/lib/engine.mjs +105 -0
  154. package/assets/skills/ovenn-validate/scripts/lib/engine.test.mjs +46 -0
  155. package/assets/skills/ovenn-validate/scripts/lib/source-utils.mjs +5 -3
  156. package/assets/skills/ovenn-validate/scripts/rules/doc-sync.mjs +28 -5
  157. package/assets/skills/ovenn-validate/scripts/rules/doc-sync.test.mjs +15 -0
  158. package/assets/skills/ovenn-validate/scripts/rules/ghost-tokens.mjs +7 -0
  159. package/assets/skills/ovenn-validate/scripts/rules/hardcoded.mjs +61 -30
  160. package/assets/skills/ovenn-validate/scripts/rules/memory-rules.mjs +7 -4
  161. package/assets/skills/ovenn-validate/scripts/rules/memory-rules.test.mjs +3 -0
  162. package/assets/skills/ovenn-validate/scripts/validate.mjs +8 -136
  163. package/assets/skills/ovenn-wireframe/SKILL.md +1 -1
  164. package/bin/ovenn.js +8 -0
  165. package/package.json +2 -2
  166. package/src/commands/check.js +70 -0
  167. package/src/commands/info.js +32 -7
  168. package/src/commands/init.js +26 -30
  169. package/src/commands/setup-checks.js +80 -0
  170. package/src/commands/update.js +90 -18
  171. package/src/data/ctds-releases.json +1 -0
  172. package/src/utils/assets.js +5 -0
  173. package/src/utils/component-usage.js +7 -1
  174. package/src/utils/design-workflow.js +6 -2
  175. package/src/utils/doctor.js +7 -1
  176. package/src/utils/legacy-ctds.js +169 -0
  177. package/src/utils/managed-assets.js +16 -3
  178. package/src/utils/route.js +17 -0
  179. package/src/utils/rules-context.js +91 -0
  180. package/src/utils/update-transaction.js +16 -3
  181. package/assets/prompts/FEEDBACK_PROCESS.md +0 -19
  182. package/assets/prompts/GUIDE.md +0 -307
  183. package/assets/prompts/MEMORY.md +0 -202
  184. package/assets/prompts/TEMPLATE_PREVIEWS.md +0 -21
  185. package/assets/prompts/components/README.md +0 -84
package/README.md CHANGED
@@ -66,7 +66,7 @@ Clicking "Apply" writes two files to the project root:
66
66
  ```bash
67
67
  npx @conscience-technology/ovenn init # default
68
68
  npx @conscience-technology/ovenn init --dry # print planned writes without touching disk
69
- npx @conscience-technology/ovenn init --force # overwrite existing files
69
+ npx @conscience-technology/ovenn init --force # on an existing install: same as `ovenn update --force` (backup + rollback)
70
70
  ```
71
71
 
72
72
  Debug:
@@ -76,6 +76,15 @@ OVENN_DEBUG=1 npx @conscience-technology/ovenn init
76
76
 
77
77
  ## Diagnose and update safely
78
78
 
79
+ Run the latest CLI explicitly. A bare `ovenn` resolves to whatever version the project or npx cache already holds, which may be the release you are trying to leave.
80
+
81
+ ```bash
82
+ npx @conscience-technology/ovenn@latest update --dry # preview
83
+ npx @conscience-technology/ovenn@latest update
84
+ ```
85
+
86
+ Running `init` on an existing install runs `update`; with `--force` it runs `update --force`, so local edits are never replaced without a backup. Projects installed by the legacy `@conscience-technology/ctds` CLI (0.1.0–0.6.3) are migrated by the same command: untouched CTDS files are replaced or removed, `components/ctds` imports in project code and `globals.css`/`layout.tsx` move to `components/ovenn`, `ctds.config.json` becomes `ovenn.config.json`, the CTDS block leaves `AGENTS.md`, and saved `ctds-*` theme choices carry over in the browser. Files are recognised as untouched by comparing them with every published CTDS release.
87
+
79
88
  ```bash
80
89
  ovenn info doctor --json
81
90
  ovenn update --dry --json
@@ -86,12 +95,42 @@ ovenn update --rollback=UPDATE_ID
86
95
  ovenn update --recover=UPDATE_ID
87
96
  ```
88
97
 
89
- All bundled components, prompts, skills and onboarding assets use file-level hash comparison. Extra files, config and local renderers remain in place. Keeping a local edit retains its old upstream baseline, so a later update still reports the conflict. Re-running init without force does not adopt skipped local files as a new baseline. Legacy metadata without auxiliary hashes treats differing existing auxiliary files as conflicts.
98
+ All bundled components, prompts, skills and onboarding assets use file-level hash comparison. Files a release no longer ships are removed when untouched; edited ones, and edited CTDS files, are moved to `.ovenn/kept/<path>` so they neither compile against removed siblings nor reach agents, and the update lists them by name. Your own extra files, config and local renderers remain in place. `AGENTS.md`, `CLAUDE.md` and the Cursor rule only replace their Ovenn marker block, so notes outside it never block an update. Files kept because of local edits are listed by name; they stay at the old version until you take the new one. Keeping a local edit retains its old upstream baseline, so a later update still reports the conflict. Re-running init without force does not adopt skipped local files as a new baseline. Legacy metadata without auxiliary hashes treats differing existing auxiliary files as conflicts.
90
99
 
91
- Interactive choices are collected before writes. In a noninteractive shell, conflicts are kept unless --force is explicitly supplied. Each applied update has backups and a journal in `.ovenn/updates/ID`. A later user edit blocks rollback before any restoration. A process interrupted while applying requires --recover; do not remove its backup directory first. Backups may contain project code; retain them according to your project policy.
100
+ Interactive choices are collected before writes. In a noninteractive shell, conflicts are kept unless --force is explicitly supplied. Edited files that --force (or an interactive yes) replaces are listed by name, and the backup restores them. Each applied update has backups and a journal in `.ovenn/updates/ID`. A later user edit blocks rollback before any restoration. A process interrupted while applying requires --recover; do not remove its backup directory first. Backups may contain project code; retain them according to your project policy.
92
101
 
93
102
  Doctor checks declared and resolvable dependencies, metadata/missing assets/local edits, token import, visible ThemeController integration, config JSON, installed/CLI version and unfinished update journals. External wrappers and peer range compatibility need additional verification. Root `app/` and `src/app/` fixtures use the repository's pinned Next/React runtime in release checks; this is not a compatibility claim for every peer version or Vite.
94
103
 
104
+ ## Run the check automatically (opt-in)
105
+
106
+ ```bash
107
+ npx @conscience-technology/ovenn setup-checks --hook --prebuild --ci # or --all; --dry previews
108
+ ```
109
+
110
+ `--hook` adds a Claude Code PostToolUse hook to `.claude/settings.json`: after each Edit/Write it checks only that file and, on a violation, exits 2 so Claude Code shows the file, line and fix to the agent. `--prebuild` makes `npm run build` run the check first (an existing `prebuild` is kept and the check appended). `--ci` adds `.github/workflows/ovenn-check.yml`. Existing settings are merged; running it again changes nothing. `ovenn init` only mentions this; it installs none of it.
111
+
112
+ ## Rules for the task at hand
113
+
114
+ ```bash
115
+ ovenn info get-rules --local --components=Input,Canvas # RULES + those components' principle/behaviour/Don't/[HARD]
116
+ ovenn info get-design-workflow --local --phase=build # only the build sections of ASSEMBLY/WORKFLOW_DESIGN
117
+ ```
118
+
119
+ MCP `get_rules(components, principles)` and `get_design_workflow(phase)` return the same text. Without arguments both return the full documents as before.
120
+
121
+ ## TypeScript 7
122
+
123
+ Installed components type-check with TypeScript 5, 6 and 7. `ovenn info check-component-usage --local` parses with TypeScript's JS compiler API, which the TypeScript 7 `typescript` package no longer ships; in a TypeScript 7 project install Microsoft's compatibility package next to it (`npm install -D @typescript/typescript6`) and the check uses it. `ovenn info doctor` warns when it is missing. A project's own `import "./globals.css"` in `app/layout.tsx` needs its own declaration under TypeScript 7; that file is not part of Ovenn.
124
+
125
+ ## Check your code offline
126
+
127
+ ```bash
128
+ npx @conscience-technology/ovenn check # app/, src/, components/ … (skips components/ovenn)
129
+ npx @conscience-technology/ovenn check app/dashboard --json
130
+ ```
131
+
132
+ Hardcoded colours, sizes and times, undeclared tokens and the machine-checkable `prompts/RULES.md` rules, reported as `file:line — rule — message` with a suggested fix. Exit code 1 on any error, so it fits a prebuild script, a commit hook or CI. No server is needed and it runs the copy bundled with the CLI, so a git-ignored `.claude/` does not matter. Mark a justified case with `/* ovenn-validate-disable-next-line <rule> */`, or a whole file with `/* ovenn-validate-disable-file <rule> -- <reason> */` (the reason is required). `ovenn info check-hardcoding --file=…` runs the same check; MCP `check_hardcoding` uses the same engine.
133
+
95
134
  ## MCP queries
96
135
 
97
136
  `ovenn info` initializes Streamable HTTP, accepts JSON or SSE responses, preserves session headers and bounds requests with `--timeout=15000`. An unavailable endpoint produces an error; it does not modify the project. No authentication provider is added by the CLI.
@@ -105,7 +144,7 @@ ovenn info check-brand --project=brand-check.json --json
105
144
 
106
145
  A project check JSON contains `{files: {"App.tsx": "source code", "frame.tsx": "source code"}, entryFiles: ["App.tsx"], brandSetId: "core"}`. Diagnostics include file/line/column, severity, rule source and a suggested next step. Supply the root entry and its wrappers/re-exports. Unknown external components and runtime spreads produce explicit limitations; valid does not mean complete. This is a structure check, not visual brand certification. Existing Ovenn validators remain responsible for token/hardcoding rules.
107
146
 
108
- 설치 진단은 `ovenn info doctor --json`, 변경 미리보기는 `ovenn update --dry --json`, 로컬 수정 보존은 `--keep-local`을 사용합니다. 백업 ID로 `--rollback=ID`, 중간 종료는 `--recover=ID`를 실행합니다. 실제 모델 성능 평가는 저장소 `evals/p4/README.md`에서 별도로 추적합니다.
147
+ 업데이트는 `npx @conscience-technology/ovenn@latest update`로 최신 CLI를 지정해 실행합니다. 기존 설치에서 `init`을 다시 실행해도 update로 처리되며, 구 `@conscience-technology/ctds` 설치도 같은 명령으로 Ovenn에 이전됩니다. 설치 진단은 `ovenn info doctor --json`, 변경 미리보기는 `ovenn update --dry --json`, 로컬 수정 보존은 `--keep-local`을 사용합니다. 백업 ID로 `--rollback=ID`, 중간 종료는 `--recover=ID`를 실행합니다. 실제 모델 성능 평가는 저장소 `evals/p4/README.md`에서 별도로 추적합니다.
109
148
 
110
149
  ## Local development (contributors)
111
150
 
@@ -18,6 +18,11 @@
18
18
  margin-bottom: var(--space-1);
19
19
  }
20
20
 
21
+ .before {
22
+ width: 100%;
23
+ min-width: 0;
24
+ }
25
+
21
26
  .body {
22
27
  color: var(--fg);
23
28
  font-size: var(--text-base);
@@ -103,6 +108,11 @@
103
108
  .body > :global(p) {
104
109
  margin: 0;
105
110
  }
111
+ .body :global(a) {
112
+ color: var(--primary);
113
+ text-decoration: underline;
114
+ overflow-wrap: anywhere;
115
+ }
106
116
  /* 블록 요소 (CodeBlock·MessageQuote·MessageSources·MessageTable wrapper) — 섹션 분리감 */
107
117
  .body > :global(div),
108
118
  .body > :global(blockquote) {
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { useEffect, useState, type HTMLAttributes, type ReactNode } from "react";
3
+ import { useEffect, useState, type HTMLAttributes, type MouseEvent, type ReactNode } from "react";
4
4
  import {
5
5
  MessageActions,
6
6
  type MessageAction,
@@ -19,6 +19,8 @@ export interface AIMessageProps extends HTMLAttributes<HTMLDivElement> {
19
19
  children: ReactNode;
20
20
  /** 메시지 위 작은 라벨 ("LongText", "Code Block" 등). 없으면 숨김. */
21
21
  label?: ReactNode;
22
+ /** 본문 위에 표시하는 작업 요약 등 부가 콘텐츠. */
23
+ before?: ReactNode;
22
24
  /** 액션 노출. 기본 hover. */
23
25
  actionsVisibility?: AIMessageActionsVisibility;
24
26
  /** 액션 커스터마이즈. 기본 [copy, regenerate]. 비우려면 []. */
@@ -26,7 +28,7 @@ export interface AIMessageProps extends HTMLAttributes<HTMLDivElement> {
26
28
  /** 소스 목록 — 액션바 옆에 inline chip으로 노출. */
27
29
  sources?: MessageSource[];
28
30
  /** sources chip 클릭 시 (popover 열기 등). */
29
- onSourcesClick?: () => void;
31
+ onSourcesClick?: (event: MouseEvent<HTMLButtonElement>) => void;
30
32
  /** 생성 중이면 액션 숨김. */
31
33
  isGenerating?: boolean;
32
34
  /** 본문 수신 중. children에 누적 본문을 전달하며 액션은 완료 후 표시. */
@@ -77,6 +79,7 @@ function MessageText({ text, streaming }: { text: string; streaming: boolean })
77
79
  export function AIMessage({
78
80
  children,
79
81
  label,
82
+ before,
80
83
  actionsVisibility = "hover",
81
84
  actions = DEFAULT_ACTIONS,
82
85
  sources,
@@ -101,6 +104,7 @@ export function AIMessage({
101
104
  {...rest}
102
105
  >
103
106
  {label ? <div className={styles.label}>{label}</div> : null}
107
+ {before != null ? <div className={styles.before}>{before}</div> : null}
104
108
  <div className={styles.body} data-ai-message-body>
105
109
  {isGenerating && !isStreaming ? (
106
110
  <>
@@ -1,4 +1,5 @@
1
1
  "use client";
2
+ // ovenn-validate-disable-file hardcoded/hex-color -- image placeholder light/dark colour pair, the same asset-colour pattern as the FileIcon generic group
2
3
 
3
4
  import type { CSSProperties, HTMLAttributes, MouseEvent } from "react";
4
5
  import { ImageSquare as PhImageSquare, X as PhX } from "@phosphor-icons/react";
@@ -10,13 +10,31 @@
10
10
  */
11
11
 
12
12
  .root {
13
+ --breadcrumb-height: var(--control-h-xs);
14
+ --breadcrumb-font-size: var(--label-sm-size);
15
+ --breadcrumb-line-height: var(--label-sm-line-height);
16
+ --breadcrumb-icon-size: var(--size-3);
17
+ --breadcrumb-caret-size: var(--size-3);
18
+ --breadcrumb-gap: var(--space-0_5);
19
+ --breadcrumb-slot-gap: var(--space-1);
20
+ --breadcrumb-padding: var(--space-1);
13
21
  min-width: 0;
14
22
  }
23
+ .root[data-size="lg"] {
24
+ --breadcrumb-height: var(--control-h-sm);
25
+ --breadcrumb-font-size: var(--label-md-size);
26
+ --breadcrumb-line-height: var(--label-md-line-height);
27
+ --breadcrumb-icon-size: var(--size-4);
28
+ --breadcrumb-caret-size: calc(var(--size-3) + var(--size-0-5));
29
+ --breadcrumb-gap: var(--space-1_5);
30
+ --breadcrumb-slot-gap: var(--space-1_5);
31
+ --breadcrumb-padding: var(--space-1_5);
32
+ }
15
33
 
16
34
  .list {
17
35
  display: inline-flex;
18
36
  align-items: center;
19
- gap: var(--space-0_5);
37
+ gap: var(--breadcrumb-gap, var(--space-0_5));
20
38
  margin: 0;
21
39
  padding: 0;
22
40
  list-style: none;
@@ -48,15 +66,15 @@
48
66
  display: inline-flex;
49
67
  align-items: center;
50
68
  justify-content: center;
51
- gap: var(--space-1);
52
- height: var(--control-h-xs);
53
- padding-inline: var(--space-1);
69
+ gap: var(--breadcrumb-slot-gap, var(--space-1));
70
+ height: var(--breadcrumb-height, var(--control-h-xs));
71
+ padding-inline: var(--breadcrumb-padding, var(--space-1));
54
72
  corner-shape: var(--corner-shape);
55
73
  border-radius: var(--radius-xs);
56
74
  font-family: var(--label-font);
57
75
  font-weight: var(--font-weight-regular);
58
- font-size: var(--label-sm-size);
59
- line-height: var(--label-sm-line-height);
76
+ font-size: var(--breadcrumb-font-size, var(--label-sm-size));
77
+ line-height: var(--breadcrumb-line-height, var(--label-sm-line-height));
60
78
  letter-spacing: var(--label-tracking);
61
79
  color: var(--fg-muted);
62
80
  background: transparent;
@@ -87,7 +105,7 @@
87
105
 
88
106
  /* Icon-only 변형 — children 없이 leftIcon만 있을 때. 정사각 hit box. */
89
107
  .linkIconOnly {
90
- width: var(--control-h-xs);
108
+ width: var(--breadcrumb-height, var(--control-h-xs));
91
109
  padding-inline: 0;
92
110
  gap: 0;
93
111
  }
@@ -96,13 +114,15 @@
96
114
  .current {
97
115
  display: inline-flex;
98
116
  align-items: center;
99
- gap: var(--space-1);
100
- height: var(--control-h-xs);
101
- padding-inline: var(--space-1);
117
+ justify-content: center;
118
+ gap: var(--breadcrumb-slot-gap, var(--space-1));
119
+ height: var(--breadcrumb-height, var(--control-h-xs));
120
+ border: 1px solid transparent;
121
+ padding-inline: var(--breadcrumb-padding, var(--space-1));
102
122
  font-family: var(--label-font);
103
123
  font-weight: var(--font-weight-regular);
104
- font-size: var(--label-sm-size);
105
- line-height: var(--label-sm-line-height);
124
+ font-size: var(--breadcrumb-font-size, var(--label-sm-size));
125
+ line-height: var(--breadcrumb-line-height, var(--label-sm-line-height));
106
126
  letter-spacing: var(--label-tracking);
107
127
  color: var(--fg-strong);
108
128
  min-width: 0;
@@ -136,8 +156,8 @@
136
156
  display: inline-flex;
137
157
  align-items: center;
138
158
  justify-content: center;
139
- height: var(--control-h-xs);
140
- padding-inline: var(--space-1);
159
+ height: var(--breadcrumb-height, var(--control-h-xs));
160
+ padding-inline: var(--breadcrumb-padding, var(--space-1));
141
161
  border: 1px solid transparent;
142
162
  corner-shape: var(--corner-shape);
143
163
  border-radius: var(--radius-xs);
@@ -145,8 +165,8 @@
145
165
  color: var(--fg-muted);
146
166
  font-family: var(--label-font);
147
167
  font-weight: var(--font-weight-regular);
148
- font-size: var(--label-sm-size);
149
- line-height: var(--label-sm-line-height);
168
+ font-size: var(--breadcrumb-font-size, var(--label-sm-size));
169
+ line-height: var(--breadcrumb-line-height, var(--label-sm-line-height));
150
170
  letter-spacing: var(--label-tracking);
151
171
  cursor: pointer;
152
172
  user-select: none;
@@ -168,15 +188,15 @@
168
188
  color: var(--fg);
169
189
  }
170
190
 
171
- /* Menu trigger ─── segment 자체가 트리거. Link와 같은 xs · ghost 스펙 + ▾ caret.
191
+ /* Menu trigger ─── segment 자체가 트리거. Link와 같은 xs · ghost 스펙 + 상하 caret.
172
192
  active=true일 때는 Current와 같은 톤(--fg-strong) + hover는 그대로 유지. */
173
193
  .menuTrigger {
174
194
  display: inline-flex;
175
195
  align-items: center;
176
196
  justify-content: center;
177
- gap: var(--space-1);
178
- height: var(--control-h-xs);
179
- padding-inline: var(--space-1);
197
+ gap: var(--breadcrumb-slot-gap, var(--space-1));
198
+ height: var(--breadcrumb-height, var(--control-h-xs));
199
+ padding-inline: var(--breadcrumb-padding, var(--space-1));
180
200
  border: 1px solid transparent;
181
201
  corner-shape: var(--corner-shape);
182
202
  border-radius: var(--radius-xs);
@@ -184,8 +204,8 @@
184
204
  color: var(--fg-muted);
185
205
  font-family: var(--label-font);
186
206
  font-weight: var(--font-weight-regular);
187
- font-size: var(--label-sm-size);
188
- line-height: var(--label-sm-line-height);
207
+ font-size: var(--breadcrumb-font-size, var(--label-sm-size));
208
+ line-height: var(--breadcrumb-line-height, var(--label-sm-line-height));
189
209
  letter-spacing: var(--label-tracking);
190
210
  cursor: pointer;
191
211
  user-select: none;
@@ -215,7 +235,7 @@
215
235
  opacity: 1;
216
236
  }
217
237
 
218
- /* ▾ caret ─── 트리거 끝에 붙는 작은 꼬리표. Separator처럼 반응 없음. */
238
+ /* 상하 caret ─── 트리거 끝에 붙는 작은 꼬리표. Separator처럼 반응 없음. */
219
239
  .menuCaret {
220
240
  display: inline-flex;
221
241
  align-items: center;
@@ -233,6 +253,45 @@
233
253
  opacity: 0.9;
234
254
  }
235
255
 
256
+ /* Collapse only the decorative caret; the labelled trigger stays available. */
257
+ .menuTrigger[data-caret-visibility="hover"] {
258
+ column-gap: 0;
259
+ }
260
+ .menuTrigger[data-caret-visibility="hover"] > .linkIcon {
261
+ margin-inline-end: var(--breadcrumb-slot-gap, var(--space-1));
262
+ }
263
+ .menuTrigger[data-caret-visibility="hover"] .menuCaret {
264
+ width: 0;
265
+ margin-inline-start: 0;
266
+ overflow: hidden;
267
+ opacity: 0;
268
+ pointer-events: none;
269
+ transition:
270
+ width var(--duration-base) var(--ease-out),
271
+ margin-inline-start var(--duration-base) var(--ease-out),
272
+ opacity var(--duration-base) var(--ease-out);
273
+ }
274
+ .menuTrigger[data-caret-visibility="hover"] .menuCaret > svg {
275
+ flex-shrink: 0;
276
+ }
277
+ .menuTrigger[data-caret-visibility="hover"]:is(:hover, :focus-visible, [data-state="open"]) .menuCaret {
278
+ width: var(--breadcrumb-caret-size, var(--size-3));
279
+ margin-inline-start: var(--breadcrumb-slot-gap, var(--space-1));
280
+ opacity: 0.9;
281
+ }
282
+ @media (hover: none), (pointer: coarse) {
283
+ .menuTrigger[data-caret-visibility="hover"] .menuCaret {
284
+ width: var(--breadcrumb-caret-size, var(--size-3));
285
+ margin-inline-start: var(--breadcrumb-slot-gap, var(--space-1));
286
+ opacity: 0.5;
287
+ }
288
+ }
289
+ @media (prefers-reduced-motion: reduce) {
290
+ .menuTrigger[data-caret-visibility="hover"] .menuCaret {
291
+ transition: none;
292
+ }
293
+ }
294
+
236
295
  /* Popover surface ─── Select · ContextMenu와 동일한 팝오버 표면.
237
296
  ContextMenu.module.css의 .surface를 composes해 시각 규칙 원본을 재사용. */
238
297
  .popoverContent {
@@ -4,6 +4,8 @@ import {
4
4
  Children,
5
5
  Fragment,
6
6
  cloneElement,
7
+ createContext,
8
+ useContext,
7
9
  forwardRef,
8
10
  isValidElement,
9
11
  type AnchorHTMLAttributes,
@@ -19,8 +21,11 @@ import { Icon, IconAxisProvider, useIconAxis } from "../Icon";
19
21
  import { MenuItem } from "../MenuItem";
20
22
  import styles from "./Breadcrumb.module.css";
21
23
 
22
- /** 트리거 내부 아이콘 렌더 사이즈 — Button xs와 동일한 12px. */
23
- const ICON_SIZE = 12;
24
+ /** 루트 크기를 상속하며 단독 사용 시 기존 크기로 fallback. */
25
+ const ICON_SIZE = "var(--breadcrumb-icon-size, var(--size-3))";
26
+
27
+ export type BreadcrumbSize = "md" | "lg";
28
+ const BreadcrumbSizeContext = createContext<BreadcrumbSize>("md");
24
29
 
25
30
  function sizedIcon(node: ReactNode): ReactNode {
26
31
  if (!isValidElement(node)) return node;
@@ -34,6 +39,8 @@ function sizedIcon(node: ReactNode): ReactNode {
34
39
  // ────────────────────────────────────────────────────────────
35
40
 
36
41
  export interface BreadcrumbProps extends Omit<HTMLAttributes<HTMLElement>, "children"> {
42
+ /** md는 기존 크기, lg는 아이콘·간격을 넓힌 큰 크기. */
43
+ size?: BreadcrumbSize;
37
44
  /** 스크린리더용 라벨. 기본 "Breadcrumb". */
38
45
  "aria-label"?: string;
39
46
  /** 항목 사이 구분자. 기본은 caret-right 아이콘. */
@@ -42,30 +49,37 @@ export interface BreadcrumbProps extends Omit<HTMLAttributes<HTMLElement>, "chil
42
49
  }
43
50
 
44
51
  const Root = forwardRef<HTMLElement, BreadcrumbProps>(
45
- ({ className, separator, children, "aria-label": ariaLabel = "Breadcrumb", ...rest }, ref) => {
46
- const sep = separator ?? <Icon name="caret-right" size={12} />;
52
+ ({ className, size = "md", separator, children, "aria-label": ariaLabel = "Breadcrumb", ...rest }, ref) => {
53
+ const sep = separator === "/" ? (
54
+ <svg width={ICON_SIZE} height={ICON_SIZE} viewBox="0 0 256 256" fill="none" aria-hidden="true">
55
+ <path d="M160 40 96 216" stroke="currentColor" strokeWidth={16} strokeLinecap="round" />
56
+ </svg>
57
+ ) : separator ?? <Icon name="caret-right" size={ICON_SIZE} />;
47
58
  const items = Children.toArray(children).filter(isValidElement);
48
59
 
49
60
  return (
50
- <nav
51
- ref={ref}
52
- aria-label={ariaLabel}
53
- className={[styles.root, className ?? ""].filter(Boolean).join(" ")}
54
- {...rest}
55
- >
56
- <ol className={styles.list}>
57
- {items.map((child, i) => (
58
- <Fragment key={(child as ReactElement).key ?? i}>
59
- <li className={styles.item}>{child}</li>
60
- {i < items.length - 1 && (
61
- <li className={styles.separator} aria-hidden>
62
- {sep}
63
- </li>
64
- )}
65
- </Fragment>
66
- ))}
67
- </ol>
68
- </nav>
61
+ <BreadcrumbSizeContext.Provider value={size}>
62
+ <nav
63
+ ref={ref}
64
+ aria-label={ariaLabel}
65
+ data-size={size}
66
+ className={[styles.root, className ?? ""].filter(Boolean).join(" ")}
67
+ {...rest}
68
+ >
69
+ <ol className={styles.list}>
70
+ {items.map((child, i) => (
71
+ <Fragment key={(child as ReactElement).key ?? i}>
72
+ <li className={styles.item}>{child}</li>
73
+ {i < items.length - 1 && (
74
+ <li className={styles.separator} aria-hidden>
75
+ {sep}
76
+ </li>
77
+ )}
78
+ </Fragment>
79
+ ))}
80
+ </ol>
81
+ </nav>
82
+ </BreadcrumbSizeContext.Provider>
69
83
  );
70
84
  },
71
85
  );
@@ -282,7 +296,7 @@ const Ellipsis = forwardRef<HTMLButtonElement, BreadcrumbEllipsisProps>(
282
296
  Ellipsis.displayName = "Breadcrumb.Ellipsis";
283
297
 
284
298
  // ────────────────────────────────────────────────────────────
285
- // Menu — segment 자체가 트리거. ▾ caret으로 형제 전환 UI 노출.
299
+ // Menu — segment 자체가 트리거. 상하 caret으로 형제 전환 UI 노출.
286
300
  // active=true면 aria-current="page" 유지 (현재 페이지 자리로 쓸 때).
287
301
  // ────────────────────────────────────────────────────────────
288
302
 
@@ -296,12 +310,15 @@ export interface BreadcrumbMenuProps
296
310
  items: BreadcrumbMenuItem[];
297
311
  /** 현재 페이지 자리에 쓸 때 true. aria-current="page" + fg-strong 톤. */
298
312
  active?: boolean;
313
+ /** 메뉴 화살표 표시 방식. hover는 포커스·열림·터치에서도 표시. */
314
+ caretVisibility?: "always" | "hover";
299
315
  /** 팝오버 side offset (px). 기본 6. */
300
316
  sideOffset?: number;
301
317
  }
302
318
 
303
319
  const Menu = forwardRef<HTMLButtonElement, BreadcrumbMenuProps>(
304
- ({ className, children, leftIcon, items, active = false, sideOffset = 6, ...rest }, ref) => {
320
+ ({ className, children, leftIcon, items, active = false, caretVisibility = "always", sideOffset = 6, ...rest }, ref) => {
321
+ const size = useContext(BreadcrumbSizeContext);
305
322
  const cls = [styles.menuTrigger, active ? styles.menuTriggerActive : "", className ?? ""]
306
323
  .filter(Boolean)
307
324
  .join(" ");
@@ -314,6 +331,7 @@ const Menu = forwardRef<HTMLButtonElement, BreadcrumbMenuProps>(
314
331
  aria-current={active ? "page" : undefined}
315
332
  aria-haspopup="menu"
316
333
  className={cls}
334
+ data-caret-visibility={caretVisibility}
317
335
  {...rest}
318
336
  >
319
337
  {leftIcon && (
@@ -323,7 +341,7 @@ const Menu = forwardRef<HTMLButtonElement, BreadcrumbMenuProps>(
323
341
  )}
324
342
  <span className={styles.linkLabel}>{children}</span>
325
343
  <span className={styles.menuCaret} aria-hidden>
326
- <Icon name="caret-down" size={ICON_SIZE} />
344
+ <Icon name={size === "lg" ? "caret-up-down" : "caret-down"} size="var(--breadcrumb-caret-size, var(--size-3))" />
327
345
  </span>
328
346
  </button>
329
347
  </RPopover.Trigger>
@@ -1,6 +1,7 @@
1
1
  export { Breadcrumb } from "./Breadcrumb";
2
2
  export type {
3
3
  BreadcrumbProps,
4
+ BreadcrumbSize,
4
5
  BreadcrumbLinkProps,
5
6
  BreadcrumbCurrentProps,
6
7
  BreadcrumbEllipsisProps,
@@ -293,16 +293,14 @@
293
293
  --button-fg: var(--fg-muted);
294
294
  --button-border: var(--border);
295
295
  }
296
- /* Paint the thin outline outside the shared control box. The 1px native border
297
- stays transparent for layout; padding-box inset -2 hairlines extends the
298
- visible contour by one hairline without changing heights or icon-only squares. */
296
+ /* Match the button's outer edge by offsetting the padding box by its transparent border. */
299
297
  .outline {
300
298
  border-color: transparent;
301
299
  }
302
300
  .outline:not([data-slot="control-group"][data-composition="buttons"] > *)::before {
303
301
  content: "";
304
302
  position: absolute;
305
- inset: calc(var(--hairline) * -2);
303
+ inset: calc(var(--hairline) * -1);
306
304
  box-sizing: border-box;
307
305
  border: var(--hairline) solid var(--button-border);
308
306
  corner-shape: inherit;
@@ -4,39 +4,60 @@
4
4
  패딩·gap은 사진의 밸런스를 재현 — 아이콘 좌우 gap은 타이틀 line-height 보정으로
5
5
  space-3, 헤더-본문-액션은 space-3 리듬. */
6
6
  .root {
7
- /* 광색역 배경이 sRGB 범위를 넘을 때 글래스 합성 색의 왜곡을 방지한다. */
8
- --callout-material-bg: rgb(from var(--material-floating-bg) clamp(0, r, 255) clamp(0, g, 255) clamp(0, b, 255) / alpha); /* lint-hardcoded: ignore — 기존 Material 색의 채널 범위만 정규화하는 로컬 토큰 정의 */
7
+ --callout-padding: var(--space-4);
8
+ --callout-row-gap: var(--space-1_5);
9
+ --callout-item-gap: var(--space-2);
10
+ --callout-text-gap: var(--space-1);
11
+ --callout-inline-padding-block: var(--space-3);
12
+ --callout-inline-action-inset: var(--space-2);
9
13
  display: flex;
10
14
  flex-direction: column;
11
- gap: var(--space-1_5);
12
- padding: var(--space-4);
15
+ gap: var(--callout-row-gap);
16
+ padding: var(--callout-padding);
13
17
  corner-shape: var(--card-corner-shape);
14
18
  border-radius: var(--radius-md);
15
19
  color: var(--fg);
16
- border: 1px solid var(--material-border, transparent);
17
- backdrop-filter: var(--material-floating-filter, none);
20
+ border: 1px solid transparent;
18
21
  font-family: var(--font-sans);
19
22
  }
20
23
 
24
+ .root[data-size="sm"] {
25
+ --callout-padding: var(--space-3);
26
+ --callout-row-gap: var(--space-1);
27
+ --callout-item-gap: var(--space-1_5);
28
+ --callout-text-gap: var(--space-0_5);
29
+ --callout-inline-padding-block: var(--space-2);
30
+ --callout-inline-action-inset: var(--space-1_5);
31
+ }
32
+
21
33
  /* Variants
22
34
  fill: tone subtle 표면 (8% 알파).
23
- outline: 표면 투명 + tone border (32% 알파).
35
+ outline: 표면 투명 + tone 경계.
36
+ outline-tint: 같은 경계 + fill의 절반 농도.
24
37
  tone별로 --callout-subtle / --callout-border를 스왑해서 재사용. */
25
38
  .fill {
26
- background: var(--callout-material-bg, var(--callout-subtle));
39
+ background: var(--callout-subtle);
40
+ }
41
+ .outline,
42
+ .outlineTint {
43
+ border-color: var(--callout-border);
27
44
  }
28
45
  .outline {
29
- background: var(--callout-material-bg, transparent);
30
- border-color: var(--material-border, var(--callout-border));
46
+ background: transparent;
31
47
  box-shadow: var(--shadow-sm);
32
48
  }
49
+ .outlineTint {
50
+ --callout-outline-tint: color-mix(in oklab, var(--callout-subtle) 50%, transparent);
51
+ background: var(--callout-outline-tint);
52
+ background-clip: padding-box;
53
+ }
33
54
 
34
55
  /* Head: icon | title | dismiss ─────────────────────────────── */
35
56
  /* 아이콘은 타이틀 line-height와 같은 높이 박스로 잡아 첫 줄 baseline과 맞춤 */
36
57
  .head {
37
58
  display: flex;
38
59
  align-items: flex-start;
39
- gap: var(--space-2);
60
+ gap: var(--callout-item-gap);
40
61
  }
41
62
  .icon {
42
63
  display: inline-flex;
@@ -67,6 +88,7 @@
67
88
 
68
89
  /* 버튼 영역과 글리프 크기는 독립적이다. 안내 아이콘은 유지하고 X만 중간 크기로 맞춘다. */
69
90
  .root .dismiss > svg {
91
+ color: color-mix(in oklab, var(--fg-muted), var(--fg-subtle));
70
92
  width: var(--icon-size-sm);
71
93
  height: var(--icon-size-sm);
72
94
  }
@@ -79,7 +101,7 @@
79
101
  }
80
102
  /* title-body는 같은 텍스트 블록으로 묶여 보이도록 gap을 좁힘 (한 단계 축소). */
81
103
  .head + .body {
82
- margin-top: calc(var(--space-1) - var(--space-1_5));
104
+ margin-top: calc(var(--callout-text-gap) - var(--callout-row-gap));
83
105
  }
84
106
 
85
107
  /* Actions ─────────────────────────────────────────────────── */
@@ -95,7 +117,7 @@
95
117
  .actionsRight {
96
118
  display: grid;
97
119
  grid-template-columns: 1fr auto;
98
- gap: var(--space-1_5) var(--space-4);
120
+ gap: var(--callout-row-gap) var(--callout-padding);
99
121
  }
100
122
  .actionsRight .head {
101
123
  /* 좌측 박스 head: icon + title만. dismiss는 우측 사이드로 분리되므로 head 자체는 아이콘·타이틀만 담는다. */
@@ -104,7 +126,7 @@
104
126
  display: flex;
105
127
  flex-direction: column;
106
128
  align-items: flex-end;
107
- gap: var(--space-2);
129
+ gap: var(--callout-item-gap);
108
130
  grid-row: 1 / span 2;
109
131
  grid-column: 2;
110
132
  }
@@ -161,9 +183,13 @@
161
183
  flex-direction: row;
162
184
  align-items: center;
163
185
  flex-wrap: wrap;
164
- gap: var(--space-2);
165
- padding: var(--space-3) var(--space-4);
186
+ gap: var(--callout-item-gap);
187
+ padding: var(--callout-inline-padding-block) var(--callout-padding);
188
+ }
189
+ .inline > .icon {
190
+ align-self: flex-start;
166
191
  }
192
+
167
193
  .message {
168
194
  flex: 1;
169
195
  min-width: 0;
@@ -174,19 +200,19 @@
174
200
  .message .title,
175
201
  .message .body {
176
202
  display: inline;
203
+ line-height: inherit;
177
204
  }
178
205
  .message > .body:only-child {
179
206
  color: var(--fg);
180
207
  }
181
208
  .message .title + .body::before {
182
209
  content: " ";
183
- white-space: pre-wrap;
184
210
  }
185
211
  .inline > .actions {
186
212
  max-width: 100%;
187
213
  /* 컨트롤이 기존 세로 패딩을 사용하도록 해 한 줄 높이를 늘리지 않는다.
188
214
  xs/sm 액션 및 md 컨트롤까지 본문 행의 중심에 배치한다. */
189
- margin-block: calc(var(--space-2) * -1);
215
+ margin-block: calc(var(--callout-inline-action-inset) * -1);
190
216
  }
191
217
  .inline > .actions > .dismiss {
192
218
  margin-block: 0;