react-glide-table 1.0.1 → 1.1.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-glide-table",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/zpxlffjrm/react-glide-table.git"
@@ -10,6 +10,10 @@
10
10
  },
11
11
  "homepage": "https://github.com/zpxlffjrm/react-glide-table#readme",
12
12
  "type": "module",
13
+ "license": "MIT",
14
+ "engines": {
15
+ "node": "^20.19.0 || >=22.12.0"
16
+ },
13
17
  "main": "./dist/index.cjs",
14
18
  "module": "./dist/index.js",
15
19
  "types": "./dist/index.d.ts",
@@ -18,36 +22,38 @@
18
22
  "types": "./dist/index.d.ts",
19
23
  "import": "./dist/index.js",
20
24
  "require": "./dist/index.cjs"
21
- },
22
- "./style.css": "./dist/style.css"
25
+ }
23
26
  },
24
27
  "files": [
25
28
  "dist"
26
29
  ],
27
30
  "scripts": {
28
- "build": "tsup && node scripts/build-css.mjs",
31
+ "dev": "vite --config playground/vite.config.ts",
32
+ "build": "tsup",
29
33
  "test": "vitest run",
30
34
  "typecheck": "tsc"
31
35
  },
32
36
  "peerDependencies": {
33
- "@tanstack/react-table": "^8.0.0",
34
- "@tanstack/react-virtual": "^3.0.0",
35
37
  "react": "^18.0.0 || ^19.0.0",
36
38
  "react-dom": "^18.0.0 || ^19.0.0"
37
39
  },
38
- "devDependencies": {
40
+ "dependencies": {
39
41
  "@tanstack/react-table": "^8.21.3",
40
- "@tanstack/react-virtual": "^3.14.7",
42
+ "@tanstack/react-virtual": "^3.14.7"
43
+ },
44
+ "devDependencies": {
41
45
  "@testing-library/jest-dom": "^7.0.0",
42
46
  "@testing-library/react": "^16.3.2",
43
47
  "@testing-library/user-event": "^14.6.1",
44
48
  "@types/react": "^19.2.17",
45
49
  "@types/react-dom": "^19.2.3",
50
+ "@vitejs/plugin-react": "^6.0.3",
46
51
  "jsdom": "^29.1.1",
47
52
  "react": "^19.2.7",
48
53
  "react-dom": "^19.2.7",
49
54
  "tsup": "^8.5.1",
50
55
  "typescript": "^6.0.3",
56
+ "vite": "^8.1.5",
51
57
  "vitest": "^4.1.10"
52
58
  }
53
59
  }
