@blakesteve/roster 4.1.0 → 4.2.1
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/LICENSE +21 -0
- package/README.md +37 -3
- package/dist/Table-BaJ8qfrV.js +4949 -0
- package/dist/Table-Cqm_mtRS.cjs +566 -0
- package/dist/components/atoms/Eyebrow/Eyebrow.d.ts +19 -3
- package/dist/components/atoms/ThemeToggle/ThemeToggle.d.ts +15 -0
- package/dist/components/molecules/Breadcrumbs/Breadcrumbs.d.ts +42 -3
- package/dist/data-table.cjs.js +1 -1
- package/dist/data-table.es.js +9 -8
- package/dist/preflight.cjs.js +1 -1
- package/dist/preflight.es.js +1 -1
- package/dist/roster.cjs.js +2 -2
- package/dist/roster.css +1 -1
- package/dist/roster.es.js +763 -739
- package/dist/tokens.cjs.js +1 -1
- package/dist/tokens.es.js +1 -1
- package/dist/utils-D2U2F80P.cjs +1 -0
- package/dist/utils-DtaLkIY8.js +2776 -0
- package/dist/utils.cjs.js +1 -0
- package/dist/utils.d.ts +14 -0
- package/dist/utils.es.js +4 -0
- package/package.json +28 -1
- package/dist/Table-DN9b_g1N.cjs +0 -566
- package/dist/Table-DNbzjCZM.js +0 -7716
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Blake Ball
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -143,6 +143,27 @@ the script and the toggle disagree, which shows up as a flash on every reload.
|
|
|
143
143
|
bar paints *itself* with. Pair them with `themeMode="auto"` and the nav follows
|
|
144
144
|
whatever `ThemeToggle` sets.
|
|
145
145
|
|
|
146
|
+
### Components that render links
|
|
147
|
+
|
|
148
|
+
`Breadcrumbs` renders a plain `<a>` by default, which is right for a static
|
|
149
|
+
page and wrong inside a router — every hop becomes a full page load. Pass your
|
|
150
|
+
router's link component instead:
|
|
151
|
+
|
|
152
|
+
```tsx
|
|
153
|
+
import NextLink from "next/link";
|
|
154
|
+
|
|
155
|
+
<Breadcrumbs linkComponent={NextLink} items={items} />;
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
In an app with React Server Components, do that from a client component.
|
|
159
|
+
`linkComponent` is a function, and functions do not cross the RSC boundary —
|
|
160
|
+
passing it from a server component fails the render with *Functions cannot be
|
|
161
|
+
passed directly to Client Components*. A small `"use client"` wrapper binds it
|
|
162
|
+
once, and the pages that use the wrapper stay server-rendered.
|
|
163
|
+
|
|
164
|
+
`Eyebrow` takes the other approach: `as` accepts any element and the props
|
|
165
|
+
follow it, so `<Eyebrow as="a" href="/work">` works, as does `as={NextLink}`.
|
|
166
|
+
|
|
146
167
|
## Quick start
|
|
147
168
|
|
|
148
169
|
```tsx
|
|
@@ -179,7 +200,7 @@ function App() {
|
|
|
179
200
|
| `Card` | Bordered surface container |
|
|
180
201
|
| `Checkbox` | Accessible checkbox with label support |
|
|
181
202
|
| `Disclosure` | Show/hide toggle using HeadlessUI |
|
|
182
|
-
| `Eyebrow` | Small tracked-out uppercase label above a heading or beside a rule |
|
|
203
|
+
| `Eyebrow` | Small tracked-out uppercase label above a heading or beside a rule; polymorphic via `as` |
|
|
183
204
|
| `InlineCode` | Inline `<code>` for identifiers in running prose |
|
|
184
205
|
| `Input` | Text input with label, error state, and icon slots |
|
|
185
206
|
| `LabeledDivider` | Horizontal rule carrying a label, with an optional trailing count |
|
|
@@ -195,7 +216,7 @@ function App() {
|
|
|
195
216
|
| `Spinner` | Loading indicator |
|
|
196
217
|
| `Switch` | Toggle switch |
|
|
197
218
|
| `Textarea` | Multi-line text input |
|
|
198
|
-
| `ThemeToggle` | Flips class-based dark mode on the document root and remembers the choice |
|
|
219
|
+
| `ThemeToggle` | Flips class-based dark mode on the document root and remembers the choice; labels and icons are configurable |
|
|
199
220
|
| `Tooltip` | Radix-powered tooltip: hover/focus on desktop, tap-to-toggle on mobile |
|
|
200
221
|
|
|
201
222
|
### Molecules
|
|
@@ -204,7 +225,7 @@ function App() {
|
|
|
204
225
|
|---|---|
|
|
205
226
|
| `Accordion` | Collapsible content sections (single or multi-expand) |
|
|
206
227
|
| `Alert` | Inline notice strip with optional title and dismiss |
|
|
207
|
-
| `Breadcrumbs` | Navigation trail |
|
|
228
|
+
| `Breadcrumbs` | Navigation trail; pass `linkComponent` to keep navigation client-side |
|
|
208
229
|
| `CallToAction` | Prominent hero-style CTA block |
|
|
209
230
|
| `DescriptionList` | Label and value pairs as a real `<dl>`: inline, stacked, or split |
|
|
210
231
|
| `EmptyState` | Zero-data placeholder with icon and action slot |
|
|
@@ -251,6 +272,19 @@ argument instead of two. A columns array is heterogeneous, so v9 types each
|
|
|
251
272
|
entry's value as `unknown` and recovers the real type per column through
|
|
252
273
|
`createColumnHelper`.
|
|
253
274
|
|
|
275
|
+
### Server components
|
|
276
|
+
|
|
277
|
+
The main entry carries a `"use client"` directive, because nearly everything in
|
|
278
|
+
it is interactive. That is correct for components and wrong for a plain
|
|
279
|
+
function, so `cn` ships from its own entry with no directive:
|
|
280
|
+
|
|
281
|
+
```tsx
|
|
282
|
+
import { cn } from "@blakesteve/roster/utils";
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
Importing `cn` from the package root still works on the client. In a React
|
|
286
|
+
Server Component it typechecks and then throws at render — use `/utils` there.
|
|
287
|
+
|
|
254
288
|
### Hooks
|
|
255
289
|
|
|
256
290
|
| Hook | Description |
|