next-helios-fe 1.8.41 → 1.8.43

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.41",
3
+ "version": "1.8.43",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -43,10 +43,10 @@ export const Button: React.FC<ButtonProps> = ({
43
43
  ? "text-white bg-warning shadow-sm shadow-warning hover:bg-warning-dark disabled:bg-secondary-dark disabled:shadow-secondary-dark"
44
44
  : options?.variant === "danger"
45
45
  ? "text-white bg-danger shadow-sm shadow-danger hover:bg-danger-dark disabled:bg-secondary-dark disabled:shadow-secondary-dark"
46
- : `text-default hover:bg-secondary-light disabled:shadow-sm disabled:text-white ${
46
+ : `text-default hover:bg-secondary-light ${
47
47
  loading
48
- ? "disabled:bg-secondary-dark disabled:shadow-secondary-dark"
49
- : "disabled:bg-primary disabled:shadow-primary"
48
+ ? ""
49
+ : "disabled:bg-primary disabled:text-white disabled:shadow-sm disabled:shadow-primary"
50
50
  }`;
51
51
  const width = options?.width === "fit" ? "w-fit" : "w-full";
52
52
  const height =
@@ -35,19 +35,6 @@ export const Tab: TabComponent = ({
35
35
  });
36
36
  const [activeTab, setActiveTab] = useState(0);
37
37
 
38
- useEffect(() => {
39
- if (tabs.length === 1) {
40
- setActiveTab(0);
41
- }
42
-
43
- if (onChangeTab) {
44
- onChangeTab({
45
- index: activeTab,
46
- title: tabs[activeTab].title,
47
- });
48
- }
49
- }, [tabs, activeTab]);
50
-
51
38
  return (
52
39
  <div
53
40
  className={`flex w-full h-full overlow-hidden ${
@@ -115,6 +102,13 @@ export const Tab: TabComponent = ({
115
102
  }`}
116
103
  onClick={() => {
117
104
  setActiveTab(index);
105
+
106
+ if (onChangeTab) {
107
+ onChangeTab({
108
+ index: index,
109
+ title: tabs[index].title,
110
+ });
111
+ }
118
112
  }}
119
113
  >
120
114
  {tab?.icon && <Icon icon={tab?.icon} className="text-lg" />}