@nibssplc/cams-sdk-react 1.0.0-rc.85 → 1.0.0-rc.86

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.esm.js CHANGED
@@ -1701,12 +1701,12 @@ var ADLoginModal = function (_a) {
1701
1701
  return (jsxs(FormItem, { children: [jsx(FormLabel, { children: "Username" }), jsx(FormControl, { children: jsx(Input, __assign({ className: "h-12", placeholder: "Enter your username" }, field)) }), jsx(FormMessage, {})] }));
1702
1702
  } }), jsx(FormField, { control: form.control, name: "password", render: function (_a) {
1703
1703
  var field = _a.field;
1704
- return (jsxs(FormItem, { children: [jsx(FormLabel, { children: "Password" }), jsx(FormControl, { children: jsxs("div", { className: "relative", children: [jsx(Input, __assign({ className: "h-12 pr-10", type: "password", placeholder: "Enter your password" }, field)), jsx("button", { type: "button", onClick: function () { return setShowPassword(!showPassword); }, className: "absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground", children: showPassword ? (jsx(EyeOff, { className: "w-5 h-5" })) : (jsx(Eye, { className: "w-5 h-5" })) })] }) }), jsx(FormMessage, {})] }));
1705
- } }), jsx(Button, { type: "submit", className: "py-3 w-full bg-[#506f4a] hover:bg-[#506f4a]/90", children: "Continue" })] }) }))) : (jsxs("div", { className: "space-y-4", children: [jsx(GenericOTPVerifier, { value: MFACode, setValue: setMFACode, setLoading: setIsLoading, isDisabled: isLoading, onChangeOTP: handleMFASubmit, fieldName: "AuthenticatorCode" }), isLoading && (jsxs("div", { className: "flex items-center justify-center gap-2 text-sm text-muted-foreground", children: [jsx(Loader2, { className: "w-4 h-4 animate-spin" }), jsx("span", { children: "Verifying..." })] }))] }))] }) }));
1704
+ return (jsxs(FormItem, { children: [jsx(FormLabel, { children: "Password" }), jsx(FormControl, { children: jsxs("div", { className: "relative", children: [jsx(Input, __assign({ className: "h-12 pr-10", type: showPassword ? "text" : "password", placeholder: "Enter your password" }, field)), jsx("button", { type: "button", onClick: function () { return setShowPassword(!showPassword); }, className: "absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground", children: showPassword ? (jsx(EyeOff, { className: "w-5 h-5" })) : (jsx(Eye, { className: "w-5 h-5" })) })] }) }), jsx(FormMessage, {})] }));
1705
+ } }), jsx(Button, { type: "submit", className: "py-4 w-full bg-[#506f4a] hover:bg-[#506f4a]/90", children: "Continue" })] }) }))) : (jsxs("div", { className: "space-y-4", children: [jsx(GenericOTPVerifier, { value: MFACode, setValue: setMFACode, setLoading: setIsLoading, isDisabled: isLoading, onChangeOTP: handleMFASubmit, fieldName: "AuthenticatorCode" }), isLoading && (jsxs("div", { className: "flex items-center justify-center gap-2 text-sm text-muted-foreground", children: [jsx(Loader2, { className: "w-4 h-4 animate-spin" }), jsx("span", { children: "Verifying..." })] }))] }))] }) }));
1706
1706
  };
1707
1707
 
