dara-ui 0.4.5 → 0.4.7

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,5 +1,10 @@
1
1
  import { default as React } from 'react';
2
- export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
2
+ interface ButtonBaseProps {
3
+ /**
4
+ * The HTML element to render the button as.
5
+ * @default "button"
6
+ */
7
+ as?: "button" | "a";
3
8
  /**
4
9
  * Button visual style variant
5
10
  * @default "primary"
@@ -33,6 +38,13 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
33
38
  */
34
39
  rightIcon?: React.ReactNode;
35
40
  }
41
+ export type ButtonAsButtonProps = ButtonBaseProps & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "as"> & {
42
+ as?: "button";
43
+ };
44
+ export type ButtonAsAnchorProps = ButtonBaseProps & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "as"> & {
45
+ as: "a";
46
+ };
47
+ export type ButtonProps = ButtonAsButtonProps | ButtonAsAnchorProps;
36
48
  /**
37
49
  * Dara UI Button - Glassmorphism style with cyberpunk aesthetics
38
50
  *
@@ -44,6 +56,7 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
44
56
  * - Full width option
45
57
  * - Icon support on both sides
46
58
  * - Smooth hover animations with scale and lift
59
+ * - Can be rendered as a link or any other HTML element via the `as` prop
47
60
  */
48
- export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
61
+ export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
49
62
  export default Button;