@ponchia/ui 0.6.9 → 0.6.11
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 +92 -0
- package/README.md +38 -25
- package/annotations/index.d.ts +15 -15
- package/annotations/index.d.ts.map +1 -1
- package/annotations/index.js +52 -34
- package/behaviors/carousel.d.ts +7 -3
- package/behaviors/carousel.d.ts.map +1 -1
- package/behaviors/carousel.js +157 -27
- package/behaviors/combobox.d.ts +1 -1
- package/behaviors/combobox.d.ts.map +1 -1
- package/behaviors/combobox.js +46 -23
- package/behaviors/command.d.ts +1 -1
- package/behaviors/command.d.ts.map +1 -1
- package/behaviors/command.js +63 -23
- package/behaviors/connectors.d.ts.map +1 -1
- package/behaviors/connectors.js +126 -19
- package/behaviors/crosshair.d.ts.map +1 -1
- package/behaviors/crosshair.js +71 -8
- package/behaviors/dialog.d.ts.map +1 -1
- package/behaviors/dialog.js +20 -3
- package/behaviors/disclosure.d.ts.map +1 -1
- package/behaviors/disclosure.js +35 -6
- package/behaviors/dismissible.js +1 -1
- package/behaviors/forms.d.ts +23 -2
- package/behaviors/forms.d.ts.map +1 -1
- package/behaviors/forms.js +97 -9
- package/behaviors/glyph.d.ts.map +1 -1
- package/behaviors/glyph.js +56 -5
- package/behaviors/internal.d.ts.map +1 -1
- package/behaviors/internal.js +52 -5
- package/behaviors/menu.d.ts.map +1 -1
- package/behaviors/menu.js +2 -1
- package/behaviors/modal.d.ts.map +1 -1
- package/behaviors/modal.js +25 -9
- package/behaviors/popover.d.ts.map +1 -1
- package/behaviors/popover.js +8 -6
- package/behaviors/sources.d.ts.map +1 -1
- package/behaviors/sources.js +24 -3
- package/behaviors/splitter.d.ts.map +1 -1
- package/behaviors/splitter.js +27 -6
- package/behaviors/table.d.ts.map +1 -1
- package/behaviors/table.js +44 -7
- package/behaviors/tabs.d.ts.map +1 -1
- package/behaviors/tabs.js +51 -14
- package/behaviors/theme.d.ts.map +1 -1
- package/behaviors/theme.js +64 -4
- package/behaviors/toast.d.ts +6 -1
- package/behaviors/toast.d.ts.map +1 -1
- package/behaviors/toast.js +48 -12
- package/classes/classes.json +57 -2
- package/classes/index.d.ts +13 -2
- package/classes/index.js +88 -40
- package/connectors/index.d.ts +4 -4
- package/connectors/index.d.ts.map +1 -1
- package/connectors/index.js +14 -12
- package/css/annotations.css +1 -0
- package/css/app.css +7 -0
- package/css/base.css +3 -0
- package/css/bullet.css +41 -7
- package/css/code.css +14 -0
- package/css/command.css +10 -0
- package/css/dataviz.css +27 -0
- package/css/diff.css +2 -0
- package/css/disclosure.css +8 -0
- package/css/dots.css +1 -1
- package/css/feedback.css +9 -0
- package/css/interval.css +20 -2
- package/css/legend.css +10 -9
- package/css/marks.css +1 -0
- package/css/motion.css +2 -0
- package/css/overlay.css +14 -2
- package/css/primitives.css +1 -1
- package/css/report.css +3 -0
- package/css/sources.css +4 -4
- package/css/spotlight.css +6 -0
- package/css/table.css +19 -0
- package/css/term.css +4 -1
- package/css/tokens.css +8 -13
- package/css/workbench.css +128 -0
- package/dist/bronto.css +1 -1
- package/dist/css/analytical.css +1 -1
- package/dist/css/app.css +1 -1
- package/dist/css/bullet.css +1 -1
- package/dist/css/code.css +1 -1
- package/dist/css/command.css +1 -1
- package/dist/css/dataviz.css +1 -1
- package/dist/css/diff.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/interval.css +1 -1
- package/dist/css/legend.css +1 -1
- package/dist/css/marks.css +1 -1
- package/dist/css/overlay.css +1 -1
- package/dist/css/primitives.css +1 -1
- package/dist/css/report-kit.css +1 -1
- package/dist/css/sources.css +1 -1
- package/dist/css/spotlight.css +1 -1
- package/dist/css/table.css +1 -1
- package/dist/css/term.css +1 -1
- package/dist/css/tokens.css +1 -1
- package/dist/css/workbench.css +1 -1
- package/docs/annotations.md +27 -0
- package/docs/architecture.md +5 -3
- package/docs/bullet.md +6 -1
- package/docs/clamp.md +5 -0
- package/docs/command.md +3 -2
- package/docs/contrast.md +3 -3
- package/docs/crosshair.md +6 -0
- package/docs/dots.md +10 -3
- package/docs/figure.md +7 -0
- package/docs/glyphs.md +14 -2
- package/docs/highlights.md +9 -0
- package/docs/interval.md +6 -0
- package/docs/mermaid.md +5 -3
- package/docs/package-contract.md +24 -1
- package/docs/reference.md +21 -1
- package/docs/reporting.md +8 -8
- package/docs/selection.md +9 -0
- package/docs/sources.md +5 -0
- package/docs/state.md +6 -0
- package/docs/textref.md +18 -13
- package/docs/theming.md +18 -8
- package/docs/toc.md +6 -0
- package/docs/tree.md +9 -2
- package/docs/usage.md +2 -2
- package/docs/vega.md +5 -3
- package/docs/workbench.md +56 -9
- package/glyphs/glyphs.js +62 -8
- package/index.d.ts +1 -0
- package/llms.txt +18 -14
- package/package.json +98 -6
- package/qwik/index.d.ts +4 -3
- package/qwik/index.d.ts.map +1 -1
- package/qwik/index.js +7 -5
- package/react/index.d.ts +4 -3
- package/react/index.d.ts.map +1 -1
- package/react/index.js +3 -2
- package/solid/index.d.ts +7 -5
- package/solid/index.d.ts.map +1 -1
- package/solid/index.js +11 -7
- package/tokens/vega.d.ts +1 -1
- package/tokens/vega.js +3 -2
- package/vue/index.d.ts.map +1 -1
- package/vue/index.js +37 -3
package/docs/highlights.md
CHANGED
|
@@ -12,6 +12,9 @@ DOM.
|
|
|
12
12
|
Bronto only paints the names below. The host owns range discovery, search,
|
|
13
13
|
source mapping, current-match state, and cleanup.
|
|
14
14
|
|
|
15
|
+
Because highlights are paint only, mirror search and current-match state in
|
|
16
|
+
host-owned controls or text when users need to navigate it.
|
|
17
|
+
|
|
15
18
|
| Highlight name | Use |
|
|
16
19
|
| --- | --- |
|
|
17
20
|
| `bronto-evidence` | Cited evidence or selected proof text. |
|
|
@@ -50,3 +53,9 @@ if (CSS.highlights) {
|
|
|
50
53
|
|
|
51
54
|
Check `CSS.highlights` before registering ranges. Without support, the page
|
|
52
55
|
falls back to plain text; no wrapper spans or extra cleanup are required.
|
|
56
|
+
|
|
57
|
+
## Related
|
|
58
|
+
|
|
59
|
+
`highlights.css` is part of
|
|
60
|
+
[`analytical.css`](./reporting.md#the-analytical-toolbox-in-a-report). Use
|
|
61
|
+
[reference.md](./reference.md) for the generated class catalog.
|
package/docs/interval.md
CHANGED
|
@@ -53,3 +53,9 @@ and optional point estimate.
|
|
|
53
53
|
Pair each interval with a written label or `role="img"` plus `aria-label`. The
|
|
54
54
|
range is not the data of record: under forced-colors or print, the readable
|
|
55
55
|
label and bounds must still explain the value.
|
|
56
|
+
|
|
57
|
+
## Related
|
|
58
|
+
|
|
59
|
+
Use the [reporting toolbox](./reporting.md#the-analytical-toolbox-in-a-report)
|
|
60
|
+
to place `interval.css` in report surfaces, and use
|
|
61
|
+
[reference.md](./reference.md) for the generated class catalog.
|
package/docs/mermaid.md
CHANGED
|
@@ -71,8 +71,10 @@ below):
|
|
|
71
71
|
> an `http(s)` origin the `import`/`fetch` forms both work.
|
|
72
72
|
|
|
73
73
|
The result is monochrome surfaces and lines with the rationed accent reserved
|
|
74
|
-
for notes — a diagram that looks like the rest of a bronto surface
|
|
75
|
-
**
|
|
74
|
+
for notes — a diagram that looks like the rest of a bronto surface. The accent is
|
|
75
|
+
**resolved into the theme map** you pass to `initialize`, not read live from
|
|
76
|
+
`--accent`: to change it you re-`initialize` with the new palette and re-render;
|
|
77
|
+
an already-drawn diagram does not live-reskin (see below).
|
|
76
78
|
|
|
77
79
|
### Why resolved colours, not `var(--x)`
|
|
78
80
|
|
|
@@ -90,7 +92,7 @@ switch, re-`initialize` with the other palette and re-render.
|
|
|
90
92
|
- **Chart-like** diagrams carry a categorical series palette — **pie**
|
|
91
93
|
(`pie1`…`pie12`), **git** (`git0`…`git7`), and **user-journey**
|
|
92
94
|
(`fillType0`…`fillType7`) are wired to the CVD-safe
|
|
93
|
-
[charts palette](./legends.md) (series 1 = the
|
|
95
|
+
[charts palette](./legends.md) (series 1 = the resolved accent).
|
|
94
96
|
- **Structural** diagrams — flowchart, sequence, class, ER, state — use the
|
|
95
97
|
monochrome node/edge/cluster grammar and spend the accent only on notes.
|
|
96
98
|
- **Not themed: `gantt` and `timeline`.** Their colours come from
|
package/docs/package-contract.md
CHANGED
|
@@ -25,7 +25,7 @@ semantic versioning contract for the surfaces listed here.
|
|
|
25
25
|
|
|
26
26
|
| Export | Target | Group | Stability | Contract |
|
|
27
27
|
| --- | --- | --- | --- | --- |
|
|
28
|
-
| `.` | style: `./dist/bronto.css`<br>default: `./dist/bronto.css` | CSS root bundle | Stable | CSS-only package root. Supported as a CSS side-effect import in CSS-aware bundlers; not a Node/runtime JS entrypoint. |
|
|
28
|
+
| `.` | types: `./index.d.ts`<br>style: `./dist/bronto.css`<br>default: `./dist/bronto.css` | CSS root bundle | Stable | CSS-only package root. Supported as a CSS side-effect import in CSS-aware bundlers; not a Node/runtime JS entrypoint. |
|
|
29
29
|
| `./dist/bronto.css` | `./dist/bronto.css` | Flattened CSS bundle | Stable path | The prebuilt default stylesheet. Generated from css/core.css and byte-checked by check:dist. |
|
|
30
30
|
| `./tailwind` | `./tailwind.css` | Tailwind CSS bridge | Stable additive | CSS-only Tailwind v4 theme/variant bridge. It maps Bronto tokens into Tailwind namespaces; it does not import component CSS. |
|
|
31
31
|
| `./tailwind.css` | `./tailwind.css` | Tailwind CSS bridge | Stable additive | CSS-only Tailwind v4 theme/variant bridge. It maps Bronto tokens into Tailwind namespaces; it does not import component CSS. |
|
|
@@ -180,6 +180,28 @@ semantic versioning contract for the surfaces listed here.
|
|
|
180
180
|
| `./classes` | types: `./classes/index.d.ts`<br>default: `./classes/index.js` | Class recipes JS | Stable | ESM class registry, recipes, attrs helpers, and cx joiner. The emitted class vocabulary is public. |
|
|
181
181
|
| `./classes.json` | `./classes/classes.json` | Machine-readable data | Stable additive | JSON package data for non-JS/tooling consumers. Shape is public unless the paired doc marks a field internal. |
|
|
182
182
|
| `./behaviors` | types: `./behaviors/index.d.ts`<br>default: `./behaviors/index.js` | Vanilla behavior JS | Stable | ESM, SSR-safe, cleanup-returning behavior initializers. Behavior internals are not public. |
|
|
183
|
+
| `./behaviors/carousel` | types: `./behaviors/carousel.d.ts`<br>default: `./behaviors/carousel.js` | Package subpath | Public | Exported package subpath. See docs/stability.md for semantic stability. |
|
|
184
|
+
| `./behaviors/combobox` | types: `./behaviors/combobox.d.ts`<br>default: `./behaviors/combobox.js` | Package subpath | Public | Exported package subpath. See docs/stability.md for semantic stability. |
|
|
185
|
+
| `./behaviors/command` | types: `./behaviors/command.d.ts`<br>default: `./behaviors/command.js` | Package subpath | Public | Exported package subpath. See docs/stability.md for semantic stability. |
|
|
186
|
+
| `./behaviors/connectors` | types: `./behaviors/connectors.d.ts`<br>default: `./behaviors/connectors.js` | Package subpath | Public | Exported package subpath. See docs/stability.md for semantic stability. |
|
|
187
|
+
| `./behaviors/crosshair` | types: `./behaviors/crosshair.d.ts`<br>default: `./behaviors/crosshair.js` | Package subpath | Public | Exported package subpath. See docs/stability.md for semantic stability. |
|
|
188
|
+
| `./behaviors/dialog` | types: `./behaviors/dialog.d.ts`<br>default: `./behaviors/dialog.js` | Package subpath | Public | Exported package subpath. See docs/stability.md for semantic stability. |
|
|
189
|
+
| `./behaviors/disclosure` | types: `./behaviors/disclosure.d.ts`<br>default: `./behaviors/disclosure.js` | Package subpath | Public | Exported package subpath. See docs/stability.md for semantic stability. |
|
|
190
|
+
| `./behaviors/dismissible` | types: `./behaviors/dismissible.d.ts`<br>default: `./behaviors/dismissible.js` | Package subpath | Public | Exported package subpath. See docs/stability.md for semantic stability. |
|
|
191
|
+
| `./behaviors/forms` | types: `./behaviors/forms.d.ts`<br>default: `./behaviors/forms.js` | Package subpath | Public | Exported package subpath. See docs/stability.md for semantic stability. |
|
|
192
|
+
| `./behaviors/glyph` | types: `./behaviors/glyph.d.ts`<br>default: `./behaviors/glyph.js` | Package subpath | Public | Exported package subpath. See docs/stability.md for semantic stability. |
|
|
193
|
+
| `./behaviors/inert` | types: `./behaviors/inert.d.ts`<br>default: `./behaviors/inert.js` | Package subpath | Public | Exported package subpath. See docs/stability.md for semantic stability. |
|
|
194
|
+
| `./behaviors/legend` | types: `./behaviors/legend.d.ts`<br>default: `./behaviors/legend.js` | Package subpath | Public | Exported package subpath. See docs/stability.md for semantic stability. |
|
|
195
|
+
| `./behaviors/menu` | types: `./behaviors/menu.d.ts`<br>default: `./behaviors/menu.js` | Package subpath | Public | Exported package subpath. See docs/stability.md for semantic stability. |
|
|
196
|
+
| `./behaviors/modal` | types: `./behaviors/modal.d.ts`<br>default: `./behaviors/modal.js` | Package subpath | Public | Exported package subpath. See docs/stability.md for semantic stability. |
|
|
197
|
+
| `./behaviors/popover` | types: `./behaviors/popover.d.ts`<br>default: `./behaviors/popover.js` | Package subpath | Public | Exported package subpath. See docs/stability.md for semantic stability. |
|
|
198
|
+
| `./behaviors/sources` | types: `./behaviors/sources.d.ts`<br>default: `./behaviors/sources.js` | Package subpath | Public | Exported package subpath. See docs/stability.md for semantic stability. |
|
|
199
|
+
| `./behaviors/splitter` | types: `./behaviors/splitter.d.ts`<br>default: `./behaviors/splitter.js` | Package subpath | Public | Exported package subpath. See docs/stability.md for semantic stability. |
|
|
200
|
+
| `./behaviors/spotlight` | types: `./behaviors/spotlight.d.ts`<br>default: `./behaviors/spotlight.js` | Package subpath | Public | Exported package subpath. See docs/stability.md for semantic stability. |
|
|
201
|
+
| `./behaviors/table` | types: `./behaviors/table.d.ts`<br>default: `./behaviors/table.js` | Package subpath | Public | Exported package subpath. See docs/stability.md for semantic stability. |
|
|
202
|
+
| `./behaviors/tabs` | types: `./behaviors/tabs.d.ts`<br>default: `./behaviors/tabs.js` | Package subpath | Public | Exported package subpath. See docs/stability.md for semantic stability. |
|
|
203
|
+
| `./behaviors/theme` | types: `./behaviors/theme.d.ts`<br>default: `./behaviors/theme.js` | Package subpath | Public | Exported package subpath. See docs/stability.md for semantic stability. |
|
|
204
|
+
| `./behaviors/toast` | types: `./behaviors/toast.d.ts`<br>default: `./behaviors/toast.js` | Package subpath | Public | Exported package subpath. See docs/stability.md for semantic stability. |
|
|
183
205
|
| `./glyphs` | types: `./glyphs/glyphs.d.ts`<br>default: `./glyphs/glyphs.js` | Geometry/render helper JS | Stable additive | ESM helper surface. Function names, options, and data shapes are public; rendering heuristics may tune. |
|
|
184
206
|
| `./annotations` | types: `./annotations/index.d.ts`<br>default: `./annotations/index.js` | Geometry/render helper JS | Stable additive | ESM helper surface. Function names, options, and data shapes are public; rendering heuristics may tune. |
|
|
185
207
|
| `./connectors` | types: `./connectors/index.d.ts`<br>default: `./connectors/index.js` | Geometry/render helper JS | Stable additive | ESM helper surface. Function names, options, and data shapes are public; rendering heuristics may tune. |
|
|
@@ -210,6 +232,7 @@ always includes `package.json`, `README.md`, `LICENSE`, and
|
|
|
210
232
|
| `css` | Source CSS directory | Public source leaves. Mostly hand-authored; generated exceptions are called out in the provenance table. |
|
|
211
233
|
| `dist` | Generated CSS directory | Prebuilt layered bundle and leaves. Never hand-edit. |
|
|
212
234
|
| `tailwind.css` | Tailwind CSS bridge | CSS-only Tailwind v4 theme/variant bridge; hand-authored and not part of the default Bronto bundle. |
|
|
235
|
+
| `index.d.ts` | Package file | Included in the npm files allowlist. |
|
|
213
236
|
| `fonts` | Vendored assets | Doto woff2 files plus OFL license. |
|
|
214
237
|
| `tokens` | Mixed source/generated data | Token source plus generated JSON, declarations, and renderer theme data. |
|
|
215
238
|
| `classes` | Mixed source/generated data | Class recipe source plus generated JSON/declarations/custom-data. |
|
package/docs/reference.md
CHANGED
|
@@ -9,7 +9,7 @@ rendering of every class is the kitchen-sink demo:
|
|
|
9
9
|
**<https://ponchia.github.io/bronto-ui/>**. Theming knobs and the token
|
|
10
10
|
contract: [docs/theming.md](theming.md).
|
|
11
11
|
|
|
12
|
-
-
|
|
12
|
+
- 644 classes across 179 component groups
|
|
13
13
|
- Import the typed registry: `import { cls, ui, cx } from '@ponchia/ui/classes'`
|
|
14
14
|
- Validate markup as data (no JS/TS): `@ponchia/ui/classes.json` — the same
|
|
15
15
|
vocabulary as language-neutral JSON (`groups`, `classes`, `states`,
|
|
@@ -1131,6 +1131,13 @@ each one matches a real selector in the stylesheet.
|
|
|
1131
1131
|
| `cls.segmented` | `ui-segmented` | base |
|
|
1132
1132
|
| `cls.segmentedOption` | `ui-segmented__option` | part |
|
|
1133
1133
|
|
|
1134
|
+
### `.ui-segmented-buttons`
|
|
1135
|
+
|
|
1136
|
+
| Registry key | Class | Kind |
|
|
1137
|
+
| --- | --- | --- |
|
|
1138
|
+
| `cls.segmentedButtons` | `ui-segmented-buttons` | base |
|
|
1139
|
+
| `cls.segmentedButtonsButton` | `ui-segmented-buttons__button` | part |
|
|
1140
|
+
|
|
1134
1141
|
### `.ui-sel`
|
|
1135
1142
|
|
|
1136
1143
|
| Registry key | Class | Kind |
|
|
@@ -1496,6 +1503,19 @@ each one matches a real selector in the stylesheet.
|
|
|
1496
1503
|
| --- | --- | --- |
|
|
1497
1504
|
| `cls.toolLog` | `ui-tool-log` | base |
|
|
1498
1505
|
|
|
1506
|
+
### `.ui-toolstrip`
|
|
1507
|
+
|
|
1508
|
+
| Registry key | Class | Kind |
|
|
1509
|
+
| --- | --- | --- |
|
|
1510
|
+
| `cls.toolstrip` | `ui-toolstrip` | base |
|
|
1511
|
+
| `cls.toolstripActions` | `ui-toolstrip__actions` | part |
|
|
1512
|
+
| `cls.toolstripBrand` | `ui-toolstrip__brand` | part |
|
|
1513
|
+
| `cls.toolstripContext` | `ui-toolstrip__context` | part |
|
|
1514
|
+
| `cls.toolstripGroup` | `ui-toolstrip__group` | part |
|
|
1515
|
+
| `cls.toolstripSearch` | `ui-toolstrip__search` | part |
|
|
1516
|
+
| `cls.toolstripCompact` | `ui-toolstrip--compact` | modifier |
|
|
1517
|
+
| `cls.toolstripFloating` | `ui-toolstrip--floating` | modifier |
|
|
1518
|
+
|
|
1499
1519
|
### `.ui-tooltip`
|
|
1500
1520
|
|
|
1501
1521
|
| Registry key | Class | Kind |
|
package/docs/reporting.md
CHANGED
|
@@ -54,18 +54,18 @@ No install? Link the same files from a CDN. Pin the version — pre-1.0, breakin
|
|
|
54
54
|
changes ship in the minor (see [stability.md](./stability.md)):
|
|
55
55
|
|
|
56
56
|
```html
|
|
57
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ponchia/ui@0.6.
|
|
58
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ponchia/ui@0.6.
|
|
57
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ponchia/ui@0.6.11/dist/bronto.css" />
|
|
58
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ponchia/ui@0.6.11/dist/css/report-kit.css" />
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
Leaf-by-leaf CDN imports use the same `dist/css/` paths:
|
|
62
62
|
|
|
63
63
|
```html
|
|
64
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ponchia/ui@0.6.
|
|
65
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ponchia/ui@0.6.
|
|
66
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ponchia/ui@0.6.
|
|
67
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ponchia/ui@0.6.
|
|
68
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ponchia/ui@0.6.
|
|
64
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ponchia/ui@0.6.11/dist/bronto.css" />
|
|
65
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ponchia/ui@0.6.11/dist/css/report.css" />
|
|
66
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ponchia/ui@0.6.11/dist/css/dataviz.css" />
|
|
67
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ponchia/ui@0.6.11/dist/css/annotations.css" />
|
|
68
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ponchia/ui@0.6.11/dist/css/legend.css" />
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
The CDN serves the package's own `fonts/` next to the CSS, so font URLs resolve
|
|
@@ -879,7 +879,7 @@ or validation runtime.
|
|
|
879
879
|
|
|
880
880
|
```json
|
|
881
881
|
{
|
|
882
|
-
"$schema": "https://cdn.jsdelivr.net/npm/@ponchia/ui@0.6.
|
|
882
|
+
"$schema": "https://cdn.jsdelivr.net/npm/@ponchia/ui@0.6.11/schemas/report-claims.v1.schema.json",
|
|
883
883
|
"schemaVersion": "bronto-report-claims.v1",
|
|
884
884
|
"report": { "title": "Decision readiness", "type": "decision" },
|
|
885
885
|
"claims": [
|
package/docs/selection.md
CHANGED
|
@@ -34,7 +34,16 @@ logic — Bronto only styles them. `--off` uses `opacity` (which survives
|
|
|
34
34
|
forced-colors), and `--on` falls back to the system `Highlight` color in
|
|
35
35
|
forced-colors so the selection stays visible.
|
|
36
36
|
|
|
37
|
+
Pair the visual classes with host-owned selection semantics, such as
|
|
38
|
+
`aria-selected`, native checked state, or a visible selected-count label.
|
|
39
|
+
|
|
37
40
|
> **Why no brush behavior?** A rectangular brush or lasso must translate a
|
|
38
41
|
> dragged region into a data domain (or test points against a polygon), which
|
|
39
42
|
> requires owning the chart's scales/geometry — across Bronto's line. Bring your
|
|
40
43
|
> own selection logic; use these classes to render the result.
|
|
44
|
+
|
|
45
|
+
## Related
|
|
46
|
+
|
|
47
|
+
`selection.css` is part of
|
|
48
|
+
[`analytical.css`](./reporting.md#the-analytical-toolbox-in-a-report). Use
|
|
49
|
+
[reference.md](./reference.md) for the generated class catalog.
|
package/docs/sources.md
CHANGED
|
@@ -167,3 +167,8 @@ ui.provenance({ state: 'reviewed' }); // "ui-provenance ui-src--reviewed"
|
|
|
167
167
|
`CanvasText`, so the label remains the channel.
|
|
168
168
|
- Tone dots and the card's tone border carry `print-color-adjust: exact`, so
|
|
169
169
|
they survive printing; expand citation URLs in print where it helps the reader.
|
|
170
|
+
|
|
171
|
+
## Related
|
|
172
|
+
|
|
173
|
+
- [Usage](usage.md#static-reports) shows where citations fit in reports.
|
|
174
|
+
- [Reference](reference.md) lists the generated source and citation classes.
|
package/docs/state.md
CHANGED
|
@@ -140,3 +140,9 @@ CSS only — there is no JS yet. Auto-updating elapsed time ("2m ago"), live
|
|
|
140
140
|
progress text, polling, cancellation, retry, and conflict-resolution affordances
|
|
141
141
|
are the host's job. A small optional behavior may come later if a real consumer
|
|
142
142
|
needs it.
|
|
143
|
+
|
|
144
|
+
## Related
|
|
145
|
+
|
|
146
|
+
Use the [reporting toolbox](./reporting.md#the-analytical-toolbox-in-a-report)
|
|
147
|
+
to place `state.css` in report surfaces, and use
|
|
148
|
+
[reference.md](./reference.md) for the generated class catalog.
|
package/docs/textref.md
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
`@ponchia/ui/css/textref.css` is an opt-in **deep-link-to-the-cited-sentence**
|
|
4
4
|
provenance primitive. A citation whose `href` is a URL [Text
|
|
5
5
|
Fragment](https://developer.mozilla.org/en-US/docs/Web/Text_fragments)
|
|
6
|
-
(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
(`#section:~:text=`): supporting browsers scroll to the exact quoted text and
|
|
7
|
+
highlight it, while the leading `#section` gives older engines a stable landing.
|
|
8
|
+
Bronto owns the on-brand `::target-text` paint. It is the inline counterpart to
|
|
9
|
+
the static `ui-src` / `ui-citation` trust layer (`sources.css`), which can label
|
|
10
|
+
a source but cannot point *inside* it.
|
|
10
11
|
|
|
11
12
|
```css
|
|
12
13
|
@import '@ponchia/ui';
|
|
@@ -15,12 +16,13 @@ label a source but cannot point *inside* it.
|
|
|
15
16
|
|
|
16
17
|
## How it behaves
|
|
17
18
|
|
|
18
|
-
-
|
|
19
|
-
first match of the quoted text — no script
|
|
19
|
+
- In Chrome/Edge 80+, Safari 16.1+, and Firefox 131+, the browser scrolls to
|
|
20
|
+
and highlights the first match of the quoted text — no script.
|
|
20
21
|
- Bronto repaints that browser highlight (`::target-text`) in the rationed
|
|
21
22
|
accent wash so it matches the rest of the trust layer.
|
|
22
|
-
- On engines without Text Fragments the
|
|
23
|
-
`#section
|
|
23
|
+
- On engines without Text Fragments, the `:~:text=` directive is ignored. Use a
|
|
24
|
+
real `#section:~:text=...` URL when you own the target page; a bare `#section`
|
|
25
|
+
can land only at the section, not at the quoted sentence.
|
|
24
26
|
|
|
25
27
|
## Wiring — the host builds the fragment URL
|
|
26
28
|
|
|
@@ -30,11 +32,12 @@ runtime for it. Build the `href` with a three-line pure helper and drop it on th
|
|
|
30
32
|
|
|
31
33
|
```js
|
|
32
34
|
// Encode a quote as a URL Text Fragment directive.
|
|
33
|
-
// encodeTextFragment('p95 latency fell 38%'
|
|
34
|
-
|
|
35
|
+
// encodeTextFragment('p95 latency fell 38%', { section: 'incident-summary' })
|
|
36
|
+
// -> '#incident-summary:~:text=p95%20latency%20fell%2038%25'
|
|
37
|
+
export function encodeTextFragment(quote, { prefix, section } = {}) {
|
|
35
38
|
const enc = (s) => encodeURIComponent(s).replace(/-/g, '%2D');
|
|
36
39
|
const text = prefix ? `${enc(prefix)}-,${enc(quote)}` : enc(quote);
|
|
37
|
-
return
|
|
40
|
+
return `${section ? `#${encodeURIComponent(section)}` : '#'}:~:text=${text}`;
|
|
38
41
|
}
|
|
39
42
|
```
|
|
40
43
|
|
|
@@ -43,7 +46,7 @@ export function encodeTextFragment(quote, { prefix } = {}) {
|
|
|
43
46
|
The migration cut p95 latency by 38%
|
|
44
47
|
<a
|
|
45
48
|
class="ui-textref"
|
|
46
|
-
href="https://example.com/incident-review
|
|
49
|
+
href="https://example.com/incident-review#incident-summary:~:text=p95%20latency%20fell%2038%25"
|
|
47
50
|
>jump to the source</a
|
|
48
51
|
>.
|
|
49
52
|
</p>
|
|
@@ -56,12 +59,14 @@ Notes for an autonomous author:
|
|
|
56
59
|
- Keep the quote short and verbatim; a fuzzy or paraphrased quote won't match.
|
|
57
60
|
- Use the optional `prefix` (a `prefix-,` directive) to disambiguate a quote that
|
|
58
61
|
appears more than once on the target page.
|
|
62
|
+
- Firefox support starts at 131. The project floor includes Firefox 129, so make
|
|
63
|
+
the leading section fallback meaningful when exact quote landing matters.
|
|
59
64
|
|
|
60
65
|
## Class reference
|
|
61
66
|
|
|
62
67
|
| Class | Role |
|
|
63
68
|
| ------------- | ------------------------------------------------------------------- |
|
|
64
|
-
| `.ui-textref` | A citation link whose `href` is a
|
|
69
|
+
| `.ui-textref` | A citation link whose `href` is a `#section:~:text=` fragment; dotted underline + quote-jump cue. |
|
|
65
70
|
|
|
66
71
|
| Custom property | On | Meaning |
|
|
67
72
|
| ---------------------- | ------------- | ------------------------------------------------------------------------- |
|
package/docs/theming.md
CHANGED
|
@@ -26,8 +26,15 @@ So a full re-brand is one declaration **at `:root` (or a theme root)**:
|
|
|
26
26
|
:root[data-theme='dark'] { --accent: #6ea8ff; } /* per-theme tuning */
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
fills —
|
|
29
|
+
Core DOM accent surfaces — buttons, focus rings, dot motifs, accent borders,
|
|
30
|
+
soft fills — follow automatically, in both light and dark.
|
|
31
|
+
|
|
32
|
+
That scope matters. `--accent` is the core action/emphasis hue, not the whole
|
|
33
|
+
color system. Status colors (`--success`, `--warning`, `--danger`, `--info`),
|
|
34
|
+
neutral surface tiers, display-expression tokens, and the opt-in data-viz
|
|
35
|
+
palette stay separate governed tiers. Mermaid, D2, and Vega bridges emit
|
|
36
|
+
resolved renderer theme data; a rendered SVG or canvas does not live-reskin when
|
|
37
|
+
you change CSS `--accent` later.
|
|
31
38
|
|
|
32
39
|
> **Re-branding a subtree (not `:root`) is only a *partial* re-brand.**
|
|
33
40
|
> The derived family (`--accent-soft`, `--accent-strong`, `--accent-text`,
|
|
@@ -53,6 +60,8 @@ fills — follows automatically, in both light and dark.
|
|
|
53
60
|
> When in doubt, re-brand at `:root`/`[data-theme]` — that path re-derives
|
|
54
61
|
> the whole family for you.
|
|
55
62
|
|
|
63
|
+
### Re-brand obligations
|
|
64
|
+
|
|
56
65
|
> **Two contrast obligations when you change `--accent`:**
|
|
57
66
|
>
|
|
58
67
|
> 1. **Buttons** — pick an `--accent` with ≥ 4.5:1 against `--button-text`
|
|
@@ -106,7 +115,7 @@ fills — follows automatically, in both light and dark.
|
|
|
106
115
|
set `accent-color` yourself on them — this is the one accent surface
|
|
107
116
|
the framework can't tune for you.
|
|
108
117
|
|
|
109
|
-
## Beyond accent:
|
|
118
|
+
## Beyond accent: full re-skins
|
|
110
119
|
|
|
111
120
|
The "Nothing" look is the **default skin, not the architecture**. It is
|
|
112
121
|
a handful of token declarations deep — no selector hardcodes the
|
|
@@ -142,11 +151,12 @@ no fork:
|
|
|
142
151
|
```
|
|
143
152
|
|
|
144
153
|
That changes buttons, cards, inputs, badges, focus rings, the display
|
|
145
|
-
type and the dot motif together, because
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
154
|
+
type and the dot motif together, because those surfaces consume the token
|
|
155
|
+
contract — not because there is a per-component theme file. It does not
|
|
156
|
+
rewrite status semantics or chart palettes; those are governed by their own
|
|
157
|
+
tiers. This is the difference between a *system* and a *skin*: the skin is
|
|
158
|
+
swappable, the system (rationed colour, density, classless prose, minimal JS)
|
|
159
|
+
is what you are actually adopting.
|
|
150
160
|
|
|
151
161
|
Caveat, restated: a custom `--accent` is **your** contrast obligation —
|
|
152
162
|
the shipped palettes are CI-gated ([contrast.md](contrast.md)), a re-skin
|
package/docs/toc.md
CHANGED
|
@@ -81,3 +81,9 @@ for (const id of links.keys()) {
|
|
|
81
81
|
navigation landmark.
|
|
82
82
|
- Without the optional observer the rail is a normal anchored list — every link
|
|
83
83
|
still jumps to its section.
|
|
84
|
+
|
|
85
|
+
## Related
|
|
86
|
+
|
|
87
|
+
Use the [reporting toolbox](./reporting.md#the-analytical-toolbox-in-a-report)
|
|
88
|
+
to place `toc.css` in report surfaces, and use
|
|
89
|
+
[reference.md](./reference.md) for the generated class catalog.
|
package/docs/tree.md
CHANGED
|
@@ -38,8 +38,9 @@ open/close animation come from the platform. This leaf is the hierarchy *layer*
|
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
Add `name="…"` to sibling `<details class="ui-tree__branch">` to make them an
|
|
41
|
-
exclusive-accordion group (only one open at a time) — a platform behaviour
|
|
42
|
-
|
|
41
|
+
exclusive-accordion group (only one open at a time) — a platform behaviour in
|
|
42
|
+
Chrome 120+, Safari 17.2+, and Firefox 130+. If Firefox 129 must enforce
|
|
43
|
+
exclusivity, add a host-owned JS fallback or leave the branches independent.
|
|
43
44
|
|
|
44
45
|
## A11y honesty — disclosure group, not an ARIA tree
|
|
45
46
|
|
|
@@ -72,3 +73,9 @@ honest as-is.
|
|
|
72
73
|
open-branch accent cue is re-asserted with the system highlight.
|
|
73
74
|
- The chevron spin and the auto-height animation both respect
|
|
74
75
|
`prefers-reduced-motion`.
|
|
76
|
+
|
|
77
|
+
## Related
|
|
78
|
+
|
|
79
|
+
Use the [reporting toolbox](./reporting.md#the-analytical-toolbox-in-a-report)
|
|
80
|
+
to place `tree.css` in report surfaces, and use
|
|
81
|
+
[reference.md](./reference.md) for the generated class catalog.
|
package/docs/usage.md
CHANGED
|
@@ -404,7 +404,7 @@ infinite-clone track). It's a gallery: the user drives it.
|
|
|
404
404
|
|
|
405
405
|
## Display glyphs: when (and when not)
|
|
406
406
|
|
|
407
|
-
`@ponchia/ui/glyphs` is a
|
|
407
|
+
`@ponchia/ui/glyphs` is a 71-glyph dot-matrix icon set — navigation
|
|
408
408
|
(`arrow-*`, `chevron-*`), actions (`check`, `close`, `plus`, `minus`,
|
|
409
409
|
`search`, `menu`, `gear`), status (`info`, `warning`, `bell`, `lock`) and
|
|
410
410
|
common marks (`home`, `user`, `heart`, `star`, `spark`, circle-family marks) — rendered on the
|
|
@@ -624,7 +624,6 @@ HTML, print/PDF, and before any hydration:
|
|
|
624
624
|
| Accordion | native `<details>` / `<summary>` |
|
|
625
625
|
| Segmented control (`ui-segmented`) | `:has(input:checked)` over a radio group |
|
|
626
626
|
| Scroll-reveal (`ui-scroll-reveal`) | scroll-driven animation, zero JS |
|
|
627
|
-
| Modal via native `<dialog>` | the element brings focus-trap + Escape; `initDialog` only adds open-triggers + focus-return |
|
|
628
627
|
|
|
629
628
|
**Behavior-required — a CSS skin that needs its `init*` to be interactive.**
|
|
630
629
|
These are JS widgets wearing the Bronto look; without the behavior they are inert
|
|
@@ -640,6 +639,7 @@ These are JS widgets wearing the Bronto look; without the behavior they are iner
|
|
|
640
639
|
| Table sort/select (`[data-bronto-sortable]`) | `initTableSort` | a static table (still readable) |
|
|
641
640
|
| Popover (`ui-popover`) | `initPopover` | no placement/ARIA — prefer the native `popover` attribute |
|
|
642
641
|
| Carousel (`ui-carousel`) | `initCarousel` | a native scroll-snap track (usable, no controls) |
|
|
642
|
+
| Native dialog/lightbox (`<dialog>`, `ui-lightbox`) | `initDialog` | closed markup stays closed; `data-bronto-open`/close buttons do nothing. Do not use `open` as a modal fallback: it is non-modal and has no trigger/focus-return path |
|
|
643
643
|
| Controlled modal (`ui-modal.is-open`) | `initModal` | open skin only — no inert trap, focus-return, or Escape close signal |
|
|
644
644
|
| Menu (`data-bronto-menu`) | `initMenu` | a button next to a list with no open/close, outside-click, or Escape |
|
|
645
645
|
| Dismissible alert/callout (`data-bronto-dismissible`) | `dismissible` | the close affordance is just a button; nothing is removed |
|
package/docs/vega.md
CHANGED
|
@@ -143,8 +143,10 @@ series needs the redundant second channel, drive the mark's fill from the
|
|
|
143
143
|
|
|
144
144
|
### Spending the accent
|
|
145
145
|
|
|
146
|
-
Series 1 of `range.category`
|
|
147
|
-
the first category
|
|
146
|
+
Series 1 of `range.category` resolves to the accent (per theme), so a single-series
|
|
147
|
+
chart and the first category carry the accent automatically — baked into the
|
|
148
|
+
generated `config`, so regenerate the config and re-render to change it (Vega output
|
|
149
|
+
does not live-reskin from `--accent`). To emphasise one mark in a
|
|
148
150
|
multi-series chart, paint just that mark with the accent and leave the rest
|
|
149
151
|
neutral — the same "reserve the accent for the one thing a reader must not miss"
|
|
150
152
|
rule the rest of the system follows. Two small helpers hand you the exact
|
|
@@ -169,7 +171,7 @@ const spec = {
|
|
|
169
171
|
};
|
|
170
172
|
```
|
|
171
173
|
|
|
172
|
-
`brontoVegaAccent(theme)` is `range.category[0]` (the
|
|
174
|
+
`brontoVegaAccent(theme)` is `range.category[0]` (the resolved accent) and
|
|
173
175
|
`brontoVegaNeutral(theme)` is the last category (the quiet neutral); re-read both
|
|
174
176
|
when the theme toggles. Prefer them over digging the hex out of
|
|
175
177
|
`tokens/resolved.json` — they are guaranteed to match the palette the config
|
package/docs/workbench.md
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
# Workbench — split panes, inspector, properties, selection bar
|
|
1
|
+
# Workbench — split panes, toolstrips, inspector, properties, selection bar
|
|
2
2
|
|
|
3
3
|
`@ponchia/ui/css/workbench.css` is an opt-in set of primitives for **real
|
|
4
|
-
tools**: resizable split panes,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
is the low-risk core —
|
|
4
|
+
tools**: resizable split panes, compact toolstrips, button-mode segmented
|
|
5
|
+
controls, an inspector panel, property rows for a selected object, and a bar of
|
|
6
|
+
actions on the current selection. Generic kits stop at cards/tables/forms, so
|
|
7
|
+
every app builds its own half-consistent workbench. This is the low-risk core —
|
|
8
|
+
layout, dense controls, resize affordance, and ARIA value sync.
|
|
8
9
|
|
|
9
10
|
```css
|
|
10
11
|
@import '@ponchia/ui';
|
|
@@ -20,6 +21,51 @@ initSplitter();
|
|
|
20
21
|
Not in the core bundle. Import the CSS leaf where the workbench appears and run
|
|
21
22
|
`initSplitter()` only if the page includes `[data-bronto-splitter]`.
|
|
22
23
|
|
|
24
|
+
## Toolstrip — `.ui-toolstrip`
|
|
25
|
+
|
|
26
|
+
A compact row of controls for a tool surface or viewport. Use
|
|
27
|
+
`.ui-toolstrip--floating` when the strip sits over a canvas, chart, map, media
|
|
28
|
+
stage, or preview. The CSS owns density, wrapping, grouping, and raised/floating
|
|
29
|
+
treatment; the host owns commands, search behavior, active mode, responsive
|
|
30
|
+
hiding, and placement.
|
|
31
|
+
|
|
32
|
+
```html
|
|
33
|
+
<header class="ui-toolstrip ui-toolstrip--floating" aria-label="View controls">
|
|
34
|
+
<div class="ui-toolstrip__brand">
|
|
35
|
+
<strong>Repository</strong>
|
|
36
|
+
<span class="ui-toolstrip__context">main branch</span>
|
|
37
|
+
</div>
|
|
38
|
+
<div class="ui-toolstrip__group" aria-label="Mode">
|
|
39
|
+
<button class="ui-segmented-buttons__button" type="button" aria-pressed="true">Map</button>
|
|
40
|
+
<button class="ui-segmented-buttons__button" type="button" aria-pressed="false">Flow</button>
|
|
41
|
+
<button class="ui-segmented-buttons__button" type="button" aria-pressed="false">Risk</button>
|
|
42
|
+
</div>
|
|
43
|
+
<label class="ui-toolstrip__search">
|
|
44
|
+
<span class="ui-visually-hidden">Filter items</span>
|
|
45
|
+
<input class="ui-input" type="search" placeholder="Filter by path, owner, or tag" />
|
|
46
|
+
</label>
|
|
47
|
+
<div class="ui-toolstrip__actions" aria-label="Viewport actions">
|
|
48
|
+
<button class="ui-button ui-button--ghost ui-button--icon ui-button--sm" type="button">
|
|
49
|
+
Fit
|
|
50
|
+
</button>
|
|
51
|
+
</div>
|
|
52
|
+
</header>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Button segmented control — `.ui-segmented-buttons`
|
|
56
|
+
|
|
57
|
+
Use `.ui-segmented-buttons` when each option is a real command button and the
|
|
58
|
+
current mode is exposed with `aria-pressed`. For form values submitted with the
|
|
59
|
+
page, keep using the core `.ui-segmented` radio-input pattern.
|
|
60
|
+
|
|
61
|
+
```html
|
|
62
|
+
<div class="ui-segmented-buttons" aria-label="Density">
|
|
63
|
+
<button class="ui-segmented-buttons__button" type="button" aria-pressed="true">Dense</button>
|
|
64
|
+
<button class="ui-segmented-buttons__button" type="button" aria-pressed="false">Comfort</button>
|
|
65
|
+
<button class="ui-segmented-buttons__button" type="button" aria-pressed="false">Wide</button>
|
|
66
|
+
</div>
|
|
67
|
+
```
|
|
68
|
+
|
|
23
69
|
## Splitter — `.ui-splitter`
|
|
24
70
|
|
|
25
71
|
Two panes separated by a focusable ARIA separator handle. The CSS owns the grid
|
|
@@ -113,7 +159,8 @@ A raised bar of actions on the current selection: a `__count` on one side,
|
|
|
113
159
|
## Scope
|
|
114
160
|
|
|
115
161
|
No recipes — these are structural containers and rows; apply the classes
|
|
116
|
-
directly (or read them from `cls.
|
|
117
|
-
Pair the selection bar with the cross-cutting
|
|
118
|
-
on the selected items themselves. Bronto styles
|
|
119
|
-
affordance; the host owns hit-testing,
|
|
162
|
+
directly (or read them from `cls.toolstrip`, `cls.splitter`, `cls.inspector`,
|
|
163
|
+
`cls.property`, …). Pair the selection bar with the cross-cutting
|
|
164
|
+
[`ui-sel`](./selection.md) states on the selected items themselves. Bronto styles
|
|
165
|
+
the chrome and wires the splitter affordance; the host owns hit-testing,
|
|
166
|
+
persistence, pane contents, viewport semantics, and commands.
|
package/glyphs/glyphs.js
CHANGED
|
@@ -1396,14 +1396,18 @@ export function findGlyphs(query) {
|
|
|
1396
1396
|
|
|
1397
1397
|
const TONE = { '#': 'hot', '*': 'accent' };
|
|
1398
1398
|
|
|
1399
|
+
function glyphRows(name) {
|
|
1400
|
+
return Object.hasOwn(GLYPHS, name) ? GLYPHS[name] : undefined;
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1399
1403
|
/** The raw bitmap rows for a glyph, or `undefined` if the name is unknown. */
|
|
1400
1404
|
export function glyph(name) {
|
|
1401
|
-
return
|
|
1405
|
+
return glyphRows(name);
|
|
1402
1406
|
}
|
|
1403
1407
|
|
|
1404
1408
|
/** GLYPH_SIZE² cell descriptors (row-major), or `[]` if the name is unknown. */
|
|
1405
1409
|
export function glyphCells(name) {
|
|
1406
|
-
const rows =
|
|
1410
|
+
const rows = glyphRows(name);
|
|
1407
1411
|
if (!rows) return [];
|
|
1408
1412
|
const cells = [];
|
|
1409
1413
|
for (const row of rows) {
|
|
@@ -1425,7 +1429,7 @@ export function glyphCells(name) {
|
|
|
1425
1429
|
* @returns {string}
|
|
1426
1430
|
*/
|
|
1427
1431
|
export function glyphMask(name) {
|
|
1428
|
-
const rows =
|
|
1432
|
+
const rows = glyphRows(name);
|
|
1429
1433
|
return rows ? maskUrl(rows) : '';
|
|
1430
1434
|
}
|
|
1431
1435
|
|
|
@@ -1446,13 +1450,63 @@ function esc(s) {
|
|
|
1446
1450
|
.replace(/"/g, '"');
|
|
1447
1451
|
}
|
|
1448
1452
|
|
|
1453
|
+
const CSS_LENGTH_UNITS =
|
|
1454
|
+
'(?:px|r?em|ch|ex|cap|ic|lh|rlh|vw|vh|vi|vb|vmin|vmax|' +
|
|
1455
|
+
'svw|svh|svi|svb|svmin|svmax|lvw|lvh|lvi|lvb|lvmin|lvmax|' +
|
|
1456
|
+
'dvw|dvh|dvi|dvb|dvmin|dvmax|cm|mm|q|in|pc|pt|%)';
|
|
1457
|
+
const CSS_NUMBER = '[-+]?(?:\\d*\\.\\d+|\\d+)';
|
|
1458
|
+
const CSS_LENGTH_RE = new RegExp(`^(?:0|${CSS_NUMBER}${CSS_LENGTH_UNITS})$`, 'i');
|
|
1459
|
+
const CSS_CALC_VALUE_RE = new RegExp(`^${CSS_NUMBER}(?:${CSS_LENGTH_UNITS})?`, 'i');
|
|
1460
|
+
|
|
1461
|
+
function isCalcLength(expr) {
|
|
1462
|
+
let rest = expr.trim();
|
|
1463
|
+
let depth = 0;
|
|
1464
|
+
let sawLength = false;
|
|
1465
|
+
let expectValue = true;
|
|
1466
|
+
|
|
1467
|
+
while (rest) {
|
|
1468
|
+
if (expectValue) {
|
|
1469
|
+
if (rest[0] === '(') {
|
|
1470
|
+
depth += 1;
|
|
1471
|
+
rest = rest.slice(1).trim();
|
|
1472
|
+
continue;
|
|
1473
|
+
}
|
|
1474
|
+
const token = rest.match(CSS_CALC_VALUE_RE)?.[0];
|
|
1475
|
+
if (!token) return false;
|
|
1476
|
+
if (CSS_LENGTH_RE.test(token)) sawLength = true;
|
|
1477
|
+
rest = rest.slice(token.length).trim();
|
|
1478
|
+
expectValue = false;
|
|
1479
|
+
continue;
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
if (rest[0] === ')') {
|
|
1483
|
+
depth -= 1;
|
|
1484
|
+
if (depth < 0) return false;
|
|
1485
|
+
rest = rest.slice(1).trim();
|
|
1486
|
+
continue;
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
const op = rest.match(/^[+\-*/]/)?.[0];
|
|
1490
|
+
if (!op) return false;
|
|
1491
|
+
rest = rest.slice(op.length).trim();
|
|
1492
|
+
expectValue = true;
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
if (!sawLength) return false;
|
|
1496
|
+
if (expectValue) return false;
|
|
1497
|
+
return depth === 0;
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1449
1500
|
// `dot`, `gap`, and `size` land in an inline-CSS context (`style="…"`), where
|
|
1450
1501
|
// HTML-escaping a `"` stops attribute breakout but a `;` would still open a
|
|
1451
|
-
// second CSS declaration
|
|
1452
|
-
// them to length/calc syntax — digits, units, %, whitespace and `()+-*/.,` for
|
|
1453
|
-
// calc()/clamp()/var() — and drop anything else rather than emit it.
|
|
1502
|
+
// second CSS declaration. Accept only concrete CSS lengths or calc() expressions.
|
|
1454
1503
|
function cssLen(v) {
|
|
1455
|
-
|
|
1504
|
+
const value = String(v ?? '').trim();
|
|
1505
|
+
if (CSS_LENGTH_RE.test(value)) return value;
|
|
1506
|
+
if (value.toLowerCase().startsWith('calc(') && value.endsWith(')')) {
|
|
1507
|
+
return isCalcLength(value.slice(5, -1)) ? value : '';
|
|
1508
|
+
}
|
|
1509
|
+
return '';
|
|
1456
1510
|
}
|
|
1457
1511
|
|
|
1458
1512
|
/**
|
|
@@ -1514,7 +1568,7 @@ function maskUrl(rows) {
|
|
|
1514
1568
|
* Needs `@ponchia/ui/css` (the `.ui-icon` rule).
|
|
1515
1569
|
*/
|
|
1516
1570
|
export function renderGlyph(name, options = {}) {
|
|
1517
|
-
const rows =
|
|
1571
|
+
const rows = glyphRows(name);
|
|
1518
1572
|
if (!rows) return '';
|
|
1519
1573
|
const { grid = true, solid = false, anim, label, dot, gap, render, size } = options;
|
|
1520
1574
|
|
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|