@snowpact/react-tanstack-query-table 1.1.3 → 1.3.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/README.md CHANGED
@@ -24,35 +24,51 @@ pnpm add @snowpact/react-tanstack-query-table
24
24
  npm install @tanstack/react-query @tanstack/react-table react react-dom
25
25
  ```
26
26
 
27
- ### Tailwind CSS Configuration
27
+ ### Import Styles
28
28
 
29
- Tailwind CSS is required. You must configure Tailwind to scan the package's classes:
29
+ Import the library CSS in your app entry point:
30
30
 
31
- **In your `tailwind.config.css` (Tailwind v4):**
31
+ ```tsx
32
+ import '@snowpact/react-tanstack-query-table/styles.css';
33
+ ```
34
+
35
+ ### Customization (Optional)
36
+
37
+ You can customize the library appearance by overriding CSS variables:
32
38
 
33
39
  ```css
34
- /* Include SnowTable classes for Tailwind scanning */
35
- @source "node_modules/@snowpact/react-tanstack-query-table/dist";
40
+ :root {
41
+ --snow-background: #ffffff; /* Main background (table, rows, inputs) */
42
+ --snow-foreground: #0a0a0a; /* Main text color */
43
+ --snow-secondary: #f5f5f5; /* Secondary background (headers, hover) */
44
+ --snow-secondary-foreground: #737373; /* Secondary text color */
45
+ --snow-border: #d4d4d4; /* Border color */
46
+ --snow-ring: #a3a3a3; /* Focus ring color */
47
+ --snow-radius: 0.375rem; /* Border radius */
48
+ }
36
49
  ```
37
50
 
38
- **Or in `tailwind.config.js` (Tailwind v3):**
51
+ **Dark mode example:**
39
52
 
40
- ```js
41
- module.exports = {
42
- content: [
43
- // ... your app files
44
- './node_modules/@snowpact/react-tanstack-query-table/dist/**/*.js',
45
- ],
46
- };
53
+ ```css
54
+ .dark {
55
+ --snow-background: #1a1a2e;
56
+ --snow-foreground: #eaeaea;
57
+ --snow-secondary: #16213e;
58
+ --snow-secondary-foreground: #a0a0a0;
59
+ --snow-border: #0f3460;
60
+ --snow-ring: #3b82f6;
61
+ }
47
62
  ```
48
63
 
49
- > **Note**: The path may vary depending on your project structure. If using a monorepo or workspace, adjust the path accordingly (e.g., `../../node_modules/...`).
50
-
51
64
  ## Quick Start
52
65
 
53
66
  ### 1. Setup (once in your app)
54
67
 
55
68
  ```tsx
69
+ // Import styles first
70
+ import '@snowpact/react-tanstack-query-table/styles.css';
71
+
56
72
  import { setupSnowTable } from '@snowpact/react-tanstack-query-table';
57
73
  import { useTranslation } from 'react-i18next';
58
74
  import { Link } from 'react-router-dom';
@@ -65,7 +81,7 @@ setupSnowTable({
65
81
  });
66
82
  ```
67
83
 
68
- > **Full setup example**: See [examples/full-setup.md](./examples/full-setup.md) for a complete Shadcn/UI integration with custom `useConfirm` hook, tooltips, and translations.
84
+ > **Full setup example**: See [examples/full-setup.md](./examples/full-setup.md) for a complete Shadcn/UI integration with custom `useConfirm` hook and translations.
69
85
 
70
86
  ### 2. Use a Client Table
71
87
 
@@ -412,17 +428,9 @@ setupSnowTable({
412
428
  });
413
429
  ```
414
430
 
415
- ### Action Hover (Tooltips)
431
+ ### Action Tooltips
416
432
 
417
- Integrate with your tooltip system:
418
-
419
- ```tsx
420
- setupSnowTable({
421
- // ... other options
422
- onActionHover: ({ label, element }) => showTooltip(label, element),
423
- onActionUnhover: () => hideTooltip(),
424
- });
425
- ```
433
+ Action buttons automatically display tooltips on hover. The tooltip uses your theme's CSS variables (`--snow-foreground`, `--snow-background`, `--snow-radius`) for consistent styling.
426
434
 
427
435
  ## API Reference
428
436