@akinon/pz-otp 2.0.0-beta.0 → 2.0.0-beta.10

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/CHANGELOG.md CHANGED
@@ -1,5 +1,46 @@
1
1
  # @akinon/pz-otp
2
2
 
3
+ ## 2.0.0-beta.10
4
+
5
+ ### Minor Changes
6
+
7
+ - 2806320: ZERO-3390: Update version tailwindcss, autoprefixer, tailwind-merge, postcss
8
+
9
+ ## 2.0.0-beta.9
10
+
11
+ ### Minor Changes
12
+
13
+ - 0fe7711: ZERO-3387: Upgrade nextjs, eslint-config-next
14
+
15
+ ## 2.0.0-beta.8
16
+
17
+ ## 2.0.0-beta.7
18
+
19
+ ## 2.0.0-beta.6
20
+
21
+ ### Minor Changes
22
+
23
+ - 8f05f9b: ZERO-3250: Beta branch synchronized with Main branch
24
+
25
+ ## 2.0.0-beta.5
26
+
27
+ ## 2.0.0-beta.4
28
+
29
+ ## 2.0.0-beta.3
30
+
31
+ ## 2.0.0-beta.2
32
+
33
+ ### Minor Changes
34
+
35
+ - a006015: ZERO-3116: Add not-found page and update default middleware.
36
+ - 1eeb3d8: ZERO-3116: Add not found page
37
+
38
+ ## 2.0.0-beta.1
39
+
40
+ ### Minor Changes
41
+
42
+ - ZERO-3091: Upgrade Next.js to v15 and React to v19
43
+
3
44
  ## 2.0.0-beta.0
4
45
 
5
46
  ### Major Changes
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "@akinon/pz-otp",
3
- "version": "2.0.0-beta.0",
3
+ "version": "2.0.0-beta.10",
4
4
  "license": "MIT",
5
5
  "main": "./src/index.ts",
6
6
  "module": "./src/index.ts",
7
7
  "peerDependencies": {
8
- "react": "^18.0.0",
9
- "react-dom": "^18.0.0"
8
+ "react": "^19.0.0",
9
+ "react-dom": "^19.0.0"
10
10
  },
11
11
  "devDependencies": {
12
- "@types/node": "^18.7.8",
13
- "@types/react": "^18.0.17",
14
- "@types/react-dom": "^18.0.6",
15
- "prettier": "3.0.3",
12
+ "@types/node": "^22.10.2",
13
+ "@types/react": "^19.0.2",
14
+ "@types/react-dom": "^19.0.2",
15
+ "prettier": "^3.4.2",
16
16
  "prettier-plugin-tailwindcss": "0.5.6",
17
- "react": "^18.2.0",
18
- "react-dom": "^18.2.0",
17
+ "react": "^19.0.0",
18
+ "react-dom": "^19.0.0",
19
19
  "react-hook-form": "7.31.3",
20
- "typescript": "^4.7.4"
20
+ "typescript": "^5.7.2"
21
21
  },
22
22
  "dependencies": {
23
23
  "react-otp-input": "^3.1.0",
package/readme.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # @akinon/pz-otp
2
2
 
3
- ### Install the npm package
3
+ ## Installation method
4
+
5
+ You can use the following command to install the extension with the latest plugins:
4
6
 
5
7
  ```bash
6
- # For latest version
7
- yarn add @akinon/pz-otp
8
8
 
9
- # Preferred installation method
10
9
  npx @akinon/projectzero@latest --plugins
10
+
11
11
  ```
package/src/views/Otp.tsx CHANGED
@@ -30,7 +30,6 @@ type ComponentClasses = ComponentClassKey | ComponentWrapperClassKey;
30
30
  type OtpProps = {
31
31
  codeLength?: number;
32
32
  timer?: number;
33
- phone?: string;
34
33
  submitAction: SubmitHandler<{
35
34
  [key: string]: any;
36
35
  }>;
@@ -53,15 +52,15 @@ export const Otp = ({
53
52
  timer = 60,
54
53
  texts,
55
54
  classes,
56
- error,
57
- phone
55
+ error
58
56
  }: OtpProps) => {
57
+ const { phone } = data;
59
58
  const [otp, setOtp] = useState('');
60
59
  const [canResend, setCanResend] = useState(false);
61
60
  const [time, setTime] = useState(timer);
62
61
  const [hasError, setHasError] = useState(false);
63
62
  const dispatch = useAppDispatch();
64
- const otpPopupVisible = useAppSelector((state) => state.otp?.isPopupVisible);
63
+ const { isPopupVisible } = useAppSelector((state) => state.otp);
65
64
 
66
65
  const resetTimer = () => {
67
66
  setTime(timer);
@@ -118,19 +117,21 @@ export const Otp = ({
118
117
  }, [time, onTimerEnd]);
119
118
 
120
119
  useEffect(() => {
121
- document.body.style.overflow = 'hidden';
122
- window.scrollTo({ top: 0, behavior: 'smooth' });
120
+ if (isPopupVisible) {
121
+ document.body.style.overflow = 'hidden';
122
+ window.scrollTo({ top: 0, behavior: 'smooth' });
123
123
 
124
- return () => {
125
- document.body.style.overflow = 'auto';
126
- };
124
+ return () => {
125
+ document.body.style.overflow = 'auto';
126
+ };
127
+ }
127
128
  }, []);
128
129
 
129
- if (!otpPopupVisible) return null;
130
+ if (!isPopupVisible) return null;
130
131
 
131
132
  return (
132
133
  <div className="fixed left-0 top-0 z-50 flex h-screen w-screen items-end md:items-center md:justify-center md:bg-black/10">
133
- <div className="h-[calc(100vh-48px)] w-screen flex md:h-auto md:max-w-lg flex-col items-center rounded-sm bg-white p-8 shadow-xl">
134
+ <div className="h-[calc(100vh-48px)] w-screen flex md:h-auto md:max-w-lg flex-col items-center rounded-xs bg-white p-8 shadow-xl">
134
135
  <div className="w-full flex items-center justify-end">
135
136
  <div className="cursor-pointer" onClick={closeHandler}>
136
137
  <svg