@ponchia/ui 0.6.7 → 0.6.9
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 +129 -4
- package/README.md +4 -4
- package/annotations/index.d.ts.map +1 -1
- package/annotations/index.js +26 -9
- package/behaviors/carousel.d.ts.map +1 -1
- package/behaviors/carousel.js +145 -49
- package/behaviors/combobox.d.ts.map +1 -1
- package/behaviors/combobox.js +220 -92
- package/behaviors/command.d.ts.map +1 -1
- package/behaviors/command.js +74 -14
- package/behaviors/connectors.d.ts.map +1 -1
- package/behaviors/connectors.js +131 -32
- package/behaviors/crosshair.d.ts.map +1 -1
- package/behaviors/crosshair.js +47 -1
- package/behaviors/dialog.d.ts.map +1 -1
- package/behaviors/dialog.js +24 -9
- package/behaviors/disclosure.d.ts.map +1 -1
- package/behaviors/disclosure.js +33 -3
- package/behaviors/dismissible.d.ts.map +1 -1
- package/behaviors/dismissible.js +3 -2
- package/behaviors/forms.d.ts.map +1 -1
- package/behaviors/forms.js +211 -140
- package/behaviors/glyph.d.ts.map +1 -1
- package/behaviors/glyph.js +172 -132
- package/behaviors/inert.d.ts +1 -1
- package/behaviors/inert.d.ts.map +1 -1
- package/behaviors/inert.js +4 -3
- package/behaviors/internal.d.ts.map +1 -1
- package/behaviors/internal.js +4 -3
- package/behaviors/legend.d.ts +0 -5
- package/behaviors/legend.d.ts.map +1 -1
- package/behaviors/legend.js +45 -13
- package/behaviors/menu.d.ts.map +1 -1
- package/behaviors/menu.js +13 -8
- package/behaviors/modal.d.ts.map +1 -1
- package/behaviors/modal.js +77 -19
- package/behaviors/popover.d.ts +4 -3
- package/behaviors/popover.d.ts.map +1 -1
- package/behaviors/popover.js +94 -14
- package/behaviors/sources.d.ts.map +1 -1
- package/behaviors/sources.js +14 -2
- package/behaviors/splitter.d.ts.map +1 -1
- package/behaviors/splitter.js +149 -110
- package/behaviors/spotlight.d.ts.map +1 -1
- package/behaviors/spotlight.js +28 -2
- package/behaviors/table.d.ts +1 -1
- package/behaviors/table.d.ts.map +1 -1
- package/behaviors/table.js +108 -17
- package/behaviors/tabs.d.ts.map +1 -1
- package/behaviors/tabs.js +84 -20
- package/behaviors/theme.d.ts.map +1 -1
- package/behaviors/theme.js +25 -5
- package/behaviors/toast.js +5 -5
- package/classes/index.d.ts +15 -2
- package/classes/index.js +48 -35
- package/connectors/index.d.ts +41 -8
- package/connectors/index.d.ts.map +1 -1
- package/connectors/index.js +74 -19
- package/css/annotations.css +12 -0
- package/css/app.css +3 -4
- package/css/base.css +1 -1
- package/css/content.css +3 -3
- package/css/crosshair.css +27 -2
- package/css/disclosure.css +3 -3
- package/css/dots.css +4 -4
- package/css/feedback.css +8 -37
- package/css/forms.css +9 -12
- package/css/legend.css +1 -1
- package/css/marks.css +1 -1
- package/css/motion.css +6 -6
- package/css/navigation.css +12 -0
- package/css/overlay.css +5 -7
- package/css/primitives.css +14 -16
- package/css/sidenote.css +2 -2
- package/css/table.css +2 -2
- package/css/tokens.css +16 -0
- package/dist/bronto.css +1 -1
- package/dist/css/analytical.css +1 -1
- package/dist/css/annotations.css +1 -1
- package/dist/css/crosshair.css +1 -1
- package/dist/css/feedback.css +1 -1
- package/dist/css/navigation.css +1 -1
- package/dist/css/report-kit.css +1 -1
- package/dist/css/tokens.css +1 -1
- package/docs/adr/0001-color-system.md +3 -2
- package/docs/annotations.md +21 -1
- package/docs/architecture.md +74 -13
- package/docs/command.md +4 -1
- package/docs/connectors.md +16 -0
- package/docs/crosshair.md +1 -1
- package/docs/dots.md +4 -1
- package/docs/glyphs.md +11 -0
- package/docs/interop/react-flow.md +89 -0
- package/docs/migrations/0.2-to-0.3.md +1 -1
- package/docs/package-contract.md +7 -5
- package/docs/reporting.md +23 -12
- package/docs/stability.md +85 -9
- package/docs/theming.md +2 -2
- package/docs/usage.md +16 -2
- package/docs/vega.md +4 -4
- package/glyphs/glyphs.js +43 -33
- package/llms.txt +19 -8
- package/package.json +23 -4
- package/schemas/report-claims.v1.schema.json +1 -1
- package/svelte/index.d.ts +71 -45
- package/svelte/index.d.ts.map +1 -1
- package/svelte/index.js +29 -2
- package/tokens/index.js +2 -2
- package/vue/index.d.ts +42 -5
- package/vue/index.d.ts.map +1 -1
- package/vue/index.js +32 -1
package/glyphs/glyphs.js
CHANGED
|
@@ -1518,17 +1518,34 @@ export function renderGlyph(name, options = {}) {
|
|
|
1518
1518
|
if (!rows) return '';
|
|
1519
1519
|
const { grid = true, solid = false, anim, label, dot, gap, render, size } = options;
|
|
1520
1520
|
|
|
1521
|
+
if (render === 'mask') return renderMaskGlyph(rows, { label, size });
|
|
1522
|
+
|
|
1523
|
+
const cells = glyphCells(name);
|
|
1524
|
+
const style = dotmatrixStyle({ solid, dot, gap });
|
|
1525
|
+
const cls = dotmatrixClass(anim);
|
|
1526
|
+
const stagger = anim === 'reveal';
|
|
1527
|
+
const showPanel = grid && !solid;
|
|
1528
|
+
const inner = cells
|
|
1529
|
+
.map((cell, index) => renderGlyphCell(cell, index, { showPanel, stagger }))
|
|
1530
|
+
.join('');
|
|
1531
|
+
|
|
1532
|
+
// A `<span>` (not `<div>`): it's phrasing content, so the glyph is valid
|
|
1533
|
+
// inline and inside a `<button>` (its content model is phrasing-only) — the
|
|
1534
|
+
// inline-icon use. `.ui-dotmatrix`'s `display: grid` works on a span.
|
|
1535
|
+
return `<span class="${cls}" style="${style.join(';')}" ${a11yAttrs(label)}>${inner}</span>`;
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
function renderMaskGlyph(rows, { label, size }) {
|
|
1521
1539
|
// One-node icon: a single `.ui-icon` span masked by the glyph's bitmap, so
|
|
1522
1540
|
// it scales to any font-size and inherits `currentColor` — for icon-at-scale
|
|
1523
1541
|
// (e.g. one in every table row) where the GLYPH_SIZE²-cell path is too heavy.
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
const cells = glyphCells(name);
|
|
1542
|
+
const iconSize = size && cssLen(size) ? `--icon-size:${cssLen(size)};` : '';
|
|
1543
|
+
return `<span class="ui-icon" style="${iconSize}--icon-mask:${maskUrl(rows)}" ${a11yAttrs(
|
|
1544
|
+
label,
|
|
1545
|
+
)}></span>`;
|
|
1546
|
+
}
|
|
1531
1547
|
|
|
1548
|
+
function dotmatrixStyle({ solid, dot, gap }) {
|
|
1532
1549
|
const style = [`--dotmatrix-cols:${GLYPH_SIZE}`];
|
|
1533
1550
|
const dotLen = dot && cssLen(dot);
|
|
1534
1551
|
const gapLen = gap && cssLen(gap);
|
|
@@ -1537,42 +1554,35 @@ export function renderGlyph(name, options = {}) {
|
|
|
1537
1554
|
// `minmax(0, 1fr)` and the 16×16 matrix balloons to fill its container
|
|
1538
1555
|
// (full-bleed, ~1250px) — the string API would then render an icon-intent call
|
|
1539
1556
|
// very differently from the DOM `initDotGlyph` path, which already defaults to
|
|
1540
|
-
// 0.08em. Mirror that default here so both paths render the same icon.
|
|
1557
|
+
// 0.08em. Mirror that default here so both paths render the same icon.
|
|
1541
1558
|
style.push(`--dotmatrix-dot:${dotLen || '0.08em'}`);
|
|
1542
1559
|
// Solid mode fuses the dots into a crisp pixel glyph: square cells, no gap.
|
|
1543
1560
|
if (solid) style.push('--dotmatrix-dot-radius:0', '--dotmatrix-gap:0');
|
|
1544
1561
|
else if (gapLen) style.push(`--dotmatrix-gap:${gapLen}`);
|
|
1562
|
+
return style;
|
|
1563
|
+
}
|
|
1545
1564
|
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
: 'ui-dotmatrix';
|
|
1552
|
-
// `reveal` staggers each cell by its row-major index via `--i`.
|
|
1553
|
-
const stagger = anim === 'reveal';
|
|
1554
|
-
|
|
1555
|
-
const a11y = label ? `role="img" aria-label="${esc(label)}"` : 'aria-hidden="true"';
|
|
1565
|
+
function dotmatrixClass(anim) {
|
|
1566
|
+
if (anim === 'reveal') return 'ui-dotmatrix ui-dotmatrix--reveal';
|
|
1567
|
+
if (anim === 'pulse') return 'ui-dotmatrix ui-dotmatrix--pulse';
|
|
1568
|
+
return 'ui-dotmatrix';
|
|
1569
|
+
}
|
|
1556
1570
|
|
|
1571
|
+
function renderGlyphCell(cell, index, { showPanel, stagger }) {
|
|
1572
|
+
const cl = cell.on ? cellClass(cell) : 'ui-dotmatrix__cell';
|
|
1573
|
+
const cellStyle = [];
|
|
1557
1574
|
// Off cells keep the cell class (so they hold their grid track and 1:1
|
|
1558
1575
|
// aspect-ratio); `grid: false` (implied by `solid`) only drops their lit
|
|
1559
1576
|
// background, for the glyph-only look, without collapsing all-off rows.
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
if (stagger) cellStyle.push(`--i:${i}`);
|
|
1567
|
-
const s = cellStyle.length ? ` style="${cellStyle.join(';')}"` : '';
|
|
1568
|
-
return `<span class="${cl}"${s}></span>`;
|
|
1569
|
-
})
|
|
1570
|
-
.join('');
|
|
1577
|
+
if (!cell.on && !showPanel) cellStyle.push('background:transparent');
|
|
1578
|
+
// `reveal` staggers each cell by its row-major index via `--i`.
|
|
1579
|
+
if (stagger) cellStyle.push(`--i:${index}`);
|
|
1580
|
+
const style = cellStyle.length ? ` style="${cellStyle.join(';')}"` : '';
|
|
1581
|
+
return `<span class="${cl}"${style}></span>`;
|
|
1582
|
+
}
|
|
1571
1583
|
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
// inline-icon use. `.ui-dotmatrix`'s `display: grid` works on a span.
|
|
1575
|
-
return `<span class="${cls}" style="${style.join(';')}" ${a11y}>${inner}</span>`;
|
|
1584
|
+
function a11yAttrs(label) {
|
|
1585
|
+
return label ? `role="img" aria-label="${esc(label)}"` : 'aria-hidden="true"';
|
|
1576
1586
|
}
|
|
1577
1587
|
|
|
1578
1588
|
// Character → glyph name for renderReadout. Punctuation reuses the readout face
|
package/llms.txt
CHANGED
|
@@ -44,7 +44,7 @@ the path changes from source `css/` to built `dist/css/`:
|
|
|
44
44
|
<!-- installed locally -->
|
|
45
45
|
<link rel="stylesheet" href="./node_modules/@ponchia/ui/dist/css/<leaf>.css" />
|
|
46
46
|
<!-- or from a CDN; pin the version (pre-1.0, breaking changes ship in the minor) -->
|
|
47
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ponchia/ui@0.6.
|
|
47
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ponchia/ui@0.6.9/dist/css/<leaf>.css" />
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
The flattened default bundle is `dist/bronto.css` (bundler shorthand
|
|
@@ -84,13 +84,17 @@ matching `.ui-source-card`, seed lightweight preview metadata, and emit
|
|
|
84
84
|
`bronto:source:focus`; the host still owns numbering, fetching, trust decisions,
|
|
85
85
|
and any rich preview popover.
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
deps `react` / `solid-js` /
|
|
87
|
+
Optional lifecycle adapters wrap those behaviors without owning markup or state.
|
|
88
|
+
React/Solid/Qwik use hook bindings (peer deps `react` / `solid-js` /
|
|
89
|
+
`@builder.io/qwik`, optional — core stays zero-dep); Svelte uses dependency-free
|
|
90
|
+
actions, and Vue uses dependency-free directives/plugin helpers:
|
|
89
91
|
|
|
90
92
|
```js
|
|
91
93
|
import { useDialog, useToast } from '@ponchia/ui/react'; // or '@ponchia/ui/solid' or '@ponchia/ui/qwik'
|
|
92
94
|
// React: scope with { root: reactRef } or a resolver, not { root: ref.current } during render.
|
|
93
95
|
// Qwik: hooks run in useVisibleTask$; scope with a Qwik signal — useDialog({ root: useSignal() }).
|
|
96
|
+
// Svelte: import { dialog, toast } from '@ponchia/ui/svelte'.
|
|
97
|
+
// Vue: import { vDialog, useToast } from '@ponchia/ui/vue', or app.use(brontoVue).
|
|
94
98
|
```
|
|
95
99
|
|
|
96
100
|
Optional display glyphs — dot-matrix bitmaps on the `.ui-dotmatrix` primitive
|
|
@@ -240,7 +244,10 @@ chart rendering, overlay content, and accessibility text. Details:
|
|
|
240
244
|
|
|
241
245
|
Optional SVG annotations for charts/reports — opt-in, never in the default
|
|
242
246
|
bundle. This is Bronto's subject / connector / note grammar inspired by
|
|
243
|
-
d3-annotation, not an authoring engine
|
|
247
|
+
d3-annotation, not an authoring engine. For placement, collision handling,
|
|
248
|
+
renderers, editing, and chart/diagram adapters, use the sibling
|
|
249
|
+
`@ponchia/annotations` package; `@ponchia/ui/annotations` stays a
|
|
250
|
+
dependency-free Bronto static-helper compatibility surface:
|
|
244
251
|
|
|
245
252
|
```html
|
|
246
253
|
<link rel="stylesheet" href="@ponchia/ui/css/annotations.css" />
|
|
@@ -618,7 +625,8 @@ behavior. Filter + keyboard-navigate a DOM-authored command list:
|
|
|
618
625
|
Enter→`bronto:command:select` ({value,label}) and Escape→`bronto:command:close`.
|
|
619
626
|
The HOST owns the action registry + execution; NO global Cmd/Ctrl+K (open it
|
|
620
627
|
yourself, e.g. a <dialog> via initDialog). Pairs with `ui-shortcut`. Binding:
|
|
621
|
-
`useCommand()` (
|
|
628
|
+
`useCommand()` (React/Solid/Qwik), `command` / `useCommand` (Svelte), and
|
|
629
|
+
`vCommand` / `brontoVue` (Vue). Details: `docs/command.md`.
|
|
622
630
|
|
|
623
631
|
Optional static report layer for LLM-authored HTML reports — opt-in, never in
|
|
624
632
|
the default bundle. Pair it with the normal bundle, and add data-viz only when
|
|
@@ -745,7 +753,8 @@ Read these from `node_modules/@ponchia/ui/` — no network needed:
|
|
|
745
753
|
- `schemas/report-claims.v1.schema.json` — declarative JSON Schema for
|
|
746
754
|
`claims.json` sidecars that map report claims to source IDs and relations.
|
|
747
755
|
- `docs/annotations.md` — SVG annotation recipes and helper guidance for
|
|
748
|
-
analytical figures
|
|
756
|
+
analytical figures, plus the boundary with the sibling `@ponchia/annotations`
|
|
757
|
+
engine package.
|
|
749
758
|
- `docs/mermaid.md` — theme Mermaid diagrams from bronto tokens (resolved
|
|
750
759
|
`base` themeVariables, gated) and annotate the rendered SVG.
|
|
751
760
|
- `docs/d2.md` — theme D2 diagrams from bronto tokens (theme-override slots,
|
|
@@ -770,14 +779,16 @@ Read these from `node_modules/@ponchia/ui/` — no network needed:
|
|
|
770
779
|
`glyphCells` signatures for the display glyphs. (The DOM form,
|
|
771
780
|
`initDotGlyph`, is declared in `behaviors/index.d.ts`.)
|
|
772
781
|
- `annotations/index.d.ts` — no-dependency SVG path helpers for Bronto
|
|
773
|
-
annotation geometry.
|
|
782
|
+
annotation geometry. Do not add placement/collision/renderers/adapters here;
|
|
783
|
+
that belongs in `@ponchia/annotations`; do not import or type-reference that
|
|
784
|
+
sibling package from `@ponchia/ui` code or declarations.
|
|
774
785
|
- `classes/vscode.css-custom-data.json` — editor autocomplete for tokens.
|
|
775
786
|
|
|
776
787
|
## External web references
|
|
777
788
|
|
|
778
789
|
- Live kitchen-sink demo (every component, light/dark, RTL): https://ponchia.github.io/bronto-ui/
|
|
779
790
|
- Architecture & the CSS-first decision: https://github.com/Ponchia/bronto-ui/blob/main/docs/architecture.md
|
|
780
|
-
- Framework integration guides (Astro / SvelteKit / React-Solid-Qwik / vanilla):
|
|
791
|
+
- Framework integration guides (Astro / SvelteKit / Vue / React-Solid-Qwik / vanilla):
|
|
781
792
|
https://github.com/Ponchia/bronto-ui/tree/main/docs/getting-started
|
|
782
793
|
|
|
783
794
|
## Rules an agent should respect
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ponchia/ui",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CSS-first identity and UI layer for services, tools, sites, and reports — works in HTML, every framework, and PDF, no component runtime. Shared app shell, forms, tables, workflow chrome, plus opt-in analytical/report primitives. Monochrome with one rationed accent. Zero runtime dependencies.",
|
|
6
6
|
"keywords": [
|
|
@@ -102,6 +102,7 @@
|
|
|
102
102
|
"docs/workbench.md",
|
|
103
103
|
"docs/command.md",
|
|
104
104
|
"docs/interop/tailwind.md",
|
|
105
|
+
"docs/interop/react-flow.md",
|
|
105
106
|
"docs/migrations/0.2-to-0.3.md",
|
|
106
107
|
"docs/migrations/0.3-to-0.4.md",
|
|
107
108
|
"docs/migrations/0.4-to-0.5.md",
|
|
@@ -146,7 +147,8 @@
|
|
|
146
147
|
"check:fresh": "node scripts/check-fresh.mjs",
|
|
147
148
|
"check:classes": "node scripts/check-classes.mjs",
|
|
148
149
|
"check:recipe-types": "node scripts/check-recipe-types.mjs",
|
|
149
|
-
"check:dead": "knip",
|
|
150
|
+
"check:dead": "knip --treat-config-hints-as-errors",
|
|
151
|
+
"check:complexity": "node scripts/check-complexity.mjs",
|
|
150
152
|
"check:chain": "node scripts/check-chain.mjs",
|
|
151
153
|
"check:dts-emit": "node scripts/check-dts-emit.mjs",
|
|
152
154
|
"check:glyphs": "node scripts/check-glyphs.mjs",
|
|
@@ -159,37 +161,53 @@
|
|
|
159
161
|
"check:report": "node scripts/check-report.mjs",
|
|
160
162
|
"check:legend": "node scripts/check-legend.mjs",
|
|
161
163
|
"check:types": "tsc -p tsconfig.json",
|
|
164
|
+
"check:unit": "npm test",
|
|
162
165
|
"check:shiki": "node scripts/check-shiki.mjs",
|
|
163
166
|
"check:dist": "node scripts/check-dist.mjs",
|
|
164
167
|
"check:pack": "node scripts/check-pack.mjs",
|
|
168
|
+
"check:consumer-surface": "node scripts/check-consumer-surface.mjs",
|
|
169
|
+
"check:consumer-types": "node scripts/check-consumer-types.mjs",
|
|
170
|
+
"check:component-matrix": "node scripts/check-component-matrix.mjs",
|
|
171
|
+
"check:behavior-matrix": "node scripts/check-behavior-matrix.mjs",
|
|
172
|
+
"check:helper-matrix": "node scripts/check-helper-matrix.mjs",
|
|
173
|
+
"check:binding-matrix": "node scripts/check-binding-matrix.mjs",
|
|
165
174
|
"check:examples": "node scripts/check-examples.mjs",
|
|
175
|
+
"check:visual-baselines": "node scripts/check-visual-baselines.mjs",
|
|
176
|
+
"check:playwright-container": "node scripts/check-playwright-container.mjs",
|
|
177
|
+
"check:schemas": "node scripts/check-schemas.mjs",
|
|
166
178
|
"check:release": "node scripts/check-release.mjs",
|
|
167
179
|
"check:versions": "node scripts/check-versions.mjs",
|
|
168
180
|
"check:migrations": "node scripts/check-migrations.mjs",
|
|
169
181
|
"check:public-metadata": "node scripts/check-public-metadata.mjs",
|
|
170
182
|
"check:public-hygiene": "node scripts/check-public-hygiene.mjs",
|
|
183
|
+
"check:doc-links": "node scripts/check-doc-links.mjs",
|
|
171
184
|
"check:doc-recipes": "node scripts/check-doc-recipes.mjs",
|
|
172
185
|
"check:contract": "node scripts/check-contract.mjs",
|
|
173
186
|
"check:variables": "node scripts/check-variables.mjs",
|
|
174
187
|
"check:contrast": "node scripts/check-contrast.mjs",
|
|
175
188
|
"check:publint": "publint --strict",
|
|
176
189
|
"check:attw": "attw --pack --ignore-rules no-resolution cjs-resolves-to-esm",
|
|
177
|
-
"check": "
|
|
190
|
+
"check:workflows": "github-actionlint .github/workflows/*.yml",
|
|
191
|
+
"check": "npm run lint && npm run check:format && npm run check:exports && npm run check:fresh && npm run check:classes && npm run check:recipe-types && npm run check:dead && npm run check:complexity && npm run check:types && npm run check:unit && npm run check:shiki && npm run check:dist && npm run check:pack && npm run check:consumer-surface && npm run check:consumer-types && npm run check:component-matrix && npm run check:behavior-matrix && npm run check:helper-matrix && npm run check:binding-matrix && npm run check:examples && npm run check:visual-baselines && npm run check:playwright-container && npm run check:schemas && npm run check:publint && npm run check:attw && npm run check:workflows && npm run check:release && npm run check:versions && npm run check:migrations && npm run check:public-metadata && npm run check:public-hygiene && npm run check:doc-links && npm run check:doc-recipes && npm run check:contract && npm run check:variables && npm run check:contrast && npm run check:dts-emit && npm run check:glyphs && npm run check:color-policy && npm run check:skins && npm run check:charts && npm run check:mermaid && npm run check:d2 && npm run check:vega && npm run check:report && npm run check:legend && npm run check:chain",
|
|
178
192
|
"test": "node --test \"test/*.test.mjs\"",
|
|
179
193
|
"test:e2e": "playwright test",
|
|
180
194
|
"test:e2e:chromium": "playwright test --project=chromium",
|
|
181
195
|
"test:e2e:nonpixel": "node scripts/test-e2e-nonpixel.mjs",
|
|
196
|
+
"test:e2e:visual:container": "node scripts/test-visual-container.mjs",
|
|
182
197
|
"test:examples": "node scripts/test-examples.mjs",
|
|
198
|
+
"test:examples:cross-browser": "node scripts/test-examples.mjs --browsers=chromium,firefox,webkit",
|
|
199
|
+
"test:examples:visual": "node scripts/test-examples.mjs --visual",
|
|
183
200
|
"build:artifacts": "npm run tokens:css:build && npm run tokens:build && npm run dtcg:build && npm run resolved:build && npm run figma:variables:build && npm run dts:build && npm run dts:emit && npm run reference:build && npm run package-contract:build && npm run classes:json:build && npm run contrast:build && npm run vscode:build && npm run skins:build && npm run charts:build && npm run mermaid:build && npm run d2:build && npm run vega:build && npm run dist:build && npm run glyphs:build",
|
|
184
201
|
"verify:artifacts": "npm run check:fresh && npm run check:dist && npm run check:dts-emit && npm run check:glyphs && npm run check:skins && npm run check:charts && npm run check:mermaid && npm run check:d2 && npm run check:vega && npm run check:pack",
|
|
185
202
|
"prepack": "npm run build:artifacts && npm run verify:artifacts",
|
|
186
|
-
"prepublishOnly": "npm run build:artifacts && npm run check
|
|
203
|
+
"prepublishOnly": "npm run build:artifacts && npm run check"
|
|
187
204
|
},
|
|
188
205
|
"devDependencies": {
|
|
189
206
|
"@arethetypeswrong/cli": "^0.18.3",
|
|
190
207
|
"@axe-core/playwright": "^4.11.3",
|
|
191
208
|
"@builder.io/qwik": "^1.20.0",
|
|
192
209
|
"@playwright/test": "1.60.0",
|
|
210
|
+
"github-actionlint": "^1.7.12",
|
|
193
211
|
"jsdom": "^29.1.1",
|
|
194
212
|
"knip": "^6.16.1",
|
|
195
213
|
"pdfjs-dist": "^6.0.227",
|
|
@@ -372,6 +390,7 @@
|
|
|
372
390
|
"./docs/workbench.md": "./docs/workbench.md",
|
|
373
391
|
"./docs/command.md": "./docs/command.md",
|
|
374
392
|
"./docs/interop/tailwind.md": "./docs/interop/tailwind.md",
|
|
393
|
+
"./docs/interop/react-flow.md": "./docs/interop/react-flow.md",
|
|
375
394
|
"./docs/migrations/0.2-to-0.3.md": "./docs/migrations/0.2-to-0.3.md",
|
|
376
395
|
"./docs/migrations/0.3-to-0.4.md": "./docs/migrations/0.3-to-0.4.md",
|
|
377
396
|
"./docs/migrations/0.4-to-0.5.md": "./docs/migrations/0.4-to-0.5.md",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
},
|
|
57
57
|
"hash": {
|
|
58
58
|
"type": "string",
|
|
59
|
-
"pattern": "^(sha256|sha384|sha512
|
|
59
|
+
"pattern": "^(sha256:[A-Fa-f0-9]{64}|sha384:[A-Fa-f0-9]{96}|sha512:[A-Fa-f0-9]{128})$"
|
|
60
60
|
},
|
|
61
61
|
"claimStatus": {
|
|
62
62
|
"enum": ["supported", "partial", "disputed", "unsupported", "unknown"]
|
package/svelte/index.d.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Create a Svelte action from any Bronto delegated behavior initializer.
|
|
3
3
|
*
|
|
4
4
|
* @param {(opts?: DelegateOpts) => Cleanup | void} init
|
|
5
|
-
* @returns {
|
|
5
|
+
* @returns {BrontoAction}
|
|
6
6
|
*/
|
|
7
|
-
export function createBrontoAction(init: (opts?: DelegateOpts) => Cleanup | void):
|
|
7
|
+
export function createBrontoAction(init: (opts?: DelegateOpts) => Cleanup | void): BrontoAction;
|
|
8
8
|
/**
|
|
9
9
|
* Generic escape hatch for custom behavior initializers.
|
|
10
10
|
*
|
|
@@ -21,49 +21,70 @@ export function brontoBehavior(node: Element, params: BrontoBehaviorParams | nul
|
|
|
21
21
|
* @returns {SvelteActionReturn}
|
|
22
22
|
*/
|
|
23
23
|
export function useBrontoBehavior(node: Element, params: BrontoBehaviorParams | null | undefined): SvelteActionReturn;
|
|
24
|
-
/** @type {
|
|
25
|
-
export const themeToggle:
|
|
26
|
-
|
|
27
|
-
export const
|
|
28
|
-
|
|
29
|
-
export const
|
|
30
|
-
|
|
31
|
-
export const
|
|
32
|
-
|
|
33
|
-
export const
|
|
34
|
-
|
|
35
|
-
export const
|
|
36
|
-
|
|
37
|
-
export const
|
|
38
|
-
|
|
39
|
-
export const
|
|
40
|
-
|
|
41
|
-
export const
|
|
42
|
-
|
|
43
|
-
export const
|
|
44
|
-
|
|
45
|
-
export const
|
|
46
|
-
|
|
47
|
-
export const
|
|
48
|
-
|
|
49
|
-
export const
|
|
50
|
-
|
|
51
|
-
export const
|
|
52
|
-
|
|
53
|
-
export const
|
|
54
|
-
|
|
55
|
-
export const
|
|
56
|
-
|
|
57
|
-
export const
|
|
58
|
-
|
|
59
|
-
export const
|
|
60
|
-
|
|
61
|
-
export const
|
|
62
|
-
|
|
63
|
-
export const
|
|
64
|
-
|
|
65
|
-
export const
|
|
66
|
-
|
|
24
|
+
/** @type {BrontoThemeAction} */
|
|
25
|
+
export const themeToggle: BrontoThemeAction;
|
|
26
|
+
/** @type {BrontoAction} */
|
|
27
|
+
export const dismissible: BrontoAction;
|
|
28
|
+
/** @type {BrontoAction} */
|
|
29
|
+
export const disabledGuard: BrontoAction;
|
|
30
|
+
/** @type {BrontoAction} */
|
|
31
|
+
export const disclosure: BrontoAction;
|
|
32
|
+
/** @type {BrontoAction} */
|
|
33
|
+
export const menu: BrontoAction;
|
|
34
|
+
/** @type {BrontoAction} */
|
|
35
|
+
export const formValidation: BrontoAction;
|
|
36
|
+
/** @type {BrontoAction} */
|
|
37
|
+
export const combobox: BrontoAction;
|
|
38
|
+
/** @type {BrontoAction} */
|
|
39
|
+
export const popover: BrontoAction;
|
|
40
|
+
/** @type {BrontoAction} */
|
|
41
|
+
export const tableSort: BrontoAction;
|
|
42
|
+
/** @type {BrontoAction} */
|
|
43
|
+
export const tabs: BrontoAction;
|
|
44
|
+
/** @type {BrontoAction} */
|
|
45
|
+
export const dialog: BrontoAction;
|
|
46
|
+
/** @type {BrontoAction} */
|
|
47
|
+
export const modal: BrontoAction;
|
|
48
|
+
/** @type {BrontoAction} */
|
|
49
|
+
export const carousel: BrontoAction;
|
|
50
|
+
/** @type {BrontoAction} */
|
|
51
|
+
export const dotGlyph: BrontoAction;
|
|
52
|
+
/** @type {BrontoAction} */
|
|
53
|
+
export const legend: BrontoAction;
|
|
54
|
+
/** @type {BrontoAction} */
|
|
55
|
+
export const connectors: BrontoAction;
|
|
56
|
+
/** @type {BrontoAction} */
|
|
57
|
+
export const spotlight: BrontoAction;
|
|
58
|
+
/** @type {BrontoAction} */
|
|
59
|
+
export const crosshair: BrontoAction;
|
|
60
|
+
/** @type {BrontoAction} */
|
|
61
|
+
export const command: BrontoAction;
|
|
62
|
+
/** @type {BrontoAction} */
|
|
63
|
+
export const sources: BrontoAction;
|
|
64
|
+
/** @type {BrontoAction} */
|
|
65
|
+
export const splitter: BrontoAction;
|
|
66
|
+
/** @type {BrontoThemeAction} */
|
|
67
|
+
export const useThemeToggle: BrontoThemeAction;
|
|
68
|
+
export const useDismissible: BrontoAction;
|
|
69
|
+
export const useDisabledGuard: BrontoAction;
|
|
70
|
+
export const useDisclosure: BrontoAction;
|
|
71
|
+
export const useMenu: BrontoAction;
|
|
72
|
+
export const useFormValidation: BrontoAction;
|
|
73
|
+
export const useCombobox: BrontoAction;
|
|
74
|
+
export const usePopover: BrontoAction;
|
|
75
|
+
export const useTableSort: BrontoAction;
|
|
76
|
+
export const useTabs: BrontoAction;
|
|
77
|
+
export const useDialog: BrontoAction;
|
|
78
|
+
export const useModal: BrontoAction;
|
|
79
|
+
export const useCarousel: BrontoAction;
|
|
80
|
+
export const useDotGlyph: BrontoAction;
|
|
81
|
+
export const useLegend: BrontoAction;
|
|
82
|
+
export const useConnectors: BrontoAction;
|
|
83
|
+
export const useSpotlight: BrontoAction;
|
|
84
|
+
export const useCrosshair: BrontoAction;
|
|
85
|
+
export const useCommand: BrontoAction;
|
|
86
|
+
export const useSources: BrontoAction;
|
|
87
|
+
export const useSplitter: BrontoAction;
|
|
67
88
|
export function useToast(): (message: string, opts?: ToastOpts) => Cleanup;
|
|
68
89
|
export type Cleanup = import("../behaviors/index.js").Cleanup;
|
|
69
90
|
export type DelegateOpts = import("../behaviors/index.js").DelegateOpts;
|
|
@@ -73,10 +94,15 @@ export type BrontoActionRoot = Document | Element | null | undefined;
|
|
|
73
94
|
export type BrontoActionOpts = Omit<DelegateOpts, "root"> & {
|
|
74
95
|
root?: BrontoActionRoot;
|
|
75
96
|
};
|
|
97
|
+
export type BrontoThemeActionOpts = Omit<ThemeStorageOpts & DelegateOpts, "root"> & {
|
|
98
|
+
root?: BrontoActionRoot;
|
|
99
|
+
};
|
|
76
100
|
export type BrontoBehaviorParams = {
|
|
77
101
|
init: (opts?: DelegateOpts) => Cleanup | void;
|
|
78
102
|
opts?: BrontoActionOpts | null | undefined;
|
|
79
103
|
};
|
|
104
|
+
export type BrontoAction = (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
105
|
+
export type BrontoThemeAction = (node: Element, opts?: BrontoThemeActionOpts | null | undefined) => SvelteActionReturn;
|
|
80
106
|
export type SvelteActionReturn = {
|
|
81
107
|
update?: (next?: unknown) => void;
|
|
82
108
|
destroy: () => void;
|
package/svelte/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"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"}
|
package/svelte/index.js
CHANGED
|
@@ -23,8 +23,14 @@
|
|
|
23
23
|
*
|
|
24
24
|
* @typedef {Omit<DelegateOpts, 'root'> & { root?: BrontoActionRoot }} BrontoActionOpts
|
|
25
25
|
*
|
|
26
|
+
* @typedef {Omit<ThemeStorageOpts & DelegateOpts, 'root'> & { root?: BrontoActionRoot }} BrontoThemeActionOpts
|
|
27
|
+
*
|
|
26
28
|
* @typedef {{ init: (opts?: DelegateOpts) => Cleanup | void, opts?: BrontoActionOpts | null | undefined }} BrontoBehaviorParams
|
|
27
29
|
*
|
|
30
|
+
* @typedef {(node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn} BrontoAction
|
|
31
|
+
*
|
|
32
|
+
* @typedef {(node: Element, opts?: BrontoThemeActionOpts | null | undefined) => SvelteActionReturn} BrontoThemeAction
|
|
33
|
+
*
|
|
28
34
|
* @typedef {{ update?: (next?: unknown) => void, destroy: () => void }} SvelteActionReturn
|
|
29
35
|
*/
|
|
30
36
|
import {
|
|
@@ -73,7 +79,7 @@ function run(node, init, opts) {
|
|
|
73
79
|
* Create a Svelte action from any Bronto delegated behavior initializer.
|
|
74
80
|
*
|
|
75
81
|
* @param {(opts?: DelegateOpts) => Cleanup | void} init
|
|
76
|
-
* @returns {
|
|
82
|
+
* @returns {BrontoAction}
|
|
77
83
|
*/
|
|
78
84
|
export function createBrontoAction(init) {
|
|
79
85
|
return (node, opts) => {
|
|
@@ -112,30 +118,51 @@ export function brontoBehavior(node, params) {
|
|
|
112
118
|
|
|
113
119
|
export const useBrontoBehavior = brontoBehavior;
|
|
114
120
|
|
|
115
|
-
/** @type {
|
|
121
|
+
/** @type {BrontoThemeAction} */
|
|
116
122
|
export const themeToggle = createBrontoAction(initThemeToggle);
|
|
123
|
+
/** @type {BrontoAction} */
|
|
117
124
|
export const dismissible = createBrontoAction(initDismissible);
|
|
125
|
+
/** @type {BrontoAction} */
|
|
118
126
|
export const disabledGuard = createBrontoAction(initDisabledGuard);
|
|
127
|
+
/** @type {BrontoAction} */
|
|
119
128
|
export const disclosure = createBrontoAction(initDisclosure);
|
|
129
|
+
/** @type {BrontoAction} */
|
|
120
130
|
export const menu = createBrontoAction(initMenu);
|
|
131
|
+
/** @type {BrontoAction} */
|
|
121
132
|
export const formValidation = createBrontoAction(initFormValidation);
|
|
133
|
+
/** @type {BrontoAction} */
|
|
122
134
|
export const combobox = createBrontoAction(initCombobox);
|
|
135
|
+
/** @type {BrontoAction} */
|
|
123
136
|
export const popover = createBrontoAction(initPopover);
|
|
137
|
+
/** @type {BrontoAction} */
|
|
124
138
|
export const tableSort = createBrontoAction(initTableSort);
|
|
139
|
+
/** @type {BrontoAction} */
|
|
125
140
|
export const tabs = createBrontoAction(initTabs);
|
|
141
|
+
/** @type {BrontoAction} */
|
|
126
142
|
export const dialog = createBrontoAction(initDialog);
|
|
143
|
+
/** @type {BrontoAction} */
|
|
127
144
|
export const modal = createBrontoAction(initModal);
|
|
145
|
+
/** @type {BrontoAction} */
|
|
128
146
|
export const carousel = createBrontoAction(initCarousel);
|
|
147
|
+
/** @type {BrontoAction} */
|
|
129
148
|
export const dotGlyph = createBrontoAction(initDotGlyph);
|
|
149
|
+
/** @type {BrontoAction} */
|
|
130
150
|
export const legend = createBrontoAction(initLegend);
|
|
151
|
+
/** @type {BrontoAction} */
|
|
131
152
|
export const connectors = createBrontoAction(initConnectors);
|
|
153
|
+
/** @type {BrontoAction} */
|
|
132
154
|
export const spotlight = createBrontoAction(initSpotlight);
|
|
155
|
+
/** @type {BrontoAction} */
|
|
133
156
|
export const crosshair = createBrontoAction(initCrosshair);
|
|
157
|
+
/** @type {BrontoAction} */
|
|
134
158
|
export const command = createBrontoAction(initCommand);
|
|
159
|
+
/** @type {BrontoAction} */
|
|
135
160
|
export const sources = createBrontoAction(initSources);
|
|
161
|
+
/** @type {BrontoAction} */
|
|
136
162
|
export const splitter = createBrontoAction(initSplitter);
|
|
137
163
|
|
|
138
164
|
// Hook-style aliases keep this action surface parallel with React/Solid/Qwik.
|
|
165
|
+
/** @type {BrontoThemeAction} */
|
|
139
166
|
export const useThemeToggle = themeToggle;
|
|
140
167
|
export const useDismissible = dismissible;
|
|
141
168
|
export const useDisabledGuard = disabledGuard;
|
package/tokens/index.js
CHANGED
|
@@ -115,7 +115,7 @@ export const cssVars = {
|
|
|
115
115
|
// (D2/Mermaid/Vega labels on an accent fill — see tokens/*.json). In-DOM
|
|
116
116
|
// components paint their own on-accent ink from `--button-text`; overriding
|
|
117
117
|
// `--on-accent` in CSS does NOT change a button/chip. To re-ink in-DOM
|
|
118
|
-
// accent fills, set `--button-text`.
|
|
118
|
+
// accent fills, set `--button-text`.
|
|
119
119
|
'--on-accent': 'var(--button-text)',
|
|
120
120
|
'--accent-soft': 'color-mix(in srgb, var(--accent) 10%, transparent)',
|
|
121
121
|
'--success': '#2f7d4f',
|
|
@@ -156,7 +156,7 @@ export const cssVars = {
|
|
|
156
156
|
// (D2/Mermaid/Vega labels on an accent fill — see tokens/*.json). In-DOM
|
|
157
157
|
// components paint their own on-accent ink from `--button-text`; overriding
|
|
158
158
|
// `--on-accent` in CSS does NOT change a button/chip. To re-ink in-DOM
|
|
159
|
-
// accent fills, set `--button-text`.
|
|
159
|
+
// accent fills, set `--button-text`.
|
|
160
160
|
'--on-accent': 'var(--button-text)',
|
|
161
161
|
'--accent-soft': 'color-mix(in srgb, var(--accent) 14%, transparent)',
|
|
162
162
|
'--success': '#4ec27e',
|