@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.
Files changed (145) hide show
  1. package/CHANGELOG.md +92 -0
  2. package/README.md +38 -25
  3. package/annotations/index.d.ts +15 -15
  4. package/annotations/index.d.ts.map +1 -1
  5. package/annotations/index.js +52 -34
  6. package/behaviors/carousel.d.ts +7 -3
  7. package/behaviors/carousel.d.ts.map +1 -1
  8. package/behaviors/carousel.js +157 -27
  9. package/behaviors/combobox.d.ts +1 -1
  10. package/behaviors/combobox.d.ts.map +1 -1
  11. package/behaviors/combobox.js +46 -23
  12. package/behaviors/command.d.ts +1 -1
  13. package/behaviors/command.d.ts.map +1 -1
  14. package/behaviors/command.js +63 -23
  15. package/behaviors/connectors.d.ts.map +1 -1
  16. package/behaviors/connectors.js +126 -19
  17. package/behaviors/crosshair.d.ts.map +1 -1
  18. package/behaviors/crosshair.js +71 -8
  19. package/behaviors/dialog.d.ts.map +1 -1
  20. package/behaviors/dialog.js +20 -3
  21. package/behaviors/disclosure.d.ts.map +1 -1
  22. package/behaviors/disclosure.js +35 -6
  23. package/behaviors/dismissible.js +1 -1
  24. package/behaviors/forms.d.ts +23 -2
  25. package/behaviors/forms.d.ts.map +1 -1
  26. package/behaviors/forms.js +97 -9
  27. package/behaviors/glyph.d.ts.map +1 -1
  28. package/behaviors/glyph.js +56 -5
  29. package/behaviors/internal.d.ts.map +1 -1
  30. package/behaviors/internal.js +52 -5
  31. package/behaviors/menu.d.ts.map +1 -1
  32. package/behaviors/menu.js +2 -1
  33. package/behaviors/modal.d.ts.map +1 -1
  34. package/behaviors/modal.js +25 -9
  35. package/behaviors/popover.d.ts.map +1 -1
  36. package/behaviors/popover.js +8 -6
  37. package/behaviors/sources.d.ts.map +1 -1
  38. package/behaviors/sources.js +24 -3
  39. package/behaviors/splitter.d.ts.map +1 -1
  40. package/behaviors/splitter.js +27 -6
  41. package/behaviors/table.d.ts.map +1 -1
  42. package/behaviors/table.js +44 -7
  43. package/behaviors/tabs.d.ts.map +1 -1
  44. package/behaviors/tabs.js +51 -14
  45. package/behaviors/theme.d.ts.map +1 -1
  46. package/behaviors/theme.js +64 -4
  47. package/behaviors/toast.d.ts +6 -1
  48. package/behaviors/toast.d.ts.map +1 -1
  49. package/behaviors/toast.js +48 -12
  50. package/classes/classes.json +57 -2
  51. package/classes/index.d.ts +13 -2
  52. package/classes/index.js +88 -40
  53. package/connectors/index.d.ts +4 -4
  54. package/connectors/index.d.ts.map +1 -1
  55. package/connectors/index.js +14 -12
  56. package/css/annotations.css +1 -0
  57. package/css/app.css +7 -0
  58. package/css/base.css +3 -0
  59. package/css/bullet.css +41 -7
  60. package/css/code.css +14 -0
  61. package/css/command.css +10 -0
  62. package/css/dataviz.css +27 -0
  63. package/css/diff.css +2 -0
  64. package/css/disclosure.css +8 -0
  65. package/css/dots.css +1 -1
  66. package/css/feedback.css +9 -0
  67. package/css/interval.css +20 -2
  68. package/css/legend.css +10 -9
  69. package/css/marks.css +1 -0
  70. package/css/motion.css +2 -0
  71. package/css/overlay.css +14 -2
  72. package/css/primitives.css +1 -1
  73. package/css/report.css +3 -0
  74. package/css/sources.css +4 -4
  75. package/css/spotlight.css +6 -0
  76. package/css/table.css +19 -0
  77. package/css/term.css +4 -1
  78. package/css/tokens.css +8 -13
  79. package/css/workbench.css +128 -0
  80. package/dist/bronto.css +1 -1
  81. package/dist/css/analytical.css +1 -1
  82. package/dist/css/app.css +1 -1
  83. package/dist/css/bullet.css +1 -1
  84. package/dist/css/code.css +1 -1
  85. package/dist/css/command.css +1 -1
  86. package/dist/css/dataviz.css +1 -1
  87. package/dist/css/diff.css +1 -1
  88. package/dist/css/disclosure.css +1 -1
  89. package/dist/css/dots.css +1 -1
  90. package/dist/css/feedback.css +1 -1
  91. package/dist/css/interval.css +1 -1
  92. package/dist/css/legend.css +1 -1
  93. package/dist/css/marks.css +1 -1
  94. package/dist/css/overlay.css +1 -1
  95. package/dist/css/primitives.css +1 -1
  96. package/dist/css/report-kit.css +1 -1
  97. package/dist/css/sources.css +1 -1
  98. package/dist/css/spotlight.css +1 -1
  99. package/dist/css/table.css +1 -1
  100. package/dist/css/term.css +1 -1
  101. package/dist/css/tokens.css +1 -1
  102. package/dist/css/workbench.css +1 -1
  103. package/docs/annotations.md +27 -0
  104. package/docs/architecture.md +5 -3
  105. package/docs/bullet.md +6 -1
  106. package/docs/clamp.md +5 -0
  107. package/docs/command.md +3 -2
  108. package/docs/contrast.md +3 -3
  109. package/docs/crosshair.md +6 -0
  110. package/docs/dots.md +10 -3
  111. package/docs/figure.md +7 -0
  112. package/docs/glyphs.md +14 -2
  113. package/docs/highlights.md +9 -0
  114. package/docs/interval.md +6 -0
  115. package/docs/mermaid.md +5 -3
  116. package/docs/package-contract.md +24 -1
  117. package/docs/reference.md +21 -1
  118. package/docs/reporting.md +8 -8
  119. package/docs/selection.md +9 -0
  120. package/docs/sources.md +5 -0
  121. package/docs/state.md +6 -0
  122. package/docs/textref.md +18 -13
  123. package/docs/theming.md +18 -8
  124. package/docs/toc.md +6 -0
  125. package/docs/tree.md +9 -2
  126. package/docs/usage.md +2 -2
  127. package/docs/vega.md +5 -3
  128. package/docs/workbench.md +56 -9
  129. package/glyphs/glyphs.js +62 -8
  130. package/index.d.ts +1 -0
  131. package/llms.txt +18 -14
  132. package/package.json +98 -6
  133. package/qwik/index.d.ts +4 -3
  134. package/qwik/index.d.ts.map +1 -1
  135. package/qwik/index.js +7 -5
  136. package/react/index.d.ts +4 -3
  137. package/react/index.d.ts.map +1 -1
  138. package/react/index.js +3 -2
  139. package/solid/index.d.ts +7 -5
  140. package/solid/index.d.ts.map +1 -1
  141. package/solid/index.js +11 -7
  142. package/tokens/vega.d.ts +1 -1
  143. package/tokens/vega.js +3 -2
  144. package/vue/index.d.ts.map +1 -1
  145. package/vue/index.js +37 -3
