@windrun-huaiin/third-ui 5.6.0 → 5.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -54,11 +54,8 @@ var __async = (__this, __arguments, generator) => {
54
54
  });
55
55
  };
56
56
 
57
- // src/fuma/mdx/toc-base.tsx
58
- import { useState } from "react";
59
- import { useParams } from "next/navigation";
60
- import { useCopyButton } from "fumadocs-ui/utils/use-copy-button";
61
- import Link2 from "fumadocs-core/link";
57
+ // src/fuma/fuma-page-genarator.tsx
58
+ import { DocsBody, DocsDescription, DocsPage, DocsTitle } from "fumadocs-ui/page";
62
59
 
63
60
  // ../base-ui/src/assets/github.tsx
64
61
  import React from "react";
@@ -2570,6 +2567,34 @@ for (const [iconName, IconComponent] of Object.entries(BUILTIN_ICON_COMPONENTS))
2570
2567
  var wrappedBuiltinIconsPart = tempWrappedBuiltinIcons;
2571
2568
  var globalLucideIcons = __spreadValues(__spreadValues({}, styledLimitedIconsPart), wrappedBuiltinIconsPart);
2572
2569
 
2570
+ // src/fuma/mdx/mermaid.tsx
2571
+ import { useTheme } from "next-themes";
2572
+ import { useEffect, useId, useState } from "react";
2573
+ import { jsx as jsx33, jsxs as jsxs10 } from "react/jsx-runtime";
2574
+
2575
+ // src/fuma/mdx/image-zoom.tsx
2576
+ import { Image } from "fumadocs-core/framework";
2577
+ import { useState as useState2 } from "react";
2578
+ import Zoom from "react-medium-image-zoom";
2579
+ import { jsx as jsx34 } from "react/jsx-runtime";
2580
+
2581
+ // src/fuma/mdx/trophy-card.tsx
2582
+ import { jsx as jsx35, jsxs as jsxs11 } from "react/jsx-runtime";
2583
+
2584
+ // src/fuma/mdx/image-grid.tsx
2585
+ import { jsx as jsx36 } from "react/jsx-runtime";
2586
+
2587
+ // ../lib/src/utils.ts
2588
+ import { clsx } from "clsx";
2589
+ import { twMerge } from "tailwind-merge";
2590
+ function cn(...inputs) {
2591
+ return twMerge(clsx(inputs));
2592
+ }
2593
+
2594
+ // src/fuma/mdx/zia-card.tsx
2595
+ import Link2 from "next/link";
2596
+ import { jsx as jsx37, jsxs as jsxs12 } from "react/jsx-runtime";
2597
+
2573
2598
  // ../base-ui/src/ui/button.tsx
2574
2599
  import * as React35 from "react";
2575
2600
 
@@ -2611,7 +2636,7 @@ function composeRefs(...refs) {
2611
2636
  }
2612
2637
 
2613
2638
  // ../../node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-slot/dist/index.mjs
2614
- import { Fragment as Fragment2, jsx as jsx33 } from "react/jsx-runtime";
2639
+ import { Fragment as Fragment2, jsx as jsx38 } from "react/jsx-runtime";
2615
2640
  // @__NO_SIDE_EFFECTS__
2616
2641
  function createSlot(ownerName) {
2617
2642
  const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
@@ -2629,9 +2654,9 @@ function createSlot(ownerName) {
2629
2654
  return child;
2630
2655
  }
2631
2656
  });
2632
- return /* @__PURE__ */ jsx33(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children: React34.isValidElement(newElement) ? React34.cloneElement(newElement, void 0, newChildren) : null }));
2657
+ return /* @__PURE__ */ jsx38(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children: React34.isValidElement(newElement) ? React34.cloneElement(newElement, void 0, newChildren) : null }));
2633
2658
  }
2634
- return /* @__PURE__ */ jsx33(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children }));
2659
+ return /* @__PURE__ */ jsx38(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children }));
2635
2660
  });
2636
2661
  Slot2.displayName = `${ownerName}.Slot`;
2637
2662
  return Slot2;
@@ -2698,9 +2723,9 @@ function getElementRef(element) {
2698
2723
  }
2699
2724
 
2700
2725
  // ../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs
2701
- import { clsx } from "clsx";
2726
+ import { clsx as clsx2 } from "clsx";
2702
2727
  var falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
