@ztwoint/z-ui 0.1.30 → 0.1.31

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.
Files changed (49) hide show
  1. package/dist/components/button/button.js +10 -11
  2. package/dist/components/input/input.d.ts +2 -1
  3. package/dist/components/input/input.js +37 -8
  4. package/dist/components/input/input.type.d.ts +6 -0
  5. package/dist/components/table/components/index.d.ts +4 -3
  6. package/dist/components/table/components/pagination/pagination.const.d.ts +2 -2
  7. package/dist/components/table/components/pagination/pagination.const.js +4 -4
  8. package/dist/components/table/components/pagination/pagination.js +67 -63
  9. package/dist/components/table/components/table-filter/table-filter.js +1 -1
  10. package/dist/components/table/components/table-footer-content.js +11 -4
  11. package/dist/components/table/components/table-footer.js +10 -4
  12. package/dist/components/table/components/table-header/table-header.d.ts +1 -0
  13. package/dist/components/table/components/table-header/table-header.js +34 -23
  14. package/dist/components/table/components/table-header-content.js +2 -2
  15. package/dist/components/table/components/table-header-wrapper.js +10 -4
  16. package/dist/components/table/components/table-search/index.d.ts +1 -0
  17. package/dist/components/table/components/table-search/table-search.d.ts +7 -0
  18. package/dist/components/table/components/table-search/table-search.js +21 -0
  19. package/dist/components/table/table-provider.d.ts +2 -0
  20. package/dist/components/table/table-provider.js +29 -27
  21. package/dist/components/table/table.d.ts +4 -1
  22. package/dist/components/table/table.js +26 -24
  23. package/dist/components/table/table.type.d.ts +5 -0
  24. package/dist/components/table-card/index.d.ts +2 -0
  25. package/dist/components/table-card/table-card.d.ts +4 -0
  26. package/dist/components/table-card/table-card.type.d.ts +36 -0
  27. package/dist/css/config/colors/defaults.css +15 -6
  28. package/dist/css/config/components/index.css +1 -0
  29. package/dist/css/config/components/input.css +56 -0
  30. package/dist/css/styles/tailwind.css +1 -1
  31. package/dist/index.js +36 -36
  32. package/dist/routes/index.d.ts +1 -0
  33. package/dist/routes/table-card.d.ts +2 -0
  34. package/dist/types/components/input/input.d.ts +2 -1
  35. package/dist/types/components/input/input.type.d.ts +6 -0
  36. package/dist/types/components/table/components/index.d.ts +4 -3
  37. package/dist/types/components/table/components/pagination/pagination.const.d.ts +2 -2
  38. package/dist/types/components/table/components/table-header/table-header.d.ts +1 -0
  39. package/dist/types/components/table/components/table-search/index.d.ts +1 -0
  40. package/dist/types/components/table/components/table-search/table-search.d.ts +7 -0
  41. package/dist/types/components/table/table-provider.d.ts +2 -0
  42. package/dist/types/components/table/table.d.ts +4 -1
  43. package/dist/types/components/table/table.type.d.ts +5 -0
  44. package/dist/types/components/table-card/index.d.ts +2 -0
  45. package/dist/types/components/table-card/table-card.d.ts +4 -0
  46. package/dist/types/components/table-card/table-card.type.d.ts +36 -0
  47. package/dist/types/routes/index.d.ts +1 -0
  48. package/dist/types/routes/table-card.d.ts +2 -0
  49. package/package.json +1 -1
