@7onic-ui/react 0.2.7 → 0.2.9

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
@@ -388,14 +388,15 @@ 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
- ## Namespace Pattern (Compound Components)
391
+ ## Compound Component Import Patterns
392
392
 
393
- 21 compound components use namespace imports. Access sub-components via dot notation:
393
+ 24 compound components support **two equivalent import patterns** — choose based on your rendering context:
394
+
395
+ ### Pattern A: Namespace (dot notation) — Client Components
394
396
 
395
397
  ```tsx
396
398
  import { Card } from '@7onic-ui/react'
397
399
 
398
- // ✅ Namespace usage (preferred)
399
400
  <Card>
400
401
  <Card.Header>
401
402
  <Card.Title>Title</Card.Title>
@@ -404,15 +405,61 @@ import { Card } from '@7onic-ui/react'
404
405
  <Card.Content>Content</Card.Content>
405
406
  <Card.Footer>Footer</Card.Footer>
406
407
  </Card>
408
+ ```
409
+
410
+ Better name grouping and readability. Works in files with `'use client'` directive.
411
+
412
+ ### Pattern B: Named imports — works everywhere (including Server Components)
413
+
414
+ ```tsx
415
+ import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from '@7onic-ui/react'
416
+
417
+ <Card>
418
+ <CardHeader>
419
+ <CardTitle>Title</CardTitle>
420
+ <CardDescription>Description</CardDescription>
421
+ </CardHeader>
422
+ <CardContent>Content</CardContent>
423
+ <CardFooter>Footer</CardFooter>
424
+ </Card>
425
+ ```
407
426
 
408
- // ✅ Named exports also work (backwards compatible)
409
- import { Card, CardHeader, CardTitle, CardContent } from '@7onic-ui/react'
427
+ ### ⚠️ Next.js Server Components — use Pattern B
428
+
429
+ **Namespace pattern (`<Card.Header />`) does NOT work inside Server Components** due to a Next.js Client Manifest limitation (sub-component references cannot be tracked through `Object.assign`).
430
+
431
+ ```tsx
432
+ // ❌ Server Component (default in App Router) — throws "Unsupported Server Component type: undefined"
433
+ export default function Page() {
434
+ return (
435
+ <Card>
436
+ <Card.Header>...</Card.Header>
437
+ </Card>
438
+ )
439
+ }
440
+
441
+ // ✅ Server Component — use named imports
442
+ import { Card, CardHeader } from '@7onic-ui/react'
443
+
444
+ export default function Page() {
445
+ return (
446
+ <Card>
447
+ <CardHeader>...</CardHeader>
448
+ </Card>
449
+ )
450
+ }
410
451
  ```
411
452
 
453
+ **Rule of thumb:**
454
+ - File has `'use client'` at top → either pattern works, namespace preferred
455
+ - File has no directive (Server Component default in Next.js App Router) → named imports only
456
+
412
457
  ### Compound Components List (24)
413
458
 
414
459
  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
460
 
461
+ Each compound component's sub-components can be imported as named exports. Example: `Card.Header` ↔ `CardHeader`, `Modal.Content` ↔ `ModalContent`, `Tabs.List` ↔ `TabsList`, etc. The code examples below use the namespace pattern; convert dots to camelCase for named imports when needed for Server Components.
462
+
416
463
  ### Standalone Components (16)
417
464
 
418
465
  Badge, Button, ButtonGroup, Checkbox, Divider, IconButton, Input, Progress, Skeleton, Slider, Spinner, Switch, Textarea, Toast, Toggle, TypingIndicator
@@ -500,7 +547,7 @@ import { Button, ButtonGroup } from '@7onic-ui/react'
500
547
  | radius | Button radius values | — | Applied to all children |
501
548
  | fontWeight | `'normal' \| 'semibold'` | — | Applied to all children |
502
549
  | orientation | `'horizontal' \| 'vertical'` | `'horizontal'` | Layout direction |
503
- | attached | `boolean` | `false` | Overlapping borders |
550
+ | attached | `boolean` | `true` | Overlapping borders |
504
551
  | disabled | `boolean` | `false` | Disable all children |
505
552
 
506
553
  Provides context — child Buttons inherit variant/size/radius automatically.
@@ -547,6 +594,7 @@ import { Textarea } from '@7onic-ui/react'
547
594
  | resize | `'none' \| 'vertical' \| 'horizontal' \| 'both'` | `'vertical'` | Resize handle |
