@trycompai/design-system 1.0.37 → 1.0.38
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
|
@@ -70,6 +70,8 @@ const buttonVariants = cva(
|
|
|
70
70
|
|
|
71
71
|
type ButtonProps = Omit<ButtonPrimitive.Props, 'className'> &
|
|
72
72
|
VariantProps<typeof buttonVariants> & {
|
|
73
|
+
/** Button type attribute for native button usage */
|
|
74
|
+
type?: 'button' | 'submit' | 'reset';
|
|
73
75
|
/** Show loading spinner and disable button */
|
|
74
76
|
loading?: boolean;
|
|
75
77
|
/** Icon to show on the left side of the button */
|
|
@@ -88,6 +90,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
88
90
|
iconLeft,
|
|
89
91
|
iconRight,
|
|
90
92
|
disabled,
|
|
93
|
+
type = 'button',
|
|
91
94
|
children,
|
|
92
95
|
render,
|
|
93
96
|
...props
|
|
@@ -105,6 +108,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
105
108
|
className={buttonVariants({ variant, width, size })}
|
|
106
109
|
render={render}
|
|
107
110
|
nativeButton={!render}
|
|
111
|
+
type={render ? undefined : type}
|
|
108
112
|
{...props}
|
|
109
113
|
>
|
|
110
114
|
{loading ? (
|