@ztwoint/z-ui 0.1.40 → 0.1.41

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 (30) hide show
  1. package/dist/components/assets/icons/chevron-right.d.ts +1 -2
  2. package/dist/components/assets/icons/chevron-right.js +13 -27
  3. package/dist/components/button/button.js +9 -9
  4. package/dist/components/file-upload-area/file-upload-area.js +2 -2
  5. package/dist/components/table/components/pagination/components/pagination-info.js +12 -12
  6. package/dist/components/table/components/pagination/pagination.const.d.ts +1 -1
  7. package/dist/components/table/components/pagination/pagination.const.js +1 -1
  8. package/dist/components/table/components/pagination/pagination.js +43 -43
  9. package/dist/components/table/components/pagination/pagination.utils.js +17 -15
  10. package/dist/components/table/components/table-footer.js +8 -3
  11. package/dist/components/table/components/table-header/stories/basic-header.d.ts +3 -0
  12. package/dist/components/table/components/table-header/stories/custom-header-content.d.ts +3 -0
  13. package/dist/components/table/components/table-header/stories/header-for-sorting.d.ts +3 -0
  14. package/dist/components/table/components/table-header/table-header.storiesOld.d.ts +6 -0
  15. package/dist/components/table/components/table-header-wrapper.js +6 -10
  16. package/dist/components/table/components/table-search/table-search.js +4 -4
  17. package/dist/components/table-card/table-card.js +118 -92
  18. package/dist/components/table-card/table-card.type.d.ts +7 -1
  19. package/dist/css/config/components/button.css +8 -0
  20. package/dist/css/config/components/file-upload-area.css +11 -0
  21. package/dist/css/config/components/index.css +1 -0
  22. package/dist/css/styles/tailwind.css +1 -1
  23. package/dist/types/components/assets/icons/chevron-right.d.ts +1 -2
  24. package/dist/types/components/table/components/pagination/pagination.const.d.ts +1 -1
  25. package/dist/types/components/table/components/table-header/stories/basic-header.d.ts +3 -0
  26. package/dist/types/components/table/components/table-header/stories/custom-header-content.d.ts +3 -0
  27. package/dist/types/components/table/components/table-header/stories/header-for-sorting.d.ts +3 -0
  28. package/dist/types/components/table/components/table-header/table-header.storiesOld.d.ts +6 -0
  29. package/dist/types/components/table-card/table-card.type.d.ts +7 -1
  30. package/package.json +1 -1
@@ -1,8 +1,7 @@
1
1
  import { SVGProps } from 'react';
2
2
  type IconProps = SVGProps<SVGSVGElement> & {
3
3
  secondaryfill?: string;
4
- strokewidth?: number;
5
4
  title?: string;
6
5
  };
