@nccirtu/tablefy 0.1.2 → 0.1.4

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 (48) hide show
  1. package/dist/columns/columns/actions-column.d.ts +26 -0
  2. package/dist/columns/columns/avatar-group-column.d.ts +38 -0
  3. package/dist/columns/columns/badge-column.d.ts +22 -0
  4. package/dist/columns/columns/base-column.d.ts +19 -0
  5. package/dist/columns/columns/button-column.d.ts +14 -0
  6. package/dist/columns/columns/checkbox-column.d.ts +5 -0
  7. package/dist/columns/columns/date-column.d.ts +24 -0
  8. package/dist/columns/columns/dropdown-column.d.ts +17 -0
  9. package/dist/columns/columns/icon-column.d.ts +58 -0
  10. package/dist/columns/columns/image-column.d.ts +21 -0
  11. package/dist/columns/columns/index.d.ts +16 -0
  12. package/dist/columns/columns/input-column.d.ts +14 -0
  13. package/dist/columns/columns/link-column.d.ts +27 -0
  14. package/dist/columns/columns/number-column.d.ts +23 -0
  15. package/dist/columns/columns/progress-column.d.ts +30 -0
  16. package/dist/columns/columns/select-column.d.ts +19 -0
  17. package/dist/columns/columns/text-column.d.ts +14 -0
  18. package/dist/columns/columns/types.d.ts +37 -0
  19. package/dist/columns/components/animata/list/avatar-list.d.ts +12 -0
  20. package/dist/columns/components/ui/badge.d.ts +9 -0
  21. package/dist/columns/components/ui/button.d.ts +10 -0
  22. package/dist/columns/components/ui/checkbox.d.ts +4 -0
  23. package/dist/columns/components/ui/data-table/data-table-empty.d.ts +8 -0
  24. package/dist/columns/components/ui/data-table/data-table-header.d.ts +15 -0
  25. package/dist/columns/components/ui/data-table/data-table-pagination.d.ts +9 -0
  26. package/dist/columns/components/ui/data-table/data-table-schema.d.ts +5 -0
  27. package/dist/columns/components/ui/data-table/data-table.d.ts +13 -0
  28. package/dist/columns/components/ui/dropdown-menu.d.ts +25 -0
  29. package/dist/columns/components/ui/input.d.ts +3 -0
  30. package/dist/columns/components/ui/progress.d.ts +4 -0
  31. package/dist/columns/components/ui/select.d.ts +15 -0
  32. package/dist/columns/components/ui/table.d.ts +10 -0
  33. package/dist/columns/components/ui/tooltip.d.ts +7 -0
  34. package/dist/columns/index.d.ts +15 -13
  35. package/dist/columns/index.esm.js +10331 -0
  36. package/dist/columns/index.esm.js.map +1 -0
  37. package/dist/columns/index.js +10365 -0
  38. package/dist/columns/index.js.map +1 -0
  39. package/dist/columns/lib/builders/empty-state.d.ts +27 -0
  40. package/dist/columns/lib/builders/index.d.ts +2 -0
  41. package/dist/columns/lib/builders/table-schema.d.ts +15 -0
  42. package/dist/columns/lib/types/actions.d.ts +20 -0
  43. package/dist/columns/lib/types/empty-state.d.ts +18 -0
  44. package/dist/columns/lib/types/filters.d.ts +25 -0
  45. package/dist/columns/lib/types/index.d.ts +4 -0
  46. package/dist/columns/lib/types/table.d.ts +41 -0
  47. package/dist/columns/lib/utils.d.ts +1 -0
  48. package/package.json +13 -1
