contour-ds 1.7.1 → 1.7.2

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 (54) hide show
  1. package/README.md +1 -1
  2. package/dist/build-manifest.json +57 -57
  3. package/dist/contour-wc.esm.js +53 -19
  4. package/dist/contour-wc.esm.min.js +1 -1
  5. package/dist/contour-wc.js +53 -19
  6. package/dist/contour-wc.min.js +1 -1
  7. package/dist/contour.components.json +832 -177
  8. package/dist/contour.css +988 -349
  9. package/dist/contour.min.css +1 -1
  10. package/dist/docs/actions.md +1 -1
  11. package/dist/docs/affordances.md +3 -1
  12. package/dist/docs/apireference.md +1 -1
  13. package/dist/docs/colour.md +1 -1
  14. package/dist/docs/componentindex.md +1 -1
  15. package/dist/docs/data.md +1 -1
  16. package/dist/docs/docs.md +1 -1
  17. package/dist/docs/feedback.md +1 -1
  18. package/dist/docs/field.md +1 -1
  19. package/dist/docs/forms.md +1 -1
  20. package/dist/docs/index.json +2 -2
  21. package/dist/docs/install.md +1 -1
  22. package/dist/docs/landing.md +1 -1
  23. package/dist/docs/mapengine.md +1 -1
  24. package/dist/docs/motion.md +1 -1
  25. package/dist/docs/navigation.md +1 -1
  26. package/dist/docs/overlays.md +1 -1
  27. package/dist/docs/overview.md +1 -1
  28. package/dist/docs/patterns.md +1 -1
  29. package/dist/docs/playground.md +1 -1
  30. package/dist/docs/principles.md +1 -1
  31. package/dist/docs/recipes.md +1 -1
  32. package/dist/docs/space.md +1 -1
  33. package/dist/docs/status.md +1 -1
  34. package/dist/docs/surfaces.md +1 -1
  35. package/dist/docs/theming.md +1 -1
  36. package/dist/docs/type.md +1 -1
  37. package/dist/docs/webcomponents.md +1 -1
  38. package/dist/registry/items/contour-core.json +2 -2
  39. package/dist/registry/items/contour-data.json +2 -2
  40. package/dist/registry/items/contour-docs.json +2 -2
  41. package/dist/registry/items/contour-landing.json +2 -2
  42. package/dist/registry/registry.json +8 -8
  43. package/dist/surfaces/contour-core.min.css +1 -1
  44. package/dist/surfaces/contour-data.min.css +1 -1
  45. package/dist/surfaces/contour-docs.min.css +1 -1
  46. package/dist/surfaces/contour-landing.min.css +1 -1
  47. package/dist/wc/content.mjs +1 -0
  48. package/dist/wc/data.mjs +32 -11
  49. package/dist/wc/forms.mjs +6 -2
  50. package/dist/wc/interaction.mjs +3 -1
  51. package/dist/wc/layout.mjs +2 -2
  52. package/dist/wc/navigation.mjs +1 -0
  53. package/dist/wc/ui.mjs +8 -3
  54. package/package.json +1 -1
