@ztwoint/z-ui 0.1.34 → 0.1.35
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.
- package/dist/components/table/components/table-footer.js +1 -1
- package/dist/components/table/components/table-header/table-header.js +1 -1
- package/dist/components/table/table.const.d.ts +1 -1
- package/dist/components/table/table.const.js +1 -1
- package/dist/components/table-card/index.d.ts +1 -1
- package/dist/components/table-card/table-card.js +73 -64
- package/dist/components/table-card/table-card.type.d.ts +19 -27
- package/dist/css/config/colors/semantic-colors.css +28 -27
- package/dist/css/styles/tailwind.css +1 -1
- package/dist/types/components/table/table.const.d.ts +1 -1
- package/dist/types/components/table-card/index.d.ts +1 -1
- package/dist/types/components/table-card/table-card.type.d.ts +19 -27
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
const l = ({ children: e, className: r = "" }) => /* @__PURE__ */ t(
|
|
3
3
|
"div",
|
|
4
4
|
{
|
|
5
|
-
className: `flex justify-between items-center bg-neutral-default border-stroke-solid-light border border-t-[0.5px] gap-3 p-2 pl-4 rounded-b-xl ${r} `,
|
|
5
|
+
className: `flex justify-between items-center bg-neutral-surface-default border-stroke-solid-light border border-t-[0.5px] gap-3 p-2 pl-4 rounded-b-xl ${r} `,
|
|
6
6
|
children: e
|
|
7
7
|
}
|
|
8
8
|
);
|
|
@@ -12,7 +12,7 @@ const x = ({
|
|
|
12
12
|
}) => /* @__PURE__ */ r(
|
|
13
13
|
"thead",
|
|
14
14
|
{
|
|
15
|
-
className: `${t.header} ${s ? "sticky top-[-1.5px] z-
|
|
15
|
+
className: `${t.header} ${s ? "sticky top-[-1.5px] z-1" : ""}`,
|
|
16
16
|
children: /* @__PURE__ */ r("tr", { children: a.map((e) => {
|
|
17
17
|
const l = h(e.key, i), d = p(e.key, i);
|
|
18
18
|
return /* @__PURE__ */ r(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const DEFAULT_EMPTY_MESSAGE = "No data available";
|
|
2
2
|
export declare const TABLE_CSS_CLASSES: {
|
|
3
3
|
readonly table: "w-full";
|
|
4
|
-
readonly header: "bg-neutral-
|
|
4
|
+
readonly header: "bg-background-neutral-medium text-text-neutral-secondary";
|
|
5
5
|
readonly cell: {
|
|
6
6
|
readonly default: "px-4 py-3 text-sm";
|
|
7
7
|
readonly cellHeight: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as TableCard } from './table-card';
|
|
2
|
-
export type { TableCardProps
|
|
2
|
+
export type { TableCardProps } from './table-card.type';
|
|
@@ -1,83 +1,92 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as l, jsxs as d } from "react/jsx-runtime";
|
|
2
2
|
import { Table as e } from "../table/table-provider.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { cn as
|
|
4
|
+
import { cn as o } from "../../lib/utils.js";
|
|
5
5
|
import "../table/table.context.js";
|
|
6
6
|
import "../button/button.js";
|
|
7
7
|
import "../input/input.js";
|
|
8
|
-
const
|
|
9
|
-
dataSource:
|
|
10
|
-
schema:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
const S = ({
|
|
9
|
+
dataSource: f,
|
|
10
|
+
schema: m,
|
|
11
|
+
loading: u,
|
|
12
|
+
emptyMessage: N,
|
|
13
|
+
className: H,
|
|
14
|
+
showHeader: P = !0,
|
|
15
|
+
headerClassName: v,
|
|
16
|
+
search: s,
|
|
17
|
+
filter: h,
|
|
18
|
+
headerActions: n,
|
|
19
|
+
body: r = {
|
|
17
20
|
cell: { cellHeight: "small", hasBorder: !0 },
|
|
18
21
|
className: "",
|
|
19
22
|
stickyHeader: !0
|
|
20
23
|
},
|
|
21
|
-
showFooter:
|
|
22
|
-
footerClassName:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
overrides: n = {},
|
|
27
|
-
...y
|
|
24
|
+
showFooter: C = !0,
|
|
25
|
+
footerClassName: _,
|
|
26
|
+
pagination: a,
|
|
27
|
+
paginationInfo: c,
|
|
28
|
+
paginationQuickJumper: t
|
|
28
29
|
}) => {
|
|
29
|
-
const
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
),
|
|
44
|
-
d && /* @__PURE__ */ a(
|
|
45
|
-
e.Filter,
|
|
46
|
-
{
|
|
47
|
-
schema: h,
|
|
48
|
-
filter: {
|
|
49
|
-
value: d.value || [],
|
|
50
|
-
onChange: d.onChange || (() => {
|
|
51
|
-
})
|
|
30
|
+
const x = a || c || t, g = s || h || n;
|
|
31
|
+
return /* @__PURE__ */ l("div", { className: o("flex flex-col overflow-hidden", H), children: /* @__PURE__ */ d(e, { dataSource: f, schema: m, loading: u, emptyMessage: N, children: [
|
|
32
|
+
P && g && /* @__PURE__ */ d(e.Header, { className: o("flex-shrink-0", v), children: [
|
|
33
|
+
/* @__PURE__ */ d(e.HeaderContent, { children: [
|
|
34
|
+
s && /* @__PURE__ */ l(
|
|
35
|
+
e.Search,
|
|
36
|
+
{
|
|
37
|
+
search: {
|
|
38
|
+
value: s.value || "",
|
|
39
|
+
onChange: s.onChange || (() => {
|
|
40
|
+
}),
|
|
41
|
+
placeholder: s.placeholder
|
|
42
|
+
},
|
|
43
|
+
className: s.className
|
|
52
44
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
45
|
+
),
|
|
46
|
+
h && /* @__PURE__ */ l(
|
|
47
|
+
e.Filter,
|
|
48
|
+
{
|
|
49
|
+
schema: m,
|
|
50
|
+
filter: {
|
|
51
|
+
value: h.value || [],
|
|
52
|
+
onChange: h.onChange || (() => {
|
|
53
|
+
})
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
] }),
|
|
58
|
+
n && /* @__PURE__ */ l(e.HeaderContent, { children: n })
|
|
59
|
+
] }),
|
|
60
|
+
/* @__PURE__ */ l(
|
|
57
61
|
e.Body,
|
|
58
62
|
{
|
|
59
|
-
cell:
|
|
60
|
-
sort:
|
|
61
|
-
className:
|
|
63
|
+
cell: r == null ? void 0 : r.cell,
|
|
64
|
+
sort: r == null ? void 0 : r.sort,
|
|
65
|
+
className: o(
|
|
62
66
|
"flex-1 min-h-0",
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
"border-stroke-solid-light border-b-1 border-x-1 border-t-0",
|
|
68
|
+
!(P && g) && "rounded-t-xl",
|
|
69
|
+
!(C && x) && "rounded-b-xl",
|
|
70
|
+
"[&_td:first-child]:border-l-0 [&_td:last-child]:border-r-0",
|
|
71
|
+
"[&_th:first-child]:border-l-0 [&_th:last-child]:border-r-0",
|
|
72
|
+
"[&_tr:last-child_td]:border-b-0",
|
|
73
|
+
r == null ? void 0 : r.className
|
|
65
74
|
),
|
|
66
|
-
stickyHeader:
|
|
75
|
+
stickyHeader: r == null ? void 0 : r.stickyHeader
|
|
67
76
|
}
|
|
68
77
|
),
|
|
69
|
-
|
|
70
|
-
|
|
78
|
+
C && x && /* @__PURE__ */ d(e.Footer, { className: o("flex-shrink-0", _), children: [
|
|
79
|
+
c && /* @__PURE__ */ l(e.FooterContent, { children: /* @__PURE__ */ l(
|
|
71
80
|
e.PaginationInfo,
|
|
72
81
|
{
|
|
73
|
-
showTotal:
|
|
74
|
-
totalItems:
|
|
75
|
-
currentPage:
|
|
76
|
-
itemsPerPage:
|
|
82
|
+
showTotal: c.showTotal || !1,
|
|
83
|
+
totalItems: c.totalItems || 0,
|
|
84
|
+
currentPage: c.currentPage || 1,
|
|
85
|
+
itemsPerPage: c.itemsPerPage || 10
|
|
77
86
|
}
|
|
78
87
|
) }),
|
|
79
|
-
(t ||
|
|
80
|
-
t && /* @__PURE__ */
|
|
88
|
+
(t || a) && /* @__PURE__ */ d(e.FooterContent, { children: [
|
|
89
|
+
t && /* @__PURE__ */ l(
|
|
81
90
|
e.PaginationQuickJumper,
|
|
82
91
|
{
|
|
83
92
|
currentPage: t.currentPage || 1,
|
|
@@ -87,12 +96,12 @@ const J = ({
|
|
|
87
96
|
disabled: t.disabled || !1
|
|
88
97
|
}
|
|
89
98
|
),
|
|
90
|
-
|
|
99
|
+
a && /* @__PURE__ */ l(
|
|
91
100
|
e.Pagination,
|
|
92
101
|
{
|
|
93
|
-
currentPage:
|
|
94
|
-
totalPage:
|
|
95
|
-
onChange:
|
|
102
|
+
currentPage: a.currentPage || 1,
|
|
103
|
+
totalPage: a.totalPage || 1,
|
|
104
|
+
onChange: a.onChange || (() => {
|
|
96
105
|
})
|
|
97
106
|
}
|
|
98
107
|
)
|
|
@@ -101,5 +110,5 @@ const J = ({
|
|
|
101
110
|
] }) });
|
|
102
111
|
};
|
|
103
112
|
export {
|
|
104
|
-
|
|
113
|
+
S as default
|
|
105
114
|
};
|
|
@@ -1,36 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TableProps, TableSchema, TableFilter, TableSearch, TableSort } from '../table/table.type';
|
|
2
3
|
import { PaginationProps, PaginationInfoProps, PaginationQuickJumperProps } from '../table/components/pagination/pagination.type';
|
|
3
|
-
export interface
|
|
4
|
-
className?: string;
|
|
5
|
-
}
|
|
6
|
-
export type TableCardFilter = Partial<TableFilterType>;
|
|
7
|
-
export type TableCardPaginationInfo = Partial<PaginationInfoProps>;
|
|
8
|
-
export type TableCardPaginationQuickJumper = Partial<PaginationQuickJumperProps>;
|
|
9
|
-
export type TableCardPagination = Partial<PaginationProps>;
|
|
10
|
-
export type TableCardBodyProps = Pick<TableProps, 'cell' | 'sort'> & {
|
|
11
|
-
className?: string;
|
|
12
|
-
stickyHeader?: boolean;
|
|
13
|
-
};
|
|
14
|
-
export interface TableCardProps extends Omit<TableProps, 'filter' | 'pagination' | 'sort'> {
|
|
4
|
+
export interface TableCardProps {
|
|
15
5
|
dataSource: Record<string, unknown>[];
|
|
16
6
|
schema: TableSchema;
|
|
17
7
|
className?: string;
|
|
18
8
|
showHeader?: boolean;
|
|
19
9
|
headerClassName?: string;
|
|
20
|
-
search?:
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
search?: Partial<TableSearch> & {
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
filter?: Partial<TableFilter>;
|
|
14
|
+
headerActions?: React.ReactNode;
|
|
15
|
+
body?: {
|
|
16
|
+
cell?: TableProps['cell'];
|
|
17
|
+
sort?: TableSort;
|
|
18
|
+
className?: string;
|
|
19
|
+
stickyHeader?: boolean;
|
|
20
|
+
};
|
|
23
21
|
showFooter?: boolean;
|
|
24
22
|
footerClassName?: string;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
filter?: Partial<TableCardFilter>;
|
|
31
|
-
body?: Partial<TableCardBodyProps>;
|
|
32
|
-
paginationInfo?: Partial<TableCardPaginationInfo>;
|
|
33
|
-
paginationQuickJumper?: Partial<TableCardPaginationQuickJumper>;
|
|
34
|
-
pagination?: Partial<TableCardPagination>;
|
|
35
|
-
};
|
|
23
|
+
pagination?: Partial<PaginationProps>;
|
|
24
|
+
paginationInfo?: Partial<PaginationInfoProps>;
|
|
25
|
+
paginationQuickJumper?: Partial<PaginationQuickJumperProps>;
|
|
26
|
+
loading?: boolean;
|
|
27
|
+
emptyMessage?: string;
|
|
36
28
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/* Semantic Colors - Design System Foundation */
|
|
2
2
|
|
|
3
3
|
:root {
|
|
4
|
-
/* Background Colors */
|
|
5
|
-
--background-default: var(--neutral-0);
|
|
6
|
-
--background-on-top: var(--neutral-0);
|
|
7
|
-
--background-light: var(--neutral-25);
|
|
8
|
-
--background-medium: var(--neutral-50);
|
|
9
|
-
--background-high: var(--neutral-100);
|
|
10
|
-
--background-inverted-elevated: rgba(255, 255, 255, 0.1);
|
|
11
|
-
--background-attention: var(--neutral-200);
|
|
12
|
-
--background-brand: #001534;
|
|
13
4
|
|
|
5
|
+
/* Background Colors - Neutral */
|
|
6
|
+
--background-neutral-default: var(--neutral-0);
|
|
7
|
+
--background-neutral-on-top: var(--neutral-0);
|
|
8
|
+
--background-neutral-light: var(--neutral-25);
|
|
9
|
+
--background-neutral-medium: var(--neutral-50);
|
|
10
|
+
--background-neutral-high: var(--neutral-100);
|
|
11
|
+
--background-neutral-pressed: var(--neutral-75);
|
|
12
|
+
--background-neutral-hover: var(--neutral-50);
|
|
13
|
+
--background-neutral-focused: var(--neutral-25);
|
|
14
14
|
/* Surface Colors - Neutral */
|
|
15
15
|
--surface-neutral-default: var(--neutral-0);
|
|
16
16
|
--surface-neutral-hover: var(--neutral-75);
|
|
@@ -119,16 +119,17 @@
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
.dark {
|
|
122
|
-
/* Background Colors - Dark Mode */
|
|
123
|
-
--background-default: var(--neutral-0);
|
|
124
|
-
--background-on-top: var(--neutral-50);
|
|
125
|
-
--background-light: var(--neutral-25);
|
|
126
|
-
--background-medium: var(--neutral-25);
|
|
127
|
-
--background-high: var(--neutral-100);
|
|
128
|
-
--background-inverted-elevated: rgba(20, 20, 20, 0.1);
|
|
129
|
-
--background-attention: var(--neutral-200);
|
|
130
|
-
--background-brand: #0f0f0f;
|
|
131
122
|
|
|
123
|
+
|
|
124
|
+
/* Background Colors - Neutral - Dark Mode */
|
|
125
|
+
--background-neutral-default: var(--neutral-0);
|
|
126
|
+
--background-neutral-on-top: var(--neutral-50);
|
|
127
|
+
--background-neutral-light: var(--neutral-25);
|
|
128
|
+
--background-neutral-medium: var(--neutral-25);
|
|
129
|
+
--background-neutral-high: var(--neutral-100);
|
|
130
|
+
--background-neutral-pressed: var(--neutral-75);
|
|
131
|
+
--background-neutral-hover: var(--neutral-50);
|
|
132
|
+
--background-neutral-focused: var(--neutral-25);
|
|
132
133
|
/* Surface Colors - Neutral - Dark Mode */
|
|
133
134
|
--surface-neutral-default: var(--neutral-0);
|
|
134
135
|
--surface-neutral-hover: var(--neutral-75);
|
|
@@ -238,16 +239,16 @@
|
|
|
238
239
|
|
|
239
240
|
/* Tailwind v4 Theme Integration */
|
|
240
241
|
@theme inline {
|
|
241
|
-
/* Background Colors */
|
|
242
|
-
--color-background-default: var(--background-default);
|
|
243
|
-
--color-background-on-top: var(--background-on-top);
|
|
244
|
-
--color-background-light: var(--background-light);
|
|
245
|
-
--color-background-medium: var(--background-medium);
|
|
246
|
-
--color-background-high: var(--background-high);
|
|
247
|
-
--color-background-inverted-elevated: var(--background-inverted-elevated);
|
|
248
|
-
--color-background-attention: var(--background-attention);
|
|
249
|
-
--color-background-brand: var(--background-brand);
|
|
250
242
|
|
|
243
|
+
/* Background Colors - Neutral */
|
|
244
|
+
--color-background-neutral-default: var(--background-neutral-default);
|
|
245
|
+
--color-background-neutral-on-top: var(--background-neutral-on-top);
|
|
246
|
+
--color-background-neutral-light: var(--background-neutral-light);
|
|
247
|
+
--color-background-neutral-medium: var(--background-neutral-medium);
|
|
248
|
+
--color-background-neutral-high: var(--background-neutral-high);
|
|
249
|
+
--color-background-neutral-pressed: var(--background-neutral-pressed);
|
|
250
|
+
--color-background-neutral-hover: var(--background-neutral-hover);
|
|
251
|
+
--color-background-neutral-focused: var(--background-neutral-focused);
|
|
251
252
|
/* Surface Colors - Neutral */
|
|
252
253
|
--color-surface-neutral-default: var(--surface-neutral-default);
|
|
253
254
|
--color-surface-neutral-hover: var(--surface-neutral-hover);
|