@windrun-huaiin/third-ui 5.2.1 → 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.
@@ -2533,24 +2533,46 @@ function cn(...inputs) {
2533
2533
  }
2534
2534
 
2535
2535
  // src/fuma/mdx/zia-card.tsx
2536
- var import_link2 = __toESM(require("fumadocs-core/link"));
2536
+ var import_link2 = __toESM(require("next/link"));
2537
2537
  var import_jsx_runtime34 = require("react/jsx-runtime");
2538
2538
  function ZiaCard(_a) {
2539
2539
  var _b = _a, { icon, title, description } = _b, props = __objRest(_b, ["icon", "title", "description"]);
2540
- const E = props.href ? import_link2.default : "div";
2540
+ const validHref = typeof props.href === "string" && props.href.trim() !== "";
2541
+ const validDescription = typeof description === "string" && (description == null ? void 0 : description.trim()) !== "";
2542
+ if (validHref) {
2543
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
2544
+ import_link2.default,
2545
+ __spreadProps(__spreadValues({
2546
+ href: props.href,
2547
+ "data-card": true,
2548
+ className: cn(
2549
+ "block rounded-lg border bg-fd-card p-4 text-fd-card-foreground shadow-md transition-colors @max-lg:col-span-full",
2550
+ "hover:bg-fd-accent/80",
2551
+ props.className
2552
+ )
2553
+ }, props), {
2554
+ children: [
2555
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("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__ */ (0, import_jsx_runtime34.jsx)(globalLucideIcons.CircleSmall, {}) }),
2556
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("h3", { className: "not-prose mb-1 text-sm font-medium line-clamp-2 min-h-[2.5rem]", children: title }),
2557
+ validDescription ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "!my-0 text-sm text-fd-muted-foreground", children: description }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "!my-0 text-sm text-fd-muted-foreground opacity-0 select-none", children: "\xA0" }),
2558
+ props.children ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "text-sm text-fd-muted-foreground prose-no-margin", children: props.children }) : null
2559
+ ]
2560
+ })
2561
+ );
2562
+ }
2541
2563
  return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
2542
- E,
2543
- __spreadProps(__spreadValues({}, props), {
2564
+ "div",
2565
+ __spreadProps(__spreadValues({
2544
2566
  "data-card": true,
2545
2567
  className: cn(
2546
2568
  "block rounded-lg border bg-fd-card p-4 text-fd-card-foreground shadow-md transition-colors @max-lg:col-span-full",
2547
- props.href && "hover:bg-fd-accent/80",
2548
2569
  props.className
2549
- ),
2570
+ )
2571
+ }, props), {
2550
2572
  children: [
2551
2573
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("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__ */ (0, import_jsx_runtime34.jsx)(globalLucideIcons.CircleSmall, {}) }),
2552
2574
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("h3", { className: "not-prose mb-1 text-sm font-medium line-clamp-2 min-h-[2.5rem]", children: title }),
2553
- description ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "!my-0 text-sm text-fd-muted-foreground", children: description }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "!my-0 text-sm text-fd-muted-foreground opacity-0 select-none", children: "\xA0" }),
2575
+ validDescription ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "!my-0 text-sm text-fd-muted-foreground", children: description }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "!my-0 text-sm text-fd-muted-foreground opacity-0 select-none", children: "\xA0" }),
2554
2576
  props.children ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "text-sm text-fd-muted-foreground prose-no-margin", children: props.children }) : null
2555
2577
  ]
2556
2578
  })