@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 @@
|
|
|
1
|
+
export declare function thaiBahtText(amount: number): string;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thai month names in Buddhist calendar
|
|
3
|
+
*/
|
|
4
|
+
export declare const THAI_MONTH_NAMES: string[];
|
|
5
|
+
/**
|
|
6
|
+
* Convert Gregorian year to Buddhist year
|
|
7
|
+
* Buddhist calendar is 543 years ahead of Gregorian calendar
|
|
8
|
+
*
|
|
9
|
+
* @param gregorianYear - The Gregorian year (e.g., 2024)
|
|
10
|
+
* @returns The Buddhist year (e.g., 2567)
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* toBuddhistYear(2024); // returns 2567
|
|
14
|
+
*/
|
|
15
|
+
export declare function toBuddhistYear(gregorianYear: number): number;
|
|
16
|
+
/**
|
|
17
|
+
* Convert Buddhist year to Gregorian year
|
|
18
|
+
*
|
|
19
|
+
* @param buddhistYear - The Buddhist year (e.g., 2567)
|
|
20
|
+
* @returns The Gregorian year (e.g., 2024)
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* toGregorianYear(2567); // returns 2024
|
|
24
|
+
*/
|
|
25
|
+
export declare function toGregorianYear(buddhistYear: number): number;
|
|
26
|
+
/**
|
|
27
|
+
* Get the first and last day of a month
|
|
28
|
+
*
|
|
29
|
+
* @param date - The date within the month
|
|
30
|
+
* @returns Object with start and end dates of the month
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* getMonthDateRange(new Date('2024-06-15'));
|
|
34
|
+
* // returns { start: Date('2024-06-01'), end: Date('2024-06-30') }
|
|
35
|
+
*/
|
|
36
|
+
export declare function getMonthDateRange(date: Date): {
|
|
37
|
+
start: Date;
|
|
38
|
+
end: Date;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Format a date to Thai Buddhist calendar month display
|
|
42
|
+
*
|
|
43
|
+
* @param date - The date to format
|
|
44
|
+
* @returns Formatted string in Thai Buddhist calendar (e.g., "มกราคม 2568")
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* formatThaiMonth(new Date('2024-01-15')); // returns "มกราคม 2567"
|
|
48
|
+
* formatThaiMonth(new Date('2024-12-25')); // returns "ธันวาคม 2567"
|
|
49
|
+
*/
|
|
50
|
+
export declare function formatThaiMonth(date: Date): string;
|
|
51
|
+
/**
|
|
52
|
+
* Format a date to short Thai Buddhist calendar format
|
|
53
|
+
*
|
|
54
|
+
* @param date - The date to format
|
|
55
|
+
* @returns Formatted string (e.g., "01/2568")
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* formatThaiMonthShort(new Date('2024-01-15')); // returns "01/2567"
|
|
59
|
+
*/
|
|
60
|
+
export declare function formatThaiMonthShort(date: Date): string;
|
|
61
|
+
/**
|
|
62
|
+
* Get Thai month name by index (0-11)
|
|
63
|
+
*
|
|
64
|
+
* @param monthIndex - Month index (0 = January, 11 = December)
|
|
65
|
+
* @returns Thai month name
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* getThaiMonthName(0); // returns "มกราคม"
|
|
69
|
+
* getThaiMonthName(11); // returns "ธันวาคม"
|
|
70
|
+
*/
|
|
71
|
+
export declare function getThaiMonthName(monthIndex: number): string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File validation + helpers shared across ERP apps.
|
|
3
|
+
*/
|
|
4
|
+
export interface FileValidationResult {
|
|
5
|
+
isValid: boolean;
|
|
6
|
+
error?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Validate a file's MIME type or extension against an allow-list.
|
|
10
|
+
* Supports wildcards like "image/*".
|
|
11
|
+
*/
|
|
12
|
+
export declare function validateFileType(file: File, acceptedTypes: string[]): FileValidationResult;
|
|
13
|
+
/** Validate that a file is at or below `maxSizeMB`. */
|
|
14
|
+
export declare function validateFileSize(file: File, maxSizeMB: number): FileValidationResult;
|
|
15
|
+
/** True if the file's MIME type starts with `image/`. */
|
|
16
|
+
export declare function isImageFile(file: File): boolean;
|
|
17
|
+
/** Format bytes as human-readable string (Bytes/KB/MB/GB). */
|
|
18
|
+
export declare function formatFileSize(bytes: number): string;
|
|
19
|
+
/** Generate a unique file ID using crypto.randomUUID when available. */
|
|
20
|
+
export declare function generateFileId(): string;
|
package/dist/lib/format.d.ts
CHANGED
|
@@ -1 +1,36 @@
|
|
|
1
1
|
export declare function formatDate(date: Date | string | number | undefined, opts?: Intl.DateTimeFormatOptions): string;
|
|
2
|
+
/**
|
|
3
|
+
* Format a date with Thai locale (Asia/Bangkok timezone).
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* formatDateThai(new Date("2024-06-01")); // "1 มิถุนายน 2024" (Gregorian, Thai locale)
|
|
7
|
+
*/
|
|
8
|
+
export declare function formatDateThai(date: Date | string | number | undefined, opts?: Intl.DateTimeFormatOptions): string;
|
|
9
|
+
/**
|
|
10
|
+
* Format a date as RFC3339 with Asia/Bangkok offset (UTC+7).
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* formatDateThaiShort(new Date("2024-06-01")); // "2024-06-01T00:00:00+07:00"
|
|
14
|
+
*/
|
|
15
|
+
export declare function formatDateThaiShort(date: Date | string | number | undefined | null): string;
|
|
16
|
+
/**
|
|
17
|
+
* Format a number as currency. Defaults to THB; pass `currency: "USD"` for USD.
|
|
18
|
+
*/
|
|
19
|
+
export declare function formatCurrency(amount?: number, currency?: string, locale?: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* Format a number or numeric string with comma separators and three decimal places.
|
|
22
|
+
* Returns "0.00" for non-numeric input.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* formatNumber(1234567.8); // "1,234,567.800"
|
|
26
|
+
*/
|
|
27
|
+
export declare const formatNumber: (value: number | string) => string;
|
|
28
|
+
/**
|
|
29
|
+
* Convert a Gregorian "YYYY-MM-DD" date string to a Buddhist calendar string.
|
|
30
|
+
* Supports a custom output format using YYYY/MM/DD tokens.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* toBuddhistIso("2024-06-01"); // "2567-06-01"
|
|
34
|
+
* toBuddhistIso("2024-06-01", "DD/MM/YYYY"); // "01/06/2567"
|
|
35
|
+
*/
|
|
36
|
+
export declare const toBuddhistIso: (dateString: string, format?: string) => string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eintrek/erp-theme",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.3",
|
|
4
4
|
"private": false,
|
|
5
|
+
"packageManager": "pnpm@10.17.1",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"description": "A shadcn/ui component library with Storybook",
|
|
7
8
|
"main": "dist/index.js",
|
|
@@ -9,8 +10,19 @@
|
|
|
9
10
|
"types": "dist/index.d.ts",
|
|
10
11
|
"style": "dist/styles.css",
|
|
11
12
|
"files": [
|
|
12
|
-
"dist"
|
|
13
|
+
"dist",
|
|
14
|
+
"scripts/enforce-pnpm.js"
|
|
13
15
|
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"preinstall": "node scripts/enforce-pnpm.js",
|
|
18
|
+
"build": "cross-env NODE_ENV=production rollup -c --silent",
|
|
19
|
+
"dev": "cross-env NODE_ENV=production rollup -c -w",
|
|
20
|
+
"storybook": "storybook dev -p 6006",
|
|
21
|
+
"build-storybook": "storybook build",
|
|
22
|
+
"clean": "rimraf dist",
|
|
23
|
+
"prepare": "rimraf dist && cross-env NODE_ENV=production rollup -c --silent",
|
|
24
|
+
"pack": "cross-env NODE_ENV=production pnpm build && pnpm pack"
|
|
25
|
+
},
|
|
14
26
|
"keywords": [
|
|
15
27
|
"react",
|
|
16
28
|
"components",
|
|
@@ -20,9 +32,11 @@
|
|
|
20
32
|
"typescript"
|
|
21
33
|
],
|
|
22
34
|
"peerDependencies": {
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
35
|
+
"embla-carousel-react": "^8.6.0",
|
|
36
|
+
"next": "^15.5.3",
|
|
37
|
+
"nuqs": "^2.7.1",
|
|
38
|
+
"react": "^19.1.1",
|
|
39
|
+
"react-dom": "^19.1.1"
|
|
26
40
|
},
|
|
27
41
|
"devDependencies": {
|
|
28
42
|
"@eslint/eslintrc": "^3.3.1",
|
|
@@ -40,9 +54,11 @@
|
|
|
40
54
|
"@types/react-date-range": "^1.4.10",
|
|
41
55
|
"@types/react-dom": "^19.0.0",
|
|
42
56
|
"autoprefixer": "^10.4.16",
|
|
57
|
+
"cross-env": "^7.0.3",
|
|
43
58
|
"eslint": "^9.29.0",
|
|
44
59
|
"eslint-config-next": "^15.3.4",
|
|
45
60
|
"eslint-plugin-storybook": "^9.0.12",
|
|
61
|
+
"nuqs": "^2.7.1",
|
|
46
62
|
"postcss": "^8.4.32",
|
|
47
63
|
"postcss-import": "^16.1.0",
|
|
48
64
|
"postcss-prefix-selector": "^1.15.0",
|
|
@@ -57,7 +73,7 @@
|
|
|
57
73
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
58
74
|
"storybook": "^9.0.9",
|
|
59
75
|
"tailwindcss": "^4.0.0",
|
|
60
|
-
"typescript": "^5.
|
|
76
|
+
"typescript": "^5.9.2"
|
|
61
77
|
},
|
|
62
78
|
"dependencies": {
|
|
63
79
|
"@dnd-kit/core": "^6.3.1",
|
|
@@ -66,9 +82,16 @@
|
|
|
66
82
|
"@dnd-kit/utilities": "^3.2.2",
|
|
67
83
|
"@faker-js/faker": "^9.8.0",
|
|
68
84
|
"@hookform/resolvers": "^5.1.1",
|
|
85
|
+
"@radix-ui/react-checkbox": "^1.3.3",
|
|
86
|
+
"@radix-ui/react-dialog": "^1.1.15",
|
|
87
|
+
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
69
88
|
"@radix-ui/react-label": "^2.1.7",
|
|
70
|
-
"@radix-ui/react-
|
|
89
|
+
"@radix-ui/react-popover": "^1.1.15",
|
|
90
|
+
"@radix-ui/react-progress": "^1.1.7",
|
|
91
|
+
"@radix-ui/react-select": "^2.2.6",
|
|
92
|
+
"@radix-ui/react-separator": "^1.1.7",
|
|
71
93
|
"@radix-ui/react-slot": "^1.2.3",
|
|
94
|
+
"@radix-ui/react-tabs": "^1.1.13",
|
|
72
95
|
"@tanstack/react-table": "^8.21.3",
|
|
73
96
|
"class-variance-authority": "^0.7.1",
|
|
74
97
|
"clsx": "^2.1.1",
|
|
@@ -81,19 +104,20 @@
|
|
|
81
104
|
"lucide-react": "^0.516.0",
|
|
82
105
|
"motion": "^12.19.1",
|
|
83
106
|
"nanoid": "^5.1.5",
|
|
84
|
-
"next": "^15.
|
|
107
|
+
"next": "^15.5.3",
|
|
85
108
|
"next-themes": "^0.4.6",
|
|
86
|
-
"nuqs": "^2.4.3",
|
|
87
109
|
"prettier": "^3.5.3",
|
|
88
110
|
"radix-ui": "^1.4.2",
|
|
89
|
-
"react": "^19.1.
|
|
90
|
-
"react-day-picker": "^9.
|
|
91
|
-
"react-dom": "^19.1.
|
|
111
|
+
"react": "^19.1.1",
|
|
112
|
+
"react-day-picker": "^9.11.0",
|
|
113
|
+
"react-dom": "^19.1.1",
|
|
114
|
+
"react-dropzone": "^14.3.8",
|
|
115
|
+
"react-error-boundary": "6.0.0",
|
|
92
116
|
"react-hook-form": "^7.58.1",
|
|
93
117
|
"react-resizable-panels": "^3.0.3",
|
|
94
118
|
"recharts": "^2.15.3",
|
|
95
119
|
"server-only": "^0.0.1",
|
|
96
|
-
"shadcn": "^
|
|
120
|
+
"shadcn": "^3.3.1",
|
|
97
121
|
"sonner": "^2.0.5",
|
|
98
122
|
"tailwind-merge": "^2.6.0",
|
|
99
123
|
"tailwindcss-animate": "^1.0.7",
|
|
@@ -108,13 +132,5 @@
|
|
|
108
132
|
"extends": [
|
|
109
133
|
"plugin:storybook/recommended"
|
|
110
134
|
]
|
|
111
|
-
},
|
|
112
|
-
"scripts": {
|
|
113
|
-
"build": "NODE_ENV=production rollup -c",
|
|
114
|
-
"dev": "NODE_ENV=production rollup -c -w",
|
|
115
|
-
"storybook": "storybook dev -p 6006",
|
|
116
|
-
"build-storybook": "storybook build",
|
|
117
|
-
"clean": "rimraf dist",
|
|
118
|
-
"pack": "NODE_ENV=production pnpm build && pnpm pack"
|
|
119
135
|
}
|
|
120
|
-
}
|
|
136
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skip when this package is installed as a dependency (cwd under node_modules).
|
|
3
|
+
* In the repo root, allow only pnpm so npm/yarn do not corrupt the pnpm lockfile layout.
|
|
4
|
+
*/
|
|
5
|
+
const cwd = process.cwd().replace(/\\/g, "/");
|
|
6
|
+
if (/\/node_modules\//.test(cwd)) {
|
|
7
|
+
process.exit(0);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const execPath = process.env.npm_execpath ?? "";
|
|
11
|
+
if (execPath.includes("pnpm") || execPath.includes("pnpx")) {
|
|
12
|
+
process.exit(0);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
console.error(
|
|
16
|
+
"@eintrek/erp-theme: use `pnpm install` in this repo (pnpm-lock.yaml). `npm install` is unsupported and often fails with npm resolution errors.",
|
|
17
|
+
);
|
|
18
|
+
process.exit(1);
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Button } from "@/components/ui/button";
|
|
2
|
-
import type { Table } from "@tanstack/react-table";
|
|
3
|
-
import { motion } from "motion/react";
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
interface DataTableActionBarProps<TData> extends React.ComponentProps<typeof motion.div> {
|
|
6
|
-
table: Table<TData>;
|
|
7
|
-
visible?: boolean;
|
|
8
|
-
container?: Element | DocumentFragment | null;
|
|
9
|
-
}
|
|
10
|
-
declare function DataTableActionBar<TData>({ table, visible: visibleProp, container: containerProp, children, className, ...props }: DataTableActionBarProps<TData>): React.ReactPortal | null;
|
|
11
|
-
interface DataTableActionBarActionProps extends React.ComponentProps<typeof Button> {
|
|
12
|
-
tooltip?: string;
|
|
13
|
-
isPending?: boolean;
|
|
14
|
-
}
|
|
15
|
-
declare function DataTableActionBarAction({ size, tooltip, isPending, disabled, className, children, ...props }: DataTableActionBarActionProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
interface DataTableActionBarSelectionProps<TData> {
|
|
17
|
-
table: Table<TData>;
|
|
18
|
-
}
|
|
19
|
-
declare function DataTableActionBarSelection<TData>({ table, }: DataTableActionBarSelectionProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
export { DataTableActionBar, DataTableActionBarAction, DataTableActionBarSelection, };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Table } from "@tanstack/react-table";
|
|
2
|
-
import type * as React from "react";
|
|
3
|
-
interface DataTableAdvancedToolbarProps<TData> extends React.ComponentProps<"div"> {
|
|
4
|
-
table: Table<TData>;
|
|
5
|
-
}
|
|
6
|
-
export declare function DataTableAdvancedToolbar<TData>({ table, children, className, ...props }: DataTableAdvancedToolbarProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Table } from "@tanstack/react-table";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { PopoverContent } from "@/components/ui/popover";
|
|
4
|
-
interface DataTableFilterMenuProps<TData> extends React.ComponentProps<typeof PopoverContent> {
|
|
5
|
-
table: Table<TData>;
|
|
6
|
-
debounceMs?: number;
|
|
7
|
-
throttleMs?: number;
|
|
8
|
-
shallow?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export declare function DataTableFilterMenu<TData>({ table, debounceMs, throttleMs, shallow, align, ...props }: DataTableFilterMenuProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export {};
|
package/dist/lib/data-table.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ExtendedColumnFilter, FilterOperator, FilterVariant } from "@/types/data-table";
|
|
2
|
-
import type { Column } from "@tanstack/react-table";
|
|
3
|
-
export declare function getCommonPinningStyles<TData>({ column, withBorder, }: {
|
|
4
|
-
column: Column<TData>;
|
|
5
|
-
withBorder?: boolean;
|
|
6
|
-
}): React.CSSProperties;
|
|
7
|
-
export declare function getFilterOperators(filterVariant: FilterVariant): {
|
|
8
|
-
label: string;
|
|
9
|
-
value: FilterOperator;
|
|
10
|
-
}[];
|
|
11
|
-
export declare function getDefaultFilterOperator(filterVariant: FilterVariant): "iLike" | "notILike" | "eq" | "ne" | "isEmpty" | "isNotEmpty" | "lt" | "lte" | "gt" | "gte" | "isBetween" | "isRelativeToToday" | "inArray" | "notInArray";
|
|
12
|
-
export declare function getValidFilters<TData>(filters: ExtendedColumnFilter<TData>[]): ExtendedColumnFilter<TData>[];
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ExtendedColumnFilter, JoinOperator } from "@/types/data-table";
|
|
2
|
-
import { type AnyColumn, type SQL, type Table } from "drizzle-orm";
|
|
3
|
-
export declare function filterColumns<T extends Table>({ table, filters, joinOperator, }: {
|
|
4
|
-
table: T;
|
|
5
|
-
filters: ExtendedColumnFilter<T>[];
|
|
6
|
-
joinOperator: JoinOperator;
|
|
7
|
-
}): SQL | undefined;
|
|
8
|
-
export declare function getColumn<T extends Table>(table: T, columnKey: keyof T): AnyColumn;
|
package/dist/lib/parsers.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { ExtendedColumnFilter, ExtendedColumnSort } from "@/types/data-table";
|
|
3
|
-
export declare const getSortingStateParser: <TData>(columnIds?: string[] | Set<string>) => import("nuqs").ParserBuilder<ExtendedColumnSort<TData>[]>;
|
|
4
|
-
declare const filterItemSchema: z.ZodObject<{
|
|
5
|
-
id: z.ZodString;
|
|
6
|
-
value: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
7
|
-
variant: z.ZodEnum<["text", "number", "range", "date", "dateRange", "boolean", "select", "multiSelect"]>;
|
|
8
|
-
operator: z.ZodEnum<["iLike", "notILike", "eq", "ne", "inArray", "notInArray", "isEmpty", "isNotEmpty", "lt", "lte", "gt", "gte", "isBetween", "isRelativeToToday"]>;
|
|
9
|
-
filterId: z.ZodString;
|
|
10
|
-
}, "strip", z.ZodTypeAny, {
|
|
11
|
-
id: string;
|
|
12
|
-
value: string | string[];
|
|
13
|
-
operator: "iLike" | "notILike" | "eq" | "ne" | "isEmpty" | "isNotEmpty" | "lt" | "lte" | "gt" | "gte" | "isBetween" | "isRelativeToToday" | "inArray" | "notInArray";
|
|
14
|
-
variant: "number" | "boolean" | "select" | "text" | "date" | "range" | "dateRange" | "multiSelect";
|
|
15
|
-
filterId: string;
|
|
16
|
-
}, {
|
|
17
|
-
id: string;
|
|
18
|
-
value: string | string[];
|
|
19
|
-
operator: "iLike" | "notILike" | "eq" | "ne" | "isEmpty" | "isNotEmpty" | "lt" | "lte" | "gt" | "gte" | "isBetween" | "isRelativeToToday" | "inArray" | "notInArray";
|
|
20
|
-
variant: "number" | "boolean" | "select" | "text" | "date" | "range" | "dateRange" | "multiSelect";
|
|
21
|
-
filterId: string;
|
|
22
|
-
}>;
|
|
23
|
-
export type FilterItemSchema = z.infer<typeof filterItemSchema>;
|
|
24
|
-
export declare const getFiltersStateParser: <TData>(columnIds?: string[] | Set<string>) => import("nuqs").ParserBuilder<ExtendedColumnFilter<TData>[]>;
|
|
25
|
-
export {};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
-
import { Alert } from "@/components/ui/alert";
|
|
3
|
-
/**
|
|
4
|
-
* Displays a callout for user attention.
|
|
5
|
-
*/
|
|
6
|
-
declare const meta: {
|
|
7
|
-
title: string;
|
|
8
|
-
component: typeof Alert;
|
|
9
|
-
tags: string[];
|
|
10
|
-
argTypes: {
|
|
11
|
-
variant: {
|
|
12
|
-
options: string[];
|
|
13
|
-
control: {
|
|
14
|
-
type: "radio";
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
args: {
|
|
19
|
-
variant: "default";
|
|
20
|
-
};
|
|
21
|
-
render: (args: import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & import("class-variance-authority").VariantProps<(props?: ({
|
|
22
|
-
variant?: "default" | "destructive" | null | undefined;
|
|
23
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string>) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
};
|
|
25
|
-
export default meta;
|
|
26
|
-
type Story = StoryObj<typeof meta>;
|
|
27
|
-
/**
|
|
28
|
-
* The default form of the alert.
|
|
29
|
-
*/
|
|
30
|
-
export declare const Default: Story;
|
|
31
|
-
/**
|
|
32
|
-
* Use the `destructive` alert to indicate a destructive action.
|
|
33
|
-
*/
|
|
34
|
-
export declare const Destructive: Story;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
-
import { AspectRatio } from "@/components/ui/aspect-ratio";
|
|
3
|
-
/**
|
|
4
|
-
* Displays content within a desired ratio.
|
|
5
|
-
*/
|
|
6
|
-
declare const meta: Meta<typeof AspectRatio>;
|
|
7
|
-
export default meta;
|
|
8
|
-
type Story = StoryObj<typeof meta>;
|
|
9
|
-
/**
|
|
10
|
-
* The default form of the aspect ratio.
|
|
11
|
-
*/
|
|
12
|
-
export declare const Default: Story;
|
|
13
|
-
/**
|
|
14
|
-
* Use the `1:1` aspect ratio to display a square image.
|
|
15
|
-
*/
|
|
16
|
-
export declare const Square: Story;
|
|
17
|
-
/**
|
|
18
|
-
* Use the `4:3` aspect ratio to display a landscape image.
|
|
19
|
-
*/
|
|
20
|
-
export declare const Landscape: Story;
|
|
21
|
-
/**
|
|
22
|
-
* Use the `2.35:1` aspect ratio to display a cinemascope image.
|
|
23
|
-
*/
|
|
24
|
-
export declare const Cinemascope: Story;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
-
import { Badge } from "@/components/ui/badge";
|
|
3
|
-
/**
|
|
4
|
-
* Displays a badge or a component that looks like a badge.
|
|
5
|
-
*/
|
|
6
|
-
declare const meta: {
|
|
7
|
-
title: string;
|
|
8
|
-
component: typeof Badge;
|
|
9
|
-
tags: string[];
|
|
10
|
-
argTypes: {
|
|
11
|
-
children: {
|
|
12
|
-
control: "text";
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
args: {
|
|
16
|
-
children: string;
|
|
17
|
-
};
|
|
18
|
-
parameters: {
|
|
19
|
-
layout: string;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export default meta;
|
|
23
|
-
type Story = StoryObj<typeof meta>;
|
|
24
|
-
/**
|
|
25
|
-
* The default form of the badge.
|
|
26
|
-
*/
|
|
27
|
-
export declare const Default: Story;
|
|
28
|
-
/**
|
|
29
|
-
* Use the `secondary` badge to call for less urgent information, blending
|
|
30
|
-
* into the interface while still signaling minor updates or statuses.
|
|
31
|
-
*/
|
|
32
|
-
export declare const Secondary: Story;
|
|
33
|
-
/**
|
|
34
|
-
* Use the `destructive` badge to indicate errors, alerts, or the need for
|
|
35
|
-
* immediate attention.
|
|
36
|
-
*/
|
|
37
|
-
export declare const Destructive: Story;
|
|
38
|
-
/**
|
|
39
|
-
* Use the `outline` badge for overlaying without obscuring interface details,
|
|
40
|
-
* emphasizing clarity and subtlety..
|
|
41
|
-
*/
|
|
42
|
-
export declare const Outline: Story;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
-
import { Breadcrumb } from "@/components/ui/breadcrumb";
|
|
3
|
-
/**
|
|
4
|
-
* Displays the path to the current resource using a hierarchy of links.
|
|
5
|
-
*/
|
|
6
|
-
declare const meta: {
|
|
7
|
-
title: string;
|
|
8
|
-
component: typeof Breadcrumb;
|
|
9
|
-
tags: string[];
|
|
10
|
-
argTypes: {};
|
|
11
|
-
args: {};
|
|
12
|
-
render: (args: import("react").ClassAttributes<HTMLElement> & import("react").HTMLAttributes<HTMLElement>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
parameters: {
|
|
14
|
-
layout: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export default meta;
|
|
18
|
-
type Story = StoryObj<typeof meta>;
|
|
19
|
-
/**
|
|
20
|
-
* Displays the path of links to the current resource.
|
|
21
|
-
*/
|
|
22
|
-
export declare const Default: Story;
|
|
23
|
-
/**
|
|
24
|
-
* Displays the path with a custom icon for the separator.
|
|
25
|
-
*/
|
|
26
|
-
export declare const WithCustomSeparator: Story;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
-
import { Button } from "@/components/ui/button";
|
|
3
|
-
/**
|
|
4
|
-
* Displays a button or a component that looks like a button.
|
|
5
|
-
*/
|
|
6
|
-
declare const meta: {
|
|
7
|
-
title: string;
|
|
8
|
-
component: typeof Button;
|
|
9
|
-
tags: string[];
|
|
10
|
-
argTypes: {
|
|
11
|
-
children: {
|
|
12
|
-
control: "text";
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
parameters: {
|
|
16
|
-
layout: string;
|
|
17
|
-
};
|
|
18
|
-
args: {
|
|
19
|
-
variant: "default";
|
|
20
|
-
size: "default";
|
|
21
|
-
children: string;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export default meta;
|
|
25
|
-
type Story = StoryObj<typeof meta>;
|
|
26
|
-
/**
|
|
27
|
-
* The default form of the button, used for primary actions and commands.
|
|
28
|
-
*/
|
|
29
|
-
export declare const Default: Story;
|
|
30
|
-
/**
|
|
31
|
-
* Use the `outline` button to reduce emphasis on secondary actions, such as
|
|
32
|
-
* canceling or dismissing a dialog.
|
|
33
|
-
*/
|
|
34
|
-
export declare const Outline: Story;
|
|
35
|
-
/**
|
|
36
|
-
* Use the `ghost` button is minimalistic and subtle, for less intrusive
|
|
37
|
-
* actions.
|
|
38
|
-
*/
|
|
39
|
-
export declare const Ghost: Story;
|
|
40
|
-
/**
|
|
41
|
-
* Use the `secondary` button to call for less emphasized actions, styled to
|
|
42
|
-
* complement the primary button while being less conspicuous.
|
|
43
|
-
*/
|
|
44
|
-
export declare const Secondary: Story;
|
|
45
|
-
/**
|
|
46
|
-
* Use the `destructive` button to indicate errors, alerts, or the need for
|
|
47
|
-
* immediate attention.
|
|
48
|
-
*/
|
|
49
|
-
export declare const Destructive: Story;
|
|
50
|
-
/**
|
|
51
|
-
* Use the `link` button to reduce emphasis on tertiary actions, such as
|
|
52
|
-
* hyperlink or navigation, providing a text-only interactive element.
|
|
53
|
-
*/
|
|
54
|
-
export declare const Link: Story;
|
|
55
|
-
/**
|
|
56
|
-
* Add the `disabled` prop to a button to prevent interactions and add a
|
|
57
|
-
* loading indicator, such as a spinner, to signify an in-progress action.
|
|
58
|
-
*/
|
|
59
|
-
export declare const Loading: Story;
|
|
60
|
-
/**
|
|
61
|
-
* Add an icon element to a button to enhance visual communication and
|
|
62
|
-
* providing additional context for the action.
|
|
63
|
-
*/
|
|
64
|
-
export declare const WithIcon: Story;
|
|
65
|
-
/**
|
|
66
|
-
* Use the `sm` size for a smaller button, suitable for interfaces needing
|
|
67
|
-
* compact elements without sacrificing usability.
|
|
68
|
-
*/
|
|
69
|
-
export declare const Small: Story;
|
|
70
|
-
/**
|
|
71
|
-
* Use the `lg` size for a larger button, offering better visibility and
|
|
72
|
-
* easier interaction for users.
|
|
73
|
-
*/
|
|
74
|
-
export declare const Large: Story;
|
|
75
|
-
/**
|
|
76
|
-
* Use the "icon" size for a button with only an icon.
|
|
77
|
-
*/
|
|
78
|
-
export declare const Icon: Story;
|
|
79
|
-
/**
|
|
80
|
-
* Add the `disabled` prop to prevent interactions with the button.
|
|
81
|
-
*/
|
|
82
|
-
export declare const Disabled: Story;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
-
import { Calendar } from "@/components/ui/calendar";
|
|
3
|
-
/**
|
|
4
|
-
* A date field component that allows users to enter and edit date.
|
|
5
|
-
*/
|
|
6
|
-
declare const meta: {
|
|
7
|
-
title: string;
|
|
8
|
-
component: typeof Calendar;
|
|
9
|
-
tags: string[];
|
|
10
|
-
argTypes: {};
|
|
11
|
-
args: {
|
|
12
|
-
mode: "single";
|
|
13
|
-
selected: Date;
|
|
14
|
-
onSelect: import("storybook/internal/actions").HandlerFunction;
|
|
15
|
-
className: string;
|
|
16
|
-
};
|
|
17
|
-
parameters: {
|
|
18
|
-
layout: string;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export default meta;
|
|
22
|
-
type Story = StoryObj<typeof meta>;
|
|
23
|
-
/**
|
|
24
|
-
* The default form of the calendar.
|
|
25
|
-
*/
|
|
26
|
-
export declare const Default: Story;
|
|
27
|
-
/**
|
|
28
|
-
* Use the `multiple` mode to select multiple dates.
|
|
29
|
-
*/
|
|
30
|
-
export declare const Multiple: Story;
|
|
31
|
-
/**
|
|
32
|
-
* Use the `range` mode to select a range of dates.
|
|
33
|
-
*/
|
|
34
|
-
export declare const Range: Story;
|
|
35
|
-
/**
|
|
36
|
-
* Use the `disabled` prop to disable specific dates.
|
|
37
|
-
*/
|
|
38
|
-
export declare const Disabled: Story;
|
|
39
|
-
/**
|
|
40
|
-
* Use the `numberOfMonths` prop to display multiple months.
|
|
41
|
-
*/
|
|
42
|
-
export declare const MultipleMonths: Story;
|
|
43
|
-
export declare const ShouldChangeMonths: Story;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
-
import { Card } from "@/components/ui/card";
|
|
3
|
-
/**
|
|
4
|
-
* Displays a card with header, content, and footer.
|
|
5
|
-
*/
|
|
6
|
-
declare const meta: {
|
|
7
|
-
title: string;
|
|
8
|
-
component: typeof Card;
|
|
9
|
-
tags: string[];
|
|
10
|
-
argTypes: {};
|
|
11
|
-
args: {
|
|
12
|
-
className: string;
|
|
13
|
-
};
|
|
14
|
-
render: (args: import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
parameters: {
|
|
16
|
-
layout: string;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export default meta;
|
|
20
|
-
type Story = StoryObj<typeof meta>;
|
|
21
|
-
/**
|
|
22
|
-
* The default form of the card.
|
|
23
|
-
*/
|
|
24
|
-
export declare const Default: Story;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
-
import { Carousel } from "@/components/ui/carousel";
|
|
3
|
-
/**
|
|
4
|
-
* A carousel with motion and swipe built using Embla.
|
|
5
|
-
*/
|
|
6
|
-
declare const meta: Meta<typeof Carousel>;
|
|
7
|
-
export default meta;
|
|
8
|
-
type Story = StoryObj<typeof meta>;
|
|
9
|
-
/**
|
|
10
|
-
* The default form of the carousel.
|
|
11
|
-
*/
|
|
12
|
-
export declare const Default: Story;
|
|
13
|
-
/**
|
|
14
|
-
* Use the `basis` utility class to change the size of the carousel.
|
|
15
|
-
*/
|
|
16
|
-
export declare const Size: Story;
|
|
17
|
-
export declare const ShouldNavigate: Story;
|