package/dist/style.css DELETED
@@ -1,404 +0,0 @@
1
- :root {
2
- --color-neutral-border-default: #e5e7eb;
3
- --color-neutral-bg-surface: #ffffff;
4
- --color-neutral-bg-app: #f9fafb;
5
- --color-neutral-text-primary: #111827;
6
- --color-neutral-text-secondary: #4b5563;
7
- --color-neutral-text-muted: #6b7280;
8
- --color-neutral-text-placeholder: #9ca3af;
9
- --color-neutral-text-default: #1f2937;
10
- --color-brand-primary: #2563eb;
11
- --color-brand-accent: #2563eb;
12
- --color-brand-surface: #eff6ff;
13
- --spacing-xs: 4px;
14
- --spacing-sm: 6px;
15
- --spacing-md: 8px;
16
- --spacing-lg: 12px;
17
- --spacing-xl: 16px;
18
- --spacing-3xl: 24px;
19
- --spacing-5xl: 32px;
20
- --spacing-7xl: 48px;
21
- --radius-sm: 4px;
22
- --radius-md: 6px;
23
- }
24
-
25
-
26
- .DataTableJSX {
27
- display: flex;
28
- flex-direction: column;
29
- width: 100%;
30
- height: 100%;
31
- overflow: hidden;
32
- border-radius: var(--radius-md);
33
- border: 1px solid var(--color-neutral-border-default);
34
- background-color: var(--color-neutral-bg-surface);
35
- }
36
-
37
- .DataTableJSX--pending {
38
- display: flex;
39
- align-items: center;
40
- justify-content: center;
41
- min-height: 240px;
42
- }
43
-
44
- .DataTableJSX--pending .data-table-loading-text {
45
- font-size: 14px;
46
- color: var(--color-neutral-text-muted);
47
- }
48
-
49
- .DataTableJSX--with-pagination {
50
- border-bottom-left-radius: 0;
51
- border-bottom-right-radius: 0;
52
- border-bottom: 0;
53
- }
54
-
55
- .DataTableJSX .data-table-scroll {
56
- flex: 1;
57
- min-height: 0;
58
- overflow: auto;
59
- }
60
-
61
- .DataTableJSX .data-table {
62
- width: 100%;
63
- border-collapse: separate;
64
- border-spacing: 0;
65
- }
66
-
67
- .DataTableJSX .data-table-head {
68
- position: sticky;
69
- top: 0;
70
- z-index: 10;
71
- background-color: var(--color-neutral-bg-app);
72
- }
73
-
74
- .DataTableJSX .data-table-head-row {
75
- height: 40px;
76
- }
77
-
78
- .DataTableJSX .data-table-head-cell {
79
- border-bottom: 1px solid var(--color-neutral-border-default);
80
- padding: 0 var(--spacing-md);
81
- font-size: 12px;
82
- font-weight: 600;
83
- color: var(--color-neutral-text-muted);
84
- }
85
-
86
- .DataTableJSX .data-table-body {
87
- user-select: none;
88
- }
89
-
90
- .DataTableJSX .data-table-empty-cell {
91
- height: 96px;
92
- border-bottom: 1px solid var(--color-neutral-border-default);
93
- padding: 0 var(--spacing-md);
94
- text-align: center;
95
- font-size: 14px;
96
- color: var(--color-neutral-text-muted);
97
- }
98
-
99
- .DataTableJSX .data-table-virtual-spacer-cell {
100
- padding: 0;
101
- border: 0;
102
- }
103
-
104
- .DataTableJSX .cell-align-left {
105
- text-align: left;
106
- }
107
-
108
- .DataTableJSX .cell-align-center {
109
- text-align: center;
110
- }
111
-
112
- .DataTableJSX .cell-align-right {
113
- text-align: right;
114
- }
115
-
116
-
117
- .DataTableRowJSX {
118
- min-height: 44px;
119
- background-color: var(--color-neutral-bg-surface);
120
- transition: background-color 0.15s ease;
121
- }
122
-
123
- .DataTableRowJSX.row-hoverable:hover {
124
- background-color: var(--color-neutral-border-default);
125
- }
126
-
127
- .DataTableRowJSX.row-hovered {
128
- background-color: var(--color-neutral-border-default);
129
- }
130
-
131
- .DataTableRowJSX.is-selected {
132
- background-color: var(--color-brand-primary);
133
- color: #ffffff;
134
- }
135
-
136
- .DataTableRowJSX.is-selected * {
137
- color: #ffffff;
138
- }
139
-
140
- .DataTableRowJSX.is-expandable {
141
- cursor: pointer;
142
- }
143
-
144
- .DataTableRowJSX .data-table-cell {
145
- position: relative;
146
- border-bottom: 1px solid var(--color-neutral-border-default);
147
- padding: 0 var(--spacing-md);
148
- font-size: 14px;
149
- font-weight: 400;
150
- }
151
-
152
- .DataTableRowJSX .data-table-cell.is-group-selected {
153
- background-color: var(--color-brand-primary);
154
- color: #ffffff;
155
- }
156
-
157
- .DataTableRowJSX .data-table-cell.is-group-selected * {
158
- color: #ffffff;
159
- }
160
-
161
- .DataTableRowJSX .data-table-cell.is-group-hovered {
162
- background-color: var(--color-neutral-border-default);
163
- }
164
-
165
- .DataTableRowJSX .data-table-cell.cell-selection-fill {
166
- background-color: var(--color-brand-surface);
167
- color: #000000;
168
- }
169
-
170
- .DataTableRowJSX .data-table-cell.is-editable {
171
- cursor: text;
172
- }
173
-
174
- .DataTableRowJSX .cell-align-left {
175
- text-align: left;
176
- }
177
-
178
- .DataTableRowJSX .cell-align-center {
179
- text-align: center;
180
- }
181
-
182
- .DataTableRowJSX .cell-align-right {
183
- text-align: right;
184
- }
185
-
186
- .DataTableRowJSX .cell-edit-input {
187
- box-sizing: border-box;
188
- width: 100%;
189
- min-width: 0;
190
- height: 32px;
191
- padding: 0 var(--spacing-xs);
192
- border: 0;
193
- border-radius: var(--radius-sm);
194
- background-color: var(--color-neutral-bg-surface);
195
- font-size: 14px;
196
- color: var(--color-neutral-text-default);
197
- outline: none;
198
- user-select: text;
199
- }
200
-
201
- .DataTableRowJSX .expand-cell {
202
- display: flex;
203
- align-items: center;
204
- justify-content: space-between;
205
- gap: var(--spacing-xs);
206
- }
207
-
208
- .DataTableRowJSX .expand-cell-content {
209
- display: flex;
210
- min-width: 0;
211
- align-items: center;
212
- gap: var(--spacing-xs);
213
- }
214
-
215
- .DataTableRowJSX .expand-cell-indent {
216
- flex-shrink: 0;
217
- width: 20px;
218
- text-align: center;
219
- font-size: 20px;
220
- line-height: 1;
221
- }
222
-
223
- .DataTableRowJSX .expand-cell-value {
224
- min-width: 0;
225
- overflow: hidden;
226
- text-overflow: ellipsis;
227
- white-space: nowrap;
228
- }
229
-
230
- .DataTableRowJSX .expand-toggle-button {
231
- display: inline-flex;
232
- flex-shrink: 0;
233
- align-items: center;
234
- justify-content: center;
235
- width: 24px;
236
- height: 24px;
237
- padding: 0;
238
- border: 0;
239
- background: transparent;
240
- color: var(--color-neutral-text-muted);
241
- cursor: pointer;
242
- }
243
-
244
- .DataTableRowJSX .expand-toggle-icon {
245
- width: 16px;
246
- height: 16px;
247
- }
248
-
249
- .DataTableRowJSX .fill-handle {
250
- position: absolute;
251
- right: 0;
252
- bottom: 0;
253
- z-index: 10;
254
- width: 8px;
255
- height: 8px;
256
- background-color: var(--color-brand-primary);
257
- cursor: crosshair;
258
- }
259
-
260
-
261
- .DataTableToolbarJSX {
262
- display: flex;
263
- flex-shrink: 0;
264
- align-items: center;
265
- justify-content: space-between;
266
- gap: var(--spacing-md);
267
- height: 48px;
268
- padding: 0 var(--spacing-5xl);
269
- border-bottom: 1px solid var(--color-neutral-border-default);
270
- }
271
-
272
- .DataTableToolbarJSX .toolbar-left {
273
- display: flex;
274
- min-width: 0;
275
- flex: 1;
276
- align-items: center;
277
- gap: var(--spacing-7xl);
278
- }
279
-
280
- .DataTableToolbarJSX .toolbar-count {
281
- flex-shrink: 0;
282
- font-size: 16px;
283
- font-weight: 600;
284
- letter-spacing: -0.1px;
285
- }
286
-
287
- .DataTableToolbarJSX .toolbar-count-primary {
288
- color: var(--color-neutral-text-primary);
289
- }
290
-
291
- .DataTableToolbarJSX .toolbar-count-placeholder {
292
- color: var(--color-neutral-text-placeholder);
293
- }
294
-
295
- .DataTableToolbarJSX .toolbar-right {
296
- display: flex;
297
- flex-shrink: 0;
298
- align-items: center;
299
- gap: var(--spacing-7xl);
300
- }
301
-
302
- .DataTableToolbarJSX .toolbar-selection {
303
- font-size: 14px;
304
- font-weight: 500;
305
- color: var(--color-brand-accent);
306
- }
307
-
308
- .DataTableToolbarJSX .toolbar-actions {
309
- display: flex;
310
- flex-shrink: 0;
311
- align-items: center;
312
- gap: var(--spacing-lg);
313
- }
314
-
315
-
316
- .TableJSX {
317
- display: flex;
318
- width: 100%;
319
- height: 100%;
320
- flex-direction: column;
321
- overflow: hidden;
322
- }
323
-
324
-
325
- .TablePaginationJSX {
326
- display: flex;
327
- flex-shrink: 0;
328
- align-items: center;
329
- justify-content: center;
330
- gap: var(--spacing-md);
331
- height: 48px;
332
- padding: 0 var(--spacing-5xl);
333
- border-top: 1px solid var(--color-neutral-border-default);
334
- border-radius: 0 0 var(--radius-md) var(--radius-md);
335
- border: 1px solid var(--color-neutral-border-default);
336
- border-top: 0;
337
- background-color: var(--color-neutral-bg-surface);
338
- }
339
-
340
- .TablePaginationJSX .pagination-button {
341
- display: inline-flex;
342
- flex-shrink: 0;
343
- align-items: center;
344
- justify-content: center;
345
- gap: var(--spacing-xs);
346
- padding: var(--spacing-xs) var(--spacing-xl);
347
- border: 1px solid var(--color-neutral-border-default);
348
- border-radius: var(--radius-sm);
349
- background-color: var(--color-neutral-bg-surface);
350
- color: var(--color-neutral-text-secondary);
351
- font-size: 12px;
352
- font-weight: 500;
353
- line-height: 1.4;
354
- cursor: pointer;
355
- transition: background-color 0.15s ease;
356
- }
357
-
358
- .TablePaginationJSX .pagination-button:hover:not(:disabled) {
359
- background-color: var(--color-neutral-bg-app);
360
- }
361
-
362
- .TablePaginationJSX .pagination-button:disabled {
363
- opacity: 0.4;
364
- pointer-events: none;
365
- cursor: not-allowed;
366
- }
367
-
368
- .TablePaginationJSX .pagination-button-icon {
369
- width: 16px;
370
- height: 16px;
371
- }
372
-
373
- .TablePaginationJSX .pagination-label {
374
- min-width: 72px;
375
- text-align: center;
376
- font-size: 14px;
377
- color: var(--color-neutral-text-secondary);
378
- }
379
-
380
-
381
- .SortableHeaderJSX {
382
- display: inline-flex;
383
- align-items: center;
384
- gap: var(--spacing-xs);
385
- padding: 0;
386
- border: 0;
387
- background: transparent;
388
- cursor: pointer;
389
- font: inherit;
390
- }
391
-
392
- .SortableHeaderJSX.is-active {
393
- color: var(--color-neutral-text-primary);
394
- }
395
-
396
- .SortableHeaderJSX.is-inactive {
397
- color: var(--color-neutral-text-muted);
398
- }
399
-
400
- .SortableHeaderJSX .sortable-header-icon {
401
- flex-shrink: 0;
402
- width: 14px;
403
- height: 14px;
404
- }