@7onic-ui/react 0.3.4 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -13
- package/llms.txt +150 -123
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
| **🧩** | **shadcn freedom + MUI convenience** | shadcn's customization with none of its missing features. MUI's built-in power with none of its styling constraints. Both, by design. |
|
|
29
29
|
| **⚡** | **npm or CLI — your choice** | `npm install` for packages, `npx 7onic add` for local copy. Same components, two workflows. |
|
|
30
30
|
| **🔀** | **Only Tailwind v3+v4 dual support** | The ecosystem's only design system supporting both Tailwind versions. Same tokens, same DX. |
|
|
31
|
-
| **🪄** | **Framework-aware setup** | Next.js
|
|
31
|
+
| **🪄** | **Framework-aware setup** | Detects Next.js / Vite, TypeScript, and Tailwind — exits with a clear error if anything's missing. Auto-cleans Vite boilerplate (`.bak` backup), auto-wraps `*` reset in `@layer base` for Next.js + Tailwind v4. No Provider wrapper, no `globals.css` replacement. |
|
|
32
32
|
| **🎮** | **Built-in playground** | Interactive props editor + live code generation in docs. No Storybook setup needed. |
|
|
33
33
|
| **🌗** | **Dark mode, zero config** | Light/dark themes built into tokens. System preference detection out of the box. |
|
|
34
34
|
| **🔓** | **Framework-agnostic tokens** | Tokens ship as pure CSS variables. Use with Vue, Angular, Svelte, or vanilla CSS — no React required. |
|
|
@@ -47,19 +47,24 @@
|
|
|
47
47
|
npm install @7onic-ui/react @7onic-ui/tokens
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
npx 7onic init
|
|
54
|
-
npx 7onic add button card input
|
|
55
|
-
```
|
|
50
|
+
Then add tokens to your CSS:
|
|
56
51
|
|
|
57
52
|
<details>
|
|
58
53
|
<summary><strong>Tailwind v4</strong></summary>
|
|
59
54
|
|
|
60
55
|
```css
|
|
56
|
+
/* app/globals.css — Next.js */
|
|
57
|
+
@import "tailwindcss";
|
|
58
|
+
@import '@7onic-ui/tokens/tailwind/v4.css';
|
|
59
|
+
|
|
60
|
+
@source "../node_modules/@7onic-ui/react/dist";
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
```css
|
|
64
|
+
/* src/index.css — Vite */
|
|
61
65
|
@import "tailwindcss";
|
|
62
66
|
@import '@7onic-ui/tokens/tailwind/v4.css';
|
|
67
|
+
|
|
63
68
|
@source "../node_modules/@7onic-ui/react/dist";
|
|
64
69
|
```
|
|
65
70
|
</details>
|
|
@@ -69,16 +74,41 @@ npx 7onic add button card input
|
|
|
69
74
|
|
|
70
75
|
```css
|
|
71
76
|
@import '@7onic-ui/tokens/css/all.css';
|
|
77
|
+
|
|
72
78
|
@tailwind base;
|
|
73
79
|
@tailwind components;
|
|
74
80
|
@tailwind utilities;
|
|
75
81
|
```
|
|
76
82
|
|
|
77
83
|
```js
|
|
78
|
-
// tailwind.config.js
|
|
84
|
+
// tailwind.config.js — Next.js
|
|
85
|
+
/** @type {import('tailwindcss').Config} */
|
|
79
86
|
module.exports = {
|
|
80
|
-
presets: [
|
|
81
|
-
|
|
87
|
+
presets: [
|
|
88
|
+
require('@7onic-ui/tokens/tailwind/v3-preset'),
|
|
89
|
+
],
|
|
90
|
+
content: [
|
|
91
|
+
'./node_modules/@7onic-ui/react/dist/**/*.{js,mjs}',
|
|
92
|
+
'./app/**/*.{js,ts,jsx,tsx,mdx}',
|
|
93
|
+
'./pages/**/*.{js,ts,jsx,tsx,mdx}',
|
|
94
|
+
'./components/**/*.{js,ts,jsx,tsx,mdx}',
|
|
95
|
+
'./src/**/*.{js,ts,jsx,tsx,mdx}',
|
|
96
|
+
],
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
```js
|
|
101
|
+
// tailwind.config.js — Vite
|
|
102
|
+
/** @type {import('tailwindcss').Config} */
|
|
103
|
+
export default {
|
|
104
|
+
presets: [
|
|
105
|
+
require('@7onic-ui/tokens/tailwind/v3-preset'),
|
|
106
|
+
],
|
|
107
|
+
content: [
|
|
108
|
+
'./node_modules/@7onic-ui/react/dist/**/*.{js,mjs}',
|
|
109
|
+
'./index.html',
|
|
110
|
+
'./src/**/*.{js,ts,jsx,tsx}',
|
|
111
|
+
],
|
|
82
112
|
}
|
|
83
113
|
```
|
|
84
114
|
</details>
|
|
@@ -97,6 +127,13 @@ module.exports = {
|
|
|
97
127
|
```
|
|
98
128
|
</details>
|
|
99
129
|
|
|
130
|
+
**Option B — CLI (local file copy)**
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
npx 7onic init # detects framework, installs deps, configures CSS automatically
|
|
134
|
+
npx 7onic add button card input
|
|
135
|
+
```
|
|
136
|
+
|
|
100
137
|
Use components:
|
|
101
138
|
|
|
102
139
|
```tsx
|
|
@@ -259,10 +296,10 @@ Works with Claude Code, Cursor, GitHub Copilot, ChatGPT, and any AI tool that re
|
|
|
259
296
|
- [x] Automated doc verification (8 checks, AST-powered, blocks publish on error)
|
|
260
297
|
- [x] Automated component verification (7 checks — hardcoded colors, tokens, dark mode, dead code)
|
|
261
298
|
- [x] Multilingual documentation — English, Japanese, Korean (powered by next-intl)
|
|
262
|
-
- [x] npm package distribution — `@7onic-ui/react` + `@7onic-ui/tokens` v0.3.
|
|
299
|
+
- [x] npm package distribution — `@7onic-ui/react` + `@7onic-ui/tokens` v0.3.6
|
|
263
300
|
- [x] AI integration — `llms.txt` standard, setup guides for Claude Code / Cursor / Copilot / ChatGPT
|
|
264
301
|
- [x] `npx 7onic add` CLI (shadcn-style) — source copy with dependency resolution
|
|
265
|
-
- [x] `npx 7onic init`
|
|
302
|
+
- [x] `npx 7onic init` full workflow — framework/TS/Tailwind detection (abort if missing), Vite `@/` alias auto-configure, base deps install, CSS token import, Vite boilerplate cleanup (`.bak` backup), Next.js+v4 `*` reset auto-wrap, `cn()` + `7onic.json` generation
|
|
266
303
|
- [x] Technical blog — [blog.7onic.design](https://blog.7onic.design) ("Design to Code" series)
|
|
267
304
|
- [x] Enterprise-grade supply chain security — cryptographically signed releases (npm provenance), automated vulnerability scanning on every build, reproducible installs. Protection against npm package hijacking attacks (like the 2026 axios incident)
|
|
268
305
|
- [ ] Theme Customizer — live palette preview + CSS variable export
|
|
@@ -288,5 +325,5 @@ MIT
|
|
|
288
325
|
<p align="center">
|
|
289
326
|
<strong>One JSON, every format — from Figma to production.</strong><br>
|
|
290
327
|
Independently built.<br>
|
|
291
|
-
<sub>Last updated: 2026-04-
|
|
328
|
+
<sub>Last updated: 2026-04-29 (v0.3.6)</sub>
|
|
292
329
|
</p>
|
package/llms.txt
CHANGED
|
@@ -27,92 +27,29 @@ Before writing any code, present this checklist and wait for answers:
|
|
|
27
27
|
|
|
28
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.
|
|
29
29
|
|
|
30
|
-
### Step 2:
|
|
30
|
+
### Step 2: Install / Setup
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
⚠️ **DO NOT GUESS** — install procedures evolve with each Tailwind / Next / Vite version. Before writing any code, AI **MUST** fetch the live pages below and follow their instructions verbatim:
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
npm install @7onic-ui/react @7onic-ui/tokens lucide-react
|
|
37
|
-
```
|
|
38
|
-
> Check package.json first. If packages are already listed in dependencies, skip this step.
|
|
39
|
-
|
|
40
|
-
**2-2. Create or update globals.css with token imports:**
|
|
41
|
-
|
|
42
|
-
**How to detect Tailwind version:**
|
|
43
|
-
- `tailwind.config.js` (or `.ts`) exists → **v3**
|
|
44
|
-
- No config file → **v4** (uses CSS-based configuration)
|
|
45
|
-
|
|
46
|
-
**New project (Tailwind v4):**
|
|
47
|
-
```css
|
|
48
|
-
/* globals.css (Next.js) or src/index.css (Vite) — ALL imports are required, do not skip any */
|
|
49
|
-
@import "tailwindcss";
|
|
50
|
-
@import "@7onic-ui/tokens/css/variables.css";
|
|
51
|
-
@import "@7onic-ui/tokens/css/themes/light.css";
|
|
52
|
-
@import "@7onic-ui/tokens/css/themes/dark.css"; /* omit ONLY if dark mode = no */
|
|
53
|
-
@import "@7onic-ui/tokens/tailwind/v4-theme.css";
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
**Existing project with Tailwind v3** (detect from tailwind.config.js):
|
|
57
|
-
```css
|
|
58
|
-
/* globals.css */
|
|
59
|
-
@import '@7onic-ui/tokens/css/variables.css';
|
|
60
|
-
@import '@7onic-ui/tokens/css/themes/light.css';
|
|
61
|
-
@import '@7onic-ui/tokens/css/themes/dark.css'; /* omit ONLY if dark mode = no */
|
|
62
|
-
@tailwind base;
|
|
63
|
-
@tailwind components;
|
|
64
|
-
@tailwind utilities;
|
|
65
|
-
```
|
|
66
|
-
```js
|
|
67
|
-
// tailwind.config.js — add preset
|
|
68
|
-
const preset = require('@7onic-ui/tokens/tailwind/v3-preset')
|
|
69
|
-
module.exports = {
|
|
70
|
-
presets: [preset],
|
|
71
|
-
content: [
|
|
72
|
-
'./src/**/*.{js,ts,jsx,tsx}',
|
|
73
|
-
'./node_modules/@7onic-ui/react/dist/**/*.{js,mjs}',
|
|
74
|
-
],
|
|
75
|
-
}
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
**2-3. Vite users only — clean up `src/index.css`:**
|
|
34
|
+
- **Official install page (SSOT)**: https://7onic.design/components/installation
|
|
35
|
+
- **Tailwind CSS official**: https://tailwindcss.com/docs/installation
|
|
79
36
|
|
|
80
|
-
|
|
37
|
+
The install instructions are intentionally **not duplicated in this file**. Setup details (packages, `tailwind.config.js`, `vite.config.ts`, `postcss.config.mjs`, `globals.css` patterns, framework default cleanup, layer wrap tips, etc.) are version-sensitive and change frequently — always defer to the live documentation above.
|
|
81
38
|
|
|
82
|
-
|
|
83
|
-
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
- `button { background-color: #1a1a1a; ... }` block and all other element-level rules (`a { color: #646cff }`, etc.)
|
|
87
|
-
- `@media (prefers-color-scheme: light) { ... }` block
|
|
39
|
+
Apply user's answers from Step 1 after the install page steps are complete:
|
|
40
|
+
- Dark mode = yes → implement dark mode toggle (see below in this file)
|
|
41
|
+
- Custom font → load via `next/font/google` (Next.js) or Fontsource / CDN (Vite)
|
|
42
|
+
- Japanese / Korean locale → load Noto Sans JP / KR
|
|
88
43
|
|
|
89
|
-
|
|
44
|
+
⛔ **Do NOT proceed to Step 3 until install page setup is verified.**
|
|
90
45
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
- Dark mode = yes → implement dark mode toggle (see below)
|
|
94
|
-
- Custom font → load font:
|
|
95
|
-
- **Next.js**: use `next/font/google`
|
|
96
|
-
- **Vite / Remix**: use Fontsource (`npm install @fontsource/inter`, then `import '@fontsource/inter/400.css'` in `src/main.tsx`) or Google Fonts CDN
|
|
97
|
-
- Then set `--font-family-sans` in CSS
|
|
98
|
-
- Locale includes Japanese → load Noto Sans JP font
|
|
99
|
-
- Fontsource: `npm install @fontsource/noto-sans-jp` → import in `src/main.tsx` (Vite) or `app/layout.tsx` (Next.js)
|
|
100
|
-
- CDN: Google Fonts link tag in `index.html`
|
|
101
|
-
- Locale includes Korean → load Noto Sans KR font
|
|
102
|
-
- Fontsource: `npm install @fontsource/noto-sans-kr` → import in `src/main.tsx` (Vite) or `app/layout.tsx` (Next.js)
|
|
103
|
-
- CDN: Google Fonts link tag in `index.html`
|
|
104
|
-
|
|
105
|
-
**2-5. Verify setup is complete before writing any UI code:**
|
|
106
|
-
- [ ] Packages installed (@7onic-ui/react, @7onic-ui/tokens, lucide-react)
|
|
107
|
-
- [ ] globals.css / src/index.css has ALL required imports in correct order
|
|
108
|
-
- [ ] (Vite only) Vite template CSS blocks deleted from src/index.css
|
|
109
|
-
- [ ] Dark mode toggle (if selected)
|
|
110
|
-
- [ ] Font loaded (if custom)
|
|
111
|
-
- [ ] CJK fonts loaded (if applicable)
|
|
46
|
+
### Icon Import Pattern (lucide-react)
|
|
112
47
|
|
|
113
|
-
|
|
48
|
+
⚠️ **`lucide-react` is NOT a 7onic dependency.** 7onic components themselves use inline SVG. Install separately if you want to use lucide icons in your app code:
|
|
114
49
|
|
|
115
|
-
|
|
50
|
+
```bash
|
|
51
|
+
npm install lucide-react
|
|
52
|
+
```
|
|
116
53
|
|
|
117
54
|
```tsx
|
|
118
55
|
// ✅ Official pattern — no suffix
|
|
@@ -131,7 +68,9 @@ import { Badge as BadgeIcon } from 'lucide-react'
|
|
|
131
68
|
Place `<Toaster />` once in your root layout file. Without this, `toast()` calls will not render.
|
|
132
69
|
|
|
133
70
|
```tsx
|
|
134
|
-
import { Toaster } from '@7onic-ui/react'
|
|
71
|
+
import { Toaster } from '@7onic-ui/react'
|
|
72
|
+
|
|
73
|
+
// In your root layout (e.g., app/layout.tsx)
|
|
135
74
|
<body>
|
|
136
75
|
{children}
|
|
137
76
|
<Toaster position="bottom-right" />
|
|
@@ -248,7 +187,9 @@ style={{ color: '#333', padding: '20px' }}
|
|
|
248
187
|
w-4 h-4, w-5 h-5 → icon-sm, icon-md
|
|
249
188
|
|
|
250
189
|
// ❌ Radix direct import
|
|
251
|
-
import * as Dialog from '@radix-ui/react-dialog' → import { Badge, Button, Card, Input, Table } from '@7onic-ui/react'
|
|
190
|
+
import * as Dialog from '@radix-ui/react-dialog' → import { Badge, Button, Card, Input, Table } from '@7onic-ui/react'
|
|
191
|
+
|
|
192
|
+
// ❌ Unnecessary component wrappers
|
|
252
193
|
function MyButton(props) { return <Button {...props} /> } → Use Button directly
|
|
253
194
|
```
|
|
254
195
|
|
|
@@ -402,7 +343,9 @@ import { Button, Card, Input, toast } from '@7onic-ui/react'
|
|
|
402
343
|
All components use Named imports. Works in every environment (Next.js App Router RSC, Client Components, Pages Router, Vite, CRA, CJS).
|
|
403
344
|
|
|
404
345
|
```tsx
|
|
405
|
-
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@7onic-ui/react'
|
|
346
|
+
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@7onic-ui/react'
|
|
347
|
+
|
|
348
|
+
<Card>
|
|
406
349
|
<CardHeader>
|
|
407
350
|
<CardTitle>Title</CardTitle>
|
|
408
351
|
<CardDescription>Description</CardDescription>
|
|
@@ -435,7 +378,9 @@ Badge, Button, ButtonGroup, Checkbox, Divider, IconButton, Input, Progress, Skel
|
|
|
435
378
|
### Button
|
|
436
379
|
|
|
437
380
|
```tsx
|
|
438
|
-
import { Button } from '@7onic-ui/react'
|
|
381
|
+
import { Button } from '@7onic-ui/react'
|
|
382
|
+
|
|
383
|
+
<Button variant="solid" color="primary" size="default">Submit</Button>
|
|
439
384
|
<Button variant="outline" color="default" leftIcon={<Icon />}>Cancel</Button>
|
|
440
385
|
<Button loading>Processing...</Button>
|
|
441
386
|
<Button variant="link" color="primary">Learn more</Button>
|
|
@@ -464,7 +409,9 @@ import { Button } from '@7onic-ui/react'<Button variant="solid" color="primary"
|
|
|
464
409
|
### IconButton
|
|
465
410
|
|
|
466
411
|
```tsx
|
|
467
|
-
import { IconButton } from '@7onic-ui/react'
|
|
412
|
+
import { IconButton } from '@7onic-ui/react'
|
|
413
|
+
|
|
414
|
+
<IconButton variant="ghost" size="default" aria-label="Settings">
|
|
468
415
|
<SettingsIcon />
|
|
469
416
|
</IconButton>
|
|
470
417
|
```
|
|
@@ -487,7 +434,9 @@ import { IconButton } from '@7onic-ui/react'<IconButton variant="ghost" size="de
|
|
|
487
434
|
### ButtonGroup
|
|
488
435
|
|
|
489
436
|
```tsx
|
|
490
|
-
import { Button, ButtonGroup } from '@7onic-ui/react'
|
|
437
|
+
import { Button, ButtonGroup } from '@7onic-ui/react'
|
|
438
|
+
|
|
439
|
+
<ButtonGroup variant="outline" size="default" attached>
|
|
491
440
|
<Button>Left</Button>
|
|
492
441
|
<Button>Center</Button>
|
|
493
442
|
<Button>Right</Button>
|
|
@@ -511,7 +460,9 @@ Provides context — child Buttons inherit variant/size/radius automatically.
|
|
|
511
460
|
### Input
|
|
512
461
|
|
|
513
462
|
```tsx
|
|
514
|
-
import { Input } from '@7onic-ui/react'
|
|
463
|
+
import { Input } from '@7onic-ui/react'
|
|
464
|
+
|
|
465
|
+
<Input placeholder="Email" size="default" />
|
|
515
466
|
<Input variant="filled" leftIcon={<SearchIcon />} />
|
|
516
467
|
<Input error rightIcon={<AlertIcon />} />
|
|
517
468
|
```
|
|
@@ -533,7 +484,9 @@ import { Input } from '@7onic-ui/react'<Input placeholder="Email" size="default"
|
|
|
533
484
|
### Textarea
|
|
534
485
|
|
|
535
486
|
```tsx
|
|
536
|
-
import { Textarea } from '@7onic-ui/react'
|
|
487
|
+
import { Textarea } from '@7onic-ui/react'
|
|
488
|
+
|
|
489
|
+
<Textarea placeholder="Message" rows={4} resize="vertical" />
|
|
537
490
|
```
|
|
538
491
|
|
|
539
492
|
| Prop | Type | Default | Description |
|
|
@@ -551,7 +504,9 @@ import { Textarea } from '@7onic-ui/react'<Textarea placeholder="Message" rows={
|
|
|
551
504
|
### Select
|
|
552
505
|
|
|
553
506
|
```tsx
|
|
554
|
-
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectTrigger, SelectValue } from '@7onic-ui/react'
|
|
507
|
+
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectTrigger, SelectValue } from '@7onic-ui/react'
|
|
508
|
+
|
|
509
|
+
<Select>
|
|
555
510
|
<SelectTrigger>
|
|
556
511
|
<SelectValue placeholder="Choose option" />
|
|
557
512
|
</SelectTrigger>
|
|
@@ -581,7 +536,9 @@ import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectTrig
|
|
|
581
536
|
### DropdownMenu
|
|
582
537
|
|
|
583
538
|
```tsx
|
|
584
|
-
import { Button, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from '@7onic-ui/react'
|
|
539
|
+
import { Button, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from '@7onic-ui/react'
|
|
540
|
+
|
|
541
|
+
<DropdownMenu>
|
|
585
542
|
<DropdownMenuTrigger asChild>
|
|
586
543
|
<Button variant="outline">Options</Button>
|
|
587
544
|
</DropdownMenuTrigger>
|
|
@@ -608,7 +565,9 @@ import { Button, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMe
|
|
|
608
565
|
### Checkbox
|
|
609
566
|
|
|
610
567
|
```tsx
|
|
611
|
-
import { Checkbox } from '@7onic-ui/react'
|
|
568
|
+
import { Checkbox } from '@7onic-ui/react'
|
|
569
|
+
|
|
570
|
+
<Checkbox label="Accept terms" />
|
|
612
571
|
<Checkbox size="lg" color="primary" checked />
|
|
613
572
|
<Checkbox checked="indeterminate" />
|
|
614
573
|
```
|
|
@@ -630,7 +589,9 @@ import { Checkbox } from '@7onic-ui/react'<Checkbox label="Accept terms" />
|
|
|
630
589
|
### RadioGroup
|
|
631
590
|
|
|
632
591
|
```tsx
|
|
633
|
-
import { RadioGroup, RadioGroupItem } from '@7onic-ui/react'
|
|
592
|
+
import { RadioGroup, RadioGroupItem } from '@7onic-ui/react'
|
|
593
|
+
|
|
594
|
+
<RadioGroup defaultValue="a">
|
|
634
595
|
<RadioGroupItem value="a" label="Option A" />
|
|
635
596
|
<RadioGroupItem value="b" label="Option B" />
|
|
636
597
|
<RadioGroupItem value="c" label="Option C" disabled />
|
|
@@ -654,7 +615,9 @@ import { RadioGroup, RadioGroupItem } from '@7onic-ui/react'<RadioGroup defaultV
|
|
|
654
615
|
### Switch
|
|
655
616
|
|
|
656
617
|
```tsx
|
|
657
|
-
import { Switch } from '@7onic-ui/react'
|
|
618
|
+
import { Switch } from '@7onic-ui/react'
|
|
619
|
+
|
|
620
|
+
<Switch label="Notifications" />
|
|
658
621
|
<Switch size="lg" color="primary" defaultChecked />
|
|
659
622
|
<Switch startLabel="Off" endLabel="On" />
|
|
660
623
|
```
|
|
@@ -679,7 +642,9 @@ import { Switch } from '@7onic-ui/react'<Switch label="Notifications" />
|
|
|
679
642
|
### Toggle
|
|
680
643
|
|
|
681
644
|
```tsx
|
|
682
|
-
import { Toggle } from '@7onic-ui/react'
|
|
645
|
+
import { Toggle } from '@7onic-ui/react'
|
|
646
|
+
|
|
647
|
+
<Toggle variant="default" aria-label="Bold">
|
|
683
648
|
<BoldIcon />
|
|
684
649
|
</Toggle>
|
|
685
650
|
<Toggle variant="outline" pressed>Active</Toggle>
|
|
@@ -702,7 +667,9 @@ import { Toggle } from '@7onic-ui/react'<Toggle variant="default" aria-label="Bo
|
|
|
702
667
|
### ToggleGroup
|
|
703
668
|
|
|
704
669
|
```tsx
|
|
705
|
-
import { ToggleGroup, ToggleGroupItem } from '@7onic-ui/react'
|
|
670
|
+
import { ToggleGroup, ToggleGroupItem } from '@7onic-ui/react'
|
|
671
|
+
|
|
672
|
+
<ToggleGroup type="single" defaultValue="center">
|
|
706
673
|
<ToggleGroupItem value="left"><AlignLeftIcon /></ToggleGroupItem>
|
|
707
674
|
<ToggleGroupItem value="center"><AlignCenterIcon /></ToggleGroupItem>
|
|
708
675
|
<ToggleGroupItem value="right"><AlignRightIcon /></ToggleGroupItem>
|
|
@@ -728,7 +695,9 @@ import { ToggleGroup, ToggleGroupItem } from '@7onic-ui/react'<ToggleGroup type=
|
|
|
728
695
|
### Segmented
|
|
729
696
|
|
|
730
697
|
```tsx
|
|
731
|
-
import { Segmented, SegmentedItem } from '@7onic-ui/react'
|
|
698
|
+
import { Segmented, SegmentedItem } from '@7onic-ui/react'
|
|
699
|
+
|
|
700
|
+
<Segmented defaultValue="all">
|
|
732
701
|
<SegmentedItem value="all">All</SegmentedItem>
|
|
733
702
|
<SegmentedItem value="active">Active</SegmentedItem>
|
|
734
703
|
<SegmentedItem value="inactive">Inactive</SegmentedItem>
|
|
@@ -753,7 +722,9 @@ import { Segmented, SegmentedItem } from '@7onic-ui/react'<Segmented defaultValu
|
|
|
753
722
|
### Slider
|
|
754
723
|
|
|
755
724
|
```tsx
|
|
756
|
-
import { Slider } from '@7onic-ui/react'
|
|
725
|
+
import { Slider } from '@7onic-ui/react'
|
|
726
|
+
|
|
727
|
+
<Slider defaultValue={[50]} showTooltip="auto" />
|
|
757
728
|
<Slider defaultValue={[20, 80]} color="primary" />
|
|
758
729
|
```
|
|
759
730
|
|
|
@@ -778,7 +749,9 @@ import { Slider } from '@7onic-ui/react'<Slider defaultValue={[50]} showTooltip=
|
|
|
778
749
|
### Field (Form Wrapper)
|
|
779
750
|
|
|
780
751
|
```tsx
|
|
781
|
-
import { Field, FieldCharCount, FieldError, FieldLabel, Input, Textarea } from '@7onic-ui/react'
|
|
752
|
+
import { Field, FieldCharCount, FieldError, FieldLabel, Input, Textarea } from '@7onic-ui/react'
|
|
753
|
+
|
|
754
|
+
<Field error="Invalid email">
|
|
782
755
|
<FieldLabel required>Email</FieldLabel>
|
|
783
756
|
<Input placeholder="you@example.com" />
|
|
784
757
|
<FieldError />
|
|
@@ -807,7 +780,9 @@ import { Field, FieldCharCount, FieldError, FieldLabel, Input, Textarea } from '
|
|
|
807
780
|
### Avatar
|
|
808
781
|
|
|
809
782
|
```tsx
|
|
810
|
-
import { Avatar, AvatarFallback, AvatarGroup, AvatarImage } from '@7onic-ui/react'
|
|
783
|
+
import { Avatar, AvatarFallback, AvatarGroup, AvatarImage } from '@7onic-ui/react'
|
|
784
|
+
|
|
785
|
+
<Avatar size="default">
|
|
811
786
|
<AvatarImage src="/photo.jpg" alt="User" />
|
|
812
787
|
<AvatarFallback name="John Doe" colorized />
|
|
813
788
|
</Avatar>
|
|
@@ -845,7 +820,9 @@ import { Avatar, AvatarFallback, AvatarGroup, AvatarImage } from '@7onic-ui/reac
|
|
|
845
820
|
### Badge
|
|
846
821
|
|
|
847
822
|
```tsx
|
|
848
|
-
import { Badge } from '@7onic-ui/react'
|
|
823
|
+
import { Badge } from '@7onic-ui/react'
|
|
824
|
+
|
|
825
|
+
<Badge variant="solid" color="primary">New</Badge>
|
|
849
826
|
<Badge variant="subtle" color="success" dot>Active</Badge>
|
|
850
827
|
<Badge variant="outline" removable onRemove={() => {}}>Tag</Badge>
|
|
851
828
|
```
|
|
@@ -867,7 +844,9 @@ import { Badge } from '@7onic-ui/react'<Badge variant="solid" color="primary">Ne
|
|
|
867
844
|
### Card
|
|
868
845
|
|
|
869
846
|
```tsx
|
|
870
|
-
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardImage, CardTitle, IconButton } from '@7onic-ui/react'
|
|
847
|
+
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardImage, CardTitle, IconButton } from '@7onic-ui/react'
|
|
848
|
+
|
|
849
|
+
<Card variant="default" interactive>
|
|
871
850
|
<CardImage src="/cover.jpg" overlay overlayOpacity={40} />
|
|
872
851
|
<CardHeader>
|
|
873
852
|
<CardTitle icon={<StarIcon />}>Featured</CardTitle>
|
|
@@ -900,7 +879,9 @@ import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader,
|
|
|
900
879
|
### Table
|
|
901
880
|
|
|
902
881
|
```tsx
|
|
903
|
-
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@7onic-ui/react'
|
|
882
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@7onic-ui/react'
|
|
883
|
+
|
|
884
|
+
<Table variant="default" stickyHeader>
|
|
904
885
|
<TableHeader>
|
|
905
886
|
<TableRow>
|
|
906
887
|
<TableHead sortable sortDirection="asc" onSort={() => {}}>Name</TableHead>
|
|
@@ -947,7 +928,9 @@ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@
|
|
|
947
928
|
### Tabs
|
|
948
929
|
|
|
949
930
|
```tsx
|
|
950
|
-
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@7onic-ui/react'
|
|
931
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@7onic-ui/react'
|
|
932
|
+
|
|
933
|
+
<Tabs defaultValue="tab1">
|
|
951
934
|
<TabsList variant="line" size="default">
|
|
952
935
|
<TabsTrigger value="tab1">Tab 1</TabsTrigger>
|
|
953
936
|
<TabsTrigger value="tab2">Tab 2</TabsTrigger>
|
|
@@ -972,7 +955,9 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from '@7onic-ui/react'<Tabs
|
|
|
972
955
|
### Accordion
|
|
973
956
|
|
|
974
957
|
```tsx
|
|
975
|
-
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@7onic-ui/react'
|
|
958
|
+
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@7onic-ui/react'
|
|
959
|
+
|
|
960
|
+
<Accordion type="single" collapsible defaultValue="item-1">
|
|
976
961
|
<AccordionItem value="item-1">
|
|
977
962
|
<AccordionTrigger>Section 1</AccordionTrigger>
|
|
978
963
|
<AccordionContent>Content 1</AccordionContent>
|
|
@@ -999,7 +984,9 @@ import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@7
|
|
|
999
984
|
### Divider
|
|
1000
985
|
|
|
1001
986
|
```tsx
|
|
1002
|
-
import { Divider } from '@7onic-ui/react'
|
|
987
|
+
import { Divider } from '@7onic-ui/react'
|
|
988
|
+
|
|
989
|
+
<Divider />
|
|
1003
990
|
<Divider variant="dashed" color="muted" />
|
|
1004
991
|
<Divider label="OR" labelPosition="center" />
|
|
1005
992
|
<Divider orientation="vertical" />
|
|
@@ -1021,7 +1008,9 @@ import { Divider } from '@7onic-ui/react'<Divider />
|
|
|
1021
1008
|
### Modal
|
|
1022
1009
|
|
|
1023
1010
|
```tsx
|
|
1024
|
-
import { Button, Modal, ModalBody, ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalOverlay, ModalPortal, ModalTitle, ModalTrigger } from '@7onic-ui/react'
|
|
1011
|
+
import { Button, Modal, ModalBody, ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalOverlay, ModalPortal, ModalTitle, ModalTrigger } from '@7onic-ui/react'
|
|
1012
|
+
|
|
1013
|
+
<Modal>
|
|
1025
1014
|
<ModalTrigger asChild>
|
|
1026
1015
|
<Button>Open Modal</Button>
|
|
1027
1016
|
</ModalTrigger>
|
|
@@ -1057,7 +1046,9 @@ import { Button, Modal, ModalBody, ModalClose, ModalContent, ModalDescription, M
|
|
|
1057
1046
|
### AlertModal
|
|
1058
1047
|
|
|
1059
1048
|
```tsx
|
|
1060
|
-
import { AlertModal, AlertModalAction, AlertModalBody, AlertModalCancel, AlertModalContent, AlertModalDescription, AlertModalFooter, AlertModalHeader, AlertModalOverlay, AlertModalPortal, AlertModalTitle, AlertModalTrigger, Button } from '@7onic-ui/react'
|
|
1049
|
+
import { AlertModal, AlertModalAction, AlertModalBody, AlertModalCancel, AlertModalContent, AlertModalDescription, AlertModalFooter, AlertModalHeader, AlertModalOverlay, AlertModalPortal, AlertModalTitle, AlertModalTrigger, Button } from '@7onic-ui/react'
|
|
1050
|
+
|
|
1051
|
+
<AlertModal>
|
|
1061
1052
|
<AlertModalTrigger asChild>
|
|
1062
1053
|
<Button color="destructive">Delete</Button>
|
|
1063
1054
|
</AlertModalTrigger>
|
|
@@ -1091,7 +1082,9 @@ import { AlertModal, AlertModalAction, AlertModalBody, AlertModalCancel, AlertMo
|
|
|
1091
1082
|
### Drawer
|
|
1092
1083
|
|
|
1093
1084
|
```tsx
|
|
1094
|
-
import { Button, Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger } from '@7onic-ui/react'
|
|
1085
|
+
import { Button, Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger } from '@7onic-ui/react'
|
|
1086
|
+
|
|
1087
|
+
<Drawer>
|
|
1095
1088
|
<DrawerTrigger asChild>
|
|
1096
1089
|
<Button>Open Drawer</Button>
|
|
1097
1090
|
</DrawerTrigger>
|
|
@@ -1123,7 +1116,9 @@ import { Button, Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerFooter, D
|
|
|
1123
1116
|
### Tooltip
|
|
1124
1117
|
|
|
1125
1118
|
```tsx
|
|
1126
|
-
import { Button, Tooltip, TooltipArrow, TooltipContent, TooltipPortal, TooltipProvider, TooltipTrigger } from '@7onic-ui/react'
|
|
1119
|
+
import { Button, Tooltip, TooltipArrow, TooltipContent, TooltipPortal, TooltipProvider, TooltipTrigger } from '@7onic-ui/react'
|
|
1120
|
+
|
|
1121
|
+
<TooltipProvider>
|
|
1127
1122
|
<Tooltip>
|
|
1128
1123
|
<TooltipTrigger asChild>
|
|
1129
1124
|
<Button>Hover me</Button>
|
|
@@ -1158,7 +1153,9 @@ import { Button, Tooltip, TooltipArrow, TooltipContent, TooltipPortal, TooltipPr
|
|
|
1158
1153
|
### Popover
|
|
1159
1154
|
|
|
1160
1155
|
```tsx
|
|
1161
|
-
import { Button, Popover, PopoverArrow, PopoverContent, PopoverPortal, PopoverTrigger } from '@7onic-ui/react'
|
|
1156
|
+
import { Button, Popover, PopoverArrow, PopoverContent, PopoverPortal, PopoverTrigger } from '@7onic-ui/react'
|
|
1157
|
+
|
|
1158
|
+
<Popover>
|
|
1162
1159
|
<PopoverTrigger asChild>
|
|
1163
1160
|
<Button variant="outline">Open</Button>
|
|
1164
1161
|
</PopoverTrigger>
|
|
@@ -1188,7 +1185,9 @@ import { Button, Popover, PopoverArrow, PopoverContent, PopoverPortal, PopoverTr
|
|
|
1188
1185
|
### Alert
|
|
1189
1186
|
|
|
1190
1187
|
```tsx
|
|
1191
|
-
import { Alert, AlertDescription, AlertTitle } from '@7onic-ui/react'
|
|
1188
|
+
import { Alert, AlertDescription, AlertTitle } from '@7onic-ui/react'
|
|
1189
|
+
|
|
1190
|
+
<Alert color="success" closable onClose={() => {}}>
|
|
1192
1191
|
<AlertTitle>Success</AlertTitle>
|
|
1193
1192
|
<AlertDescription>Operation completed.</AlertDescription>
|
|
1194
1193
|
</Alert>
|
|
@@ -1216,7 +1215,9 @@ import { Alert, AlertDescription, AlertTitle } from '@7onic-ui/react'<Alert colo
|
|
|
1216
1215
|
### Toast (Imperative API)
|
|
1217
1216
|
|
|
1218
1217
|
```tsx
|
|
1219
|
-
import { Toaster, toast } from '@7onic-ui/react'
|
|
1218
|
+
import { Toaster, toast } from '@7onic-ui/react'
|
|
1219
|
+
|
|
1220
|
+
// 1. Add Toaster provider to your app layout (once)
|
|
1220
1221
|
<Toaster position="bottom-right" />
|
|
1221
1222
|
|
|
1222
1223
|
// 2. Call toast() anywhere
|
|
@@ -1264,7 +1265,9 @@ toast.dismiss() // Dismiss all
|
|
|
1264
1265
|
### Progress
|
|
1265
1266
|
|
|
1266
1267
|
```tsx
|
|
1267
|
-
import { Progress } from '@7onic-ui/react'
|
|
1268
|
+
import { Progress } from '@7onic-ui/react'
|
|
1269
|
+
|
|
1270
|
+
<Progress value={65} showValue />
|
|
1268
1271
|
<Progress type="circular" value={75} color="primary" />
|
|
1269
1272
|
<Progress variant="striped" animated value={50} />
|
|
1270
1273
|
```
|
|
@@ -1286,7 +1289,9 @@ import { Progress } from '@7onic-ui/react'<Progress value={65} showValue />
|
|
|
1286
1289
|
### Spinner
|
|
1287
1290
|
|
|
1288
1291
|
```tsx
|
|
1289
|
-
import { Spinner } from '@7onic-ui/react'
|
|
1292
|
+
import { Spinner } from '@7onic-ui/react'
|
|
1293
|
+
|
|
1294
|
+
<Spinner />
|
|
1290
1295
|
<Spinner variant="dots" size="lg" color="primary" />
|
|
1291
1296
|
<Spinner variant="bars" speed="slow" />
|
|
1292
1297
|
<Spinner variant="orbit" orbitStyle="morph" />
|
|
@@ -1306,7 +1311,9 @@ import { Spinner } from '@7onic-ui/react'<Spinner />
|
|
|
1306
1311
|
### Skeleton
|
|
1307
1312
|
|
|
1308
1313
|
```tsx
|
|
1309
|
-
import { Skeleton } from '@7onic-ui/react'
|
|
1314
|
+
import { Skeleton } from '@7onic-ui/react'
|
|
1315
|
+
|
|
1316
|
+
<Skeleton variant="text" count={3} />
|
|
1310
1317
|
<Skeleton variant="circular" width={48} height={48} />
|
|
1311
1318
|
<Skeleton variant="rectangular" width="100%" height={200} />
|
|
1312
1319
|
|
|
@@ -1334,7 +1341,9 @@ import { Skeleton } from '@7onic-ui/react'<Skeleton variant="text" count={3} />
|
|
|
1334
1341
|
### Breadcrumb
|
|
1335
1342
|
|
|
1336
1343
|
```tsx
|
|
1337
|
-
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from '@7onic-ui/react'
|
|
1344
|
+
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from '@7onic-ui/react'
|
|
1345
|
+
|
|
1346
|
+
<Breadcrumb>
|
|
1338
1347
|
<BreadcrumbList>
|
|
1339
1348
|
<BreadcrumbItem>
|
|
1340
1349
|
<BreadcrumbLink href="/">Home</BreadcrumbLink>
|
|
@@ -1366,7 +1375,9 @@ import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbP
|
|
|
1366
1375
|
### Pagination
|
|
1367
1376
|
|
|
1368
1377
|
```tsx
|
|
1369
|
-
import { Pagination, PaginationContent, PaginationItems, PaginationNext, PaginationPrevious } from '@7onic-ui/react'
|
|
1378
|
+
import { Pagination, PaginationContent, PaginationItems, PaginationNext, PaginationPrevious } from '@7onic-ui/react'
|
|
1379
|
+
|
|
1380
|
+
{/* Quick mode — withControls (default: true), withEdges (default: false) */}
|
|
1370
1381
|
<Pagination total={10} defaultValue={1} />
|
|
1371
1382
|
<Pagination total={10} defaultValue={1} withEdges />
|
|
1372
1383
|
<Pagination total={10} defaultValue={1} withControls={false} />
|
|
@@ -1405,7 +1416,9 @@ import { Pagination, PaginationContent, PaginationItems, PaginationNext, Paginat
|
|
|
1405
1416
|
### NavigationMenu
|
|
1406
1417
|
|
|
1407
1418
|
```tsx
|
|
1408
|
-
import { NavigationMenu, NavigationMenuContent, NavigationMenuGroup, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport } from '@7onic-ui/react'
|
|
1419
|
+
import { NavigationMenu, NavigationMenuContent, NavigationMenuGroup, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport } from '@7onic-ui/react'
|
|
1420
|
+
|
|
1421
|
+
{/* Horizontal (header) */}
|
|
1409
1422
|
<NavigationMenu orientation="horizontal">
|
|
1410
1423
|
<NavigationMenuList>
|
|
1411
1424
|
<NavigationMenuItem>
|
|
@@ -1470,7 +1483,9 @@ import { NavigationMenu, NavigationMenuContent, NavigationMenuGroup, NavigationM
|
|
|
1470
1483
|
All chart types use the Chart namespace:
|
|
1471
1484
|
|
|
1472
1485
|
```tsx
|
|
1473
|
-
import { ChartArea, ChartBar, ChartLegend, ChartLegendContent, ChartLine, ChartPie, ChartTooltip, ChartTooltipContent, ChartXAxis, ChartYAxis } from '@7onic-ui/react/chart'
|
|
1486
|
+
import { ChartArea, ChartBar, ChartLegend, ChartLegendContent, ChartLine, ChartPie, ChartTooltip, ChartTooltipContent, ChartXAxis, ChartYAxis } from '@7onic-ui/react/chart'
|
|
1487
|
+
|
|
1488
|
+
const chartConfig = {
|
|
1474
1489
|
revenue: { label: 'Revenue', color: 'var(--color-chart-1)' },
|
|
1475
1490
|
profit: { label: 'Profit', color: 'var(--color-chart-2)' },
|
|
1476
1491
|
}
|
|
@@ -1570,7 +1585,9 @@ type ChartConfig = {
|
|
|
1570
1585
|
### MetricCard
|
|
1571
1586
|
|
|
1572
1587
|
```tsx
|
|
1573
|
-
import { MetricCard, MetricCardDescription, MetricCardHeader, MetricCardSymbol, MetricCardTitle, MetricCardTrend, MetricCardValue } from '@7onic-ui/react'
|
|
1588
|
+
import { MetricCard, MetricCardDescription, MetricCardHeader, MetricCardSymbol, MetricCardTitle, MetricCardTrend, MetricCardValue } from '@7onic-ui/react'
|
|
1589
|
+
|
|
1590
|
+
<MetricCard>
|
|
1574
1591
|
<MetricCardHeader>
|
|
1575
1592
|
<MetricCardTitle>Revenue</MetricCardTitle>
|
|
1576
1593
|
<MetricCardSymbol><DollarIcon /></MetricCardSymbol>
|
|
@@ -1760,7 +1777,9 @@ Components that support `asChild`: Button, IconButton, Badge, Card, Modal.Trigge
|
|
|
1760
1777
|
**Use Field wrapper** for labeled form elements with validation:
|
|
1761
1778
|
|
|
1762
1779
|
```tsx
|
|
1763
|
-
import { Field, FieldCharCount, FieldError, FieldLabel, Input, Textarea } from '@7onic-ui/react'
|
|
1780
|
+
import { Field, FieldCharCount, FieldError, FieldLabel, Input, Textarea } from '@7onic-ui/react'
|
|
1781
|
+
|
|
1782
|
+
{/* Text input with label + error */}
|
|
1764
1783
|
<Field error={errors.email}>
|
|
1765
1784
|
<FieldLabel required>Email</FieldLabel>
|
|
1766
1785
|
<Input placeholder="you@example.com" />
|
|
@@ -1951,7 +1970,9 @@ But if YOUR code uses React hooks (`useState`, `useEffect`) or event handlers (`
|
|
|
1951
1970
|
### TypingIndicator
|
|
1952
1971
|
|
|
1953
1972
|
```tsx
|
|
1954
|
-
import { TypingIndicator } from '@7onic-ui/react'
|
|
1973
|
+
import { TypingIndicator } from '@7onic-ui/react'
|
|
1974
|
+
|
|
1975
|
+
{/* Default — dots, muted, default size */}
|
|
1955
1976
|
<TypingIndicator />
|
|
1956
1977
|
|
|
1957
1978
|
{/* Cursor variant */}
|
|
@@ -1987,7 +2008,9 @@ import { TypingIndicator } from '@7onic-ui/react'{/* Default — dots, muted, de
|
|
|
1987
2008
|
### QuickReply
|
|
1988
2009
|
|
|
1989
2010
|
```tsx
|
|
1990
|
-
import { QuickReply, QuickReplyItem } from '@7onic-ui/react'
|
|
2011
|
+
import { QuickReply, QuickReplyItem } from '@7onic-ui/react'
|
|
2012
|
+
|
|
2013
|
+
{/* Basic suggested replies */}
|
|
1991
2014
|
<QuickReply aria-label="Suggested replies">
|
|
1992
2015
|
<QuickReplyItem>About payment</QuickReplyItem>
|
|
1993
2016
|
<QuickReplyItem>Shipping info</QuickReplyItem>
|
|
@@ -2036,7 +2059,9 @@ import { QuickReply, QuickReplyItem } from '@7onic-ui/react'{/* Basic suggested
|
|
|
2036
2059
|
### ChatInput
|
|
2037
2060
|
|
|
2038
2061
|
```tsx
|
|
2039
|
-
import { ChatInput, ChatInputField, ChatInputSubmit } from '@7onic-ui/react'
|
|
2062
|
+
import { ChatInput, ChatInputField, ChatInputSubmit } from '@7onic-ui/react'
|
|
2063
|
+
|
|
2064
|
+
{/* Basic uncontrolled */}
|
|
2040
2065
|
<ChatInput onSubmit={(value) => console.log(value)}>
|
|
2041
2066
|
<ChatInputField placeholder="Ask me anything..." />
|
|
2042
2067
|
<ChatInputSubmit />
|
|
@@ -2114,7 +2139,9 @@ const [value, setValue] = useState('')
|
|
|
2114
2139
|
### ChatMessage
|
|
2115
2140
|
|
|
2116
2141
|
```tsx
|
|
2117
|
-
import { ChatMessage, ChatMessageAvatar, ChatMessageContent, ChatMessageFooter } from '@7onic-ui/react'
|
|
2142
|
+
import { ChatMessage, ChatMessageAvatar, ChatMessageContent, ChatMessageFooter } from '@7onic-ui/react'
|
|
2143
|
+
|
|
2144
|
+
{/* Assistant message */}
|
|
2118
2145
|
<ChatMessage role="assistant">
|
|
2119
2146
|
<ChatMessageAvatar />
|
|
2120
2147
|
<div className="flex flex-col gap-1">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@7onic-ui/react",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.css"
|
|
@@ -79,6 +79,7 @@
|
|
|
79
79
|
"@radix-ui/react-tooltip": "^1.1.0",
|
|
80
80
|
"class-variance-authority": "^0.7.0",
|
|
81
81
|
"clsx": "^2.1.0",
|
|
82
|
+
"jsonc-parser": "^3.3.1",
|
|
82
83
|
"next-intl": "^4.9.1",
|
|
83
84
|
"tailwind-merge": "^2.3.0"
|
|
84
85
|
},
|