@trustware/sdk-staging 1.0.16-staging.13 → 1.0.17-staging.15
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/dist/constants.cjs +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/core-DRDMS5t3.d.ts +435 -0
- package/dist/core-DXxIIFgy.d.cts +435 -0
- package/dist/core.cjs +3107 -0
- package/dist/core.cjs.map +1 -0
- package/dist/core.d.cts +3 -0
- package/dist/core.d.ts +3 -0
- package/dist/core.mjs +3087 -0
- package/dist/core.mjs.map +1 -0
- package/dist/detect-BI5qLt5s.d.cts +34 -0
- package/dist/detect-GUvqS-mr.d.ts +34 -0
- package/dist/index.cjs +7570 -5867
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -682
- package/dist/index.d.ts +9 -682
- package/dist/index.mjs +7427 -5749
- package/dist/index.mjs.map +1 -1
- package/dist/manager-CgpuAzqn.d.cts +306 -0
- package/dist/manager-CgpuAzqn.d.ts +306 -0
- package/dist/types-BrVfNxND.d.cts +14 -0
- package/dist/types-BrVfNxND.d.ts +14 -0
- package/dist/wallet.cjs +2161 -0
- package/dist/wallet.cjs.map +1 -0
- package/dist/wallet.d.cts +37 -0
- package/dist/wallet.d.ts +37 -0
- package/dist/wallet.mjs +2117 -0
- package/dist/wallet.mjs.map +1 -0
- package/dist/widget.cjs +13388 -0
- package/dist/widget.cjs.map +1 -0
- package/dist/widget.d.cts +66 -0
- package/dist/widget.d.ts +66 -0
- package/dist/widget.mjs +13377 -0
- package/dist/widget.mjs.map +1 -0
- package/package.json +3 -1
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { N as NavigationStep } from './types-BrVfNxND.cjs';
|
|
3
|
+
|
|
4
|
+
type Theme = "light" | "dark" | "system";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Ref methods exposed by TrustwareWidgetV2
|
|
8
|
+
*/
|
|
9
|
+
interface TrustwareWidgetV2Ref {
|
|
10
|
+
/** Open the widget */
|
|
11
|
+
open: () => void;
|
|
12
|
+
/** Close the widget (shows confirmation if transaction active) */
|
|
13
|
+
close: () => void;
|
|
14
|
+
/** Check if widget is currently open */
|
|
15
|
+
isOpen: () => boolean;
|
|
16
|
+
}
|
|
17
|
+
interface TrustwareWidgetV2Props {
|
|
18
|
+
/** Widget theme - light, dark, or system preference (used as initial theme) */
|
|
19
|
+
theme?: Theme;
|
|
20
|
+
/** Additional inline styles */
|
|
21
|
+
style?: React.CSSProperties;
|
|
22
|
+
/** Initial navigation step (defaults to 'home') */
|
|
23
|
+
initialStep?: NavigationStep;
|
|
24
|
+
/** Whether the widget is initially open (defaults to true for inline usage) */
|
|
25
|
+
defaultOpen?: boolean;
|
|
26
|
+
/** Callback when the widget is closed */
|
|
27
|
+
onClose?: () => void;
|
|
28
|
+
/** Callback when the widget is opened */
|
|
29
|
+
onOpen?: () => void;
|
|
30
|
+
/** Whether to show the theme toggle button (defaults to true) */
|
|
31
|
+
showThemeToggle?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* TrustwareWidgetV2 - Main widget component for deposit flow.
|
|
35
|
+
*
|
|
36
|
+
* Provides a complete deposit experience with:
|
|
37
|
+
* - Page navigation based on state machine
|
|
38
|
+
* - Animated transitions between pages
|
|
39
|
+
* - Theme support (light/dark/system)
|
|
40
|
+
* - Context-based state management
|
|
41
|
+
* - Programmatic open/close API via ref
|
|
42
|
+
* - State persistence in sessionStorage
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* // Basic inline usage
|
|
47
|
+
* <TrustwareWidgetV2 theme="dark" />
|
|
48
|
+
*
|
|
49
|
+
* // With ref for programmatic control
|
|
50
|
+
* const widgetRef = useRef<TrustwareWidgetV2Ref>(null);
|
|
51
|
+
*
|
|
52
|
+
* <TrustwareWidgetV2
|
|
53
|
+
* ref={widgetRef}
|
|
54
|
+
* defaultOpen={false}
|
|
55
|
+
* onClose={() => console.log('Widget closed')}
|
|
56
|
+
* onOpen={() => console.log('Widget opened')}
|
|
57
|
+
* />
|
|
58
|
+
*
|
|
59
|
+
* // Open/close programmatically
|
|
60
|
+
* widgetRef.current?.open();
|
|
61
|
+
* widgetRef.current?.close();
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
declare const TrustwareWidgetV2: React.ForwardRefExoticComponent<TrustwareWidgetV2Props & React.RefAttributes<TrustwareWidgetV2Ref>>;
|
|
65
|
+
|
|
66
|
+
export { TrustwareWidgetV2 as TrustwareWidget, type TrustwareWidgetV2Props as TrustwareWidgetProps, type TrustwareWidgetV2Ref as TrustwareWidgetRef, TrustwareWidgetV2, type TrustwareWidgetV2Props, type TrustwareWidgetV2Ref };
|
package/dist/widget.d.ts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { N as NavigationStep } from './types-BrVfNxND.js';
|
|
3
|
+
|
|
4
|
+
type Theme = "light" | "dark" | "system";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Ref methods exposed by TrustwareWidgetV2
|
|
8
|
+
*/
|
|
9
|
+
interface TrustwareWidgetV2Ref {
|
|
10
|
+
/** Open the widget */
|
|
11
|
+
open: () => void;
|
|
12
|
+
/** Close the widget (shows confirmation if transaction active) */
|
|
13
|
+
close: () => void;
|
|
14
|
+
/** Check if widget is currently open */
|
|
15
|
+
isOpen: () => boolean;
|
|
16
|
+
}
|
|
17
|
+
interface TrustwareWidgetV2Props {
|
|
18
|
+
/** Widget theme - light, dark, or system preference (used as initial theme) */
|
|
19
|
+
theme?: Theme;
|
|
20
|
+
/** Additional inline styles */
|
|
21
|
+
style?: React.CSSProperties;
|
|
22
|
+
/** Initial navigation step (defaults to 'home') */
|
|
23
|
+
initialStep?: NavigationStep;
|
|
24
|
+
/** Whether the widget is initially open (defaults to true for inline usage) */
|
|
25
|
+
defaultOpen?: boolean;
|
|
26
|
+
/** Callback when the widget is closed */
|
|
27
|
+
onClose?: () => void;
|
|
28
|
+
/** Callback when the widget is opened */
|
|
29
|
+
onOpen?: () => void;
|
|
30
|
+
/** Whether to show the theme toggle button (defaults to true) */
|
|
31
|
+
showThemeToggle?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* TrustwareWidgetV2 - Main widget component for deposit flow.
|
|
35
|
+
*
|
|
36
|
+
* Provides a complete deposit experience with:
|
|
37
|
+
* - Page navigation based on state machine
|
|
38
|
+
* - Animated transitions between pages
|
|
39
|
+
* - Theme support (light/dark/system)
|
|
40
|
+
* - Context-based state management
|
|
41
|
+
* - Programmatic open/close API via ref
|
|
42
|
+
* - State persistence in sessionStorage
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* // Basic inline usage
|
|
47
|
+
* <TrustwareWidgetV2 theme="dark" />
|
|
48
|
+
*
|
|
49
|
+
* // With ref for programmatic control
|
|
50
|
+
* const widgetRef = useRef<TrustwareWidgetV2Ref>(null);
|
|
51
|
+
*
|
|
52
|
+
* <TrustwareWidgetV2
|
|
53
|
+
* ref={widgetRef}
|
|
54
|
+
* defaultOpen={false}
|
|
55
|
+
* onClose={() => console.log('Widget closed')}
|
|
56
|
+
* onOpen={() => console.log('Widget opened')}
|
|
57
|
+
* />
|
|
58
|
+
*
|
|
59
|
+
* // Open/close programmatically
|
|
60
|
+
* widgetRef.current?.open();
|
|
61
|
+
* widgetRef.current?.close();
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
declare const TrustwareWidgetV2: React.ForwardRefExoticComponent<TrustwareWidgetV2Props & React.RefAttributes<TrustwareWidgetV2Ref>>;
|
|
65
|
+
|
|
66
|
+
export { TrustwareWidgetV2 as TrustwareWidget, type TrustwareWidgetV2Props as TrustwareWidgetProps, type TrustwareWidgetV2Ref as TrustwareWidgetRef, TrustwareWidgetV2, type TrustwareWidgetV2Props, type TrustwareWidgetV2Ref };
|