@ttoss/react-auth 2.2.1 → 2.3.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/dist/esm/index.js CHANGED
@@ -833,11 +833,12 @@ var AuthSignUp = ({
833
833
  };
834
834
 
835
835
  // src/Auth.tsx
836
+ import { Flex as Flex5 } from "@ttoss/ui";
836
837
  import { assign, createMachine } from "xstate";
837
838
  import { confirmResetPassword, confirmSignUp, resendSignUpCode, resetPassword, signIn, signUp } from "aws-amplify/auth";
838
839
  import { useMachine } from "@xstate/react";
839
840
  import { useNotifications as useNotifications4 } from "@ttoss/react-notifications";
840
- import { jsx as jsx9 } from "react/jsx-runtime";
841
+ import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
841
842
  var authMachine = createMachine({
842
843
  predictableActionArguments: true,
843
844
  initial: "signIn",
@@ -1107,7 +1108,9 @@ var AuthLogic = () => {
1107
1108
  };
1108
1109
  var Auth = ({
1109
1110
  logo,
1110
- fullScreen = true
1111
+ layout = {
1112
+ fullScreen: true
1113
+ }
1111
1114
  }) => {
1112
1115
  const withLogoNode = React6.useMemo(() => {
1113
1116
  return /* @__PURE__ */jsx9(LogoProvider, {
@@ -1115,7 +1118,37 @@ var Auth = ({
1115
1118
  children: /* @__PURE__ */jsx9(AuthLogic, {})
1116
1119
  });
1117
1120
  }, [logo]);
1118
- if (fullScreen) {
1121
+ if (layout.fullScreen) {
1122
+ if (layout.sideImage) {
1123
+ return /* @__PURE__ */jsx9(AuthFullScreen, {
1124
+ children: /* @__PURE__ */jsxs6(Flex5, {
1125
+ sx: {
1126
+ width: "100%",
1127
+ height: "100%",
1128
+ flexDirection: layout.sideImagePosition === "left" ? "row" : "row-reverse"
1129
+ },
1130
+ children: [/* @__PURE__ */jsx9(Flex5, {
1131
+ sx: {
1132
+ width: "100%",
1133
+ height: "100%",
1134
+ flex: [0, 0, 1],
1135
+ justifyContent: "center",
1136
+ alignItems: "center"
1137
+ },
1138
+ children: layout.sideImage
1139
+ }), /* @__PURE__ */jsx9(Flex5, {
1140
+ sx: {
1141
+ width: "100%",
1142
+ height: "100%",
1143
+ flex: [1],
1144
+ justifyContent: "center",
1145
+ alignItems: "center"
1146
+ },
1147
+ children: withLogoNode
1148
+ })]
1149
+ })
1150
+ });
1151
+ }
1119
1152
  return /* @__PURE__ */jsx9(AuthFullScreen, {
1120
1153
  children: withLogoNode
1121
1154
  });
package/dist/index.d.ts CHANGED
@@ -26,10 +26,15 @@ type LogoContextProps = {
26
26
  children?: React.ReactNode;
27
27
  };
28
28
 
29
- type AuthProps = LogoContextProps & {
29
+ type AuthLayout = {
30
30
  fullScreen?: boolean;
31
+ sideImage?: React.ReactNode;
32
+ sideImagePosition?: 'left' | 'right';
33
+ };
34
+ type AuthProps = LogoContextProps & {
35
+ layout?: AuthLayout;
31
36
  };
32
- declare const Auth: ({ logo, fullScreen }: AuthProps) => react_jsx_runtime.JSX.Element;
37
+ declare const Auth: ({ logo, layout }: AuthProps) => react_jsx_runtime.JSX.Element;
33
38
 
34
39
  type OnSignInInput = {
35
40
  email: string;
@@ -55,4 +60,4 @@ type OnForgotPasswordResetPassword = (input: {
55
60
  newPassword: string;
56
61
  }) => void;
57
62
 
58
- export { Auth, AuthProvider, type OnConfirmSignUp, type OnForgotPassword, type OnForgotPasswordResetPassword, type OnSignIn, type OnSignInInput, type OnSignUp, type OnSignUpInput, useAuth };
63
+ export { Auth, type AuthProps, AuthProvider, type OnConfirmSignUp, type OnForgotPassword, type OnForgotPasswordResetPassword, type OnSignIn, type OnSignInInput, type OnSignUp, type OnSignUpInput, useAuth };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/react-auth",
3
- "version": "2.2.1",
3
+ "version": "2.3.0",
4
4
  "description": "ttoss authentication module for React apps.",
5
5
  "license": "MIT",
6
6
  "author": "ttoss",
@@ -27,29 +27,29 @@
27
27
  "dependencies": {
28
28
  "@xstate/react": "^3.2.2",
29
29
  "xstate": "^4.38.3",
30
- "@ttoss/forms": "^0.26.2"
30
+ "@ttoss/forms": "^0.26.3"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "aws-amplify": "^6.0.0",
34
34
  "react": ">=16.8.0",
35
- "@ttoss/react-i18n": "^2.0.4",
36
- "@ttoss/ui": "^5.0.9",
37
- "@ttoss/react-notifications": "^1.24.59"
35
+ "@ttoss/react-notifications": "^1.24.60",
36
+ "@ttoss/react-i18n": "^2.0.5",
37
+ "@ttoss/ui": "^5.0.10"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@jest/globals": "^29.7.0",
41
- "@types/react": "^18.3.7",
41
+ "@types/react": "^18.3.12",
42
42
  "aws-amplify": "^6.0.28",
43
43
  "jest": "^29.7.0",
44
44
  "react": "^18.3.1",
45
- "tsup": "^8.3.0",
46
- "@ttoss/config": "^1.34.1",
47
- "@ttoss/cloud-auth": "^0.12.22",
48
- "@ttoss/i18n-cli": "^0.7.22",
49
- "@ttoss/react-i18n": "^2.0.4",
50
- "@ttoss/test-utils": "^2.1.17",
51
- "@ttoss/react-notifications": "^1.24.59",
52
- "@ttoss/ui": "^5.0.9"
45
+ "tsup": "^8.3.5",
46
+ "@ttoss/i18n-cli": "^0.7.23",
47
+ "@ttoss/react-notifications": "^1.24.60",
48
+ "@ttoss/config": "^1.34.2",
49
+ "@ttoss/cloud-auth": "^0.12.23",
50
+ "@ttoss/react-i18n": "^2.0.5",
51
+ "@ttoss/test-utils": "^2.1.18",
52
+ "@ttoss/ui": "^5.0.10"
53
53
  },
54
54
  "keywords": [
55
55
  "React",