@windrun-huaiin/third-ui 3.2.2 → 3.3.1

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 (42) hide show
  1. package/dist/clerk/index.js +1 -1
  2. package/dist/clerk/index.js.map +1 -1
  3. package/dist/clerk/index.mjs.map +1 -1
  4. package/dist/fuma/index.d.mts +1 -23
  5. package/dist/fuma/index.d.ts +1 -23
  6. package/dist/fuma/index.js +157 -319
  7. package/dist/fuma/index.js.map +1 -1
  8. package/dist/fuma/index.mjs +136 -296
  9. package/dist/fuma/index.mjs.map +1 -1
  10. package/dist/fuma/mdx/index.d.mts +23 -1
  11. package/dist/fuma/mdx/index.d.ts +23 -1
  12. package/dist/fuma/mdx/index.js +162 -1
  13. package/dist/fuma/mdx/index.js.map +1 -1
  14. package/dist/fuma/mdx/index.mjs +159 -0
  15. package/dist/fuma/mdx/index.mjs.map +1 -1
  16. package/dist/index.d.mts +1 -1
  17. package/dist/index.d.ts +1 -1
  18. package/dist/index.js +49 -210
  19. package/dist/index.js.map +1 -1
  20. package/dist/index.mjs +35 -194
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/lib/index.js +0 -1
  23. package/dist/lib/index.js.map +1 -1
  24. package/dist/lib/index.mjs +0 -1
  25. package/dist/lib/index.mjs.map +1 -1
  26. package/dist/main/index.js +3 -2
  27. package/dist/main/index.js.map +1 -1
  28. package/dist/main/index.mjs +2 -1
  29. package/dist/main/index.mjs.map +1 -1
  30. package/package.json +2 -2
  31. package/src/clerk/clerk-organization.tsx +2 -0
  32. package/src/clerk/index.ts +1 -0
  33. package/src/fuma/index.ts +2 -4
  34. package/src/fuma/mdx/index.ts +5 -1
  35. package/src/fuma/mdx/toc-base.tsx +1 -0
  36. package/src/lib/index.ts +2 -0
  37. package/src/main/ads-alert-dialog.tsx +2 -0
  38. package/src/main/faq.tsx +2 -1
  39. package/src/main/index.ts +2 -0
  40. package/src/main/nprogress-bar.tsx +2 -1
  41. /package/src/fuma/{fuma-banner-suit.tsx → mdx/fuma-banner-suit.tsx} +0 -0
  42. /package/src/fuma/{fuma-github-info.tsx → mdx/fuma-github-info.tsx} +0 -0
@@ -2721,8 +2721,167 @@ function TocFooter({ lastModified, showCopy, editPath, githubBaseUrl }) {
2721
2721
  showEdit && /* @__PURE__ */ jsx39(EditOnGitHub, { url: `${githubBaseUrl}${editPath}` })
2722
2722
  ] });
2723
2723
  }
