@dust-tt/sparkle 0.1.2 → 0.1.3

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": "@dust-tt/sparkle",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "scripts": {
5
5
  "build": "rollup -c"
6
6
  },
@@ -7,18 +7,17 @@ type TabProps = {
7
7
  tabs: Array<{
8
8
  label: string;
9
9
  hideLabel?: boolean;
10
- href: string;
11
10
  current: boolean;
12
11
  sizing?: "hug" | "expand";
13
12
  icon?: ReactComponentLike;
14
13
  }>;
15
- onTabClick?: (tabName: string, event: MouseEvent<HTMLAnchorElement>) => void;
14
+ onTabClick?: (tabName: string, event: MouseEvent<HTMLDivElement>) => void;
16
15
  className?: string;
17
16
  };
18
17
 
19
18
  const tabClasses = {
20
19
  default: {
21
- base: "text-element-800 border-transparent",
20
+ base: "text-element-800 border-transparent cursor-pointer",
22
21
  hover: "hover:text-action-600",
23
22
  dark: {
24
23
  base: "dark:text-element-800-dark",
@@ -85,16 +84,15 @@ export function Tab({ tabs, onTabClick, className = "" }: TabProps) {
85
84
  );
86
85
 
87
86
  return (
88
- <a
87
+ <div
89
88
  key={tab.label}
90
- href={tab.href}
91
89
  className={finalTabClasses}
92
90
  aria-current={tab.current ? "page" : undefined}
93
91
  onClick={(event) => onTabClick?.(tab.label, event)}
94
92
  >
95
93
  {tab.icon && <tab.icon className={finalIconClasses} />}
96
94
  {tab.hideLabel ?? tab.label}
97
- </a>
95
+ </div>
98
96
  );
99
97
  });
100
98