@ponchia/ui 0.4.1 → 0.5.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/CHANGELOG.md +230 -8
- package/MIGRATIONS.json +92 -0
- package/README.md +9 -6
- package/annotations/index.d.ts +280 -0
- package/annotations/index.js +522 -0
- package/behaviors/carousel.js +197 -0
- package/behaviors/combobox.js +195 -0
- package/behaviors/command.js +187 -0
- package/behaviors/connectors.js +96 -0
- package/behaviors/crosshair.js +58 -0
- package/behaviors/dialog.js +73 -0
- package/behaviors/disclosure.js +25 -0
- package/behaviors/dismissible.js +24 -0
- package/behaviors/forms.js +158 -0
- package/behaviors/glyph.js +109 -0
- package/behaviors/index.d.ts +79 -0
- package/behaviors/index.js +18 -1409
- package/behaviors/internal.js +50 -0
- package/behaviors/legend.js +46 -0
- package/behaviors/menu.js +46 -0
- package/behaviors/popover.js +108 -0
- package/behaviors/spotlight.js +53 -0
- package/behaviors/table.js +109 -0
- package/behaviors/tabs.js +103 -0
- package/behaviors/theme.js +82 -0
- package/behaviors/toast.js +152 -0
- package/classes/index.d.ts +280 -2
- package/classes/index.js +313 -2
- package/connectors/index.d.ts +71 -0
- package/connectors/index.js +179 -0
- package/css/analytical.css +21 -0
- package/css/annotations.css +292 -0
- package/css/command.css +97 -0
- package/css/connectors.css +93 -0
- package/css/crosshair.css +100 -0
- package/css/feedback.css +51 -0
- package/css/fonts.css +11 -7
- package/css/generated.css +117 -0
- package/css/legend.css +268 -0
- package/css/marks.css +144 -0
- package/css/primitives.css +18 -0
- package/css/report.css +12 -31
- package/css/selection.css +46 -0
- package/css/sources.css +179 -0
- package/css/spotlight.css +104 -0
- package/css/state.css +121 -0
- package/css/tokens.css +25 -37
- package/css/workbench.css +83 -0
- package/dist/bronto.css +1 -1
- package/dist/css/analytical.css +1 -0
- package/dist/css/annotations.css +1 -0
- package/dist/css/command.css +1 -0
- package/dist/css/connectors.css +1 -0
- package/dist/css/crosshair.css +1 -0
- package/dist/css/feedback.css +1 -1
- package/dist/css/fonts.css +1 -1
- package/dist/css/generated.css +1 -0
- package/dist/css/legend.css +1 -0
- package/dist/css/marks.css +1 -0
- package/dist/css/primitives.css +1 -1
- package/dist/css/report.css +1 -1
- package/dist/css/selection.css +1 -0
- package/dist/css/sources.css +1 -0
- package/dist/css/spotlight.css +1 -0
- package/dist/css/state.css +1 -0
- package/dist/css/workbench.css +1 -0
- package/docs/adr/0003-theme-model.md +7 -4
- package/docs/annotations.md +345 -0
- package/docs/architecture.md +202 -0
- package/docs/command.md +95 -0
- package/docs/connectors.md +91 -0
- package/docs/crosshair.md +63 -0
- package/docs/generated.md +91 -0
- package/docs/legends.md +168 -0
- package/docs/marks.md +86 -0
- package/docs/reference.md +309 -3
- package/docs/reporting.md +49 -14
- package/docs/selection.md +40 -0
- package/docs/sources.md +110 -0
- package/docs/spotlight.md +78 -0
- package/docs/stability.md +16 -1
- package/docs/state.md +85 -0
- package/docs/usage.md +22 -0
- package/docs/workbench.md +72 -0
- package/fonts/doto-400.woff2 +0 -0
- package/fonts/doto-500.woff2 +0 -0
- package/fonts/doto-600.woff2 +0 -0
- package/fonts/doto-700.woff2 +0 -0
- package/fonts/doto-800.woff2 +0 -0
- package/fonts/doto-900.woff2 +0 -0
- package/llms.txt +229 -6
- package/package.json +69 -4
- package/qwik/index.d.ts +5 -0
- package/qwik/index.js +20 -0
- package/react/index.d.ts +5 -0
- package/react/index.js +10 -0
- package/solid/index.d.ts +5 -0
- package/solid/index.js +10 -0
- package/tokens/index.js +9 -5
- package/fonts/doto-400.ttf +0 -0
- package/fonts/doto-500.ttf +0 -0
- package/fonts/doto-600.ttf +0 -0
- package/fonts/doto-700.ttf +0 -0
- package/fonts/doto-800.ttf +0 -0
- package/fonts/doto-900.ttf +0 -0
package/docs/sources.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Sources, citations & provenance
|
|
2
|
+
|
|
3
|
+
`@ponchia/ui/css/sources.css` is an opt-in **trust layer** for generated
|
|
4
|
+
reports, AI output, audits, and docs — the grammar that answers _"where did
|
|
5
|
+
this come from?"_. Generic UI kits have tags and footnotes; this is a small,
|
|
6
|
+
explicit vocabulary for sources and their trust state.
|
|
7
|
+
|
|
8
|
+
```css
|
|
9
|
+
@import '@ponchia/ui';
|
|
10
|
+
@import '@ponchia/ui/css/sources.css';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Bronto owns the visual grammar and the trust **states**. The host owns fetching,
|
|
14
|
+
citation numbering, permission checks, and whether a source is actually
|
|
15
|
+
trustworthy. The state is carried by a rationed tone **and** an author-written
|
|
16
|
+
label, so it never relies on colour alone (WCAG 1.4.1). Not in the core bundle.
|
|
17
|
+
|
|
18
|
+
## Trust states
|
|
19
|
+
|
|
20
|
+
A cross-cutting trust-state class — `ui-src--verified`, `ui-src--stale`, and the
|
|
21
|
+
rest in the table below — sets the tone on a citation chip, source card, or
|
|
22
|
+
provenance item. Always pair it with a word: the colour is a second channel, not
|
|
23
|
+
the only one.
|
|
24
|
+
|
|
25
|
+
| State | Class | Tone |
|
|
26
|
+
| --- | --- | --- |
|
|
27
|
+
| Verified | `ui-src--verified` | success |
|
|
28
|
+
| Reviewed (by a human) | `ui-src--reviewed` | accent |
|
|
29
|
+
| Generated | `ui-src--generated` | info |
|
|
30
|
+
| Unverified | `ui-src--unverified` | muted |
|
|
31
|
+
| Stale | `ui-src--stale` | warning |
|
|
32
|
+
| Conflict | `ui-src--conflict` | danger |
|
|
33
|
+
|
|
34
|
+
## Inline citation — `.ui-citation`
|
|
35
|
+
|
|
36
|
+
A reference marker on a real `<a>` or `<button>` (the visual index is never the
|
|
37
|
+
only label — give it an accessible name).
|
|
38
|
+
|
|
39
|
+
```html
|
|
40
|
+
<p>
|
|
41
|
+
Latency fell 38%<a class="ui-citation" href="#s1" aria-label="Source 1">[1]</a>.
|
|
42
|
+
</p>
|
|
43
|
+
|
|
44
|
+
<!-- Named-source pill, with a leading trust dot: -->
|
|
45
|
+
<a class="ui-citation ui-citation--chip ui-src--verified" href="#s1">
|
|
46
|
+
Q3 incident review
|
|
47
|
+
</a>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Source card — `.ui-source-card`
|
|
51
|
+
|
|
52
|
+
A single source preview: title, origin, time, excerpt, actions. The
|
|
53
|
+
`border-inline-start` carries the trust tone.
|
|
54
|
+
|
|
55
|
+
```html
|
|
56
|
+
<article class="ui-source-card ui-src--generated">
|
|
57
|
+
<h3 class="ui-source-card__title">Model output — pricing summary</h3>
|
|
58
|
+
<p class="ui-source-card__origin">gpt-x · internal</p>
|
|
59
|
+
<p class="ui-source-card__time">2026-06-01 09:42</p>
|
|
60
|
+
<p class="ui-source-card__excerpt">The migration cut p95 latency by 38%…</p>
|
|
61
|
+
<div class="ui-source-card__actions">
|
|
62
|
+
<button class="ui-button ui-button--subtle ui-button--sm" type="button">Open</button>
|
|
63
|
+
</div>
|
|
64
|
+
</article>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Source list — `.ui-source-list`
|
|
68
|
+
|
|
69
|
+
A references section: a reset list of source cards (or rows).
|
|
70
|
+
|
|
71
|
+
```html
|
|
72
|
+
<ol class="ui-source-list">
|
|
73
|
+
<li class="ui-source-list__item"><article class="ui-source-card ui-src--verified">…</article></li>
|
|
74
|
+
<li class="ui-source-list__item"><article class="ui-source-card ui-src--stale">…</article></li>
|
|
75
|
+
</ol>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Provenance — `.ui-provenance`
|
|
79
|
+
|
|
80
|
+
A compact metadata row beside generated content — each `__item` carries a trust
|
|
81
|
+
dot and a label.
|
|
82
|
+
|
|
83
|
+
```html
|
|
84
|
+
<p class="ui-provenance">
|
|
85
|
+
<span class="ui-provenance__item ui-src--generated">Generated</span>
|
|
86
|
+
<span class="ui-provenance__item ui-src--verified">3 sources</span>
|
|
87
|
+
<span class="ui-provenance__item ui-src--reviewed">Human-reviewed</span>
|
|
88
|
+
</p>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Recipes
|
|
92
|
+
|
|
93
|
+
```js
|
|
94
|
+
import { ui } from '@ponchia/ui/classes';
|
|
95
|
+
|
|
96
|
+
ui.citation({ chip: true, state: 'verified' });
|
|
97
|
+
// "ui-citation ui-citation--chip ui-src--verified"
|
|
98
|
+
ui.source({ state: 'generated' }); // "ui-source-card ui-src--generated"
|
|
99
|
+
ui.provenance({ state: 'reviewed' }); // "ui-provenance ui-src--reviewed"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Accessibility & print
|
|
103
|
+
|
|
104
|
+
- A citation must be a real link or button with a stable accessible name; the
|
|
105
|
+
bracketed index alone is not enough.
|
|
106
|
+
- The trust state must be readable as text — the tone dot/border is decorative
|
|
107
|
+
reinforcement. Under `forced-colors`, dots and borders fall back to
|
|
108
|
+
`CanvasText`, so the label remains the channel.
|
|
109
|
+
- Tone dots and the card's tone border carry `print-color-adjust: exact`, so
|
|
110
|
+
they survive printing; expand citation URLs in print where it helps the reader.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Spotlight (guided focus)
|
|
2
|
+
|
|
3
|
+
`@ponchia/ui/css/spotlight.css` is an opt-in **guided-focus overlay** — a
|
|
4
|
+
dimming layer with a cutout over a target element, an optional ring, and a
|
|
5
|
+
callout note. It's the *visual language* of a product tour or onboarding step.
|
|
6
|
+
|
|
7
|
+
```css
|
|
8
|
+
@import '@ponchia/ui';
|
|
9
|
+
@import '@ponchia/ui/css/spotlight.css';
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
**Bronto is not a tour engine.** It owns the look and (via `initSpotlight`)
|
|
13
|
+
positions the cutout over a target. Step order, advancing, persistence, and
|
|
14
|
+
whether the overlay is shown are the host's job — Bronto deliberately stays out
|
|
15
|
+
of that state machine.
|
|
16
|
+
|
|
17
|
+
## Markup
|
|
18
|
+
|
|
19
|
+
```html
|
|
20
|
+
<div
|
|
21
|
+
class="ui-spotlight ui-spotlight--ring"
|
|
22
|
+
data-bronto-spotlight
|
|
23
|
+
data-target="save-button"
|
|
24
|
+
role="region"
|
|
25
|
+
aria-label="Tour"
|
|
26
|
+
>
|
|
27
|
+
<div class="ui-spotlight__hole"></div>
|
|
28
|
+
|
|
29
|
+
<div class="ui-tour-note" style="position: absolute; …place near the hole…">
|
|
30
|
+
<span class="ui-tour-note__step">Step 2 of 4</span>
|
|
31
|
+
<h2 class="ui-tour-note__title">Save your work</h2>
|
|
32
|
+
<p class="ui-tour-note__body">Changes autosave, but you can force a save here.</p>
|
|
33
|
+
<div class="ui-tour-note__actions">
|
|
34
|
+
<button class="ui-button ui-button--ghost" type="button">Skip</button>
|
|
35
|
+
<button class="ui-button" type="button">Next</button>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
```js
|
|
42
|
+
import { initSpotlight } from '@ponchia/ui/behaviors';
|
|
43
|
+
const stop = initSpotlight(); // positions the cutout; re-places on resize/scroll
|
|
44
|
+
// Advance the tour by pointing at the next target — the cutout follows:
|
|
45
|
+
document.querySelector('[data-bronto-spotlight]').dataset.target = 'next-thing';
|
|
46
|
+
// Hide it when the tour ends (host-owned):
|
|
47
|
+
document.querySelector('[data-bronto-spotlight]').hidden = true;
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Pieces
|
|
51
|
+
|
|
52
|
+
| Class | Role |
|
|
53
|
+
| --- | --- |
|
|
54
|
+
| `ui-spotlight` | The fixed overlay. Non-blocking (`pointer-events: none`) — a visual highlight, not a modal trap. |
|
|
55
|
+
| `ui-spotlight__hole` | The cutout. Dims the page via one box-shadow; positioned by `--spot-x/y/w/h`. |
|
|
56
|
+
| `ui-spotlight--ring` | Adds an accent ring around the cutout. |
|
|
57
|
+
| `ui-tour-note` | The callout card (re-enables pointer events for its controls). |
|
|
58
|
+
| `ui-tour-note__step` / `__title` / `__body` / `__actions` | Callout parts. |
|
|
59
|
+
|
|
60
|
+
`ui.spotlight({ ring })` builds the overlay class string.
|
|
61
|
+
|
|
62
|
+
## How positioning works
|
|
63
|
+
|
|
64
|
+
`initSpotlight` reads each `[data-bronto-spotlight]`'s `data-target` id, measures
|
|
65
|
+
that element with `getBoundingClientRect`, and sets `--spot-x/y/w/h` (viewport
|
|
66
|
+
coordinates) on the overlay. Because the overlay is `position: fixed`, those map
|
|
67
|
+
directly. It re-places on resize, scroll, and whenever `data-target` changes —
|
|
68
|
+
so stepping a tour is just updating `data-target`. `--spot-pad` insets the
|
|
69
|
+
cutout from the target; `--spot-radius` rounds it.
|
|
70
|
+
|
|
71
|
+
## Accessibility notes
|
|
72
|
+
|
|
73
|
+
- The overlay is **non-blocking by design** (the dim is a box-shadow, not an
|
|
74
|
+
interaction trap). If a step must block interaction, that's a host concern —
|
|
75
|
+
add your own inert/`aria-hidden` handling around it.
|
|
76
|
+
- Put the tour's real content in `.ui-tour-note` (a focusable region with a
|
|
77
|
+
heading), not in the visual dim, so screen-reader users get the same guidance.
|
|
78
|
+
- Keep the callout's label stable and move focus to it when a step opens (host).
|
package/docs/stability.md
CHANGED
|
@@ -11,6 +11,7 @@ patches are non-breaking. This matrix defines what counts as public API.
|
|
|
11
11
|
| Class recipes (`@ponchia/ui/classes`) | Stable | Exported `cls`, `ui`, `cx`, recipe names, and option unions are public. |
|
|
12
12
|
| Design tokens | Stable names/roles | Token names and documented roles are public. Exact values and generated colour math outputs may change for visual tuning before 1.0. |
|
|
13
13
|
| `--accent-1..6` | Stable names/roles | A subtle-to-bold accent ramp derived from `--accent`. Exact resolved values are visual tuning; algorithm changes require release-note visibility and resolver/browser checks. |
|
|
14
|
+
| Theme axes | Mixed | `data-theme` (light/dark) is the **contractual** base. `data-surface="oled"`, `data-density`, and `data-contrast` are **convenience presets** — best-effort visual variants, **not** part of the stability contract; their presence and exact values may change for tuning. (A computed-style smoke test guards the OLED `--bg` flip; the others are unverified.) |
|
|
14
15
|
| Behavior attributes (`data-bronto-*`) | Stable | Attribute names and documented markup relationships are public. Behavior internals are not. |
|
|
15
16
|
| Behavior functions (`@ponchia/ui/behaviors`) | Stable | Exported function names, option names, custom events, SSR no-op behavior, idempotency, and cleanup-returning contract are public. |
|
|
16
17
|
| Glyph registry/renderers (`@ponchia/ui/glyphs`) | Stable additive | Existing glyph names stay valid. New glyphs are additive. Renderer option names and accessibility defaults are public. |
|
|
@@ -18,7 +19,21 @@ patches are non-breaking. This matrix defines what counts as public API.
|
|
|
18
19
|
| React/Solid/Qwik bindings | Stable thin adapters | Hook/primitive names, optional peer behavior, root ref/signal/resolver support, and cleanup lifecycle are public. They remain wrappers over vanilla behaviors, not component APIs. |
|
|
19
20
|
| Skins (`@ponchia/ui/skins`, `css/skins.css`) | Stable additive | Existing skin names stay valid. New skins are additive. Skins are root-level choices. |
|
|
20
21
|
| Charts (`@ponchia/ui/charts`, `charts.json`, `css/dataviz.css`) | Stable additive | Token names, JSON shape, and 8 categorical slots are public. Exact palette values may tune if gates and release notes justify it. |
|
|
21
|
-
| Reports (`css/report.css`, `.ui-report*`, `.ui-chart*`, print utilities) | Stable additive | Report class names, BEM part names, chart helper class names, and print utility names are public. Report CSS is opt-in and not imported by the default bundle. |
|
|
22
|
+
| Reports (`css/report.css`, `.ui-report*`, `.ui-chart*`, print utilities) | Stable additive | Report class names, BEM part names, chart helper class names, and print utility names are public. Report CSS is opt-in and not imported by the default bundle. The data key now lives in the standalone Legends layer (below), not `css/report.css`. |
|
|
23
|
+
| Annotations (`@ponchia/ui/annotations`, `css/annotations.css`, `.ui-annotation*`) | Stable additive | SVG annotation class names, recipe option names, and helper function names are public. Helper internals and exact path-control heuristics may tune before 1.0. |
|
|
24
|
+
| Legends (`css/legend.css`, `.ui-legend*`, `@ponchia/ui/behaviors` `initLegend`) | Stable additive | Legend class names, recipe option names, and the `bronto:legend:toggle` event contract (`aria-pressed="true"` ⇒ shown) are public. Opt-in, not in the default bundle; swatch colours are gated to the `--chart-*` palette. |
|
|
25
|
+
| Marks (`css/marks.css`, `.ui-mark*`, `.ui-bracket-note*`) | Stable additive | Text-mark and bracket-note class names and recipe option names are public. Opt-in, not in the default bundle. Uses semantic tones only. |
|
|
26
|
+
| Connectors (`@ponchia/ui/connectors`, `css/connectors.css`, `.ui-connector*`, `initConnectors`) | Stable additive | Connector class names, the `data-bronto-connector` attribute contract, geometry helper function names, and recipe options are public. Helper internals/heuristics may tune before 1.0. Opt-in, not in the default bundle. |
|
|
27
|
+
| Spotlight (`css/spotlight.css`, `.ui-spotlight*`, `.ui-tour-note*`, `initSpotlight`) | Stable additive | Spotlight/tour-note class names, the `--spot-*` custom-property contract, and the `data-bronto-spotlight`/`data-target` attributes are public. Opt-in, not in the default bundle. Not a tour engine. |
|
|
28
|
+
| Crosshair (`css/crosshair.css`, `.ui-crosshair*`, `.ui-readout`, `initCrosshair`) | Stable additive | Crosshair/readout class names, the `--crosshair-x/y` properties, the `data-bronto-crosshair` attribute, and the `bronto:crosshair:move`/`:leave` event contract are public. Opt-in. Reports pointer position only — no data mapping. |
|
|
29
|
+
| Selection states (`css/selection.css`, `.ui-sel*`) | Stable additive | The `.ui-sel`/`--on`/`--off`/`--maybe` emphasis classes and recipe options are public. Opt-in, cross-cutting. The host owns selection logic; Bronto only styles the states. |
|
|
30
|
+
| Analytical roll-up (`css/analytical.css`) | Stable additive | A convenience `@import` of the seven analytical leaves (annotations, legend, marks, connectors, spotlight, crosshair, selection). The set of leaves it bundles may grow additively; each leaf also stays individually exported. Opt-in, not in the default bundle. |
|
|
31
|
+
| Sources / provenance (`css/sources.css`, `.ui-citation*`, `.ui-source-card*`, `.ui-source-list*`, `.ui-provenance*`, `.ui-src--*`) | Stable additive | Citation/source/provenance class names, the cross-cutting `.ui-src--*` trust-state modifiers (always paired with an author label), and the `ui.citation`/`ui.source`/`ui.provenance` recipes + `cls.sourceList` are public. Opt-in, not in the default bundle. |
|
|
32
|
+
| Lifecycle state (`css/state.css`, `.ui-state*`, `.ui-syncbar`) | Stable additive | The `.ui-state`/`__label`/`__detail`/`--busy` classes, the canonical lifecycle state modifiers, `.ui-syncbar`, and the `ui.state` recipe are public. Opt-in, not in the default bundle. |
|
|
33
|
+
| Generated / AI-trust (`css/generated.css`, `.ui-generated*`, `.ui-origin-label*`, `.ui-reasoning*`, `.ui-tool-log`, `.ui-tool-call*`) | Stable additive | The generated-content, origin-label (incl. `--ai`), reasoning-trace and tool-log/tool-call class names and the `ui.originLabel` recipe are public. Opt-in, not in the default bundle. Not a chat kit; no confidence widget. |
|
|
34
|
+
| Workbench (`css/workbench.css`, `.ui-inspector*`, `.ui-property*`, `.ui-selectionbar*`) | Stable additive | Inspector, property-row and selection-bar class + BEM part names are public (class-only — no recipe). Opt-in, not in the default bundle. Splitters/drag handles are out of scope. |
|
|
35
|
+
| Command palette (`css/command.css`, `.ui-command*`, `initCommand`, `useCommand`) | Stable additive | Command class/part names, the `data-bronto-command` attribute, and the event contract — `bronto:command:select` (`detail: { value, label }`) and `bronto:command:close` — are public, plus the `useCommand` binding hook. Bronto filters + navigates (APG combobox/listbox); the host owns the action registry/execution. Opt-in, not in the default bundle, no global hotkey. |
|
|
36
|
+
| Keyboard-shortcut hint (`.ui-shortcut`, `.ui-shortcut__sep`) | Stable additive | Class names for the chord/sequence hint over `.ui-kbd` are public. Ships in the core layer (class-only, no recipe). |
|
|
22
37
|
| Generated docs shipped in npm | Stable paths | `llms.txt` and exported docs paths stay shipped and resolvable within a compatible minor. Markdown/text assets are for reading unless your runtime has a loader. Generated content may change with the source contract. |
|
|
23
38
|
| Demo, examples, tests, scripts | Internal | Useful for learning and verification, but not shipped runtime API unless a path is explicitly exported in `package.json`. |
|
|
24
39
|
|
package/docs/state.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Lifecycle & system state
|
|
2
|
+
|
|
3
|
+
`@ponchia/ui/css/state.css` is an opt-in vocabulary for the states real apps
|
|
4
|
+
spend their time in — saving, saved, queued, offline, stale, conflicted, locked,
|
|
5
|
+
reviewed. These are usually improvised per product, so even good apps feel
|
|
6
|
+
inconsistent. This is the canonical set: a labelled state object with a rationed
|
|
7
|
+
tone, plus a page/document sync bar.
|
|
8
|
+
|
|
9
|
+
```css
|
|
10
|
+
@import '@ponchia/ui';
|
|
11
|
+
@import '@ponchia/ui/css/state.css';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Bronto ships the visual states and the canonical wording. The host owns the
|
|
15
|
+
state machine, retry policy, persistence, and announcements. **Persistent state
|
|
16
|
+
deserves persistent UI** — a toast is secondary, not the answer. The tone is a
|
|
17
|
+
second channel; the **label is the state**, so it survives forced-colors and
|
|
18
|
+
screen readers (WCAG 1.4.1).
|
|
19
|
+
|
|
20
|
+
## `.ui-state`
|
|
21
|
+
|
|
22
|
+
A leading tone dot, a `__label`, and an optional `__detail`. Add `--busy` to
|
|
23
|
+
pulse the indicator for an in-progress state (reduced-motion-safe).
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
<span class="ui-state ui-state--saving ui-state--busy">
|
|
27
|
+
<span class="ui-state__label">Saving…</span>
|
|
28
|
+
</span>
|
|
29
|
+
|
|
30
|
+
<span class="ui-state ui-state--saved">
|
|
31
|
+
<span class="ui-state__label">Saved</span>
|
|
32
|
+
<span class="ui-state__detail">2m ago</span>
|
|
33
|
+
</span>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## State matrix
|
|
37
|
+
|
|
38
|
+
Use the canonical label; the modifier bakes in the tone.
|
|
39
|
+
|
|
40
|
+
| State | Class | Canonical label | Tone | Busy? |
|
|
41
|
+
| --- | --- | --- | --- | --- |
|
|
42
|
+
| Saving | `ui-state--saving` | "Saving…" | accent | yes |
|
|
43
|
+
| Saved | `ui-state--saved` | "Saved" / "All changes saved" | success | — |
|
|
44
|
+
| Queued | `ui-state--queued` | "Queued" / "Pending" | muted | — |
|
|
45
|
+
| Offline | `ui-state--offline` | "Offline" | warning | — |
|
|
46
|
+
| Stale | `ui-state--stale` | "Out of date" | warning | — |
|
|
47
|
+
| Conflict | `ui-state--conflict` | "Conflict" | danger | — |
|
|
48
|
+
| Error | `ui-state--error` | "Failed" / "Couldn't save" | danger | — |
|
|
49
|
+
| Locked | `ui-state--locked` | "Locked" / "Read-only" | muted | — |
|
|
50
|
+
| Reviewed | `ui-state--reviewed` | "Reviewed" | success | — |
|
|
51
|
+
| Needs review | `ui-state--needs-review` | "Needs review" | warning | — |
|
|
52
|
+
|
|
53
|
+
"Syncing" and "Retrying" are the saving tone with their own label — use
|
|
54
|
+
`ui-state--saving ui-state--busy` and write the word.
|
|
55
|
+
|
|
56
|
+
## `.ui-syncbar`
|
|
57
|
+
|
|
58
|
+
A page- or document-level status strip: a state on one side, optional actions on
|
|
59
|
+
the other.
|
|
60
|
+
|
|
61
|
+
```html
|
|
62
|
+
<div class="ui-syncbar">
|
|
63
|
+
<span class="ui-state ui-state--saved">
|
|
64
|
+
<span class="ui-state__label">All changes saved</span>
|
|
65
|
+
<span class="ui-state__detail">just now</span>
|
|
66
|
+
</span>
|
|
67
|
+
<button class="ui-button ui-button--subtle ui-button--sm" type="button">View history</button>
|
|
68
|
+
</div>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Recipe
|
|
72
|
+
|
|
73
|
+
```js
|
|
74
|
+
import { ui } from '@ponchia/ui/classes';
|
|
75
|
+
|
|
76
|
+
ui.state({ state: 'saving', busy: true }); // "ui-state ui-state--saving ui-state--busy"
|
|
77
|
+
ui.state({ state: 'conflict' }); // "ui-state ui-state--conflict"
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Scope
|
|
81
|
+
|
|
82
|
+
CSS only — there is no JS yet. Auto-updating elapsed time ("2m ago") or live
|
|
83
|
+
progress text is the host's job; a small optional behavior may come later if a
|
|
84
|
+
real consumer needs it. Background-job progress and conflict-resolution
|
|
85
|
+
affordances are deliberately deferred until then.
|
package/docs/usage.md
CHANGED
|
@@ -263,6 +263,28 @@ dashboards: `--chart-1..8` (categorical), `--chart-seq-*` (sequential),
|
|
|
263
263
|
Cap a chart at ~8 series. Full detail in [theming.md](theming.md) →
|
|
264
264
|
"Data-viz palette".
|
|
265
265
|
|
|
266
|
+
## SVG annotations: subject, connector, note
|
|
267
|
+
|
|
268
|
+
`@ponchia/ui/css/annotations.css` (opt-in) adds Bronto-styled SVG annotations
|
|
269
|
+
for reports and chart figures. It is a visual grammar, not a charting or
|
|
270
|
+
authoring engine.
|
|
271
|
+
|
|
272
|
+
- Compose each callout from `ui-annotation` plus a subject
|
|
273
|
+
(`ui-annotation__subject`), connector (`ui-annotation__connector`), and note
|
|
274
|
+
(`ui-annotation__note`, `ui-annotation__title`, `ui-annotation__label`).
|
|
275
|
+
- Use `ui.annotation({ variant, tone, motion })` when building class strings in
|
|
276
|
+
JS. The default is a callout in the accent tone; motion is always opt-in.
|
|
277
|
+
- Use `@ponchia/ui/annotations` when you want deterministic SVG path strings
|
|
278
|
+
for circle, rect, threshold, bracket, band, slope, comparison, cluster, axis,
|
|
279
|
+
timeline, line, elbow, or curve annotations. Use `notePlacement()` for a
|
|
280
|
+
single bounded note when you need a conservative first placement pass.
|
|
281
|
+
- Status tones are only for status-bearing callouts; otherwise use `accent` for
|
|
282
|
+
the main insight and `muted` for secondary labels.
|
|
283
|
+
- Keep annotated charts sparse. Dense figures need a scrollable SVG, a
|
|
284
|
+
simplified mobile SVG, or complete caption/fallback text.
|
|
285
|
+
- Annotation text must be visible or represented in the figure caption, SVG
|
|
286
|
+
`<desc>`, or fallback table. Full detail in [annotations.md](annotations.md).
|
|
287
|
+
|
|
266
288
|
## When to add a behavior
|
|
267
289
|
|
|
268
290
|
The CSS is the framework; `@ponchia/ui/behaviors` is the *sanctioned*
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Workbench — inspector, properties, selection bar
|
|
2
|
+
|
|
3
|
+
`@ponchia/ui/css/workbench.css` is an opt-in set of primitives for **real
|
|
4
|
+
tools**: an inspector panel, property rows for a selected object, and a bar of
|
|
5
|
+
actions on the current selection. Generic kits stop at cards/tables/forms, so
|
|
6
|
+
every app builds its own half-consistent workbench. This is the low-risk CSS
|
|
7
|
+
core — layout and affordances only.
|
|
8
|
+
|
|
9
|
+
```css
|
|
10
|
+
@import '@ponchia/ui';
|
|
11
|
+
@import '@ponchia/ui/css/workbench.css';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Resizable split panes (a focusable ARIA window-splitter behavior) and drag
|
|
15
|
+
handles are deliberately deferred until a consumer needs them. Not in the core
|
|
16
|
+
bundle.
|
|
17
|
+
|
|
18
|
+
## Inspector — `.ui-inspector`
|
|
19
|
+
|
|
20
|
+
A panel of details for the selected object: a `__header` (title + actions) over
|
|
21
|
+
a `__body` of property rows.
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<aside class="ui-inspector">
|
|
25
|
+
<div class="ui-inspector__header">
|
|
26
|
+
<h2 class="ui-eyebrow">Rectangle</h2>
|
|
27
|
+
<button class="ui-button ui-button--subtle ui-button--sm" type="button">Reset</button>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="ui-inspector__body">
|
|
30
|
+
<!-- property rows -->
|
|
31
|
+
</div>
|
|
32
|
+
</aside>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Property row — `.ui-property`
|
|
36
|
+
|
|
37
|
+
A label/value pair, denser than `ui-key-value` and tuned for an inspector. The
|
|
38
|
+
`__value` can hold a static read-out or an input.
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<div class="ui-property">
|
|
42
|
+
<span class="ui-property__label">Width</span>
|
|
43
|
+
<span class="ui-property__value">240 px</span>
|
|
44
|
+
</div>
|
|
45
|
+
<div class="ui-property">
|
|
46
|
+
<span class="ui-property__label">Fill</span>
|
|
47
|
+
<span class="ui-property__value"><input class="ui-input" value="#121212" /></span>
|
|
48
|
+
</div>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Selection bar — `.ui-selectionbar`
|
|
52
|
+
|
|
53
|
+
A raised bar of actions on the current selection: a `__count` on one side,
|
|
54
|
+
`__actions` on the other. The host owns what is selected and what the actions do.
|
|
55
|
+
|
|
56
|
+
```html
|
|
57
|
+
<div class="ui-selectionbar">
|
|
58
|
+
<span class="ui-selectionbar__count">3 selected</span>
|
|
59
|
+
<span class="ui-selectionbar__actions">
|
|
60
|
+
<button class="ui-button ui-button--subtle ui-button--sm" type="button">Group</button>
|
|
61
|
+
<button class="ui-button ui-button--subtle ui-button--sm" type="button">Align</button>
|
|
62
|
+
<button class="ui-button ui-button--danger ui-button--sm" type="button">Delete</button>
|
|
63
|
+
</span>
|
|
64
|
+
</div>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Scope
|
|
68
|
+
|
|
69
|
+
CSS only, no recipes — these are structural containers and rows; apply the
|
|
70
|
+
classes directly (or read them from `cls.inspector`, `cls.property`, …). Pair
|
|
71
|
+
the selection bar with the cross-cutting [`ui-sel`](./selection.md) states on the
|
|
72
|
+
selected items themselves; Bronto styles both, the host owns the hit-testing.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|