@nocios/crudify-ui 1.0.53 → 1.0.54

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.js CHANGED
@@ -500,10 +500,7 @@ var LoginForm = ({ config, onNavigate, onLoginSuccess, onError, redirectUrl = "/
500
500
  }
501
501
  )
502
502
  ] }),
503
- config.loginActions?.includes("forgotPassword") && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material.Box, { sx: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
504
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material.Link, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login/checkCode"), variant: "body2", color: "primary", children: t("login.alreadyHaveCodeLink") }),
505
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material.Link, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login/forgotPassword"), variant: "body2", color: "secondary", children: t("login.forgotPasswordLink") })
506
- ] }),
503
+ config.loginActions?.includes("forgotPassword") && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material.Box, { sx: { display: "flex", justifyContent: "flex-end", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material.Link, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login/forgotPassword"), variant: "body2", color: "secondary", children: t("login.forgotPasswordLink") }) }),
507
504
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material.Button, { disabled: loading, type: "submit", fullWidth: true, variant: "contained", color: "primary", sx: { mt: 1, mb: 2 }, children: loading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material.CircularProgress, { size: 20 }) : t("login.loginButton") })
508
505
  ]
509
506
  }
@@ -589,14 +586,22 @@ var ForgotPasswordForm = ({ config, onNavigate, onError }) => {
589
586
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Alert, { severity: "success", sx: { mb: 3 }, children: t("forgotPassword.emailSentMessage") }),
590
587
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Typography, { variant: "body2", sx: { mb: 2 }, children: t("forgotPassword.checkEmailInstructions") }),
591
588
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Link, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login/checkCode"), variant: "body2", color: "primary", children: t("forgotPassword.enterCodeLink") }),
592
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Box, { sx: { mt: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Link, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login"), variant: "body2", color: "secondary", children: t("common.backToLogin") }) })
589
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_material2.Box, { sx: { display: "flex", justifyContent: "center", alignItems: "center", gap: 2, mt: 2 }, children: [
590
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Link, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login"), variant: "body2", color: "secondary", children: t("common.back") }),
591
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Typography, { variant: "body2", sx: { color: "grey.400" }, children: "\u2022" }),
592
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Link, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login/checkCode"), variant: "body2", color: "secondary", children: t("forgotPassword.alreadyHaveCodeLink") })
593
+ ] })
593
594
  ] });
594
595
  }
595
596
  if (codeAlreadyExists) {
596
597
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_material2.Box, { sx: { textAlign: "center" }, children: [
597
598
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Alert, { severity: "info", sx: { mb: 3 }, children: t("forgotPassword.codeAlreadyExistsMessage") }),
598
599
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Link, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login/checkCode"), variant: "body2", color: "primary", children: t("forgotPassword.enterCodeLink") }),
599
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Box, { sx: { mt: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Link, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login"), variant: "body2", color: "secondary", children: t("common.backToLogin") }) })
600
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_material2.Box, { sx: { display: "flex", justifyContent: "center", alignItems: "center", gap: 2, mt: 2 }, children: [
601
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Link, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login"), variant: "body2", color: "secondary", children: t("common.back") }),
602
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Typography, { variant: "body2", sx: { color: "grey.400" }, children: "\u2022" }),
603
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Link, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login/checkCode"), variant: "body2", color: "secondary", children: t("forgotPassword.alreadyHaveCodeLink") })
604
+ ] })
600
605
  ] });
601
606
  }
602
607
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
@@ -633,7 +638,11 @@ var ForgotPasswordForm = ({ config, onNavigate, onError }) => {
633
638
  )
634
639
  ] }),
635
640
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Button, { disabled: loading, type: "submit", fullWidth: true, variant: "contained", color: "primary", sx: { mt: 2, mb: 2 }, children: loading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.CircularProgress, { size: 20 }) : t("forgotPassword.sendCodeButton") }),
636
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Box, { sx: { textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Link, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login"), variant: "body2", color: "secondary", children: t("common.backToLogin") }) })
641
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_material2.Box, { sx: { display: "flex", justifyContent: "center", alignItems: "center", gap: 2 }, children: [
642
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Link, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login"), variant: "body2", color: "secondary", children: t("common.back") }),
643
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Typography, { variant: "body2", sx: { color: "grey.400" }, children: "\u2022" }),
644
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Link, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login/checkCode"), variant: "body2", color: "secondary", children: t("forgotPassword.alreadyHaveCodeLink") })
645
+ ] })
637
646
  ] }),
638
647
  errors.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Box, { sx: { mt: 2 }, children: errors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Alert, { variant: "filled", severity: "error", children: error }, index)) })
639
648
  ] });
