next-helios-fe 1.6.24 → 1.6.26
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/components/form/input/color.d.ts +2 -1
- package/dist/components/form/input/date.d.ts +1 -0
- package/dist/components/form/input/email.d.ts +2 -1
- package/dist/components/form/input/file.d.ts +2 -1
- package/dist/components/form/input/number.d.ts +2 -1
- package/dist/components/form/input/password.d.ts +2 -1
- package/dist/components/form/input/range.d.ts +3 -2
- package/dist/components/form/input/text.d.ts +2 -1
- package/dist/components/form/input/time.d.ts +2 -1
- package/dist/components/form/other/autocomplete.d.ts +6 -5
- package/dist/components/form/other/multipleSelect.d.ts +6 -5
- package/dist/components/form/other/phoneNumber.d.ts +2 -1
- package/dist/components/form/other/pin.d.ts +2 -1
- package/dist/components/form/other/secret.d.ts +2 -1
- package/dist/components/form/other/select.d.ts +6 -5
- package/dist/components/form/other/textarea.d.ts +2 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/form/input/color.tsx +20 -10
- package/src/components/form/input/date.tsx +24 -11
- package/src/components/form/input/email.tsx +33 -11
- package/src/components/form/input/file.tsx +34 -11
- package/src/components/form/input/number.tsx +47 -11
- package/src/components/form/input/password.tsx +27 -10
- package/src/components/form/input/range.tsx +34 -16
- package/src/components/form/input/text.tsx +33 -11
- package/src/components/form/input/time.tsx +25 -12
- package/src/components/form/other/autocomplete.tsx +27 -17
- package/src/components/form/other/multipleSelect.tsx +26 -16
- package/src/components/form/other/phoneNumber.tsx +21 -10
- package/src/components/form/other/pin.tsx +21 -10
- package/src/components/form/other/secret.tsx +20 -10
- package/src/components/form/other/select.tsx +24 -15
- package/src/components/form/other/textarea.tsx +28 -10
@@ -1,28 +1,30 @@
|
|
1
1
|
"use client";
|
2
2
|
import React, { useState, useEffect, useRef } from "react";
|
3
|
-
import { Icon } from "@iconify/react";
|
4
3
|
import { createPortal } from "react-dom";
|
4
|
+
import { Icon } from "@iconify/react";
|
5
5
|
|
6
6
|
export interface AutocompleteProps
|
7
7
|
extends React.SelectHTMLAttributes<HTMLSelectElement> {
|
8
|
-
options?: {
|
9
|
-
width?: "full" | "fit";
|
10
|
-
height?: "short" | "medium" | "high";
|
11
|
-
};
|
12
|
-
label?: string;
|
13
8
|
menus: {
|
14
9
|
label: string;
|
15
10
|
value: string;
|
16
11
|
[key: string]: any;
|
17
12
|
}[];
|
13
|
+
label?: string;
|
18
14
|
placeholder?: string;
|
15
|
+
description?: string;
|
16
|
+
options?: {
|
17
|
+
width?: "full" | "fit";
|
18
|
+
height?: "short" | "medium" | "high";
|
19
|
+
};
|
19
20
|
}
|
20
21
|
|
21
22
|
export const Autocomplete: React.FC<AutocompleteProps> = ({
|
22
|
-
options,
|
23
|
-
label,
|
24
23
|
menus,
|
24
|
+
label,
|
25
25
|
placeholder,
|
26
|
+
description,
|
27
|
+
options,
|
26
28
|
...rest
|
27
29
|
}) => {
|
28
30
|
const [tempValue, setTempValue] = useState("");
|
@@ -116,15 +118,23 @@ export const Autocomplete: React.FC<AutocompleteProps> = ({
|
|
116
118
|
|
117
119
|
return (
|
118
120
|
<label className={`grid gap-2 ${width}`}>
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
121
|
+
<div className="flex justify-between items-center">
|
122
|
+
{label && (
|
123
|
+
<span
|
124
|
+
className={`text-sm select-none ${
|
125
|
+
rest.required &&
|
126
|
+
"after:content-['*'] after:ml-1 after:text-danger"
|
127
|
+
}`}
|
128
|
+
>
|
129
|
+
{label}
|
130
|
+
</span>
|
131
|
+
)}
|
132
|
+
{description && (
|
133
|
+
<span title={description} className="text-sm text-primary-dark">
|
134
|
+
<Icon icon="octicon:info-16" />
|
135
|
+
</span>
|
136
|
+
)}
|
137
|
+
</div>
|
128
138
|
<div className="relative" ref={triggerRef}>
|
129
139
|
<div
|
130
140
|
className="relative flex items-center cursor-pointer"
|
@@ -5,17 +5,18 @@ import { Icon } from "@iconify/react";
|
|
5
5
|
|
6
6
|
export interface MultipleSelectProps
|
7
7
|
extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange" | "value"> {
|
8
|
-
options?: {
|
9
|
-
width?: "full" | "fit";
|
10
|
-
height?: "short" | "medium" | "high";
|
11
|
-
};
|
12
|
-
label?: string;
|
13
8
|
menus: {
|
14
9
|
label: string;
|
15
10
|
value: string;
|
16
11
|
[key: string]: any;
|
17
12
|
}[];
|
13
|
+
label?: string;
|
18
14
|
placeholder?: string;
|
15
|
+
description?: string;
|
16
|
+
options?: {
|
17
|
+
width?: "full" | "fit";
|
18
|
+
height?: "short" | "medium" | "high";
|
19
|
+
};
|
19
20
|
required?: boolean;
|
20
21
|
disabled?: boolean;
|
21
22
|
value?: string[];
|
@@ -32,6 +33,7 @@ export const MultipleSelect: React.FC<MultipleSelectProps> = ({
|
|
32
33
|
label,
|
33
34
|
menus,
|
34
35
|
placeholder,
|
36
|
+
description,
|
35
37
|
required,
|
36
38
|
disabled,
|
37
39
|
value,
|
@@ -78,19 +80,27 @@ export const MultipleSelect: React.FC<MultipleSelectProps> = ({
|
|
78
80
|
return (
|
79
81
|
<div className="flex flex-row-reverse items-end">
|
80
82
|
<label className={`grid gap-2 ${width}`}>
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
83
|
+
<div className="flex justify-between items-center">
|
84
|
+
{label && (
|
85
|
+
<span
|
86
|
+
className={`text-sm select-none ${
|
87
|
+
required &&
|
88
|
+
"after:content-['*'] after:ml-1 after:text-danger"
|
89
|
+
}`}
|
90
|
+
>
|
91
|
+
{label}
|
92
|
+
</span>
|
93
|
+
)}
|
94
|
+
{description && (
|
95
|
+
<span title={description} className="text-sm text-primary-dark">
|
96
|
+
<Icon icon="octicon:info-16" />
|
97
|
+
</span>
|
98
|
+
)}
|
99
|
+
</div>
|
90
100
|
<div className="relative flex items-center">
|
91
101
|
<div
|
92
102
|
ref={inputRef}
|
93
|
-
className={`group/button flex justify-between items-center gap-2 w-full min-h-10
|
103
|
+
className={`group/button flex justify-between items-center gap-2 w-full min-h-10 px-4 border rounded-md caret-transparent focus:outline-none focus:ring-1 focus:ring-primary focus:shadow focus:shadow-primary focus:border-primary-dark ${height} ${
|
94
104
|
disabled
|
95
105
|
? "bg-secondary-light cursor-default pointer-events-none"
|
96
106
|
: "bg-secondary-bg cursor-pointer"
|
@@ -209,7 +219,7 @@ export const MultipleSelect: React.FC<MultipleSelectProps> = ({
|
|
209
219
|
<button
|
210
220
|
key={index}
|
211
221
|
type="button"
|
212
|
-
className="min-w-40 w-full my-0.5
|
222
|
+
className="min-w-40 w-full my-0.5 ps-4 pe-14 py-2 rounded-md text-sm text-left text-default hover:bg-secondary-light disabled:bg-primary-transparent"
|
213
223
|
disabled={
|
214
224
|
tempValue?.find((i) => i === item.value) ? true : false
|
215
225
|
}
|
@@ -1,14 +1,16 @@
|
|
1
1
|
"use client";
|
2
2
|
import React, { useState, useEffect, useRef } from "react";
|
3
3
|
import { createPortal } from "react-dom";
|
4
|
+
import { Icon } from "@iconify/react";
|
4
5
|
|
5
6
|
export interface PhoneNumberProps
|
6
7
|
extends React.InputHTMLAttributes<HTMLInputElement> {
|
8
|
+
label?: string;
|
9
|
+
description?: string;
|
7
10
|
options?: {
|
8
11
|
width?: "full" | "fit";
|
9
12
|
height?: "short" | "medium" | "high";
|
10
13
|
};
|
11
|
-
label?: string;
|
12
14
|
getPhoneNumber?: (value: string) => void;
|
13
15
|
}
|
14
16
|
|
@@ -1470,6 +1472,7 @@ const countryCodes = [
|
|
1470
1472
|
export const PhoneNumber: React.FC<PhoneNumberProps> = ({
|
1471
1473
|
options,
|
1472
1474
|
label,
|
1475
|
+
description,
|
1473
1476
|
getPhoneNumber,
|
1474
1477
|
...rest
|
1475
1478
|
}) => {
|
@@ -1567,15 +1570,23 @@ export const PhoneNumber: React.FC<PhoneNumberProps> = ({
|
|
1567
1570
|
|
1568
1571
|
return (
|
1569
1572
|
<label className={`grid gap-2 ${width}`}>
|
1570
|
-
|
1571
|
-
|
1572
|
-
|
1573
|
-
|
1574
|
-
|
1575
|
-
|
1576
|
-
|
1577
|
-
|
1578
|
-
|
1573
|
+
<div className="flex justify-between items-center">
|
1574
|
+
{label && (
|
1575
|
+
<span
|
1576
|
+
className={`text-sm select-none ${
|
1577
|
+
rest.required &&
|
1578
|
+
"after:content-['*'] after:ml-1 after:text-danger"
|
1579
|
+
}`}
|
1580
|
+
>
|
1581
|
+
{label}
|
1582
|
+
</span>
|
1583
|
+
)}
|
1584
|
+
{description && (
|
1585
|
+
<span title={description} className="text-sm text-primary-dark">
|
1586
|
+
<Icon icon="octicon:info-16" />
|
1587
|
+
</span>
|
1588
|
+
)}
|
1589
|
+
</div>
|
1579
1590
|
<div className="flex flex-row-reverse gap-4">
|
1580
1591
|
<div className="relative flex-1 flex items-center">
|
1581
1592
|
<div className="absolute left-0 flex justify-center w-14 border-r">
|
@@ -1,19 +1,22 @@
|
|
1
1
|
"use client";
|
2
2
|
import React from "react";
|
3
3
|
import { PinField } from "react-pin-field";
|
4
|
+
import { Icon } from "@iconify/react";
|
4
5
|
|
5
6
|
export interface PinProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
7
|
+
label?: string;
|
8
|
+
description?: string;
|
6
9
|
options?: {
|
7
10
|
height?: "short" | "medium" | "high";
|
8
11
|
length: number;
|
9
12
|
};
|
10
|
-
label?: string;
|
11
13
|
onChange?: (e: any) => void;
|
12
14
|
}
|
13
15
|
|
14
16
|
export const Pin: React.FC<PinProps> = ({
|
15
17
|
options,
|
16
18
|
label,
|
19
|
+
description,
|
17
20
|
onChange,
|
18
21
|
...rest
|
19
22
|
}) => {
|
@@ -26,15 +29,23 @@ export const Pin: React.FC<PinProps> = ({
|
|
26
29
|
|
27
30
|
return (
|
28
31
|
<label className="grid gap-2 w-fit">
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
32
|
+
<div className="flex justify-between items-center">
|
33
|
+
{label && (
|
34
|
+
<span
|
35
|
+
className={`text-sm select-none ${
|
36
|
+
rest.required &&
|
37
|
+
"after:content-['*'] after:ml-1 after:text-danger"
|
38
|
+
}`}
|
39
|
+
>
|
40
|
+
{label}
|
41
|
+
</span>
|
42
|
+
)}
|
43
|
+
{description && (
|
44
|
+
<span title={description} className="text-sm text-primary-dark">
|
45
|
+
<Icon icon="octicon:info-16" />
|
46
|
+
</span>
|
47
|
+
)}
|
48
|
+
</div>
|
38
49
|
<div className="flex items-center gap-4">
|
39
50
|
<PinField
|
40
51
|
className={`text-center w-10 border-default border rounded-md bg-secondary-bg placeholder:duration-300 placeholder:translate-x-0 focus:placeholder:translate-x-1 placeholder:text-slate-300 focus:outline-none focus:ring-1 focus:ring-primary focus:shadow focus:shadow-primary focus:border-primary-dark disabled:bg-secondary-light disabled:text-slate-400 ${height}`}
|
@@ -4,11 +4,12 @@ import { Icon } from "@iconify/react";
|
|
4
4
|
|
5
5
|
export interface SecretProps
|
6
6
|
extends React.InputHTMLAttributes<HTMLInputElement> {
|
7
|
+
label?: string;
|
8
|
+
description?: string;
|
7
9
|
options?: {
|
8
10
|
width?: "full" | "fit";
|
9
11
|
height?: "short" | "medium" | "high";
|
10
12
|
};
|
11
|
-
label?: string;
|
12
13
|
value?: string;
|
13
14
|
onClipboardClick?: (value: string) => void;
|
14
15
|
}
|
@@ -16,6 +17,7 @@ export interface SecretProps
|
|
16
17
|
export const Secret: React.FC<SecretProps> = ({
|
17
18
|
options,
|
18
19
|
label,
|
20
|
+
description,
|
19
21
|
value,
|
20
22
|
onClipboardClick,
|
21
23
|
...rest
|
@@ -31,15 +33,23 @@ export const Secret: React.FC<SecretProps> = ({
|
|
31
33
|
|
32
34
|
return (
|
33
35
|
<label className={`grid gap-2 ${width}`}>
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
36
|
+
<div className="flex justify-between items-center">
|
37
|
+
{label && (
|
38
|
+
<span
|
39
|
+
className={`text-sm select-none ${
|
40
|
+
rest.required &&
|
41
|
+
"after:content-['*'] after:ml-1 after:text-danger"
|
42
|
+
}`}
|
43
|
+
>
|
44
|
+
{label}
|
45
|
+
</span>
|
46
|
+
)}
|
47
|
+
{description && (
|
48
|
+
<span title={description} className="text-sm text-primary-dark">
|
49
|
+
<Icon icon="octicon:info-16" />
|
50
|
+
</span>
|
51
|
+
)}
|
52
|
+
</div>
|
43
53
|
<div className="relative flex items-center">
|
44
54
|
<input
|
45
55
|
type="text"
|
@@ -5,17 +5,18 @@ import { Icon } from "@iconify/react";
|
|
5
5
|
|
6
6
|
export interface SelectProps
|
7
7
|
extends React.SelectHTMLAttributes<HTMLSelectElement> {
|
8
|
-
options?: {
|
9
|
-
width?: "full" | "fit";
|
10
|
-
height?: "short" | "medium" | "high";
|
11
|
-
};
|
12
|
-
label?: string;
|
13
8
|
menus: {
|
14
9
|
label: string;
|
15
10
|
value: string;
|
16
11
|
[key: string]: any;
|
17
12
|
}[];
|
13
|
+
label?: string;
|
18
14
|
placeholder?: string;
|
15
|
+
description?: string;
|
16
|
+
options?: {
|
17
|
+
width?: "full" | "fit";
|
18
|
+
height?: "short" | "medium" | "high";
|
19
|
+
};
|
19
20
|
}
|
20
21
|
|
21
22
|
export const Select: React.FC<SelectProps> = ({
|
@@ -23,6 +24,7 @@ export const Select: React.FC<SelectProps> = ({
|
|
23
24
|
label,
|
24
25
|
menus,
|
25
26
|
placeholder,
|
27
|
+
description,
|
26
28
|
...rest
|
27
29
|
}) => {
|
28
30
|
const [tempValue, setTempValue] = useState("");
|
@@ -68,16 +70,23 @@ export const Select: React.FC<SelectProps> = ({
|
|
68
70
|
return (
|
69
71
|
<div className="flex flex-row-reverse items-end">
|
70
72
|
<label className={`grid gap-2 ${width}`}>
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
73
|
+
<div className="flex justify-between items-center">
|
74
|
+
{label && (
|
75
|
+
<span
|
76
|
+
className={`text-sm select-none ${
|
77
|
+
rest.required &&
|
78
|
+
"after:content-['*'] after:ml-1 after:text-danger"
|
79
|
+
}`}
|
80
|
+
>
|
81
|
+
{label}
|
82
|
+
</span>
|
83
|
+
)}
|
84
|
+
{description && (
|
85
|
+
<span title={description} className="text-sm text-primary-dark">
|
86
|
+
<Icon icon="octicon:info-16" />
|
87
|
+
</span>
|
88
|
+
)}
|
89
|
+
</div>
|
81
90
|
<div className="relative flex items-center cursor-pointer">
|
82
91
|
<input
|
83
92
|
ref={inputRef}
|
@@ -1,18 +1,21 @@
|
|
1
1
|
"use client";
|
2
2
|
import React from "react";
|
3
|
+
import { Icon } from "@iconify/react";
|
3
4
|
|
4
5
|
export interface TextareaProps
|
5
6
|
extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
7
|
+
label?: string;
|
8
|
+
description?: string;
|
6
9
|
options?: {
|
7
10
|
width?: "full" | "fit";
|
8
11
|
height?: "short" | "medium" | "high";
|
9
12
|
};
|
10
|
-
label?: string;
|
11
13
|
}
|
12
14
|
|
13
15
|
export const Textarea: React.FC<TextareaProps> = ({
|
14
16
|
options,
|
15
17
|
label,
|
18
|
+
description,
|
16
19
|
...rest
|
17
20
|
}) => {
|
18
21
|
const width = options?.width === "fit" ? "w-fit" : "w-full";
|
@@ -25,15 +28,30 @@ export const Textarea: React.FC<TextareaProps> = ({
|
|
25
28
|
|
26
29
|
return (
|
27
30
|
<label className={`grid gap-2 ${width}`}>
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
31
|
+
<div className="flex justify-between">
|
32
|
+
{label && (
|
33
|
+
<span
|
34
|
+
className={`text-sm select-none ${
|
35
|
+
rest.required &&
|
36
|
+
"after:content-['*'] after:ml-1 after:text-danger"
|
37
|
+
}`}
|
38
|
+
>
|
39
|
+
{label}
|
40
|
+
</span>
|
41
|
+
)}
|
42
|
+
<div className="flex items-center gap-2">
|
43
|
+
{(rest.minLength || rest.maxLength) && (
|
44
|
+
<span className="text-sm select-none">
|
45
|
+
{rest.minLength || 0}/{rest.maxLength || "∞"}
|
46
|
+
</span>
|
47
|
+
)}
|
48
|
+
{description && (
|
49
|
+
<span title={description} className="text-sm text-primary-dark">
|
50
|
+
<Icon icon="octicon:info-16" />
|
51
|
+
</span>
|
52
|
+
)}
|
53
|
+
</div>
|
54
|
+
</div>
|
37
55
|
<textarea
|
38
56
|
rows={rest.rows || 10}
|
39
57
|
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-slate-300 focus:outline-none focus:ring-1 focus:ring-primary focus:shadow focus:shadow-primary focus:border-primary-dark disabled:bg-secondary-light disabled:text-slate-400 ${height}`}
|