1708
1708
  var DefaultLoginPage = function (_a) {
1709
- var usePassKey = _a.usePassKey, useADLogin = _a.useADLogin, MFAEndpoints = _a.MFAEndpoints, CredentialsAuthEndpoint = _a.CredentialsAuthEndpoint, PassKeysRegisterProps = _a.PassKeysRegisterProps;
1709
+ var usePassKey = _a.usePassKey, useADLogin = _a.useADLogin, MFAEndpoints = _a.MFAEndpoints, CredentialsAuthEndpoint = _a.CredentialsAuthEndpoint, PassKeysRegisterProps = _a.PassKeysRegisterProps, onADLoginSuccess = _a.onADLoginSuccess;
1710
1710
  var cardVariants = {
1711
1711
  hidden: { opacity: 0, scale: 0.8, y: 50 },
1712
1712
  visible: {
@@ -1769,7 +1769,7 @@ var DefaultLoginPage = function (_a) {
1769
1769
  };
1770
1770
  if (showSuccessAnimation && useADLogin) {
1771
1771
  return (jsx("div", { className: "flex justify-center items-center h-dvh", children: jsx(Card, { className: "mx-auto space-y-6 p-6 bg-white rounded-lg shadow-md", children: jsx(AuthSuccessAnimation, { onComplete: function () {
1772
- // Animation completed, can add additional logic here if needed
1772
+ onADLoginSuccess === null || onADLoginSuccess === void 0 ? void 0 : onADLoginSuccess();
1773
1773
  } }) }) }));
1774
1774
  }
1775
1775
  return (jsxs("main", { className: "cams-sdk min-h-screen bg-gray-50", children: [jsx(motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: 0.5 }, children: jsx("div", { className: "flex h-screen items-center justify-center", children: jsxs(motion.div, { variants: cardVariants, initial: "hidden", animate: "visible", exit: "exit", className: "w-full max-w-md p-6 space-y-4 rounded-2xl shadow-2xl", children: [jsxs(CardHeader, { className: "text-center space-y-3", children: [jsx("div", { className: "w-full flex items-center justify-center", children: jsx("img", { src: NIBSSLogo, alt: "NIBSS Logo", width: 225, height: 225 }) }), jsx(CardTitle, { className: "text-3xl font-bold", children: "NIBSS CAMS" }), jsx(CardTitle, { className: "text-gray-500 dark:text-gray-400 font-bold text-lg", children: "Centralized Authentication" })] }), jsxs(CardAction, { className: "w-full flex flex-col items-center justify-center text-center text-gray-500 dark:text-gray-400 mb-8", children: [jsx("img", { src: AuthLogo, alt: "Auth Logo", width: 365, height: 365 }), "Use Below Identity Providers To Authenticate"] }), jsxs("div", { className: "space-y-4", children: [jsxs(Button
@@ -1781,7 +1781,7 @@ var DefaultLoginPage = function (_a) {
1781
1781
  : "Sign in with ActiveDirectory" })] })), usePassKey && (jsxs(Button, { className: "w-full flex items-center justify-center cursor-pointer bg-[#506f4a] hover:bg-[#506f4a] rounded-lg border border-transparent px-5 py-8 text-base font-medium transition-colors duration-250", onClick: function () {
1782
1782
  return authentication.HandleRegister(MFAEndpoints.RegisterNewChallenge, MFAEndpoints.RegisterVerify +
1783
1783
  "?username=".concat(PassKeysRegisterProps.username), register, PassKeysRegisterProps);
1784
- }, disabled: isLoading, children: [jsx(KeyIcon, { className: "text-[#506f4a]", size: 64 }), jsx("span", { children: "Create a Passkey" })] }))] }), jsxs(CardFooter, { className: "flex items-center justify-center mt-6 space-x-2 text-gray-400 text-sm", children: [jsx(ShieldCheck, { className: "w-4 h-4 text-[#506f4a] pulse-glow" }), jsx("span", { children: "Powered By NIBSS" })] })] }) }) }, "landing"), jsx(ADLoginModal, { open: showADModal, onOpenChange: setShowADModal, isLoading: isCredAuthLoading, setIsLoading: setIsCredAuthLoading, onLogin: function (_a) { return __awaiter$1(void 0, [_a], void 0, function (_b) {
1784
+ }, disabled: isLoading, children: [jsx(KeyIcon, { className: "text-[#506f4a]", size: 64 }), jsx("span", { children: "Create a Passkey" })] }))] }), jsxs(CardFooter, { className: "flex items-center justify-center mt-6 space-x-2 text-gray-400 text-sm", children: [jsx(ShieldCheck, { className: "w-4 h-4 text-[#506f4a] pulse-glow" }), jsx("span", { children: "Powered By NIBSS" })] })] }) }) }, "landing"), jsx(ADLoginModal, { open: showADModal, onOpenChange: setShowADModal, isLoading: context.isLoading || isCredAuthLoading, setIsLoading: setIsCredAuthLoading, onLogin: function (_a) { return __awaiter$1(void 0, [_a], void 0, function (_b) {
1785
1785
  var username = _b.username, password = _b.password, MFACode = _b.MFACode;
1786
1786
  return __generator$1(this, function (_c) {
1787
1787
  // Implement your AD login logic here
@@ -1935,7 +1935,7 @@ var MFAGate = function (_a) {
1935
1935
  return jsx(Fragment, { children: children });
1936
1936
  case "Unauthenticated":
1937
1937
  default:
1938
- return (jsx(DefaultLoginPage, { usePassKey: usePassKey, useADLogin: useADLogin, MFAEndpoints: ValidatedMFAEndpoints, PassKeysRegisterProps: PassKeysRegisterProps, CredentialsAuthEndpoint: CredentialsAuthEndpoint }));
1938
+ return (jsx(DefaultLoginPage, { usePassKey: usePassKey, useADLogin: useADLogin, MFAEndpoints: ValidatedMFAEndpoints, PassKeysRegisterProps: PassKeysRegisterProps, CredentialsAuthEndpoint: CredentialsAuthEndpoint, onADLoginSuccess: function () { return setAuthState("Authenticated"); } }));
1939
1939
  }
1940
1940
  };
1941
1941