@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
package/dist/index.js CHANGED
@@ -38,26 +38,26 @@ import { extractCellValue as Te, getNestedValue as be } from "./components/table
38
38
  import { DEFAULT_EMPTY_MESSAGE as ge, TABLE_CSS_CLASSES as we } from "./components/table/table.const.js";
39
39
  import { TableContext as se, useTableContext as Ie } from "./components/table/table.context.js";
40
40
  import { TableCell as Me } from "./components/table/components/table-cell.js";
41
- import { TableHeader as Ae } from "./components/table/components/table-header/table-header.js";
41
+ import { TextCell as Ae } from "./components/table/components/cell/text-cell.js";
42
+ import { NumberCell as Pe } from "./components/table/components/cell/number-cell.js";
43
+ import { BooleanCell as Le } from "./components/table/components/cell/boolean-cell.js";
44
+ import { TableHeader as He } from "./components/table/components/table-header/table-header.js";
42
45
  import "react/jsx-runtime";
43
- import { TableRow as Pe } from "./components/table/components/table-row.js";
44
- import { TableEmptyState as Le } from "./components/table/components/table-empty-state.js";
45
- import { TableLoadingState as He } from "./components/table/components/table-loading-state.js";
46
- import { Pagination as ye } from "./components/table/components/pagination/pagination.js";
46
+ import { TableRow as ye } from "./components/table/components/table-row.js";
47
+ import { TableEmptyState as Ge } from "./components/table/components/table-empty-state.js";
48
+ import { TableLoadingState as Ue } from "./components/table/components/table-loading-state.js";
49
+ import { Pagination as We } from "./components/table/components/pagination/pagination.js";
50
+ import { TableHeaderWrapper as Oe } from "./components/table/components/table-header-wrapper.js";
51
+ import { TableHeaderContent as Qe } from "./components/table/components/table-header-content.js";
52
+ import { TableFooter as je } from "./components/table/components/table-footer.js";
53
+ import { TableFooterContent as ze } from "./components/table/components/table-footer-content.js";
54
+ import { MagnifierIcon as Xe } from "./components/assets/icons/magnifier-icon.js";
55
+ import { TableFilter as or } from "./components/table/components/table-filter/table-filter.js";
56
+ import { PaginationInfo as rr } from "./components/table/components/pagination/components/pagination-info.js";
57
+ import { PaginationQuickJumper as pr } from "./components/table/components/pagination/components/pagination-quick-jumper.js";
47
58
  import "react";
48
- import { TableHeaderWrapper as Ge } from "./components/table/components/table-header-wrapper.js";
49
- import { TableHeaderContent as Ue } from "./components/table/components/table-header-content.js";
50
- import { TableFooter as We } from "./components/table/components/table-footer.js";
51
- import { TableFooterContent as Oe } from "./components/table/components/table-footer-content.js";
52
- import { TextCell as Qe } from "./components/table/components/cell/text-cell.js";
53
- import { NumberCell as je } from "./components/table/components/cell/number-cell.js";
54
- import { BooleanCell as ze } from "./components/table/components/cell/boolean-cell.js";
55
- import { TableFilter as Xe } from "./components/table/components/table-filter/table-filter.js";
56
- import { PaginationInfo as or } from "./components/table/components/pagination/components/pagination-info.js";
57
- import { PaginationQuickJumper as rr } from "./components/table/components/pagination/components/pagination-quick-jumper.js";
58
- import { Z2Tooltip as pr } from "./components/tooltip/tooltip.js";
59
- import { InfoIcon as nr } from "./components/assets/icons/info-icon.js";
60
- import { MagnifierIcon as mr } from "./components/assets/icons/magnifier-icon.js";
59
+ import { Z2Tooltip as nr } from "./components/tooltip/tooltip.js";
60
+ import { InfoIcon as mr } from "./components/assets/icons/info-icon.js";
61
61
  import { useTheme as xr } from "./lib/theme.hook.js";
62
62
  import { cn as Zr } from "./lib/utils.js";
63
63
  import { Z2PopoverTrigger as Sr } from "./components/collapsible-side-nav-bar/popover/popover-trigger.js";
