mailsentry-auth 0.2.0 → 0.2.1
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 +78 -44
- package/dist/index.mjs +78 -44
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -747,6 +747,8 @@ var useStepRenderer = () => {
|
|
|
747
747
|
|
|
748
748
|
|
|
749
749
|
|
|
750
|
+
var _image = require('next/image'); var _image2 = _interopRequireDefault(_image);
|
|
751
|
+
var _classvarianceauthority = require('class-variance-authority');
|
|
750
752
|
|
|
751
753
|
// src/hooks/useAuthActionHandler.ts
|
|
752
754
|
|
|
@@ -2870,6 +2872,37 @@ var useAuthFlowModal = () => {
|
|
|
2870
2872
|
|
|
2871
2873
|
// src/components/auth/auth-flow-container.tsx
|
|
2872
2874
|
|
|
2875
|
+
var containerVariants = _classvarianceauthority.cva.call(void 0, "w-full h-screen p-6 overflow-hidden", {
|
|
2876
|
+
variants: {
|
|
2877
|
+
layout: {
|
|
2878
|
+
withImage: "",
|
|
2879
|
+
fullWidth: "max-w-[600px] mx-auto"
|
|
2880
|
+
}
|
|
2881
|
+
},
|
|
2882
|
+
defaultVariants: {
|
|
2883
|
+
layout: "fullWidth"
|
|
2884
|
+
}
|
|
2885
|
+
});
|
|
2886
|
+
var formContentVariants = _classvarianceauthority.cva.call(void 0, "overflow-auto w-full", {
|
|
2887
|
+
variants: {
|
|
2888
|
+
centered: {
|
|
2889
|
+
true: "flex justify-center items-center"
|
|
2890
|
+
}
|
|
2891
|
+
},
|
|
2892
|
+
defaultVariants: {
|
|
2893
|
+
centered: true
|
|
2894
|
+
}
|
|
2895
|
+
});
|
|
2896
|
+
var imageContainerVariants = _classvarianceauthority.cva.call(void 0, "h-screen overflow-hidden relative", {
|
|
2897
|
+
variants: {
|
|
2898
|
+
gradient: {
|
|
2899
|
+
purple: ""
|
|
2900
|
+
}
|
|
2901
|
+
},
|
|
2902
|
+
defaultVariants: {
|
|
2903
|
+
gradient: "purple"
|
|
2904
|
+
}
|
|
2905
|
+
});
|
|
2873
2906
|
function AuthFlowContainer({
|
|
2874
2907
|
variant = "default" /* DEFAULT */,
|
|
2875
2908
|
backgroundImage
|
|
@@ -3062,53 +3095,54 @@ function AuthFlowContainer({
|
|
|
3062
3095
|
onClick: goBackToHome
|
|
3063
3096
|
};
|
|
3064
3097
|
}, [stepperState.currentStep, stepperActions, clearAll, goBackToHome]);
|
|
3065
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _antd.Row, { className: "h-
|
|
3066
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Col, { xs: 24, lg: showRightSideImage ?
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
children: topButton.label
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3098
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _antd.Row, { className: "m-0 h-screen", children: [
|
|
3099
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Col, { xs: 24, lg: showRightSideImage ? 10 : 24, className: "flex flex-col", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3100
|
+
_antd.Flex,
|
|
3101
|
+
{
|
|
3102
|
+
vertical: true,
|
|
3103
|
+
justify: "space-between",
|
|
3104
|
+
className: containerVariants({
|
|
3105
|
+
layout: showRightSideImage ? "withImage" : "fullWidth"
|
|
3106
|
+
}),
|
|
3107
|
+
children: [
|
|
3108
|
+
config2.showBackToHome && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Flex, { justify: "flex-start", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Button, { onClick: topButton.onClick, shape: "round", size: "large", type: "primary", ghost: true, children: topButton.label }) }),
|
|
3109
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Flex, { flex: 1, justify: "center", align: "center", className: formContentVariants(), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Space, { direction: "vertical", className: "w-full max-w-[480px]", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SelectedComponent, __spreadValues({}, stepProps)) }) }),
|
|
3110
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _antd.Flex, { align: "center", gap: "small", className: "mt-4", children: [
|
|
3111
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3112
|
+
_antd.Button,
|
|
3113
|
+
{
|
|
3114
|
+
type: "text",
|
|
3115
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _icons.ArrowLeftOutlined, {}),
|
|
3116
|
+
onClick: handleBack,
|
|
3117
|
+
disabled: stepperState.isFirstStep
|
|
3118
|
+
}
|
|
3119
|
+
),
|
|
3120
|
+
config2.showSteps && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Flex, { flex: 1, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3121
|
+
_antd.Steps,
|
|
3122
|
+
{
|
|
3123
|
+
current: currentVisibleStepIndex >= 0 ? currentVisibleStepIndex : 0,
|
|
3124
|
+
labelPlacement: "vertical",
|
|
3125
|
+
size: "small",
|
|
3126
|
+
className: "w-full",
|
|
3127
|
+
items: visibleSteps.map((step) => ({
|
|
3128
|
+
title: step.title
|
|
3129
|
+
}))
|
|
3130
|
+
}
|
|
3131
|
+
) })
|
|
3132
|
+
] })
|
|
3133
|
+
]
|
|
3134
|
+
}
|
|
3135
|
+
) }),
|
|
3136
|
+
showRightSideImage && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Col, { xs: 0, lg: 14, className: imageContainerVariants(), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Flex, { justify: "center", align: "center", className: "absolute top-0 left-0 w-full h-full p-10", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Space, { className: "relative w-full h-full", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3137
|
+
_image2.default,
|
|
3104
3138
|
{
|
|
3105
3139
|
src: backgroundImage,
|
|
3106
|
-
alt: "Authentication
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3140
|
+
alt: "Authentication",
|
|
3141
|
+
fill: true,
|
|
3142
|
+
className: "rounded-lg object-cover",
|
|
3143
|
+
priority: true
|
|
3110
3144
|
}
|
|
3111
|
-
) }) })
|
|
3145
|
+
) }) }) })
|
|
3112
3146
|
] });
|
|
3113
3147
|
}
|
|
3114
3148
|
|
package/dist/index.mjs
CHANGED
|
@@ -745,8 +745,10 @@ var useStepRenderer = () => {
|
|
|
745
745
|
|
|
746
746
|
// src/components/auth/auth-flow-container.tsx
|
|
747
747
|
import React3, { useState as useState5 } from "react";
|
|
748
|
-
import { Steps, Col, Button as Button5, Flex as Flex3, Row,
|
|
748
|
+
import { Steps, Col, Button as Button5, Flex as Flex3, Row, Space as Space4 } from "antd";
|
|
749
749
|
import { ArrowLeftOutlined as ArrowLeftOutlined3 } from "@ant-design/icons";
|
|
750
|
+
import Image from "next/image";
|
|
751
|
+
import { cva } from "class-variance-authority";
|
|
750
752
|
|
|
751
753
|
// src/hooks/useAuthActionHandler.ts
|
|
752
754
|
import { useState as useState2, useCallback } from "react";
|
|
@@ -2870,6 +2872,37 @@ var useAuthFlowModal = () => {
|
|
|
2870
2872
|
|
|
2871
2873
|
// src/components/auth/auth-flow-container.tsx
|
|
2872
2874
|
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2875
|
+
var containerVariants = cva("w-full h-screen p-6 overflow-hidden", {
|
|
2876
|
+
variants: {
|
|
2877
|
+
layout: {
|
|
2878
|
+
withImage: "",
|
|
2879
|
+
fullWidth: "max-w-[600px] mx-auto"
|
|
2880
|
+
}
|
|
2881
|
+
},
|
|
2882
|
+
defaultVariants: {
|
|
2883
|
+
layout: "fullWidth"
|
|
2884
|
+
}
|
|
2885
|
+
});
|
|
2886
|
+
var formContentVariants = cva("overflow-auto w-full", {
|
|
2887
|
+
variants: {
|
|
2888
|
+
centered: {
|
|
2889
|
+
true: "flex justify-center items-center"
|
|
2890
|
+
}
|
|
2891
|
+
},
|
|
2892
|
+
defaultVariants: {
|
|
2893
|
+
centered: true
|
|
2894
|
+
}
|
|
2895
|
+
});
|
|
2896
|
+
var imageContainerVariants = cva("h-screen overflow-hidden relative", {
|
|
2897
|
+
variants: {
|
|
2898
|
+
gradient: {
|
|
2899
|
+
purple: ""
|
|
2900
|
+
}
|
|
2901
|
+
},
|
|
2902
|
+
defaultVariants: {
|
|
2903
|
+
gradient: "purple"
|
|
2904
|
+
}
|
|
2905
|
+
});
|
|
2873
2906
|
function AuthFlowContainer({
|
|
2874
2907
|
variant = "default" /* DEFAULT */,
|
|
2875
2908
|
backgroundImage
|
|
@@ -3062,53 +3095,54 @@ function AuthFlowContainer({
|
|
|
3062
3095
|
onClick: goBackToHome
|
|
3063
3096
|
};
|
|
3064
3097
|
}, [stepperState.currentStep, stepperActions, clearAll, goBackToHome]);
|
|
3065
|
-
return /* @__PURE__ */ jsxs7(Row, { className: "h-
|
|
3066
|
-
/* @__PURE__ */ jsx12(Col, { xs: 24, lg: showRightSideImage ?
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
children: topButton.label
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3098
|
+
return /* @__PURE__ */ jsxs7(Row, { className: "m-0 h-screen", children: [
|
|
3099
|
+
/* @__PURE__ */ jsx12(Col, { xs: 24, lg: showRightSideImage ? 10 : 24, className: "flex flex-col", children: /* @__PURE__ */ jsxs7(
|
|
3100
|
+
Flex3,
|
|
3101
|
+
{
|
|
3102
|
+
vertical: true,
|
|
3103
|
+
justify: "space-between",
|
|
3104
|
+
className: containerVariants({
|
|
3105
|
+
layout: showRightSideImage ? "withImage" : "fullWidth"
|
|
3106
|
+
}),
|
|
3107
|
+
children: [
|
|
3108
|
+
config2.showBackToHome && /* @__PURE__ */ jsx12(Flex3, { justify: "flex-start", children: /* @__PURE__ */ jsx12(Button5, { onClick: topButton.onClick, shape: "round", size: "large", type: "primary", ghost: true, children: topButton.label }) }),
|
|
3109
|
+
/* @__PURE__ */ jsx12(Flex3, { flex: 1, justify: "center", align: "center", className: formContentVariants(), children: /* @__PURE__ */ jsx12(Space4, { direction: "vertical", className: "w-full max-w-[480px]", children: /* @__PURE__ */ jsx12(SelectedComponent, __spreadValues({}, stepProps)) }) }),
|
|
3110
|
+
/* @__PURE__ */ jsxs7(Flex3, { align: "center", gap: "small", className: "mt-4", children: [
|
|
3111
|
+
/* @__PURE__ */ jsx12(
|
|
3112
|
+
Button5,
|
|
3113
|
+
{
|
|
3114
|
+
type: "text",
|
|
3115
|
+
icon: /* @__PURE__ */ jsx12(ArrowLeftOutlined3, {}),
|
|
3116
|
+
onClick: handleBack,
|
|
3117
|
+
disabled: stepperState.isFirstStep
|
|
3118
|
+
}
|
|
3119
|
+
),
|
|
3120
|
+
config2.showSteps && /* @__PURE__ */ jsx12(Flex3, { flex: 1, children: /* @__PURE__ */ jsx12(
|
|
3121
|
+
Steps,
|
|
3122
|
+
{
|
|
3123
|
+
current: currentVisibleStepIndex >= 0 ? currentVisibleStepIndex : 0,
|
|
3124
|
+
labelPlacement: "vertical",
|
|
3125
|
+
size: "small",
|
|
3126
|
+
className: "w-full",
|
|
3127
|
+
items: visibleSteps.map((step) => ({
|
|
3128
|
+
title: step.title
|
|
3129
|
+
}))
|
|
3130
|
+
}
|
|
3131
|
+
) })
|
|
3132
|
+
] })
|
|
3133
|
+
]
|
|
3134
|
+
}
|
|
3135
|
+
) }),
|
|
3136
|
+
showRightSideImage && /* @__PURE__ */ jsx12(Col, { xs: 0, lg: 14, className: imageContainerVariants(), children: /* @__PURE__ */ jsx12(Flex3, { justify: "center", align: "center", className: "absolute top-0 left-0 w-full h-full p-10", children: /* @__PURE__ */ jsx12(Space4, { className: "relative w-full h-full", children: /* @__PURE__ */ jsx12(
|
|
3103
3137
|
Image,
|
|
3104
3138
|
{
|
|
3105
3139
|
src: backgroundImage,
|
|
3106
|
-
alt: "Authentication
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3140
|
+
alt: "Authentication",
|
|
3141
|
+
fill: true,
|
|
3142
|
+
className: "rounded-lg object-cover",
|
|
3143
|
+
priority: true
|
|
3110
3144
|
}
|
|
3111
|
-
) }) })
|
|
3145
|
+
) }) }) })
|
|
3112
3146
|
] });
|
|
3113
3147
|
}
|
|
3114
3148
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mailsentry-auth",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Next.js 15 authentication package with multi-step auth flow, cross-tab sync, and Zustand state management",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"@react-oauth/google": "^0.13.4",
|
|
49
49
|
"@types/js-cookie": "^3.0.6",
|
|
50
50
|
"antd": "^5.27.0",
|
|
51
|
+
"class-variance-authority": "^0.7.1",
|
|
51
52
|
"immer": "^10.1.1",
|
|
52
53
|
"js-cookie": "^3.0.5",
|
|
53
54
|
"zustand": "^5.0.8"
|