@rationalbloks/frontblok-components 0.2.2 → 0.2.4

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/index.d.ts CHANGED
@@ -10,21 +10,12 @@ import { Theme } from '@mui/material';
10
10
  import { ThemeOptions } from '@mui/material/styles';
11
11
 
12
12
  export declare interface AppThemeOptions {
13
- /** Override default palette colors */
14
13
  paletteOverrides?: Record<string, unknown>;
15
- /** Override default typography settings */
16
14
  typographyOverrides?: Record<string, unknown>;
17
- /** Override default component styles */
18
15
  componentsOverrides?: ThemeOptions['components'];
19
- /** Border radius for shapes. Default: 12 */
20
16
  borderRadius?: number;
21
17
  }
22
18
 
23
- /**
24
- * Auth API interface - matches frontblok-auth's authApi.
25
- * Components need these methods to work.
26
- * Uses generic return types to be compatible with various implementations.
27
- */
28
19
  export declare interface AuthApi {
29
20
  requestPasswordReset: (email: string) => Promise<unknown>;
30
21
  resetPassword: (token: string, newPassword: string) => Promise<unknown>;
@@ -34,9 +25,6 @@ export declare interface AuthApi {
34
25
  }>;
35
26
  }
36
27
 
37
- /**
38
- * Auth hook return type - matches useClientAuth from frontblok-auth.
39
- */
40
28
  export declare interface AuthHook {
41
29
  login: (email: string, password: string) => Promise<boolean>;
42
30
  register: (email: string, password: string, firstName: string, lastName: string) => Promise<boolean>;
@@ -46,13 +34,8 @@ export declare interface AuthHook {
46
34
 
47
35
  export declare const AuthView: default_2.FC<AuthViewProps>;
48
36
 
49
- /**
50
- * Props for AuthView which also needs the auth hook and nonce generator.
51
- */
52
37
  export declare interface AuthViewProps extends ViewProps {
53
- /** Auth hook (login, register, isLoading, error) */
54
38
  useAuth: () => AuthHook;
55
- /** Generate OAuth nonce for Google login */
56
39
  generateOAuthNonce: () => string;
57
40
  }
58
41
 
@@ -61,32 +44,19 @@ export declare interface BrandConfig {
61
44
  logo: string;
62
45
  }
63
46
 
64
- /**
65
- * Branding configuration passed to components.
66
- * Customize the look and feel of auth components.
67
- */
68
47
  export declare interface Branding {
69
- /** App name displayed in headers */
70
48
  appName: string;
71
- /** Short tagline for auth pages */
72
49
  tagline: string;
73
- /** Single letter for logo icon */
74
50
  logoLetter: string;
75
- /** CSS gradient for primary buttons and logo */
76
51
  primaryGradient: string;
77
- /** CSS gradient for hover state */
78
52
  primaryGradientHover: string;
79
- /** Box shadow for logo */
80
53
  logoShadow: string;
81
- /** Route to redirect after login */
82
54
  dashboardRoute: string;
83
- /** Success messages */
84
55
  messages: {
85
56
  loginSuccess: string;
86
57
  registerSuccess: string;
87
58
  googleNewUser: string;
88
59
  };
89
- /** Security badge text */
90
60
  securityBadge: string;
91
61
  }
92
62
 
@@ -130,37 +100,10 @@ declare interface ConfirmationModalProps_2 {
130
100
  bulletPoints?: string[];
131
101
  }
132
102
 
133
- /**
134
- * Props for ConfirmationModal.
135
- */
136
103
  export declare type ConfirmationModalSeverity = 'info' | 'warning' | 'error' | 'success';
137
104
 
138
105
  declare type ConfirmationModalSeverity_2 = 'info' | 'warning' | 'error' | 'success';
139
106
 
140
- /**
141
- * Creates a MUI theme with RationalBloks defaults.
142
- *
143
- * All defaults can be overridden per-app via the options parameter.
144
- * The defaults include:
145
- * - Warm beige background
146
- * - Professional blue primary palette
147
- * - System font typography with tight letter-spacing
148
- * - Polished component overrides (no uppercase buttons, rounded cards, etc.)
149
- *
150
- * @param options - Customization options
151
- * @returns A MUI Theme object
152
- *
153
- * @example
154
- * ```typescript
155
- * // Use defaults
156
- * const theme = createAppTheme();
157
- *
158
- * // Override primary color
159
- * const theme = createAppTheme({
160
- * paletteOverrides: { primary: { main: '#e91e63' } },
161
- * });
162
- * ```
163
- */
164
107
  export declare function createAppTheme(options?: AppThemeOptions): Theme;
165
108
 
166
109
  export declare function createNavbar(config: NavbarConfig): () => JSX.Element;
@@ -236,9 +179,6 @@ export declare class ErrorBoundary extends Component<Props, State> {
236
179
  render(): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | ReactPortal | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | JSX.Element | null | undefined;
237
180
  }
238
181
 
239
- /**
240
- * Props for ErrorBoundary.
241
- */
242
182
  export declare interface ErrorBoundaryProps {
243
183
  children: ReactNode;
244
184
  supportEmail?: string;
@@ -256,11 +196,9 @@ export declare interface ErrorFallbackProps {
256
196
  export declare function ForgotPasswordView({ authApi, authRoute }: ForgotPasswordViewProps): JSX.Element;
257
197
 
258
198
  export declare interface ForgotPasswordViewProps {
259
- /** Auth API object with requestPasswordReset method */
260
199
  authApi: {
261
200
  requestPasswordReset: (email: string) => Promise<unknown>;
262
201
  };
263
- /** Route to navigate back to login (default: '/auth') */
264
202
  authRoute?: string;
265
203
  }
266
204
 
@@ -278,7 +216,6 @@ export declare interface NavbarConfig {
278
216
  brand: BrandConfig;
279
217
  navigation: NavigationConfig;
280
218
  useAuth: () => NavbarAuthHookResult;
281
- /** Gradient colors for navbar background */
282
219
  navbarGradient: {
283
220
  start: string;
284
221
  end: string;
@@ -308,11 +245,9 @@ declare interface Props {
308
245
  export declare function ResetPasswordView({ authApi, authRoute }: ResetPasswordViewProps): JSX.Element;
309
246
 
310
247
  export declare interface ResetPasswordViewProps {
311
- /** Auth API object with resetPassword method */
312
248
  authApi: {
313
249
  resetPassword: (token: string, newPassword: string) => Promise<unknown>;
314
250
  };
315
- /** Route to navigate after successful reset (default: '/auth') */
316
251
  authRoute?: string;
317
252
  }
318
253
 
@@ -326,16 +261,12 @@ export declare interface SettingsViewAuthApi {
326
261
  }
327
262
 
328
263
  export declare interface SettingsViewProps {
329
- /** The auth API instance (must have deleteAccount method) */
330
264
  authApi: SettingsViewAuthApi;
331
- /** The useAuth hook from your app */
332
265
  useAuth: () => {
333
266
  user: SettingsViewUser | null;
334
267
  logout: () => void;
335
268
  };
336
- /** Route to navigate to after logout/delete. Default: '/' */
337
269
  homeRoute?: string;
338
- /** Optional additional content to render between profile and danger zone */
339
270
  children?: default_2.ReactNode;
340
271
  }
341
272
 
@@ -356,23 +287,15 @@ export declare const SupportView: () => JSX.Element;
356
287
  export declare function VerifyEmailView({ authApi, successRoute, errorRoute }: VerifyEmailViewProps): JSX.Element;
357
288
 
358
289
  export declare interface VerifyEmailViewProps {
359
- /** Auth API object with verifyEmail method */
360
290
  authApi: {
361
291
  verifyEmail: (token: string) => Promise<unknown>;
362
292
  };
363
- /** Route to navigate after successful verification (default: '/projects') */
364
293
  successRoute?: string;
365
- /** Route to navigate on error (default: '/settings') */
366
294
  errorRoute?: string;
367
295
  }
368
296
 
369
- /**
370
- * Common props for all views that need auth and branding.
371
- */
372
297
  export declare interface ViewProps {
373
- /** Branding configuration */
374
298
  branding: Branding;
375
- /** Auth API instance */
376
299
  authApi: AuthApi;
377
300
  }
378
301
 
package/dist/index.js CHANGED
@@ -733,8 +733,8 @@ const AuthView = ({
733
733
  setLocalError("Passwords do not match");
734
734
  return false;
735
735
  }
736
- if (formData.password.length < 6) {
737
- setLocalError("Password must be at least 6 characters");
736
+ if (formData.password.length < 8) {
737
+ setLocalError("Password must be at least 8 characters");
738
738
  return false;
739
739
  }
740
740
  }