astrogators-shared-ui 0.4.3 → 0.5.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.
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+
3
+ export interface BadgeProps {
4
+ children: React.ReactNode;
5
+ variant?: 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'info';
6
+ size?: 'sm' | 'md' | 'lg';
7
+ className?: string;
8
+ }
9
+ /**
10
+ * Badge component
11
+ * Small label for status, tags, or categories
12
+ */
13
+ export declare const Badge: React.FC<BadgeProps>;
@@ -0,0 +1,20 @@
1
+ import { default as React } from 'react';
2
+
3
+ export interface CardProps {
4
+ children: React.ReactNode;
5
+ variant?: 'default' | 'elevated' | 'outline';
6
+ chamfered?: boolean;
7
+ chamferSize?: 'sm' | 'md' | 'lg' | 'asymmetric';
8
+ padding?: 'none' | 'sm' | 'md' | 'lg';
9
+ hoverable?: boolean;
10
+ showDiagonalBorders?: boolean;
11
+ diagonalBorderColor?: string;
12
+ className?: string;
13
+ onClick?: () => void;
14
+ style?: React.CSSProperties;
15
+ }
16
+ /**
17
+ * Card component
18
+ * Container for content with optional chamfered corners and diagonal borders
19
+ */
20
+ export declare const Card: React.FC<CardProps>;
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+
3
+ export interface ModalProps {
4
+ isOpen: boolean;
5
+ onClose: () => void;
6
+ title?: string;
7
+ children: React.ReactNode;
8
+ size?: 'sm' | 'md' | 'lg' | 'xl';
9
+ closeOnOverlayClick?: boolean;
10
+ className?: string;
11
+ }
12
+ /**
13
+ * Modal component
14
+ * Overlay dialog for focused user interaction
15
+ */
16
+ export declare const Modal: React.FC<ModalProps>;
@@ -0,0 +1,6 @@
1
+ export { Card } from './Card';
2
+ export type { CardProps } from './Card';
3
+ export { Badge } from './Badge';
4
+ export type { BadgeProps } from './Badge';
5
+ export { Modal } from './Modal';
6
+ export type { ModalProps } from './Modal';
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+
3
+ export interface LoaderProps {
4
+ size?: 'sm' | 'md' | 'lg';
5
+ variant?: 'spinner' | 'dots';
6
+ className?: string;
7
+ }
8
+ /**
9
+ * Loader component
10
+ * Loading indicator with spinner or dots animation
11
+ */
12
+ export declare const Loader: React.FC<LoaderProps>;
@@ -0,0 +1,2 @@
1
+ export { Loader } from './Loader';
2
+ export type { LoaderProps } from './Loader';
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+
3
+ export interface AllyCodeDropdownProps {
4
+ onAllyCodeSelected?: (allyCode: string | null) => void;
5
+ className?: string;
6
+ }
7
+ /**
8
+ * AllyCodeDropdown component
9
+ * Dropdown for selecting and managing saved ally codes
10
+ * Shows all saved codes with player names, allows quick switching
11
+ */
12
+ export declare const AllyCodeDropdown: React.FC<AllyCodeDropdownProps>;
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+
3
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
4
+ children: React.ReactNode;
5
+ variant?: 'primary' | 'secondary' | 'outline' | 'ghost' | 'danger';
6
+ size?: 'sm' | 'md' | 'lg';
7
+ fullWidth?: boolean;
8
+ loading?: boolean;
9
+ disabled?: boolean;
10
+ className?: string;
11
+ }
12
+ /**
13
+ * Button component
14
+ * Reusable button with multiple variants and sizes
15
+ */
16
+ export declare const Button: React.FC<ButtonProps>;
@@ -0,0 +1,14 @@
1
+ import { default as React } from 'react';
2
+
3
+ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
4
+ label?: string;
5
+ error?: string;
6
+ helperText?: string;
7
+ fullWidth?: boolean;
8
+ className?: string;
9
+ }
10
+ /**
11
+ * Input component
12
+ * Text input field with label, error, and helper text support
13
+ */
14
+ export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,21 @@
1
+ import { default as React } from 'react';
2
+
3
+ export interface SelectOption {
4
+ value: string;
5
+ label: string;
6
+ disabled?: boolean;
7
+ }
8
+ export interface SelectProps extends React.SelectHTMLAttributes<HTMLSelectElement> {
9
+ label?: string;
10
+ error?: string;
11
+ helperText?: string;
12
+ options?: SelectOption[];
13
+ placeholder?: string;
14
+ fullWidth?: boolean;
15
+ className?: string;
16
+ }
17
+ /**
18
+ * Select component
19
+ * Dropdown select with label, error, and helper text support
20
+ */
21
+ export declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLSelectElement>>;
@@ -0,0 +1,8 @@
1
+ export { Button } from './Button';
2
+ export type { ButtonProps } from './Button';
3
+ export { Input } from './Input';
4
+ export type { InputProps } from './Input';
5
+ export { Select } from './Select';
6
+ export type { SelectProps, SelectOption } from './Select';
7
+ export { AllyCodeDropdown } from './AllyCodeDropdown';
8
+ export type { AllyCodeDropdownProps } from './AllyCodeDropdown';
@@ -0,0 +1,14 @@
1
+ import { default as React, CSSProperties } from 'react';
2
+
3
+ export interface ContainerProps {
4
+ children: React.ReactNode;
5
+ maxWidth?: 'sm' | 'md' | 'lg' | 'xl' | 'full';
6
+ padding?: boolean;
7
+ className?: string;
8
+ style?: CSSProperties;
9
+ }
10
+ /**
11
+ * Container component
12
+ * Centers content and applies max-width constraints
13
+ */
14
+ export declare const Container: React.FC<ContainerProps>;
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+
3
+ export interface FooterProps {
4
+ children?: React.ReactNode;
5
+ className?: string;
6
+ }
7
+ /**
8
+ * Footer component
9
+ * Global footer shown across all applications
10
+ */
11
+ export declare const Footer: React.FC<FooterProps>;
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+
3
+ export interface TopBarProps {
4
+ logo?: React.ReactNode;
5
+ leftContent?: React.ReactNode;
6
+ rightContent?: React.ReactNode;
7
+ className?: string;
8
+ }
9
+ /**
10
+ * TopBar component
11
+ * Global navigation bar shown across all applications
12
+ */
13
+ export declare const TopBar: React.FC<TopBarProps>;
@@ -0,0 +1,6 @@
1
+ export { Container } from './Container';
2
+ export type { ContainerProps } from './Container';
3
+ export { TopBar } from './TopBar';
4
+ export type { TopBarProps } from './TopBar';
5
+ export { Footer } from './Footer';
6
+ export type { FooterProps } from './Footer';
@@ -0,0 +1,43 @@
1
+ import { default as React } from 'react';
2
+ import { User, LoginRequest, RegisterRequest, ForgotPasswordRequest, ResetPasswordRequest, ResendVerificationRequest, AllyCode, AllyCodeMigrationPrompt } from '../types';
3
+ import { StoredAllyCode } from '../services/allyCodeStorage';
4
+
5
+ export interface AuthContextValue {
6
+ user: User | null;
7
+ isAuthenticated: boolean;
8
+ isLoading: boolean;
9
+ login: (credentials: LoginRequest) => Promise<void>;
10
+ register: (data: RegisterRequest) => Promise<void>;
11
+ logout: () => void;
12
+ refreshUser: () => Promise<void>;
13
+ forgotPassword: (data: ForgotPasswordRequest) => Promise<string>;
14
+ resetPassword: (data: ResetPasswordRequest) => Promise<string>;
15
+ resendVerification: (data: ResendVerificationRequest) => Promise<string>;
16
+ authEnabled: boolean;
17
+ isLoadingFeatures: boolean;
18
+ allyCodes: AllyCode[] | StoredAllyCode[];
19
+ selectedAllyCode: string | null;
20
+ isLoadingAllyCodes: boolean;
21
+ fetchAllyCodes: () => Promise<void>;
22
+ addAllyCode: (allyCode: string) => Promise<void>;
23
+ removeAllyCode: (allyCodeId: number | string) => Promise<void>;
24
+ selectAllyCode: (allyCode: string | null) => void;
25
+ updateAllyCodeLastUsed: (allyCodeId: number | string) => Promise<void>;
26
+ migrationPrompt: AllyCodeMigrationPrompt;
27
+ dismissMigrationPrompt: () => void;
28
+ migrateLocalStorageCodes: () => Promise<void>;
29
+ }
30
+ export interface AuthProviderProps {
31
+ children: React.ReactNode;
32
+ apiBaseUrl: string;
33
+ }
34
+ /**
35
+ * AuthProvider
36
+ * Provides authentication state and methods to the entire application
37
+ */
38
+ export declare const AuthProvider: React.FC<AuthProviderProps>;
39
+ /**
40
+ * useAuth hook
41
+ * Access authentication state and methods
42
+ */
43
+ export declare const useAuth: () => AuthContextValue;
@@ -0,0 +1,18 @@
1
+
2
+ export { Container, TopBar, Footer } from './components/layout';
3
+ export type { ContainerProps, TopBarProps, FooterProps } from './components/layout';
4
+ export { Button, Input, Select, AllyCodeDropdown } from './components/forms';
5
+ export type { ButtonProps, InputProps, SelectProps, SelectOption, AllyCodeDropdownProps } from './components/forms';
6
+ export { Card, Badge, Modal } from './components/display';
7
+ export type { CardProps, BadgeProps, ModalProps } from './components/display';
8
+ export { Loader } from './components/feedback';
9
+ export type { LoaderProps } from './components/feedback';
10
+ export { AuthProvider, useAuth } from './contexts/AuthContext';
11
+ export type { AuthContextValue, AuthProviderProps } from './contexts/AuthContext';
12
+ export { ApiClient, apiClient, initializeApiClient } from './services/api';
13
+ export type { ApiClientConfig } from './services/api';
14
+ export { getAccessToken, setAccessToken, removeAccessToken, getRefreshToken, setRefreshToken, removeRefreshToken, setTokens, clearTokens, isAuthenticated, } from './services/auth';
15
+ export { getAllyCodesFromStorage, saveAllyCodeToStorage, removeAllyCodeFromStorage, updateAllyCodeLastUsed, getSelectedAllyCode, setSelectedAllyCode, clearAllyCodes, } from './services/allyCodeStorage';
16
+ export type { StoredAllyCode } from './services/allyCodeStorage';
17
+ export { formatAllyCode, unformatAllyCode } from './utils/formatAllyCode';
18
+ export type { User, LoginRequest, LoginResponse, RegisterRequest, RegisterResponse, RefreshTokenRequest, RefreshTokenResponse, ForgotPasswordRequest, ForgotPasswordResponse, ResetPasswordRequest, ResetPasswordResponse, VerifyEmailRequest, VerifyEmailResponse, ResendVerificationRequest, ResendVerificationResponse, AllyCode, AllyCodeCreate, AllyCodeListResponse, AllyCodeMigrationPrompt, ApiResponse, ApiError, PaginatedResponse, ModStat, ParsedMod, ModListResponse, EvaluationScores, ModEvaluation, EvaluationRequest, EvaluationResponse, } from './types';