@serendie/ui 3.6.0 → 3.6.1

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,53 +1,57 @@
1
- import { jsxs as M, jsx as l } from "react/jsx-runtime";
2
- import { useReactTable as T } from "../../node_modules/@tanstack/react-table/build/lib/index.js";
3
- import { useState as w } from "react";
1
+ import { jsxs as p, jsx as l } from "react/jsx-runtime";
2
+ import { useReactTable as M } from "../../node_modules/@tanstack/react-table/build/lib/index.js";
3
+ import { useState as f } from "react";
4
4
  import { DataTable as r } from "./index.js";
5
- import { getSortedRowModel as S, getCoreRowModel as u } from "../../node_modules/@tanstack/table-core/build/lib/index.js";
6
- function y({
5
+ import { getSortedRowModel as T, getCoreRowModel as S } from "../../node_modules/@tanstack/table-core/build/lib/index.js";
6
+ function g({
7
7
  className: s,
8
- enableRowSelection: m = !0,
9
- onRowSelectionChange: i,
10
- onSortingChange: t,
8
+ enableRowSelection: t = !0,
9
+ onRowSelectionChange: d,
10
+ onSortingChange: i,
11
11
  state: e,
12
- ...R
12
+ ...c
13
13
  }) {
14
- const [b, f] = w({}), [p, n] = w([]), d = T({
15
- getCoreRowModel: u(),
16
- getSortedRowModel: S(),
17
- enableRowSelection: m,
18
- ...R,
14
+ const [R, n] = f({}), [u, b] = f([]), m = M({
15
+ getCoreRowModel: S(),
16
+ getSortedRowModel: T(),
17
+ enableRowSelection: t,
18
+ ...c,
19
+ defaultColumn: {
20
+ size: void 0,
21
+ ...c.defaultColumn
22
+ },
19
23
  state: {
20
- rowSelection: (e == null ? void 0 : e.rowSelection) ?? b,
21
- sorting: (e == null ? void 0 : e.sorting) ?? p,
24
+ rowSelection: (e == null ? void 0 : e.rowSelection) ?? R,
25
+ sorting: (e == null ? void 0 : e.sorting) ?? u,
22
26
  ...e
23
27
  },
24
28
  onRowSelectionChange: (o) => {
25
- f(o), i == null || i(o);
29
+ n(o), d == null || d(o);
26
30
  },
27
31
  onSortingChange: (o) => {
28
- n(o), t == null || t(o);
32
+ b(o), i == null || i(o);
29
33
  }
30
- }), c = m !== !1;
31
- return /* @__PURE__ */ M(r.Root, { className: s, children: [
32
- /* @__PURE__ */ l(r.Thead, { children: d.getHeaderGroups().map((o) => /* @__PURE__ */ l(
34
+ }), w = t !== !1;
35
+ return /* @__PURE__ */ p(r.Root, { className: s, children: [
36
+ /* @__PURE__ */ l(r.Thead, { children: m.getHeaderGroups().map((o) => /* @__PURE__ */ l(
33
37
  r.HeaderRow,
34
38
  {
35
39
  headerGroup: o,
36
- enableRowSelection: c,
37
- table: d
40
+ enableRowSelection: w,
41
+ table: m
38
42
  },
39
43
  o.id
40
44
  )) }),
41
- /* @__PURE__ */ l(r.Tbody, { children: d.getRowModel().rows.map((o) => /* @__PURE__ */ l(
45
+ /* @__PURE__ */ l(r.Tbody, { children: m.getRowModel().rows.map((o) => /* @__PURE__ */ l(
42
46
  r.Row,
43
47
  {
44
48
  row: o,
45
- enableRowSelection: c
49
+ enableRowSelection: w
46
50
  },
47
51
  o.id
48
52
  )) })
49
53
  ] });
50
54
  }
51
55
  export {
52
- y as DataTableComponent
56
+ g as DataTableComponent
53
57
  };
@@ -1,10 +1,10 @@
1
- import { jsx as l, jsxs as p } from "react/jsx-runtime";
2
- import f from "react";
1
+ import { jsx as l, jsxs as f } from "react/jsx-runtime";
2
+ import y from "react";
3
3
  import { SerendieSymbol as a } from "@serendie/symbols";
4
- import { css as y } from "../../../styled-system/css/css.js";
5
- import { cx as u } from "../../../styled-system/css/cx.js";
6
- import { cva as g } from "../../../styled-system/css/cva.js";
7
- const h = g({
4
+ import { css as u } from "../../../styled-system/css/css.js";
5
+ import { cx as g } from "../../../styled-system/css/cx.js";
6
+ import { cva as h } from "../../../styled-system/css/cva.js";
7
+ const x = h({
8
8
  base: {
9
9
  borderBottomWidth: "1px",
10
10
  borderBottomStyle: "solid",
@@ -22,7 +22,7 @@ const h = g({
22
22
  whiteSpace: "nowrap"
23
23
  },
24
24
  defaultVariants: {}
25
- }), A = f.forwardRef(
25
+ }), B = y.forwardRef(
26
26
  ({
27
27
  children: s,
28
28
  size: r = "medium",
@@ -31,11 +31,12 @@ const h = g({
31
31
  sortDirection: n,
32
32
  onSort: o,
33
33
  className: i,
34
- ...m
35
- }, c) => /* @__PURE__ */ l(
34
+ style: m,
35
+ ...c
36
+ }, p) => /* @__PURE__ */ l(
36
37
  "th",
37
38
  {
38
- ref: c,
39
+ ref: p,
39
40
  role: "columnheader",
40
41
  "aria-sort": n === "asc" ? "ascending" : n === "desc" ? "descending" : e ? "none" : void 0,
41
42
  tabIndex: e ? 0 : void 0,
@@ -43,16 +44,17 @@ const h = g({
43
44
  onKeyDown: (t) => {
44
45
  e && (t.key === "Enter" || t.key === " ") && (t.preventDefault(), o == null || o());
45
46
  },
46
- className: u(h({ size: r, state: d }), i),
47
+ className: g(x({ size: r, state: d }), i),
47
48
  style: {
48
49
  cursor: e ? "pointer" : "default",
49
- userSelect: "none"
50
+ userSelect: "none",
51
+ ...m
50
52
  },
51
- ...m,
52
- children: /* @__PURE__ */ p(
53
+ ...c,
54
+ children: /* @__PURE__ */ f(
53
55
  "span",
54
56
  {
55
- className: y({
57
+ className: u({
56
58
  display: "inline-flex",
57
59
  alignItems: "center",
58
60
  verticalAlign: "middle"
@@ -85,5 +87,5 @@ const h = g({
85
87
  )
86
88
  );
87
89
  export {
88
- A as HeaderCell
90
+ B as HeaderCell
89
91
  };
@@ -1,42 +1,43 @@
1
- import { jsx as n, jsxs as g } from "react/jsx-runtime";
2
- import f from "react";
3
- import { flexRender as u } from "../../../node_modules/@tanstack/react-table/build/lib/index.js";
1
+ import { jsx as r, jsxs as g } from "react/jsx-runtime";
2
+ import u from "react";
3
+ import { flexRender as f } from "../../../node_modules/@tanstack/react-table/build/lib/index.js";
4
4
  import { DataTable as t } from "../index.js";
5
- import { css as R } from "../../../styled-system/css/css.js";
6
- const w = ({
7
- headerGroup: r,
8
- enableRowSelection: d,
5
+ import { css as w } from "../../../styled-system/css/css.js";
6
+ const R = ({
7
+ headerGroup: l,
8
+ enableRowSelection: m,
9
9
  table: o,
10
- children: l,
10
+ children: n,
11
11
  className: c
12
- }, s) => l ? /* @__PURE__ */ n(t.Tr, { ref: s, className: c, children: l }) : !r || !o ? null : /* @__PURE__ */ g(t.Tr, { ref: s, className: c, children: [
13
- d && /* @__PURE__ */ n(
12
+ }, s) => n ? /* @__PURE__ */ r(t.Tr, { ref: s, className: c, children: n }) : !l || !o ? null : /* @__PURE__ */ g(t.Tr, { ref: s, className: c, children: [
13
+ m && /* @__PURE__ */ r(
14
14
  t.HeaderCheckbox,
15
15
  {
16
16
  checked: o.getIsSomeRowsSelected() ? "indeterminate" : !!o.getIsAllRowsSelected(),
17
17
  onChange: o.getToggleAllRowsSelectedHandler(),
18
18
  value: "select-all",
19
- className: R({
19
+ className: w({
20
20
  verticalAlign: "middle"
21
21
  })
22
22
  }
23
23
  ),
24
- r.headers.map((e) => {
25
- const i = e.column.getCanSort(), a = e.column.getIsSorted();
26
- return /* @__PURE__ */ n(
24
+ l.headers.map((e) => {
25
+ const d = e.column.getCanSort(), a = e.column.getIsSorted();
26
+ return /* @__PURE__ */ r(
27
27
  t.HeaderCell,
28
28
  {
29
- sortable: i,
29
+ sortable: d,
30
30
  sortDirection: a,
31
31
  onSort: () => e.column.toggleSorting(),
32
- children: u(e.column.columnDef.header, e.getContext())
32
+ style: e.column.columnDef.size != null ? { width: e.getSize() } : void 0,
33
+ children: f(e.column.columnDef.header, e.getContext())
33
34
  },
34
35
  e.id
35
36
  );
36
37
  })
37
- ] }, r.id), m = f.forwardRef(w);
38
- m.displayName = "HeaderRow";
39
- const T = m;
38
+ ] }, l.id), i = u.forwardRef(R);
39
+ i.displayName = "HeaderRow";
40
+ const D = i;
40
41
  export {
41
- T as HeaderRow
42
+ D as HeaderRow
42
43
  };
@@ -1,10 +1,10 @@
1
- import { jsx as n, jsxs as f } from "react/jsx-runtime";
2
- import u from "react";
1
+ import { jsx as n, jsxs as p } from "react/jsx-runtime";
2
+ import f from "react";
3
3
  import { flexRender as y } from "../../../node_modules/@tanstack/react-table/build/lib/index.js";
4
4
  import { DataTable as o } from "../index.js";
5
- import { cx as l } from "../../../styled-system/css/cx.js";
5
+ import { cx as m } from "../../../styled-system/css/cx.js";
6
6
  import { cva as g } from "../../../styled-system/css/cva.js";
7
- const m = g({
7
+ const l = g({
8
8
  base: {
9
9
  _hover: {
10
10
  _after: {
@@ -58,18 +58,18 @@ const m = g({
58
58
  o.Tr,
59
59
  {
60
60
  ref: i,
61
- className: l(
62
- m({ state: d ? "selected" : void 0 }),
61
+ className: m(
62
+ l({ state: d ? "selected" : void 0 }),
63
63
  s
64
64
  ),
65
65
  children: r
66
66
  }
67
- ) : e ? /* @__PURE__ */ f(
67
+ ) : e ? /* @__PURE__ */ p(
68
68
  o.Tr,
69
69
  {
70
70
  ref: i,
71
- className: l(
72
- m({
71
+ className: m(
72
+ l({
73
73
  state: e.getIsSelected() ? "selected" : void 0
74
74
  }),
75
75
  s
@@ -84,17 +84,25 @@ const m = g({
84
84
  }
85
85
  ),
86
86
  e.getVisibleCells().map((t) => {
87
- const p = x(t);
88
- return /* @__PURE__ */ n(o.BodyCell, { type: p, children: y(t.column.columnDef.cell, t.getContext()) }, t.id);
87
+ const u = x(t);
88
+ return /* @__PURE__ */ n(
89
+ o.BodyCell,
90
+ {
91
+ type: u,
92
+ style: t.column.columnDef.size != null ? { width: t.column.getSize() } : void 0,
93
+ children: y(t.column.columnDef.cell, t.getContext())
94
+ },
95
+ t.id
96
+ );
89
97
  })
90
98
  ]
91
99
  }
92
- ) : null, a = u.forwardRef(v);
100
+ ) : null, a = f.forwardRef(v);
93
101
  a.displayName = "Row";
94
- const w = a;
102
+ const R = a;
95
103
  function x(e) {
96
104
  return e.column.columnDef.meta && "getType" in e.column.columnDef.meta && typeof e.column.columnDef.meta.getType == "function" ? e.column.columnDef.meta.getType(e.row.original) : "default";
97
105
  }
98
106
  export {
99
- w as Row
107
+ R as Row
100
108
  };
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "publishConfig": {
10
10
  "access": "public"
11
11
  },
12
- "version": "3.6.0",
12
+ "version": "3.6.1",
13
13
  "type": "module",
14
14
  "types": "./dist/index.d.ts",
15
15
  "sideEffects": [