@craftzbay/ui 0.4.0 → 0.6.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-lib/catalog.d.ts +8 -0
- package/dist-lib/components/patterns/AppShell.d.ts +142 -4
- package/dist-lib/components/patterns/DataTablePage.d.ts +81 -1
- package/dist-lib/components/patterns/FirstRunEmpty.d.ts +39 -1
- package/dist-lib/components/patterns/Onboarding.d.ts +65 -1
- package/dist-lib/components/patterns/Pricing.d.ts +40 -1
- package/dist-lib/components/patterns/RecordDetail.d.ts +48 -1
- package/dist-lib/components/patterns/Settings.d.ts +34 -1
- package/dist-lib/components/ui/EmptyState.d.ts +22 -7
- package/dist-lib/components/ui/ErrorState.d.ts +15 -4
- package/dist-lib/icons/index.d.ts +1 -1
- package/dist-lib/index.cjs +2 -4
- package/dist-lib/index.cjs.map +1 -1
- package/dist-lib/index.js +2973 -4944
- package/dist-lib/index.js.map +1 -1
- package/dist-lib/showcase/components/Accordion.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Alert.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Avatar.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Badge.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Breadcrumbs.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Button.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Calendar.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Card.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Carousel.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Chart.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Checkbox.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Combobox.docs.d.ts +3 -0
- package/dist-lib/showcase/components/CommandPalette.docs.d.ts +3 -0
- package/dist-lib/showcase/components/ContextMenu.docs.d.ts +3 -0
- package/dist-lib/showcase/components/DataGrid.docs.d.ts +3 -0
- package/dist-lib/showcase/components/DatePicker.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Dialog.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Drawer.docs.d.ts +3 -0
- package/dist-lib/showcase/components/DropdownMenu.docs.d.ts +3 -0
- package/dist-lib/showcase/components/EmptyState.docs.d.ts +3 -0
- package/dist-lib/showcase/components/ErrorState.docs.d.ts +3 -0
- package/dist-lib/showcase/components/FileUpload.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Form.docs.d.ts +3 -0
- package/dist-lib/showcase/components/IconButton.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Input.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Kbd.docs.d.ts +3 -0
- package/dist-lib/showcase/components/MultiSelect.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Pagination.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Popover.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Progress.docs.d.ts +3 -0
- package/dist-lib/showcase/components/RadioGroup.docs.d.ts +3 -0
- package/dist-lib/showcase/components/ScrollArea.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Select.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Separator.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Sheet.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Sidebar.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Skeleton.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Slider.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Snackbar.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Spinner.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Stepper.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Switch.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Table.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Tabs.docs.d.ts +3 -0
- package/dist-lib/showcase/components/TagInput.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Textarea.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Timeline.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Toast.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Tooltip.docs.d.ts +3 -0
- package/dist-lib/showcase/components/TopNav.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Tree.docs.d.ts +3 -0
- package/dist-lib/showcase/guides/DarkMode.d.ts +1 -0
- package/dist-lib/showcase/guides/Forms.d.ts +1 -0
- package/dist-lib/showcase/guides/Responsive.d.ts +1 -0
- package/dist-lib/showcase/guides/Theming.d.ts +1 -0
- package/dist-lib/showcase/layout/DocLayout.d.ts +22 -0
- package/dist-lib/showcase/layout/DocSidebar.d.ts +27 -0
- package/dist-lib/showcase/layout/ShowcaseTopBar.d.ts +13 -0
- package/dist-lib/showcase/layout/sidebars.d.ts +14 -0
- package/dist-lib/showcase/pages/ComponentDocPage.d.ts +6 -0
- package/dist-lib/showcase/pages/ComponentsIndexPage.d.ts +1 -0
- package/dist-lib/showcase/pages/GuidePage.d.ts +6 -0
- package/dist-lib/showcase/pages/GuidesIndexPage.d.ts +1 -0
- package/dist-lib/showcase/pages/HomePage.d.ts +1 -0
- package/dist-lib/showcase/pages/TemplateDocPage.d.ts +6 -0
- package/dist-lib/showcase/pages/TemplatesIndexPage.d.ts +1 -0
- package/dist-lib/showcase/registry/components.d.ts +4 -0
- package/dist-lib/showcase/registry/guides.d.ts +3 -0
- package/dist-lib/showcase/registry/templates.d.ts +3 -0
- package/dist-lib/showcase/registry/types.d.ts +69 -0
- package/dist-lib/showcase/routing.d.ts +39 -0
- package/dist-lib/showcase/templates/AuthForgot.template.d.ts +3 -0
- package/dist-lib/showcase/templates/AuthMagic.template.d.ts +3 -0
- package/dist-lib/showcase/templates/AuthSignIn.template.d.ts +3 -0
- package/dist-lib/showcase/templates/AuthSignUp.template.d.ts +3 -0
- package/dist-lib/showcase/templates/Dashboard.template.d.ts +3 -0
- package/dist-lib/showcase/templates/DataTable.template.d.ts +3 -0
- package/dist-lib/showcase/templates/FirstRunEmpty.template.d.ts +3 -0
- package/dist-lib/showcase/templates/Onboarding.template.d.ts +3 -0
- package/dist-lib/showcase/templates/Pricing.template.d.ts +3 -0
- package/dist-lib/showcase/templates/RecordDetail.template.d.ts +3 -0
- package/dist-lib/showcase/templates/Settings.template.d.ts +3 -0
- package/dist-lib/showcase/widgets/CodeBlock.d.ts +12 -0
- package/dist-lib/showcase/widgets/CodePreview.d.ts +14 -0
- package/dist-lib/showcase/widgets/PropsTable.d.ts +10 -0
- package/dist-lib/showcase/widgets/SectionAnchor.d.ts +13 -0
- package/package.json +16 -22
package/README.md
CHANGED
|
@@ -5,7 +5,8 @@ primitives — Button through DataGrid — plus composed patterns
|
|
|
5
5
|
(authentication, app shell, settings, etc.).
|
|
6
6
|
|
|
7
7
|
- **Showcase:** [design.runestonetechnologies.com](https://design.runestonetechnologies.com)
|
|
8
|
-
- **
|
|
8
|
+
- **Components catalog:** [design.runestonetechnologies.com#catalog](https://design.runestonetechnologies.com#catalog)
|
|
9
|
+
- **Docs:** [design.runestonetechnologies.com#docs](https://design.runestonetechnologies.com#docs)
|
|
9
10
|
|
|
10
11
|
> **Aesthetic direction:** Linear / Vercel / Stripe Dashboard / Notion / Raycast.
|
|
11
12
|
> Neutral-dominant, one accent, hairline borders, generous whitespace, fast quiet
|
|
@@ -33,7 +34,6 @@ Peer dependencies: `react@>=18`, `react-dom@>=18`.
|
|
|
33
34
|
```bash
|
|
34
35
|
pnpm install
|
|
35
36
|
pnpm dev # Vite showcase at localhost:5173
|
|
36
|
-
pnpm storybook # Storybook at localhost:6006
|
|
37
37
|
pnpm build:lib # Build library → dist-lib/
|
|
38
38
|
```
|
|
39
39
|
|
|
@@ -1,12 +1,150 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Legacy nav keys retained for back-compat. The `active` prop now accepts
|
|
4
|
+
* any string — these are kept as a typed alias for consumers that hard-code
|
|
5
|
+
* one of the original demo values.
|
|
6
|
+
*/
|
|
2
7
|
export type AppShellNavKey = 'home' | 'projects' | 'inbox' | 'members' | 'insights' | 'bookmarks' | 'apps' | 'settings' | 'integrations' | 'help';
|
|
8
|
+
export interface AppShellNavItem {
|
|
9
|
+
/** Active-state identifier — matches AppShell's `active` prop. */
|
|
10
|
+
key: string;
|
|
11
|
+
label: ReactNode;
|
|
12
|
+
/** Leading icon. */
|
|
13
|
+
icon?: ReactNode;
|
|
14
|
+
/** Destination. Renders as <a href>; for SPAs intercept onClick. */
|
|
15
|
+
href?: string;
|
|
16
|
+
/** Right-aligned content (Badge, count). */
|
|
17
|
+
trailing?: ReactNode;
|
|
18
|
+
/** Optional click handler. */
|
|
19
|
+
onClick?: () => void;
|
|
20
|
+
}
|
|
21
|
+
export interface AppShellNavSection {
|
|
22
|
+
/** Section heading shown above the items. */
|
|
23
|
+
label?: ReactNode;
|
|
24
|
+
items: AppShellNavItem[];
|
|
25
|
+
}
|
|
26
|
+
export interface AppShellUser {
|
|
27
|
+
name: ReactNode;
|
|
28
|
+
email?: ReactNode;
|
|
29
|
+
/** 1–2 char initials for the Avatar fallback. */
|
|
30
|
+
initials: string;
|
|
31
|
+
/** Online status — drives the Avatar status dot. */
|
|
32
|
+
status?: 'online' | 'busy' | 'away' | 'offline';
|
|
33
|
+
}
|
|
34
|
+
export interface AppShellNotification {
|
|
35
|
+
id: string;
|
|
36
|
+
who: {
|
|
37
|
+
name: string;
|
|
38
|
+
initials: string;
|
|
39
|
+
};
|
|
40
|
+
action: ReactNode;
|
|
41
|
+
target: ReactNode;
|
|
42
|
+
when: ReactNode;
|
|
43
|
+
unread?: boolean;
|
|
44
|
+
onClick?: () => void;
|
|
45
|
+
}
|
|
46
|
+
export interface AppShellProfileMenuItem {
|
|
47
|
+
label: ReactNode;
|
|
48
|
+
icon?: ReactNode;
|
|
49
|
+
trailing?: ReactNode;
|
|
50
|
+
onSelect?: () => void;
|
|
51
|
+
/** Renders a separator before this item. */
|
|
52
|
+
separatorAbove?: boolean;
|
|
53
|
+
}
|
|
3
54
|
export interface AppShellProps {
|
|
4
55
|
/** Page content. */
|
|
5
56
|
children: ReactNode;
|
|
6
57
|
/** Logo / wordmark rendered at the top of the sidebar. */
|
|
7
58
|
brand: ReactNode;
|
|
8
|
-
/** Which sidebar item is active. Defaults to `home`. */
|
|
9
|
-
active?:
|
|
59
|
+
/** Which sidebar item is active. Matches `AppShellNavItem.key`. Defaults to `'home'`. */
|
|
60
|
+
active?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Sidebar nav sections. Defaults to the built-in demo nav. Pass an empty
|
|
63
|
+
* array to hide the nav entirely, or use `sidebar` for a fully custom rail.
|
|
64
|
+
*/
|
|
65
|
+
navSections?: AppShellNavSection[];
|
|
66
|
+
/**
|
|
67
|
+
* Escape hatch: replace the entire Sidebar contents. Takes precedence over
|
|
68
|
+
* `navSections`. Use when you need custom section components, groups, etc.
|
|
69
|
+
*/
|
|
70
|
+
sidebar?: ReactNode;
|
|
71
|
+
/** Slot for additional topbar actions (left of notifications). */
|
|
72
|
+
topbarActions?: ReactNode;
|
|
73
|
+
/** Topbar search input — pass `false` to hide. */
|
|
74
|
+
search?: ReactNode | false;
|
|
75
|
+
/** Currently signed-in user, shown in the sidebar footer + profile menu. */
|
|
76
|
+
user?: AppShellUser;
|
|
77
|
+
/** Profile dropdown items. Defaults to the demo Profile / Settings / Sign out menu. */
|
|
78
|
+
profileMenu?: AppShellProfileMenuItem[];
|
|
79
|
+
/** Notification feed. Set to an empty array to hide the bell entirely. */
|
|
80
|
+
notifications?: AppShellNotification[];
|
|
81
|
+
/** Fires when the user clicks "Mark all read". */
|
|
82
|
+
onMarkAllNotificationsRead?: () => void;
|
|
83
|
+
/** Fires when the user clicks "View all" in the notifications menu. */
|
|
84
|
+
onViewAllNotifications?: () => void;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* AppShell — sticky sidebar + topbar shell for SaaS dashboards.
|
|
88
|
+
*
|
|
89
|
+
* @example Default — uses the built-in demo nav, user, notifications
|
|
90
|
+
* <AppShell brand={<Logo />} active="home">
|
|
91
|
+
* <Dashboard />
|
|
92
|
+
* </AppShell>
|
|
93
|
+
*
|
|
94
|
+
* @example Custom nav + user
|
|
95
|
+
* <AppShell
|
|
96
|
+
* brand={<Logo />}
|
|
97
|
+
* active="projects"
|
|
98
|
+
* user={{ name: 'Avery Long', email: 'avery@acme.com', initials: 'AL', status: 'online' }}
|
|
99
|
+
* navSections={[
|
|
100
|
+
* { label: 'Workspace', items: [
|
|
101
|
+
* { key: 'home', label: 'Home', icon: <Home />, href: '/' },
|
|
102
|
+
* { key: 'projects', label: 'Projects', icon: <Folder />, href: '/projects',
|
|
103
|
+
* trailing: <Badge tone="neutral">{count}</Badge> },
|
|
104
|
+
* ]},
|
|
105
|
+
* ]}
|
|
106
|
+
* notifications={data?.notifications ?? []}
|
|
107
|
+
* >
|
|
108
|
+
* <ProjectsPage />
|
|
109
|
+
* </AppShell>
|
|
110
|
+
*/
|
|
111
|
+
export declare function AppShell({ children, brand, active, navSections, sidebar, topbarActions, search, user, profileMenu, notifications, onMarkAllNotificationsRead, onViewAllNotifications, }: AppShellProps): import("react/jsx-runtime").JSX.Element;
|
|
112
|
+
export interface DashboardStat {
|
|
113
|
+
label: ReactNode;
|
|
114
|
+
value: ReactNode;
|
|
115
|
+
delta?: {
|
|
116
|
+
value: string;
|
|
117
|
+
positive?: boolean;
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
export interface DashboardActivityRow {
|
|
121
|
+
id: string;
|
|
122
|
+
who: {
|
|
123
|
+
name: string;
|
|
124
|
+
initials: string;
|
|
125
|
+
};
|
|
126
|
+
action: ReactNode;
|
|
127
|
+
target: ReactNode;
|
|
128
|
+
when: ReactNode;
|
|
129
|
+
}
|
|
130
|
+
export interface DashboardProps {
|
|
131
|
+
/** Top heading. */
|
|
132
|
+
title?: ReactNode;
|
|
133
|
+
/** Subtitle below the heading. */
|
|
134
|
+
subtitle?: ReactNode;
|
|
135
|
+
/** Top-right slot (date-range picker, segmented control, …). */
|
|
136
|
+
headerActions?: ReactNode;
|
|
137
|
+
/** Stat cards rendered in a responsive grid. */
|
|
138
|
+
stats?: DashboardStat[];
|
|
139
|
+
/** Chart card — any ReactNode (Chart component, SVG, image, placeholder). */
|
|
140
|
+
chart?: ReactNode;
|
|
141
|
+
/** Title above the chart. */
|
|
142
|
+
chartTitle?: ReactNode;
|
|
143
|
+
/** Subtitle under the chart title. */
|
|
144
|
+
chartDescription?: ReactNode;
|
|
145
|
+
/** Activity table rows. */
|
|
146
|
+
activity?: DashboardActivityRow[];
|
|
147
|
+
/** Title for the activity table. */
|
|
148
|
+
activityTitle?: ReactNode;
|
|
10
149
|
}
|
|
11
|
-
export declare function
|
|
12
|
-
export declare function Dashboard(): import("react/jsx-runtime").JSX.Element;
|
|
150
|
+
export declare function Dashboard({ title, subtitle, headerActions, stats, chart, chartTitle, chartDescription, activity, activityTitle, }?: DashboardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1,81 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ButtonProps } from '../ui/Button';
|
|
3
|
+
import { DataGridColumn } from '../ui/DataGrid';
|
|
4
|
+
export interface DataTableFilter {
|
|
5
|
+
/** Field key used by the default predicate, and as the React key. */
|
|
6
|
+
key: string;
|
|
7
|
+
label: string;
|
|
8
|
+
/** First option should be the "all" / cleared value. */
|
|
9
|
+
options: {
|
|
10
|
+
value: string;
|
|
11
|
+
label: string;
|
|
12
|
+
}[];
|
|
13
|
+
/** Initial value. Defaults to the first option's value. */
|
|
14
|
+
defaultValue?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface DataTableBulkAction<T> {
|
|
17
|
+
label: string;
|
|
18
|
+
/** Optional leading icon. */
|
|
19
|
+
icon?: ReactNode;
|
|
20
|
+
variant?: ButtonProps['variant'];
|
|
21
|
+
/** Receives the selected rows. Awaited — toolbar shows a spinner while pending. */
|
|
22
|
+
onAction: (selected: T[]) => void | Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
export interface DataTablePageProps<T extends {
|
|
25
|
+
id: string | number;
|
|
26
|
+
}> {
|
|
27
|
+
/** Page heading. */
|
|
28
|
+
title?: ReactNode;
|
|
29
|
+
/** Optional subtitle — defaults to a row-count line. */
|
|
30
|
+
subtitle?: ReactNode;
|
|
31
|
+
/** Right-aligned header actions (e.g. New / Import buttons). */
|
|
32
|
+
headerActions?: ReactNode;
|
|
33
|
+
/** Row data. */
|
|
34
|
+
rows?: T[];
|
|
35
|
+
/** Column descriptors. */
|
|
36
|
+
columns?: DataGridColumn<T>[];
|
|
37
|
+
/** Filter selects to render in the toolbar. */
|
|
38
|
+
filters?: DataTableFilter[];
|
|
39
|
+
/** Custom predicate. Receives the row + the active filter values. */
|
|
40
|
+
predicate?: (row: T, filterValues: Record<string, string>, search: string) => boolean;
|
|
41
|
+
/** Search placeholder. */
|
|
42
|
+
searchPlaceholder?: string;
|
|
43
|
+
/** Available rows-per-page sizes. */
|
|
44
|
+
pageSizeOptions?: number[];
|
|
45
|
+
/** Initial page size. */
|
|
46
|
+
defaultPageSize?: number;
|
|
47
|
+
/** Bulk-action buttons shown when rows are selected. */
|
|
48
|
+
bulkActions?: DataTableBulkAction<T>[];
|
|
49
|
+
/** EmptyState rendered when the filtered rows are empty. */
|
|
50
|
+
emptyState?: ReactNode;
|
|
51
|
+
className?: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Generic data-table page.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* interface User { id: string; name: string; role: string; status: 'active' | 'invited' }
|
|
58
|
+
*
|
|
59
|
+
* <DataTablePage<User>
|
|
60
|
+
* title="Members"
|
|
61
|
+
* rows={users}
|
|
62
|
+
* columns={[
|
|
63
|
+
* { key: 'name', header: 'Name', sortable: true },
|
|
64
|
+
* { key: 'role', header: 'Role' },
|
|
65
|
+
* { key: 'status', header: 'Status', cell: (r) => <Badge>{r.status}</Badge> },
|
|
66
|
+
* ]}
|
|
67
|
+
* filters={[
|
|
68
|
+
* { key: 'status', label: 'Status', options: [
|
|
69
|
+
* { value: 'all', label: 'All' },
|
|
70
|
+
* { value: 'active', label: 'Active' },
|
|
71
|
+
* { value: 'invited', label: 'Invited' },
|
|
72
|
+
* ]},
|
|
73
|
+
* ]}
|
|
74
|
+
* bulkActions={[
|
|
75
|
+
* { label: 'Remove', variant: 'destructive', onAction: (rows) => api.remove(rows) },
|
|
76
|
+
* ]}
|
|
77
|
+
* />
|
|
78
|
+
*/
|
|
79
|
+
export declare function DataTablePage<T extends {
|
|
80
|
+
id: string | number;
|
|
81
|
+
}>({ title, subtitle, headerActions, rows: rowsProp, columns: columnsProp, filters: filtersProp, predicate, searchPlaceholder, pageSizeOptions, defaultPageSize, bulkActions: bulkActionsProp, emptyState, className, }?: DataTablePageProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1,39 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface FirstRunNextStep {
|
|
3
|
+
icon?: ReactNode;
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
cta: string;
|
|
7
|
+
onSelect?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export interface FirstRunEmptyProps {
|
|
10
|
+
/** Hero icon — typically a folder, sparkles, or product mark. */
|
|
11
|
+
heroIcon?: ReactNode;
|
|
12
|
+
/** Hero title. */
|
|
13
|
+
title?: ReactNode;
|
|
14
|
+
/** Hero subtitle. */
|
|
15
|
+
description?: ReactNode;
|
|
16
|
+
/** Primary CTA inside the hero (top tutorial / overview action). */
|
|
17
|
+
primaryAction?: ReactNode;
|
|
18
|
+
/** Next-step cards rendered below the hero. */
|
|
19
|
+
steps?: FirstRunNextStep[];
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* First-run empty product state.
|
|
24
|
+
*
|
|
25
|
+
* @example Default (uses built-in placeholder copy)
|
|
26
|
+
* <FirstRunEmpty />
|
|
27
|
+
*
|
|
28
|
+
* @example Customized
|
|
29
|
+
* <FirstRunEmpty
|
|
30
|
+
* heroIcon={<Illustrations.InboxEmpty className="size-16" />}
|
|
31
|
+
* title="Welcome to Atlas"
|
|
32
|
+
* description="Pick a starting point."
|
|
33
|
+
* steps={[
|
|
34
|
+
* { icon: <Plus />, title: 'New project', description: '…', cta: 'Create' },
|
|
35
|
+
* { icon: <Github />, title: 'Import repo', description: '…', cta: 'Connect' },
|
|
36
|
+
* ]}
|
|
37
|
+
* />
|
|
38
|
+
*/
|
|
39
|
+
export declare function FirstRunEmpty({ heroIcon, title, description, primaryAction, steps, className, }?: FirstRunEmptyProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1,65 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface OnboardingStepContext<T = unknown> {
|
|
3
|
+
/** Move to the next step. */
|
|
4
|
+
next: () => void;
|
|
5
|
+
/** Move to the previous step. */
|
|
6
|
+
prev: () => void;
|
|
7
|
+
/** Jump to a step by index. */
|
|
8
|
+
goTo: (index: number) => void;
|
|
9
|
+
/** Finish the flow — calls onComplete. */
|
|
10
|
+
finish: () => void;
|
|
11
|
+
/** Current accumulated data across steps. */
|
|
12
|
+
data: T;
|
|
13
|
+
/** Patch the accumulated data. */
|
|
14
|
+
setData: (patch: Partial<T>) => void;
|
|
15
|
+
}
|
|
16
|
+
export interface OnboardingStep<T = unknown> {
|
|
17
|
+
/** Stable id used for keys + analytics. */
|
|
18
|
+
id: string;
|
|
19
|
+
/** Title shown in the Stepper. */
|
|
20
|
+
title: string;
|
|
21
|
+
/** Optional sub-description shown only in vertical Stepper. */
|
|
22
|
+
description?: string;
|
|
23
|
+
/** Card heading rendered when the step is active. */
|
|
24
|
+
heading: ReactNode;
|
|
25
|
+
/** Card description rendered under the heading. */
|
|
26
|
+
subheading?: ReactNode;
|
|
27
|
+
/** Step body. Receives navigation controls + shared data. */
|
|
28
|
+
render: (ctx: OnboardingStepContext<T>) => ReactNode;
|
|
29
|
+
/** Override the Continue / Finish button label. */
|
|
30
|
+
ctaLabel?: string;
|
|
31
|
+
/** Hide the default Back/Next bar — render your own inside `render`. */
|
|
32
|
+
hideNavigation?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface OnboardingProps<T = unknown> {
|
|
35
|
+
steps?: OnboardingStep<T>[];
|
|
36
|
+
/** Initial accumulated data. */
|
|
37
|
+
initialData?: T;
|
|
38
|
+
/** Called when the user advances past the last step. */
|
|
39
|
+
onComplete?: (data: T) => void | Promise<void>;
|
|
40
|
+
className?: string;
|
|
41
|
+
}
|
|
42
|
+
interface DemoData {
|
|
43
|
+
workspaceName?: string;
|
|
44
|
+
slug?: string;
|
|
45
|
+
inviteEmail?: string;
|
|
46
|
+
role?: string;
|
|
47
|
+
source?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Multi-step onboarding wizard.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* <Onboarding<{ name: string; email: string }>
|
|
54
|
+
* initialData={{ name: '', email: '' }}
|
|
55
|
+
* steps={[
|
|
56
|
+
* { id: 'name', title: 'Name', heading: 'What should we call you?',
|
|
57
|
+
* render: ({ data, setData }) =>
|
|
58
|
+
* <Input value={data.name} onChange={(e) => setData({ name: e.target.value })} /> },
|
|
59
|
+
* …
|
|
60
|
+
* ]}
|
|
61
|
+
* onComplete={async (data) => api.completeOnboarding(data)}
|
|
62
|
+
* />
|
|
63
|
+
*/
|
|
64
|
+
export declare function Onboarding<T = DemoData>({ steps, initialData, onComplete, className, }?: OnboardingProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
65
|
+
export {};
|
|
@@ -1 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface PricingTier {
|
|
3
|
+
name: string;
|
|
4
|
+
/** Price string. Pre-formatted — render '$0', '$20', 'Custom', '¥1,200', etc. */
|
|
5
|
+
price: string;
|
|
6
|
+
/** Cadence label rendered next to the price ('per user / month'). */
|
|
7
|
+
cadence?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
features: string[];
|
|
10
|
+
/** CTA label. */
|
|
11
|
+
cta: string;
|
|
12
|
+
/** Mark this tier as the recommended one — adds accent border + badge. */
|
|
13
|
+
highlighted?: boolean;
|
|
14
|
+
/** Click handler for the CTA. */
|
|
15
|
+
onSelect?: () => void;
|
|
16
|
+
}
|
|
17
|
+
export interface PricingProps {
|
|
18
|
+
/** Top heading. */
|
|
19
|
+
title?: ReactNode;
|
|
20
|
+
/** Subtitle under the heading. */
|
|
21
|
+
subtitle?: ReactNode;
|
|
22
|
+
/** Tier descriptors. */
|
|
23
|
+
tiers?: PricingTier[];
|
|
24
|
+
/** Label shown on the highlighted tier badge. */
|
|
25
|
+
highlightedLabel?: string;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Pricing grid. Defaults to a 3-tier demo if `tiers` is omitted.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* <Pricing
|
|
33
|
+
* title="Plans"
|
|
34
|
+
* tiers={[
|
|
35
|
+
* { name: 'Free', price: '$0', features: ['…'], cta: 'Start' },
|
|
36
|
+
* { name: 'Pro', price: '$12', features: ['…'], cta: 'Upgrade', highlighted: true },
|
|
37
|
+
* ]}
|
|
38
|
+
* />
|
|
39
|
+
*/
|
|
40
|
+
export declare function Pricing({ title, subtitle, tiers, highlightedLabel, className, }?: PricingProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1,48 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface RecordDetailHeader {
|
|
3
|
+
title: ReactNode;
|
|
4
|
+
subtitle?: ReactNode;
|
|
5
|
+
/** Optional status pill rendered next to the title. */
|
|
6
|
+
status?: ReactNode;
|
|
7
|
+
/** Right-aligned action buttons. */
|
|
8
|
+
actions?: ReactNode;
|
|
9
|
+
/** Breadcrumb trail rendered above the header. */
|
|
10
|
+
breadcrumbs?: {
|
|
11
|
+
label: ReactNode;
|
|
12
|
+
href?: string;
|
|
13
|
+
}[];
|
|
14
|
+
}
|
|
15
|
+
export interface RecordDetailTab {
|
|
16
|
+
id: string;
|
|
17
|
+
label: ReactNode;
|
|
18
|
+
render: () => ReactNode;
|
|
19
|
+
}
|
|
20
|
+
export interface RecordDetailProps {
|
|
21
|
+
header?: RecordDetailHeader;
|
|
22
|
+
tabs?: RecordDetailTab[];
|
|
23
|
+
/** Initial tab id. Defaults to the first tab. */
|
|
24
|
+
defaultTab?: string;
|
|
25
|
+
/** Optional right-side panel (related items, details list, watchers, …). */
|
|
26
|
+
sidePanel?: ReactNode;
|
|
27
|
+
className?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Record detail page — header (breadcrumbs + title + actions) + tabs + side panel.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* <RecordDetail
|
|
34
|
+
* header={{
|
|
35
|
+
* title: project.name,
|
|
36
|
+
* subtitle: project.description,
|
|
37
|
+
* status: <Badge tone="success">Active</Badge>,
|
|
38
|
+
* actions: <Button>Share</Button>,
|
|
39
|
+
* breadcrumbs: [{ label: 'Projects', href: '/projects' }, { label: project.name }],
|
|
40
|
+
* }}
|
|
41
|
+
* tabs={[
|
|
42
|
+
* { id: 'overview', label: 'Overview', render: () => <Overview project={project} /> },
|
|
43
|
+
* { id: 'activity', label: 'Activity', render: () => <Activity projectId={project.id} /> },
|
|
44
|
+
* ]}
|
|
45
|
+
* sidePanel={<RelatedItems project={project} />}
|
|
46
|
+
* />
|
|
47
|
+
*/
|
|
48
|
+
export declare function RecordDetail({ header, tabs, defaultTab, sidePanel, className, }?: RecordDetailProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1,34 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface SettingsSection {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
render: () => ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export interface SettingsPageProps {
|
|
9
|
+
/** Page title — defaults to "Settings". */
|
|
10
|
+
title?: ReactNode;
|
|
11
|
+
/** Subtitle under the heading. */
|
|
12
|
+
subtitle?: ReactNode;
|
|
13
|
+
sections?: SettingsSection[];
|
|
14
|
+
/** Initially active section id. Defaults to the first section. */
|
|
15
|
+
defaultSection?: string;
|
|
16
|
+
/** Controlled active section id. */
|
|
17
|
+
activeSection?: string;
|
|
18
|
+
/** Fires when the active section changes (controlled mode). */
|
|
19
|
+
onActiveSectionChange?: (id: string) => void;
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Settings page with a sticky sub-nav on the left and section cards on the right.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* <SettingsPage
|
|
27
|
+
* sections={[
|
|
28
|
+
* { id: 'profile', label: 'Profile', icon: <User />, render: () => <ProfileForm /> },
|
|
29
|
+
* { id: 'team', label: 'Team', icon: <Users />, render: () => <TeamForm /> },
|
|
30
|
+
* ]}
|
|
31
|
+
* defaultSection="profile"
|
|
32
|
+
* />
|
|
33
|
+
*/
|
|
34
|
+
export declare function SettingsPage({ title, subtitle, sections, defaultSection, activeSection, onActiveSectionChange, className, }?: SettingsPageProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
export interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Small Lucide-sized icon rendered inside a 48px circular container.
|
|
5
|
+
* Use for compact empty states (table cells, sidebar panes, cards).
|
|
6
|
+
*/
|
|
4
7
|
icon?: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Full-size illustration rendered without the icon container. Takes
|
|
10
|
+
* precedence over `icon`. If neither is set, the default `InboxEmpty`
|
|
11
|
+
* line illustration is used.
|
|
12
|
+
*/
|
|
13
|
+
illustration?: ReactNode;
|
|
5
14
|
/** Heading. One short sentence. */
|
|
6
15
|
title: ReactNode;
|
|
7
16
|
/** Description. One or two sentences max. */
|
|
@@ -15,17 +24,23 @@ export interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, 't
|
|
|
15
24
|
* Shown when a list / dataset / surface has no content yet. Tone is helpful,
|
|
16
25
|
* never apologetic.
|
|
17
26
|
*
|
|
18
|
-
* @example
|
|
27
|
+
* @example Default — uses the built-in InboxEmpty illustration
|
|
19
28
|
* <EmptyState
|
|
20
|
-
* icon={<Folder className="size-6" />}
|
|
21
29
|
* title="No projects yet"
|
|
22
30
|
* description="Create a project to start tracking work."
|
|
23
31
|
* action={<Button>New project</Button>}
|
|
24
32
|
* />
|
|
25
33
|
*
|
|
26
|
-
* @
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
34
|
+
* @example Compact — small Lucide icon for dense layouts
|
|
35
|
+
* <EmptyState
|
|
36
|
+
* icon={<Folder className="size-6" />}
|
|
37
|
+
* title="No items"
|
|
38
|
+
* />
|
|
39
|
+
*
|
|
40
|
+
* @example Custom illustration
|
|
41
|
+
* <EmptyState
|
|
42
|
+
* illustration={<Illustrations.NoSearchResults className="size-32" />}
|
|
43
|
+
* title="No results"
|
|
44
|
+
* />
|
|
30
45
|
*/
|
|
31
46
|
export declare const EmptyState: import('react').ForwardRefExoticComponent<EmptyStateProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -6,6 +6,11 @@ export interface ErrorStateProps extends Omit<HTMLAttributes<HTMLDivElement>, 't
|
|
|
6
6
|
title?: ReactNode;
|
|
7
7
|
/** Override the default description. */
|
|
8
8
|
description?: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Override the variant's default illustration. Pass any ReactNode (e.g.
|
|
11
|
+
* `<Illustrations.Construction className="size-32" />`).
|
|
12
|
+
*/
|
|
13
|
+
illustration?: ReactNode;
|
|
9
14
|
/** Custom action node. Replaces the default retry button. */
|
|
10
15
|
action?: ReactNode;
|
|
11
16
|
/** When provided, renders a default "Try again" button calling this handler. */
|
|
@@ -14,13 +19,19 @@ export interface ErrorStateProps extends Omit<HTMLAttributes<HTMLDivElement>, 't
|
|
|
14
19
|
/**
|
|
15
20
|
* Page-level error placeholder. Pair with `onRetry` for transient failures.
|
|
16
21
|
*
|
|
17
|
-
* @example
|
|
22
|
+
* @example 404 (uses built-in line illustration)
|
|
23
|
+
* <ErrorState variant="404" />
|
|
24
|
+
*
|
|
25
|
+
* @example 500 with retry
|
|
18
26
|
* <ErrorState variant="500" onRetry={refetch} />
|
|
19
27
|
*
|
|
20
28
|
* @example Custom
|
|
21
|
-
* <ErrorState
|
|
22
|
-
*
|
|
23
|
-
*
|
|
29
|
+
* <ErrorState
|
|
30
|
+
* title="Quota exceeded"
|
|
31
|
+
* description="Your plan allows 1,000 events/day."
|
|
32
|
+
* illustration={<Illustrations.Construction className="size-32" />}
|
|
33
|
+
* action={<Button>Upgrade plan</Button>}
|
|
34
|
+
* />
|
|
24
35
|
*
|
|
25
36
|
* @do Match the tone to the cause — server errors apologise, user errors
|
|
26
37
|
* explain. Always offer a next step.
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
* - 20px for use inside buttons
|
|
9
9
|
* - strokeWidth 1.5
|
|
10
10
|
*/
|
|
11
|
-
export { AlertCircle, AlertTriangle, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, ArrowUpDown, BarChart3, Bell, Bookmark, Calendar, Check, CheckCircle2, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, ChevronsLeft, ChevronsRight, ChevronsUpDown, Circle, Copy, CornerDownLeft, CreditCard, Download, Edit2, Ellipsis, Eye, EyeOff, Filter, Folder, GripVertical, Home, Inbox, LayoutGrid, Lock, LogOut, HelpCircle, Info, Link2, Loader2, Mail, Menu, Minus, MoreHorizontal, Plug, Plus, Search, Sparkles, Settings, Sun, Moon, Trash2, Upload, User, Users, X, XCircle, ExternalLink, type LucideIcon, type LucideProps, } from 'lucide-react';
|
|
11
|
+
export { AlertCircle, AlertTriangle, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, ArrowUpDown, AtSign, BarChart3, Bell, Bookmark, Calendar, Check, CheckCircle2, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, ChevronsLeft, ChevronsRight, ChevronsUpDown, Circle, Copy, CornerDownLeft, CreditCard, Download, Edit2, Ellipsis, Eye, EyeOff, Filter, Folder, GripVertical, Home, Inbox, LayoutGrid, Lock, LogOut, HelpCircle, Info, Link2, Loader2, Mail, Menu, Minus, MoreHorizontal, Package, Plug, Plus, Search, Sparkles, Settings, Sun, Moon, Trash2, Upload, User, Users, X, XCircle, ExternalLink, type LucideIcon, type LucideProps, } from 'lucide-react';
|