@classytic/fluid 0.1.2 → 0.2.1
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/README.md +63 -18
- package/animations.css +74 -0
- package/dist/chunk-GUHK2DTW.js +15 -0
- package/dist/chunk-GUHK2DTW.js.map +1 -0
- package/dist/chunk-H3NFL3GJ.js +57 -0
- package/dist/chunk-H3NFL3GJ.js.map +1 -0
- package/dist/chunk-J2YRTQE4.js +293 -0
- package/dist/chunk-J2YRTQE4.js.map +1 -0
- package/dist/compact.d.ts +217 -0
- package/dist/compact.js +986 -0
- package/dist/compact.js.map +1 -0
- package/dist/dashboard.d.ts +38 -1
- package/dist/dashboard.js +65 -25
- package/dist/dashboard.js.map +1 -1
- package/dist/index.d.ts +586 -507
- package/dist/index.js +1656 -2211
- package/dist/index.js.map +1 -1
- package/dist/layout.js +2 -60
- package/dist/layout.js.map +1 -1
- package/dist/search.d.ts +172 -0
- package/dist/search.js +341 -0
- package/dist/search.js.map +1 -0
- package/dist/use-base-search-AS5Z3SAy.d.ts +64 -0
- package/package.json +36 -28
- package/styles.css +3 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filter utilities for building URL parameters
|
|
3
|
+
* Simplified approach since backend handles all operator parsing
|
|
4
|
+
*/
|
|
5
|
+
interface FilterConfig {
|
|
6
|
+
paramName: string;
|
|
7
|
+
type?: "array" | "string" | "number" | "boolean";
|
|
8
|
+
defaultValue?: unknown;
|
|
9
|
+
}
|
|
10
|
+
interface SearchConfig {
|
|
11
|
+
basePath: string;
|
|
12
|
+
searchFields?: Record<string, string>;
|
|
13
|
+
filterFields?: Record<string, FilterConfig>;
|
|
14
|
+
defaultSearchType?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Build URL parameters from filters object
|
|
18
|
+
*/
|
|
19
|
+
declare function buildFilterParams(filters: Record<string, unknown>, filterConfig: Record<string, FilterConfig>): URLSearchParams;
|
|
20
|
+
/**
|
|
21
|
+
* Build search parameters from search state
|
|
22
|
+
*/
|
|
23
|
+
declare function buildSearchParams(searchType: string, searchValue: string, searchFields: Record<string, string>): URLSearchParams;
|
|
24
|
+
/**
|
|
25
|
+
* Build listing status parameters (inventory-specific)
|
|
26
|
+
*/
|
|
27
|
+
declare function buildListingStatusParams(listingStatus: Record<string, boolean | undefined>): URLSearchParams;
|
|
28
|
+
/**
|
|
29
|
+
* Clear specific parameter types from URLSearchParams
|
|
30
|
+
*/
|
|
31
|
+
declare function clearSearchAndFilterParams(params: URLSearchParams, config: SearchConfig): void;
|
|
32
|
+
/**
|
|
33
|
+
* Get API-ready parameters from URL
|
|
34
|
+
*/
|
|
35
|
+
declare function getApiParams(searchParams: URLSearchParams): Record<string, string>;
|
|
36
|
+
|
|
37
|
+
interface UseBaseSearchConfig {
|
|
38
|
+
basePath: string;
|
|
39
|
+
searchFields?: Record<string, string>;
|
|
40
|
+
filterFields?: Record<string, FilterConfig>;
|
|
41
|
+
defaultSearchType?: string;
|
|
42
|
+
}
|
|
43
|
+
interface UseBaseSearchReturn {
|
|
44
|
+
searchType: string;
|
|
45
|
+
setSearchType: (type: string) => void;
|
|
46
|
+
searchValue: string;
|
|
47
|
+
setSearchValue: (value: string) => void;
|
|
48
|
+
filters: Record<string, unknown>;
|
|
49
|
+
setFilters: React.Dispatch<React.SetStateAction<Record<string, unknown>>>;
|
|
50
|
+
updateFilter: (key: string, value: unknown) => void;
|
|
51
|
+
handleSearch: () => void;
|
|
52
|
+
clearSearch: () => void;
|
|
53
|
+
getSearchParams: () => Record<string, string>;
|
|
54
|
+
hasActiveSearch: boolean;
|
|
55
|
+
hasActiveFilters: boolean;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Base search hook that provides common search functionality
|
|
59
|
+
* Can be extended by specific search hooks for different entities
|
|
60
|
+
* Supports bracket syntax: field[operator]=value
|
|
61
|
+
*/
|
|
62
|
+
declare function useBaseSearch(config: UseBaseSearchConfig): UseBaseSearchReturn;
|
|
63
|
+
|
|
64
|
+
export { type FilterConfig as F, type SearchConfig as S, type UseBaseSearchReturn as U, buildSearchParams as a, buildFilterParams as b, buildListingStatusParams as c, clearSearchAndFilterParams as d, type UseBaseSearchConfig as e, getApiParams as g, useBaseSearch as u };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@classytic/fluid",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Fluid UI - Custom components built on shadcn/ui and base ui by Classytic",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -18,11 +18,21 @@
|
|
|
18
18
|
"types": "./dist/dashboard.d.ts",
|
|
19
19
|
"import": "./dist/dashboard.js"
|
|
20
20
|
},
|
|
21
|
-
"./
|
|
21
|
+
"./compact": {
|
|
22
|
+
"types": "./dist/compact.d.ts",
|
|
23
|
+
"import": "./dist/compact.js"
|
|
24
|
+
},
|
|
25
|
+
"./search": {
|
|
26
|
+
"types": "./dist/search.d.ts",
|
|
27
|
+
"import": "./dist/search.js"
|
|
28
|
+
},
|
|
29
|
+
"./styles.css": "./styles.css",
|
|
30
|
+
"./animations.css": "./animations.css"
|
|
22
31
|
},
|
|
23
32
|
"files": [
|
|
24
33
|
"dist",
|
|
25
|
-
"styles.css"
|
|
34
|
+
"styles.css",
|
|
35
|
+
"animations.css"
|
|
26
36
|
],
|
|
27
37
|
"scripts": {
|
|
28
38
|
"build": "tsup && node scripts/add-use-client.js",
|
|
@@ -32,24 +42,23 @@
|
|
|
32
42
|
"prepublishOnly": "npm run build"
|
|
33
43
|
},
|
|
34
44
|
"peerDependencies": {
|
|
35
|
-
"react": ">=
|
|
36
|
-
"react-dom": ">=
|
|
37
|
-
"lucide-react": ">=0.
|
|
45
|
+
"react": ">=19.0.0",
|
|
46
|
+
"react-dom": ">=19.0.0",
|
|
47
|
+
"lucide-react": ">=0.560.0",
|
|
38
48
|
"class-variance-authority": ">=0.7.0",
|
|
39
|
-
"clsx": ">=2.
|
|
40
|
-
"tailwind-merge": ">=2.
|
|
41
|
-
"@tanstack/react-table": ">=8.
|
|
42
|
-
"
|
|
43
|
-
"next": ">=
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"date-fns": ">=3.0.0"
|
|
49
|
+
"clsx": ">=2.1.0",
|
|
50
|
+
"tailwind-merge": ">=2.2.0",
|
|
51
|
+
"@tanstack/react-table": ">=8.21.0",
|
|
52
|
+
"next": ">=15.0.0",
|
|
53
|
+
"next-themes": ">=0.4.0",
|
|
54
|
+
"react-hook-form": ">=7.54.0",
|
|
55
|
+
"date-fns": ">=4.1.0"
|
|
47
56
|
},
|
|
48
57
|
"peerDependenciesMeta": {
|
|
49
58
|
"@tanstack/react-table": {
|
|
50
59
|
"optional": true
|
|
51
60
|
},
|
|
52
|
-
"
|
|
61
|
+
"next": {
|
|
53
62
|
"optional": true
|
|
54
63
|
},
|
|
55
64
|
"next-themes": {
|
|
@@ -66,21 +75,20 @@
|
|
|
66
75
|
"@types/node": "^22.0.0",
|
|
67
76
|
"@types/react": "^19.0.0",
|
|
68
77
|
"@types/react-dom": "^19.0.0",
|
|
69
|
-
"react": "
|
|
70
|
-
"react-dom": "
|
|
78
|
+
"react": ">=19.0.0",
|
|
79
|
+
"react-dom": ">=19.0.0",
|
|
71
80
|
"tsup": "^8.5.0",
|
|
72
81
|
"typescript": "^5.7.0",
|
|
73
82
|
"rimraf": "^5.0.0",
|
|
74
|
-
"lucide-react": "
|
|
75
|
-
"class-variance-authority": "
|
|
76
|
-
"clsx": "
|
|
77
|
-
"tailwind-merge": "
|
|
78
|
-
"@tanstack/react-table": "
|
|
79
|
-
"
|
|
80
|
-
"next": "
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"date-fns": "^4.1.0"
|
|
83
|
+
"lucide-react": ">=0.560.0",
|
|
84
|
+
"class-variance-authority": ">=0.7.0",
|
|
85
|
+
"clsx": ">=2.1.0",
|
|
86
|
+
"tailwind-merge": ">=2.2.0",
|
|
87
|
+
"@tanstack/react-table": ">=8.21.0",
|
|
88
|
+
"next": ">=15.0.0",
|
|
89
|
+
"next-themes": ">=0.4.0",
|
|
90
|
+
"react-hook-form": ">=7.54.0",
|
|
91
|
+
"date-fns": ">=4.1.0"
|
|
84
92
|
},
|
|
85
93
|
"publishConfig": {
|
|
86
94
|
"access": "public"
|
|
@@ -104,7 +112,7 @@
|
|
|
104
112
|
"classytic"
|
|
105
113
|
],
|
|
106
114
|
"author": "Classytic",
|
|
107
|
-
"license": "
|
|
115
|
+
"license": "MIT",
|
|
108
116
|
"sideEffects": [
|
|
109
117
|
"*.css"
|
|
110
118
|
]
|