@nebutra/ui 0.1.0 → 0.2.1
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/dist/components/index.d.ts +380 -0
- package/dist/components/index.js +2398 -0
- package/dist/components/index.js.map +1 -0
- package/dist/hooks/index.d.ts +106 -0
- package/dist/hooks/index.js +182 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/icons/index.d.ts +3 -0
- package/dist/icons/index.js +5 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/layout/index.d.ts +296 -0
- package/dist/layout/index.js +1303 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/layouts/index.d.ts +161 -0
- package/dist/layouts/index.js +611 -0
- package/dist/layouts/index.js.map +1 -0
- package/dist/patterns/index.d.ts +363 -0
- package/dist/patterns/index.js +3004 -0
- package/dist/patterns/index.js.map +1 -0
- package/dist/primitives/index.d.ts +9588 -0
- package/dist/primitives/index.js +26779 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/styles/brand-override.css +61 -0
- package/dist/tailwind.preset.d.ts +251 -0
- package/dist/tailwind.preset.js +273 -0
- package/dist/tailwind.preset.js.map +1 -0
- package/dist/theme/index.d.ts +150 -0
- package/dist/theme/index.js +28 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/typography/fonts.css +110 -0
- package/dist/typography/index.d.ts +425 -0
- package/dist/typography/index.js +374 -0
- package/dist/typography/index.js.map +1 -0
- package/dist/utils/index.d.ts +61 -0
- package/dist/utils/index.js +55 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +18 -8
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import React__default, { ReactNode } from 'react';
|
|
4
|
+
import { ThemeMode } from '../theme/index.js';
|
|
5
|
+
import '@lobehub/icons';
|
|
6
|
+
import '@nebutra/icons';
|
|
7
|
+
|
|
8
|
+
interface AppShellProps {
|
|
9
|
+
/** Sidebar slot — typically a `SidebarNav` or equivalent navigation tree. */
|
|
10
|
+
sidebar: React.ReactNode;
|
|
11
|
+
/** Optional sticky top header (breadcrumbs, search, user menu). */
|
|
12
|
+
header?: React.ReactNode;
|
|
13
|
+
/** Main content rendered inside `<main>`. */
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
/** Sidebar width in pixels when expanded. */
|
|
16
|
+
sidebarWidth?: number;
|
|
17
|
+
/** Sidebar width in pixels when collapsed (icon-only rail). */
|
|
18
|
+
sidebarCollapsedWidth?: number;
|
|
19
|
+
/** Controlled collapsed state. When provided, the component is fully controlled. */
|
|
20
|
+
collapsed?: boolean;
|
|
21
|
+
/** Default collapsed state for uncontrolled usage. */
|
|
22
|
+
defaultCollapsed?: boolean;
|
|
23
|
+
/** Fires whenever the collapsed state changes (both controlled + uncontrolled). */
|
|
24
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
25
|
+
/** Height in pixels of the sticky header row. Defaults to 48. */
|
|
26
|
+
headerHeight?: number;
|
|
27
|
+
/** Override the default container styles applied to `<main>`. */
|
|
28
|
+
contentClassName?: string;
|
|
29
|
+
/** Extra classes for the outer wrapper. */
|
|
30
|
+
className?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* AppShell — top-level dashboard chrome: sidebar + sticky header + scrollable main.
|
|
34
|
+
*
|
|
35
|
+
* Modeled after Vercel / Linear / MiniMax application shells. The sidebar is a
|
|
36
|
+
* fixed-width rail on `md+` viewports and collapses into a `Sheet` overlay on
|
|
37
|
+
* mobile (triggered by the hamburger button shown in the header).
|
|
38
|
+
*
|
|
39
|
+
* The sidebar width animates smoothly (200ms ease-out) when toggling between
|
|
40
|
+
* the expanded and collapsed states so it can host an icon-only rail.
|
|
41
|
+
*
|
|
42
|
+
* @status stable
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* <AppShell
|
|
47
|
+
* sidebar={<SidebarNav items={navItems} />}
|
|
48
|
+
* header={<DashboardHeader />}
|
|
49
|
+
* >
|
|
50
|
+
* <PageHeader title="Overview" />
|
|
51
|
+
* {children}
|
|
52
|
+
* </AppShell>
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
declare function AppShell({ sidebar, header, children, sidebarWidth, sidebarCollapsedWidth, collapsed, defaultCollapsed, onCollapsedChange, headerHeight, contentClassName, className, }: AppShellProps): react_jsx_runtime.JSX.Element;
|
|
56
|
+
|
|
57
|
+
interface CardProps {
|
|
58
|
+
children: React__default.ReactNode;
|
|
59
|
+
className?: string;
|
|
60
|
+
/** Whether the card has a hover/press effect */
|
|
61
|
+
isInteractive?: boolean;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Card — surface container with border, background, and shadow.
|
|
65
|
+
*
|
|
66
|
+
* @status stable
|
|
67
|
+
* @planned apps/web dashboard — settings panels, billing summary, team member tiles.
|
|
68
|
+
* See governance/registry.ts for full allocation record.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```tsx
|
|
72
|
+
* <Card>
|
|
73
|
+
* <p>Card content</p>
|
|
74
|
+
* </Card>
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
declare function Card({ children, isInteractive, className }: CardProps): react_jsx_runtime.JSX.Element;
|
|
78
|
+
|
|
79
|
+
type ContainerSize = "sm" | "md" | "lg" | "xl" | "full";
|
|
80
|
+
interface ContainerProps {
|
|
81
|
+
children: React__default.ReactNode;
|
|
82
|
+
/** Max-width breakpoint */
|
|
83
|
+
size?: ContainerSize;
|
|
84
|
+
className?: string;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Container — centred max-width layout wrapper.
|
|
88
|
+
*
|
|
89
|
+
* @status stable
|
|
90
|
+
* @planned apps/web dashboard — canonical max-width wrapper for all page layouts.
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```tsx
|
|
94
|
+
* <Container size="lg">
|
|
95
|
+
* <p>Page content</p>
|
|
96
|
+
* </Container>
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
declare function Container({ children, size, className }: ContainerProps): react_jsx_runtime.JSX.Element;
|
|
100
|
+
|
|
101
|
+
interface DesignSystemProviderProps {
|
|
102
|
+
children: React__default.ReactNode;
|
|
103
|
+
defaultMode?: ThemeMode;
|
|
104
|
+
storageKey?: string;
|
|
105
|
+
enableSystemPreference?: boolean;
|
|
106
|
+
}
|
|
107
|
+
declare function DesignSystemProvider({ children, defaultMode, storageKey, enableSystemPreference, }: DesignSystemProviderProps): react_jsx_runtime.JSX.Element;
|
|
108
|
+
|
|
109
|
+
type Tone = "default" | "branded" | "subtle";
|
|
110
|
+
type Size = "sm" | "md" | "lg";
|
|
111
|
+
interface EmptyStateProps {
|
|
112
|
+
/** Primary message. */
|
|
113
|
+
title: string;
|
|
114
|
+
/** Supporting description. */
|
|
115
|
+
description?: string;
|
|
116
|
+
/** Visual anchor. When omitted and `tone="branded"`, a default `<BrandMark>` is rendered. */
|
|
117
|
+
mascot?: ReactNode;
|
|
118
|
+
/** Inline icon shown above the title. Ignored when `mascot` is provided. */
|
|
119
|
+
icon?: ReactNode;
|
|
120
|
+
/** Primary call-to-action node. */
|
|
121
|
+
action?: ReactNode;
|
|
122
|
+
/** Secondary call-to-action node. */
|
|
123
|
+
secondaryAction?: ReactNode;
|
|
124
|
+
/**
|
|
125
|
+
* Visual tone.
|
|
126
|
+
* - `default`: neutral bordered state
|
|
127
|
+
* - `branded`: BrandMark anchor for first-touch panels
|
|
128
|
+
* - `subtle`: quieter inline state
|
|
129
|
+
*/
|
|
130
|
+
tone?: Tone;
|
|
131
|
+
/** Size variant. */
|
|
132
|
+
size?: Size;
|
|
133
|
+
/** Extra classes for the root element. */
|
|
134
|
+
className?: string;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* EmptyState — layout-compatible wrapper around the canonical compound
|
|
138
|
+
* primitive. New composition work should prefer `EmptyState.Root` from
|
|
139
|
+
* `@nebutra/ui/primitives`; product layout code can keep this simpler API.
|
|
140
|
+
*/
|
|
141
|
+
declare function EmptyState({ title, description, mascot, icon, action, secondaryAction, tone, size, className, }: EmptyStateProps): react_jsx_runtime.JSX.Element;
|
|
142
|
+
|
|
143
|
+
interface ErrorStateProps {
|
|
144
|
+
/** Error title */
|
|
145
|
+
title?: string;
|
|
146
|
+
/** Error detail or message */
|
|
147
|
+
message?: string;
|
|
148
|
+
/** Optional retry callback */
|
|
149
|
+
onRetry?: () => void;
|
|
150
|
+
/** Stable request, trace, deployment, or run identifier */
|
|
151
|
+
errorId?: string;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* ErrorState — inline error display with optional retry action.
|
|
155
|
+
*
|
|
156
|
+
* @status stable
|
|
157
|
+
* @planned apps/web dashboard — React Error Boundary fallback, failed fetch/mutation states.
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* ```tsx
|
|
161
|
+
* <ErrorState
|
|
162
|
+
* title="Failed to load projects"
|
|
163
|
+
* message={error.message}
|
|
164
|
+
* onRetry={refetch}
|
|
165
|
+
* />
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
168
|
+
declare function ErrorState({ title, message, onRetry, errorId, }: ErrorStateProps): react_jsx_runtime.JSX.Element;
|
|
169
|
+
|
|
170
|
+
interface FullPageStatusAction {
|
|
171
|
+
label: string;
|
|
172
|
+
/** Either href (renders <Link>) or onClick (renders <button>). */
|
|
173
|
+
href?: string;
|
|
174
|
+
onClick?: () => void;
|
|
175
|
+
}
|
|
176
|
+
interface FullPageStatusMeta {
|
|
177
|
+
/** e.g. "Error ID: abc123" — rendered monospace, muted. */
|
|
178
|
+
errorId?: string;
|
|
179
|
+
/** e.g. "status.nebutra.com" — rendered as link if `statusUrl` provided. */
|
|
180
|
+
statusUrl?: string;
|
|
181
|
+
}
|
|
182
|
+
interface FullPageStatusProps {
|
|
183
|
+
/** Eyebrow label, e.g. "Error 404" / "Error 500". Rendered monospace, uppercase. */
|
|
184
|
+
code: string;
|
|
185
|
+
/** Headline. Keep it direct; use Accent only for subtle neutral emphasis. */
|
|
186
|
+
title: ReactNode;
|
|
187
|
+
/** Single-sentence subcopy. */
|
|
188
|
+
description: string;
|
|
189
|
+
/** Primary CTA (filled neutral ink). */
|
|
190
|
+
primaryAction: FullPageStatusAction;
|
|
191
|
+
/** Secondary CTA (outlined). Optional. */
|
|
192
|
+
secondaryAction?: FullPageStatusAction;
|
|
193
|
+
/** Optional footer metadata: error ID + status page link. */
|
|
194
|
+
meta?: FullPageStatusMeta;
|
|
195
|
+
/**
|
|
196
|
+
* Layout variant.
|
|
197
|
+
* - `"viewport"` (default): full-viewport takeover with bg — for not-found.tsx / global-error.
|
|
198
|
+
* - `"section"`: in-segment, no bg, ~60vh min height — for segment `error.tsx` inside a layout.
|
|
199
|
+
*/
|
|
200
|
+
variant?: "viewport" | "section";
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* FullPageStatus — restrained full-page status template for 404, 500, and other
|
|
204
|
+
* authenticated error/not-found states that live inside the root layout.
|
|
205
|
+
*
|
|
206
|
+
* Pattern: monospace eyebrow → headline → subcopy → primary + optional secondary CTA →
|
|
207
|
+
* optional monospace error ID + status link footer. Linear/Vercel/Stripe convention.
|
|
208
|
+
*
|
|
209
|
+
* NOT for `global-error.tsx` — that renders outside root layout and cannot consume
|
|
210
|
+
* CSS variables or Tailwind. Keep that file standalone with inline styles.
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* ```tsx
|
|
214
|
+
* <FullPageStatus
|
|
215
|
+
* code="Error 404"
|
|
216
|
+
* title={<>We couldn't find that page.</>}
|
|
217
|
+
* description="The page you're looking for doesn't exist or has been moved."
|
|
218
|
+
* primaryAction={{ label: "Go to dashboard", href: "/" }}
|
|
219
|
+
* secondaryAction={{ label: "Open docs", href: "/docs" }}
|
|
220
|
+
* />
|
|
221
|
+
* ```
|
|
222
|
+
*/
|
|
223
|
+
declare function FullPageStatus({ code, title, description, primaryAction, secondaryAction, meta, variant, }: FullPageStatusProps): react_jsx_runtime.JSX.Element;
|
|
224
|
+
declare namespace FullPageStatus {
|
|
225
|
+
var Accent: ({ children }: {
|
|
226
|
+
children: ReactNode;
|
|
227
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
interface LoadingStateProps {
|
|
231
|
+
/** Optional message shown below the spinner */
|
|
232
|
+
message?: string;
|
|
233
|
+
/** Size of the spinner */
|
|
234
|
+
size?: "small" | "medium" | "large";
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* LoadingState — centred spinner for async content loading.
|
|
238
|
+
*
|
|
239
|
+
* @status stable
|
|
240
|
+
* @planned apps/web dashboard — React Suspense fallback boundaries for async data routes.
|
|
241
|
+
*
|
|
242
|
+
* @example
|
|
243
|
+
* ```tsx
|
|
244
|
+
* <LoadingState message="Fetching projects…" />
|
|
245
|
+
* ```
|
|
246
|
+
*/
|
|
247
|
+
declare function LoadingState({ message, size }: LoadingStateProps): react_jsx_runtime.JSX.Element;
|
|
248
|
+
|
|
249
|
+
interface PageHeaderProps {
|
|
250
|
+
/** Page title */
|
|
251
|
+
title: string;
|
|
252
|
+
/** Optional subtitle or description */
|
|
253
|
+
description?: string;
|
|
254
|
+
/** Optional action slot (e.g. a Button) */
|
|
255
|
+
actions?: React__default.ReactNode;
|
|
256
|
+
className?: string;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* PageHeader — standardised top-of-page title + description + actions row.
|
|
260
|
+
*
|
|
261
|
+
* @status stable
|
|
262
|
+
* @planned apps/web dashboard — every dashboard page top area (Settings, Billing, Team, Logs, etc.).
|
|
263
|
+
*
|
|
264
|
+
* @example
|
|
265
|
+
* ```tsx
|
|
266
|
+
* <PageHeader
|
|
267
|
+
* title="Team Settings"
|
|
268
|
+
* description="Manage your team members and permissions."
|
|
269
|
+
* actions={<button>Invite member</button>}
|
|
270
|
+
* />
|
|
271
|
+
* ```
|
|
272
|
+
*/
|
|
273
|
+
declare function PageHeader({ title, description, actions, className }: PageHeaderProps): react_jsx_runtime.JSX.Element;
|
|
274
|
+
|
|
275
|
+
interface SectionProps {
|
|
276
|
+
children: React__default.ReactNode;
|
|
277
|
+
/** Optional semantic section label (aria-label) */
|
|
278
|
+
label?: string;
|
|
279
|
+
className?: string;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Section — semantic page section with vertical spacing.
|
|
283
|
+
*
|
|
284
|
+
* @status stable
|
|
285
|
+
* @planned apps/web dashboard — semantic grouping of dashboard page content with aria-label.
|
|
286
|
+
*
|
|
287
|
+
* @example
|
|
288
|
+
* ```tsx
|
|
289
|
+
* <Section label="Features">
|
|
290
|
+
* <FeatureGrid />
|
|
291
|
+
* </Section>
|
|
292
|
+
* ```
|
|
293
|
+
*/
|
|
294
|
+
declare function Section({ children, label, className }: SectionProps): react_jsx_runtime.JSX.Element;
|
|
295
|
+
|
|
296
|
+
export { AppShell, type AppShellProps, Card, type CardProps, Container, type ContainerProps, type ContainerSize, DesignSystemProvider, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, FullPageStatus, type FullPageStatusAction, type FullPageStatusMeta, type FullPageStatusProps, LoadingState, type LoadingStateProps, PageHeader, type PageHeaderProps, Section, type SectionProps };
|