@@ -0,0 +1,27 @@
1
+ import { EmptyStateConfig } from "../types/empty-state";
2
+ import React from "react";
3
+ /**
4
+ * Empty State Builder
5
+ * Fluent API for building empty state configurations
6
+ */
7
+ export declare class EmptyStateBuilder {
8
+ private config;
9
+ static make(): EmptyStateBuilder;
10
+ title(title: string): this;
11
+ description(description: string): this;
12
+ icon(icon: React.ReactNode): this;
13
+ imageUrl(imageUrl: string): this;
14
+ action(label: string, onClick?: () => void, href?: string, icon?: React.ReactNode): this;
15
+ variant(variant: "default" | "search" | "filter" | "error" | "custom"): this;
16
+ error(params?: {
17
+ onRetry?: () => void;
18
+ }): this;
19
+ noSearchResults(params?: {
20
+ onClear?: () => void;
21
+ }): this;
22
+ noFilterResults(params?: {
23
+ onReset?: () => void;
24
+ }): this;
25
+ noData(): this;
26
+ build(): EmptyStateConfig;
27
+ }
@@ -0,0 +1,2 @@
1
+ export { TableSchema } from "./table-schema";
2
+ export { EmptyStateBuilder } from "./empty-state";
@@ -0,0 +1,15 @@
1
+ import { ColumnDef } from "@tanstack/react-table";
2
+ type ColumnBuilder<TData> = {
3
+ build(): ColumnDef<TData, unknown>;
4
+ };
5
+ /**
6
+ * Table Schema Builder
7
+ * Fluent API for building table column definitions
8
+ */
9
+ export declare class TableSchema<TData> {
10
+ private columnBuilders;
11
+ static make<TData>(): TableSchema<TData>;
12
+ columns(...builders: ColumnBuilder<TData>[]): this;
13
+ build(): ColumnDef<TData, unknown>[];
14
+ }
15
+ export {};
@@ -0,0 +1,20 @@
1
+ import { ReactNode } from "react";
2
+ /**
3
+ * Header Action Configuration
4
+ * Defines actions that can be displayed in the table header
5
+ */
6
+ export interface HeaderAction<TData = unknown> {
7
+ id: string;
8
+ label: string;
9
+ icon?: ReactNode;
10
+ variant?: "default" | "secondary" | "outline" | "ghost" | "destructive";
11
+ size?: "default" | "sm" | "lg" | "icon";
12
+ onClick?: () => void;
13
+ href?: string;
14
+ disabled?: boolean;
15
+ loading?: boolean;
16
+ bulk?: boolean;
17
+ bulkOnClick?: (selectedRows: TData[]) => void;
18
+ hidden?: boolean;
19
+ children?: Omit<HeaderAction<TData>, "children" | "bulk">[];
20
+ }
@@ -0,0 +1,18 @@
1
+ import { ReactNode } from "react";
2
+ /**
3
+ * Empty State Configuration
4
+ * Defines how empty states are displayed in the table
5
+ */
6
+ export interface EmptyStateConfig {
7
+ icon?: ReactNode;
8
+ imageUrl?: string;
9
+ title: string;
10
+ description?: string;
11
+ action?: {
12
+ label: string;
13
+ onClick?: () => void;
14
+ href?: string;
15
+ icon?: ReactNode;
16
+ };
17
+ variant?: "default" | "search" | "filter" | "error" | "custom";
18
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Filter Configuration
3
+ * Defines filters that can be applied to table data
4
+ */
5
+ export interface FilterConfig {
6
+ id: string;
7
+ label: string;
8
+ type: "text" | "select" | "multi-select" | "date" | "date-range" | "boolean";
9
+ column: string;
10
+ placeholder?: string;
11
+ options?: Array<{
12
+ label: string;
13
+ value: string;
14
+ }>;
15
+ }
16
+ /**
17
+ * Search Configuration
18
+ * Defines search functionality for the table
19
+ */
20
+ export interface SearchConfig {
21
+ enabled: boolean;
22
+ placeholder?: string;
23
+ columns?: string[];
24
+ debounce?: number;
25
+ }
@@ -0,0 +1,4 @@
1
+ export type { HeaderAction } from "./actions";
2
+ export type { EmptyStateConfig } from "./empty-state";
3
+ export type { FilterConfig, SearchConfig } from "./filters";
4
+ export type { PaginationConfig, DataTableConfig } from "./table";
@@ -0,0 +1,41 @@
1
+ import { HeaderAction } from "./actions";
2
+ import { EmptyStateConfig } from "./empty-state";
3
+ import { FilterConfig, SearchConfig } from "./filters";
4
+ /**
5
+ * Pagination Configuration
6
+ * Defines pagination settings for the table
7
+ */
8
+ export interface PaginationConfig {
9
+ enabled: boolean;
10
+ pageSize?: number;
11
+ pageSizeOptions?: number[];
12
+ showPageInfo?: boolean;
13
+ showPageSizeSelector?: boolean;
14
+ }
15
+ /**
16
+ * Complete Data Table Configuration
17
+ * Main configuration object for the data table component
18
+ */
19
+ export interface DataTableConfig<TData> {
20
+ title?: string;
21
+ description?: string;
22
+ headerActions?: HeaderAction<TData>[];
23
+ emptyState?: EmptyStateConfig;
24
+ searchEmptyState?: EmptyStateConfig;
25
+ filterEmptyState?: EmptyStateConfig;
26
+ search?: SearchConfig;
27
+ filters?: FilterConfig[];
28
+ pagination?: PaginationConfig;
29
+ enableRowSelection?: boolean;
30
+ enableMultiRowSelection?: boolean;
31
+ enableSorting?: boolean;
32
+ defaultSort?: {
33
+ id: string;
34
+ desc: boolean;
35
+ };
36
+ enableColumnVisibility?: boolean;
37
+ density?: "compact" | "default" | "comfortable";
38
+ bordered?: boolean;
39
+ striped?: boolean;
40
+ hoverable?: boolean;
41
+ }
@@ -0,0 +1 @@
1
+ export declare function cn(...inputs: Array<string | boolean | undefined | null>): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nccirtu/tablefy",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "A powerful, type-safe React table package built with TanStack Table and shadcn/ui components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -68,6 +68,18 @@
68
68
  "import": "./dist/index.esm.js",
69
69
  "require": "./dist/index.js",
70
70
  "types": "./dist/index.d.ts"
71
+ },
72
+ "./columns": {
73
+ "import": "./dist/columns/index.esm.js",
74
+ "require": "./dist/columns/index.js",
75
+ "types": "./dist/columns/index.d.ts"
76
+ }
77
+ },
78
+ "typesVersions": {
79
+ "*": {
80
+ "columns": [
81
+ "dist/columns/index.d.ts"
82
+ ]
71
83
  }
72
84
  }
73
85
  }