@dust-tt/sparkle 0.2.38 → 0.2.39-beta

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,4 +1,3 @@
1
- import type { StoryObj } from "@storybook/react";
2
1
  import React from "react";
3
2
  import { Item } from "../index_with_tw_base";
4
3
  declare const meta: {
@@ -6,9 +5,4 @@ declare const meta: {
6
5
  component: typeof Item;
7
6
  };
8
7
  export default meta;
9
- type Story = StoryObj<typeof meta>;
10
8
  export declare const ListItemExample: () => React.JSX.Element;
11
- export declare const ItemMD: Story;
12
- export declare const ItemSM: Story;
13
- export declare const ItemWithoutIcon: Story;
14
- export declare const ItemWithVisual: Story;
@@ -8,8 +8,10 @@ type AvatarProps = {
8
8
  busy?: boolean;
9
9
  isRounded?: boolean;
10
10
  backgroundColor?: string;
11
+ className?: string;
12
+ disabled?: boolean;
11
13
  };
12
- export declare function Avatar({ size, name, visual, onClick, clickable, busy, isRounded, backgroundColor, }: AvatarProps): React.JSX.Element;
14
+ export declare function Avatar({ size, name, visual, onClick, clickable, busy, isRounded, backgroundColor, disabled, className, }: AvatarProps): React.JSX.Element;
13
15
  export declare namespace Avatar {
14
16
  var Stack: ({ children, nbMoreItems, size, isRounded, hasMagnifier, }: AvatarStackProps) => React.JSX.Element;
15
17
  }
@@ -7,7 +7,7 @@ export interface DropdownMenuProps {
7
7
  export declare function DropdownMenu({ children, className }: DropdownMenuProps): React.JSX.Element;
8
8
  export declare namespace DropdownMenu {
9
9
  var Button: ({ label, type, tooltip, icon, children, tooltipPosition, className, disabled, }: DropdownButtonProps) => React.JSX.Element;
10
- var Item: ({ label, href, disabled, visual, onClick, }: DropdownItemProps) => React.JSX.Element;
10
+ var Item: ({ label, description, href, disabled, visual, icon, onClick, }: DropdownItemProps) => React.JSX.Element;
11
11
  var Items: ({ origin, width, children, }: DropdownItemsProps) => React.JSX.Element;
12
12
  }
13
13
  export interface DropdownButtonProps {
@@ -22,9 +22,11 @@ export interface DropdownButtonProps {
22
22
  }
23
23
  interface DropdownItemProps {
24
24
  label: string;
25
+ description?: string;
25
26
  href?: string;
26
27
  disabled?: boolean;
27
28
  visual?: string | React.ReactNode;
29
+ icon?: ComponentType;
28
30
  onClick?: () => void;
29
31
  }
30
32
  interface DropdownItemsProps {
@@ -1,27 +1,73 @@
1
1
  import React, { ComponentType, MouseEvent, ReactNode } from "react";
2
2
  type ItemProps = {
3
3
  onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
4
- size?: "sm" | "md";
5
- variant?: "default" | "dropdown";
4
+ style: "action" | "item";
5
+ spacing?: "sm" | "md";
6
+ selectable?: boolean;
6
7
  selected?: boolean;
7
8
  disabled?: boolean;
8
9
  label: string;
9
- icon?: ComponentType;
10
+ description?: string;
10
11
  visual?: string | React.ReactNode;
12
+ icon?: ComponentType;
13
+ action?: ComponentType;
14
+ hasAction?: boolean | "hover";
11
15
  className?: string;
12
16
  href?: string;
13
17
  };
14
- export declare function Item({ onClick, selected, size, disabled, variant, label, icon, visual, className, href, }: ItemProps): React.JSX.Element;
18
+ export declare function Item({ label, description, visual, icon, style, spacing, action, hasAction, onClick, selected, disabled, className, href, }: ItemProps): React.JSX.Element;
15
19
  export declare namespace Item {
20
+ var Entry: (props: EntryItemProps) => React.JSX.Element;
21
+ var Avatar: ({ description, ...otherProps }: AvatarItemProps) => React.JSX.Element;
22
+ var Navigation: (props: NavigationListItemProps) => React.JSX.Element;
23
+ var Dropdown: (props: DropdownListItemProps) => React.JSX.Element;
16
24
  var SectionHeader: ({ label, variant, }: ItemSectionHeaderProps) => React.JSX.Element;
17
25
  var List: ({ children, className }: ListItemProps) => React.JSX.Element;
18
26
  }
19
- interface ItemSectionHeaderProps {
27
+ interface EntryItemProps {
28
+ onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
29
+ disabled?: boolean;
30
+ selected?: boolean;
20
31
  label: string;
21
- variant?: "primary" | "secondary";
32
+ icon?: ComponentType;
33
+ className?: string;
34
+ href?: string;
35
+ }
36
+ interface AvatarItemProps {
37
+ onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
38
+ disabled?: boolean;
39
+ label: string;
40
+ description?: string;
41
+ visual?: string | React.ReactNode;
42
+ className?: string;
43
+ href?: string;
44
+ }
45
+ interface NavigationListItemProps {
46
+ onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
47
+ selected?: boolean;
48
+ disabled?: boolean;
49
+ label: string;
50
+ description?: string;
51
+ icon?: ComponentType;
52
+ className?: string;
53
+ href?: string;
54
+ }
55
+ interface DropdownListItemProps {
56
+ onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
57
+ disabled?: boolean;
58
+ label: string;
59
+ description?: string;
60
+ visual?: string | React.ReactNode;
61
+ icon?: ComponentType;
62
+ className?: string;
63
+ href?: string;
22
64
  }
23
65
  interface ListItemProps {
24
66
  children: ReactNode;
25
67
  className?: string;
26
68
  }
69
+ interface ItemSectionHeaderProps {
70
+ label: string;
71
+ variant?: "primary" | "secondary";
72
+ }
27
73
  export {};