package/CHANGELOG.md CHANGED
@@ -5,6 +5,98 @@
5
5
  |> `^0` / `*` wildcard does **not** protect you. See README → Versioning, and
6
6
  |> the deprecation policy in CONTRIBUTING.md.
7
7
 
8
+ ## 0.6.11 — 2026-07-04
9
+
10
+ A correctness, accessibility, and performance release drawn from a multi-pass
11
+ review of the behavior layer and docs. No default-bundle contract change, no
12
+ public class/token/subpath renames, and the CSS payload is unchanged — this is a
13
+ non-breaking patch. Every change landed through PR CI, including the aggregate
14
+ `check` gate and cross-engine (Chromium/Firefox/WebKit) end-to-end coverage.
15
+
16
+ ### Added
17
+
18
+ - **Localization hooks for behavior-authored text.** New opt-in attributes let
19
+ hosts localize the strings behaviors set on enhanced elements —
20
+ `data-bronto-carousel-roledescription` and
21
+ `data-bronto-carousel-slide-roledescription` for carousel/slide
22
+ `aria-roledescription`, plus localized error-summary title, toast dismiss
23
+ label, combobox, command, and table hooks. Absent an override, the existing
24
+ English defaults are preserved, and any author-provided value now wins over the
25
+ behavior's default.
26
+ - **Root type resolution for `import '@ponchia/ui'`.** The package root now
27
+ advertises a types condition (`index.d.ts`) so TypeScript consumers importing
28
+ the CSS entry resolve types without reaching for a subpath.
29
+ - **Concepts guide.** `docs/concepts.md` is a new canonical mental-model page
30
+ that consolidates the load-bearing concepts (CSS-first, the cooperative
31
+ `@layer bronto` override model, the tiered color model, primitive ownership,
32
+ identity-vs-inventory bundling, token projections, and the package-path
33
+ contract) that were previously scattered across many pages.
34
+
35
+ ### Fixed
36
+
37
+ - **Focus management.** `focusInto()` now skips hidden, `inert`, disabled, and
38
+ non-rendered candidates instead of parking focus on them; the tablist roving
39
+ set excludes hidden/disabled tabs so keyboard focus can always enter it; and a
40
+ closed controlled (non-`<dialog>`) modal is hidden while closed, so its
41
+ controls are no longer reachable by Tab.
42
+ - **Screen-reader announcements.** The assertive toast stack no longer
43
+ re-announces earlier toasts when a new one arrives; the command palette's empty
44
+ state is a polite live region; the combobox listbox now mirrors the input's
45
+ accessible name (via `aria-labelledby`/`title`); and toast/command/combobox
46
+ ARIA added at init is fully restored on cleanup.
47
+ - **Internationalization.** Combobox, command, and table filtering/sorting are
48
+ locale-aware, and a Unicode minus in `data-sort-value` (e.g. `−3,5`) now parses
49
+ correctly instead of sorting as `-35`.
50
+ - **Connector resilience and scoping.** A malformed enum on one connector no
51
+ longer aborts its siblings, and a scoped connector can no longer resolve an
52
+ endpoint to a same-id element outside its root.
53
+ - **Attribute parsing.** Splitter ARIA-range values are parsed strictly and
54
+ rewritten to a canonical numeric form; splitter/glyph enum values and the
55
+ dismissible target selector are trimmed, so trailing whitespace no longer
56
+ changes behavior.
57
+ - **Theme following the OS.** When no explicit theme is set, an OS
58
+ `prefers-color-scheme` change now updates the theme toggle's `aria-pressed`,
59
+ and the render-blocking no-flash snippets in the integration and framework
60
+ guides validate the stored value is `light` or `dark` before applying it.
61
+
62
+ ### Performance
63
+
64
+ - **Behavior hot paths.** Connector redraw caches its records and endpoint map
65
+ per init and batches scroll/resize/observer redraws through one animation
66
+ frame; source backrefs build one island-scoped id map instead of rescanning
67
+ per citation; the crosshair caches layout reads across `pointermove`; the table
68
+ text sort decorates rows once instead of parsing inside the comparator; and a
69
+ genuine user scroll during a carousel's programmatic-scroll suppression is now
70
+ replayed instead of dropped. Observable behavior is unchanged.
71
+
72
+ ### Verified
73
+
74
+ - PR CI passed for every change, including the aggregate `check` gate,
75
+ cross-engine e2e, CodeQL, and the packed examples matrix. The default bundle
76
+ and its size are unchanged; this release adds optional localization hooks, root
77
+ type resolution, and documentation, and fixes accessibility, correctness, and
78
+ performance defects without moving the public contract.
79
+
80
+ ## 0.6.10 — 2026-06-23
81
+
82
+ ### Added
83
+
84
+ - **Workbench toolstrip primitives.** `workbench.css`, the generated class
85
+ registry, and the workbench docs now cover floating toolstrips, compact
86
+ grouped actions, segmented button groups, contextual labels, and search/action
87
+ slots for dense canvas or editor-style tools.
88
+ - **Annotation composition guidance.** The annotation docs now show how the
89
+ dependency-free `@ponchia/ui` annotation surface composes with richer
90
+ annotation engines in a workbench-style consumer, while keeping runtime
91
+ package boundaries explicit.
92
+
93
+ ### Verified
94
+
95
+ - **Release evidence.** PR CI passed for the workbench expansion, including the
96
+ aggregate `check` gate, Chromium e2e, CodeQL, and the packed examples matrix.
97
+ This release adds opt-in workbench CSS and generated class/docs artifacts; it
98
+ does not move the default bundle contract.
99
+
8
100
  ## 0.6.9 — 2026-06-20
