@bouko/react 2.9.6 → 2.9.8

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",
@@ -8,6 +8,7 @@ export * from "./layout/flex";
8
8
  export * from "./tab";
9
9
  export * from "./route";
10
10
  export { default as Pagination } from "./pagination";
11
+ export { default as Section } from "./section";
11
12
  export { default as Button } from "./button/normal";
12
13
  export { default as IconButton } from "./button/icon";
13
14
  export { default as Badge } from "./text/badge";
@@ -8,6 +8,7 @@ export * from "./layout/flex";
8
8
  export * from "./tab";
9
9
  export * from "./route";
10
10
  export { default as Pagination } from "./pagination";
11
+ export { default as Section } from "./section";
11
12
  export { default as Button } from "./button/normal";
12
13
  export { default as IconButton } from "./button/icon";
13
14
  export { default as Badge } from "./text/badge";
@@ -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 }))] })] }));
@@ -0,0 +1,15 @@
1
+ import { ReactNode } from "react";
2
+ /**
3
+ * Settings Section Component.
4
+ *
5
+ * Generic layout wrapper used to group related settings or content
6
+ * under a titled section with a visual separator for consistency.
7
+ *
8
+ * @param {string} title - The section title displayed at top.
9
+ * @param {ReactNode} content - Rendered below the separator.
10
+ **/
11
+ declare const Section: ({ title, content }: {
12
+ title: string;
13
+ content: ReactNode;
14
+ }) => import("react/jsx-runtime").JSX.Element;
15
+ export default Section;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ColumnBox } from "./layout/flex";
3
+ /**
4
+ * Settings Section Component.
5
+ *
6
+ * Generic layout wrapper used to group related settings or content
7
+ * under a titled section with a visual separator for consistency.
8
+ *
9
+ * @param {string} title - The section title displayed at top.
10
+ * @param {ReactNode} content - Rendered below the separator.
11
+ **/
12
+ const Section = ({ title, content }) => (_jsxs(ColumnBox, { style: styles.container, children: [title, _jsx("hr", { className: styles.separator }), content] }));
13
+ const styles = {
14
+ container: "gap-2 items-start text-primary",
15
+ separator: "mb-2 w-full text-border-dark"
16
+ };
17
+ export default Section;
@@ -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.8",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "license": "MIT",