@passkeyme/react-auth 1.0.0
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/CHANGELOG.md +86 -0
- package/LICENSE +21 -0
- package/README.md +951 -0
- package/dist/components/DevToolsDashboard.d.ts +18 -0
- package/dist/components/DevToolsDashboard.d.ts.map +1 -0
- package/dist/components/LazyComponents.d.ts +22 -0
- package/dist/components/LazyComponents.d.ts.map +1 -0
- package/dist/components/NotificationProvider.d.ts +31 -0
- package/dist/components/NotificationProvider.d.ts.map +1 -0
- package/dist/components/PasskeymeAuthPanel.d.ts +121 -0
- package/dist/components/PasskeymeAuthPanel.d.ts.map +1 -0
- package/dist/components/PasskeymeButton.d.ts +64 -0
- package/dist/components/PasskeymeButton.d.ts.map +1 -0
- package/dist/components/PasskeymeCallbackHandler.d.ts +50 -0
- package/dist/components/PasskeymeCallbackHandler.d.ts.map +1 -0
- package/dist/components/PasskeymeErrorDisplay.d.ts +28 -0
- package/dist/components/PasskeymeErrorDisplay.d.ts.map +1 -0
- package/dist/components/PasskeymeLoadingIndicator.d.ts +34 -0
- package/dist/components/PasskeymeLoadingIndicator.d.ts.map +1 -0
- package/dist/components/PasskeymeOAuthButton.d.ts +8 -0
- package/dist/components/PasskeymeOAuthButton.d.ts.map +1 -0
- package/dist/components/PasskeymeProtectedRoute.d.ts +16 -0
- package/dist/components/PasskeymeProtectedRoute.d.ts.map +1 -0
- package/dist/components/PasskeymeProvider.d.ts +24 -0
- package/dist/components/PasskeymeProvider.d.ts.map +1 -0
- package/dist/components/PasskeymeUserProfile.d.ts +31 -0
- package/dist/components/PasskeymeUserProfile.d.ts.map +1 -0
- package/dist/components/PerformanceDashboard.d.ts +30 -0
- package/dist/components/PerformanceDashboard.d.ts.map +1 -0
- package/dist/components/VirtualScrollList.d.ts +105 -0
- package/dist/components/VirtualScrollList.d.ts.map +1 -0
- package/dist/hooks/useAuthUtils.d.ts +26 -0
- package/dist/hooks/useAuthUtils.d.ts.map +1 -0
- package/dist/hooks/useLoadingState.d.ts +31 -0
- package/dist/hooks/useLoadingState.d.ts.map +1 -0
- package/dist/hooks/usePerformanceMonitor.d.ts +41 -0
- package/dist/hooks/usePerformanceMonitor.d.ts.map +1 -0
- package/dist/hooks/useUsernameManager.d.ts +62 -0
- package/dist/hooks/useUsernameManager.d.ts.map +1 -0
- package/dist/index.d.ts +85 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +8734 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +8827 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +249 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/analytics.d.ts +112 -0
- package/dist/utils/analytics.d.ts.map +1 -0
- package/dist/utils/debug.d.ts +9 -0
- package/dist/utils/debug.d.ts.map +1 -0
- package/dist/utils/devUtils.d.ts +53 -0
- package/dist/utils/devUtils.d.ts.map +1 -0
- package/dist/utils/enhancedButtonStyles.d.ts +70 -0
- package/dist/utils/enhancedButtonStyles.d.ts.map +1 -0
- package/dist/utils/importOptimizer.d.ts +79 -0
- package/dist/utils/importOptimizer.d.ts.map +1 -0
- package/dist/utils/loadingStates.d.ts +35 -0
- package/dist/utils/loadingStates.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +41 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/performanceProfiler.d.ts +80 -0
- package/dist/utils/performanceProfiler.d.ts.map +1 -0
- package/dist/utils/reactCompat.d.ts +6 -0
- package/dist/utils/reactCompat.d.ts.map +1 -0
- package/dist/utils/storageOptimization.d.ts +173 -0
- package/dist/utils/storageOptimization.d.ts.map +1 -0
- package/dist/utils/testingUtils.d.ts +163 -0
- package/dist/utils/testingUtils.d.ts.map +1 -0
- package/package.json +93 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Developer Tools Dashboard for PasskeyMe React SDK
|
|
3
|
+
* Provides real-time debugging and development utilities
|
|
4
|
+
*/
|
|
5
|
+
export interface DevToolsDashboardProps {
|
|
6
|
+
/** Whether to show the dashboard (default: only in development) */
|
|
7
|
+
show?: boolean;
|
|
8
|
+
/** Position of the dashboard */
|
|
9
|
+
position?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
10
|
+
/** Whether the dashboard is collapsed by default */
|
|
11
|
+
collapsed?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const DevToolsDashboard: ({ show, position, collapsed: initialCollapsed, }: {
|
|
14
|
+
show?: boolean | undefined;
|
|
15
|
+
position?: string | undefined;
|
|
16
|
+
collapsed?: boolean | undefined;
|
|
17
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
18
|
+
//# sourceMappingURL=DevToolsDashboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DevToolsDashboard.d.ts","sourceRoot":"","sources":["../../src/components/DevToolsDashboard.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,MAAM,WAAW,sBAAsB;IACrC,mEAAmE;IACnE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,gCAAgC;IAChC,QAAQ,CAAC,EAAE,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;IACrE,oDAAoD;IACpD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAUD,eAAO,MAAM,iBAAiB;;;;oDA8T7B,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lazy-loaded components for better performance
|
|
3
|
+
* Components are loaded only when needed
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import type { PasskeymeErrorDisplayProps } from "./PasskeymeErrorDisplay";
|
|
7
|
+
import type { PasskeymeLoadingIndicatorProps } from "./PasskeymeLoadingIndicator";
|
|
8
|
+
/**
|
|
9
|
+
* Lazy-loaded Error Display with Suspense boundary
|
|
10
|
+
*/
|
|
11
|
+
export declare const PasskeymeErrorDisplayLazy: (props: PasskeymeErrorDisplayProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
/**
|
|
13
|
+
* Lazy-loaded Loading Indicator with Suspense boundary
|
|
14
|
+
*/
|
|
15
|
+
export declare const PasskeymeLoadingIndicatorLazy: (props: PasskeymeLoadingIndicatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
/**
|
|
17
|
+
* Generic lazy component wrapper
|
|
18
|
+
*/
|
|
19
|
+
export declare const createLazyComponent: <T extends Record<string, any>>(importFn: () => Promise<{
|
|
20
|
+
default: React.ComponentType<T>;
|
|
21
|
+
}>, fallback?: React.ReactNode) => React.MemoExoticComponent<(props: T) => import("react/jsx-runtime").JSX.Element>;
|
|
22
|
+
//# sourceMappingURL=LazyComponents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LazyComponents.d.ts","sourceRoot":"","sources":["../../src/components/LazyComponents.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAyB,MAAM,OAAO,CAAC;AAC9C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAclF;;GAEG;AACH,eAAO,MAAM,yBAAyB,UAC7B,0BAA0B,4CAWlC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,6BAA6B,UACjC,8BAA8B,4CAKtC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,4CACpB,MAAM,QAAQ;IAAE,OAAO,EAAE,MAAM,aAAa,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC,aACjD,MAAM,SAAS,uCAIA,CAAC,6CAK5B,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple notification system for PasskeyMe SDK
|
|
3
|
+
* Uses a React portal for clean rendering without external dependencies
|
|
4
|
+
*/
|
|
5
|
+
import { ReactNode } from "react";
|
|
6
|
+
interface Notification {
|
|
7
|
+
id: string;
|
|
8
|
+
type: "success" | "error" | "info" | "warning";
|
|
9
|
+
title: string;
|
|
10
|
+
message?: string;
|
|
11
|
+
duration?: number;
|
|
12
|
+
action?: {
|
|
13
|
+
label: string;
|
|
14
|
+
onClick: () => void;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
interface NotificationContextValue {
|
|
18
|
+
notifications: Notification[];
|
|
19
|
+
addNotification: (notification: Omit<Notification, "id">) => void;
|
|
20
|
+
removeNotification: (id: string) => void;
|
|
21
|
+
showSuccess: (title: string, message?: string) => void;
|
|
22
|
+
showError: (title: string, message?: string) => void;
|
|
23
|
+
showInfo: (title: string, message?: string) => void;
|
|
24
|
+
showWarning: (title: string, message?: string) => void;
|
|
25
|
+
}
|
|
26
|
+
export declare const useNotifications: () => NotificationContextValue;
|
|
27
|
+
export declare const NotificationProvider: ({ children, }: {
|
|
28
|
+
children?: ReactNode;
|
|
29
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=NotificationProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationProvider.d.ts","sourceRoot":"","sources":["../../src/components/NotificationProvider.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAKL,SAAS,EACV,MAAM,OAAO,CAAC;AAGf,UAAU,YAAY;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,IAAI,CAAC;KACrB,CAAC;CACH;AAED,UAAU,wBAAwB;IAChC,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,eAAe,EAAE,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC;IAClE,kBAAkB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACxD;AAMD,eAAO,MAAM,gBAAgB,QAAO,wBAQnC,CAAC;AA8KF,eAAO,MAAM,oBAAoB,kBAE9B;IACD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,4CA+CA,CAAC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface PasskeymeAuthPanelTheme {
|
|
3
|
+
container?: {
|
|
4
|
+
backgroundColor?: string;
|
|
5
|
+
borderRadius?: string;
|
|
6
|
+
border?: string;
|
|
7
|
+
boxShadow?: string;
|
|
8
|
+
padding?: string;
|
|
9
|
+
maxWidth?: string;
|
|
10
|
+
fontFamily?: string;
|
|
11
|
+
color?: string;
|
|
12
|
+
};
|
|
13
|
+
title?: {
|
|
14
|
+
fontSize?: string;
|
|
15
|
+
fontWeight?: string;
|
|
16
|
+
color?: string;
|
|
17
|
+
marginBottom?: string;
|
|
18
|
+
textAlign?: "left" | "center" | "right";
|
|
19
|
+
};
|
|
20
|
+
subtitle?: {
|
|
21
|
+
fontSize?: string;
|
|
22
|
+
color?: string;
|
|
23
|
+
marginBottom?: string;
|
|
24
|
+
textAlign?: "left" | "center" | "right";
|
|
25
|
+
};
|
|
26
|
+
passkeyButton?: {
|
|
27
|
+
backgroundColor?: string;
|
|
28
|
+
backgroundColorHover?: string;
|
|
29
|
+
backgroundColorDisabled?: string;
|
|
30
|
+
color?: string;
|
|
31
|
+
border?: string;
|
|
32
|
+
borderRadius?: string;
|
|
33
|
+
padding?: string;
|
|
34
|
+
fontSize?: string;
|
|
35
|
+
fontWeight?: string;
|
|
36
|
+
cursor?: string;
|
|
37
|
+
transition?: string;
|
|
38
|
+
width?: string;
|
|
39
|
+
minHeight?: string;
|
|
40
|
+
};
|
|
41
|
+
oauthSection?: {
|
|
42
|
+
gap?: string;
|
|
43
|
+
marginTop?: string;
|
|
44
|
+
};
|
|
45
|
+
dividerText?: {
|
|
46
|
+
color?: string;
|
|
47
|
+
fontSize?: string;
|
|
48
|
+
margin?: string;
|
|
49
|
+
textAlign?: "left" | "center" | "right";
|
|
50
|
+
fontWeight?: string;
|
|
51
|
+
};
|
|
52
|
+
successState?: {
|
|
53
|
+
backgroundColor?: string;
|
|
54
|
+
borderRadius?: string;
|
|
55
|
+
border?: string;
|
|
56
|
+
padding?: string;
|
|
57
|
+
textAlign?: "left" | "center" | "right";
|
|
58
|
+
};
|
|
59
|
+
loadingState?: {
|
|
60
|
+
color?: string;
|
|
61
|
+
fontSize?: string;
|
|
62
|
+
};
|
|
63
|
+
debugInfo?: {
|
|
64
|
+
backgroundColor?: string;
|
|
65
|
+
border?: string;
|
|
66
|
+
borderRadius?: string;
|
|
67
|
+
padding?: string;
|
|
68
|
+
fontSize?: string;
|
|
69
|
+
color?: string;
|
|
70
|
+
marginTop?: string;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
export interface PasskeymeAuthPanelProps {
|
|
74
|
+
providers?: ("google" | "github" | "facebook" | "apple" | "microsoft")[];
|
|
75
|
+
enablePasskeys?: boolean;
|
|
76
|
+
enableUsernamePassword?: boolean;
|
|
77
|
+
redirectUri?: string;
|
|
78
|
+
state?: string;
|
|
79
|
+
layout?: "vertical" | "horizontal" | "grid";
|
|
80
|
+
spacing?: "compact" | "normal" | "relaxed";
|
|
81
|
+
passkeyFirst?: boolean;
|
|
82
|
+
hideProvidersInitially?: boolean;
|
|
83
|
+
autoTriggerPasskey?: boolean;
|
|
84
|
+
title?: string;
|
|
85
|
+
subtitle?: string;
|
|
86
|
+
passkeyButtonText?: string;
|
|
87
|
+
passkeyLoadingText?: string;
|
|
88
|
+
dividerText?: string;
|
|
89
|
+
successTitle?: string;
|
|
90
|
+
successSubtitle?: string;
|
|
91
|
+
logoutButtonText?: string;
|
|
92
|
+
showTitle?: boolean;
|
|
93
|
+
showSubtitle?: boolean;
|
|
94
|
+
showDividerText?: boolean;
|
|
95
|
+
showSuccessState?: boolean;
|
|
96
|
+
showLogoutButton?: boolean;
|
|
97
|
+
showDebugInfo?: boolean;
|
|
98
|
+
theme?: PasskeymeAuthPanelTheme;
|
|
99
|
+
className?: string;
|
|
100
|
+
style?: React.CSSProperties;
|
|
101
|
+
onSuccess?: (user: any, method: string) => void;
|
|
102
|
+
onError?: (error: Error) => void;
|
|
103
|
+
onProviderSelect?: (provider: string) => void;
|
|
104
|
+
onPasskeyAttempt?: () => void;
|
|
105
|
+
onOAuthRequired?: (providers: string[]) => void;
|
|
106
|
+
onLogout?: () => void;
|
|
107
|
+
debugMode?: boolean;
|
|
108
|
+
passkeyOptions?: {
|
|
109
|
+
timeout?: number;
|
|
110
|
+
userVerification?: "required" | "preferred" | "discouraged";
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* PasskeyMe Authentication Panel Component
|
|
115
|
+
*
|
|
116
|
+
* A fully customizable authentication panel that handles passkey and OAuth authentication
|
|
117
|
+
* with extensive theming and configuration options.
|
|
118
|
+
*/
|
|
119
|
+
export declare const PasskeymeAuthPanel: ({ providers, enablePasskeys, enableUsernamePassword: _enableUsernamePassword, redirectUri, state: _state, layout, spacing, passkeyFirst, hideProvidersInitially, autoTriggerPasskey, title, subtitle, passkeyButtonText, passkeyLoadingText, dividerText, successTitle, successSubtitle, logoutButtonText, showTitle, showSubtitle, showDividerText, showSuccessState, showLogoutButton, showDebugInfo, theme, className, style, onSuccess, onError, onProviderSelect, onPasskeyAttempt, onOAuthRequired, onLogout, debugMode, passkeyOptions, }: PasskeymeAuthPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
120
|
+
export default PasskeymeAuthPanel;
|
|
121
|
+
//# sourceMappingURL=PasskeymeAuthPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PasskeymeAuthPanel.d.ts","sourceRoot":"","sources":["../../src/components/PasskeymeAuthPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD,MAAM,WAAW,uBAAuB;IAEtC,SAAS,CAAC,EAAE;QACV,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IAGF,KAAK,CAAC,EAAE;QACN,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;KACzC,CAAC;IAEF,QAAQ,CAAC,EAAE;QACT,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,SAAS,CAAC,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OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;IAGxB,KAAK,CAAC,EAAE,uBAAuB,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAG5B,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAChD,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAGtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,gBAAgB,CAAC,EAAE,UAAU,GAAG,WAAW,GAAG,aAAa,CAAC;KAC7D,CAAC;CACH;AAqED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,qhBAiD5B,uBAAuB,4CA2SzB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PasskeyMe Button Component with native passkey authentication
|
|
3
|
+
* Performance optimized with React.memo and useCallback
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import type { User } from "@passkeyme/auth";
|
|
7
|
+
import { PasskeymeError } from "@passkeyme/auth";
|
|
8
|
+
export interface PasskeymeButtonProps {
|
|
9
|
+
/** Username for passkey authentication (optional - will attempt discoverable credential first) */
|
|
10
|
+
username?: string;
|
|
11
|
+
/** API key for passkey operations (optional - will use from config) */
|
|
12
|
+
apiKey?: string;
|
|
13
|
+
/** Custom button text */
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
/** Custom CSS class */
|
|
16
|
+
className?: string;
|
|
17
|
+
/** Custom inline styles */
|
|
18
|
+
style?: React.CSSProperties;
|
|
19
|
+
/** Callback when authentication succeeds (optional - default shows success notification) */
|
|
20
|
+
onSuccess?: (user: User, method: "passkey" | "hosted") => void;
|
|
21
|
+
/** Callback when authentication fails (optional - default shows error notification) */
|
|
22
|
+
onError?: (error: string | PasskeymeError) => void;
|
|
23
|
+
/** Whether to show passkey icon */
|
|
24
|
+
showIcon?: boolean;
|
|
25
|
+
/** Whether button is disabled */
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/** Button size */
|
|
28
|
+
size?: "small" | "medium" | "large";
|
|
29
|
+
/** Button variant */
|
|
30
|
+
variant?: "primary" | "secondary" | "outline";
|
|
31
|
+
/** Whether to show default notifications (default: true) */
|
|
32
|
+
showNotifications?: boolean;
|
|
33
|
+
/** Whether to show enhanced loading indicator (default: false) */
|
|
34
|
+
showLoadingIndicator?: boolean;
|
|
35
|
+
/** Button theme */
|
|
36
|
+
theme?: "light" | "dark" | "auto";
|
|
37
|
+
/** Whether button should take full width */
|
|
38
|
+
fullWidth?: boolean;
|
|
39
|
+
/** Whether to show progress in loading indicator */
|
|
40
|
+
showProgress?: boolean;
|
|
41
|
+
/** Accessible label for the button (for screen readers) */
|
|
42
|
+
"aria-label"?: string;
|
|
43
|
+
/** ID of element that describes the button */
|
|
44
|
+
"aria-describedby"?: string;
|
|
45
|
+
/** ID of element that labels the button */
|
|
46
|
+
"aria-labelledby"?: string;
|
|
47
|
+
/** Additional ARIA attributes */
|
|
48
|
+
"aria-pressed"?: boolean;
|
|
49
|
+
/** HTML id attribute for the button */
|
|
50
|
+
id?: string;
|
|
51
|
+
/** Tab index for keyboard navigation */
|
|
52
|
+
tabIndex?: number;
|
|
53
|
+
/** Callback for keyboard events */
|
|
54
|
+
onKeyDown?: (event: React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
55
|
+
/** Callback for focus events */
|
|
56
|
+
onFocus?: (event: React.FocusEvent<HTMLButtonElement>) => void;
|
|
57
|
+
/** Callback for blur events */
|
|
58
|
+
onBlur?: (event: React.FocusEvent<HTMLButtonElement>) => void;
|
|
59
|
+
/** Autofocus the button on mount */
|
|
60
|
+
autoFocus?: boolean;
|
|
61
|
+
}
|
|
62
|
+
export declare const PasskeymeButton: React.MemoExoticComponent<({ username, apiKey, children, className, style, onSuccess, onError, showIcon, disabled, size, variant, showNotifications, showLoadingIndicator, theme, fullWidth, showProgress, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, "aria-labelledby": ariaLabelledBy, "aria-pressed": ariaPressed, id, tabIndex, onKeyDown, onFocus, onBlur, autoFocus, }: PasskeymeButtonProps) => import("react/jsx-runtime").JSX.Element>;
|
|
63
|
+
export default PasskeymeButton;
|
|
64
|
+
//# sourceMappingURL=PasskeymeButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PasskeymeButton.d.ts","sourceRoot":"","sources":["../../src/components/PasskeymeButton.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAyC,MAAM,OAAO,CAAC;AAa9D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAsB,MAAM,iBAAiB,CAAC;AAErE,MAAM,WAAW,oBAAoB;IACnC,kGAAkG;IAClG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,KAA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CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC/D,+BAA+B;IAC/B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC9D,oCAAoC;IACpC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAmfD,eAAO,MAAM,eAAe,mYA9ZzB,oBAAoB,6CA8Z4C,CAAC;AAEpE,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { PasskeymeCallbackHandlerProps } from "../types";
|
|
2
|
+
export interface CallbackState {
|
|
3
|
+
loading: boolean;
|
|
4
|
+
error: string | null;
|
|
5
|
+
success: boolean;
|
|
6
|
+
showPasskeyPrompt: boolean;
|
|
7
|
+
passkeyRegistering: boolean;
|
|
8
|
+
authenticatedUser: any | null;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Built-in OAuth callback handler component for PasskeyMe authentication.
|
|
12
|
+
*
|
|
13
|
+
* This component automatically handles the OAuth callback flow including:
|
|
14
|
+
* - Token extraction from URL parameters
|
|
15
|
+
* - Token validation and user info retrieval
|
|
16
|
+
* - Error handling and user feedback
|
|
17
|
+
* - Automatic redirection on success/failure
|
|
18
|
+
* - Optional passkey registration prompting
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* // Basic usage - handles everything automatically
|
|
23
|
+
* <Route path="/callback" element={<CallbackHandler />} />
|
|
24
|
+
*
|
|
25
|
+
* // With custom redirects
|
|
26
|
+
* <Route path="/callback" element={
|
|
27
|
+
* <CallbackHandler
|
|
28
|
+
* successRedirect="/dashboard"
|
|
29
|
+
* errorRedirect="/login?error=auth_failed"
|
|
30
|
+
* />
|
|
31
|
+
* } />
|
|
32
|
+
*
|
|
33
|
+
* // With passkey registration
|
|
34
|
+
* <Route path="/callback" element={
|
|
35
|
+
* <CallbackHandler
|
|
36
|
+
* passkey={{
|
|
37
|
+
* promptRegistration: true,
|
|
38
|
+
* apiKey: "your-passkeyme-api-key",
|
|
39
|
+
* onRegistrationComplete: (success, error) => {
|
|
40
|
+
* if (success) {
|
|
41
|
+
* toast.success('Passkey registered successfully!');
|
|
42
|
+
* }
|
|
43
|
+
* }
|
|
44
|
+
* }}
|
|
45
|
+
* />
|
|
46
|
+
* } />
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare const PasskeymeCallbackHandler: ({ loadingComponent: LoadingComponent, errorComponent: ErrorComponent, successRedirect, errorRedirect, onSuccess, onError, passkey, }: PasskeymeCallbackHandlerProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
50
|
+
//# sourceMappingURL=PasskeymeCallbackHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PasskeymeCallbackHandler.d.ts","sourceRoot":"","sources":["../../src/components/PasskeymeCallbackHandler.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AAuLzD,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iBAAiB,EAAE,GAAG,GAAG,IAAI,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,eAAO,MAAM,wBAAwB,yIAQlC,6BAA6B,mDAg2B/B,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error Display Component for PasskeyMe SDK
|
|
3
|
+
* Provides user-friendly error messages with actionable suggestions
|
|
4
|
+
* Performance optimized with React.memo and useCallback
|
|
5
|
+
*/
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { PasskeymeError } from "@passkeyme/auth";
|
|
8
|
+
export interface PasskeymeErrorDisplayProps {
|
|
9
|
+
/** The error to display */
|
|
10
|
+
error: PasskeymeError | Error | string | null;
|
|
11
|
+
/** Custom CSS class */
|
|
12
|
+
className?: string;
|
|
13
|
+
/** Custom inline styles */
|
|
14
|
+
style?: React.CSSProperties;
|
|
15
|
+
/** Whether to show technical details (for debugging) */
|
|
16
|
+
showTechnicalDetails?: boolean;
|
|
17
|
+
/** Callback for retry button (if error is retryable) */
|
|
18
|
+
onRetry?: () => void;
|
|
19
|
+
/** Callback for alternative action button */
|
|
20
|
+
onAlternativeAction?: () => void;
|
|
21
|
+
/** Custom retry button text */
|
|
22
|
+
retryButtonText?: string;
|
|
23
|
+
/** Custom alternative action button text */
|
|
24
|
+
alternativeActionText?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const PasskeymeErrorDisplay: React.MemoExoticComponent<({ error, className, style, showTechnicalDetails, onRetry, onAlternativeAction, retryButtonText, alternativeActionText, }: PasskeymeErrorDisplayProps) => import("react/jsx-runtime").JSX.Element | null>;
|
|
27
|
+
export default PasskeymeErrorDisplay;
|
|
28
|
+
//# sourceMappingURL=PasskeymeErrorDisplay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PasskeymeErrorDisplay.d.ts","sourceRoot":"","sources":["../../src/components/PasskeymeErrorDisplay.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,cAAc,EAAsB,MAAM,iBAAiB,CAAC;AAErE,MAAM,WAAW,0BAA0B;IACzC,2BAA2B;IAC3B,KAAK,EAAE,cAAc,GAAG,KAAK,GAAG,MAAM,GAAG,IAAI,CAAC;IAC9C,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,wDAAwD;IACxD,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,6CAA6C;IAC7C,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,+BAA+B;IAC/B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,4CAA4C;IAC5C,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAgFD,eAAO,MAAM,qBAAqB,uJAU7B,0BAA0B,oDAoK9B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enhanced Loading Indicator Component
|
|
3
|
+
* Provides rich visual feedback for authentication flows
|
|
4
|
+
* Performance optimized with React.memo and useCallback
|
|
5
|
+
*/
|
|
6
|
+
import React from "react";
|
|
7
|
+
import type { PasskeymeLoadingStateInfo } from "../utils/loadingStates";
|
|
8
|
+
export interface PasskeymeLoadingIndicatorProps {
|
|
9
|
+
/** Loading state information */
|
|
10
|
+
loadingState: PasskeymeLoadingStateInfo;
|
|
11
|
+
/** Custom CSS class */
|
|
12
|
+
className?: string;
|
|
13
|
+
/** Custom inline styles */
|
|
14
|
+
style?: React.CSSProperties;
|
|
15
|
+
/** Whether to show progress bar */
|
|
16
|
+
showProgress?: boolean;
|
|
17
|
+
/** Whether to show elapsed time */
|
|
18
|
+
showElapsedTime?: boolean;
|
|
19
|
+
/** Whether to show user action text */
|
|
20
|
+
showUserActionText?: boolean;
|
|
21
|
+
/** Size variant */
|
|
22
|
+
size?: "small" | "medium" | "large";
|
|
23
|
+
/** Theme variant */
|
|
24
|
+
theme?: "light" | "dark" | "auto";
|
|
25
|
+
/** Custom loading messages */
|
|
26
|
+
customMessages?: Partial<Record<string, string>>;
|
|
27
|
+
/** Callback when user action is required */
|
|
28
|
+
onUserActionRequired?: () => void;
|
|
29
|
+
/** Elapsed time in milliseconds */
|
|
30
|
+
elapsedTime?: number;
|
|
31
|
+
}
|
|
32
|
+
export declare const PasskeymeLoadingIndicator: React.MemoExoticComponent<({ loadingState, className, style, showProgress, showElapsedTime, showUserActionText, size, theme, customMessages, onUserActionRequired, elapsedTime, }: PasskeymeLoadingIndicatorProps) => import("react/jsx-runtime").JSX.Element | null>;
|
|
33
|
+
export default PasskeymeLoadingIndicator;
|
|
34
|
+
//# sourceMappingURL=PasskeymeLoadingIndicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PasskeymeLoadingIndicator.d.ts","sourceRoot":"","sources":["../../src/components/PasskeymeLoadingIndicator.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAuC,MAAM,OAAO,CAAC;AAC5D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAExE,MAAM,WAAW,8BAA8B;IAC7C,gCAAgC;IAChC,YAAY,EAAE,yBAAyB,CAAC;IACxC,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,mCAAmC;IACnC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mCAAmC;IACnC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uCAAuC;IACvC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,mBAAmB;IACnB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,oBAAoB;IACpB,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAClC,8BAA8B;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACjD,4CAA4C;IAC5C,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAC;IAClC,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AA2GD,eAAO,MAAM,yBAAyB,qLAajC,8BAA8B,oDA8JlC,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PasskeyMe OAuth Login Button Component with Enhanced Accessibility and Performance
|
|
3
|
+
*/
|
|
4
|
+
import React from "react";
|
|
5
|
+
import type { PasskeymeOAuthButtonProps } from "../types";
|
|
6
|
+
export declare const PasskeymeOAuthButton: React.MemoExoticComponent<({ provider, variant, size, redirectUri, children, className, style, disabled, onClick, loading: externalLoading, }: PasskeymeOAuthButtonProps) => import("react/jsx-runtime").JSX.Element>;
|
|
7
|
+
export default PasskeymeOAuthButton;
|
|
8
|
+
//# sourceMappingURL=PasskeymeOAuthButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PasskeymeOAuthButton.d.ts","sourceRoot":"","sources":["../../src/components/PasskeymeOAuthButton.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAyC,MAAM,OAAO,CAAC;AAE9D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAqJ1D,eAAO,MAAM,oBAAoB,iJA1G9B,yBAAyB,6CA0GiD,CAAC;AAE9E,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PasskeyMe Protected Route Component
|
|
3
|
+
* Performance optimized with React.memo and useMemo
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import type { PasskeymeProtectedRouteProps } from "../types";
|
|
7
|
+
export declare const PasskeymeProtectedRoute: React.MemoExoticComponent<({ children, fallback, redirectTo, requiredRoles, hasAccess }: PasskeymeProtectedRouteProps) => string | number | boolean | Iterable<React.ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined>;
|
|
8
|
+
/**
|
|
9
|
+
* Higher-order component for protecting components
|
|
10
|
+
*/
|
|
11
|
+
export declare const withAuth: <P extends object>(Component: React.ComponentType<P>, options?: Omit<PasskeymeProtectedRouteProps, "children">) => {
|
|
12
|
+
(props: P): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
export default PasskeymeProtectedRoute;
|
|
16
|
+
//# sourceMappingURL=PasskeymeProtectedRoute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PasskeymeProtectedRoute.d.ts","sourceRoot":"","sources":["../../src/components/PasskeymeProtectedRoute.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAG7D,eAAO,MAAM,uBAAuB,2FAEqB,4BAA4B,wHAsEnF,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,QAAQ,gCACR,MAAM,aAAa,CAAC,CAAC,CAAC,YACvB,KAAK,4BAA4B,EAAE,UAAU,CAAC;YAEvB,CAAC;;CAUnC,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enhanced PasskeymeProvider for React Web
|
|
3
|
+
* Automatically includes NotificationProvider and Web SDK injection for better DX
|
|
4
|
+
*/
|
|
5
|
+
import type { PasskeymeProviderProps } from "../types";
|
|
6
|
+
/**
|
|
7
|
+
* PasskeymeProvider for React Web applications
|
|
8
|
+
*
|
|
9
|
+
* This provider automatically includes:
|
|
10
|
+
* - NotificationProvider for UI notifications
|
|
11
|
+
* - Web SDK injection for passkey functionality
|
|
12
|
+
*
|
|
13
|
+
* You don't need to manually configure the passkey SDK for web environments.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* // Simple usage (recommended):
|
|
18
|
+
* <PasskeymeProvider config={config}>
|
|
19
|
+
* <App />
|
|
20
|
+
* </PasskeymeProvider>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare const PasskeymeProvider: ({ children, config, enableNotifications, ...coreProviderProps }: PasskeymeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
//# sourceMappingURL=PasskeymeProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PasskeymeProvider.d.ts","sourceRoot":"","sources":["../../src/components/PasskeymeProvider.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAGvD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iBAAiB,oEAK3B,sBAAsB,4CA6BxB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PasskeyMe User Profile Component
|
|
3
|
+
* Displays user information with customizable styling
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import type { User } from "@passkeyme/auth";
|
|
7
|
+
export interface PasskeymeUserProfileProps {
|
|
8
|
+
/** User object to display */
|
|
9
|
+
user: User;
|
|
10
|
+
/** Whether to show the user's picture/avatar (default: true) */
|
|
11
|
+
showPicture?: boolean;
|
|
12
|
+
/** Whether to show the user's name (default: true) */
|
|
13
|
+
showName?: boolean;
|
|
14
|
+
/** Whether to show the user's email (default: true) */
|
|
15
|
+
showEmail?: boolean;
|
|
16
|
+
/** Whether to show additional user roles/info (default: false) */
|
|
17
|
+
showRoles?: boolean;
|
|
18
|
+
/** Size of the profile display */
|
|
19
|
+
size?: "small" | "medium" | "large";
|
|
20
|
+
/** Layout orientation */
|
|
21
|
+
layout?: "horizontal" | "vertical";
|
|
22
|
+
/** Custom CSS class */
|
|
23
|
+
className?: string;
|
|
24
|
+
/** Custom styles */
|
|
25
|
+
style?: React.CSSProperties;
|
|
26
|
+
/** Click handler */
|
|
27
|
+
onClick?: () => void;
|
|
28
|
+
}
|
|
29
|
+
export declare const PasskeymeUserProfile: React.MemoExoticComponent<({ user, showPicture, showName, showEmail, showRoles, size, layout, className, style, onClick, }: PasskeymeUserProfileProps) => import("react/jsx-runtime").JSX.Element>;
|
|
30
|
+
export default PasskeymeUserProfile;
|
|
31
|
+
//# sourceMappingURL=PasskeymeUserProfile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PasskeymeUserProfile.d.ts","sourceRoot":"","sources":["../../src/components/PasskeymeUserProfile.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,WAAW,yBAAyB;IACxC,6BAA6B;IAC7B,IAAI,EAAE,IAAI,CAAC;IACX,gEAAgE;IAChE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uDAAuD;IACvD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kEAAkE;IAClE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kCAAkC;IAClC,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,yBAAyB;IACzB,MAAM,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACnC,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAmID,eAAO,MAAM,oBAAoB,8HAtH9B,yBAAyB,6CAsHiD,CAAC;AAE9E,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Performance monitoring dashboard component
|
|
3
|
+
* Provides real-time performance metrics and optimization insights
|
|
4
|
+
*/
|
|
5
|
+
export interface PerformanceMetrics {
|
|
6
|
+
renderTime: number;
|
|
7
|
+
bundleSize: number;
|
|
8
|
+
memoryUsage: number;
|
|
9
|
+
cacheHitRate: number;
|
|
10
|
+
errorRate: number;
|
|
11
|
+
}
|
|
12
|
+
export interface PerformanceDashboardProps {
|
|
13
|
+
enabled?: boolean;
|
|
14
|
+
position?: "top-right" | "top-left" | "bottom-right" | "bottom-left";
|
|
15
|
+
minimized?: boolean;
|
|
16
|
+
onToggle?: (minimized: boolean) => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Performance monitoring dashboard
|
|
20
|
+
*/
|
|
21
|
+
export declare const PerformanceDashboard: ({ enabled, position, minimized: initialMinimized, onToggle, }: PerformanceDashboardProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
22
|
+
/**
|
|
23
|
+
* Lightweight performance indicator
|
|
24
|
+
*/
|
|
25
|
+
export declare const PerformanceIndicator: ({ threshold, position, }: {
|
|
26
|
+
threshold?: number;
|
|
27
|
+
position?: "top-right" | "top-left" | "bottom-right" | "bottom-left";
|
|
28
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
29
|
+
export default PerformanceDashboard;
|
|
30
|
+
//# sourceMappingURL=PerformanceDashboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PerformanceDashboard.d.ts","sourceRoot":"","sources":["../../src/components/PerformanceDashboard.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AASH,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,yBAAyB;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,WAAW,GAAG,UAAU,GAAG,cAAc,GAAG,aAAa,CAAC;IACrE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,kEAK9B,yBAAyB,mDA4P3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,6BAG9B;IACD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,WAAW,GAAG,UAAU,GAAG,cAAc,GAAG,aAAa,CAAC;CACtE,mDA6DA,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|