@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.
@@ -6,13 +6,13 @@ interface FumaPageParams {
6
6
  getMDXComponents: () => any;
7
7
  mdxSourceDir: string;
8
8
  githubBaseUrl?: string;
9
- showCopy?: boolean;
9
+ copyButtonComponent?: ReactNode;
10
10
  siteIcon: ReactNode;
11
11
  FallbackPage: React.ComponentType<{
12
12
  siteIcon: ReactNode;
13
13
  }>;
14
14
  }
15
- declare function createFumaPage({ mdxContentSource, getMDXComponents, mdxSourceDir, githubBaseUrl, showCopy, siteIcon, FallbackPage, }: FumaPageParams): {
15
+ declare function createFumaPage({ mdxContentSource, getMDXComponents, mdxSourceDir, githubBaseUrl, copyButtonComponent, siteIcon, FallbackPage, }: FumaPageParams): {
16
16
  Page: ({ params }: {
17
17
  params: Promise<{
18
18
  locale: string;
@@ -6,13 +6,13 @@ interface FumaPageParams {
6
6
  getMDXComponents: () => any;
7
7
  mdxSourceDir: string;
8
8
  githubBaseUrl?: string;
9
- showCopy?: boolean;
9
+ copyButtonComponent?: ReactNode;
10
10
  siteIcon: ReactNode;
11
11
  FallbackPage: React.ComponentType<{
12
12
  siteIcon: ReactNode;
13
13
  }>;
14
14
  }
15
- declare function createFumaPage({ mdxContentSource, getMDXComponents, mdxSourceDir, githubBaseUrl, showCopy, siteIcon, FallbackPage, }: FumaPageParams): {
15
+ declare function createFumaPage({ mdxContentSource, getMDXComponents, mdxSourceDir, githubBaseUrl, copyButtonComponent, siteIcon, FallbackPage, }: FumaPageParams): {
16
16
  Page: ({ params }: {
17
17
  params: Promise<{
18
18
  locale: string;
@@ -83,11 +83,8 @@ __export(server_exports, {
83
83
  });
84
84
  module.exports = __toCommonJS(server_exports);
85
85
 
86
- // src/fuma/mdx/toc-base.tsx
87
- var import_react35 = require("react");
88
- var import_navigation = require("next/navigation");
89
- var import_use_copy_button = require("fumadocs-ui/utils/use-copy-button");
90
- var import_link2 = __toESM(require("fumadocs-core/link"));
86
+ // src/fuma/fuma-page-genarator.tsx
87
+ var import_page = require("fumadocs-ui/page");
91
88
 
92
89
  // ../base-ui/src/assets/github.tsx
93
90
  var import_react = __toESM(require("react"), 1);
@@ -2599,6 +2596,34 @@ for (const [iconName, IconComponent] of Object.entries(BUILTIN_ICON_COMPONENTS))
2599
2596
  var wrappedBuiltinIconsPart = tempWrappedBuiltinIcons;
2600
2597
  var globalLucideIcons = __spreadValues(__spreadValues({}, styledLimitedIconsPart), wrappedBuiltinIconsPart);
2601
2598
 
2599
+ // src/fuma/mdx/mermaid.tsx
2600
+ var import_next_themes = require("next-themes");
2601
+ var import_react35 = require("react");
2602
+ var import_jsx_runtime33 = require("react/jsx-runtime");
2603
+
2604
+ // src/fuma/mdx/image-zoom.tsx
2605
+ var import_framework = require("fumadocs-core/framework");
2606
+ var import_react36 = require("react");
2607
+ var import_react_medium_image_zoom = __toESM(require("react-medium-image-zoom"));
2608
+ var import_jsx_runtime34 = require("react/jsx-runtime");
2609
+
2610
+ // src/fuma/mdx/trophy-card.tsx
2611
+ var import_jsx_runtime35 = require("react/jsx-runtime");
2612
+
2613
+ // src/fuma/mdx/image-grid.tsx
2614
+ var import_jsx_runtime36 = require("react/jsx-runtime");
2615
+
2616
+ // ../lib/src/utils.ts
2617
+ var import_clsx = require("clsx");
2618
+ var import_tailwind_merge = require("tailwind-merge");
2619
+ function cn(...inputs) {
2620
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
2621
+ }
2622
+
2623
+ // src/fuma/mdx/zia-card.tsx
2624
+ var import_link2 = __toESM(require("next/link"));
2625
+ var import_jsx_runtime37 = require("react/jsx-runtime");
2626
+
2602
2627
  // ../base-ui/src/ui/button.tsx
2603
2628
  var React35 = __toESM(require("react"), 1);
2604
2629
 
@@ -2640,7 +2665,7 @@ function composeRefs(...refs) {
2640
2665
  }
2641
2666
 
2642
2667
  // ../../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
2643
- var import_jsx_runtime33 = require("react/jsx-runtime");
2668
+ var import_jsx_runtime38 = require("react/jsx-runtime");
2644
2669
  // @__NO_SIDE_EFFECTS__
2645
2670
  function createSlot(ownerName) {
2646
2671
  const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
@@ -2658,9 +2683,9 @@ function createSlot(ownerName) {
2658
2683
  return child;
2659
2684
  }
2660
2685
  });
2661
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children: React34.isValidElement(newElement) ? React34.cloneElement(newElement, void 0, newChildren) : null }));
2686
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children: React34.isValidElement(newElement) ? React34.cloneElement(newElement, void 0, newChildren) : null }));
2662
2687
  }
2663
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children }));
2688
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children }));
2664
2689
  });