@@ -67,7 +67,7 @@ export {
67
67
  f as AlertCirclesIcon,
68
68
  n as AlertDescription,
69
69
  l as AlertTitle,
70
- ze as BooleanCell,
70
+ Le as BooleanCell,
71
71
  i as Button,
72
72
  _ as ChevronUpIcon,
73
73
  R as CirclesIcon,
@@ -77,14 +77,14 @@ export {
77
77
  V as DatabaseCopy,
78
78
  fo as DropdownContext,
79
79
  yo as FileUploadArea,
80
- nr as InfoIcon,
80
+ mr as InfoIcon,
81
81
  Uo as Input,
82
- mr as MagnifierIcon,
82
+ Xe as MagnifierIcon,
83
83
  Wo as NavHeader,
84
84
  Oo as NavItem,
85
- je as NumberCell,
86
- or as PaginationInfo,
87
- rr as PaginationQuickJumper,
85
+ Pe as NumberCell,
86
+ rr as PaginationInfo,
87
+ pr as PaginationQuickJumper,
88
88
  Y as SIDEBAR_WIDTH,
89
89
  j as SIDEBAR_WIDTH_COLLAPSED,
90
90
  J as SidebarLeftShowCopy,
@@ -94,18 +94,18 @@ export {
94
94
  ue as TableBody,
95
95
  Me as TableCell,
96
96
  se as TableContext,
97
- Le as TableEmptyState,
98
- Xe as TableFilter,
99
- We as TableFooter,
100
- Oe as TableFooterContent,
101
- Ae as TableHeader,
102
- Ue as TableHeaderContent,
103
- Ge as TableHeaderWrapper,
104
- He as TableLoadingState,
105
- ye as TablePagination,
97
+ Ge as TableEmptyState,
98
+ or as TableFilter,
99
+ je as TableFooter,
100
+ ze as TableFooterContent,
101
+ He as TableHeader,
102
+ Qe as TableHeaderContent,
103
+ Oe as TableHeaderWrapper,
104
+ Ue as TableLoadingState,
105
+ We as TablePagination,
106
106
  de as TableProvider,
107
- Pe as TableRow,
108
- Qe as TextCell,
107
+ ye as TableRow,
108
+ Ae as TextCell,
109
109
  k as WindowLeftCopy,
110
110
  X as Z2Dialog,
111
111
  $ as Z2DialogClose,
@@ -168,7 +168,7 @@ export {
168
168
  me as Z2TabsContent,
169
169
  fe as Z2TabsList,
170
170
  xe as Z2TabsTrigger,
171
- pr as Z2Tooltip,
171
+ nr as Z2Tooltip,
172
172
  Z as buttonVariants,
173
173
  Zr as cn,
174
174
  Te as extractCellValue,
@@ -1,2 +1,3 @@
1
1
  export { default as DefaultPage } from './default';
2
2
  export { default as TablePage } from './table';
3
+ export { default as TableCardPage } from './table-card';
@@ -0,0 +1,2 @@
1
+ declare const TableCardPage: () => import("react/jsx-runtime").JSX.Element;
2
+ export default TableCardPage;
@@ -1,2 +1,3 @@
1
1
  import React from 'react';
2
- export declare const Input: React.FC<React.InputHTMLAttributes<HTMLInputElement>>;
2
+ import { InputProps } from './input.type';
3
+ export declare const Input: React.FC<InputProps>;
@@ -0,0 +1,6 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
3
+ size: 'large' | 'small';
4
+ leftIcon?: React.ReactNode;
5
+ rightIcon?: React.ReactNode;
6
+ }
@@ -1,11 +1,12 @@
1
1
  export { TableCell } from './table-cell';
2
- export { TableHeader, TableSortIcon } from './table-header';
2
+ export { TextCell, NumberCell, BooleanCell } from './cell';
3
+ export { TableHeader } from './table-header';
3
4
  export { TableRow } from './table-row';
4
5
  export { TableEmptyState } from './table-empty-state';
5
6
  export { TableLoadingState } from './table-loading-state';
6
- export { Pagination as TablePagination } from './pagination';
7
+ export { Pagination as TablePagination } from './pagination/pagination';
7
8
  export { TableHeaderWrapper } from './table-header-wrapper';
8
9
  export { TableHeaderContent } from './table-header-content';
9
10
  export { TableFooter } from './table-footer';
10
11
  export { TableFooterContent } from './table-footer-content';
11
- export * from './cell';
12
+ export { TableSearch } from './table-search';
@@ -9,9 +9,9 @@ export declare const PAGINATION_CSS_CLASSES: {
9
9
  readonly buttonActive: "bg-blue-600 text-white border-blue-600 hover:bg-blue-700";
10
10
  readonly buttonIcon: "flex items-center justify-center w-8 h-8 text-sm rounded border border-gray-300 bg-white hover:bg-gray-50 disabled:bg-gray-100 disabled:text-gray-400 disabled:cursor-not-allowed transition-colors";
11
11
  readonly ellipsis: "flex items-center justify-center w-8 h-8 text-gray-400";
12
- readonly info: "text-sm text-text-neutral-secondary";
12
+ readonly info: "leading-none-sm text-text-neutral-secondary";
13
13
  readonly jumper: "flex items-center gap-2 text-sm text-text-neutral-primary";
14
- readonly input: "w-16 px-2 py-1 text-sm border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent";
14
+ readonly input: "w-16 px-2 py-1 text-sm h-6 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent";
15
15
  };
16
16
  export declare const PAGINATION_LABELS: {
17
17
  readonly previous: "Previous page";
@@ -5,6 +5,7 @@ interface TableHeaderProps {
5
5
  schema: TableSchemaColumn[];
6
6
  sort?: TableSort;
7
7
  cell: TableProps['cell'];
8
+ stickyHeader?: boolean;
8
9
  }
9
10
  export declare const TableHeader: React.FC<TableHeaderProps>;
10
11
  export {};
@@ -0,0 +1 @@
1
+ export { TableSearch } from './table-search';
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import { TableSearch as TableSearchType } from '../../table.type';
3
+ export interface TableSearchProps {
4
+ search: TableSearchType;
5
+ className?: string;
6
+ }
7
+ export declare const TableSearch: React.FC<TableSearchProps>;
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  import { TableProps } from './table.type';
3
3
  import { TableBody } from './table';
4
4
  import { TableFilter } from './components/table-filter';
5
+ import { TableSearch } from './components/table-search';
5
6
  import { Pagination } from './components/pagination';
6
7
  import { TableHeaderWrapper, TableHeaderContent, TableFooter, TableFooterContent } from './components';
7
8
  import { PaginationInfo, PaginationQuickJumper } from './components/pagination/components';
@@ -12,6 +13,7 @@ declare const TableProvider: React.FC<TableProviderProps>;
12
13
  interface TableCompoundComponent extends React.FC<TableProviderProps> {
13
14
  Body: typeof TableBody;
14
15
  Filter: typeof TableFilter;
16
+ Search: typeof TableSearch;
15
17
  Pagination: typeof Pagination;
16
18
  PaginationInfo: typeof PaginationInfo;
17
19
  PaginationQuickJumper: typeof PaginationQuickJumper;
@@ -1,4 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { TableProps } from './table.type';
3
- export declare const TableBody: React.FC<Partial<TableProps>>;
3
+ export declare const TableBody: React.FC<Partial<TableProps> & {
4
+ className?: string;
5
+ stickyHeader?: boolean;
6
+ }>;
4
7
  export default TableBody;
@@ -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 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
+ }
@@ -1,2 +1,3 @@
1
1
  export { default as DefaultPage } from './default';
2
2
  export { default as TablePage } from './table';
3
+ export { default as TableCardPage } from './table-card';
@@ -0,0 +1,2 @@
1
+ declare const TableCardPage: () => import("react/jsx-runtime").JSX.Element;
2
+ export default TableCardPage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ztwoint/z-ui",
3
- "version": "0.1.30",
3
+ "version": "0.1.31",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",