@altimateai/ui-components 0.0.69-beta1 → 0.0.70-beta.1

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.
@@ -6,16 +6,23 @@ declare const buttonVariants: (props?: ({
6
6
  variant?: "link" | "default" | "destructive" | "outline" | "success" | "secondary" | "ghost" | null | undefined;
7
7
  size?: "xs" | "sm" | "lg" | "default" | "icon" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
+ type ButtonSize = "default" | "sm" | "xs" | "lg" | "icon";
9
10
  type BaseButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & Omit<VariantProps<typeof buttonVariants>, "size"> & {
10
11
  asChild?: boolean;
11
12
  };
12
- type ButtonProps = BaseButtonProps & ({
13
+ type ButtonProps<TSize extends ButtonSize | undefined = undefined> = BaseButtonProps & ([TSize] extends ["icon"] ? {
13
14
  size: "icon";
14
15
  title: string;
15
- } | {
16
- size?: "default" | "sm" | "xs" | "lg";
16
+ } : [TSize] extends [undefined] ? {
17
+ size?: Exclude<ButtonSize, "icon">;
18
+ title?: string;
19
+ } : {
20
+ size?: TSize;
17
21
  title?: string;
18
22
  });
19
- declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
23
+ type GenericButtonComponent = <TSize extends ButtonSize | undefined = undefined>(props: ButtonProps<TSize> & React.RefAttributes<HTMLButtonElement>) => React.ReactElement | null;
24
+ declare const Button: GenericButtonComponent & {
25
+ displayName?: string;
26
+ };
20
27
 
21
- export { type ButtonProps as B, Button as a, buttonVariants as b };
28
+ export { type ButtonProps as B, Button as a, type ButtonSize as b, buttonVariants as c };