2665
2690
  Slot2.displayName = `${ownerName}.Slot`;
2666
2691
  return Slot2;
@@ -2727,9 +2752,9 @@ function getElementRef(element) {
2727
2752
  }
2728
2753
 
2729
2754
  // ../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs
2730
- var import_clsx = require("clsx");
2755
+ var import_clsx2 = require("clsx");
2731
2756
  var falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
2732
- var cx = import_clsx.clsx;
2757
+ var cx = import_clsx2.clsx;
2733
2758
  var cva = (base, config) => (props) => {
2734
2759
  var _config_compoundVariants;
2735
2760
  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);
@@ -2763,15 +2788,8 @@ var cva = (base, config) => (props) => {
2763
2788
  return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
2764
2789
  };
2765
2790
 
2766
- // ../lib/src/utils.ts
2767
- var import_clsx2 = require("clsx");
2768
- var import_tailwind_merge = require("tailwind-merge");
2769
- function cn(...inputs) {
2770
- return (0, import_tailwind_merge.twMerge)((0, import_clsx2.clsx)(inputs));
2771
- }
2772
-
2773
2791
  // ../base-ui/src/ui/button.tsx
2774
- var import_jsx_runtime34 = require("react/jsx-runtime");
2792
+ var import_jsx_runtime39 = require("react/jsx-runtime");
2775
2793
  var buttonVariants = cva(
2776
2794
  "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",
2777
2795
  {
@@ -2802,7 +2820,7 @@ var Button = React35.forwardRef(
2802
2820
  var _b = _a, { className, variant, size, asChild = false, loading = false, children } = _b, props = __objRest(_b, ["className", "variant", "size", "asChild", "loading", "children"]);
2803
2821
  const Comp = asChild ? Slot : "button";
2804
2822
  if (asChild) {
2805
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2823
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2806
2824
  Comp,
2807
2825
  __spreadProps(__spreadValues({
2808
2826
  className: cn(buttonVariants({ variant, size, className })),
@@ -2813,7 +2831,7 @@ var Button = React35.forwardRef(
2813
2831
  })
2814
2832
  );
2815
2833
  }
2816
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
2834
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
2817
2835
  Comp,
2818
2836
  __spreadProps(__spreadValues({
2819
2837
  className: cn(buttonVariants({ variant, size, className })),
@@ -2822,7 +2840,7 @@ var Button = React35.forwardRef(
2822
2840
  }, props), {
2823
2841
  children: [
2824
2842
  children,
2825
- loading && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(globalLucideIcons.Loader2, { className: "ml-2 h-4 w-4 animate-spin" })
2843
+ loading && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(globalLucideIcons.Loader2, { className: "ml-2 h-4 w-4 animate-spin" })
2826
2844
  ]
2827
2845
  })
2828
2846
  );
@@ -2830,95 +2848,76 @@ var Button = React35.forwardRef(
2830
2848
  );
2831
2849
  Button.displayName = "Button";
2832
2850
 
2851
+ // src/fuma/mdx/gradient-button.tsx
2852
+ var import_link3 = __toESM(require("fumadocs-core/link"));
2853
+ var import_react37 = __toESM(require("react"));
2854
+ var import_jsx_runtime40 = require("react/jsx-runtime");
2855
+
2833
2856
  // src/fuma/mdx/toc-base.tsx
2834
- var import_jsx_runtime35 = require("react/jsx-runtime");
2835
- var cache = /* @__PURE__ */ new Map();
2836
- function LLMCopyButton({ llmApiUrl } = {}) {
2837
- const [isLoading, setLoading] = (0, import_react35.useState)(false);
2838
- const params = (0, import_navigation.useParams)();
2839
- const locale = params.locale;
2840
- const slug = params.slug;
2841
- const [checked, onClick] = (0, import_use_copy_button.useCopyButton)(() => __async(null, null, function* () {
2842
- var _a;
2843
- setLoading(true);
2844
- const path = slug && Array.isArray(slug) ? slug.join("/") : "";
2845
- const apiPrefix = llmApiUrl || "/api/llm-content";
2846
- const apiUrl = `${apiPrefix}?locale=${encodeURIComponent(locale)}&path=${encodeURIComponent(path)}`;
2847
- console.log("Fetching LLM content from:", apiUrl);
2848
- try {
2849
- const content = (_a = cache.get(apiUrl)) != null ? _a : yield fetch(apiUrl).then((res) => {
2850
- if (!res.ok) {
2851
- throw new Error(`Failed to fetch LLM content: ${res.status} ${res.statusText}`);
2852
- }
2853
- return res.text();
2854
- });
2855
- cache.set(apiUrl, content);
2856
- yield navigator.clipboard.writeText(content);
2857
- } catch (error) {
2858
- console.error("Error fetching or copying LLM content:", error);
2859
- } finally {
2860
- setLoading(false);
2861
- }
2862
- }));
2863
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
2864
- Button,
2865
- {
2866
- variant: "ghost",
2867
- size: "sm",
2868
- loading: isLoading,
2869
- className: "justify-start px-0 text-stone-600 hover:text-stone-500 dark:text-stone-400 dark:hover:text-stone-300",
2870
- onClick,
2871
- children: checked ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
2872
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(globalLucideIcons.Check, {}),
2873
- "Copied!"
2874
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
2875
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(globalLucideIcons.Markdown, {}),
2876
- "Copy page as Markdown"
2877
- ] })
2878
- }
2879
- );
2880
- }
2857
+ var import_react38 = require("react");
2858
+ var import_navigation = require("next/navigation");
2859
+ var import_use_copy_button = require("fumadocs-ui/utils/use-copy-button");
2860
+ var import_link4 = __toESM(require("fumadocs-core/link"));
2861
+ var import_jsx_runtime41 = require("react/jsx-runtime");
2881
2862
  function EditOnGitHub({ url }) {
2882
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
2883
- import_link2.default,
2863
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
2864
+ import_link4.default,
2884
2865
  {
2885
2866
  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",
2886
2867
  href: url,
2887
2868
  children: [
2888
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(globalLucideIcons.GitHub, {}),
2869
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(globalLucideIcons.GitHub, {}),
2889
2870
  "Edit this page on GitHub"
2890
2871
  ]
2891
2872
  }
2892
2873
  );
