@syscore/ui-library 2.0.0-beta-publish-workflow-beta.8 → 2.0.0-beta-publish-workflow-beta.9
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.
- package/client/components/ui/hero-split-image.tsx +38 -5
- package/client/global.css +48 -3
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +36 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -17743,7 +17743,42 @@ function ResourceThumbnail({
|
|
|
17743
17743
|
);
|
|
17744
17744
|
}
|
|
17745
17745
|
const HeroSplitImage = React.forwardRef(
|
|
17746
|
-
({ src, alt = "" }, ref) =>
|
|
17746
|
+
({ src, alt = "" }, ref) => {
|
|
17747
|
+
const [current, setCurrent] = React.useState(src);
|
|
17748
|
+
const [previous, setPrevious] = React.useState(null);
|
|
17749
|
+
const [isCurrentLoaded, setIsCurrentLoaded] = React.useState(false);
|
|
17750
|
+
React.useEffect(() => {
|
|
17751
|
+
if (src === current) return;
|
|
17752
|
+
setPrevious(current);
|
|
17753
|
+
setCurrent(src);
|
|
17754
|
+
setIsCurrentLoaded(false);
|
|
17755
|
+
}, [src, current]);
|
|
17756
|
+
return /* @__PURE__ */ jsxs("span", { className: "hero-split-image-frame", children: [
|
|
17757
|
+
previous ? /* @__PURE__ */ jsx(
|
|
17758
|
+
"img",
|
|
17759
|
+
{
|
|
17760
|
+
src: previous,
|
|
17761
|
+
alt: "",
|
|
17762
|
+
"aria-hidden": "true",
|
|
17763
|
+
className: cn("hero-split-image", !isCurrentLoaded && "hero-split-image--loaded"),
|
|
17764
|
+
onTransitionEnd: (event) => {
|
|
17765
|
+
if (event.propertyName === "opacity" && isCurrentLoaded) setPrevious(null);
|
|
17766
|
+
}
|
|
17767
|
+
}
|
|
17768
|
+
) : null,
|
|
17769
|
+
/* @__PURE__ */ jsx(
|
|
17770
|
+
"img",
|
|
17771
|
+
{
|
|
17772
|
+
ref,
|
|
17773
|
+
src: current,
|
|
17774
|
+
alt,
|
|
17775
|
+
className: cn("hero-split-image", isCurrentLoaded && "hero-split-image--loaded"),
|
|
17776
|
+
onLoad: () => setIsCurrentLoaded(true)
|
|
17777
|
+
},
|
|
17778
|
+
current
|
|
17779
|
+
)
|
|
17780
|
+
] });
|
|
17781
|
+
}
|
|
17747
17782
|
);
|
|
17748
17783
|
HeroSplitImage.displayName = "HeroSplitImage";
|
|
17749
17784
|
const PriceTag = React.forwardRef(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syscore/ui-library",
|
|
3
|
-
"version": "2.0.0-beta-publish-workflow-beta.
|
|
3
|
+
"version": "2.0.0-beta-publish-workflow-beta.9",
|
|
4
4
|
"description": "A comprehensive React component library built with Radix UI, Tailwind CSS, and TypeScript",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|