@meetreeve/ui 0.30.0 → 0.33.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
@@ -95,6 +95,7 @@ An optional compact list above the pages, e.g. recent chats. Rows are buttons: s
95
95
  moreHref: "/chats", // optional; "More" shows when items exceed `limit` or `hasMore`
96
96
  hasMore,
97
97
  // label: "Recent", limit: 6 (defaults)
98
+ // href: "/chats", // optional (DEV-19583): the heading becomes a link there
98
99
  }}
99
100
  />
100
101
  ```
@@ -105,6 +106,8 @@ The list sits between `topItem` and the pages, outside the measured ladder nav.
105
106
 
106
107
  A folded group's row opens a horizontal flyout on hover (desktop) or click (keyboard/touch parity): `aria-expanded` + menu roles, focus moves to the first child on open, Esc closes and returns focus to the trigger. If the active route's module is inside a folded group, the group's own row shows the active state and the flyout highlights the specific child. No open/close transition under `prefers-reduced-motion`.
107
108
 
109
+ A ladder group can carry its own page (`href`, DEV-19583; an app path starting with one `/`, zod-checked). The row then splits in two: the label is a link through `linkComponent` (click or Enter navigates, hover still opens the panel) and a chevron button beside it is the disclosure (Enter/Space/click, focus to the first child, Esc back to the chevron). The group is also active on its own href. On the collapsed icon rail the row stays one button and the panel's first row links to the group's page. Without `href` the row is the single button it always was.
110
+
108
111
  ## ResponsiveHeader
109
112
 
110
113
  ```tsx
@@ -280,11 +283,23 @@ clips gets no clip and no 404.
280
283
  (`aspect-video`) with `object-contain`, so a clip of another shape
281
284
  letterboxes instead of cropping. Border and background are the paired
282
285
  `border-border bg-muted` tokens.
286
+ - While it can play, a corner toggle pauses and resumes it (DEV-19403).
283
287
  - `prefers-reduced-motion` never starts playback, including on the first
284
288
  client render after SSR, and turning it on mid-loop pauses the clip. The
285
- poster and native controls carry it instead.
289
+ poster shows and the toggle offers Play, so it plays only when asked
290
+ (DEV-19583).
286
291
  - If the browser refuses autoplay (iOS Low Power Mode), native controls
287
- appear until a later `play()` succeeds.
292
+ replace the toggle until a later `play()` succeeds.
293
+
294
+ Card mode (DEV-19583), same files:
295
+
296
+ - `fit="cover"` crops to fill the 16:9 box (default `"contain"`).
297
+ - `playWhenVisible` attaches the sources only once a quarter of the clip is
298
+ on screen, so off-screen clips download nothing but the poster; it plays
299
+ only while visible and pauses when it leaves.
300
+ - `overlay` paints a node over the frame (e.g. a title on a dark fade); clicks
301
+ pass through it.
302
+ - `posterOnly` renders just the poster `<img>`, with no video or sources.
288
303
 
289
304
  `usePrefersReducedMotion()` is the live OS setting it reads. It is exported
290
305
  from the package root and, as before, from `@meetreeve/ui/charts`.
package/dist/index.d.mts CHANGED
@@ -212,17 +212,19 @@ declare function useResponsivePlaceholder(desktop: string, mobile?: string): str
212
212
  * looping seconds of the other app's screen, shown where a step sends someone
213
213
  * there. Generalised from the Docs share strip's ShareClip (DEV-18388).
214
214
  *
215
- * Muted and looping; reduced motion never starts it (and turning it on
216
- * mid-loop pauses it), so the poster and the native controls carry it
217
- * instead. A browser that refuses autoplay (iOS Low Power Mode) gets the
218
- * controls too, until a later play() succeeds. A browser whose play() returns
219
- * no promise (or has no play()) is judged by whether the clip actually left
220
- * the paused state.
215
+ * Muted and looping. A corner toggle pauses and resumes it (DEV-19403, WCAG
216
+ * 2.2.2). Reduced motion never starts it (and turning it on mid-loop pauses
217
+ * it): the poster shows and the toggle offers Play, so it plays only when the
218
+ * viewer asks (DEV-19583). A browser that refuses autoplay (iOS Low Power
219
+ * Mode) gets the native controls instead of the toggle, until a later play()
220
+ * succeeds, so there is never a second set. A browser whose play() returns no
221
+ * promise (or has no play()) is judged by whether the clip actually left the
222
+ * paused state. A pause made with the toggle outlasts a reduced-motion change
223
+ * and a scroll away, but not a new clip.
221
224
  *
