@conscience-technology/ovenn 0.6.7 → 0.7.0

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 (320) hide show
  1. package/assets/components/AIMessage/AIMessage.module.css +2 -1
  2. package/assets/components/Accordion/Accordion.module.css +3 -0
  3. package/assets/components/AppFrame/AppFrame.module.css +2 -0
  4. package/assets/components/AttachmentItem/AttachmentItem.module.css +9 -3
  5. package/assets/components/AttachmentThumb/AttachmentThumb.module.css +4 -0
  6. package/assets/components/Avatar/Avatar.module.css +26 -11
  7. package/assets/components/Avatar/Avatar.tsx +1 -1
  8. package/assets/components/AvatarUpload/AvatarUpload.module.css +4 -3
  9. package/assets/components/Badge/Badge.module.css +96 -70
  10. package/assets/components/Badge/Badge.tsx +33 -25
  11. package/assets/components/Breadcrumb/Breadcrumb.module.css +8 -4
  12. package/assets/components/Breadcrumb/Breadcrumb.tsx +1 -1
  13. package/assets/components/Bubble/Bubble.module.css +6 -0
  14. package/assets/components/Button/Button.module.css +6 -0
  15. package/assets/components/Calendar/Calendar.module.css +244 -0
  16. package/assets/components/Calendar/Calendar.tsx +419 -0
  17. package/assets/components/Calendar/index.ts +2 -0
  18. package/assets/components/Callout/Callout.module.css +1 -0
  19. package/assets/components/Canvas/Canvas.module.css +75 -0
  20. package/assets/components/Canvas/Canvas.tsx +699 -0
  21. package/assets/components/Canvas/alignment.ts +34 -0
  22. package/assets/components/Canvas/clipboard.ts +30 -0
  23. package/assets/components/Canvas/collision.ts +67 -0
  24. package/assets/components/Canvas/edgeOptions.ts +11 -0
  25. package/assets/components/Canvas/graph.ts +11 -0
  26. package/assets/components/Canvas/history.ts +41 -0
  27. package/assets/components/Canvas/index.ts +4 -0
  28. package/assets/components/Canvas/selection.ts +56 -0
  29. package/assets/components/Canvas/tokens.css +61 -0
  30. package/assets/components/Canvas/types.ts +27 -0
  31. package/assets/components/Canvas/useCanvasSettlement.ts +79 -0
  32. package/assets/components/CanvasEdge/CanvasEdge.module.css +62 -0
  33. package/assets/components/CanvasEdge/CanvasEdge.tsx +121 -0
  34. package/assets/components/CanvasEdge/geometry.ts +350 -0
  35. package/assets/components/CanvasEdge/index.ts +4 -0
  36. package/assets/components/CanvasEdge/interactions.ts +14 -0
  37. package/assets/components/CanvasEdge/tokens.css +29 -0
  38. package/assets/components/CanvasNode/CanvasNode.module.css +234 -30
  39. package/assets/components/CanvasNode/CanvasNode.tsx +95 -28
  40. package/assets/components/CanvasNode/index.ts +1 -1
  41. package/assets/components/CanvasNode/runningOutline.ts +59 -0
  42. package/assets/components/CanvasNode/tokens.css +76 -13
  43. package/assets/components/Card/Card.module.css +5 -0
  44. package/assets/components/Chart/Chart.module.css +278 -0
  45. package/assets/components/Chart/Chart.tsx +385 -0
  46. package/assets/components/Chart/entrance.tsx +57 -0
  47. package/assets/components/Chart/index.ts +14 -0
  48. package/assets/components/ChatInput/ChatInput.module.css +5 -0
  49. package/assets/components/Checkbox/Checkbox.module.css +39 -0
  50. package/assets/components/Checkbox/Checkbox.tsx +99 -14
  51. package/assets/components/Checkbox/index.ts +1 -1
  52. package/assets/components/CheckboxCard/CheckboxCard.module.css +1 -177
  53. package/assets/components/CheckboxCard/CheckboxCard.tsx +6 -72
  54. package/assets/components/Chip/Chip.module.css +20 -30
  55. package/assets/components/Code/Code.module.css +1 -0
  56. package/assets/components/CodeBlock/CodeBlock.module.css +7 -3
  57. package/assets/components/ColorArea/ColorArea.module.css +3 -0
  58. package/assets/components/ColorField/ColorField.module.css +6 -0
  59. package/assets/components/ColorField/ColorField.tsx +3 -1
  60. package/assets/components/ColorPicker/ColorPicker.module.css +310 -0
  61. package/assets/components/ColorPicker/ColorPicker.tsx +387 -0
  62. package/assets/components/ColorPicker/index.ts +16 -0
  63. package/assets/components/ColorSlider/ColorSlider.module.css +15 -12
  64. package/assets/components/ColorSlider/ColorSlider.tsx +3 -3
  65. package/assets/components/ColorSwatch/ColorSwatch.module.css +2 -2
  66. package/assets/components/ColorSwatchPicker/ColorSwatchPicker.module.css +4 -3
  67. package/assets/components/Combobox/Combobox.module.css +1 -1
  68. package/assets/components/Combobox/Combobox.tsx +1 -1
  69. package/assets/components/CommandPalette/CommandPalette.module.css +18 -23
  70. package/assets/components/CommandPalette/CommandPalette.tsx +7 -5
  71. package/assets/components/Comment/Comment.module.css +25 -0
  72. package/assets/components/Comment/Comment.tsx +44 -0
  73. package/assets/components/Comment/CommentComposer.module.css +26 -0
  74. package/assets/components/Comment/CommentComposer.tsx +56 -0
  75. package/assets/components/Comment/CommentEditor.module.css +8 -0
  76. package/assets/components/Comment/CommentEditor.tsx +43 -0
  77. package/assets/components/Comment/CommentMentionInput.module.css +9 -0
  78. package/assets/components/Comment/CommentMentionInput.tsx +150 -0
  79. package/assets/components/Comment/index.ts +9 -0
  80. package/assets/components/Comment/types.ts +1 -0
  81. package/assets/components/ContextMenu/ContextMenu.module.css +5 -2
  82. package/assets/components/ContextMenu/ContextMenu.tsx +5 -0
  83. package/assets/components/ControlGroup/ControlGroup.module.css +7 -1
  84. package/assets/components/DataTable/DataTable.module.css +2 -0
  85. package/assets/components/DatePicker/DatePicker.module.css +36 -3
  86. package/assets/components/DatePicker/DatePicker.tsx +11 -1
  87. package/assets/components/DatePicker/TimeSelector.tsx +1 -1
  88. package/assets/components/Disclosure/Disclosure.module.css +1 -0
  89. package/assets/components/Drawer/Drawer.module.css +11 -4
  90. package/assets/components/Drawer/Drawer.tsx +5 -1
  91. package/assets/components/DropdownMenu/DropdownMenu.tsx +5 -0
  92. package/assets/components/EventChip/EventChip.module.css +120 -53
  93. package/assets/components/EventChip/EventChip.tsx +54 -6
  94. package/assets/components/EventChip/index.ts +1 -1
  95. package/assets/components/EventListItem/EventListItem.module.css +3 -0
  96. package/assets/components/EventListItem/EventListItem.tsx +15 -8
  97. package/assets/components/FileIcon/FileIcon.module.css +2 -0
  98. package/assets/components/FileUpload/FileUpload.module.css +10 -3
  99. package/assets/components/FileUpload/FileUpload.tsx +5 -9
  100. package/assets/components/FileUpload/FileUploadItem.tsx +34 -0
  101. package/assets/components/GalleryItem/GalleryItem.module.css +16 -19
  102. package/assets/components/GeneratedImage/GeneratedImage.module.css +2 -0
  103. package/assets/components/Icon/Icon.tsx +264 -1088
  104. package/assets/components/Icon/LucideFamilyIcon.tsx +434 -0
  105. package/assets/components/Icon/MissingIcon.tsx +25 -0
  106. package/assets/components/Icon/SolarFamilyIcon.tsx +439 -0
  107. package/assets/components/Icon/catalogNames.ts +8 -0
  108. package/assets/components/Icon/context.tsx +1 -1
  109. package/assets/components/Icon/index.ts +2 -0
  110. package/assets/components/Icon/lucideCatalog.ts +11358 -0
  111. package/assets/components/Icon/phosphorCatalog.ts +3052 -0
  112. package/assets/components/Icon/solarCatalog.ts +16064 -0
  113. package/assets/components/IconButton/IconButton.module.css +3 -2
  114. package/assets/components/Input/Input.module.css +30 -12
  115. package/assets/components/Input/Input.tsx +1 -1
  116. package/assets/components/Kanban/Kanban.module.css +6 -0
  117. package/assets/components/ListItem/ListItem.module.css +9 -6
  118. package/assets/components/MenuItem/MenuItem.module.css +24 -22
  119. package/assets/components/MenuItem/MenuItem.tsx +12 -12
  120. package/assets/components/MessageActions/MessageActions.module.css +36 -0
  121. package/assets/components/MessageActions/MessageActions.tsx +53 -28
  122. package/assets/components/MessageQuote/MessageQuote.module.css +1 -0
  123. package/assets/components/MessageSources/MessageSources.module.css +2 -0
  124. package/assets/components/MessageState/MessageState.module.css +1 -1
  125. package/assets/components/MetricCard/MetricCard.module.css +96 -108
  126. package/assets/components/MetricCard/MetricCard.tsx +45 -23
  127. package/assets/components/MetricCard/tokens.css +10 -0
  128. package/assets/components/MiniCalendar/MiniCalendar.module.css +130 -0
  129. package/assets/components/MiniCalendar/MiniCalendar.tsx +161 -0
  130. package/assets/components/MiniCalendar/index.ts +2 -0
  131. package/assets/components/Modal/Modal.module.css +13 -4
  132. package/assets/components/Modal/Modal.tsx +4 -0
  133. package/assets/components/Onboarding/LayoutBuilder.tsx +12 -50
  134. package/assets/components/Onboarding/Onboarding.module.css +211 -278
  135. package/assets/components/Onboarding/OnboardingAxisPanel.tsx +81 -125
  136. package/assets/components/Onboarding/OnboardingPage.tsx +244 -467
  137. package/assets/components/Onboarding/actions.ts +5 -0
  138. package/assets/components/Onboarding/palette.css +8 -0
  139. package/assets/components/Onboarding/wizardData.ts +8 -8
  140. package/assets/components/ProgressBar/ProgressBar.module.css +8 -8
  141. package/assets/components/ProgressBar/ProgressBar.tsx +0 -5
  142. package/assets/components/ProgressBar/index.ts +0 -1
  143. package/assets/components/QuotationBar/QuotationBar.module.css +2 -0
  144. package/assets/components/Radio/Radio.module.css +2 -0
  145. package/assets/components/RadioCard/RadioCard.module.css +78 -3
  146. package/assets/components/RadioCard/RadioCard.tsx +34 -12
  147. package/assets/components/RadioCard/index.ts +1 -1
  148. package/assets/components/SegmentedChart/SegmentedChart.module.css +16 -0
  149. package/assets/components/SegmentedChart/SegmentedChart.tsx +25 -8
  150. package/assets/components/Select/Select.tsx +7 -4
  151. package/assets/components/Shortcut/Shortcut.module.css +2 -0
  152. package/assets/components/Sidebar/Sidebar.module.css +1 -0
  153. package/assets/components/Sidebar/Sidebar.tsx +2 -2
  154. package/assets/components/Skeleton/Skeleton.module.css +33 -0
  155. package/assets/components/Skeleton/Skeleton.tsx +20 -0
  156. package/assets/components/Skeleton/index.ts +2 -0
  157. package/assets/components/Skeleton/tokens.css +11 -0
  158. package/assets/components/Slider/Slider.module.css +3 -0
  159. package/assets/components/Slider/Slider.tsx +7 -2
  160. package/assets/components/Spinner/LottiePlayer.tsx +4 -4
  161. package/assets/components/Spinner/Spinner.module.css +3 -0
  162. package/assets/components/Spinner/lottieManifest.ts +3 -0
  163. package/assets/components/Stepper/Stepper.module.css +56 -8
  164. package/assets/components/Stepper/Stepper.tsx +13 -4
  165. package/assets/components/Switch/Switch.module.css +55 -42
  166. package/assets/components/Switch/Switch.tsx +6 -2
  167. package/assets/components/Switch/index.ts +1 -1
  168. package/assets/components/TabStrip/TabStrip.module.css +5 -1
  169. package/assets/components/TableCell/TableCell.module.css +8 -1
  170. package/assets/components/TableCell/TableCellBadge.tsx +7 -3
  171. package/assets/components/TableCell/TableCellImage.tsx +1 -1
  172. package/assets/components/TableCell/TableCellTag.tsx +23 -0
  173. package/assets/components/TableCell/index.ts +3 -0
  174. package/assets/components/TableHeader/TableHeader.module.css +4 -0
  175. package/assets/components/TableRow/TableRow.module.css +3 -0
  176. package/assets/components/TableRowEdit/TableRowEdit.module.css +2 -0
  177. package/assets/components/TableToolbar/TableToolbar.module.css +1 -0
  178. package/assets/components/Tabs/Tabs.module.css +22 -7
  179. package/assets/components/Tabs/Tabs.tsx +2 -1
  180. package/assets/components/Tag/Tag.module.css +101 -0
  181. package/assets/components/Tag/Tag.tsx +55 -0
  182. package/assets/components/Tag/index.ts +2 -0
  183. package/assets/components/TemplateBoundary/TemplateBoundary.tsx +22 -18
  184. package/assets/components/TemplateBoundary/types.ts +2 -0
  185. package/assets/components/Textarea/Textarea.module.css +7 -0
  186. package/assets/components/ThemeController.tsx +30 -3
  187. package/assets/components/TimePicker/TimePicker.module.css +1 -0
  188. package/assets/components/TimePicker/TimePicker.tsx +37 -16
  189. package/assets/components/TimelineView/TimelineEventBar.tsx +109 -0
  190. package/assets/components/TimelineView/TimelineView.module.css +203 -0
  191. package/assets/components/TimelineView/TimelineView.tsx +137 -0
  192. package/assets/components/TimelineView/axis.ts +62 -0
  193. package/assets/components/TimelineView/index.ts +3 -0
  194. package/assets/components/TimelineView/layout.ts +56 -0
  195. package/assets/components/TimelineView/move.ts +51 -0
  196. package/assets/components/TimelineView/useTimelineDrag.ts +215 -0
  197. package/assets/components/TimelineView/useTimelineZoom.ts +92 -0
  198. package/assets/components/Toast/Toast.module.css +2 -0
  199. package/assets/components/Toolbar/Toolbar.module.css +31 -24
  200. package/assets/components/Toolbar/Toolbar.tsx +4 -3
  201. package/assets/components/Tooltip/Tooltip.module.css +10 -0
  202. package/assets/components/Tooltip/Tooltip.tsx +17 -8
  203. package/assets/components/TopLoader/TopLoader.module.css +1 -0
  204. package/assets/components/TreeNav/TreeNav.module.css +1 -0
  205. package/assets/components/_color.ts +2 -2
  206. package/assets/components/_data.ts +33 -32
  207. package/assets/components/_utils.css +5 -0
  208. package/assets/components/axisOptions.ts +2 -0
  209. package/assets/components/component-registry.json +151 -2
  210. package/assets/components/index.ts +16 -0
  211. package/assets/components/materialScope.tsx +11 -0
  212. package/assets/components/reset.css +1 -0
  213. package/assets/components/themeBootScript.ts +3 -2
  214. package/assets/components/tokens.css +225 -71
  215. package/assets/components/useChartEntrance.ts +119 -0
  216. package/assets/prompts/ASSEMBLY.md +9 -7
  217. package/assets/prompts/CATALOG.md +18 -4
  218. package/assets/prompts/FEEDBACK_PROCESS.md +19 -0
  219. package/assets/prompts/PRINCIPLES.md +14 -0
  220. package/assets/prompts/WORKFLOW_DESIGN.md +46 -70
  221. package/assets/prompts/axes/font.md +6 -1
  222. package/assets/prompts/axes/icon.md +6 -4
  223. package/assets/prompts/axes/material.md +40 -0
  224. package/assets/prompts/axes/palette.md +2 -1
  225. package/assets/prompts/axes/shape.md +8 -0
  226. package/assets/prompts/components/attachment-item.md +2 -1
  227. package/assets/prompts/components/badge.md +32 -97
  228. package/assets/prompts/components/breadcrumb.md +1 -0
  229. package/assets/prompts/components/calendar.md +151 -0
  230. package/assets/prompts/components/canvas-edge.md +67 -0
  231. package/assets/prompts/components/canvas-node.md +25 -8
  232. package/assets/prompts/components/canvas.md +82 -0
  233. package/assets/prompts/components/card.md +10 -10
  234. package/assets/prompts/components/chart-bar.md +77 -0
  235. package/assets/prompts/components/chart-pie.md +63 -0
  236. package/assets/prompts/components/chart-radar.md +56 -0
  237. package/assets/prompts/components/chart-radial.md +56 -0
  238. package/assets/prompts/components/chart.md +129 -0
  239. package/assets/prompts/components/checkbox-card.md +26 -45
  240. package/assets/prompts/components/checkbox.md +23 -0
  241. package/assets/prompts/components/chip.md +6 -6
  242. package/assets/prompts/components/code-block.md +1 -0
  243. package/assets/prompts/components/color-picker.md +173 -0
  244. package/assets/prompts/components/color-slider.md +7 -7
  245. package/assets/prompts/components/command-palette.md +7 -6
  246. package/assets/prompts/components/comment.md +72 -0
  247. package/assets/prompts/components/context-menu.md +6 -3
  248. package/assets/prompts/components/data-table.md +9 -0
  249. package/assets/prompts/components/date-picker.md +10 -0
  250. package/assets/prompts/components/drawer.md +10 -0
  251. package/assets/prompts/components/dropdown-menu.md +3 -1
  252. package/assets/prompts/components/event-chip.md +60 -18
  253. package/assets/prompts/components/event-list-item.md +14 -10
  254. package/assets/prompts/components/file-upload.md +1 -1
  255. package/assets/prompts/components/gallery-item.md +5 -4
  256. package/assets/prompts/components/icon.md +30 -8
  257. package/assets/prompts/components/kanban.md +1 -1
  258. package/assets/prompts/components/list-item.md +11 -2
  259. package/assets/prompts/components/menu-item.md +8 -3
  260. package/assets/prompts/components/message-actions.md +9 -0
  261. package/assets/prompts/components/metric-card.md +57 -109
  262. package/assets/prompts/components/mini-calendar.md +72 -0
  263. package/assets/prompts/components/modal.md +1 -0
  264. package/assets/prompts/components/onboarding.md +11 -7
  265. package/assets/prompts/components/page-header.md +11 -2
  266. package/assets/prompts/components/progress-bar.md +12 -2
  267. package/assets/prompts/components/radio-card.md +33 -117
  268. package/assets/prompts/components/segmented-chart.md +19 -5
  269. package/assets/prompts/components/select.md +1 -0
  270. package/assets/prompts/components/sidebar.md +12 -3
  271. package/assets/prompts/components/skeleton.md +44 -0
  272. package/assets/prompts/components/stepper.md +15 -1
  273. package/assets/prompts/components/switch.md +15 -10
  274. package/assets/prompts/components/tab-strip.md +1 -0
  275. package/assets/prompts/components/table-cell.md +6 -4
  276. package/assets/prompts/components/table-row.md +12 -3
  277. package/assets/prompts/components/table-toolbar.md +9 -0
  278. package/assets/prompts/components/tabs.md +4 -2
  279. package/assets/prompts/components/tag.md +54 -0
  280. package/assets/prompts/components/time-picker.md +1 -0
  281. package/assets/prompts/components/timeline-view.md +129 -0
  282. package/assets/prompts/components/toast.md +1 -1
  283. package/assets/prompts/components/toolbar.md +17 -4
  284. package/assets/prompts/components/tooltip.md +21 -3
  285. package/assets/prompts/components/top-loader.md +1 -1
  286. package/assets/prompts/components/topbar.md +9 -0
  287. package/assets/prompts/components/tree-nav.md +1 -1
  288. package/assets/prompts/templates/ains.md +2 -1
  289. package/assets/prompts/templates/aurora.md +5 -4
  290. package/assets/prompts/templates/glass-button.md +6 -5
  291. package/assets/prompts/templates/minimal.md +8 -6
  292. package/assets/prompts/templates/workspace.md +3 -3
  293. package/assets/prompts/tokens/color.md +4 -2
  294. package/assets/prompts/tokens/material.md +51 -0
  295. package/assets/prompts/tokens/radius.md +12 -0
  296. package/assets/prompts/tokens/typography.md +24 -2
  297. package/assets/prompts/use-cases/chart-chart-area.md +1334 -0
  298. package/assets/prompts/use-cases/chart-chart-bar.md +1886 -0
  299. package/assets/prompts/use-cases/chart-chart-pie.md +1031 -0
  300. package/assets/prompts/use-cases/chart-chart-radar.md +785 -0
  301. package/assets/prompts/use-cases/chart-chart-radial.md +988 -0
  302. package/assets/prompts/use-cases/chart-segmented-chart.md +262 -0
  303. package/assets/prompts/use-cases/data-comment.md +360 -0
  304. package/assets/prompts/use-cases/data-data-table.md +249 -0
  305. package/assets/prompts/use-cases/data-list-item.md +1056 -0
  306. package/assets/prompts/use-cases/data-metric-card.md +673 -0
  307. package/assets/prompts/use-cases/data-table-row.md +966 -0
  308. package/assets/prompts/use-cases/data-table-toolbar.md +481 -0
  309. package/assets/prompts/use-cases/feedback-drawer.md +1163 -0
  310. package/assets/prompts/use-cases/feedback-progress-bar.md +427 -0
  311. package/assets/prompts/use-cases/general-toolbar.md +854 -0
  312. package/assets/prompts/use-cases/general-tooltip.md +652 -0
  313. package/assets/prompts/use-cases/input-checkbox.md +443 -0
  314. package/assets/prompts/use-cases/structure-card.md +603 -0
  315. package/assets/prompts/use-cases/structure-page-header.md +755 -0
  316. package/assets/prompts/use-cases/structure-sidebar.md +1132 -0
  317. package/assets/prompts/use-cases/structure-topbar.md +1200 -0
  318. package/assets/public/ovenn-wordmark.svg +19 -0
  319. package/package.json +6 -2
  320. package/src/commands/info.js +1 -1
