@bouko/react 2.6.1 → 2.6.2
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,9 +1,10 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import type { Clickable } from "../../core/types";
|
|
3
3
|
declare type Props = Clickable & {
|
|
4
|
+
style?: string;
|
|
4
5
|
color?: string;
|
|
5
6
|
icon: ReactNode;
|
|
6
7
|
disabled?: boolean;
|
|
7
8
|
};
|
|
8
|
-
export default function IconButton({ color, icon, action, disabled }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default function IconButton({ style, color, icon, action, disabled }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { opacitize } from "@bouko/style";
|
|
3
|
-
export default function IconButton({ color = "--color-accent", icon, action, disabled = false }) {
|
|
4
|
-
|
|
5
|
-
return (_jsx("button", { className: "hover:brightness-115 disabled:!cursor-not-allowed", style: styles(color), onClick: action, disabled: !action || disabled, children: icon }, void 0));
|
|
2
|
+
import { cn, opacitize } from "@bouko/style";
|
|
3
|
+
export default function IconButton({ style, color = "--color-accent", icon, action, disabled = false }) {
|
|
4
|
+
return (_jsx("button", { className: cn("hover:brightness-115 disabled:!cursor-not-allowed", style), style: styles(color), onClick: action, disabled: !action || disabled, children: icon }, void 0));
|
|
6
5
|
}
|
|
7
6
|
const styles = (color) => ({
|
|
8
7
|
display: "flex",
|