@windrun-huaiin/third-ui 6.2.0 → 6.2.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.
@@ -3103,6 +3103,7 @@ function TrophyCard({
3103
3103
  }
3104
3104
 
3105
3105
  // src/fuma/mdx/image-grid.tsx
3106
+ import { ImageZoom as ImageZoom2 } from "@third-ui/fuma/mdx/image-zoom";
3106
3107
  import { jsx as jsx36 } from "react/jsx-runtime";
3107
3108
  function ImageGrid({
3108
3109
  type = "url",
@@ -3121,7 +3122,7 @@ function ImageGrid({
3121
3122
  alignItems: "center"
3122
3123
  },
3123
3124
  children: images.map((img, idx) => /* @__PURE__ */ jsx36(
3124
- ImageZoom,
3125
+ ImageZoom2,
3125
3126
  {
3126
3127
  src: img.startsWith("http://") || img.startsWith("https://") ? img : type === "url" ? `${cdnBaseUrl == null ? void 0 : cdnBaseUrl.replace(/\/+$/, "")}/${img.replace(/^\/+/, "")}` : img,
3127
3128
  alt: `${altPrefix}-${idx + 1}`
@@ -3780,16 +3781,163 @@ function ZiaFolder(_a) {
3780
3781
  }
3781
3782
 
3782
3783
  // src/fuma/mdx/toc-footer-wrapper.tsx
3784
+ import { EditOnGitHub as EditOnGitHub2, LastUpdatedDate as LastUpdatedDate2 } from "@third-ui/fuma/mdx/toc-base";
3783
3785
  import { jsx as jsx44, jsxs as jsxs18 } from "react/jsx-runtime";
3784
3786
  function TocFooterWrapper({ lastModified, editPath, githubBaseUrl, copyButtonComponent }) {
3785
3787
  const showEdit = githubBaseUrl && editPath;
3786
3788
  return /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-y-2 items-start m-4", children: [
3787
- /* @__PURE__ */ jsx44(LastUpdatedDate, { date: lastModified }),
3789
+ /* @__PURE__ */ jsx44(LastUpdatedDate2, { date: lastModified }),
3788
3790
  copyButtonComponent,
3789
- showEdit && /* @__PURE__ */ jsx44(EditOnGitHub, { url: `${githubBaseUrl}${editPath}` })
3791
+ showEdit && /* @__PURE__ */ jsx44(EditOnGitHub2, { url: `${githubBaseUrl}${editPath}` })
3790
3792
  ] });
3791
3793
  }
3794
+
3795
+ // src/fuma/mdx/banner.tsx
3796
+ import { cva as cva2 } from "class-variance-authority";
3797
+ import { useEffect as useEffect3, useState as useState7 } from "react";
3798
+ import { Fragment as Fragment5, jsx as jsx45, jsxs as jsxs19 } from "react/jsx-runtime";
3799
+ var buttonVariants2 = cva2(
3800
+ "inline-flex items-center justify-center rounded-md p-2 text-sm font-medium transition-colors duration-100 disabled:pointer-events-none disabled:opacity-50",
3801
+ {
3802
+ variants: {
3803
+ color: {
3804
+ primary: "bg-primary text-primary-foreground hover:bg-primary/80",
3805
+ outline: "border hover:bg-accent hover:text-accent-foreground",
3806
+ ghost: "hover:bg-accent hover:text-accent-foreground",
3807
+ secondary: "border bg-secondary text-secondary-foreground hover:bg-accent hover:text-accent-foreground"
3808
+ },
3809
+ size: {
3810
+ sm: "gap-1 px-2 py-1.5 text-xs",
3811
+ icon: "p-1.5 [&_svg]:size-5",
3812
+ "icon-sm": "p-1.5 [&_svg]:size-4.5"
3813
+ }
3814
+ }
3815
+ }
3816
+ );
3817
+ var maskImage = "linear-gradient(to bottom,white,transparent), radial-gradient(circle at top center, white, transparent)";
3818
+ var rainbowLayer = /* @__PURE__ */ jsxs19(Fragment5, { children: [
3819
+ /* @__PURE__ */ jsx45(
3820
+ "div",
3821
+ {
3822
+ className: "absolute inset-0 z-[-1]",
3823
+ style: {
3824
+ maskImage,
3825
+ maskComposite: "intersect",
3826
+ animation: "fd-moving-banner 16s linear infinite",
3827
+ "--start": "rgba(0,87,255,0.5)",
3828
+ "--mid": "rgba(255,0,166,0.77)",
3829
+ "--end": "rgba(255,77,0,0.4)",
3830
+ "--via": "rgba(164,255,68,0.4)",
3831
+ animationDirection: "reverse",
3832
+ backgroundImage: "repeating-linear-gradient(60deg, var(--end), var(--start) 2%, var(--start) 5%, transparent 8%, transparent 14%, var(--via) 18%, var(--via) 22%, var(--mid) 28%, var(--mid) 30%, var(--via) 34%, var(--via) 36%, transparent, var(--end) calc(50% - 12px))",
3833
+ backgroundSize: "200% 100%",
3834
+ mixBlendMode: "difference"
3835
+ }
3836
+ }
3837
+ ),
3838
+ /* @__PURE__ */ jsx45(
3839
+ "div",
3840
+ {
3841
+ className: "absolute inset-0 z-[-1]",
3842
+ style: {
3843
+ maskImage,
3844
+ maskComposite: "intersect",
3845
+ animation: "fd-moving-banner 20s linear infinite",
3846
+ "--start": "rgba(255,120,120,0.5)",
3847
+ "--mid": "rgba(36,188,255,0.4)",
3848
+ "--end": "rgba(64,0,255,0.51)",
3849
+ "--via": "rgba(255,89,0,0.56)",
3850
+ backgroundImage: "repeating-linear-gradient(45deg, var(--end), var(--start) 4%, var(--start) 8%, transparent 9%, transparent 14%, var(--mid) 16%, var(--mid) 20%, transparent, var(--via) 36%, var(--via) 40%, transparent 42%, var(--end) 46%, var(--end) calc(50% - 16.8px))",
3851
+ backgroundSize: "200% 100%",
3852
+ mixBlendMode: "color-dodge"
3853
+ }
3854
+ }
3855
+ ),
3856
+ /* @__PURE__ */ jsx45("style", { children: `@keyframes fd-moving-banner {
3857
+ from { background-position: 0% 0; }
3858
+ to { background-position: 100% 0; }
3859
+ }` })
3860
+ ] });
3861
+ function Banner(_a) {
3862
+ var _b = _a, {
3863
+ id,
3864
+ variant = "rainbow",
3865
+ changeLayout = true,
3866
+ height = 3
3867
+ } = _b, props = __objRest(_b, [
3868
+ "id",
3869
+ "variant",
3870
+ "changeLayout",
3871
+ "height"
3872
+ ]);
3873
+ const [open, setOpen] = useState7(true);
3874
+ const globalKey = id ? `nd-banner-${id}` : null;
3875
+ const bannerHeight = `${height}rem`;
3876
+ useEffect3(() => {
3877
+ if (globalKey) setOpen(localStorage.getItem(globalKey) !== "true");
3878
+ }, [globalKey]);
3879
+ if (!open) return null;
3880
+ return /* @__PURE__ */ jsxs19(
3881
+ "div",
3882
+ __spreadProps(__spreadValues({
3883
+ id
3884
+ }, props), {
3885
+ className: cn(
3886
+ "flex flex-row items-center justify-center px-4 text-center text-sm font-medium",
3887
+ "bg-neutral-100 dark:bg-neutral-900",
3888
+ !open && "hidden",
3889
+ props.className
3890
+ ),
3891
+ style: {
3892
+ // 将 fuma.css 中的 .sticky.top-0.z-40 样式完全移到这里
3893
+ position: "fixed",
3894
+ top: 0,
3895
+ left: 0,
3896
+ width: "100vw",
3897
+ zIndex: 1001,
3898
+ height: bannerHeight,
3899
+ minHeight: bannerHeight,
3900
+ maxHeight: bannerHeight,
3901
+ margin: 0,
3902
+ borderRadius: 0
3903
+ },
3904
+ children: [
3905
+ globalKey ? /* @__PURE__ */ jsx45("style", { children: `.${globalKey} #${id} { display: none; }` }) : null,
3906
+ globalKey ? /* @__PURE__ */ jsx45(
3907
+ "script",
3908
+ {
3909
+ dangerouslySetInnerHTML: {
3910
+ __html: `if (localStorage.getItem('${globalKey}') === 'true') document.documentElement.classList.add('${globalKey}');`
3911
+ }
3912
+ }
3913
+ ) : null,
3914
+ variant === "rainbow" ? rainbowLayer : null,
3915
+ props.children,
3916
+ id ? /* @__PURE__ */ jsx45(
3917
+ "button",
3918
+ {
3919
+ type: "button",
3920
+ "aria-label": "Close Banner",
3921
+ onClick: () => {
3922
+ setOpen(false);
3923
+ if (globalKey) localStorage.setItem(globalKey, "true");
3924
+ },
3925
+ className: cn(
3926
+ buttonVariants2({
3927
+ color: "ghost",
3928
+ className: "absolute end-2 top-1/2 -translate-y-1/2 text-neutral-600 dark:text-neutral-400",
3929
+ size: "icon"
3930
+ })
3931
+ ),
3932
+ children: /* @__PURE__ */ jsx45(globalLucideIcons.X, {})
3933
+ }
3934
+ ) : null
3935
+ ]
3936
+ })
3937
+ );
3938
+ }
3792
3939
  export {
3940
+ Banner,
3793
3941
  EditOnGitHub,
3794
3942
  FumaGithubInfo,
3795
3943
  GradientButton,