@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.
@@ -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 };
@@ -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 };