@yuhuanowo/yunui 0.1.7 → 0.2.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 +22 -5
- package/dist/ai.d.ts +61 -2
- package/dist/ai.js +1 -1
- package/dist/ai.js.map +1 -1
- package/dist/{chunk-ORS36OUN.js → chunk-N7JHOWGR.js} +2 -2
- package/dist/chunk-N7JHOWGR.js.map +1 -0
- package/dist/{chunk-FYXF43G3.js → chunk-YRITK7CC.js} +556 -38
- package/dist/chunk-YRITK7CC.js.map +1 -0
- package/dist/index.d.ts +365 -4
- package/dist/index.js +2 -2
- package/dist/patterns.d.ts +68 -0
- package/dist/patterns.js +5 -5
- package/dist/patterns.js.map +1 -1
- package/package.json +5 -3
- package/dist/chunk-FYXF43G3.js.map +0 -1
- package/dist/chunk-ORS36OUN.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { AnimatedNumber, Avatar, AvatarFallback, AvatarImage, Badge, BentoCard, BentoGrid, Button, Card, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ConfirmModal, CustomSelect, DeleteConfirmModal, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, IconButton, Input, Label, Marquee, Modal, MotionDiv, MotionSpan, NavTabs, PageLoader, Popover, PopoverClose, PopoverContent, PopoverTrigger, Progress, RegenerateConfirmModal, SegmentedSelect, Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue, Sheet, ShinyButton, Skeleton, Slider, Spinner, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, fadeIn, staggerContainer, staggerItem, toast, useBodyScrollLock, useEscapeKey, useModalBehavior } from './chunk-
|
|
3
|
-
export { ThemeToggle, cn } from './chunk-
|
|
2
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AnimatedNumber, Avatar, AvatarFallback, AvatarImage, Badge, BentoCard, BentoGrid, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Column, Combobox, ConfirmModal, CustomSelect, DeleteConfirmModal, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, Flex, Grid, IconButton, Input, Label, Marquee, Modal, MotionDiv, MotionSpan, NavTabs, PageLoader, Pagination, Popover, PopoverClose, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, RegenerateConfirmModal, Row, SegmentedSelect, Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue, Sheet, ShinyButton, Skeleton, Slider, Spinner, Stack, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TableBody as Tbody, TableCell as Td, Textarea, TableFooter as Tfoot, TableHead as Th, TableHeader as Thead, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TableRow as Tr, fadeIn, staggerContainer, staggerItem, toast, useBodyScrollLock, useEscapeKey, useModalBehavior } from './chunk-YRITK7CC.js';
|
|
3
|
+
export { ThemeToggle, cn } from './chunk-N7JHOWGR.js';
|
|
4
4
|
import './chunk-T37N6OZA.js';
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/dist/patterns.d.ts
CHANGED
|
@@ -6,7 +6,9 @@ declare function BackgroundEffects(): React$1.JSX.Element;
|
|
|
6
6
|
declare function CodeDemo(): React$1.JSX.Element;
|
|
7
7
|
|
|
8
8
|
interface FAQItem {
|
|
9
|
+
/** The question heading. */
|
|
9
10
|
question: string;
|
|
11
|
+
/** The answer content (revealed when expanded). */
|
|
10
12
|
answer: React.ReactNode;
|
|
11
13
|
}
|
|
12
14
|
interface FAQProps {
|
|
@@ -15,23 +17,35 @@ interface FAQProps {
|
|
|
15
17
|
/** Which item starts expanded (default: first). Pass null for all collapsed. */
|
|
16
18
|
defaultOpenIndex?: number | null;
|
|
17
19
|
}
|
|
20
|
+
/** Accordion list of questions where one item expands at a time. */
|
|
18
21
|
declare function FAQ({ items, defaultOpenIndex }: FAQProps): React$1.JSX.Element;
|
|
19
22
|
|
|
20
23
|
interface Tab {
|
|
24
|
+
/** Unique tab id. */
|
|
21
25
|
id: string;
|
|
26
|
+
/** Tab label shown in the header. */
|
|
22
27
|
label: string;
|
|
28
|
+
/** Code shown when this tab is active. */
|
|
23
29
|
code: string;
|
|
30
|
+
/** Language for this tab's code. */
|
|
24
31
|
language?: string;
|
|
25
32
|
}
|
|
26
33
|
interface CodeBlockProps {
|
|
34
|
+
/** The code to display (ignored when `tabs` are provided). */
|
|
27
35
|
code: string;
|
|
36
|
+
/** Language label, also used by the lightweight highlighter. @defaultValue "text" */
|
|
28
37
|
language?: string;
|
|
38
|
+
/** Filename shown in the header instead of the language badge. */
|
|
29
39
|
filename?: string;
|
|
40
|
+
/** Show line numbers in the gutter. @defaultValue true */
|
|
30
41
|
showLineNumbers?: boolean;
|
|
42
|
+
/** Show the copy-to-clipboard button. @defaultValue true */
|
|
31
43
|
copyable?: boolean;
|
|
32
44
|
className?: string;
|
|
45
|
+
/** Render multiple switchable code tabs instead of a single `code` block. */
|
|
33
46
|
tabs?: Tab[];
|
|
34
47
|
}
|
|
48
|
+
/** Styled code block with a window-chrome header, optional tabs, line numbers, basic syntax highlighting, and copy. */
|
|
35
49
|
declare function CodeBlock({ code, language, filename, showLineNumbers, copyable, className, tabs, }: CodeBlockProps): React$1.JSX.Element;
|
|
36
50
|
|
|
37
51
|
declare function LLMCopyButton({ markdownUrl }: {
|
|
@@ -43,23 +57,34 @@ declare function ViewOptions({ markdownUrl, githubUrl, }: {
|
|
|
43
57
|
}): React$1.JSX.Element;
|
|
44
58
|
|
|
45
59
|
interface BlogCardProps {
|
|
60
|
+
/** Post title. */
|
|
46
61
|
title: string;
|
|
62
|
+
/** Short excerpt/summary. */
|
|
47
63
|
description?: string;
|
|
64
|
+
/** Publish date (ISO string); formatted via `locale`. */
|
|
48
65
|
date?: string;
|
|
66
|
+
/** Post author (name shown in the meta row). */
|
|
49
67
|
author?: {
|
|
50
68
|
name?: string;
|
|
51
69
|
avatar?: string;
|
|
52
70
|
url?: string;
|
|
53
71
|
};
|
|
72
|
+
/** Category label shown as an info badge. */
|
|
54
73
|
category?: string;
|
|
74
|
+
/** Tag list (first 3 rendered as clickable chips). */
|
|
55
75
|
tags?: string[];
|
|
76
|
+
/** Estimated reading time in minutes. */
|
|
56
77
|
readingTime?: number;
|
|
78
|
+
/** Cover image URL; a placeholder icon is shown when absent. */
|
|
57
79
|
coverImage?: string;
|
|
80
|
+
/** Destination the card links to. */
|
|
58
81
|
url: string;
|
|
82
|
+
/** Layout: `default` or `featured` (spans 2 columns on `md`+). */
|
|
59
83
|
variant?: "default" | "featured";
|
|
60
84
|
/** Locale for the date; defaults to a stable "en-US" (SSR-safe). */
|
|
61
85
|
locale?: string;
|
|
62
86
|
}
|
|
87
|
+
/** Blog post preview card with cover image, category, meta (date/reading time/author), and tags. */
|
|
63
88
|
declare function BlogCard({ title, description, date, author, category, tags, readingTime, coverImage, url, variant, locale, }: BlogCardProps): React$1.JSX.Element;
|
|
64
89
|
|
|
65
90
|
interface BlogPostHeaderProps {
|
|
@@ -102,28 +127,39 @@ interface CategoryFilterProps {
|
|
|
102
127
|
declare function CategoryFilter({ categories, selectedCategory, onSelect, allLabel, }: CategoryFilterProps): React$1.JSX.Element;
|
|
103
128
|
|
|
104
129
|
interface SidebarNavItem {
|
|
130
|
+
/** Link text. */
|
|
105
131
|
label: string;
|
|
132
|
+
/** Destination href; also the basis for active-state matching. */
|
|
106
133
|
href: string;
|
|
134
|
+
/** Optional leading icon component. */
|
|
107
135
|
icon?: ElementType;
|
|
108
136
|
/** Extra path prefixes that should also mark this item active. */
|
|
109
137
|
match?: string[];
|
|
110
138
|
}
|
|
111
139
|
interface SidebarSection {
|
|
140
|
+
/** Optional section heading. */
|
|
112
141
|
title?: string;
|
|
142
|
+
/** Nav items in this section. */
|
|
113
143
|
items: SidebarNavItem[];
|
|
114
144
|
}
|
|
115
145
|
interface SidebarProps {
|
|
146
|
+
/** Brand name shown next to the logo. */
|
|
116
147
|
appName: string;
|
|
148
|
+
/** Logo image src. @defaultValue "/favicon.ico" */
|
|
117
149
|
logoSrc?: string;
|
|
150
|
+
/** Where the logo links to. @defaultValue "/" */
|
|
118
151
|
homeHref?: string;
|
|
152
|
+
/** Grouped navigation sections. */
|
|
119
153
|
sections: SidebarSection[];
|
|
120
154
|
/** Used to compute the active item. */
|
|
121
155
|
currentPath?: string;
|
|
122
156
|
/** Mobile drawer open state. */
|
|
123
157
|
isOpen?: boolean;
|
|
158
|
+
/** Called to close the mobile drawer. */
|
|
124
159
|
onClose?: () => void;
|
|
125
160
|
/** Desktop collapse state (hides the sidebar off-canvas). */
|
|
126
161
|
collapsed?: boolean;
|
|
162
|
+
/** Called to toggle the desktop collapse state (also renders the collapse button when set). */
|
|
127
163
|
onToggleCollapse?: () => void;
|
|
128
164
|
/**
|
|
129
165
|
* Called when a nav item is clicked. When provided, default link navigation
|
|
@@ -133,12 +169,14 @@ interface SidebarProps {
|
|
|
133
169
|
onNavigate?: (href: string) => void;
|
|
134
170
|
/** Bottom-pinned slot (balance card, user card, etc.). */
|
|
135
171
|
footer?: ReactNode;
|
|
172
|
+
/** Accessible label for the close/collapse buttons. @defaultValue "Close" */
|
|
136
173
|
closeLabel?: string;
|
|
137
174
|
/** While true, the nav (and footer slot) render shimmer skeletons. */
|
|
138
175
|
loading?: boolean;
|
|
139
176
|
/** sessionStorage key for persisting nav scroll position across navigations. */
|
|
140
177
|
scrollStorageKey?: string;
|
|
141
178
|
}
|
|
179
|
+
/** App navigation sidebar: logo, grouped nav sections with active-state matching, a mobile drawer, desktop collapse, and a footer slot. */
|
|
142
180
|
declare function Sidebar({ appName, logoSrc, homeHref, sections, currentPath, isOpen, onClose, collapsed, onToggleCollapse, onNavigate, footer, closeLabel, loading, scrollStorageKey, }: SidebarProps): React$1.JSX.Element;
|
|
143
181
|
|
|
144
182
|
interface PageHeaderProps {
|
|
@@ -150,21 +188,32 @@ interface PageHeaderProps {
|
|
|
150
188
|
declare function PageHeader({ title, description, actions, className }: PageHeaderProps): React$1.JSX.Element;
|
|
151
189
|
|
|
152
190
|
interface PageLoadingStateProps {
|
|
191
|
+
/** Optional text shown beside the spinner. */
|
|
153
192
|
message?: string;
|
|
154
193
|
}
|
|
194
|
+
/** Centered in-page loading state (spinner + optional message). */
|
|
155
195
|
declare function PageLoadingState({ message }: PageLoadingStateProps): React$1.JSX.Element;
|
|
156
196
|
interface PageErrorStateProps {
|
|
197
|
+
/** Error message to display. */
|
|
157
198
|
message: string;
|
|
199
|
+
/** When provided, shows a retry link that calls this. */
|
|
158
200
|
onRetry?: () => void;
|
|
201
|
+
/** Label for the retry link. @defaultValue "Retry" */
|
|
159
202
|
retryLabel?: string;
|
|
160
203
|
}
|
|
204
|
+
/** Centered in-page error state with an optional retry link. */
|
|
161
205
|
declare function PageErrorState({ message, onRetry, retryLabel }: PageErrorStateProps): React$1.JSX.Element;
|
|
162
206
|
interface PageEmptyStateProps {
|
|
207
|
+
/** Optional icon component shown above the title. */
|
|
163
208
|
icon?: ElementType;
|
|
209
|
+
/** Heading text. */
|
|
164
210
|
title: string;
|
|
211
|
+
/** Supporting text below the title. */
|
|
165
212
|
description?: string;
|
|
213
|
+
/** Action slot (e.g. a button) below the text. */
|
|
166
214
|
action?: ReactNode;
|
|
167
215
|
}
|
|
216
|
+
/** Centered in-page empty state with an icon, title, description, and optional action. */
|
|
168
217
|
declare function PageEmptyState({ icon: Icon, title, description, action }: PageEmptyStateProps): React$1.JSX.Element;
|
|
169
218
|
|
|
170
219
|
/**
|
|
@@ -178,10 +227,15 @@ declare const TONES: Record<string, {
|
|
|
178
227
|
value: string;
|
|
179
228
|
}>;
|
|
180
229
|
interface StatCardProps {
|
|
230
|
+
/** Optional leading icon component (e.g. a Lucide icon). */
|
|
181
231
|
icon?: ElementType;
|
|
232
|
+
/** Metric name. */
|
|
182
233
|
label: string;
|
|
234
|
+
/** The metric value (string, number, or node). */
|
|
183
235
|
value: ReactNode;
|
|
236
|
+
/** Optional supporting line under the value. */
|
|
184
237
|
subtext?: ReactNode;
|
|
238
|
+
/** Optional trend indicator: percent `value` plus whether it's `positive` (up/green) or down/red. */
|
|
185
239
|
trend?: {
|
|
186
240
|
value: number;
|
|
187
241
|
positive: boolean;
|
|
@@ -259,27 +313,41 @@ interface AccountLockedCardProps {
|
|
|
259
313
|
declare function AccountLockedCard({ appName, logoSrc, icon, title, subtitle, appeal, backLabel, onBack, onMount, loading, children, }: AccountLockedCardProps): React$1.JSX.Element;
|
|
260
314
|
|
|
261
315
|
interface MediaPageHeaderProps {
|
|
316
|
+
/** Page title. */
|
|
262
317
|
title: string;
|
|
318
|
+
/** Page subtitle/description. */
|
|
263
319
|
description: string;
|
|
320
|
+
/** While true, the sync button spins and is disabled. */
|
|
264
321
|
isSyncing: boolean;
|
|
322
|
+
/** Sync error message; shown in a red banner when non-null. */
|
|
265
323
|
syncError: string | null;
|
|
324
|
+
/** Called when the sync button is clicked. */
|
|
266
325
|
onSync: () => void;
|
|
326
|
+
/** Optional inline stat chips (`label` + `value`) below the header. */
|
|
267
327
|
stats?: {
|
|
268
328
|
label: string;
|
|
269
329
|
value: string | number;
|
|
270
330
|
}[];
|
|
271
331
|
}
|
|
332
|
+
/** Media library page header with a title, description, sync button, error banner, and optional stats. */
|
|
272
333
|
declare function MediaPageHeader({ title, description, isSyncing, syncError, onSync, stats }: MediaPageHeaderProps): React$1.JSX.Element;
|
|
273
334
|
interface MediaEmptyStateProps {
|
|
335
|
+
/** Icon component shown above the title. */
|
|
274
336
|
icon: ElementType;
|
|
337
|
+
/** Heading text. */
|
|
275
338
|
title: string;
|
|
339
|
+
/** Supporting text below the title. */
|
|
276
340
|
description: string;
|
|
341
|
+
/** Action slot (e.g. a button) below the text. */
|
|
277
342
|
action?: ReactNode;
|
|
278
343
|
}
|
|
344
|
+
/** Empty state for media pages (icon, title, description, optional action). */
|
|
279
345
|
declare function MediaEmptyState({ icon: Icon, title, description, action }: MediaEmptyStateProps): React$1.JSX.Element;
|
|
346
|
+
/** Loading state for media pages (spinning sync icon + message, falls back to i18n default). */
|
|
280
347
|
declare function MediaLoadingState({ message }: {
|
|
281
348
|
message?: string;
|
|
282
349
|
}): React$1.JSX.Element;
|
|
350
|
+
/** Error state for media pages with an optional retry button. */
|
|
283
351
|
declare function MediaErrorState({ message, onRetry }: {
|
|
284
352
|
message: string;
|
|
285
353
|
onRetry?: () => void;
|
package/dist/patterns.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Button, Card, Badge, Avatar, AvatarImage, AvatarFallback, IconButton, Spinner } from './chunk-
|
|
2
|
+
import { Button, Card, Badge, Avatar, AvatarImage, AvatarFallback, IconButton, Spinner } from './chunk-YRITK7CC.js';
|
|
3
3
|
import { copyToClipboard } from './chunk-WASCOOVD.js';
|
|
4
|
-
import { cn } from './chunk-
|
|
4
|
+
import { cn } from './chunk-N7JHOWGR.js';
|
|
5
5
|
import { useYunUI } from './chunk-T37N6OZA.js';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
7
|
import React, { useState, useEffect, useCallback, useRef } from 'react';
|
|
@@ -214,7 +214,7 @@ var codeSnippets = {
|
|
|
214
214
|
python: `import openai
|
|
215
215
|
|
|
216
216
|
client = openai.OpenAI(
|
|
217
|
-
base_url="https://api.
|
|
217
|
+
base_url="https://api.example.com/v1",
|
|
218
218
|
api_key="your_api_key"
|
|
219
219
|
)
|
|
220
220
|
|
|
@@ -227,7 +227,7 @@ print(response.choices[0].message.content)`,
|
|
|
227
227
|
javascript: `import OpenAI from 'openai';
|
|
228
228
|
|
|
229
229
|
const client = new OpenAI({
|
|
230
|
-
baseURL: 'https://api.
|
|
230
|
+
baseURL: 'https://api.example.com/v1',
|
|
231
231
|
apiKey: 'your_api_key'
|
|
232
232
|
});
|
|
233
233
|
|
|
@@ -237,7 +237,7 @@ const response = await client.chat.completions.create({
|
|
|
237
237
|
});
|
|
238
238
|
|
|
239
239
|
console.log(response.choices[0].message.content);`,
|
|
240
|
-
curl: `curl https://api.
|
|
240
|
+
curl: `curl https://api.example.com/v1/chat/completions \\
|
|
241
241
|
-H "Authorization: Bearer your_api_key" \\
|
|
242
242
|
-H "Content-Type: application/json" \\
|
|
243
243
|
-d '{
|