@sth87/shadcn-design-system 0.2.4 → 0.2.6

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,4 +1,4 @@
1
- import { jsxs as t, jsx as n, Fragment as g } from "react/jsx-runtime";
1
+ import { jsxs as t, jsx as a, Fragment as g } from "react/jsx-runtime";
2
2
  import { Pagination as P } from "../Pagination/index.js";
3
3
  import { cn as S } from "../../packages/ui/src/lib/utils.js";
4
4
  import C from "../Select/Select.js";
@@ -6,15 +6,15 @@ function y({
6
6
  table: e,
7
7
  pageSizeOptions: l = [5, 10, 20, 30, 40, 50, 100],
8
8
  className: m,
9
- showPageInfo: f = !1,
10
- showPageSizeOptions: c = !1,
9
+ showPageInfo: c = !1,
10
+ showPageSizeOptions: f = !1,
11
11
  showRowSelectionCount: p = !1,
12
12
  showTotalCount: u = !1,
13
13
  totalCount: o,
14
14
  showPagination: x = !0,
15
15
  ...h
16
16
  }) {
17
- const { pageIndex: w, pageSize: d } = e.getState().pagination, a = e.getRowCount(), r = e.getFilteredSelectedRowModel().rows.length, i = a === 0 ? 0 : w * d + 1, v = Math.min(i + d - 1, a);
17
+ const { pageIndex: w, pageSize: d } = e.getState().pagination, n = e.getRowCount(), r = e.getFilteredSelectedRowModel().rows.length, i = n === 0 ? 0 : w * d + 1, v = Math.min(i + d - 1, n);
18
18
  return /* @__PURE__ */ t(
19
19
  "div",
20
20
  {
@@ -24,28 +24,29 @@ function y({
24
24
  ),
25
25
  ...h,
26
26
  children: [
27
- /* @__PURE__ */ n("div", { className: "ds:flex-1 ds:whitespace-nowrap ds:text-muted-foreground ds:text-sm", children: p && r > 0 ? /* @__PURE__ */ t(g, { children: [
27
+ /* @__PURE__ */ a("div", { className: "ds:flex-1 ds:whitespace-nowrap ds:text-muted-foreground ds:text-sm", children: p && r > 0 ? /* @__PURE__ */ t(g, { children: [
28
28
  r,
29
29
  " of ",
30
- a,
30
+ n,
31
31
  " row(s) selected."
32
32
  ] }) : u && /* @__PURE__ */ t(g, { children: [
33
- i,
34
- " - ",
35
- v,
36
- " from ",
37
- a,
33
+ "Hiển thị ",
34
+ /* @__PURE__ */ t("strong", { children: [
35
+ i,
36
+ " - ",
37
+ v
38
+ ] }),
38
39
  typeof o == "number" && ` / ${o}`
39
40
  ] }) }),
40
41
  /* @__PURE__ */ t("div", { className: "ds:flex ds:flex-col-reverse ds:items-center ds:gap-2 ds:sm:flex-row ds:sm:gap-2 ds:lg:gap-4", children: [
41
- f && /* @__PURE__ */ t("div", { className: "ds:flex ds:items-center ds:justify-center ds:font-medium ds:text-sm", children: [
42
+ c && /* @__PURE__ */ t("div", { className: "ds:flex ds:items-center ds:justify-center ds:font-medium ds:text-sm", children: [
42
43
  "Page ",
43
44
  e.getState().pagination.pageIndex + 1,
44
45
  " of",
45
46
  " ",
46
47
  e.getPageCount()
47
48
  ] }),
48
- x && /* @__PURE__ */ n(
49
+ x && /* @__PURE__ */ a(
49
50
  P,
50
51
  {
51
52
  total: e.getPageCount(),
@@ -58,7 +59,7 @@ function y({
58
59
  showPreviousNext: !0
59
60
  }
60
61
  ),
61
- c && /* @__PURE__ */ n(
62
+ f && /* @__PURE__ */ a(
62
63
  C,
63
64
  {
64
65
  value: `${e.getState().pagination.pageSize}`,
@@ -67,7 +68,7 @@ function y({
67
68
  },
68
69
  options: l.map((s) => ({
69
70
  value: `${s}`,
70
- label: `${s} / page`
71
+ label: `${s} / trang`
71
72
  }))
72
73
  }
73
74
  )
@@ -10,21 +10,21 @@ function W({
10
10
  table: n,
11
11
  actionBar: g,
12
12
  children: H,
13
- className: P,
13
+ className: R,
14
14
  pagination: a = !0,
15
15
  sticky: s = !0,
16
- stickyFooter: R = !1,
17
- bordered: D = !0,
16
+ stickyFooter: D = !1,
17
+ bordered: P = !0,
18
18
  loading: p,
19
19
  loadingIndicator: I,
20
20
  footer: h,
21
- emptyState: N,
21
+ emptyState: j,
22
22
  onRowClick: u,
23
23
  rowClassName: m,
24
24
  renderRow: w,
25
25
  renderCell: x,
26
26
  classNames: l,
27
- showTotalCount: j = !0,
27
+ showTotalCount: N = !0,
28
28
  totalCount: z,
29
29
  ...M
30
30
  }) {
@@ -37,7 +37,7 @@ function W({
37
37
  {
38
38
  className: d(
39
39
  "ds:flex ds:w-full ds:flex-col ds:gap-2.5 ds:relative",
40
- P
40
+ R
41
41
  ),
42
42
  ...M,
43
43
  children: [
@@ -57,7 +57,7 @@ function W({
57
57
  {
58
58
  className: l?.table,
59
59
  containerClassName: d(
60
- D && "ds:rounded-md ds:border ds:border-border",
60
+ P && "ds:rounded-md ds:border ds:border-border",
61
61
  // Thin, unobtrusive scrollbar that darkens only when hovering the thumb itself
62
62
  "ds:[scrollbar-width:thin] ds:[scrollbar-color:var(--border)_transparent]",
63
63
  "ds:[&::-webkit-scrollbar]:h-1.5 ds:[&::-webkit-scrollbar]:w-1.5",
@@ -144,7 +144,7 @@ function W({
144
144
  {
145
145
  colSpan: v,
146
146
  className: d("ds:h-24 ds:text-center", l?.emptyCell),
147
- children: N ?? "No results."
147
+ children: j ?? "No results."
148
148
  }
149
149
  ) }) }),
150
150
  h && /* @__PURE__ */ e(_, { children: /* @__PURE__ */ e(i, { className: l?.footerRow, children: /* @__PURE__ */ e(
@@ -152,7 +152,7 @@ function W({
152
152
  {
153
153
  colSpan: v,
154
154
  className: l?.footerCell,
155
- style: R ? {
155
+ style: D ? {
156
156
  position: "sticky",
157
157
  bottom: 0,
158
158
  zIndex: 2
@@ -167,12 +167,10 @@ function W({
167
167
  a && /* @__PURE__ */ e(
168
168
  F,
169
169
  {
170
- showTotalCount: j,
170
+ showTotalCount: N,
171
171
  totalCount: z,
172
- showPageInfo: !0,
173
172
  showPageSizeOptions: !0,
174
173
  showRowSelectionCount: !0,
175
- className: "ds:mt-2.5",
176
174
  table: n,
177
175
  ...a === !0 ? {} : a
178
176
  }