@7onic-ui/tokens 0.2.2 → 0.2.4

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/llms.txt CHANGED
@@ -1,17 +1,17 @@
1
- # 7onic Design System — AI Guide (Tokens)
1
+ # 7onic Design System — AI Guide (Full)
2
2
 
3
3
  ## What is 7onic?
4
4
 
5
- Token-driven design system. Single source of truth design tokens to code.
6
- Use the token system to style any project with consistent colors, spacing, typography, and more.
5
+ Token-driven React design system with 42 components on Radix UI.
6
+ Single source of truth design tokens to code. Use this to build any React service.
7
7
 
8
8
  - Documentation: https://7onic.design
9
- - npm: `@7onic-ui/tokens` (design tokens)
10
- - For components + tokens guide, see: https://7onic.design/llms-full.txt
9
+ - npm: `@7onic-ui/react` (components) + `@7onic-ui/tokens` (design tokens)
10
+ - For tokens-only guide, see: https://7onic.design/llms.txt
11
11
 
12
12
  ---
13
13
 
14
- # ═══ SECTION 1: PROJECT SETUP ═══
14
+ # ═══ SECTION 1: PROJECT SETUP & AI RULES ═══
15
15
 
16
16
  ## How to Start
17
17
 
@@ -23,18 +23,19 @@ Before writing any code, present this checklist and wait for answers:
23
23
  2. **Dark mode** — Yes or no?
24
24
  3. **Font** — Use default, or custom font? If custom, which font?
25
25
  4. **Locale** — Which language(s)? (for CJK font loading)
26
+ 5. **What are you building?** — Describe the project
26
27
 
27
- **If the user answers in natural language**, extract the answers. **If any item is missing, ask a follow-up question for the missing items only.** Do not proceed until all 4 items are answered.
28
+ **If the user answers in natural language** (e.g., "Make me a dashboard with dark mode, English only"), extract the answers from their message. **If any item is missing, ask a follow-up question for the missing items only.** Do not proceed until all 5 items are answered.
28
29
 
29
30
  ### Step 2: Execute full setup (all at once, do not skip any)
30
31
 
31
32
  After receiving answers, execute ALL of the following in order. Every step is mandatory.
32
33
 
33
- **2-1. Install package (skip if already installed):**
34
+ **2-1. Install packages (skip if already installed):**
34
35
  ```bash
35
- npm install @7onic-ui/tokens
36
+ npm install @7onic-ui/react @7onic-ui/tokens lucide-react
36
37
  ```
37
- > Check package.json first. If already listed in dependencies, skip this step.
38
+ > Check package.json first. If packages are already listed in dependencies, skip this step.
38
39
 
39
40
  **2-2. Create or update globals.css with token imports:**
40
41
 
@@ -44,7 +45,7 @@ npm install @7onic-ui/tokens
44
45
 
45
46
  **New project (Tailwind v4):**
46
47
  ```css
47
- /* globals.css — ALL imports are required, do not skip any */
48
+ /* globals.css (Next.js) or src/index.css (Vite) — ALL imports are required, do not skip any */
48
49
  @import "tailwindcss";
49
50
  @import "@7onic-ui/tokens/css/variables.css";
50
51
  @import "@7onic-ui/tokens/css/themes/light.css";
@@ -52,22 +53,27 @@ npm install @7onic-ui/tokens
52
53
  @import "@7onic-ui/tokens/tailwind/v4-theme.css";
53
54
  ```
54
55
 
56
+ > **Vite + Tailwind v4**: When using CLI (`npx 7onic`), `@import "tailwindcss"` is auto-injected if not present, and `@source "./components/ui"` is auto-injected after `add`. No manual setup needed.
57
+
55
58
  **Existing project with Tailwind v3** (detect from tailwind.config.js):
56
59
  ```css
57
60
  /* globals.css */
58
- @tailwind base;
59
- @tailwind components;
60
- @tailwind utilities;
61
61
  @import '@7onic-ui/tokens/css/variables.css';
62
62
  @import '@7onic-ui/tokens/css/themes/light.css';
63
63
  @import '@7onic-ui/tokens/css/themes/dark.css'; /* omit ONLY if dark mode = no */
64
+ @tailwind base;
65
+ @tailwind components;
66
+ @tailwind utilities;
64
67
  ```
65
68
  ```js
66
69
  // tailwind.config.js — add preset
67
70
  const preset = require('@7onic-ui/tokens/tailwind/v3-preset')
68
71
  module.exports = {
69
72
  presets: [preset],
70
- content: ['./src/**/*.{js,ts,jsx,tsx}'],
73
+ content: [
74
+ './src/**/*.{js,ts,jsx,tsx}',
75
+ './node_modules/@7onic-ui/react/dist/**/*.{js,mjs}',
76
+ ],
71
77
  }
72
78
  ```
73
79
 
