@rovula/ui 0.0.56 → 0.0.57

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.
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import "./Tabs.css";
3
3
  type Tab = {
4
+ id?: string;
4
5
  label: string;
5
6
  startTabContent?: React.ReactElement;
6
7
  endTabContent?: React.ReactElement;
@@ -3,6 +3,7 @@ declare const meta: {
3
3
  title: string;
4
4
  component: React.FC<{
5
5
  tabs: {
6
+ id?: string | undefined;
6
7
  label: string;
7
8
  startTabContent?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
8
9
  endTabContent?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
@@ -38,6 +39,7 @@ declare const meta: {
38
39
  };
39
40
  decorators: ((Story: import("@storybook/types").PartialStoryFn<import("@storybook/react").ReactRenderer, {
40
41
  tabs: {
42
+ id?: string | undefined;
41
43
  label: string;
42
44
  startTabContent?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
43
45
  endTabContent?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
@@ -91,6 +91,6 @@ export interface TreeProps extends Pick<TreeItemProps, "renderIcon" | "renderRig
91
91
  hierarchicalCheck?: boolean;
92
92
  checkable?: boolean;
93
93
  maxLevel?: number;
94
- mode: "checkbox" | "radio";
94
+ mode?: "checkbox" | "radio";
95
95
  autoDisabled?: boolean;
96
96
  }
package/dist/index.d.ts CHANGED
@@ -106,6 +106,7 @@ type TextProps = {
106
106
  declare const Text: React__default.ForwardRefExoticComponent<TextProps & React__default.RefAttributes<unknown>>;
107
107
 
108
108
  type Tab = {
109
+ id?: string;
109
110
  label: string;
110
111
  startTabContent?: React__default.ReactElement;
111
112
  endTabContent?: React__default.ReactElement;
@@ -706,7 +707,7 @@ interface TreeProps extends Pick<TreeItemProps, "renderIcon" | "renderRightSecti
706
707
  hierarchicalCheck?: boolean;
707
708
  checkable?: boolean;
708
709
  maxLevel?: number;
709
- mode: "checkbox" | "radio";
710
+ mode?: "checkbox" | "radio";
710
711
  autoDisabled?: boolean;
711
712
  }
712
713
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rovula/ui",
3
- "version": "0.0.56",
3
+ "version": "0.0.57",
4
4
  "main": "dist/cjs/bundle.js",
5
5
  "module": "dist/esm/bundle.js",
6
6
  "types": "dist/index.d.ts",
@@ -6,6 +6,7 @@ import Icon from "../Icon/Icon";
6
6
  import { Loading } from "@/index";
7
7
 
8
8
  type Tab = {
9
+ id?: string;
9
10
  label: string;
10
11
  startTabContent?: React.ReactElement;
11
12
  endTabContent?: React.ReactElement;
@@ -232,7 +233,9 @@ const Tabs: React.FC<TabsProps> = ({
232
233
  id={`tab-content-${activeTab}`}
233
234
  aria-labelledby={`tab-${activeTab}`}
234
235
  >
235
- {tabs[activeTab]?.content}
236
+ <div key={tabs[activeTab].label + tabs[activeTab].id ?? Math.random()}>
237
+ {tabs[activeTab]?.content}
238
+ </div>
236
239
  </div>
237
240
  </div>
238
241
  );
@@ -30,7 +30,7 @@ const Tree: FC<TreeProps> = ({
30
30
  enableSeparatorLine = true,
31
31
  checkable = true,
32
32
  maxLevel,
33
- mode,
33
+ mode = "checkbox",
34
34
  autoDisabled = false,
35
35
  }) => {
36
36
  const [checkedState, setCheckedState] = useState<Record<string, boolean>>({});
@@ -109,7 +109,7 @@ export interface TreeProps
109
109
  hierarchicalCheck?: boolean;
110
110
  checkable?: boolean;
111
111
  maxLevel?: number;
112
- mode: "checkbox" | "radio";
112
+ mode?: "checkbox" | "radio";
113
113
  // Only radio mode
114
114
  autoDisabled?: boolean;
115
115
  }