contour-ds 1.8.1 → 1.9.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.
Files changed (147) hide show
  1. package/README.md +227 -378
  2. package/dist/agent-cookbook.json +960 -0
  3. package/dist/agent-examples.json +65 -0
  4. package/dist/agent-map-wiring.json +152 -0
  5. package/dist/build-manifest.json +320 -179
  6. package/dist/contour-wc-content.esm.js +479 -3665
  7. package/dist/contour-wc-content.esm.min.js +1 -1
  8. package/dist/contour-wc-core.esm.js +3724 -0
  9. package/dist/contour-wc-core.esm.min.js +1 -0
  10. package/dist/contour-wc-dashboard.esm.js +2713 -4381
  11. package/dist/contour-wc-dashboard.esm.min.js +1 -1
  12. package/dist/contour-wc-data.esm.js +2658 -4346
  13. package/dist/contour-wc-data.esm.min.js +1 -1
  14. package/dist/contour-wc-docs.esm.js +218 -3547
  15. package/dist/contour-wc-docs.esm.min.js +1 -1
  16. package/dist/contour-wc-feedback.esm.js +483 -3658
  17. package/dist/contour-wc-feedback.esm.min.js +1 -1
  18. package/dist/contour-wc-forms.esm.js +503 -3754
  19. package/dist/contour-wc-forms.esm.min.js +1 -1
  20. package/dist/contour-wc-interaction.esm.js +379 -3616
  21. package/dist/contour-wc-interaction.esm.min.js +1 -1
  22. package/dist/contour-wc-layout.esm.js +234 -3563
  23. package/dist/contour-wc-layout.esm.min.js +1 -1
  24. package/dist/contour-wc-map.esm.js +949 -3743
  25. package/dist/contour-wc-map.esm.min.js +1 -1
  26. package/dist/contour-wc-misc.esm.js +237 -3556
  27. package/dist/contour-wc-misc.esm.min.js +1 -1
  28. package/dist/contour-wc-navigation.esm.js +2235 -5237
  29. package/dist/contour-wc-navigation.esm.min.js +1 -1
  30. package/dist/contour-wc-ui.esm.js +4638 -7128
  31. package/dist/contour-wc-ui.esm.min.js +1 -1
  32. package/dist/contour-wc.esm.js +11971 -7727
  33. package/dist/contour-wc.esm.min.js +1 -1
  34. package/dist/contour-wc.js +11971 -7727
  35. package/dist/contour-wc.min.js +1 -1
  36. package/dist/contour.a11y.json +402 -0
  37. package/dist/contour.code-snippets +96 -74
  38. package/dist/contour.components.json +2591 -741
  39. package/dist/contour.css +2624 -1888
  40. package/dist/contour.d.ts +421 -228
  41. package/dist/contour.esm.js +433 -18
  42. package/dist/contour.esm.min.js +1 -1
  43. package/dist/contour.html-data.json +1231 -199
  44. package/dist/contour.js +433 -18
  45. package/dist/contour.min.css +1 -1
  46. package/dist/contour.min.js +1 -1
  47. package/dist/contour.react.d.ts +100 -98
  48. package/dist/contour.single.html +2 -2
  49. package/dist/contour.single.min.css +1 -1
  50. package/dist/contour.themes.json +56 -12
  51. package/dist/contour.tokens.json +482 -255
  52. package/dist/contour.vue.d.ts +100 -98
  53. package/dist/contour.web-types.json +1226 -226
  54. package/dist/custom-elements.json +7649 -2237
  55. package/dist/docs/actions.md +15 -6
  56. package/dist/docs/affordances.md +18 -96
  57. package/dist/docs/apireference.md +9 -5
  58. package/dist/docs/colour.md +10 -4
  59. package/dist/docs/componentindex.md +9 -26
  60. package/dist/docs/data.md +36 -60
  61. package/dist/docs/docs.md +10 -12
  62. package/dist/docs/feedback.md +30 -12
  63. package/dist/docs/field.md +28 -13
  64. package/dist/docs/forms.md +35 -19
  65. package/dist/docs/index.json +63 -56
  66. package/dist/docs/install.md +12 -7
  67. package/dist/docs/landing.md +7 -4
  68. package/dist/docs/mapengine.md +18 -13
  69. package/dist/docs/motion.md +12 -6
  70. package/dist/docs/navigation.md +31 -7
  71. package/dist/docs/overlays.md +32 -25
  72. package/dist/docs/overview.md +3 -2
  73. package/dist/docs/patterns.md +19 -9
  74. package/dist/docs/playground.md +9 -22
  75. package/dist/docs/principles.md +8 -6
  76. package/dist/docs/recipes.md +113 -14
  77. package/dist/docs/space.md +10 -6
  78. package/dist/docs/status.md +12 -25
  79. package/dist/docs/surfaces.md +17 -22
  80. package/dist/docs/theming.md +18 -32
  81. package/dist/docs/type.md +12 -5
  82. package/dist/docs/webcomponents.md +66 -38
  83. package/dist/hljs.css +1 -20
  84. package/dist/map-chrome.mapbox.css +68 -92
  85. package/dist/map-chrome.maplibre.css +68 -92
  86. package/dist/registry/items/contour-core.json +2 -2
  87. package/dist/registry/items/contour-data.json +2 -2
  88. package/dist/registry/items/contour-docs.json +2 -2
  89. package/dist/registry/items/contour-landing.json +2 -2
  90. package/dist/registry/registry.json +8 -8
  91. package/dist/surfaces/contour-core.min.css +1 -1
  92. package/dist/surfaces/contour-data.min.css +1 -1
  93. package/dist/surfaces/contour-docs.min.css +1 -1
  94. package/dist/surfaces/contour-landing.min.css +1 -1
  95. package/dist/svg/icons.svg +367 -0
  96. package/dist/wc/behaviours.mjs +190 -148
  97. package/dist/wc/content.mjs +273 -129
  98. package/dist/wc/core.mjs +598 -395
  99. package/dist/wc/dashboard.mjs +64 -44
  100. package/dist/wc/data-chart.mjs +1333 -0
  101. package/dist/wc/data-export.mjs +391 -0
  102. package/dist/wc/data-gauge.mjs +779 -0
  103. package/dist/wc/data-geo.mjs +696 -0
  104. package/dist/wc/data-glyphs.mjs +133 -0
  105. package/dist/wc/data-legend.mjs +431 -0
  106. package/dist/wc/data-readout.mjs +227 -0
  107. package/dist/wc/data-series.mjs +1004 -0
  108. package/dist/wc/data-table.mjs +751 -0
  109. package/dist/wc/data.mjs +15 -4322
  110. package/dist/wc/docs.mjs +12 -11
  111. package/dist/wc/feedback.mjs +277 -122
  112. package/dist/wc/forms-controls.mjs +635 -0
  113. package/dist/wc/forms-field.mjs +547 -0
  114. package/dist/wc/forms-groups.mjs +347 -0
  115. package/dist/wc/forms-input.mjs +292 -0
  116. package/dist/wc/forms.mjs +10 -1751
  117. package/dist/wc/glyph.mjs +204 -0
  118. package/dist/wc/index.mjs +11 -9
  119. package/dist/wc/interaction.mjs +173 -80
  120. package/dist/wc/layout.mjs +28 -27
  121. package/dist/wc/map.mjs +743 -207
  122. package/dist/wc/misc.mjs +31 -20
  123. package/dist/wc/navigation-menu.mjs +735 -0
  124. package/dist/wc/navigation-shell.mjs +495 -0
  125. package/dist/wc/navigation-tree.mjs +995 -0
  126. package/dist/wc/navigation.mjs +9 -1905
  127. package/dist/wc/registration.mjs +1 -8
  128. package/dist/wc/shadow.mjs +206 -110
  129. package/dist/wc/states.mjs +54 -75
  130. package/dist/wc/svg.mjs +118 -47
  131. package/dist/wc/ui-atoms.mjs +608 -0
  132. package/dist/wc/ui-data.mjs +1404 -0
  133. package/dist/wc/ui-feedback.mjs +419 -0
  134. package/dist/wc/ui-inputs.mjs +1570 -0
  135. package/dist/wc/ui-menus.mjs +307 -0
  136. package/dist/wc/ui-overlays.mjs +1605 -0
  137. package/integrations/README.md +23 -5
  138. package/integrations/ai/CLAUDE.md +3 -0
  139. package/integrations/ai/COPILOT.md +14 -0
  140. package/integrations/ai/GEMINI.md +14 -0
  141. package/integrations/ai/WINDSURF.md +14 -0
  142. package/integrations/ai/v0-prompt.md +13 -1
  143. package/integrations/native/README.md +0 -3
  144. package/integrations/tailwind/contour-theme.css +66 -7
  145. package/integrations/validate-markup.mjs +172 -0
  146. package/package.json +77 -42
  147. package/dist/wc/ui.mjs +0 -5072
