@yuhuanowo/yunui 0.2.12 → 0.2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/patterns.js CHANGED
@@ -1,12 +1,12 @@
1
1
  "use client";
2
- import { Button, Card, Badge, Avatar, AvatarImage, AvatarFallback, IconButton, Spinner } from './chunk-65XAR7FY.js';
3
- import { copyToClipboard } from './chunk-BO6CDGJS.js';
4
- export { Footer } from './chunk-BO6CDGJS.js';
5
- import { cn } from './chunk-TFZKMJGF.js';
2
+ import { Button, Card, Badge, Avatar, AvatarImage, AvatarFallback, IconButton, Spinner } from './chunk-VXFEANVX.js';
3
+ import { copyToClipboard } from './chunk-N53PNMPJ.js';
4
+ export { Footer } from './chunk-N53PNMPJ.js';
5
+ import { cn } from './chunk-GHO4RCDR.js';
6
6
  import { useYunUI } from './chunk-U2LNRVMI.js';
7
7
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
8
  import React, { useState, useEffect, useCallback, useRef } from 'react';
9
- import { AlertCircle, RefreshCw, Check, Copy, Plus, FileText, ExternalLink, Calendar, Clock, User, ChevronLeft, ChevronRight, PanelLeftClose, X, ArrowUpRight, ArrowDownRight, GraduationCap, Award, Waves, SlidersHorizontal, Layers, Fingerprint, Ban, Image, Brain, Eye, Code, MessageSquare, XCircle, Zap, CheckCircle, FileCode, EyeOff } from 'lucide-react';
9
+ import { AlertCircle, RefreshCw, Check, Copy, Plus, FileText, ExternalLink, Calendar, Clock, User, ChevronLeft, ChevronRight, 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, Bell, Trash2, Camera, Info, CheckCircle2, AlertTriangle } from 'lucide-react';
10
10
 
