@bouku/core 0.2.8 → 0.3.0

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,6 +1,6 @@
1
1
  export { default as Accordion } from "./accordion";
2
- export { default as Table } from "./table";
3
2
  export { default as Pagination } from "./pagination";
4
3
  export { default as ProgressBar } from "./progress";
5
4
  export { default as Glow } from "./glow";
6
5
  export { default as Dropdown } from "./dropdown";
6
+ export * from "./table";
@@ -1,13 +1,25 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
18
  };
5
19
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Dropdown = exports.Glow = exports.ProgressBar = exports.Pagination = exports.Table = exports.Accordion = void 0;
20
+ exports.Dropdown = exports.Glow = exports.ProgressBar = exports.Pagination = exports.Accordion = void 0;
7
21
  var accordion_1 = require("./accordion");
8
22
  Object.defineProperty(exports, "Accordion", { enumerable: true, get: function () { return __importDefault(accordion_1).default; } });
9
- var table_1 = require("./table");
10
- Object.defineProperty(exports, "Table", { enumerable: true, get: function () { return __importDefault(table_1).default; } });
11
23
  var pagination_1 = require("./pagination");
12
24
  Object.defineProperty(exports, "Pagination", { enumerable: true, get: function () { return __importDefault(pagination_1).default; } });
13
25
  var progress_1 = require("./progress");
@@ -16,3 +28,4 @@ var glow_1 = require("./glow");
16
28
  Object.defineProperty(exports, "Glow", { enumerable: true, get: function () { return __importDefault(glow_1).default; } });
17
29
  var dropdown_1 = require("./dropdown");
18
30
  Object.defineProperty(exports, "Dropdown", { enumerable: true, get: function () { return __importDefault(dropdown_1).default; } });
31
+ __exportStar(require("./table"), exports);
@@ -1,4 +1,4 @@
1
- import { type Row, type Action } from "./row";
1
+ import { type Row, type TableAction } from "./row";
2
2
  type ColumnOptions = {
3
3
  label?: string;
4
4
  pad?: number;
@@ -9,7 +9,7 @@ type Props<T extends Row> = {
9
9
  title?: string;
10
10
  config: Partial<Record<keyof T, boolean | ColumnOptions>>;
11
11
  items: T[];
12
- actions?: Action<T>[];
12
+ actions?: TableAction<T>[];
13
13
  };
14
- export default function Table<T extends Row>({ style, title, config: initConfig, items, actions }: Props<T>): import("react").JSX.Element;
15
- export {};
14
+ export declare function Table<T extends Row>({ style, title, config: initConfig, items, actions }: Props<T>): import("react").JSX.Element;
15
+ export type { TableAction } from "./row";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.default = Table;
4
+ exports.Table = Table;
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const sorter_1 = require("./sorter");
7
7
  const ts_helper_kit_1 = require("ts-helper-kit");
@@ -4,10 +4,11 @@ type ColumnOptions = {
4
4
  pad?: number;
5
5
  link?: string;
6
6
  };
7
- export type Action<T> = {
8
- variant?: "accent" | "surface" | "error";
9
- icon?: React.ReactNode;
7
+ export type TableAction<T> = {
10
8
  style?: string;
9
+ variant?: "accent" | "surface" | "error";
10
+ label?: string;
11
+ icon: React.ReactNode;
11
12
  handler: (row: T) => void;
12
13
  next?: () => void;
13
14
  };
@@ -15,7 +16,7 @@ interface Props<T> {
15
16
  config: Record<string, ColumnOptions>;
16
17
  data: T;
17
18
  count: number;
18
- actions?: Action<T>[];
19
+ actions?: TableAction<T>[];
19
20
  }
20
21
  export type Row = Record<string, CellValue>;
21
22
  export type CellValue = string | number | boolean | object | null;
@@ -31,8 +31,3 @@ export interface NavItem {
31
31
  label: string;
32
32
  href: string;
33
33
  }
34
- export type TableActions<T> = {
35
- label?: string;
36
- icon: ReactNode;
37
- handler: (row: T) => void;
38
- }[];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
 
3
3
  "name": "@bouku/core",
4
- "version": "0.2.8",
4
+ "version": "0.3.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "license": "MIT",