@hexdspace/react 0.0.26 → 0.0.27

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.
@@ -72,7 +72,7 @@
72
72
  @layer components {
73
73
  .card {
74
74
  background: var(--surface-2);
75
- border: 1px solid color-mix(in oklab, var(--border), transparent 45%);
75
+ border: 1px solid color-mix(in oklab, var(--border), transparent 80%);
76
76
  border-radius: var(--radius-card);
77
77
  box-shadow: var(--shadow-elevated);
78
78
  }
package/dist/index.d.ts CHANGED
@@ -255,7 +255,7 @@ interface LogoutUser {
255
255
  }
256
256
 
257
257
  interface RegisterUser {
258
- execute(email: string, password: string): AsyncResult<Error, GenericResponse>;
258
+ execute(email: string, password: string, attributes?: Record<string, string>): AsyncResult<Error, GenericResponse>;
259
259
  }
260
260
 
261
261
  interface GetAuthenticatedUser {
@@ -265,7 +265,7 @@ interface GetAuthenticatedUser {
265
265
  interface AuthProvider$1 {
266
266
  getAuthenticatedUser(): AsyncResult<Error, User | null>;
267
267
  login(email: string, password: string): AsyncResult<Error, User>;
268
- register(email: string, password: string): AsyncResult<Error, GenericResponse>;
268
+ register(email: string, password: string, attributes?: Record<string, string>): AsyncResult<Error, GenericResponse>;
269
269
  logout(): AsyncResult<Error, null>;
270
270
  }
271
271
 
@@ -277,7 +277,7 @@ declare class AuthController {
277
277
  constructor(loginUser: LoginUser, logoutUser: LogoutUser, registerUser: RegisterUser, getAuthenticatedUser: GetAuthenticatedUser);
278
278
  login(email: string, password: string): AsyncResult<Error, User>;
279
279
  logout(): AsyncResult<Error, null>;
280
- register(email: string, password: string): AsyncResult<Error, {
280
+ register(email: string, password: string, attributes?: Record<string, string>): AsyncResult<Error, {
281
281
  message: string;
282
282
  }>;
283
283
  getCurrentUser(): AsyncResult<Error, User | null>;
@@ -311,7 +311,7 @@ declare function useAuth(): AuthState;
311
311
  declare function useAuthActions(): {
312
312
  login: (email: string, password: string) => Promise<Result<Error, User>>;
313
313
  logout: () => void;
314
- register: (email: string, password: string) => Promise<Result<Error, {
314
+ register: (email: string, password: string, attributes?: Record<string, string>) => Promise<Result<Error, {
315
315
  message: string;
316
316
  }>>;
317
317
  };
package/dist/index.js CHANGED
@@ -638,9 +638,12 @@ var HttpCookieAuthProvider = class {
638
638
  }
639
639
  }
640
640
  }
641
- async register(email, password) {
641
+ async register(email, password, attributes) {
642
642
  try {
643
- const res = await this.httpClient.post("/auth/register", { email, password });
643
+ const res = await this.httpClient.post(
644
+ "/auth/register",
645
+ { email, password, ...attributes ?? {} }
646
+ );
644
647
  return ok2(res.data);
645
648
  } catch (err) {
646
649
  if (err instanceof Error) {
@@ -692,8 +695,8 @@ var RegisterUserUseCase = class {
692
695
  constructor(authProvider) {
693
696
  this.authProvider = authProvider;
694
697
  }
695
- execute(email, password) {
696
- return this.authProvider.register(email, password);
698
+ execute(email, password, attributes) {
699
+ return this.authProvider.register(email, password, attributes);
697
700
  }
698
701
  };
699
702
 
@@ -721,8 +724,8 @@ var AuthController = class {
721
724
  async logout() {
722
725
  return this.logoutUser.execute();
723
726
  }
724
- async register(email, password) {
725
- return this.registerUser.execute(email, password);
727
+ async register(email, password, attributes) {
728
+ return this.registerUser.execute(email, password, attributes);
726
729
  }
727
730
  async getCurrentUser() {
728
731
  return this.getAuthenticatedUser.execute();
@@ -856,9 +859,9 @@ function useAuthActions() {
856
859
  const logout = useCallback2(() => {
857
860
  authController2.logout().then(() => dispatch({ type: "LOGOUT" }));
858
861
  }, [dispatch, authController2]);
859
- const register = useCallback2(async (email, password) => {
862
+ const register = useCallback2(async (email, password, attributes) => {
860
863
  dispatch({ type: "REQUEST" });
861
- const res = await authController2.register(email, password);
864
+ const res = await authController2.register(email, password, attributes);
862
865
  dispatchRegisterResult(res, dispatch);
863
866
  return res;
864
867
  }, [dispatch, authController2]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hexdspace/react",
3
- "version": "0.0.26",
3
+ "version": "0.0.27",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",