11
11
  function BackgroundEffects() {
12
12
  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(
@@ -162,7 +162,7 @@ function CodeBlock({
162
162
  const handleTabChange = (index) => {
163
163
  setActiveTab(index);
164
164
  };
165
- return /* @__PURE__ */ jsxs("div", { className: cn("card overflow-hidden", className), children: [
165
+ return /* @__PURE__ */ jsxs("div", { className: cn("card overflow-hidden max-w-full min-w-0", className), children: [
166
166
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-2.5 border-b border-(--border-hairline) bg-(--bg-elevated)", children: [
167
167
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2.5", children: [
168
168
  /* @__PURE__ */ jsxs("div", { className: "flex gap-1", children: [
@@ -175,7 +175,7 @@ function CodeBlock({
175
175
  {
176
176
  onClick: () => handleTabChange(index),
177
177
  className: cn(
178
- "px-3 py-1 rounded-md text-xs font-medium transition-all",
178
+ "px-3 py-1 rounded-md text-xs font-medium transition-all outline-none focus-visible:ring-2 focus-visible:ring-ring",
179
179
  activeTab === index ? "bg-(--accent-subtle) text-(--text-primary)" : "text-(--text-tertiary) hover:text-(--text-secondary) hover:bg-(--accent-subtle)/50"
180
180
  ),
181
181
  children: tab.label
@@ -187,7 +187,7 @@ function CodeBlock({
187
187
  "button",
188
188
  {
189
189
  onClick: handleCopy,
190
- className: "flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium transition-all hover:bg-(--accent-subtle)",
190
+ className: "flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium transition-all hover:bg-(--accent-subtle) outline-none focus-visible:ring-2 focus-visible:ring-ring",
191
191
  children: copied ? /* @__PURE__ */ jsxs(Fragment, { children: [
192
192
  /* @__PURE__ */ jsx(Check, { className: "w-3.5 h-3.5 text-(--success)" }),
193
193
  /* @__PURE__ */ jsx("span", { className: "text-(--success)", children: t("copied") })
@@ -268,14 +268,15 @@ function FAQ({ items, defaultOpenIndex = 0 }) {
268
268
  {
269
269
  className: cn(
270
270
  "glass-card overflow-hidden transition-all duration-300",
271
- openIndex === i ? "bg-card/60 ring-1 ring-accent-muted" : "hover:bg-card/50"
271
+ openIndex === i ? "bg-card/60 ring-1 ring-(--accent-muted)" : "hover:bg-card/50"
272
272
  ),
273
273
  children: [
274
274
  /* @__PURE__ */ jsxs(
275
275
  "button",
276
276
  {
277
277
  onClick: () => setOpenIndex(openIndex === i ? null : i),
278
- className: "w-full flex items-center justify-between p-6 text-left gap-4",
278
+ "aria-expanded": openIndex === i,
279
+ className: "w-full flex items-center justify-between p-6 text-left gap-4 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset rounded-[inherit]",
279
280
  children: [
280
281
  /* @__PURE__ */ jsx("span", { className: "font-semibold text-foreground flex-1 min-w-0", children: faq.question }),
281
282
  /* @__PURE__ */ jsx("span", { className: cn("text-muted-foreground transition-transform duration-300 shrink-0", openIndex === i ? "rotate-45" : ""), children: /* @__PURE__ */ jsx(Plus, { className: "w-5 h-5" }) })
@@ -392,7 +393,8 @@ function BlogCard({
392
393
  const { Link } = useYunUI();
393
394
  const formattedDate = date ? formatDate(date, locale) : null;
394
395
  const isFeatured = variant === "featured";
395
- return /* @__PURE__ */ jsx(Link, { href: url, className: "block h-full", children: /* @__PURE__ */ jsxs(Card, { hover: true, className: `overflow-hidden h-full flex flex-col ${isFeatured ? "md:col-span-2" : ""}`, children: [
396
+ return /* @__PURE__ */ jsxs(Card, { hover: true, className: `group relative overflow-hidden h-full flex flex-col ${isFeatured ? "md:col-span-2" : ""}`, children: [
397
+ /* @__PURE__ */ jsx(Link, { href: url, "aria-label": title, className: "absolute inset-0 z-0 outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-[inherit]" }),
396
398
  /* @__PURE__ */ jsx("div", { className: "aspect-video w-full overflow-hidden bg-muted flex-shrink-0", children: coverImage ? /* @__PURE__ */ jsx(
397
399
  "img",
398
400
  {
@@ -420,16 +422,11 @@ function BlogCard({
420
422
  author.name
421
423
  ] })
422
424
  ] }),
423
- tags && tags.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 mt-3", children: tags.slice(0, 3).map((tag) => /* @__PURE__ */ jsxs(
424
- "button",
425
+ tags && tags.length > 0 && /* @__PURE__ */ jsx("div", { className: "relative z-10 flex flex-wrap gap-1 mt-3", children: tags.slice(0, 3).map((tag) => /* @__PURE__ */ jsxs(
426
+ Link,
425
427
  {
426
- type: "button",
427
- onClick: (e) => {
428
- e.preventDefault();
429
- e.stopPropagation();
430
- window.location.href = `/blog?tag=${tag}`;
431
- },
432
- className: "text-xs bg-muted px-2 py-0.5 rounded hover:bg-muted/80 transition-colors cursor-pointer",
428
+ href: `/blog?tag=${tag}`,
429
+ className: "text-xs bg-muted px-2 py-0.5 rounded hover:bg-muted/80 transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring",
433
430
  children: [
434
431
  "#",
435
432
  tag
@@ -438,7 +435,7 @@ function BlogCard({
438
435
  tag
439
436
  )) })
440
437
  ] })
441
- ] }) });
438
+ ] });
442
439
  }
443
440
  function BlogPostHeader({
444
441
  title,
@@ -498,12 +495,12 @@ function BlogPagination({
498
495
  const previousLabel = labels?.previous ?? "Previous";
499
496
  const nextLabel = labels?.next ?? "Next";
500
497
  if (totalPages <= 1) return null;
501
- const maxVisible = 5;
498
+ const maxVisible = 3;
502
499
  let start = Math.max(1, currentPage - Math.floor(maxVisible / 2));
503
500
  const end = Math.min(totalPages, start + maxVisible - 1);
504
501
  start = Math.max(1, end - maxVisible + 1);
505
502
  const pages = Array.from({ length: end - start + 1 }, (_, i) => start + i);
506
- return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2", children: [
503
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-1.5 sm:gap-2", children: [
507
504
  /* @__PURE__ */ jsxs(
508
505
  Button,
509
506
  {
@@ -513,22 +510,24 @@ function BlogPagination({
513
510
  disabled: currentPage === 1,
514
511
  children: [
515
512
  /* @__PURE__ */ jsx(ChevronLeft, { size: 16 }),
516
- /* @__PURE__ */ jsx("span", { className: "ml-1", children: previousLabel })
513
+ /* @__PURE__ */ jsx("span", { className: "ml-1 hidden sm:inline", children: previousLabel })
517
514
  ]
518
515
  }
519
516
  ),
520
517
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
521
518
  start > 1 && /* @__PURE__ */ jsxs(Fragment, { children: [
522
- /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: () => handlePageChange(1), className: "min-w-[36px]", children: "1" }),
519
+ /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: () => handlePageChange(1), className: "w-8 h-8 p-0 justify-center text-sm", children: "1" }),
523
520
  start > 2 && /* @__PURE__ */ jsx("span", { className: "px-2 text-muted-foreground", children: "..." })
524
521
  ] }),
525
522
  pages.map((page) => /* @__PURE__ */ jsx(
526
523
  Button,
527
524
  {
528
- variant: page === currentPage ? "primary" : "ghost",
525
+ variant: "ghost",
529
526
  size: "sm",
530
527
  onClick: () => handlePageChange(page),
531
- className: "min-w-[36px]",
528
+ "aria-current": page === currentPage ? "page" : void 0,
529
+ className: `w-8 h-8 p-0 justify-center text-sm ${page === currentPage ? "font-semibold" : ""}`,
530
+ style: page === currentPage ? { color: "var(--text-primary)" } : void 0,
532
531
  children: page
533
532
  },
534
533
  page
@@ -541,7 +540,7 @@ function BlogPagination({
541
540
  variant: "ghost",
542
541
  size: "sm",
543
542
  onClick: () => handlePageChange(totalPages),
544
- className: "min-w-[36px]",
543
+ className: "w-8 h-8 p-0 justify-center text-sm",
545
544
  children: totalPages
546
545
  }
547
546
  )
@@ -555,13 +554,37 @@ function BlogPagination({
555
554
  onClick: () => handlePageChange(currentPage + 1),
556
555
  disabled: currentPage === totalPages,
557
556
  children: [
558
- /* @__PURE__ */ jsx("span", { className: "mr-1", children: nextLabel }),
557
+ /* @__PURE__ */ jsx("span", { className: "mr-1 hidden sm:inline", children: nextLabel }),
559
558
  /* @__PURE__ */ jsx(ChevronRight, { size: 16 })
560
559
  ]
561
560
  }
562
561
  )
563
562
  ] });
564
563
  }
564
+ function SimplePagination({
565
+ currentPage,
566
+ hasPrevious,
567
+ hasNext,
568
+ onPrevious,
569
+ onNext,
570
+ labels
571
+ }) {
572
+ const canPrev = hasPrevious ?? currentPage > 1;
573
+ const previousLabel = labels?.previous ?? "Previous";
574
+ const nextLabel = labels?.next ?? "Next";
575
+ const pageNode = labels?.page ? labels.page(currentPage) : `Page ${currentPage}`;
576
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-1.5 sm:gap-2", children: [
577
+ /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", onClick: onPrevious, disabled: !canPrev, children: [
578
+ /* @__PURE__ */ jsx(ChevronLeft, { size: 16 }),
579
+ /* @__PURE__ */ jsx("span", { className: "ml-1 hidden sm:inline", children: previousLabel })
580
+ ] }),
581
+ /* @__PURE__ */ jsx("span", { className: "px-3 text-sm font-medium tabular-nums whitespace-nowrap", children: pageNode }),
582
+ /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", onClick: onNext, disabled: !hasNext, children: [
583
+ /* @__PURE__ */ jsx("span", { className: "mr-1 hidden sm:inline", children: nextLabel }),
584
+ /* @__PURE__ */ jsx(ChevronRight, { size: 16 })
585
+ ] })
586
+ ] });
587
+ }
565
588
  function CategoryFilter({
566
589
  categories,
567
590
  selectedCategory,
@@ -573,18 +596,24 @@ function CategoryFilter({
573
596
  /* @__PURE__ */ jsx(
574
597
  Button,
575
598
  {
576
- variant: selectedCategory ? "ghost" : "primary",
599
+ variant: "ghost",
577
600
  size: "sm",
578
601
  onClick: () => handleCategoryClick(null),
602
+ "aria-pressed": !selectedCategory,
603
+ className: !selectedCategory ? "font-semibold" : "",
604
+ style: !selectedCategory ? { background: "var(--bg-elevated)", color: "var(--text-primary)" } : void 0,
579
605
  children: allLabel
580
606
  }
581
607
  ),
582
608
  categories.map((category) => /* @__PURE__ */ jsx(
583
609
  Button,
584
610
  {
585
- variant: selectedCategory === category ? "primary" : "ghost",
611
+ variant: "ghost",
586
612
  size: "sm",
587
613
  onClick: () => handleCategoryClick(category),
614
+ "aria-pressed": selectedCategory === category,
615
+ className: selectedCategory === category ? "font-semibold" : "",
616
+ style: selectedCategory === category ? { background: "var(--bg-elevated)", color: "var(--text-primary)" } : void 0,
588
617
  children: category
589
618
  },
590
619
  category
@@ -697,8 +726,8 @@ function Sidebar({
697
726
  ] });
698
727
  }
699
728
  function PageHeader({ title, description, actions, className }) {
700
- return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center justify-between gap-4", className), children: [
701
- /* @__PURE__ */ jsxs("div", { children: [
729
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4", className), children: [
730
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
702
731
  /* @__PURE__ */ jsx("h1", { className: "heading-xl", children: title }),
703
732
  description && /* @__PURE__ */ jsx("p", { className: "text-body mt-1", children: description })
704
733
  ] }),
@@ -713,12 +742,12 @@ function PageLoadingState({ message }) {
713
742
  }
714
743
  function PageErrorState({ message, onRetry, retryLabel = "Retry" }) {
715
744
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center py-16 text-center", children: [
716
- /* @__PURE__ */ jsx("div", { className: "text-red-600 dark:text-red-400 font-medium mb-2", children: message }),
745
+ /* @__PURE__ */ jsx("div", { className: "text-error font-medium mb-2", children: message }),
717
746
  onRetry && /* @__PURE__ */ jsx(
718
747
  "button",
719
748
  {
720
749
  onClick: onRetry,
721
- className: "text-sm text-muted-foreground hover:text-foreground transition-colors underline",
750
+ className: "text-sm text-muted-foreground hover:text-foreground transition-colors underline outline-none focus-visible:ring-2 focus-visible:ring-ring rounded",
722
751
  children: retryLabel
723
752
  }
724
753
  )
@@ -739,9 +768,10 @@ var TONES = {
739
768
  red: { card: "border-red-500/20 bg-red-500/5", value: "text-red-600 dark:text-red-400" },
740
769
  purple: { card: "border-purple-500/20 bg-purple-500/5", value: "text-purple-600 dark:text-purple-400" }
741
770
  };
742
- function StatCard({ icon: Icon, label, value, subtext, trend, tone, delay = 0, inline = false, valueFirst = false, className }) {
771
+ function StatCard({ icon: Icon, label, value, subtext, trend, tone, delay = 0, inline = false, valueFirst = false, compact = false, className }) {
743
772
  const toneCfg = tone ? TONES[tone] : void 0;
744
773
  const showTopRow = Boolean(Icon || trend);
774
+ const surface = compact ? "card p-4" : "stat-card p-5";
745
775
  const topRow = showTopRow ? /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between mb-4", children: [
746
776
  Icon ? /* @__PURE__ */ jsx("div", { className: "w-10 h-10 rounded-xl bg-muted flex items-center justify-center", children: /* @__PURE__ */ jsx(Icon, { size: 20, strokeWidth: 1.5, className: "text-muted-foreground" }) }) : /* @__PURE__ */ jsx("span", {}),
747
777
  trend && /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-1 text-xs font-medium", trend.positive ? "text-success" : "text-error"), children: [
@@ -763,7 +793,7 @@ function StatCard({ icon: Icon, label, value, subtext, trend, tone, delay = 0, i
763
793
  return /* @__PURE__ */ jsxs(
764
794
  "div",
765
795
  {
766
- className: cn("stat-card p-5 animate-enter", toneCfg?.card, className),
796
+ className: cn(surface, "animate-enter", toneCfg?.card, className),
767
797
  style: delay ? { animationDelay: `${delay}ms` } : void 0,
768
798
  children: [
769
799
  topRow,
@@ -777,7 +807,7 @@ function StatCard({ icon: Icon, label, value, subtext, trend, tone, delay = 0, i
777
807
  return /* @__PURE__ */ jsxs(
778
808
  "div",
779
809
  {
780
- className: cn("stat-card p-5 animate-enter", toneCfg?.card, className),
810
+ className: cn(surface, "animate-enter", toneCfg?.card, className),
781
811
  style: delay ? { animationDelay: `${delay}ms` } : void 0,
782
812
  children: [
783
813
  topRow,
@@ -801,17 +831,19 @@ function FellowsBanner({
801
831
  Link,
802
832
  {
803
833
  href,
804
- className: `card p-5 flex items-center gap-4 border-2 border-primary/20 bg-gradient-to-r from-primary/5 to-transparent hover:border-primary/40 transition-all group ${className}`,
834
+ className: `card p-5 flex flex-col gap-4 sm:flex-row sm:items-center border-2 border-primary/20 bg-linear-to-r from-primary/5 to-transparent hover:border-primary/40 transition-all group outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background ${className}`,
805
835
  children: [
806
- /* @__PURE__ */ jsx("div", { className: "p-3 bg-primary/10 rounded-xl", children: /* @__PURE__ */ jsx(GraduationCap, { className: "w-6 h-6 text-primary" }) }),
807
- /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
808
- /* @__PURE__ */ jsx("h3", { className: "font-semibold text-sm", children: title }),
809
- /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: description }),
810
- features.length > 0 && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground/70 mt-1", children: features.join(" \xB7 ") })
836
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
837
+ /* @__PURE__ */ jsx("div", { className: "p-3 bg-primary/10 rounded-xl shrink-0", children: /* @__PURE__ */ jsx(GraduationCap, { className: "w-6 h-6 text-primary" }) }),
838
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
839
+ /* @__PURE__ */ jsx("h3", { className: "font-semibold text-sm", children: title }),
840
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: description }),
841
+ features.length > 0 && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground/70 mt-1", children: features.join(" \xB7 ") })
842
+ ] })
811
843
  ] }),
812
- /* @__PURE__ */ jsxs("span", { className: "text-sm font-medium text-primary group-hover:underline whitespace-nowrap", children: [
844
+ /* @__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: [
813
845
  ctaText,
814
- " \u2192"
846
+ /* @__PURE__ */ jsx(ArrowRight, { className: "w-4 h-4 transition-transform group-hover:translate-x-0.5" })
815
847
  ] })
816
848
  ]
817
849
  }
@@ -823,7 +855,7 @@ function ErrorFallback({
823
855
  labels
824
856
  }) {
825
857
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center min-h-100 p-8", children: [
826
- /* @__PURE__ */ jsx("div", { className: "w-16 h-16 rounded-full bg-red-100 dark:bg-red-900/20 flex items-center justify-center mb-4", children: /* @__PURE__ */ jsx(AlertCircle, { size: 32, className: "text-red-500" }) }),
858
+ /* @__PURE__ */ jsx("div", { className: "w-16 h-16 rounded-full bg-error-soft flex items-center justify-center mb-4", children: /* @__PURE__ */ jsx(AlertCircle, { size: 32, className: "text-error" }) }),
827
859
  /* @__PURE__ */ jsx("h2", { className: "text-xl font-semibold mb-2", children: labels?.title ?? "Something went wrong" }),
828
860
  /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-center mb-4 max-w-md", children: error?.message || labels?.message || "An unexpected error occurred." }),
829
861
  /* @__PURE__ */ jsxs(Button, { variant: "secondary", onClick: onRetry, className: "whitespace-nowrap", children: [
@@ -878,7 +910,7 @@ function AccountLockedCard({
878
910
  /* @__PURE__ */ jsx("span", { className: "font-semibold text-[15px]", children: appName })
879
911
  ] }),
880
912
  /* @__PURE__ */ jsxs("div", { className: "p-6 bg-card border border-border rounded-xl", children: [
881
- /* @__PURE__ */ jsx("div", { className: "mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-error/10", children: icon }),
913
+ /* @__PURE__ */ jsx("div", { className: "mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-error-soft", children: icon }),
882
914
  /* @__PURE__ */ jsx("h1", { className: "text-xl font-semibold mb-2 text-center", children: title }),
883
915
  /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-5 text-center", children: subtitle }),
884
916
  children,
@@ -889,7 +921,7 @@ function AccountLockedCard({
889
921
  type: "button",
890
922
  onClick: onBack,
891
923
  disabled: loading,
892
- className: "w-full h-10 rounded-lg bg-primary text-primary-foreground text-sm font-medium hover:opacity-90 transition-opacity disabled:opacity-60",
924
+ className: "w-full h-10 rounded-lg bg-primary text-primary-foreground text-sm font-medium hover:opacity-90 transition-opacity disabled:opacity-60 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
893
925
  children: backLabel
894
926
  }
895
927
  )
@@ -899,21 +931,21 @@ function AccountLockedCard({
899
931
  function MediaPageHeader({ title, description, isSyncing, syncError, onSync, stats }) {
900
932
  const t = useYunUI().useT("components.mediaPageHeader");
901
933
  return /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
902
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
903
- /* @__PURE__ */ jsxs("div", { children: [
934
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between", children: [
935
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
904
936
  /* @__PURE__ */ jsx("h1", { className: "heading-xl", children: title }),
905
937
  /* @__PURE__ */ jsx("p", { className: "text-body mt-1", children: description })
906
938
  ] }),
907
- /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", onClick: onSync, disabled: isSyncing, className: "text-muted-foreground", children: [
939
+ /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", onClick: onSync, disabled: isSyncing, className: "text-muted-foreground shrink-0 self-start sm:self-auto", children: [
908
940
  /* @__PURE__ */ jsx(RefreshCw, { size: 16, className: isSyncing ? "animate-spin" : "" }),
909
941
  /* @__PURE__ */ jsx("span", { className: "ml-2", children: isSyncing ? t("syncing") : t("sync") })
910
942
  ] })
911
943
  ] }),
912
- syncError && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 p-3 rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 text-red-700 dark:text-red-300 text-sm", children: [
944
+ syncError && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 p-3 rounded-lg bg-error-soft border border-error-soft text-error text-sm", children: [
913
945
  /* @__PURE__ */ jsx(AlertCircle, { size: 16 }),
914
946
  /* @__PURE__ */ jsx("span", { children: syncError })
915
947
  ] }),
916
- stats && stats.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex gap-4 text-sm text-muted-foreground", children: stats.map((stat, index) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
948
+ stats && stats.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-x-4 gap-y-1 text-sm text-muted-foreground", children: stats.map((stat, index) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
917
949
  /* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: stat.value }),
918
950
  /* @__PURE__ */ jsx("span", { children: stat.label })
919
951
  ] }, index)) })
@@ -938,8 +970,8 @@ function MediaLoadingState({ message }) {
938
970
  function MediaErrorState({ message, onRetry }) {
939
971
  const t = useYunUI().useT("components.mediaPageHeader");
940
972
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center py-16 text-center", children: [
941
- /* @__PURE__ */ jsx(AlertCircle, { size: 40, className: "text-red-500/50 mb-3" }),
942
- /* @__PURE__ */ jsx("div", { className: "font-medium text-red-600 dark:text-red-400 mb-1", children: t("error") }),
973
+ /* @__PURE__ */ jsx(AlertCircle, { size: 40, className: "text-error opacity-50 mb-3" }),
974
+ /* @__PURE__ */ jsx("div", { className: "font-medium text-error mb-1", children: t("error") }),
943
975
  /* @__PURE__ */ jsx("div", { className: "text-caption mb-4", children: message }),
944
976
  onRetry && /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", onClick: onRetry, children: [
945
977
  /* @__PURE__ */ jsx(RefreshCw, { size: 14, className: "mr-2" }),
@@ -1026,7 +1058,386 @@ function DeprecatedBadge({ isDeprecated }) {
1026
1058
  if (!isDeprecated) return null;
1027
1059
  return /* @__PURE__ */ jsx("span", { className: "badge", children: t("deprecated") });
1028
1060
  }
1061
+ function FeatureLockedState({ icon, title, description, noteTitle, noteText, className }) {
1062
+ return /* @__PURE__ */ jsx("div", { className: cn("flex items-center justify-center min-h-[60vh]", className), children: /* @__PURE__ */ jsxs("div", { className: "text-center max-w-md mx-auto p-8", children: [
1063
+ /* @__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" }) }),
1064
+ /* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold mb-2", children: title }),
1065
+ description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mb-6", children: description }),
1066
+ (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: [
1067
+ /* @__PURE__ */ jsx(AlertCircle, { className: "w-5 h-5 shrink-0 mt-0.5" }),
1068
+ /* @__PURE__ */ jsxs("div", { className: "text-left", children: [
1069
+ noteTitle && /* @__PURE__ */ jsx("p", { className: "font-medium mb-1", children: noteTitle }),
1070
+ noteText && /* @__PURE__ */ jsx("p", { children: noteText })
1071
+ ] })
1072
+ ] }) })
1073
+ ] }) });
1074
+ }
1075
+ function SessionItem({
1076
+ icon,
1077
+ name,
1078
+ detail,
1079
+ ip,
1080
+ time,
1081
+ current,
1082
+ currentLabel,
1083
+ inactive,
1084
+ inactiveLabel,
1085
+ onRevoke,
1086
+ revoking,
1087
+ revokeLabel,
1088
+ className
1089
+ }) {
1090
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex items-start gap-3 p-2 rounded-lg bg-(--bg-elevated) relative", inactive && "opacity-50", className), children: [
1091
+ icon != null && /* @__PURE__ */ jsx("div", { className: "w-8 h-8 rounded-lg bg-muted flex items-center justify-center shrink-0", children: icon }),
1092
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
1093
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1094
+ /* @__PURE__ */ jsx("span", { className: "text-xs font-medium truncate", children: name }),
1095
+ current && /* @__PURE__ */ jsx("span", { className: "text-[10px] px-1.5 py-0.5 rounded-full badge-success shrink-0", children: currentLabel }),
1096
+ inactive && /* @__PURE__ */ jsx("span", { className: "text-[10px] px-1.5 py-0.5 rounded-full badge-neutral shrink-0", children: inactiveLabel })
1097
+ ] }),
1098
+ detail && /* @__PURE__ */ jsx("div", { className: "text-[10px] text-(--text-tertiary) mt-0.5", children: detail }),
1099
+ (ip != null || time != null) && /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-2 mt-1 text-[10px] text-(--text-tertiary)", children: [
1100
+ ip != null && /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-0.5", children: [
1101
+ /* @__PURE__ */ jsx(Globe, { size: 8 }),
1102
+ ip
1103
+ ] }),
1104
+ time != null && /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-0.5", children: [
1105
+ /* @__PURE__ */ jsx(Clock, { size: 8 }),
1106
+ time
1107
+ ] })
1108
+ ] })
1109
+ ] }),
1110
+ !current && onRevoke && /* @__PURE__ */ jsx(
1111
+ "button",
1112
+ {
1113
+ type: "button",
1114
+ onClick: onRevoke,
1115
+ disabled: revoking,
1116
+ "aria-label": revokeLabel,
1117
+ title: revokeLabel,
1118
+ 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",
1119
+ children: revoking ? /* @__PURE__ */ jsx(Loader2, { size: 12, className: "animate-spin" }) : /* @__PURE__ */ jsx(LogOut, { size: 12 })
1120
+ }
1121
+ )
1122
+ ] });
1123
+ }
1124
+ function MetricBar({ icon, label, value, percentage, color, className }) {
1125
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-3", className), children: [
1126
+ icon != null ? icon : /* @__PURE__ */ jsx("div", { className: "w-3 h-3 rounded-full shrink-0", style: { backgroundColor: color } }),
1127
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
1128
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-1 gap-2", children: [
1129
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium truncate", children: label }),
1130
+ value != null && /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground shrink-0", children: value })
1131
+ ] }),
1132
+ /* @__PURE__ */ jsx("div", { className: "h-1.5 bg-muted rounded-full overflow-hidden", children: /* @__PURE__ */ jsx(
1133
+ "div",
1134
+ {
1135
+ role: "progressbar",
1136
+ "aria-valuenow": Math.max(0, Math.min(100, percentage)),
1137
+ "aria-valuemin": 0,
1138
+ "aria-valuemax": 100,
1139
+ className: "h-full rounded-full transition-all duration-300",
1140
+ style: { width: `${Math.max(0, Math.min(100, percentage))}%`, backgroundColor: color }
1141
+ }
1142
+ ) })
1143
+ ] })
1144
+ ] });
1145
+ }
1146
+ var TONES2 = {
1147
+ info: {
1148
+ bg: "bg-linear-to-r from-blue-500/10 via-blue-500/5 to-blue-500/10",
1149
+ border: "border-blue-500/25",
1150
+ text: "text-blue-700 dark:text-blue-300",
1151
+ icon: "text-blue-500",
1152
+ dismissHover: "hover:bg-blue-500/10",
1153
+ defaultIcon: /* @__PURE__ */ jsx(Info, { size: 16 })
1154
+ },
1155
+ warning: {
1156
+ bg: "bg-linear-to-r from-amber-500/10 via-amber-500/5 to-amber-500/10",
1157
+ border: "border-amber-500/25",
1158
+ text: "text-amber-700 dark:text-amber-300",
1159
+ icon: "text-amber-500",
1160
+ dismissHover: "hover:bg-amber-500/10",
1161
+ defaultIcon: /* @__PURE__ */ jsx(AlertTriangle, { size: 16 })
1162
+ },
1163
+ critical: {
1164
+ bg: "bg-linear-to-r from-red-500/10 via-red-500/5 to-red-500/10",
1165
+ border: "border-red-500/25",
1166
+ text: "text-red-700 dark:text-red-300",
1167
+ icon: "text-red-500",
1168
+ dismissHover: "hover:bg-red-500/10",
1169
+ defaultIcon: /* @__PURE__ */ jsx(AlertCircle, { size: 16 })
1170
+ },
1171
+ success: {
1172
+ bg: "bg-linear-to-r from-green-500/10 via-green-500/5 to-green-500/10",
1173
+ border: "border-green-500/25",
1174
+ text: "text-green-700 dark:text-green-300",
1175
+ icon: "text-green-500",
1176
+ dismissHover: "hover:bg-green-500/10",
1177
+ defaultIcon: /* @__PURE__ */ jsx(CheckCircle2, { size: 16 })
1178
+ },
1179
+ neutral: {
1180
+ bg: "bg-muted/40",
1181
+ border: "border-border",
1182
+ text: "text-foreground",
1183
+ icon: "text-muted-foreground",
1184
+ dismissHover: "hover:bg-muted",
1185
+ defaultIcon: /* @__PURE__ */ jsx(Info, { size: 16 })
1186
+ }
1187
+ };
1188
+ function Banner({
1189
+ tone = "info",
1190
+ icon,
1191
+ title,
1192
+ description,
1193
+ meta,
1194
+ actions,
1195
+ dismissible,
1196
+ onDismiss,
1197
+ dismissLabel,
1198
+ className
1199
+ }) {
1200
+ const t = TONES2[tone];
1201
+ const resolvedIcon = icon === void 0 ? t.defaultIcon : icon;
1202
+ return /* @__PURE__ */ jsx("div", { className: cn("card", t.bg, t.border, className), children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 px-4 py-2.5", children: [
1203
+ resolvedIcon != null && /* @__PURE__ */ jsx("span", { className: cn("shrink-0", t.icon), "aria-hidden": "true", children: resolvedIcon }),
1204
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
1205
+ /* @__PURE__ */ jsx("span", { className: cn("text-sm font-medium", t.text), children: title }),
1206
+ description && /* @__PURE__ */ jsx("span", { className: cn("text-sm ml-2 hidden sm:inline opacity-70", t.text), children: description })
1207
+ ] }),
1208
+ meta != null && /* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground/70 shrink-0", children: meta }),
1209
+ actions && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 shrink-0", children: actions }),
1210
+ dismissible && /* @__PURE__ */ jsx(
1211
+ "button",
1212
+ {
1213
+ type: "button",
1214
+ onClick: onDismiss,
1215
+ "aria-label": dismissLabel,
1216
+ className: cn("p-1 rounded-lg transition-colors shrink-0 outline-none focus-visible:ring-2 focus-visible:ring-ring", t.dismissHover),
1217
+ children: /* @__PURE__ */ jsx(X, { size: 14, className: "text-muted-foreground/70" })
1218
+ }
1219
+ )
1220
+ ] }) });
1221
+ }
1222
+ function NotificationBell({ count = 0, max = 99, label, icon, onClick, className }) {
1223
+ return /* @__PURE__ */ jsxs(
1224
+ "button",
1225
+ {
1226
+ type: "button",
1227
+ onClick,
1228
+ "aria-label": label,
1229
+ className: cn(
1230
+ "relative flex items-center justify-center rounded-lg px-2 py-1.5 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring",
1231
+ className
1232
+ ),
1233
+ children: [
1234
+ icon ?? /* @__PURE__ */ jsx(Bell, { size: 18 }),
1235
+ count > 0 && /* @__PURE__ */ jsx("span", { className: "absolute -top-0.5 -right-0.5 flex h-4 min-w-4 items-center justify-center rounded-full bg-(--error) text-[10px] font-bold text-pure-white px-1", children: count > max ? `${max}+` : count })
1236
+ ]
1237
+ }
1238
+ );
1239
+ }
1240
+ function NotificationItem({
1241
+ icon,
1242
+ iconClassName,
1243
+ title,
1244
+ body,
1245
+ time,
1246
+ unread,
1247
+ href,
1248
+ onSelect,
1249
+ dismissible,
1250
+ onDismiss,
1251
+ dismissLabel,
1252
+ className
1253
+ }) {
1254
+ const { Link } = useYunUI();
1255
+ const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
1256
+ icon != null && /* @__PURE__ */ jsx("div", { className: cn("shrink-0 rounded-lg p-1.5", iconClassName ?? "bg-muted"), children: icon }),
1257
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
1258
+ /* @__PURE__ */ jsx("p", { className: cn("text-sm leading-snug truncate", unread ? "font-medium" : "text-muted-foreground"), children: title }),
1259
+ body && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground/60 mt-0.5 line-clamp-1", children: body })
1260
+ ] }),
1261
+ time != null && /* @__PURE__ */ jsx("span", { className: "shrink-0 self-center text-[10px] text-muted-foreground/50", children: time })
1262
+ ] });
1263
+ const rowClass = cn("flex items-center gap-2.5 px-3 py-2.5", dismissible ? "pr-9" : "pr-3");
1264
+ return /* @__PURE__ */ jsxs("div", { className: cn("group/notif relative rounded-xl hover:bg-foreground/5 transition-colors", className), children: [
1265
+ href ? /* @__PURE__ */ jsx(Link, { href, onClick: onSelect, className: rowClass, children: inner }) : /* @__PURE__ */ jsx("button", { type: "button", onClick: onSelect, className: cn(rowClass, "w-full text-left outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset rounded-xl"), children: inner }),
1266
+ dismissible && /* @__PURE__ */ jsx(
1267
+ "button",
1268
+ {
1269
+ type: "button",
1270
+ "aria-label": dismissLabel,
1271
+ onClick: (e) => {
1272
+ e.stopPropagation();
1273
+ e.preventDefault();
1274
+ onDismiss?.();
1275
+ },
1276
+ className: "absolute right-1.5 top-1/2 -translate-y-1/2 p-1 rounded-lg opacity-0 group-hover/notif:opacity-100 group-focus-within/notif:opacity-100 hover:bg-muted transition-all outline-none focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-ring",
1277
+ children: /* @__PURE__ */ jsx(Trash2, { size: 12, className: "text-muted-foreground/40 hover:text-error" })
1278
+ }
1279
+ )
1280
+ ] });
1281
+ }
1282
+ function NotificationPanel({
1283
+ title,
1284
+ unreadCount = 0,
1285
+ unreadLabel,
1286
+ loading,
1287
+ loadingLabel,
1288
+ empty,
1289
+ emptyLabel,
1290
+ footer,
1291
+ children,
1292
+ className
1293
+ }) {
1294
+ return /* @__PURE__ */ jsxs(
1295
+ "div",
1296
+ {
1297
+ className: cn(
1298
+ "w-80 sm:w-[400px] rounded-2xl border border-border bg-background/60 backdrop-blur-2xl shadow-lg shadow-black/5",
1299
+ className
1300
+ ),
1301
+ children: [
1302
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-3", children: [
1303
+ /* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold", children: title }),
1304
+ unreadCount > 0 && /* @__PURE__ */ jsxs("span", { className: "text-[10px] font-medium text-primary", children: [
1305
+ unreadCount,
1306
+ unreadLabel ? /* @__PURE__ */ jsxs(Fragment, { children: [
1307
+ " ",
1308
+ unreadLabel
1309
+ ] }) : null
1310
+ ] })
1311
+ ] }),
1312
+ /* @__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: [
1313
+ /* @__PURE__ */ jsx(Bell, { size: 24, className: "mx-auto mb-2 text-muted-foreground/40" }),
1314
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: emptyLabel })
1315
+ ] }) : children }),
1316
+ 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 })
1317
+ ]
1318
+ }
1319
+ );
1320
+ }
1321
+ function SettingRow({ title, description, control, className }) {
1322
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center justify-between gap-4 py-3 border-b border-border last:border-0", className), children: [
1323
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
1324
+ /* @__PURE__ */ jsx("div", { className: "text-sm font-medium", children: title }),
1325
+ description && /* @__PURE__ */ jsx("div", { className: "text-xs text-(--text-tertiary) mt-0.5 leading-relaxed whitespace-normal wrap-break-word", children: description })
1326
+ ] }),
1327
+ control != null && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: control })
1328
+ ] });
1329
+ }
1330
+ function LinkRow({ icon, title, description, href, external, className }) {
1331
+ const { Link } = useYunUI();
1332
+ const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
1333
+ icon != null && /* @__PURE__ */ jsx("span", { className: "text-(--text-tertiary) shrink-0", children: icon }),
1334
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
1335
+ /* @__PURE__ */ jsx("div", { className: "text-sm font-medium", children: title }),
1336
+ description && /* @__PURE__ */ jsx("div", { className: "text-xs text-(--text-tertiary) truncate", children: description })
1337
+ ] }),
1338
+ /* @__PURE__ */ jsx(ChevronRight, { size: 16, className: "text-(--text-muted) shrink-0" })
1339
+ ] });
1340
+ const cls = cn(
1341
+ "flex items-center gap-3 p-3 rounded-lg border border-border hover:bg-(--bg-elevated) transition-colors",
1342
+ className
1343
+ );
1344
+ if (external) {
1345
+ return /* @__PURE__ */ jsx("a", { href, target: "_blank", rel: "noopener noreferrer", className: cls, children: inner });
1346
+ }
1347
+ return /* @__PURE__ */ jsx(Link, { href, className: cls, children: inner });
1348
+ }
1349
+ function ConnectedAccountRow({
1350
+ icon,
1351
+ badge,
1352
+ avatarUrl,
1353
+ name,
1354
+ subname,
1355
+ detail,
1356
+ time,
1357
+ onUnlink,
1358
+ unlinking,
1359
+ unlinkLabel,
1360
+ className
1361
+ }) {
1362
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-3 p-3 rounded-xl bg-(--bg-elevated) border border-border", className), children: [
1363
+ /* @__PURE__ */ jsxs("div", { className: "relative shrink-0", children: [
1364
+ avatarUrl ? (
1365
+ // eslint-disable-next-line @next/next/no-img-element
1366
+ /* @__PURE__ */ jsx("img", { src: avatarUrl, alt: "", className: "w-9 h-9 rounded-full object-cover ring-2 ring-border" })
1367
+ ) : /* @__PURE__ */ jsx("div", { className: "w-9 h-9 rounded-full bg-muted flex items-center justify-center ring-2 ring-border", children: icon }),
1368
+ badge != null && /* @__PURE__ */ jsx("div", { className: "absolute bottom-0 right-0 w-5 h-5 rounded-full bg-(--bg-elevated) border border-border flex items-center justify-center", children: badge })
1369
+ ] }),
1370
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
1371
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1372
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium capitalize", children: name }),
1373
+ subname != null && /* @__PURE__ */ jsxs("span", { className: "text-xs text-(--text-secondary) truncate", children: [
1374
+ "\xB7 ",
1375
+ subname
1376
+ ] })
1377
+ ] }),
1378
+ detail != null && /* @__PURE__ */ jsx("div", { className: "text-xs text-(--text-tertiary) truncate", children: detail }),
1379
+ time != null && /* @__PURE__ */ jsxs("div", { className: "text-[10px] text-(--text-tertiary) flex items-center gap-1 mt-0.5", children: [
1380
+ /* @__PURE__ */ jsx(Clock, { size: 8 }),
1381
+ time
1382
+ ] })
1383
+ ] }),
1384
+ onUnlink && /* @__PURE__ */ jsx(
1385
+ "button",
1386
+ {
1387
+ type: "button",
1388
+ onClick: onUnlink,
1389
+ disabled: unlinking,
1390
+ title: unlinkLabel,
1391
+ "aria-label": unlinkLabel,
1392
+ 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",
1393
+ children: unlinking ? /* @__PURE__ */ jsx(Loader2, { size: 14, className: "animate-spin" }) : /* @__PURE__ */ jsx(X, { size: 14 })
1394
+ }
1395
+ )
1396
+ ] });
1397
+ }
1398
+ function AvatarUploader({
1399
+ src,
1400
+ fallback,
1401
+ size = 48,
1402
+ uploading,
1403
+ onSelectFile,
1404
+ label,
1405
+ className
1406
+ }) {
1407
+ const inputRef = useRef(null);
1408
+ return /* @__PURE__ */ jsxs(
1409
+ "button",
1410
+ {
1411
+ type: "button",
1412
+ onClick: () => inputRef.current?.click(),
1413
+ "aria-label": label,
1414
+ className: cn("relative group cursor-pointer shrink-0 rounded-full outline-none focus-visible:ring-2 focus-visible:ring-ring", className),
1415
+ style: { width: size, height: size },
1416
+ children: [
1417
+ /* @__PURE__ */ jsx(
1418
+ "input",
1419
+ {
1420
+ ref: inputRef,
1421
+ type: "file",
1422
+ accept: "image/*",
1423
+ className: "hidden",
1424
+ onChange: (e) => {
1425
+ const file = e.target.files?.[0];
1426
+ if (file) onSelectFile?.(file);
1427
+ e.target.value = "";
1428
+ }
1429
+ }
1430
+ ),
1431
+ src ? (
1432
+ // eslint-disable-next-line @next/next/no-img-element
1433
+ /* @__PURE__ */ jsx("img", { src, alt: "", className: "w-full h-full rounded-full object-cover ring-2 ring-border group-hover:ring-primary transition-all" })
1434
+ ) : /* @__PURE__ */ jsx("div", { className: "w-full h-full rounded-full bg-linear-to-br from-primary to-primary/60 flex items-center justify-center text-primary-foreground font-semibold ring-2 ring-border group-hover:ring-primary transition-all", style: { fontSize: size * 0.36 }, children: fallback }),
1435
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 rounded-full bg-black/50 sm:opacity-0 sm:group-hover:opacity-100 group-focus-visible:opacity-100 transition-opacity flex items-center justify-center", children: uploading ? /* @__PURE__ */ jsx(Loader2, { size: Math.round(size / 3), className: "text-pure-white animate-spin" }) : /* @__PURE__ */ jsx(Camera, { size: Math.round(size / 3), className: "text-pure-white" }) })
1436
+ ]
1437
+ }
1438
+ );
1439
+ }
1029
1440
 
