@ponchia/ui 0.3.0 → 0.3.1
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 +43 -61
- package/behaviors/index.d.ts +46 -0
- package/behaviors/index.js +575 -6
- package/classes/index.d.ts +25 -0
- package/classes/index.js +25 -0
- package/classes/vscode.css-custom-data.json +407 -0
- package/css/app.css +11 -2
- package/css/base.css +0 -1
- package/css/dots.css +1 -1
- package/css/feedback.css +87 -2
- package/css/forms.css +126 -0
- package/css/overlay.css +64 -1
- package/css/primitives.css +95 -0
- package/css/site.css +2 -2
- package/css/table.css +59 -0
- package/css/tokens.css +69 -21
- package/dist/bronto.css +1 -1
- package/dist/css/app.css +1 -1
- package/dist/css/base.css +1 -1
- package/dist/css/dots.css +1 -1
- package/dist/css/feedback.css +1 -1
- package/dist/css/forms.css +1 -1
- package/dist/css/overlay.css +1 -1
- package/dist/css/primitives.css +1 -1
- package/dist/css/site.css +1 -1
- package/dist/css/table.css +1 -1
- package/dist/css/tokens.css +1 -1
- package/package.json +13 -7
- package/tokens/index.d.ts +2 -2
- package/tokens/index.js +45 -14
- package/tokens/index.json +90 -28
- package/tokens/tokens.dtcg.json +219 -14
package/README.md
CHANGED
|
@@ -1,9 +1,30 @@
|
|
|
1
1
|
# @ponchia/ui
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@ponchia/ui)
|
|
4
|
+
[](https://www.npmjs.com/package/@ponchia/ui#provenance)
|
|
5
|
+
[](package.json)
|
|
6
|
+
[](scripts/check-dist.mjs)
|
|
7
|
+
[](https://github.com/Ponchia/bronto-ui/actions/workflows/ci.yml)
|
|
8
|
+
[](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
|
-
##
|
|
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
|
-
|
|
138
|
-
|
|
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
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
-
|
|
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
|
-
|
|
158
|
-
|
|
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
|
-
|
|
174
|
+
python3 -m http.server -d . 8080 # then open http://localhost:8080/demo/
|
|
162
175
|
```
|
|
163
176
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
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*`,
|
package/behaviors/index.d.ts
CHANGED
|
@@ -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).
|