2724
+
2725
+ // src/fuma/mdx/fuma-banner-suit.tsx
2726
+ import { Banner } from "fumadocs-ui/components/banner";
2727
+ import { useTranslations } from "next-intl";
2728
+ import { jsx as jsx40 } from "react/jsx-runtime";
2729
+ function FumaBannerSuit({ showText }) {
2730
+ const t = useTranslations("home");
2731
+ return showText ? /* @__PURE__ */ jsx40(Banner, { variant: "rainbow", changeLayout: true, children: /* @__PURE__ */ jsx40("p", { className: "text-xl", children: t("banner") }) }) : /* @__PURE__ */ jsx40(Banner, { variant: "normal", changeLayout: true, className: "bg-white dark:bg-[rgb(10,10,10)]" });
2732
+ }
2733
+
2734
+ // src/fuma/mdx/fuma-github-info.tsx
2735
+ import { useEffect as useEffect2, useState as useState4 } from "react";
2736
+ import { jsx as jsx41, jsxs as jsxs14 } from "react/jsx-runtime";
2737
+ function GitHubInfoSkeleton({ owner, repo, className }) {
2738
+ return /* @__PURE__ */ jsxs14("div", { className: `flex flex-col gap-1.5 p-2 rounded-lg text-sm text-fd-foreground/80 lg:flex-row lg:items-center animate-pulse ${className}`, children: [
2739
+ /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2", children: [
2740
+ /* @__PURE__ */ jsx41("div", { className: "size-3.5 bg-fd-muted rounded" }),
2741
+ /* @__PURE__ */ jsx41("div", { className: "h-4 bg-fd-muted rounded w-20" })
2742
+ ] }),
2743
+ /* @__PURE__ */ jsx41("div", { className: "h-3 bg-fd-muted rounded w-8" })
2744
+ ] });
2745
+ }
2746
+ function GitHubInfoFallback({ owner, repo, className }) {
2747
+ return /* @__PURE__ */ jsxs14(
2748
+ "a",
2749
+ {
2750
+ href: `https://github.com/${owner}/${repo}`,
2751
+ rel: "noreferrer noopener",
2752
+ target: "_blank",
2753
+ className: `flex flex-col gap-1.5 p-2 rounded-lg text-sm text-fd-foreground/80 transition-colors lg:flex-row lg:items-center hover:text-fd-accent-foreground hover:bg-fd-accent ${className}`,
2754
+ children: [
2755
+ /* @__PURE__ */ jsxs14("p", { className: "flex items-center gap-2 truncate", children: [
2756
+ /* @__PURE__ */ jsxs14("svg", { fill: "currentColor", viewBox: "0 0 24 24", className: "size-3.5", children: [
2757
+ /* @__PURE__ */ jsx41("title", { children: "GitHub" }),
2758
+ /* @__PURE__ */ jsx41("path", { d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" })
2759
+ ] }),
2760
+ owner,
2761
+ "/",
2762
+ repo
2763
+ ] }),
2764
+ /* @__PURE__ */ jsxs14("p", { className: "flex text-xs items-center gap-1 text-fd-muted-foreground", children: [
2765
+ /* @__PURE__ */ jsx41(globalLucideIcons.ExternalLink, { className: "size-3" }),
2766
+ "GitHub"
2767
+ ] })
2768
+ ]
2769
+ }
2770
+ );
2771
+ }
2772
+ function GitHubInfoSuccess({
2773
+ owner,
2774
+ repo,
2775
+ stars,
2776
+ className
2777
+ }) {
2778
+ const humanizedStars = humanizeNumber(stars);
2779
+ return /* @__PURE__ */ jsxs14(
2780
+ "a",
2781
+ {
2782
+ href: `https://github.com/${owner}/${repo}`,
2783
+ rel: "noreferrer noopener",
2784
+ target: "_blank",
2785
+ className: `flex flex-col gap-1.5 p-2 rounded-lg text-sm text-fd-foreground/80 transition-colors lg:flex-row lg:items-center hover:text-fd-accent-foreground hover:bg-fd-accent ${className}`,
2786
+ children: [
2787
+ /* @__PURE__ */ jsxs14("p", { className: "flex items-center gap-2 truncate", children: [
2788
+ /* @__PURE__ */ jsxs14("svg", { fill: "currentColor", viewBox: "0 0 24 24", className: "size-3.5", children: [
2789
+ /* @__PURE__ */ jsx41("title", { children: "GitHub" }),
2790
+ /* @__PURE__ */ jsx41("path", { d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" })
2791
+ ] }),
2792
+ owner,
2793
+ "/",
2794
+ repo
2795
+ ] }),
2796
+ /* @__PURE__ */ jsxs14("p", { className: "flex text-xs items-center gap-1 text-fd-muted-foreground", children: [
2797
+ /* @__PURE__ */ jsx41(globalLucideIcons.Star, { className: "size-3" }),
2798
+ humanizedStars
2799
+ ] })
2800
+ ]
2801
+ }
2802
+ );
2803
+ }
2804
+ function humanizeNumber(num) {
2805
+ if (num < 1e3) {
2806
+ return num.toString();
2807
+ }
2808
+ if (num < 1e5) {
2809
+ const value = (num / 1e3).toFixed(1);
2810
+ const formattedValue = value.endsWith(".0") ? value.slice(0, -2) : value;
2811
+ return `${formattedValue}K`;
2812
+ }
2813
+ if (num < 1e6) {
2814
+ return `${Math.floor(num / 1e3)}K`;
2815
+ }
2816
+ return num.toString();
2817
+ }
2818
+ function FumaGithubInfo({ owner, repo, token, className }) {
2819
+ const [data, setData] = useState4(null);
2820
+ const [loading, setLoading] = useState4(true);
2821
+ const [error, setError] = useState4(null);
2822
+ useEffect2(() => {
2823
+ const fetchRepoData = () => __async(null, null, function* () {
2824
+ try {
2825
+ setLoading(true);
2826
+ setError(null);
2827
+ const controller = new AbortController();
2828
+ const timeoutId = setTimeout(() => controller.abort(), 5e3);
2829
+ const headers = new Headers({
2830
+ "Accept": "application/vnd.github.v3+json"
2831
+ });
2832
+ if (token) {
2833
+ headers.set("Authorization", `Bearer ${token}`);
2834
+ }
2835
+ const response = yield fetch(`https://api.github.com/repos/${owner}/${repo}`, {
2836
+ signal: controller.signal,
2837
+ headers
2838
+ });
2839
+ clearTimeout(timeoutId);
2840
+ if (!response.ok) {
2841
+ throw new Error(`GitHub API response error: ${response.status}`);
2842
+ }
2843
+ const repoData = yield response.json();
2844
+ setData({
2845
+ stargazers_count: repoData.stargazers_count,
2846
+ forks_count: repoData.forks_count
2847
+ });
2848
+ } catch (err) {
2849
+ console.warn("GitHub API call failed:", err);
2850
+ if (err instanceof Error) {
2851
+ if (err.name === "AbortError") {
2852
+ setError("Request timeout");
2853
+ } else {
2854
+ setError("Failed to get repository information");
2855
+ }
2856
+ } else {
2857
+ setError("Unknown error");
2858
+ }
2859
+ } finally {
2860
+ setLoading(false);
2861
+ }
2862
+ });
2863
+ fetchRepoData();
2864
+ }, [owner, repo, token]);
2865
+ if (loading) {
2866
+ return /* @__PURE__ */ jsx41(GitHubInfoSkeleton, { owner, repo, className });
2867
+ }
2868
+ if (error || !data) {
2869
+ return /* @__PURE__ */ jsx41(GitHubInfoFallback, { owner, repo, className });
2870
+ }
2871
+ return /* @__PURE__ */ jsx41(
2872
+ GitHubInfoSuccess,
2873
+ {
2874
+ owner,
2875
+ repo,
2876
+ stars: data.stargazers_count,
2877
+ className
2878
+ }
2879
+ );
2880
+ }
2724
2881
  export {
2725
2882
  EditOnGitHub,
2883
+ FumaBannerSuit,
2884
+ FumaGithubInfo,
2726
2885
  GradientButton,
2727
2886
  ImageGrid,
2728
2887
  ImageZoom,