@bouko/react 0.4.8 → 0.5.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.
|
@@ -4,7 +4,7 @@ export function Button({ variant, style, ...props }) {
|
|
|
4
4
|
return (_jsx("button", { className: cn(styles({ variant }), style), ...props }));
|
|
5
5
|
}
|
|
6
6
|
const styles = tv({
|
|
7
|
-
base: "px-4 py-2 bg-accent hover:bg-accent-dark border border-accent-dark rounded font-semibold text-background-light duration-200 cursor-pointer",
|
|
7
|
+
base: "flex items-center gap-2 px-4 py-2 bg-accent hover:bg-accent-dark border border-accent-dark rounded font-semibold text-background-light duration-200 cursor-pointer",
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
10
10
|
primary: "bg-primary hover:bg-primary-dark border-primary-dark",
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
type Props = {
|
|
3
|
+
styles?: Record<string, string>;
|
|
3
4
|
container?: string;
|
|
4
5
|
icon?: ReactNode;
|
|
5
6
|
title: ReactNode;
|
|
6
7
|
subtitle: ReactNode;
|
|
7
8
|
reverse?: boolean;
|
|
8
9
|
};
|
|
9
|
-
export default function Heading({ container, icon, title, subtitle, reverse }: Props): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default function Heading({ styles, container, icon, title, subtitle, reverse }: Props): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { RowBox, ColumnBox } from "./flex";
|
|
3
3
|
import { cn } from "@bouko/style";
|
|
4
|
-
export default function Heading({ container, icon, title, subtitle, reverse }) {
|
|
5
|
-
return (_jsxs(RowBox, { style: cn(container, styles.container), children: [icon, _jsxs(ColumnBox, { style: cn(
|
|
4
|
+
export default function Heading({ styles = {}, container, icon, title, subtitle, reverse }) {
|
|
5
|
+
return (_jsxs(RowBox, { style: cn(base.container, styles.container, container), children: [icon, _jsxs(ColumnBox, { style: cn(base.subcontainer, reverse && "flex-col-reverse"), children: [_jsx("span", { className: cn(base.title, styles.title), children: title }), _jsx("span", { className: cn(base.subtitle, styles.subtitle), children: subtitle })] })] }));
|
|
6
6
|
}
|
|
7
|
-
const
|
|
7
|
+
const base = {
|
|
8
8
|
container: "gap-2 items-center",
|
|
9
9
|
subcontainer: "grow",
|
|
10
10
|
title: "flex items-center gap-2 font-bold",
|