@ponchia/ui 0.3.4 → 0.3.6
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 +121 -175
- package/behaviors/index.d.ts +27 -0
- package/behaviors/index.js +305 -0
- package/classes/index.d.ts +41 -0
- package/classes/index.js +41 -0
- package/css/disclosure.css +180 -0
- package/css/dots.css +42 -4
- package/css/feedback.css +111 -0
- package/css/forms.css +44 -0
- package/css/overlay.css +48 -0
- package/css/primitives.css +60 -0
- package/css/site.css +33 -0
- package/dist/bronto.css +1 -1
- package/dist/css/disclosure.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/docs/reference.md +73 -1
- package/docs/usage.md +110 -0
- package/fonts/OFL.txt +93 -0
- package/glyphs/glyphs.d.ts +102 -0
- package/glyphs/glyphs.js +922 -0
- package/llms.txt +11 -0
- package/package.json +28 -4
package/README.md
CHANGED
|
@@ -2,220 +2,166 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@ponchia/ui)
|
|
4
4
|
[](https://www.npmjs.com/package/@ponchia/ui#provenance)
|
|
5
|
-
[](package.json)
|
|
6
|
-
[](https://github.com/Ponchia/bronto-ui/blob/main/package.json)
|
|
6
|
+
[](https://github.com/Ponchia/bronto-ui/blob/main/scripts/check-dist.mjs)
|
|
7
7
|
[](https://github.com/Ponchia/bronto-ui/actions/workflows/ci.yml)
|
|
8
|
-
[](https://scorecard.dev/viewer/?uri=github.com/Ponchia/bronto-ui)
|
|
9
|
+
[](https://github.com/Ponchia/bronto-ui/blob/main/LICENSE)
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
monochrome surfaces, a single red accent, dot-matrix display type (Doto),
|
|
12
|
-
flat hairline borders, restrained motion. CSS-first and framework-agnostic.
|
|
11
|
+
**A CSS-first, framework-agnostic UI framework with a "Nothing"-inspired look — monochrome surfaces, one rationed red accent, dot-matrix display type, hairline borders, restrained motion. Zero runtime dependencies. Re-brand the whole thing with one CSS variable.**
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
[Reference](docs/reference.md) · [Usage](docs/usage.md) ·
|
|
16
|
-
[Theming](docs/theming.md) · [Contrast](docs/contrast.md) ·
|
|
17
|
-
[Roadmap](ROADMAP.md) · [Contributing](CONTRIBUTING.md)
|
|
13
|
+
### [Live demo →](https://ponchia.github.io/bronto-ui/) · [Theme playground →](https://ponchia.github.io/bronto-ui/demo/theme-playground.html)
|
|
18
14
|
|
|
19
|
-
|
|
20
|
-
> file so every design token autocompletes inside `var(--…)`. Add to
|
|
21
|
-
> your `.vscode/settings.json`:
|
|
22
|
-
>
|
|
23
|
-
> ```json
|
|
24
|
-
> {
|
|
25
|
-
> "css.customData": ["node_modules/@ponchia/ui/classes/vscode.css-custom-data.json"]
|
|
26
|
-
> }
|
|
27
|
-
> ```
|
|
15
|
+
The demo is the kitchen sink — every component, light/dark, RTL, live theming.
|
|
28
16
|
|
|
29
|
-
|
|
30
|
-
> point a coding agent at `node_modules/@ponchia/ui/llms.txt` for a
|
|
31
|
-
> self-contained orientation. The full class catalog
|
|
32
|
-
> (`docs/reference.md`) and the token contract (`docs/theming.md`) also
|
|
33
|
-
> ship in the tarball, so an offline agent never has to guess at the API.
|
|
17
|
+
---
|
|
34
18
|
|
|
35
|
-
|
|
36
|
-
sink (every component, light/dark, RTL, theming) deployed from `demo/`.
|
|
19
|
+
## What it is
|
|
37
20
|
|
|
38
|
-
|
|
21
|
+
`@ponchia/ui` ships its design as **CSS**, not components. You drop in one stylesheet and style with semantic `ui-*` classes; an optional thin layer of typed class-name recipes and SSR-safe vanilla behaviors sits on top for the few things that genuinely need JS (theme persistence, dialogs, toasts, disclosure). The guiding principle is **color is rationed, structure carries meaning** — layout, type weight and the hairline do the work before a hue does, and the accent is a spotlight, not a paint bucket. Because everything lives in a single `@layer bronto`, your own un-layered CSS overrides the framework with no specificity fight and no `!important`.
|
|
39
22
|
|
|
40
|
-
Install
|
|
23
|
+
## Install
|
|
41
24
|
|
|
42
25
|
```bash
|
|
43
26
|
npm i @ponchia/ui
|
|
44
27
|
```
|
|
45
28
|
|
|
46
|
-
|
|
47
|
-
> ownable). The **CSS layer** and behavior attributes stay `bronto`
|
|
48
|
-
> (`@layer bronto`, `data-bronto-*`) — that's the design-system namespace,
|
|
49
|
-
> deliberately distinct from the package name. See
|
|
50
|
-
> [`docs/architecture.md`](docs/architecture.md).
|
|
29
|
+
Or drop it in with no build step, straight from a CDN:
|
|
51
30
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
```css
|
|
56
|
-
@import '@ponchia/ui/css'; /* === @ponchia/ui/css/core.css */
|
|
31
|
+
```html
|
|
32
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ponchia/ui/dist/bronto.css">
|
|
57
33
|
```
|
|
58
34
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
package also ships one flattened, minified bundle with no `@import`
|
|
63
|
-
chain:
|
|
35
|
+
## Quick start
|
|
36
|
+
|
|
37
|
+
**1. Load the CSS.** One flattened, minified bundle — the whole framework, one request (~73 kB raw / ~13 kB gzip):
|
|
64
38
|
|
|
65
39
|
```css
|
|
66
|
-
@import '@ponchia/ui';
|
|
40
|
+
@import '@ponchia/ui'; /* via a bundler */
|
|
67
41
|
```
|
|
68
42
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
43
|
+
```html
|
|
44
|
+
<!-- or a plain <link>, no bundler -->
|
|
45
|
+
<link rel="stylesheet" href="/node_modules/@ponchia/ui/dist/bronto.css">
|
|
46
|
+
```
|
|
73
47
|
|
|
74
|
-
>
|
|
75
|
-
> resolves to a stylesheet — `@import '@ponchia/ui'` in CSS, never
|
|
76
|
-
> `import '@ponchia/ui'` in JS. There is no JS module at the root; the
|
|
77
|
-
> JS entrypoints are the explicit subpaths `@ponchia/ui/tokens`,
|
|
78
|
-
> `/classes`, and `/behaviors` (see [Entrypoints](#entrypoints)).
|
|
48
|
+
> Prefer source leaves through a bundler? Use `@import '@ponchia/ui/css'` (a thin `@import` fan-out) instead. Both resolve the Doto `@font-face` with relative URLs, so there's no `/fonts` path assumption.
|
|
79
49
|
|
|
80
|
-
|
|
50
|
+
**2. Write markup with `ui-*` classes** (primary is the default button; modifiers are opt-in):
|
|
81
51
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
52
|
+
```html
|
|
53
|
+
<button class="ui-button">Save</button>
|
|
54
|
+
<button class="ui-button ui-button--ghost">Cancel</button>
|
|
55
|
+
<div class="ui-card">
|
|
56
|
+
<span class="ui-eyebrow">Status</span>
|
|
57
|
+
<span class="ui-badge ui-badge--success">Online</span>
|
|
58
|
+
</div>
|
|
59
|
+
```
|
|
87
60
|
|
|
88
|
-
|
|
89
|
-
`css/core.css`) with URLs relative to the package, so it resolves through a
|
|
90
|
-
bundler or static serving with no `/fonts` path assumption. To self-host the
|
|
91
|
-
font instead, import everything except `fonts.css` and override `--display` /
|
|
92
|
-
`--dot-font`.
|
|
61
|
+
**3. (Optional) typed recipes — build class strings in JS/TS:**
|
|
93
62
|
|
|
94
|
-
|
|
95
|
-
|
|
63
|
+
```js
|
|
64
|
+
import { ui, cx } from '@ponchia/ui/classes';
|
|
65
|
+
|
|
66
|
+
ui.button({ variant: 'ghost' }); // → "ui-button ui-button--ghost"
|
|
67
|
+
ui.meter({ tone: 'warning' }); // → "ui-meter ui-meter--warning"
|
|
68
|
+
```
|
|
96
69
|
|
|
97
|
-
|
|
98
|
-
> `@ponchia/ui/css/primitives.css`, etc. — is self-wrapped in
|
|
99
|
-
> `@layer bronto`, so mixing the bundle with individual leaves (e.g.
|
|
100
|
-
> per-route CSS splitting in SvelteKit/Astro) is safe: no silent
|
|
101
|
-
> cascade inversion. The deliberate full-specificity escape hatch is
|
|
102
|
-
> the explicit `@ponchia/ui/css/unlayered/<leaf>.css` path — use it
|
|
103
|
-
> only when you *want* an unlayered override, never by accident.
|
|
70
|
+
**4. (Optional) behaviors — SSR-safe vanilla JS, each returns a cleanup function:**
|
|
104
71
|
|
|
105
|
-
|
|
106
|
-
|
|
72
|
+
```js
|
|
73
|
+
import { initThemeToggle, initDialog, toast } from '@ponchia/ui/behaviors';
|
|
107
74
|
|
|
108
|
-
|
|
109
|
-
(
|
|
110
|
-
|
|
111
|
-
|
|
75
|
+
initThemeToggle(); // wires [data-bronto-theme-toggle] + localStorage
|
|
76
|
+
initDialog(); // native <dialog> glue: [data-bronto-open] / [data-bronto-close]
|
|
77
|
+
toast('Saved', { tone: 'success' }); // body-anchored stack, no markup needed
|
|
78
|
+
```
|
|
112
79
|
|
|
113
|
-
|
|
80
|
+
Behaviors cover theme persistence, disclosure, dropdown menus, native-`<dialog>` modals/drawers, tabs, combobox, form validation, table sort, carousel and toasts — wired by `data-bronto-*` attributes.
|
|
114
81
|
|
|
115
|
-
|
|
116
|
-
on top of it — none pull in a UI framework. See
|
|
117
|
-
[`docs/architecture.md`](docs/architecture.md) for the rationale.
|
|
82
|
+
**5. (Optional) display glyphs — a 43-glyph dot-matrix icon set:**
|
|
118
83
|
|
|
119
84
|
```js
|
|
120
|
-
import
|
|
121
|
-
import { ui, cx } from '@ponchia/ui/classes'; // typed class-name recipes
|
|
122
|
-
import { initThemeToggle, dismissible } from '@ponchia/ui/behaviors'; // vanilla, SSR-safe
|
|
123
|
-
```
|
|
85
|
+
import { renderGlyph } from '@ponchia/ui/glyphs';
|
|
124
86
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
87
|
+
el.innerHTML = renderGlyph('search', { label: 'Search' }); // role="img"
|
|
88
|
+
// or drop a placeholder and expand it: <span data-bronto-glyph="check"></span>
|
|
89
|
+
// import { initDotGlyph } from '@ponchia/ui/behaviors'; initDotGlyph();
|
|
128
90
|
```
|
|
129
91
|
|
|
130
|
-
`
|
|
131
|
-
`[data-bronto-dismissible]`, `[data-bronto-disclosure]`,
|
|
132
|
-
`[data-bronto-menu]` (`initMenu`: Escape / outside-click /
|
|
133
|
-
close-on-activate for a `<details>` `.ui-menu` dropdown), and native
|
|
134
|
-
`<dialog>` glue (`initDialog`: `[data-bronto-open]` / `[data-bronto-close]`
|
|
135
|
-
/ `[data-bronto-dialog-light]`). `toast(message, { tone, title, duration })`
|
|
136
|
-
pushes into a shared, body-anchored stack. Each initializer is SSR-safe and
|
|
137
|
-
returns a cleanup function. `demo/index.html` drives itself with these
|
|
138
|
-
modules, so it is also a live integration test.
|
|
139
|
-
|
|
140
|
-
## Layout
|
|
141
|
-
|
|
142
|
-
| File | Contents |
|
|
143
|
-
| ---------------- | ------------------------------------------------------------- |
|
|
144
|
-
| `tokens.css` | palette (dual light/dark), spacing, type, motion, dot tokens |
|
|
145
|
-
| `fonts.css` | Doto `@font-face` (relative URLs; optional if self-hosting) |
|
|
146
|
-
| `base.css` | reset, element defaults, focus, scrollbars |
|
|
147
|
-
| `motion.css` | keyframes + animation utilities + reduced-motion |
|
|
148
|
-
| `dots.css` | dot-grid, dot rule, status dot, dot loader, orbital dot spinner, dot bar (+ indeterminate), matrix reveal |
|
|
149
|
-
| `primitives.css` | `ui-*` buttons, cards, chips, badges, links, key/value |
|
|
150
|
-
| `forms.css` | inputs, select, textarea, search, switch, checkbox |
|
|
151
|
-
| `feedback.css` | alert / callout, toast, tooltip, linear progress |
|
|
152
|
-
| `overlay.css` | modal + drawer (native `<dialog>`), dropdown menu |
|
|
153
|
-
| `disclosure.css` | tabs, accordion (`<details>`), segmented, breadcrumb, pagination, avatar |
|
|
154
|
-
| `table.css` | `ui-table` dense / comfortable |
|
|
155
|
-
| `app.css` | admin shell: `ui-app-shell`/`-rail`/`-topbar`/`-toolbar`/`-panel`/`-nav`/`-metrics` |
|
|
156
|
-
| `navigation.css` | `ui-themetoggle` (dot-thumb switch) |
|
|
157
|
-
| `site.css` | content-site shell: `ui-container`, `ui-siteheader`/`ui-sitenav` (aria-current), `ui-sitemenu`, `ui-sitefooter`, `ui-skiplink`, `ui-tags`, `ui-meta` |
|
|
158
|
-
| `content.css` | `.ui-prose` Markdown/raw-HTML long-form (zero classes) + `ui-quote` pull-quote |
|
|
159
|
-
|
|
160
|
-
## Getting started
|
|
161
|
-
|
|
162
|
-
| Consumer | Guide |
|
|
163
|
-
| ----------------------- | ------------------------------------------------------------------ |
|
|
164
|
-
| Astro | [`docs/getting-started/astro.md`](docs/getting-started/astro.md) |
|
|
165
|
-
| SvelteKit | [`docs/getting-started/sveltekit.md`](docs/getting-started/sveltekit.md) |
|
|
166
|
-
| Vanilla / Vite / plain | [`docs/getting-started/vanilla.md`](docs/getting-started/vanilla.md) |
|
|
167
|
-
| React / Solid (snippet) | [`docs/getting-started/react-solid.md`](docs/getting-started/react-solid.md) |
|
|
168
|
-
| Tailwind / cascade-layer interop | [`docs/interop/tailwind.md`](docs/interop/tailwind.md) |
|
|
169
|
-
|
|
170
|
-
Each covers the CSS import location, the **no-flash** `applyStoredTheme`
|
|
171
|
-
head-script pattern, behavior init/cleanup in that framework's lifecycle,
|
|
172
|
-
and SSR caveats. Index: [`docs/integration.md`](docs/integration.md).
|
|
173
|
-
|
|
174
|
-
## Demo
|
|
175
|
-
|
|
176
|
-
`demo/index.html` is a kitchen sink covering every primitive in both
|
|
177
|
-
themes — it drives itself with the real behavior modules, so it is also a
|
|
178
|
-
live integration test. Serve the package root and open `/demo/`:
|
|
92
|
+
Arrows, chevrons, check/close/plus/minus, search/menu/gear, info/warning/bell/lock, home/user/heart/star/spark — rendered on the same `.ui-dotmatrix` primitive and re-skinned by the `--field-dot*` tokens (no SVG, no font). Default dot look is for **display** sizes; pass **`{ solid: true }`** to fuse the cells into a crisp pixel glyph that works as an **inline icon down to ~16px**.
|
|
179
93
|
|
|
180
|
-
|
|
181
|
-
|
|
94
|
+
## What's in the box
|
|
95
|
+
|
|
96
|
+
- **Primitives** — buttons, cards, chips, badges, links, key/value, `ui-num`, avatars.
|
|
97
|
+
- **Forms** — inputs, select, textarea, search, switch, checkbox, `ui-input-icon`, `ui-input-group`.
|
|
98
|
+
- **Feedback** — alert/callout, toast, tooltip, `ui-progress` (task) and `ui-meter` (measured value).
|
|
99
|
+
- **Overlay** — modal + drawer on native `<dialog>`, dropdown menu, `ui-carousel` + `ui-lightbox` (gallery, user-driven — not an auto-slider).
|
|
100
|
+
- **Disclosure & nav** — tabs, accordion, segmented, breadcrumb, pagination, `ui-steps`, `ui-timeline`, `ui-pagehead`, `ui-kbd`.
|
|
101
|
+
- **Shells** — an admin dashboard shell (`ui-app-*`) and a content/marketing site shell (`ui-site*`, `ui-container`).
|
|
102
|
+
- **Prose** — `.ui-prose` styles raw, unclassed semantic HTML (Markdown / CMS / LLM output) with zero classes.
|
|
103
|
+
- **Motion & dots** — the dot-matrix motif kit: dot grid, status dots, dot loaders, the orbital spinner, matrix reveal — all reduced-motion aware.
|
|
104
|
+
|
|
105
|
+
Full generated catalog of every class: **[docs/reference.md](https://github.com/Ponchia/bronto-ui/blob/main/docs/reference.md)**. The decision guide (which primitive when): **[docs/usage.md](https://github.com/Ponchia/bronto-ui/blob/main/docs/usage.md)**.
|
|
106
|
+
|
|
107
|
+
## Theming: one knob
|
|
108
|
+
|
|
109
|
+
Everything accent-colored derives from a single `--accent` variable via `color-mix()`. Re-brand the entire app — both light and dark — with one declaration, globally or scoped to any subtree:
|
|
110
|
+
|
|
111
|
+
```css
|
|
112
|
+
:root { --accent: #2f6df6; } /* whole app blue */
|
|
113
|
+
.promo { --accent: #16a34a; } /* …or just this section green */
|
|
182
114
|
```
|
|
183
115
|
|
|
184
|
-
|
|
116
|
+
Buttons, focus rings, dot motifs, accent borders and soft fills all follow automatically. Light/dark is `data-theme="light"` / `"dark"` on `<html>` (defaults to `prefers-color-scheme`); `data-density` and `data-contrast` give density and contrast presets. A full re-skin (radius, display face, dot density, surfaces) is a handful more token overrides — the "Nothing" look is the **default skin, not the architecture**.
|
|
117
|
+
|
|
118
|
+
> When you change `--accent`, contrast becomes yours: verify your hue in the **[theme playground](https://ponchia.github.io/bronto-ui/demo/theme-playground.html)** (it shows the derived family and computed WCAG ratios). Full contract: **[docs/theming.md](https://github.com/Ponchia/bronto-ui/blob/main/docs/theming.md)**.
|
|
119
|
+
|
|
120
|
+
## Works with anything
|
|
121
|
+
|
|
122
|
+
The CSS is the framework, so it works with React, Svelte/SvelteKit, Astro, Vue, Solid or plain HTML — there's no component runtime to adopt. The optional `classes` and `behaviors` entrypoints pull in **no** UI framework and are SSR-safe.
|
|
123
|
+
|
|
124
|
+
Per-framework getting-started guides + runnable example apps live in the repo:
|
|
125
|
+
|
|
126
|
+
| Stack | Guide | Example |
|
|
127
|
+
| ----- | ----- | ------- |
|
|
128
|
+
| Vanilla / Vite / plain HTML | [vanilla.md](https://github.com/Ponchia/bronto-ui/blob/main/docs/getting-started/vanilla.md) | [`examples/vanilla-vite`](https://github.com/Ponchia/bronto-ui/tree/main/examples/vanilla-vite) |
|
|
129
|
+
| Astro | [astro.md](https://github.com/Ponchia/bronto-ui/blob/main/docs/getting-started/astro.md) | [`examples/astro`](https://github.com/Ponchia/bronto-ui/tree/main/examples/astro) |
|
|
130
|
+
| SvelteKit | [sveltekit.md](https://github.com/Ponchia/bronto-ui/blob/main/docs/getting-started/sveltekit.md) | [`examples/sveltekit`](https://github.com/Ponchia/bronto-ui/tree/main/examples/sveltekit) |
|
|
131
|
+
| React / Solid (snippet) | [react-solid.md](https://github.com/Ponchia/bronto-ui/blob/main/docs/getting-started/react-solid.md) | — |
|
|
132
|
+
| Tailwind / cascade-layer interop | [tailwind.md](https://github.com/Ponchia/bronto-ui/blob/main/docs/interop/tailwind.md) | — |
|
|
133
|
+
|
|
134
|
+
## Extras
|
|
135
|
+
|
|
136
|
+
- **Tokens as data** — `import tokens, { themeColor, cssVars } from '@ponchia/ui/tokens'` (plus `tokens.json`, W3C DTCG `tokens.dtcg.json`, and `tokens/resolved.json` for charts/data-viz).
|
|
137
|
+
- **Editor IntelliSense** — point VS Code at the shipped custom-data file so every token autocompletes in `var(--…)`:
|
|
138
|
+
```json
|
|
139
|
+
{ "css.customData": ["node_modules/@ponchia/ui/classes/vscode.css-custom-data.json"] }
|
|
140
|
+
```
|
|
141
|
+
- **For AI coding agents** — the package ships `llms.txt` at its root plus `docs/reference.md`, `docs/usage.md` and `docs/theming.md` inside the tarball, so an offline agent has the full API without guessing.
|
|
142
|
+
|
|
143
|
+
> The package root is **CSS-only**: `@import '@ponchia/ui'` in CSS, never `import '@ponchia/ui'` in JS. The JS entrypoints are the explicit subpaths `/tokens`, `/classes`, `/behaviors`, `/glyphs`.
|
|
185
144
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
scope: **[ROADMAP.md](ROADMAP.md)**.
|
|
145
|
+
## Browser support
|
|
146
|
+
|
|
147
|
+
Evergreen only. The framework relies on cascade layers, `:has()`, `color-mix()`, CSS logical properties and native `<dialog>`. Floor: **Chrome/Edge 111+, Safari 16.4+, Firefox 121+** (early 2023 onward). No build-time fallback ships; pin an older tag if you need below this.
|
|
190
148
|
|
|
191
149
|
## Versioning
|
|
192
150
|
|
|
193
|
-
Pre-1.0 and deliberately so. **Until `1.0.0`, breaking changes ship in
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
behavior attributes; each behavior's return-cleanup contract. **What is
|
|
211
|
-
not** (may change in any release): token _values_ (visual tuning), the
|
|
212
|
-
internal leaf-file boundaries and `@layer` internals, and anything
|
|
213
|
-
explicitly marked legacy/deprecated. Full token contract:
|
|
214
|
-
[`docs/theming.md`](docs/theming.md).
|
|
215
|
-
|
|
216
|
-
## Consumers
|
|
217
|
-
|
|
218
|
-
Built for two shapes of app: a content/marketing site (`ui-site*`,
|
|
219
|
-
`ui-prose`) and an admin dashboard (`ui-app-*` shell). Both import the
|
|
220
|
-
one bundle `@ponchia/ui` (or `@ponchia/ui/css`); consuming apps depend
|
|
221
|
-
on it via `@ponchia/ui`.
|
|
151
|
+
Pre-1.0 and deliberately so. **Until `1.0.0`, breaking changes ship in the _minor_** (`0.x.0`); patches (`0.x.y`) are always non-breaking. Pin with the patch range — at `0.x`, `~0.3.0` (and equivalently `^0.3.0`) resolves to `>=0.3.0 <0.4.0`, giving you safe patches while holding back the next breaking minor. Every breaking change is called out under a **BREAKING** heading in the **[CHANGELOG](https://github.com/Ponchia/bronto-ui/blob/main/CHANGELOG.md)** with a migration note.
|
|
152
|
+
|
|
153
|
+
Contractual (changes are breaking): the `--accent` derivation and token **names**, the `.ui-*` class and recipe names, the `data-bronto-*` attributes, and each behavior's cleanup contract. Not contractual (may change any release): token **values** (visual tuning) and internal leaf-file / `@layer` boundaries.
|
|
154
|
+
|
|
155
|
+
Release candidates publish to the `next` dist-tag, never to `latest` — opt in with `npm i @ponchia/ui@next` to try an upcoming version early. A plain `npm i @ponchia/ui` only ever resolves a stable release.
|
|
156
|
+
|
|
157
|
+
## Links
|
|
158
|
+
|
|
159
|
+
- **[Live demo](https://ponchia.github.io/bronto-ui/)** · **[Theme playground](https://ponchia.github.io/bronto-ui/demo/theme-playground.html)**
|
|
160
|
+
- **[Class reference](https://github.com/Ponchia/bronto-ui/blob/main/docs/reference.md)** · **[Usage guide](https://github.com/Ponchia/bronto-ui/blob/main/docs/usage.md)** · **[Theming](https://github.com/Ponchia/bronto-ui/blob/main/docs/theming.md)** · **[Contrast](https://github.com/Ponchia/bronto-ui/blob/main/docs/contrast.md)**
|
|
161
|
+
- **[CHANGELOG](https://github.com/Ponchia/bronto-ui/blob/main/CHANGELOG.md)** · **[Roadmap](https://github.com/Ponchia/bronto-ui/blob/main/ROADMAP.md)** · **[Contributing](https://github.com/Ponchia/bronto-ui/blob/main/CONTRIBUTING.md)**
|
|
162
|
+
|
|
163
|
+
## License
|
|
164
|
+
|
|
165
|
+
[MIT](https://github.com/Ponchia/bronto-ui/blob/main/LICENSE) © Ponchia.
|
|
166
|
+
|
|
167
|
+
The bundled **Doto** font (`fonts/*.ttf`) is © 2024 The Doto Project Authors and licensed separately under the [SIL Open Font License 1.1](https://github.com/Ponchia/bronto-ui/blob/main/fonts/OFL.txt) — see `fonts/OFL.txt`.
|
package/behaviors/index.d.ts
CHANGED
|
@@ -106,6 +106,22 @@ export declare function initTabs(opts?: DelegateOpts): Cleanup;
|
|
|
106
106
|
*/
|
|
107
107
|
export declare function initDialog(opts?: DelegateOpts): Cleanup;
|
|
108
108
|
|
|
109
|
+
/**
|
|
110
|
+
* Image carousel / gallery built on CSS scroll-snap (touch/trackpad swipe
|
|
111
|
+
* is the browser's). Wires `[data-bronto-carousel]`: prev/next
|
|
112
|
+
* (`[data-bronto-carousel-prev|next]`), keyboard (Arrow/Home/End on the
|
|
113
|
+
* focused `.ui-carousel__viewport`), a `.ui-carousel__thumb` strip with
|
|
114
|
+
* `aria-current` sync, the `.ui-carousel__status` counter, and ARIA. Keeps
|
|
115
|
+
* a JS index in sync with the scroll position both ways (via
|
|
116
|
+
* IntersectionObserver where available). `data-bronto-carousel-loop` wraps
|
|
117
|
+
* at the ends; `data-bronto-carousel-label` names the region. A
|
|
118
|
+
* full-screen lightbox is the same markup inside a native
|
|
119
|
+
* `<dialog class="ui-lightbox">` opened by `initDialog` (focus-trap/Escape
|
|
120
|
+
* come from the dialog). Emits `bronto:change` ({ detail: { index } }).
|
|
121
|
+
* SSR-safe, idempotent per carousel. Returns a cleanup function.
|
|
122
|
+
*/
|
|
123
|
+
export declare function initCarousel(opts?: DelegateOpts): Cleanup;
|
|
124
|
+
|
|
109
125
|
export interface ToastOpts {
|
|
110
126
|
/** Status tone — maps to `ui-toast--<tone>`. */
|
|
111
127
|
tone?: 'accent' | 'success' | 'warning' | 'danger' | 'info';
|
|
@@ -127,3 +143,14 @@ export interface ToastOpts {
|
|
|
127
143
|
* function that dismisses it early. No-op (returns noop) without a DOM.
|
|
128
144
|
*/
|
|
129
145
|
export declare function toast(message: string, opts?: ToastOpts): Cleanup;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Expand `[data-bronto-glyph="name"]` placeholders into a `.ui-dotmatrix`
|
|
149
|
+
* grid of cells — the DOM counterpart to `renderGlyph` from
|
|
150
|
+
* `@ponchia/ui/glyphs`. Decorative by default (`aria-hidden`); add
|
|
151
|
+
* `data-bronto-glyph-label` to expose it as `role="img"`. Unknown glyph names
|
|
152
|
+
* are left untouched. SSR-safe, idempotent (skips an already-expanded host).
|
|
153
|
+
* Returns a cleanup that removes the cells and restores the original
|
|
154
|
+
* attributes.
|
|
155
|
+
*/
|
|
156
|
+
export declare function initDotGlyph(opts?: DelegateOpts): Cleanup;
|