@7onic-ui/react 0.1.1 → 0.2.1

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.
package/README.md CHANGED
@@ -94,6 +94,7 @@ Use components:
94
94
 
95
95
  ```tsx
96
96
  import { Button, Card } from '@7onic-ui/react'
97
+ import { Chart, type ChartConfig } from '@7onic-ui/react/chart' // charts: separate entry
97
98
 
98
99
  <Button variant="solid" color="primary">Get Started</Button>
99
100
 
@@ -175,6 +176,9 @@ Breaking changes are auto-detected with diff visualization. Backward-compatible
175
176
  | `dist/index.js` | CJS | CommonJS for Node.js / require() |
176
177
  | `dist/index.mjs` | ESM | ES Modules for bundlers / import |
177
178
  | `dist/index.d.ts` | Types | TypeScript definitions |
179
+ | `dist/chart.js` | CJS | Chart components (separate entry — `@7onic-ui/react/chart`) |
180
+ | `dist/chart.mjs` | ESM | Chart components ESM |
181
+ | `dist/chart.d.ts` | Types | Chart TypeScript definitions |
178
182
  | `llms.txt` | Text | AI integration rules (llms.txt standard) |
179
183
 
180
184
  ### `@7onic-ui/tokens`
@@ -194,6 +198,14 @@ Breaking changes are auto-detected with diff visualization. Backward-compatible
194
198
  | `json/tokens.json` | Flat JSON for custom tooling |
195
199
  | `cli/sync.js` | `npx sync-tokens` CLI |
196
200
  | `figma-tokens.json` | SSOT — the only file you edit |
201
+ | `llms.txt` | AI integration rules for tokens |
202
+
203
+ ### `7onic` (CLI)
204
+
205
+ | File | Description |
206
+ |------|-------------|
207
+ | `dist/index.js` | Self-contained CLI bundle |
208
+ | `llms.txt` | AI integration — CLI command reference |
197
209
 
198
210
  </details>
199
211
 
@@ -218,16 +230,12 @@ Works with Claude Code, Cursor, GitHub Copilot, ChatGPT, and any AI tool that re
218
230
 
219
231
  ## Tech Stack
220
232
 
221
- | | |
233
+ | Category | Technology |
222
234
  |---|---|
223
- | **Framework** | Next.js 14 + React 18 |
224
- | **Language** | TypeScript 5 |
225
235
  | **Styling** | Tailwind CSS v3 / v4 + CSS Variables |
226
236
  | **Primitives** | Radix UI |
227
237
  | **Charts** | Recharts |
228
- | **Tokens** | Figma Token Studio → `sync-tokens` |
229
238
  | **Variants** | class-variance-authority (CVA) |
230
- | **Build** | tsup (library), Next.js (docs) |
231
239
 
232
240
  ---
233
241
 
@@ -243,19 +251,15 @@ Works with Claude Code, Cursor, GitHub Copilot, ChatGPT, and any AI tool that re
243
251
  - [x] Automated doc verification (8 checks, AST-powered, blocks publish on error)
244
252
  - [x] Automated component verification (7 checks — hardcoded colors, tokens, dark mode, dead code)
245
253
  - [x] Multilingual documentation — English, Japanese, Korean (powered by next-intl)
246
- - [x] npm package distribution — `@7onic-ui/react` + `@7onic-ui/tokens` v0.1.0
254
+ - [x] npm package distribution — `@7onic-ui/react` + `@7onic-ui/tokens` v0.2.0
247
255
  - [x] AI integration — `llms.txt` standard, setup guides for Claude Code / Cursor / Copilot / ChatGPT
248
256
  - [ ] Theme Customizer (live color preview)
249
- - [ ] `npx 7onic add` CLI (shadcn-style)
257
+ - [x] `npx 7onic add` CLI (shadcn-style) — source copy with dependency resolution
250
258
  - [ ] Figma UI Kit
251
259
  - [ ] Dashboard / landing templates
252
260
 
253
261
  ---
254
262
 
255
- ## Contact
256
-
257
- hello@7onic.io
258
-
259
263
  ## License
260
264
 
261
265
  MIT
@@ -264,5 +268,6 @@ MIT
264
268
 
265
269
  <p align="center">
266
270
  <strong>One JSON, every format — from Figma to production.</strong><br>
267
- Independently built.
271
+ Independently built.<br>
272
+ <sub>Last updated: 2026-04-09</sub>
268
273
  </p>
@@ -0,0 +1,163 @@
1
+ import * as React from 'react';
2
+ import * as RechartsPrimitive from 'recharts';
3
+
4
+ declare const THEMES: {
5
+ readonly light: "";
6
+ readonly dark: ".dark";
7
+ };
8
+ type ChartConfig = {
9
+ [k in string]: {
10
+ label?: React.ReactNode;
11
+ icon?: React.ComponentType;
12
+ } & ({
13
+ color?: string;
14
+ theme?: never;
15
+ } | {
16
+ color?: never;
17
+ theme: Record<keyof typeof THEMES, string>;
18
+ });
19
+ };
20
+ type ChartContextProps = {
21
+ config: ChartConfig;
22
+ hoverFade: boolean;
23
+ activeIndex: number | null;
24
+ setActiveIndex: (index: number | null) => void;
25
+ activeDataKey: string | null;
26
+ setActiveDataKey: (key: string | null) => void;
27
+ };
28
+ declare function useChart(): ChartContextProps;
29
+ declare function ChartContainer({ id, className, children, config, hoverFade, ...props }: React.ComponentProps<'div'> & {
30
+ config: ChartConfig;
31
+ /** Enable hover-to-highlight: hovered bar group stays full opacity, others fade. */
32
+ hoverFade?: boolean;
33
+ children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];
34
+ }): React.JSX.Element;
35
+ declare const ChartStyle: ({ id, config }: {
36
+ id: string;
37
+ config: ChartConfig;
38
+ }) => React.JSX.Element;
39
+ type ChartBarRadius = 'none' | 'sm' | 'base' | 'md' | 'lg';
40
+ type ChartBarVariant = 'solid' | 'outline';
41
+ type ChartBarProps = Omit<React.ComponentProps<typeof RechartsPrimitive.Bar>, 'radius'> & {
42
+ /** Named radius token. Auto-adapts corners based on layout and stack position. */
43
+ radius?: ChartBarRadius;
44
+ /** 'horizontal' rounds the right side (away from Y-axis). Default: 'vertical' */
45
+ layout?: 'vertical' | 'horizontal';
46
+ /** 'bottom' rounds the bottom corners (base of a stack). Default: 'top' */
47
+ stackPosition?: 'top' | 'bottom';
48
+ /** 'outline' renders a thick border with a semi-transparent fill. Default: 'solid' */
49
+ variant?: ChartBarVariant;
50
+ };
51
+ declare function ChartBar({ radius, layout, stackPosition, variant, fill, stackId, ...props }: ChartBarProps): React.JSX.Element;
52
+ declare function ChartTooltip(props: React.ComponentProps<typeof RechartsPrimitive.Tooltip>): React.JSX.Element;
53
+ type TooltipPayloadItem = {
54
+ dataKey?: string | number;
55
+ name?: string;
56
+ value?: number | string;
57
+ type?: string;
58
+ color?: string;
59
+ payload?: Record<string, unknown>;
60
+ fill?: string;
61
+ };
62
+ type ChartTooltipContentProps = React.ComponentProps<'div'> & {
63
+ active?: boolean;
64
+ payload?: TooltipPayloadItem[];
65
+ label?: string;
66
+ labelFormatter?: (value: unknown, payload: TooltipPayloadItem[]) => React.ReactNode;
67
+ labelClassName?: string;
68
+ formatter?: (value: unknown, name: string, item: TooltipPayloadItem, index: number, payload: Record<string, unknown>) => React.ReactNode;
69
+ color?: string;
70
+ hideLabel?: boolean;
71
+ hideIndicator?: boolean;
72
+ indicator?: 'line' | 'dot' | 'dashed';
73
+ nameKey?: string;
74
+ labelKey?: string;
75
+ };
76
+ declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }: ChartTooltipContentProps): React.JSX.Element | null;
77
+ declare const ChartLegend: React.MemoExoticComponent<(outsideProps: RechartsPrimitive.LegendProps) => React.ReactPortal | null>;
78
+ type LegendPayloadItem = {
79
+ value?: string;
80
+ type?: string;
81
+ color?: string;
82
+ dataKey?: string;
83
+ };
84
+ type ChartLegendContentProps = React.ComponentProps<'div'> & {
85
+ payload?: LegendPayloadItem[];
86
+ verticalAlign?: 'top' | 'middle' | 'bottom';
87
+ align?: 'left' | 'center' | 'right';
88
+ /** Recharts passes layout when Legend uses layout prop */
89
+ layout?: 'horizontal' | 'vertical';
90
+ hideIcon?: boolean;
91
+ nameKey?: string;
92
+ };
93
+ declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, align, layout, nameKey, }: ChartLegendContentProps): React.JSX.Element | null;
94
+ type ChartXAxisProps = React.ComponentProps<typeof RechartsPrimitive.XAxis>;
95
+ type ChartYAxisProps = React.ComponentProps<typeof RechartsPrimitive.YAxis>;
96
+ declare function ChartXAxis({ tick, padding, ...props }: ChartXAxisProps): React.JSX.Element;
97
+ declare function ChartYAxis({ tick, width, ...props }: ChartYAxisProps): React.JSX.Element;
98
+ type ChartLineType = 'linear' | 'monotone' | 'step' | 'natural';
99
+ type ChartLineVariant = 'solid' | 'dashed';
100
+ type ChartLineProps = Omit<React.ComponentProps<typeof RechartsPrimitive.Line>, 'type' | 'dot' | 'activeDot'> & {
101
+ /** Curve interpolation type. Default: 'monotone' */
102
+ type?: ChartLineType;
103
+ /** Line style. 'dashed' applies stroke-dasharray. Default: 'solid' */
104
+ variant?: ChartLineVariant;
105
+ /** Show data point dots. Default: true */
106
+ dot?: boolean;
107
+ /** Show highlighted dot on hover. Default: true */
108
+ activeDot?: boolean;
109
+ };
110
+ declare function ChartLine({ type, variant, dot: showDot, activeDot: showActiveDot, stroke, dataKey, ...props }: ChartLineProps): React.JSX.Element;
111
+ type ChartAreaType = 'linear' | 'monotone' | 'step' | 'natural';
112
+ type ChartAreaVariant = 'solid' | 'gradient';
113
+ type ChartAreaProps = Omit<React.ComponentProps<typeof RechartsPrimitive.Area>, 'type' | 'dot' | 'activeDot'> & {
114
+ /** Curve interpolation type. Default: 'monotone' */
115
+ type?: ChartAreaType;
116
+ /** Fill style. 'gradient' auto-generates an SVG linearGradient. Default: 'solid' */
117
+ variant?: ChartAreaVariant;
118
+ /** Show data point dots. Default: true */
119
+ dot?: boolean;
120
+ /** Show highlighted dot on hover. Default: true */
121
+ activeDot?: boolean;
122
+ /** Fill opacity for this area (0–1). Default: 0.4 */
123
+ fillOpacity?: number;
124
+ };
125
+ declare function ChartArea({ type, variant, dot: showDot, activeDot: showActiveDot, fillOpacity, stroke, fill, dataKey, ...props }: ChartAreaProps): React.JSX.Element;
126
+ type ChartPieVariant = 'pie' | 'donut';
127
+ type ChartPieLabel = 'none' | 'outside' | 'inside';
128
+ type ChartPieLabelContent = 'value' | 'percent';
129
+ type ChartPieProps = Omit<React.ComponentProps<typeof RechartsPrimitive.Pie>, 'label' | 'labelLine' | 'activeShape'> & {
130
+ /** 'donut' applies innerRadius automatically. Default: 'pie' */
131
+ variant?: ChartPieVariant;
132
+ /** Label position. Default: 'none' */
133
+ label?: ChartPieLabel;
134
+ /** Label display content. Default: 'value' */
135
+ labelContent?: ChartPieLabelContent;
136
+ /** Hover expand effect. Default: true */
137
+ activeShape?: boolean;
138
+ /** Override inner radius (default: 0 for pie, 60 for donut) */
139
+ innerRadius?: number;
140
+ /** Padding angle between slices (degrees). Default: 0 */
141
+ paddingAngle?: number;
142
+ /** Corner radius for slices. Default: 0 */
143
+ cornerRadius?: number;
144
+ };
145
+ declare function ChartPie({ variant, label: labelMode, labelContent, activeShape: showActiveShape, innerRadius, paddingAngle, cornerRadius, startAngle, endAngle, ...props }: ChartPieProps): React.JSX.Element;
146
+ declare const Chart: typeof ChartContainer & {
147
+ Bar: typeof ChartBar;
148
+ Line: typeof ChartLine;
149
+ Area: typeof ChartArea;
150
+ Pie: typeof ChartPie;
151
+ Tooltip: typeof ChartTooltip;
152
+ TooltipContent: typeof ChartTooltipContent;
153
+ Legend: React.MemoExoticComponent<(outsideProps: RechartsPrimitive.LegendProps) => React.ReactPortal | null>;
154
+ LegendContent: typeof ChartLegendContent;
155
+ XAxis: typeof ChartXAxis;
156
+ YAxis: typeof ChartYAxis;
157
+ Style: ({ id, config }: {
158
+ id: string;
159
+ config: ChartConfig;
160
+ }) => React.JSX.Element;
161
+ };
162
+
163
+ export { Chart, ChartArea, type ChartAreaType, type ChartAreaVariant, ChartBar, type ChartBarRadius, type ChartBarVariant, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartLine, type ChartLineType, type ChartLineVariant, ChartPie, type ChartPieLabel, type ChartPieLabelContent, type ChartPieVariant, ChartStyle, ChartTooltip, ChartTooltipContent, ChartXAxis, ChartYAxis, useChart };
@@ -0,0 +1,163 @@
1
+ import * as React from 'react';
2
+ import * as RechartsPrimitive from 'recharts';
3
+
4
+ declare const THEMES: {
5
+ readonly light: "";
6
+ readonly dark: ".dark";
7
+ };
8
+ type ChartConfig = {
9
+ [k in string]: {
10
+ label?: React.ReactNode;
11
+ icon?: React.ComponentType;
12
+ } & ({
13
+ color?: string;
14
+ theme?: never;
15
+ } | {
16
+ color?: never;
17
+ theme: Record<keyof typeof THEMES, string>;
18
+ });
19
+ };
20
+ type ChartContextProps = {
21
+ config: ChartConfig;
22
+ hoverFade: boolean;
23
+ activeIndex: number | null;
24
+ setActiveIndex: (index: number | null) => void;
25
+ activeDataKey: string | null;
26
+ setActiveDataKey: (key: string | null) => void;
27
+ };
28
+ declare function useChart(): ChartContextProps;
29
+ declare function ChartContainer({ id, className, children, config, hoverFade, ...props }: React.ComponentProps<'div'> & {
30
+ config: ChartConfig;
31
+ /** Enable hover-to-highlight: hovered bar group stays full opacity, others fade. */
32
+ hoverFade?: boolean;
33
+ children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];
34
+ }): React.JSX.Element;
35
+ declare const ChartStyle: ({ id, config }: {
36
+ id: string;
37
+ config: ChartConfig;
38
+ }) => React.JSX.Element;
39
+ type ChartBarRadius = 'none' | 'sm' | 'base' | 'md' | 'lg';
40
+ type ChartBarVariant = 'solid' | 'outline';
41
+ type ChartBarProps = Omit<React.ComponentProps<typeof RechartsPrimitive.Bar>, 'radius'> & {
42
+ /** Named radius token. Auto-adapts corners based on layout and stack position. */
43
+ radius?: ChartBarRadius;
44
+ /** 'horizontal' rounds the right side (away from Y-axis). Default: 'vertical' */
45
+ layout?: 'vertical' | 'horizontal';
46
+ /** 'bottom' rounds the bottom corners (base of a stack). Default: 'top' */
47
+ stackPosition?: 'top' | 'bottom';
48
+ /** 'outline' renders a thick border with a semi-transparent fill. Default: 'solid' */
49
+ variant?: ChartBarVariant;
50
+ };
51
+ declare function ChartBar({ radius, layout, stackPosition, variant, fill, stackId, ...props }: ChartBarProps): React.JSX.Element;
52
+ declare function ChartTooltip(props: React.ComponentProps<typeof RechartsPrimitive.Tooltip>): React.JSX.Element;
53
+ type TooltipPayloadItem = {
54
+ dataKey?: string | number;
55
+ name?: string;
56
+ value?: number | string;
57
+ type?: string;
58
+ color?: string;
59
+ payload?: Record<string, unknown>;
60
+ fill?: string;
61
+ };
62
+ type ChartTooltipContentProps = React.ComponentProps<'div'> & {
63
+ active?: boolean;
64
+ payload?: TooltipPayloadItem[];
65
+ label?: string;
66
+ labelFormatter?: (value: unknown, payload: TooltipPayloadItem[]) => React.ReactNode;
67
+ labelClassName?: string;
68
+ formatter?: (value: unknown, name: string, item: TooltipPayloadItem, index: number, payload: Record<string, unknown>) => React.ReactNode;
69
+ color?: string;
70
+ hideLabel?: boolean;
71
+ hideIndicator?: boolean;
72
+ indicator?: 'line' | 'dot' | 'dashed';
73
+ nameKey?: string;
74
+ labelKey?: string;
75
+ };
76
+ declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }: ChartTooltipContentProps): React.JSX.Element | null;
77
+ declare const ChartLegend: React.MemoExoticComponent<(outsideProps: RechartsPrimitive.LegendProps) => React.ReactPortal | null>;
78
+ type LegendPayloadItem = {
79
+ value?: string;
80
+ type?: string;
81
+ color?: string;
82
+ dataKey?: string;
83
+ };
84
+ type ChartLegendContentProps = React.ComponentProps<'div'> & {
85
+ payload?: LegendPayloadItem[];
86
+ verticalAlign?: 'top' | 'middle' | 'bottom';
87
+ align?: 'left' | 'center' | 'right';
88
+ /** Recharts passes layout when Legend uses layout prop */
89
+ layout?: 'horizontal' | 'vertical';
90
+ hideIcon?: boolean;
91
+ nameKey?: string;
92
+ };
93
+ declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, align, layout, nameKey, }: ChartLegendContentProps): React.JSX.Element | null;
94
+ type ChartXAxisProps = React.ComponentProps<typeof RechartsPrimitive.XAxis>;
95
+ type ChartYAxisProps = React.ComponentProps<typeof RechartsPrimitive.YAxis>;
96
+ declare function ChartXAxis({ tick, padding, ...props }: ChartXAxisProps): React.JSX.Element;
97
+ declare function ChartYAxis({ tick, width, ...props }: ChartYAxisProps): React.JSX.Element;
98
+ type ChartLineType = 'linear' | 'monotone' | 'step' | 'natural';
99
+ type ChartLineVariant = 'solid' | 'dashed';
100
+ type ChartLineProps = Omit<React.ComponentProps<typeof RechartsPrimitive.Line>, 'type' | 'dot' | 'activeDot'> & {
101
+ /** Curve interpolation type. Default: 'monotone' */
102
+ type?: ChartLineType;
103
+ /** Line style. 'dashed' applies stroke-dasharray. Default: 'solid' */
104
+ variant?: ChartLineVariant;
105
+ /** Show data point dots. Default: true */
106
+ dot?: boolean;
107
+ /** Show highlighted dot on hover. Default: true */
108
+ activeDot?: boolean;
109
+ };
110
+ declare function ChartLine({ type, variant, dot: showDot, activeDot: showActiveDot, stroke, dataKey, ...props }: ChartLineProps): React.JSX.Element;
111
+ type ChartAreaType = 'linear' | 'monotone' | 'step' | 'natural';
112
+ type ChartAreaVariant = 'solid' | 'gradient';
113
+ type ChartAreaProps = Omit<React.ComponentProps<typeof RechartsPrimitive.Area>, 'type' | 'dot' | 'activeDot'> & {
114
+ /** Curve interpolation type. Default: 'monotone' */
115
+ type?: ChartAreaType;
116
+ /** Fill style. 'gradient' auto-generates an SVG linearGradient. Default: 'solid' */
117
+ variant?: ChartAreaVariant;
118
+ /** Show data point dots. Default: true */
119
+ dot?: boolean;
120
+ /** Show highlighted dot on hover. Default: true */
121
+ activeDot?: boolean;
122
+ /** Fill opacity for this area (0–1). Default: 0.4 */
123
+ fillOpacity?: number;
124
+ };
125
+ declare function ChartArea({ type, variant, dot: showDot, activeDot: showActiveDot, fillOpacity, stroke, fill, dataKey, ...props }: ChartAreaProps): React.JSX.Element;
126
+ type ChartPieVariant = 'pie' | 'donut';
127
+ type ChartPieLabel = 'none' | 'outside' | 'inside';
128
+ type ChartPieLabelContent = 'value' | 'percent';
129
+ type ChartPieProps = Omit<React.ComponentProps<typeof RechartsPrimitive.Pie>, 'label' | 'labelLine' | 'activeShape'> & {
130
+ /** 'donut' applies innerRadius automatically. Default: 'pie' */
131
+ variant?: ChartPieVariant;
132
+ /** Label position. Default: 'none' */
133
+ label?: ChartPieLabel;
134
+ /** Label display content. Default: 'value' */
135
+ labelContent?: ChartPieLabelContent;
136
+ /** Hover expand effect. Default: true */
137
+ activeShape?: boolean;
138
+ /** Override inner radius (default: 0 for pie, 60 for donut) */
139
+ innerRadius?: number;
140
+ /** Padding angle between slices (degrees). Default: 0 */
141
+ paddingAngle?: number;
142
+ /** Corner radius for slices. Default: 0 */
143
+ cornerRadius?: number;
144
+ };
145
+ declare function ChartPie({ variant, label: labelMode, labelContent, activeShape: showActiveShape, innerRadius, paddingAngle, cornerRadius, startAngle, endAngle, ...props }: ChartPieProps): React.JSX.Element;
146
+ declare const Chart: typeof ChartContainer & {
147
+ Bar: typeof ChartBar;
148
+ Line: typeof ChartLine;
149
+ Area: typeof ChartArea;
150
+ Pie: typeof ChartPie;
151
+ Tooltip: typeof ChartTooltip;
152
+ TooltipContent: typeof ChartTooltipContent;
153
+ Legend: React.MemoExoticComponent<(outsideProps: RechartsPrimitive.LegendProps) => React.ReactPortal | null>;
154
+ LegendContent: typeof ChartLegendContent;
155
+ XAxis: typeof ChartXAxis;
156
+ YAxis: typeof ChartYAxis;
157
+ Style: ({ id, config }: {
158
+ id: string;
159
+ config: ChartConfig;
160
+ }) => React.JSX.Element;
161
+ };
162
+
163
+ export { Chart, ChartArea, type ChartAreaType, type ChartAreaVariant, ChartBar, type ChartBarRadius, type ChartBarVariant, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartLine, type ChartLineType, type ChartLineVariant, ChartPie, type ChartPieLabel, type ChartPieLabelContent, type ChartPieVariant, ChartStyle, ChartTooltip, ChartTooltipContent, ChartXAxis, ChartYAxis, useChart };