velocis 1.0.1 → 1.1.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.
@@ -0,0 +1,154 @@
1
+ # Dropdown1 (`velocis/dropdown1`)
2
+
3
+ Flexible action menus with optional nested sub-menus. Compose items freely — use `SubMenu` only when you need nested options.
4
+
5
+ Use **Dropdown1** for action menus and nested menu lists. Use [`velocis/dialog1`](./dialog1.md) `popover` variant for arbitrary panel content (forms, rich layouts).
6
+
7
+ ## Import
8
+
9
+ ```tsx
10
+ 'use client';
11
+
12
+ import { Dropdown1, useDropdown1 } from 'velocis/dropdown1';
13
+ ```
14
+
15
+ ## When to use
16
+
17
+ | Scenario | Use |
18
+ |----------|-----|
19
+ | Simple action menu | `Dropdown1` + `Dropdown1.Item` |
20
+ | Menu with nested options | Add `Dropdown1.SubMenu` around sub-items |
21
+ | Controlled open state | `useDropdown1()` hook |
22
+ | Rich panel beside trigger | `Dialog1` popover → [dialog1.md](./dialog1.md) |
23
+ | Native form select | `FormSelect` → [forms.md](./forms.md) |
24
+
25
+ ## Quick setup — simple menu
26
+
27
+ ```tsx
28
+ <Dropdown1 trigger={<span>Actions</span>}>
29
+ <Dropdown1.Item onClick={() => console.log('edit')}>Edit</Dropdown1.Item>
30
+ <Dropdown1.Item onClick={() => console.log('delete')}>Delete</Dropdown1.Item>
31
+ </Dropdown1>
32
+ ```
33
+
34
+ ## Quick setup — with sub-menu
35
+
36
+ ```tsx
37
+ <Dropdown1 trigger={<span>Menu</span>}>
38
+ <Dropdown1.Item onClick={() => console.log('item 1')}>Item 1</Dropdown1.Item>
39
+ <Dropdown1.SubMenu trigger="More">
40
+ <Dropdown1.Item onClick={() => console.log('sub 1')}>Sub 1</Dropdown1.Item>
41
+ <Dropdown1.Item onClick={() => console.log('sub 2')}>Sub 2</Dropdown1.Item>
42
+ </Dropdown1.SubMenu>
43
+ </Dropdown1>
44
+ ```
45
+
46
+ No `SubMenu` → plain dropdown. Add `SubMenu` only where needed.
47
+
48
+ ## Controlled state
49
+
50
+ ```tsx
51
+ const { open, setOpen, dropdownProps } = useDropdown1();
52
+
53
+ <button onClick={() => setOpen(true)}>Open externally</button>
54
+ <Dropdown1 {...dropdownProps} trigger={<span>Actions</span>}>
55
+ <Dropdown1.Item onClick={...}>Edit</Dropdown1.Item>
56
+ </Dropdown1>
57
+ ```
58
+
59
+ ## Styling — coordinated colors
60
+
61
+ Every layer uses **bg + text + hover** pairs from `dropdown1Styles` (Velocis tokens by default). Override any layer via the `styles` prop — `subMenuContent` inherits `content` when omitted.
62
+
63
+ ```tsx
64
+ import { Dropdown1, dropdown1Styles } from 'velocis/dropdown1';
65
+
66
+ // defaults — bg/text always matched
67
+ <Dropdown1 trigger={<span>Actions</span>}>...</Dropdown1>
68
+
69
+ // custom theme (dark panel example)
70
+ <Dropdown1
71
+ trigger={<span>Actions</span>}
72
+ styles={{
73
+ trigger: 'bg-slate-900 text-white ring-slate-700 hover:bg-slate-800',
74
+ triggerIcon: 'text-slate-400',
75
+ content: 'bg-slate-900 text-white border-slate-700 shadow-xl ring-1 ring-slate-700/50',
76
+ item: 'text-slate-100 hover:bg-slate-800 hover:text-white',
77
+ subMenuTrigger: 'text-slate-100 hover:bg-slate-800 hover:text-white',
78
+ subMenuIcon: 'text-slate-400',
79
+ }}
80
+ >
81
+ ...
82
+ </Dropdown1>
83
+
84
+ // tweak one layer only — rest stay default
85
+ <Dropdown1 styles={{ content: dropdown1Styles.content, item: 'text-red-600 hover:bg-red-50' }}>
86
+ ...
87
+ </Dropdown1>
88
+ ```
89
+
90
+ | Style key | Default tokens | Applies to |
91
+ |-----------|----------------|------------|
92
+ | `trigger` | `bg-velocis-background text-velocis-foreground …` | Trigger button |
93
+ | `triggerIcon` | `text-velocis-muted` | Trigger chevron |
94
+ | `content` | `bg-velocis-background text-velocis-foreground …` | Main menu panel |
95
+ | `item` | `text-velocis-foreground hover:bg-velocis-border/40` | `Dropdown1.Item` |
96
+ | `subMenuTrigger` | same as `item` | Sub-menu row |
97
+ | `subMenuContent` | inherits `content` | Sub-menu panel |
98
+ | `subMenuIcon` | `text-velocis-muted` | Sub-menu chevron |
99
+
100
+ Export `dropdown1Styles` and `resolveDropdown1Styles` for app-wide presets.
101
+
102
+ ## Props — `Dropdown1`
103
+
104
+ | Prop | Default | Description |
105
+ |------|---------|-------------|
106
+ | `trigger` | required | Trigger label/content |
107
+ | `children` | required | `Dropdown1.Item` and/or `Dropdown1.SubMenu` |
108
+ | `open` / `defaultOpen` / `onOpenChange` | uncontrolled | Controlled open state |
109
+ | `styles` | `dropdown1Styles` | Coordinated bg/text/hover per layer |
110
+ | `triggerClassName` / `contentClassName` | — | Extra CSS classes |
111
+ | `contentWidth` | `w-56` | Tailwind width class for menu panel |
112
+ | `maxHeight` | — | Scrollable content max height |
113
+ | `fullWidth` | `false` | Match trigger width to container |
114
+ | `disabled` | `false` | Disable trigger |
115
+ | `contentZIndex` | `--velocis-z-dropdown` | Raise z-index inside dialogs |
116
+ | `closeOnScroll` | `true` | Close when scrolling outside menu |
117
+ | `testId` / `contentTestId` | — | Test IDs |
118
+
119
+ ## Props — `Dropdown1.Item`
120
+
121
+ | Prop | Default | Description |
122
+ |------|---------|-------------|
123
+ | `onClick` | — | Click handler |
124
+ | `closeOnSelect` | `true` | Close menu after click |
125
+ | `styles` | root `styles.item` | Override item colors |
126
+ | `className` / `testId` | — | Extra CSS / test id |
127
+
128
+ ## Props — `Dropdown1.SubMenu`
129
+
130
+ | Prop | Default | Description |
131
+ |------|---------|-------------|
132
+ | `trigger` | required | Sub-menu label |
133
+ | `children` | required | Nested `Dropdown1.Item` elements |
134
+ | `contentWidth` | `w-48` | Sub-menu panel width |
135
+ | `styles` | root sub-menu styles | Override sub-menu colors |
136
+ | `className` | — | Extra CSS on sub-menu panel |
137
+
138
+ ## RTL / LTR
139
+
140
+ Dropdown1 respects `DirectionProvider` from `velocis/theme`. Sub-menus open toward inline-end (right in LTR, left in RTL) using logical CSS properties.
141
+
142
+ ## Accessibility
143
+
144
+ - Trigger: `type="button"`, `aria-expanded`, `aria-haspopup="menu"`
145
+ - Content: `role="menu"`, items: `role="menuitem"`
146
+ - Escape closes the menu; click outside closes the menu
147
+
148
+ ## vs Dialog1 popover
149
+
150
+ | | Dropdown1 | Dialog1 popover |
151
+ |--|-----------|-----------------|
152
+ | Use case | Action menus | Arbitrary panel content |
153
+ | API | Item + SubMenu | Dialog compound layout |
154
+ | Sub-menu | Built-in hover nested | Manual composition |
@@ -0,0 +1,90 @@
1
+ # Feedback (`velocis/feedback`)
2
+
3
+ Loading, empty, and error states plus overlays and notifications.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import {
9
+ EmptyState,
10
+ LoadingState,
11
+ ErrorFallback,
12
+ SkeletonBase,
13
+ VelocisErrorBoundary,
14
+ Modal,
15
+ Alert,
16
+ ToastProvider,
17
+ useToast,
18
+ Tooltip,
19
+ Spinner,
20
+ Progress,
21
+ Badge,
22
+ Drawer,
23
+ Popover,
24
+ Chip,
25
+ } from 'velocis/feedback';
26
+ ```
27
+
28
+ ## State components
29
+
30
+ | Component | Use when |
31
+ |-----------|----------|
32
+ | `LoadingState` | Data is fetching |
33
+ | `EmptyState` | No results / first-use |
34
+ | `ErrorFallback` | Request or render failed |
35
+ | `SkeletonBase` | Inline content placeholder |
36
+ | `VelocisErrorBoundary` | Catch React render errors |
37
+ | `Spinner` | Small inline spinner |
38
+ | `Progress` | Determinate progress bar |
39
+
40
+ ### Examples
41
+
42
+ ```tsx
43
+ if (status === 'loading') return <LoadingState message="Loading users…" />;
44
+ if (status === 'error') return <ErrorFallback error={error} onRetry={refetch} />;
45
+ if (!data.length) return <EmptyState title="No users" description="Add your first user." />;
46
+ ```
47
+
48
+ ## Overlays
49
+
50
+ | Component | Use when |
51
+ |-----------|----------|
52
+ | `Modal` | Focused dialog / confirmation |
53
+ | `Drawer` | Side panel |
54
+ | `Popover` | Anchored floating content |
55
+ | `Tooltip` | Hover hint on control |
56
+
57
+ ## Notifications
58
+
59
+ Wrap app (or section) with `ToastProvider`, then call `useToast()`:
60
+
61
+ ```tsx
62
+ import { ToastProvider, useToast } from 'velocis/feedback';
63
+
64
+ function App() {
65
+ return (
66
+ <ToastProvider>
67
+ <MyPage />
68
+ </ToastProvider>
69
+ );
70
+ }
71
+
72
+ function MyPage() {
73
+ const toast = useToast();
74
+ return <button onClick={() => toast.success('Saved!')}>Save</button>;
75
+ }
76
+ ```
77
+
78
+ ## Display components
79
+
80
+ | Component | Use when |
81
+ |-----------|----------|
82
+ | `Alert` | Inline banner (info, warning, error) |
83
+ | `Badge` | Status label on element |
84
+ | `Chip` | Removable tag / filter chip |
85
+
86
+ ## When to use
87
+
88
+ - Pair `LoadingState` / `EmptyState` / `ErrorFallback` with async tables and lists.
89
+ - Use `Modal` for forms; `Drawer` for filters or detail panels.
90
+ - Use `ToastProvider` once near the root for global toasts.
package/docs/forms.md ADDED
@@ -0,0 +1,78 @@
1
+ # Forms (`velocis/forms`)
2
+
3
+ Form layout and field components built on `react-hook-form`.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import {
9
+ FormRoot,
10
+ FormField,
11
+ FormSelect,
12
+ FormCheckbox,
13
+ FormTextarea,
14
+ FormSwitch,
15
+ FormDatePicker,
16
+ FormDateRangePicker,
17
+ } from 'velocis/forms';
18
+ ```
19
+
20
+ ## Basic usage
21
+
22
+ ```tsx
23
+ 'use client';
24
+ import { FormRoot, FormField, FormSelect } from 'velocis/forms';
25
+
26
+ <FormRoot
27
+ defaultValues={{ name: '', role: '' }}
28
+ onSubmitData={(data) => console.log(data)}
29
+ >
30
+ <FormField name="name" label="Name" placeholder="Your name" />
31
+ <FormSelect
32
+ name="role"
33
+ label="Role"
34
+ options={[
35
+ { value: 'admin', label: 'Admin' },
36
+ { value: 'user', label: 'User' },
37
+ ]}
38
+ />
39
+ <button type="submit">Submit</button>
40
+ </FormRoot>
41
+ ```
42
+
43
+ ## Components
44
+
45
+ | Component | Purpose |
46
+ |-----------|---------|
47
+ | `FormRoot` | Form wrapper + `react-hook-form` provider |
48
+ | `FormField` | Text input with label and validation message |
49
+ | `FormSelect` | Dropdown select |
50
+ | `FormCheckbox` | Checkbox |
51
+ | `FormTextarea` | Multi-line text |
52
+ | `FormSwitch` | Toggle switch |
53
+ | `FormDatePicker` | Single date picker |
54
+ | `FormDateRangePicker` | Start/end date range |
55
+
56
+ ## FormRoot props
57
+
58
+ | Prop | Type | Description |
59
+ |------|------|-------------|
60
+ | `onSubmitData` | `(data: Record<string, string>) => void` | Called on valid submit |
61
+ | `defaultValues` | `Record<string, string>` | Initial field values |
62
+ | `children` | `ReactNode` | Field components |
63
+ | `className` | `string` | Form element class |
64
+
65
+ ## FormField props
66
+
67
+ | Prop | Type | Default |
68
+ |------|------|---------|
69
+ | `name` | `string` | required |
70
+ | `label` | `string` | required |
71
+ | `type` | `string` | `'text'` |
72
+ | `placeholder` | `string` | — |
73
+
74
+ ## When to use
75
+
76
+ - Use `FormRoot` as the single parent for all Velocis form fields.
77
+ - Field `name` must match keys in `defaultValues` and `onSubmitData`.
78
+ - For hero signup, see `HeroWithForm` in [hero.md](./hero.md).
package/docs/hero.md ADDED
@@ -0,0 +1,84 @@
1
+ # Hero (`velocis/hero`)
2
+
3
+ Landing-page hero section variants.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ // All variants
9
+ import {
10
+ HeroCentered,
11
+ HeroSplitImage,
12
+ HeroVideoBackground,
13
+ HeroGradientAnimated,
14
+ HeroWithForm,
15
+ HeroMinimalText,
16
+ HeroCarousel,
17
+ HeroParallax,
18
+ HeroStatsShowcase,
19
+ HeroAppDownload,
20
+ HeroPricingTeaser,
21
+ Hero3DTilt,
22
+ HeroTestimonial,
23
+ HeroNewsletter,
24
+ HeroComparison,
25
+ HeroBase,
26
+ } from 'velocis/hero';
27
+
28
+ // Tree-shaken single variant
29
+ import { HeroCentered } from 'velocis/hero/centered';
30
+ ```
31
+
32
+ ## Shared props (`HeroVariantProps`)
33
+
34
+ Most heroes accept:
35
+
36
+ | Prop | Type | Required | Description |
37
+ |------|------|----------|-------------|
38
+ | `title` | `string` | yes | Main heading |
39
+ | `subtitle` | `string` | no | Supporting text |
40
+ | `eyebrow` | `string` | no | Small label above title |
41
+ | `actions` | `ReactNode` | no | CTA buttons |
42
+ | `className` | `string` | no | Extra classes |
43
+
44
+ ## Variants
45
+
46
+ | Component | Use when |
47
+ |-----------|----------|
48
+ | `HeroCentered` | Classic centered headline + CTA |
49
+ | `HeroSplitImage` | Text on one side, image on the other |
50
+ | `HeroVideoBackground` | Full-width video behind text |
51
+ | `HeroGradientAnimated` | Animated gradient background |
52
+ | `HeroWithForm` | Hero with embedded signup form |
53
+ | `HeroMinimalText` | Typography-only, minimal layout |
54
+ | `HeroCarousel` | Rotating slides |
55
+ | `HeroParallax` | Parallax scroll effect |
56
+ | `HeroStatsShowcase` | Highlight metrics / numbers |
57
+ | `HeroAppDownload` | App store download CTAs |
58
+ | `HeroPricingTeaser` | Pricing preview |
59
+ | `Hero3DTilt` | 3D tilt interaction on media |
60
+ | `HeroTestimonial` | Customer quote highlight |
61
+ | `HeroNewsletter` | Email capture |
62
+ | `HeroComparison` | Before/after or plan comparison |
63
+
64
+ ## Example
65
+
66
+ ```tsx
67
+ import { HeroCentered } from 'velocis/hero/centered';
68
+
69
+ <HeroCentered
70
+ eyebrow="New"
71
+ title="Build faster with Velocis"
72
+ subtitle="RTL-aware React components"
73
+ actions={<button>Get started</button>}
74
+ />
75
+ ```
76
+
77
+ ## Low-level building blocks
78
+
79
+ `HeroBase`, `HeroContentProps`, `HeroMediaProps`, `HeroTextProps`, `HeroActionsProps` — for custom hero layouts.
80
+
81
+ ## When to use
82
+
83
+ - Top-of-page marketing sections only.
84
+ - Pick one variant per page section; prefer `velocis/hero/centered` import when using a single variant.
package/docs/list.md ADDED
@@ -0,0 +1,73 @@
1
+ # List (`velocis/list`)
2
+
3
+ List view variants for displaying collections.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import {
9
+ ListView,
10
+ SimpleList,
11
+ AvatarList,
12
+ GroupedList,
13
+ VirtualizedInfiniteList,
14
+ ReorderableList,
15
+ GridList,
16
+ TimelineList,
17
+ MasonryList,
18
+ KanbanList,
19
+ } from 'velocis/list';
20
+ ```
21
+
22
+ ## Compound API (`ListView`)
23
+
24
+ `ListView` defaults to `SimpleList`:
25
+
26
+ | Property | Component | Use when |
27
+ |----------|-----------|----------|
28
+ | `ListView` / `ListView.Simple` | `SimpleList` | Basic text list |
29
+ | `ListView.Avatar` | `AvatarList` | List with user avatars |
30
+ | `ListView.Grouped` | `GroupedList` | Sections with headers |
31
+ | `ListView.VirtualizedInfinite` | `VirtualizedInfiniteList` | Infinite scroll, large lists |
32
+ | `ListView.Reorderable` | `ReorderableList` | Drag-to-reorder |
33
+ | `ListView.Grid` | `GridList` | Grid layout of items |
34
+ | `ListView.Timeline` | `TimelineList` | Chronological events |
35
+ | `ListView.Masonry` | `MasonryList` | Pinterest-style masonry |
36
+ | `ListView.Kanban` | `KanbanList` | Kanban board columns |
37
+
38
+ ## Basic example
39
+
40
+ ```tsx
41
+ 'use client';
42
+ import { ListView } from 'velocis/list';
43
+
44
+ const items = [
45
+ { id: '1', title: 'Item one', description: 'Details' },
46
+ { id: '2', title: 'Item two' },
47
+ ];
48
+
49
+ <ListView items={items} />
50
+ ```
51
+
52
+ ## Types
53
+
54
+ | Type | Package |
55
+ |------|---------|
56
+ | `ListItem`, `ListViewProps` | SimpleList |
57
+ | `GridListItem`, `GridListProps` | GridList |
58
+ | `TimelineItem`, `TimelineListProps` | TimelineList |
59
+ | `MasonryListItem`, `MasonryListProps` | MasonryList |
60
+ | `KanbanColumn`, `KanbanListProps` | KanbanList |
61
+
62
+ ## When to use
63
+
64
+ | Scenario | Component |
65
+ |----------|-----------|
66
+ | Settings menu, notifications | `SimpleList` |
67
+ | Team members | `AvatarList` |
68
+ | Grouped contacts | `GroupedList` |
69
+ | Feed with load more | `VirtualizedInfiniteList` |
70
+ | Task priority reorder | `ReorderableList` |
71
+ | Product gallery | `GridList` or `MasonryList` |
72
+ | Activity log | `TimelineList` |
73
+ | Project board | `KanbanList` |
@@ -0,0 +1,102 @@
1
+ # Navigation (`velocis/navigation`)
2
+
3
+ Navigation, layout, and wayfinding components.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import {
9
+ Navigation,
10
+ Breadcrumb,
11
+ Pagination,
12
+ Tabs,
13
+ Accordion,
14
+ Stepper,
15
+ SearchInput,
16
+ FilterChips,
17
+ Navbar,
18
+ Sidebar,
19
+ } from 'velocis/navigation';
20
+ ```
21
+
22
+ ## Namespace object
23
+
24
+ `Navigation` groups all components:
25
+
26
+ ```tsx
27
+ import { Navigation } from 'velocis/navigation';
28
+
29
+ <Navigation.Tabs items={tabs} />
30
+ <Navigation.Navbar items={navItems} />
31
+ ```
32
+
33
+ Equivalent to importing each component directly.
34
+
35
+ ## Components
36
+
37
+ | Component | Use when |
38
+ |-----------|----------|
39
+ | `Breadcrumb` | Page hierarchy trail |
40
+ | `Pagination` | Page number navigation |
41
+ | `Tabs` | Switch between views |
42
+ | `Accordion` | Collapsible sections |
43
+ | `Stepper` | Multi-step wizard progress |
44
+ | `SearchInput` | Search field with icon |
45
+ | `FilterChips` | Active filter tags |
46
+ | `Navbar` | Top navigation bar |
47
+ | `Sidebar` | Side navigation panel |
48
+
49
+ ## Examples
50
+
51
+ ### Tabs
52
+
53
+ ```tsx
54
+ import { Tabs } from 'velocis/navigation';
55
+
56
+ <Tabs
57
+ items={[
58
+ { id: 'overview', label: 'Overview', content: <Overview /> },
59
+ { id: 'settings', label: 'Settings', content: <Settings /> },
60
+ ]}
61
+ />
62
+ ```
63
+
64
+ ### Breadcrumb
65
+
66
+ ```tsx
67
+ import { Breadcrumb } from 'velocis/navigation';
68
+
69
+ <Breadcrumb
70
+ items={[
71
+ { label: 'Home', href: '/' },
72
+ { label: 'Products', href: '/products' },
73
+ { label: 'Detail' },
74
+ ]}
75
+ />
76
+ ```
77
+
78
+ ### Navbar + Sidebar
79
+
80
+ Use `Navbar` for horizontal top links and `Sidebar` for vertical app shell navigation.
81
+
82
+ ## Types
83
+
84
+ | Type | Used by |
85
+ |------|---------|
86
+ | `BreadcrumbItem` | `Breadcrumb` |
87
+ | `TabItem` | `Tabs` |
88
+ | `AccordionItem` | `Accordion` |
89
+ | `StepperStep` | `Stepper` |
90
+ | `FilterChip` | `FilterChips` |
91
+ | `NavbarItem` | `Navbar` |
92
+ | `SidebarItem` | `Sidebar` |
93
+
94
+ ## When to use
95
+
96
+ | Scenario | Component |
97
+ |----------|-----------|
98
+ | App shell | `Navbar` + `Sidebar` |
99
+ | Settings sections | `Tabs` or `Accordion` |
100
+ | Checkout flow | `Stepper` |
101
+ | Data table filters | `SearchInput` + `FilterChips` |
102
+ | Long result sets | `Pagination` (or `Table.Paginated`) |
package/docs/table.md ADDED
@@ -0,0 +1,111 @@
1
+ # Table (`velocis/table`)
2
+
3
+ Data tables with sorting, pagination, virtualization, and utilities.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import {
9
+ Table,
10
+ DataTable,
11
+ PaginatedTable,
12
+ ExpandableRowTable,
13
+ EditableTable,
14
+ VirtualizedTable,
15
+ TreeTable,
16
+ TableColumn,
17
+ useTableEngine,
18
+ useTableUrlSync,
19
+ useTablePersistence,
20
+ } from 'velocis/table';
21
+ ```
22
+
23
+ ## Compound API (`Table`)
24
+
25
+ `Table` defaults to `DataTable` and exposes variants as static properties:
26
+
27
+ | Property | Component | Use when |
28
+ |----------|-----------|----------|
29
+ | `Table` / `Table.Data` | `DataTable` | Static in-memory data |
30
+ | `Table.Paginated` | `PaginatedTable` | Server-side / async pagination |
31
+ | `Table.Expandable` | `ExpandableRowTable` | Rows expand to show detail |
32
+ | `Table.Editable` | `EditableTable` | Inline cell editing |
33
+ | `Table.Virtualized` | `VirtualizedTable` | Large datasets (virtual scroll) |
34
+ | `Table.Tree` | `TreeTable` | Hierarchical rows |
35
+ | `Table.Column` | `TableColumn` | Column helper (PaginatedTable) |
36
+ | `Table.Footer` | `TableFooter` | Custom table footer |
37
+ | `Table.Export` | `TableExport` | Export data (CSV, etc.) |
38
+ | `Table.ColumnVisibility` | `TableColumnVisibility` | Show/hide columns |
39
+ | `Table.Aggregation` | `TableAggregation` | Sum/avg/count footer rows |
40
+ | `Table.DetailPanel` | `TableDetailPanel` | Side detail panel |
41
+ | `Table.Import` | `TableImport` | Import data from file |
42
+
43
+ ## Column definition
44
+
45
+ ```tsx
46
+ const columns = [
47
+ { id: 'name', header: 'Name', accessor: 'name', sortable: true },
48
+ { id: 'email', header: 'Email', accessor: 'email' },
49
+ { id: 'role', header: 'Role', accessor: (row) => row.role },
50
+ ];
51
+ ```
52
+
53
+ | Field | Type | Description |
54
+ |-------|------|-------------|
55
+ | `id` | `string` | Unique column id |
56
+ | `header` | `string` | Column header label |
57
+ | `accessor` | `keyof T \| (row) => ReactNode` | Cell value |
58
+ | `sortable` | `boolean` | Enable sorting |
59
+ | `width` | `string` | CSS width |
60
+
61
+ ## Basic example
62
+
63
+ ```tsx
64
+ 'use client';
65
+ import { Table } from 'velocis/table';
66
+
67
+ const data = [{ name: 'Alice', email: 'a@example.com', role: 'Admin' }];
68
+
69
+ <Table data={data} columns={columns} />
70
+ ```
71
+
72
+ ## Paginated (async data)
73
+
74
+ ```tsx
75
+ import { Table } from 'velocis/table';
76
+
77
+ <Table.Paginated
78
+ dataSource={myDataSource}
79
+ columns={columns}
80
+ />
81
+ ```
82
+
83
+ Requires a `DataSource<T>` from `@velocis/core` / `velocis`.
84
+
85
+ ## Hooks
86
+
87
+ | Hook | Purpose |
88
+ |------|---------|
89
+ | `useTableEngine` | Sort, filter, pagination, selection, expansion state |
90
+ | `useTableUrlSync` | Sync table state to URL query params |
91
+ | `useTablePersistence` | Persist column/state to localStorage |
92
+
93
+ ## Table props (shared)
94
+
95
+ | Prop | Type | Description |
96
+ |------|------|-------------|
97
+ | `data` | `T[]` | Row data (static tables) |
98
+ | `columns` | `ColumnDef<T>[]` | Column config |
99
+ | `isLoading` | `boolean` | Loading state |
100
+ | `getRowId` | `(row) => string \| number` | Stable row id |
101
+ | `className` | `string` | Wrapper class |
102
+
103
+ ## When to use
104
+
105
+ | Scenario | Component |
106
+ |----------|-----------|
107
+ | Small static list | `Table` / `DataTable` |
108
+ | API-backed pages | `Table.Paginated` |
109
+ | 1000+ rows | `Table.Virtualized` |
110
+ | Nested categories | `Table.Tree` |
111
+ | Master-detail | `Table.Expandable` + `Table.DetailPanel` |