2703
- var cx = clsx;
2728
+ var cx = clsx2;
2704
2729
  var cva = (base, config) => (props) => {
2705
2730
  var _config_compoundVariants;
2706
2731
  if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
@@ -2734,15 +2759,8 @@ var cva = (base, config) => (props) => {
2734
2759
  return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
2735
2760
  };
2736
2761
 
2737
- // ../lib/src/utils.ts
2738
- import { clsx as clsx2 } from "clsx";
2739
- import { twMerge } from "tailwind-merge";
2740
- function cn(...inputs) {
2741
- return twMerge(clsx2(inputs));
2742
- }
2743
-
2744
2762
  // ../base-ui/src/ui/button.tsx
2745
- import { jsx as jsx34, jsxs as jsxs10 } from "react/jsx-runtime";
2763
+ import { jsx as jsx39, jsxs as jsxs13 } from "react/jsx-runtime";
2746
2764
  var buttonVariants = cva(
2747
2765
  "inline-flex items-center gap-2 whitespace-nowrap rounded-md text-sm ring-offset-background transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
2748
2766
  {
@@ -2773,7 +2791,7 @@ var Button = React35.forwardRef(
2773
2791
  var _b = _a, { className, variant, size, asChild = false, loading = false, children } = _b, props = __objRest(_b, ["className", "variant", "size", "asChild", "loading", "children"]);
2774
2792
  const Comp = asChild ? Slot : "button";
2775
2793
  if (asChild) {
2776
- return /* @__PURE__ */ jsx34(
2794
+ return /* @__PURE__ */ jsx39(
2777
2795
  Comp,
2778
2796
  __spreadProps(__spreadValues({
2779
2797
  className: cn(buttonVariants({ variant, size, className })),
@@ -2784,7 +2802,7 @@ var Button = React35.forwardRef(
2784
2802
  })
2785
2803
  );
2786
2804
  }
2787
- return /* @__PURE__ */ jsxs10(
2805
+ return /* @__PURE__ */ jsxs13(
2788
2806
  Comp,
2789
2807
  __spreadProps(__spreadValues({
2790
2808
  className: cn(buttonVariants({ variant, size, className })),
@@ -2793,7 +2811,7 @@ var Button = React35.forwardRef(
2793
2811
  }, props), {
2794
2812
  children: [
2795
2813
  children,
2796
- loading && /* @__PURE__ */ jsx34(globalLucideIcons.Loader2, { className: "ml-2 h-4 w-4 animate-spin" })
2814
+ loading && /* @__PURE__ */ jsx39(globalLucideIcons.Loader2, { className: "ml-2 h-4 w-4 animate-spin" })
2797
2815
  ]
2798
2816
  })
2799
2817
  );
@@ -2801,95 +2819,80 @@ var Button = React35.forwardRef(
2801
2819
  );
2802
2820
  Button.displayName = "Button";
2803
2821
 
2822
+ // src/fuma/mdx/gradient-button.tsx
2823
+ import Link3 from "fumadocs-core/link";
2824
+ import React36 from "react";
2825
+ import { jsx as jsx40, jsxs as jsxs14 } from "react/jsx-runtime";
2826
+
2804
2827
  // src/fuma/mdx/toc-base.tsx
2805
- import { Fragment as Fragment3, jsx as jsx35, jsxs as jsxs11 } from "react/jsx-runtime";
2806
- var cache = /* @__PURE__ */ new Map();
2807
- function LLMCopyButton({ llmApiUrl } = {}) {
2808
- const [isLoading, setLoading] = useState(false);
2809
- const params = useParams();
2810
- const locale = params.locale;
2811
- const slug = params.slug;
2812
- const [checked, onClick] = useCopyButton(() => __async(null, null, function* () {
2813
- var _a;
2814
- setLoading(true);
2815
- const path = slug && Array.isArray(slug) ? slug.join("/") : "";
2816
- const apiPrefix = llmApiUrl || "/api/llm-content";
2817
- const apiUrl = `${apiPrefix}?locale=${encodeURIComponent(locale)}&path=${encodeURIComponent(path)}`;
2818
- console.log("Fetching LLM content from:", apiUrl);
2819
- try {
2820
- const content = (_a = cache.get(apiUrl)) != null ? _a : yield fetch(apiUrl).then((res) => {
2821
- if (!res.ok) {
2822
- throw new Error(`Failed to fetch LLM content: ${res.status} ${res.statusText}`);
2823
- }
2824
- return res.text();
2825
- });
2826
- cache.set(apiUrl, content);
2827
- yield navigator.clipboard.writeText(content);
2828
- } catch (error) {
2829
- console.error("Error fetching or copying LLM content:", error);
2830
- } finally {
2831
- setLoading(false);
2832
- }
2833
- }));
2834
- return /* @__PURE__ */ jsx35(
2835
- Button,
2836
- {
2837
- variant: "ghost",
2838
- size: "sm",
2839
- loading: isLoading,
2840
- className: "justify-start px-0 text-stone-600 hover:text-stone-500 dark:text-stone-400 dark:hover:text-stone-300",
2841
- onClick,
2842
- children: checked ? /* @__PURE__ */ jsxs11(Fragment3, { children: [
2843
- /* @__PURE__ */ jsx35(globalLucideIcons.Check, {}),
2844
- "Copied!"
2845
- ] }) : /* @__PURE__ */ jsxs11(Fragment3, { children: [
2846
- /* @__PURE__ */ jsx35(globalLucideIcons.Markdown, {}),
2847
- "Copy page as Markdown"
2848
- ] })
2849
- }
2850
- );
2851
- }
2828
+ import { useState as useState3 } from "react";
2829
+ import { useParams } from "next/navigation";
2830
+ import { useCopyButton } from "fumadocs-ui/utils/use-copy-button";
2831
+ import Link4 from "fumadocs-core/link";
2832
+ import { Fragment as Fragment3, jsx as jsx41, jsxs as jsxs15 } from "react/jsx-runtime";
2852
2833
  function EditOnGitHub({ url }) {
2853
- return /* @__PURE__ */ jsxs11(
2854
- Link2,
2834
+ return /* @__PURE__ */ jsxs15(
2835
+ Link4,
2855
2836
  {
2856
2837
  className: "flex items-center gap-x-2 text-stone-600 hover:text-stone-500 dark:text-stone-400 dark:hover:text-stone-300 text-sm",
2857
2838
  href: url,
2858
2839
  children: [
2859
- /* @__PURE__ */ jsx35(globalLucideIcons.GitHub, {}),
2840
+ /* @__PURE__ */ jsx41(globalLucideIcons.GitHub, {}),
2860
2841
  "Edit this page on GitHub"
2861
2842
  ]
2862
2843
  }
2863
2844
  );
2864
2845
  }
2865
2846
  function LastUpdatedDate({ date }) {
2866
- return /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-x-2 text-stone-600 dark:text-stone-400 text-sm", children: [
2867
- /* @__PURE__ */ jsx35(globalLucideIcons.LastUpdated, {}),
2847
+ return /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-x-2 text-stone-600 dark:text-stone-400 text-sm", children: [
2848
+ /* @__PURE__ */ jsx41(globalLucideIcons.LastUpdated, {}),
2868
2849
  "Lastest on ",
2869
2850
  date ? date : "Ages ago"
2870
2851
  ] });
2871
2852
  }
2872
2853
 
2873
- // src/fuma/mdx/toc.tsx
2874
- import { jsx as jsx36, jsxs as jsxs12 } from "react/jsx-runtime";
2875
- function TocFooter({ lastModified, showCopy, editPath, githubBaseUrl }) {
2854
+ // src/fuma/mdx/fuma-banner-suit.tsx
2855
+ import { Banner } from "fumadocs-ui/components/banner";
2856
+ import { useTranslations } from "next-intl";
2857
+ import { jsx as jsx42 } from "react/jsx-runtime";
2858
+
2859
+ // src/fuma/mdx/fuma-github-info.tsx
2860
+ import { useEffect as useEffect2, useState as useState4 } from "react";
2861
+ import { jsx as jsx43, jsxs as jsxs16 } from "react/jsx-runtime";
2862
+
2863
+ // src/fuma/mdx/site-x.tsx
2864
+ import { useTranslations as useTranslations2 } from "next-intl";
2865
+ import { jsx as jsx44 } from "react/jsx-runtime";
2866
+
2867
+ // src/fuma/mdx/zia-file.tsx
2868
+ import { useState as useState5 } from "react";
2869
+ import {
2870
+ Collapsible,
2871
+ CollapsibleContent,
2872
+ CollapsibleTrigger
2873
+ } from "fumadocs-ui/components/ui/collapsible";
2874
+ import Link5 from "next/link";
2875
+ import { jsx as jsx45, jsxs as jsxs17 } from "react/jsx-runtime";
2876
+
2877
+ // src/fuma/mdx/toc-footer-wrapper.tsx
2878
+ import { jsx as jsx46, jsxs as jsxs18 } from "react/jsx-runtime";
2879
+ function TocFooterWrapper({ lastModified, editPath, githubBaseUrl, copyButtonComponent }) {
2876
2880
  const showEdit = githubBaseUrl && editPath;
2877
- return /* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-y-2 items-start m-4", children: [
2878
- /* @__PURE__ */ jsx36(LastUpdatedDate, { date: lastModified }),
2879
- showCopy && /* @__PURE__ */ jsx36(LLMCopyButton, {}),
2880
- showEdit && /* @__PURE__ */ jsx36(EditOnGitHub, { url: `${githubBaseUrl}${editPath}` })
2881
+ return /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-y-2 items-start m-4", children: [
2882
+ /* @__PURE__ */ jsx46(LastUpdatedDate, { date: lastModified }),
2883
+ copyButtonComponent,
2884
+ showEdit && /* @__PURE__ */ jsx46(EditOnGitHub, { url: `${githubBaseUrl}${editPath}` })
2881
2885
  ] });
2882
2886
  }
2883
2887
 
2884
2888
  // src/fuma/fuma-page-genarator.tsx
2885
- import { DocsBody, DocsDescription, DocsPage, DocsTitle } from "fumadocs-ui/page";
2886
- import { jsx as jsx37, jsxs as jsxs13 } from "react/jsx-runtime";
2889
+ import { jsx as jsx47, jsxs as jsxs19 } from "react/jsx-runtime";
2887
2890
  function createFumaPage({
2888
2891
  mdxContentSource,
2889
2892
  getMDXComponents,
2890
2893
  mdxSourceDir,
2891
2894
  githubBaseUrl,
2892
- showCopy = true,
2895
+ copyButtonComponent,
2893
2896
  siteIcon,
2894
2897
  FallbackPage
2895
2898
  }) {
@@ -2898,20 +2901,20 @@ function createFumaPage({
2898
2901
  const { slug, locale } = yield params;
2899
2902
  const page = mdxContentSource.getPage(slug, locale);
2900
2903
  if (!page) {
2901
- return /* @__PURE__ */ jsx37(FallbackPage, { siteIcon });
2904
+ return /* @__PURE__ */ jsx47(FallbackPage, { siteIcon });
2902
2905
  }
2903
2906
  const path = githubBaseUrl ? `${mdxSourceDir}/${page.file.path}` : void 0;
2904
- const tocFooterElement = /* @__PURE__ */ jsx37(
2905
- TocFooter,
2907
+ const tocFooterElement = /* @__PURE__ */ jsx47(
2908
+ TocFooterWrapper,
2906
2909
  {
2907
2910
  lastModified: page.data.date,
2908
- showCopy,
2911
+ copyButtonComponent,
2909
2912
  editPath: path,
2910
2913
  githubBaseUrl
2911
2914
  }
2912
2915
  );
2913
2916
  const MDX = page.data.body;
2914
- return /* @__PURE__ */ jsxs13(
2917
+ return /* @__PURE__ */ jsxs19(
2915
2918
  DocsPage,
2916
2919
  {
2917
2920
  tableOfContent: { style: "clerk", single: false, footer: tocFooterElement },
@@ -2920,9 +2923,9 @@ function createFumaPage({
2920
2923
  full: page.data.full,
2921
2924
  article: { className: "max-sm:pb-16" },
2922
2925
  children: [
2923
- /* @__PURE__ */ jsx37(DocsTitle, { children: page.data.title }),
2924
- /* @__PURE__ */ jsx37(DocsDescription, { className: "mb-2", children: page.data.description }),
2925
- /* @__PURE__ */ jsx37(DocsBody, { className: "text-fd-foreground/80", children: /* @__PURE__ */ jsx37(MDX, { components: getMDXComponents() }) })
2926
+ /* @__PURE__ */ jsx47(DocsTitle, { children: page.data.title }),
2927
+ /* @__PURE__ */ jsx47(DocsDescription, { className: "mb-2", children: page.data.description }),
2928
+ /* @__PURE__ */ jsx47(DocsBody, { className: "text-fd-foreground/80", children: /* @__PURE__ */ jsx47(MDX, { components: getMDXComponents() }) })
2926
2929
  ]
2927
2930
  }
2928
2931
  );