548
595
  | error | `boolean` | `false` | Error state |
549
596
  | focusRing | `boolean` | `false` | Explicit focus ring |
597
+ | rows | `number` | `4` | Initial row count |
550
598
 
551
599
  ---
552
600
 
@@ -602,7 +650,7 @@ import { DropdownMenu } from '@7onic-ui/react'
602
650
 
603
651
  | Prop (Content) | Type | Default | Description |
604
652
  |---|---|---|---|
605
- | radius | `'md' \| 'lg' \| 'xl'` | `'lg'` | Border radius |
653
+ | radius | `'md' \| 'lg' \| 'xl'` | `'md'` | Border radius |
606
654
  | size | `'sm' \| 'md' \| 'lg'` | `'md'` | Item density |
607
655
  | flush | `boolean` | `false` | Full-width items (no padding) |
608
656
  | sideOffset | `number` | `4` | Gap from trigger |
@@ -781,7 +829,7 @@ import { Slider } from '@7onic-ui/react'
781
829
  |---|---|---|---|
782
830
  | size | `'sm' \| 'default' \| 'lg'` | `'default'` | Track/thumb size |
783
831
  | color | `'default' \| 'primary'` | `'default'` | Active track color |
784
- | showTooltip | `'auto' \| 'always' \| 'never'` | `'auto'` | Tooltip display |
832
+ | showTooltip | `'auto' \| 'always' \| 'never'` | `'never'` | Tooltip display |
785
833
  | formatLabel | `(value: number) => string` | — | Tooltip value formatter |
786
834
  | startContent | `ReactNode` | — | Left content (label/icon) |
787
835
  | endContent | `ReactNode` | — | Right content (label/icon) |
@@ -853,7 +901,7 @@ import { Avatar } from '@7onic-ui/react'
853
901
  | Prop (Fallback) | Type | Default | Description |
854
902
  |---|---|---|---|
855
903
  | name | `string` | — | Auto-generates initials |
856
- | colorized | `boolean` | `false` | Deterministic color from name hash |
904
+ | colorized | `string` | — | Pass a name/key string to enable deterministic colored fallback |
857
905
  | colorVariant | `'vivid' \| 'soft'` | `'vivid'` | Color intensity |
858
906
 
859
907
  | Prop (Group) | Type | Default | Description |
@@ -964,6 +1012,10 @@ import { Table } from '@7onic-ui/react'
964
1012
  | interactive | `boolean` | `false` | Hover highlight |
965
1013
  | selected | `boolean` | `false` | Selected state |
966
1014
 
1015
+ | Prop (Cell) | Type | Default | Description |
1016
+ |---|---|---|---|
1017
+ | align | `'left' \| 'center' \| 'right'` | `'left'` | Text alignment |
1018
+
967
1019
  **Sub-components:** Table.Header, Table.Body, Table.Footer, Table.Row, Table.Head, Table.Cell, Table.Caption
968
1020
 
969
1021
  ---
@@ -991,7 +1043,7 @@ import { Tabs } from '@7onic-ui/react'
991
1043
  | size | `'sm' \| 'md' \| 'default' \| 'lg'` | `'default'` | Tab size |
992
1044
  | fitted | `boolean` | `false` | Full width tabs |
993
1045
  | color | `'default' \| 'primary'` | `'default'` | Active tab color |
994
- | radius | `'none' \| 'sm' \| 'md' \| 'default' \| 'lg' \| 'full'` | `'default'` | Border radius (enclosed/pill) |
1046
+ | radius | `'none' \| 'sm' \| 'base' \| 'md' \| 'lg' \| 'xl' \| '2xl' \| '3xl' \| 'full'` | `'md'` | Border radius (enclosed/pill) |
995
1047
 
996
1048
  **Sub-components:** Tabs.List, Tabs.Trigger, Tabs.Content
997
1049
 
@@ -1016,11 +1068,11 @@ import { Accordion } from '@7onic-ui/react'
1016
1068
 
1017
1069
  | Prop (Root) | Type | Default | Description |
1018
1070
  |---|---|---|---|
1019
- | type | `'single' \| 'multiple'` | required | Expansion mode |
1071
+ | type | `'single' \| 'multiple'` | `'single'` | Expansion mode |
1020
1072
  | variant | `'default' \| 'bordered' \| 'splitted'` | `'default'` | Visual style |
1021
1073
  | size | `'sm' \| 'default' \| 'lg'` | `'default'` | Padding scale |
