@bouku/core 0.2.6 → 0.2.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,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const jsx_runtime_1 = require("react/jsx-runtime");
4
- const flex_1 = require("../container/flex");
4
+ const _1 = require("../container/_");
5
5
  const separator_1 = require("./separator");
6
- const style_1 = require("../../utils/functions/style");
6
+ const utils_1 = require("../../utils");
7
7
  /**
8
8
  * Layout Section Component.
9
9
  *
@@ -14,9 +14,11 @@ const style_1 = require("../../utils/functions/style");
14
14
  * @param title - The section title displayed at top.
15
15
  * @param content - Element(s) rendered below the separator.
16
16
  **/
17
- const Section = ({ style, title, children }) => ((0, jsx_runtime_1.jsxs)(flex_1.ColumnBox, { style: s.container, children: [(0, jsx_runtime_1.jsx)("span", { className: s.title, children: title }), (0, jsx_runtime_1.jsx)(separator_1.Separator, { style: "mb-2" }), (0, jsx_runtime_1.jsx)("div", { className: (0, style_1.cn)(s.content, style), children: children })] }));
17
+ const Section = ({ style, title, children }) => ((0, jsx_runtime_1.jsxs)(_1.ColumnBox, { style: s.container, children: [(0, jsx_runtime_1.jsxs)(_1.RowBox, { style: s.header, children: [(0, jsx_runtime_1.jsx)("div", { className: s.marker }), (0, jsx_runtime_1.jsx)("span", { className: s.title, children: title })] }), (0, jsx_runtime_1.jsx)(separator_1.Separator, { style: "mb-2" }), (0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)(s.content, style), children: children })] }));
18
18
  const s = {
19
- container: "gap-3 w-full",
19
+ container: "relative gap-3 w-full",
20
+ header: "gap-3 items-center",
21
+ marker: "w-1 h-5 rounded bg-linear-to-t from-background to-accent",
20
22
  title: "text-xl font-bold text-primary",
21
23
  content: "w-full"
22
24
  };
@@ -9,6 +9,7 @@ export type Action<T> = {
9
9
  icon?: React.ReactNode;
10
10
  style?: string;
11
11
  handler: (row: T) => void;
12
+ next?: () => void;
12
13
  };
13
14
  interface Props<T> {
14
15
  config: Record<string, ColumnOptions>;
@@ -20,7 +20,11 @@ function TableRow({ config, data, actions, count }) {
20
20
  const variantStyles = action.variant === "error" ? "bg-error/10 text-error hover:bg-error/20" :
21
21
  action.variant === "accent" ? "bg-accent/10 text-accent hover:bg-accent/20" :
22
22
  "bg-surface-light text-primary hover:bg-surface-light/80";
23
- return ((0, jsx_runtime_1.jsx)(_1.Button, { size: "xs", variant: "surface", style: action.style, icon: action.icon, action: () => action.handler(data) }, actionIdx));
23
+ const onClick = async () => {
24
+ await action.handler(data);
25
+ action.next?.();
26
+ };
27
+ return ((0, jsx_runtime_1.jsx)(_1.Button, { size: "xs", variant: "surface", style: action.style, icon: action.icon, action: onClick }, actionIdx));
24
28
  }) }) }, i));
25
29
  }
26
30
  const rawValue = data[key];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
 
3
3
  "name": "@bouku/core",
4
- "version": "0.2.6",
4
+ "version": "0.2.8",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "license": "MIT",