next-helios-fe 1.8.92 → 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 }}
|