222
- * While it autoplays, a corner toggle pauses and resumes it (DEV-19403, WCAG
223
- * 2.2.2). The toggle shows only while the native controls are off, so there is
224
- * never a second set; a pause made with the toggle outlasts a reduced-motion
225
- * change but not a new clip.
225
+ * Card mode (DEV-19583): `fit`, `overlay`, `playWhenVisible` (no download and
226
+ * no playback until the clip is on screen) and `posterOnly` (the poster image,
227
+ * no video at all).
226
228
  */
227
229
  interface HowToClipProps {
228
230
  /** File stem: `${clipBaseUrl}/${slug}.webm|.mp4` and `${clipBaseUrl}/${slug}-poster.jpg`. Must match /^[a-z0-9-]{1,64}$/ or nothing renders. */
@@ -231,9 +233,21 @@ interface HowToClipProps {
231
233
  label: string;
232
234
  /** Where the clip files are served from, e.g. "/how-to" or "https://cdn.example/how-to" (no query or hash). Omitted or blank → renders null. A trailing slash is dropped. */
233
235
  clipBaseUrl?: string;
236
+ /** How the frame fills the 16:9 box: `"contain"` (default) letterboxes, `"cover"` crops to fill, for cards. */
237
+ fit?: "contain" | "cover";
238
+ /**
239
+ * Attach the sources only once a quarter of the clip is first on screen
240
+ * (an off-screen clip downloads nothing but its poster), then play only
241
+ * while it stays that visible and pause when it leaves.
242
+ */
243
+ playWhenVisible?: boolean;
244
+ /** Painted over the frame, inside its rounded box (e.g. a title on a dark fade). Clicks pass through it. */
245
+ overlay?: ReactNode;
246
+ /** Only the poster, as an image named by `label`: no video, no sources, no toggle. */
247
+ posterOnly?: boolean;
234
248
  className?: string;
235
249
  }
236
- declare function HowToClip({ slug, label, clipBaseUrl, className }: HowToClipProps): react.JSX.Element | null;
250
+ declare function HowToClip({ slug, label, clipBaseUrl, fit, playWhenVisible, overlay, posterOnly, className, }: HowToClipProps): react.JSX.Element | null;
237
251
 
238
252
  interface SiteFooterLink {
239
253
  href: string;
@@ -328,6 +342,11 @@ interface GroupRungItem {
328
342
  icon: string;
329
343
  /** moduleIds folded into this group. Non-empty (zod-enforced). */
330
344
  children: string[];
345
+ /** DEV-19583: the group's own page — an app path ("/explore"), never another
346
+ * origin: zod rejects anything not starting with one "/", and any
347
+ * backslash, whitespace or control character (browsers fold those into "//").
348
+ * Set, the group's label links there and the row is active on it too. */
349
+ href?: string;
331
350
  }
332
351
  type RungItem = AppRungItem | GroupRungItem;
333
352
  interface SidebarRung {
@@ -367,6 +386,7 @@ declare const zSidebarLadder: z.ZodObject<{
367
386
  label: z.ZodString;
368
387
  icon: z.ZodString;
369
388
  children: z.ZodArray<z.ZodString>;
389
+ href: z.ZodOptional<z.ZodString>;
370
390
  }, z.core.$strip>], "type">>;
371
391
  }, z.core.$strip>>;
372
392
  }, z.core.$strip>;
