@yuhuanowo/yunui 0.1.4
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/LICENSE +201 -0
- package/README.md +104 -0
- package/dist/adapters.d.ts +46 -0
- package/dist/adapters.js +4 -0
- package/dist/adapters.js.map +1 -0
- package/dist/ai.d.ts +192 -0
- package/dist/ai.js +1013 -0
- package/dist/ai.js.map +1 -0
- package/dist/chunk-DRZ7UCRU.js +85 -0
- package/dist/chunk-DRZ7UCRU.js.map +1 -0
- package/dist/chunk-OHIFY64L.js +1839 -0
- package/dist/chunk-OHIFY64L.js.map +1 -0
- package/dist/chunk-WASCOOVD.js +29 -0
- package/dist/chunk-WASCOOVD.js.map +1 -0
- package/dist/chunk-XZGNL5A6.js +66 -0
- package/dist/chunk-XZGNL5A6.js.map +1 -0
- package/dist/index.d.ts +510 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/patterns.d.ts +311 -0
- package/dist/patterns.js +1031 -0
- package/dist/patterns.js.map +1 -0
- package/package.json +77 -0
- package/styles/yunui.css +2251 -0
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import React__default, { ElementType, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
declare function BackgroundEffects(): React$1.JSX.Element;
|
|
5
|
+
|
|
6
|
+
declare function CodeDemo(): React$1.JSX.Element;
|
|
7
|
+
|
|
8
|
+
interface FAQItem {
|
|
9
|
+
question: string;
|
|
10
|
+
answer: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
interface FAQProps {
|
|
13
|
+
/** The questions to render. The host app supplies (and translates) these. */
|
|
14
|
+
items: FAQItem[];
|
|
15
|
+
/** Which item starts expanded (default: first). Pass null for all collapsed. */
|
|
16
|
+
defaultOpenIndex?: number | null;
|
|
17
|
+
}
|
|
18
|
+
declare function FAQ({ items, defaultOpenIndex }: FAQProps): React$1.JSX.Element;
|
|
19
|
+
|
|
20
|
+
interface Tab {
|
|
21
|
+
id: string;
|
|
22
|
+
label: string;
|
|
23
|
+
code: string;
|
|
24
|
+
language?: string;
|
|
25
|
+
}
|
|
26
|
+
interface CodeBlockProps {
|
|
27
|
+
code: string;
|
|
28
|
+
language?: string;
|
|
29
|
+
filename?: string;
|
|
30
|
+
showLineNumbers?: boolean;
|
|
31
|
+
copyable?: boolean;
|
|
32
|
+
className?: string;
|
|
33
|
+
tabs?: Tab[];
|
|
34
|
+
}
|
|
35
|
+
declare function CodeBlock({ code, language, filename, showLineNumbers, copyable, className, tabs, }: CodeBlockProps): React$1.JSX.Element;
|
|
36
|
+
|
|
37
|
+
declare function LLMCopyButton({ markdownUrl }: {
|
|
38
|
+
markdownUrl: string;
|
|
39
|
+
}): React$1.JSX.Element;
|
|
40
|
+
declare function ViewOptions({ markdownUrl, githubUrl, }: {
|
|
41
|
+
markdownUrl: string;
|
|
42
|
+
githubUrl?: string;
|
|
43
|
+
}): React$1.JSX.Element;
|
|
44
|
+
|
|
45
|
+
interface BlogCardProps {
|
|
46
|
+
title: string;
|
|
47
|
+
description?: string;
|
|
48
|
+
date?: string;
|
|
49
|
+
author?: {
|
|
50
|
+
name?: string;
|
|
51
|
+
avatar?: string;
|
|
52
|
+
url?: string;
|
|
53
|
+
};
|
|
54
|
+
category?: string;
|
|
55
|
+
tags?: string[];
|
|
56
|
+
readingTime?: number;
|
|
57
|
+
coverImage?: string;
|
|
58
|
+
url: string;
|
|
59
|
+
variant?: "default" | "featured";
|
|
60
|
+
/** Locale for the date; defaults to a stable "en-US" (SSR-safe). */
|
|
61
|
+
locale?: string;
|
|
62
|
+
}
|
|
63
|
+
declare function BlogCard({ title, description, date, author, category, tags, readingTime, coverImage, url, variant, locale, }: BlogCardProps): React$1.JSX.Element;
|
|
64
|
+
|
|
65
|
+
interface BlogPostHeaderProps {
|
|
66
|
+
title: string;
|
|
67
|
+
description?: string;
|
|
68
|
+
date?: string;
|
|
69
|
+
author?: {
|
|
70
|
+
name?: string;
|
|
71
|
+
avatar?: string;
|
|
72
|
+
url?: string;
|
|
73
|
+
};
|
|
74
|
+
category?: string;
|
|
75
|
+
tags?: string[];
|
|
76
|
+
readingTime?: number;
|
|
77
|
+
coverImage?: string;
|
|
78
|
+
}
|
|
79
|
+
declare function BlogPostHeader({ title, description, date, author, category, tags, readingTime, coverImage, }: BlogPostHeaderProps): React$1.JSX.Element;
|
|
80
|
+
|
|
81
|
+
interface BlogPaginationProps {
|
|
82
|
+
currentPage: number;
|
|
83
|
+
totalPages: number;
|
|
84
|
+
/** Navigate to a page. The host app owns routing / query-string updates. */
|
|
85
|
+
onPageChange: (page: number) => void;
|
|
86
|
+
/** Localized labels; default to English. */
|
|
87
|
+
labels?: {
|
|
88
|
+
previous?: string;
|
|
89
|
+
next?: string;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
declare function BlogPagination({ currentPage, totalPages, onPageChange, labels, }: BlogPaginationProps): React$1.JSX.Element | null;
|
|
93
|
+
|
|
94
|
+
interface CategoryFilterProps {
|
|
95
|
+
categories: string[];
|
|
96
|
+
selectedCategory?: string;
|
|
97
|
+
/** Called with the chosen category, or null for "all". Host owns routing. */
|
|
98
|
+
onSelect: (category: string | null) => void;
|
|
99
|
+
/** Localized label for the "all posts" button; defaults to English. */
|
|
100
|
+
allLabel?: string;
|
|
101
|
+
}
|
|
102
|
+
declare function CategoryFilter({ categories, selectedCategory, onSelect, allLabel, }: CategoryFilterProps): React$1.JSX.Element;
|
|
103
|
+
|
|
104
|
+
interface SidebarNavItem {
|
|
105
|
+
label: string;
|
|
106
|
+
href: string;
|
|
107
|
+
icon?: ElementType;
|
|
108
|
+
/** Extra path prefixes that should also mark this item active. */
|
|
109
|
+
match?: string[];
|
|
110
|
+
}
|
|
111
|
+
interface SidebarSection {
|
|
112
|
+
title?: string;
|
|
113
|
+
items: SidebarNavItem[];
|
|
114
|
+
}
|
|
115
|
+
interface SidebarProps {
|
|
116
|
+
appName: string;
|
|
117
|
+
logoSrc?: string;
|
|
118
|
+
homeHref?: string;
|
|
119
|
+
sections: SidebarSection[];
|
|
120
|
+
/** Used to compute the active item. */
|
|
121
|
+
currentPath?: string;
|
|
122
|
+
/** Mobile drawer open state. */
|
|
123
|
+
isOpen?: boolean;
|
|
124
|
+
onClose?: () => void;
|
|
125
|
+
/** Desktop collapse state (hides the sidebar off-canvas). */
|
|
126
|
+
collapsed?: boolean;
|
|
127
|
+
onToggleCollapse?: () => void;
|
|
128
|
+
/**
|
|
129
|
+
* Called when a nav item is clicked. When provided, default link navigation
|
|
130
|
+
* is prevented and the host owns routing (useful in SPAs / demos). When
|
|
131
|
+
* omitted, items navigate via the injected Link adapter.
|
|
132
|
+
*/
|
|
133
|
+
onNavigate?: (href: string) => void;
|
|
134
|
+
/** Bottom-pinned slot (balance card, user card, etc.). */
|
|
135
|
+
footer?: ReactNode;
|
|
136
|
+
closeLabel?: string;
|
|
137
|
+
/** While true, the nav (and footer slot) render shimmer skeletons. */
|
|
138
|
+
loading?: boolean;
|
|
139
|
+
/** sessionStorage key for persisting nav scroll position across navigations. */
|
|
140
|
+
scrollStorageKey?: string;
|
|
141
|
+
}
|
|
142
|
+
declare function Sidebar({ appName, logoSrc, homeHref, sections, currentPath, isOpen, onClose, collapsed, onToggleCollapse, onNavigate, footer, closeLabel, loading, scrollStorageKey, }: SidebarProps): React$1.JSX.Element;
|
|
143
|
+
|
|
144
|
+
interface PageHeaderProps {
|
|
145
|
+
title: string;
|
|
146
|
+
description?: string;
|
|
147
|
+
actions?: ReactNode;
|
|
148
|
+
className?: string;
|
|
149
|
+
}
|
|
150
|
+
declare function PageHeader({ title, description, actions, className }: PageHeaderProps): React$1.JSX.Element;
|
|
151
|
+
|
|
152
|
+
interface PageLoadingStateProps {
|
|
153
|
+
message?: string;
|
|
154
|
+
}
|
|
155
|
+
declare function PageLoadingState({ message }: PageLoadingStateProps): React$1.JSX.Element;
|
|
156
|
+
interface PageErrorStateProps {
|
|
157
|
+
message: string;
|
|
158
|
+
onRetry?: () => void;
|
|
159
|
+
retryLabel?: string;
|
|
160
|
+
}
|
|
161
|
+
declare function PageErrorState({ message, onRetry, retryLabel }: PageErrorStateProps): React$1.JSX.Element;
|
|
162
|
+
interface PageEmptyStateProps {
|
|
163
|
+
icon?: ElementType;
|
|
164
|
+
title: string;
|
|
165
|
+
description?: string;
|
|
166
|
+
action?: ReactNode;
|
|
167
|
+
}
|
|
168
|
+
declare function PageEmptyState({ icon: Icon, title, description, action }: PageEmptyStateProps): React$1.JSX.Element;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Canonical dashboard stat card — the single source for every metric tile.
|
|
172
|
+
* Structure is the dashboard overview card; `tone` provides semantic color
|
|
173
|
+
* (amber=pending, red=rejected, …); icon/trend/subtext/delay are all optional
|
|
174
|
+
* so compact colored tiles and rich trend cards share one component.
|
|
175
|
+
*/
|
|
176
|
+
declare const TONES: Record<string, {
|
|
177
|
+
card: string;
|
|
178
|
+
value: string;
|
|
179
|
+
}>;
|
|
180
|
+
interface StatCardProps {
|
|
181
|
+
icon?: ElementType;
|
|
182
|
+
label: string;
|
|
183
|
+
value: ReactNode;
|
|
184
|
+
subtext?: ReactNode;
|
|
185
|
+
trend?: {
|
|
186
|
+
value: number;
|
|
187
|
+
positive: boolean;
|
|
188
|
+
};
|
|
189
|
+
/** Semantic color tint for the card + value (amber/emerald/blue/red/purple). */
|
|
190
|
+
tone?: keyof typeof TONES | string;
|
|
191
|
+
/** Stagger entrance delay in ms. */
|
|
192
|
+
delay?: number;
|
|
193
|
+
/** Compact layout: icon + label on one row, value below (admin insights style). */
|
|
194
|
+
inline?: boolean;
|
|
195
|
+
/** Value-first layout: big number on top, label beneath (analytics / admin stats style). */
|
|
196
|
+
valueFirst?: boolean;
|
|
197
|
+
className?: string;
|
|
198
|
+
}
|
|
199
|
+
declare function StatCard({ icon: Icon, label, value, subtext, trend, tone, delay, inline, valueFirst, className }: StatCardProps): React$1.JSX.Element;
|
|
200
|
+
|
|
201
|
+
interface FellowsBannerProps {
|
|
202
|
+
title: string;
|
|
203
|
+
description: string;
|
|
204
|
+
ctaText: string;
|
|
205
|
+
/** Pre-resolved feature labels, rendered as a "·"-joined list. */
|
|
206
|
+
features?: string[];
|
|
207
|
+
href?: string;
|
|
208
|
+
className?: string;
|
|
209
|
+
}
|
|
210
|
+
declare function FellowsBanner({ title, description, ctaText, features, href, className, }: FellowsBannerProps): React$1.JSX.Element;
|
|
211
|
+
|
|
212
|
+
interface ErrorBoundaryLabels {
|
|
213
|
+
title?: string;
|
|
214
|
+
message?: string;
|
|
215
|
+
retry?: string;
|
|
216
|
+
}
|
|
217
|
+
interface ErrorBoundaryProps {
|
|
218
|
+
children: React__default.ReactNode;
|
|
219
|
+
fallback?: React__default.ReactNode;
|
|
220
|
+
/** Override the default English copy. */
|
|
221
|
+
labels?: ErrorBoundaryLabels;
|
|
222
|
+
/** Notified when an error is caught (e.g. for logging). */
|
|
223
|
+
onError?: (error: Error, info: React__default.ErrorInfo) => void;
|
|
224
|
+
}
|
|
225
|
+
interface ErrorBoundaryState {
|
|
226
|
+
hasError: boolean;
|
|
227
|
+
error: Error | null;
|
|
228
|
+
}
|
|
229
|
+
declare class ErrorBoundary extends React__default.Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
230
|
+
constructor(props: ErrorBoundaryProps);
|
|
231
|
+
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
232
|
+
componentDidCatch(error: Error, errorInfo: React__default.ErrorInfo): void;
|
|
233
|
+
handleRetry: () => void;
|
|
234
|
+
render(): string | number | bigint | boolean | React__default.JSX.Element | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | null | undefined;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Card for terminal "your account is locked" auth screens (banned / suspended).
|
|
239
|
+
* Presentational only — the host owns the logout/redirect behind `onBack`.
|
|
240
|
+
*/
|
|
241
|
+
interface AccountLockedCardProps {
|
|
242
|
+
appName: string;
|
|
243
|
+
logoSrc?: string;
|
|
244
|
+
icon: ReactNode;
|
|
245
|
+
title: string;
|
|
246
|
+
subtitle: string;
|
|
247
|
+
appeal: string;
|
|
248
|
+
backLabel: string;
|
|
249
|
+
onBack: () => void;
|
|
250
|
+
/**
|
|
251
|
+
* Run once on mount. Yunxin uses this to drop the (now-useless) session via
|
|
252
|
+
* api.logout() so background auth probes can't bounce the user back into a
|
|
253
|
+
* loop on these terminal screens.
|
|
254
|
+
*/
|
|
255
|
+
onMount?: () => void;
|
|
256
|
+
loading?: boolean;
|
|
257
|
+
children?: ReactNode;
|
|
258
|
+
}
|
|
259
|
+
declare function AccountLockedCard({ appName, logoSrc, icon, title, subtitle, appeal, backLabel, onBack, onMount, loading, children, }: AccountLockedCardProps): React$1.JSX.Element;
|
|
260
|
+
|
|
261
|
+
interface MediaPageHeaderProps {
|
|
262
|
+
title: string;
|
|
263
|
+
description: string;
|
|
264
|
+
isSyncing: boolean;
|
|
265
|
+
syncError: string | null;
|
|
266
|
+
onSync: () => void;
|
|
267
|
+
stats?: {
|
|
268
|
+
label: string;
|
|
269
|
+
value: string | number;
|
|
270
|
+
}[];
|
|
271
|
+
}
|
|
272
|
+
declare function MediaPageHeader({ title, description, isSyncing, syncError, onSync, stats }: MediaPageHeaderProps): React$1.JSX.Element;
|
|
273
|
+
interface MediaEmptyStateProps {
|
|
274
|
+
icon: ElementType;
|
|
275
|
+
title: string;
|
|
276
|
+
description: string;
|
|
277
|
+
action?: ReactNode;
|
|
278
|
+
}
|
|
279
|
+
declare function MediaEmptyState({ icon: Icon, title, description, action }: MediaEmptyStateProps): React$1.JSX.Element;
|
|
280
|
+
declare function MediaLoadingState({ message }: {
|
|
281
|
+
message?: string;
|
|
282
|
+
}): React$1.JSX.Element;
|
|
283
|
+
declare function MediaErrorState({ message, onRetry }: {
|
|
284
|
+
message: string;
|
|
285
|
+
onRetry?: () => void;
|
|
286
|
+
}): React$1.JSX.Element;
|
|
287
|
+
|
|
288
|
+
declare function FellowBadge({ variant, className }: {
|
|
289
|
+
variant?: "inline" | "pill";
|
|
290
|
+
className?: string;
|
|
291
|
+
}): React$1.JSX.Element;
|
|
292
|
+
declare function CapabilityBadge({ capability, short }: {
|
|
293
|
+
capability: string;
|
|
294
|
+
short?: boolean;
|
|
295
|
+
}): React$1.JSX.Element | null;
|
|
296
|
+
declare function StatusBadge({ status, size }: {
|
|
297
|
+
status: string;
|
|
298
|
+
size?: "sm" | "md";
|
|
299
|
+
}): React$1.JSX.Element | null;
|
|
300
|
+
declare function SourceBadge({ source, showIcon }: {
|
|
301
|
+
source: string;
|
|
302
|
+
showIcon?: boolean;
|
|
303
|
+
}): React$1.JSX.Element | null;
|
|
304
|
+
declare function ActiveBadge({ isActive }: {
|
|
305
|
+
isActive: boolean;
|
|
306
|
+
}): React$1.JSX.Element;
|
|
307
|
+
declare function DeprecatedBadge({ isDeprecated }: {
|
|
308
|
+
isDeprecated: boolean;
|
|
309
|
+
}): React$1.JSX.Element | null;
|
|
310
|
+
|
|
311
|
+
export { AccountLockedCard, type AccountLockedCardProps, ActiveBadge, BackgroundEffects, BlogCard, BlogPagination, BlogPostHeader, CapabilityBadge, CategoryFilter, CodeBlock, CodeDemo, DeprecatedBadge, ErrorBoundary, type ErrorBoundaryLabels, FAQ, type FAQItem, type FAQProps, FellowBadge, FellowsBanner, type FellowsBannerProps, LLMCopyButton, MediaEmptyState, MediaErrorState, MediaLoadingState, MediaPageHeader, PageEmptyState, PageErrorState, PageHeader, PageLoadingState, Sidebar, type SidebarNavItem, type SidebarProps, type SidebarSection, SourceBadge, StatCard, StatusBadge, ViewOptions };
|