@yuhuanowo/yunui 0.2.17 → 0.2.18

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.
Files changed (41) hide show
  1. package/README.md +3 -1
  2. package/README.zh-CN.md +5 -1
  3. package/README.zh-TW.md +5 -1
  4. package/dist/ai.d.ts +99 -3
  5. package/dist/ai.js +212 -104
  6. package/dist/ai.js.map +1 -1
  7. package/dist/chat.d.ts +10 -3
  8. package/dist/chat.js +12 -7
  9. package/dist/chat.js.map +1 -1
  10. package/dist/{chunk-HH3JBHRP.js → chunk-AFVENY4D.js} +286 -31
  11. package/dist/chunk-AFVENY4D.js.map +1 -0
  12. package/dist/{chunk-F2HG4TOQ.js → chunk-GAXVET76.js} +13 -19
  13. package/dist/chunk-GAXVET76.js.map +1 -0
  14. package/dist/{chunk-DDUP7GAX.js → chunk-LEBQPP4B.js} +69 -3
  15. package/dist/chunk-LEBQPP4B.js.map +1 -0
  16. package/dist/chunk-ST6TSBVQ.js +208 -0
  17. package/dist/chunk-ST6TSBVQ.js.map +1 -0
  18. package/dist/chunk-V7VJKZ5Q.js +254 -0
  19. package/dist/chunk-V7VJKZ5Q.js.map +1 -0
  20. package/dist/{chunk-BCOKFWXC.js → chunk-YKWRCA2S.js} +80 -156
  21. package/dist/chunk-YKWRCA2S.js.map +1 -0
  22. package/dist/content.d.ts +10 -2
  23. package/dist/content.js +50 -40
  24. package/dist/content.js.map +1 -1
  25. package/dist/index.d.ts +266 -16
  26. package/dist/index.js +4 -4
  27. package/dist/patterns.d.ts +471 -22
  28. package/dist/patterns.js +783 -131
  29. package/dist/patterns.js.map +1 -1
  30. package/icons/providers/gmi.svg +5 -0
  31. package/package.json +3 -4
  32. package/styles/content.css +3 -1
  33. package/styles/yunui.css +197 -84
  34. package/dist/chunk-BCOKFWXC.js.map +0 -1
  35. package/dist/chunk-DDUP7GAX.js.map +0 -1
  36. package/dist/chunk-F2HG4TOQ.js.map +0 -1
  37. package/dist/chunk-HH3JBHRP.js.map +0 -1
  38. package/dist/chunk-N4QO7RN5.js +0 -98
  39. package/dist/chunk-N4QO7RN5.js.map +0 -1
  40. package/dist/chunk-QEIBYOG2.js +0 -188
  41. package/dist/chunk-QEIBYOG2.js.map +0 -1
package/dist/patterns.js CHANGED
@@ -1,15 +1,15 @@
1
1
  "use client";
2
- import './chunk-HH3JBHRP.js';
3
- import { copyToClipboard } from './chunk-DDUP7GAX.js';
4
- export { Footer } from './chunk-DDUP7GAX.js';
5
- import './chunk-F2HG4TOQ.js';
6
- import { ImageLightbox } from './chunk-QEIBYOG2.js';
7
- import { Button, Card, Badge, Avatar, AvatarImage, AvatarFallback, IconButton, Spinner, Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './chunk-BCOKFWXC.js';
8
- import { cn } from './chunk-N4QO7RN5.js';
2
+ import './chunk-AFVENY4D.js';
3
+ import { capabilityBadgeColor, capabilityIconColor, copyToClipboard } from './chunk-LEBQPP4B.js';
4
+ export { Footer } from './chunk-LEBQPP4B.js';
5
+ import './chunk-GAXVET76.js';
6
+ import { ImageLightbox } from './chunk-ST6TSBVQ.js';
7
+ import { Button, Card, Badge, Avatar, AvatarImage, AvatarFallback, IconButton, Spinner, Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './chunk-YKWRCA2S.js';
8
+ import { cn } from './chunk-V7VJKZ5Q.js';
9
9
  import { useYunUI } from './chunk-3RT24MSH.js';
10
10
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
11
11
  import React, { useState, useEffect, useCallback, useRef, useMemo } from 'react';
12
- import { AlertCircle, RefreshCw, Check, Copy, Plus, FileText, ExternalLink, Calendar, Clock, User, ChevronLeft, ChevronRight, ArrowUp, PanelLeftClose, X, ArrowUpRight, ArrowDownRight, GraduationCap, ArrowRight, Award, Waves, SlidersHorizontal, Layers, Fingerprint, Ban, Image, Brain, Eye, Code, MessageSquare, XCircle, Zap, CheckCircle, FileCode, EyeOff, Sparkles, Globe, Loader2, LogOut, Pause, Play, Download, Grid, List, Bell, Trash2, Camera, Info, CheckCircle2, AlertTriangle } from 'lucide-react';
12
+ import { AlertCircle, RefreshCw, Check, Copy, Plus, FileText, ExternalLink, Calendar, Clock, User, ChevronLeft, ChevronRight, ArrowUp, PanelLeftClose, X, ArrowUpRight, ArrowDownRight, GraduationCap, ArrowRight, Award, Waves, SlidersHorizontal, Layers, Fingerprint, Ban, DatabaseZap, Image, Brain, Eye, Code, MessageSquare, XCircle, Zap, CheckCircle, FileCode, EyeOff, Sparkles, Globe, Loader2, LogOut, Pause, Play, Download, Grid, List, Bell, Trash2, Camera, Quote, ChevronDown, Info, CheckCircle2, AlertTriangle } from 'lucide-react';
13
13
 
14
14
  function BackgroundEffects() {
15
15
  return /* @__PURE__ */ jsx("div", { className: "absolute inset-0 -z-10 h-full w-full pointer-events-none select-none overflow-hidden bg-(--bg-base)", children: /* @__PURE__ */ jsx(
@@ -136,7 +136,7 @@ function highlightCode(code) {
136
136
  const lines = code.split("\n");
137
137
  return lines.map((line, i) => {
138
138
  const rendered = renderLine(line) || " ";
139
- return `<div class="table-row group"><span class="table-cell select-none text-right pr-4 w-8 text-(--text-muted) text-xs opacity-0 group-hover:opacity-50 transition-opacity">${i + 1}</span><span class="table-cell">${rendered}</span></div>`;
139
+ return `<div class="table-row group"><span class="table-cell select-none text-right pr-4 w-8 text-(--text-tertiary) text-xs opacity-0 group-hover:opacity-100 transition-opacity">${i + 1}</span><span class="table-cell">${rendered}</span></div>`;
140
140
  }).join("");
141
141
  }
142
142
  function CodeBlock({
@@ -207,61 +207,67 @@ function CodeBlock({
207
207
  className: "table",
208
208
  dangerouslySetInnerHTML: {
209
209
  __html: highlightedHtml || code.split("\n").map(
210
- (line, i) => `<div class="table-row group"><span class="table-cell select-none text-right pr-4 w-8 text-(--text-muted) text-xs opacity-0 group-hover:opacity-50 transition-opacity">${i + 1}</span><span class="table-cell">${escapeHtml(line) || "&nbsp;"}</span></div>`
210
+ (line, i) => `<div class="table-row group"><span class="table-cell select-none text-right pr-4 w-8 text-(--text-tertiary) text-xs opacity-0 group-hover:opacity-100 transition-opacity">${i + 1}</span><span class="table-cell">${escapeHtml(line) || "&nbsp;"}</span></div>`
211
211
  ).join("")
212
212
  }
213
213
  }
214
214
  ) : code }) }) })
215
215
  ] });
216
216
  }
217
- var codeSnippets = {
218
- python: `import openai
217
+ function snippets(baseUrl, model, apiKey, prompt) {
218
+ const j = (s) => JSON.stringify(s);
219
+ const sq = (s) => `'${s.replace(/'/g, "\\'")}'`;
220
+ return {
221
+ python: `import openai
219
222
 
220
223
  client = openai.OpenAI(
221
- base_url="https://api.example.com/v1",
222
- api_key="your_api_key"
224
+ base_url=${j(baseUrl)},
225
+ api_key=${j(apiKey)}
223
226
  )
224
227
 
225
228
  response = client.chat.completions.create(
226
- model="deepseek-r1",
227
- messages=[{"role": "user", "content": "Hello!"}]
229
+ model=${j(model)},
230
+ messages=[{"role": "user", "content": ${j(prompt)}}]
228
231
  )
229
232
 
230
233
  print(response.choices[0].message.content)`,
231
- javascript: `import OpenAI from 'openai';
234
+ javascript: `import OpenAI from 'openai';
232
235
 
233
236
  const client = new OpenAI({
234
- baseURL: 'https://api.example.com/v1',
235
- apiKey: 'your_api_key'
237
+ baseURL: ${sq(baseUrl)},
238
+ apiKey: ${sq(apiKey)}
236
239
  });
237
240
 
238
241
  const response = await client.chat.completions.create({
239
- model: 'deepseek-r1',
240
- messages: [{ role: 'user', content: 'Hello!' }]
242
+ model: ${sq(model)},
243
+ messages: [{ role: 'user', content: ${sq(prompt)} }]
241
244
  });
242
245
 
243
246
  console.log(response.choices[0].message.content);`,
244
- curl: `curl https://api.example.com/v1/chat/completions \\
245
- -H "Authorization: Bearer your_api_key" \\
247
+ curl: `curl ${baseUrl}/chat/completions \\
248
+ -H "Authorization: Bearer ${apiKey}" \\
246
249
  -H "Content-Type: application/json" \\
247
250
  -d '{
248
- "model": "deepseek-r1",
249
- "messages": [{"role": "user", "content": "Hello!"}]
251
+ "model": ${j(model)},
252
+ "messages": [{"role": "user", "content": ${j(prompt)}}]
250
253
  }'`
251
- };
252
- function CodeDemo() {
254
+ };
255
+ }
256
+ function CodeDemo({
257
+ baseUrl = "https://api.example.com/v1",
258
+ model = "deepseek-r1",
259
+ apiKeyPlaceholder = "your_api_key",
260
+ prompt = "Hello!",
261
+ labels,
262
+ className
263
+ } = {}) {
264
+ const code = snippets(baseUrl, model, apiKeyPlaceholder, prompt);
253
265
  const tabs = [
254
- { id: "python", label: "Python", code: codeSnippets.python, language: "python" },
255
- { id: "javascript", label: "Node.js", code: codeSnippets.javascript, language: "javascript" },
256
- { id: "curl", label: "cURL", code: codeSnippets.curl, language: "bash" }
266
+ { id: "python", label: labels?.python ?? "Python", code: code.python, language: "python" },
267
+ { id: "javascript", label: labels?.javascript ?? "Node.js", code: code.javascript, language: "javascript" },
268
+ { id: "curl", label: labels?.curl ?? "cURL", code: code.curl, language: "bash" }
257
269
  ];
258
- return /* @__PURE__ */ jsx("div", { className: "w-full max-w-2xl mx-auto", children: /* @__PURE__ */ jsx(
259
- CodeBlock,
260
- {
261
- code: codeSnippets.python,
262
- tabs
263
- }
264
- ) });
270
+ return /* @__PURE__ */ jsx("div", { className: className ?? "w-full max-w-2xl mx-auto", children: /* @__PURE__ */ jsx(CodeBlock, { code: code.python, tabs }) });
265
271
  }
