feat(chart): add @hm-design/chart package with Bar, Line, Donut, Pie, Radar, Area and Radial charts
- new workspace package packages/chart (shadcn/ui Chart + Recharts, HM Theme tokens), examples entry with sample data - Storybook Chart group (src/chart), consumer example (examples/chart), build:chart / build:chart-example scripts - README rewritten as the AI usage guide (install, CSS wiring, chart selection, data rules, verification) - docs: package count/list, Submodule guide (chart workspace, React dedupe), shared AI_GUIDE row, MAINTAINING, story inventory
This commit is contained in:
1 parent
228944a06b
commit
dc9258599c
56 files changed
+3979
-28
No files matched your search
@@ -0,0 +1 @@
|
||||
@import "@hm-design/ui/theme.css";
|
||||
@@ -0,0 +1,9 @@
|
||||
@import "tailwindcss" source("./");
|
||||
@import "@hm-design/ui/tailwind.css";
|
||||
@import "@hm-design/chart/tailwind.css";
|
||||
|
||||
body { margin: 0; background: var(--hm-sem-bg-content); color: var(--hm-sem-fg-primary); font-family: var(--hm-font-family-base); }
|
||||
.chart-example { min-height: 100dvh; }
|
||||
.chart-example-main { display: grid; min-width: 0; gap: 24px; max-width: 1180px; margin-inline: auto; padding: 24px 16px; }
|
||||
.chart-example-main h1 { margin: 0; font-size: 24px; font-weight: var(--hm-font-weight-bold); }
|
||||
.chart-example-main p { margin: 0; color: var(--hm-sem-fg-secondary); }
|
||||
@@ -0,0 +1,2 @@
|
||||
<!doctype html>
|
||||
<html lang="ko"><head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>HMDesign 차트 예제</title><link rel="icon" href="data:," /></head><body><div id="root"></div><script type="module" src="./main.tsx"></script></body></html>
|
||||
@@ -0,0 +1,27 @@
|
||||
import { StrictMode } from "react"
|
||||
import { createRoot } from "react-dom/client"
|
||||
import { AreaStackedExample, ChartExamples, PieLabelExample, RadarPlainExample, RadialTextExample } from "@hm-design/chart/examples"
|
||||
import "./index.css"
|
||||
import "./hm-theme.css"
|
||||
|
||||
// Consumer of the public @hm-design/chart entries only: bar, line and donut sample cards plus one Pie, Radar, Area and Radial example.
|
||||
createRoot(document.getElementById("root")!).render(
|
||||
<StrictMode>
|
||||
<div className="chart-example">
|
||||
<main className="chart-example-main">
|
||||
<header>
|
||||
<h1>HMDesign 차트 예제</h1>
|
||||
<p>막대·선·도넛 차트와 파이·방사형(Radar)·영역·래디얼 차트 예시의 표시와 툴팁·범례·반응형 동작을 확인하는 화면입니다. 모든 값은 예시 데이터입니다.</p>
|
||||
</header>
|
||||
<ChartExamples />
|
||||
{/* One example each of the Pie, Radar, Area and Radial charts. */}
|
||||
<div className="grid grid-cols-1 gap-6 lg:grid-cols-2">
|
||||
<PieLabelExample className="min-w-0" />
|
||||
<RadarPlainExample className="min-w-0" />
|
||||
<AreaStackedExample className="min-w-0" />
|
||||
<RadialTextExample className="min-w-0" />
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</StrictMode>,
|
||||
)
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.app.json",
|
||||
"compilerOptions": { "composite": false, "noEmit": true, "types": ["vite/client"], "tsBuildInfoFile": "../../_local/chart-example.tsbuildinfo" },
|
||||
"include": ["main.tsx", "vite.config.ts"]
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { defineConfig } from "vite"
|
||||
import react from "@vitejs/plugin-react"
|
||||
import tailwindcss from "@tailwindcss/vite"
|
||||
import { fileURLToPath } from "node:url"
|
||||
|
||||
// Consumer example of @hm-design/chart. The fonts come from the repository public folder like the publisher example.
|
||||
export default defineConfig({
|
||||
root: fileURLToPath(new URL("./", import.meta.url)),
|
||||
publicDir: fileURLToPath(new URL("../../public", import.meta.url)),
|
||||
base: "./",
|
||||
plugins: [react(), tailwindcss()],
|
||||
server: { host: "127.0.0.1" },
|
||||
})
|
||||
Reference in new issue
Block a user