1022
1074
  | iconPosition | `'left' \| 'right'` | `'right'` | Chevron placement |
1023
- | collapsible | `boolean` | `false` | Allow all closed (single only) |
1075
+ | collapsible | `boolean` | `true` | Allow all closed (single only) |
1024
1076
 
1025
1077
  **Sub-components:** Accordion.Item, Accordion.Trigger (with `icon` prop), Accordion.Content
1026
1078
 
@@ -1078,8 +1130,8 @@ import { Modal, Button } from '@7onic-ui/react'
1078
1130
 
1079
1131
  | Prop (Content) | Type | Default | Description |
1080
1132
  |---|---|---|---|
1081
- | size | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'` | `'md'` | Modal width |
1082
- | scrollBehavior | `'inside' \| 'outside'` | `'inside'` | Scroll target |
1133
+ | size | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'` | `'sm'` | Modal width |
1134
+ | scrollBehavior | `'inside' \| 'outside'` | `'outside'` | Scroll target |
1083
1135
  | showCloseButton | `boolean` | `true` | Show X button |
1084
1136
 
1085
1137
  **Sub-components:** Modal.Trigger, Modal.Portal, Modal.Overlay, Modal.Content, Modal.Header, Modal.Title, Modal.Description, Modal.Body, Modal.Footer, Modal.Close
@@ -1088,6 +1140,42 @@ import { Modal, Button } from '@7onic-ui/react'
1088
1140
 
1089
1141
  ---
1090
1142
 
1143
+ ### AlertModal
1144
+
1145
+ ```tsx
1146
+ import { AlertModal, Button } from '@7onic-ui/react'
1147
+
1148
+ <AlertModal>
1149
+ <AlertModal.Trigger asChild>
1150
+ <Button color="destructive">Delete</Button>
1151
+ </AlertModal.Trigger>
1152
+ <AlertModal.Portal>
1153
+ <AlertModal.Overlay />
1154
+ <AlertModal.Content size="sm">
1155
+ <AlertModal.Header>
1156
+ <AlertModal.Title>Delete item?</AlertModal.Title>
1157
+ <AlertModal.Description>This action cannot be undone.</AlertModal.Description>
1158
+ </AlertModal.Header>
1159
+ <AlertModal.Body>Further confirmation details</AlertModal.Body>
1160
+ <AlertModal.Footer>
1161
+ <AlertModal.Cancel asChild><Button variant="outline">Cancel</Button></AlertModal.Cancel>
1162
+ <AlertModal.Action asChild><Button color="destructive">Delete</Button></AlertModal.Action>
1163
+ </AlertModal.Footer>
1164
+ </AlertModal.Content>
1165
+ </AlertModal.Portal>
1166
+ </AlertModal>
1167
+ ```
1168
+
1169
+ | Prop (Content) | Type | Default | Description |
1170
+ |---|---|---|---|
1171
+ | size | `'xs' \| 'sm'` | `'sm'` | AlertModal width (smaller than Modal by design) |
1172
+
1173
+ **Sub-components:** AlertModal.Trigger, AlertModal.Portal, AlertModal.Overlay, AlertModal.Content, AlertModal.Header, AlertModal.Title, AlertModal.Description, AlertModal.Body, AlertModal.Footer, AlertModal.Action, AlertModal.Cancel
1174
+
1175
+ **Required structure:** Portal → Overlay + Content (same as Modal). Use for destructive confirmations — renders as `role="alertdialog"` via Radix AlertDialog primitive. No close button by default (force user to Action or Cancel).
1176
+
1177
+ ---
1178
+
1091
1179
  ### Drawer
1092
1180
 