266
272
  function FAQ({ items, defaultOpenIndex = 0 }) {
267
273
  const [openIndex, setOpenIndex] = useState(defaultOpenIndex);
@@ -303,9 +309,9 @@ function FAQ({ items, defaultOpenIndex = 0 }) {
303
309
  }
304
310
  var actionClass = cn(
305
311
  "inline-flex items-center gap-1.5 px-2 py-1 text-xs",
306
- "text-fd-muted-foreground hover:text-fd-accent-foreground transition-colors rounded-md hover:bg-fd-accent"
312
+ "text-muted-foreground hover:text-accent-foreground transition-colors rounded-md hover:bg-accent"
307
313
  );
308
- function LLMCopyButton({ markdownUrl }) {
314
+ function LLMCopyButton({ markdownUrl, labels }) {
309
315
  const [copied, setCopied] = useState(false);
310
316
  const handleCopy = useCallback(async () => {
311
317
  try {
@@ -320,15 +326,12 @@ function LLMCopyButton({ markdownUrl }) {
320
326
  setTimeout(() => setCopied(false), 2e3);
321
327
  }
322
328
  }, [markdownUrl]);
323
- return /* @__PURE__ */ jsxs("button", { type: "button", onClick: handleCopy, title: "Copy as Markdown for LLM", className: actionClass, children: [
329
+ return /* @__PURE__ */ jsxs("button", { type: "button", onClick: handleCopy, title: labels?.title ?? "Copy as Markdown for LLM", className: actionClass, children: [
324
330
  copied ? /* @__PURE__ */ jsx(Check, { className: "size-3" }) : /* @__PURE__ */ jsx(Copy, { className: "size-3" }),
325
- copied ? "Copied" : "Copy"
331
+ copied ? labels?.copied ?? "Copied" : labels?.copy ?? "Copy"
326
332
  ] });
327
333
  }
328
- function ViewOptions({
329
- markdownUrl,
330
- githubUrl
331
- }) {
334
+ function ViewOptions({ markdownUrl, githubUrl, labels }) {
332
335
  return /* @__PURE__ */ jsxs(Fragment, { children: [
333
336
  /* @__PURE__ */ jsxs(
334
337
  "a",
@@ -337,10 +340,10 @@ function ViewOptions({
337
340
  target: "_blank",
338
341
  rel: "noreferrer noopener",
339
342
  className: cn(actionClass, "no-underline"),
340
- title: "View as Markdown",
343
+ title: labels?.markdownTitle ?? "View as Markdown",
341
344
  children: [
342
345
  /* @__PURE__ */ jsx(FileText, { className: "size-3" }),
343
- "Markdown"
346
+ labels?.markdown ?? "Markdown"
344
347
  ]
345
348
  }
346
349
  ),
@@ -351,10 +354,10 @@ function ViewOptions({
351
354
  target: "_blank",
352
355
  rel: "noreferrer noopener",
353
356
  className: cn(actionClass, "no-underline"),
354
- title: "Edit on GitHub",
357
+ title: labels?.githubTitle ?? "Edit on GitHub",
355
358
  children: [
356
359
  /* @__PURE__ */ jsx(ExternalLink, { className: "size-3" }),
357
- "GitHub"
360
+ labels?.github ?? "GitHub"
358
361
  ]
359
362
  }
360
363
  )
@@ -511,8 +514,9 @@ function BlogPagination({
511
514
  size: "sm",
512
515
  onClick: () => handlePageChange(currentPage - 1),
513
516
  disabled: currentPage === 1,
517
+ "aria-label": previousLabel,
514
518
  children: [
515
- /* @__PURE__ */ jsx(ChevronLeft, { size: 16 }),
519
+ /* @__PURE__ */ jsx(ChevronLeft, { size: 16, "aria-hidden": true }),
516
520
  /* @__PURE__ */ jsx("span", { className: "ml-1 hidden sm:inline", children: previousLabel })
517
521
  ]
518
522
  }
@@ -556,9 +560,10 @@ function BlogPagination({
556
560
  size: "sm",
557
561
  onClick: () => handlePageChange(currentPage + 1),
558
562
  disabled: currentPage === totalPages,
563
+ "aria-label": nextLabel,
559
564
  children: [
560
565
  /* @__PURE__ */ jsx("span", { className: "mr-1 hidden sm:inline", children: nextLabel }),
561
- /* @__PURE__ */ jsx(ChevronRight, { size: 16 })
566
+ /* @__PURE__ */ jsx(ChevronRight, { size: 16, "aria-hidden": true })
562
567
  ]
563
568
  }
564
569
  )
@@ -670,14 +675,14 @@ function SimplePagination({
670
675
  const nextLabel = labels?.next ?? "Next";
671
676
  const pageNode = labels?.page ? labels.page(currentPage) : `Page ${currentPage}`;
672
677
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-1.5 sm:gap-2", children: [
673
- /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", onClick: onPrevious, disabled: !canPrev, children: [
674
- /* @__PURE__ */ jsx(ChevronLeft, { size: 16 }),
678
+ /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", onClick: onPrevious, disabled: !canPrev, "aria-label": previousLabel, children: [
679
+ /* @__PURE__ */ jsx(ChevronLeft, { size: 16, "aria-hidden": true }),
675
680
  /* @__PURE__ */ jsx("span", { className: "ml-1 hidden sm:inline", children: previousLabel })
676
681
  ] }),
677
682
  /* @__PURE__ */ jsx("span", { className: "px-3 text-sm font-medium tabular-nums whitespace-nowrap", children: pageNode }),
678
- /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", onClick: onNext, disabled: !hasNext, children: [
683
+ /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", onClick: onNext, disabled: !hasNext, "aria-label": nextLabel, children: [
679
684
  /* @__PURE__ */ jsx("span", { className: "mr-1 hidden sm:inline", children: nextLabel }),
680
- /* @__PURE__ */ jsx(ChevronRight, { size: 16 })
685
+ /* @__PURE__ */ jsx(ChevronRight, { size: 16, "aria-hidden": true })
681
686
  ] })
682
687
  ] });
683
688
  }
@@ -733,10 +738,15 @@ function NavStateIndicator({
733
738
  }
734
739
  );
735
740
  }
736
- function isItemActive(item, currentPath, homeHref) {
737
- if (currentPath === item.href) return true;
738
- if (item.href !== homeHref && currentPath.startsWith(item.href)) return true;
739
- return item.match?.some((m) => currentPath.startsWith(m)) ?? false;
741
+ function matchStrength(item, currentPath, homeHref) {
742
+ let best = -1;
743
+ for (const prefix of [item.href, ...item.match ?? []]) {
744
+ if (currentPath === prefix) best = Math.max(best, prefix.length);
745
+ else if (prefix !== homeHref && currentPath.startsWith(prefix.replace(/\/$/, "") + "/")) {
746
+ best = Math.max(best, prefix.length);
747
+ }
748
+ }
749
+ return best;
740
750
  }
741
751
  function Sidebar({
742
752
  appName,
@@ -762,14 +772,31 @@ function Sidebar({
762
772
  }) {
763
773
  const { Link, Image } = useYunUI();
764
774
  const navRef = useRef(null);
775
+ const strongestMatch = useMemo(
776
+ () => sections.reduce(
777
+ (best, section) => section.items.reduce((inner, item) => Math.max(inner, matchStrength(item, currentPath, homeHref)), best),
778
+ -1
779
+ ),
780
+ [sections, currentPath, homeHref]
781
+ );
765
782
  useEffect(() => {
766
783
  const nav = navRef.current;
767
784
  if (!nav) return;
768
785
  const saved = sessionStorage.getItem(scrollStorageKey);
769
786
  if (saved) nav.scrollTop = parseInt(saved, 10);
770
- const onScroll = () => sessionStorage.setItem(scrollStorageKey, String(nav.scrollTop));
771
- nav.addEventListener("scroll", onScroll);
772
- return () => nav.removeEventListener("scroll", onScroll);
787
+ let frame = 0;
788
+ const onScroll = () => {
789
+ if (frame) return;
790
+ frame = requestAnimationFrame(() => {
791
+ frame = 0;
792
+ sessionStorage.setItem(scrollStorageKey, String(nav.scrollTop));
793
+ });
794
+ };
795
+ nav.addEventListener("scroll", onScroll, { passive: true });
796
+ return () => {
797
+ if (frame) cancelAnimationFrame(frame);
798
+ nav.removeEventListener("scroll", onScroll);
799
+ };
773
800
  }, [scrollStorageKey]);
774
801
  return /* @__PURE__ */ jsxs(Fragment, { children: [
775
802
  layout === "fixed" && isOpen && /* @__PURE__ */ jsx(
@@ -814,7 +841,7 @@ function Sidebar({
814
841
  children != null ? /* @__PURE__ */ jsx("div", { className: "flex min-h-0 flex-1 flex-col", children }) : /* @__PURE__ */ jsx("nav", { ref: navRef, className: "flex-1 overflow-y-auto py-3 px-3", children: loading ? /* @__PURE__ */ jsx("div", { className: "space-y-2 animate-pulse", children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsx("div", { className: "h-9 rounded-lg bg-foreground/5" }, i)) }) : sections.map((section, i) => /* @__PURE__ */ jsxs("div", { className: i > 0 ? "mt-4" : "", children: [
815
842
  section.title && /* @__PURE__ */ jsx("div", { className: "nav-section", children: section.title }),
816
843
  section.items.map((item) => {
817
- const active = isItemActive(item, currentPath, homeHref);
844
+ const active = strongestMatch >= 0 && matchStrength(item, currentPath, homeHref) === strongestMatch;
818
845
  const Icon = item.icon;
819
846
  const content = /* @__PURE__ */ jsxs(Fragment, { children: [
820
847
  /* @__PURE__ */ jsx(NavStateIndicator, { active }),
@@ -860,11 +887,12 @@ function PageLayout({
860
887
  hideFooter = false,
861
888
  transparentBg = false,
862
889
  mainClassName,
890
+ mainId = "main-content",
863
891
  className
864
892
  }) {
865
893
  return /* @__PURE__ */ jsxs("div", { className: cn("min-h-dvh flex flex-col relative", !transparentBg && "bg-background", className), children: [
866
894
  navbar,
867
- /* @__PURE__ */ jsx("main", { className: cn("flex-1 pt-28", mainClassName), children }),
895
+ /* @__PURE__ */ jsx("main", { id: mainId, className: cn("flex-1 pt-28", mainClassName), children }),
868
896
  !hideFooter && footer
869
897
  ] });
870
898
  }
@@ -906,12 +934,23 @@ function PageEmptyState({ icon: Icon, title, description, action }) {
906
934
  action && /* @__PURE__ */ jsx("div", { className: "mt-4", children: action })
907
935
  ] });
908
936
  }
937
+ var SEMANTIC_TONES = {
938
+ warning: { card: "border-warning-soft bg-warning-soft", value: "text-warning" },
939
+ success: { card: "border-success-soft bg-success-soft", value: "text-success" },
940
+ info: { card: "border-info-soft bg-info-soft", value: "text-info" },
941
+ error: { card: "border-error-soft bg-error-soft", value: "text-error" },
942
+ // No `.text-accent` helper exists (unlike the four status tones), so the
943
+ // value colour reads the token directly rather than a dead utility class.
944
+ accent: { card: "border-accent-soft bg-accent-soft", value: "text-(--accent)" }
945
+ };
909
946
  var TONES = {
910
- amber: { card: "border-amber-500/20 bg-amber-500/5", value: "text-amber-600 dark:text-amber-400" },
911
- emerald: { card: "border-emerald-500/20 bg-emerald-500/5", value: "text-emerald-600 dark:text-emerald-400" },
912
- blue: { card: "border-blue-500/20 bg-blue-500/5", value: "text-blue-600 dark:text-blue-400" },
913
- red: { card: "border-red-500/20 bg-red-500/5", value: "text-red-600 dark:text-red-400" },
914
- purple: { card: "border-purple-500/20 bg-purple-500/5", value: "text-purple-600 dark:text-purple-400" }
947
+ ...SEMANTIC_TONES,
948
+ // Legacy colour-named aliases.
949
+ amber: SEMANTIC_TONES.warning,
950
+ emerald: SEMANTIC_TONES.success,
951
+ blue: SEMANTIC_TONES.info,
952
+ red: SEMANTIC_TONES.error,
953
+ purple: SEMANTIC_TONES.accent
915
954
  };
916
955
  function StatCard({ icon: Icon, label, value, subtext, trend, tone, delay = 0, inline = false, valueFirst = false, compact = false, className }) {
917
956
  const toneCfg = tone ? TONES[tone] : void 0;
@@ -925,9 +964,10 @@ function StatCard({ icon: Icon, label, value, subtext, trend, tone, delay = 0, i
925
964
  "%"
926
965
  ] })
927
966
  ] }) : null;
967
+ const mutedInk = toneCfg ? "text-foreground/75" : "text-muted-foreground";
928
968
  if (inline) {
929
969
  return /* @__PURE__ */ jsxs("div", { className: cn("card p-4", toneCfg?.card, className), children: [
930
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
970
+ /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-2 text-sm", mutedInk), children: [
931
971
  Icon && /* @__PURE__ */ jsx(Icon, { size: 18 }),
932
972
  /* @__PURE__ */ jsx("span", { children: label })
933
973
  ] }),
@@ -943,8 +983,8 @@ function StatCard({ icon: Icon, label, value, subtext, trend, tone, delay = 0, i
943
983
  children: [
944
984
  topRow,
945
985
  /* @__PURE__ */ jsx("div", { className: cn("text-2xl font-semibold mb-1", toneCfg?.value), children: value }),
946
- /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: label }),
947
- subtext && /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground/60 mt-1", children: subtext })
986
+ /* @__PURE__ */ jsx("div", { className: cn("text-sm", mutedInk), children: label }),
987
+ subtext && /* @__PURE__ */ jsx("div", { className: cn("text-xs mt-1", toneCfg ? "text-foreground/75" : "text-muted-foreground"), children: subtext })
948
988
  ]
949
989
  }
950
990
  );
@@ -983,7 +1023,7 @@ function FellowsBanner({
983
1023
  /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
984
1024
  /* @__PURE__ */ jsx("h3", { className: "font-semibold text-sm", children: title }),
985
1025
  /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: description }),
986
- features.length > 0 && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground/70 mt-1", children: features.join(" \xB7 ") })
1026
+ features.length > 0 && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-1", children: features.join(" \xB7 ") })
987
1027
  ] })
988
1028
  ] }),
989
1029
  /* @__PURE__ */ jsxs("span", { className: "shrink-0 w-full sm:w-auto inline-flex items-center justify-center gap-1.5 px-4 py-2.5 rounded-xl bg-primary/10 text-primary text-sm font-medium group-hover:bg-primary/15 transition-colors", children: [
@@ -1127,31 +1167,35 @@ function MediaErrorState({ message, onRetry }) {
1127
1167
  function FellowBadge({ variant = "inline", className = "" }) {
1128
1168
  const t = useYunUI().useT("components.badges");
1129
1169
  if (variant === "pill") {
1130
- return /* @__PURE__ */ jsxs("span", { className: `badge inline-flex items-center gap-1 text-xs bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20 ${className}`, children: [
1131
- /* @__PURE__ */ jsx(Award, { size: 11, className: "text-amber-500" }),
1170
+ return /* @__PURE__ */ jsxs("span", { className: `badge inline-flex items-center gap-1 text-xs bg-amber-500/10 text-amber-700 dark:text-amber-400 border-amber-500/20 ${className}`, children: [
1171
+ /* @__PURE__ */ jsx(Award, { size: 11, className: "text-amber-600" }),
1132
1172
  t("fellow")
1133
1173
  ] });
1134
1174
  }
1135
- return /* @__PURE__ */ jsxs("span", { className: `inline-flex items-center gap-1 text-xs font-medium text-amber-600 dark:text-amber-400 ${className}`, children: [
1136
- /* @__PURE__ */ jsx(Award, { size: 10, className: "text-amber-500" }),
1175
+ return /* @__PURE__ */ jsxs("span", { className: `inline-flex items-center gap-1 text-xs font-medium text-amber-700 dark:text-amber-400 ${className}`, children: [
1176
+ /* @__PURE__ */ jsx(Award, { size: 10, className: "text-amber-600" }),
1137
1177
  t("fellow")
1138
1178
  ] });
1139
1179
  }
1140
1180
  function CapabilityBadge({ capability, short = false }) {
1141
1181
  const t = useYunUI().useT("components.badges");
1142
1182
  const configs = {
1143
- chat: { icon: MessageSquare, iconColor: "text-blue-500", color: "bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20", labelKey: "chat" },
1144
- streaming: { icon: Waves, iconColor: "text-cyan-500", color: "bg-cyan-500/10 text-cyan-600 dark:text-cyan-400 border-cyan-500/20", labelKey: "streaming" },
1145
- function_calling: { icon: Code, iconColor: "text-purple-500", color: "bg-purple-500/10 text-purple-600 dark:text-purple-400 border-purple-500/20", labelKey: "functionCalling" },
1146
- vision: { icon: Eye, iconColor: "text-amber-500", color: "bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20", labelKey: "vision" },
1147
- thinking: { icon: Brain, iconColor: "text-pink-500", color: "bg-pink-500/10 text-pink-600 dark:text-pink-400 border-pink-500/20", labelKey: "thinking" },
1148
- image_edit: { icon: Image, iconColor: "text-orange-500", color: "bg-orange-500/10 text-orange-600 dark:text-orange-400 border-orange-500/20", labelKey: "imageEdit" },
1149
- negative_prompt: { icon: Ban, iconColor: "text-red-500", color: "bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/20", labelKey: "negativePrompt" },
1150
- seed_control: { icon: Fingerprint, iconColor: "text-indigo-500", color: "bg-indigo-500/10 text-indigo-600 dark:text-indigo-400 border-indigo-500/20", labelKey: "seedControl" },
1151
- lora: { icon: Layers, iconColor: "text-teal-500", color: "bg-teal-500/10 text-teal-600 dark:text-teal-400 border-teal-500/20", labelKey: "loraSupport" },
1152
- guidance_scale: { icon: SlidersHorizontal, iconColor: "text-yellow-500", color: "bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 border-yellow-500/20", labelKey: "guidanceScale" },
1153
- strength: { icon: SlidersHorizontal, iconColor: "text-orange-500", color: "bg-orange-500/10 text-orange-600 dark:text-orange-400 border-orange-500/20", labelKey: "strength" },
1154
- batch: { icon: Waves, iconColor: "text-cyan-500", color: "bg-cyan-500/10 text-cyan-600 dark:text-cyan-400 border-cyan-500/20", labelKey: "batchGeneration" }
1183
+ chat: { icon: MessageSquare, iconColor: capabilityIconColor("chat"), color: capabilityBadgeColor("chat"), labelKey: "chat" },
1184
+ streaming: { icon: Waves, iconColor: capabilityIconColor("streaming"), color: capabilityBadgeColor("streaming"), labelKey: "streaming" },
1185
+ function_calling: { icon: Code, iconColor: capabilityIconColor("function_calling"), color: capabilityBadgeColor("function_calling"), labelKey: "functionCalling" },
1186
+ vision: { icon: Eye, iconColor: capabilityIconColor("vision"), color: capabilityBadgeColor("vision"), labelKey: "vision" },
1187
+ thinking: { icon: Brain, iconColor: capabilityIconColor("thinking"), color: capabilityBadgeColor("thinking"), labelKey: "thinking" },
1188
+ image_edit: { icon: Image, iconColor: capabilityIconColor("image_edit"), color: capabilityBadgeColor("image_edit"), labelKey: "imageEdit" },
1189
+ // Whether the model CAN reuse a cached prompt — a separate question from what caching
1190
+ // costs. An unquoted or zero cache price says nothing about the capability.
1191
+ prompt_caching: { icon: DatabaseZap, iconColor: capabilityIconColor("prompt_caching"), color: capabilityBadgeColor("prompt_caching"), labelKey: "promptCaching" },
1192
+ context_caching: { icon: DatabaseZap, iconColor: capabilityIconColor("context_caching"), color: capabilityBadgeColor("context_caching"), labelKey: "contextCaching" },
1193
+ negative_prompt: { icon: Ban, iconColor: capabilityIconColor("negative_prompt"), color: capabilityBadgeColor("negative_prompt"), labelKey: "negativePrompt" },
1194
+ seed_control: { icon: Fingerprint, iconColor: capabilityIconColor("seed_control"), color: capabilityBadgeColor("seed_control"), labelKey: "seedControl" },
1195
+ lora: { icon: Layers, iconColor: capabilityIconColor("lora"), color: capabilityBadgeColor("lora"), labelKey: "loraSupport" },
1196
+ guidance_scale: { icon: SlidersHorizontal, iconColor: capabilityIconColor("guidance_scale"), color: capabilityBadgeColor("guidance_scale"), labelKey: "guidanceScale" },
1197
+ strength: { icon: SlidersHorizontal, iconColor: capabilityIconColor("strength"), color: capabilityBadgeColor("strength"), labelKey: "strength" },
1198
+ batch: { icon: Waves, iconColor: capabilityIconColor("batch"), color: capabilityBadgeColor("batch"), labelKey: "batchGeneration" }
1155
1199
  };
1156
1200
  const config = configs[capability];
1157
1201
  if (!config) return null;
@@ -1180,8 +1224,8 @@ function StatusBadge({ status, size = "sm" }) {
1180
1224
  function SourceBadge({ source, showIcon = true }) {
1181
1225
  const t = useYunUI().useT("common.badge");
1182
1226
  const configs = {
1183
- yaml: { icon: FileCode, color: "bg-purple-500/10 text-purple-600 dark:text-purple-400 border-purple-500/20", label: t("yaml") },
1184
- api: { icon: FileText, color: "bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20", label: t("api") }
1227
+ yaml: { icon: FileCode, color: "bg-purple-500/10 text-purple-700 dark:text-purple-400 border-purple-500/20", label: t("yaml") },
1228
+ api: { icon: FileText, color: "bg-blue-500/10 text-blue-700 dark:text-blue-400 border-blue-500/20", label: t("api") }
1185
1229
  };
1186
1230
  const config = configs[source.toLowerCase()];
1187
1231
  if (!config) return null;
@@ -1208,7 +1252,7 @@ function FeatureLockedState({ icon, title, description, noteTitle, noteText, cla
1208
1252
  /* @__PURE__ */ jsx("div", { className: "w-16 h-16 rounded-full bg-muted/50 flex items-center justify-center mx-auto mb-4", children: icon ?? /* @__PURE__ */ jsx(Sparkles, { className: "w-8 h-8 text-muted-foreground" }) }),
1209
1253
  /* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold mb-2", children: title }),
1210
1254
  description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mb-6", children: description }),
1211
- (noteTitle || noteText) && /* @__PURE__ */ jsx("div", { className: "card p-4 bg-muted/30 border border-dashed", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3 text-sm text-muted-foreground", children: [
1255
+ (noteTitle || noteText) && /* @__PURE__ */ jsx("div", { className: "card p-4 bg-muted/30 border border-dashed border-border", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3 text-sm text-muted-foreground", children: [
1212
1256
  /* @__PURE__ */ jsx(AlertCircle, { className: "w-5 h-5 shrink-0 mt-0.5" }),
1213
1257
  /* @__PURE__ */ jsxs("div", { className: "text-left", children: [
1214
1258
  noteTitle && /* @__PURE__ */ jsx("p", { className: "font-medium mb-1", children: noteTitle }),
@@ -1224,14 +1268,15 @@ function SessionItem({
1224
1268
  ip,
1225
1269
  time,
1226
1270
  current,
1227
- currentLabel,
1228
1271
  inactive,
1229
- inactiveLabel,
1230
1272
  selected,
1231
1273
  running,
1232
- runningLabel,
1233
1274
  onRevoke,
1234
1275
  revoking,
1276
+ labels,
1277
+ currentLabel,
1278
+ inactiveLabel,
1279
+ runningLabel,
1235
1280
  revokeLabel,
1236
1281
  className
1237
1282
  }) {
@@ -1256,13 +1301,13 @@ function SessionItem({
1256
1301
  "data-session-activity-rail": true
1257
1302
  }
1258
1303
  ),
1259
- running && runningLabel != null && /* @__PURE__ */ jsx("span", { className: "sr-only", children: runningLabel }),
1304
+ running && (labels?.running ?? runningLabel) != null && /* @__PURE__ */ jsx("span", { className: "sr-only", children: labels?.running ?? runningLabel }),
1260
1305
  icon != null && /* @__PURE__ */ jsx("div", { className: "w-8 h-8 rounded-lg bg-muted flex items-center justify-center shrink-0", children: icon }),
1261
1306
  /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
1262
1307
  /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
1263
1308
  /* @__PURE__ */ jsx("span", { className: "block min-w-0 flex-1 truncate text-xs font-medium", children: name }),
1264
- current && /* @__PURE__ */ jsx("span", { className: "text-[10px] px-1.5 py-0.5 rounded-full badge-success shrink-0", children: currentLabel }),
1265
- inactive && /* @__PURE__ */ jsx("span", { className: "text-[10px] px-1.5 py-0.5 rounded-full badge-neutral shrink-0", children: inactiveLabel })
1309
+ current && /* @__PURE__ */ jsx("span", { className: "text-[10px] px-1.5 py-0.5 rounded-full badge-success shrink-0", children: labels?.current ?? currentLabel }),
1310
+ inactive && /* @__PURE__ */ jsx("span", { className: "text-[10px] px-1.5 py-0.5 rounded-full badge-neutral shrink-0", children: labels?.inactive ?? inactiveLabel })
1266
1311
  ] }),
1267
1312
  detail && /* @__PURE__ */ jsx("div", { className: "text-[10px] text-(--text-tertiary) mt-0.5 truncate", children: detail }),
1268
1313
  (ip != null || time != null) && /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-2 mt-1 text-[10px] text-(--text-tertiary)", children: [
@@ -1282,8 +1327,8 @@ function SessionItem({
1282
1327
  type: "button",
1283
1328
  onClick: onRevoke,
1284
1329
  disabled: revoking,
1285
- "aria-label": revokeLabel,
1286
- title: revokeLabel,
1330
+ "aria-label": labels?.revoke ?? revokeLabel,
1331
+ title: labels?.revoke ?? revokeLabel,
1287
1332
  className: "p-1.5 hover:bg-error-soft rounded text-(--text-tertiary) hover:text-error transition-colors shrink-0 outline-none focus-visible:ring-2 focus-visible:ring-ring",
1288
1333
  children: revoking ? /* @__PURE__ */ jsx(Loader2, { size: 12, className: "animate-spin" }) : /* @__PURE__ */ jsx(LogOut, { size: 12 })
1289
1334
  }
@@ -1304,6 +1349,7 @@ function MetricBar({ icon, label, value, percentage, color, className }) {
1304
1349
  "div",
1305
1350
  {
1306
1351
  role: "progressbar",
1352
+ "aria-label": typeof label === "string" ? label : void 0,
1307
1353
  "aria-valuenow": Math.max(0, Math.min(100, percentage)),
1308
1354
  "aria-valuemin": 0,
1309
1355
  "aria-valuemax": 100,
@@ -1461,7 +1507,7 @@ function MediaBody({
1461
1507
  return /* @__PURE__ */ jsxs("div", { className: "flex h-full w-full flex-col items-center justify-center gap-1 bg-muted px-3 text-center", children: [
1462
1508
  /* @__PURE__ */ jsx(AlertCircle, { size: 22, className: "text-error" }),
1463
1509
  /* @__PURE__ */ jsx("span", { className: "text-xs text-error", children: status === "failed" ? labels.failed : labels.expired }),
1464
- item.error && /* @__PURE__ */ jsx("span", { className: "mt-0.5 max-w-[85%] truncate text-xs text-error/70", children: item.error })
1510
+ item.error && /* @__PURE__ */ jsx("span", { className: "mt-0.5 max-w-[85%] truncate text-xs text-error", children: item.error })
1465
1511
  ] });
1466
1512
  }
1467
1513
  if (kind === "audio") {
@@ -1750,36 +1796,40 @@ function MediaGallery({
1750
1796
  ] });
1751
1797
  }
1752
1798
  var TONES2 = {
1799
+ // Token-driven, matching Alert/Badge: the raw `blue/amber/red/green-500`
1800
+ // palette these used to carry is not the same colour as `--info`/`--warning`/
1801
+ // `--error`/`--success`, so a Banner and an Alert reading the same severity
1802
+ // rendered as two different hues and neither followed a brand theme.
1753
1803
  info: {
1754
- bg: "bg-linear-to-r from-blue-500/10 via-blue-500/5 to-blue-500/10",
1755
- border: "border-blue-500/25",
1756
- text: "text-blue-700 dark:text-blue-300",
1757
- icon: "text-blue-500",
1758
- dismissHover: "hover:bg-blue-500/10",
1804
+ bg: "bg-info-soft",
1805
+ border: "border-info-soft",
1806
+ text: "text-info",
1807
+ icon: "text-info",
1808
+ dismissHover: "hover:bg-info-soft",
1759
1809
  defaultIcon: /* @__PURE__ */ jsx(Info, { size: 16 })
1760
1810
  },
1761
1811
  warning: {
1762
- bg: "bg-linear-to-r from-amber-500/10 via-amber-500/5 to-amber-500/10",
1763
- border: "border-amber-500/25",
1764
- text: "text-amber-700 dark:text-amber-300",
1765
- icon: "text-amber-500",
1766
- dismissHover: "hover:bg-amber-500/10",
1812
+ bg: "bg-warning-soft",
1813
+ border: "border-warning-soft",
1814
+ text: "text-warning",
1815
+ icon: "text-warning",
1816
+ dismissHover: "hover:bg-warning-soft",
1767
1817
  defaultIcon: /* @__PURE__ */ jsx(AlertTriangle, { size: 16 })
1768
1818
  },
1769
1819
  critical: {
1770
- bg: "bg-linear-to-r from-red-500/10 via-red-500/5 to-red-500/10",
1771
- border: "border-red-500/25",
1772
- text: "text-red-700 dark:text-red-300",
1773
- icon: "text-red-500",
1774
- dismissHover: "hover:bg-red-500/10",
1820
+ bg: "bg-error-soft",
1821
+ border: "border-error-soft",
1822
+ text: "text-error",
1823
+ icon: "text-error",
1824
+ dismissHover: "hover:bg-error-soft",
1775
1825
  defaultIcon: /* @__PURE__ */ jsx(AlertCircle, { size: 16 })
1776
1826
  },
1777
1827
  success: {
1778
- bg: "bg-linear-to-r from-green-500/10 via-green-500/5 to-green-500/10",
1779
- border: "border-green-500/25",
1780
- text: "text-green-700 dark:text-green-300",
1781
- icon: "text-green-500",
1782
- dismissHover: "hover:bg-green-500/10",
1828
+ bg: "bg-success-soft",
1829
+ border: "border-success-soft",
1830
+ text: "text-success",
1831
+ icon: "text-success",
1832
+ dismissHover: "hover:bg-success-soft",
1783
1833
  defaultIcon: /* @__PURE__ */ jsx(CheckCircle2, { size: 16 })
1784
1834
  },
1785
1835
  neutral: {
@@ -1811,7 +1861,7 @@ function Banner({
1811
1861
  /* @__PURE__ */ jsx("span", { className: cn("text-sm font-medium", t.text), children: title }),
1812
1862
  description && /* @__PURE__ */ jsx("span", { className: cn("text-sm ml-2 hidden sm:inline opacity-70", t.text), children: description })
1813
1863
  ] }),
1814
- meta != null && /* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground/70 shrink-0", children: meta }),
1864
+ meta != null && /* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground shrink-0", children: meta }),
1815
1865
  actions && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 shrink-0", children: actions }),
1816
1866
  dismissible && /* @__PURE__ */ jsx(
1817
1867
  "button",
@@ -1862,9 +1912,9 @@ function NotificationItem({
1862
1912
  icon != null && /* @__PURE__ */ jsx("div", { className: cn("shrink-0 rounded-lg p-1.5", iconClassName ?? "bg-muted"), children: icon }),
1863
1913
  /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
1864
1914
  /* @__PURE__ */ jsx("p", { className: cn("text-sm leading-snug truncate", unread ? "font-medium" : "text-muted-foreground"), children: title }),
1865
- body && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground/60 mt-0.5 line-clamp-1", children: body })
1915
+ body && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-0.5 line-clamp-1", children: body })
1866
1916
  ] }),
1867
- time != null && /* @__PURE__ */ jsx("span", { className: "shrink-0 self-center text-[10px] text-muted-foreground/50", children: time })
1917
+ time != null && /* @__PURE__ */ jsx("span", { className: "shrink-0 self-center text-[10px] text-muted-foreground", children: time })
1868
1918
  ] });
1869
1919
  const rowClass = cn("flex items-center gap-2.5 px-3 py-2.5", dismissible ? "pr-9" : "pr-3");
1870
1920
  return /* @__PURE__ */ jsxs("div", { className: cn("group/notif relative rounded-xl hover:bg-foreground/5 transition-colors", className), children: [
@@ -1888,10 +1938,11 @@ function NotificationItem({
1888
1938
  function NotificationPanel({
1889
1939
  title,
1890
1940
  unreadCount = 0,
1891
- unreadLabel,
1892
1941
  loading,
1893
- loadingLabel,
1894
1942
  empty,
1943
+ labels,
1944
+ unreadLabel,
1945
+ loadingLabel,
1895
1946
  emptyLabel,
1896
1947
  footer,
1897
1948
  children,
@@ -1909,15 +1960,15 @@ function NotificationPanel({
1909
1960
  /* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold", children: title }),
1910
1961
  unreadCount > 0 && /* @__PURE__ */ jsxs("span", { className: "text-[10px] font-medium text-primary", children: [
1911
1962
  unreadCount,
1912
- unreadLabel ? /* @__PURE__ */ jsxs(Fragment, { children: [
1963
+ labels?.unread ?? unreadLabel ? /* @__PURE__ */ jsxs(Fragment, { children: [
1913
1964
  " ",
1914
- unreadLabel
1965
+ labels?.unread ?? unreadLabel
1915
1966
  ] }) : null
1916
1967
  ] })
1917
1968
  ] }),
1918
- /* @__PURE__ */ jsx("div", { className: "max-h-[400px] overflow-y-auto px-2 pb-2 flex flex-col gap-1", children: loading ? /* @__PURE__ */ jsx("div", { className: "p-4 text-center text-sm text-muted-foreground", children: loadingLabel }) : empty ? /* @__PURE__ */ jsxs("div", { className: "p-6 text-center", children: [
1969
+ /* @__PURE__ */ jsx("div", { className: "max-h-[400px] overflow-y-auto px-2 pb-2 flex flex-col gap-1", children: loading ? /* @__PURE__ */ jsx("div", { className: "p-4 text-center text-sm text-muted-foreground", children: labels?.loading ?? loadingLabel }) : empty ? /* @__PURE__ */ jsxs("div", { className: "p-6 text-center", children: [
1919
1970
  /* @__PURE__ */ jsx(Bell, { size: 24, className: "mx-auto mb-2 text-muted-foreground/40" }),
1920
- /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: emptyLabel })
1971
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: labels?.empty ?? emptyLabel })
1921
1972
  ] }) : children }),
1922
1973
  footer && /* @__PURE__ */ jsx("div", { className: "text-center text-xs text-muted-foreground hover:text-foreground transition-colors [&>a]:block [&>a]:py-2.5", children: footer })
1923
1974
  ]
@@ -2128,7 +2179,608 @@ function AvatarUploader({
2128
2179
  }
2129
2180
  );
2130
2181
  }
2182
+ function Eyebrow({ icon, children, className, ...props }) {
2183
+ return /* @__PURE__ */ jsxs(
2184
+ "div",
2185
+ {
2186
+ className: cn(
2187
+ "inline-flex items-center gap-2 rounded-full border border-(--accent-muted) bg-(--accent-subtle) px-3 py-1",
2188
+ className
2189
+ ),
2190
+ ...props,
2191
+ children: [
2192
+ icon,
2193
+ /* @__PURE__ */ jsx("span", { className: "text-xs font-medium", children })
2194
+ ]
2195
+ }
2196
+ );
2197
+ }
2198
+ function SectionHeading({
2199
+ badge,
2200
+ icon,
2201
+ title,
2202
+ subtitle,
2203
+ align = "center",
2204
+ animate = true,
2205
+ className,
2206
+ ...props
2207
+ }) {
2208
+ const enter = animate ? "animate-enter" : void 0;
2209
+ return /* @__PURE__ */ jsxs(
2210
+ "div",
2211
+ {
2212
+ className: cn("mb-16", align === "center" ? "text-center" : "text-left", className),
2213
+ ...props,
2214
+ children: [
2215
+ badge != null && /* @__PURE__ */ jsx(Eyebrow, { icon, className: cn("mb-4", enter), children: badge }),
2216
+ /* @__PURE__ */ jsx(
2217
+ "h2",
2218
+ {
2219
+ className: cn("heading-xl mb-4 text-balance", enter),
2220
+ style: animate ? { animationDelay: "100ms" } : void 0,
2221
+ children: title
2222
+ }
2223
+ ),
2224
+ subtitle != null && /* @__PURE__ */ jsx(
2225
+ "p",
2226
+ {
2227
+ className: cn(
2228
+ "text-body text-lg text-pretty",
2229
+ align === "center" && "mx-auto max-w-2xl",
2230
+ enter
2231
+ ),
2232
+ style: animate ? { animationDelay: "200ms" } : void 0,
2233
+ children: subtitle
2234
+ }
2235
+ )
2236
+ ]
2237
+ }
2238
+ );
2239
+ }
2240
+ function FeatureCard({
2241
+ icon,
2242
+ title,
2243
+ description,
2244
+ delay,
2245
+ children,
2246
+ className,
2247
+ style,
2248
+ ...props
2249
+ }) {
2250
+ return /* @__PURE__ */ jsxs(
2251
+ "div",
2252
+ {
2253
+ className: cn(
2254
+ "group relative h-full overflow-hidden rounded-2xl border border-border bg-card/50 p-8 shadow-sm backdrop-blur-xl",
2255
+ "transition-all duration-300 hover:-translate-y-1 hover:shadow-xl",
2256
+ delay != null && "animate-enter",
2257
+ className
2258
+ ),
2259
+ style: delay != null ? { animationDelay: `${delay}ms`, ...style } : style,
2260
+ ...props,
2261
+ children: [
2262
+ /* @__PURE__ */ jsx(
2263
+ "div",
2264
+ {
2265
+ "aria-hidden": true,
2266
+ className: "pointer-events-none absolute inset-x-0 top-0 h-px bg-linear-to-r from-transparent via-foreground/15 to-transparent"
2267
+ }
2268
+ ),
2269
+ /* @__PURE__ */ jsx(
2270
+ "div",
2271
+ {
2272
+ "aria-hidden": true,
2273
+ className: "pointer-events-none absolute -top-16 -right-16 h-40 w-40 rounded-full bg-foreground/5 blur-3xl opacity-0 transition-opacity duration-500 group-hover:opacity-100"
2274
+ }
2275
+ ),
2276
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
2277
+ icon && /* @__PURE__ */ jsx("div", { className: "feature-icon mb-5 transition-transform duration-200 group-hover:scale-105", children: icon }),
2278
+ /* @__PURE__ */ jsx("h3", { className: "heading-md mb-3", children: title }),
2279
+ description != null && /* @__PURE__ */ jsx("p", { className: "text-body leading-relaxed", children: description }),
2280
+ children
2281
+ ] })
2282
+ ]
2283
+ }
2284
+ );
2285
+ }
2286
+ function MembershipCard({
2287
+ brand,
2288
+ badge,
2289
+ watermark,
2290
+ label,
2291
+ status,
2292
+ stats = [],
2293
+ chip = true,
2294
+ className,
2295
+ ...props
2296
+ }) {
2297
+ return /* @__PURE__ */ jsxs(
2298
+ "div",
2299
+ {
2300
+ className: cn(
2301
+ "group relative w-full max-w-md mx-auto lg:mx-0 aspect-[1.586/1] min-h-56 rounded-[20px]",
2302
+ "bg-foreground/80 backdrop-blur-2xl border border-background/15 text-background",
2303
+ "shadow-2xl overflow-hidden select-none animate-enter",
2304
+ "transition-transform duration-300 hover:-translate-y-1",
2305
+ className
2306
+ ),
2307
+ ...props,
2308
+ children: [
2309
+ /* @__PURE__ */ jsx("div", { className: "absolute -top-1/3 -left-1/4 w-2/3 h-2/3 rounded-full bg-background/15 blur-3xl" }),
2310
+ /* @__PURE__ */ jsx("div", { className: "absolute -bottom-1/3 -right-1/4 w-1/2 h-2/3 rounded-full bg-background/8 blur-3xl" }),
2311
+ watermark != null && /* @__PURE__ */ jsx("div", { "aria-hidden": true, className: "absolute -right-8 -bottom-9 opacity-[0.06]", children: watermark }),
2312
+ /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute top-0 -left-1/3 h-full w-1/3 -skew-x-12 bg-background/15 blur-xl translate-x-[-200%] group-hover:translate-x-[450%] transition-transform duration-[900ms] ease-out" }),
2313
+ /* @__PURE__ */ jsxs("div", { className: "relative h-full flex flex-col justify-between p-6 sm:p-7", children: [
2314
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
2315
+ brand != null && /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold tracking-tight", children: brand }),
2316
+ badge != null && /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-background/15 text-[11px] font-medium", children: [
2317
+ badge.icon,
2318
+ badge.label
2319
+ ] })
2320
+ ] }),
2321
+ /* @__PURE__ */ jsxs("div", { className: "flex items-end justify-between gap-4", children: [
2322
+ /* @__PURE__ */ jsxs("div", { children: [
2323
+ label != null && /* @__PURE__ */ jsx("div", { className: "text-[10px] uppercase tracking-[0.22em] opacity-50 mb-1.5", children: label }),
2324
+ status != null && /* @__PURE__ */ jsx("div", { className: "text-lg font-medium leading-tight", children: status })
2325
+ ] }),
2326
+ chip && /* @__PURE__ */ jsx("div", { className: "hidden sm:block w-9 h-7 rounded-md bg-background/15 border border-background/10 shrink-0" })
2327
+ ] }),
2328
+ stats.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex items-end gap-6", children: stats.map((stat, i) => /* @__PURE__ */ jsxs("div", { children: [
2329
+ /* @__PURE__ */ jsx("div", { className: "text-base font-semibold tabular-nums leading-none", children: stat.value }),
2330
+ /* @__PURE__ */ jsx("div", { className: "text-[11px] opacity-50 mt-1", children: stat.label })
2331
+ ] }, i)) })
2332
+ ] })
2333
+ ]
2334
+ }
2335
+ );
2336
+ }
2337
+ function CTASection({
2338
+ title,
2339
+ body,
2340
+ actions,
2341
+ eyebrow,
2342
+ animate = true,
2343
+ className,
2344
+ ...props
2345
+ }) {
2346
+ const enter = animate ? "animate-enter" : void 0;
2347
+ return /* @__PURE__ */ jsxs(
2348
+ "div",
2349
+ {
2350
+ className: cn(
2351
+ // `isolate` is load-bearing: the radial wash below is `-z-10`, and `relative`
2352
+ // alone is NOT a stacking context — without this the wash escapes to the
2353
+ // root and disappears the moment a consumer nests this in an opaque box.
2354
+ "relative isolate overflow-hidden rounded-3xl border border-border p-12 text-center md:p-16",
2355
+ className
2356
+ ),
2357
+ ...props,
2358
+ children: [
2359
+ /* @__PURE__ */ jsx(
2360
+ "div",
2361
+ {
2362
+ "aria-hidden": true,
2363
+ className: "absolute inset-0 -z-10",
2364
+ style: {
2365
+ background: "radial-gradient(70% 120% at 50% 0%, var(--accent-subtle), transparent 70%)"
2366
+ }
2367
+ }
2368
+ ),
2369
+ eyebrow != null && /* @__PURE__ */ jsx("div", { className: cn("mb-4", enter), children: eyebrow }),
2370
+ /* @__PURE__ */ jsx("h2", { className: cn("heading-xl mb-4 text-balance", enter), children: title }),
2371
+ body != null && /* @__PURE__ */ jsx(
2372
+ "p",
2373
+ {
2374
+ className: cn("text-body mx-auto mb-8 max-w-xl text-lg text-pretty", enter),
2375
+ style: animate ? { animationDelay: "100ms" } : void 0,
2376
+ children: body
2377
+ }
2378
+ ),
2379
+ actions != null && /* @__PURE__ */ jsx(
2380
+ "div",
2381
+ {
2382
+ className: cn("flex flex-wrap items-center justify-center gap-3", enter),
2383
+ style: animate ? { animationDelay: "200ms" } : void 0,
2384
+ children: actions
2385
+ }
2386
+ )
2387
+ ]
2388
+ }
2389
+ );
2390
+ }
2391
+ function PullQuote({
2392
+ children,
2393
+ cite,
2394
+ showIcon = true,
2395
+ className,
2396
+ ...props
2397
+ }) {
2398
+ return /* @__PURE__ */ jsxs("figure", { className: cn("mx-auto max-w-4xl text-center", className), ...props, children: [
2399
+ showIcon && /* @__PURE__ */ jsx(Quote, { "aria-hidden": true, className: "mx-auto mb-6 h-8 w-8 text-muted-foreground/30" }),
2400
+ /* @__PURE__ */ jsx("blockquote", { className: "bg-linear-to-r from-foreground to-muted-foreground/70 bg-clip-text text-2xl leading-snug font-semibold tracking-tight text-balance text-transparent md:text-3xl", children }),
2401
+ cite != null && /* @__PURE__ */ jsx("figcaption", { className: "text-caption mt-6", children: cite })
2402
+ ] });
2403
+ }
2404
+ function MarketingHero({
2405
+ badge,
2406
+ title,
2407
+ subtitle,
2408
+ actions,
2409
+ facts,
2410
+ scrollToId,
2411
+ scrollLabel = "Scroll down",
2412
+ fullHeight = true,
2413
+ className,
2414
+ ...props
2415
+ }) {
2416
+ return /* @__PURE__ */ jsxs(
2417
+ "section",
2418
+ {
2419
+ className: cn(
2420
+ // `isolate` is load-bearing: the radial wash below is `-z-10`, and `relative`
2421
+ // alone is NOT a stacking context, so the wash would escape to the root
2422
+ // and vanish behind any opaque ancestor a consumer wraps this in.
2423
+ "relative isolate flex flex-col items-center justify-center px-6 pt-32 pb-28",
2424
+ fullHeight && "min-h-dvh",
2425
+ className
2426
+ ),
2427
+ ...props,
2428
+ children: [
2429
+ /* @__PURE__ */ jsx(
2430
+ "div",
2431
+ {
2432
+ "aria-hidden": true,
2433
+ className: "absolute inset-0 -z-10",
2434
+ style: {
2435
+ background: "radial-gradient(60% 50% at 50% 30%, var(--accent-subtle), transparent 70%)"
2436
+ }
2437
+ }
2438
+ ),
2439
+ /* @__PURE__ */ jsxs("div", { className: "relative z-10 mx-auto w-full max-w-6xl text-center", children: [
2440
+ badge != null && /* @__PURE__ */ jsx("div", { className: "mb-8 animate-enter", children: badge }),
2441
+ /* @__PURE__ */ jsx(
2442
+ "h1",
2443
+ {
2444
+ className: "mb-6 animate-enter text-4xl font-bold tracking-tight text-balance sm:text-5xl md:text-6xl lg:text-7xl",
2445
+ style: { animationDelay: "100ms" },
2446
+ children: title
2447
+ }
2448
+ ),
2449
+ subtitle != null && /* @__PURE__ */ jsx(
2450
+ "p",
2451
+ {
2452
+ className: "mx-auto mb-10 max-w-2xl animate-enter text-lg leading-relaxed text-pretty text-muted-foreground md:text-xl",
2453
+ style: { animationDelay: "300ms" },
2454
+ children: subtitle
2455
+ }
2456
+ ),
2457
+ actions != null && /* @__PURE__ */ jsx(
2458
+ "div",
2459
+ {
2460
+ className: "flex animate-enter flex-col items-center justify-center gap-4 sm:flex-row",
2461
+ style: { animationDelay: "400ms" },
2462
+ children: actions
2463
+ }
2464
+ ),
2465
+ facts && facts.length > 0 && /* @__PURE__ */ jsx(
2466
+ "div",
2467
+ {
2468
+ className: "mt-8 flex animate-enter flex-wrap items-center justify-center gap-2",
2469
+ style: { animationDelay: "500ms" },
2470
+ children: facts.map((fact, i) => /* @__PURE__ */ jsx(
2471
+ "span",
2472
+ {
2473
+ className: "rounded-full border border-border bg-card/60 px-3 py-1 text-xs text-muted-foreground backdrop-blur-sm",
2474
+ children: fact
2475
+ },
2476
+ i
2477
+ ))
2478
+ }
2479
+ )
2480
+ ] }),
2481
+ scrollToId && /* @__PURE__ */ jsx(
2482
+ "a",
2483
+ {
2484
+ href: `#${scrollToId}`,
2485
+ "aria-label": scrollLabel,
2486
+ className: "absolute bottom-8 left-1/2 z-10 -translate-x-1/2 animate-bounce text-muted-foreground/60 transition-colors hover:text-foreground",
2487
+ children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-5 w-5" })
2488
+ }
2489
+ )
2490
+ ]
2491
+ }
2492
+ );
2493
+ }
2494
+ function HeroAccent({ children }) {
2495
+ return /* @__PURE__ */ jsx("span", { className: "bg-linear-to-r from-foreground via-foreground to-muted-foreground/70 bg-clip-text text-transparent", children });
2496
+ }
2497
+ function ProseArticle({ children, prose = true, className, ...props }) {
2498
+ return /* @__PURE__ */ jsx("article", { className: cn("mx-auto max-w-3xl px-6 py-16", className), ...props, children: prose ? /* @__PURE__ */ jsx("div", { className: "prose prose-neutral dark:prose-invert max-w-none", children }) : children });
2499
+ }
2500
+ function BackLink({ href, children, className }) {
2501
+ const { Link } = useYunUI();
2502
+ return /* @__PURE__ */ jsxs(
2503
+ Link,
2504
+ {
2505
+ href,
2506
+ className: cn(
2507
+ "mb-8 inline-flex items-center gap-1 text-sm text-muted-foreground transition-colors hover:text-foreground",
2508
+ className
2509
+ ),
2510
+ children: [
2511
+ /* @__PURE__ */ jsx(ChevronLeft, { size: 16, "aria-hidden": true }),
2512
+ children
2513
+ ]
2514
+ }
2515
+ );
2516
+ }
2517
+ function AuthShell({
2518
+ brand,
2519
+ homeHref,
2520
+ title,
2521
+ subtitle,
2522
+ error,
2523
+ icon,
2524
+ children,
2525
+ footer,
2526
+ centered = false,
2527
+ width = "sm",
2528
+ className,
2529
+ cardClassName,
2530
+ ...props
2531
+ }) {
2532
+ const { Link } = useYunUI();
2533
+ const brandRowClass = "flex items-center justify-center gap-2.5 mb-8";
2534
+ return /* @__PURE__ */ jsx(
2535
+ "div",
2536
+ {
2537
+ className: cn(
2538
+ "min-h-dvh bg-background flex items-center justify-center px-6",
2539
+ className
2540
+ ),
2541
+ ...props,
2542
+ children: /* @__PURE__ */ jsxs("div", { className: cn("w-full", width === "sm" ? "max-w-sm" : "max-w-md"), children: [
2543
+ brand != null && (homeHref ? /* @__PURE__ */ jsx(Link, { href: homeHref, className: brandRowClass, children: brand }) : /* @__PURE__ */ jsx("div", { className: brandRowClass, children: brand })),
2544
+ /* @__PURE__ */ jsxs(
2545
+ "div",
2546
+ {
2547
+ className: cn(
2548
+ "p-6 bg-card border border-border rounded-xl",
2549
+ centered && "text-center",
2550
+ cardClassName
2551
+ ),
2552
+ children: [
2553
+ icon != null && /* @__PURE__ */ jsx("div", { className: "flex justify-center mb-4", children: icon }),
2554
+ title != null && /* @__PURE__ */ jsx(
2555
+ "h1",
2556
+ {
2557
+ className: cn(
2558
+ "text-xl font-semibold text-center",
2559
+ subtitle != null ? "mb-2" : "mb-6"
2560
+ ),
2561
+ children: title
2562
+ }
2563
+ ),
2564
+ subtitle != null && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm text-center mb-6", children: subtitle }),
2565
+ error ? /* @__PURE__ */ jsx("div", { className: "mb-4 p-3 bg-error-soft text-error text-sm rounded-lg border border-error-soft", children: error }) : null,
2566
+ children
2567
+ ]
2568
+ }
2569
+ ),
2570
+ footer != null && /* @__PURE__ */ jsx("div", { className: "mt-6 text-center text-sm text-muted-foreground", children: footer })
2571
+ ] })
2572
+ }
2573
+ );
2574
+ }
2575
+ function TableState({
2576
+ children,
2577
+ loading = false,
2578
+ surface = "plain",
2579
+ className,
2580
+ ...props
2581
+ }) {
2582
+ return /* @__PURE__ */ jsxs(
2583
+ "div",
2584
+ {
2585
+ className: cn(
2586
+ "flex items-center justify-center gap-2 p-8 text-center text-sm text-muted-foreground",
2587
+ surface === "card" && "card",
2588
+ className
2589
+ ),
2590
+ ...props,
2591
+ children: [
2592
+ loading && /* @__PURE__ */ jsx(Loader2, { "aria-hidden": true, className: "h-4 w-4 animate-spin" }),
2593
+ children
2594
+ ]
2595
+ }
2596
+ );
2597
+ }
2598
+ function StatGrid({ children, columns = 4, className, ...props }) {
2599
+ return /* @__PURE__ */ jsx(
2600
+ "div",
2601
+ {
2602
+ className: cn(
2603
+ "grid grid-cols-2 gap-4",
2604
+ columns === 2 && "sm:grid-cols-2",
2605
+ columns === 3 && "sm:grid-cols-3",
2606
+ columns === 4 && "sm:grid-cols-4",
2607
+ className
2608
+ ),
2609
+ ...props,
2610
+ children
2611
+ }
2612
+ );
2613
+ }
2614
+ function DashboardPage({
2615
+ children,
2616
+ width = "7xl",
2617
+ className,
2618
+ ...props
2619
+ }) {
2620
+ return /* @__PURE__ */ jsx(
2621
+ "div",
2622
+ {
2623
+ className: cn(
2624
+ "mx-auto space-y-6",
2625
+ width === "5xl" && "max-w-5xl",
2626
+ width === "6xl" && "max-w-6xl",
2627
+ width === "7xl" && "max-w-7xl",
2628
+ className
2629
+ ),
2630
+ ...props,
2631
+ children
2632
+ }
2633
+ );
2634
+ }
2635
+ function SectionRow({ title, action, className, ...props }) {
2636
+ return /* @__PURE__ */ jsxs("div", { className: cn("mb-4 flex items-center justify-between gap-3", className), ...props, children: [
2637
+ /* @__PURE__ */ jsx("h2", { className: "text-sm font-semibold text-foreground", children: title }),
2638
+ action
2639
+ ] });
2640
+ }
2641
+ function SectionNav({ items, offset = 112, label = "Sections", className }) {
2642
+ const [active, setActive] = useState(items[0]?.id ?? null);
2643
+ useEffect(() => {
2644
+ if (items.length === 0) return;
2645
+ const observer = new IntersectionObserver(
2646
+ (entries) => {
2647
+ const visible = entries.filter((e) => e.isIntersecting).sort((a, b) => a.boundingClientRect.top - b.boundingClientRect.top);
2648
+ if (visible[0]) setActive(visible[0].target.id);
2649
+ },
2650
+ {
2651
+ // Shrink the viewport to a band just under the header: without it a
2652
+ // section counts as visible while it is still behind the navbar.
2653
+ rootMargin: `-${offset}px 0px -55% 0px`,
2654
+ threshold: 0
2655
+ }
2656
+ );
2657
+ for (const item of items) {
2658
+ const el = document.getElementById(item.id);
2659
+ if (el) observer.observe(el);
2660
+ }
2661
+ return () => observer.disconnect();
2662
+ }, [items, offset]);
2663
+ if (items.length === 0) return null;
2664
+ return /* @__PURE__ */ jsx("nav", { "aria-label": label, className, children: /* @__PURE__ */ jsx("ul", { className: "space-y-0.5", children: items.map((item) => {
2665
+ const isActive = item.id === active;
2666
+ return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
2667
+ "a",
2668
+ {
2669
+ href: `#${item.id}`,
2670
+ "aria-current": isActive ? "true" : void 0,
2671
+ className: cn(
2672
+ "group flex items-center justify-between gap-2 rounded-lg px-3 py-1.5 text-sm transition-colors",
2673
+ isActive ? "bg-foreground/5 font-medium text-foreground" : "text-muted-foreground hover:bg-foreground/5 hover:text-foreground"
2674
+ ),
2675
+ children: [
2676
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: item.label }),
2677
+ item.count !== void 0 && /* @__PURE__ */ jsx(
2678
+ "span",
2679
+ {
2680
+ className: cn(
2681
+ "shrink-0 text-xs tabular-nums",
2682
+ isActive ? "text-foreground" : "text-muted-foreground"
2683
+ ),
2684
+ children: item.count
2685
+ }
2686
+ )
2687
+ ]
2688
+ }
2689
+ ) }, item.id);
2690
+ }) }) });
2691
+ }
2692
+ var DEFAULT_WEEKDAYS = ["S", "M", "T", "W", "T", "F", "S"];
2693
+ function parts(date) {
2694
+ const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(date);
2695
+ return m ? { y: +m[1], m: +m[2], d: +m[3] } : null;
2696
+ }
2697
+ function pad(n) {
2698
+ return String(n).padStart(2, "0");
2699
+ }
2700
+ function monthShape(year, month) {
2701
+ return {
2702
+ days: new Date(Date.UTC(year, month, 0)).getUTCDate(),
2703
+ firstDay: new Date(Date.UTC(year, month - 1, 1)).getUTCDay()
2704
+ };
2705
+ }
2706
+ function ArchiveCalendar({
2707
+ dates,
2708
+ href,
2709
+ maxMonths = 24,
2710
+ weekdays = DEFAULT_WEEKDAYS,
2711
+ formatMonth = (year, month) => `${year}-${String(month).padStart(2, "0")}`,
2712
+ formatCount,
2713
+ formatDayLabel = (date) => date,
2714
+ className = ""
2715
+ }) {
2716
+ const { Link } = useYunUI();
2717
+ const have = new Set(dates);
2718
+ const sorted = [...dates].sort();
2719
+ const newest = parts(sorted.at(-1) ?? "");
2720
+ const oldest = parts(sorted[0] ?? "");
2721
+ if (!newest || !oldest) return null;
2722
+ const span = (newest.y - oldest.y) * 12 + (newest.m - oldest.m) + 1;
2723
+ const grid = [];
2724
+ for (let back = 0; back < Math.min(span, maxMonths); back++) {
2725
+ const month = newest.m - back;
2726
+ grid.push({
2727
+ year: newest.y + Math.floor((month - 1) / 12),
2728
+ month: ((month - 1) % 12 + 12) % 12 + 1
2729
+ });
2730
+ }
2731
+ return /* @__PURE__ */ jsx("div", { className: `grid gap-6 sm:grid-cols-2 lg:grid-cols-3 ${className}`, children: grid.map(({ year, month }) => {
2732
+ const { days, firstDay } = monthShape(year, month);
2733
+ const cells = [
2734
+ ...Array.from({ length: firstDay }, () => null),
2735
+ ...Array.from({ length: days }, (_, i) => i + 1)
2736
+ ];
2737
+ const filled = cells.filter(
2738
+ (day) => day && have.has(`${year}-${pad(month)}-${pad(day)}`)
2739
+ ).length;
2740
+ return /* @__PURE__ */ jsxs("div", { children: [
2741
+ /* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-baseline justify-between", children: [
2742
+ /* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold tracking-tight tabular-nums", children: formatMonth(year, month) }),
2743
+ formatCount && /* @__PURE__ */ jsx("span", { className: "text-caption tabular-nums", children: formatCount(filled) })
2744
+ ] }),
2745
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-7 gap-1", role: "presentation", children: [
2746
+ weekdays.map((label, i) => /* @__PURE__ */ jsx(
2747
+ "div",
2748
+ {
2749
+ "aria-hidden": true,
2750
+ className: "text-caption grid h-6 place-items-center text-[0.6875rem]",
2751
+ children: label
2752
+ },
2753
+ `${label}-${i}`
2754
+ )),
2755
+ cells.map((day, i) => {
2756
+ if (!day) return /* @__PURE__ */ jsx("div", { "aria-hidden": true }, `pad-${i}`);
2757
+ const date = `${year}-${pad(month)}-${pad(day)}`;
2758
+ if (!have.has(date)) {
2759
+ return /* @__PURE__ */ jsx(
2760
+ "div",
2761
+ {
2762
+ className: "text-muted-foreground grid h-8 place-items-center text-xs tabular-nums",
2763
+ children: day
2764
+ },
2765
+ date
2766
+ );
2767
+ }
2768
+ return /* @__PURE__ */ jsx(
2769
+ Link,
2770
+ {
2771
+ href: href(date),
2772
+ className: "border-border hover:border-(--accent) hover:text-(--accent) grid h-8 place-items-center rounded-md border text-xs font-medium tabular-nums transition-colors",
2773
+ "aria-label": formatDayLabel(date),
2774
+ children: day
2775
+ },
2776
+ date
2777
+ );
2778
+ })
2779
+ ] })
2780
+ ] }, `${year}-${month}`);
2781
+ }) });
2782
+ }
2131
2783
 
2132
- export { AccountLockedCard, ActiveBadge, AudioPlayer, AvatarUploader, BackgroundEffects, Banner, BlogCard, BlogPagination, BlogPostHeader, CapabilityBadge, CategoryFilter, CodeBlock, CodeDemo, ConnectedAccountRow, DeprecatedBadge, ErrorBoundary, FAQ, FeatureLockedState, FellowBadge, FellowsBanner, LLMCopyButton, LinkRow, MediaEmptyState, MediaErrorState, MediaGallery, MediaLoadingState, MediaPageHeader, MetricBar, NavStateIndicator, NotificationBell, NotificationItem, NotificationPanel, PageEmptyState, PageErrorState, PageHeader, PageLayout, PageLoadingState, ReadingProgress, SessionItem, SettingRow, SettingsShell, Sidebar, SimplePagination, SourceBadge, StatCard, StatusBadge, ViewOptions };
2784
+ export { AccountLockedCard, ActiveBadge, ArchiveCalendar, AudioPlayer, AuthShell, AvatarUploader, BackLink, BackgroundEffects, Banner, BlogCard, BlogPagination, BlogPostHeader, CTASection, CapabilityBadge, CategoryFilter, CodeBlock, CodeDemo, ConnectedAccountRow, DashboardPage, DeprecatedBadge, ErrorBoundary, Eyebrow, FAQ, FeatureCard, FeatureLockedState, FellowBadge, FellowsBanner, HeroAccent, LLMCopyButton, LinkRow, MarketingHero, MediaEmptyState, MediaErrorState, MediaGallery, MediaLoadingState, MediaPageHeader, MembershipCard, MetricBar, NavStateIndicator, NotificationBell, NotificationItem, NotificationPanel, PageEmptyState, PageErrorState, PageHeader, PageLayout, PageLoadingState, ProseArticle, PullQuote, ReadingProgress, SectionHeading, SectionNav, SectionRow, SessionItem, SettingRow, SettingsShell, Sidebar, SimplePagination, SourceBadge, StatCard, StatGrid, StatusBadge, TableState, ViewOptions };
2133
2785
  //# sourceMappingURL=patterns.js.map
2134
2786
  //# sourceMappingURL=patterns.js.map