@qwanyx/stack 0.2.66 → 0.2.67

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,70 @@
1
+ /**
2
+ * Geometry utilities for QMap
3
+ *
4
+ * Handles:
5
+ * - Edge path calculations (bezier, orthogonal, straight)
6
+ * - Node connection point calculations
7
+ * - Intersection tests
8
+ */
9
+ import type { EdgeStyle, QMapNodePosition } from '../types';
10
+ export interface Point {
11
+ x: number;
12
+ y: number;
13
+ }
14
+ /**
15
+ * Calculate SVG path for an edge between two nodes
16
+ */
17
+ export declare function calculateEdgePath(source: QMapNodePosition, target: QMapNodePosition, style?: EdgeStyle): string;
18
+ /**
19
+ * Get the center point of a node
20
+ */
21
+ export declare function getNodeCenter(node: QMapNodePosition): Point;
22
+ /**
23
+ * Get the connection point on a node's boundary toward a target point
24
+ * Returns the intersection of the line from center to target with the node boundary
25
+ */
26
+ export declare function getConnectionPoint(node: QMapNodePosition, target: Point): Point;
27
+ /**
28
+ * Get connection point on a specific side of the node
29
+ */
30
+ export declare function getNodeSidePoint(node: QMapNodePosition, side: 'left' | 'right' | 'top' | 'bottom' | 'center'): Point;
31
+ /**
32
+ * Test if a point is inside a rectangle
33
+ */
34
+ export declare function pointInRect(point: Point, rect: {
35
+ x: number;
36
+ y: number;
37
+ width: number;
38
+ height: number;
39
+ }): boolean;
40
+ /**
41
+ * Test if two rectangles intersect (AABB collision)
42
+ */
43
+ export declare function rectsIntersect(rect1: {
44
+ x: number;
45
+ y: number;
46
+ width: number;
47
+ height: number;
48
+ }, rect2: {
49
+ x: number;
50
+ y: number;
51
+ width: number;
52
+ height: number;
53
+ }): boolean;
54
+ /**
55
+ * Calculate the bounding box of multiple nodes
56
+ */
57
+ export declare function calculateBoundingBox(nodes: QMapNodePosition[]): {
58
+ x: number;
59
+ y: number;
60
+ width: number;
61
+ height: number;
62
+ } | null;
63
+ /**
64
+ * Calculate distance between two points
65
+ */
66
+ export declare function distance(p1: Point, p2: Point): number;
67
+ /**
68
+ * Calculate squared distance (faster, no sqrt)
69
+ */
70
+ export declare function distanceSquared(p1: Point, p2: Point): number;
@@ -0,0 +1,42 @@
1
+ import { ReactNode } from 'react';
2
+ export interface RegisterFormTheme {
3
+ primaryColor?: string;
4
+ primaryHoverColor?: string;
5
+ backgroundColor?: string;
6
+ textColor?: string;
7
+ textMutedColor?: string;
8
+ borderColor?: string;
9
+ errorColor?: string;
10
+ errorBackgroundColor?: string;
11
+ successColor?: string;
12
+ successBackgroundColor?: string;
13
+ inputBackground?: string;
14
+ borderRadius?: string;
15
+ }
16
+ export interface RegisterFormProps {
17
+ onRegister: (email: string, password: string, options?: {
18
+ firstName?: string;
19
+ lastName?: string;
20
+ }) => Promise<{
21
+ success: boolean;
22
+ error?: string;
23
+ requiresVerification?: boolean;
24
+ }>;
25
+ onSuccess?: (email: string) => void;
26
+ onLoginClick?: () => void;
27
+ logo?: ReactNode;
28
+ title?: string;
29
+ submitText?: string;
30
+ loadingText?: string;
31
+ emailLabel?: string;
32
+ passwordLabel?: string;
33
+ confirmPasswordLabel?: string;
34
+ firstNameLabel?: string;
35
+ lastNameLabel?: string;
36
+ loginLinkText?: string;
37
+ showNameFields?: boolean;
38
+ theme?: RegisterFormTheme;
39
+ className?: string;
40
+ isModal?: boolean;
41
+ }
42
+ export declare function RegisterForm({ onRegister, onSuccess, onLoginClick, logo, title, submitText, loadingText, emailLabel, passwordLabel, confirmPasswordLabel, firstNameLabel, lastNameLabel, loginLinkText, showNameFields, theme: customTheme, className, isModal, }: RegisterFormProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,33 @@
1
+ export interface ResetPasswordFormTheme {
2
+ primaryColor?: string;
3
+ primaryHoverColor?: string;
4
+ backgroundColor?: string;
5
+ textColor?: string;
6
+ textMutedColor?: string;
7
+ borderColor?: string;
8
+ errorColor?: string;
9
+ errorBackgroundColor?: string;
10
+ inputBackground?: string;
11
+ borderRadius?: string;
12
+ }
13
+ export interface ResetPasswordFormProps {
14
+ email: string;
15
+ code: string;
16
+ onResetPassword: (email: string, code: string, password: string) => Promise<{
17
+ success: boolean;
18
+ error?: string;
19
+ }>;
20
+ onSuccess?: () => void;
21
+ onBackClick?: () => void;
22
+ title?: string;
23
+ subtitle?: string;
24
+ submitText?: string;
25
+ loadingText?: string;
26
+ passwordLabel?: string;
27
+ confirmPasswordLabel?: string;
28
+ backText?: string;
29
+ theme?: ResetPasswordFormTheme;
30
+ className?: string;
31
+ isModal?: boolean;
32
+ }
33
+ export declare function ResetPasswordForm({ email, code, onResetPassword, onSuccess, onBackClick, title, subtitle, submitText, loadingText, passwordLabel, confirmPasswordLabel, backText, theme: customTheme, className, isModal, }: ResetPasswordFormProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,38 @@
1
+ export interface VerifyCodeFormTheme {
2
+ primaryColor?: string;
3
+ primaryHoverColor?: string;
4
+ backgroundColor?: string;
5
+ textColor?: string;
6
+ textMutedColor?: string;
7
+ borderColor?: string;
8
+ errorColor?: string;
9
+ errorBackgroundColor?: string;
10
+ successColor?: string;
11
+ inputBackground?: string;
12
+ borderRadius?: string;
13
+ }
14
+ export interface VerifyCodeFormProps {
15
+ email: string;
16
+ onVerify: (email: string, code: string) => Promise<{
17
+ success: boolean;
18
+ error?: string;
19
+ }>;
20
+ onSuccess?: () => void;
21
+ onResendCode?: (email: string) => Promise<{
22
+ success: boolean;
23
+ error?: string;
24
+ }>;
25
+ onBackClick?: () => void;
26
+ title?: string;
27
+ subtitle?: string;
28
+ submitText?: string;
29
+ loadingText?: string;
30
+ resendText?: string;
31
+ resendingText?: string;
32
+ backText?: string;
33
+ codeLength?: number;
34
+ theme?: VerifyCodeFormTheme;
35
+ className?: string;
36
+ isModal?: boolean;
37
+ }
38
+ export declare function VerifyCodeForm({ email, onVerify, onSuccess, onResendCode, onBackClick, title, subtitle, submitText, loadingText, resendText, resendingText, backText, codeLength, theme: customTheme, className, isModal, }: VerifyCodeFormProps): import("react/jsx-runtime").JSX.Element;