@dynostack/react-grid 0.1.0 → 0.2.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 +305 -18
- package/dist/index.cjs +375 -97
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +142 -43
- package/dist/index.d.ts +142 -43
- package/dist/index.js +371 -99
- package/dist/index.js.map +1 -1
- package/dist/page.css +24 -0
- package/dist/styles.css +145 -46
- package/package.json +4 -2
package/dist/page.css
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Optional page-level styling for @dynostack/react-grid.
|
|
3
|
+
*
|
|
4
|
+
* Import this AFTER `styles.css` if you want the page background and text
|
|
5
|
+
* color to follow the same tokens the grid uses — so the grid blends into
|
|
6
|
+
* the page instead of sitting on a contrasting body color.
|
|
7
|
+
*
|
|
8
|
+
* import "@dynostack/react-grid/styles.css"
|
|
9
|
+
* import "@dynostack/react-grid/page.css" // optional
|
|
10
|
+
*
|
|
11
|
+
* Not imported by default — `styles.css` only declares tokens, never touches
|
|
12
|
+
* `html` or `body`, which keeps the grid embeddable inside heavily-themed
|
|
13
|
+
* shells without surprise side effects.
|
|
14
|
+
*
|
|
15
|
+
* Layered the same way as `styles.css` so consumer rules still win.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
@layer dynostack-grid-defaults {
|
|
19
|
+
html,
|
|
20
|
+
body {
|
|
21
|
+
background-color: var(--background);
|
|
22
|
+
color: var(--foreground);
|
|
23
|
+
}
|
|
24
|
+
}
|
package/dist/styles.css
CHANGED
|
@@ -1,71 +1,170 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Default theme tokens for @dynostack/react-grid.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* have shadcn/ui's tokens defined on :root. If shadcn is already set up,
|
|
6
|
-
* skip this — the table will pick up the tokens you already provide.
|
|
4
|
+
* Drop-in behavior:
|
|
7
5
|
*
|
|
8
|
-
*
|
|
6
|
+
* import "@dynostack/react-grid/styles.css"
|
|
7
|
+
*
|
|
8
|
+
* What you get with this single import:
|
|
9
|
+
*
|
|
10
|
+
* • Clean light tokens by default.
|
|
11
|
+
* • Automatic dark-mode follow: switches when the OS reports
|
|
12
|
+
* `prefers-color-scheme: dark`.
|
|
13
|
+
* • Manual override: add the `.dark` (or `.light`) class to <html> or any
|
|
14
|
+
* ancestor and the table flips immediately, ignoring OS preference.
|
|
15
|
+
* • shadcn-compatible: token names match shadcn/ui's CSS variables exactly,
|
|
16
|
+
* so if you already have shadcn (or any compatible theme) defined on
|
|
17
|
+
* :root, *that* takes precedence and the grid blends in automatically.
|
|
18
|
+
*
|
|
19
|
+
* Cascade design
|
|
20
|
+
* --------------
|
|
21
|
+
* All declarations below live inside the `dynostack-grid-defaults` cascade
|
|
22
|
+
* layer. Any *unlayered* declaration in the consumer app (which is where
|
|
23
|
+
* shadcn and most app CSS lives) automatically wins, regardless of import
|
|
24
|
+
* order. This makes import order non-fragile — you cannot accidentally
|
|
25
|
+
* overwrite the consumer's theme by importing this file in the "wrong" spot.
|
|
26
|
+
*
|
|
27
|
+
* <highest priority>
|
|
28
|
+
* inline style on the grid root (per-instance `theme` prop)
|
|
29
|
+
* consumer's unlayered :root rules (shadcn, custom app theme)
|
|
30
|
+
* this file (@layer dynostack-grid-defaults)
|
|
31
|
+
* <lowest priority>
|
|
9
32
|
*/
|
|
10
33
|
|
|
11
|
-
|
|
12
|
-
|
|
34
|
+
@layer dynostack-grid-defaults {
|
|
35
|
+
:root {
|
|
36
|
+
color-scheme: light;
|
|
13
37
|
|
|
14
|
-
|
|
15
|
-
--foreground: oklch(0.145 0 0);
|
|
38
|
+
--radius: 0.625rem;
|
|
16
39
|
|
|
17
|
-
|
|
18
|
-
|
|
40
|
+
--background: oklch(1 0 0);
|
|
41
|
+
--foreground: oklch(0.145 0 0);
|
|
19
42
|
|
|
20
|
-
|
|
21
|
-
|
|
43
|
+
--card: oklch(1 0 0);
|
|
44
|
+
--card-foreground: oklch(0.145 0 0);
|
|
22
45
|
|
|
23
|
-
|
|
24
|
-
|
|
46
|
+
--popover: oklch(1 0 0);
|
|
47
|
+
--popover-foreground: oklch(0.145 0 0);
|
|
25
48
|
|
|
26
|
-
|
|
27
|
-
|
|
49
|
+
--primary: oklch(0.205 0 0);
|
|
50
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
28
51
|
|
|
29
|
-
|
|
30
|
-
|
|
52
|
+
--secondary: oklch(0.97 0 0);
|
|
53
|
+
--secondary-foreground: oklch(0.205 0 0);
|
|
31
54
|
|
|
32
|
-
|
|
33
|
-
|
|
55
|
+
--muted: oklch(0.97 0 0);
|
|
56
|
+
--muted-foreground: oklch(0.556 0 0);
|
|
34
57
|
|
|
35
|
-
|
|
36
|
-
|
|
58
|
+
--accent: oklch(0.97 0 0);
|
|
59
|
+
--accent-foreground: oklch(0.205 0 0);
|
|
37
60
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
61
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
62
|
+
--destructive-foreground: oklch(0.985 0 0);
|
|
63
|
+
|
|
64
|
+
--border: oklch(0.922 0 0);
|
|
65
|
+
--input: oklch(0.922 0 0);
|
|
66
|
+
--ring: oklch(0.708 0 0);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* Auto-follow OS dark mode. */
|
|
70
|
+
@media (prefers-color-scheme: dark) {
|
|
71
|
+
:root {
|
|
72
|
+
color-scheme: dark;
|
|
73
|
+
|
|
74
|
+
--background: oklch(0.145 0 0);
|
|
75
|
+
--foreground: oklch(0.985 0 0);
|
|
76
|
+
|
|
77
|
+
--card: oklch(0.205 0 0);
|
|
78
|
+
--card-foreground: oklch(0.985 0 0);
|
|
79
|
+
|
|
80
|
+
--popover: oklch(0.205 0 0);
|
|
81
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
82
|
+
|
|
83
|
+
--primary: oklch(0.985 0 0);
|
|
84
|
+
--primary-foreground: oklch(0.205 0 0);
|
|
85
|
+
|
|
86
|
+
--secondary: oklch(0.269 0 0);
|
|
87
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
88
|
+
|
|
89
|
+
--muted: oklch(0.269 0 0);
|
|
90
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
91
|
+
|
|
92
|
+
--accent: oklch(0.269 0 0);
|
|
93
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
94
|
+
|
|
95
|
+
--destructive: oklch(0.577 0.245 27.325 / 0.6);
|
|
96
|
+
--destructive-foreground: oklch(0.985 0 0);
|
|
97
|
+
|
|
98
|
+
--border: oklch(0.269 0 0);
|
|
99
|
+
--input: oklch(0.269 0 0);
|
|
100
|
+
--ring: oklch(0.439 0 0);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* Manual override — wins over the media query above. */
|
|
105
|
+
:root.light,
|
|
106
|
+
.light {
|
|
107
|
+
color-scheme: light;
|
|
108
|
+
|
|
109
|
+
--background: oklch(1 0 0);
|
|
110
|
+
--foreground: oklch(0.145 0 0);
|
|
111
|
+
|
|
112
|
+
--card: oklch(1 0 0);
|
|
113
|
+
--card-foreground: oklch(0.145 0 0);
|
|
114
|
+
|
|
115
|
+
--popover: oklch(1 0 0);
|
|
116
|
+
--popover-foreground: oklch(0.145 0 0);
|
|
117
|
+
|
|
118
|
+
--primary: oklch(0.205 0 0);
|
|
119
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
120
|
+
|
|
121
|
+
--secondary: oklch(0.97 0 0);
|
|
122
|
+
--secondary-foreground: oklch(0.205 0 0);
|
|
123
|
+
|
|
124
|
+
--muted: oklch(0.97 0 0);
|
|
125
|
+
--muted-foreground: oklch(0.556 0 0);
|
|
126
|
+
|
|
127
|
+
--accent: oklch(0.97 0 0);
|
|
128
|
+
--accent-foreground: oklch(0.205 0 0);
|
|
129
|
+
|
|
130
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
131
|
+
--destructive-foreground: oklch(0.985 0 0);
|
|
132
|
+
|
|
133
|
+
--border: oklch(0.922 0 0);
|
|
134
|
+
--input: oklch(0.922 0 0);
|
|
135
|
+
--ring: oklch(0.708 0 0);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
:root.dark,
|
|
139
|
+
.dark {
|
|
140
|
+
color-scheme: dark;
|
|
42
141
|
|
|
43
|
-
.
|
|
44
|
-
|
|
45
|
-
--foreground: oklch(0.985 0 0);
|
|
142
|
+
--background: oklch(0.145 0 0);
|
|
143
|
+
--foreground: oklch(0.985 0 0);
|
|
46
144
|
|
|
47
|
-
|
|
48
|
-
|
|
145
|
+
--card: oklch(0.205 0 0);
|
|
146
|
+
--card-foreground: oklch(0.985 0 0);
|
|
49
147
|
|
|
50
|
-
|
|
51
|
-
|
|
148
|
+
--popover: oklch(0.205 0 0);
|
|
149
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
52
150
|
|
|
53
|
-
|
|
54
|
-
|
|
151
|
+
--primary: oklch(0.985 0 0);
|
|
152
|
+
--primary-foreground: oklch(0.205 0 0);
|
|
55
153
|
|
|
56
|
-
|
|
57
|
-
|
|
154
|
+
--secondary: oklch(0.269 0 0);
|
|
155
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
58
156
|
|
|
59
|
-
|
|
60
|
-
|
|
157
|
+
--muted: oklch(0.269 0 0);
|
|
158
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
61
159
|
|
|
62
|
-
|
|
63
|
-
|
|
160
|
+
--accent: oklch(0.269 0 0);
|
|
161
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
64
162
|
|
|
65
|
-
|
|
66
|
-
|
|
163
|
+
--destructive: oklch(0.577 0.245 27.325 / 0.6);
|
|
164
|
+
--destructive-foreground: oklch(0.985 0 0);
|
|
67
165
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
166
|
+
--border: oklch(0.269 0 0);
|
|
167
|
+
--input: oklch(0.269 0 0);
|
|
168
|
+
--ring: oklch(0.439 0 0);
|
|
169
|
+
}
|
|
71
170
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynostack/react-grid",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Enterprise-grade React DataGrid on TanStack + Radix + Tailwind, with operator-driven filters, inline editing, column pinning/resizing/reordering, CSV/Excel export, and full theme + i18n customization.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "wanted-coder-vijay <drop.at.vijay@gmail.com>",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"require": "./dist/index.cjs"
|
|
30
30
|
},
|
|
31
31
|
"./styles.css": "./dist/styles.css",
|
|
32
|
+
"./page.css": "./dist/page.css",
|
|
32
33
|
"./tailwind-content": "./dist/tailwind-content.js"
|
|
33
34
|
},
|
|
34
35
|
"files": [
|
|
@@ -41,7 +42,8 @@
|
|
|
41
42
|
"build": "tsup",
|
|
42
43
|
"dev": "tsup --watch",
|
|
43
44
|
"typecheck": "tsc --noEmit",
|
|
44
|
-
"clean": "rimraf dist"
|
|
45
|
+
"clean": "rimraf dist",
|
|
46
|
+
"prepublishOnly": "npm run clean && npm run typecheck && npm run build"
|
|
45
47
|
},
|
|
46
48
|
"keywords": [
|
|
47
49
|
"react",
|