@@ -25,6 +25,7 @@ import type {
25
25
  DensityValue,
26
26
  IconFamily,
27
27
  LangValue,
28
+ MaterialValue,
28
29
  MotionValue,
29
30
  PaletteSet,
30
31
  ShapeValue,
@@ -50,6 +51,7 @@ export type AppliedConfig = {
50
51
  brand: string;
51
52
  paletteSet: PaletteSet;
52
53
  mono: boolean;
54
+ material: MaterialValue;
53
55
  shape: ShapeValue;
54
56
  density: DensityValue;
55
57
  motion: MotionValue;
@@ -150,6 +152,8 @@ export async function applyOnboarding(
150
152
  config: AppliedConfig,
151
153
  options: { overwrite?: boolean; lang?: Lang } = {}
152
154
  ): Promise<ApplyResult> {
155
+ // Older integrations may omit the newly added axis. Persist a valid default.
156
+ config = { ...config, material: config.material === "glass" ? "glass" : "solid" };
153
157
  const lang: Lang = options.lang ?? "ko";
154
158
  const msg = ERROR_MESSAGES[lang];
155
159
 
@@ -220,6 +224,7 @@ ${themeLine}
220
224
  | Brand | \`${c.brand}\` | ${t.brandDesc} |
221
225
  | Palette Set | \`${c.paletteSet}\` | ${paletteSetDesc(c.paletteSet, lang)} |
222
226
  | Mono | \`${String(c.mono)}\` | ${c.mono ? t.monoOn : t.monoOff} |
227
+ | Material | \`${c.material}\` | ${c.material === "glass" ? (lang === "ko" ? "떠 있는 표면의 반투명 글래스" : "Translucent floating surfaces") : (lang === "ko" ? "불투명 표면" : "Opaque surfaces")} |
223
228
  | Shape | \`${c.shape}\` | ${shapeDesc(c.shape, lang)} |
224
229
  | Density | \`${c.density}\` | ${densityDesc(c.density, lang)} |
225
230
  | Motion | \`${c.motion}\` | ${motionDesc(c.motion, lang)} |
@@ -38,3 +38,11 @@
38
38
  --onb-mode-light: #FFFFFF;
39
39
  --onb-mode-dark: #1A1A1A;
40
40
  }
41
+
42
+ :root {
43
+ --onb-preview-bg: #E8E0D7;
44
+ --onb-preview-line: #B5A49B;
45
+ --onb-preview-glass: rgba(255, 255, 255, 0.55);
46
+ --onb-preview-blur: 12px;
47
+ --onb-preview-compact-blur: 3px;
48
+ }
@@ -164,8 +164,8 @@ const VIBE_CHOICES_I18N: ReadonlyArray<{
164
164
  id: "playful",
165
165
  title: { ko: "활력 있고 통통 튀는", en: "Energetic and bouncy" },
166
166
  hint: {
167
- ko: "코너는 둥글고, 모션은 쫀득하게, 색은 보조색까지. 브랜드가 기억되어야 하는 화면.",
168
- en: "Rounded corners, springy motion, accent colors in play. Screens where the brand needs to be memorable.",
167
+ ko: "둥근 모서리와 탄력 있는 모션. 친근하고 경쾌한 화면.",
168
+ en: "Rounded corners and springy motion for a friendly, energetic feel.",
169
169
  },
170
170
  examples: {
171
171
  ko: "스타트업 프로덕트, 마케팅 사이트, 온보딩·튜토리얼",
@@ -226,8 +226,8 @@ const PALETTE_CHOICES_I18N: ReadonlyArray<{
226
226
  id: "analogous",
227
227
  title: { ko: "잔잔한 조화", en: "Analogous" },
228
228
  hint: {
229
- ko: "primary 주변 ±30·±60도. 인접 색으로만 분산 → 안정적이고 통합된 느낌.",
230
- en: "±30/±60 around primary. Adjacent hues only — unified and calm.",
229
+ ko: "가까운 색으로 차분하게",
230
+ en: "Neighboring hues, calm palette.",
231
231
  },
232
232
  examples: {
233
233
  ko: "SaaS, 관리 도구, 포털",
@@ -238,8 +238,8 @@ const PALETTE_CHOICES_I18N: ReadonlyArray<{
238
238
  id: "triadic",
239
239
  title: { ko: "강한 대비", en: "Triadic" },
240
240
  hint: {
241
- ko: "primary + 120·240도. 색상환을 3등분해 강한 대비.",
242
- en: "Primary + 120·240. Three-way split for strong contrast.",
241
+ ko: "서로 다른 색으로 또렷하게",
242
+ en: "Distinct hues, clear separation.",
243
243
  },
244
244
  examples: {
245
245
  ko: "브랜드 사이트, 마케팅, 캠페인",
@@ -250,8 +250,8 @@ const PALETTE_CHOICES_I18N: ReadonlyArray<{
250
250
  id: "split",
251
251
  title: { ko: "보색 분할", en: "Split-complementary" },
252
252
  hint: {
253
- ko: "primary + 보색 양 옆 ±30도. 대비와 조화의 중간.",
254
- en: "Primary + split complement ±30. Between contrast and harmony.",
253
+ ko: "반대편 색으로 균형 있게",
254
+ en: "Base hue with contrasting accents.",
255
255
  },
256
256
  examples: {
257
257
  ko: "데이터 대시보드, 콘텐츠 플랫폼",
@@ -8,7 +8,7 @@
8
8
  transition: opacity var(--duration-fast) var(--ease-out);
9
9
  /* 초기값 1 — active=true로 mount되는 자리에서 fade-in 깜빡임 방지. active=false면 아래 룰이 0으로 밀어냄. */
10
10
  opacity: 1;
11
- --_pb-bar: var(--fg-strong);
11
+ --_pb-bar: var(--primary);
12
12
  }
13
13
  .root:not([data-active]) {
14
14
  opacity: 0;
@@ -42,6 +42,7 @@
42
42
  white-space: nowrap;
43
43
  }
44
44
  .output {
45
+ margin-inline-start: auto;
45
46
  color: var(--fg-muted);
46
47
  flex-shrink: 0;
47
48
  font-variant-numeric: tabular-nums;
@@ -49,17 +50,19 @@
49
50
 
50
51
  /* Track — 흐린 배경(bar 색의 저알파)으로 "얼마 남았는지" 시각 신호.
51
52
  determinate 60%일 때 뒤 40%가 희미하게 보여야 비율감이 생김.
52
- bar와 같은 톤의 저알파 — 상태색이 바뀌어도 track이 자동 추종. */
53
+ bar와 같은 포인트 색의 저알파 — 테마 변경 시 track도 자동 추종. */
53
54
  .track {
54
55
  position: relative;
55
56
  height: var(--_pb-height);
56
57
  background: color-mix(in oklch, var(--_pb-bar) 15%, transparent);
57
58
  overflow: hidden;
59
+ corner-shape: var(--corner-shape);
58
60
  border-radius: var(--radius-full);
59
61
  }
60
62
  /* fixed 자리는 트랙 배경 없이(화면 상단 overlay가 콘텐츠에 겹침). */
61
63
  .root[data-position="fixed"] .track {
62
64
  background: transparent;
65
+ corner-shape: var(--corner-shape);
63
66
  border-radius: 0;
64
67
  }
65
68
 
@@ -70,22 +73,19 @@
70
73
  .bar {
71
74
  height: 100%;
72
75
  background: var(--_pb-bar);
76
+ corner-shape: var(--corner-shape);
73
77
  border-radius: var(--radius-full);
74
- /* determinate width 변화는 duration-base로 부드럽게. background는 상태 전환용. */
78
+ /* determinate width 변화는 duration-base로 부드럽게. background는 테마 전환용. */
75
79
  transition:
76
80
  width var(--duration-base) var(--ease-out),
77
81
  background var(--duration-base) var(--ease-out);
78
82
  }
79
83
  /* fixed 자리는 왼쪽만 flat(화면 상단 밀착), 오른쪽만 둥글게. */
80
84
  .root[data-position="fixed"] .bar {
85
+ corner-shape: var(--corner-shape);
81
86
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
82
87
  }
83
88
 
84
- /* Status 색 — 기본은 fg-strong, 나머지는 각 상태 색. track 배경은 color-mix로 자동 추종. */
85
- .root[data-status="success"] { --_pb-bar: var(--success); }
86
- .root[data-status="warning"] { --_pb-bar: var(--warning); }
87
- .root[data-status="danger"] { --_pb-bar: var(--destructive); }
88
-
89
89
  .root[data-mode="determinate"] .bar {
90
90
  transform-origin: left center;
91
91
  }
@@ -5,7 +5,6 @@ import styles from "./ProgressBar.module.css";
5
5
 
6
6
  export type ProgressBarSize = "sm" | "md";
7
7
  export type ProgressBarPosition = "fixed" | "inline";
8
- export type ProgressBarStatus = "default" | "success" | "warning" | "danger";
9
8
 
10
9
  export interface ProgressBarProps extends HTMLAttributes<HTMLDivElement> {
11
10
  /**
@@ -17,8 +16,6 @@ export interface ProgressBarProps extends HTMLAttributes<HTMLDivElement> {
17
16
  size?: ProgressBarSize;
18
17
  /** fixed는 화면 최상단 overlay, inline은 흐름 안에 앉음. 기본 inline. */
19
18
  position?: ProgressBarPosition;
20
- /** 상태색. 기본 default(fg-strong 중성). success/warning/danger는 업로드 완료·멈춤·실패에. */
21
- status?: ProgressBarStatus;
22
19
  /** 표시 여부. false면 즉시 숨김 + fade-out. */
23
20
  active?: boolean;
24
21
  /** 좌측 라벨 (예: "업로드 중"). 공급 시 자체 Label 슬롯 렌더. */
@@ -40,7 +37,6 @@ const ProgressBar = forwardRef<HTMLDivElement, ProgressBarProps>(
40
37
  value,
41
38
  size = "md",
42
39
  position = "inline",
43
- status = "default",
44
40
  active = true,
45
41
  label,
46
42
  output,
@@ -62,7 +58,6 @@ const ProgressBar = forwardRef<HTMLDivElement, ProgressBarProps>(
62
58
  aria-valuenow={clamped}
63
59
  data-position={position}
64
60
  data-size={size}
65
- data-status={status}
66
61
  data-active={active || undefined}
67
62
  data-mode={isDeterminate ? "determinate" : "indeterminate"}
68
63
  className={[styles.root, className ?? ""].filter(Boolean).join(" ")}
@@ -3,5 +3,4 @@ export type {
3
3
  ProgressBarProps,
4
4
  ProgressBarSize,
5
5
  ProgressBarPosition,
6
- ProgressBarStatus,
7
6
  } from "./ProgressBar";
@@ -9,6 +9,7 @@
9
9
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
10
10
  background: var(--bg-subtle);
11
11
  border: 0;
12
+ corner-shape: var(--corner-shape);
12
13
  border-radius: var(--radius-md);
13
14
  color: var(--fg);
14
15
  font-size: var(--text-sm);
@@ -40,6 +41,7 @@
40
41
  border: 0;
41
42
  background: transparent;
42
43
  color: var(--fg-muted);
44
+ corner-shape: var(--corner-shape);
43
45
  border-radius: var(--radius-sm);
44
46
  cursor: pointer;
45
47
  transition: var(--transition-colors);
@@ -35,6 +35,7 @@
35
35
  width: var(--size-4);
36
36
  height: var(--size-4);
37
37
  margin-top: calc((var(--lh-base) - var(--size-4)) / 2);
38
+ corner-shape: round;
38
39
  border-radius: var(--radius-full);
39
40
  border: 1px solid var(--border-strong);
40
41
  background: var(--bg);
@@ -49,6 +50,7 @@
49
50
  content: "";
50
51
  position: absolute;
51
52
  inset: 25%;
53
+ corner-shape: round;
52
54
  border-radius: var(--radius-full);
53
55
  background: var(--selected-fg);
54
56
  transform: scale(0);
@@ -1,6 +1,6 @@
1
1
  /* RadioCard ────────────────────────────────────────────────
2
2
  온보딩·유저 타입 선택·문서 지도 등 큰 선택지/네비게이션 카드.
3
- - mode: radio(단일) | checkbox(다중) | link(네비게이션)
3
+ - RadioCard: radio(단일) | link(네비게이션), CheckboxCard: checkbox(다중)
4
4
  - layout: vertical(아이콘 위 · 텍스트 아래 가운데) | horizontal(아이콘 왼쪽 · 텍스트 오른쪽 좌측정렬)
5
5
 
6
6
  구조 · 상태 처리 · 접근성은 [[CheckboxCard]]와 동일한 패턴:
@@ -16,6 +16,7 @@
16
16
  user-select: none;
17
17
  color: var(--fg);
18
18
  font-family: var(--font-sans);
19
+ corner-shape: var(--card-corner-shape);
19
20
  border-radius: var(--radius-lg);
20
21
  transition: var(--transition-colors), var(--transition-press);
21
22
  /* Hover translateY 상단 잘림 방지 */
@@ -30,6 +31,7 @@
30
31
  .surface {
31
32
  position: absolute;
32
33
  inset: 0;
34
+ corner-shape: inherit;
33
35
  border-radius: inherit;
34
36
  background: transparent;
35
37
  border: 1px solid var(--border);
@@ -64,7 +66,7 @@
64
66
  min-width: 0;
65
67
  }
66
68
 
67
- /* ── Align: vertical 기준 cross-axis / horizontal 기준 text alignment ── */
69
+ /* ── Align: center는 아이콘과 텍스트를 위아래 중앙 정렬 ── */
68
70
  .root[data-layout="vertical"][data-align="center"] .content {
69
71
  align-items: center;
70
72
  text-align: center;
@@ -86,10 +88,16 @@
86
88
  align-items: flex-start;
87
89
  }
88
90
  .root[data-layout="horizontal"][data-align="center"] .content {
91
+ flex-direction: column;
92
+ align-items: center;
89
93
  text-align: center;
90
- justify-content: center;
94
+ gap: var(--space-1);
95
+ }
96
+ .root[data-layout="horizontal"][data-align="center"] .icon {
97
+ align-self: center;
91
98
  }
92
99
  .root[data-layout="horizontal"][data-align="center"] .text {
100
+ flex: initial;
93
101
  align-items: center;
94
102
  }
95
103
 
@@ -206,3 +214,70 @@
206
214
  .root[data-mode="link"] .description {
207
215
  color: var(--fg-muted);
208
216
  }
217
+
218
+ /* 공유 선택 표시: RadioCard는 dot, CheckboxCard는 check. */
219
+ .indicator {
220
+ display: inline-flex;
221
+ align-items: center;
222
+ justify-content: center;
223
+ flex-shrink: 0;
224
+ height: var(--lh-sm);
225
+ }
226
+ /* Radio dot — 선택 전 배경 없음(부모 표면 노출). */
227
+ .radioDot {
228
+ display: inline-block;
229
+ width: var(--size-4);
230
+ height: var(--size-4);
231
+ corner-shape: round;
232
+ border-radius: var(--radius-full);
233
+ box-shadow: inset 0 0 0 1px var(--border-strong);
234
+ background: transparent;
235
+ transition:
236
+ box-shadow var(--duration-slow) var(--ease-out),
237
+ background var(--duration-slow) var(--ease-out);
238
+ }
239
+
240
+ /* Checkbox — 선택 전 배경 없음(부모 표면 노출). */
241
+ .checkBox {
242
+ display: inline-flex;
243
+ align-items: center;
244
+ justify-content: center;
245
+ width: var(--size-4);
246
+ height: var(--size-4);
247
+ corner-shape: var(--corner-shape);
248
+ border-radius: var(--radius-xs);
249
+ border: 1px solid var(--border-strong);
250
+ background: transparent;
251
+ color: transparent;
252
+ transition: var(--transition-colors);
253
+ }
254
+ .checkBox > svg {
255
+ width: 100%;
256
+ height: 100%;
257
+ display: block;
258
+ }
259
+
260
+
261
+ /* Radio dot — checked 시 안쪽 도트를 accent 색으로. stroke는 항상 1px.
262
+ 바깥은 투명(부모 표면 노출). */
263
+ .input:checked ~ .content .radioDot {
264
+ box-shadow: inset 0 0 0 1px var(--selected-fg);
265
+ background: radial-gradient(
266
+ circle at center,
267
+ var(--selected-fg) 0,
268
+ var(--selected-fg) 30%,
269
+ transparent 31%
270
+ );
271
+ }
272
+
273
+ /* Checkbox — checked 시 배경/경계/체크 색이 accent로 반전. */
274
+ .input:checked ~ .content .checkBox {
275
+ background: var(--selected-fg);
276
+ border-color: var(--selected-fg);
277
+ color: var(--bg);
278
+ }
279
+
280
+
281
+ .root[data-layout="horizontal"][data-align="start"] .indicator {
282
+ align-self: flex-start;
283
+ }
@@ -7,64 +7,70 @@ import { Icon, type IconName } from "../Icon";
7
7
 
8
8
  import styles from "./RadioCard.module.css";
9
9
 
10
- export type RadioCardMode = "radio" | "checkbox" | "link";
10
+ export type RadioCardMode = "radio" | "link";
11
+ type ChoiceCardMode = RadioCardMode | "checkbox";
11
12
  export type RadioCardLayout = "vertical" | "horizontal";
12
13
  export type RadioCardSize = "md" | "lg";
13
14
  export type RadioCardAlign = "start" | "center";
14
15
 
15
- type CommonProps = {
16
+ export type ChoiceCardCommonProps = {
16
17
  /**
17
18
  * radio: 단일 선택 (RadioGroup으로 묶기).
18
- * checkbox: 다중 선택.
19
+ * 다중 선택은 CheckboxCard 사용.
19
20
  * link: 네비게이션 카드 (`<a>` 렌더, href 필수, 선택 상태 없음).
20
21
  */
21
- mode?: RadioCardMode;
22
+ mode?: ChoiceCardMode;
22
23
  /**
23
24
  * vertical: 아이콘 위·텍스트 아래 (온보딩·유저 타입 선택 등 페이지 중앙 큰 선택지).
24
25
  * horizontal: 아이콘 왼쪽·텍스트 오른쪽 (문서 지도·설정 라우트 등 네비게이션 리스트).
25
- * 정렬은 `align`으로 독립 조절.
26
+ * align="center"이면 layout과 관계없이 아이콘 위·텍스트 아래로 가운데 정렬.
26
27
  */
27
28
  layout?: RadioCardLayout;
29
+ /** 선택 표시. 미지정 시 아이콘 없는 선택 카드에 표시한다. */
30
+ indicator?: boolean;
28
31
  /**
29
32
  * md(기본): padding space-4, title text-sm, icon size-md.
30
33
  * lg: padding space-5, title text-md, icon size-lg. 큰 중앙 선택지에.
31
34
  */
32
35
  size?: RadioCardSize;
33
36
  /**
34
- * start: 좌측정렬. center: 가운데 정렬.
37
+ * start: 좌측정렬. center: 아이콘 위·텍스트 아래 가운데 정렬.
35
38
  * 미지정 시 layout의 자연 정렬을 따른다 (vertical→center, horizontal→start).
36
39
  */
37
40
  align?: RadioCardAlign;
38
41
  /**
39
42
  * IconName 문자열이면 기본 Icon을 렌더. ReactNode를 넘기면 그대로 슬롯에 꽂아
40
43
  * fill variant·커스텀 색 Icon·이미지·로고 등을 자유롭게 사용할 수 있다.
41
- * 생략 시 아이콘 영역 자체가 사라져 텍스트만 가운데/왼쪽 정렬.
44
+ * 생략 시 아이콘 영역은 사라지며 indicator 기본값은 true.
42
45
  */
43
46
  icon?: IconName | ReactNode;
44
47
  title: ReactNode;
45
48
  description?: ReactNode;
46
49
  };
47
50
 
48
- type InputChoiceProps = CommonProps &
51
+ type InputChoiceProps = ChoiceCardCommonProps &
49
52
  Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "title"> & {
50
53
  mode?: "radio" | "checkbox";
51
54
  href?: never;
52
55
  };
53
56
 
54
- type LinkChoiceProps = CommonProps &
57
+ type LinkChoiceProps = ChoiceCardCommonProps &
55
58
  Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "title"> & {
56
59
  mode: "link";
57
60
  href: string;
58
61
  };
59
62
 
60
- export type RadioCardProps = InputChoiceProps | LinkChoiceProps;
63
+ export type ChoiceCardInputProps = InputChoiceProps;
64
+ type ChoiceCardProps = InputChoiceProps | LinkChoiceProps;
65
+ export type RadioCardProps = (Omit<InputChoiceProps, "mode"> & { mode?: "radio" }) | LinkChoiceProps;
61
66
 
62
- const RadioCard = forwardRef<HTMLInputElement | HTMLAnchorElement, RadioCardProps>(
67
+ export const ChoiceCard = forwardRef<HTMLInputElement | HTMLAnchorElement, ChoiceCardProps>(
63
68
  (props, ref) => {
64
69
  const {
65
70
  className,
66
71
  mode = "radio",
67
- layout = "vertical",
72
+ layout: requestedLayout,
73
+ indicator: requestedIndicator,
68
74
  size = "md",
69
75
  align,
70
76
  icon,
@@ -72,6 +78,8 @@ const RadioCard = forwardRef<HTMLInputElement | HTMLAnchorElement, RadioCardProp
72
78
  description,
73
79
  } = props;
74
80
 
81
+ const indicator = mode !== "link" && (requestedIndicator ?? (icon == null || icon === false));
82
+ const layout = requestedLayout ?? (indicator ? "horizontal" : "vertical");
75
83
  const resolvedAlign: RadioCardAlign =
76
84
  align ?? (layout === "vertical" ? "center" : "start");
77
85
  const rootClass = [styles.root, className ?? ""].filter(Boolean).join(" ");
@@ -81,6 +89,13 @@ const RadioCard = forwardRef<HTMLInputElement | HTMLAnchorElement, RadioCardProp
81
89
  <>
82
90
  <span className={styles.surface} aria-hidden />
83
91
  <span className={styles.content}>
92
+ {indicator && (
93
+ <span className={styles.indicator} aria-hidden>
94
+ {mode === "checkbox" ? (
95
+ <span className={styles.checkBox}><Icon name="check" /></span>
96
+ ) : <span className={styles.radioDot} />}
97
+ </span>
98
+ )}
84
99
  {hasIcon && (
85
100
  <span className={styles.icon} aria-hidden>
86
101
  {typeof icon === "string" ? <Icon name={icon as IconName} /> : icon}
@@ -101,6 +116,7 @@ const RadioCard = forwardRef<HTMLInputElement | HTMLAnchorElement, RadioCardProp
101
116
  href,
102
117
  mode: _m,
103
118
  layout: _l,
119
+ indicator: _indicator,
104
120
  size: _s,
105
121
  align: _a,
106
122
  icon: _i,
@@ -127,6 +143,7 @@ const RadioCard = forwardRef<HTMLInputElement | HTMLAnchorElement, RadioCardProp
127
143
  const {
128
144
  mode: _m,
129
145
  layout: _l,
146
+ indicator: _indicator,
130
147
  size: _s,
131
148
  align: _a,
132
149
  icon: _i,
@@ -159,6 +176,11 @@ const RadioCard = forwardRef<HTMLInputElement | HTMLAnchorElement, RadioCardProp
159
176
  },
160
177
  );
161
178
 
179
+ ChoiceCard.displayName = "ChoiceCard";
180
+
181
+ const RadioCard = forwardRef<HTMLInputElement | HTMLAnchorElement, RadioCardProps>(
182
+ (props, ref) => <ChoiceCard {...props} ref={ref} />,
183
+ );
162
184
  RadioCard.displayName = "RadioCard";
163
185
 
164
186
  export { RadioCard };
@@ -1,2 +1,2 @@
1
1
  export { RadioCard } from "./RadioCard";
2
- export type { RadioCardProps, RadioCardMode, RadioCardLayout } from "./RadioCard";
2
+ export type { RadioCardProps, RadioCardMode, RadioCardLayout, RadioCardSize, RadioCardAlign } from "./RadioCard";
@@ -1,4 +1,6 @@
1
1
  .root {
2
+ --chart-enter-duration: calc(var(--duration-slower) * 2);
3
+ --chart-enter-easing: cubic-bezier(0.22, 1.12, 0.36, 1); /* lint-hardcoded: ignore */
2
4
  --segmented-secondary-fg: color-mix(in oklch, var(--fg-muted) 70%, var(--fg-subtle));
3
5
  --segmented-radius: max(var(--hairline), calc(var(--radius-xs) / 4));
4
6
  --segmented-color-1: color-mix(in oklch, var(--primary) 24%, var(--bg-muted));
@@ -61,6 +63,7 @@
61
63
  }
62
64
 
63
65
  .track {
66
+ transform-origin: left center;
64
67
  display: flex;
65
68
  height: var(--size-3);
66
69
  gap: var(--space-0_5);
@@ -68,6 +71,7 @@
68
71
 
69
72
  .track[data-empty] {
70
73
  background: var(--bg-muted);
74
+ corner-shape: var(--corner-shape);
71
75
  border-radius: var(--segmented-radius);
72
76
  }
73
77
 
@@ -75,6 +79,7 @@
75
79
  flex-basis: 0;
76
80
  min-width: 0;
77
81
  background: var(--segment-color);
82
+ corner-shape: var(--corner-shape);
78
83
  border-radius: var(--segmented-radius);
79
84
  transform: translateY(0);
80
85
  transition: var(--transition-press);
@@ -155,6 +160,7 @@
155
160
  width: var(--size-2);
156
161
  height: var(--size-2);
157
162
  flex-shrink: 0;
163
+ corner-shape: var(--corner-shape);
158
164
  border-radius: var(--radius-xs);
159
165
  background: var(--segment-color);
160
166
  }
@@ -219,3 +225,13 @@
219
225
  text-align: start;
220
226
  }
221
227
  }
228
+
229
+ @media (prefers-reduced-motion: no-preference) {
230
+ .root[data-entrance="pending"] .track:not([data-empty]) {
231
+ visibility: hidden;
232
+ }
233
+
234
+ :global([data-motion="none"]) .root[data-entrance="pending"] .track {
235
+ visibility: visible;
236
+ }
237
+ }
@@ -1,9 +1,10 @@
1
1
  "use client";
2
2
 
3
- import { forwardRef, type CSSProperties, type HTMLAttributes, type ReactNode } from "react";
3
+ import { forwardRef, useImperativeHandle, useLayoutEffect, useRef, type CSSProperties, type HTMLAttributes, type ReactNode } from "react";
4
4
  import { Button } from "../Button";
5
5
  import { EmptyState } from "../EmptyState";
6
6
  import styles from "./SegmentedChart.module.css";
7
+ import { useChartEntrance } from "../useChartEntrance";
7
8
 
8
9
  export interface SegmentedChartItem {
9
10
  /** 데이터 내에서 고유하고 변경되지 않는 식별자. */
@@ -18,8 +19,11 @@ export interface SegmentedChartItem {
18
19
 
19
20
  export interface SegmentedChartProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "title"> {
20
21
  data: readonly SegmentedChartItem[];
22
+ animateIn?: boolean;
21
23
  /** 선택 시 범례명으로, 선택 해제 시 원래 제목으로 돌아온다. */
22
24
  title?: ReactNode;
25
+ /** 합계·단위·caption을 표시한다. 기본형은 분할 막대와 범례만 표시. */
26
+ showSummary?: boolean;
23
27
  unit?: string;
24
28
  /** 상단 금액 옆 보조 정보. 예: "총 32건". */
25
29
  caption?: ReactNode;
@@ -34,10 +38,23 @@ export interface SegmentedChartProps extends Omit<HTMLAttributes<HTMLDivElement>
34
38
  /** 전체 구성비를 분할 막대와 접근 가능한 수치 목록으로 표현한다. */
35
39
  export const SegmentedChart = forwardRef<HTMLDivElement, SegmentedChartProps>(
36
40
  function SegmentedChart({
37
- data, title, unit, caption, locale = "ko-KR", formatValue,
41
+ data, title, showSummary = false, animateIn = true, unit, caption, locale = "ko-KR", formatValue,
38
42
  emptyLabel = "표시할 데이터가 없습니다", selectedId, onSegmentClick,
39
43
  className, "aria-label": ariaLabel = "구성비", ...rest
40
44
  }, ref) {
45
+ const root = useRef<HTMLDivElement>(null);
46
+ const track = useRef<HTMLDivElement>(null);
47
+ useImperativeHandle(ref, () => root.current!, []);
48
+ const { phase, duration, cssEasing, seriesComplete } = useChartEntrance(root, animateIn && data.some(item => Number.isFinite(item.value) && item.value > 0));
49
+ useLayoutEffect(() => {
50
+ if (phase !== "running" || !track.current) return;
51
+ const animation = track.current.animate(
52
+ [{ transform: "scaleX(0)" }, { transform: "scaleX(1)" }],
53
+ { duration: duration, easing: cssEasing, fill: "none" },
54
+ );
55
+ animation.onfinish = () => seriesComplete("segments", 1);
56
+ return () => animation.cancel();
57
+ }, [phase, duration, cssEasing, seriesComplete]);
41
58
  const rows = data.map((item) => ({
42
59
  item,
43
60
  value: Number.isFinite(item.value) && item.value > 0 ? item.value : 0,
@@ -55,22 +72,22 @@ export const SegmentedChart = forwardRef<HTMLDivElement, SegmentedChartProps>(
55
72
  } as CSSProperties);
56
73
 
57
74
  return (
58
- <div {...rest} ref={ref} role="group" aria-label={ariaLabel} data-has-title={hasTitle || undefined}
75
+ <div {...rest} ref={root} data-entrance={phase} role="group" aria-label={ariaLabel} data-has-title={hasTitle || undefined}
59
76
  className={[styles.root, className].filter(Boolean).join(" ")}>
60
77
  {rows.length === 0 ? (
61
78
  <EmptyState size="sm" icon="chart-line" title={emptyLabel} className={styles.empty} />
62
79
  ) : <>
63
- <div className={styles.header}>
80
+ {(hasTitle || showSummary) && <div className={styles.header}>
64
81
  {hasTitle && <h3 className={styles.title}>{selectedRow?.item.label ?? title}</h3>}
65
- <div className={styles.summary}>
82
+ {showSummary && <div className={styles.summary}>
66
83
  <span className={styles.total}>
67
84
  <strong>{format(selectedRow?.value ?? total)}</strong>
68
85
  {unit && <span className={styles.unit}>{unit}</span>}
69
86
  </span>
70
87
  {caption != null && <span className={styles.caption}>{caption}</span>}
71
- </div>
72
- </div>
73
- <div className={styles.track} aria-hidden="true" data-empty={weight === 0 || undefined}>
88
+ </div>}
89
+ </div>}
90
+ <div ref={track} className={styles.track} aria-hidden="true" data-empty={weight === 0 || undefined}>
74
91
  {weight > 0 && rows.map(({ item, value }, index) => value > 0 && (
75
92
  <span key={item.id} className={styles.segment}
76
93
  data-selected={hasSelection && item.id === selectedId || undefined}
@@ -21,6 +21,7 @@
21
21
  * </Select>
22
22
  */
23
23
 
24
+ import { useMaterialScope } from "../materialScope";
24
25
  import * as RS from "@radix-ui/react-select";
25
26
  import {
26
27
  createContext,
@@ -52,11 +53,11 @@ export type SelectWidth = "fill" | "md" | "lg" | number;
52
53
  /* Size context ─────────────────────────────────────────────────────
53
54
  Trigger의 size를 Content 하위 Item들이 이어받도록 공유.
54
55
  Trigger는 3단(sm/md/lg)이지만 드롭다운 MenuItem은 조밀하게 여는 게 실전에서 자연스러움 —
55
- lg 트리거만 lg 아이템으로 열고, sm/md 트리거는 모두 md 아이템(32px)으로 연다. */
56
+ lg 트리거만 md 아이템으로 열고, sm/md 트리거는 모두 sm 아이템으로 연다. */
56
57
  const menuSizeFor: Record<SelectSize, MenuItemSize> = {
57
- sm: "md",
58
- md: "md",
59
- lg: "lg",
58
+ sm: "sm",
59
+ md: "sm",
60
+ lg: "md",
60
61
  };
61
62
 
62
63
  const SizeContext = createContext<SelectSize>("md");
@@ -318,9 +319,11 @@ const Content = forwardRef<HTMLDivElement, ContentProps>(function SelectContent(
318
319
  /* Radix Portal이 Content를 document.body로 옮기며 상위 React Provider가 흘러가지 않는다.
319
320
  Icon 축을 캡처해 Portal 하위에 재주입 — 내부 Icon과 Item 아이콘까지 축 스왑 반응. */
320
321
  const iconAxis = useIconAxis();
322
+ const materialScope = useMaterialScope();
321
323
  return (
322
324
  <ControlGroupContext.Provider value={undefined}><RS.Portal container={container}>
323
325
  <RS.Content
326
+ data-material={materialScope}
324
327
  ref={ref}
325
328
  position={position}
326
329
  sideOffset={sideOffset}
@@ -66,6 +66,7 @@
66
66
  padding-inline: var(--space-1);
67
67
  gap: var(--space-0_5);
68
68
  font-size: var(--text-2xs); /* 12 */
69
+ corner-shape: var(--corner-shape);
69
70
  border-radius: var(--radius-checkbox);
70
71
  }
71
72
  .md {
@@ -73,5 +74,6 @@
73
74
  padding-inline: var(--space-1_5);
74
75
  gap: var(--space-0_5);
75
76
  font-size: var(--text-2xs); /* 12 */
77
+ corner-shape: var(--corner-shape);
76
78
  border-radius: var(--radius-checkbox);
77
79
  }