@7onic-ui/react 0.2.8 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/chart.d.mts +1 -17
- package/dist/chart.d.ts +1 -17
- package/dist/chart.js +1 -14
- package/dist/chart.js.map +1 -1
- package/dist/chart.mjs +1 -14
- package/dist/chart.mjs.map +1 -1
- package/dist/index.d.mts +28 -318
- package/dist/index.d.ts +28 -318
- package/dist/index.js +48 -237
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +49 -230
- package/dist/index.mjs.map +1 -1
- package/llms.txt +43 -14
- package/package.json +2 -1
package/llms.txt
CHANGED
|
@@ -388,31 +388,31 @@ For detailed token reference, see: https://7onic.design/llms.txt
|
|
|
388
388
|
import { Button, Card, Input, Toast } from '@7onic-ui/react'
|
|
389
389
|
```
|
|
390
390
|
|
|
391
|
-
##
|
|
391
|
+
## Component Import
|
|
392
392
|
|
|
393
|
-
|
|
393
|
+
All components use Named imports. Works in every environment (Next.js App Router RSC, Client Components, Pages Router, Vite, CRA, CJS).
|
|
394
394
|
|
|
395
395
|
```tsx
|
|
396
|
-
import { Card } from '@7onic-ui/react'
|
|
396
|
+
import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from '@7onic-ui/react'
|
|
397
397
|
|
|
398
|
-
// ✅ Namespace usage (preferred)
|
|
399
398
|
<Card>
|
|
400
|
-
<
|
|
401
|
-
<
|
|
402
|
-
<
|
|
403
|
-
</
|
|
404
|
-
<
|
|
405
|
-
<
|
|
399
|
+
<CardHeader>
|
|
400
|
+
<CardTitle>Title</CardTitle>
|
|
401
|
+
<CardDescription>Description</CardDescription>
|
|
402
|
+
</CardHeader>
|
|
403
|
+
<CardContent>Content</CardContent>
|
|
404
|
+
<CardFooter>Footer</CardFooter>
|
|
406
405
|
</Card>
|
|
407
|
-
|
|
408
|
-
// ✅ Named exports also work (backwards compatible)
|
|
409
|
-
import { Card, CardHeader, CardTitle, CardContent } from '@7onic-ui/react'
|
|
410
406
|
```
|
|
411
407
|
|
|
412
|
-
### Compound Components
|
|
408
|
+
### Compound Components (24)
|
|
409
|
+
|
|
410
|
+
Components that provide sub-components. Each sub is a Named export (`CardHeader`, `ModalContent`, `TabsList`, etc.).
|
|
413
411
|
|
|
414
412
|
Accordion, Alert, Avatar, Breadcrumb, Card, ChatInput, ChatMessage, Chart, Drawer, DropdownMenu, Field, MetricCard, Modal, NavigationMenu, Pagination, Popover, QuickReply, RadioGroup, Segmented, Select, Table, Tabs, ToggleGroup, Tooltip
|
|
415
413
|
|
|
414
|
+
Prefer dot-notation (`<Card.Header>`)? See **Compound Recipe** section at end of this document.
|
|
415
|
+
|
|
416
416
|
### Standalone Components (16)
|
|
417
417
|
|
|
418
418
|
Badge, Button, ButtonGroup, Checkbox, Divider, IconButton, Input, Progress, Skeleton, Slider, Spinner, Switch, Textarea, Toast, Toggle, TypingIndicator
|
|
@@ -2272,6 +2272,35 @@ import { ChatMessage } from '@7onic-ui/react'
|
|
|
2272
2272
|
|
|
2273
2273
|
---
|
|
2274
2274
|
|
|
2275
|
+
## Compound Recipe (opt-in self-wrapper)
|
|
2276
|
+
|
|
2277
|
+
v0.3.0+ library exports Named only (`<CardHeader>`). To restore dot-notation (`<Card.Header>`) in your project, add a 5-line wrapper file:
|
|
2278
|
+
|
|
2279
|
+
```tsx
|
|
2280
|
+
// lib/card.tsx
|
|
2281
|
+
'use client'
|
|
2282
|
+
import {
|
|
2283
|
+
Card as CardBase,
|
|
2284
|
+
CardHeader, CardTitle, CardDescription,
|
|
2285
|
+
CardContent, CardFooter, CardImage, CardAction,
|
|
2286
|
+
} from '@7onic-ui/react'
|
|
2287
|
+
|
|
2288
|
+
export const Card = Object.assign(CardBase, {
|
|
2289
|
+
Header: CardHeader, Title: CardTitle,
|
|
2290
|
+
Description: CardDescription, Content: CardContent,
|
|
2291
|
+
Footer: CardFooter, Image: CardImage, Action: CardAction,
|
|
2292
|
+
})
|
|
2293
|
+
// Then: <Card.Header>, <Card.Title>, etc. — Client Components only.
|
|
2294
|
+
```
|
|
2295
|
+
|
|
2296
|
+
**Rules**:
|
|
2297
|
+
- Wrapper file must start with `'use client'` — Next.js Client Manifest cannot track `Object.assign` properties across RSC boundaries.
|
|
2298
|
+
- Recipe works only in Client Components. Server Components must use Named imports (`<CardHeader>`).
|
|
2299
|
+
- If you don't need dot-notation, skip this entirely — Named imports (`<CardHeader>`) work everywhere: RSC, Client, Vite, CRA, CJS.
|
|
2300
|
+
- Compound namespaces (component families with sub-components): Accordion, Alert, AlertModal, Avatar, Breadcrumb, Card, Chart, ChatInput, ChatMessage, Drawer, DropdownMenu, Field, MetricCard, Modal, NavigationMenu, Pagination, Popover, QuickReply, RadioGroup, Segmented, Select, Table, Tabs, ToggleGroup, Tooltip.
|
|
2301
|
+
|
|
2302
|
+
---
|
|
2303
|
+
|
|
2275
2304
|
## Links
|
|
2276
2305
|
|
|
2277
2306
|
- Documentation: https://7onic.design
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@7onic-ui/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.css"
|
|
@@ -94,6 +94,7 @@
|
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"@7onic-ui/tokens": "file:./tokens",
|
|
96
96
|
"@clack/prompts": "^1.2.0",
|
|
97
|
+
"@playwright/test": "^1.59.1",
|
|
97
98
|
"@types/node": "^20.14.0",
|
|
98
99
|
"@types/react": "^19.0.0",
|
|
99
100
|
"@types/react-dom": "^19.0.0",
|