@dust-tt/sparkle 0.2.98-pr → 0.2.98
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,7 +1,7 @@
|
|
|
1
1
|
import React, { ComponentType, MouseEvent } from "react";
|
|
2
|
-
type TabType = {
|
|
2
|
+
type TabType<E> = {
|
|
3
3
|
label: string;
|
|
4
|
-
id?:
|
|
4
|
+
id?: E;
|
|
5
5
|
hideLabel?: boolean;
|
|
6
6
|
current: boolean;
|
|
7
7
|
sizing?: "hug" | "expand";
|
|
@@ -16,10 +16,10 @@ type TabType = {
|
|
|
16
16
|
onClick?: never;
|
|
17
17
|
href: string;
|
|
18
18
|
});
|
|
19
|
-
type TabProps = {
|
|
19
|
+
type TabProps<E> = {
|
|
20
20
|
variant?: "default" | "stepper";
|
|
21
|
-
tabs: Array<TabType
|
|
22
|
-
setCurrentTab?: (tabId:
|
|
21
|
+
tabs: Array<TabType<E>>;
|
|
22
|
+
setCurrentTab?: (tabId: E, e: MouseEvent<HTMLAnchorElement>) => void;
|
|
23
23
|
className?: string;
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
@@ -31,5 +31,5 @@ type TabProps = {
|
|
|
31
31
|
* - or globally, by providing a setCurrentTab function.
|
|
32
32
|
* Both per-tab and global actions can be set, the per-tab action taking precedence.
|
|
33
33
|
*/
|
|
34
|
-
export declare function Tab({ variant, tabs, setCurrentTab, className, }: TabProps): React.JSX.Element;
|
|
34
|
+
export declare function Tab<E>({ variant, tabs, setCurrentTab, className, }: TabProps<E>): React.JSX.Element;
|
|
35
35
|
export {};
|