@@ -3438,6 +3438,7 @@ class ContourShowcaseFull extends ContourBase {
3438
3438
  static get properties() { return { title: { attribute: "title" }, text: { attribute: "text" }, media: { attribute: "media" }, reverse: { attribute: "reverse" }, items: { attribute: "items" }, src: { attribute: "src" } }; }
3439
3439
  render() {
3440
3440
  this.classList.add("c-showcase");
3441
+ this.setAttribute("role", "list");
3441
3442
  if (this.hasAttribute("reverse")) this.classList.add("c-showcase--reverse"); else this.classList.remove("c-showcase--reverse");
3442
3443
  const title = this.getAttribute("title");
3443
3444
  if (title) this.setAttribute("aria-label", title);
@@ -4426,7 +4427,7 @@ class ContourTable extends ContourBase {
4426
4427
  btn.className = "c-btn c-btn--ghost c-btn--sm";
4427
4428
  btn.type = "button";
4428
4429
  btn.textContent = this.getAttribute("retry") || "Retry";
4429
- btn.style.marginInlineStart = "var(--space-sm)";
4430
+ btn.classList.add("u-ms-sm");
4430
4431
  btn.dataset.action = "retry";
4431
4432
  td.appendChild(btn);
4432
4433
  }
@@ -4902,7 +4903,7 @@ class ContourChart extends ContourBase {
4902
4903
  btn.type = "button";
4903
4904
  btn.textContent = this.getAttribute("retry") || "Retry";
4904
4905
  btn.dataset.action = "retry";
4905
- btn.style.marginBlockStart = "var(--space-sm)";
4906
+ btn.classList.add("u-mbs-sm");
4906
4907
  err.appendChild(btn);
4907
4908
  }
4908
4909
  plot.appendChild(err);
@@ -4923,7 +4924,7 @@ class ContourChart extends ContourBase {
4923
4924
  sk.style.display = "block";
4924
4925
  sk.style.inlineSize = "100%";
4925
4926
  sk.style.blockSize = "0.6rem";
4926
- sk.style.marginBlockEnd = "var(--space-2xs)";
4927
+ sk.classList.add("u-mbe-2xs");
4927
4928
  plot.appendChild(sk);
4928
4929
  }
4929
4930
  const axis = this.getAttribute("axis");
@@ -6244,9 +6245,11 @@ class ContourDonut extends ContourBase {
6244
6245
  // text list
6245
6246
  const list = document.createElement("div");
6246
6247
  list.className = "c-donut__list";
6248
+ list.setAttribute("role", "list");
6247
6249
  items.forEach((it, i) => {
6248
6250
  const row = document.createElement("div");
6249
6251
  row.className = "c-donut__item";
6252
+ row.setAttribute("role", "listitem");
6250
6253
  const sw = document.createElement("span");
6251
6254
  sw.className = "c-donut__swatch";
6252
6255
  sw.style.background = (typeof it === "object" && it.color) ? it.color : "var(--chart-" + ((i % 8) + 1) + ")";
@@ -6431,8 +6434,6 @@ class ContourPivot extends ContourBase {
6431
6434
  const toolbar = document.createElement("div");
6432
6435
  toolbar.className = "c-pivot__toolbar";
6433
6436
  toolbar.style.display = "flex";
6434
- toolbar.style.gap = "0.5rem";
6435
- toolbar.style.marginBlockEnd = "0.5rem";
6436
6437
  const filterInput = document.createElement("input");
6437
6438
  filterInput.type = "search";
6438
6439
  filterInput.className = "c-input c-pivot__filter";
@@ -6870,6 +6871,7 @@ class ContourMetricsFull extends ContourBase {
6870
6871
  static get properties() { return { items: { attribute: "items" }, src: { attribute: "src" } }; }
6871
6872
  render() {
6872
6873
  this.classList.add("c-metrics");
6874
+ this.setAttribute("role", "list");
6873
6875
  wireStates(this);
6874
6876
  loadRemote(this, "items");
6875
6877
  if (renderStates(this, "metrics")) return;
@@ -6882,6 +6884,7 @@ class ContourMetricsFull extends ContourBase {
6882
6884
  parsed.forEach((it) => {
6883
6885
  const item = document.createElement("div");
6884
6886
  item.className = "c-metrics__item";
6887
+ item.setAttribute("role", "listitem");
6885
6888
  const v = document.createElement("div");
6886
6889
  v.className = "c-metrics__value";
6887
6890
  v.textContent = (typeof it === "object" && it !== null) ? (it.value ?? it.v ?? "") : String(it);
@@ -6908,6 +6911,12 @@ class ContourLegend extends ContourBase {
6908
6911
  static get properties() { return { title: { attribute: "title" }, ramp: { attribute: "ramp" }, scale: { attribute: "scale" }, items: { attribute: "items" }, method: { attribute: "method" }, norm: { attribute: "norm" }, selectable: { attribute: "selectable", type: Boolean }, src: { attribute: "src" } }; }
6909
6912
  render() {
6910
6913
  this.classList.add("c-legend");
6914
+ const continuous = this.hasAttribute("continuous");
6915
+ if (continuous || this.hasAttribute("selectable")) {
6916
+ this.setAttribute("role", "group");
6917
+ } else {
6918
+ this.setAttribute("role", "list");
6919
+ }
6911
6920
  wireStates(this);
6912
6921
  loadRemote(this, "items");
6913
6922
  if (renderStates(this, "legend")) return;
@@ -6939,7 +6948,11 @@ class ContourLegend extends ContourBase {
6939
6948
  try {
6940
6949
  const parsed = JSON.parse(items);
6941
6950
  const list = this.ensure(".c-legend__items", () => { const el = document.createElement("div"); el.className = "c-legend__items"; return el; });
6942
- list.setAttribute("role", "listbox");
6951
+ if (this.hasAttribute("selectable")) {
6952
+ list.setAttribute("role", "group");
6953
+ } else {
6954
+ list.setAttribute("role", "listbox");
6955
+ }
6943
6956
  if (title) list.setAttribute("aria-label", title);
6944
6957
  list.innerHTML = "";
6945
6958
  parsed.forEach((it) => {
@@ -6949,8 +6962,8 @@ class ContourLegend extends ContourBase {
6949
6962
  item.className = "c-legend__item";
6950
6963
  item.setAttribute("tabindex", "-1");
6951
6964
  if (selectable) {
6952
- item.setAttribute("role", "option");
6953
- item.setAttribute("aria-selected", "true");
6965
+ item.setAttribute("role", "button");
6966
+ item.setAttribute("aria-pressed", "true");
6954
6967
  item.dataset.key = key;
6955
6968
  } else {
6956
6969
  item.setAttribute("role", "option");
@@ -7168,8 +7181,17 @@ class ContourLegend extends ContourBase {
7168
7181
  this.addEventListener("click", (e) => {
7169
7182
  const btn = e.target && e.target.closest ? e.target.closest(".c-legend__item") : null;
7170
7183
  if (!btn || !this.contains(btn)) return;
7171
- const selected = btn.getAttribute("aria-selected") !== "true";
7172
- btn.setAttribute("aria-selected", String(selected));
7184
+ let selected;
7185
+ const isPressed = btn.getAttribute("aria-pressed");
7186
+ if (btn.getAttribute("aria-pressed") !== null) {
7187
+ const pressed = btn.getAttribute("aria-pressed") !== "true";
7188
+ btn.setAttribute("aria-pressed", String(pressed));
7189
+ selected = pressed;
7190
+ } else {
7191
+ const selected2 = btn.getAttribute("aria-selected") !== "true";
7192
+ btn.setAttribute("aria-selected", String(selected2));
7193
+ selected = selected2;
7194
+ }
7173
7195
  this.dispatchEvent(new CustomEvent("contour:legend-toggle", {
7174
7196
  detail: { label: btn.textContent.trim(), key: btn.dataset.key || btn.textContent.trim(), pressed: selected },
7175
7197
  bubbles: true,
@@ -7542,7 +7564,7 @@ class ContourCompare extends ContourBase {
7542
7564
  this.classList.add("c-compare");
7543
7565
  this.setAttribute("role", "group");
7544
7566
  this.setAttribute("aria-label", "Comparison");
7545
- this.style.padding = "var(--space-md)";
7567
+
7546
7568
  wireStates(this);
7547
7569
  loadRemote(this, ["no", "text", "yes"]);
7548
7570
  if (renderStates(this, "compare")) return;
@@ -9989,9 +10011,13 @@ class ContourInputFull extends ContourBase {
9989
10011
  input.className = "c-input";
9990
10012
  input.type = this.getAttribute("type") || "text";
9991
10013
  input.placeholder = this.getAttribute("placeholder") || "";
9992
- const label = this.getAttribute("label");
10014
+ let label = this.getAttribute("label");
10015
+ if (!label) {
10016
+ const field = this.closest("contour-field");
10017
+ if (field) label = field.getAttribute("label");
10018
+ }
9993
10019
  if (label) input.setAttribute("aria-label", label);
9994
- // else: keep any aria-label set by an ancestor (e.g. contour-field).
10020
+ else if (!input.getAttribute("aria-label")) input.setAttribute("aria-label", "Input");
9995
10021
  if (this.hasAttribute("value")) input.value = this.getAttribute("value");
9996
10022
  if (this.hasAttribute("required")) input.setAttribute("required", "");
9997
10023
  else input.removeAttribute("required");
@@ -10238,6 +10264,7 @@ class ContourShortcutListFull extends ContourBase {
10238
10264
  static get properties() { return { title: { attribute: "title" } }; }
10239
10265
  render() {
10240
10266
  this.classList.add("c-shortcut-list");
10267
+ this.setAttribute("role", "list");
10241
10268
  const title = this.getAttribute("title");
10242
10269
  if (title) {
10243
10270
  const t = this.ensure(".c-shortcut-list__title", () => { const el = document.createElement("div"); el.className = "c-shortcut-list__title"; el.style.padding = "var(--space-sm)"; el.style.fontWeight = "var(--weight-semibold)"; return el; });
@@ -10251,6 +10278,7 @@ class ContourShortcutRowFull extends ContourBase {
10251
10278
  static get properties() { return { desc: { attribute: "desc" }, key: { attribute: "key" } }; }
10252
10279
  render() {
10253
10280
  this.classList.add("c-shortcut-row");
10281
+ this.setAttribute("role", "listitem");
10254
10282
  const key = this.getAttribute("key");
10255
10283
  const desc = this.getAttribute("desc");
10256
10284
  if (key) {
@@ -10295,7 +10323,7 @@ class ContourShortcutPanelFull extends ContourBase {
10295
10323
  this.classList.add("c-shortcut-overlay");
10296
10324
  const title = this.getAttribute("title");
10297
10325
  if (title) {
10298
- const t = this.ensure(".c-shortcut-overlay__title", () => { const el = document.createElement("div"); el.className = "c-shortcut-overlay__title"; el.style.padding = "var(--space-sm)"; return el; });
10326
+ const t = this.ensure(".c-shortcut-overlay__title", () => { const el = document.createElement("div"); el.className = "c-shortcut-overlay__title"; return el; });
10299
10327
  t.textContent = title;
10300
10328
  }
10301
10329
  if (this.hasAttribute("open")) this.removeAttribute("hidden");
@@ -10679,7 +10707,7 @@ class ContourBtn extends ContourBase {
10679
10707
  const header = this.ensure(".c-app__header", () => { const el = document.createElement("header"); el.className = "c-app__header"; return el; });
10680
10708
  const title = this.getAttribute("title");
10681
10709
  if (title) {
10682
- const t = this.ensure(".c-app__title", () => { const el = document.createElement("div"); el.className = "c-app__title"; el.style.padding = "var(--space-md)"; el.style.fontWeight = "var(--weight-semibold)"; return el; });
10710
+ const t = this.ensure(".c-app__title", () => { const el = document.createElement("div"); el.className = "c-app__title"; return el; });
10683
10711
  t.textContent = title;
10684
10712
  if (t.parentNode !== header) header.appendChild(t);
10685
10713
  }
@@ -10697,7 +10725,7 @@ class ContourBtn extends ContourBase {
10697
10725
  const main = this.ensure(".c-app-body__main", () => { const el = document.createElement("main"); el.className = "c-app-body__main"; return el; });
10698
10726
  const title = this.getAttribute("title");
10699
10727
  if (title) {
10700
- const t = this.ensure(".c-app-body__title", () => { const el = document.createElement("div"); el.className = "c-app-body__title"; el.style.padding = "var(--space-md)"; return el; });
10728
+ const t = this.ensure(".c-app-body__title", () => { const el = document.createElement("div"); el.className = "c-app-body__title"; return el; });
10701
10729
  t.textContent = title;
10702
10730
  if (t.parentNode !== main) main.appendChild(t);
10703
10731
  }
@@ -13183,6 +13211,7 @@ class ContourTocFull extends ContourBase {
13183
13211
  static get properties() { return { title: { attribute: "title" }, items: { attribute: "items" }, src: { attribute: "src" } }; }
13184
13212
  render() {
13185
13213
  this.classList.add("c-toc");
13214
+ this.setAttribute("role", "list");
13186
13215
  wireStates(this);
13187
13216
  loadRemote(this, "items");
13188
13217
  if (renderStates(this, "toc")) return;
@@ -13936,6 +13965,8 @@ class ContourAvatar extends ContourBase {
13936
13965
  img.className = "c-avatar__img";
13937
13966
  img.src = src;
13938
13967
  img.alt = name || "";
13968
+ img.loading = "lazy";
13969
+ img.decoding = "async";
13939
13970
  this.appendChild(img);
13940
13971
  } else if (name) {
13941
13972
  const initials = name.split(" ").map((w) => w[0]).join("").toUpperCase().slice(0, 2);
@@ -15022,7 +15053,7 @@ class ContourStylePanel extends ContourBase {
15022
15053
  body.appendChild(list);
15023
15054
  }
15024
15055
  // Apply/Revert buttons
15025
- const actions = document.createElement("div"); actions.className = "c-style-panel__actions";
15056
+ const actions = document.createElement("div"); actions.className = "c-style-panel__actions c-btn-group";
15026
15057
  const applyBtn = document.createElement("button"); applyBtn.type = "button"; applyBtn.className = "c-btn c-btn--primary"; applyBtn.textContent = "Apply";
15027
15058
  const revertBtn = document.createElement("button"); revertBtn.type = "button"; revertBtn.className = "c-btn"; revertBtn.textContent = "Revert";
15028
15059
  actions.appendChild(applyBtn); actions.appendChild(revertBtn);
@@ -16097,6 +16128,8 @@ class ContourFileUpload extends ContourBase {
16097
16128
  const img = document.createElement("img");
16098
16129
  img.className = "c-file-upload__preview-thumb";
16099
16130
  img.alt = f.name;
16131
+ img.loading = "lazy";
16132
+ img.decoding = "async";
16100
16133
  try { img.src = URL.createObjectURL(f); } catch (e) {}
16101
16134
  item.appendChild(img);
16102
16135
  } else {
@@ -16126,6 +16159,7 @@ class ContourNotificationCenter extends ContourBase {
16126
16159
  static get properties() { return { count: { attribute: "count" }, items: { attribute: "items" }, color: { attribute: "color" } }; }
16127
16160
  render() {
16128
16161
  this.classList.add("c-notification-center");
16162
+ this.setAttribute("role", "list");
16129
16163
  const btn = this.ensure(".c-notification-center__trigger", () => { const el = document.createElement("button"); el.className = "c-btn c-btn--sm c-notification-center__trigger"; el.type = "button"; el.innerHTML = '<span class="c-notification-center__bullet" aria-hidden="true"></span>'; el.setAttribute("aria-haspopup", "dialog"); el.setAttribute("aria-expanded", "false"); return el; });
16130
16164
  const color = this.getAttribute("color");
16131
16165
  const bullet = btn.querySelector(".c-notification-center__bullet");
@@ -16229,7 +16263,7 @@ class ContourStepper extends ContourBase {
16229
16263
  li.textContent = typeof s === "string" ? s : (s.title || s.label || "");
16230
16264
  list.appendChild(li);
16231
16265
  });
16232
- const nav = this.ensure(".c-stepper__nav", () => { const el = document.createElement("div"); el.className = "c-stepper__nav"; return el; });
16266
+ const nav = this.ensure(".c-stepper__nav", () => { const el = document.createElement("div"); el.className = "c-stepper__nav c-btn-group"; return el; });
16233
16267
  const prev = this.ensure(".c-stepper__prev", () => { const el = document.createElement("button"); el.className = "c-btn c-btn--sm c-stepper__prev"; el.type = "button"; el.textContent = "Back"; return el; });
16234
16268
  const next = this.ensure(".c-stepper__next", () => { const el = document.createElement("button"); el.className = "c-btn c-btn--sm c-stepper__next"; el.type = "button"; el.textContent = "Next"; return el; });
16235
16269
  if (!nav.contains(prev)) nav.appendChild(prev);
@@ -16627,7 +16661,7 @@ class ContourTour extends ContourBase {
16627
16661
  const step = parsed[current] || {};
16628
16662
  const tip = this.ensure(".c-tour__tip", () => { const el = document.createElement("div"); el.className = "c-tour__tip"; return el; });
16629
16663
  tip.textContent = typeof step === "string" ? step : (step.text || step.title || "");
16630
- const nav = this.ensure(".c-tour__nav", () => { const el = document.createElement("div"); el.className = "c-tour__nav"; return el; });
16664
+ const nav = this.ensure(".c-tour__nav", () => { const el = document.createElement("div"); el.className = "c-tour__nav c-btn-group"; return el; });
16631
16665
  const next = this.ensure(".c-tour__next", () => { const el = document.createElement("button"); el.className = "c-btn c-btn--sm c-tour__next"; el.type = "button"; el.textContent = "Next"; return el; });
16632
16666
  if (!nav.contains(next)) nav.appendChild(next);
16633
16667
  }