@breadcoop/ui 2.0.0 → 2.0.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.
|
@@ -2,7 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { ElementType, ReactNode, ComponentPropsWithoutRef } from 'react';
|
|
3
3
|
import { App } from '../../interface/app.mjs';
|
|
4
4
|
|
|
5
|
-
type Variant = "primary" | "secondary" | "destructive" | "positive" | "light";
|
|
5
|
+
type Variant = "primary" | "secondary" | "destructive" | "positive" | "light" | "burn";
|
|
6
6
|
type ButtonOwnProps<E extends ElementType = "button"> = {
|
|
7
7
|
as?: E;
|
|
8
8
|
app?: App;
|
|
@@ -17,4 +17,4 @@ type ButtonOwnProps<E extends ElementType = "button"> = {
|
|
|
17
17
|
type ButtonProps<E extends ElementType = "button"> = ButtonOwnProps<E> & Omit<ComponentPropsWithoutRef<E>, keyof ButtonOwnProps<E>>;
|
|
18
18
|
declare const Button: <E extends ElementType = "button">({ as, app, size, variant, rightIcon, leftIcon, children, disabled, className, isLoading, showChildrenWhenLoading, withBorder, ...rest }: ButtonProps<E>) => react_jsx_runtime.JSX.Element;
|
|
19
19
|
|
|
20
|
-
export { Button as default };
|
|
20
|
+
export { type ButtonProps, Button as default };
|
|
@@ -10,6 +10,9 @@ const getBaseClassName = (app, variant) => {
|
|
|
10
10
|
if (variant === "destructive") {
|
|
11
11
|
return "bg-system-red hover:bg-[#BF0A00] active:bg-system-red";
|
|
12
12
|
}
|
|
13
|
+
if (variant === "burn") {
|
|
14
|
+
return "bg-red-0 text-red-main hover:bg-red-1 active:bg-red-0";
|
|
15
|
+
}
|
|
13
16
|
if (variant === "positive") {
|
|
14
17
|
return "bg-system-green hover:bg-[#2B8F00] active:bg-system-green";
|
|
15
18
|
}
|
|
@@ -66,6 +69,8 @@ const Button = (_a) => {
|
|
|
66
69
|
Component,
|
|
67
70
|
__spreadProps(__spreadValues({}, rest), {
|
|
68
71
|
className: cn(
|
|
72
|
+
"text-paper-main",
|
|
73
|
+
"href" in rest ? "cursor-pointer" : "",
|
|
69
74
|
getBaseClassName(app, variant),
|
|
70
75
|
"flex items-center justify-center gap-2 active:shadow-none disabled:shadow-none disabled:bg-surface-grey disabled:cursor-not-allowed",
|
|
71
76
|
"transition-all duration-200 border disabled:border-transparent",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as CopyButtonIcon } from './copy-icon.mjs';
|
|
2
|
-
export { default as Button } from './button.mjs';
|
|
2
|
+
export { default as Button, ButtonProps } from './button.mjs';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
5
5
|
import '../../hooks/use-copy-to-clipboard.mjs';
|
package/dist/index.d.mts
CHANGED
|
@@ -11,7 +11,7 @@ export { cn } from './utils/cn.mjs';
|
|
|
11
11
|
export { formatBalance } from './utils/formatter.mjs';
|
|
12
12
|
export { LoginButton } from './components/auth/login-button.mjs';
|
|
13
13
|
export { default as CopyButtonIcon } from './components/buttons/copy-icon.mjs';
|
|
14
|
-
export { default as Button } from './components/buttons/button.mjs';
|
|
14
|
+
export { default as Button, ButtonProps } from './components/buttons/button.mjs';
|
|
15
15
|
export { useConnectedUser } from './components/connected-user/context.mjs';
|
|
16
16
|
export { ConnectedUserProvider } from './components/connected-user/provider.mjs';
|
|
17
17
|
export { TConnectedUserState, TUserConnected, TUserLoading, TUserNotConnected } from './components/connected-user/interface.mjs';
|