@@ -1111,65 +1120,38 @@ var CrudifyLoginInternal = ({
1111
1120
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(LoginForm_default, { ...commonProps, onLoginSuccess });
1112
1121
  }
1113
1122
  };
1114
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1115
- import_material5.Box,
1116
- {
1117
- sx: {
1118
- display: "flex",
1119
- justifyContent: "center",
1120
- alignItems: "center",
1121
- minHeight: "100vh",
1122
- padding: 2,
1123
- backgroundColor: finalConfig.colors?.bgColor || "#f5f5f5"
1124
- },
1125
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1126
- import_material5.Paper,
1127
- {
1128
- elevation: 3,
1129
- sx: {
1130
- p: 4,
1131
- width: "100%",
1132
- maxWidth: 400,
1133
- display: "flex",
1134
- flexDirection: "column",
1135
- background: finalConfig.colors?.bgColor || "#fff"
1136
- },
1137
- children: [
1138
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_material5.Box, { sx: { display: "flex", justifyContent: "center", mb: 3 }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1139
- "img",
1140
- {
1141
- src: finalConfig.logo || "/nocios-default.png",
1142
- alt: t("login.logoAlt"),
1143
- style: {
1144
- width: "100%",
1145
- maxWidth: "150px",
1146
- height: "auto"
1147
- },
1148
- onError: (e) => {
1149
- const target = e.target;
1150
- target.src = "/nocios-default.png";
1151
- }
1152
- }
1153
- ) }),
1154
- finalConfig.appName && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1155
- import_material5.Typography,
1156
- {
1157
- variant: "h6",
1158
- component: "h1",
1159
- sx: {
1160
- textAlign: "center",
1161
- mb: 2,
1162
- color: finalConfig.colors?.primaryColor || "#1066BA"
1163
- },
1164
- children: finalConfig.appName
1165
- }
1166
- ),
1167
- renderCurrentForm()
1168
- ]
1123
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
1124
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_material5.Box, { sx: { display: "flex", justifyContent: "center", mb: 3 }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1125
+ "img",
1126
+ {
1127
+ src: finalConfig.logo || "/nocios-default.png",
1128
+ alt: t("login.logoAlt"),
1129
+ style: {
1130
+ width: "100%",
1131
+ maxWidth: "150px",
1132
+ height: "auto"
1133
+ },
1134
+ onError: (e) => {
1135
+ const target = e.target;
1136
+ target.src = "/nocios-default.png";
1169
1137
  }
1170
- )
1171
- }
1172
- );
1138
+ }
1139
+ ) }),
1140
+ finalConfig.appName && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1141
+ import_material5.Typography,
1142
+ {
1143
+ variant: "h6",
1144
+ component: "h1",
1145
+ sx: {
1146
+ textAlign: "center",
1147
+ mb: 2,
1148
+ color: finalConfig.colors?.primaryColor || "#1066BA"
1149
+ },
1150
+ children: finalConfig.appName
1151
+ }
1152
+ ),
1153
+ renderCurrentForm()
1154
+ ] });
1173
1155
  };
1174
1156
  var CrudifyLogin = ({
1175
1157
  translations,
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ export * from "@nocios/crudify-browser";
4
4
 
5
5
  // src/components/CrudifyLogin/index.tsx
6
6
  import { useState as useState6, useMemo as useMemo3 } from "react";
7
- import { Paper, Box as Box5, Typography as Typography5 } from "@mui/material";
7
+ import { Box as Box5, Typography as Typography5 } from "@mui/material";
8
8
 
9
9
  // src/components/CrudifyLogin/context/I18nProvider.tsx
10
10
  import { createContext, useContext, useMemo } from "react";
@@ -456,10 +456,7 @@ var LoginForm = ({ config, onNavigate, onLoginSuccess, onError, redirectUrl = "/
456
456
  }
457
457
  )
458
458
  ] }),