2893
2874
  }
2894
2875
  function LastUpdatedDate({ date }) {
2895
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center gap-x-2 text-stone-600 dark:text-stone-400 text-sm", children: [
2896
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(globalLucideIcons.LastUpdated, {}),
2876
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center gap-x-2 text-stone-600 dark:text-stone-400 text-sm", children: [
2877
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(globalLucideIcons.LastUpdated, {}),
2897
2878
  "Lastest on ",
2898
2879
  date ? date : "Ages ago"
2899
2880
  ] });
2900
2881
  }
2901
2882
 
2902
- // src/fuma/mdx/toc.tsx
2903
- var import_jsx_runtime36 = require("react/jsx-runtime");
2904
- function TocFooter({ lastModified, showCopy, editPath, githubBaseUrl }) {
2883
+ // src/fuma/mdx/fuma-banner-suit.tsx
2884
+ var import_banner = require("fumadocs-ui/components/banner");
2885
+ var import_next_intl = require("next-intl");
2886
+ var import_jsx_runtime42 = require("react/jsx-runtime");
2887
+
2888
+ // src/fuma/mdx/fuma-github-info.tsx
2889
+ var import_react39 = require("react");
2890
+ var import_jsx_runtime43 = require("react/jsx-runtime");
2891
+
2892
+ // src/fuma/mdx/site-x.tsx
2893
+ var import_next_intl2 = require("next-intl");
2894
+ var import_jsx_runtime44 = require("react/jsx-runtime");
2895
+
2896
+ // src/fuma/mdx/zia-file.tsx
2897
+ var import_react40 = require("react");
2898
+ var import_collapsible = require("fumadocs-ui/components/ui/collapsible");
2899
+ var import_link5 = __toESM(require("next/link"));
2900
+ var import_jsx_runtime45 = require("react/jsx-runtime");
2901
+
2902
+ // src/fuma/mdx/toc-footer-wrapper.tsx
2903
+ var import_jsx_runtime46 = require("react/jsx-runtime");
2904
+ function TocFooterWrapper({ lastModified, editPath, githubBaseUrl, copyButtonComponent }) {
2905
2905
  const showEdit = githubBaseUrl && editPath;
2906
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex flex-col gap-y-2 items-start m-4", children: [
2907
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(LastUpdatedDate, { date: lastModified }),
2908
- showCopy && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(LLMCopyButton, {}),
2909
- showEdit && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(EditOnGitHub, { url: `${githubBaseUrl}${editPath}` })
2906
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex flex-col gap-y-2 items-start m-4", children: [
2907
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(LastUpdatedDate, { date: lastModified }),
2908
+ copyButtonComponent,
2909
+ showEdit && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(EditOnGitHub, { url: `${githubBaseUrl}${editPath}` })
2910
2910
  ] });