1030
- export { AccountLockedCard, ActiveBadge, BackgroundEffects, BlogCard, BlogPagination, BlogPostHeader, CapabilityBadge, CategoryFilter, CodeBlock, CodeDemo, DeprecatedBadge, ErrorBoundary, FAQ, FellowBadge, FellowsBanner, LLMCopyButton, MediaEmptyState, MediaErrorState, MediaLoadingState, MediaPageHeader, PageEmptyState, PageErrorState, PageHeader, PageLoadingState, Sidebar, SourceBadge, StatCard, StatusBadge, ViewOptions };
1441
+ export { AccountLockedCard, ActiveBadge, AvatarUploader, BackgroundEffects, Banner, BlogCard, BlogPagination, BlogPostHeader, CapabilityBadge, CategoryFilter, CodeBlock, CodeDemo, ConnectedAccountRow, DeprecatedBadge, ErrorBoundary, FAQ, FeatureLockedState, FellowBadge, FellowsBanner, LLMCopyButton, LinkRow, MediaEmptyState, MediaErrorState, MediaLoadingState, MediaPageHeader, MetricBar, NotificationBell, NotificationItem, NotificationPanel, PageEmptyState, PageErrorState, PageHeader, PageLoadingState, SessionItem, SettingRow, Sidebar, SimplePagination, SourceBadge, StatCard, StatusBadge, ViewOptions };
1031
1442
  //# sourceMappingURL=patterns.js.map
1032
1443
  //# sourceMappingURL=patterns.js.map