459
- config.loginActions?.includes("forgotPassword") && /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
460
- /* @__PURE__ */ jsx2(Link, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login/checkCode"), variant: "body2", color: "primary", children: t("login.alreadyHaveCodeLink") }),
461
- /* @__PURE__ */ jsx2(Link, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login/forgotPassword"), variant: "body2", color: "secondary", children: t("login.forgotPasswordLink") })
462
- ] }),
459
+ config.loginActions?.includes("forgotPassword") && /* @__PURE__ */ jsx2(Box, { sx: { display: "flex", justifyContent: "flex-end", alignItems: "center" }, children: /* @__PURE__ */ jsx2(Link, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login/forgotPassword"), variant: "body2", color: "secondary", children: t("login.forgotPasswordLink") }) }),
463
460
  /* @__PURE__ */ jsx2(Button, { disabled: loading, type: "submit", fullWidth: true, variant: "contained", color: "primary", sx: { mt: 1, mb: 2 }, children: loading ? /* @__PURE__ */ jsx2(CircularProgress, { size: 20 }) : t("login.loginButton") })
464
461
  ]
465
462
  }
@@ -545,14 +542,22 @@ var ForgotPasswordForm = ({ config, onNavigate, onError }) => {
545
542
  /* @__PURE__ */ jsx3(Alert2, { severity: "success", sx: { mb: 3 }, children: t("forgotPassword.emailSentMessage") }),
546
543
  /* @__PURE__ */ jsx3(Typography2, { variant: "body2", sx: { mb: 2 }, children: t("forgotPassword.checkEmailInstructions") }),
547
544
  /* @__PURE__ */ jsx3(Link2, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login/checkCode"), variant: "body2", color: "primary", children: t("forgotPassword.enterCodeLink") }),
548
- /* @__PURE__ */ jsx3(Box2, { sx: { mt: 2 }, children: /* @__PURE__ */ jsx3(Link2, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login"), variant: "body2", color: "secondary", children: t("common.backToLogin") }) })
545
+ /* @__PURE__ */ jsxs2(Box2, { sx: { display: "flex", justifyContent: "center", alignItems: "center", gap: 2, mt: 2 }, children: [
546
+ /* @__PURE__ */ jsx3(Link2, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login"), variant: "body2", color: "secondary", children: t("common.back") }),
547
+ /* @__PURE__ */ jsx3(Typography2, { variant: "body2", sx: { color: "grey.400" }, children: "\u2022" }),
548
+ /* @__PURE__ */ jsx3(Link2, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login/checkCode"), variant: "body2", color: "secondary", children: t("forgotPassword.alreadyHaveCodeLink") })
549
+ ] })
549
550
  ] });
550
551
  }
551
552
  if (codeAlreadyExists) {
552
553
  return /* @__PURE__ */ jsxs2(Box2, { sx: { textAlign: "center" }, children: [
553
554
  /* @__PURE__ */ jsx3(Alert2, { severity: "info", sx: { mb: 3 }, children: t("forgotPassword.codeAlreadyExistsMessage") }),
554
555
  /* @__PURE__ */ jsx3(Link2, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login/checkCode"), variant: "body2", color: "primary", children: t("forgotPassword.enterCodeLink") }),
555
- /* @__PURE__ */ jsx3(Box2, { sx: { mt: 2 }, children: /* @__PURE__ */ jsx3(Link2, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login"), variant: "body2", color: "secondary", children: t("common.backToLogin") }) })
556
+ /* @__PURE__ */ jsxs2(Box2, { sx: { display: "flex", justifyContent: "center", alignItems: "center", gap: 2, mt: 2 }, children: [
557
+ /* @__PURE__ */ jsx3(Link2, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login"), variant: "body2", color: "secondary", children: t("common.back") }),
558
+ /* @__PURE__ */ jsx3(Typography2, { variant: "body2", sx: { color: "grey.400" }, children: "\u2022" }),
559
+ /* @__PURE__ */ jsx3(Link2, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login/checkCode"), variant: "body2", color: "secondary", children: t("forgotPassword.alreadyHaveCodeLink") })
560
+ ] })
556
561
  ] });
557
562
  }
558
563
  return /* @__PURE__ */ jsxs2(Fragment2, { children: [
@@ -589,7 +594,11 @@ var ForgotPasswordForm = ({ config, onNavigate, onError }) => {
589
594
  )
590
595
  ] }),
591
596
  /* @__PURE__ */ jsx3(Button2, { disabled: loading, type: "submit", fullWidth: true, variant: "contained", color: "primary", sx: { mt: 2, mb: 2 }, children: loading ? /* @__PURE__ */ jsx3(CircularProgress2, { size: 20 }) : t("forgotPassword.sendCodeButton") }),
592
- /* @__PURE__ */ jsx3(Box2, { sx: { textAlign: "center" }, children: /* @__PURE__ */ jsx3(Link2, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login"), variant: "body2", color: "secondary", children: t("common.backToLogin") }) })
597
+ /* @__PURE__ */ jsxs2(Box2, { sx: { display: "flex", justifyContent: "center", alignItems: "center", gap: 2 }, children: [
598
+ /* @__PURE__ */ jsx3(Link2, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login"), variant: "body2", color: "secondary", children: t("common.back") }),
599
+ /* @__PURE__ */ jsx3(Typography2, { variant: "body2", sx: { color: "grey.400" }, children: "\u2022" }),
600
+ /* @__PURE__ */ jsx3(Link2, { sx: { cursor: "pointer" }, onClick: () => onNavigate?.("/login/checkCode"), variant: "body2", color: "secondary", children: t("forgotPassword.alreadyHaveCodeLink") })
601
+ ] })
593
602
  ] }),
594
603
  errors.length > 0 && /* @__PURE__ */ jsx3(Box2, { sx: { mt: 2 }, children: errors.map((error, index) => /* @__PURE__ */ jsx3(Alert2, { variant: "filled", severity: "error", children: error }, index)) })
595
604
  ] });
@@ -976,7 +985,7 @@ var CheckCodeForm = ({ config, onNavigate, onError }) => {
976
985
  var CheckCodeForm_default = CheckCodeForm;
977
986
 
978
987
  // src/components/CrudifyLogin/index.tsx
979
- import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
988
+ import { Fragment as Fragment5, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
980
989
  var CrudifyLoginInternal = ({
981
990
  config: providedConfig,
982
991
  onNavigate,
@@ -1067,65 +1076,38 @@ var CrudifyLoginInternal = ({
1067
1076
  return /* @__PURE__ */ jsx6(LoginForm_default, { ...commonProps, onLoginSuccess });
1068
1077
  }
1069
1078
  };
1070
- return /* @__PURE__ */ jsx6(
1071
- Box5,
1072
- {
1073
- sx: {
1074
- display: "flex",
1075
- justifyContent: "center",
1076
- alignItems: "center",
1077
- minHeight: "100vh",
1078
- padding: 2,
1079
- backgroundColor: finalConfig.colors?.bgColor || "#f5f5f5"
1080
- },
1081
- children: /* @__PURE__ */ jsxs5(
1082
- Paper,
1083
- {
1084
- elevation: 3,
1085
- sx: {
1086
- p: 4,
1087
- width: "100%",
1088
- maxWidth: 400,
1089
- display: "flex",
1090
- flexDirection: "column",
1091
- background: finalConfig.colors?.bgColor || "#fff"
1092
- },
1093
- children: [
1094
- /* @__PURE__ */ jsx6(Box5, { sx: { display: "flex", justifyContent: "center", mb: 3 }, children: /* @__PURE__ */ jsx6(
1095
- "img",
1096
- {
1097
- src: finalConfig.logo || "/nocios-default.png",
1098
- alt: t("login.logoAlt"),
1099
- style: {
1100
- width: "100%",
1101
- maxWidth: "150px",
1102
- height: "auto"
1103
- },
1104
- onError: (e) => {
1105
- const target = e.target;
1106
- target.src = "/nocios-default.png";
1107
- }
1108
- }
1109
- ) }),
1110
- finalConfig.appName && /* @__PURE__ */ jsx6(
1111
- Typography5,
1112
- {
1113
- variant: "h6",
1114
- component: "h1",
1115
- sx: {
1116
- textAlign: "center",
1117
- mb: 2,
1118
- color: finalConfig.colors?.primaryColor || "#1066BA"
1119
- },
1120
- children: finalConfig.appName
1121
- }
1122
- ),
1123
- renderCurrentForm()
1124
- ]
1079
+ return /* @__PURE__ */ jsxs5(Fragment5, { children: [
1080
+ /* @__PURE__ */ jsx6(Box5, { sx: { display: "flex", justifyContent: "center", mb: 3 }, children: /* @__PURE__ */ jsx6(
1081
+ "img",
1082
+ {
1083
+ src: finalConfig.logo || "/nocios-default.png",
1084
+ alt: t("login.logoAlt"),
1085
+ style: {
1086
+ width: "100%",
1087
+ maxWidth: "150px",
1088
+ height: "auto"
1089
+ },
1090
+ onError: (e) => {
1091
+ const target = e.target;
1092
+ target.src = "/nocios-default.png";
1125
1093
  }
1126
- )
1127
- }
1128
- );
1094
+ }
1095
+ ) }),
1096
+ finalConfig.appName && /* @__PURE__ */ jsx6(
1097
+ Typography5,
1098
+ {
1099
+ variant: "h6",
1100
+ component: "h1",
1101
+ sx: {
1102
+ textAlign: "center",
1103
+ mb: 2,
1104
+ color: finalConfig.colors?.primaryColor || "#1066BA"
1105
+ },
1106
+ children: finalConfig.appName
1107
+ }
1108
+ ),
1109
+ renderCurrentForm()
1110
+ ] });
1129
1111
  };
1130
1112
  var CrudifyLogin = ({
1131
1113
  translations,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocios/crudify-ui",
3
- "version": "1.0.53",
3
+ "version": "1.0.54",
4
4
  "description": "Biblioteca de componentes UI para Crudify",
5
5
  "author": "Nocios",
6
6
  "license": "MIT",