@@ -79,12 +85,15 @@ module.exports = {
79
85
  **2-4. Apply user's answers:**
80
86
 
81
87
  - Dark mode = yes → implement dark mode toggle (see below)
82
- - Custom font → load font (next/font for Next.js, CDN for Vite) + set `--font-family-sans`
88
+ - Custom font → load font:
89
+ - **Next.js**: use `next/font/google`
90
+ - **Vite / Remix**: use Fontsource (`npm install @fontsource/inter`, then `import '@fontsource/inter/400.css'` in `src/main.tsx`) or Google Fonts CDN
91
+ - Then set `--font-family-sans` in CSS
83
92
  - Locale includes Japanese → load Noto Sans JP font
84
93
  - Locale includes Korean → load Noto Sans KR font
85
94
 
86
95
  **2-5. Verify setup is complete before writing any UI code:**
87
- - [ ] Package installed (@7onic-ui/tokens)
96
+ - [ ] Packages installed (@7onic-ui/react, @7onic-ui/tokens, lucide-react)
88
97
  - [ ] globals.css has ALL required imports in correct order
89
98
  - [ ] Body has `bg-background text-foreground`
90
99
  - [ ] Dark mode toggle (if selected)
@@ -102,28 +111,48 @@ import { Search, Settings, ChevronDown, X } from 'lucide-react'
102
111
  // ❌ Legacy alias — avoid
103
112
  import { SearchIcon, SettingsIcon } from 'lucide-react'
104
113
 
105
- // ⚠️ Name collision with your own component — use alias
114
+ // ⚠️ Name collision with 7onic component — use alias
115
+ import { Badge } from '@7onic-ui/react'
106
116
  import { Badge as BadgeIcon } from 'lucide-react'
107
117
  ```
108
118
 
109
- ### Step 3: Start building
119
+ ### Step 3: Add Toaster to root layout (if using Toast)
110
120
 
111
- Use token classes for all styling. See Token Reference below.
121
+ Place `<Toaster />` once in your root layout file. Without this, `toast()` calls will not render.
112
122
 
113
- ---
123
+ ```tsx
124
+ import { Toaster } from '@7onic-ui/react'
125
+
126
+ // In your root layout (e.g., app/layout.tsx)
127
+ <body className="bg-background text-foreground">
128
+ {children}
129
+ <Toaster position="bottom-right" />
130
+ </body>
131
+ ```
132
+
133
+ ### Step 4: Start building
134
+
135
+ Design freely based on user's project description. Always use 7onic components + tokens.
136
+
137
+ ### Component Dependencies (auto-install during development)
138
+
139
+ | Component | Additional Package | When to install |
140
+ |---|---|---|
141
+ | Chart (Bar, Line, Area, Pie) | `recharts` | `npm install recharts` — import from `@7onic-ui/react/chart` (separate entry point) |
114
142
 
115
- # ═══ SECTION 2: AI RULES ═══
143
+ ---
116
144
 
117
- ## ⛔ Core Principle
145
+ ## ⛔ AI Rules — Whitelist System
118
146
 
119
- **Token values are user-defined.** Every project has different brand colors, spacing, and design decisions. The token NAMES are the API — never assume or hardcode specific values.
147
+ ### Core Principle
120
148
 
121
- ## WhitelistONLY These Are Allowed
149
+ **Token values are user-defined.** Every project has different brand colors and design decisions. The token NAMES are the API never assume or hardcode specific values.
122
150
 
123
- When writing any code, you may ONLY use:
151
+ ### Whitelist ONLY These Are Allowed
124
152
 
125
- 1. **Token classes** — colors, spacing, typography, radius, shadows, z-index, icon sizes, duration, easing, opacity, scale (listed in Token Reference below)
126
- 2. **Tailwind structural utilities** — layout, positioning, display, overflow, sizing, and more:
153
+ 1. **7onic components + Props** — always prefer components over raw HTML
154
+ 2. **Token classes** — colors, spacing, typography, radius, shadows, z-index, icon sizes, duration, easing, opacity, scale
155
+ 3. **Tailwind structural utilities** — layout, positioning, display, overflow, sizing, and more:
127
156
  - Layout: flex, grid, block, inline, hidden, container
128
157
  - Position: relative, absolute, fixed, sticky, top-0, inset-0
129
158
  - Flex/Grid: items-center, justify-between, gap-4, col-span-2
@@ -140,38 +169,84 @@ When writing any code, you may ONLY use:
140
169
  - ⚠️ Utilities that implicitly use color (divide, border) must be paired with a token color:
141
170
  `divide-y divide-border` ✅ / `divide-y` alone ❌ (may not adapt to dark mode)
142
171
  `border border-border` ✅ / `border` alone ❌
143
- 3. **Tailwind visual utilities using token values** — gradients, transforms, transitions:
172
+ 4. **Tailwind visual utilities using token values** — gradients, transforms, transitions:
144
173
  - Gradient: bg-gradient-to-r, from-primary, to-secondary (token colors only)
145
174
  - Transform: rotate-45, translate-x-1
146
175
  - Transition: transition-all, transition-colors (with token durations)
147
176
  - Backdrop: backdrop-blur, backdrop-blur-sm
148
- 4. **Responsive prefixes** — sm:, md:, lg:, xl:, 2xl: (on allowed classes only)
149
- 5. **State prefixes** — hover:, focus:, active:, disabled: (on allowed classes only, token values only)
150
- 6. **Layout dimension arbitrary values** — height and width ONLY: h-[300px], max-w-[1200px], min-h-screen (when no token fits)
151
- 7. **Opacity modifier** — append `/0-100` to any token color for transparency:
177
+ 5. **Responsive prefixes** — sm:, md:, lg:, xl:, 2xl: (on allowed classes only)
178
+ 6. **State prefixes** — hover:, focus:, active:, disabled: (on allowed classes only, token values only)
179
+ 7. **Layout dimension arbitrary values** — height and width ONLY: h-[300px], max-w-[1200px] (when no token fits)
180
+ 8. **Opacity modifier** — append `/0-100` to any token color for transparency:
152
181
  - `bg-primary/50`, `text-foreground/70`, `border-border/30`
153
182
  - Do NOT use `opacity-*` utility as a workaround — it affects the entire element including children
154
183
  - `bg-primary/10` ✅ (only background is transparent) / `bg-primary opacity-10` ❌ (children also become transparent)
155
184
 
185
+ 9. **Token-first rule** — Before adding any Tailwind utility, check if the property is already included in a design token. Typography tokens (`text-sm`, `text-md`, etc.) include both font-size AND line-height as a pair. Do NOT override with Tailwind line-height utilities:
186
+ - `text-sm` ✅ (token provides font-size + line-height)
187
+ - `text-sm leading-relaxed` ❌ (overrides token line-height)
188
+ - `text-sm leading-none` ❌ (overrides token line-height)
189
+ - `text-sm leading-[18px]` ❌ (hardcodes line-height)
190
+
156
191
  **Everything not in this list is FORBIDDEN.**
157
192
 
158
193
  ⚠️ **Gradient/visual utilities must use token colors only:** `from-primary to-secondary` ✅ / `from-blue-500 to-purple-600` ❌
159
194
 
160
- ## ForbiddenNever Use These
195
+ ### Decision TreeFor Every UI Element
161
196
 
162
- | Category | Forbidden | Use Instead |
163
- |---|---|---|
164
- | Raw colors | `bg-blue-500`, `text-gray-700`, `bg-white` | `bg-primary`, `text-foreground`, `bg-background` |
165
- | Dark prefix | `dark:bg-gray-900`, `dark:text-white` | Semantic tokens auto-adapt |
166
- | Arbitrary values | `p-[17px]`, `text-[13px]`, `rounded-[7px]`, `z-[999]` | `p-4`, `text-sm`, `rounded-md`, `z-modal` |
167
- | Icon sizing | `w-4 h-4`, `w-5 h-5` | `icon-sm`, `icon-md` |
168
- | Raw durations | `duration-150`, `duration-200` | `duration-micro`, `duration-normal` |
169
- | Raw shadows | `shadow-[0_2px_4px...]` | `shadow-sm` |
170
- | Inline styles | `style={{ color: '#333' }}` | `className="text-foreground"` |
171
- | @apply raw | `@apply bg-blue-500` | `@apply bg-primary` |
172
- | Hardcoded hex | `#FF5733`, `rgb(51,51,51)` | Token classes |
173
-
174
- ## When User Requests Custom Values
197
+ ```
198
+ Step 1: Does a 7onic component exist for this?
199
+ YES: Use the component. Style via Props (variant/size/color).
200
+ className ONLY for layout (margin, width, flex positioning).
201
+ NO: Step 2
202
+
203
+ Step 2: Is this a layout/structural element? (flex container, grid, section wrapper)
204
+ YES: Use div/section + token classes only.
205
+ NO: Step 3
206
+
207
+ Step 3: Re-check the 42 components. Most UI can be built with component combinations.
208
+ → Still no match: Use div + token classes only.
209
+ ```
210
+
211
+ ### ❌ Forbidden Patterns
212
+
213
+ ```tsx
214
+ // ❌ HTML instead of components
215
+ <button className="bg-primary rounded-lg px-4 py-2"> → <Button>
216
+ <input className="border rounded-lg px-3 h-10"> → <Input>
217
+ <div className="border rounded-xl p-6 shadow-sm"> → <Card>
218
+ <table className="w-full"> → <Table>
219
+
220
+ // ❌ className overriding component styles
221
+ <Button className="bg-blue-500 text-white"> → <Button color="primary">
222
+ <Badge className="bg-red-100 text-red-700"> → <Badge color="error">
223
+
224
+ // ❌ Raw Tailwind colors
225
+ bg-blue-500, text-gray-700, bg-white, border-gray-200
226
+
227
+ // ❌ Dark mode prefix
228
+ dark:bg-gray-900, dark:text-white
229
+
230
+ // ❌ Arbitrary values (except layout dimensions)
231
+ p-[17px], text-[13px], rounded-[7px], z-[999]
232
+
233
+ // ❌ Inline styles
234
+ style={{ color: '#333', padding: '20px' }}
235
+
236
+ // ❌ @apply with raw values
237
+ @apply bg-blue-500
238
+
239
+ // ❌ Icon sizing with w/h
240
+ w-4 h-4, w-5 h-5 → icon-sm, icon-md
241
+
242
+ // ❌ Radix direct import
243
+ import * as Dialog from '@radix-ui/react-dialog' → import { Modal } from '@7onic-ui/react'
244
+
245
+ // ❌ Unnecessary component wrappers
246
+ function MyButton(props) { return <Button {...props} /> } → Use Button directly
247
+ ```
248
+
249
+ ### When User Requests Custom Values
175
250
 
176
251
  If the user explicitly asks for a value outside the token system:
177
252
 
@@ -186,22 +261,64 @@ User: "Apply it"
186
261
  AI: → Apply the custom value
187
262
  ```
188
263
 
189
- **Rule:**
190
- - User request within token range → execute immediately
191
- - User request outside token range ask "custom value, bypass tokens?" → execute only after confirmation
192
- - AI writing code on its owntoken system ONLY, never bypass
264
+ | Situation | AI Behavior |
265
+ |---|---|
266
+ | User request within token range | Execute immediately |
267
+ | User request outside token range | Ask "bypass tokens?" execute after confirmation |
268
+ | AI writing code on its own | Token system ONLY — never bypass |
269
+
270
+ ### Third-Party Libraries
271
+
272
+ When a feature is needed that no 7onic component covers (map, video player, rich text editor, etc.):
273
+
274
+ - **Do NOT install any library without asking the user first**
275
+ - Ask: "Which library would you like to use for [feature]?"
276
+ - Install and use only after user's choice
277
+
278
+ ### Token Customization Is the User's Responsibility
279
+
280
+ The token system covers all UI needs out of the box. As AI, use existing tokens only.
281
+
282
+ If the user needs custom values beyond existing tokens, they will handle it separately.
283
+ Customization guide: https://7onic.design/components/theming
284
+
285
+ **Never modify generated token files** — these are auto-generated from figma-tokens.json via sync-tokens. AI must never edit, add to, or delete from: `variables.css`, `light.css`, `dark.css`, `v3-preset.js`, `v4-theme.css`, `index.js`, `index.mjs`, `index.d.ts`, `tokens.json`
286
+
287
+ ### Self-Check (after writing ANY code)
288
+
289
+ Before presenting code to the user, scan your own output for violations:
290
+
291
+ - [ ] Any raw color class? (`bg-blue-*`, `text-gray-*`, `bg-white`, `border-gray-*`)
292
+ - [ ] Any arbitrary value? (`p-[*]`, `text-[*]`, `rounded-[*]`, `z-[*]`)
293
+ - [ ] Any inline style? (`style={{ }}`)
294
+ - [ ] Any `dark:` prefix?
295
+ - [ ] Any `w-N h-N` for icons instead of `icon-*`?
296
+ - [ ] Any `<button>`, `<input>`, `<table>` instead of 7onic components?
297
+ - [ ] Any Radix direct import?
298
+ - [ ] Any className overriding component visual styles?
299
+ - [ ] Any `divide-*` or `border` without a token color? (`divide-y` alone → `divide-y divide-border`)
300
+ - [ ] Any `opacity-*` on element instead of color modifier? (`bg-primary opacity-10` → `bg-primary/10`)
301
+
302
+ **If ANY violation is found → fix it before showing code to the user.**
303
+ **Do NOT present code with violations. Fix first, then present.**
193
304
 
194
305
  ---
195
306
 
196
- ## Dark Mode
307
+ **When in doubt, check the documentation** — if component Props, token usage, or patterns are unclear, refer to the official docs before guessing:
308
+ - Component pages: `https://7onic.design/components/{name}` (e.g., `/components/button`, `/components/navigation-menu`)
309
+ - Token pages: `https://7onic.design/design-tokens/{name}` (e.g., `/design-tokens/colors`, `/design-tokens/spacing`)
310
+ - Do not guess — verify from documentation first
197
311
 
198
- Dark mode is **automatic** when using semantic tokens. No `dark:` prefix needed.
312
+ ---
313
+
314
+ ## Dark Mode — Automatic
315
+
316
+ Dark mode works automatically when using semantic tokens. No `dark:` prefix needed.
199
317
 
200
318
  | ❌ NEVER | ✅ CORRECT |
201
319
  |---|---|
202
320
  | `bg-white dark:bg-gray-900` | `bg-background` |
203
321
  | `text-gray-900 dark:text-gray-100` | `text-foreground` |
204
- | `text-gray-500 dark:text-gray-400` | `text-muted` |
205
322
  | `border-gray-200 dark:border-gray-700` | `border-border` |
206
323
 
207
324
  ### Dark Mode Toggle Implementation
@@ -225,243 +342,1875 @@ Strategy: `dark` class on `<html>` element.
225
342
 
226
343
  ---
227
344
 
228
- # ═══ SECTION 3: TOKEN REFERENCE ═══
345
+ ## Token Reference (Quick)
229
346
 
230
- > Token values depend on the user's project configuration.
231
- > The names below are the API. Never assume specific hex values.
347
+ > Token values depend on the user's project configuration. Never assume specific hex values.
232
348
 
233
- ## Colors — Semantic (theme-aware, USE THESE)
349
+ **Semantic Colors (theme-aware):**
350
+ - Background: `background`, `background-paper`, `background-elevated`, `background-muted`
351
+ - Text: `foreground`, `text-muted`, `text-subtle`, `text-link`, `text-primary`
352
+ - Status text: `text-info`, `text-success`, `text-error`, `text-warning`
353
+ - Intent (×6): `{intent}`, `{intent}-hover`, `{intent}-active`, `{intent}-tint`, `{intent}-foreground` — where intent = primary, secondary, success, warning, error, info
354
+ - Border: `border`, `border-subtle`, `border-strong`
355
+ - State: `disabled`, `disabled-text`, `focus-ring`, `focus-ring-error`
234
356
 
235
- **Background:**
236
- - `background` — main page background
237
- - `background-paper` — card/surface background
238
- - `background-elevated` — elevated surface (above paper)
239
- - `background-muted` — subtle/subdued background
357
+ **Spacing:** 0, 0.5(2px), 1(4px), 1.5(6px), 2(8px), 2.5(10px), 3(12px), 3.5(14px), 4(16px), 5(20px), 6(24px), 7(28px), 8(32px), 10(40px), 12(48px), 14(56px), 16(64px), 20(80px), 24(96px)
240
358
 
241
- **Text:**
242
- - `foreground` (alias: `text`) primary text
243
- - `text-muted` — secondary text, lower emphasis
244
- - `text-subtle` — tertiary text, lowest emphasis
245
- - `text-link` — link color
246
- - `text-primary` — brand-colored text
359
+ **Font:** `font-sans` (user-defined), `font-mono` (user-defined)
360
+ **Font Sizes:** text-2xs(11px), text-xs(12px), text-sm(13px), text-md(14px), text-base(16px), text-lg(18px), text-xl(20px), text-2xl(24px), text-3xl(30px), text-4xl(36px), text-5xl(48px)
361
+ **Font Weights:** font-normal(400), font-semibold(600), font-bold(700)
247
362
 
248
- **Intent Status:**
249
- - `text-info` / `text-success` / `text-error` / `text-warning`
363
+ **Radius:** rounded-none(0), rounded-sm(2), rounded-base(4), rounded-md(6), rounded-lg(8), rounded-xl(12), rounded-2xl(16), rounded-3xl(24), rounded-full(9999)
250
364
 
251
- **Intent Colors (each has 5 variants):**
252
- - `primary` / `primary-hover` / `primary-active` / `primary-tint` / `primary-foreground`
253
- - `secondary` / `secondary-hover` / `secondary-active` / `secondary-tint` / `secondary-foreground`
254
- - `success` / `success-hover` / `success-active` / `success-tint` / `success-foreground`
255
- - `warning` / `warning-hover` / `warning-active` / `warning-tint` / `warning-foreground`
256
- - `error` / `error-hover` / `error-active` / `error-tint` / `error-foreground`
257
- - `info` / `info-hover` / `info-active` / `info-tint` / `info-foreground`
365
+ **Shadows:** shadow-xs, shadow-sm, shadow-md, shadow-lg, shadow-xl
258
366
 
259
- **Border:**
260
- - `border` — default border
261
- - `border-subtle` — lighter/softer border
262
- - `border-strong` — stronger/darker border
367
+ **Z-Index:** z-sticky(100), z-dropdown(1000), z-overlay(1100), z-modal(2000), z-popover(2100), z-tooltip(2200), z-toast(3000)
263
368
 
264
- **State:**
265
- - `disabled` — disabled background
266
- - `disabled-text` — disabled text
267
- - `focus-ring` — focus indicator
268
- - `focus-ring-error` — error focus indicator
369
+ **Icon Sizes:** icon-2xs(12px), icon-xs(14px), icon-sm(16px), icon-md(20px), icon-lg(24px), icon-xl(32px)
269
370
 
270
- ## Colors Primitive (raw palette, use sparingly)
371
+ **Duration:** duration-instant(0), duration-fast(100), duration-micro(150), duration-normal(200), duration-slow(300), duration-slower(400), duration-slowest(500), duration-spin(1000)
271
372
 
272
- 7 color families, each with 50–900 shades (10 steps):
273
- `gray`, `primary`, `secondary`, `blue`, `green`, `red`, `yellow`
373
+ **Easing:** ease-linear, ease-ease, ease-ease-in, ease-ease-out, ease-ease-in-out
274
374
 
275
- Usage: `bg-primary-100`, `text-gray-600`, `border-blue-300`
276
- **Prefer semantic tokens over primitives** — primitives don't auto-adapt to dark mode.
277
- **Note:** The actual colors of each palette depend on the user's token configuration.
375
+ **Opacity:** opacity-0 to opacity-100 (5% increments)
278
376
 
279
- ## Spacing
377
+ **Scale:** scale-50, scale-75, scale-95, scale-pressed(0.98)
280
378
 
281
- | Token | Value | Common Use |
282
- |---|---|---|
283
- | `0` | 0 | Reset |
284
- | `0.5` | 2px | Micro gap |
285
- | `1` | 4px | Tight gap |
286
- | `1.5` | 6px | Small gap |
287
- | `2` | 8px | Default gap |
288
- | `2.5` | 10px | — |
289
- | `3` | 12px | Section gap |
290
- | `4` | 16px | Card padding |
291
- | `5` | 20px | — |
292
- | `6` | 24px | Section padding |
293
- | `7` | 28px | — |
294
- | `8` | 32px | Large padding |
295
- | `10` | 40px | — |
296
- | `12` | 48px | — |
297
- | `14` | 56px | — |
298
- | `16` | 64px | Page margin |
299
- | `20` | 80px | — |
300
- | `24` | 96px | Hero spacing |
301
-
302
- ## Typography
303
-
304
- **Font Families:**
305
- - `font-sans` — sans-serif body font (user-defined)
306
- - `font-mono` — monospace code font (user-defined)
307
-
308
- **Font Sizes:**
309
-
310
- | Class | Size | Line Height | Use Case |
311
- |---|---|---|---|
312
- | `text-2xs` | 11px | 16px | Fine print |
313
- | `text-xs` | 12px | 18px | Caption, badge |
314
- | `text-sm` | 13px | 20px | Body small, table |
315
- | `text-md` | 14px | 22px | Body default |
316
- | `text-base` | 16px | 26px | Body large |
317
- | `text-lg` | 18px | 28px | Subtitle |
318
- | `text-xl` | 20px | 30px | Title |
319
- | `text-2xl` | 24px | 34px | Heading |
320
- | `text-3xl` | 30px | 40px | Hero subtitle |
321
- | `text-4xl` | 36px | 46px | Hero title |
322
- | `text-5xl` | 48px | 58px | Display |
323
-
324
- **Font Weights:**
325
- - `font-normal` (400) — body text
326
- - `font-semibold` (600) — labels, emphasis
327
- - `font-bold` (700) — headings
328
-
329
- ## Border Radius
330
-
331
- | Class | Value | Use Case |
332
- |---|---|---|
333
- | `rounded-none` | 0px | Square |
334
- | `rounded-sm` | 2px | Subtle |
335
- | `rounded-base` | 4px | Default (checkbox) |
336
- | `rounded-md` | 6px | Default (button) |
337
- | `rounded-lg` | 8px | Card, input |
338
- | `rounded-xl` | 12px | Large card |
339
- | `rounded-2xl` | 16px | Modal |
340
- | `rounded-3xl` | 24px | Pill shape |
341
- | `rounded-full` | 9999px | Circle, pill button |
342
-
343
- ## Shadows
344
-
345
- | Class | Description |
346
- |---|---|
347
- | `shadow-xs` | Barely visible — subtle elevation |
348
- | `shadow-sm` | Default card shadow |
349
- | `shadow-md` | Dropdown, popover |
350
- | `shadow-lg` | Modal, drawer |
351
- | `shadow-xl` | Floating action |
379
+ **Breakpoints:** sm(640), md(768), lg(1024), xl(1280), 2xl(1536)
352
380
 
353
- Shadows automatically adapt between light and dark themes.
381
+ For detailed token reference, see: https://7onic.design/llms.txt
354
382
 
355
- ## Z-Index (named stack)
383
+ ---
356
384
 
357
- | Class | Value | Use Case |
358
- |---|---|---|
359
- | `z-0` | 0 | Default |
360
- | `z-10`–`z-50` | 10–50 | Layout layers |
361
- | `z-sticky` | 100 | Sticky header |
362
- | `z-dropdown` | 1000 | Dropdown menu |
363
- | `z-overlay` | 1100 | Overlay/backdrop |
364
- | `z-modal` | 2000 | Modal dialog |
365
- | `z-popover` | 2100 | Popover |
366
- | `z-tooltip` | 2200 | Tooltip |
367
- | `z-toast` | 3000 | Toast notification |
385
+ # ═══ SECTION 2: COMPONENT IMPORT PATTERNS ═══
368
386
 
369
- **Never use arbitrary z-index values.** Always use these named tokens.
387
+ ## Import
370
388
 
371
- ## Icon Sizes (6-step scale)
389
+ ```tsx
390
+ // All components from single package
391
+ import { Button, Card, Input, Toast } from '@7onic-ui/react'
392
+ ```
372
393
 
373
- | Class | Size | Use Case |
374
- |---|---|---|
375
- | `icon-2xs` | 12px | Badge icon, small indicator |
376
- | `icon-xs` | 14px | xs/sm button icon, tag |
377
- | `icon-sm` | 16px | Default button icon, form element |
378
- | `icon-md` | 20px | Navigation, default icon button |
379
- | `icon-lg` | 24px | Large icon button, card |
380
- | `icon-xl` | 32px | Hero, feature icon |
394
+ ## Namespace Pattern (Compound Components)
395
+
396
+ 21 compound components use namespace imports. Access sub-components via dot notation:
381
397
 
382
- **Never use `w-4 h-4` for icons.** Always use `icon-{size}` classes.
398
+ ```tsx
399
+ import { Card } from '@7onic-ui/react'
400
+
401
+ // ✅ Namespace usage (preferred)
402
+ <Card>
403
+ <Card.Header>
404
+ <Card.Title>Title</Card.Title>
405
+ <Card.Description>Description</Card.Description>
406
+ </Card.Header>
407
+ <Card.Content>Content</Card.Content>
408
+ <Card.Footer>Footer</Card.Footer>
409
+ </Card>
410
+
411
+ // ✅ Named exports also work (backwards compatible)
412
+ import { Card, CardHeader, CardTitle, CardContent } from '@7onic-ui/react'
413
+ ```
383
414
 
384
- ## Duration
415
+ ### Compound Components List (24)
385
416
 
386
- | Class | Value | Use Case |
387
- |---|---|---|
388
- | `duration-instant` | 0ms | No animation |
389
- | `duration-fast` | 100ms | Micro interactions |
390
- | `duration-micro` | 150ms | Button press, toggle |
391
- | `duration-normal` | 200ms | Default transition |
392
- | `duration-slow` | 300ms | Panel slide |
393
- | `duration-slower` | 400ms | Page transition |
394
- | `duration-slowest` | 500ms | Complex animation |
395
- | `duration-spin` | 1000ms | Spinner rotation |
417
+ Accordion, Alert, Avatar, Breadcrumb, Card, ChatInput, ChatMessage, Chart, Drawer, DropdownMenu, Field, MetricCard, Modal, NavigationMenu, Pagination, Popover, QuickReply, RadioGroup, Segmented, Select, Table, Tabs, ToggleGroup, Tooltip
396
418
 
397
- ## Easing
419
+ ### Standalone Components (16)
398
420
 
399
- - `ease-linear` constant speed
400
- - `ease-ease` — natural acceleration/deceleration
401
- - `ease-ease-in` — slow start
402
- - `ease-ease-out` — slow end
403
- - `ease-ease-in-out` — slow start and end
421
+ Badge, Button, ButtonGroup, Checkbox, Divider, IconButton, Input, Progress, Skeleton, Slider, Spinner, Switch, Textarea, Toast, Toggle, TypingIndicator
404
422
 
405
- ## Opacity
423
+ ---
406
424
 
407
- 21-step scale: `opacity-0`, `opacity-5`, `opacity-10` ... `opacity-95`, `opacity-100`
408
- Each 5% increment. Values: 0, 0.05, 0.10 ... 0.95, 1.0
425
+ # ═══ SECTION 3: ALL COMPONENTS (42) ═══
409
426
 
410
- ## Scale (Transform)
427
+ ---
411
428
 
412
- | Class | Value | Use Case |
413
- |---|---|---|
414
- | `scale-50` | 0.5 | Half size |
415
- | `scale-75` | 0.75 | Reduced |
416
- | `scale-95` | 0.95 | Hover shrink |
417
- | `scale-pressed` | 0.98 | Button press effect |
429
+ ## Forms
418
430
 
419
- ## Breakpoints
431
+ ### Button
420
432
 
421
- | Class | Min Width | Use Case |
422
- |---|---|---|
423
- | `sm:` | 640px | Mobile landscape |
424
- | `md:` | 768px | Tablet |
425
- | `lg:` | 1024px | Desktop |
426
- | `xl:` | 1280px | Wide desktop |
427
- | `2xl:` | 1536px | Ultra-wide |
433
+ ```tsx
434
+ import { Button } from '@7onic-ui/react'
435
+
436
+ <Button variant="solid" color="primary" size="default">Submit</Button>
437
+ <Button variant="outline" color="default" leftIcon={<Icon />}>Cancel</Button>
438
+ <Button loading>Processing...</Button>
439
+ <Button variant="link" color="primary">Learn more</Button>
440
+ ```
441
+
442
+ | Prop | Type | Default | Description |
443
+ |---|---|---|---|
444
+ | variant | `'solid' \| 'outline' \| 'ghost' \| 'link'` | `'solid'` | Visual style |
445
+ | color | `'default' \| 'primary' \| 'secondary' \| 'destructive'` | `'default'` | Color scheme |
446
+ | size | `'xs' \| 'sm' \| 'md' \| 'default' \| 'lg'` | `'default'` | Height: 28/32/36/40/48px |
447
+ | radius | `'none' \| 'sm' \| 'base' \| 'default' \| 'lg' \| 'xl' \| '2xl' \| '3xl' \| 'full'` | `'default'` | Border radius |
448
+ | loading | `boolean` | `false` | Shows spinner, disables button |
449
+ | leftIcon | `ReactNode` | — | Icon before label |
450
+ | rightIcon | `ReactNode` | — | Icon after label |
451
+ | fullWidth | `boolean` | `false` | `w-full` |
452
+ | selected | `boolean` | — | Selected state (outline/ghost) |
453
+ | fontWeight | `'normal' \| 'semibold'` | per variant | Override font weight |
454
+ | pressEffect | `boolean` | `true` | Scale-down on press |
455
+ | asChild | `boolean` | `false` | Render as child element (Slot) |
456
+ | disabled | `boolean` | `false` | Disabled state |
457
+
458
+ **Icon sizing by button size:** xs/sm → icon-xs(14px), md/default/lg → icon-sm(16px)
428
459
 
429
460
  ---
430
461
 
431
- # ═══ SECTION 4: TOKEN CUSTOMIZATION ═══
462
+ ### IconButton
432
463
 
433
- ## ⛔ Rule for AI: Use Existing Tokens Only
464
+ ```tsx
465
+ import { IconButton } from '@7onic-ui/react'
434
466
 
435
- The token system is comprehensive — semantic colors, primitives, spacing, typography, radius, shadows, z-index, icon sizes, duration, easing, opacity, scale, and breakpoints cover all UI needs.
467
+ <IconButton variant="ghost" size="default" aria-label="Settings">
468
+ <SettingsIcon />
469
+ </IconButton>
470
+ ```
436
471
 
437
- **Every visual value you need already exists as a token.** Use it.
472
+ | Prop | Type | Default | Description |
473
+ |---|---|---|---|
474
+ | variant | `'solid' \| 'outline' \| 'ghost' \| 'subtle'` | `'solid'` | Visual style |
475
+ | color | `'default' \| 'primary' \| 'secondary' \| 'destructive'` | `'default'` | Color scheme |
476
+ | size | `'xs' \| 'sm' \| 'md' \| 'default' \| 'lg'` | `'default'` | 28/32/36/40/48px (square) |
477
+ | radius | Same as Button | `'default'` | Border radius |
478
+ | loading | `boolean` | `false` | Shows spinner |
479
+ | pressEffect | `boolean` | `true` | Scale-down on press |
480
+ | asChild | `boolean` | `false` | Slot pattern |
438
481
 
439
- - **Always use token names** (`bg-primary`, `text-foreground`, `rounded-lg`) never hardcode values
440
- - **Never assume specific color values** token values are defined by the user's project
441
- - **Never add CSS variables, hex values, or arbitrary Tailwind values**
442
- - **Token customization is the user's responsibility** — if the user needs custom values, they will handle it separately. See: https://7onic.design/components/theming
443
- - **Never modify generated token files** — the following files are auto-generated from figma-tokens.json via sync-tokens. AI must never edit, add to, or delete from these files: `variables.css`, `light.css`, `dark.css`, `v3-preset.js`, `v4-theme.css`, `index.js`, `index.mjs`, `index.d.ts`, `tokens.json`
482
+ **Icon sizing:** xs icon-xs(14px), sm/md → icon-sm(16px), default → icon-md(20px), lg icon-lg(24px)
483
+ **Always provide `aria-label`**no visible text.
444
484
 
445
- ### Self-Check (after writing ANY code)
485
+ ---
446
486
 
447
- Before presenting code to the user, scan your own output for violations:
487
+ ### ButtonGroup
448
488
 
449
- - [ ] Any raw color class? (`bg-blue-*`, `text-gray-*`, `bg-white`, `border-gray-*`)
450
- - [ ] Any arbitrary value? (`p-[*]`, `text-[*]`, `rounded-[*]`, `z-[*]`)
451
- - [ ] Any inline style? (`style={{ }}`)
452
- - [ ] Any `dark:` prefix?
453
- - [ ] Any `w-N h-N` for icons instead of `icon-*`?
454
- - [ ] Any `divide-*` or `border` without a token color? (`divide-y` alone → `divide-y divide-border`)
455
- - [ ] Any `opacity-*` on element instead of color modifier? (`bg-primary opacity-10` → `bg-primary/10`)
489
+ ```tsx
490
+ import { Button, ButtonGroup } from '@7onic-ui/react'
456
491
 
457
- **If ANY violation is found → fix it before showing code to the user.**
458
- **Do NOT present code with violations. Fix first, then present.**
492
+ <ButtonGroup variant="outline" size="default" attached>
493
+ <Button>Left</Button>
494
+ <Button>Center</Button>
495
+ <Button>Right</Button>
496
+ </ButtonGroup>
497
+ ```
498
+
499
+ | Prop | Type | Default | Description |
500
+ |---|---|---|---|
501
+ | variant | `'outline' \| 'ghost'` | — | Applied to all children |
502
+ | size | Button sizes | — | Applied to all children |
503
+ | radius | Button radius values | — | Applied to all children |
504
+ | fontWeight | `'normal' \| 'semibold'` | — | Applied to all children |
505
+ | orientation | `'horizontal' \| 'vertical'` | `'horizontal'` | Layout direction |
506
+ | attached | `boolean` | `false` | Overlapping borders |
507
+ | disabled | `boolean` | `false` | Disable all children |
508
+
509
+ Provides context — child Buttons inherit variant/size/radius automatically.
510
+
511
+ ---
512
+
513
+ ### Input
514
+
515
+ ```tsx
516
+ import { Input } from '@7onic-ui/react'
517
+
518
+ <Input placeholder="Email" size="default" />
519
+ <Input variant="filled" leftIcon={<SearchIcon />} />
520
+ <Input error rightIcon={<AlertIcon />} />
521
+ ```
522
+
523
+ | Prop | Type | Default | Description |
524
+ |---|---|---|---|
525
+ | variant | `'default' \| 'filled'` | `'default'` | Border or filled background |
526
+ | size | `'xs' \| 'sm' \| 'default' \| 'lg' \| 'xl'` | `'default'` | Height: 36/40/44/48/56px |
527
+ | radius | `'none' \| 'sm' \| 'base' \| 'default' \| 'lg' \| 'xl' \| '2xl' \| '3xl' \| 'full'` | `'default'` | Border radius |
528
+ | error | `boolean` | `false` | Error border state |
529
+ | focusRing | `boolean` | `false` | Explicit focus ring (vs keyboard-only) |
530
+ | leftIcon | `ReactNode` | — | Left icon |
531
+ | rightIcon | `ReactNode` | — | Right icon |
532
+
533
+ **Works with Field wrapper** for label, error, char count. See Field section.
534
+
535
+ ---
536
+
537
+ ### Textarea
538
+
539
+ ```tsx
540
+ import { Textarea } from '@7onic-ui/react'
541
+
542
+ <Textarea placeholder="Message" rows={4} resize="vertical" />
543
+ ```
544
+
545
+ | Prop | Type | Default | Description |
546
+ |---|---|---|---|
547
+ | variant | `'default' \| 'filled'` | `'default'` | Border or filled |
548
+ | size | `'compact' \| 'default'` | `'default'` | Padding density |
549
+ | radius | Same as Input | `'default'` | Border radius |
550
+ | resize | `'none' \| 'vertical' \| 'horizontal' \| 'both'` | `'vertical'` | Resize handle |
551
+ | error | `boolean` | `false` | Error state |
552
+ | focusRing | `boolean` | `false` | Explicit focus ring |
553
+
554
+ ---
555
+
556
+ ### Select
557
+
558
+ ```tsx
559
+ import { Select } from '@7onic-ui/react'
560
+
561
+ <Select>
562
+ <Select.Trigger>
563
+ <Select.Value placeholder="Choose option" />
564
+ </Select.Trigger>
565
+ <Select.Content>
566
+ <Select.Item value="a">Option A</Select.Item>
567
+ <Select.Item value="b">Option B</Select.Item>
568
+ <Select.Group>
569
+ <Select.Label>Group</Select.Label>
570
+ <Select.Item value="c">Option C</Select.Item>
571
+ </Select.Group>
572
+ </Select.Content>
573
+ </Select>
574
+ ```
575
+
576
+ | Prop (Root) | Type | Default | Description |
577
+ |---|---|---|---|
578
+ | size | `'xs' \| 'sm' \| 'default' \| 'lg' \| 'xl'` | `'default'` | Trigger height |
579
+ | radius | Same as Input | `'default'` | Border radius |
580
+ | value | `string` | — | Controlled value |
581
+ | defaultValue | `string` | — | Uncontrolled default |
582
+ | onValueChange | `(value: string) => void` | — | Change handler |
583
+
584
+ **Sub-components:** Select.Trigger, Select.Value, Select.Content, Select.Item, Select.Group, Select.Label, Select.Separator
585
+
586
+ ---
587
+
588
+ ### DropdownMenu
589
+
590
+ ```tsx
591
+ import { DropdownMenu } from '@7onic-ui/react'
592
+
593
+ <DropdownMenu>
594
+ <DropdownMenu.Trigger asChild>
595
+ <Button variant="outline">Options</Button>
596
+ </DropdownMenu.Trigger>
597
+ <DropdownMenu.Content>
598
+ <DropdownMenu.Item>Edit</DropdownMenu.Item>
599
+ <DropdownMenu.Item>Duplicate</DropdownMenu.Item>
600
+ <DropdownMenu.Separator />
601
+ <DropdownMenu.Item className="text-error">Delete</DropdownMenu.Item>
602
+ </DropdownMenu.Content>
603
+ </DropdownMenu>
604
+ ```
605
+
606
+ | Prop (Content) | Type | Default | Description |
607
+ |---|---|---|---|
608
+ | radius | `'md' \| 'lg' \| 'xl'` | `'lg'` | Border radius |
609
+ | size | `'sm' \| 'md' \| 'lg'` | `'md'` | Item density |
610
+ | flush | `boolean` | `false` | Full-width items (no padding) |
611
+ | sideOffset | `number` | `4` | Gap from trigger |
612
+
613
+ **Sub-components:** DropdownMenu.Trigger, DropdownMenu.Content, DropdownMenu.Item, DropdownMenu.CheckboxItem, DropdownMenu.RadioItem, DropdownMenu.Label, DropdownMenu.Separator, DropdownMenu.Group, DropdownMenu.Sub, DropdownMenu.SubTrigger, DropdownMenu.SubContent, DropdownMenu.Shortcut
614
+
615
+ ---
616
+
617
+ ### Checkbox
618
+
619
+ ```tsx
620
+ import { Checkbox } from '@7onic-ui/react'
621
+
622
+ <Checkbox label="Accept terms" />
623
+ <Checkbox size="lg" color="primary" checked />
624
+ <Checkbox checked="indeterminate" />
625
+ ```
626
+
627
+ | Prop | Type | Default | Description |
628
+ |---|---|---|---|
629
+ | size | `'sm' \| 'default' \| 'lg'` | `'default'` | Checkbox size |
630
+ | radius | `'none' \| 'sm' \| 'md'` | `'sm'` | Border radius |
631
+ | weight | `'thin' \| 'bold'` | `'bold'` | Checkmark thickness |
632
+ | color | `'default' \| 'primary'` | `'default'` | Checked color |
633
+ | label | `string` | — | Label text |
634
+ | checked | `boolean \| 'indeterminate'` | — | Controlled state |
635
+ | defaultChecked | `boolean` | — | Uncontrolled default |
636
+ | onCheckedChange | `(checked: boolean \| 'indeterminate') => void` | — | Change handler |
637
+ | disabled | `boolean` | `false` | Disabled state |
638
+
639
+ ---
640
+
641
+ ### RadioGroup
642
+
643
+ ```tsx
644
+ import { RadioGroup } from '@7onic-ui/react'
645
+
646
+ <RadioGroup defaultValue="a">
647
+ <RadioGroup.Item value="a" label="Option A" />
648
+ <RadioGroup.Item value="b" label="Option B" />
649
+ <RadioGroup.Item value="c" label="Option C" disabled />
650
+ </RadioGroup>
651
+ ```
652
+
653
+ | Prop (Root) | Type | Default | Description |
654
+ |---|---|---|---|
655
+ | size | `'sm' \| 'default' \| 'lg'` | `'default'` | Radio size |
656
+ | weight | `'thin' \| 'bold'` | `'bold'` | Indicator thickness |
657
+ | color | `'default' \| 'primary'` | `'default'` | Selected color |
658
+ | orientation | `'horizontal' \| 'vertical'` | `'vertical'` | Layout direction |
659
+ | value | `string` | — | Controlled value |
660
+ | defaultValue | `string` | — | Uncontrolled default |
661
+ | onValueChange | `(value: string) => void` | — | Change handler |
662
+
663
+ **Sub-components:** RadioGroup.Item (with `label` prop)
664
+
665
+ ---
666
+
667
+ ### Switch
668
+
669
+ ```tsx
670
+ import { Switch } from '@7onic-ui/react'
671
+
672
+ <Switch label="Notifications" />
673
+ <Switch size="lg" color="primary" defaultChecked />
674
+ <Switch startLabel="Off" endLabel="On" />
675
+ ```
676
+
677
+ | Prop | Type | Default | Description |
678
+ |---|---|---|---|
679
+ | size | `'sm' \| 'default' \| 'lg'` | `'default'` | Track size |
680
+ | color | `'default' \| 'primary' \| 'success' \| 'warning' \| 'error'` | `'default'` | Active track color |
681
+ | label | `string` | — | Label text |
682
+ | labelPosition | `'start' \| 'end' \| 'top' \| 'bottom'` | `'end'` | Label placement |
683
+ | startLabel | `string` | — | Left label (off state) |
684
+ | endLabel | `string` | — | Right label (on state) |
685
+ | checkedIcon | `ReactNode` | — | Icon when checked |
686
+ | uncheckedIcon | `ReactNode` | — | Icon when unchecked |
687
+ | checked | `boolean` | — | Controlled state |
688
+ | defaultChecked | `boolean` | — | Uncontrolled default |
689
+ | onCheckedChange | `(checked: boolean) => void` | — | Change handler |
690
+ | disabled | `boolean` | `false` | Disabled state |
691
+
692
+ ---
693
+
694
+ ### Toggle
695
+
696
+ ```tsx
697
+ import { Toggle } from '@7onic-ui/react'
698
+
699
+ <Toggle variant="default" aria-label="Bold">
700
+ <BoldIcon />
701
+ </Toggle>
702
+ <Toggle variant="outline" pressed>Active</Toggle>
703
+ ```
704
+
705
+ | Prop | Type | Default | Description |
706
+ |---|---|---|---|
707
+ | variant | `'default' \| 'outline' \| 'ghost' \| 'outline-ghost'` | `'default'` | Visual style |
708
+ | size | `'xs' \| 'sm' \| 'md' \| 'default' \| 'lg'` | `'default'` | 28/32/36/40/48px |
709
+ | radius | Same as Button | `'default'` | Border radius |
710
+ | fontWeight | `'normal' \| 'semibold'` | per variant | Font weight |
711
+ | iconOnly | `boolean` | `false` | Square mode (no text padding) |
712
+ | pressEffect | `boolean` | `true` | Scale-down on press |
713
+ | pressed | `boolean` | — | Controlled state |
714
+ | defaultPressed | `boolean` | — | Uncontrolled default |
715
+ | onPressedChange | `(pressed: boolean) => void` | — | Change handler |
716
+
717
+ ---
718
+
719
+ ### ToggleGroup
720
+
721
+ ```tsx
722
+ import { ToggleGroup } from '@7onic-ui/react'
723
+
724
+ <ToggleGroup type="single" defaultValue="center">
725
+ <ToggleGroup.Item value="left"><AlignLeftIcon /></ToggleGroup.Item>
726
+ <ToggleGroup.Item value="center"><AlignCenterIcon /></ToggleGroup.Item>
727
+ <ToggleGroup.Item value="right"><AlignRightIcon /></ToggleGroup.Item>
728
+ </ToggleGroup>
729
+ ```
730
+
731
+ | Prop (Root) | Type | Default | Description |
732
+ |---|---|---|---|
733
+ | type | `'single' \| 'multiple'` | required | Selection mode |
734
+ | variant | `'default' \| 'outline'` | `'default'` | Visual style |
735
+ | size | `'xs' \| 'sm' \| 'md' \| 'default' \| 'lg'` | `'default'` | Item size |
736
+ | radius | Same as Button | `'default'` | Border radius |
737
+ | fontWeight | `'normal' \| 'semibold'` | per variant | Font weight |
738
+ | orientation | `'horizontal' \| 'vertical'` | `'horizontal'` | Layout direction |
739
+ | value | `string \| string[]` | — | Controlled value |
740
+ | defaultValue | `string \| string[]` | — | Uncontrolled default |
741
+ | onValueChange | `(value) => void` | — | Change handler |
742
+
743
+ **Sub-components:** ToggleGroup.Item
744
+
745
+ ---
746
+
747
+ ### Segmented
748
+
749
+ ```tsx
750
+ import { Segmented } from '@7onic-ui/react'
751
+
752
+ <Segmented defaultValue="all">
753
+ <Segmented.Item value="all">All</Segmented.Item>
754
+ <Segmented.Item value="active">Active</Segmented.Item>
755
+ <Segmented.Item value="inactive">Inactive</Segmented.Item>
756
+ </Segmented>
757
+ ```
758
+
759
+ | Prop (Root) | Type | Default | Description |
760
+ |---|---|---|---|
761
+ | variant | `'default' \| 'outline' \| 'underline' \| 'ghost'` | `'default'` | Visual style |
762
+ | size | `'sm' \| 'md' \| 'default' \| 'lg'` | `'default'` | 32/36/40/48px (no xs) |
763
+ | radius | Same as Button (excl. none) | `'default'` | Border radius |
764
+ | fontWeight | `'normal' \| 'semibold'` | per variant | Font weight |
765
+ | value | `string` | — | Controlled value |
766
+ | defaultValue | `string` | — | Uncontrolled default |
767
+ | onValueChange | `(value: string) => void` | — | Change handler |
768
+
769
+ **Sub-components:** Segmented.Item
770
+ **Note:** Only 4 sizes (no xs) — intentional design decision.
771
+
772
+ ---
773
+
774
+ ### Slider
775
+
776
+ ```tsx
777
+ import { Slider } from '@7onic-ui/react'
778
+
779
+ <Slider defaultValue={[50]} showTooltip="auto" />
780
+ <Slider defaultValue={[20, 80]} color="primary" />
781
+ ```
782
+
783
+ | Prop | Type | Default | Description |
784
+ |---|---|---|---|
785
+ | size | `'sm' \| 'default' \| 'lg'` | `'default'` | Track/thumb size |
786
+ | color | `'default' \| 'primary'` | `'default'` | Active track color |
787
+ | showTooltip | `'auto' \| 'always' \| 'never'` | `'auto'` | Tooltip display |
788
+ | formatLabel | `(value: number) => string` | — | Tooltip value formatter |
789
+ | startContent | `ReactNode` | — | Left content (label/icon) |
790
+ | endContent | `ReactNode` | — | Right content (label/icon) |
791
+ | orientation | `'horizontal' \| 'vertical'` | `'horizontal'` | Direction |
792
+ | value | `number[]` | — | Controlled value(s) |
793
+ | defaultValue | `number[]` | — | Uncontrolled default |
794
+ | onValueChange | `(value: number[]) => void` | — | Change handler |
795
+ | min | `number` | `0` | Minimum value |
796
+ | max | `number` | `100` | Maximum value |
797
+ | step | `number` | `1` | Step increment |
798
+
799
+ ---
800
+
801
+ ### Field (Form Wrapper)
802
+
803
+ ```tsx
804
+ import { Field, Input, Textarea } from '@7onic-ui/react'
805
+
806
+ <Field error="Invalid email">
807
+ <Field.Label required>Email</Field.Label>
808
+ <Input placeholder="you@example.com" />
809
+ <Field.Error />
810
+ </Field>
811
+
812
+ <Field>
813
+ <Field.Label>Bio</Field.Label>
814
+ <Textarea placeholder="Tell us about yourself" maxLength={200} />
815
+ <Field.CharCount />
816
+ </Field>
817
+ ```
818
+
819
+ | Prop (Root) | Type | Default | Description |
820
+ |---|---|---|---|
821
+ | gap | `'none' \| 'xs' \| 'sm' \| 'default' \| 'lg'` | `'default'` | Gap between elements |
822
+ | error | `string \| boolean` | — | Error message (passed to children via context) |
823
+ | disabled | `boolean` | `false` | Disabled state (passed to children via context) |
824
+
825
+ **Sub-components:** Field.Label (with `required` prop), Field.Error, Field.CharCount
826
+ **Context:** Input, Textarea, Checkbox, RadioGroup, Select auto-detect Field context for error/disabled/id.
827
+
828
+ ---
829
+
830
+ ## Data Display
831
+
832
+ ### Avatar
833
+
834
+ ```tsx
835
+ import { Avatar } from '@7onic-ui/react'
836
+
837
+ <Avatar size="default">
838
+ <Avatar.Image src="/photo.jpg" alt="User" />
839
+ <Avatar.Fallback name="John Doe" colorized />
840
+ </Avatar>
841
+
842
+ <Avatar.Group max={3}>
843
+ <Avatar><Avatar.Image src="/a.jpg" /><Avatar.Fallback>A</Avatar.Fallback></Avatar>
844
+ <Avatar><Avatar.Image src="/b.jpg" /><Avatar.Fallback>B</Avatar.Fallback></Avatar>
845
+ <Avatar><Avatar.Image src="/c.jpg" /><Avatar.Fallback>C</Avatar.Fallback></Avatar>
846
+ <Avatar><Avatar.Fallback>+2</Avatar.Fallback></Avatar>
847
+ </Avatar.Group>
848
+ ```
849
+
850
+ | Prop (Root) | Type | Default | Description |
851
+ |---|---|---|---|
852
+ | size | `'xs' \| 'sm' \| 'default' \| 'lg' \| 'xl' \| '2xl'` | `'default'` | Avatar size |
853
+ | shape | `'circle' \| 'square'` | `'circle'` | Avatar shape |
854
+ | status | `'online' \| 'offline' \| 'busy' \| 'away'` | — | Status indicator dot |
855
+
856
+ | Prop (Fallback) | Type | Default | Description |
857
+ |---|---|---|---|
858
+ | name | `string` | — | Auto-generates initials |
859
+ | colorized | `boolean` | `false` | Deterministic color from name hash |
860
+ | colorVariant | `'vivid' \| 'soft'` | `'vivid'` | Color intensity |
861
+
862
+ | Prop (Group) | Type | Default | Description |
863
+ |---|---|---|---|
864
+ | max | `number` | — | Max visible avatars |
865
+ | size | Same as Root | — | Override all children |
866
+ | shape | Same as Root | — | Override all children |
867
+
868
+ **Sub-components:** Avatar.Image, Avatar.Fallback, Avatar.Group
869
+
870
+ ---
871
+
872
+ ### Badge
873
+
874
+ ```tsx
875
+ import { Badge } from '@7onic-ui/react'
876
+
877
+ <Badge variant="solid" color="primary">New</Badge>
878
+ <Badge variant="subtle" color="success" dot>Active</Badge>
879
+ <Badge variant="outline" removable onRemove={() => {}}>Tag</Badge>
880
+ ```
881
+
882
+ | Prop | Type | Default | Description |
883
+ |---|---|---|---|
884
+ | variant | `'solid' \| 'subtle' \| 'outline'` | `'subtle'` | Visual style |
885
+ | color | `'default' \| 'primary' \| 'success' \| 'warning' \| 'error' \| 'info'` | `'default'` | Color scheme |
886
+ | size | `'sm' \| 'default' \| 'lg'` | `'default'` | Badge size |
887
+ | radius | `'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'` | `'full'` | Border radius |
888
+ | icon | `ReactNode` | — | Leading icon |
889
+ | dot | `boolean` | `false` | Status dot indicator |
890
+ | removable | `boolean` | `false` | Shows remove button |
891
+ | onRemove | `() => void` | — | Remove handler |
892
+ | asChild | `boolean` | `false` | Slot pattern |
893
+
894
+ ---
895
+
896
+ ### Card
897
+
898
+ ```tsx
899
+ import { Card } from '@7onic-ui/react'
900
+
901
+ <Card variant="default" interactive>
902
+ <Card.Image src="/cover.jpg" overlay overlayOpacity={40} />
903
+ <Card.Header>
904
+ <Card.Title icon={<StarIcon />}>Featured</Card.Title>
905
+ <Card.Description>Card description</Card.Description>
906
+ <Card.Action><IconButton variant="ghost"><MoreIcon /></IconButton></Card.Action>
907
+ </Card.Header>
908
+ <Card.Content>Main content</Card.Content>
909
+ <Card.Footer>Footer actions</Card.Footer>
910
+ </Card>
911
+ ```
912
+
913
+ | Prop (Root) | Type | Default | Description |
914
+ |---|---|---|---|
915
+ | variant | `'default' \| 'outline' \| 'ghost'` | `'default'` | Visual style |
916
+ | size | `'sm' \| 'default' \| 'lg'` | `'default'` | Padding scale |
917
+ | radius | `'sm' \| 'base' \| 'md' \| 'lg' \| 'xl' \| '2xl'` | `'xl'` | Border radius |
918
+ | direction | `'vertical' \| 'horizontal'` | `'vertical'` | Layout direction |
919
+ | interactive | `boolean` | `false` | Hover shadow + lift |
920
+ | asChild | `boolean` | `false` | Slot pattern |
921
+
922
+ | Prop (Image) | Type | Default | Description |
923
+ |---|---|---|---|
924
+ | overlay | `boolean` | `false` | Gradient overlay |
925
+ | overlayOpacity | `10-90` | `60` | Overlay darkness |
926
+
927
+ **Sub-components:** Card.Image, Card.Header, Card.Title (with `icon`), Card.Description, Card.Action, Card.Content, Card.Footer
459
928
 
460
929
  ---
461
930
 
462
- - **When in doubt, check the documentation** — if token usage is unclear, refer to the official docs:
463
- - Token pages: `https://7onic.design/design-tokens/{name}` (e.g., `/design-tokens/colors`, `/design-tokens/spacing`)
464
- - Do not guess token values or usage — verify from the documentation first
931
+ ### Table
932
+
933
+ ```tsx
934
+ import { Table } from '@7onic-ui/react'
935
+
936
+ <Table variant="default" stickyHeader>
937
+ <Table.Header>
938
+ <Table.Row>
939
+ <Table.Head sortable sortDirection="asc" onSort={() => {}}>Name</Table.Head>
940
+ <Table.Head align="right">Amount</Table.Head>
941
+ </Table.Row>
942
+ </Table.Header>
943
+ <Table.Body>
944
+ <Table.Row interactive>
945
+ <Table.Cell>John</Table.Cell>
946
+ <Table.Cell align="right">$100</Table.Cell>
947
+ </Table.Row>
948
+ </Table.Body>
949
+ </Table>
950
+ ```
951
+
952
+ | Prop (Root) | Type | Default | Description |
953
+ |---|---|---|---|
954
+ | variant | `'default' \| 'bordered' \| 'striped'` | `'default'` | Visual style |
955
+ | size | `'sm' \| 'default' \| 'lg'` | `'default'` | Cell padding |
956
+ | stickyHeader | `boolean` | `false` | Sticky header row |
957
+
958
+ | Prop (Head) | Type | Default | Description |
959
+ |---|---|---|---|
960
+ | align | `'left' \| 'center' \| 'right'` | `'left'` | Text alignment |
961
+ | sortable | `boolean` | `false` | Shows sort indicator |
962
+ | sortDirection | `'asc' \| 'desc' \| null` | — | Current sort state |
963
+ | onSort | `() => void` | — | Sort handler |
964
+
965
+ | Prop (Row) | Type | Default | Description |
966
+ |---|---|---|---|
967
+ | interactive | `boolean` | `false` | Hover highlight |
968
+ | selected | `boolean` | `false` | Selected state |
969
+
970
+ **Sub-components:** Table.Header, Table.Body, Table.Footer, Table.Row, Table.Head, Table.Cell, Table.Caption
971
+
972
+ ---
973
+
974
+ ## Layout
975
+
976
+ ### Tabs
977
+
978
+ ```tsx
979
+ import { Tabs } from '@7onic-ui/react'
980
+
981
+ <Tabs defaultValue="tab1">
982
+ <Tabs.List variant="line" size="default">
983
+ <Tabs.Trigger value="tab1">Tab 1</Tabs.Trigger>
984
+ <Tabs.Trigger value="tab2">Tab 2</Tabs.Trigger>
985
+ </Tabs.List>
986
+ <Tabs.Content value="tab1">Content 1</Tabs.Content>
987
+ <Tabs.Content value="tab2">Content 2</Tabs.Content>
988
+ </Tabs>
989
+ ```
990
+
991
+ | Prop (List) | Type | Default | Description |
992
+ |---|---|---|---|
993
+ | variant | `'line' \| 'enclosed' \| 'pill'` | `'line'` | Tab style |
994
+ | size | `'sm' \| 'md' \| 'default' \| 'lg'` | `'default'` | Tab size |
995
+ | fitted | `boolean` | `false` | Full width tabs |
996
+ | color | `'default' \| 'primary'` | `'default'` | Active tab color |
997
+ | radius | `'none' \| 'sm' \| 'md' \| 'default' \| 'lg' \| 'full'` | `'default'` | Border radius (enclosed/pill) |
998
+
999
+ **Sub-components:** Tabs.List, Tabs.Trigger, Tabs.Content
1000
+
1001
+ ---
1002
+
1003
+ ### Accordion
1004
+
1005
+ ```tsx
1006
+ import { Accordion } from '@7onic-ui/react'
1007
+
1008
+ <Accordion type="single" collapsible defaultValue="item-1">
1009
+ <Accordion.Item value="item-1">
1010
+ <Accordion.Trigger>Section 1</Accordion.Trigger>
1011
+ <Accordion.Content>Content 1</Accordion.Content>
1012
+ </Accordion.Item>
1013
+ <Accordion.Item value="item-2">
1014
+ <Accordion.Trigger>Section 2</Accordion.Trigger>
1015
+ <Accordion.Content>Content 2</Accordion.Content>
1016
+ </Accordion.Item>
1017
+ </Accordion>
1018
+ ```
1019
+
1020
+ | Prop (Root) | Type | Default | Description |
1021
+ |---|---|---|---|
1022
+ | type | `'single' \| 'multiple'` | required | Expansion mode |
1023
+ | variant | `'default' \| 'bordered' \| 'splitted'` | `'default'` | Visual style |
1024
+ | size | `'sm' \| 'default' \| 'lg'` | `'default'` | Padding scale |
1025
+ | iconPosition | `'left' \| 'right'` | `'right'` | Chevron placement |
1026
+ | collapsible | `boolean` | `false` | Allow all closed (single only) |
1027
+
1028
+ **Sub-components:** Accordion.Item, Accordion.Trigger (with `icon` prop), Accordion.Content
1029
+
1030
+ ---
1031
+
1032
+ ### Divider
1033
+
1034
+ ```tsx
1035
+ import { Divider } from '@7onic-ui/react'
1036
+
1037
+ <Divider />
1038
+ <Divider variant="dashed" color="muted" />
1039
+ <Divider label="OR" labelPosition="center" />
1040
+ <Divider orientation="vertical" />
1041
+ ```
1042
+
1043
+ | Prop | Type | Default | Description |
1044
+ |---|---|---|---|
1045
+ | orientation | `'horizontal' \| 'vertical'` | `'horizontal'` | Direction |
1046
+ | variant | `'solid' \| 'dashed' \| 'dotted'` | `'solid'` | Line style |
1047
+ | color | `'default' \| 'muted' \| 'strong'` | `'default'` | Line color |
1048
+ | spacing | `'sm' \| 'md' \| 'default' \| 'lg'` | `'default'` | Margin around line |
1049
+ | label | `string` | — | Center label text |
1050
+ | labelPosition | `'left' \| 'center' \| 'right'` | `'center'` | Label placement |
1051
+
1052
+ ---
1053
+
1054
+ ## Overlay
1055
+
1056
+ ### Modal
1057
+
1058
+ ```tsx
1059
+ import { Modal, Button } from '@7onic-ui/react'
1060
+
1061
+ <Modal>
1062
+ <Modal.Trigger asChild>
1063
+ <Button>Open Modal</Button>
1064
+ </Modal.Trigger>
1065
+ <Modal.Portal>
1066
+ <Modal.Overlay />
1067
+ <Modal.Content size="md">
1068
+ <Modal.Header>
1069
+ <Modal.Title>Confirm</Modal.Title>
1070
+ <Modal.Description>Are you sure?</Modal.Description>
1071
+ </Modal.Header>
1072
+ <Modal.Body>Modal body content</Modal.Body>
1073
+ <Modal.Footer>
1074
+ <Modal.Close asChild><Button variant="outline">Cancel</Button></Modal.Close>
1075
+ <Button color="primary">Confirm</Button>
1076
+ </Modal.Footer>
1077
+ </Modal.Content>
1078
+ </Modal.Portal>
1079
+ </Modal>
1080
+ ```
1081
+
1082
+ | Prop (Content) | Type | Default | Description |
1083
+ |---|---|---|---|
1084
+ | size | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'` | `'md'` | Modal width |
1085
+ | scrollBehavior | `'inside' \| 'outside'` | `'inside'` | Scroll target |
1086
+ | showCloseButton | `boolean` | `true` | Show X button |
1087
+
1088
+ **Sub-components:** Modal.Trigger, Modal.Portal, Modal.Overlay, Modal.Content, Modal.Header, Modal.Title, Modal.Description, Modal.Body, Modal.Footer, Modal.Close
1089
+
1090
+ **Required structure:** Portal → Overlay + Content. Don't forget Portal and Overlay.
1091
+
1092
+ ---
1093
+
1094
+ ### Drawer
1095
+
1096
+ ```tsx
1097
+ import { Drawer, Button } from '@7onic-ui/react'
1098
+
1099
+ <Drawer>
1100
+ <Drawer.Trigger asChild>
1101
+ <Button>Open Drawer</Button>
1102
+ </Drawer.Trigger>
1103
+ <Drawer.Portal>
1104
+ <Drawer.Overlay />
1105
+ <Drawer.Content side="right" size="md">
1106
+ <Drawer.Header>
1107
+ <Drawer.Title>Settings</Drawer.Title>
1108
+ </Drawer.Header>
1109
+ <Drawer.Body>Content</Drawer.Body>
1110
+ <Drawer.Footer>
1111
+ <Drawer.Close asChild><Button variant="outline">Close</Button></Drawer.Close>
1112
+ </Drawer.Footer>
1113
+ </Drawer.Content>
1114
+ </Drawer.Portal>
1115
+ </Drawer>
1116
+ ```
1117
+
1118
+ | Prop (Content) | Type | Default | Description |
1119
+ |---|---|---|---|
1120
+ | side | `'left' \| 'right' \| 'top' \| 'bottom'` | `'right'` | Slide direction |
1121
+ | size | `'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'` | `'md'` | Width/height |
1122
+ | showCloseButton | `boolean` | `true` | Show X button |
1123
+
1124
+ **Sub-components:** Drawer.Trigger, Drawer.Portal, Drawer.Overlay, Drawer.Content, Drawer.Header, Drawer.Title, Drawer.Description, Drawer.Body, Drawer.Footer, Drawer.Close
1125
+
1126
+ ---
1127
+
1128
+ ### Tooltip
1129
+
1130
+ ```tsx
1131
+ import { Tooltip } from '@7onic-ui/react'
1132
+
1133
+ <Tooltip.Provider>
1134
+ <Tooltip>
1135
+ <Tooltip.Trigger asChild>
1136
+ <Button>Hover me</Button>
1137
+ </Tooltip.Trigger>
1138
+ <Tooltip.Portal>
1139
+ <Tooltip.Content side="top" showArrow>
1140
+ Tooltip text
1141
+ <Tooltip.Arrow />
1142
+ </Tooltip.Content>
1143
+ </Tooltip.Portal>
1144
+ </Tooltip>
1145
+ </Tooltip.Provider>
1146
+ ```
1147
+
1148
+ | Prop (Root) | Type | Default | Description |
1149
+ |---|---|---|---|
1150
+ | delayDuration | `number` | `200` | Hover delay (ms) |
1151
+
1152
+ | Prop (Content) | Type | Default | Description |
1153
+ |---|---|---|---|
1154
+ | variant | `'default' \| 'inverted'` | `'default'` | Dark/light bg |
1155
+ | size | `'sm' \| 'default'` | `'default'` | Padding scale |
1156
+ | side | `'top' \| 'right' \| 'bottom' \| 'left'` | `'top'` | Placement |
1157
+ | showArrow | `boolean` | `false` | Show arrow |
1158
+ | sideOffset | `number` | `4` | Gap from trigger |
1159
+
1160
+ **⚠️ Tooltip.Provider is required** — wrap your app or section with it.
1161
+ **Sub-components:** Tooltip.Provider, Tooltip.Trigger, Tooltip.Content, Tooltip.Arrow, Tooltip.Portal
1162
+
1163
+ ---
1164
+
1165
+ ### Popover
1166
+
1167
+ ```tsx
1168
+ import { Popover, Button } from '@7onic-ui/react'
1169
+
1170
+ <Popover>
1171
+ <Popover.Trigger asChild>
1172
+ <Button variant="outline">Open</Button>
1173
+ </Popover.Trigger>
1174
+ <Popover.Portal>
1175
+ <Popover.Content side="bottom" showArrow showClose>
1176
+ <Popover.Arrow />
1177
+ <p>Popover content</p>
1178
+ </Popover.Content>
1179
+ </Popover.Portal>
1180
+ </Popover>
1181
+ ```
1182
+
1183
+ | Prop (Content) | Type | Default | Description |
1184
+ |---|---|---|---|
1185
+ | variant | `'default' \| 'elevated'` | `'default'` | Shadow style |
1186
+ | size | `'sm' \| 'default' \| 'lg'` | `'default'` | Padding scale |
1187
+ | side | `'top' \| 'right' \| 'bottom' \| 'left'` | `'bottom'` | Placement |
1188
+ | showArrow | `boolean` | `false` | Show arrow |
1189
+ | showClose | `boolean` | `false` | Show X button |
1190
+
1191
+ **Sub-components:** Popover.Trigger, Popover.Content, Popover.Arrow, Popover.Close, Popover.Anchor, Popover.Portal
1192
+
1193
+ ---
1194
+
1195
+ ## Feedback
1196
+
1197
+ ### Alert
1198
+
1199
+ ```tsx
1200
+ import { Alert } from '@7onic-ui/react'
1201
+
1202
+ <Alert color="success" closable onClose={() => {}}>
1203
+ <Alert.Title>Success</Alert.Title>
1204
+ <Alert.Description>Operation completed.</Alert.Description>
1205
+ </Alert>
1206
+
1207
+ <Alert variant="filled" color="error" icon={<ErrorIcon />}>
1208
+ <Alert.Title>Error</Alert.Title>
1209
+ </Alert>
1210
+ ```
1211
+
1212
+ | Prop (Root) | Type | Default | Description |
1213
+ |---|---|---|---|
1214
+ | variant | `'default' \| 'outline' \| 'filled'` | `'default'` | Visual style |
1215
+ | color | `'info' \| 'success' \| 'warning' \| 'error'` | `'info'` | Color scheme |
1216
+ | size | `'sm' \| 'default' \| 'lg'` | `'default'` | Padding scale |
1217
+ | radius | Same as Card | `'lg'` | Border radius |
1218
+ | closable | `boolean` | `false` | Show close button |
1219
+ | onClose | `() => void` | — | Close handler |
1220
+ | icon | `ReactNode` | auto | Custom icon (auto-selects by color) |
1221
+ | hideIcon | `boolean` | `false` | Hide icon |
1222
+
1223
+ **Sub-components:** Alert.Title, Alert.Description
1224
+
1225
+ ---
1226
+
1227
+ ### Toast (Imperative API)
1228
+
1229
+ ```tsx
1230
+ import { Toaster, toast } from '@7onic-ui/react'
1231
+
1232
+ // 1. Add Toaster provider to your app layout (once)
1233
+ <Toaster position="bottom-right" />
1234
+
1235
+ // 2. Call toast() anywhere
1236
+ toast('Default notification')
1237
+ toast.success('Saved successfully')
1238
+ toast.error('Something went wrong')
1239
+ toast.warning('Please check your input')
1240
+ toast.info('New update available')
1241
+ toast.loading('Processing...')
1242
+
1243
+ // With options
1244
+ toast.success('Saved', {
1245
+ description: 'Your changes have been saved.',
1246
+ duration: 5000,
1247
+ action: { label: 'Undo', onClick: () => {} },
1248
+ })
1249
+
1250
+ // Promise
1251
+ toast.promise(fetchData(), {
1252
+ loading: 'Loading...',
1253
+ success: 'Data loaded',
1254
+ error: 'Failed to load',
1255
+ })
1256
+
1257
+ // Dismiss
1258
+ const id = toast('Message')
1259
+ toast.dismiss(id) // Dismiss specific
1260
+ toast.dismiss() // Dismiss all
1261
+ ```
1262
+
1263
+ | Prop (Toaster) | Type | Default | Description |
1264
+ |---|---|---|---|
1265
+ | position | `'top-left' \| 'top-center' \| 'top-right' \| 'bottom-left' \| 'bottom-center' \| 'bottom-right'` | `'bottom-right'` | Toast position |
1266
+ | size | `'sm' \| 'default' \| 'lg'` | `'default'` | Toast size |
1267
+ | duration | `number` | `4000` | Auto-dismiss ms (0 = persistent) |
1268
+ | closeButton | `boolean` | `false` | Show close button |
1269
+ | richColors | `boolean` | `false` | Filled color backgrounds |
1270
+ | expand | `boolean` | `false` | Show all toasts expanded |
1271
+ | visibleToasts | `number` | `3` | Max visible at once |
1272
+
1273
+ **⚠️ No Portal needed.** Just place `<Toaster />` in your root layout. Call `toast()` from anywhere.
1274
+
1275
+ ---
1276
+
1277
+ ### Progress
1278
+
1279
+ ```tsx
1280
+ import { Progress } from '@7onic-ui/react'
1281
+
1282
+ <Progress value={65} showValue />
1283
+ <Progress type="circular" value={75} color="primary" />
1284
+ <Progress variant="striped" animated value={50} />
1285
+ ```
1286
+
1287
+ | Prop | Type | Default | Description |
1288
+ |---|---|---|---|
1289
+ | type | `'linear' \| 'circular'` | `'linear'` | Shape |
1290
+ | value | `number` | `0` | Current value |
1291
+ | max | `number` | `100` | Maximum value |
1292
+ | size | `'sm' \| 'default' \| 'lg'` | `'default'` | Bar/circle size |
1293
+ | variant | `'default' \| 'striped'` | `'default'` | Bar fill style |
1294
+ | color | `'default' \| 'primary'` | `'default'` | Fill color |
1295
+ | showValue | `boolean` | `false` | Show percentage text |
1296
+ | formatLabel | `(value: number, max: number) => string` | — | Custom label |
1297
+ | animated | `boolean` | `false` | Animate stripes |
1298
+
1299
+ ---
1300
+
1301
+ ### Spinner
1302
+
1303
+ ```tsx
1304
+ import { Spinner } from '@7onic-ui/react'
1305
+
1306
+ <Spinner />
1307
+ <Spinner variant="dots" size="lg" color="primary" />
1308
+ <Spinner variant="bars" speed="slow" />
1309
+ <Spinner variant="orbit" orbitStyle="morph" />
1310
+ ```
1311
+
1312
+ | Prop | Type | Default | Description |
1313
+ |---|---|---|---|
1314
+ | variant | `'ring' \| 'dots' \| 'bars' \| 'orbit'` | `'ring'` | Animation style |
1315
+ | orbitStyle | `'ring' \| 'dots' \| 'cube' \| 'flip' \| 'morph'` | `'ring'` | Orbit sub-variant |
1316
+ | size | `'sm' \| 'default' \| 'lg'` | `'default'` | Spinner size |
1317
+ | color | `'default' \| 'primary' \| 'current'` | `'default'` | Color |
1318
+ | speed | `'slow' \| 'default' \| 'fast'` | `'default'` | Animation speed |
1319
+ | label | `string` | `'Loading'` | aria-label text |
1320
+
1321
+ ---
1322
+
1323
+ ### Skeleton
1324
+
1325
+ ```tsx
1326
+ import { Skeleton } from '@7onic-ui/react'
1327
+
1328
+ <Skeleton variant="text" count={3} />
1329
+ <Skeleton variant="circular" width={48} height={48} />
1330
+ <Skeleton variant="rectangular" width="100%" height={200} />
1331
+
1332
+ {/* Conditional rendering */}
1333
+ <Skeleton loading={isLoading}>
1334
+ <ActualContent />
1335
+ </Skeleton>
1336
+ ```
1337
+
1338
+ | Prop | Type | Default | Description |
1339
+ |---|---|---|---|
1340
+ | variant | `'text' \| 'circular' \| 'rectangular'` | `'text'` | Shape |
1341
+ | animation | `'pulse' \| 'wave' \| false` | `'pulse'` | Animation style |
1342
+ | width | `number \| string` | — | Width (px or CSS) |
1343
+ | height | `number \| string` | — | Height (px or CSS) |
1344
+ | radius | `number \| string` | — | Border radius |
1345
+ | count | `number` | `1` | Multi-line count |
1346
+ | loading | `boolean` | `true` | Show skeleton vs children |
1347
+ | children | `ReactNode` | — | Content (shown when loading=false) |
1348
+
1349
+ ---
1350
+
1351
+ ## Navigation
1352
+
1353
+ ### Breadcrumb
1354
+
1355
+ ```tsx
1356
+ import { Breadcrumb } from '@7onic-ui/react'
1357
+
1358
+ <Breadcrumb>
1359
+ <Breadcrumb.List>
1360
+ <Breadcrumb.Item>
1361
+ <Breadcrumb.Link href="/">Home</Breadcrumb.Link>
1362
+ </Breadcrumb.Item>
1363
+ <Breadcrumb.Separator />
1364
+ <Breadcrumb.Item>
1365
+ <Breadcrumb.Link href="/docs">Docs</Breadcrumb.Link>
1366
+ </Breadcrumb.Item>
1367
+ <Breadcrumb.Separator />
1368
+ <Breadcrumb.Item>
1369
+ <Breadcrumb.Page>Current</Breadcrumb.Page>
1370
+ </Breadcrumb.Item>
1371
+ </Breadcrumb.List>
1372
+ </Breadcrumb>
1373
+ ```
1374
+
1375
+ | Prop (Root) | Type | Default | Description |
1376
+ |---|---|---|---|
1377
+ | separator | `ReactNode` | `'/'` | Custom separator |
1378
+ | size | `'sm' \| 'default' \| 'lg'` | `'default'` | Text size |
1379
+ | maxItems | `number` | — | Collapse threshold |
1380
+ | itemsBeforeCollapse | `number` | `1` | Items before ellipsis |
1381
+ | itemsAfterCollapse | `number` | `1` | Items after ellipsis |
1382
+
1383
+ **Sub-components:** Breadcrumb.List, Breadcrumb.Item, Breadcrumb.Link (with `asChild`), Breadcrumb.Page, Breadcrumb.Separator, Breadcrumb.Ellipsis
1384
+
1385
+ ---
1386
+
1387
+ ### Pagination
1388
+
1389
+ ```tsx
1390
+ import { Pagination } from '@7onic-ui/react'
1391
+
1392
+ {/* Quick mode */}
1393
+ <Pagination total={10} defaultValue={1} />
1394
+
1395
+ {/* Compound mode */}
1396
+ <Pagination total={20} value={page} onChange={setPage}>
1397
+ <Pagination.Content>
1398
+ <Pagination.Previous />
1399
+ <Pagination.Items />
1400
+ <Pagination.Next />
1401
+ </Pagination.Content>
1402
+ </Pagination>
1403
+ ```
1404
+
1405
+ | Prop (Root) | Type | Default | Description |
1406
+ |---|---|---|---|
1407
+ | total | `number` | required | Total pages |
1408
+ | value | `number` | — | Controlled page |
1409
+ | defaultValue | `number` | `1` | Uncontrolled default |
1410
+ | onChange | `(page: number) => void` | — | Change handler |
1411
+ | siblings | `number` | `1` | Pages beside current |
1412
+ | boundaries | `number` | `1` | Pages at start/end |
1413
+ | variant | `'default' \| 'outline' \| 'ghost'` | `'default'` | Visual style |
1414
+ | color | `'default' \| 'primary'` | `'default'` | Active page color |
1415
+ | size | `'xs' \| 'sm' \| 'default' \| 'lg' \| 'xl'` | `'default'` | Button size |
1416
+ | radius | `'none' \| 'sm' \| 'md' \| 'default' \| 'lg' \| 'full'` | `'default'` | Border radius |
1417
+ | loop | `boolean` | `false` | Wrap around |
1418
+ | disabled | `boolean` | `false` | Disabled state |
1419
+
1420
+ **Sub-components:** Pagination.Content, Pagination.Item, Pagination.Link, Pagination.Previous, Pagination.Next, Pagination.First, Pagination.Last, Pagination.Ellipsis, Pagination.Items
1421
+
1422
+ ---
1423
+
1424
+ ### NavigationMenu
1425
+
1426
+ ```tsx
1427
+ import { NavigationMenu } from '@7onic-ui/react'
1428
+
1429
+ {/* Horizontal (header) */}
1430
+ <NavigationMenu orientation="horizontal">
1431
+ <NavigationMenu.List>
1432
+ <NavigationMenu.Item>
1433
+ <NavigationMenu.Link href="/" active>Home</NavigationMenu.Link>
1434
+ </NavigationMenu.Item>
1435
+ <NavigationMenu.Item>
1436
+ <NavigationMenu.Trigger>Products</NavigationMenu.Trigger>
1437
+ <NavigationMenu.Content>
1438
+ <NavigationMenu.Link href="/product-a">Product A</NavigationMenu.Link>
1439
+ <NavigationMenu.Link href="/product-b">Product B</NavigationMenu.Link>
1440
+ </NavigationMenu.Content>
1441
+ </NavigationMenu.Item>
1442
+ </NavigationMenu.List>
1443
+ <NavigationMenu.Viewport />
1444
+ </NavigationMenu>
1445
+
1446
+ {/* Vertical (sidebar) */}
1447
+ <NavigationMenu orientation="vertical" size="default">
1448
+ <NavigationMenu.List>
1449
+ <NavigationMenu.Group label="Main">
1450
+ <NavigationMenu.Item>
1451
+ <NavigationMenu.Link href="/" icon={<HomeIcon />} active>Dashboard</NavigationMenu.Link>
1452
+ </NavigationMenu.Item>
1453
+ </NavigationMenu.Group>
1454
+ </NavigationMenu.List>
1455
+ </NavigationMenu>
1456
+ ```
1457
+
1458
+ | Prop (Root) | Type | Default | Description |
1459
+ |---|---|---|---|
1460
+ | orientation | `'horizontal' \| 'vertical'` | `'horizontal'` | Layout mode |
1461
+ | size | `'sm' \| 'md' \| 'default' \| 'lg'` | `'default'` | Item size |
1462
+ | collapsed | `boolean` | `false` | Icon-only mode (vertical) |
1463
+ | radius | Same as Button | `'default'` | Border radius |
1464
+ | fontWeight | `'normal' \| 'semibold'` | `'normal'` | Font weight |
1465
+
1466
+ | Prop (Link) | Type | Default | Description |
1467
+ |---|---|---|---|
1468
+ | active | `boolean` | `false` | Current page indicator |
1469
+ | icon | `ReactNode` | — | Leading icon |
1470
+ | asChild | `boolean` | `false` | Slot pattern |
1471
+
1472
+ **Sub-components:** NavigationMenu.List, NavigationMenu.Item, NavigationMenu.Trigger, NavigationMenu.Content, NavigationMenu.Link, NavigationMenu.Group (vertical only, with `label`), NavigationMenu.Indicator (horizontal only), NavigationMenu.Viewport
1473
+
1474
+ ---
1475
+
1476
+ ## Charts
1477
+
1478
+ ### Chart (Container + Sub-components)
1479
+
1480
+ All chart types use the Chart namespace:
1481
+
1482
+ ```tsx
1483
+ import { Chart } from '@7onic-ui/react/chart'
1484
+
1485
+ const chartConfig = {
1486
+ revenue: { label: 'Revenue', color: 'var(--color-chart-1)' },
1487
+ profit: { label: 'Profit', color: 'var(--color-chart-2)' },
1488
+ }
1489
+
1490
+ {/* Line Chart */}
1491
+ <Chart config={chartConfig} className="h-[300px]">
1492
+ <Chart.XAxis dataKey="month" />
1493
+ <Chart.YAxis />
1494
+ <Chart.Tooltip content={<Chart.TooltipContent />} />
1495
+ <Chart.Legend content={<Chart.LegendContent />} />
1496
+ <Chart.Line dataKey="revenue" type="monotone" />
1497
+ <Chart.Line dataKey="profit" type="monotone" variant="dashed" />
1498
+ </Chart>
1499
+
1500
+ {/* Bar Chart */}
1501
+ <Chart config={chartConfig} className="h-[300px]" hoverFade>
1502
+ <Chart.XAxis dataKey="month" />
1503
+ <Chart.YAxis />
1504
+ <Chart.Tooltip content={<Chart.TooltipContent />} />
1505
+ <Chart.Bar dataKey="revenue" radius="md" />
1506
+ <Chart.Bar dataKey="profit" radius="md" />
1507
+ </Chart>
1508
+
1509
+ {/* Area Chart */}
1510
+ <Chart config={chartConfig} className="h-[300px]">
1511
+ <Chart.XAxis dataKey="month" />
1512
+ <Chart.YAxis />
1513
+ <Chart.Tooltip content={<Chart.TooltipContent />} />
1514
+ <Chart.Area dataKey="revenue" type="monotone" variant="gradient" />
1515
+ </Chart>
1516
+
1517
+ {/* Pie Chart */}
1518
+ <Chart config={chartConfig} className="h-[300px]">
1519
+ <Chart.Tooltip content={<Chart.TooltipContent />} />
1520
+ <Chart.Pie data={data} dataKey="value" nameKey="name" variant="donut" label="outside" />
1521
+ </Chart>
1522
+ ```
1523
+
1524
+ **⚠️ chartConfig is REQUIRED.** It maps data keys to labels and colors.
1525
+
1526
+ | Prop (Container) | Type | Default | Description |
1527
+ |---|---|---|---|
1528
+ | config | `ChartConfig` | required | Data key → label/color mapping |
1529
+ | hoverFade | `boolean` | `false` | Fade non-hovered elements |
1530
+
1531
+ | Prop (Bar) | Type | Default | Description |
1532
+ |---|---|---|---|
1533
+ | radius | `'none' \| 'sm' \| 'base' \| 'md' \| 'lg'` | `'none'` | Bar corner radius |
1534
+ | layout | `'vertical' \| 'horizontal'` | `'vertical'` | Bar direction |
1535
+ | variant | `'solid' \| 'outline'` | `'solid'` | Fill style |
1536
+ | stackPosition | `'top' \| 'bottom'` | `'top'` | Stack position |
1537
+
1538
+ | Prop (Line) | Type | Default | Description |
1539
+ |---|---|---|---|
1540
+ | type | `'linear' \| 'monotone' \| 'step' \| 'natural'` | `'monotone'` | Curve type |
1541
+ | variant | `'solid' \| 'dashed'` | `'solid'` | Line style |
1542
+ | dot | `boolean` | `true` | Show data points |
1543
+ | activeDot | `boolean` | `true` | Show active point |
1544
+
1545
+ | Prop (Area) | Type | Default | Description |
1546
+ |---|---|---|---|
1547
+ | type | `'linear' \| 'monotone' \| 'step' \| 'natural'` | `'monotone'` | Curve type |
1548
+ | variant | `'solid' \| 'gradient'` | `'solid'` | Fill style |
1549
+ | fillOpacity | `number` | `0.4` | Fill opacity (0-1) |
1550
+
1551
+ | Prop (Pie) | Type | Default | Description |
1552
+ |---|---|---|---|
1553
+ | variant | `'pie' \| 'donut'` | `'pie'` | Pie or donut |
1554
+ | label | `'none' \| 'outside' \| 'inside'` | `'none'` | Label display |
1555
+ | labelContent | `'value' \| 'percent'` | `'value'` | Label format |
1556
+ | activeShape | `boolean` | `true` | Expand on hover |
1557
+
1558
+ **Chart Colors (CSS variables):**
1559
+ `--color-chart-1` (blue), `--color-chart-2` (pink), `--color-chart-3` (lavender), `--color-chart-4` (sky), `--color-chart-5` (rose)
1560
+ Each has light/dark theme variants.
1561
+
1562
+ **ChartConfig format:**
1563
+ ```tsx
1564
+ type ChartConfig = {
1565
+ [dataKey: string]: {
1566
+ label?: ReactNode
1567
+ icon?: ComponentType
1568
+ color?: string // CSS color or variable
1569
+ // OR theme-specific:
1570
+ theme?: { light: string, dark: string }
1571
+ }
1572
+ }
1573
+ ```
1574
+
1575
+ ---
1576
+
1577
+ ### MetricCard
1578
+
1579
+ ```tsx
1580
+ import { MetricCard } from '@7onic-ui/react'
1581
+
1582
+ <MetricCard>
1583
+ <MetricCard.Header>
1584
+ <MetricCard.Title>Revenue</MetricCard.Title>
1585
+ <MetricCard.Symbol><DollarIcon /></MetricCard.Symbol>
1586
+ </MetricCard.Header>
1587
+ <MetricCard.Value animated>$12,450</MetricCard.Value>
1588
+ <MetricCard.Trend direction="up">+12.5%</MetricCard.Trend>
1589
+ <MetricCard.Description>vs. last month</MetricCard.Description>
1590
+ </MetricCard>
1591
+ ```
1592
+
1593
+ | Prop (Root) | Type | Default | Description |
1594
+ |---|---|---|---|
1595
+ | variant | `'default' \| 'elevated' \| 'ghost'` | `'default'` | Visual style |
1596
+ | size | `'sm' \| 'default' \| 'lg'` | `'default'` | Padding scale |
1597
+ | radius | Same as Card + `'none'` | `'xl'` | Border radius |
1598
+
1599
+ | Prop (Value) | Type | Default | Description |
1600
+ |---|---|---|---|
1601
+ | animated | `boolean` | `false` | Number count-up animation |
1602
+
1603
+ | Prop (Trend) | Type | Default | Description |
1604
+ |---|---|---|---|
1605
+ | direction | `'up' \| 'down' \| 'neutral'` | — | Trend arrow + color |
1606
+
1607
+ **Sub-components:** MetricCard.Header, MetricCard.Title, MetricCard.Value, MetricCard.Trend, MetricCard.Description, MetricCard.Symbol
1608
+
1609
+ ---
1610
+
1611
+ # ═══ SECTION 4: COMPONENT USAGE GUIDE ═══
1612
+
1613
+ ## Component Selection
1614
+
1615
+ Before creating custom UI, check if 7onic already has it:
1616
+
1617
+ | Need | Use This Component |
1618
+ |---|---|
1619
+ | Action trigger | Button, IconButton |
1620
+ | Text input | Input (single line), Textarea (multi line) |
1621
+ | Selection (one) | RadioGroup, Select, Segmented |
1622
+ | Selection (many) | Checkbox, ToggleGroup |
1623
+ | Boolean toggle | Switch, Toggle, Checkbox |
1624
+ | Container | Card |
1625
+ | Data table | Table |
1626
+ | Tabs | Tabs |
1627
+ | Collapsible | Accordion |
1628
+ | Dialog | Modal |
1629
+ | Side panel | Drawer |
1630
+ | Hint text | Tooltip |
1631
+ | Rich hint | Popover |
1632
+ | Notification | Toast (imperative), Alert (inline) |
1633
+ | Loading | Spinner (indeterminate), Progress (determinate), Skeleton (placeholder) |
1634
+ | Navigation | Breadcrumb, Pagination, NavigationMenu |
1635
+ | Data visualization | Chart (Line/Area/Bar/Pie), MetricCard |
1636
+ | Metric display | MetricCard |
1637
+ | Tag / chip | Badge (with `removable`) |
1638
+ | Avatar | Avatar |
1639
+ | Separator | Divider |
1640
+
1641
+ **If the component exists, use it.** Don't build custom versions with HTML + classes.
1642
+
1643
+ ---
1644
+
1645
+ ## Import Pattern
1646
+
1647
+ ```tsx
1648
+ // ✅ Single import path
1649
+ import { Button, Card, Input, toast } from '@7onic-ui/react'
1650
+
1651
+ // ✅ Chart components use a separate entry point (recharts is optional)
1652
+ import { Chart } from '@7onic-ui/react/chart'
1653
+
1654
+ // ❌ Never import from internal paths
1655
+ import { Button } from '@7onic-ui/react/components/button' // WRONG
1656
+
1657
+ // ❌ Never import Radix directly
1658
+ import * as Dialog from '@radix-ui/react-dialog' // WRONG → use Modal
1659
+ ```
1660
+
1661
+ ---
1662
+
1663
+ ## Compound Component Structure
1664
+
1665
+ Compound components have **required sub-components**. Missing them causes errors or broken UI.
1666
+
1667
+ **Modal — required structure:**
1668
+ ```tsx
1669
+ <Modal>
1670
+ <Modal.Trigger>...</Modal.Trigger>
1671
+ <Modal.Portal> {/* ← Required for correct z-index */}
1672
+ <Modal.Overlay /> {/* ← Required for backdrop */}
1673
+ <Modal.Content>
1674
+ <Modal.Header>
1675
+ <Modal.Title>...</Modal.Title>
1676
+ </Modal.Header>
1677
+ <Modal.Body>...</Modal.Body>
1678
+ </Modal.Content>
1679
+ </Modal.Portal>
1680
+ </Modal>
1681
+ ```
1682
+
1683
+ **Drawer — same pattern as Modal** (Portal + Overlay + Content required)
1684
+
1685
+ **Tooltip — Provider required:**
1686
+ ```tsx
1687
+ <Tooltip.Provider> {/* ← Required, wrap app once */}
1688
+ <Tooltip>
1689
+ <Tooltip.Trigger>...</Tooltip.Trigger>
1690
+ <Tooltip.Portal>
1691
+ <Tooltip.Content>...</Tooltip.Content>
1692
+ </Tooltip.Portal>
1693
+ </Tooltip>
1694
+ </Tooltip.Provider>
1695
+ ```
1696
+
1697
+ **Toast — imperative API, no compound structure:**
1698
+ ```tsx
1699
+ // Place Toaster once in layout
1700
+ <Toaster />
1701
+ // Call toast() anywhere
1702
+ toast.success('Done')
1703
+ ```
1704
+
1705
+ ---
1706
+
1707
+ ## asChild Pattern (Slot)
1708
+
1709
+ `asChild` replaces the component's DOM element with its child, keeping styles and behavior:
1710
+
1711
+ ```tsx
1712
+ // ❌ Double <a> — broken HTML
1713
+ <Link href="/about">
1714
+ <Button>About</Button>
1715
+ </Link>
1716
+
1717
+ // ✅ Button renders as <a> with Button styles
1718
+ <Button asChild>
1719
+ <Link href="/about">About</Link>
1720
+ </Button>
1721
+
1722
+ // ✅ DropdownMenu item as link
1723
+ <DropdownMenu.Item asChild>
1724
+ <Link href="/settings">Settings</Link>
1725
+ </DropdownMenu.Item>
1726
+
1727
+ // ✅ Breadcrumb as Next.js Link
1728
+ <Breadcrumb.Link asChild>
1729
+ <Link href="/">Home</Link>
1730
+ </Breadcrumb.Link>
1731
+ ```
1732
+
1733
+ **Use `asChild` when combining 7onic components with routing `<Link>`.**
1734
+ Components that support `asChild`: Button, IconButton, Badge, Card, Modal.Trigger, Modal.Close, Drawer.Trigger, Drawer.Close, DropdownMenu.Item, Breadcrumb.Link, NavigationMenu.Link, Tooltip.Trigger, Popover.Trigger
1735
+
1736
+ ---
1737
+
1738
+ ## Props Usage
1739
+
1740
+ **Always use allowed values.** Don't pass arbitrary strings to variant/size/color props.
1741
+
1742
+ ```tsx
1743
+ // ✅ Correct
1744
+ <Button variant="solid" size="default" color="primary" />
1745
+
1746
+ // ❌ Wrong — invalid values
1747
+ <Button variant="primary" /> // 'primary' is a color, not a variant
1748
+ <Button size="medium" /> // Use 'md' or 'default', not 'medium'
1749
+ <Button color="blue" /> // Use 'primary', not raw color names
1750
+ ```
1751
+
1752
+ **`className` on components = layout ONLY** (margin, width, flex positioning). All visual styling (color, size, radius, variant) must use Props.
1753
+
1754
+ **Style via Props, not className:**
1755
+ ```tsx
1756
+ // ✅ Use Props
1757
+ <Button color="primary" size="lg" />
1758
+ <Badge color="error" variant="subtle" />
1759
+
1760
+ // ❌ Don't override with className
1761
+ <Button className="bg-blue-500 text-white" />
1762
+ <Badge className="bg-red-100" />
1763
+ ```
1764
+
1765
+ ---
1766
+
1767
+ ## Form Patterns
1768
+
1769
+ **Use Field wrapper** for labeled form elements with validation:
1770
+
1771
+ ```tsx
1772
+ import { Field, Input, Textarea, Checkbox } from '@7onic-ui/react'
1773
+
1774
+ {/* Text input with label + error */}
1775
+ <Field error={errors.email}>
1776
+ <Field.Label required>Email</Field.Label>
1777
+ <Input placeholder="you@example.com" />
1778
+ <Field.Error />
1779
+ </Field>
1780
+
1781
+ {/* Textarea with character count */}
1782
+ <Field>
1783
+ <Field.Label>Bio</Field.Label>
1784
+ <Textarea maxLength={200} />
1785
+ <Field.CharCount />
1786
+ </Field>
1787
+ ```
1788
+
1789
+ **Field context auto-connects** to Input, Textarea, Select, Checkbox, RadioGroup:
1790
+ - Passes `error` state
1791
+ - Passes `disabled` state
1792
+ - Auto-generates matching `id` / `htmlFor` / `aria-describedby`
1793
+
1794
+ ---
1795
+
1796
+ ## Chart Patterns
1797
+
1798
+ **⚠️ recharts is required.** Auto-install when using any Chart component:
1799
+ ```bash
1800
+ npm install recharts
1801
+ ```
1802
+
1803
+ **Always provide chartConfig:**
1804
+ ```tsx
1805
+ const chartConfig = {
1806
+ revenue: { label: 'Revenue', color: 'var(--color-chart-1)' },
1807
+ expenses: { label: 'Expenses', color: 'var(--color-chart-2)' },
1808
+ }
1809
+ ```
1810
+
1811
+ **Available chart colors (CSS variables, auto-adapt to light/dark):**
1812
+ - `var(--color-chart-1)` — blue
1813
+ - `var(--color-chart-2)` — pink
1814
+ - `var(--color-chart-3)` — lavender
1815
+ - `var(--color-chart-4)` — sky
1816
+ - `var(--color-chart-5)` — rose
1817
+
1818
+ **Container height is required (layout arbitrary value — allowed):**
1819
+ ```tsx
1820
+ <Chart config={chartConfig} className="h-[300px]">
1821
+ ```
1822
+
1823
+ ---
1824
+
1825
+ ## Overlay Patterns
1826
+
1827
+ **All overlays use Portal for correct stacking:**
1828
+ ```tsx
1829
+ <Modal.Portal>
1830
+ <Modal.Overlay />
1831
+ <Modal.Content>...</Modal.Content>
1832
+ </Modal.Portal>
1833
+ ```
1834
+
1835
+ **Z-index hierarchy (automatic via tokens) — never set custom z-index:**
1836
+ 1. `z-dropdown` (1000) — Dropdown, Select
1837
+ 2. `z-overlay` (1100) — Modal/Drawer overlay
1838
+ 3. `z-modal` (2000) — Modal/Drawer content
1839
+ 4. `z-popover` (2100) — Popover
1840
+ 5. `z-tooltip` (2200) — Tooltip
1841
+ 6. `z-toast` (3000) — Toast
1842
+
1843
+ ---
1844
+
1845
+ ## Accessibility
1846
+
1847
+ **Built-in (via Radix UI):** keyboard navigation, focus trap, ARIA attributes, screen reader.
1848
+
1849
+ **Do NOT override:**
1850
+ ```tsx
1851
+ // ❌ Never remove focus ring
1852
+ <Button className="outline-none focus:outline-none" />
1853
+
1854
+ // ✅ Focus ring is managed by the design system
1855
+ <Button />
1856
+ ```
1857
+
1858
+ **Always provide labels:**
1859
+ ```tsx
1860
+ <IconButton aria-label="Close"><XIcon /></IconButton>
1861
+
1862
+ <Field>
1863
+ <Field.Label>Email</Field.Label>
1864
+ <Input />
1865
+ </Field>
1866
+ ```
1867
+
1868
+ ---
1869
+
1870
+ ## Responsive Layout
1871
+
1872
+ **Mobile-first with token breakpoints:**
1873
+ ```tsx
1874
+ <div className="flex flex-col md:flex-row gap-4 md:gap-6">
1875
+ <Card className="w-full md:w-1/2">...</Card>
1876
+ <Card className="w-full md:w-1/2">...</Card>
1877
+ </div>
1878
+ ```
1879
+
1880
+ **Use component Props for sizing, not className overrides:**
1881
+ ```tsx
1882
+ // ✅ Correct
1883
+ <Button size="default" />
1884
+
1885
+ // ❌ Wrong
1886
+ <Button size="sm" className="md:h-10 md:px-4" />
1887
+ ```
1888
+
1889
+ ---
1890
+
1891
+ ## Performance
1892
+
1893
+ **Tree-shaking works automatically:**
1894
+ ```tsx
1895
+ import { Button, Card, Input } from '@7onic-ui/react'
1896
+ ```
1897
+
1898
+ **Don't wrap components unnecessarily:**
1899
+ ```tsx
1900
+ // ❌ Unnecessary
1901
+ function MyButton(props) { return <Button {...props} /> }
1902
+
1903
+ // ✅ Use directly
1904
+ <Button variant="solid" color="primary">Submit</Button>
1905
+ ```
1906
+
1907
+ **Next.js App Router:** 7onic components have `'use client'` internally — they render in Server Components.
1908
+ But if YOUR code uses React hooks (`useState`, `useEffect`) or event handlers (`onClick`, `onChange`), add `'use client'` at the top of your file. When in doubt, add `'use client'` — it's always safe.
1909
+
1910
+ ---
1911
+
1912
+ # ═══ SECTION 5: COMPLETE COMPONENT SUMMARY ═══
1913
+
1914
+ ## Quick Reference Table
1915
+
1916
+ | Component | Type | Variants | Sizes | Colors | Key Feature |
1917
+ |---|---|---|---|---|---|
1918
+ | Button | Standalone | solid/outline/ghost/link | xs/sm/md/default/lg | default/primary/secondary/destructive | loading, icons, press effect |
1919
+ | IconButton | Standalone | solid/outline/ghost/subtle | xs/sm/md/default/lg | default/primary/secondary/destructive | Square, icon-only |
1920
+ | ButtonGroup | Container | outline/ghost | (inherits) | (inherits) | Context provider, attached |
1921
+ | Input | Standalone | default/filled | xs/sm/default/lg/xl | — | leftIcon/rightIcon, error |
1922
+ | Textarea | Standalone | default/filled | compact/default | — | resize options |
1923
+ | Select | Compound | — | xs/sm/default/lg/xl | — | Trigger + Content + Item |
1924
+ | DropdownMenu | Compound | — | sm/md/lg | — | CheckboxItem, RadioItem, Sub |
1925
+ | Checkbox | Standalone | — | sm/default/lg | default/primary | indeterminate, label |
1926
+ | RadioGroup | Compound | — | sm/default/lg | default/primary | Item with label |
1927
+ | Switch | Standalone | — | sm/default/lg | 5 colors | label positions, icons |
1928
+ | Toggle | Standalone | default/outline/ghost/outline-ghost | xs/sm/md/default/lg | — | pressed state |
1929
+ | ToggleGroup | Compound | default/outline | xs/sm/md/default/lg | — | single/multiple |
1930
+ | Segmented | Compound | default/outline/underline/ghost | sm/md/default/lg | — | Tab-like selection |
1931
+ | Slider | Standalone | — | sm/default/lg | default/primary | tooltip, range |
1932
+ | Field | Compound | — | — | — | Label, Error, CharCount |
1933
+ | Avatar | Compound | — | xs/sm/default/lg/xl/2xl | — | colorized fallback, Group |
1934
+ | Badge | Standalone | solid/subtle/outline | sm/default/lg | default/primary/success/warning/error/info | dot, removable |
1935
+ | Card | Compound | default/outline/ghost | sm/default/lg | — | Image overlay, interactive |
1936
+ | Table | Compound | default/bordered/striped | sm/default/lg | — | stickyHeader, sortable |
1937
+ | Tabs | Compound | line/enclosed/pill | sm/md/default/lg | default/primary | fitted |
1938
+ | Accordion | Compound | default/bordered/splitted | sm/default/lg | — | single/multiple |
1939
+ | Divider | Standalone | solid/dashed/dotted | — | default/muted/strong | label |
1940
+ | Modal | Compound | — | xs/sm/md/lg/xl/full | — | scrollBehavior |
1941
+ | Drawer | Compound | — | sm/md/lg/xl/full | — | 4 sides |
1942
+ | Tooltip | Compound | default/inverted | sm/default | — | Provider required |
1943
+ | Popover | Compound | default/elevated | sm/default/lg | — | arrow, close button |
1944
+ | Alert | Compound | default/outline/filled | sm/default/lg | info/success/warning/error | closable |
1945
+ | Toast | Imperative | — | sm/default/lg | 6 types | promise, action |
1946
+ | Progress | Standalone | default/striped | sm/default/lg | default/primary | linear/circular |
1947
+ | Spinner | Standalone | ring/dots/bars/orbit | sm/default/lg | default/primary/current | 5 orbit styles |
1948
+ | Skeleton | Standalone | text/circular/rectangular | — | — | pulse/wave, count |
1949
+ | Breadcrumb | Compound | — | sm/default/lg | — | maxItems collapse |
1950
+ | Pagination | Compound | default/outline/ghost | xs/sm/default/lg/xl | default/primary | compound or auto |
1951
+ | NavigationMenu | Compound | — | sm/md/default/lg | — | horizontal/vertical, collapsed |
1952
+ | Chart | Compound | — | — | chart colors | Bar/Line/Area/Pie |
1953
+ | MetricCard | Compound | default/elevated/ghost | sm/default/lg | — | animated value, trend |
1954
+ | TypingIndicator | Standalone | dots/cursor | sm/default/lg | default/primary/muted | speed (dots only), animate-typing-cursor, showLabel |
1955
+ | QuickReply | Compound | outline/filled/ghost | sm/default/lg | default/primary | layout (scroll/wrap), radius (md/lg/full), gap, icon, asChild |
1956
+ | ChatInput | Compound | outline/filled | sm/default/lg | default/primary | layout (default/inline), radius (sm/md/lg/xl/2xl/full), buttonRadius, auto-resize, showCount, loading, onStop |
1957
+ | ChatMessage | Compound | bubble/flat | sm/default/lg | default/muted/primary/dark | role (assistant/user), tail, avatarSize, radius (md/lg/xl/2xl), typing, actions, Avatar/Content/Footer sub-components |
1958
+ ---
1959
+
1960
+ ### TypingIndicator
1961
+
1962
+ ```tsx
1963
+ import { TypingIndicator } from '@7onic-ui/react'
1964
+
1965
+ {/* Default — dots, muted, default size */}
1966
+ <TypingIndicator />
1967
+
1968
+ {/* Cursor variant */}
1969
+ <TypingIndicator variant="cursor" />
1970
+
1971
+ {/* Chat bubble */}
1972
+ <TypingIndicator variant="dots" color="muted" />
1973
+
1974
+ {/* AI response — fast with label */}
1975
+ <TypingIndicator
1976
+ variant="dots"
1977
+ color="primary"
1978
+ speed="fast"
1979
+ showLabel
1980
+ label="AI is typing..."
1981
+ />
1982
+
1983
+ {/* Large cursor, primary color */}
1984
+ <TypingIndicator variant="cursor" size="lg" color="primary" />
1985
+ ```
1986
+
1987
+ | Prop | Type | Default | Description |
1988
+ |---|---|---|---|
1989
+ | variant | `'dots' \| 'cursor'` | `'dots'` | Animation style |
1990
+ | size | `'sm' \| 'default' \| 'lg'` | `'default'` | Size |
1991
+ | color | `'default' \| 'primary' \| 'muted'` | `'muted'` | Color |
1992
+ | speed | `'slow' \| 'default' \| 'fast'` | `'default'` | Speed (dots only) |
1993
+ | label | `string` | `'Typing'` | aria-label and showLabel text |
1994
+ | showLabel | `boolean` | `false` | Show text label alongside indicator |
1995
+
1996
+ ---
1997
+
1998
+ ### QuickReply
1999
+
2000
+ ```tsx
2001
+ import { QuickReply } from '@7onic-ui/react'
2002
+
2003
+ {/* Basic suggested replies */}
2004
+ <QuickReply aria-label="Suggested replies">
2005
+ <QuickReply.Item>About payment</QuickReply.Item>
2006
+ <QuickReply.Item>Shipping info</QuickReply.Item>
2007
+ <QuickReply.Item>Return policy</QuickReply.Item>
2008
+ </QuickReply>
2009
+
2010
+ {/* Primary color, filled variant */}
2011
+ <QuickReply color="primary" variant="filled" aria-label="Quick replies">
2012
+ <QuickReply.Item>Payment</QuickReply.Item>
2013
+ <QuickReply.Item>Shipping</QuickReply.Item>
2014
+ </QuickReply>
2015
+
2016
+ {/* Wrap layout for FAQ */}
2017
+ <QuickReply layout="wrap" aria-label="FAQ topics">
2018
+ <QuickReply.Item>Payments</QuickReply.Item>
2019
+ <QuickReply.Item>Shipping</QuickReply.Item>
2020
+ <QuickReply.Item>Returns</QuickReply.Item>
2021
+ <QuickReply.Item>Account</QuickReply.Item>
2022
+ </QuickReply>
2023
+
2024
+ {/* With icon */}
2025
+ <QuickReply aria-label="Actions">
2026
+ <QuickReply.Item icon={<MessageCircle />}>Contact us</QuickReply.Item>
2027
+ <QuickReply.Item icon={<Package />}>Track order</QuickReply.Item>
2028
+ </QuickReply>
2029
+ ```
2030
+
2031
+ | Prop (QuickReply) | Type | Default | Description |
2032
+ |---|---|---|---|
2033
+ | layout | `'scroll' \| 'wrap'` | `'scroll'` | Chip layout mode |
2034
+ | variant | `'outline' \| 'filled' \| 'ghost'` | `'outline'` | Visual style |
2035
+ | color | `'default' \| 'primary'` | `'default'` | Color theme |
2036
+ | size | `'sm' \| 'default' \| 'lg'` | `'default'` | Chip size |
2037
+ | radius | `'md' \| 'lg' \| 'full'` | `'full'` | Border radius |
2038
+ | gap | `'sm' \| 'default' \| 'lg'` | `'default'` | Gap between chips |
2039
+
2040
+ | Prop (QuickReply.Item) | Type | Default | Description |
2041
+ |---|---|---|---|
2042
+ | icon | `ReactNode` | — | Leading icon |
2043
+ | asChild | `boolean` | `false` | Compose with custom element (Radix Slot) |
2044
+ | disabled | `boolean` | `false` | Disable the chip |
2045
+ | onClick | `() => void` | — | Click callback |
2046
+
2047
+ ---
2048
+
2049
+ ### ChatInput
2050
+
2051
+ ```tsx
2052
+ import { ChatInput } from '@7onic-ui/react'
2053
+
2054
+ {/* Basic uncontrolled */}
2055
+ <ChatInput onSubmit={(value) => console.log(value)}>
2056
+ <ChatInput.Field placeholder="Ask me anything..." />
2057
+ <ChatInput.Submit />
2058
+ </ChatInput>
2059
+
2060
+ {/* Controlled mode */}
2061
+ const [value, setValue] = useState('')
2062
+ <ChatInput onSubmit={(v) => { handleSend(v); setValue('') }}>
2063
+ <ChatInput.Field
2064
+ value={value}
2065
+ onChange={(e) => setValue(e.target.value)}
2066
+ placeholder="Ask me anything..."
2067
+ />
2068
+ <ChatInput.Submit />
2069
+ </ChatInput>
2070
+
2071
+ {/* With loading state + stop */}
2072
+ <ChatInput onSubmit={handleSubmit}>
2073
+ <ChatInput.Field placeholder="Ask me anything..." />
2074
+ <ChatInput.Submit
2075
+ loading={isLoading}
2076
+ onStop={() => abortController.abort()}
2077
+ />
2078
+ </ChatInput>
2079
+
2080
+ {/* Character count */}
2081
+ <ChatInput onSubmit={(value) => console.log(value)}>
2082
+ <ChatInput.Field placeholder="Ask me anything..." showCount maxLength={500} />
2083
+ <ChatInput.Submit />
2084
+ </ChatInput>
2085
+
2086
+ {/* Filled variant, large, custom radius */}
2087
+ <ChatInput variant="filled" size="lg" radius="2xl" onSubmit={(v) => console.log(v)}>
2088
+ <ChatInput.Field placeholder="Ask me anything..." maxRows={6} />
2089
+ <ChatInput.Submit />
2090
+ </ChatInput>
2091
+
2092
+ {/* Inline layout (single-line field + button side by side) */}
2093
+ <ChatInput layout="inline" radius="full" onSubmit={(value) => console.log(value)}>
2094
+ <ChatInput.Field placeholder="Message..." />
2095
+ <ChatInput.Submit />
2096
+ </ChatInput>
2097
+
2098
+ {/* Inline with custom button radius */}
2099
+ <ChatInput layout="inline" radius="xl" onSubmit={handleSubmit}>
2100
+ <ChatInput.Field placeholder="Message..." />
2101
+ <ChatInput.Submit buttonRadius="full" loading={isLoading} onStop={handleStop} />
2102
+ </ChatInput>
2103
+ ```
2104
+
2105
+ | Prop (ChatInput) | Type | Default | Description |
2106
+ |---|---|---|---|
2107
+ | variant | `'outline' \| 'filled'` | `'outline'` | Visual style |
2108
+ | size | `'sm' \| 'default' \| 'lg'` | `'default'` | Size scale |
2109
+ | radius | `'sm' \| 'md' \| 'lg' \| 'xl' \| '2xl' \| 'full'` | `'xl'` | Corner radius (`'full'` available in inline layout) |
2110
+ | color | `'default' \| 'primary'` | `'default'` | Submit button color |
2111
+ | layout | `'default' \| 'inline'` | `'default'` | `'inline'` renders field and button side by side |
2112
+ | disabled | `boolean` | `false` | Disable input and submit |
2113
+ | onSubmit | `(value: string) => void` | — | Submit callback |
2114
+
2115
+ | Prop (ChatInput.Field) | Type | Default | Description |
2116
+ |---|---|---|---|
2117
+ | maxRows | `number` | `8` | Max rows before scrolling |
2118
+ | showCount | `boolean` | `false` | Show character counter (default layout only) |
2119
+ | maxLength | `number` | — | Max characters |
2120
+ | placeholder | `string` | — | Placeholder text |
2121
+
2122
+ | Prop (ChatInput.Submit) | Type | Default | Description |
2123
+ |---|---|---|---|
2124
+ | loading | `boolean` | `false` | Switch to stop icon — button stays enabled |
2125
+ | onStop | `() => void` | — | Called on click when loading |
2126
+ | buttonRadius | `'sm' \| 'md' \| 'lg' \| 'xl' \| '2xl' \| 'full'` | — | Override button radius (default: auto from container radius) |
2127
+ | children | `ReactNode` | — | Custom icon (default: send arrow) |
2128
+
2129
+ ### ChatMessage
2130
+
2131
+ ```tsx
2132
+ import { ChatMessage } from '@7onic-ui/react'
2133
+
2134
+ {/* Assistant message */}
2135
+ <ChatMessage role="assistant">
2136
+ <ChatMessage.Avatar />
2137
+ <div className="flex flex-col gap-1">
2138
+ <ChatMessage.Content>How can I help you today?</ChatMessage.Content>
2139
+ <ChatMessage.Footer timestamp="12:34" />
2140
+ </div>
2141
+ </ChatMessage>
2142
+
2143
+ {/* User message with status */}
2144
+ <ChatMessage role="user">
2145
+ <div className="flex flex-col gap-1 items-end">
2146
+ <ChatMessage.Content>Thank you for your help!</ChatMessage.Content>
2147
+ <ChatMessage.Footer timestamp="12:34" status="read" />
2148
+ </div>
2149
+ </ChatMessage>
2150
+
2151
+ {/* Typing animation */}
2152
+ <ChatMessage role="assistant" typing>
2153
+ <ChatMessage.Avatar />
2154
+ <ChatMessage.Content />
2155
+ </ChatMessage>
2156
+
2157
+ {/* Custom avatar + hover actions */}
2158
+ <ChatMessage
2159
+ role="assistant"
2160
+ actions={<button aria-label="Copy">...</button>}
2161
+ >
2162
+ <ChatMessage.Avatar initials="AI" />
2163
+ <div className="flex flex-col gap-1">
2164
+ <ChatMessage.Content>Response text here.</ChatMessage.Content>
2165
+ <ChatMessage.Footer timestamp="12:34" />
2166
+ </div>
2167
+ </ChatMessage>
2168
+
2169
+ {/* User bubble with muted color (common pattern) */}
2170
+ <ChatMessage role="user" color="muted">
2171
+ <div className="flex flex-col gap-1 items-end">
2172
+ <ChatMessage.Content>Message text</ChatMessage.Content>
2173
+ <ChatMessage.Footer timestamp="12:34" status="read" />
2174
+ </div>
2175
+ </ChatMessage>
2176
+
2177
+ {/* History (flat) layout — full-width, no footer */}
2178
+ <div className="flex flex-col gap-3">
2179
+ <ChatMessage role="assistant" variant="flat">
2180
+ <ChatMessage.Avatar />
2181
+ <ChatMessage.Content className="w-full">Here is the answer.</ChatMessage.Content>
2182
+ </ChatMessage>
2183
+ <ChatMessage role="user" variant="flat" color="muted">
2184
+ <ChatMessage.Content className="w-full">Thanks!</ChatMessage.Content>
2185
+ </ChatMessage>
2186
+ </div>
2187
+ ```
2188
+
2189
+ | Prop (ChatMessage) | Type | Default | Description |
2190
+ |---|---|---|---|
2191
+ | role | `'assistant' \| 'user'` | `'assistant'` | Aligns left (assistant) or right (user) |
2192
+ | variant | `'bubble' \| 'flat'` | `'bubble'` | Bubble style with background/border, or flat with no fill |
2193
+ | color | `'default' \| 'muted' \| 'primary' \| 'dark'` | `'default'` | Bubble background color |
2194
+ | size | `'sm' \| 'default' \| 'lg'` | `'default'` | Size scale affecting padding and font |
2195
+ | radius | `'md' \| 'lg' \| 'xl' \| '2xl'` | `'2xl'` | Bubble corner radius |
2196
+ | tail | `boolean` | `true` | Asymmetric tail corner (sharp on avatar side) — bubble only |
2197
+ | avatarSize | `'sm' \| 'md' \| 'lg'` | — | Avatar size — also adjusts gap between avatar and bubble |
2198
+ | typing | `boolean` | `false` | Show animated typing dots inside Content |
2199
+ | actions | `ReactNode` | — | Hover-reveal action buttons (copy, react, etc.) |
2200
+
2201
+ | Prop (ChatMessage.Avatar) | Type | Default | Description |
2202
+ |---|---|---|---|
2203
+ | size | `'sm' \| 'md' \| 'lg'` | `'md'` | Avatar size: 24/28/32px |
2204
+ | src | `string` | — | Avatar image URL |
2205
+ | alt | `string` | `'Avatar'` | Alt text |
2206
+ | initials | `string` | — | 1–2 character initials (fallback) |
2207
+ | icon | `ReactNode` | — | Custom icon (fallback) |
2208
+
2209
+ | Prop (ChatMessage.Footer) | Type | Default | Description |
2210
+ |---|---|---|---|
2211
+ | timestamp | `string` | — | Pre-formatted time string |
2212
+ | status | `'sending' \| 'sent' \| 'read' \| 'error' \| ReactNode` | — | Delivery status (built-in presets or custom node) |
2213
+ | size | `'sm' \| 'default' \| 'lg'` | — | Size override (defaults to context value from root) |
465
2214
 
466
2215
  ---
467
2216
 
@@ -471,4 +2220,4 @@ Before presenting code to the user, scan your own output for violations:
471
2220
  - npm (tokens): https://npmjs.com/package/@7onic-ui/tokens
472
2221
  - npm (react): https://npmjs.com/package/@7onic-ui/react
473
2222
  - GitHub: https://github.com/itonys/7onic
474
- - Full AI guide (tokens + components): https://7onic.design/llms-full.txt
2223
+ - Tokens-only AI guide: https://7onic.design/llms.txt