@stokr/components-library 3.0.72-beta.4 → 3.0.72-beta.6

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.
@@ -61,6 +61,25 @@ const LottieAnimation = ({
61
61
  [animationSegment, animationLoop, speed]
62
62
  );
63
63
  useEffect(() => clearTimers, []);
64
+ useEffect(() => {
65
+ const redrawFrame = (d, frame) => {
66
+ d.setFrame(frame < 1 ? frame + 1 : frame - 1);
67
+ d.setFrame(frame);
68
+ };
69
+ const onVisible = () => {
70
+ const d = dotRef.current;
71
+ if (document.visibilityState !== "visible" || !d?.isLoaded) return;
72
+ if (!animationLoop) {
73
+ const endFrame = animationSegment?.[1] ?? d.totalFrames;
74
+ d.pause();
75
+ redrawFrame(d, endFrame);
76
+ return;
77
+ }
78
+ redrawFrame(d, d.currentFrame);
79
+ };
80
+ document.addEventListener("visibilitychange", onVisible);
81
+ return () => document.removeEventListener("visibilitychange", onVisible);
82
+ }, [animationLoop, animationSegment]);
64
83
  return /* @__PURE__ */ jsx(AnimationWrapper, { $size: size, style, className, children: /* @__PURE__ */ jsx(
65
84
  DotLottieReact,
66
85
  {
@@ -155,11 +155,15 @@ const PaymentDisplay = ({
155
155
  onAmountCopy,
156
156
  onAddressCopy,
157
157
  copyButtonStyle,
158
+ // Optional chip rendered at the top of the card (e.g. an expiry countdown
159
+ // pill) — a plain slot, the card has no opinion on what it contains.
160
+ chip,
158
161
  // Arbitrary extra content (e.g. a "show details" toggle + table, extra
159
162
  // buttons) — rendered last, inside the card.
160
163
  children
161
164
  }) => {
162
165
  return /* @__PURE__ */ jsx(ComponentWrapper, { noPadding: true, center: true, style: containerStyle, className, children: /* @__PURE__ */ jsxs(CodeWrapper, { style: codeWrapperStyle, maxWidth, className: codeWrapperClassName, children: [
166
+ chip,
163
167
  /* @__PURE__ */ jsxs(AmountBlock, { children: [
164
168
  /* @__PURE__ */ jsx(SectionTitle, { children: amountTitle }),
165
169
  /* @__PURE__ */ jsxs(AmountRow, { style: amountSectionStyle, children: [
@@ -60,6 +60,9 @@ const PaymentPendingCard = ({
60
60
  actionHref,
61
61
  onActionClick,
62
62
  footerNote,
63
+ // Optional chip rendered at the top of the card (e.g. an expiry countdown
64
+ // pill) — a plain slot, the card has no opinion on what it contains.
65
+ chip,
63
66
  maxWidth,
64
67
  containerStyle,
65
68
  codeWrapperStyle,
@@ -68,6 +71,7 @@ const PaymentPendingCard = ({
68
71
  children
69
72
  }) => {
70
73
  return /* @__PURE__ */ jsx(ComponentWrapper, { noPadding: true, center: true, style: containerStyle, className, children: /* @__PURE__ */ jsxs(CodeWrapper, { style: { gap: "40px", ...codeWrapperStyle }, maxWidth, className: codeWrapperClassName, children: [
74
+ chip,
71
75
  /* @__PURE__ */ jsx(Spinner, {}),
72
76
  (title || description) && /* @__PURE__ */ jsxs(TextBlock, { children: [
73
77
  title && /* @__PURE__ */ jsx(Title, { children: title }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stokr/components-library",
3
- "version": "3.0.72-beta.4",
3
+ "version": "3.0.72-beta.6",
4
4
  "description": "STOKR - Components Library",
5
5
  "author": "Bilal Hodzic <bilal@stokr.io>",
6
6
  "license": "MIT",