@bouko/react 0.2.5 → 0.2.6
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,8 +1,9 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
type Props = {
|
|
3
|
+
variant?: "ghost";
|
|
3
4
|
style?: string;
|
|
4
5
|
onClick?: () => void;
|
|
5
6
|
children: ReactNode;
|
|
6
7
|
};
|
|
7
|
-
export default function Button({ style, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default function Button({ variant, style, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "@bouko/style";
|
|
3
|
-
export default function Button({ style, ...props }) {
|
|
4
|
-
return (_jsx("button", { className: cn(
|
|
2
|
+
import { cn, tv } from "@bouko/style";
|
|
3
|
+
export default function Button({ variant, style, ...props }) {
|
|
4
|
+
return (_jsx("button", { className: cn(styles({ variant }), style), ...props }));
|
|
5
5
|
}
|
|
6
|
+
const styles = tv({
|
|
7
|
+
base: "px-4 py-2 bg-accent hover:bg-accent-dark border border-accent-dark rounded font-semibold text-primary duration-200 cursor-pointer",
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
ghost: "bg-transparent border-transparent"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
});
|