@@ -433,6 +453,9 @@ interface AppSidebarRecent {
433
453
  onSelect: (id: string) => void;
434
454
  /** Section heading. Default `"Recent"`. */
435
455
  label?: string;
456
+ /** DEV-19583: where the heading goes (e.g. the full chats page). Set, the
457
+ * heading renders as a link through `linkComponent`, same text and id. */
458
+ href?: string;
436
459
  /** Rows shown before "More". Default 6; floored to a whole number >= 1, and a non-finite value uses the default. */
437
460
  limit?: number;
438
461
  /** Where "More" goes (rendered through `linkComponent`). No href, no More. */
@@ -598,7 +621,22 @@ interface FlyoutProps {
598
621
  active: boolean;
599
622
  children: FlyoutChild[];
600
623
  /**
601
- * Link renderer for the panel's child rows. Defaults to a bare `"a"` so
624
+ * DEV-19583: the group's own page. Set, the label becomes a link to it
625
+ * (through `linkComponent`), so a click or Enter navigates while hover
626
+ * still opens the panel; a separate chevron button beside it is the
627
+ * disclosure (`aria-expanded`, Enter/Space/click toggle the panel, Esc
628
+ * closes it and returns focus to the chevron). Omitted, the row is the
629
+ * single disclosure button it always was, markup unchanged.
630
+ *
631
+ * On the `collapsed` rail there is no room for two controls, so the row
632
+ * stays the single icon button and the panel opens with a first row
633
+ * linking to `href`, named by `label`.
634
+ */
635
+ href?: string;
636
+ /** DEV-19583: the current page is `href` itself (not a child), so its link carries `aria-current="page"`. */
637
+ hrefActive?: boolean;
638
+ /**
639
+ * Link renderer for the panel's child rows (and the `href` label). Defaults to a bare `"a"` so
602
640
  * the package stays framework-agnostic; consumers pass their router's
603
641
  * link (e.g. `next/link`) for client-side navigation. Flyout is
604
642
  * independently exported (see src/index.ts), so it carries its own copy
@@ -672,7 +710,7 @@ interface FlyoutProps {
672
710
  * than working around it. jsdom never computes real scrollable-overflow
673
711
  * geometry, so no unit test caught this — only an actual browser render did.
674
712
  */
675
- declare function Flyout({ label, icon, active, children, linkComponent, collapsed, onOpenChange, forceClosed, hoverOpenDelayMs, className, }: FlyoutProps): react.JSX.Element;
713
+ declare function Flyout({ label, icon, active, children, href, hrefActive, linkComponent, collapsed, onOpenChange, forceClosed, hoverOpenDelayMs, className, }: FlyoutProps): react.JSX.Element;
676
714
 
677
715
  /**
678
716
  * ContextSwitcher (DEV-4408) — promoted out of reeve-frontend's
package/dist/index.d.ts CHANGED
@@ -212,17 +212,19 @@ declare function useResponsivePlaceholder(desktop: string, mobile?: string): str
212
212
  * looping seconds of the other app's screen, shown where a step sends someone
213
213
  * there. Generalised from the Docs share strip's ShareClip (DEV-18388).
214
214
  *
215
- * Muted and looping; reduced motion never starts it (and turning it on
216
- * mid-loop pauses it), so the poster and the native controls carry it
217
- * instead. A browser that refuses autoplay (iOS Low Power Mode) gets the
218
- * controls too, until a later play() succeeds. A browser whose play() returns
219
- * no promise (or has no play()) is judged by whether the clip actually left
220
- * the paused state.
215
+ * Muted and looping. A corner toggle pauses and resumes it (DEV-19403, WCAG
216
+ * 2.2.2). Reduced motion never starts it (and turning it on mid-loop pauses
217
+ * it): the poster shows and the toggle offers Play, so it plays only when the
218
+ * viewer asks (DEV-19583). A browser that refuses autoplay (iOS Low Power
219
+ * Mode) gets the native controls instead of the toggle, until a later play()
220
+ * succeeds, so there is never a second set. A browser whose play() returns no
221
+ * promise (or has no play()) is judged by whether the clip actually left the
222
+ * paused state. A pause made with the toggle outlasts a reduced-motion change
223
+ * and a scroll away, but not a new clip.
221
224
  *
222
- * While it autoplays, a corner toggle pauses and resumes it (DEV-19403, WCAG
223
- * 2.2.2). The toggle shows only while the native controls are off, so there is
224
- * never a second set; a pause made with the toggle outlasts a reduced-motion
225
- * change but not a new clip.
225
+ * Card mode (DEV-19583): `fit`, `overlay`, `playWhenVisible` (no download and
226
+ * no playback until the clip is on screen) and `posterOnly` (the poster image,
227
+ * no video at all).
226
228
  */
227
229
  interface HowToClipProps {
228
230
  /** File stem: `${clipBaseUrl}/${slug}.webm|.mp4` and `${clipBaseUrl}/${slug}-poster.jpg`. Must match /^[a-z0-9-]{1,64}$/ or nothing renders. */
@@ -231,9 +233,21 @@ interface HowToClipProps {
231
233
  label: string;
232
234
  /** Where the clip files are served from, e.g. "/how-to" or "https://cdn.example/how-to" (no query or hash). Omitted or blank → renders null. A trailing slash is dropped. */
233
235
  clipBaseUrl?: string;
236
+ /** How the frame fills the 16:9 box: `"contain"` (default) letterboxes, `"cover"` crops to fill, for cards. */
237
+ fit?: "contain" | "cover";
238
+ /**
239
+ * Attach the sources only once a quarter of the clip is first on screen
240
+ * (an off-screen clip downloads nothing but its poster), then play only
241
+ * while it stays that visible and pause when it leaves.
242
+ */
243
+ playWhenVisible?: boolean;
244
+ /** Painted over the frame, inside its rounded box (e.g. a title on a dark fade). Clicks pass through it. */
245
+ overlay?: ReactNode;
246
+ /** Only the poster, as an image named by `label`: no video, no sources, no toggle. */
247
+ posterOnly?: boolean;
234
248
  className?: string;
235
249
  }
236
- declare function HowToClip({ slug, label, clipBaseUrl, className }: HowToClipProps): react.JSX.Element | null;
250
+ declare function HowToClip({ slug, label, clipBaseUrl, fit, playWhenVisible, overlay, posterOnly, className, }: HowToClipProps): react.JSX.Element | null;
237
251
 
238
252
  interface SiteFooterLink {
239
253
  href: string;
@@ -328,6 +342,11 @@ interface GroupRungItem {
328
342
  icon: string;
329
343
  /** moduleIds folded into this group. Non-empty (zod-enforced). */
330
344
  children: string[];
345
+ /** DEV-19583: the group's own page — an app path ("/explore"), never another
346
+ * origin: zod rejects anything not starting with one "/", and any
347
+ * backslash, whitespace or control character (browsers fold those into "//").
348
+ * Set, the group's label links there and the row is active on it too. */
349
+ href?: string;
331
350
  }
332
351
  type RungItem = AppRungItem | GroupRungItem;
333
352
  interface SidebarRung {
@@ -367,6 +386,7 @@ declare const zSidebarLadder: z.ZodObject<{
367
386
  label: z.ZodString;
368
387
  icon: z.ZodString;
369
388
  children: z.ZodArray<z.ZodString>;
389
+ href: z.ZodOptional<z.ZodString>;
370
390
  }, z.core.$strip>], "type">>;
371
391
  }, z.core.$strip>>;
372
392
  }, z.core.$strip>;
@@ -433,6 +453,9 @@ interface AppSidebarRecent {
433
453
  onSelect: (id: string) => void;
434
454
  /** Section heading. Default `"Recent"`. */
435
455
  label?: string;
456
+ /** DEV-19583: where the heading goes (e.g. the full chats page). Set, the
457
+ * heading renders as a link through `linkComponent`, same text and id. */
458
+ href?: string;
436
459
  /** Rows shown before "More". Default 6; floored to a whole number >= 1, and a non-finite value uses the default. */
437
460
  limit?: number;
438
461
  /** Where "More" goes (rendered through `linkComponent`). No href, no More. */
@@ -598,7 +621,22 @@ interface FlyoutProps {
598
621
  active: boolean;
599
622
  children: FlyoutChild[];
600
623
  /**
601
- * Link renderer for the panel's child rows. Defaults to a bare `"a"` so
624
+ * DEV-19583: the group's own page. Set, the label becomes a link to it
625
+ * (through `linkComponent`), so a click or Enter navigates while hover
626
+ * still opens the panel; a separate chevron button beside it is the
627
+ * disclosure (`aria-expanded`, Enter/Space/click toggle the panel, Esc
628
+ * closes it and returns focus to the chevron). Omitted, the row is the
629
+ * single disclosure button it always was, markup unchanged.
630
+ *
631
+ * On the `collapsed` rail there is no room for two controls, so the row
632
+ * stays the single icon button and the panel opens with a first row
633
+ * linking to `href`, named by `label`.
634
+ */
635
+ href?: string;
636
+ /** DEV-19583: the current page is `href` itself (not a child), so its link carries `aria-current="page"`. */
637
+ hrefActive?: boolean;
638
+ /**
639
+ * Link renderer for the panel's child rows (and the `href` label). Defaults to a bare `"a"` so
602
640
  * the package stays framework-agnostic; consumers pass their router's
603
641
  * link (e.g. `next/link`) for client-side navigation. Flyout is
604
642
  * independently exported (see src/index.ts), so it carries its own copy
@@ -672,7 +710,7 @@ interface FlyoutProps {
672
710
  * than working around it. jsdom never computes real scrollable-overflow
673
711
  * geometry, so no unit test caught this — only an actual browser render did.
674
712
  */
675
- declare function Flyout({ label, icon, active, children, linkComponent, collapsed, onOpenChange, forceClosed, hoverOpenDelayMs, className, }: FlyoutProps): react.JSX.Element;
713
+ declare function Flyout({ label, icon, active, children, href, hrefActive, linkComponent, collapsed, onOpenChange, forceClosed, hoverOpenDelayMs, className, }: FlyoutProps): react.JSX.Element;
676
714
 
677
715
  /**
678
716
  * ContextSwitcher (DEV-4408) — promoted out of reeve-frontend's