@meetreeve/ui 0.25.0 → 0.30.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 +118 -6
- package/dist/button/index.d.mts +19 -0
- package/dist/button/index.d.ts +19 -0
- package/dist/button/index.js +3436 -0
- package/dist/button/index.mjs +3400 -0
- package/dist/button-client/index.d.mts +23 -0
- package/dist/button-client/index.d.ts +23 -0
- package/dist/button-client/index.js +59 -0
- package/dist/button-client/index.mjs +25 -0
- package/dist/charts/index.d.mts +14 -4
- package/dist/charts/index.d.ts +14 -4
- package/dist/charts/index.js +102 -9
- package/dist/charts/index.mjs +117 -10
- package/dist/index.d.mts +207 -6
- package/dist/index.d.ts +207 -6
- package/dist/index.js +4267 -414
- package/dist/index.mjs +4201 -364
- package/dist/use-prefers-reduced-motion-CRlBJxhu.d.mts +8 -0
- package/dist/use-prefers-reduced-motion-CRlBJxhu.d.ts +8 -0
- package/package.json +14 -2
package/README.md
CHANGED
|
@@ -255,6 +255,46 @@ the host must define `--color-popover`, `--color-popover-foreground`,
|
|
|
255
255
|
`--color-border` and `--color-ring`, and Tailwind consumers must include this
|
|
256
256
|
package's `dist` as a `@source` (see ResponsiveHeader above).
|
|
257
257
|
|
|
258
|
+
## HowToClip (DEV-19372)
|
|
259
|
+
|
|
260
|
+
The one player for every how-to clip: a few silent, looping seconds of another
|
|
261
|
+
app's screen, shown where a step sends someone there.
|
|
262
|
+
|
|
263
|
+
```tsx
|
|
264
|
+
import { HowToClip } from "@meetreeve/ui";
|
|
265
|
+
|
|
266
|
+
<HowToClip
|
|
267
|
+
slug="share-google-doc"
|
|
268
|
+
label="Sharing a Google Doc with reeve@meetreeve.com as Editor, in Google Docs"
|
|
269
|
+
clipBaseUrl="/how-to"
|
|
270
|
+
/>;
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
It plays `${clipBaseUrl}/${slug}.webm`, falling back to `.mp4`, with
|
|
274
|
+
`${clipBaseUrl}/${slug}-poster.jpg` as the poster. A trailing slash on
|
|
275
|
+
`clipBaseUrl` is dropped. It renders **nothing** without `clipBaseUrl`, or when
|
|
276
|
+
`slug` doesn't match `/^[a-z0-9-]{1,64}$/`, so a host that doesn't serve the
|
|
277
|
+
clips gets no clip and no 404.
|
|
278
|
+
|
|
279
|
+
- Muted, looping, inline, `preload="metadata"`, in a 16:9 box
|
|
280
|
+
(`aspect-video`) with `object-contain`, so a clip of another shape
|
|
281
|
+
letterboxes instead of cropping. Border and background are the paired
|
|
282
|
+
`border-border bg-muted` tokens.
|
|
283
|
+
- `prefers-reduced-motion` never starts playback, including on the first
|
|
284
|
+
client render after SSR, and turning it on mid-loop pauses the clip. The
|
|
285
|
+
poster and native controls carry it instead.
|
|
286
|
+
- If the browser refuses autoplay (iOS Low Power Mode), native controls
|
|
287
|
+
appear until a later `play()` succeeds.
|
|
288
|
+
|
|
289
|
+
`usePrefersReducedMotion()` is the live OS setting it reads. It is exported
|
|
290
|
+
from the package root and, as before, from `@meetreeve/ui/charts`.
|
|
291
|
+
|
|
292
|
+
### Setup-guide step clips
|
|
293
|
+
|
|
294
|
+
A `ConnectorGuideStep` can name a clip (`clip: "slack-invite"`). Pass
|
|
295
|
+
`clipBaseUrl` to `ConnectorPicker` and the setup guide shows that clip under
|
|
296
|
+
the step. Without `clipBaseUrl` the guide renders exactly as before.
|
|
297
|
+
|
|
258
298
|
## ChatCanvasShell (DEV-19008)
|
|
259
299
|
|
|
260
300
|
A nav rail, then a chat pane and a canvas pane, in three layouts: **Chat**
|
|
@@ -282,13 +322,17 @@ import { ChatCanvasShell, CanvasLayoutSwitch, useCanvasLayout } from "@meetreeve
|
|
|
282
322
|
in Chat enters Split; Split and Dashboard are kept. Navigating to
|
|
283
323
|
`homePath` returns to Chat.
|
|
284
324
|
- **Divider:** a 9px hit area (1px of layout) that turns `bg-brand-accent` on
|
|
285
|
-
hover, focus or drag.
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
325
|
+
hover, focus or drag. Split opens at 2/3 canvas, 1/3 chat (67% canvas).
|
|
326
|
+
Free drag between 30% and 75% canvas width; a release within 4 points of
|
|
327
|
+
the default (63–71%) snaps to it, past 85% snaps to Dashboard, below 15%
|
|
328
|
+
snaps to Chat. The last Split width is kept in localStorage
|
|
329
|
+
(`<storageKey>:split-pct:v2`; widths under the older `:split-pct` key are
|
|
330
|
+
not read) and reused. Arrow keys step 5 points, Enter or a double-click
|
|
331
|
+
resets to 67. Snaps animate over 300ms
|
|
290
332
|
`cubic-bezier(.16,1,.3,1)`, and not at all under `prefers-reduced-motion`.
|
|
291
|
-
- **Chat width:** at least 480px in Split
|
|
333
|
+
- **Chat width:** at least 480px in Split, so the chat gets exactly 1/3 only
|
|
334
|
+
when the panes are at least 1440px wide; narrower, it stays at 480px and the
|
|
335
|
+
canvas takes the rest. When the panes are narrower than
|
|
292
336
|
960px (480px chat plus a usable canvas), Split isn't offered and a Split
|
|
293
337
|
request renders as Chat until there is room again, so the chat is never
|
|
294
338
|
hidden by default; the switch offers Chat and Dashboard.
|
|
@@ -432,6 +476,70 @@ import { PageSurface } from "@meetreeve/ui";
|
|
|
432
476
|
- **`as`** picks the element. From a Server Component pass a tag name
|
|
433
477
|
(`"main"`); a component value cannot cross into this client component.
|
|
434
478
|
|
|
479
|
+
## Controls: Button, PageActions, Toolbar, RowActions, ConfirmDialog (DEV-19236)
|
|
480
|
+
|
|
481
|
+
The control grammar (DEV-19235): a page has one primary action and a ⋯ More
|
|
482
|
+
menu, a list sits under one toolbar row, each row ends in a ⋯ menu, and
|
|
483
|
+
destructive actions confirm.
|
|
484
|
+
|
|
485
|
+
```tsx
|
|
486
|
+
import { Button, buttonVariants } from "@meetreeve/ui/button";
|
|
487
|
+
import { PageActions, Toolbar, RowActions, type Action } from "@meetreeve/ui";
|
|
488
|
+
|
|
489
|
+
const more: Action[] = [
|
|
490
|
+
{ id: "import", label: "Import", onSelect: openImport },
|
|
491
|
+
{ id: "delete", label: "Delete list", destructive: true, onSelect: deleteList },
|
|
492
|
+
];
|
|
493
|
+
|
|
494
|
+
<PageActions
|
|
495
|
+
primary={{ id: "new", label: "New campaign", options: [
|
|
496
|
+
{ id: "blank", label: "Blank", onSelect: newBlank },
|
|
497
|
+
{ id: "ai", label: "Draft with AI", onSelect: draftWithAi },
|
|
498
|
+
] }}
|
|
499
|
+
more={more}
|
|
500
|
+
/>
|
|
501
|
+
<Toolbar search={<SearchInput />} filters={<FilterBar />} end={<ViewToggle />} />
|
|
502
|
+
<RowActions items={[{ id: "archive", label: "Archive", destructive: true, onSelect: () => archive(row.id) }]} />
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
- **`Action`** is `{ id, label, icon?, disabled?, destructive?, confirm?: {
|
|
506
|
+
title, body?, confirmLabel? } }` plus either `onSelect` (may return a
|
|
507
|
+
promise) or `options` (a menu of actions: a split-button primary, or a
|
|
508
|
+
submenu inside a menu). A destructive action renders last, after a
|
|
509
|
+
separator, and always confirms, with `"<label>?"` when it has no `confirm`.
|
|
510
|
+
Options inherit their parent's `destructive` and `confirm`. An unconfirmed
|
|
511
|
+
action whose `onSelect` returns a promise is not re-run while it is
|
|
512
|
+
pending; its errors are its own to show (a toast).
|
|
513
|
+
- **PageActions** renders at most one `action` button and one ⋯ menu; with
|
|
514
|
+
neither it renders nothing. Putting it in the canvas header is the host's
|
|
515
|
+
job.
|
|
516
|
+
- **Toolbar** is one 32px row with no card chrome. It wraps when it runs out
|
|
517
|
+
of width, and its gaps open up on touch screens. The slots take any node.
|
|
518
|
+
- **RowActions** stops click, keydown and keyup propagation, including from its
|
|
519
|
+
portaled menu and dialog, so it never opens the row it sits in. Pointer
|
|
520
|
+
down/up are not stopped (Radix's outside-dismiss listens for them), so a
|
|
521
|
+
row that drags or selects on pointerdown should attach that to a handle.
|
|
522
|
+
- **ConfirmDialog** (`open`, `onOpenChange`, `title`, `body?`,
|
|
523
|
+
`confirmLabel?`, `cancelLabel?`, `destructive?`, `onConfirm`,
|
|
524
|
+
`returnFocusRef?`) is `role="alertdialog"` with Cancel first. A promise from
|
|
525
|
+
`onConfirm` keeps it open and busy (Escape and Cancel do nothing, confirm is
|
|
526
|
+
disabled); a rejection shows its message and lets the user retry.
|
|
527
|
+
- **Button** is reeve-frontend's shadcn Button on the server-safe
|
|
528
|
+
`@meetreeve/ui/button` subpath. Sizes: `sm` 32px (the default), `default`
|
|
529
|
+
36px (forms), `icon` 32px, `icon-sm` 28px; `xs`, `lg`, `icon-xs` and
|
|
530
|
+
`icon-lg` are deprecated aliases. The visual size and the tap target are
|
|
531
|
+
separate: a centred `::after` keeps every size's hit area at least
|
|
532
|
+
`MIN_SIZES.touchTarget` (44px) on both axes (`link` opts out). The console
|
|
533
|
+
Button on `@meetreeve/ui/console` is a different, Base UI button.
|
|
534
|
+
- **Theme tokens:** like the console primitives, these read the host's shadcn
|
|
535
|
+
theme. Besides the usual (`primary`, `accent`, `popover`, `destructive`,
|
|
536
|
+
`destructive-subtle`, `card`, `border`, `ring`), the `action` variant needs
|
|
537
|
+
`--color-action` / `--color-action-foreground` and `link` needs
|
|
538
|
+
`--color-link`; reeve-frontend defines them in `globals.css`.
|
|
539
|
+
- **DropdownMenu** (`Trigger`, `Content`, `Item` with `variant="destructive"`,
|
|
540
|
+
`Label`, `Group`, `Separator`, `Sub`, `SubTrigger`, `SubContent`) is the
|
|
541
|
+
Radix wrapper these use, exported for custom menus.
|
|
542
|
+
|
|
435
543
|
## StageRail (DEV-13855)
|
|
436
544
|
|
|
437
545
|
Domain-free "flow of cards": cards joined by connectors, left to right.
|
|
@@ -549,6 +657,10 @@ chart in a tenant's brand colours, set those variables. Hosts that don't import
|
|
|
549
657
|
(`BAR_CATEGORY_GAP = "8.33%"` per side), no y-axis, the value above each bar.
|
|
550
658
|
An all-negative series tops out at 0 (DEV-16977). Hand-rolled Recharts bar
|
|
551
659
|
charts spread `BAR_STANDARD` and render `<LabelList content={barValueLabel(fmt)} />`.
|
|
660
|
+
- **Funnels:** `<BarChart funnel />` adds a faint silhouette behind the bars
|
|
661
|
+
that slopes from each bar's top to the next (DEV-19691). Single series
|
|
662
|
+
only (ignored otherwise); no tooltip or legend entry. Use it only when the
|
|
663
|
+
steps are a real funnel, each a subset of the one before.
|
|
552
664
|
- **Reduced motion:** entry animations are off under `prefers-reduced-motion`.
|
|
553
665
|
- **`KpiCard`:** `delta` is a fraction (0.12 = +12%). `polarity` decides
|
|
554
666
|
whether a rise is green or red. `state="empty" | "setup"` replaces raw errors;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
declare const buttonVariants: (props?: ({
|
|
6
|
+
variant?: "default" | "action" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
7
|
+
size?: "default" | "xs" | "lg" | "icon-sm" | "icon-xs" | "icon-lg" | "sm" | "icon" | null | undefined;
|
|
8
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
|
+
type ButtonProps = react.ComponentPropsWithoutRef<"button"> & VariantProps<typeof buttonVariants> & {
|
|
10
|
+
asChild?: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare const Button: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
|
|
13
|
+
variant?: "default" | "action" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
14
|
+
size?: "default" | "xs" | "lg" | "icon-sm" | "icon-xs" | "icon-lg" | "sm" | "icon" | null | undefined;
|
|
15
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string> & {
|
|
16
|
+
asChild?: boolean;
|
|
17
|
+
} & react.RefAttributes<HTMLButtonElement>>;
|
|
18
|
+
|
|
19
|
+
export { Button, type ButtonProps, buttonVariants };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
declare const buttonVariants: (props?: ({
|
|
6
|
+
variant?: "default" | "action" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
7
|
+
size?: "default" | "xs" | "lg" | "icon-sm" | "icon-xs" | "icon-lg" | "sm" | "icon" | null | undefined;
|
|
8
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
|
+
type ButtonProps = react.ComponentPropsWithoutRef<"button"> & VariantProps<typeof buttonVariants> & {
|
|
10
|
+
asChild?: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare const Button: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
|
|
13
|
+
variant?: "default" | "action" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
14
|
+
size?: "default" | "xs" | "lg" | "icon-sm" | "icon-xs" | "icon-lg" | "sm" | "icon" | null | undefined;
|
|
15
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string> & {
|
|
16
|
+
asChild?: boolean;
|
|
17
|
+
} & react.RefAttributes<HTMLButtonElement>>;
|
|
18
|
+
|
|
19
|
+
export { Button, type ButtonProps, buttonVariants };
|