7
- declare function ChevronRightIcon({ fill, secondaryfill: _secondaryfill, strokewidth: _strokewidth, width, height, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
6
+ declare function ChevronRightIcon({ fill, title, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
8
7
  export default ChevronRightIcon;
@@ -9,7 +9,7 @@ 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: "leading-none-sm text-text-neutral-secondary";
12
+ readonly info: "leading-none-medium-sm text-text-neutral-secondary";
13
13
  readonly jumper: "flex items-center gap-2 text-sm text-text-neutral-primary";
14
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
  };
@@ -0,0 +1,3 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ export declare const basicHeaderUsageCode = "import { Table, TableHeader } from '@/components/table';\n\nconst schema = [\n {\n key: 'id',\n title: 'ID',\n cellType: 'number',\n sortable: true,\n },\n {\n key: 'name',\n title: 'Name',\n cellType: 'text',\n sortable: true,\n },\n];\n\nconst data = [\n { id: 1, name: 'John Doe' },\n { id: 2, name: 'Jane Smith' },\n];\n\nfunction MyTable() {\n return (\n <Table dataSource={data} schema={schema}>\n <table className=\"w-full\">\n <TableHeader \n schema={schema}\n cell={{ cellHeight: 'small', hasBorder: true }}\n />\n {/* Table body goes here */}\n </table>\n </Table>\n );\n}";
3
+ export declare const BasicHeader: StoryObj;
@@ -0,0 +1,3 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ export declare const customHeaderUsageCode = "import { TableHeaderWrapper, TableHeaderContent } from '@/components/table';\n\nfunction CustomHeader() {\n return (\n <TableHeaderWrapper>\n <tr>\n <TableHeaderContent className=\"font-bold text-blue-600\">\n Custom Header 1\n </TableHeaderContent>\n <TableHeaderContent className=\"font-bold text-green-600\">\n Custom Header 2\n </TableHeaderContent>\n </tr>\n </TableHeaderWrapper>\n );\n}";
3
+ export declare const CustomHeaderContent: StoryObj;
@@ -0,0 +1,3 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ export declare const sortingUsageCode = "import { useState } from 'react';\nimport { Table, TableHeader } from '@/components/table';\nimport { SortColumn } from '@/components/table/table.type';\n\nfunction SortableTable() {\n const [sortedColumns, setSortedColumns] = useState<SortColumn[]>([]);\n\n const handleSort = (field: string, direction: 'asc' | 'desc' | null) => {\n setSortedColumns(prev => {\n if (direction === null) {\n return prev.filter(col => col.field !== field);\n }\n const exists = prev.find(col => col.field === field);\n if (exists) {\n return prev.map(col => \n col.field === field ? { ...col, direction } : col\n );\n }\n return [...prev, { field, direction }];\n });\n };\n\n return (\n <Table dataSource={data} schema={schema}>\n <table className=\"w-full\">\n <TableHeader \n schema={schema}\n sort={{\n sortedColumns,\n onSort: handleSort,\n }}\n cell={{ cellHeight: 'small', hasBorder: true }}\n />\n {/* Table body goes here */}\n </table>\n </Table>\n );\n}";
3
+ export declare const HeaderWithSorting: StoryObj;
@@ -0,0 +1,6 @@
1
+ import type { Meta } from '@storybook/react';
2
+ import { TableHeaderWrapper } from '../index';
3
+ declare const meta: Meta<typeof TableHeaderWrapper>;
4
+ export default meta;
5
+ export { BasicHeader } from './stories/basic-header';
6
+ export { HeaderWithSorting } from './stories/header-for-sorting';
@@ -5,12 +5,15 @@ export interface TableCardProps {
5
5
  dataSource: Record<string, unknown>[];
6
6
  schema: TableSchema;
7
7
  className?: string;
8
+ rounded?: boolean;
9
+ bordered?: boolean;
8
10
  showHeader?: boolean;
9
11
  headerClassName?: string;
10
12
  search?: Partial<TableSearch> & {
11
13
  className?: string;
12
14
  };
13
15
  filter?: Partial<TableFilter>;
16
+ headerLeftContent?: React.ReactNode;
14
17
  headerActions?: React.ReactNode;
15
18
  body?: {
16
19
  cell?: TableProps['cell'];
@@ -21,7 +24,10 @@ export interface TableCardProps {
21
24
  showFooter?: boolean;
22
25
  footerClassName?: string;
23
26
  pagination?: Partial<PaginationProps>;
24
- paginationInfo?: Partial<PaginationInfoProps>;
27
+ paginationInfo?: Partial<Omit<PaginationInfoProps, 'itemsPerPage' | 'totalItems'>> & {
28
+ itemsPerPage: number;
29
+ totalItems: number;
30
+ };
25
31
  paginationQuickJumper?: Partial<PaginationQuickJumperProps>;
26
32
  loading?: boolean;
27
33
  emptyMessage?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ztwoint/z-ui",
3
- "version": "0.1.40",
3
+ "version": "0.1.41",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",