@bridge-ds/toolbar 0.2.0 → 0.4.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 +18 -4
- package/dist/ChangeNav.d.ts +18 -0
- package/dist/ChangeOutlines.d.ts +6 -1
- package/dist/{Toolbar-CzR1TM9x.js → Toolbar-ByLHemKF.js} +444 -192
- package/dist/Toolbar-ByLHemKF.js.map +1 -0
- package/dist/{index-3f0I3tAL.js → index-cRndUN9A.js} +3 -3
- package/dist/{index-3f0I3tAL.js.map → index-cRndUN9A.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/markers.d.ts +25 -0
- package/dist/navigate.d.ts +59 -0
- package/dist/outline.d.ts +4 -0
- package/dist/{session-CzlIsFDY.js → session-Dvma9jtT.js} +9 -5
- package/dist/session-Dvma9jtT.js.map +1 -0
- package/dist/session.d.ts +3 -0
- package/dist/together.js +1 -1
- package/dist/useMarkedChanges.d.ts +2 -0
- package/package.json +2 -2
- package/dist/Toolbar-CzR1TM9x.js.map +0 -1
- package/dist/session-CzlIsFDY.js.map +0 -1
package/README.md
CHANGED
|
@@ -2,12 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
The Bridge toolbar for a product built with the Bridge design system. Bridge Studio opens the product with
|
|
4
4
|
`?bridge=<change>` ("Try it in the product"); the toolbar then lets anyone browse the real product and flip between
|
|
5
|
-
**Live product** (before) and **This change** (after), with **Show what changed
|
|
5
|
+
**Live product** (before) and **This change** (after), with **Show what changed**.
|
|
6
6
|
|
|
7
7
|
- **Code changes** (an exploration in the product's repository, a feature branch): Before is the product in
|
|
8
|
-
production, After is the branch's preview. Flipping keeps the screen and the scroll position.
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
production, After is the branch's preview. Flipping keeps the screen and the scroll position. Production is another
|
|
9
|
+
origin, so the toolbar cannot measure the difference: the change marks each new or changed area of the UI with
|
|
10
|
+
`data-bridge-change="<short plain label>"` on its outermost element (Bridge tells Claude to, in every exploration).
|
|
11
|
+
On This change those areas are outlined, counted ("1 changed", "1 / 3 changed") and stepped through like token
|
|
12
|
+
changes, with Isolate, and the Changes list names them. On Live product the bar says how many wait on This change
|
|
13
|
+
("1 changed on This change"). A change that marks nothing says so.
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
<div role="status" data-bridge-change="Orders waiting to ship alert">30 orders are waiting to ship</div>
|
|
17
|
+
```
|
|
18
|
+
- **Token changes** of the design system: the live tokens swap in without a reload. As soon as the toolbar is open,
|
|
19
|
+
every surface that differs is outlined and counted in the bar ("13 changed", then "2 / 13 changed"). Previous and Next scroll to each one
|
|
20
|
+
in reading order and outline it stronger than the others; Isolate dims the rest of the page (Esc turns it off). The
|
|
21
|
+
outlines, the position and Isolate hold when you flip to Live product, since both sides are the same page.
|
|
22
|
+
|
|
23
|
+
Keyboard: **B** flips Live product and This change on the same screen and scroll position, **C** turns the outlines
|
|
24
|
+
off and on, **Esc** ends Isolate. None of them fires while you type in a field.
|
|
11
25
|
|
|
12
26
|
Without `?bridge=` (or the session that remembers it) it renders nothing and loads nothing: the toolbar and its styles
|
|
13
27
|
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;
|
package/dist/ChangeOutlines.d.ts
CHANGED
|
@@ -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;
|