@bouko/react 2.9.8 → 2.9.9

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,5 +1,9 @@
1
1
  import type { Component } from "../../core/types";
2
- type Props = Component & {
2
+ type Hoverable = {
3
+ onHover?: () => void;
4
+ onLeave?: () => void;
5
+ };
6
+ type Props = Component & Hoverable & {
3
7
  center?: boolean;
4
8
  centerX?: boolean;
5
9
  centerY?: boolean;
@@ -11,6 +15,6 @@ type Props = Component & {
11
15
  * @param {ReactNode} children - Child elements to render inside the row.
12
16
  * @param {Props} opts - Variant options for styling.
13
17
  **/
14
- export declare function RowBox({ style, children, ...opts }: Props): import("react/jsx-runtime").JSX.Element | null;
15
- export declare function ColumnBox({ style, children, ...opts }: Props): import("react/jsx-runtime").JSX.Element | null;
18
+ export declare function RowBox({ style, children, onHover, onLeave, ...opts }: Props): import("react/jsx-runtime").JSX.Element | null;
19
+ export declare function ColumnBox({ style, children, onHover, onLeave, ...opts }: Props): import("react/jsx-runtime").JSX.Element | null;
16
20
  export {};
@@ -7,15 +7,15 @@ import { cn, tv } from "@bouko/style";
7
7
  * @param {ReactNode} children - Child elements to render inside the row.
8
8
  * @param {Props} opts - Variant options for styling.
9
9
  **/
10
- export function RowBox({ style, children, ...opts }) {
10
+ export function RowBox({ style, children, onHover, onLeave, ...opts }) {
11
11
  if (!children)
12
12
  return null;
13
- return (_jsx("div", { className: cn(row(opts), style), children: children }));
13
+ return (_jsx("div", { className: cn(row(opts), style), onMouseEnter: onHover, onMouseLeave: onLeave, children: children }));
14
14
  }
15
- export function ColumnBox({ style, children, ...opts }) {
15
+ export function ColumnBox({ style, children, onHover, onLeave, ...opts }) {
16
16
  if (!children)
17
17
  return null;
18
- return (_jsx("div", { className: cn(column(opts), style), children: children }));
18
+ return (_jsx("div", { className: cn(column(opts), style), onMouseEnter: onHover, onMouseLeave: onLeave, children: children }));
19
19
  }
20
20
  /**
21
21
  * Styling variants for flex options.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
 
3
3
  "name": "@bouko/react",
4
- "version": "2.9.8",
4
+ "version": "2.9.9",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "license": "MIT",