@@ -1,39 +1,41 @@
1
- import { jsxs as S, jsx as e } from "react/jsx-runtime";
2
- import * as d from "react";
3
- import { DEFAULT_EMPTY_MESSAGE as b, TABLE_CSS_CLASSES as T } from "./table.const.js";
4
- import { TableHeader as u } from "./components/table-header/table-header.js";
5
- import { TableRow as g } from "./components/table-row.js";
6
- import { TableEmptyState as h } from "./components/table-empty-state.js";
7
- import { TableLoadingState as E } from "./components/table-loading-state.js";
8
- import { TableContext as x } from "./table.context.js";
9
- const j = ({
1
+ import { jsx as e, jsxs as b } from "react/jsx-runtime";
2
+ import * as u from "react";
3
+ import { DEFAULT_EMPTY_MESSAGE as T, TABLE_CSS_CLASSES as h } from "./table.const.js";
4
+ import { TableHeader as g } from "./components/table-header/table-header.js";
5
+ import { TableRow as E } from "./components/table-row.js";
6
+ import { TableEmptyState as y } from "./components/table-empty-state.js";
7
+ import { TableLoadingState as x } from "./components/table-loading-state.js";
8
+ import { TableContext as C } from "./table.context.js";
9
+ const w = ({
10
10
  cell: r = { cellHeight: "small", hasBorder: !0 },
11
11
  sort: l,
12
- ...m
12
+ className: m,
13
+ stickyHeader: s = !1,
14
+ ...n
13
15
  }) => {
14
- const s = d.useContext(x), {
16
+ const c = u.useContext(C), {
15
17
  dataSource: o = [],
16
18
  schema: t = [],
17
- loading: n = !1,
18
- emptyMessage: c = b,
19
- customCells: i
20
- } = s || m, p = () => n ? /* @__PURE__ */ e(E, { colSpan: t.length }) : !o || o.length === 0 ? /* @__PURE__ */ e(h, { colSpan: t.length, message: c }) : /* @__PURE__ */ e("tbody", { children: o.map((f, a) => /* @__PURE__ */ e(
21
- g,
19
+ loading: i = !1,
20
+ emptyMessage: f = T,
21
+ customCells: p
22
+ } = c || n, d = () => i ? /* @__PURE__ */ e(x, { colSpan: t.length }) : !o || o.length === 0 ? /* @__PURE__ */ e(y, { colSpan: t.length, message: f }) : /* @__PURE__ */ e("tbody", { children: o.map((S, a) => /* @__PURE__ */ e(
23
+ E,
22
24
  {
23
- record: f,
25
+ record: S,
24
26
  index: a,
25
27
  schema: t,
26
- customCells: i,
28
+ customCells: p,
27
29
  cell: r
28
30
  },
29
31
  a
30
32
  )) });
31
- return /* @__PURE__ */ S("table", { className: T.table, children: [
32
- /* @__PURE__ */ e(u, { schema: t, sort: l, cell: r }),
33
- p()
34
- ] });
33
+ return /* @__PURE__ */ e("div", { className: `${m} overflow-y-auto`, children: /* @__PURE__ */ b("table", { className: h.table, children: [
34
+ /* @__PURE__ */ e(g, { schema: t, sort: l, cell: r, stickyHeader: s }),
35
+ d()
36
+ ] }) });
35
37
  };
36
38
  export {
37
- j as TableBody,
38
- j as default
39
+ w as TableBody,
40
+ w as default
39
41
  };
@@ -18,6 +18,11 @@ export type TableFilter = {
18
18
  value: FilterRule[];
19
19
  onChange: (filters: FilterRule[]) => void;
20
20
  };
21
+ export type TableSearch = {
22
+ value: string;
23
+ onChange: (searchValue: string) => void;
24
+ placeholder?: string;
25
+ };
21
26
  export type TablePaginationConfig = {
22
27
  currentPage: number;
23
28
  totalPage: number;
@@ -0,0 +1,2 @@
1
+ export { default as TableCard } from './table-card';
2
+ export type { TableCardProps, TableCardSearch, TableCardFilter, TableCardPaginationInfo, TableCardPaginationQuickJumper, TableCardPagination, TableCardBodyProps, } from './table-card.type';
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { TableCardProps } from './table-card.type';
3
+ declare const TableCard: React.FC<TableCardProps>;
4
+ export default TableCard;
@@ -0,0 +1,36 @@
1
+ import { TableProps, TableSchema, TableFilter as TableFilterType, TableSearch as TableSearchType } from '../table/table.type';
2
+ import { PaginationProps, PaginationInfoProps, PaginationQuickJumperProps } from '../table/components/pagination/pagination.type';
3
+ export interface TableCardSearch extends Partial<TableSearchType> {
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'> {
15
+ dataSource: Record<string, unknown>[];
16
+ schema: TableSchema;
17
+ className?: string;
18
+ showHeader?: boolean;
19
+ headerClassName?: string;
20
+ search?: TableCardSearch;
21
+ filter?: TableCardFilter;
22
+ body?: TableCardBodyProps;
23
+ showFooter?: boolean;
24
+ footerClassName?: string;
25
+ paginationInfo?: TableCardPaginationInfo;
26
+ paginationQuickJumper?: TableCardPaginationQuickJumper;
27
+ pagination?: TableCardPagination;
28
+ overrides?: {
29
+ search?: Partial<TableCardSearch>;
30
+ filter?: Partial<TableCardFilter>;
31
+ body?: Partial<TableCardBodyProps>;
32
+ paginationInfo?: Partial<TableCardPaginationInfo>;
33
+ paginationQuickJumper?: Partial<TableCardPaginationQuickJumper>;
34
+ pagination?: Partial<TableCardPagination>;
35
+ };
36
+ }
@@ -123,6 +123,13 @@
123
123
  --alpha-two-700: rgba(255, 255, 255, 0.7);
124
124
  --alpha-two-800: rgba(255, 255, 255, 0.8);
125
125
  --alpha-two-900: rgba(255, 255, 255, 0.9);
126
+
127
+ --shadow-custom:
128
+ 0px 2px 4px 0px var(--color-alpha-one-50), 0px 0px 0px 0.5px var(--color-neutral-150);
129
+ --shadow-default:
130
+ 0px 1px 2px 0px var(--color-alpha-one-50), 0px 0px 0px 0.5px var(--color-neutral-150);
131
+
132
+ --shadow-button-disabled: 0px 0px 0px 0.5px var(--neutral-100), 0px 1px 2px 0px transparent;
126
133
  }
127
134
 
128
135
  .dark {
@@ -248,6 +255,13 @@
248
255
  --alpha-two-700: rgba(0, 0, 0, 0.7);
249
256
  --alpha-two-800: rgba(0, 0, 0, 0.8);
250
257
  --alpha-two-900: rgba(0, 0, 0, 0.9);
258
+
259
+ --shadow-custom:
260
+ 0px 2px 4px 0px var(--color-alpha-one-50), 0px 0px 0px 0.5px var(--color-neutral-150);
261
+ --shadow-default:
262
+ 0px 1px 2px 0px var(--color-alpha-one-50), 0px 0px 0px 0.5px var(--color-neutral-150);
263
+
264
+ --shadow-button-disabled: 0px 0px 0px 0.5px var(--neutral-100), 0px 1px 2px 0px transparent;
251
265
  }
252
266
 
253
267
  /* Tailwind v4 Theme Integration */
@@ -375,10 +389,5 @@
375
389
  --color-alpha-two-800: var(--alpha-two-800);
376
390
  --color-alpha-two-900: var(--alpha-two-900);
377
391
 
378
- --shadow-custom:
379
- 0px 2px 4px 0px var(--color-alpha-one-50), 0px 0px 0px 0.5px var(--color-neutral-150);
380
- --shadow-default:
381
- 0px 1px 2px 0px var(--color-alpha-one-50), 0px 0px 0px 0.5px var(--color-neutral-150);
382
- --shadow-button-disabled:
383
- 0px 1px 2px 0px var(--color-neutral-950), 0px 0px 0px 0.5px var(--color-alpha-two-50);
392
+ --shadow-button-disabled: var(--shadow-button-disabled);
384
393
  }
@@ -1 +1,2 @@
1
1
  @import './button.css';
2
+ @import './input.css';
@@ -0,0 +1,56 @@
1
+ /* Input Component Colors - Design System Foundation */
2
+
3
+ :root {
4
+ /* Input - Surface */
5
+ --input-surface-default: var(--neutral-0);
6
+ --input-surface-hover: var(--neutral-50);
7
+ --input-surface-pressed: var(--neutral-100);
8
+ --input-surface-active: var(--neutral-00);
9
+ --input-surface-filled: var(--neutral-25);
10
+ --input-surface-disabled: var(--neutral-50);
11
+
12
+ /* Input - Stroke */
13
+ --input-stroke-default: var(--neutral-150);
14
+ --input-stroke-hover: var(--neutral-200);
15
+ --input-stroke-pressed: transparent;
16
+ --input-stroke-active: var(--neutral-950);
17
+ --input-stroke-filled: var(--neutral-150);
18
+ --input-stroke-disabled: var(--neutral-100);
19
+ }
20
+
21
+ .dark {
22
+ /* Input - Surface - Dark Mode */
23
+ --input-surface-default: var(--neutral-50);
24
+ --input-surface-hover: var(--neutral-100);
25
+ --input-surface-pressed: var(--neutral-150);
26
+ --input-surface-active: var(--neutral-50);
27
+ --input-surface-filled: rgba(0, 0, 0, 0.2);
28
+ --input-surface-disabled: rgba(0, 0, 0, 0.2);
29
+
30
+ /* Input - Stroke - Dark Mode */
31
+ --input-stroke-default: var(--neutral-100);
32
+ --input-stroke-hover: var(--neutral-200);
33
+ --input-stroke-pressed: transparent;
34
+ --input-stroke-active: var(--neutral-950);
35
+ --input-stroke-filled: var(--neutral-50);
36
+ --input-stroke-disabled: var(--neutral-50);
37
+ }
38
+
39
+ /* Tailwind v4 Theme Integration */
40
+ @theme inline {
41
+ /* Input - Surface */
42
+ --color-input-surface-default: var(--input-surface-default);
43
+ --color-input-surface-hover: var(--input-surface-hover);
44
+ --color-input-surface-pressed: var(--input-surface-pressed);
45
+ --color-input-surface-active: var(--input-surface-active);
46
+ --color-input-surface-filled: var(--input-surface-filled);
47
+ --color-input-surface-disabled: var(--input-surface-disabled);
48
+
49
+ /* Input - Stroke */
50
+ --color-input-stroke-default: var(--input-stroke-default);
51
+ --color-input-stroke-hover: var(--input-stroke-hover);
52
+ --color-input-stroke-pressed: var(--input-stroke-pressed);
53
+ --color-input-stroke-active: var(--input-stroke-active);
54
+ --color-input-stroke-filled: var(--input-stroke-filled);
55
+ --color-input-stroke-disabled: var(--input-stroke-disabled);
56
+ }