2911
2911
  }
2912
2912
 
2913
2913
  // src/fuma/fuma-page-genarator.tsx
2914
- var import_page = require("fumadocs-ui/page");
2915
- var import_jsx_runtime37 = require("react/jsx-runtime");
2914
+ var import_jsx_runtime47 = require("react/jsx-runtime");
2916
2915
  function createFumaPage({
2917
2916
  mdxContentSource,
2918
2917
  getMDXComponents,
2919
2918
  mdxSourceDir,
2920
2919
  githubBaseUrl,
2921
- showCopy = true,
2920
+ copyButtonComponent,
2922
2921
  siteIcon,
2923
2922
  FallbackPage
2924
2923
  }) {
@@ -2927,20 +2926,20 @@ function createFumaPage({
2927
2926
  const { slug, locale } = yield params;
2928
2927
  const page = mdxContentSource.getPage(slug, locale);
2929
2928
  if (!page) {
2930
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(FallbackPage, { siteIcon });
2929
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FallbackPage, { siteIcon });
2931
2930
  }
2932
2931
  const path = githubBaseUrl ? `${mdxSourceDir}/${page.file.path}` : void 0;
2933
- const tocFooterElement = /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2934
- TocFooter,
2932
+ const tocFooterElement = /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
2933
+ TocFooterWrapper,
2935
2934
  {
2936
2935
  lastModified: page.data.date,
2937
- showCopy,
2936
+ copyButtonComponent,
2938
2937
  editPath: path,
2939
2938
  githubBaseUrl
2940
2939
  }
2941
2940
  );
2942
2941
  const MDX = page.data.body;
2943
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
2942
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
2944
2943
  import_page.DocsPage,
2945
2944
  {
2946
2945
  tableOfContent: { style: "clerk", single: false, footer: tocFooterElement },
@@ -2949,9 +2948,9 @@ function createFumaPage({
2949
2948
  full: page.data.full,
2950
2949
  article: { className: "max-sm:pb-16" },
2951
2950
  children: [
2952
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_page.DocsTitle, { children: page.data.title }),
2953
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_page.DocsDescription, { className: "mb-2", children: page.data.description }),
2954
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_page.DocsBody, { className: "text-fd-foreground/80", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MDX, { components: getMDXComponents() }) })
2951
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_page.DocsTitle, { children: page.data.title }),
2952
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_page.DocsDescription, { className: "mb-2", children: page.data.description }),
2953
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_page.DocsBody, { className: "text-fd-foreground/80", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(MDX, { components: getMDXComponents() }) })
2955
2954
  ]
2956
2955
  }
2957
2956
  );