@dust-tt/sparkle 0.2.200 → 0.2.201

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.2.200",
3
+ "version": "0.2.201",
4
4
  "scripts": {
5
5
  "build": "rm -rf dist && rollup -c",
6
6
  "build:with-tw-base": "rollup -c --environment INCLUDE_TW_BASE:true",
@@ -12,13 +12,14 @@ import { Icon } from "./Icon";
12
12
  import { Tooltip } from "./Tooltip";
13
13
 
14
14
  type TabType<E> = {
15
- label: string;
16
- id?: E;
17
- hideLabel?: boolean;
18
15
  current: boolean;
19
- sizing?: "hug" | "expand";
20
- icon?: ComponentType<{ className?: string }>;
16
+ disabled?: boolean;
21
17
  hasSeparator?: boolean;
18
+ hideLabel?: boolean;
19
+ icon?: ComponentType<{ className?: string }>;
20
+ id?: E;
21
+ label: string;
22
+ sizing?: "hug" | "expand";
22
23
  } & (
23
24
  | { onClick?: (event: MouseEvent<HTMLAnchorElement>) => void; href?: never }
24
25
  | { onClick?: never; href: string }
@@ -137,7 +138,8 @@ export function Tab<E>({
137
138
  tabStateClasses.hover,
138
139
  tabStateClasses.dark.base,
139
140
  tabStateClasses.dark.hover,
140
- tabClassName
141
+ tabClassName,
142
+ tab.disabled ? "s-opacity-50 s-pointer-events-none" : ""
141
143
  );
142
144
 
143
145
  const finalIconClasses = classNames(
@@ -41,7 +41,15 @@ export const TabExample = () => {
41
41
  current: currentTab === "build",
42
42
  icon: RobotIcon,
43
43
  sizing: "expand",
44
+ },
45
+ {
46
+ label: "Admin",
47
+ id: "admin",
48
+ current: currentTab === "admin",
49
+ icon: RobotIcon,
50
+ sizing: "expand",
44
51
  hasSeparator: true,
52
+ disabled: true,
45
53
  },
46
54
  {
47
55
  label: "Settings",