@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
@@ -0,0 +1,785 @@
1
+ # Radar Chart 사용 사례 소스
2
+
3
+ <!-- Generated by scripts/build-use-cases.mjs. Edit original TSX/CSS, then regenerate. -->
4
+
5
+ ### 사례 목록
6
+
7
+ - Product quality card
8
+
9
+ 문서: /en/components/chart/chart-radar#use-cases
10
+
11
+ 문서 페이지에서 렌더하는 사례입니다.
12
+
13
+ ### 조회 방법
14
+
15
+ get_guide(topic="use-cases/chart-chart-radar", sections=["사례 목록", "파일 목록"])로 먼저 확인하고, 필요한 Section 또는 Source 파일 헤딩만 sections로 조회하세요. 전체 문서는 문서 페이지의 다른 예제도 포함합니다. 공용 컴포넌트 계약은 get_component로 읽고, 예제의 docs 전용 셸·locale·import 경로는 대상 프로젝트에 맞게 조합하세요. 이 연결은 디자인 승인이나 기능 검증을 뜻하지 않습니다.
16
+
17
+ ### 파일 목록
18
+
19
+ - `web/app/[lang]/components/chart/chart-radar/_strings.tsx`
20
+ - `web/app/[lang]/components/chart/chart-radar/page.module.css`
21
+ - `web/app/[lang]/components/chart/chart-radar/page.tsx`
22
+ - `web/examples/ChartCardExamples.module.css`
23
+ - `web/examples/ChartCardExamples.tsx`
24
+ - `web/examples/TrafficComparisonExample.module.css`
25
+ - `web/examples/TrafficComparisonExample.tsx`
26
+
27
+ ### Section: web/app/[lang]/components/chart/chart-radar/page.tsx#use-cases
28
+
29
+ ```tsx
30
+ <section id="use-cases">
31
+ <h2>In Use</h2>
32
+ <h3>{en ? "Product quality card" : "제품 품질 카드"}</h3>
33
+ <ExampleBlock previewWidth="full"><QualityCardExample /></ExampleBlock>
34
+ </section>
35
+ ```
36
+
37
+ ### Source: web/app/[lang]/components/chart/chart-radar/_strings.tsx
38
+
39
+ ````tsx
40
+ import type { ReactNode } from "react";
41
+
42
+ type Strings = {
43
+ title: string;
44
+ lead: ReactNode;
45
+ months: [string, string, string, string, string, string];
46
+ desktop: string;
47
+ mobile: string;
48
+ usage: { heading: string; desc: ReactNode };
49
+ shape: { heading: string; dots: ReactNode; linesOnly: ReactNode; customLabel: ReactNode };
50
+ grid: { heading: string; desc: ReactNode };
51
+ multiple: { heading: string; desc: ReactNode };
52
+ api: { heading: string; desc: ReactNode; official: string };
53
+ };
54
+
55
+ const en: Strings = {
56
+ title: "Radar Chart",
57
+ lead: "Compares strengths and weaknesses across several categories. Use Bar Chart for precise value comparisons.",
58
+ months: ["Jan", "Feb", "Mar", "Apr", "May", "Jun"],
59
+ desktop: "Desktop",
60
+ mobile: "Mobile",
61
+ usage: {
62
+ heading: "Usage",
63
+ desc: "Use when the overall profile matters more than differences between individual values.",
64
+ },
65
+ shape: {
66
+ heading: "Points and Labels",
67
+ dots: "Show points when individual values need emphasis.",
68
+ linesOnly: "Use outlines when filled areas would obscure each other.",
69
+ customLabel: "Shorten long category names to keep labels apart.",
70
+ },
71
+ grid: {
72
+ heading: "Grid",
73
+ desc: "Use a grid when readers need to compare distance from the center.",
74
+ },
75
+ multiple: {
76
+ heading: "With Legend",
77
+ desc: "Limit overlays to two series. Select a legend item to isolate it, and select again to restore both.",
78
+ },
79
+ api: {
80
+ heading: "API Reference",
81
+ desc: "For profile and grid options, see the",
82
+ official: "Radar documentation",
83
+ },
84
+ };
85
+
86
+ const ko: Strings = {
87
+ title: "Radar Chart",
88
+ lead: "여러 항목의 강점과 약점을 한눈에 비교합니다. 정확한 수치 비교에는 Bar Chart를 사용합니다.",
89
+ months: ["1월", "2월", "3월", "4월", "5월", "6월"],
90
+ desktop: "데스크톱",
91
+ mobile: "모바일",
92
+ usage: {
93
+ heading: "Usage",
94
+ desc: "개별 값의 차이보다 전체적인 강약을 비교할 때 사용합니다.",
95
+ },
96
+ shape: {
97
+ heading: "점과 라벨",
98
+ dots: "개별 지점의 값을 강조해야 할 때 점을 표시합니다.",
99
+ linesOnly: "영역이 서로 가려지면 채움 대신 윤곽선으로 비교합니다.",
100
+ customLabel: "항목명이 길면 짧게 줄여 라벨이 겹치지 않게 합니다.",
101
+ },
102
+ grid: {
103
+ heading: "격자",
104
+ desc: "중심에서 떨어진 거리를 비교할 수 있도록 격자를 표시합니다.",
105
+ },
106
+ multiple: {
107
+ heading: "범례",
108
+ desc: "겹쳐 비교하는 데이터 계열은 두 개로 제한합니다. 범례를 선택하면 해당 계열만 표시하고, 다시 선택하면 둘 다 표시합니다.",
109
+ },
110
+ api: {
111
+ heading: "API Reference",
112
+ desc: "윤곽선과 격자 옵션은",
113
+ official: "Radar 문서",
114
+ },
115
+ };
116
+
117
+ export const strings: Record<"en" | "ko", Strings> = { en, ko };
118
+ ````
119
+
120
+ ### Source: web/app/[lang]/components/chart/chart-radar/page.module.css
121
+
122
+ ````css
123
+ .radarChart,
124
+ .playgroundChart {
125
+ width: 100%;
126
+ max-width: calc(var(--size-24) * 4);
127
+ aspect-ratio: 1;
128
+ }
129
+
130
+ .customTick {
131
+ fill: var(--primary);
132
+ font-size: var(--text-xs);
133
+ font-weight: var(--font-weight-semibold);
134
+ }
135
+ ````
136
+
137
+ ### Source: web/app/[lang]/components/chart/chart-radar/page.tsx
138
+
139
+ ````tsx
140
+ "use client";
141
+
142
+ import { QualityCardExample } from "@/examples/ChartCardExamples";
143
+ import { useMemo, useState } from "react";
144
+ import { usePathname } from "next/navigation";
145
+ import {
146
+ PolarAngleAxis,
147
+ PolarGrid,
148
+ Radar,
149
+ RadarChart,
150
+ } from "recharts";
151
+ import {
152
+ ChartContainer,
153
+ ChartLegend,
154
+ ChartLegendContent,
155
+ ChartTooltip,
156
+ ChartTooltipContent,
157
+ type ChartConfig,
158
+ } from "@/components/Chart";
159
+ import { ExampleBlock } from "../../../../_components/ExampleBlock";
160
+ import { Playground } from "../../../../_components/Playground";
161
+ import { DocsTable } from "../../../../_components/DocsTable";
162
+ import { localeFromPathname } from "../../../../_dict";
163
+ import { strings } from "./_strings";
164
+ import styles from "./page.module.css";
165
+
166
+ const GRIDS = ["polygon", "circle", "none"] as const;
167
+ type GridMode = (typeof GRIDS)[number];
168
+
169
+ type TickProps = {
170
+ x?: string | number;
171
+ y?: string | number;
172
+ textAnchor?: "start" | "middle" | "end" | "inherit";
173
+ payload?: { value?: string };
174
+ };
175
+
176
+ function customTick({ x = 0, y = 0, textAnchor = "middle", payload }: TickProps) {
177
+ return (
178
+ <text x={x} y={y} textAnchor={textAnchor} dominantBaseline="central" className={styles.customTick}>
179
+ {payload?.value?.slice(0, 3)}
180
+ </text>
181
+ );
182
+ }
183
+
184
+ export default function ChartRadarPage() {
185
+ const pathname = usePathname() ?? "/";
186
+ const en = localeFromPathname(pathname) === "en";
187
+ const t = strings[en ? "en" : "ko"];
188
+ const data = useMemo(
189
+ () => [
190
+ { month: strings.en.months[0], desktop: 186, mobile: 80 },
191
+ { month: strings.en.months[1], desktop: 305, mobile: 200 },
192
+ { month: strings.en.months[2], desktop: 237, mobile: 120 },
193
+ { month: strings.en.months[3], desktop: 273, mobile: 190 },
194
+ { month: strings.en.months[4], desktop: 209, mobile: 130 },
195
+ { month: strings.en.months[5], desktop: 214, mobile: 140 },
196
+ ],
197
+ [strings.en.months],
198
+ );
199
+ const config = useMemo(
200
+ () =>
201
+ ({
202
+ desktop: { label: strings.en.desktop, color: "var(--chart-1)" },
203
+ mobile: { label: strings.en.mobile, color: "var(--chart-2)" },
204
+ }) satisfies ChartConfig,
205
+ [strings.en.desktop, strings.en.mobile],
206
+ );
207
+
208
+ const [pgGrid, setPgGrid] = useState<GridMode>("polygon");
209
+ const [pgFill, setPgFill] = useState(true);
210
+ const [pgDots, setPgDots] = useState(false);
211
+ const [pgMultiple, setPgMultiple] = useState(true);
212
+ const [pgLegend, setPgLegend] = useState(true);
213
+ const [pgSpokes, setPgSpokes] = useState(true);
214
+ const [pgSolo, setPgSolo] = useState<string | null>(null);
215
+ const [legendSolo, setLegendSolo] = useState<string | null>(null);
216
+ const seriesKeys = useMemo(() => ["desktop", "mobile"], []);
217
+ const pgHidden = useMemo(
218
+ () => new Set(pgSolo ? seriesKeys.filter((key) => key !== pgSolo) : []),
219
+ [pgSolo, seriesKeys],
220
+ );
221
+ const legendHidden = useMemo(
222
+ () => new Set(legendSolo ? seriesKeys.filter((key) => key !== legendSolo) : []),
223
+ [legendSolo, seriesKeys],
224
+ );
225
+
226
+ return (
227
+ <>
228
+ <h1 className="page-title">{t.title}</h1>
229
+ <p className="page-lead">{t.lead}</p>
230
+
231
+ <section id="usage" className="section-first">
232
+ <h2>{t.usage.heading}</h2>
233
+ <p className="desc">{t.usage.desc}</p>
234
+ <ExampleBlock code={`import { Radar, RadarChart, PolarAngleAxis } from "recharts";
235
+ import { ChartContainer } from "@/components/Chart";
236
+
237
+ <ChartContainer config={config}>
238
+ <RadarChart data={data} accessibilityLayer>
239
+ <PolarAngleAxis dataKey="month" />
240
+ <Radar dataKey="desktop" stroke="var(--color-desktop)" />
241
+ </RadarChart>
242
+ </ChartContainer>`}>
243
+ <ChartContainer config={config} className={styles.radarChart}>
244
+ <RadarChart data={data} accessibilityLayer outerRadius="72%">
245
+ <PolarGrid />
246
+ <PolarAngleAxis dataKey="month" tickLine={false} />
247
+ <ChartTooltip content={<ChartTooltipContent />} />
248
+ <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.16} stroke="var(--color-desktop)" isAnimationActive={false} />
249
+ </RadarChart>
250
+ </ChartContainer>
251
+ </ExampleBlock>
252
+ </section>
253
+
254
+ <Playground
255
+ axes={[{ label: "grid", value: pgGrid, onChange: (v) => setPgGrid(v as GridMode), options: GRIDS }]}
256
+ toggles={[
257
+ { label: "fill", value: pgFill, onChange: setPgFill },
258
+ { label: "dots", value: pgDots, onChange: setPgDots },
259
+ { label: "multiple", value: pgMultiple, onChange: setPgMultiple },
260
+ { label: "legend", value: pgLegend, onChange: setPgLegend },
261
+ { label: "radial lines", value: pgSpokes, onChange: setPgSpokes },
262
+ ]}
263
+ >
264
+ <ChartContainer config={config} className={styles.playgroundChart}>
265
+ <RadarChart data={data} accessibilityLayer outerRadius="70%">
266
+ {pgGrid !== "none" && <PolarGrid gridType={pgGrid} radialLines={pgSpokes} />}
267
+ <PolarAngleAxis dataKey="month" tickLine={false} />
268
+ <ChartTooltip content={<ChartTooltipContent />} />
269
+ <Radar
270
+ dataKey="desktop"
271
+ hide={pgSolo === "mobile"}
272
+ fill="var(--color-desktop)"
273
+ fillOpacity={pgFill ? 0.16 : 0}
274
+ stroke="var(--color-desktop)"
275
+ dot={pgDots ? { r: 3, fill: "var(--color-desktop)" } : false}
276
+ isAnimationActive="auto"
277
+ />
278
+ {pgMultiple && (
279
+ <Radar
280
+ dataKey="mobile"
281
+ hide={pgSolo === "desktop"}
282
+ fill="var(--color-mobile)"
283
+ fillOpacity={pgFill ? 0.12 : 0}
284
+ stroke="var(--color-mobile)"
285
+ dot={pgDots ? { r: 3, fill: "var(--color-mobile)" } : false}
286
+ isAnimationActive="auto"
287
+ />
288
+ )}
289
+ {pgLegend && pgMultiple && (
290
+ <ChartLegend content={<ChartLegendContent hidden={pgHidden} onItemClick={(key) => setPgSolo((prev) => prev === key ? null : key)} />} />
291
+ )}
292
+ </RadarChart>
293
+ </ChartContainer>
294
+ </Playground>
295
+
296
+ <section id="shape">
297
+ <h2>{t.shape.heading}</h2>
298
+ <p className="desc">{t.shape.dots}</p>
299
+ <ExampleBlock code={`<Radar dataKey="desktop" dot={{ r: 3 }} ... />`}>
300
+ <ChartContainer config={config} className={styles.radarChart}>
301
+ <RadarChart data={data} accessibilityLayer outerRadius="72%">
302
+ <PolarGrid /><PolarAngleAxis dataKey="month" tickLine={false} />
303
+ <ChartTooltip content={<ChartTooltipContent />} />
304
+ <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.14} stroke="var(--color-desktop)" dot={{ r: 3, fill: "var(--color-desktop)" }} isAnimationActive={false} />
305
+ </RadarChart>
306
+ </ChartContainer>
307
+ </ExampleBlock>
308
+
309
+ <p className="desc">{t.shape.linesOnly}</p>
310
+ <ExampleBlock code={`<Radar dataKey="desktop" fillOpacity={0} stroke="var(--color-desktop)" />`}>
311
+ <ChartContainer config={config} className={styles.radarChart}>
312
+ <RadarChart data={data} accessibilityLayer outerRadius="72%">
313
+ <PolarGrid /><PolarAngleAxis dataKey="month" tickLine={false} />
314
+ <ChartTooltip content={<ChartTooltipContent />} />
315
+ <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0} stroke="var(--color-desktop)" isAnimationActive={false} />
316
+ </RadarChart>
317
+ </ChartContainer>
318
+ </ExampleBlock>
319
+
320
+ <p className="desc">{t.shape.customLabel}</p>
321
+ <ExampleBlock code={`<PolarAngleAxis dataKey="month" tick={customTick} />`}>
322
+ <ChartContainer config={config} className={styles.radarChart}>
323
+ <RadarChart data={data} accessibilityLayer outerRadius="70%">
324
+ <PolarGrid /><PolarAngleAxis dataKey="month" tick={customTick} tickLine={false} />
325
+ <ChartTooltip content={<ChartTooltipContent />} />
326
+ <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.16} stroke="var(--color-desktop)" isAnimationActive={false} />
327
+ </RadarChart>
328
+ </ChartContainer>
329
+ </ExampleBlock>
330
+ </section>
331
+
332
+ <section id="grid">
333
+ <h2>{t.grid.heading}</h2>
334
+ <p className="desc">{t.grid.desc}</p>
335
+ <ExampleBlock code={`<PolarGrid gridType="circle" radialLines={false} />`}>
336
+ <ChartContainer config={config} className={styles.radarChart}>
337
+ <RadarChart data={data} accessibilityLayer outerRadius="72%">
338
+ <PolarGrid gridType="circle" radialLines={false} /><PolarAngleAxis dataKey="month" tickLine={false} />
339
+ <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.16} stroke="var(--color-desktop)" isAnimationActive={false} />
340
+ </RadarChart>
341
+ </ChartContainer>
342
+ </ExampleBlock>
343
+ </section>
344
+
345
+ <section id="multiple">
346
+ <h2>{t.multiple.heading}</h2>
347
+ <p className="desc">{t.multiple.desc}</p>
348
+ <ExampleBlock code={`<Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.12} ... />
349
+ <Radar dataKey="mobile" fill="var(--color-mobile)" fillOpacity={0.12} ... />
350
+ <ChartLegend content={<ChartLegendContent hidden={hidden} onItemClick={toggleSeries} />} />`}>
351
+ <ChartContainer config={config} className={styles.radarChart}>
352
+ <RadarChart data={data} accessibilityLayer outerRadius="68%">
353
+ <PolarGrid /><PolarAngleAxis dataKey="month" tickLine={false} />
354
+ <ChartTooltip content={<ChartTooltipContent />} />
355
+ <Radar dataKey="desktop" hide={legendSolo === "mobile"} fill="var(--color-desktop)" fillOpacity={0.12} stroke="var(--color-desktop)" isAnimationActive="auto" />
356
+ <Radar dataKey="mobile" hide={legendSolo === "desktop"} fill="var(--color-mobile)" fillOpacity={0.12} stroke="var(--color-mobile)" isAnimationActive="auto" />
357
+ <ChartLegend content={<ChartLegendContent hidden={legendHidden} onItemClick={(key) => setLegendSolo((prev) => prev === key ? null : key)} />} />
358
+ </RadarChart>
359
+ </ChartContainer>
360
+ </ExampleBlock>
361
+ </section>
362
+
363
+ <section id="use-cases">
364
+ <h2>In Use</h2>
365
+ <h3>{en ? "Product quality card" : "제품 품질 카드"}</h3>
366
+ <ExampleBlock previewWidth="full"><QualityCardExample /></ExampleBlock>
367
+ </section>
368
+
369
+ <section id="api">
370
+ <h2>{t.api.heading}</h2>
371
+ <p className="desc">
372
+ {t.api.desc}{" "}<a href="https://recharts.github.io/en-US/api/Radar" target="_blank" rel="noreferrer">{t.api.official}</a>{en ? "." : "에서 확인하세요."}
373
+ </p>
374
+ <h3>Radar</h3>
375
+ <DocsTable
376
+ columns={[
377
+ { key: "prop", label: "Prop", width: 160 },
378
+ { key: "type", label: "Type", flex: true, minWidth: 220 },
379
+ { key: "default", label: en ? "Default" : "기본값", width: 120 },
380
+ { key: "desc", label: en ? "Description" : "설명", flex: true, minWidth: 260 },
381
+ ]}
382
+ rows={[
383
+ { prop: "dataKey", type: "DataKey", default: "-", desc: en ? "Numeric series key." : "수치를 읽을 데이터 키입니다." },
384
+ { prop: "fill", type: "string", default: "-", desc: en ? "Area fill color." : "영역을 채울 색상입니다." },
385
+ { prop: "fillOpacity", type: "number", default: "-", desc: en ? "Area translucency." : "채움의 불투명도를 지정합니다." },
386
+ { prop: "stroke", type: "string", default: "-", desc: en ? "Outline color." : "윤곽선의 색상입니다." },
387
+ { prop: "dot", type: "boolean | object | function", default: "false", desc: en ? "Vertex marker." : "각 지점의 표시를 설정합니다." },
388
+ { prop: "connectNulls", type: "boolean", default: "false", desc: en ? "Connect across missing values." : "누락된 값 사이의 선을 연결합니다." },
389
+ ]}
390
+ />
391
+ <h3>PolarGrid</h3>
392
+ <DocsTable
393
+ columns={[
394
+ { key: "prop", label: "Prop", width: 160 },
395
+ { key: "type", label: "Type", flex: true, minWidth: 220 },
396
+ { key: "default", label: en ? "Default" : "기본값", width: 120 },
397
+ { key: "desc", label: en ? "Description" : "설명", flex: true, minWidth: 260 },
398
+ ]}
399
+ rows={[
400
+ { prop: "gridType", type: '"polygon" | "circle"', default: '"polygon"', desc: en ? "Grid geometry." : "격자의 형태를 선택합니다." },
401
+ { prop: "radialLines", type: "boolean", default: "true", desc: en ? "Center-to-edge spokes." : "중심에서 바깥으로 이어지는 선을 표시합니다." },
402
+ { prop: "polarRadius", type: "number[]", default: "-", desc: en ? "Explicit ring radii." : "격자 원의 반지름을 지정합니다." },
403
+ ]}
404
+ />
405
+ </section>
406
+ </>
407
+ );
408
+ }
409
+ ````
410
+
411
+ ### Source: web/examples/ChartCardExamples.module.css
412
+
413
+ ````css
414
+ .card {
415
+ --chart-card-width: 384px; /* lint-hardcoded: ignore */
416
+ --chart-card-wide: 560px; /* lint-hardcoded: ignore */
417
+ --chart-card-plot-height: 208px; /* lint-hardcoded: ignore */
418
+ --chart-card-round-size: 208px; /* lint-hardcoded: ignore */
419
+ display: flex;
420
+ flex-direction: column;
421
+ gap: var(--space-4);
422
+ width: 100%;
423
+ max-width: var(--chart-card-width);
424
+ min-width: 0;
425
+ padding-top: var(--space-6);
426
+ }
427
+
428
+ .wide {
429
+ max-width: var(--chart-card-wide);
430
+ --comparison-chart-height: 248px; /* lint-hardcoded: ignore */
431
+ }
432
+
433
+ .header {
434
+ display: flex;
435
+ flex-direction: column;
436
+ gap: var(--space-1);
437
+ }
438
+
439
+ .header h3 {
440
+ margin: 0;
441
+ font-size: var(--text-base);
442
+ font-weight: var(--font-weight-semibold);
443
+ line-height: var(--lh-tight);
444
+ }
445
+
446
+ .header > span,
447
+ .center > span,
448
+ .goalCaption {
449
+ color: var(--fg-muted);
450
+ font-size: var(--text-sm);
451
+ line-height: var(--lh-base);
452
+ }
453
+
454
+ .metric {
455
+ display: flex;
456
+ align-items: baseline;
457
+ gap: var(--space-2);
458
+ font-size: var(--text-3xl);
459
+ font-weight: var(--font-weight-book);
460
+ line-height: var(--lh-tight);
461
+ font-variant-numeric: tabular-nums;
462
+ }
463
+
464
+ .metric > span {
465
+ font-size: var(--text-sm);
466
+ color: var(--fg-muted);
467
+ }
468
+
469
+ .cartesian {
470
+ height: var(--chart-card-plot-height);
471
+ aspect-ratio: auto;
472
+ min-width: 0;
473
+ }
474
+
475
+ .donutWrap {
476
+ position: relative;
477
+ display: grid;
478
+ place-items: center;
479
+ }
480
+
481
+ .donut,
482
+ .radial {
483
+ width: var(--chart-card-round-size);
484
+ max-width: 100%;
485
+ height: var(--chart-card-round-size);
486
+ aspect-ratio: 1;
487
+ align-self: center;
488
+ }
489
+
490
+ .center {
491
+ position: absolute;
492
+ display: flex;
493
+ flex-direction: column;
494
+ align-items: center;
495
+ gap: 0;
496
+ pointer-events: none;
497
+ }
498
+
499
+ .center strong {
500
+ font-size: var(--text-3xl);
501
+ font-weight: var(--font-weight-book);
502
+ line-height: var(--lh-tight);
503
+ font-variant-numeric: tabular-nums;
504
+ }
505
+
506
+ .center > span {
507
+ font-size: var(--text-xs);
508
+ line-height: var(--lh-tight);
509
+ }
510
+
511
+ .radar {
512
+ height: auto;
513
+ aspect-ratio: 1.3;
514
+ }
515
+
516
+ .goalValue {
517
+ fill: var(--fg);
518
+ font-size: var(--text-4xl);
519
+ font-weight: var(--font-weight-book);
520
+ }
521
+
522
+ .percent {
523
+ fill: var(--fg-muted);
524
+ font-size: var(--text-base);
525
+ }
526
+
527
+ .goalCaption {
528
+ margin: 0;
529
+ text-align: center;
530
+ }
531
+
532
+ .goalCaption strong {
533
+ color: var(--fg);
534
+ font-weight: var(--font-weight-medium);
535
+ }
536
+
537
+ /* Keep Button padding and hover area; align its content with the card heading. */
538
+ .breakdown {
539
+ margin-inline: calc((var(--space-3) + var(--hairline)) * -1);
540
+ }
541
+
542
+ .breakdown > ul {
543
+ width: 100%;
544
+ max-width: none;
545
+ }
546
+
547
+ @media (max-width: 360px) {
548
+ .radar {
549
+ aspect-ratio: 1.4;
550
+ }
551
+ }
552
+ ````
553
+
554
+ ### Source: web/examples/ChartCardExamples.tsx
555
+
556
+ ````tsx
557
+ "use client";
558
+
559
+ import { useId, useState, type ReactNode } from "react";
560
+ import {
561
+ Area, AreaChart, Bar, BarChart, CartesianGrid, Cell, Label, Pie, PieChart,
562
+ PolarAngleAxis, PolarGrid, PolarRadiusAxis, Radar, RadarChart,
563
+ RadialBar, RadialBarChart, XAxis,
564
+ } from "recharts";
565
+ import { Card } from "@/components/Card";
566
+ import { ChartContainer, ChartTooltip, ChartTooltipContent, type ChartConfig } from "@/components/Chart";
567
+ import { ChartItemLegend } from "@/app/_components/ChartItemLegend";
568
+ import { TrafficComparisonExample } from "./TrafficComparisonExample";
569
+ import styles from "./ChartCardExamples.module.css";
570
+
571
+ function ChartCard({ title, period, children, wide = false }: {
572
+ title: string; period: string; children: ReactNode; wide?: boolean;
573
+ }) {
574
+ return <Card variant="framed" className={`${styles.card} ${wide ? styles.wide : ""}`}>
575
+ <div className={styles.header}><h3>{title}</h3><span>{period}</span></div>
576
+ {children}
577
+ </Card>;
578
+ }
579
+
580
+ export function TrafficCardExample() {
581
+ return <ChartCard title="Website traffic" period="Today · 10:30 AM" wide>
582
+ <TrafficComparisonExample />
583
+ </ChartCard>;
584
+ }
585
+
586
+ const revenue = [
587
+ { day: "Mon", revenue: 2400 }, { day: "Tue", revenue: 3200 },
588
+ { day: "Wed", revenue: 2800 }, { day: "Thu", revenue: 4100 },
589
+ { day: "Fri", revenue: 3600 }, { day: "Sat", revenue: 4800 }, { day: "Sun", revenue: 4200 },
590
+ ];
591
+ const revenueConfig = { revenue: { label: "Revenue", color: "var(--chart-1)" } } satisfies ChartConfig;
592
+
593
+ export function RevenueCardExample() {
594
+ const gradient = `revenue-${useId().replace(/:/g, "")}`;
595
+ const total = revenue.reduce((sum, row) => sum + row.revenue, 0);
596
+ return <ChartCard title="Weekly revenue" period="Oct 26 – Nov 1">
597
+ <div className={styles.metric}>{total.toLocaleString("en-US", { style: "currency", currency: "USD", maximumFractionDigits: 0 })}</div>
598
+ <ChartContainer config={revenueConfig} className={styles.cartesian} aria-label="Daily revenue for October 26 to November 1">
599
+ <AreaChart data={revenue} accessibilityLayer margin={{ left: 12, right: 12, top: 16, bottom: 0 }}>
600
+ <defs><linearGradient id={gradient} x1="0" y1="0" x2="0" y2="1">
601
+ <stop offset="0%" stopColor="var(--color-revenue)" stopOpacity={0.24} />
602
+ <stop offset="100%" stopColor="var(--color-revenue)" stopOpacity={0} />
603
+ </linearGradient></defs>
604
+ <CartesianGrid vertical={false} />
605
+ <XAxis dataKey="day" tickLine={false} axisLine={false} tickMargin={10} interval="preserveStartEnd" />
606
+ <ChartTooltip content={<ChartTooltipContent indicator="line" />} />
607
+ <Area dataKey="revenue" type="monotone" fill={`url(#${gradient})`} stroke="var(--color-revenue)" isAnimationActive={false} />
608
+ </AreaChart>
609
+ </ChartContainer>
610
+ </ChartCard>;
611
+ }
612
+
613
+ const support = [
614
+ { day: "Mon", tickets: 42 }, { day: "Tue", tickets: 58 }, { day: "Wed", tickets: 35 },
615
+ { day: "Thu", tickets: 47 }, { day: "Fri", tickets: 64 },
616
+ ];
617
+ const supportConfig = { tickets: { label: "Tickets", color: "var(--chart-1)" } } satisfies ChartConfig;
618
+
619
+ export function SupportCardExample() {
620
+ return <ChartCard title="Support requests" period="Oct 26–30">
621
+ <div className={styles.metric}>{support.reduce((sum, row) => sum + row.tickets, 0)}<span>tickets</span></div>
622
+ <ChartContainer config={supportConfig} className={styles.cartesian} aria-label="Support requests by weekday">
623
+ <BarChart data={support} accessibilityLayer maxBarSize={32} margin={{ top: 16, right: 0, bottom: 0, left: 0 }}>
624
+ <CartesianGrid vertical={false} />
625
+ <XAxis dataKey="day" tickLine={false} axisLine={false} tickMargin={10} interval="preserveStartEnd" />
626
+ <ChartTooltip cursor={false} content={<ChartTooltipContent />} />
627
+ <Bar dataKey="tickets" fill="var(--color-tickets)" radius={[6, 6, 0, 0]} isAnimationActive={false} />
628
+ </BarChart>
629
+ </ChartContainer>
630
+ </ChartCard>;
631
+ }
632
+
633
+ const acquisition = [
634
+ { id: "organic", label: "Organic search", value: 1820, color: "var(--chart-1)" },
635
+ { id: "direct", label: "Direct", value: 1140, color: "var(--chart-2)" },
636
+ { id: "referral", label: "Referral", value: 680, color: "var(--chart-3)" },
637
+ { id: "social", label: "Social", value: 360, color: "var(--chart-4)" },
638
+ ];
639
+ const acquisitionConfig = Object.fromEntries(acquisition.map(row => [row.id, { label: row.label, color: row.color }])) satisfies ChartConfig;
640
+
641
+ export function AcquisitionCardExample() {
642
+ const [selected, setSelected] = useState<string | null>(null);
643
+ const current = acquisition.find(row => row.id === selected);
644
+ const value = current?.value ?? acquisition.reduce((sum, row) => sum + row.value, 0);
645
+ return <ChartCard title="Acquisition sources" period="October 2026">
646
+ <div className={styles.donutWrap}>
647
+ <ChartContainer config={acquisitionConfig} className={styles.donut} aria-label="October visitors by acquisition source">
648
+ <PieChart accessibilityLayer>
649
+ <ChartTooltip content={<ChartTooltipContent nameKey="id" hideLabel />} />
650
+ <Pie data={acquisition} dataKey="value" nameKey="id" innerRadius="72%" outerRadius="92%" paddingAngle={3} stroke="var(--bg)" isAnimationActive={false}>
651
+ {acquisition.map(row => <Cell key={row.id} fill={`var(--color-${row.id})`} opacity={selected && selected !== row.id ? 0.18 : 1} />)}
652
+ </Pie>
653
+ </PieChart>
654
+ </ChartContainer>
655
+ <div className={styles.center} aria-live="polite"><strong>{value.toLocaleString("en-US")}</strong><span>{current?.label ?? "Visitors"}</span></div>
656
+ </div>
657
+ <div className={styles.breakdown}><ChartItemLegend items={acquisition} selected={selected} onSelect={key => setSelected(value => value === key ? null : key)} /></div>
658
+ </ChartCard>;
659
+ }
660
+
661
+ const quality = [
662
+ { axis: "Speed", current: 86, previous: 62 }, { axis: "Reliability", current: 92, previous: 78 },
663
+ { axis: "Ease of use", current: 78, previous: 65 }, { axis: "Features", current: 84, previous: 72 },
664
+ { axis: "Support", current: 90, previous: 80 },
665
+ ];
666
+ const qualityConfig = {
667
+ current: { label: "Current release", color: "var(--chart-1)" },
668
+ previous: { label: "Previous release", color: "var(--chart-3)" },
669
+ } satisfies ChartConfig;
670
+
671
+ export function QualityCardExample() {
672
+ const [selected, setSelected] = useState<string | null>(null);
673
+ return <ChartCard title="Product quality" period="Score out of 100">
674
+ <ChartContainer config={qualityConfig} className={styles.radar} aria-label="Current and previous release quality scores out of 100">
675
+ <RadarChart data={quality} accessibilityLayer outerRadius="60%">
676
+ <PolarGrid radialLines={false} />
677
+ <PolarAngleAxis dataKey="axis" tickLine={false} tickSize={4} />
678
+ <PolarRadiusAxis domain={[0, 100]} tick={false} axisLine={false} />
679
+ <ChartTooltip content={<ChartTooltipContent />} />
680
+ <Radar dataKey="previous" hide={selected === "current"} stroke="var(--color-previous)" fill="var(--color-previous)" fillOpacity={0.08} isAnimationActive={false} />
681
+ <Radar dataKey="current" hide={selected === "previous"} stroke="var(--color-current)" fill="var(--color-current)" fillOpacity={0.16} isAnimationActive={false} />
682
+ </RadarChart>
683
+ </ChartContainer>
684
+ <ChartItemLegend compact items={Object.entries(qualityConfig).map(([id, row]) => ({ id, label: row.label, color: row.color, value: 0 }))}
685
+ selected={selected} onSelect={key => setSelected(value => value === key ? null : key)} />
686
+ </ChartCard>;
687
+ }
688
+
689
+ const goal = { completed: 72, target: 100 };
690
+ const goalConfig = { completed: { label: "Completed", color: "var(--chart-1)" } } satisfies ChartConfig;
691
+
692
+ export function GoalCardExample() {
693
+ const percentage = Math.round(goal.completed / goal.target * 100);
694
+ return <ChartCard title="Monthly goal" period="November 2026">
695
+ <ChartContainer config={goalConfig} className={styles.radial} aria-label={`${goal.completed} of ${goal.target} reports completed, ${percentage}%`}>
696
+ <RadialBarChart data={[goal]} accessibilityLayer startAngle={90} endAngle={-270} innerRadius="78%" outerRadius="100%" barSize={14}>
697
+ <PolarAngleAxis type="number" domain={[0, goal.target]} tick={false} />
698
+ <RadialBar dataKey="completed" fill="var(--color-completed)" background={{ fill: "var(--bg-muted)" }} cornerRadius={8} isAnimationActive={false} />
699
+ <PolarRadiusAxis tick={false} tickLine={false} axisLine={false}>
700
+ <Label position="center" content={({ x, y }) => {
701
+ if (x == null || y == null) return null;
702
+ return <text x={x} y={y} textAnchor="middle" dominantBaseline="central" className={styles.goalValue}>{percentage}<tspan className={styles.percent}>%</tspan></text>;
703
+ }} />
704
+ </PolarRadiusAxis>
705
+ </RadialBarChart>
706
+ </ChartContainer>
707
+ <p className={styles.goalCaption}><strong>{goal.completed}</strong> of {goal.target} reports completed</p>
708
+ </ChartCard>;
709
+ }
710
+ ````
711
+
712
+ ### Source: web/examples/TrafficComparisonExample.module.css
713
+
714
+ ````css
715
+ .chart {
716
+ width: 100%;
717
+ min-width: 0;
718
+ height: var(--comparison-chart-height, 320px); /* lint-hardcoded: ignore */
719
+ aspect-ratio: auto;
720
+ }
721
+
722
+ .currentLine,
723
+ .previousLine {
724
+ display: inline-block;
725
+ width: var(--space-3);
726
+ height: 0;
727
+ flex-shrink: 0;
728
+ border-top: 2px solid var(--color-today); /* lint-hardcoded: ignore */
729
+ }
730
+
731
+ .previousLine {
732
+ border-top-style: dotted;
733
+ border-top-color: var(--color-yesterday);
734
+ }
735
+ ````
736
+
737
+ ### Source: web/examples/TrafficComparisonExample.tsx
738
+
739
+ ````tsx
740
+ "use client";
741
+
742
+ import { CartesianGrid, Line, LineChart, XAxis, YAxis } from "recharts";
743
+ import { ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent, type ChartConfig } from "@/components/Chart";
744
+ import styles from "./TrafficComparisonExample.module.css";
745
+
746
+ const today = [0, 0, 1720, 2100, 2280, 1950, 2800, 2200, 2480, 2890, 3300, 3250, 3905];
747
+ const yesterday = [0, 430, 260, 450, 510, 780, 520, 760, 470, 790, 1260, 1430, 2545];
748
+ const minutes = [0, 30, 60, 120, 180, 240, 300, 360, 420, 480, 540, 600, 630];
749
+ const data = today.map((value, index) => ({ minute: minutes[index], today: value as number | null, yesterday: yesterday[index] as number | null }));
750
+ data.push({ minute: 1439, today: null, yesterday: null });
751
+
752
+ function CurrentLine() { return <span className={styles.currentLine} />; }
753
+ function PreviousLine() { return <span className={styles.previousLine} />; }
754
+ const config = {
755
+ today: { label: "Today", color: "var(--chart-1)", icon: CurrentLine },
756
+ yesterday: { label: "Yesterday", color: "var(--fg-muted)", icon: PreviousLine },
757
+ } satisfies ChartConfig;
758
+
759
+ function formatTime(value: number) {
760
+ const hour = Math.floor(value / 60);
761
+ const minute = Math.floor(value % 60);
762
+ return `${hour % 12 || 12}:${String(minute).padStart(2, "0")}${hour < 12 ? "AM" : "PM"}`;
763
+ }
764
+
765
+ export function TrafficComparisonExample() {
766
+ return <ChartContainer config={config} className={styles.chart} role="group"
767
+ aria-label="Website visitors by time. At 10:30AM, today has 3,905 visitors and yesterday had 2,545.">
768
+ <LineChart data={data} accessibilityLayer margin={{ top: 12, right: 16, bottom: 8, left: 0 }}>
769
+ <CartesianGrid vertical={false} strokeOpacity={0.45} />
770
+ <XAxis dataKey="minute" type="number" domain={[0, 1439]} ticks={[0, 720, 1439]}
771
+ tickFormatter={formatTime} tickLine={false} axisLine={false} tickMargin={12} minTickGap={32} />
772
+ <YAxis domain={[0, 5000]} ticks={[0, 1000, 2000, 3000, 4000, 5000]} interval={0} width={40}
773
+ tickFormatter={(value: number) => value === 0 ? "0" : `${value / 1000}K`}
774
+ tickLine={false} axisLine={false} tickMargin={8} />
775
+ <ChartTooltip cursor={{ stroke: "var(--fg-muted)", strokeWidth: 1 }}
776
+ content={<ChartTooltipContent indicator="line" labelFormatter={(value) => `Today at ${formatTime(Number(value))}`} />} />
777
+ <ChartLegend align="left" content={<ChartLegendContent />} />
778
+ <Line dataKey="today" type="monotone" stroke="var(--color-today)" strokeWidth={1.75}
779
+ dot={false} activeDot={{ r: 4, fill: "var(--bg)", stroke: "var(--color-today)", strokeWidth: 1.75 }} isAnimationActive={false} />
780
+ <Line dataKey="yesterday" type="linear" stroke="var(--color-yesterday)" strokeWidth={1.5}
781
+ strokeDasharray="2 4" strokeLinecap="round" dot={false} activeDot={false} isAnimationActive={false} />
782
+ </LineChart>
783
+ </ChartContainer>;
784
+ }
785
+ ````