@blakesteve/roster 4.1.0 → 4.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 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 |