@kopexa/theme 1.7.6 → 1.7.7

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.
@@ -0,0 +1,140 @@
1
+ // src/components/data-grid.ts
2
+ import { tv } from "tailwind-variants";
3
+ var datagrid = tv({
4
+ slots: {
5
+ container: "grid w-full",
6
+ table: "w-full align-middle caption-bottom text-left rtl:text-right text-foreground font-normal text-sm",
7
+ head: "",
8
+ headerRow: "",
9
+ headerRowCell: "relative h-10 text-left rtl:text-right align-middle font-normal text-secondary-foreground/80 [&:has([role=checkbox])]:pe-0",
10
+ headRowCellResize: "absolute top-0 h-full w-4 cursor-col-resize user-select-none touch-none -end-2 z-10 flex justify-center before:absolute before:w-px before:inset-y-0 before:bg-border before:-translate-x-px",
11
+ rowSpacer: "h-2",
12
+ body: "[&_tr:last-child]:border-0",
13
+ bodyRowSkeleton: "hover:bg-muted/40 data-[state=selected]:bg-muted/50",
14
+ bodyRowSkeletonCell: "align-middle",
15
+ bodyRow: "hover:bg-muted/40 data-[state=selected]:bg-muted/50",
16
+ bodyRowCell: "align-middle",
17
+ bodyRowExpanded: "",
18
+ empty: "text-center text-muted-foreground py-6"
19
+ },
20
+ variants: {
21
+ border: {
22
+ true: {
23
+ container: "border border-border rounded-lg"
24
+ }
25
+ },
26
+ headerBorder: {
27
+ true: {
28
+ headerRow: "[&>th]:border-b"
29
+ }
30
+ },
31
+ cellBorder: {
32
+ true: {
33
+ headerRow: "[&_>:last-child]:border-e-0",
34
+ headerRowCell: "border-e",
35
+ bodyRowSkeleton: "[&_>:last-child]:border-e-0",
36
+ bodyRowSkeletonCell: "border-e",
37
+ bodyRow: "[&_>:last-child]:border-e-0",
38
+ bodyRowCell: "border-e"
39
+ }
40
+ },
41
+ rowBorder: {
42
+ true: {
43
+ bodyRowExpanded: "[&:not(:last-child)>td]:border-b"
44
+ }
45
+ },
46
+ rowRounded: {
47
+ true: {
48
+ body: "[&_td:first-child]:rounded-s-lg [&_td:last-child]:rounded-e-lg"
49
+ }
50
+ },
51
+ columnsResizable: {
52
+ true: {
53
+ headerRowCell: "truncate"
54
+ }
55
+ },
56
+ columnsDraggable: {
57
+ true: {
58
+ table: "border-separate border-spacing-0"
59
+ }
60
+ },
61
+ headerBackground: {
62
+ false: {
63
+ headerRow: "bg-transparent"
64
+ },
65
+ true: {
66
+ headerRow: "bg-muted/40"
67
+ }
68
+ },
69
+ stripped: {
70
+ true: {
71
+ headerRow: "bg-transparent",
72
+ bodyRowSkeleton: "odd:bg-muted/90 hover:bg-transparent odd:hover:bg-muted",
73
+ bodyRow: "odd:bg-muted/90 hover:bg-transparent odd:hover:bg-muted"
74
+ }
75
+ },
76
+ width: {
77
+ fixed: {
78
+ table: "table-fixed",
79
+ headerRowCell: "w-[var(--size)]"
80
+ },
81
+ auto: {
82
+ table: "table-auto"
83
+ }
84
+ },
85
+ dense: {
86
+ true: {
87
+ headerRowCell: "px-2.5 h-8",
88
+ bodyRowSkeletonCell: "px-2.5 py-2",
89
+ bodyRowCell: "px-2.5 py-2"
90
+ },
91
+ false: {
92
+ headerRowCell: "px-4",
93
+ bodyRowSkeletonCell: "px-4 py-3",
94
+ bodyRowCell: "px-4 py-3"
95
+ }
96
+ },
97
+ columnsPinnable: {
98
+ true: {
99
+ headerRowCell: "[&:not([data-pinned]):has(+[data-pinned])_div.cursor-col-resize:last-child]:opacity-0 [&[data-last-col=left]_div.cursor-col-resize:last-child]:opacity-0 [&[data-pinned=left][data-last-col=left]]:border-e! [&[data-pinned=right]:last-child_div.cursor-col-resize:last-child]:opacity-0 [&[data-pinned=right][data-last-col=right]]:border-s! [&[data-pinned][data-last-col]]:border-border data-pinned:bg-muted/90 data-pinned:backdrop-blur-xs"
100
+ },
101
+ false: {}
102
+ },
103
+ headerSticky: {
104
+ true: {
105
+ head: "sticky top-0 z-10 bg-background/90 backdrop-blur-xs"
106
+ }
107
+ },
108
+ loadingMode: {
109
+ skeleton: {}
110
+ }
111
+ },
112
+ compoundVariants: [
113
+ {
114
+ stripped: false,
115
+ rowBorder: true,
116
+ className: {
117
+ bodyRowSkeleton: "border-b border-border [&:not(:last-child)>td]:border-b",
118
+ bodyRow: "border-b border-border [&:not(:last-child)>td]:border-b"
119
+ }
120
+ }
121
+ ],
122
+ defaultVariants: {
123
+ border: true,
124
+ dense: false,
125
+ width: "fixed",
126
+ headerSticky: false,
127
+ headerBorder: true,
128
+ headerBackground: true,
129
+ cellBorder: false,
130
+ stripped: false,
131
+ columnsPinnable: false,
132
+ columnsResizable: false,
133
+ loadingMode: "skeleton",
134
+ rowBorder: true
135
+ }
136
+ });
137
+
138
+ export {
139
+ datagrid
140
+ };
@@ -0,0 +1,325 @@
1
+ import * as tailwind_variants from 'tailwind-variants';
2
+ import { VariantProps } from 'tailwind-variants';
3
+
4
+ declare const datagrid: tailwind_variants.TVReturnType<{
5
+ border: {
6
+ true: {
7
+ container: string;
8
+ };
9
+ };
10
+ headerBorder: {
11
+ true: {
12
+ headerRow: string;
13
+ };
14
+ };
15
+ cellBorder: {
16
+ true: {
17
+ headerRow: string;
18
+ headerRowCell: string;
19
+ bodyRowSkeleton: string;
20
+ bodyRowSkeletonCell: string;
21
+ bodyRow: string;
22
+ bodyRowCell: string;
23
+ };
24
+ };
25
+ rowBorder: {
26
+ true: {
27
+ bodyRowExpanded: string;
28
+ };
29
+ };
30
+ rowRounded: {
31
+ true: {
32
+ body: string;
33
+ };
34
+ };
35
+ columnsResizable: {
36
+ true: {
37
+ headerRowCell: string;
38
+ };
39
+ };
40
+ columnsDraggable: {
41
+ true: {
42
+ table: string;
43
+ };
44
+ };
45
+ headerBackground: {
46
+ false: {
47
+ headerRow: string;
48
+ };
49
+ true: {
50
+ headerRow: string;
51
+ };
52
+ };
53
+ stripped: {
54
+ true: {
55
+ headerRow: string;
56
+ bodyRowSkeleton: string;
57
+ bodyRow: string;
58
+ };
59
+ };
60
+ width: {
61
+ fixed: {
62
+ table: string;
63
+ headerRowCell: string;
64
+ };
65
+ auto: {
66
+ table: string;
67
+ };
68
+ };
69
+ dense: {
70
+ true: {
71
+ headerRowCell: string;
72
+ bodyRowSkeletonCell: string;
73
+ bodyRowCell: string;
74
+ };
75
+ false: {
76
+ headerRowCell: string;
77
+ bodyRowSkeletonCell: string;
78
+ bodyRowCell: string;
79
+ };
80
+ };
81
+ columnsPinnable: {
82
+ true: {
83
+ headerRowCell: string;
84
+ };
85
+ false: {};
86
+ };
87
+ headerSticky: {
88
+ true: {
89
+ head: string;
90
+ };
91
+ };
92
+ loadingMode: {
93
+ skeleton: {};
94
+ };
95
+ }, {
96
+ container: string;
97
+ table: string;
98
+ head: string;
99
+ headerRow: string;
100
+ headerRowCell: string;
101
+ headRowCellResize: string;
102
+ rowSpacer: string;
103
+ body: string;
104
+ bodyRowSkeleton: string;
105
+ bodyRowSkeletonCell: string;
106
+ bodyRow: string;
107
+ bodyRowCell: string;
108
+ bodyRowExpanded: string;
109
+ empty: string;
110
+ }, undefined, {
111
+ border: {
112
+ true: {
113
+ container: string;
114
+ };
115
+ };
116
+ headerBorder: {
117
+ true: {
118
+ headerRow: string;
119
+ };
120
+ };
121
+ cellBorder: {
122
+ true: {
123
+ headerRow: string;
124
+ headerRowCell: string;
125
+ bodyRowSkeleton: string;
126
+ bodyRowSkeletonCell: string;
127
+ bodyRow: string;
128
+ bodyRowCell: string;
129
+ };
130
+ };
131
+ rowBorder: {
132
+ true: {
133
+ bodyRowExpanded: string;
134
+ };
135
+ };
136
+ rowRounded: {
137
+ true: {
138
+ body: string;
139
+ };
140
+ };
141
+ columnsResizable: {
142
+ true: {
143
+ headerRowCell: string;
144
+ };
145
+ };
146
+ columnsDraggable: {
147
+ true: {
148
+ table: string;
149
+ };
150
+ };
151
+ headerBackground: {
152
+ false: {
153
+ headerRow: string;
154
+ };
155
+ true: {
156
+ headerRow: string;
157
+ };
158
+ };
159
+ stripped: {
160
+ true: {
161
+ headerRow: string;
162
+ bodyRowSkeleton: string;
163
+ bodyRow: string;
164
+ };
165
+ };
166
+ width: {
167
+ fixed: {
168
+ table: string;
169
+ headerRowCell: string;
170
+ };
171
+ auto: {
172
+ table: string;
173
+ };
174
+ };
175
+ dense: {
176
+ true: {
177
+ headerRowCell: string;
178
+ bodyRowSkeletonCell: string;
179
+ bodyRowCell: string;
180
+ };
181
+ false: {
182
+ headerRowCell: string;
183
+ bodyRowSkeletonCell: string;
184
+ bodyRowCell: string;
185
+ };
186
+ };
187
+ columnsPinnable: {
188
+ true: {
189
+ headerRowCell: string;
190
+ };
191
+ false: {};
192
+ };
193
+ headerSticky: {
194
+ true: {
195
+ head: string;
196
+ };
197
+ };
198
+ loadingMode: {
199
+ skeleton: {};
200
+ };
201
+ }, {
202
+ container: string;
203
+ table: string;
204
+ head: string;
205
+ headerRow: string;
206
+ headerRowCell: string;
207
+ headRowCellResize: string;
208
+ rowSpacer: string;
209
+ body: string;
210
+ bodyRowSkeleton: string;
211
+ bodyRowSkeletonCell: string;
212
+ bodyRow: string;
213
+ bodyRowCell: string;
214
+ bodyRowExpanded: string;
215
+ empty: string;
216
+ }, tailwind_variants.TVReturnType<{
217
+ border: {
218
+ true: {
219
+ container: string;
220
+ };
221
+ };
222
+ headerBorder: {
223
+ true: {
224
+ headerRow: string;
225
+ };
226
+ };
227
+ cellBorder: {
228
+ true: {
229
+ headerRow: string;
230
+ headerRowCell: string;
231
+ bodyRowSkeleton: string;
232
+ bodyRowSkeletonCell: string;
233
+ bodyRow: string;
234
+ bodyRowCell: string;
235
+ };
236
+ };
237
+ rowBorder: {
238
+ true: {
239
+ bodyRowExpanded: string;
240
+ };
241
+ };
242
+ rowRounded: {
243
+ true: {
244
+ body: string;
245
+ };
246
+ };
247
+ columnsResizable: {
248
+ true: {
249
+ headerRowCell: string;
250
+ };
251
+ };
252
+ columnsDraggable: {
253
+ true: {
254
+ table: string;
255
+ };
256
+ };
257
+ headerBackground: {
258
+ false: {
259
+ headerRow: string;
260
+ };
261
+ true: {
262
+ headerRow: string;
263
+ };
264
+ };
265
+ stripped: {
266
+ true: {
267
+ headerRow: string;
268
+ bodyRowSkeleton: string;
269
+ bodyRow: string;
270
+ };
271
+ };
272
+ width: {
273
+ fixed: {
274
+ table: string;
275
+ headerRowCell: string;
276
+ };
277
+ auto: {
278
+ table: string;
279
+ };
280
+ };
281
+ dense: {
282
+ true: {
283
+ headerRowCell: string;
284
+ bodyRowSkeletonCell: string;
285
+ bodyRowCell: string;
286
+ };
287
+ false: {
288
+ headerRowCell: string;
289
+ bodyRowSkeletonCell: string;
290
+ bodyRowCell: string;
291
+ };
292
+ };
293
+ columnsPinnable: {
294
+ true: {
295
+ headerRowCell: string;
296
+ };
297
+ false: {};
298
+ };
299
+ headerSticky: {
300
+ true: {
301
+ head: string;
302
+ };
303
+ };
304
+ loadingMode: {
305
+ skeleton: {};
306
+ };
307
+ }, {
308
+ container: string;
309
+ table: string;
310
+ head: string;
311
+ headerRow: string;
312
+ headerRowCell: string;
313
+ headRowCellResize: string;
314
+ rowSpacer: string;
315
+ body: string;
316
+ bodyRowSkeleton: string;
317
+ bodyRowSkeletonCell: string;
318
+ bodyRow: string;
319
+ bodyRowCell: string;
320
+ bodyRowExpanded: string;
321
+ empty: string;
322
+ }, undefined, unknown, unknown, undefined>>;
323
+ type DataGridVariants = VariantProps<typeof datagrid>;
324
+
325
+ export { type DataGridVariants, datagrid };