next-helios-fe 1.8.91 → 1.8.93
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
@@ -84,17 +84,25 @@ export const Dialog: React.FC<DialogProps> = ({
|
|
84
84
|
<div className="flex justify-end gap-4">
|
85
85
|
<button
|
86
86
|
type="button"
|
87
|
-
className={`disabled:text-disabled disabled:pointer-events-none ${actionVariant}`}
|
87
|
+
className={`flex gap-1 items-center disabled:text-disabled disabled:pointer-events-none ${actionVariant}`}
|
88
88
|
disabled={loading}
|
89
89
|
onClick={() => {
|
90
90
|
action.onClick && action.onClick();
|
91
91
|
}}
|
92
92
|
>
|
93
|
-
{
|
93
|
+
{loading ? (
|
94
|
+
<Icon
|
95
|
+
icon="mingcute:loading-fill"
|
96
|
+
className="animate-spin text-lg"
|
97
|
+
/>
|
98
|
+
) : (
|
99
|
+
action.label
|
100
|
+
)}
|
94
101
|
</button>
|
95
102
|
<button
|
96
103
|
type="button"
|
97
|
-
className="text-secondary hover:text-secondary-dark hover:underline"
|
104
|
+
className="text-secondary hover:text-secondary-dark hover:underline disabled:text-disabled disabled:pointer-events-none"
|
105
|
+
disabled={loading}
|
98
106
|
onClick={() => {
|
99
107
|
onClose && onClose();
|
100
108
|
}}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
"use client";
|
2
|
-
import React from "react";
|
2
|
+
import React, { useEffect, useRef } from "react";
|
3
3
|
import { Tooltip } from "../../../components";
|
4
4
|
import { Icon } from "@iconify/react";
|
5
5
|
|
@@ -11,6 +11,7 @@ export interface CheckboxProps
|
|
11
11
|
};
|
12
12
|
label?: string;
|
13
13
|
description?: string;
|
14
|
+
indeterminate?: boolean;
|
14
15
|
theme?: string;
|
15
16
|
}
|
16
17
|
|
@@ -19,8 +20,15 @@ export const Checkbox: React.FC<CheckboxProps> = ({
|
|
19
20
|
label,
|
20
21
|
description,
|
21
22
|
theme,
|
23
|
+
indeterminate,
|
22
24
|
...rest
|
23
25
|
}) => {
|
26
|
+
const inputRef = useRef<HTMLInputElement>(null);
|
27
|
+
|
28
|
+
useEffect(() => {
|
29
|
+
inputRef.current!.indeterminate = indeterminate ?? false;
|
30
|
+
}, [inputRef, indeterminate]);
|
31
|
+
|
24
32
|
return (
|
25
33
|
<label
|
26
34
|
className={`group/checkbox flex items-center ${
|
@@ -36,8 +44,9 @@ export const Checkbox: React.FC<CheckboxProps> = ({
|
|
36
44
|
} ${options?.variant === "switch" && "hidden"}`}
|
37
45
|
>
|
38
46
|
<input
|
47
|
+
ref={inputRef}
|
39
48
|
type="checkbox"
|
40
|
-
className={`border-default border rounded bg-secondary-bg cursor-pointer checked:bg-primary focus:outline-none focus:ring-0 focus:ring-offset-0 disabled:bg-secondary-light disabled:checked:bg-secondary-dark disabled:cursor-default ${
|
49
|
+
className={`border-default border rounded bg-secondary-bg cursor-pointer indeterminate:bg-primary indeterminate:hover:bg-primary checked:bg-primary focus:outline-none focus:ring-0 focus:ring-offset-0 disabled:bg-secondary-light disabled:checked:bg-secondary-dark disabled:cursor-default ${
|
41
50
|
theme && "border-0"
|
42
51
|
}`}
|
43
52
|
style={{ backgroundColor: theme }}
|
@@ -211,9 +211,11 @@ export const File: React.FC<FileProps> = ({
|
|
211
211
|
}`}
|
212
212
|
/>
|
213
213
|
</div>
|
214
|
-
<div className="flex flex-col gap-2 items-center">
|
214
|
+
<div className="flex flex-col gap-2 items-center w-full">
|
215
215
|
{tempFile.length !== 0 ? (
|
216
|
-
<span>
|
216
|
+
<span className="w-full text-center truncate whitespace-nowrap">
|
217
|
+
{tempFile[0]?.name}
|
218
|
+
</span>
|
217
219
|
) : (
|
218
220
|
<div className="flex gap-2 text-disabled">
|
219
221
|
<span className="underline underline-offset-2">
|
@@ -231,8 +233,8 @@ export const File: React.FC<FileProps> = ({
|
|
231
233
|
{tempFile.length !== 0
|
232
234
|
? `${
|
233
235
|
tempFile[0]?.size < 1000000
|
234
|
-
? `${tempFile[0]?.size / 1000} KB`
|
235
|
-
: `${tempFile[0]?.size / 1000000} MB`
|
236
|
+
? `${(tempFile[0]?.size / 1000).toFixed(2)} KB`
|
237
|
+
: `${(tempFile[0]?.size / 1000000).toFixed(2)} MB`
|
236
238
|
}`
|
237
239
|
: `Maximum file size ${options?.maxSizeInMb} MB`}
|
238
240
|
</span>
|