@yuhuanowo/yunui 0.2.14 → 0.2.16
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 +19 -1
- package/README.zh-CN.md +17 -1
- package/README.zh-TW.md +17 -1
- package/dist/adapters.js +1 -1
- package/dist/ai.js +142 -103
- package/dist/ai.js.map +1 -1
- package/dist/chat.d.ts +133 -0
- package/dist/chat.js +268 -0
- package/dist/chat.js.map +1 -0
- package/dist/{chunk-U2LNRVMI.js → chunk-3RT24MSH.js} +4 -3
- package/dist/chunk-3RT24MSH.js.map +1 -0
- package/dist/chunk-5E3O6ANF.js +1154 -0
- package/dist/chunk-5E3O6ANF.js.map +1 -0
- package/dist/{chunk-VXFEANVX.js → chunk-5TOGZTAO.js} +333 -875
- package/dist/chunk-5TOGZTAO.js.map +1 -0
- package/dist/chunk-AV5TGEJS.js +54 -0
- package/dist/chunk-AV5TGEJS.js.map +1 -0
- package/dist/{chunk-GHO4RCDR.js → chunk-GSPJ5YI6.js} +57 -28
- package/dist/chunk-GSPJ5YI6.js.map +1 -0
- package/dist/chunk-QEIBYOG2.js +188 -0
- package/dist/chunk-QEIBYOG2.js.map +1 -0
- package/dist/{chunk-N53PNMPJ.js → chunk-UYYG4XDW.js} +3 -3
- package/dist/{chunk-N53PNMPJ.js.map → chunk-UYYG4XDW.js.map} +1 -1
- package/dist/content.d.ts +144 -0
- package/dist/content.js +890 -0
- package/dist/content.js.map +1 -0
- package/dist/index.d.ts +273 -6
- package/dist/index.js +5 -3
- package/dist/patterns.d.ts +107 -1
- package/dist/patterns.js +463 -10
- package/dist/patterns.js.map +1 -1
- package/package.json +77 -5
- package/styles/content.css +129 -0
- package/styles/tokens.css +704 -352
- package/styles/yunui.css +126 -4
- package/dist/chunk-GHO4RCDR.js.map +0 -1
- package/dist/chunk-U2LNRVMI.js.map +0 -1
- package/dist/chunk-VXFEANVX.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
# YunUI
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@yuhuanowo/yunui)
|
|
4
|
+
[](https://ui.yuhuanstudio.com)
|
|
4
5
|
|
|
5
6
|
**English** · [简体中文](./README.zh-CN.md) · [繁體中文](./README.zh-TW.md)
|
|
6
7
|
|
|
7
|
-
A standalone, versioned
|
|
8
|
+
A standalone, versioned React 19 + Tailwind v4 design system that doesn't shout — every detail quietly considered.
|
|
9
|
+
|
|
10
|
+
🔗 **Live showcase & docs → [ui.yuhuanstudio.com](https://ui.yuhuanstudio.com)**
|
|
11
|
+
|
|
12
|
+
<p align="center">
|
|
13
|
+
<a href="https://ui.yuhuanstudio.com"><img src="https://raw.githubusercontent.com/YuhuanStudio/YunUI/main/assets/hero-light.png" alt="YunUI — quietly beautiful, quietly engineered" width="100%"></a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<img src="https://raw.githubusercontent.com/YuhuanStudio/YunUI/main/assets/showcase-light.png" alt="Every YunUI component on one page" width="49%">
|
|
18
|
+
<img src="https://raw.githubusercontent.com/YuhuanStudio/YunUI/main/assets/hero-dark.png" alt="YunUI in the true-black theme" width="49%">
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
<p align="center">
|
|
22
|
+
<img src="https://raw.githubusercontent.com/YuhuanStudio/YunUI/main/assets/theming.png" alt="Live theming — 12 multi-color presets, 24 OKLCH palettes, token-driven effects" width="100%">
|
|
23
|
+
</p>
|
|
8
24
|
|
|
9
25
|
Edit YunUI once → publish a new version → every project picks up the same **design tokens, animations, and components** on its next upgrade (`pnpm up`). Already running in production at Yunxin.
|
|
10
26
|
|
|
@@ -96,6 +112,8 @@ Without a provider, YunUI uses zero-dependency defaults (`<a>` / `<img>` / ident
|
|
|
96
112
|
| `@yuhuanowo/yunui/adapters` | `YunUIProvider` / `useYunUI` and the adapter interfaces |
|
|
97
113
|
| `@yuhuanowo/yunui/patterns` | Page-level components: FAQ, StatCard (`tone` / `inline` / `valueFirst` variants), BlogCard, CodeBlock, Sidebar, PageHeader, BackgroundEffects, and more |
|
|
98
114
|
| `@yuhuanowo/yunui/ai` | AI product-domain components (prop-driven, no direct API calls): ProviderIcon / ModelIcon / ModelTypeIcon, ModelCard, CapabilitySelector, Navbar, Footer, LanguageSwitcher, ThinkingBlock, IDBadge, … |
|
|
115
|
+
| `@yuhuanowo/yunui/content` | Content-rendering stack: `MarkdownRenderer` (GFM + KaTeX + Shiki + Mermaid + callouts + lazy zoomable images), `CodeBlock` / `InlineCode`, `CalloutBlock`, `MathRenderer`, `MermaidDiagram`, `ContentImage`, `ImageLightbox`. Heavy engines are **optional peer deps** (Shiki/Mermaid load on demand). Also import `@yuhuanowo/yunui/content.css` + `katex/dist/katex.min.css` |
|
|
116
|
+
| `@yuhuanowo/yunui/chat` | Slot-based chat UI blocks (presentational, no data types): `ChatMessage`, `ChatMessageList` (stick-to-bottom), `ChatComposer`, `ChatHeader`. Pairs with `@yuhuanowo/yunui/content` |
|
|
99
117
|
|
|
100
118
|
**Utilities / hooks** (exported from `@yuhuanowo/yunui`): `cn`, `toast` / `Toaster` (sonner-based), `MotionDiv` / `MotionSpan` / `fadeIn` / `staggerContainer` / `staggerItem`, `useEscapeKey` / `useBodyScrollLock` / `useModalBehavior`.
|
|
101
119
|
|
package/README.zh-CN.md
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
# YunUI
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@yuhuanowo/yunui)
|
|
4
|
+
[](https://ui.yuhuanstudio.com)
|
|
4
5
|
|
|
5
6
|
[English](./README.md) · **简体中文** · [繁體中文](./README.zh-TW.md)
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
一套不喧哗的 React 19 + Tailwind v4 设计系统 —— 每个细节都被好好想过。
|
|
9
|
+
|
|
10
|
+
🔗 **在线展示与文档 → [ui.yuhuanstudio.com](https://ui.yuhuanstudio.com)**
|
|
11
|
+
|
|
12
|
+
<p align="center">
|
|
13
|
+
<a href="https://ui.yuhuanstudio.com"><img src="https://raw.githubusercontent.com/YuhuanStudio/YunUI/main/assets/hero-light.png" alt="YunUI — 安静的好看,安静的扎实" width="100%"></a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<img src="https://raw.githubusercontent.com/YuhuanStudio/YunUI/main/assets/showcase-light.png" alt="所有 YunUI 组件,尽在一页" width="49%">
|
|
18
|
+
<img src="https://raw.githubusercontent.com/YuhuanStudio/YunUI/main/assets/hero-dark.png" alt="YunUI 纯黑主题" width="49%">
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
<p align="center">
|
|
22
|
+
<img src="https://raw.githubusercontent.com/YuhuanStudio/YunUI/main/assets/theming.png" alt="即时主题 — 12 套多色预设、24 套 OKLCH 色盘、令牌驱动特效" width="100%">
|
|
23
|
+
</p>
|
|
8
24
|
|
|
9
25
|
改 YunUI 一处 → 发版 → 各项目升级版本号即可同步获得统一的 **设计 token、动画、组件**。已在 Yunxin 生产环境使用。
|
|
10
26
|
|
package/README.zh-TW.md
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
# YunUI
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@yuhuanowo/yunui)
|
|
4
|
+
[](https://ui.yuhuanstudio.com)
|
|
4
5
|
|
|
5
6
|
[English](./README.md) · [简体中文](./README.zh-CN.md) · **繁體中文**
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
一套不喧嘩的 React 19 + Tailwind v4 設計系統 —— 每個細節都被好好想過。
|
|
9
|
+
|
|
10
|
+
🔗 **線上展示與文件 → [ui.yuhuanstudio.com](https://ui.yuhuanstudio.com)**
|
|
11
|
+
|
|
12
|
+
<p align="center">
|
|
13
|
+
<a href="https://ui.yuhuanstudio.com"><img src="https://raw.githubusercontent.com/YuhuanStudio/YunUI/main/assets/hero-light.png" alt="YunUI — 安靜的好看,安靜的扎實" width="100%"></a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<img src="https://raw.githubusercontent.com/YuhuanStudio/YunUI/main/assets/showcase-light.png" alt="所有 YunUI 元件,盡在一頁" width="49%">
|
|
18
|
+
<img src="https://raw.githubusercontent.com/YuhuanStudio/YunUI/main/assets/hero-dark.png" alt="YunUI 純黑主題" width="49%">
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
<p align="center">
|
|
22
|
+
<img src="https://raw.githubusercontent.com/YuhuanStudio/YunUI/main/assets/theming.png" alt="即時主題 — 12 套多色預設、24 套 OKLCH 色盤、權杖驅動特效" width="100%">
|
|
23
|
+
</p>
|
|
8
24
|
|
|
9
25
|
改 YunUI 一處 → 發版 → 各專案升級版本號即可同步取得統一的 **設計 token、動畫、元件**。已在 Yunxin 生產環境使用。
|
|
10
26
|
|
package/dist/adapters.js
CHANGED
package/dist/ai.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { copyToClipboard } from './chunk-
|
|
3
|
-
export { DiscordIcon, Footer, GithubIcon, InstagramIcon } from './chunk-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { copyToClipboard } from './chunk-UYYG4XDW.js';
|
|
3
|
+
export { DiscordIcon, Footer, GithubIcon, InstagramIcon } from './chunk-UYYG4XDW.js';
|
|
4
|
+
import { ThemeToggle } from './chunk-GSPJ5YI6.js';
|
|
5
|
+
import { cn, useAnchoredPosition } from './chunk-AV5TGEJS.js';
|
|
6
|
+
import { useYunUI } from './chunk-3RT24MSH.js';
|
|
6
7
|
import { memo, useState, useRef, useMemo, useEffect } from 'react';
|
|
7
8
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
8
9
|
import { Pin, MessageSquare, Waves, Code, Eye, Brain, Pencil, Ban, Fingerprint, Layers, SlidersHorizontal, Mic, Video, Music, Box, Radio, ChevronUp, ChevronDown, Check, Copy, Image, PauseCircle, Search, X, Sparkles, Bot, Globe, Menu, Shield, Shuffle, Volume2, Headphones, Palette, Hash, FileText } from 'lucide-react';
|
|
@@ -142,7 +143,7 @@ function ModelCard({
|
|
|
142
143
|
/* @__PURE__ */ jsxs("div", { className: "mt-auto flex flex-wrap items-center justify-between gap-x-3 gap-y-1.5 text-[11px] text-muted-foreground pt-3 border-t border-border", children: [
|
|
143
144
|
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5 min-w-0", children: [
|
|
144
145
|
developer?.iconUrl && /* @__PURE__ */ jsx("div", { className: "rounded-md overflow-hidden bg-muted", style: { width: 12, height: 12 }, children: /* @__PURE__ */ jsx(Image, { src: developer.iconUrl, alt: developer.label, width: 12, height: 12, className: "object-cover" }) }),
|
|
145
|
-
developer?.label && /* @__PURE__ */ jsx("span", { children: developer.label })
|
|
146
|
+
developer?.label && /* @__PURE__ */ jsx("span", { className: "truncate min-w-0", children: developer.label })
|
|
146
147
|
] }),
|
|
147
148
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
148
149
|
context && /* @__PURE__ */ jsx("span", { className: "bg-muted px-1.5 py-0.5 rounded-sm font-medium", children: context }),
|
|
@@ -182,6 +183,8 @@ function ModelSelect({
|
|
|
182
183
|
const rootRef = useRef(null);
|
|
183
184
|
const inputRef = useRef(null);
|
|
184
185
|
const listRef = useRef(null);
|
|
186
|
+
const panelRef = useRef(null);
|
|
187
|
+
const { shift, maxHeight } = useAnchoredPosition(isOpen, panelRef);
|
|
185
188
|
const pinnedSet = useMemo(() => new Set(pinned ?? []), [pinned]);
|
|
186
189
|
useEffect(() => {
|
|
187
190
|
const onDown = (e) => {
|
|
@@ -315,11 +318,12 @@ function ModelSelect({
|
|
|
315
318
|
isOpen && /* @__PURE__ */ jsxs(
|
|
316
319
|
motion.div,
|
|
317
320
|
{
|
|
321
|
+
ref: panelRef,
|
|
318
322
|
initial: { opacity: 0, y: -8, scale: 0.96 },
|
|
319
323
|
animate: { opacity: 1, y: 0, scale: 1 },
|
|
320
324
|
transition: { duration: 0.16, ease: "easeOut" },
|
|
321
|
-
style: { maxWidth: "calc(100vw - 1rem)" },
|
|
322
|
-
className: "origin-top absolute z-50 top-full left-0 mt-2 w-96 bg-
|
|
325
|
+
style: { maxWidth: "calc(100vw - 1rem)", marginLeft: shift, maxHeight },
|
|
326
|
+
className: "origin-top absolute z-50 top-full left-0 mt-2 w-96 max-w-[calc(100vw-1rem)] flex flex-col bg-background/60 backdrop-blur-2xl border border-border rounded-2xl shadow-lg shadow-black/5 text-popover-foreground overflow-hidden",
|
|
323
327
|
children: [
|
|
324
328
|
/* @__PURE__ */ jsxs("div", { className: "p-2.5 border-b border-border/50", children: [
|
|
325
329
|
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
@@ -332,6 +336,7 @@ function ModelSelect({
|
|
|
332
336
|
onChange: (e) => setSearch(e.target.value),
|
|
333
337
|
onKeyDown: onSearchKeyDown,
|
|
334
338
|
placeholder: L.search,
|
|
339
|
+
"aria-label": L.search,
|
|
335
340
|
role: "combobox",
|
|
336
341
|
"aria-expanded": isOpen,
|
|
337
342
|
"aria-controls": "yunui-ms-listbox",
|
|
@@ -349,7 +354,7 @@ function ModelSelect({
|
|
|
349
354
|
activeFilters.length > 0 && /* @__PURE__ */ jsx("button", { type: "button", onClick: () => setActiveFilters([]), title: L.clearFilters, "aria-label": L.clearFilters, className: "p-1 rounded-md text-muted-foreground hover:bg-muted outline-none focus-visible:ring-2 focus-visible:ring-ring", children: /* @__PURE__ */ jsx(X, { size: 14 }) })
|
|
350
355
|
] })
|
|
351
356
|
] }),
|
|
352
|
-
groups.length > 1 && /* @__PURE__ */ jsx("div", { className: "px-2.5 py-2 border-b border-border/50 overflow-x-auto", children: /* @__PURE__ */ jsxs("div", { className: "flex gap-1 min-w-max", children: [
|
|
357
|
+
groups.length > 1 && /* @__PURE__ */ jsx("div", { className: "px-2.5 py-2 border-b border-border/50 overflow-x-auto overflow-y-hidden overscroll-x-contain", children: /* @__PURE__ */ jsxs("div", { className: "flex gap-1 min-w-max", children: [
|
|
353
358
|
/* @__PURE__ */ jsxs("button", { type: "button", onClick: () => setActiveGroup(null), "aria-pressed": !activeGroup, className: cn("px-2.5 py-1.5 text-xs rounded-lg font-medium transition-colors whitespace-nowrap outline-none focus-visible:ring-2 focus-visible:ring-ring", !activeGroup ? "bg-foreground text-background" : "bg-muted text-muted-foreground hover:bg-muted/80"), children: [
|
|
354
359
|
L.all,
|
|
355
360
|
" (",
|
|
@@ -361,7 +366,7 @@ function ModelSelect({
|
|
|
361
366
|
groupLabel[g] ?? g
|
|
362
367
|
] }, g))
|
|
363
368
|
] }) }),
|
|
364
|
-
/* @__PURE__ */ jsxs("div", { ref: listRef, onWheel, onMouseMove: clearActiveOnPointer, id: "yunui-ms-listbox", role: "listbox", className: "max-h-96 overflow-y-auto overscroll-contain", children: [
|
|
369
|
+
/* @__PURE__ */ jsxs("div", { ref: listRef, onWheel, onMouseMove: clearActiveOnPointer, id: "yunui-ms-listbox", role: "listbox", className: "flex-1 min-h-0 max-h-96 overflow-y-auto overscroll-contain", children: [
|
|
365
370
|
pinnedList.length > 0 && /* @__PURE__ */ jsxs("div", { className: "px-1.5 py-1.5 border-b border-border/40", children: [
|
|
366
371
|
/* @__PURE__ */ jsxs("div", { className: "text-[10px] font-medium text-muted-foreground uppercase tracking-wide px-2 mb-1 flex items-center gap-1", children: [
|
|
367
372
|
/* @__PURE__ */ jsx(Pin, { size: 9 }),
|
|
@@ -421,7 +426,7 @@ var ModelRow = memo(function ModelRow2({
|
|
|
421
426
|
"div",
|
|
422
427
|
{
|
|
423
428
|
className: cn(
|
|
424
|
-
"absolute left-
|
|
429
|
+
"absolute left-1.5 top-1/2 w-1 h-6 rounded-full bg-primary transition-all duration-150 -translate-y-1/2",
|
|
425
430
|
selected ? "opacity-100 translate-x-0" : "opacity-0 -translate-x-1.5 group-hover:opacity-50 group-hover:translate-x-0"
|
|
426
431
|
)
|
|
427
432
|
}
|
|
@@ -476,16 +481,19 @@ function ModelManagerCard({
|
|
|
476
481
|
className
|
|
477
482
|
),
|
|
478
483
|
children: [
|
|
479
|
-
|
|
484
|
+
selectSlot && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 -mt-2 mb-3 min-h-7", children: [
|
|
480
485
|
/* @__PURE__ */ jsx("div", { className: "flex items-center", children: selectSlot }),
|
|
481
486
|
actions && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-0.5 -mr-1.5 text-muted-foreground", children: actions })
|
|
482
487
|
] }),
|
|
483
488
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
484
489
|
icon && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: icon }),
|
|
485
490
|
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
486
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-
|
|
487
|
-
/* @__PURE__ */
|
|
488
|
-
|
|
491
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
|
|
492
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-x-2 gap-y-1 flex-wrap min-w-0", children: [
|
|
493
|
+
/* @__PURE__ */ jsx("span", { className: "font-semibold leading-tight min-w-0 break-words", children: name }),
|
|
494
|
+
nameBadges
|
|
495
|
+
] }),
|
|
496
|
+
!selectSlot && actions && /* @__PURE__ */ jsx("div", { className: "shrink-0 -mr-1.5 -mt-1 flex items-center gap-0.5 text-muted-foreground", children: actions })
|
|
489
497
|
] }),
|
|
490
498
|
ids && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-1 mt-1.5", children: ids })
|
|
491
499
|
] })
|
|
@@ -1530,6 +1538,9 @@ function LanguageSwitcher({
|
|
|
1530
1538
|
}) {
|
|
1531
1539
|
const [isOpen, setIsOpen] = useState(false);
|
|
1532
1540
|
const containerRef = useRef(null);
|
|
1541
|
+
const triggerRef = useRef(null);
|
|
1542
|
+
const panelRef = useRef(null);
|
|
1543
|
+
const { shift, maxHeight } = useAnchoredPosition(isOpen, panelRef);
|
|
1533
1544
|
useEffect(() => {
|
|
1534
1545
|
const handleClickOutside = (e) => {
|
|
1535
1546
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
@@ -1539,6 +1550,17 @@ function LanguageSwitcher({
|
|
|
1539
1550
|
document.addEventListener("mousedown", handleClickOutside);
|
|
1540
1551
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1541
1552
|
}, []);
|
|
1553
|
+
useEffect(() => {
|
|
1554
|
+
if (!isOpen) return;
|
|
1555
|
+
const onKey = (e) => {
|
|
1556
|
+
if (e.key === "Escape") {
|
|
1557
|
+
setIsOpen(false);
|
|
1558
|
+
triggerRef.current?.focus();
|
|
1559
|
+
}
|
|
1560
|
+
};
|
|
1561
|
+
document.addEventListener("keydown", onKey);
|
|
1562
|
+
return () => document.removeEventListener("keydown", onKey);
|
|
1563
|
+
}, [isOpen]);
|
|
1542
1564
|
const handleLocaleChange = (newLocale) => {
|
|
1543
1565
|
if (newLocale === currentLocale || pending) return;
|
|
1544
1566
|
setIsOpen(false);
|
|
@@ -1549,6 +1571,7 @@ function LanguageSwitcher({
|
|
|
1549
1571
|
variant === "pill" ? /* @__PURE__ */ jsxs(
|
|
1550
1572
|
"button",
|
|
1551
1573
|
{
|
|
1574
|
+
ref: triggerRef,
|
|
1552
1575
|
onClick: () => setIsOpen(!isOpen),
|
|
1553
1576
|
className: "flex items-center gap-1.5 h-9 px-2.5 sm:px-3 rounded-full text-sm font-medium transition-all bg-(--bg-elevated) hover:bg-(--bg-elevated)/80 border border-(--border-hairline) text-(--text-secondary) hover:text-(--text-primary) disabled:opacity-50 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
1554
1577
|
disabled: pending,
|
|
@@ -1563,6 +1586,7 @@ function LanguageSwitcher({
|
|
|
1563
1586
|
) : /* @__PURE__ */ jsx(
|
|
1564
1587
|
"button",
|
|
1565
1588
|
{
|
|
1589
|
+
ref: triggerRef,
|
|
1566
1590
|
onClick: () => setIsOpen(!isOpen),
|
|
1567
1591
|
className: "w-9 h-9 rounded-lg flex items-center justify-center hover:bg-foreground/5 transition-colors disabled:opacity-50 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
1568
1592
|
disabled: pending,
|
|
@@ -1572,15 +1596,23 @@ function LanguageSwitcher({
|
|
|
1572
1596
|
children: /* @__PURE__ */ jsx(Globe, { className: "h-[1.2rem] w-[1.2rem]" })
|
|
1573
1597
|
}
|
|
1574
1598
|
),
|
|
1575
|
-
isOpen && /* @__PURE__ */ jsx(
|
|
1576
|
-
"
|
|
1599
|
+
isOpen && /* @__PURE__ */ jsx(
|
|
1600
|
+
"div",
|
|
1577
1601
|
{
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1602
|
+
ref: panelRef,
|
|
1603
|
+
style: { marginLeft: shift, maxHeight },
|
|
1604
|
+
className: `absolute ${align === "left" ? "left-0" : "right-0"} top-full mt-2 z-50 flex flex-col overflow-hidden rounded-2xl border border-border bg-background/60 backdrop-blur-2xl text-popover-foreground shadow-lg shadow-black/5 animate-in fade-in-0 zoom-in-95 duration-200`,
|
|
1605
|
+
children: /* @__PURE__ */ jsx("div", { className: "p-1 flex-1 min-h-0 overflow-y-auto", children: locales.map((lang) => /* @__PURE__ */ jsx(
|
|
1606
|
+
"button",
|
|
1607
|
+
{
|
|
1608
|
+
onClick: () => handleLocaleChange(lang.value),
|
|
1609
|
+
className: `dropdown-item w-full text-left ${currentLocale === lang.value ? "active" : ""}`,
|
|
1610
|
+
children: /* @__PURE__ */ jsx("span", { className: "flex-1", children: lang.label })
|
|
1611
|
+
},
|
|
1612
|
+
lang.value
|
|
1613
|
+
)) })
|
|
1614
|
+
}
|
|
1615
|
+
)
|
|
1584
1616
|
] });
|
|
1585
1617
|
}
|
|
1586
1618
|
function Navbar({
|
|
@@ -1642,92 +1674,99 @@ function Navbar({
|
|
|
1642
1674
|
}
|
|
1643
1675
|
return false;
|
|
1644
1676
|
};
|
|
1645
|
-
return /* @__PURE__ */ jsxs(
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
children:
|
|
1656
|
-
/* @__PURE__ */ jsx("span", { className: `text-sm relative z-10 ${isActive(link.href) ? "text-foreground font-medium" : "text-muted-foreground"}`, children: link.label }),
|
|
1657
|
-
/* @__PURE__ */ jsx("span", { className: `absolute bottom-1.5 left-1/2 -translate-x-1/2 h-0.5 bg-foreground rounded-full transition-all duration-200 yunui-accent-bg ${isActive(link.href) ? "w-8" : "w-0 group-hover:w-8"}` })
|
|
1658
|
-
]
|
|
1659
|
-
},
|
|
1660
|
-
link.href
|
|
1661
|
-
)) }),
|
|
1662
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 shrink-0", children: [
|
|
1663
|
-
/* @__PURE__ */ jsx("span", { className: "hidden md:flex items-center gap-1.5", children: languageSwitcher }),
|
|
1664
|
-
themeToggle ?? /* @__PURE__ */ jsx(ThemeToggle, { variant: "pill" }),
|
|
1665
|
-
variant !== "minimal" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1666
|
-
/* @__PURE__ */ jsx(
|
|
1667
|
-
Link,
|
|
1668
|
-
{
|
|
1669
|
-
href: loginHref,
|
|
1670
|
-
className: "hidden md:block text-sm text-muted-foreground hover:text-foreground transition-colors duration-200 py-2 whitespace-nowrap min-w-15 text-center",
|
|
1671
|
-
children: signIn
|
|
1672
|
-
}
|
|
1673
|
-
),
|
|
1674
|
-
/* @__PURE__ */ jsx(
|
|
1675
|
-
Link,
|
|
1676
|
-
{
|
|
1677
|
-
href: signupHref,
|
|
1678
|
-
className: "hidden md:inline-block px-4 py-2 bg-foreground text-background text-sm font-medium rounded-lg hover:bg-foreground/90 hover:shadow-md transition-all duration-200 whitespace-nowrap min-w-20 text-center yunui-accent-bg yunui-accent-on",
|
|
1679
|
-
children: signUp
|
|
1680
|
-
}
|
|
1681
|
-
)
|
|
1682
|
-
] }),
|
|
1683
|
-
variant === "public" && /* @__PURE__ */ jsx(
|
|
1684
|
-
"button",
|
|
1685
|
-
{
|
|
1686
|
-
type: "button",
|
|
1687
|
-
onClick: () => setMenuOpen((o) => !o),
|
|
1688
|
-
className: "md:hidden w-9 h-9 rounded-full flex items-center justify-center hover:bg-foreground/5 transition-colors",
|
|
1689
|
-
"aria-label": menuLabel,
|
|
1690
|
-
"aria-expanded": menuOpen,
|
|
1691
|
-
children: menuOpen ? /* @__PURE__ */ jsx(X, { className: "w-5 h-5" }) : /* @__PURE__ */ jsx(Menu, { className: "w-5 h-5" })
|
|
1692
|
-
}
|
|
1693
|
-
)
|
|
1694
|
-
] }),
|
|
1695
|
-
variant === "public" && menuOpen && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1696
|
-
/* @__PURE__ */ jsx("div", { className: "md:hidden fixed inset-0 -z-10", onClick: () => setMenuOpen(false) }),
|
|
1697
|
-
/* @__PURE__ */ jsxs("div", { className: "md:hidden absolute top-full left-0 right-0 mt-3 p-2 bg-background/95 backdrop-blur-xl border border-border rounded-2xl shadow-lg flex flex-col gap-0.5", children: [
|
|
1698
|
-
links.map((link) => /* @__PURE__ */ jsx(
|
|
1677
|
+
return /* @__PURE__ */ jsxs(
|
|
1678
|
+
"nav",
|
|
1679
|
+
{
|
|
1680
|
+
style: { top: "max(1.5rem, env(safe-area-inset-top))" },
|
|
1681
|
+
className: "fixed left-1/2 -translate-x-1/2 z-50 px-6 py-2.5 max-w-6xl w-[calc(100%-48px)] bg-background/80 backdrop-blur-xl border border-border rounded-full shadow-md flex items-center justify-between",
|
|
1682
|
+
children: [
|
|
1683
|
+
/* @__PURE__ */ jsxs(Link, { href: homeHref, className: "flex items-center gap-2 min-w-0 rounded-lg px-2 py-1 -mx-2 hover:bg-foreground/5 transition-colors duration-200", children: [
|
|
1684
|
+
/* @__PURE__ */ jsx(Image, { src: logoSrc, alt: appName, width: 28, height: 28, className: "w-7 h-7 shrink-0" }),
|
|
1685
|
+
/* @__PURE__ */ jsx("span", { className: "font-semibold text-sm tracking-tight truncate", children: appName })
|
|
1686
|
+
] }),
|
|
1687
|
+
variant === "public" && /* @__PURE__ */ jsx("div", { className: "hidden md:flex items-center gap-6 lg:gap-8 absolute left-1/2 -translate-x-1/2", children: links.map((link) => /* @__PURE__ */ jsxs(
|
|
1699
1688
|
Link,
|
|
1700
1689
|
{
|
|
1701
1690
|
href: link.href,
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1691
|
+
className: "group relative px-2 lg:px-3 py-2 whitespace-nowrap min-w-15 text-center",
|
|
1692
|
+
children: [
|
|
1693
|
+
/* @__PURE__ */ jsx("span", { className: `text-sm relative z-10 ${isActive(link.href) ? "text-foreground font-medium" : "text-muted-foreground"}`, children: link.label }),
|
|
1694
|
+
/* @__PURE__ */ jsx("span", { className: `absolute bottom-1.5 left-1/2 -translate-x-1/2 h-0.5 bg-foreground rounded-full transition-all duration-200 yunui-accent-bg ${isActive(link.href) ? "w-8" : "w-0 group-hover:w-8"}` })
|
|
1695
|
+
]
|
|
1705
1696
|
},
|
|
1706
1697
|
link.href
|
|
1707
|
-
)),
|
|
1708
|
-
/* @__PURE__ */
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1698
|
+
)) }),
|
|
1699
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 shrink-0", children: [
|
|
1700
|
+
/* @__PURE__ */ jsx("span", { className: "hidden md:flex items-center gap-1.5", children: languageSwitcher }),
|
|
1701
|
+
themeToggle ?? /* @__PURE__ */ jsx(ThemeToggle, { variant: "pill" }),
|
|
1702
|
+
variant !== "minimal" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1703
|
+
/* @__PURE__ */ jsx(
|
|
1704
|
+
Link,
|
|
1705
|
+
{
|
|
1706
|
+
href: loginHref,
|
|
1707
|
+
className: "hidden md:block text-sm text-muted-foreground hover:text-foreground transition-colors duration-200 py-2 whitespace-nowrap min-w-15 text-center",
|
|
1708
|
+
children: signIn
|
|
1709
|
+
}
|
|
1710
|
+
),
|
|
1711
|
+
/* @__PURE__ */ jsx(
|
|
1712
|
+
Link,
|
|
1713
|
+
{
|
|
1714
|
+
href: signupHref,
|
|
1715
|
+
className: "hidden md:inline-block px-4 py-2 bg-foreground text-background text-sm font-medium rounded-lg hover:bg-foreground/90 hover:shadow-md transition-all duration-200 whitespace-nowrap min-w-20 text-center yunui-accent-bg yunui-accent-on",
|
|
1716
|
+
children: signUp
|
|
1717
|
+
}
|
|
1718
|
+
)
|
|
1719
|
+
] }),
|
|
1720
|
+
variant === "public" && /* @__PURE__ */ jsx(
|
|
1721
|
+
"button",
|
|
1722
|
+
{
|
|
1723
|
+
type: "button",
|
|
1724
|
+
onClick: () => setMenuOpen((o) => !o),
|
|
1725
|
+
className: "md:hidden w-9 h-9 rounded-full flex items-center justify-center hover:bg-foreground/5 transition-colors",
|
|
1726
|
+
"aria-label": menuLabel,
|
|
1727
|
+
"aria-expanded": menuOpen,
|
|
1728
|
+
children: menuOpen ? /* @__PURE__ */ jsx(X, { className: "w-5 h-5" }) : /* @__PURE__ */ jsx(Menu, { className: "w-5 h-5" })
|
|
1729
|
+
}
|
|
1730
|
+
)
|
|
1731
|
+
] }),
|
|
1732
|
+
variant === "public" && menuOpen && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1733
|
+
/* @__PURE__ */ jsx("div", { className: "md:hidden fixed inset-0 -z-10", "aria-hidden": "true", onClick: () => setMenuOpen(false) }),
|
|
1734
|
+
/* @__PURE__ */ jsxs("div", { className: "md:hidden absolute top-full left-0 right-0 mt-3 p-2 bg-background/60 backdrop-blur-2xl border border-border rounded-2xl shadow-lg shadow-black/5 flex flex-col gap-0.5", children: [
|
|
1735
|
+
links.map((link) => /* @__PURE__ */ jsx(
|
|
1736
|
+
Link,
|
|
1737
|
+
{
|
|
1738
|
+
href: link.href,
|
|
1739
|
+
onClick: () => setMenuOpen(false),
|
|
1740
|
+
className: `px-4 py-2.5 rounded-xl text-sm transition-colors hover:bg-foreground/5 ${isActive(link.href) ? "text-foreground font-medium" : "text-muted-foreground"}`,
|
|
1741
|
+
children: link.label
|
|
1742
|
+
},
|
|
1743
|
+
link.href
|
|
1744
|
+
)),
|
|
1745
|
+
/* @__PURE__ */ jsx("div", { className: "my-1 border-t border-border" }),
|
|
1746
|
+
languageSwitcher && /* @__PURE__ */ jsx("div", { className: "px-2 py-1.5", children: languageSwitcher }),
|
|
1747
|
+
/* @__PURE__ */ jsx(
|
|
1748
|
+
Link,
|
|
1749
|
+
{
|
|
1750
|
+
href: loginHref,
|
|
1751
|
+
onClick: () => setMenuOpen(false),
|
|
1752
|
+
className: "px-4 py-2.5 rounded-xl text-sm text-muted-foreground transition-colors hover:bg-foreground/5",
|
|
1753
|
+
children: signIn
|
|
1754
|
+
}
|
|
1755
|
+
),
|
|
1756
|
+
/* @__PURE__ */ jsx(
|
|
1757
|
+
Link,
|
|
1758
|
+
{
|
|
1759
|
+
href: signupHref,
|
|
1760
|
+
onClick: () => setMenuOpen(false),
|
|
1761
|
+
className: "mt-0.5 px-4 py-2.5 rounded-xl text-sm font-medium text-center bg-foreground text-background hover:bg-foreground/90 transition-colors yunui-accent-bg yunui-accent-on",
|
|
1762
|
+
children: signUp
|
|
1763
|
+
}
|
|
1764
|
+
)
|
|
1765
|
+
] })
|
|
1766
|
+
] })
|
|
1767
|
+
]
|
|
1768
|
+
}
|
|
1769
|
+
);
|
|
1731
1770
|
}
|
|
1732
1771
|
|
|
1733
1772
|
export { CapabilityIcon, CapabilitySelector, IDBadge, LanguageSwitcher, ModelAvatar, ModelCard, ModelIcon, ModelManagerCard, ModelSelect, ModelTypeIcon, Navbar, PROVIDER_ICON_SLUGS, ProviderAvatar, ProviderIcon, ProviderIconImg, ProviderNames, ThinkingBlock, buttonVariants, getDeveloperIconPath, getIconPath, getProviderIconOptions, getProviderName, isKnownCapability, normalizeProviderId };
|