@bouko/react 2.9.6 → 2.9.7

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,10 +1,2 @@
1
- import type { ReactNode } from "react";
2
1
  import type { Clickable } from "../../core/types";
3
- type Props = Clickable & {
4
- style?: string;
5
- color?: string;
6
- icon: ReactNode;
7
- disabled?: boolean;
8
- };
9
- export default function IconButton({ style, color, icon, action, disabled }: Props): import("react/jsx-runtime").JSX.Element;
10
- export {};
2
+ export default function IconButton({ style, color, icon, action, disabled }: Clickable): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import Check from "../../assets/icons/check.svg";
2
3
  import { cn, opacitize } from "@bouko/style";
3
4
  export default function IconButton({ style, color = "--color-accent", icon, action, disabled = false }) {
4
- return (_jsx("button", { className: cn("flex hover:brightness-115 disabled:!cursor-not-allowed", style), style: styles(color), onClick: action, disabled: !action || disabled, children: icon }));
5
+ return (_jsx("button", { className: cn("flex hover:brightness-115 disabled:!cursor-not-allowed", style), style: styles(color), onClick: action, disabled: !action || disabled, children: icon || _jsx(Check, {}) }));
5
6
  }
6
7
  const styles = (color) => ({
7
8
  justifyContent: "center",
@@ -1,4 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { ColumnBox, RowBox } from "./layout/flex";
3
3
  import Badge from "./text/badge";
4
- export const MediaRow = ({ media, title, subtitle, badge, styles = {}, }) => (_jsxs(RowBox, { style: `items-center gap-3 ${styles.container ?? ""}`, children: [_jsx("img", { src: media, className: "size-10 w-10 h-10 border border-border rounded", alt: title }), _jsxs(ColumnBox, { style: "gap-px min-w-0", children: [_jsxs(RowBox, { style: "items-center gap-2 min-w-0", children: [_jsx("span", { className: `text-primary text-sm font-semibold truncate ${styles.title ?? ""}`, children: title }), badge && _jsx(Badge, { size: "sm", children: badge })] }), subtitle && (_jsx("span", { className: `text-xs text-primary-dark ${styles.subtitle}`, children: subtitle }))] })] }));
4
+ export const MediaRow = ({ media, title, subtitle, badge, styles = {}, }) => (_jsxs(RowBox, { style: `items-center gap-3 ${styles.container ?? ""}`, children: [_jsx("img", { src: media, className: "size-10 w-10 h-10 border border-border rounded", alt: title }), _jsxs(ColumnBox, { style: "gap-px min-w-0", children: [_jsxs(RowBox, { style: "items-center gap-2 min-w-0", children: [_jsx("span", { className: `text-primary text-sm font-semibold truncate ${styles.title ?? ""}`, children: title }), badge && _jsx(Badge, { size: "xs", children: badge })] }), subtitle && (_jsx("span", { className: `text-xs text-primary-dark ${styles.subtitle}`, children: subtitle }))] })] }));
@@ -1,7 +1,7 @@
1
1
  import type { Component } from "../../core/types";
2
2
  type Props = Component & {
3
3
  color?: string;
4
- size?: "sm" | "md";
4
+ size?: "xs" | "sm" | "md";
5
5
  };
6
6
  /**
7
7
  * Color-themed badge component.
@@ -10,6 +10,9 @@ export type Component = {
10
10
  children?: ReactNode;
11
11
  };
12
12
  export type Clickable = {
13
+ style?: string;
14
+ color?: string;
15
+ icon?: React.ReactNode;
13
16
  action?: () => void;
14
17
  disabled?: boolean;
15
18
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
 
3
3
  "name": "@bouko/react",
4
- "version": "2.9.6",
4
+ "version": "2.9.7",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "license": "MIT",