@ponchia/ui 0.3.0 → 0.3.2

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
@@ -1,9 +1,30 @@
1
1
  # @ponchia/ui
2
2
 
3
+ [![npm](https://img.shields.io/npm/v/@ponchia/ui?logo=npm)](https://www.npmjs.com/package/@ponchia/ui)
4
+ [![npm provenance](https://img.shields.io/badge/npm-provenance-blue?logo=npm)](https://www.npmjs.com/package/@ponchia/ui#provenance)
5
+ [![runtime deps](https://img.shields.io/badge/runtime%20deps-0-brightgreen)](package.json)
6
+ [![bundle](https://img.shields.io/badge/dist-~54kB%20%2F%20~10kB%20gzip-informational)](scripts/check-dist.mjs)
7
+ [![CI](https://github.com/Ponchia/bronto-ui/actions/workflows/ci.yml/badge.svg)](https://github.com/Ponchia/bronto-ui/actions/workflows/ci.yml)
8
+ [![license: MIT](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
9
+
3
10
  Shared UI framework for Bronto personal projects. Nothing-inspired:
4
11
  monochrome surfaces, a single red accent, dot-matrix display type (Doto),
5
12
  flat hairline borders, restrained motion. CSS-first and framework-agnostic.
6
13
 
14
+ **New here?** → [Getting started](#getting-started) ·
15
+ [Reference](docs/reference.md) · [Theming](docs/theming.md) ·
16
+ [Roadmap](ROADMAP.md) · [Contributing](CONTRIBUTING.md)
17
+
18
+ > **Editor IntelliSense.** The package ships a VS Code CSS Custom Data
19
+ > file so every design token autocompletes inside `var(--…)`. Add to
20
+ > your `.vscode/settings.json`:
21
+ >
22
+ > ```json
23
+ > {
24
+ > "css.customData": ["node_modules/@ponchia/ui/classes/vscode.css-custom-data.json"]
25
+ > }
26
+ > ```
27
+
7
28
  **[Live demo →](https://ponchia.github.io/bronto-ui/)** — the kitchen
8
29
  sink (every component, light/dark, RTL, theming) deployed from `demo/`.
9
30
 
@@ -129,52 +150,36 @@ modules, so it is also a live integration test.
129
150
  | `site.css` | content-site shell: `ui-container`, `ui-siteheader`/`ui-sitenav` (aria-current), `ui-sitemenu`, `ui-sitefooter`, `ui-skiplink`, `ui-tags`, `ui-meta` |
130
151
  | `content.css` | `.ui-prose` Markdown/raw-HTML long-form (zero classes) + `ui-quote` pull-quote |
131
152
 
132
- ## Demo
133
-
134
- `demo/index.html` is a kitchen sink covering every primitive in both themes.
135
- Serve the package root and open `/demo/`:
153
+ ## Getting started
136
154
 
137
- ```bash
138
- python3 -m http.server -d . 8080 # then open http://localhost:8080/demo/
139
- ```
155
+ | Consumer | Guide |
156
+ | ----------------------- | ------------------------------------------------------------------ |
157
+ | Astro | [`docs/getting-started/astro.md`](docs/getting-started/astro.md) |
158
+ | SvelteKit | [`docs/getting-started/sveltekit.md`](docs/getting-started/sveltekit.md) |
159
+ | Vanilla / Vite / plain | [`docs/getting-started/vanilla.md`](docs/getting-started/vanilla.md) |
160
+ | React / Solid (snippet) | [`docs/getting-started/react-solid.md`](docs/getting-started/react-solid.md) |
161
+ | Tailwind / cascade-layer interop | [`docs/interop/tailwind.md`](docs/interop/tailwind.md) |
140
162
 
141
- ## Develop
142
-
143
- ```bash
144
- npm install # stylelint + jsdom (test only)
145
- npm run check # lint + 5 integrity checks (exports, tokens, classes, dist, pack)
146
- npm test # node:test — pure modules + jsdom behavior tests
147
- npm run lint:fix # auto-fix the safe stylistic rules + logical properties
148
- npm run tokens:build # regenerate tokens/index.json from tokens/index.js
149
- npm run dist:build # rebuild the flattened dist/ bundles
150
- ```
163
+ Each covers the CSS import location, the **no-flash** `applyStoredTheme`
164
+ head-script pattern, behavior init/cleanup in that framework's lifecycle,
165
+ and SSR caveats. Index: [`docs/integration.md`](docs/integration.md).
151
166
 
152
- `npm run check` enforces that the data mirrors cannot drift from the CSS:
153
- exports/import-graph integrity, `tokens.css` ⇄ `tokens/index.{js,json}`, the
154
- `classes` registry ⇄ the `.ui-*` selectors, `dist/` ⇄ `css/` (fresh + in
155
- budget), and that the published tarball ships only the intended files.
167
+ ## Demo
156
168
 
157
- End-to-end regression is a separate suite (real browsers, so not in the
158
- zero-dep core check):
169
+ `demo/index.html` is a kitchen sink covering every primitive in both
170
+ themes it drives itself with the real behavior modules, so it is also a
171
+ live integration test. Serve the package root and open `/demo/`:
159
172
 
160
173
  ```bash
161
- npx playwright test # visual snapshots + axe a11y + cross-engine + modes
174
+ python3 -m http.server -d . 8080 # then open http://localhost:8080/demo/
162
175
  ```
163
176
 
164
- It covers: visual snapshots light/dark/RTL/modal (chromium); axe-core
165
- WCAG 2.1 A/AA **plus best-practice** in both themes; behavioural specs
166
- (`:has()`, `color-mix()`, native `<dialog>`, `:dir()`/logical) on
167
- **chromium + firefox + webkit**; forced-colors / reduced-motion / print
168
- mode assertions; and a no-console-error / no-404 / document-structure
169
- gate. Pinned to a Playwright container so baselines are byte-stable; the
170
- committed baselines under `test/e2e/__screenshots__` were authored in
171
- that same image. To (re)generate them after an intentional visual
172
- change, run the **“Update visual baselines”** workflow
173
- (`workflow_dispatch`) from your branch — it rebuilds them in the pinned
174
- container and commits them back (never author them on a dev machine —
175
- cross-OS rasterisation differs). CI (`.github/workflows/ci.yml`) runs the `check` job and
176
- a containerised `e2e` job on every branch push and PR (and `release.yml`
177
- gates publish on it). It never publishes — a push to `main` ships nothing.
177
+ ## Develop & release
178
+
179
+ Contributor setup, the 14 `check` gates, the e2e suite, the visual-
180
+ baseline workflow, the deprecation policy and the tag-driven release
181
+ flow all live in **[CONTRIBUTING.md](CONTRIBUTING.md)**. Direction and
182
+ scope: **[ROADMAP.md](ROADMAP.md)**.
178
183
 
179
184
  ## Versioning
180
185
 
@@ -201,29 +206,6 @@ internal leaf-file boundaries and `@layer` internals, and anything
201
206
  explicitly marked legacy/deprecated. Full token contract:
202
207
  [`docs/theming.md`](docs/theming.md).
203
208
 
204
- ## Release
205
-
206
- Releases publish to npm and are tag-driven:
207
-
208
- ```bash
209
- # 1. bump "version" in package.json, land on main, let CI go green
210
- git tag vX.Y.Z && git push origin vX.Y.Z
211
- ```
212
-
213
- The tag triggers `.github/workflows/release.yml`: `validate` (read-only
214
- checks + tag↔version match) **and** `e2e` (Playwright visual + a11y) must
215
- both pass → `publish-npm` → `release-notes`. **The npm publish is the
216
- gate** — a failing check or e2e means the version never reaches npm, so
217
- consumers never resolve it. GitHub also serves the raw tag tarball
218
- ungated, but that is a legacy/fallback path, not the documented install.
219
- See [`docs/architecture.md`](docs/architecture.md).
220
-
221
- Published: `@ponchia/ui` is live on npm, released by CI with provenance.
222
- The `@ponchia` scope and the `NPM_TOKEN` repo secret are in place, so a
223
- pushed `vX.Y.Z` tag is all a release needs. (The current published
224
- version is whatever npm's `latest` dist-tag resolves to — this README
225
- deliberately does not restate it, so it can't drift from the registry.)
226
-
227
209
  ## Consumers
228
210
 
229
211
  Built for two shapes of app: a content/marketing site (`ui-site*`,
@@ -46,6 +46,52 @@ export declare function initDisclosure(opts?: DelegateOpts): Cleanup;
46
46
  */
47
47
  export declare function initMenu(opts?: DelegateOpts): Cleanup;
48
48
 
49
+ /**
50
+ * Accessible validation glue for `<form data-bronto-validate>`:
51
+ * progressive enhancement over the Constraint Validation API. Sets
52
+ * `aria-invalid`, writes `validationMessage` into the field's
53
+ * `[data-bronto-error]` / `.ui-hint` slot (linked via
54
+ * `aria-describedby`), and on invalid submit fills the form's
55
+ * `[data-bronto-error-summary]` with focusable links and blocks submit.
56
+ * Works without JS (native validation). Returns a cleanup function.
57
+ */
58
+ export declare function initFormValidation(opts?: DelegateOpts): Cleanup;
59
+
60
+ /**
61
+ * Editable combobox with a filtered listbox popup (WAI-ARIA APG
62
+ * pattern), dependency-free and CSS-anchored. Wires
63
+ * `[data-bronto-combobox]` (input `role=combobox` +
64
+ * `.ui-combobox__list` of `role=option`): ids, `aria-expanded` /
65
+ * `aria-controls` / `aria-activedescendant`, type-to-filter, full
66
+ * keyboard, pointer select, outside-click close. Emits `bronto:change`
67
+ * ({ detail: { value } }) on selection. SSR-safe, idempotent per
68
+ * instance. Returns a cleanup function.
69
+ */
70
+ export declare function initCombobox(opts?: DelegateOpts): Cleanup;
71
+
72
+ /**
73
+ * Collision-aware popover, dependency-free. A `[data-bronto-popover]`
74
+ * trigger toggles the `.ui-popover` panel it names; the panel flips
75
+ * above when it would overflow the viewport and its inline edge is
76
+ * clamped on-screen. Uses the native top layer when the panel has
77
+ * `popover` and the Popover API exists, else an `.is-open` class.
78
+ * Manages `aria-expanded`/`aria-controls`, Escape + outside-click
79
+ * close, scroll/resize reposition. Returns a cleanup function.
80
+ */
81
+ export declare function initPopover(opts?: DelegateOpts): Cleanup;
82
+
83
+ /**
84
+ * Client-side sortable + selectable data table for
85
+ * `[data-bronto-sortable]`. Header `.ui-table__sort` / `th[data-sort]`
86
+ * cycles `aria-sort` and reorders the tbody (numeric- or
87
+ * locale-string-aware); `[data-bronto-select-all]` toggles
88
+ * `[data-bronto-select]` rows + `aria-selected` with synced
89
+ * checked/indeterminate state. Emits `bronto:selectionchange`
90
+ * ({ detail: { count } }). SSR-safe, idempotent per table. Returns a
91
+ * cleanup function.
92
+ */
93
+ export declare function initTableSort(opts?: DelegateOpts): Cleanup;
94
+
49
95
  /**
50
96
  * Wire `[data-bronto-tabs]` groups with the WAI-ARIA Tabs keyboard
51
97
  * pattern (roving tabindex, Arrow/Home/End, aria-selected, panel sync).