1093
1181
  ```tsx
@@ -1151,8 +1239,8 @@ import { Tooltip } from '@7onic-ui/react'
1151
1239
  | variant | `'default' \| 'inverted'` | `'default'` | Dark/light bg |
1152
1240
  | size | `'sm' \| 'default'` | `'default'` | Padding scale |
1153
1241
  | side | `'top' \| 'right' \| 'bottom' \| 'left'` | `'top'` | Placement |
1154
- | showArrow | `boolean` | `false` | Show arrow |
1155
- | sideOffset | `number` | `4` | Gap from trigger |
1242
+ | showArrow | `boolean` | `true` | Show arrow |
1243
+ | sideOffset | `number` | `6` | Gap from trigger |
1156
1244
 
1157
1245
  **⚠️ Tooltip.Provider is required** — wrap your app or section with it.
1158
1246
  **Sub-components:** Tooltip.Provider, Tooltip.Trigger, Tooltip.Content, Tooltip.Arrow, Tooltip.Portal
@@ -1182,7 +1270,7 @@ import { Popover, Button } from '@7onic-ui/react'
1182
1270
  | variant | `'default' \| 'elevated'` | `'default'` | Shadow style |
1183
1271
  | size | `'sm' \| 'default' \| 'lg'` | `'default'` | Padding scale |
1184
1272
  | side | `'top' \| 'right' \| 'bottom' \| 'left'` | `'bottom'` | Placement |
1185
- | showArrow | `boolean` | `false` | Show arrow |
1273
+ | showArrow | `boolean` | `true` | Show arrow |
1186
1274
  | showClose | `boolean` | `false` | Show X button |
1187
1275
 
1188
1276
  **Sub-components:** Popover.Trigger, Popover.Content, Popover.Arrow, Popover.Close, Popover.Anchor, Popover.Portal
@@ -1263,9 +1351,9 @@ toast.dismiss() // Dismiss all
1263
1351
  | size | `'sm' \| 'default' \| 'lg'` | `'default'` | Toast size |
1264
1352
  | duration | `number` | `4000` | Auto-dismiss ms (0 = persistent) |
1265
1353
  | closeButton | `boolean` | `false` | Show close button |
1266
- | richColors | `boolean` | `false` | Filled color backgrounds |
1354
+ | richColors | `boolean` | `true` | Filled color backgrounds |
1267
1355
  | expand | `boolean` | `false` | Show all toasts expanded |
1268
- | visibleToasts | `number` | `3` | Max visible at once |
1356
+ | visibleToasts | `number` | `5` | Max visible at once |
1269
1357
 
1270
1358
  **⚠️ No Portal needed.** Just place `<Toaster />` in your root layout. Call `toast()` from anywhere.
1271
1359
 
@@ -1371,7 +1459,7 @@ import { Breadcrumb } from '@7onic-ui/react'
1371
1459
 
1372
1460
  | Prop (Root) | Type | Default | Description |
1373
1461
  |---|---|---|---|
1374
- | separator | `ReactNode` | `'/'` | Custom separator |
1462
+ | separator | `ReactNode` | `<ChevronRightIcon />` | Custom separator (default: chevron right icon) |
1375
1463
  | size | `'sm' \| 'default' \| 'lg'` | `'default'` | Text size |
1376
1464
  | maxItems | `number` | — | Collapse threshold |
1377
1465
  | itemsBeforeCollapse | `number` | `1` | Items before ellipsis |
@@ -1403,7 +1491,7 @@ import { Pagination } from '@7onic-ui/react'
1403
1491
 
1404
1492
  | Prop (Root) | Type | Default | Description |
1405
1493
  |---|---|---|---|
1406
- | total | `number` | required | Total pages |
1494
+ | total | `number` | `1` | Total pages |
1407
1495
  | value | `number` | — | Controlled page |
1408
1496
  | defaultValue | `number` | `1` | Uncontrolled default |
1409
1497
  | onChange | `(page: number) => void` | — | Change handler |
@@ -1461,8 +1549,10 @@ import { NavigationMenu } from '@7onic-ui/react'
1461
1549
  | orientation | `'horizontal' \| 'vertical'` | `'horizontal'` | Layout mode |
1462
1550
  | size | `'sm' \| 'md' \| 'default' \| 'lg'` | `'default'` | Item size |
1463
1551
  | collapsed | `boolean` | `false` | Icon-only mode (vertical) |
1464
- | radius | Same as Button | `'default'` | Border radius |
1552
+ | radius | Same as Button | `'lg'` | Border radius |
1465
1553
  | fontWeight | `'normal' \| 'semibold'` | `'normal'` | Font weight |
1554
+ | delayDuration | `number` | `200` | Hover delay before content opens (horizontal only, ms) |
1555
+ | skipDelayDuration | `number` | `300` | Reset delay when moving between triggers (horizontal only, ms) |
1466
1556
 
1467
1557
  | Prop (Link) | Type | Default | Description |
1468
1558
  |---|---|---|---|
@@ -1470,6 +1560,15 @@ import { NavigationMenu } from '@7onic-ui/react'
1470
1560
  | icon | `ReactNode` | — | Leading icon |
1471
1561
  | asChild | `boolean` | `false` | Slot pattern |
1472
1562
 
1563
+ | Prop (Item) | Type | Default | Description |
1564
+ |---|---|---|---|
1565
+ | value | `string` | — | Identifier for controlled state (horizontal menus) |
1566
+ | defaultOpen | `boolean` | `false` | Initial open state for vertical collapsible item |
1567
+
1568
+ | Prop (Indicator) | Type | Default | Description |
1569
+ |---|---|---|---|
1570
+ | color | `'default' \| 'primary'` | `'default'` | Indicator color (horizontal variant only) |
1571
+
1473
1572
  **Sub-components:** NavigationMenu.List, NavigationMenu.Item, NavigationMenu.Trigger, NavigationMenu.Content, NavigationMenu.Link, NavigationMenu.Group (vertical only, with `label`), NavigationMenu.Indicator (horizontal only), NavigationMenu.Viewport
1474
1573
 
1475
1574
  ---
@@ -1555,6 +1654,11 @@ const chartConfig = {
1555
1654
  | label | `'none' \| 'outside' \| 'inside'` | `'none'` | Label display |
1556
1655
  | labelContent | `'value' \| 'percent'` | `'value'` | Label format |
1557
1656
  | activeShape | `boolean` | `true` | Expand on hover |
1657
+ | paddingAngle | `number` | `0` | Gap between slices (degrees) |
1658
+ | cornerRadius | `number` | `0` | Slice corner radius (px) |
1659
+ | startAngle | `number` | `90` | Start angle (degrees, 12 o'clock = 90) |
1660
+ | endAngle | `number` | `-270` | End angle (degrees, full circle = 90→-270) |
1661
+ | innerRadius | `number` | — | Override donut inner radius (default auto by variant) |
1558
1662
 
1559
1663
  **Chart Colors (CSS variables):**
1560
1664
  `--color-chart-1` (blue), `--color-chart-2` (pink), `--color-chart-3` (lavender), `--color-chart-4` (sky), `--color-chart-5` (rose)
@@ -1595,7 +1699,7 @@ import { MetricCard } from '@7onic-ui/react'
1595
1699
  |---|---|---|---|
1596
1700
  | variant | `'default' \| 'elevated' \| 'ghost'` | `'default'` | Visual style |
1597
1701
  | size | `'sm' \| 'default' \| 'lg'` | `'default'` | Padding scale |
1598
- | radius | Same as Card + `'none'` | `'xl'` | Border radius |
1702
+ | radius | `'none' \| 'sm' \| 'base' \| 'default' \| 'lg' \| 'xl' \| '2xl' \| '3xl' \| 'full'` | `'default'` | Border radius |
1599
1703
 
1600
1704
  | Prop (Value) | Type | Default | Description |
1601
1705
  |---|---|---|---|
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@7onic-ui/react",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "private": false,
5
5
  "sideEffects": [
6
6
  "*.css"
7
7
  ],
8
- "description": "React component library with automated design token pipeline — from Figma to code",
8
+ "description": "React component library where design and code never drift — automated Figma token pipeline",
9
9
  "main": "./dist/index.js",
10
10
  "module": "./dist/index.mjs",
11
11
  "types": "./dist/index.d.ts",
@@ -77,7 +77,7 @@
77
77
  "@radix-ui/react-tooltip": "^1.1.0",
78
78
  "class-variance-authority": "^0.7.0",
79
79
  "clsx": "^2.1.0",
80
- "next-intl": "^4.9.0",
80
+ "next-intl": "^4.9.1",
81
81
  "tailwind-merge": "^2.3.0"
82
82
  },
83
83
  "peerDependencies": {
@@ -107,12 +107,13 @@
107
107
  "eslint-plugin-react": "^7.34.0",
108
108
  "eslint-plugin-react-hooks": "^4.6.0",
109
109
  "lucide-react": "^0.400.0",
110
- "next": "^15.0.0",
110
+ "next": "^15.5.15",
111
111
  "picocolors": "^1.1.1",
112
112
  "postcss": "^8.4.38",
113
113
  "prettier": "^3.3.0",
114
114
  "react": "^19.0.0",
115
115
  "react-dom": "^19.0.0",
116
+ "react-is": "^18.3.1",
116
117
  "recharts": "^3.7.0",
117
118
  "tailwindcss": "^3.4.4",
118
119
  "tailwindcss-animate": "^1.0.7",