@mcp-b/viz-components 0.2.21 → 0.3.0

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.
@@ -9,7 +9,14 @@ interface LegendItem {
9
9
  /** @tag sigvelo-viz-legend @summary Displays a compact color legend for charts and thematic maps. */
10
10
  declare class SigveloVizLegend extends SigveloElement {
11
11
  static styles: CSSResultGroup;
12
- title: string;
12
+ /**
13
+ * The visible text above the swatches, which also names the region.
14
+ *
15
+ * Not `title`: that is a global HTML attribute, so a Lit property of that name
16
+ * would make this heading and the browser's tooltip the same value, and each
17
+ * would overwrite the other.
18
+ */
19
+ heading: string;
13
20
  items: readonly LegendItem[];
14
21
  render(): import("lit-html").TemplateResult<1>;
15
22
  }
@@ -29,15 +29,15 @@ const styles = css`
29
29
  var SigveloVizLegend = class extends SigveloElement {
30
30
  constructor(..._args) {
31
31
  super(..._args);
32
- this.title = "Legend";
32
+ this.heading = "Legend";
33
33
  this.items = [];
34
34
  }
35
35
  static {
36
36
  this.styles = [hostStyles, styles];
37
37
  }
38
38
  render() {
39
- return html`<section aria-label=${this.title} part="legend">
40
- <strong part="title">${this.title}</strong>
39
+ return html`<section aria-labelledby="heading" part="legend">
40
+ <strong id="heading" part="heading">${this.heading}</strong>
41
41
  <div class="items">
42
42
  ${this.items.map((item) => html`<span class="item" part="item"
43
43
  ><span class="swatch" style=${`background:${item.color}`} part="swatch"></span
@@ -47,7 +47,7 @@ var SigveloVizLegend = class extends SigveloElement {
47
47
  </section>`;
48
48
  }
49
49
  };
50
- __decorate([property()], SigveloVizLegend.prototype, "title", void 0);
50
+ __decorate([property()], SigveloVizLegend.prototype, "heading", void 0);
51
51
  __decorate([property({ attribute: false })], SigveloVizLegend.prototype, "items", void 0);
52
52
  customElements.define("sigvelo-viz-legend", SigveloVizLegend);
53
53
  //#endregion
@@ -318,11 +318,12 @@
318
318
  },
319
319
  {
320
320
  "kind": "field",
321
- "name": "title",
321
+ "name": "heading",
322
322
  "type": {
323
323
  "text": "string"
324
324
  },
325
- "default": "\"Legend\""
325
+ "default": "\"Legend\"",
326
+ "description": "The visible text above the swatches, which also names the region.\n\nNot `title`: that is a global HTML attribute, so a Lit property of that name\nwould make this heading and the browser's tooltip the same value, and each\nwould overwrite the other."
326
327
  },
327
328
  {
328
329
  "kind": "field",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcp-b/viz-components",
3
- "version": "0.2.21",
3
+ "version": "0.3.0",
4
4
  "description": "D3-backed, framework-agnostic Sigvelo visualization web components.",
5
5
  "keywords": [
6
6
  "charts",
@@ -27,7 +27,7 @@
27
27
  "access": "public"
28
28
  },
29
29
  "dependencies": {
30
- "@mcp-b/wc-support": "0.2.18"
30
+ "@mcp-b/wc-support": "0.3.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@custom-elements-manifest/analyzer": "^0.10.10",