9
101
 
10
102
  ### Changed
package/README.md CHANGED
@@ -3,26 +3,37 @@
3
3
  [![npm](https://img.shields.io/npm/v/@ponchia/ui?logo=npm)](https://www.npmjs.com/package/@ponchia/ui)
4
4
  [![npm provenance](https://img.shields.io/badge/npm-provenance-blue?logo=npm)](https://www.npmjs.com/package/@ponchia/ui#provenance)
5
5
  [![runtime deps](https://img.shields.io/badge/runtime%20deps-0-brightgreen)](https://github.com/Ponchia/bronto-ui/blob/main/package.json)
6
- [![dist](https://img.shields.io/badge/dist-~88kB%20%2F%20~15kB%20gzip-informational)](https://github.com/Ponchia/bronto-ui/blob/main/scripts/check-dist.mjs)
6
+ [![default CSS](https://img.shields.io/badge/default%20CSS-~89kB%20%2F%20~15kB%20gzip-informational)](https://github.com/Ponchia/bronto-ui/blob/main/scripts/check-dist.mjs)
7
7
  [![CI](https://github.com/Ponchia/bronto-ui/actions/workflows/ci.yml/badge.svg)](https://github.com/Ponchia/bronto-ui/actions/workflows/ci.yml)
8
8
  [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/Ponchia/bronto-ui/badge)](https://scorecard.dev/viewer/?uri=github.com/Ponchia/bronto-ui)
9
9
  [![license: MIT](https://img.shields.io/badge/license-MIT-blue)](https://github.com/Ponchia/bronto-ui/blob/main/LICENSE)
10
10
 
11
- **A CSS-first identity and UI layer for services, tools, sites, and reports.** It
12
- works in plain HTML, every modern framework, and print/PDF, with no component
13
- runtime to adopt and zero runtime dependencies.
14
-
15
- The look is a deliberate stance: a neutral monochrome canvas with one rationed
16
- accent (colour signals, it never decorates), dot-matrix display type, and
17
- hairline borders all re-skinnable from a single `--accent` knob (opt-in
18
- amber-CRT, phosphor-green, and e-ink colorways).
19
-
20
- The default bundle is the shared service identity: app shells, navigation,
21
- forms, tables, feedback, overlays, workflow surfaces, prose, motion and the
22
- token system that lets each app feel related without sharing a component
23
- runtime. On top of that it ships opt-in tooling/report layers workbench panes,
24
- commands, system state, provenance, figure stages, annotations, legends,
25
- evidence highlights, intervals, data-viz tokens and a static/PDF report grammar.
11
+ **A CSS-first identity layer for services, tools, and reports that need
12
+ provenance.** It works in plain HTML, modern frameworks, and print/PDF, with no
13
+ component runtime to adopt and zero runtime dependencies.
14
+
15
+ The sharpest lane is report and tooling UI: static/PDF reports, evidence,
16
+ provenance, system state, dense workbenches, and explanatory figures. The
17
+ default CSS bundle stays the shared service identity, not the whole package:
18
+ app shells, navigation, forms, tables, feedback, overlays, prose, motion, and
19
+ the token system that lets apps feel related without sharing a component runtime.
20
+
21
+ The look is deliberately restrained: a mostly neutral canvas, one core accent
22
+ for emphasis, dot-matrix display type, and hairline borders. Status colors,
23
+ display-expression tokens, and data-viz colors are separate governed tiers, not
24
+ extra brand accents. Opt-in skins re-point the root accent; Mermaid, D2, and
25
+ Vega bridges use resolved renderer theme data instead of live CSS variables.
26
+
27
+ ## Start here
28
+
29
+ - **Building an app or service shell?** Use the quick start below, then the
30
+ framework guide for your stack.
31
+ - **Building a report, audit, or provenance view?** Start with
32
+ [docs/reporting.md](docs/reporting.md) and
33
+ [docs/frontier-primitives.md](docs/frontier-primitives.md).
34
+ - **Maintaining or integrating the package?** Read
35
+ [docs/architecture.md](docs/architecture.md),
36
+ [docs/stability.md](docs/stability.md), and `llms.txt`.
26
37
 
27
38
  ### [Live demo →](https://ponchia.github.io/bronto-ui/) &nbsp;·&nbsp; [Service shell →](https://ponchia.github.io/bronto-ui/demo/service.html) &nbsp;·&nbsp; [Static report →](https://ponchia.github.io/bronto-ui/demo/report-standalone.html) &nbsp;·&nbsp; [Theme playground →](https://ponchia.github.io/bronto-ui/demo/theme-playground.html)
28
39
 
@@ -46,9 +57,11 @@ that genuinely need JS (theme persistence, dialogs, toasts, disclosure).
46
57
 
47
58
  The guiding principle is that **colour is rationed and structure carries
48
59
  meaning** — layout, type weight, and the hairline do the work before a hue does,
49
- and the accent is a spotlight, not a paint bucket. Because everything lives in a
50
- single `@layer bronto`, your own un-layered CSS overrides the framework with no
51
- specificity fight and no `!important`.
60
+ and the accent is a spotlight, not a paint bucket. Because framework rules live
61
+ in `@layer bronto`, ordinary un-layered consumer CSS overrides them without a
62
+ specificity fight. Print and reduced-motion rules still use `!important`
63
+ deliberately where the framework must neutralize animation or layout at a media
64
+ boundary.
52
65
 
53
66
  It ships a complete, accessible **standard component set** because that is the
54
67
  identity layer every service consumes. Its sharper edge is the opt-in **tooling,
@@ -67,12 +80,12 @@ npm i @ponchia/ui
67
80
  Or drop it in with no build step, straight from a CDN:
68
81
 
69
82
  ```html
70
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ponchia/ui@0.6.9/dist/bronto.css">
83
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ponchia/ui@0.6.11/dist/bronto.css">
71
84
  ```
72
85
 
73
86
  ## Quick start
74
87
 
75
- **1. Load the CSS.** One flattened, minified bundle — the whole standard component set, one request (~88 kB raw / ~15 kB gzip):
88
+ **1. Load the CSS.** One flattened, minified default CSS bundle — the standard component set, one request (~89 kB raw / ~15 kB gzip) — that is `dist/bronto.css`, not the whole package tarball:
76
89
 
77
90
  ```css
78
91
  @import '@ponchia/ui'; /* via a bundler */
@@ -85,7 +98,7 @@ Or drop it in with no build step, straight from a CDN:
85
98
 
86
99
  > Prefer source leaves through a bundler? Use `@import '@ponchia/ui/css'` (a thin `@import` fan-out) instead. Both resolve the Doto `@font-face` with relative URLs, so there's no `/fonts` path assumption.
87
100
 
88
- > The bundle is the standard component set. The opt-in analytical & report layers — `report.css`, `dataviz.css`, `figure.css`, `annotations.css`, `legend.css`, `interval.css`, `clamp.css`, `highlights.css`, and the rest — are **not** in `bronto.css`; link each one you need from `dist/css/`. For LLM-authored static reports see [docs/reporting.md](docs/reporting.md).
101
+ > The size above is only `dist/bronto.css`. The opt-in analytical and report layers — `report.css`, `dataviz.css`, `figure.css`, `annotations.css`, `legend.css`, `interval.css`, `clamp.css`, `highlights.css`, and the rest — are **not** in the default CSS bundle; link each one you need from `dist/css/`. For LLM-authored static reports see [docs/reporting.md](docs/reporting.md).
89
102
 
90
103
  **2. Write markup with `ui-*` classes** (primary is the default button; modifiers are opt-in):
91
104
 
@@ -151,7 +164,7 @@ Full generated catalog of every class: **[docs/reference.md](https://github.com/
151
164
 
152
165
  ## Theming: one knob
153
166
 
154
- Everything accent-colored derives from a single `--accent` variable via `color-mix()`. Re-brand the entire app — both light and dark — with root-level, per-theme overrides:
167
+ Core DOM accent surfaces derive from a single `--accent` variable via `color-mix()`. Re-brand the entire app — both light and dark — with root-level, per-theme overrides:
155
168
 
156
169
  ```css
157
170
  :root { --accent: #2f6df6; } /* whole app blue */
@@ -162,11 +175,11 @@ derived family (`--accent-text`, `--accent-soft`, focus/dot/ramp tokens) is a
162
175
  root-level skin contract. Use the full per-theme recipe in
163
176
  [`docs/theming.md`](docs/theming.md) for production rebrands.
164
177
 
165
- Buttons, focus rings, dot motifs, accent borders and soft fills all follow automatically. Light/dark is `data-theme="light"` / `"dark"` on `<html>` (defaults to `prefers-color-scheme`); `data-density` and `data-contrast` give density and contrast presets. A full re-skin (radius, display face, dot density, surfaces) is a handful more token overrides — the default monochrome look is **one skin, not the architecture**.
178
+ Buttons, focus rings, dot motifs, accent borders and soft fills follow the root accent automatically. Light/dark is `data-theme="light"` / `"dark"` on `<html>` (defaults to `prefers-color-scheme`); `data-density` and `data-contrast` give density and contrast presets. A full re-skin (radius, display face, dot density, surfaces) is a handful more token overrides, while status colours and data-viz colours remain their own governed tiers — the default monochrome look is **one skin, not the architecture**.
166
179
 
167
180
  **One system, many skins.** That the knob is real isn't a claim — it ships: drop in `@ponchia/ui/css/skins.css` and set `data-bronto-skin="amber-crt | phosphor-green | e-ink"` on `<html>` for a complete, contrast-gated recolour (the derived accent family, focus ring, dot-matrix and glyphs all follow). Colour is governed in **tiers** — neutral canvas · one accent · locked status · display expression · opt-in data-viz — so it always earns its place; the full constitution is **[ADR-0001](https://github.com/Ponchia/bronto-ui/blob/main/docs/adr/0001-color-system.md)**.
168
181
 
169
- > When you change `--accent`, contrast becomes yours: verify your hue in the **[theme playground](https://ponchia.github.io/bronto-ui/demo/theme-playground.html)** (it shows the derived family and computed WCAG ratios). Full contract: **[docs/theming.md](https://github.com/Ponchia/bronto-ui/blob/main/docs/theming.md)**.
182
+ > When you change `--accent`, contrast becomes yours: verify your hue in the **[theme playground](https://ponchia.github.io/bronto-ui/demo/theme-playground.html)** (it shows the derived family and computed WCAG ratios). Mermaid, D2, and Vega helpers emit resolved theme data for those renderers; they do not live-reskin from a later CSS `--accent` override. Full contract: **[docs/theming.md](https://github.com/Ponchia/bronto-ui/blob/main/docs/theming.md)**.
170
183
 
171
184
  ## Accessibility
172
185
 
@@ -12,52 +12,52 @@ export function noteTransform({ dx, dy, x, y, align, valign, width, height, }?:
12
12
  * @param {NotePlacementOptions} options
13
13
  * @returns {NotePlacement}
14
14
  */
15
- export function notePlacement({ x, y, width, height, bounds, padding, gap, preferred, inset, }?: NotePlacementOptions): NotePlacement;
15
+ export function notePlacement(options: NotePlacementOptions): NotePlacement;
16
16
  /**
17
17
  * @param {CircleSubjectOptions} options
18
18
  * @returns {string}
19
19
  */
20
- export function circleSubjectPath({ radius }?: CircleSubjectOptions): string;
20
+ export function circleSubjectPath(options: CircleSubjectOptions): string;
21
21
  /**
22
22
  * @param {RectSubjectOptions} options
23
23
  * @returns {string}
24
24
  */
25
- export function rectSubjectPath({ width, height, x, y, padding }?: RectSubjectOptions): string;
25
+ export function rectSubjectPath(options: RectSubjectOptions): string;
26
26
  /**
27
27
  * @param {ThresholdOptions} options
28
28
  * @returns {string}
29
29
  */
30
- export function thresholdPath({ x1, y1, x2, y2 }?: ThresholdOptions): string;
30
+ export function thresholdPath(options: ThresholdOptions): string;
31
31
  /**
32
32
  * @param {AxisThresholdOptions} options
33
33
  * @returns {string}
34
34
  */
35
- export function axisThresholdPath({ orientation, value, start, end }?: AxisThresholdOptions): string;
35
+ export function axisThresholdPath(options: AxisThresholdOptions): string;
36
36
  /**
37
37
  * @param {BracketSubjectOptions} options
38
38
  * @returns {string}
39
39
  */
40
- export function bracketSubjectPath({ x1, y1, x2, y2, depth }?: BracketSubjectOptions): string;
40
+ export function bracketSubjectPath(options: BracketSubjectOptions): string;
41
41
  /**
42
42
  * @param {BandSubjectOptions} options
43
43
  * @returns {string}
44
44
  */
45
- export function bandSubjectPath({ x, y, width, height, padding }?: BandSubjectOptions): string;
45
+ export function bandSubjectPath(options: BandSubjectOptions): string;
46
46
  /**
47
47
  * @param {SlopeSubjectOptions} options
48
48
  * @returns {string}
49
49
  */
50
- export function slopeSubjectPath({ x1, y1, x2, y2 }?: SlopeSubjectOptions): string;
50
+ export function slopeSubjectPath(options: SlopeSubjectOptions): string;
51
51
  /**
52
52
  * @param {ComparisonBraceOptions} options
53
53
  * @returns {string}
54
54
  */
55
- export function comparisonBracePath({ x1, y1, x2, y2, depth }?: ComparisonBraceOptions): string;
55
+ export function comparisonBracePath(options: ComparisonBraceOptions): string;
56
56
  /**
57
57
  * @param {OutlierClusterOptions} options
58
58
  * @returns {string}
59
59
  */
60
- export function outlierClusterPath({ points, radius }?: OutlierClusterOptions): string;
60
+ export function outlierClusterPath(options: OutlierClusterOptions): string;
61
61
  /**
62
62
  * @param {TimelineEventOptions} [options]
63
63
  * @returns {string}
@@ -72,27 +72,27 @@ export function evidenceMarkerPath({ x, y, width, height, padding }?: EvidenceMa
72
72
  * @param {ConnectorEndDotOptions} options
73
73
  * @returns {string}
74
74
  */
75
- export function connectorEndDot({ x, y, radius }?: ConnectorEndDotOptions): string;
75
+ export function connectorEndDot(options: ConnectorEndDotOptions): string;
76
76
  /**
77
77
  * @param {ConnectorEndArrowOptions} options
78
78
  * @returns {string}
79
79
  */
80
- export function connectorEndArrow({ x1, y1, x2, y2, size, spread }?: ConnectorEndArrowOptions): string;
80
+ export function connectorEndArrow(options: ConnectorEndArrowOptions): string;
81
81
  /**
82
82
  * @param {ConnectorOptions} opts
83
83
  * @returns {string}
84
84
  */
85
- export function connectorLine(opts?: ConnectorOptions): string;
85
+ export function connectorLine(opts: ConnectorOptions): string;
86
86
  /**
87
87
  * @param {ConnectorOptions} opts
88
88
  * @returns {string}
89
89
  */
90
- export function connectorElbow(opts?: ConnectorOptions): string;
90
+ export function connectorElbow(opts: ConnectorOptions): string;
91
91
  /**
92
92
  * @param {ConnectorOptions} opts
93
93
  * @returns {string}
94
94
  */
95
- export function connectorCurve(opts?: ConnectorOptions): string;
95
+ export function connectorCurve(opts: ConnectorOptions): string;
96
96
  /**
97
97
  * @param {AnnotationPartsOptions} [opts]
98
98
  * @returns {AnnotationParts}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AA6SA;;;GAGG;AACH,+CAHW,OAAO,CAAC,eAAe,CAAC,GACtB,MAAM,CAIlB;AAED;;;GAGG;AACH,gFAHW,oBAAoB,GAClB,MAAM,CA0BlB;AAsCD;;;GAGG;AACH,iGAHW,oBAAoB,GAClB,aAAa,CA0DzB;AAED;;;GAGG;AACH,+CAHW,oBAAoB,GAClB,MAAM,CAIlB;AAED;;;GAGG;AACH,mEAHW,kBAAkB,GAChB,MAAM,CAYlB;AAED;;;GAGG;AACH,mDAHW,gBAAgB,GACd,MAAM,CAMlB;AAED;;;GAGG;AACH,uEAHW,oBAAoB,GAClB,MAAM,CASlB;AAED;;;GAGG;AACH,+DAHW,qBAAqB,GACnB,MAAM,CAWlB;AAED;;;GAGG;AACH,mEAHW,kBAAkB,GAChB,MAAM,CAIlB;AAED;;;GAGG;AACH,sDAHW,mBAAmB,GACjB,MAAM,CAIlB;AAED;;;GAGG;AACH,gEAHW,sBAAsB,GACpB,MAAM,CAqClB;AAED;;;GAGG;AACH,wDAHW,qBAAq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AAM;;;;;;;;;;;;;;;;;;;;YAQN,eAAe;;;;UACf,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAYN,MAAM;OACN,MAAM;;;;YACN,eAAe;;;;;;;;OAEf,MAAM"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AA6SA;;;GAGG;AACH,+CAHW,OAAO,CAAC,eAAe,CAAC,GACtB,MAAM,CAIlB;AAED;;;GAGG;AACH,gFAHW,oBAAoB,GAClB,MAAM,CA0BlB;AAsCD;;;GAGG;AACH,uCAHW,oBAAoB,GAClB,aAAa,CA2DzB;AAED;;;GAGG;AACH,2CAHW,oBAAoB,GAClB,MAAM,CAKlB;AAED;;;GAGG;AACH,yCAHW,kBAAkB,GAChB,MAAM,CAalB;AAED;;;GAGG;AACH,uCAHW,gBAAgB,GACd,MAAM,CAOlB;AAED;;;GAGG;AACH,2CAHW,oBAAoB,GAClB,MAAM,CAUlB;AAED;;;GAGG;AACH,4CAHW,qBAAqB,GACnB,MAAM,CAYlB;AAED;;;GAGG;AACH,yCAHW,kBAAkB,GAChB,MAAM,CAKlB;AAED;;;GAGG;AACH,0CAHW,mBAAmB,GACjB,MAAM,CAKlB;AAED;;;GAGG;AACH,6CAHW,sBAAsB,GACpB,MAAM,CAsClB;AAED;;;GAGG;AACH,4CAHW,qBAAqB,GACnB,MAAM,CAWlB;AAED;;;GAGG;AACH,wDAHW,oBAAoB,GAClB,MAAM,CAUlB;AAED;;;GAGG;AACH,sEAHW,qBAAqB,GACnB,MAAM,CAclB;AAED;;;GAGG;AACH,yCAHW,sBAAsB,GACpB,MAAM,CAKlB;AAED;;;GAGG;AACH,2CAHW,wBAAwB,GACtB,MAAM,CASlB;AAED;;;GAGG;AACH,oCAHW,gBAAgB,GACd,MAAM,CAYlB;AAED;;;GAGG;AACH,qCAHW,gBAAgB,GACd,MAAM,CAgBlB;AAED;;;GAGG;AACH,qCAHW,gBAAgB,GACd,MAAM,C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;WAKN,MAAM;YACN,MAAM;YACN,gBAAgB;;;;;;;;;;;;QAShB,MAAM;QACN,MAAM;WACN,eAAe;YACf,gBAAgB;eAChB,MAAM;;qCAEP,CACN,aAAa,GACb,WAAW,GACX,CAAC;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GAAG,gBAAgB,CAAC,GAC1C,CAAC;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GAAG,qBAAqB,CAAC,GAC7C,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,kBAAkB,CAAC,GACvC,CAAC;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG,mBAAmB,CAAC,GACzC,CAAC;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GAAG,sBAAsB,CAAC,GAC9C,CAAC;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GAAG,qBAAqB,CAAC,GAC7C,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,oBAAoB,CAAC,GACzC,CAAC;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG,oBAAoB,CAAC,GAC7C,CAAC;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG,qBAAqB,CAAC,CACjD;;;;;;;;;;eAWU,MAAM;aACN,MAAM;eACN,MAAM;UACN,MAAM;;;;;;SAGN,MAAM;;;;UACN,MAAM;;;;;;;;;;;;;;;;;;;;YAQN,eAAe;;;;UACf,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAYN,MAAM;OACN,MAAM;;;;YACN,eAAe;;;;;;;;OAEf,MAAM"}
@@ -377,17 +377,18 @@ function noteRect(x, y, width, height, placement) {
377
377
  * @param {NotePlacementOptions} options
378
378
  * @returns {NotePlacement}
379
379
  */
380
- export function notePlacement({
381
- x = 0,
382
- y = 0,
383
- width,
384
- height,
385
- bounds,
386
- padding = 8,
387
- gap = 32,
388
- preferred = 'right',
389
- inset = 0,
390
- } = {}) {
380
+ export function notePlacement(options) {
381
+ const {
382
+ x = 0,
383
+ y = 0,
384
+ width,
385
+ height,
386
+ bounds,
387
+ padding = 8,
388
+ gap = 32,
389
+ preferred = 'right',
390
+ inset = 0,
391
+ } = options ?? {};
391
392
  const anchorX = finite('x', x);
392
393
  const anchorY = finite('y', y);
393
394
  const w = dimension('width', width);
@@ -439,7 +440,8 @@ export function notePlacement({
439
440
  * @param {CircleSubjectOptions} options
440
441
  * @returns {string}
441
442
  */
442
- export function circleSubjectPath({ radius } = {}) {
443
+ export function circleSubjectPath(options) {
444
+ const { radius } = options ?? {};
443
445
  return circlePathAt(0, 0, radius);
444
446
  }
445
447
 
@@ -447,7 +449,8 @@ export function circleSubjectPath({ radius } = {}) {
447
449
  * @param {RectSubjectOptions} options
448
450
  * @returns {string}
449
451
  */
450
- export function rectSubjectPath({ width, height, x, y, padding = 0 } = {}) {
452
+ export function rectSubjectPath(options) {
453
+ const { width, height, x, y, padding = 0 } = options ?? {};
451
454
  const w = dimension('width', width);
452
455
  const h = dimension('height', height);
453
456
  const p = dimension('padding', padding);
@@ -463,7 +466,8 @@ export function rectSubjectPath({ width, height, x, y, padding = 0 } = {}) {
463
466
  * @param {ThresholdOptions} options
464
467
  * @returns {string}
465
468
  */
466
- export function thresholdPath({ x1 = 0, y1 = 0, x2, y2 } = {}) {
469
+ export function thresholdPath(options) {
470
+ const { x1 = 0, y1 = 0, x2, y2 } = options ?? {};
467
471
  const start = { x: finite('x1', x1), y: finite('y1', y1) };
468
472
  const end = { x: finite('x2', x2), y: finite('y2', y2) };
469
473
  return linePath(start, end);
@@ -473,7 +477,8 @@ export function thresholdPath({ x1 = 0, y1 = 0, x2, y2 } = {}) {
473
477
  * @param {AxisThresholdOptions} options
474
478
  * @returns {string}
475
479
  */
476
- export function axisThresholdPath({ orientation = 'horizontal', value = 0, start = 0, end } = {}) {
480
+ export function axisThresholdPath(options) {
481
+ const { orientation = 'horizontal', value = 0, start = 0, end } = options ?? {};
477
482
  const v = finite('value', value);
478
483
  const s = finite('start', start);
479
484
  const e = finite('end', end);
@@ -486,7 +491,8 @@ export function axisThresholdPath({ orientation = 'horizontal', value = 0, start
486
491
  * @param {BracketSubjectOptions} options
487
492
  * @returns {string}
488
493
  */
489
- export function bracketSubjectPath({ x1, y1, x2, y2, depth = 12 } = {}) {
494
+ export function bracketSubjectPath(options) {
495
+ const { x1, y1, x2, y2, depth = 12 } = options ?? {};
490
496
  const start = { x: finite('x1', x1), y: finite('y1', y1) };
491
497
  const end = { x: finite('x2', x2), y: finite('y2', y2) };
492
498
  const d = finite('depth', depth);
@@ -501,7 +507,8 @@ export function bracketSubjectPath({ x1, y1, x2, y2, depth = 12 } = {}) {
501
507
  * @param {BandSubjectOptions} options
502
508
  * @returns {string}
503
509
  */
504
- export function bandSubjectPath({ x = 0, y = 0, width, height, padding = 0 } = {}) {
510
+ export function bandSubjectPath(options) {
511
+ const { x = 0, y = 0, width, height, padding = 0 } = options ?? {};
505
512
  return rectSubjectPath({ x, y, width, height, padding });
506
513
  }
507
514
 
@@ -509,7 +516,8 @@ export function bandSubjectPath({ x = 0, y = 0, width, height, padding = 0 } = {
509
516
  * @param {SlopeSubjectOptions} options
510
517
  * @returns {string}
511
518
  */
512
- export function slopeSubjectPath({ x1, y1, x2, y2 } = {}) {
519
+ export function slopeSubjectPath(options) {
520
+ const { x1, y1, x2, y2 } = options ?? {};
513
521
  return thresholdPath({ x1, y1, x2, y2 });
514
522
  }
515
523
 
@@ -517,7 +525,8 @@ export function slopeSubjectPath({ x1, y1, x2, y2 } = {}) {
517
525
  * @param {ComparisonBraceOptions} options
518
526
  * @returns {string}
519
527
  */
520
- export function comparisonBracePath({ x1, y1, x2, y2, depth = 14 } = {}) {
528
+ export function comparisonBracePath(options) {
529
+ const { x1, y1, x2, y2, depth = 14 } = options ?? {};
521
530
  const start = { x: finite('x1', x1), y: finite('y1', y1) };
522
531
  const end = { x: finite('x2', x2), y: finite('y2', y2) };
523
532
  const d = finite('depth', depth);
@@ -558,7 +567,8 @@ export function comparisonBracePath({ x1, y1, x2, y2, depth = 14 } = {}) {
558
567
  * @param {OutlierClusterOptions} options
559
568
  * @returns {string}
560
569
  */
561
- export function outlierClusterPath({ points, radius = 6 } = {}) {
570
+ export function outlierClusterPath(options) {
571
+ const { points, radius = 6 } = options ?? {};
562
572
  if (!Array.isArray(points)) throw new TypeError('points must be an array');
563
573
  return points
564
574
  .map((p, i) =>
@@ -604,7 +614,8 @@ export function evidenceMarkerPath({ x = 0, y = 0, width = 36, height = 36, padd
604
614
  * @param {ConnectorEndDotOptions} options
605
615
  * @returns {string}
606
616
  */
607
- export function connectorEndDot({ x, y, radius = 3 } = {}) {
617
+ export function connectorEndDot(options) {
618
+ const { x, y, radius = 3 } = options ?? {};
608
619
  return dotMark({ x: finite('x', x), y: finite('y', y) }, radius);
609
620
  }
610
621
 
@@ -612,7 +623,8 @@ export function connectorEndDot({ x, y, radius = 3 } = {}) {
612
623
  * @param {ConnectorEndArrowOptions} options
613
624
  * @returns {string}
614
625
  */
615
- export function connectorEndArrow({ x1 = 0, y1 = 0, x2, y2, size = 8, spread = 0.32 } = {}) {
626
+ export function connectorEndArrow(options) {
627
+ const { x1 = 0, y1 = 0, x2, y2, size = 8, spread = 0.32 } = options ?? {};
616
628
  const start = { x: finite('x1', x1), y: finite('y1', y1) };
617
629
  const end = { x: finite('x2', x2), y: finite('y2', y2) };
618
630
  const s = dimension('size', size);
@@ -624,10 +636,11 @@ export function connectorEndArrow({ x1 = 0, y1 = 0, x2, y2, size = 8, spread = 0
624
636
  * @param {ConnectorOptions} opts
625
637
  * @returns {string}
626
638
  */
627
- export function connectorLine(opts = {}) {
628
- const { dx, dy } = validateOffset(opts);
639
+ export function connectorLine(opts) {
640
+ const options = opts ?? {};
641
+ const { dx, dy } = validateOffset(options);
629
642
  if (dx === 0 && dy === 0) return '';
630
- const start = connectorStart(dx, dy, opts.subject);
643
+ const start = connectorStart(dx, dy, options.subject);
631
644
  if (!start) return '';
632
645
  const end = { x: dx, y: dy };
633
646
  // Guard a trim that rounds onto the note anchor (straightPath has no guard).
@@ -639,10 +652,11 @@ export function connectorLine(opts = {}) {
639
652
  * @param {ConnectorOptions} opts
640
653
  * @returns {string}
641
654
  */
642
- export function connectorElbow(opts = {}) {
643
- const { dx, dy } = validateOffset(opts);
655
+ export function connectorElbow(opts) {
656
+ const options = opts ?? {};
657
+ const { dx, dy } = validateOffset(options);
644
658
  if (dx === 0 && dy === 0) return '';
645
- const start = connectorStart(dx, dy, opts.subject);
659
+ const start = connectorStart(dx, dy, options.subject);
646
660
  if (!start) return '';
647
661
  const end = { x: dx, y: dy };
648
662
  if (samePoint(start, end)) return '';
@@ -651,17 +665,18 @@ export function connectorElbow(opts = {}) {
651
665
  // annotation leader and a node connector draw the same elbow. (The former
652
666
  // inline form turned by min(|dx|,|dy|), i.e. a 45° chamfer that read as a
653
667
  // diagonal stub, not an elbow — which the `stroke-linejoin` bevel assumes.)
654
- return elbowPath(start, end, { mid: opts.mid });
668
+ return elbowPath(start, end, { mid: options.mid });
655
669
  }
656
670
 
657
671
  /**
658
672
  * @param {ConnectorOptions} opts
659
673
  * @returns {string}
660
674
  */
661
- export function connectorCurve(opts = {}) {
662
- const { dx, dy } = validateOffset(opts);
675
+ export function connectorCurve(opts) {
676
+ const options = opts ?? {};
677
+ const { dx, dy } = validateOffset(options);
663
678
  if (dx === 0 && dy === 0) return '';
664
- const start = connectorStart(dx, dy, opts.subject);
679
+ const start = connectorStart(dx, dy, options.subject);
665
680
  if (!start) return '';
666
681
  const end = { x: dx, y: dy };
667
682
  if (samePoint(start, end)) return '';
@@ -706,8 +721,11 @@ export function annotationParts(opts = {}) {
706
721
  let subject = '';
707
722
 
708
723
  if (opts.subject != null) {
709
- const build = SUBJECT_BUILDERS[opts.subject.type];
710
- if (!build) throw new TypeError('unsupported subject.type');
724
+ const subjectType = opts.subject.type;
725
+ if (!Object.hasOwn(SUBJECT_BUILDERS, subjectType)) {
726
+ throw new TypeError('unsupported subject.type');
727
+ }
728
+ const build = SUBJECT_BUILDERS[subjectType];
711
729
  subject = build(opts.subject);
712
730
  }
713
731
 
@@ -10,7 +10,9 @@
10
10
  * `[data-bronto-carousel-prev]` / `[data-bronto-carousel-next]` controls,
11
11
  * a `.ui-carousel__thumbs` list of `.ui-carousel__thumb` buttons, and a
12
12
  * `.ui-carousel__status` counter slot. Add `data-bronto-carousel-loop` to
13
- * wrap at the ends, `data-bronto-carousel-label` to name the region.
13
+ * wrap at the ends, `data-bronto-carousel-label` to name the region, and
14
+ * `data-bronto-carousel-roledescription` to localize the default
15
+ * `aria-roledescription` when the viewport does not already carry one.
14
16
  *
15
17
  * A full-screen **lightbox** is the same markup inside a native
16
18
  * `<dialog class="ui-lightbox">` opened by {@link initDialog}: the
@@ -21,8 +23,10 @@
21
23
  * (button, key, thumbnail, or swipe). SSR-safe, idempotent per carousel;
22
24
  * returns a cleanup function.
23
25
  *
24
- * @param {import('./internal.js').DelegateOpts} [opts]
26
+ * @param {import('./internal.js').DelegateOpts & { roleDescription?: string }} [opts]
25
27
  * @returns {import('./internal.js').Cleanup}
26
28
  */
27
- export function initCarousel({ root }?: import("./internal.js").DelegateOpts): import("./internal.js").Cleanup;
29
+ export function initCarousel({ root, roleDescription }?: import("./internal.js").DelegateOpts & {
30
+ roleDescription?: string;
31
+ }): import("./internal.js").Cleanup;
28
32
  //# sourceMappingURL=carousel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["carousel.js"],"names":[],"mappings":"AA6HA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wCAHW,OAAO,eAAe,EAAE,YAAY,GAClC,OAAO,eAAe,EAAE,OAAO,CAsJ3C"}
1
+ {"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["carousel.js"],"names":[],"mappings":"AAoNA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,yDAHW,OAAO,eAAe,EAAE,YAAY,GAAG;IAAE,eAAe,CAAC,EAAE,MAAM,CAAA;CAAE,GACjE,OAAO,eAAe,EAAE,OAAO,CA+L3C"}