@blakesteve/roster 3.0.0 → 4.0.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 +31 -11
- package/dist/Table-CG6Z6c1A.js +7711 -0
- package/dist/Table-CPAcmkIV.cjs +566 -0
- package/dist/data-table.cjs.js +1 -0
- package/dist/data-table.d.ts +21 -0
- package/dist/data-table.es.js +155 -0
- package/dist/index.d.ts +0 -1
- package/dist/preflight.css +1 -1
- package/dist/roster.cjs.js +2 -567
- package/dist/roster.css +1 -1
- package/dist/roster.es.js +3777 -11560
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -31,13 +31,19 @@ Roster ships pre-compiled CSS, so you do not need Tailwind installed in your hos
|
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
`DataTable` additionally needs TanStack Table v9, declared as an **optional**
|
|
34
|
-
peer.
|
|
35
|
-
|
|
34
|
+
peer. It ships from its own entry point so that peer stays genuinely optional:
|
|
35
|
+
importing anything from `@blakesteve/roster` never pulls TanStack in, because a
|
|
36
|
+
bundler resolves imports before it tree-shakes. Install it only if you use
|
|
37
|
+
`DataTable`; every other component works without it.
|
|
36
38
|
|
|
37
39
|
```bash
|
|
38
40
|
npm install @tanstack/react-table
|
|
39
41
|
```
|
|
40
42
|
|
|
43
|
+
```tsx
|
|
44
|
+
import { DataTable, type RosterTableFeatures } from "@blakesteve/roster/data-table";
|
|
45
|
+
```
|
|
46
|
+
|
|
41
47
|
It is a peer rather than a bundled dependency because v9 types column
|
|
42
48
|
definitions against the feature set that built the table. Two copies of the
|
|
43
49
|
package would mean two incompatible sets of those types, so roster and your
|
|
@@ -56,9 +62,10 @@ import "@blakesteve/roster/style.css";
|
|
|
56
62
|
import "@blakesteve/roster/tokens.css";
|
|
57
63
|
```
|
|
58
64
|
|
|
59
|
-
###
|
|
65
|
+
### Cascade layers
|
|
60
66
|
|
|
61
|
-
|
|
67
|
+
Roster ships its styles inside a `roster` cascade layer and declares the full
|
|
68
|
+
layer order in its own stylesheet, so importing it is normally enough:
|
|
62
69
|
|
|
63
70
|
```css
|
|
64
71
|
/* globals.css */
|
|
@@ -67,11 +74,23 @@ If your app uses Tailwind, import Roster's CSS **before** it:
|
|
|
67
74
|
@import "tailwindcss";
|
|
68
75
|
```
|
|
69
76
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
77
|
+
The order Roster declares is:
|
|
78
|
+
|
|
79
|
+
```css
|
|
80
|
+
@layer roster-preflight, theme, base, components, roster, utilities;
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
`roster` has to sit in that exact slot. **Above `base`**, because Tailwind's
|
|
84
|
+
preflight resets `*{margin:0;padding:0;border:0 solid}` — put Roster below it
|
|
85
|
+
and that reset outranks Roster's own spacing and border utilities, silently
|
|
86
|
+
stripping padding off buttons and turning `border-transparent` into a visible
|
|
87
|
+
1px line. **Below `utilities`**, so your app's classes and variants such as
|
|
88
|
+
`dark:hidden` still win.
|
|
89
|
+
|
|
90
|
+
Layers are ordered by *first registration*, so importing Roster before Tailwind
|
|
91
|
+
is the reliable arrangement. If you would rather not depend on import order at
|
|
92
|
+
all, declare the same line yourself at the top of your global stylesheet and it
|
|
93
|
+
holds regardless.
|
|
75
94
|
|
|
76
95
|
### The global reset is opt-in
|
|
77
96
|
|
|
@@ -159,7 +178,7 @@ function App() {
|
|
|
159
178
|
|---|---|
|
|
160
179
|
| `ActionBar` | Sticky bottom action strip |
|
|
161
180
|
| `Countdown` | Live countdown timer |
|
|
162
|
-
| `DataTable` | Full-featured table with sorting and pagination via TanStack Table v9 (see [DataTable columns](#datatable-columns)) |
|
|
181
|
+
| `DataTable` | Full-featured table with sorting and pagination via TanStack Table v9. Imported from `@blakesteve/roster/data-table` (see [DataTable columns](#datatable-columns)) |
|
|
163
182
|
| `Dialog` | Modal dialog |
|
|
164
183
|
| `Footer` | Site footer |
|
|
165
184
|
| `Navbar` | Responsive navigation bar with mobile slide-out |
|
|
@@ -172,7 +191,7 @@ the table. `DataTable` registers sorting and pagination and exports that set as
|
|
|
172
191
|
`RosterTableFeatures`, so your columns name it:
|
|
173
192
|
|
|
174
193
|
```tsx
|
|
175
|
-
import { DataTable, type RosterTableFeatures } from "@blakesteve/roster";
|
|
194
|
+
import { DataTable, type RosterTableFeatures } from "@blakesteve/roster/data-table";
|
|
176
195
|
import { createColumnHelper, type ColumnDef } from "@tanstack/react-table";
|
|
177
196
|
|
|
178
197
|
type Player = { name: string; points: number };
|
|
@@ -233,6 +252,7 @@ Output in `dist/`:
|
|
|
233
252
|
|---|---|
|
|
234
253
|
| `roster.es.js` | ES module bundle |
|
|
235
254
|
| `roster.umd.js` | UMD bundle |
|
|
255
|
+
| `data-table.es.js` | DataTable entry, keeping the TanStack import out of the main bundle |
|
|
236
256
|
| `roster.css` | Compiled component styles, in the `roster` cascade layer |
|
|
237
257
|
| `tokens.css` | Design token CSS variables |
|
|
238
258
|
| `preflight.css` | Optional global reset (see Setup) |
|