fare-privy-core 1.8.2 → 1.8.3

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/README.md CHANGED
@@ -161,7 +161,29 @@ A ready-to-use modal for funding your wallet, with animated carousel and exchang
161
161
  - Uses `useWalletBalance` for live balances
162
162
  - Minimal required props, npm-friendly defaults
163
163
 
164
- **Usage:**
164
+ **Props:**
165
+ | Prop | Type | Description |
166
+ |-----------|--------------|-----------------------------------|
167
+ | `isOpen` | `boolean` | Controls modal visibility |
168
+ | `onClose` | `() => void` | Function to close the modal |
169
+
170
+ **Usage Example:**
171
+ ```tsx
172
+ import React, { useState } from "react";
173
+ import { FundWalletModal } from "fare-privy-core";
174
+
175
+ export function FundWalletModalDemo() {
176
+ const [isOpen, setIsOpen] = useState(false);
177
+ return (
178
+ <>
179
+ <button onClick={() => setIsOpen(true)}>Open Fund Wallet Modal</button>
180
+ <FundWalletModal isOpen={isOpen} onClose={() => setIsOpen(false)} />
181
+ </>
182
+ );
183
+ }
184
+ ```
185
+
186
+ You must manage the open/close state in your app. The modal will call `onClose` when the user closes it.
165
187
  ---
166
188
 
167
189
  ## 🪝 Hooks Overview
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * fare-privy-core - v1.8.2 - Reliable Micro Hooks
2
+ * fare-privy-core - v1.8.3 - Reliable Micro Hooks
3
3
  * Proven wallet patterns with simplified balance fetching and focused micro-hooks architecture.
4
4
  */
5
5
  export { PrivyProvider, type PrivyProviderProps } from "./PrivyProviderTest";
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * fare-privy-core - v1.8.2 - Reliable Micro Hooks
2
+ * fare-privy-core - v1.8.3 - Reliable Micro Hooks
3
3
  * Proven wallet patterns with simplified balance fetching and focused micro-hooks architecture.
4
4
  */
5
5
  // ✅ CURRENT EXPORTS - Available Now
@@ -1,2 +1,6 @@
1
- export declare const FundWalletModal: () => import("react/jsx-runtime").JSX.Element;
1
+ export interface FundWalletModalProps {
2
+ isOpen: boolean;
3
+ onClose: () => void;
4
+ }
5
+ export declare const FundWalletModal: React.FC<FundWalletModalProps>;
2
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modals/FundWalletModal/index.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,eAAe,+CAgD3B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modals/FundWalletModal/index.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA+C1D,CAAC"}
@@ -1,21 +1,17 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useMemo, useRef } from "react";
2
+ import { useMemo, useRef, useState } from "react";
3
3
  import { useActiveWallet } from "../../hooks/useActiveWallet";
4
4
  import { CardCarousel } from "./CardCarousel";
5
- import { useSnapshot } from "valtio";
6
5
  import ModalCard from "../../components/shared/Modal/Card";
7
6
  import { AnimatePresence } from "framer-motion";
8
- import { fundWalletModalState } from "./FundWalletModalState";
9
- export const FundWalletModal = () => {
7
+ export const FundWalletModal = ({ isOpen, onClose, }) => {
10
8
  const modalRef = useRef(null);
11
9
  const { activeWallet } = useActiveWallet();
12
- const { isFundModalShowing, stepIdx } = useSnapshot(fundWalletModalState);
10
+ const [stepIdx, setStepIdx] = useState(0);
13
11
  const setIsVisible = (isVisible) => {
14
- fundWalletModalState.stepIdx = 0;
15
- fundWalletModalState.isFundModalShowing = isVisible;
16
- };
17
- const setStepIdx = (idx) => {
18
- fundWalletModalState.stepIdx = idx;
12
+ setStepIdx(0);
13
+ if (!isVisible)
14
+ onClose();
19
15
  };
20
16
  const maxHeight = useMemo(() => {
21
17
  if (stepIdx === 2)
@@ -25,6 +21,6 @@ export const FundWalletModal = () => {
25
21
  if (!activeWallet) {
26
22
  return null;
27
23
  }
28
- return (_jsx(AnimatePresence, { children: isFundModalShowing && (_jsx(ModalCard, { maxHeight: maxHeight, stepIdx: stepIdx, setStepIdx: setStepIdx, isVisible: isFundModalShowing, setIsVisible: setIsVisible, ref: modalRef, title: "Deposit Funds", description: _jsxs(_Fragment, { children: ["There are 2 fast and easy ways to deposit funds.", _jsx("br", {}), "No KYC. You'll be ready to play in just a few minutes!"] }), className: "fund-modal-content", children: _jsx(CardCarousel, { stepIndex: stepIdx }) })) }));
24
+ return (_jsx(AnimatePresence, { children: isOpen && (_jsx(ModalCard, { maxHeight: maxHeight, stepIdx: stepIdx, setStepIdx: setStepIdx, isVisible: isOpen, setIsVisible: setIsVisible, ref: modalRef, title: "Deposit Funds", description: _jsxs(_Fragment, { children: ["There are 2 fast and easy ways to deposit funds.", _jsx("br", {}), "No KYC. You'll be ready to play in just a few minutes!"] }), className: "fund-modal-content", children: _jsx(CardCarousel, { stepIndex: stepIdx }) })) }));
29
25
  };
30
26
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modals/FundWalletModal/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,SAAS,MAAM,oCAAoC,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,CAAC,MAAM,eAAe,GAAG,G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,SAAS,EAAE,OAAO,GAAI,GAC1B,CACb,GACe,CACnB,CAAC;AACJ,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fare-privy-core",
3
- "version": "1.8.2",
3
+ "version": "1.8.3",
4
4
  "description": "A comprehensive React library for Privy authentication and wallet management with casino gaming features, featuring reliable micro-hooks based on proven patterns",
5
5
  "keywords": [
6
6
  "privy",
@@ -1,5 +0,0 @@
1
- export declare const fundWalletModalState: {
2
- isFundModalShowing: boolean;
3
- stepIdx: number;
4
- };
5
- //# sourceMappingURL=FundWalletModalState.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FundWalletModalState.d.ts","sourceRoot":"","sources":["../../../../src/modals/FundWalletModal/FundWalletModalState.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB;;;CAG/B,CAAA"}
@@ -1,6 +0,0 @@
1
- import { proxy } from 'valtio';
2
- export const fundWalletModalState = proxy({
3
- isFundModalShowing: false,
4
- stepIdx: 0,
5
- });
6
- //# sourceMappingURL=FundWalletModalState.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FundWalletModalState.js","sourceRoot":"","sources":["../../../../src/modals/FundWalletModal/FundWalletModalState.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAE9B,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;IACxC,kBAAkB,EAAE,KAAK;IACzB,OAAO,EAAE,CAAC;CACX,CAAC,CAAA"}