@eintrek/erp-theme 1.0.3 → 1.4.3
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/data-table/data-table-cell.d.ts +35 -0
- package/dist/components/data-table/data-table-column-header.d.ts +3 -2
- package/dist/components/data-table/data-table-faceted-filter.d.ts +1 -1
- package/dist/components/data-table/data-table-filter-dropdown.d.ts +12 -0
- package/dist/components/data-table/data-table-filter-list.d.ts +1 -1
- package/dist/components/data-table/data-table-pagination.d.ts +15 -1
- package/dist/components/data-table/data-table-range-filter.d.ts +1 -1
- package/dist/components/data-table/data-table-slider-filter.d.ts +1 -2
- package/dist/components/data-table/data-table-sort-list.d.ts +1 -1
- package/dist/components/data-table/data-table-toolbar.d.ts +6 -1
- package/dist/components/data-table/data-table-types.d.ts +115 -0
- package/dist/components/data-table/data-table.d.ts +5 -2
- package/dist/components/data-table/hooks/use-callback-ref.d.ts +9 -0
- package/dist/{hooks → components/data-table/hooks}/use-data-table.d.ts +4 -3
- package/dist/components/data-table/hooks/use-debounced-callback.d.ts +4 -0
- package/dist/components/data-table/hooks/use-media-query.d.ts +1 -0
- package/dist/components/data-table/index.d.ts +17 -0
- package/dist/components/ui/calendar.d.ts +23 -8
- package/dist/components/ui/carousel.d.ts +1 -1
- package/dist/components/ui/command.d.ts +1 -1
- package/dist/components/ui/custom-select-field2.d.ts +18 -0
- package/dist/components/ui/date-picker-field.d.ts +13 -0
- package/dist/components/ui/date-picker.d.ts +19 -0
- package/dist/components/ui/faceted.d.ts +2 -2
- package/dist/components/ui/file-uploader.d.ts +33 -0
- package/dist/components/ui/form-skeleton.d.ts +11 -0
- package/dist/components/ui/input-field.d.ts +13 -0
- package/dist/components/ui/loading-screen.d.ts +1 -0
- package/dist/components/ui/page-header.d.ts +7 -0
- package/dist/components/ui/pagination.d.ts +1 -1
- package/dist/components/ui/select-field.d.ts +31 -0
- package/dist/components/ui/sidebar.d.ts +4 -4
- package/dist/components/ui/tabs.d.ts +1 -1
- package/dist/components/ui/textarea-field.d.ts +13 -0
- package/dist/components/ui/toggle-group.d.ts +1 -1
- package/dist/components/ui/validation-errors.d.ts +25 -0
- package/dist/hooks/use-debounce.d.ts +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +32 -19
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +30773 -44919
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +30837 -44920
- package/dist/index.js.map +1 -1
- package/dist/lib/baht-text.d.ts +1 -0
- package/dist/lib/date-utils.d.ts +71 -0
- package/dist/lib/file.d.ts +20 -0
- package/dist/lib/format.d.ts +35 -0
- package/package.json +38 -22
- package/scripts/enforce-pnpm.js +18 -0
- package/dist/components/data-table/data-table-action-bar.d.ts +0 -20
- package/dist/components/data-table/data-table-advanced-toolbar.d.ts +0 -7
- package/dist/components/data-table/data-table-filter-menu.d.ts +0 -11
- package/dist/lib/data-table.d.ts +0 -12
- package/dist/lib/filter-columns.d.ts +0 -8
- package/dist/lib/parsers.d.ts +0 -25
- package/dist/registry/alert.stories.d.ts +0 -34
- package/dist/registry/aspect-ratio.stories.d.ts +0 -24
- package/dist/registry/badge.stories.d.ts +0 -42
- package/dist/registry/breadcrumb.stories.d.ts +0 -26
- package/dist/registry/button.stories.d.ts +0 -82
- package/dist/registry/calendar.stories.d.ts +0 -43
- package/dist/registry/card.stories.d.ts +0 -24
- package/dist/registry/carousel.stories.d.ts +0 -17
- package/dist/registry/chart.stories.d.ts +0 -32
- package/dist/registry/checkbox.stories.d.ts +0 -17
- package/dist/registry/command.stories.d.ts +0 -41
- package/dist/registry/data-table.stories.d.ts +0 -59
- package/dist/registry/date-picker.stories.d.ts +0 -32
- package/dist/registry/drawer.stories.d.ts +0 -27
- package/dist/registry/form.stories.d.ts +0 -14
- package/dist/registry/input-otp.stories.d.ts +0 -41
- package/dist/registry/input.stories.d.ts +0 -47
- package/dist/registry/label.stories.d.ts +0 -27
- package/dist/registry/pagination.stories.d.ts +0 -91
- package/dist/registry/progress.stories.d.ts +0 -31
- package/dist/registry/resizable.stories.d.ts +0 -12
- package/dist/registry/scroll-area.stories.d.ts +0 -41
- package/dist/registry/select.stories.d.ts +0 -13
- package/dist/registry/separator.stories.d.ts +0 -21
- package/dist/registry/sheet.stories.d.ts +0 -16
- package/dist/registry/sidebar.stories.d.ts +0 -336
- package/dist/registry/skeleton.stories.d.ts +0 -20
- package/dist/registry/slider.stories.d.ts +0 -30
- package/dist/registry/sonner.stories.d.ts +0 -14
- package/dist/registry/table.stories.d.ts +0 -104
- package/dist/registry/textarea.stories.d.ts +0 -40
- package/dist/registry/toggle.stories.d.ts +0 -35
- package/dist/registry/tokens/color.stories.d.ts +0 -23
- package/dist/registry/tokens/radius.stories.d.ts +0 -17
- package/dist/registry/tokens/typography.stories.d.ts +0 -28
- package/dist/registry/tooltip.stories.d.ts +0 -26
- package/dist/types/data-table.d.ts +0 -33
- package/dist/types/doc.d.ts +0 -195
- /package/dist/{config/data-table.d.ts → components/data-table/data-table-config.d.ts} +0 -0
- /package/dist/components/ui/{form.d.ts → Form.d.ts} +0 -0
- /package/dist/components/ui/{input.d.ts → Input.d.ts} +0 -0
- /package/dist/components/ui/{label.d.ts → Label.d.ts} +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
interface DataTableCellProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
title?: string;
|
|
5
|
+
truncate?: boolean;
|
|
6
|
+
maxWidth?: string;
|
|
7
|
+
showTooltip?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
lineClamp?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Reusable cell component with truncation and tooltip support
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* // Basic usage with truncation
|
|
16
|
+
* <DataTableCell truncate title="Full text content">
|
|
17
|
+
* Long text that will be truncated
|
|
18
|
+
* </DataTableCell>
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // Multi-line truncation
|
|
22
|
+
* <DataTableCell truncate lineClamp={2} maxWidth="300px">
|
|
23
|
+
* Multi-line text content
|
|
24
|
+
* </DataTableCell>
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* // Without truncation (default)
|
|
28
|
+
* <DataTableCell>
|
|
29
|
+
* Normal cell content
|
|
30
|
+
* </DataTableCell>
|
|
31
|
+
*/
|
|
32
|
+
export declare function DataTableCell({ children, title, truncate, maxWidth, width, showTooltip, lineClamp, className, ...props }: DataTableCellProps & {
|
|
33
|
+
width?: string;
|
|
34
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Column } from "@tanstack/react-table";
|
|
2
|
-
import { DropdownMenuTrigger } from "
|
|
2
|
+
import { DropdownMenuTrigger } from "../../index";
|
|
3
3
|
interface DataTableColumnHeaderProps<TData, TValue> extends React.ComponentProps<typeof DropdownMenuTrigger> {
|
|
4
4
|
column: Column<TData, TValue>;
|
|
5
5
|
title: string;
|
|
6
|
+
sortable?: boolean;
|
|
6
7
|
}
|
|
7
|
-
export declare function DataTableColumnHeader<TData, TValue>({ column, title, className, ...props }: DataTableColumnHeaderProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function DataTableColumnHeader<TData, TValue>({ column, title, className, sortable, ...props }: DataTableColumnHeaderProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface DataTableFilterDropdownProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
buttonText?: string;
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
variant?: "default" | "outline";
|
|
8
|
+
/** Applied to PopoverContent (e.g. min-w-[520px] for custom filter layout) */
|
|
9
|
+
contentClassName?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function DataTableFilterDropdown({ children, className, buttonText, icon, variant, contentClassName, }: DataTableFilterDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Table } from "@tanstack/react-table";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { PopoverContent } from "
|
|
3
|
+
import { PopoverContent } from "../../index";
|
|
4
4
|
interface DataTableFilterListProps<TData> extends React.ComponentProps<typeof PopoverContent> {
|
|
5
5
|
table: Table<TData>;
|
|
6
6
|
debounceMs?: number;
|
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
import type { Table } from "@tanstack/react-table";
|
|
2
|
+
import * as React from "react";
|
|
2
3
|
interface DataTablePaginationProps<TData> extends React.ComponentProps<"div"> {
|
|
3
4
|
table: Table<TData>;
|
|
4
5
|
pageSizeOptions?: number[];
|
|
5
6
|
}
|
|
6
|
-
export declare function DataTablePagination<TData>({ table, pageSizeOptions, className, ...props }: DataTablePaginationProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function DataTablePagination<TData>({ table, pageSizeOptions, className, ...props }: DataTablePaginationProps<TData>): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
/**
|
|
9
|
+
* SimplePagination - A standalone pagination component for non-DataTable use cases
|
|
10
|
+
*/
|
|
11
|
+
interface SimplePaginationProps extends React.ComponentProps<"div"> {
|
|
12
|
+
currentPage: number;
|
|
13
|
+
totalPages: number;
|
|
14
|
+
onPageChange: (page: number) => void;
|
|
15
|
+
totalItems?: number;
|
|
16
|
+
pageSize?: number;
|
|
17
|
+
pageSizeOptions?: number[];
|
|
18
|
+
onPageSizeChange?: (pageSize: number) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare function SimplePagination({ currentPage, totalPages, onPageChange, totalItems, pageSize, pageSizeOptions, onPageSizeChange, className, ...props }: SimplePaginationProps): import("react/jsx-runtime").JSX.Element | null;
|
|
7
21
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Column } from "@tanstack/react-table";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import type { ExtendedColumnFilter } from "
|
|
3
|
+
import type { ExtendedColumnFilter } from "./data-table-types";
|
|
4
4
|
interface DataTableRangeFilterProps<TData> extends React.ComponentProps<"div"> {
|
|
5
5
|
filter: ExtendedColumnFilter<TData>;
|
|
6
6
|
column: Column<TData>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Column } from "@tanstack/react-table";
|
|
2
2
|
interface DataTableSliderFilterProps<TData> {
|
|
3
3
|
column: Column<TData, unknown>;
|
|
4
|
-
title?: string;
|
|
5
4
|
}
|
|
6
|
-
export declare function DataTableSliderFilter<TData>({ column,
|
|
5
|
+
export declare function DataTableSliderFilter<TData>({ column, }: DataTableSliderFilterProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Table } from "@tanstack/react-table";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { PopoverContent } from "
|
|
3
|
+
import { PopoverContent } from "../../index";
|
|
4
4
|
interface DataTableSortListProps<TData> extends React.ComponentProps<typeof PopoverContent> {
|
|
5
5
|
table: Table<TData>;
|
|
6
6
|
}
|
|
@@ -2,6 +2,11 @@ import type { Table } from "@tanstack/react-table";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
interface DataTableToolbarProps<TData> extends React.ComponentProps<"div"> {
|
|
4
4
|
table: Table<TData>;
|
|
5
|
+
mode?: "simple" | "advanced";
|
|
6
|
+
/** Custom filter content; when set, shown inside the filter dropdown instead of default column filters */
|
|
7
|
+
filterContent?: React.ReactNode;
|
|
8
|
+
/** Optional class for the filter dropdown popover when using filterContent (e.g. min-w-[560px]) */
|
|
9
|
+
filterDropdownContentClassName?: string;
|
|
5
10
|
}
|
|
6
|
-
export declare function DataTableToolbar<TData>({ table,
|
|
11
|
+
export declare function DataTableToolbar<TData>({ table, mode, filterContent, filterDropdownContentClassName, className, ...props }: DataTableToolbarProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
7
12
|
export {};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
import type { ColumnSort, Row } from "@tanstack/react-table";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import type { DataTableConfig } from "./data-table-config";
|
|
5
|
+
import type { Column } from "@tanstack/react-table";
|
|
6
|
+
export interface Option {
|
|
7
|
+
label: string;
|
|
8
|
+
value: string;
|
|
9
|
+
icon?: React.ComponentType<{
|
|
10
|
+
className?: string;
|
|
11
|
+
}>;
|
|
12
|
+
count?: number;
|
|
13
|
+
}
|
|
14
|
+
export type FilterOperator = DataTableConfig["operators"][number];
|
|
15
|
+
export type FilterVariant = DataTableConfig["filterVariants"][number];
|
|
16
|
+
export type JoinOperator = DataTableConfig["joinOperators"][number];
|
|
17
|
+
declare const filterItemSchema: z.ZodObject<{
|
|
18
|
+
id: z.ZodString;
|
|
19
|
+
value: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
20
|
+
variant: z.ZodEnum<[string, ...string[]]>;
|
|
21
|
+
operator: z.ZodEnum<[string, ...string[]]>;
|
|
22
|
+
filterId: z.ZodString;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
id: string;
|
|
25
|
+
value: string | string[];
|
|
26
|
+
operator: string;
|
|
27
|
+
variant: string;
|
|
28
|
+
filterId: string;
|
|
29
|
+
}, {
|
|
30
|
+
id: string;
|
|
31
|
+
value: string | string[];
|
|
32
|
+
operator: string;
|
|
33
|
+
variant: string;
|
|
34
|
+
filterId: string;
|
|
35
|
+
}>;
|
|
36
|
+
export type FilterItemSchema = z.infer<typeof filterItemSchema>;
|
|
37
|
+
export interface ExtendedColumnFilter<TData> extends FilterItemSchema {
|
|
38
|
+
id: Extract<keyof TData, string>;
|
|
39
|
+
}
|
|
40
|
+
export interface ExtendedColumnSort<TData> extends Omit<ColumnSort, "id"> {
|
|
41
|
+
id: Extract<keyof TData, string>;
|
|
42
|
+
}
|
|
43
|
+
export interface ToolbarColumnMeta {
|
|
44
|
+
variant?: "text" | "number" | "range" | "date" | "dateRange" | "select" | "multiSelect" | "boolean";
|
|
45
|
+
label?: string;
|
|
46
|
+
placeholder?: string;
|
|
47
|
+
unit?: string;
|
|
48
|
+
options?: Option[];
|
|
49
|
+
range?: [number, number];
|
|
50
|
+
icon?: React.ComponentType<{
|
|
51
|
+
className?: string;
|
|
52
|
+
}>;
|
|
53
|
+
sticky?: "left" | "right";
|
|
54
|
+
/** Pixel offset from the sticky edge — used when stacking multiple sticky
|
|
55
|
+
* columns on the same side (e.g. the second-to-right pinned column needs
|
|
56
|
+
* `stickyOffset` equal to the rightmost pinned column's width). */
|
|
57
|
+
stickyOffset?: number;
|
|
58
|
+
hideHeader?: boolean;
|
|
59
|
+
showLeftDivider?: boolean;
|
|
60
|
+
renderFilter?: (props: {
|
|
61
|
+
column: Column<unknown>;
|
|
62
|
+
}) => React.ReactNode;
|
|
63
|
+
}
|
|
64
|
+
export interface DataTableRowAction<TData> {
|
|
65
|
+
row: Row<TData>;
|
|
66
|
+
variant: "update" | "delete";
|
|
67
|
+
}
|
|
68
|
+
declare module "@tanstack/react-table" {
|
|
69
|
+
interface ColumnMeta<TData, TValue> extends ToolbarColumnMeta {
|
|
70
|
+
}
|
|
71
|
+
interface TableMeta<TData> {
|
|
72
|
+
queryKeys?: {
|
|
73
|
+
filters?: string;
|
|
74
|
+
joinOperator?: string;
|
|
75
|
+
sort?: string;
|
|
76
|
+
page?: string;
|
|
77
|
+
perPage?: string;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Get filters state parser for URL synchronization
|
|
83
|
+
*/
|
|
84
|
+
export declare const getFiltersStateParser: <TData>(columnIds?: string[] | Set<string>) => import("nuqs/server").SingleParserBuilder<ExtendedColumnFilter<TData>[]>;
|
|
85
|
+
/**
|
|
86
|
+
* Get common pinning styles for table columns
|
|
87
|
+
*/
|
|
88
|
+
export declare function getCommonPinningStyles<TData>({ column, withBorder, }: {
|
|
89
|
+
column: Column<TData>;
|
|
90
|
+
withBorder?: boolean;
|
|
91
|
+
}): React.CSSProperties;
|
|
92
|
+
/**
|
|
93
|
+
* Get filter operators for a specific filter variant
|
|
94
|
+
*/
|
|
95
|
+
export declare function getFilterOperators(filterVariant: FilterVariant): {
|
|
96
|
+
label: string;
|
|
97
|
+
value: FilterOperator;
|
|
98
|
+
}[];
|
|
99
|
+
/**
|
|
100
|
+
* Get default filter operator for a filter variant
|
|
101
|
+
*/
|
|
102
|
+
export declare function getDefaultFilterOperator(filterVariant: FilterVariant): "iLike" | "notILike" | "eq" | "ne" | "isEmpty" | "isNotEmpty" | "lt" | "lte" | "gt" | "gte" | "isBetween" | "isRelativeToToday" | "inArray" | "notInArray";
|
|
103
|
+
/**
|
|
104
|
+
* Get valid filters (remove empty/invalid filters)
|
|
105
|
+
*/
|
|
106
|
+
export declare function getValidFilters<TData>(filters: ExtendedColumnFilter<TData>[]): ExtendedColumnFilter<TData>[];
|
|
107
|
+
export declare const getSortingStateParser: <TData>(columnIds?: string[] | Set<string>) => import("nuqs/server").SingleParserBuilder<ExtendedColumnSort<TData>[]>;
|
|
108
|
+
export interface QueryKeys {
|
|
109
|
+
page: string;
|
|
110
|
+
perPage: string;
|
|
111
|
+
sort: string;
|
|
112
|
+
filters: string;
|
|
113
|
+
joinOperator: string;
|
|
114
|
+
}
|
|
115
|
+
export {};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { type Table as TanstackTable } from "@tanstack/react-table";
|
|
1
|
+
import { type Table as TanstackTable, type Row } from "@tanstack/react-table";
|
|
2
2
|
import type * as React from "react";
|
|
3
3
|
interface DataTableProps<TData> extends React.ComponentProps<"div"> {
|
|
4
4
|
table: TanstackTable<TData>;
|
|
5
5
|
actionBar?: React.ReactNode;
|
|
6
|
+
isLoading?: boolean;
|
|
7
|
+
isFetching?: boolean;
|
|
8
|
+
getRowClassName?: (row: Row<TData>) => string;
|
|
6
9
|
}
|
|
7
|
-
export declare function DataTable<TData>({ table, actionBar, children, className, ...props }: DataTableProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function DataTable<TData>({ table, actionBar, children, className, isLoading, isFetching, getRowClassName, ...props }: DataTableProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
8
11
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @see https://github.com/radix-ui/primitives/blob/main/packages/react/use-callback-ref/src/useCallbackRef.tsx
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
|
|
6
|
+
* prop or avoid re-executing effects when passed as a dependency
|
|
7
|
+
*/
|
|
8
|
+
declare function useCallbackRef<T extends (...args: never[]) => unknown>(callback: T | undefined): T;
|
|
9
|
+
export { useCallbackRef };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { type TableOptions, type TableState } from "@tanstack/react-table";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import type { ExtendedColumnSort } from "
|
|
4
|
-
interface UseDataTableProps<TData> extends Omit<TableOptions<TData>, "state" | "pageCount" | "getCoreRowModel" | "manualFiltering" | "manualPagination" | "manualSorting">, Required<Pick<TableOptions<TData>, "pageCount">> {
|
|
3
|
+
import type { ExtendedColumnSort, QueryKeys } from "../data-table-types";
|
|
4
|
+
export interface UseDataTableProps<TData> extends Omit<TableOptions<TData>, "state" | "pageCount" | "getCoreRowModel" | "manualFiltering" | "manualPagination" | "manualSorting">, Required<Pick<TableOptions<TData>, "pageCount">> {
|
|
5
5
|
initialState?: Omit<Partial<TableState>, "sorting"> & {
|
|
6
6
|
sorting?: ExtendedColumnSort<TData>[];
|
|
7
7
|
};
|
|
8
|
+
queryKeys?: Partial<QueryKeys>;
|
|
8
9
|
history?: "push" | "replace";
|
|
9
10
|
debounceMs?: number;
|
|
10
11
|
throttleMs?: number;
|
|
@@ -13,6 +14,7 @@ interface UseDataTableProps<TData> extends Omit<TableOptions<TData>, "state" | "
|
|
|
13
14
|
scroll?: boolean;
|
|
14
15
|
shallow?: boolean;
|
|
15
16
|
startTransition?: React.TransitionStartFunction;
|
|
17
|
+
resetOnMount?: boolean;
|
|
16
18
|
}
|
|
17
19
|
export declare function useDataTable<TData>(props: UseDataTableProps<TData>): {
|
|
18
20
|
table: import("@tanstack/react-table").Table<TData>;
|
|
@@ -20,4 +22,3 @@ export declare function useDataTable<TData>(props: UseDataTableProps<TData>): {
|
|
|
20
22
|
debounceMs: number;
|
|
21
23
|
throttleMs: number;
|
|
22
24
|
};
|
|
23
|
-
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @see https://github.com/mantinedev/mantine/blob/master/packages/@mantine/hooks/src/use-debounced-callback/use-debounced-callback.ts
|
|
3
|
+
*/
|
|
4
|
+
export declare function useDebouncedCallback<T extends (...args: never[]) => unknown>(callback: T, delay: number): (...args: Parameters<T>) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useMediaQuery(query: string): boolean;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { DataTable } from "./data-table";
|
|
2
|
+
export { DataTableCell } from "./data-table-cell";
|
|
3
|
+
export { DataTableColumnHeader } from "./data-table-column-header";
|
|
4
|
+
export { DataTablePagination } from "./data-table-pagination";
|
|
5
|
+
export { DataTableSkeleton } from "./data-table-skeleton";
|
|
6
|
+
export { DataTableDateFilter } from "./data-table-date-filter";
|
|
7
|
+
export { DataTableFacetedFilter } from "./data-table-faceted-filter";
|
|
8
|
+
export { DataTableSliderFilter } from "./data-table-slider-filter";
|
|
9
|
+
export { DataTableToolbar } from "./data-table-toolbar";
|
|
10
|
+
export { DataTableViewOptions } from "./data-table-view-options";
|
|
11
|
+
export { DataTableSortList } from "./data-table-sort-list";
|
|
12
|
+
export { DataTableFilterList } from "./data-table-filter-list";
|
|
13
|
+
export { useDataTable, type UseDataTableProps } from "./hooks/use-data-table";
|
|
14
|
+
export { DataTableRangeFilter } from "./data-table-range-filter";
|
|
15
|
+
export { DataTableFilterDropdown } from "./data-table-filter-dropdown";
|
|
16
|
+
export { dataTableConfig, type DataTableConfig } from "./data-table-config";
|
|
17
|
+
export * from "./data-table-types";
|
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
export interface DateRange {
|
|
2
|
+
from?: Date;
|
|
3
|
+
to?: Date;
|
|
4
|
+
}
|
|
5
|
+
interface CalendarProps {
|
|
6
|
+
className?: string;
|
|
7
|
+
selected?: Date | Date[] | DateRange;
|
|
8
|
+
onSelect?: (date: Date | Date[] | DateRange | undefined) => void;
|
|
9
|
+
mode?: "single" | "range" | "multiple";
|
|
10
|
+
initialFocus?: boolean;
|
|
11
|
+
showOutsideDays?: boolean;
|
|
12
|
+
disabled?: (date: Date) => boolean;
|
|
13
|
+
}
|
|
14
|
+
declare function Calendar({ className, selected, onSelect, mode, disabled, }: CalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
interface DateInputProps {
|
|
16
|
+
value?: Date;
|
|
17
|
+
onChange?: (date: Date | undefined) => void;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
className?: string;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
}
|
|
22
|
+
declare function DateInput({ value, onChange, placeholder, className, disabled }: DateInputProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export { Calendar, DateInput };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import useEmblaCarousel, { type UseEmblaCarouselType } from "embla-carousel-react";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { Button } from "
|
|
3
|
+
import { Button } from "./button";
|
|
4
4
|
type CarouselApi = UseEmblaCarouselType[1];
|
|
5
5
|
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
6
6
|
type CarouselOptions = UseCarouselParameters[0];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command as CommandPrimitive } from "cmdk";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { Dialog } from "
|
|
3
|
+
import { Dialog } from "./dialog";
|
|
4
4
|
declare function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: React.ComponentProps<typeof Dialog> & {
|
|
6
6
|
title?: string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Control, FieldValues, Path } from "react-hook-form";
|
|
2
|
+
interface CustomSelectField2Props<T extends FieldValues> {
|
|
3
|
+
name: Path<T>;
|
|
4
|
+
label: string;
|
|
5
|
+
control: Control<T>;
|
|
6
|
+
options: {
|
|
7
|
+
label: string;
|
|
8
|
+
value: string;
|
|
9
|
+
}[];
|
|
10
|
+
placeholder: string;
|
|
11
|
+
searchPlaceholder?: string;
|
|
12
|
+
emptyText?: string;
|
|
13
|
+
required?: boolean;
|
|
14
|
+
readonly?: boolean;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function CustomSelectField2<T extends FieldValues>({ name, label, control, options, placeholder, searchPlaceholder, emptyText, required, readonly, className, }: CustomSelectField2Props<T>): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type DatePickerProps } from "./date-picker";
|
|
3
|
+
export interface DatePickerFieldProps extends DatePickerProps {
|
|
4
|
+
label?: React.ReactNode;
|
|
5
|
+
helperText?: React.ReactNode;
|
|
6
|
+
error?: React.ReactNode;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
containerClassName?: string;
|
|
9
|
+
labelClassName?: string;
|
|
10
|
+
messageClassName?: string;
|
|
11
|
+
}
|
|
12
|
+
declare function DatePickerField({ id, label, helperText, error, required, containerClassName, labelClassName, messageClassName, className, ...props }: DatePickerFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { DatePickerField };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface DatePickerProps {
|
|
2
|
+
date?: Date;
|
|
3
|
+
onDateChange?: (date: Date | undefined) => void;
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
/** Restrict which dates are selectable. Default: no future dates and no dates before 1900-01-01. */
|
|
7
|
+
disabledDates?: (date: Date) => boolean;
|
|
8
|
+
/** Override the trigger label format. Defaults to Intl `th-TH` long format. */
|
|
9
|
+
formatDate?: (date: Date) => string;
|
|
10
|
+
className?: string;
|
|
11
|
+
id?: string;
|
|
12
|
+
/** Used as `aria-label` and trigger placeholder when no date is selected. */
|
|
13
|
+
ariaLabel?: string;
|
|
14
|
+
"aria-required"?: boolean;
|
|
15
|
+
"aria-invalid"?: boolean;
|
|
16
|
+
"aria-describedby"?: string;
|
|
17
|
+
}
|
|
18
|
+
declare function DatePicker({ date, onDateChange, placeholder, disabled, disabledDates, formatDate, className, id, ariaLabel, "aria-required": ariaRequired, "aria-invalid": ariaInvalid, "aria-describedby": ariaDescribedby, }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export { DatePicker };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator } from "
|
|
3
|
-
import { Popover, PopoverContent, PopoverTrigger } from "
|
|
2
|
+
import { CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator } from "./command";
|
|
3
|
+
import { Popover, PopoverContent, PopoverTrigger } from "./popover";
|
|
4
4
|
type FacetedValue<Multiple extends boolean> = Multiple extends true ? string[] : string;
|
|
5
5
|
interface FacetedProps<Multiple extends boolean = false> extends React.ComponentProps<typeof Popover> {
|
|
6
6
|
value?: FacetedValue<Multiple>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface UploadedFile {
|
|
2
|
+
id: string;
|
|
3
|
+
file: File;
|
|
4
|
+
title: string;
|
|
5
|
+
url?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Helper function to convert File objects to UploadedFile format
|
|
9
|
+
*/
|
|
10
|
+
export declare const convertFilesToUploadedFiles: (files: File[] | undefined) => UploadedFile[];
|
|
11
|
+
/**
|
|
12
|
+
* Helper function to convert single File to UploadedFile format
|
|
13
|
+
*/
|
|
14
|
+
export declare const convertFileToUploadedFile: (file: File | undefined) => UploadedFile[];
|
|
15
|
+
export interface FileUploaderProps {
|
|
16
|
+
label: string;
|
|
17
|
+
helperText?: string;
|
|
18
|
+
accept?: string;
|
|
19
|
+
maxSizeMB?: number;
|
|
20
|
+
multiple?: boolean;
|
|
21
|
+
onFilesChange: (files: UploadedFile[]) => void;
|
|
22
|
+
mode?: "create" | "edit" | "view";
|
|
23
|
+
className?: string;
|
|
24
|
+
buttonText?: string;
|
|
25
|
+
initialFiles?: UploadedFile[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* FileUploader Component
|
|
29
|
+
*
|
|
30
|
+
* A simple file uploader with validation and download functionality.
|
|
31
|
+
* Displays uploaded files as blue clickable links.
|
|
32
|
+
*/
|
|
33
|
+
export declare function FileUploader({ label, helperText, accept, maxSizeMB, multiple, onFilesChange, mode, className, buttonText, initialFiles, }: FileUploaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface FormSkeletonSection {
|
|
2
|
+
title: string;
|
|
3
|
+
fieldRows: number[];
|
|
4
|
+
gridCols?: 1 | 2 | 3;
|
|
5
|
+
}
|
|
6
|
+
export interface FormSkeletonProps {
|
|
7
|
+
sections: FormSkeletonSection[];
|
|
8
|
+
showActionButtons?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function FormSkeleton({ sections, showActionButtons, className, }: FormSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface InputFieldProps extends Omit<React.ComponentProps<"input">, "ref"> {
|
|
3
|
+
label?: React.ReactNode;
|
|
4
|
+
helperText?: React.ReactNode;
|
|
5
|
+
error?: React.ReactNode;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
containerClassName?: string;
|
|
8
|
+
labelClassName?: string;
|
|
9
|
+
messageClassName?: string;
|
|
10
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
11
|
+
}
|
|
12
|
+
declare function InputField({ id, label, helperText, error, required, containerClassName, labelClassName, messageClassName, className, ref, ...props }: InputFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { InputField };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function LoadingScreen(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { Button } from "
|
|
2
|
+
import { Button } from "./button";
|
|
3
3
|
declare function Pagination({ className, ...props }: React.ComponentProps<"nav">): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare function PaginationContent({ className, ...props }: React.ComponentProps<"ul">): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
declare function PaginationItem({ ...props }: React.ComponentProps<"li">): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface SelectFieldOption {
|
|
3
|
+
value: string;
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface SelectFieldProps {
|
|
8
|
+
id?: string;
|
|
9
|
+
label?: React.ReactNode;
|
|
10
|
+
helperText?: React.ReactNode;
|
|
11
|
+
error?: React.ReactNode;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
value?: string;
|
|
15
|
+
defaultValue?: string;
|
|
16
|
+
onValueChange?: (value: string) => void;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/** Declarative list of options. Ignored when `children` is provided. */
|
|
19
|
+
options?: SelectFieldOption[];
|
|
20
|
+
/** Use this to compose custom `<SelectContent>` children. Overrides `options`. */
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
containerClassName?: string;
|
|
23
|
+
labelClassName?: string;
|
|
24
|
+
triggerClassName?: string;
|
|
25
|
+
messageClassName?: string;
|
|
26
|
+
size?: "sm" | "default";
|
|
27
|
+
"aria-label"?: string;
|
|
28
|
+
"aria-describedby"?: string;
|
|
29
|
+
}
|
|
30
|
+
declare function SelectField({ id, label, helperText, error, required, placeholder, value, defaultValue, onValueChange, disabled, options, children, containerClassName, labelClassName, triggerClassName, messageClassName, size, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, }: SelectFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export { SelectField };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { VariantProps } from "class-variance-authority";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { Button } from "
|
|
4
|
-
import { Input } from "
|
|
5
|
-
import { Separator } from "
|
|
6
|
-
import { TooltipContent } from "
|
|
3
|
+
import { Button } from "./button";
|
|
4
|
+
import { Input } from "./Input";
|
|
5
|
+
import { Separator } from "./separator";
|
|
6
|
+
import { TooltipContent } from "./tooltip";
|
|
7
7
|
type SidebarContextProps = {
|
|
8
8
|
state: "expanded" | "collapsed";
|
|
9
9
|
open: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare function Tabs({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare function TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface TextareaFieldProps extends Omit<React.ComponentProps<"textarea">, "ref"> {
|
|
3
|
+
label?: React.ReactNode;
|
|
4
|
+
helperText?: React.ReactNode;
|
|
5
|
+
error?: React.ReactNode;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
containerClassName?: string;
|
|
8
|
+
labelClassName?: string;
|
|
9
|
+
messageClassName?: string;
|
|
10
|
+
ref?: React.Ref<HTMLTextAreaElement>;
|
|
11
|
+
}
|
|
12
|
+
declare function TextareaField({ id, label, helperText, error, required, containerClassName, labelClassName, messageClassName, className, ref, ...props }: TextareaFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { TextareaField };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
2
|
import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { toggleVariants } from "
|
|
4
|
+
import { toggleVariants } from "./toggle";
|
|
5
5
|
declare function ToggleGroup({ className, variant, size, children, ...props }: React.ComponentProps<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants>): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
declare function ToggleGroupItem({ className, children, variant, size, ...props }: React.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export { ToggleGroup, ToggleGroupItem };
|