@bridge-ds/toolbar 0.2.0 → 0.3.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
@@ -6,8 +6,13 @@ The Bridge toolbar for a product built with the Bridge design system. Bridge Stu
6
6
 
7
7
  - **Code changes** (an exploration in the product's repository, a feature branch): Before is the product in
8
8
  production, After is the branch's preview. Flipping keeps the screen and the scroll position.
9
- - **Token changes** of the design system: the live tokens swap in without a reload, and Show what changed outlines
10
- every surface that differs.
9
+ - **Token changes** of the design system: the live tokens swap in without a reload. As soon as the toolbar is open,
10
+ every surface that differs is outlined and counted in the bar ("13 changed", then "2 / 13 changed"). Previous and Next scroll to each one
11
+ in reading order and outline it stronger than the others; Isolate dims the rest of the page (Esc turns it off). The
12
+ outlines, the position and Isolate hold when you flip to Live product, since both sides are the same page.
13
+
14
+ Keyboard: **B** flips Live product and This change on the same screen and scroll position, **C** turns the outlines
15
+ off and on, **Esc** ends Isolate. None of them fires while you type in a field.
11
16
 
12
17
  Without `?bridge=` (or the session that remembers it) it renders nothing and loads nothing: the toolbar and its styles
13
18
  are one lazy chunk.
@@ -0,0 +1,18 @@
1
+ export interface ChangeNavProps {
2
+ /** "Show what changed", "13 changed", "2 / 13 changed", "Nothing changed here". */
3
+ countText: string;
4
+ /** The count's tooltip: what changed and the C shortcut. */
5
+ tip: string;
6
+ outlinesOn: boolean;
7
+ /** The change shows nothing in this theme or brand: the count is muted. */
8
+ disabled: boolean;
9
+ /** Changes to step through, null while outlines are off or measuring. */
10
+ total: number | null;
11
+ isolate: boolean;
12
+ /** Said to screen readers on each step: "Changed element 2 of 13: Save bar". */
13
+ announce: string;
14
+ onToggle: () => void;
15
+ onStep: (delta: 1 | -1) => void;
16
+ onIsolate: (on: boolean) => void;
17
+ }
18
+ export declare function ChangeNav({ countText, tip, outlinesOn, disabled, total, isolate, announce, onToggle, onStep, onIsolate }: ChangeNavProps): import("react/jsx-runtime").JSX.Element;
@@ -2,19 +2,24 @@ import { type ReactNode } from 'react';
2
2
  import type { Theme } from '@bridge-ds/react';
3
3
  import { type ChangedElement } from './outline';
4
4
  import type { Rect } from './session';
5
+ import { type Box as TipBox } from './navigate';
5
6
  export interface Shown {
6
7
  /** Visible surfaces, in order. */
7
8
  count: number;
8
9
  /** Boxes of the visible surfaces that are not page-sized: the toolbar keeps clear of them. */
9
10
  obstacles: Rect[];
10
11
  }
11
- export declare function ChangeOutlines({ surfaces, theme, tip, onShown, emphasis, flash, }: {
12
+ export declare function ChangeOutlines({ surfaces, theme, tip, onShown, emphasis, flash, isolate, bar, }: {
12
13
  surfaces: ChangedElement[];
13
14
  theme: Theme;
14
15
  /** The surface whose list row is hovered, focused or activated: chip and stronger outline. */
15
16
  emphasis: number | null;
16
17
  /** Show every chip (the moment outlines turn on). */
17
18
  flash: boolean;
19
+ /** Dim everything but the changed surfaces. */
20
+ isolate?: boolean;
21
+ /** Where the toolbar is: the before and after tooltip never covers it. */
22
+ bar?: () => TipBox | null;
18
23
  /** Tooltip content for a surface: its role, token and before and after. */
19
24
  tip: (s: ChangedElement) => ReactNode;
20
25
  onShown: (shown: Shown) => void;