next-helios-fe 1.8.57 → 1.8.59

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-helios-fe",
3
- "version": "1.8.57",
3
+ "version": "1.8.59",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import React, { useRef } from "react";
2
+ import React from "react";
3
3
  import { Tooltip } from "../../../components";
4
4
  import { Icon } from "@iconify/react";
5
5
 
@@ -20,7 +20,6 @@ export const Email: React.FC<EmailProps> = ({
20
20
  description,
21
21
  ...rest
22
22
  }) => {
23
- const inputRef = useRef<HTMLInputElement>(null);
24
23
  const width = options?.width === "fit" ? "w-fit" : "w-full";
25
24
  const height =
26
25
  options?.height === "short"
@@ -48,10 +47,8 @@ export const Email: React.FC<EmailProps> = ({
48
47
  <div className="flex-1 flex justify-end items-center gap-2">
49
48
  {rest.maxLength && (
50
49
  <span className="text-sm select-none">
51
- {inputRef.current?.value
52
- ? (inputRef.current?.value as string).length
53
- : 0}
54
- /{rest.maxLength}
50
+ {rest.value ? (rest.value as string).length : 0}/
51
+ {rest.maxLength}
55
52
  </span>
56
53
  )}
57
54
  {description && (
@@ -68,7 +65,6 @@ export const Email: React.FC<EmailProps> = ({
68
65
  )}
69
66
  <input
70
67
  type="email"
71
- ref={inputRef}
72
68
  className={`w-full px-4 border-default border rounded-md bg-secondary-bg placeholder:duration-300 placeholder:translate-x-0 focus:placeholder:translate-x-1 placeholder:text-silent focus:outline-none focus:ring-1 focus:ring-primary focus:shadow focus:shadow-primary focus:border-primary-dark disabled:bg-secondary-light disabled:text-disabled ${height}`}
73
69
  {...rest}
74
70
  />
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import React, { useState, useRef } from "react";
2
+ import React, { useState } from "react";
3
3
  import { Tooltip } from "../../../components";
4
4
  import { Icon } from "@iconify/react";
5
5
 
@@ -20,7 +20,6 @@ export const Password: React.FC<PasswordProps> = ({
20
20
  description,
21
21
  ...rest
22
22
  }) => {
23
- const inputRef = useRef<HTMLInputElement>(null);
24
23
  const [show, setShow] = useState(false);
25
24
  const width = options?.width === "fit" ? "w-fit" : "w-full";
26
25
  const height =
@@ -49,10 +48,8 @@ export const Password: React.FC<PasswordProps> = ({
49
48
  <div className="flex-1 flex justify-end items-center gap-2">
50
49
  {rest.maxLength && (
51
50
  <span className="text-sm select-none">
52
- {inputRef.current?.value
53
- ? (inputRef.current?.value as string).length
54
- : 0}
55
- /{rest.maxLength}
51
+ {rest.value ? (rest.value as string).length : 0}/
52
+ {rest.maxLength}
56
53
  </span>
57
54
  )}
58
55
  {description && (
@@ -70,7 +67,6 @@ export const Password: React.FC<PasswordProps> = ({
70
67
  <div className="relative flex items-center">
71
68
  <input
72
69
  type={show ? "text" : "password"}
73
- ref={inputRef}
74
70
  className={`w-full ps-4 pe-14 border-default border rounded-md bg-secondary-bg placeholder:duration-300 placeholder:translate-x-0 focus:placeholder:translate-x-1 placeholder:text-silent focus:outline-none focus:ring-1 focus:ring-primary focus:shadow focus:shadow-primary focus:border-primary-dark disabled:bg-secondary-light disabled:text-disabled ${height}`}
75
71
  {...rest}
76
72
  />
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import React, { useRef } from "react";
2
+ import React from "react";
3
3
  import { Tooltip } from "../../../components";
4
4
  import { Icon } from "@iconify/react";
5
5
 
@@ -19,7 +19,6 @@ export const Text: React.FC<TextProps> = ({
19
19
  description,
20
20
  ...rest
21
21
  }) => {
22
- const inputRef = useRef<HTMLInputElement>(null);
23
22
  const width = options?.width === "fit" ? "w-fit" : "w-full";
24
23
  const height =
25
24
  options?.height === "short"
@@ -47,10 +46,8 @@ export const Text: React.FC<TextProps> = ({
47
46
  <div className="flex-1 flex justify-end items-center gap-2">
48
47
  {rest.maxLength && (
49
48
  <span className="text-sm select-none">
50
- {inputRef.current?.value
51
- ? (inputRef.current?.value as string).length
52
- : 0}
53
- /{rest.maxLength}
49
+ {rest.value ? (rest.value as string).length : 0}/
50
+ {rest.maxLength}
54
51
  </span>
55
52
  )}
56
53
  {description && (
@@ -67,7 +64,6 @@ export const Text: React.FC<TextProps> = ({
67
64
  )}
68
65
  <input
69
66
  type="text"
70
- ref={inputRef}
71
67
  className={`w-full px-4 border-default border rounded-md bg-secondary-bg placeholder:duration-300 placeholder:translate-x-0 focus:placeholder:translate-x-1 placeholder:text-silent focus:outline-none focus:ring-1 focus:ring-primary focus:shadow focus:shadow-primary focus:border-primary-dark disabled:bg-secondary-light disabled:text-disabled ${height}`}
72
68
  {...rest}
73
69
  />
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import React, { useRef } from "react";
2
+ import React from "react";
3
3
  import { Tooltip } from "../../../components";
4
4
  import { Icon } from "@iconify/react";
5
5
 
@@ -20,7 +20,6 @@ export const Textarea: React.FC<TextareaProps> = ({
20
20
  description,
21
21
  ...rest
22
22
  }) => {
23
- const inputRef = useRef<HTMLTextAreaElement>(null);
24
23
  const width = options?.width === "fit" ? "w-fit" : "w-full";
25
24
  const height =
26
25
  options?.height === "short"
@@ -48,10 +47,8 @@ export const Textarea: React.FC<TextareaProps> = ({
48
47
  <div className="flex-1 flex justify-end items-center gap-2">
49
48
  {rest.maxLength && (
50
49
  <span className="text-sm select-none">
51
- {inputRef.current?.value
52
- ? (inputRef.current?.value as string).length
53
- : 0}
54
- /{rest.maxLength}
50
+ {rest.value ? (rest.value as string).length : 0}/
51
+ {rest.maxLength}
55
52
  </span>
56
53
  )}
57
54
  {description && (
@@ -68,7 +65,6 @@ export const Textarea: React.FC<TextareaProps> = ({
68
65
  )}
69
66
  <textarea
70
67
  rows={rest.rows || 10}
71
- ref={inputRef}
72
68
  className={`w-full px-4 border-default border rounded-md bg-secondary-bg placeholder:duration-300 placeholder:translate-x-0 focus:placeholder:translate-x-1 placeholder:text-silent focus:outline-none focus:ring-1 focus:ring-primary focus:shadow focus:shadow-primary focus:border-primary-dark disabled:bg-secondary-light disabled:text-disabled ${height}`}
73
69
  {...rest}
74
70
  />
@@ -184,42 +184,43 @@ export const Tooltip: React.FC<TooltipProps> = ({
184
184
  onMouseLeave={() => setVisible(false)}
185
185
  >
186
186
  {children}
187
- {createPortal(
188
- <div
189
- ref={tooltipRef}
190
- className={`absolute z-50 duration-200 transition-opacity ${
191
- visible ? "opacity-100" : "opacity-0 pointer-events-none"
192
- } ${options?.enableHover ? "" : "pointer-events-none"}`}
193
- style={getTooltipPosition()}
194
- >
195
- {position === "bottom" && (
196
- <div className="flex justify-center">
197
- <div style={getTooltipArrowPosition()}></div>
198
- </div>
199
- )}
200
- <div className="flex items-center">
201
- {position === "right" && (
187
+ {typeof document !== "undefined" &&
188
+ createPortal(
189
+ <div
190
+ ref={tooltipRef}
191
+ className={`absolute z-50 duration-200 transition-opacity ${
192
+ visible ? "opacity-100" : "opacity-0 pointer-events-none"
193
+ } ${options?.enableHover ? "" : "pointer-events-none"}`}
194
+ style={getTooltipPosition()}
195
+ >
196
+ {position === "bottom" && (
202
197
  <div className="flex justify-center">
203
198
  <div style={getTooltipArrowPosition()}></div>
204
199
  </div>
205
200
  )}
206
- <div className="max-w-96 w-fit px-3 py-1.5 rounded-md bg-black/75 text-sm text-white">
207
- {content}
201
+ <div className="flex items-center">
202
+ {position === "right" && (
203
+ <div className="flex justify-center">
204
+ <div style={getTooltipArrowPosition()}></div>
205
+ </div>
206
+ )}
207
+ <div className="max-w-96 w-fit px-3 py-1.5 rounded-md bg-black/75 text-sm text-white">
208
+ {content}
209
+ </div>
210
+ {position === "left" && (
211
+ <div className="flex justify-center">
212
+ <div style={getTooltipArrowPosition()}></div>
213
+ </div>
214
+ )}
208
215
  </div>
209
- {position === "left" && (
216
+ {position === "top" && (
210
217
  <div className="flex justify-center">
211
218
  <div style={getTooltipArrowPosition()}></div>
212
219
  </div>
213
220
  )}
214
- </div>
215
- {position === "top" && (
216
- <div className="flex justify-center">
217
- <div style={getTooltipArrowPosition()}></div>
218
- </div>
219
- )}
220
- </div>,
221
- document.body
222
- )}
221
+ </div>,
222
+ document.body
223
+ )}
223
224
  </div>
224
225
  );
225
226
  };