@ponchia/ui 0.3.6 → 0.4.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/CHANGELOG.md +1063 -0
- package/README.md +31 -14
- package/behaviors/index.d.ts +3 -1
- package/behaviors/index.js +179 -106
- package/classes/index.d.ts +41 -0
- package/classes/index.js +42 -0
- package/classes/vscode.css-custom-data.json +18 -22
- package/css/dataviz.css +96 -0
- package/css/disclosure.css +29 -0
- package/css/dots.css +32 -2
- package/css/feedback.css +53 -0
- package/css/motion.css +88 -0
- package/css/overlay.css +52 -1
- package/css/report.css +382 -0
- package/css/skins.css +54 -0
- package/css/tokens.css +56 -32
- package/dist/bronto.css +1 -1
- package/dist/css/dataviz.css +1 -0
- package/dist/css/disclosure.css +1 -1
- package/dist/css/dots.css +1 -1
- package/dist/css/feedback.css +1 -1
- package/dist/css/motion.css +1 -1
- package/dist/css/overlay.css +1 -1
- package/dist/css/report.css +1 -0
- package/dist/css/skins.css +1 -0
- package/dist/css/tokens.css +1 -1
- package/docs/adr/0001-color-system.md +271 -0
- package/docs/adr/0002-scope-and-2026-baseline.md +104 -0
- package/docs/adr/0003-theme-model.md +94 -0
- package/docs/contrast.md +170 -51
- package/docs/reference.md +118 -19
- package/docs/reporting.md +270 -0
- package/docs/stability.md +37 -0
- package/docs/theming.md +84 -7
- package/docs/usage.md +67 -8
- package/glyphs/glyphs.d.ts +14 -1
- package/glyphs/glyphs.js +143 -2
- package/llms.txt +101 -5
- package/package.json +79 -5
- package/qwik/index.d.ts +55 -0
- package/qwik/index.js +129 -0
- package/react/index.d.ts +57 -0
- package/react/index.js +84 -0
- package/solid/index.d.ts +57 -0
- package/solid/index.js +85 -0
- package/tokens/charts.d.ts +37 -0
- package/tokens/charts.js +96 -0
- package/tokens/charts.json +61 -0
- package/tokens/index.d.ts +3 -3
- package/tokens/index.js +16 -18
- package/tokens/index.json +32 -36
- package/tokens/resolved.json +39 -41
- package/tokens/skins.d.ts +27 -0
- package/tokens/skins.js +62 -0
- package/tokens/tokens.dtcg.json +22 -34
package/glyphs/glyphs.js
CHANGED
|
@@ -25,6 +25,96 @@ export const GLYPH_SIZE = 16;
|
|
|
25
25
|
// `.` off · `#` hot · `*` accent. Only `spark` uses accent dots — it is the
|
|
26
26
|
// canonical two-tone demo; the gate in check-glyphs.mjs enforces the shape.
|
|
27
27
|
const RAW = {
|
|
28
|
+
circle: [
|
|
29
|
+
'................',
|
|
30
|
+
'.....######.....',
|
|
31
|
+
'....########....',
|
|
32
|
+
'...###....###...',
|
|
33
|
+
'..##........##..',
|
|
34
|
+
'.###........###.',
|
|
35
|
+
'.##..........##.',
|
|
36
|
+
'.##..........##.',
|
|
37
|
+
'.##..........##.',
|
|
38
|
+
'.##..........##.',
|
|
39
|
+
'.###........###.',
|
|
40
|
+
'..##........##..',
|
|
41
|
+
'...###....###...',
|
|
42
|
+
'....########....',
|
|
43
|
+
'.....######.....',
|
|
44
|
+
'................',
|
|
45
|
+
],
|
|
46
|
+
'check-circle': [
|
|
47
|
+
'................',
|
|
48
|
+
'.....######.....',
|
|
49
|
+
'....########....',
|
|
50
|
+
'...###....###...',
|
|
51
|
+
'..##........##..',
|
|
52
|
+
'.###........###.',
|
|
53
|
+
'.##........####.',
|
|
54
|
+
'.##..##...##.##.',
|
|
55
|
+
'.##...##.##..##.',
|
|
56
|
+
'.##....###...##.',
|
|
57
|
+
'.###...##...###.',
|
|
58
|
+
'..##........##..',
|
|
59
|
+
'...###....###...',
|
|
60
|
+
'....########....',
|
|
61
|
+
'.....######.....',
|
|
62
|
+
'................',
|
|
63
|
+
],
|
|
64
|
+
'x-circle': [
|
|
65
|
+
'................',
|
|
66
|
+
'.....######.....',
|
|
67
|
+
'....########....',
|
|
68
|
+
'...###....###...',
|
|
69
|
+
'..##........##..',
|
|
70
|
+
'.###.##..##.###.',
|
|
71
|
+
'.##...####...##.',
|
|
72
|
+
'.##....##....##.',
|
|
73
|
+
'.##...####...##.',
|
|
74
|
+
'.##..##..##..##.',
|
|
75
|
+
'.#####....#####.',
|
|
76
|
+
'..##........##..',
|
|
77
|
+
'...###....###...',
|
|
78
|
+
'....########....',
|
|
79
|
+
'.....######.....',
|
|
80
|
+
'................',
|
|
81
|
+
],
|
|
82
|
+
'plus-circle': [
|
|
83
|
+
'................',
|
|
84
|
+
'.....######.....',
|
|
85
|
+
'....########....',
|
|
86
|
+
'...###....###...',
|
|
87
|
+
'..##........##..',
|
|
88
|
+
'.###...##...###.',
|
|
89
|
+
'.##....##....##.',
|
|
90
|
+
'.##..######..##.',
|
|
91
|
+
'.##..######..##.',
|
|
92
|
+
'.##....##....##.',
|
|
93
|
+
'.###...##...###.',
|
|
94
|
+
'..##........##..',
|
|
95
|
+
'...###....###...',
|
|
96
|
+
'....########....',
|
|
97
|
+
'.....######.....',
|
|
98
|
+
'................',
|
|
99
|
+
],
|
|
100
|
+
'minus-circle': [
|
|
101
|
+
'................',
|
|
102
|
+
'.....######.....',
|
|
103
|
+
'....########....',
|
|
104
|
+
'...###....###...',
|
|
105
|
+
'..##........##..',
|
|
106
|
+
'.###........###.',
|
|
107
|
+
'.##..........##.',
|
|
108
|
+
'.##..######..##.',
|
|
109
|
+
'.##..######..##.',
|
|
110
|
+
'.##..........##.',
|
|
111
|
+
'.###........###.',
|
|
112
|
+
'..##........##..',
|
|
113
|
+
'...###....###...',
|
|
114
|
+
'....########....',
|
|
115
|
+
'.....######.....',
|
|
116
|
+
'................',
|
|
117
|
+
],
|
|
28
118
|
'arrow-down': [
|
|
29
119
|
'................',
|
|
30
120
|
'......####......',
|
|
@@ -860,6 +950,40 @@ function cssLen(v) {
|
|
|
860
950
|
return /^[\w.%+\-*/()\s,]+$/.test(v) ? v : '';
|
|
861
951
|
}
|
|
862
952
|
|
|
953
|
+
/**
|
|
954
|
+
* Build a CSS `mask-image` `url()` of an inline SVG for a glyph's lit cells —
|
|
955
|
+
* the basis of the one-node `render: 'mask'` path. Horizontal runs are merged
|
|
956
|
+
* into single `<rect>`s (fewer nodes, no seams). The SVG is alpha-masked, so
|
|
957
|
+
* the element's `currentColor` background shows through only the lit cells —
|
|
958
|
+
* one DOM node instead of GLYPH_SIZE² (256), for an icon at any size/colour.
|
|
959
|
+
*/
|
|
960
|
+
function maskUrl(rows) {
|
|
961
|
+
let rects = '';
|
|
962
|
+
rows.forEach((row, y) => {
|
|
963
|
+
let run = 0;
|
|
964
|
+
for (let x = 0; x <= GLYPH_SIZE; x++) {
|
|
965
|
+
const on = x < GLYPH_SIZE && row[x] !== '.';
|
|
966
|
+
if (on) run++;
|
|
967
|
+
else if (run) {
|
|
968
|
+
rects += `<rect x='${x - run}' y='${y}' width='${run}' height='1'/>`;
|
|
969
|
+
run = 0;
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
});
|
|
973
|
+
// The url() lands unquoted inside an HTML `style="…"` attribute, so it must
|
|
974
|
+
// carry no spaces or quotes of its own — encode them (and `<>#`) so it stays
|
|
975
|
+
// a single CSS url-token and can't break out of the attribute.
|
|
976
|
+
const svg = `<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 ${GLYPH_SIZE} ${GLYPH_SIZE}'>${rects}</svg>`;
|
|
977
|
+
const enc = svg
|
|
978
|
+
.replace(/%/g, '%25')
|
|
979
|
+
.replace(/</g, '%3C')
|
|
980
|
+
.replace(/>/g, '%3E')
|
|
981
|
+
.replace(/#/g, '%23')
|
|
982
|
+
.replace(/'/g, '%27')
|
|
983
|
+
.replace(/ /g, '%20');
|
|
984
|
+
return `url(data:image/svg+xml,${enc})`;
|
|
985
|
+
}
|
|
986
|
+
|
|
863
987
|
/**
|
|
864
988
|
* A full `.ui-dotmatrix` HTML string for a glyph (`''` if the name is
|
|
865
989
|
* unknown). Decorative by default (`aria-hidden`); pass `label` to expose it
|
|
@@ -875,11 +999,28 @@ function cssLen(v) {
|
|
|
875
999
|
* `anim` opts into a decorative animation (disabled under reduced-motion;
|
|
876
1000
|
* the static frame + `label` still carry the meaning): `'reveal'` powers the
|
|
877
1001
|
* cells on in a scan, `'pulse'` makes the glyph breathe.
|
|
1002
|
+
*
|
|
1003
|
+
* `render: 'mask'` returns a single `.ui-icon` element masked by the glyph
|
|
1004
|
+
* bitmap (one DOM node, not GLYPH_SIZE²) — the icon-at-scale path: it sizes to
|
|
1005
|
+
* `size` (or `--icon-size` / `1em`) and inherits `currentColor`. The
|
|
1006
|
+
* cell-mode options (grid/solid/anim/dot/gap) don't apply; `label` does.
|
|
1007
|
+
* Needs `@ponchia/ui/css` (the `.ui-icon` rule).
|
|
878
1008
|
*/
|
|
879
1009
|
export function renderGlyph(name, options = {}) {
|
|
1010
|
+
const rows = GLYPHS[name];
|
|
1011
|
+
if (!rows) return '';
|
|
1012
|
+
const { grid = true, solid = false, anim, label, dot, gap, render, size } = options;
|
|
1013
|
+
|
|
1014
|
+
// One-node icon: a single `.ui-icon` span masked by the glyph's bitmap, so
|
|
1015
|
+
// it scales to any font-size and inherits `currentColor` — for icon-at-scale
|
|
1016
|
+
// (e.g. one in every table row) where the GLYPH_SIZE²-cell path is too heavy.
|
|
1017
|
+
if (render === 'mask') {
|
|
1018
|
+
const a11yM = label ? `role="img" aria-label="${esc(label)}"` : 'aria-hidden="true"';
|
|
1019
|
+
const sz = size && cssLen(size) ? `--icon-size:${cssLen(size)};` : '';
|
|
1020
|
+
return `<span class="ui-icon" style="${sz}--icon-mask:${maskUrl(rows)}" ${a11yM}></span>`;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
880
1023
|
const cells = glyphCells(name);
|
|
881
|
-
if (!cells.length) return '';
|
|
882
|
-
const { grid = true, solid = false, anim, label, dot, gap } = options;
|
|
883
1024
|
|
|
884
1025
|
const style = [`--dotmatrix-cols:${GLYPH_SIZE}`];
|
|
885
1026
|
const dotLen = dot && cssLen(dot);
|
package/llms.txt
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
> CSS-first, framework-agnostic UI framework. Zero runtime dependencies.
|
|
4
4
|
> One `@layer bronto` cascade, a typed class vocabulary, design tokens as
|
|
5
|
-
> data, and optional SSR-safe vanilla behaviors.
|
|
6
|
-
> monochrome
|
|
5
|
+
> data, and optional SSR-safe vanilla behaviors. Token-driven restraint:
|
|
6
|
+
> monochrome by default, one rationed accent, dot-matrix display type, with
|
|
7
|
+
> opt-in colorways + a colourblind-safe data-viz palette layered on top.
|
|
7
8
|
>
|
|
8
9
|
> This file orients an LLM/agent. The authoritative, always-correct API
|
|
9
10
|
> is the TypeScript declarations shipped in this package (paths below):
|
|
@@ -19,6 +20,12 @@ CSS (pick one; do not import both):
|
|
|
19
20
|
@import '@ponchia/ui/css'; /* css/core.css — @import fan-out, needs a bundler */
|
|
20
21
|
```
|
|
21
22
|
|
|
23
|
+
`import '@ponchia/ui'` is supported only as a CSS side-effect import in a
|
|
24
|
+
CSS-aware bundler. Do not import the package root from Node/runtime JS; use the
|
|
25
|
+
explicit JS subpaths below.
|
|
26
|
+
|
|
27
|
+
JS subpaths are ESM-only. In CommonJS, use dynamic `import()`.
|
|
28
|
+
|
|
22
29
|
Everything lands in `@layer bronto`. Consumer styles in no layer (or a
|
|
23
30
|
later layer) always win over framework styles regardless of selector
|
|
24
31
|
specificity — this is the intended override mechanism; do not fight it
|
|
@@ -45,6 +52,15 @@ Optional vanilla behaviors (theme toggle, etc. — SSR-safe, tree-shakeable):
|
|
|
45
52
|
import { applyStoredTheme } from '@ponchia/ui/behaviors';
|
|
46
53
|
```
|
|
47
54
|
|
|
55
|
+
For React/Solid/Qwik, optional thin hook bindings over those behaviors (peer
|
|
56
|
+
deps `react` / `solid-js` / `@builder.io/qwik`, optional — core stays zero-dep):
|
|
57
|
+
|
|
58
|
+
```js
|
|
59
|
+
import { useDialog, useToast } from '@ponchia/ui/react'; // or '@ponchia/ui/solid' or '@ponchia/ui/qwik'
|
|
60
|
+
// React: scope with { root: reactRef } or a resolver, not { root: ref.current } during render.
|
|
61
|
+
// Qwik: hooks run in useVisibleTask$; scope with a Qwik signal — useDialog({ root: useSignal() }).
|
|
62
|
+
```
|
|
63
|
+
|
|
48
64
|
Optional display glyphs — dot-matrix bitmaps on the `.ui-dotmatrix` primitive
|
|
49
65
|
(decorative by default; `renderGlyph` is SSR-safe, `initDotGlyph` is the DOM form):
|
|
50
66
|
|
|
@@ -53,6 +69,75 @@ import { renderGlyph, GLYPH_NAMES } from '@ponchia/ui/glyphs';
|
|
|
53
69
|
el.innerHTML = renderGlyph('check', { label: 'Done' });
|
|
54
70
|
```
|
|
55
71
|
|
|
72
|
+
Optional display colorways — opt-in, never in the default bundle. Root-level,
|
|
73
|
+
like `data-theme` (the derived accent family only recomputes at `:root`):
|
|
74
|
+
|
|
75
|
+
```html
|
|
76
|
+
<link rel="stylesheet" href="@ponchia/ui/css/skins.css" />
|
|
77
|
+
<html data-bronto-skin="amber-crt | phosphor-green | e-ink">
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Each re-points the one `--accent` (OKLCH, per-theme, contrast-gated); status
|
|
81
|
+
colours and the neutral canvas are untouched. Details in `docs/theming.md`.
|
|
82
|
+
|
|
83
|
+
Optional data-viz palette for dashboards — opt-in, charts-only (never UI
|
|
84
|
+
chrome), never in the default bundle:
|
|
85
|
+
|
|
86
|
+
```html
|
|
87
|
+
<link rel="stylesheet" href="@ponchia/ui/css/dataviz.css" />
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
```js
|
|
91
|
+
import charts from '@ponchia/ui/charts.json' with { type: 'json' };
|
|
92
|
+
// charts.dark.categorical → ['#ff3b41', …] (series 0 = the resolved accent)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
`--chart-1..8` (categorical; series 1 = accent; colourblind-safe, gated under
|
|
96
|
+
simulated protan/deutan/tritan), `--chart-seq-*` (sequential), `--chart-div-*`
|
|
97
|
+
(diverging), and `--chart-pattern-1..8` (dot-matrix fills — pair colour N with
|
|
98
|
+
pattern N; colour is never the sole signal). Details in `docs/theming.md`.
|
|
99
|
+
|
|
100
|
+
Optional static report layer for LLM-authored HTML reports — opt-in, never in
|
|
101
|
+
the default bundle. Pair it with the normal bundle, and add data-viz only when
|
|
102
|
+
the report contains charts. For standalone browser HTML, use real URLs; package
|
|
103
|
+
specifiers only work after a bundler rewrites them:
|
|
104
|
+
|
|
105
|
+
```html
|
|
106
|
+
<link rel="stylesheet" href="./node_modules/@ponchia/ui/dist/bronto.css" />
|
|
107
|
+
<link rel="stylesheet" href="./node_modules/@ponchia/ui/dist/css/report.css" />
|
|
108
|
+
<link rel="stylesheet" href="./node_modules/@ponchia/ui/dist/css/dataviz.css" />
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
In Vite/webpack/etc., import `@ponchia/ui`, `@ponchia/ui/css/report.css`, and
|
|
112
|
+
`@ponchia/ui/css/dataviz.css` instead.
|
|
113
|
+
|
|
114
|
+
Canonical report skeleton:
|
|
115
|
+
|
|
116
|
+
```html
|
|
117
|
+
<main class="ui-report ui-report--numbered">
|
|
118
|
+
<header class="ui-report__cover">
|
|
119
|
+
<p class="ui-eyebrow">Report</p>
|
|
120
|
+
<h1 class="ui-report__title">System review</h1>
|
|
121
|
+
<p class="ui-report__subtitle">Static HTML, Chromium PDF-ready.</p>
|
|
122
|
+
<ol class="ui-report__meta"><li>2026-06-01</li><li>Generated</li></ol>
|
|
123
|
+
</header>
|
|
124
|
+
<section class="ui-report__section">
|
|
125
|
+
<h2 class="ui-report__section-head">Executive summary</h2>
|
|
126
|
+
<div class="ui-report__summary">
|
|
127
|
+
<div class="ui-prose"><p>Use prose only for narrative body content.</p></div>
|
|
128
|
+
</div>
|
|
129
|
+
</section>
|
|
130
|
+
</main>
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Report rules for agents: static output by default; do not initialize behaviors
|
|
134
|
+
over untrusted generated content; sanitize arbitrary LLM/CMS/user HTML before
|
|
135
|
+
rendering; use semantic headings; give tables captions and header cells; give
|
|
136
|
+
charts captions, legends/direct labels, and fallback data; use
|
|
137
|
+
`ui-chart__plot`/`ui-chart__bar`/`ui-chart__fill` for simple static bar charts;
|
|
138
|
+
use `ui-report__section--unnumbered` for appendices in numbered reports; never
|
|
139
|
+
use raw chromatic inline colors. Full cookbook: `docs/reporting.md`.
|
|
140
|
+
|
|
56
141
|
## Authoritative offline references (shipped in this package)
|
|
57
142
|
|
|
58
143
|
Read these from `node_modules/@ponchia/ui/` — no network needed:
|
|
@@ -65,9 +150,14 @@ Read these from `node_modules/@ponchia/ui/` — no network needed:
|
|
|
65
150
|
the same source as the types and CI-drift-checked.
|
|
66
151
|
- `docs/theming.md` — the token contract: which tokens to override, the
|
|
67
152
|
light/dark model, and the rationed-accent rule.
|
|
153
|
+
- `docs/stability.md` — the public API matrix: stable vs internal surfaces,
|
|
154
|
+
root-import contract, behavior trust boundary, and glyph-mask CSP note.
|
|
68
155
|
- `docs/usage.md` — the decision guide: badge vs chip vs dot, default
|
|
69
156
|
density, prose-in-card, when to add a behavior. Read this before
|
|
70
157
|
re-implementing UI the framework already has an opinion about.
|
|
158
|
+
- `docs/reporting.md` — static/PDF-first report cookbook for LLM-authored
|
|
159
|
+
reports, including report skeletons, chart rules, print utilities, and safety
|
|
160
|
+
boundaries.
|
|
71
161
|
- `docs/contrast.md` — the published, CI-gated WCAG 2.1 contrast matrix
|
|
72
162
|
for every contractual token pairing, per theme. Generated from the
|
|
73
163
|
resolved palette; the build fails below the declared floor.
|
|
@@ -87,7 +177,7 @@ Read these from `node_modules/@ponchia/ui/` — no network needed:
|
|
|
87
177
|
|
|
88
178
|
- Live kitchen-sink demo (every component, light/dark, RTL): https://ponchia.github.io/bronto-ui/
|
|
89
179
|
- Architecture & the CSS-first decision: https://github.com/Ponchia/bronto-ui/blob/main/docs/architecture.md
|
|
90
|
-
- Framework integration guides (Astro / SvelteKit / React-Solid / vanilla):
|
|
180
|
+
- Framework integration guides (Astro / SvelteKit / React-Solid-Qwik / vanilla):
|
|
91
181
|
https://github.com/Ponchia/bronto-ui/tree/main/docs/getting-started
|
|
92
182
|
|
|
93
183
|
## Rules an agent should respect
|
|
@@ -95,8 +185,14 @@ Read these from `node_modules/@ponchia/ui/` — no network needed:
|
|
|
95
185
|
- Never invent `ui-*` class names. Every valid class is a member of
|
|
96
186
|
`cls` in `classes/index.d.ts`; if it is not there, it does not exist.
|
|
97
187
|
- Prefer the `ui.*()` recipes over hand-concatenating modifier strings.
|
|
188
|
+
Report/layout classes added in 0.4.1 are the exception: use `cls.report*`,
|
|
189
|
+
`cls.chart*`, `cls.printOnly`, or literal documented class names because
|
|
190
|
+
there are no `ui.report()` / `ui.chart()` recipes yet.
|
|
98
191
|
- Override framework styles by writing your own rules outside
|
|
99
192
|
`@layer bronto` — not with higher specificity or `!important`.
|
|
100
|
-
-
|
|
101
|
-
|
|
193
|
+
- Color is tiered (ADR-0001): neutral canvas · one rationed accent · locked
|
|
194
|
+
status · display expression · opt-in data-viz. Theme via the documented
|
|
195
|
+
tokens — re-point `--accent` (or a `data-bronto-skin` colorway), use status
|
|
196
|
+
tokens for status, and `--chart-*` (from `css/dataviz.css`) for charts only.
|
|
197
|
+
Don't add raw hues to components; `check:color-policy` enforces this.
|
|
102
198
|
- Pre-1.0 SemVer: breaking changes ship in the *minor*. Pin `~0.x`.
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ponchia/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "CSS-first, framework-agnostic UI framework — token-driven restraint (monochrome by default, one rationed accent), OKLCH colorways, a dot-matrix icon set, a colourblind-safe data-viz palette, dot-matrix motifs, zero runtime dependencies.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"css",
|
|
8
8
|
"ui",
|
|
@@ -13,6 +13,11 @@
|
|
|
13
13
|
"css-layers",
|
|
14
14
|
"nothing",
|
|
15
15
|
"monochrome",
|
|
16
|
+
"oklch",
|
|
17
|
+
"colorways",
|
|
18
|
+
"icons",
|
|
19
|
+
"data-visualization",
|
|
20
|
+
"wcag",
|
|
16
21
|
"framework-agnostic",
|
|
17
22
|
"zero-dependencies",
|
|
18
23
|
"dark-mode",
|
|
@@ -41,12 +46,21 @@
|
|
|
41
46
|
"classes",
|
|
42
47
|
"behaviors",
|
|
43
48
|
"glyphs",
|
|
49
|
+
"react",
|
|
50
|
+
"solid",
|
|
51
|
+
"qwik",
|
|
44
52
|
"shiki",
|
|
45
53
|
"llms.txt",
|
|
54
|
+
"CHANGELOG.md",
|
|
46
55
|
"docs/reference.md",
|
|
47
56
|
"docs/theming.md",
|
|
48
57
|
"docs/contrast.md",
|
|
49
|
-
"docs/
|
|
58
|
+
"docs/stability.md",
|
|
59
|
+
"docs/usage.md",
|
|
60
|
+
"docs/reporting.md",
|
|
61
|
+
"docs/adr/0001-color-system.md",
|
|
62
|
+
"docs/adr/0002-scope-and-2026-baseline.md",
|
|
63
|
+
"docs/adr/0003-theme-model.md"
|
|
50
64
|
],
|
|
51
65
|
"style": "./dist/bronto.css",
|
|
52
66
|
"scripts": {
|
|
@@ -54,11 +68,14 @@
|
|
|
54
68
|
"lint:fix": "stylelint \"css/**/*.css\" --fix",
|
|
55
69
|
"format": "prettier --write .",
|
|
56
70
|
"check:format": "prettier --check .",
|
|
71
|
+
"size:report": "node scripts/size-report.mjs",
|
|
57
72
|
"tokens:build": "node scripts/gen-tokens-json.mjs",
|
|
58
73
|
"dtcg:build": "node scripts/gen-dtcg.mjs",
|
|
59
74
|
"resolved:build": "node scripts/gen-resolved.mjs",
|
|
60
75
|
"dts:build": "node scripts/gen-dts.mjs",
|
|
61
76
|
"glyphs:build": "node scripts/gen-glyphs.mjs",
|
|
77
|
+
"skins:build": "node scripts/gen-skins.mjs",
|
|
78
|
+
"charts:build": "node scripts/gen-charts.mjs",
|
|
62
79
|
"reference:build": "node scripts/gen-reference.mjs",
|
|
63
80
|
"contrast:build": "node scripts/gen-contrast.mjs",
|
|
64
81
|
"vscode:build": "node scripts/gen-vscode-data.mjs",
|
|
@@ -68,7 +85,12 @@
|
|
|
68
85
|
"check:classes": "node scripts/check-classes.mjs",
|
|
69
86
|
"check:dts": "node scripts/check-dts.mjs",
|
|
70
87
|
"check:behaviors": "node scripts/check-behaviors.mjs",
|
|
88
|
+
"check:bindings": "node scripts/check-bindings.mjs",
|
|
71
89
|
"check:glyphs": "node scripts/check-glyphs.mjs",
|
|
90
|
+
"check:color-policy": "node scripts/check-color-policy.mjs",
|
|
91
|
+
"check:skins": "node scripts/check-skins.mjs",
|
|
92
|
+
"check:charts": "node scripts/check-charts.mjs",
|
|
93
|
+
"check:report": "node scripts/check-report.mjs",
|
|
72
94
|
"check:types": "tsc -p tsconfig.json",
|
|
73
95
|
"check:dtcg": "node scripts/check-dtcg.mjs",
|
|
74
96
|
"check:resolved": "node scripts/check-resolved.mjs",
|
|
@@ -79,21 +101,41 @@
|
|
|
79
101
|
"check:reference": "node scripts/check-reference.mjs",
|
|
80
102
|
"check:contrast": "node scripts/check-contrast.mjs",
|
|
81
103
|
"check:vscode": "node scripts/check-vscode-data.mjs",
|
|
82
|
-
"check": "npm run lint && npm run check:format && npm run check:exports && npm run check:tokens && npm run check:classes && npm run check:dts && npm run check:types && npm run check:dtcg && npm run check:resolved && npm run check:shiki && npm run check:dist && npm run check:pack && npm run check:release && npm run check:reference && npm run check:contrast && npm run check:vscode && npm run check:behaviors && npm run check:glyphs",
|
|
104
|
+
"check": "npm run lint && npm run check:format && npm run check:exports && npm run check:tokens && npm run check:classes && npm run check:dts && npm run check:types && npm run check:dtcg && npm run check:resolved && npm run check:shiki && npm run check:dist && npm run check:pack && npm run check:release && npm run check:reference && npm run check:contrast && npm run check:vscode && npm run check:behaviors && npm run check:bindings && npm run check:glyphs && npm run check:color-policy && npm run check:skins && npm run check:charts && npm run check:report",
|
|
83
105
|
"test": "node --test \"test/*.test.mjs\"",
|
|
84
|
-
"prepack": "npm run tokens:build && npm run dtcg:build && npm run resolved:build && npm run dts:build && npm run reference:build && npm run contrast:build && npm run vscode:build && npm run dist:build && npm run glyphs:build",
|
|
106
|
+
"prepack": "npm run tokens:build && npm run dtcg:build && npm run resolved:build && npm run dts:build && npm run reference:build && npm run contrast:build && npm run vscode:build && npm run skins:build && npm run charts:build && npm run dist:build && npm run glyphs:build",
|
|
85
107
|
"prepublishOnly": "npm run check && npm test"
|
|
86
108
|
},
|
|
87
109
|
"devDependencies": {
|
|
88
110
|
"@axe-core/playwright": "^4.11.3",
|
|
111
|
+
"@builder.io/qwik": "^1.20.0",
|
|
89
112
|
"@playwright/test": "^1.60.0",
|
|
90
113
|
"jsdom": "^29.1.1",
|
|
91
114
|
"prettier": "^3.8.3",
|
|
115
|
+
"react": "^19.2.6",
|
|
116
|
+
"react-dom": "^19.2.6",
|
|
117
|
+
"solid-js": "^1.9.13",
|
|
92
118
|
"stylelint": "^17.11.1",
|
|
93
119
|
"stylelint-config-standard": "^40.0.0",
|
|
94
120
|
"stylelint-use-logical": "^2.1.3",
|
|
95
121
|
"typescript": "^6.0.3"
|
|
96
122
|
},
|
|
123
|
+
"peerDependencies": {
|
|
124
|
+
"@builder.io/qwik": ">=1.5",
|
|
125
|
+
"react": ">=18",
|
|
126
|
+
"solid-js": ">=1.6"
|
|
127
|
+
},
|
|
128
|
+
"peerDependenciesMeta": {
|
|
129
|
+
"@builder.io/qwik": {
|
|
130
|
+
"optional": true
|
|
131
|
+
},
|
|
132
|
+
"react": {
|
|
133
|
+
"optional": true
|
|
134
|
+
},
|
|
135
|
+
"solid-js": {
|
|
136
|
+
"optional": true
|
|
137
|
+
}
|
|
138
|
+
},
|
|
97
139
|
"exports": {
|
|
98
140
|
".": {
|
|
99
141
|
"style": "./dist/bronto.css",
|
|
@@ -117,6 +159,9 @@
|
|
|
117
159
|
"./css/disclosure.css": "./dist/css/disclosure.css",
|
|
118
160
|
"./css/table.css": "./dist/css/table.css",
|
|
119
161
|
"./css/app.css": "./dist/css/app.css",
|
|
162
|
+
"./css/skins.css": "./dist/css/skins.css",
|
|
163
|
+
"./css/dataviz.css": "./dist/css/dataviz.css",
|
|
164
|
+
"./css/report.css": "./dist/css/report.css",
|
|
120
165
|
"./css/unlayered/tokens.css": "./css/tokens.css",
|
|
121
166
|
"./css/unlayered/fonts.css": "./css/fonts.css",
|
|
122
167
|
"./css/unlayered/base.css": "./css/base.css",
|
|
@@ -132,6 +177,9 @@
|
|
|
132
177
|
"./css/unlayered/disclosure.css": "./css/disclosure.css",
|
|
133
178
|
"./css/unlayered/table.css": "./css/table.css",
|
|
134
179
|
"./css/unlayered/app.css": "./css/app.css",
|
|
180
|
+
"./css/unlayered/skins.css": "./css/skins.css",
|
|
181
|
+
"./css/unlayered/dataviz.css": "./css/dataviz.css",
|
|
182
|
+
"./css/unlayered/report.css": "./css/report.css",
|
|
135
183
|
"./tokens": {
|
|
136
184
|
"types": "./tokens/index.d.ts",
|
|
137
185
|
"default": "./tokens/index.js"
|
|
@@ -145,7 +193,12 @@
|
|
|
145
193
|
"./docs/reference.md": "./docs/reference.md",
|
|
146
194
|
"./docs/theming.md": "./docs/theming.md",
|
|
147
195
|
"./docs/contrast.md": "./docs/contrast.md",
|
|
196
|
+
"./docs/stability.md": "./docs/stability.md",
|
|
148
197
|
"./docs/usage.md": "./docs/usage.md",
|
|
198
|
+
"./docs/reporting.md": "./docs/reporting.md",
|
|
199
|
+
"./docs/adr/0001-color-system.md": "./docs/adr/0001-color-system.md",
|
|
200
|
+
"./docs/adr/0002-scope-and-2026-baseline.md": "./docs/adr/0002-scope-and-2026-baseline.md",
|
|
201
|
+
"./docs/adr/0003-theme-model.md": "./docs/adr/0003-theme-model.md",
|
|
149
202
|
"./classes": {
|
|
150
203
|
"types": "./classes/index.d.ts",
|
|
151
204
|
"default": "./classes/index.js"
|
|
@@ -158,6 +211,27 @@
|
|
|
158
211
|
"types": "./glyphs/glyphs.d.ts",
|
|
159
212
|
"default": "./glyphs/glyphs.js"
|
|
160
213
|
},
|
|
214
|
+
"./react": {
|
|
215
|
+
"types": "./react/index.d.ts",
|
|
216
|
+
"default": "./react/index.js"
|
|
217
|
+
},
|
|
218
|
+
"./solid": {
|
|
219
|
+
"types": "./solid/index.d.ts",
|
|
220
|
+
"default": "./solid/index.js"
|
|
221
|
+
},
|
|
222
|
+
"./qwik": {
|
|
223
|
+
"types": "./qwik/index.d.ts",
|
|
224
|
+
"default": "./qwik/index.js"
|
|
225
|
+
},
|
|
226
|
+
"./skins": {
|
|
227
|
+
"types": "./tokens/skins.d.ts",
|
|
228
|
+
"default": "./tokens/skins.js"
|
|
229
|
+
},
|
|
230
|
+
"./charts": {
|
|
231
|
+
"types": "./tokens/charts.d.ts",
|
|
232
|
+
"default": "./tokens/charts.js"
|
|
233
|
+
},
|
|
234
|
+
"./charts.json": "./tokens/charts.json",
|
|
161
235
|
"./fonts/*": "./fonts/*"
|
|
162
236
|
}
|
|
163
237
|
}
|
package/qwik/index.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/** @ponchia/ui/qwik — thin Qwik bindings over the SSR-safe behaviors.
|
|
2
|
+
* Optional peer dep `@builder.io/qwik`. Hooks run a delegated behavior on
|
|
3
|
+
* visible and register cleanup on dispose (via `useVisibleTask$`); they take
|
|
4
|
+
* the same options as the behavior and return void. See behaviors/index.d.ts. */
|
|
5
|
+
import type { Cleanup, DelegateOpts, ThemeStorageOpts, ToastOpts } from '../behaviors/index.js';
|
|
6
|
+
|
|
7
|
+
export type BrontoBindingRoot =
|
|
8
|
+
| Document
|
|
9
|
+
| Element
|
|
10
|
+
// Qwik `useSignal()` (and any { value } / { current } ref shape).
|
|
11
|
+
| { value: Document | Element | null | undefined }
|
|
12
|
+
| { current: Document | Element | null | undefined }
|
|
13
|
+
| (() => Document | Element | null | undefined)
|
|
14
|
+
| null
|
|
15
|
+
| undefined;
|
|
16
|
+
|
|
17
|
+
export type BrontoBindingOpts<T extends DelegateOpts = DelegateOpts> = Omit<T, 'root'> & {
|
|
18
|
+
root?: BrontoBindingRoot;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type BrontoBindingOptsResolver<T extends DelegateOpts = DelegateOpts> =
|
|
22
|
+
| BrontoBindingOpts<T>
|
|
23
|
+
| (() => BrontoBindingOpts<T> | null | undefined)
|
|
24
|
+
| null
|
|
25
|
+
| undefined;
|
|
26
|
+
|
|
27
|
+
/** Run any delegated behavior for the component's lifetime (init on visible,
|
|
28
|
+
* its returned cleanup on dispose). Prefer the specific `use*` hooks in Qwik
|
|
29
|
+
* so the optimizer can serialize the task; this generic form is safe only with
|
|
30
|
+
* an optimizer-visible (module-imported) behavior. */
|
|
31
|
+
export declare function useBrontoBehavior(
|
|
32
|
+
init: (opts?: DelegateOpts) => Cleanup | void,
|
|
33
|
+
opts?: BrontoBindingOptsResolver,
|
|
34
|
+
): void;
|
|
35
|
+
|
|
36
|
+
export declare function useThemeToggle(
|
|
37
|
+
opts?: BrontoBindingOptsResolver<ThemeStorageOpts & DelegateOpts>,
|
|
38
|
+
): void;
|
|
39
|
+
export declare function useDismissible(opts?: BrontoBindingOptsResolver): void;
|
|
40
|
+
export declare function useDisclosure(opts?: BrontoBindingOptsResolver): void;
|
|
41
|
+
export declare function useMenu(opts?: BrontoBindingOptsResolver): void;
|
|
42
|
+
export declare function useFormValidation(opts?: BrontoBindingOptsResolver): void;
|
|
43
|
+
export declare function useCombobox(opts?: BrontoBindingOptsResolver): void;
|
|
44
|
+
export declare function usePopover(opts?: BrontoBindingOptsResolver): void;
|
|
45
|
+
export declare function useTableSort(opts?: BrontoBindingOptsResolver): void;
|
|
46
|
+
export declare function useTabs(opts?: BrontoBindingOptsResolver): void;
|
|
47
|
+
export declare function useDialog(opts?: BrontoBindingOptsResolver): void;
|
|
48
|
+
export declare function useCarousel(opts?: BrontoBindingOptsResolver): void;
|
|
49
|
+
export declare function useDotGlyph(opts?: BrontoBindingOptsResolver): void;
|
|
50
|
+
|
|
51
|
+
/** The `toast()` imperative (no lifecycle of its own). */
|
|
52
|
+
export declare function useToast(): (message: string, opts?: ToastOpts) => Cleanup;
|
|
53
|
+
|
|
54
|
+
export { applyStoredTheme } from '../behaviors/index.js';
|
|
55
|
+
export { cls, ui, cx } from '../classes/index.js';
|