@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 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. Install it only if you use `DataTable`; every other component works
35
- without it.
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
- ### Import Roster before Tailwind
65
+ ### Cascade layers
60
66
 
61
- If your app uses Tailwind, import Roster's CSS **before** it:
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
- Roster ships its styles inside a `roster` cascade layer, and CSS orders layers
71
- by *first registration*. Importing Roster first places its layer beneath your
72
- app's own utilities, so your styles always win. Import it second and the
73
- opposite happens: Roster's `.block` starts beating your `dark:hidden`, and
74
- variants fail silently with the rule present in the stylesheet.
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) |