@windrun-huaiin/third-ui 5.2.0 → 5.3.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.
@@ -2490,24 +2490,46 @@ function cn(...inputs) {
2490
2490
  }
2491
2491
 
2492
2492
  // src/fuma/mdx/zia-card.tsx
2493
- import Link2 from "fumadocs-core/link";
2493
+ import Link2 from "next/link";
2494
2494
  import { jsx as jsx34, jsxs as jsxs9 } from "react/jsx-runtime";
2495
2495
  function ZiaCard(_a) {
2496
2496
  var _b = _a, { icon, title, description } = _b, props = __objRest(_b, ["icon", "title", "description"]);
2497
- const E = props.href ? Link2 : "div";
2497
+ const validHref = typeof props.href === "string" && props.href.trim() !== "";
2498
+ const validDescription = typeof description === "string" && (description == null ? void 0 : description.trim()) !== "";
2499
+ if (validHref) {
2500
+ return /* @__PURE__ */ jsxs9(
2501
+ Link2,
2502
+ __spreadProps(__spreadValues({
2503
+ href: props.href,
2504
+ "data-card": true,
2505
+ className: cn(
2506
+ "block rounded-lg border bg-fd-card p-4 text-fd-card-foreground shadow-md transition-colors @max-lg:col-span-full",
2507
+ "hover:bg-fd-accent/80",
2508
+ props.className
2509
+ )
2510
+ }, props), {
2511
+ children: [
2512
+ /* @__PURE__ */ jsx34("div", { className: "not-prose mb-2 w-fit rounded-md border bg-fd-muted p-1.5 text-fd-muted-foreground [&_svg]:size-4", children: icon ? icon : /* @__PURE__ */ jsx34(globalLucideIcons.CircleSmall, {}) }),
2513
+ /* @__PURE__ */ jsx34("h3", { className: "not-prose mb-1 text-sm font-medium line-clamp-2 min-h-[2.5rem]", children: title }),
2514
+ validDescription ? /* @__PURE__ */ jsx34("p", { className: "!my-0 text-sm text-fd-muted-foreground", children: description }) : /* @__PURE__ */ jsx34("p", { className: "!my-0 text-sm text-fd-muted-foreground opacity-0 select-none", children: "\xA0" }),
2515
+ props.children ? /* @__PURE__ */ jsx34("div", { className: "text-sm text-fd-muted-foreground prose-no-margin", children: props.children }) : null
2516
+ ]
2517
+ })
2518
+ );
2519
+ }
2498
2520
  return /* @__PURE__ */ jsxs9(
2499
- E,
2500
- __spreadProps(__spreadValues({}, props), {
2521
+ "div",
2522
+ __spreadProps(__spreadValues({
2501
2523
  "data-card": true,
2502
2524
  className: cn(
2503
2525
  "block rounded-lg border bg-fd-card p-4 text-fd-card-foreground shadow-md transition-colors @max-lg:col-span-full",
2504
- props.href && "hover:bg-fd-accent/80",
2505
2526
  props.className
2506
- ),
2527
+ )
2528
+ }, props), {
2507
2529
  children: [
2508
2530
  /* @__PURE__ */ jsx34("div", { className: "not-prose mb-2 w-fit rounded-md border bg-fd-muted p-1.5 text-fd-muted-foreground [&_svg]:size-4", children: icon ? icon : /* @__PURE__ */ jsx34(globalLucideIcons.CircleSmall, {}) }),
2509
2531
  /* @__PURE__ */ jsx34("h3", { className: "not-prose mb-1 text-sm font-medium line-clamp-2 min-h-[2.5rem]", children: title }),
2510
- description ? /* @__PURE__ */ jsx34("p", { className: "!my-0 text-sm text-fd-muted-foreground", children: description }) : /* @__PURE__ */ jsx34("p", { className: "!my-0 text-sm text-fd-muted-foreground opacity-0 select-none", children: "\xA0" }),
2532
+ validDescription ? /* @__PURE__ */ jsx34("p", { className: "!my-0 text-sm text-fd-muted-foreground", children: description }) : /* @__PURE__ */ jsx34("p", { className: "!my-0 text-sm text-fd-muted-foreground opacity-0 select-none", children: "\xA0" }),
2511
2533
  props.children ? /* @__PURE__ */ jsx34("div", { className: "text-sm text-fd-muted-foreground prose-no-margin", children: props.children }) : null
2512
2534
  ]
2513
2535
  })
@@ -3065,8 +3087,8 @@ import {
3065
3087
  CollapsibleContent,
3066
3088
  CollapsibleTrigger
3067
3089
  } from "fumadocs-ui/components/ui/collapsible";
3068
- import React34 from "react";
3069
- import { Fragment as Fragment4, jsx as jsx43, jsxs as jsxs15 } from "react/jsx-runtime";
3090
+ import Link5 from "next/link";
3091
+ import { jsx as jsx43, jsxs as jsxs15 } from "react/jsx-runtime";
3070
3092
  var itemVariants = "flex flex-row items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-fd-accent hover:text-fd-accent-foreground [&_svg]:size-4";
3071
3093
  var anotionClass = "ms-2 px-2 py-0.5 rounded text-xs font-semibold bg-fd-accent/80 text-fd-accent-foreground dark:bg-white/20 dark:text-white";
3072
3094
  function ZiaFile(_a) {
@@ -3084,19 +3106,19 @@ function ZiaFile(_a) {
3084
3106
  "href"
3085
3107
  ]);
3086
3108
  const validHref = typeof href === "string" && href.trim() !== "";
3087
- const Comp = validHref ? "a" : "div";
3088
3109
  const validAnotion = typeof anotion === "string" && anotion.trim() !== "";
3089
- return React34.createElement(
3090
- Comp,
3091
- __spreadValues(__spreadValues({
3092
- className: cn(itemVariants, className)
3093
- }, validHref ? { href, target: "_blank", rel: "noopener noreferrer" } : {}), rest),
3094
- /* @__PURE__ */ jsxs15(Fragment4, { children: [
3110
+ if (validHref) {
3111
+ return /* @__PURE__ */ jsxs15(Link5, { href, className: cn(itemVariants, className), children: [
3095
3112
  icon,
3096
3113
  /* @__PURE__ */ jsx43("span", { children: name }),
3097
3114
  validAnotion && /* @__PURE__ */ jsx43("span", { className: anotionClass, children: anotion })
3098
- ] })
3099
- );
3115
+ ] });
3116
+ }
3117
+ return /* @__PURE__ */ jsxs15("div", __spreadProps(__spreadValues({ className: cn(itemVariants, className) }, rest), { children: [
3118
+ icon,
3119
+ /* @__PURE__ */ jsx43("span", { children: name }),
3120
+ validAnotion && /* @__PURE__ */ jsx43("span", { className: anotionClass, children: anotion })
3121
+ ] }));
3100
3122
  }
3101
3123
  function ZiaFolder(_a) {
3102
3124
  var _b = _a, {