@@ -1,4 +1,4 @@
1
- import { ContourBase, define, navKey, isRtl , warnBadJson } from './core.mjs';
1
+ import { ContourBase, define, navKey, isRtl , safeHref, warnBadJson, headingTag } from './core.mjs';
2
2
  class ContourApp extends ContourBase {
3
3
  static get observed() { return ["title"]; }
4
4
  static get properties() { return { title: { attribute: "title" } }; }
@@ -14,10 +14,7 @@ import { ContourBase, define, navKey, isRtl , warnBadJson } from './core.mjs';
14
14
  const main = this.ensure(".c-app__main", () => { const el = document.createElement("main"); el.className = "c-app__main"; return el; });
15
15
  if (main.parentNode !== this) this.appendChild(main);
16
16
  if (header.parentNode !== this) this.insertBefore(header, main);
17
- // The shell has one content region. Authored children left as siblings of
18
- // the generated <main> took a share of the flex column and sat outside the
19
- // document's only main landmark, which is neither the layout nor the
20
- // outline the block describes.
17
+ // Authored children move into <main>; siblings took flex share and sat outside the only main landmark.
21
18
  Array.from(this.children).forEach((child) => {
22
19
  if (child === header || child === main) return;
23
20
  main.appendChild(child);
@@ -30,9 +27,7 @@ import { ContourBase, define, navKey, isRtl , warnBadJson } from './core.mjs';
30
27
  static get properties() { return { title: { attribute: "title" } }; }
31
28
  render() {
32
29
  this.classList.add("c-app-body");
33
- // A document may have one visible <main>. Nested inside `contour-app` the
34
- // shell already owns it, so the body's content region is a plain div; on
35
- // its own it is the page's landmark.
30
+ // One visible <main> per document; nested → plain div, standalone → main.
36
31
  const nested = !!(this.parentElement && this.parentElement.closest && this.parentElement.closest("contour-app"));
37
32
  const tag = nested ? "div" : "main";
38
33
  let main = this.querySelector(":scope > .c-app-body__main");
@@ -59,8 +54,7 @@ class ContourBtnGroup extends ContourBase {
59
54
  this.classList.add("c-btn-group");
60
55
  this.setAttribute("role", "group");
61
56
  if (this.getAttribute("title")) this.setAttribute("aria-label", this.getAttribute("title"));
62
- // A shipped component must not invent its own buttons: the author supplies
63
- // the <button> children. The old code rendered One/Two/Three when empty.
57
+ // Author supplies <button> children; component doesn't invent them.
64
58
  }
65
59
  enhance() {
66
60
  if (this._wiredBtnGroup) return;
@@ -82,8 +76,8 @@ class ContourBtnGroup extends ContourBase {
82
76
  }
83
77
  define("contour-btn-group", ContourBtnGroup);
84
78
  class ContourRangeScale extends ContourBase {
85
- static get observed() { return ["label", "value", "ticks"]; }
86
- static get properties() { return { label: { attribute: "label" }, value: { attribute: "value" }, ticks: { attribute: "ticks" } }; }
79
+ static get observed() { return ["label", "ticks"]; }
80
+ static get properties() { return { label: { attribute: "label" }, ticks: { attribute: "ticks" } }; }
87
81
  render() {
88
82
  this.classList.add("c-range-scale");
89
83
  this.setAttribute("role", "group");
@@ -124,8 +118,8 @@ class ContourBtnGroup extends ContourBase {
124
118
  }
125
119
  define("contour-range-scale", ContourRangeScale);
126
120
  class ContourTimeRange extends ContourBase {
127
- static get observed() { return ["label", "value", "ticks"]; }
128
- static get properties() { return { label: { attribute: "label" }, value: { attribute: "value" }, ticks: { attribute: "ticks" } }; }
121
+ static get observed() { return ["label", "value", "ticks", "required", "disabled"]; }
122
+ static get properties() { return { label: { attribute: "label" }, value: { attribute: "value" }, ticks: { attribute: "ticks" }, required: { attribute: "required", type: Boolean }, disabled: { attribute: "disabled", type: Boolean } }; }
129
123
  render() {
130
124
  this.classList.add("c-time-range");
131
125
  this.setAttribute("role", "group");
@@ -135,6 +129,12 @@ class ContourBtnGroup extends ContourBase {
135
129
  const t = this.ensure(".c-time-range__label", () => { const el = document.createElement("span"); el.className = "c-time-range__label"; return el; });
136
130
  t.textContent = label;
137
131
  }
132
+ // Slotted input gets host's label when unnamed.
133
+ const inp = this.querySelector("input");
134
+ if (inp && label && !inp.hasAttribute("aria-label") && !(inp.labels && inp.labels.length)) inp.setAttribute("aria-label", label);
135
+ // sync observed `value` onto slotted input.
136
+ const value = this.getAttribute("value");
137
+ if (value !== null && inp && inp.value !== value) inp.value = value;
138
138
  const ticksAttr = this.getAttribute("ticks");
139
139
  Array.from(this.querySelectorAll(".c-time-range__tick")).forEach((n) => n.remove());
140
140
  if (ticksAttr) {
@@ -165,27 +165,29 @@ class ContourBtnGroup extends ContourBase {
165
165
  }
166
166
  define("contour-time-range", ContourTimeRange);
167
167
 
168
- // Skip link: an <a> that is visually hidden until focused, then slides in at
169
- // the top-left. The class does the work; the component wraps it so a consumer
170
- // can drop <contour-skip-link href="#main"> into a page and get the link.
168
+ // Skip link: visually hidden until focused; class does the work.
171
169
  class ContourSkipLink extends ContourBase {
172
170
  static get observed() { return ["href", "label"]; }
173
171
  static get properties() { return { href: { attribute: "href" }, label: { attribute: "label" } }; }
174
172
  render() {
173
+ // drop authored text nodes so the authored label isn't rendered a
174
+ // second time beside the generated <a> (which carries the `label` attribute).
175
+ Array.from(this.childNodes).forEach((n) => { if (n.nodeType === Node.TEXT_NODE) n.remove(); });
175
176
  const a = this.ensure("a", () => { const el = document.createElement("a"); el.className = "c-skip-link"; return el; });
176
- a.setAttribute("href", this.getAttribute("href") || "#main");
177
+ a.setAttribute("href", safeHref(this.getAttribute("href") || "#main"));
177
178
  a.textContent = this.getAttribute("label") || "Skip to content";
178
179
  }
179
180
  }
180
181
  define("contour-skip-link", ContourSkipLink);
181
182
 
182
- // Icon: renders a sprite <use> by name. The icon set is the guide's sprite;
183
- // a consumer points `name` at an id and the <use> resolves it.
183
+ // Icon: renders sprite <use> by name; consumer points name at an id.
184
184
  class ContourIcon extends ContourBase {
185
185
  static get observed() { return ["name", "size", "label"]; }
186
186
  static get properties() { return { name: { attribute: "name" }, size: { attribute: "size" }, label: { attribute: "label" } }; }
187
187
  render() {
188
188
  const name = this.getAttribute("name") || "";
189
+ // accept `name="check"` or `name="i-check"` (prevents "#i-i-check").
190
+ const iconName = name.startsWith("i-") ? name.slice(2) : name;
189
191
  const size = this.getAttribute("size");
190
192
  const label = this.getAttribute("label");
191
193
  this.innerHTML = "";
@@ -194,7 +196,7 @@ class ContourIcon extends ContourBase {
194
196
  svg.setAttribute("aria-hidden", "true");
195
197
  if (size) svg.style.width = size, svg.style.height = size;
196
198
  const use = document.createElementNS("http://www.w3.org/2000/svg", "use");
197
- use.setAttribute("href", "#i-" + name);
199
+ use.setAttribute("href", "#i-" + iconName);
198
200
  svg.appendChild(use);
199
201
  this.appendChild(svg);
200
202
  if (label) { this.setAttribute("role", "img"); this.setAttribute("aria-label", label); }
@@ -203,8 +205,7 @@ class ContourIcon extends ContourBase {
203
205
  }
204
206
  define("contour-icon", ContourIcon);
205
207
 
206
- // Dashboard grid: a CSS grid of widget cells. The component is a layout
207
- // primitive — it lays out its authored children in a responsive grid.
208
+ // Dashboard grid: layout primitive for responsive grid of widget cells.
208
209
  class ContourDashboardGrid extends ContourBase {
209
210
  static get observed() { return ["cols", "gap"]; }
210
211
  static get properties() { return { cols: { attribute: "cols" }, gap: { attribute: "gap" } }; }
@@ -218,10 +219,10 @@ class ContourDashboardGrid extends ContourBase {
218
219
  }
219
220
  define("contour-dashboard-grid", ContourDashboardGrid);
220
221
 
221
- // Analysis stack: a vertical stack of analysis panels with a shared header.
222
+ // Analysis stack: vertical stack of panels with shared header.
222
223
  class ContourAnalysisStack extends ContourBase {
223
- static get observed() { return ["title"]; }
224
- static get properties() { return { title: { attribute: "title" } }; }
224
+ static get observed() { return ["title", "heading"]; }
225
+ static get properties() { return { title: { attribute: "title" }, heading: { attribute: "heading" } }; }
225
226
  render() {
226
227
  this.classList.add("c-analysis-stack");
227
228
  const title = this.getAttribute("title");
@@ -229,7 +230,7 @@ class ContourAnalysisStack extends ContourBase {
229
230
  if (title) {
230
231
  if (!header) { header = document.createElement("div"); header.className = "c-analysis-stack__header"; this.prepend(header); }
231
232
  let h = header.querySelector(".c-analysis-stack__title");
232
- if (!h) { h = document.createElement("h3"); h.className = "c-analysis-stack__title"; header.appendChild(h); }
233
+ if (!h) { h = document.createElement(headingTag(this, "h3")); h.className = "c-analysis-stack__title"; header.appendChild(h); }
233
234
  h.textContent = title;
234
235
  } else if (header) header.remove();
235
236
  }