contour-ds 1.12.0 → 1.13.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 (93) hide show
  1. package/dist/build-manifest.json +80 -80
  2. package/dist/contour-wc-content.esm.js +8 -1
  3. package/dist/contour-wc-content.esm.min.js +1 -1
  4. package/dist/contour-wc-core.esm.js +15 -8
  5. package/dist/contour-wc-core.esm.min.js +1 -1
  6. package/dist/contour-wc-dashboard.esm.js +279 -20
  7. package/dist/contour-wc-dashboard.esm.min.js +1 -1
  8. package/dist/contour-wc-data.esm.js +279 -20
  9. package/dist/contour-wc-data.esm.min.js +1 -1
  10. package/dist/contour-wc-docs.esm.js +4 -0
  11. package/dist/contour-wc-feedback.esm.js +59 -7
  12. package/dist/contour-wc-feedback.esm.min.js +1 -1
  13. package/dist/contour-wc-forms.esm.js +20 -2
  14. package/dist/contour-wc-forms.esm.min.js +1 -1
  15. package/dist/contour-wc-interaction.esm.js +4 -0
  16. package/dist/contour-wc-layout.esm.js +4 -0
  17. package/dist/contour-wc-map.esm.js +4 -0
  18. package/dist/contour-wc-misc.esm.js +4 -0
  19. package/dist/contour-wc-navigation.esm.js +24 -14
  20. package/dist/contour-wc-navigation.esm.min.js +1 -1
  21. package/dist/contour-wc-ui.esm.js +290 -13
  22. package/dist/contour-wc-ui.esm.min.js +1 -1
  23. package/dist/contour-wc.esm.js +675 -65
  24. package/dist/contour-wc.esm.min.js +1 -1
  25. package/dist/contour-wc.js +675 -65
  26. package/dist/contour-wc.min.js +1 -1
  27. package/dist/contour.code-snippets +1 -1
  28. package/dist/contour.components.json +175 -16
  29. package/dist/contour.css +160 -1
  30. package/dist/contour.d.ts +6 -4
  31. package/dist/contour.html-data.json +68 -2
  32. package/dist/contour.min.css +1 -1
  33. package/dist/contour.react.d.ts +2 -2
  34. package/dist/contour.single.html +1 -1
  35. package/dist/contour.single.min.css +1 -1
  36. package/dist/contour.vue.d.ts +2 -2
  37. package/dist/contour.web-types.json +68 -3
  38. package/dist/custom-elements.json +265 -2
  39. package/dist/docs/actions.md +1 -1
  40. package/dist/docs/affordances.md +1 -1
  41. package/dist/docs/apireference.md +1 -1
  42. package/dist/docs/colour.md +1 -1
  43. package/dist/docs/componentindex.md +1 -1
  44. package/dist/docs/data.md +1 -1
  45. package/dist/docs/docs.md +1 -1
  46. package/dist/docs/feedback.md +1 -1
  47. package/dist/docs/field.md +1 -1
  48. package/dist/docs/forms.md +1 -1
  49. package/dist/docs/index.json +2 -2
  50. package/dist/docs/install.md +1 -1
  51. package/dist/docs/landing.md +1 -1
  52. package/dist/docs/mapengine.md +1 -1
  53. package/dist/docs/motion.md +1 -1
  54. package/dist/docs/navigation.md +1 -1
  55. package/dist/docs/overlays.md +1 -1
  56. package/dist/docs/overview.md +1 -1
  57. package/dist/docs/patterns.md +1 -1
  58. package/dist/docs/playground.md +1 -1
  59. package/dist/docs/principles.md +1 -1
  60. package/dist/docs/recipes.md +1 -1
  61. package/dist/docs/space.md +1 -1
  62. package/dist/docs/status.md +1 -1
  63. package/dist/docs/surfaces.md +1 -1
  64. package/dist/docs/theming.md +1 -1
  65. package/dist/docs/type.md +1 -1
  66. package/dist/docs/webcomponents.md +1 -1
  67. package/dist/registry/items/contour-core.json +2 -2
  68. package/dist/registry/items/contour-data.json +2 -2
  69. package/dist/registry/items/contour-docs.json +2 -2
  70. package/dist/registry/items/contour-landing.json +2 -2
  71. package/dist/registry/registry.json +8 -8
  72. package/dist/surfaces/contour-core.min.css +1 -1
  73. package/dist/surfaces/contour-data.min.css +1 -1
  74. package/dist/surfaces/contour-docs.min.css +1 -1
  75. package/dist/surfaces/contour-landing.min.css +1 -1
  76. package/dist/wc/behaviours.mjs +13 -7
  77. package/dist/wc/content.mjs +4 -1
  78. package/dist/wc/core.mjs +1 -0
  79. package/dist/wc/data-chart.mjs +147 -12
  80. package/dist/wc/data-export.mjs +43 -5
  81. package/dist/wc/data-series.mjs +74 -0
  82. package/dist/wc/data-table.mjs +13 -5
  83. package/dist/wc/feedback.mjs +55 -7
  84. package/dist/wc/forms-input.mjs +16 -2
  85. package/dist/wc/index.mjs +1 -1
  86. package/dist/wc/navigation-menu.mjs +20 -14
  87. package/dist/wc/shadow.mjs +4 -0
  88. package/dist/wc/ui-atoms.mjs +134 -3
  89. package/dist/wc/ui-data.mjs +67 -0
  90. package/dist/wc/ui-feedback.mjs +8 -1
  91. package/dist/wc/ui-overlays.mjs +77 -9
  92. package/integrations/libreship/contract.json +9 -2
  93. package/package.json +1 -1
@@ -438,6 +438,10 @@ import { CLASS_ONLY, CONTOUR_EVENTS, ContourBase, MERCATOR_MAX_LAT, MODS, OBSERV
438
438
  // Shadow tabs are a styling shell: panels are authored by the consumer
439
439
  shadow("contour-shadow-tabs", `<div class="c-tabs" part="tabs"><div class="c-tabs__list" part="list" role="tablist"><slot name="tabs"></slot></div><div class="c-tabs__panels" role="presentation"><slot></slot></div></div>`);
440
440
  shadow("contour-shadow-breadcrumb", `<nav class="c-breadcrumb" part="breadcrumb" aria-label="Breadcrumb"><ol><slot></slot></ol></nav>`);
441
+ // U-17: contour-shadow-menu is a shadow-styled shell with role="menu"; the
442
+ // consumer slots `role="menuitem"` children. It has no open/focus state of its
443
+ // own — pair it with contour-context-menu (which owns open/Escape/focus
444
+ // return) or drive focus with the standard menu keyboard contract.
441
445
  shadow("contour-shadow-menu", `<div class="c-menu" part="menu" role="menu"><slot></slot></div>`);
442
446
  shadow("contour-shadow-combobox", `<div class="c-combobox" part="combobox"><input class="c-combobox__input" part="input" type="text" /><ul class="c-combobox__list" part="list" hidden><slot></slot></ul></div>`);
443
447
  shadow("contour-shadow-chart", `<div class="c-chart" part="chart"><div class="c-chart__plot" part="plot"><slot></slot></div></div>`);
@@ -438,6 +438,10 @@ import { CLASS_ONLY, CONTOUR_EVENTS, ContourBase, MERCATOR_MAX_LAT, MODS, OBSERV
438
438
  // Shadow tabs are a styling shell: panels are authored by the consumer
439
439
  shadow("contour-shadow-tabs", `<div class="c-tabs" part="tabs"><div class="c-tabs__list" part="list" role="tablist"><slot name="tabs"></slot></div><div class="c-tabs__panels" role="presentation"><slot></slot></div></div>`);
440
440
  shadow("contour-shadow-breadcrumb", `<nav class="c-breadcrumb" part="breadcrumb" aria-label="Breadcrumb"><ol><slot></slot></ol></nav>`);
441
+ // U-17: contour-shadow-menu is a shadow-styled shell with role="menu"; the
442
+ // consumer slots `role="menuitem"` children. It has no open/focus state of its
443
+ // own — pair it with contour-context-menu (which owns open/Escape/focus
444
+ // return) or drive focus with the standard menu keyboard contract.
441
445
  shadow("contour-shadow-menu", `<div class="c-menu" part="menu" role="menu"><slot></slot></div>`);
442
446
  shadow("contour-shadow-combobox", `<div class="c-combobox" part="combobox"><input class="c-combobox__input" part="input" type="text" /><ul class="c-combobox__list" part="list" hidden><slot></slot></ul></div>`);
443
447
  shadow("contour-shadow-chart", `<div class="c-chart" part="chart"><div class="c-chart__plot" part="plot"><slot></slot></div></div>`);
@@ -619,6 +623,33 @@ shadow("contour-shadow-filter-pill", `<span class="c-filter-pill" part="filter-p
619
623
  function overlayIsModal(host) {
620
624
  return host.getAttribute("mode") !== "inline";
621
625
  }
626
+ // U-12: a shared open-overlay stack. Nested overlays (a dialog inside a drawer,
627
+ // a sheet inside a dialog) must close only the topmost on Escape — without this a
628
+ // single Escape bubbled to every ancestor overlay and closed them all. Each
629
+ // overlay pushes on open and pops on close; the Escape handler acts only when it
630
+ // is the top of the stack, and stops the event so an ancestor handler never runs.
631
+ const overlayStack = [];
632
+ function overlayPush(host) {
633
+ const i = overlayStack.indexOf(host);
634
+ if (i >= 0) overlayStack.splice(i, 1);
635
+ overlayStack.push(host);
636
+ }
637
+ function overlayPop(host) {
638
+ const i = overlayStack.indexOf(host);
639
+ if (i >= 0) overlayStack.splice(i, 1);
640
+ }
641
+ function overlayIsTop(host) {
642
+ return overlayStack[overlayStack.length - 1] === host;
643
+ }
644
+ // U-12: the Escape branch shared by dialog/drawer/sheet. Returns true when the
645
+ // event was consumed (so the caller can `return`).
646
+ function overlayHandleEscape(host, e) {
647
+ if (e.key !== "Escape") return false;
648
+ if (!overlayIsTop(host)) return true; // a higher overlay owns this Escape
649
+ e.stopPropagation();
650
+ host.close();
651
+ return true;
652
+ }
622
653
  // R31-12: an authored `open` at load displays the modal (CSS [open]) but never
623
654
  // ran show(), so it was not actually modal — no aria-modal, no inert siblings,
624
655
  // no focus inside. Engage the modal for an initial open without re-entering
@@ -627,6 +658,7 @@ function engageInitialModal(host) {
627
658
  if (!host.hasAttribute("open") || host._modalEngaged) return;
628
659
  host._modalEngaged = true;
629
660
  host._overlayOpen = true;
661
+ overlayPush(host); // U-12: an initially-open overlay joins the stack.
630
662
  host.classList.add("is-open");
631
663
  if (overlayIsModal(host)) {
632
664
  host.setAttribute("aria-modal", "true");
@@ -724,12 +756,14 @@ class ContourDialog extends ContourBase {
724
756
  };
725
757
  onDispose(this, () => {
726
758
  if (this.hasAttribute("open")) modalContain(this, false);
759
+ overlayPop(this); // U-12
727
760
  this._removeScrim();
728
761
  });
729
762
  // open attribute is written, never observed — no render re-entry.
730
763
  this.show = () => {
731
764
  if (this.hasAttribute("open")) return;
732
765
  this._overlayOpen = true;
766
+ overlayPush(this); // U-12
733
767
  this._dialogLastFocus = document.activeElement;
734
768
  // Guard our own `open` write: syncDeclarativeOpen would otherwise see the
735
769
  // attribute change (aria-modal is not set yet) and re-enter show(), firing
@@ -753,6 +787,7 @@ class ContourDialog extends ContourBase {
753
787
  // a lower stacked dialog stays inert.
754
788
  const wasOpen = this.hasAttribute("open") || this.hasAttribute("aria-modal") || this._overlayOpen;
755
789
  this._overlayOpen = false;
790
+ overlayPop(this); // U-12
756
791
  const dlg = this.querySelector("dialog") || (this.tagName === "DIALOG" ? this : null);
757
792
  if (dlg && typeof dlg.close === "function") dlg.close();
758
793
  // Guard our own `open` removal so syncDeclarativeOpen does not re-enter
@@ -781,9 +816,9 @@ class ContourDialog extends ContourBase {
781
816
  // Backdrop click: clicking the host surface (not its content) closes.
782
817
  if (e.target === this) this.close();
783
818
  });
784
- // Escape closes only while open; unconditional event is a claim it can't back.
819
+ // Escape closes only while open; a nested overlay closes only the topmost (U-12).
785
820
  this.addEventListener("keydown", (e) => {
786
- if (e.key === "Escape" && this.hasAttribute("open")) this.close();
821
+ if (e.key === "Escape" && this.hasAttribute("open")) overlayHandleEscape(this, e);
787
822
  });
788
823
  engageInitialModal(this);
789
824
  }
@@ -834,14 +869,25 @@ class ContourAlert extends ContourBase {
834
869
  const t = this.querySelector(".c-alert__title");
835
870
  if (t) t.remove();
836
871
  }
837
- // Authored children move into .c-alert__body (default slot); `body` attribute fills when no children.
872
+ // Authored children move into .c-alert__body (default slot); `body` attribute fills when no children.
838
873
  const body = this.getAttribute("body");
839
874
  const authored = Array.from(this.childNodes).filter((n) => {
840
- if (n.nodeType === 1 && n.classList && (n.classList.contains("c-alert__icon") || n.classList.contains("c-alert__title") || n.classList.contains("c-alert__body"))) return false;
875
+ // U-9: generated controls (action/close) are NOT authored children. Before
876
+ // this they were folded into the body on re-render, which wiped a changed
877
+ // `body` attribute in place (authored.length was truthy, so the body branch
878
+ // never ran). Excluding them keeps `body` authoritative across re-renders.
879
+ if (n.nodeType === 1 && n.classList && (n.classList.contains("c-alert__icon") || n.classList.contains("c-alert__title") || n.classList.contains("c-alert__body") || n.classList.contains("c-alert__action") || n.classList.contains("c-alert__close"))) return false;
841
880
  if (n.nodeType === 3 && !n.textContent.trim()) return false;
842
881
  return true;
843
882
  });
844
- if (authored.length) {
883
+ // U-9: the `body` attribute is authoritative across re-renders. The base
884
+ // class unwraps the previous `.c-alert__body` content back to the host
885
+ // before re-rendering, so the old body text returns as an "authored" text
886
+ // node; drop those lifted text nodes so a changed `body` value wins.
887
+ if (body) {
888
+ for (const n of authored) { if (n.nodeType === 3 && n.parentNode === this) n.remove(); }
889
+ }
890
+ if (authored.length && !body) {
845
891
  const b = this.ensure(".c-alert__body", () => { const el = document.createElement("div"); el.className = "c-alert__body"; return el; });
846
892
  b.textContent = "";
847
893
  for (const n of authored) b.appendChild(n);
@@ -1394,11 +1440,13 @@ class ContourDrawer extends ContourBase {
1394
1440
  };
1395
1441
  onDispose(this, () => {
1396
1442
  if (this.hasAttribute("open") || this._overlayOpen) modalContain(this, false);
1443
+ overlayPop(this); // U-12
1397
1444
  this._removeScrim();
1398
1445
  });
1399
1446
  this.show = () => {
1400
1447
  if (this.hasAttribute("open")) return;
1401
1448
  this._overlayOpen = true;
1449
+ overlayPush(this); // U-12
1402
1450
  this._drawerLastFocus = document.activeElement;
1403
1451
  // Guard our own `open` write (see ContourDialog.show): re-entry doubles
1404
1452
  // contour:open and leaks a modalContain depth.
@@ -1423,6 +1471,7 @@ class ContourDrawer extends ContourBase {
1423
1471
  // (or an open inline panel) must still release its state.
1424
1472
  if (!this.hasAttribute("open") && !this._overlayOpen) return;
1425
1473
  this._overlayOpen = false;
1474
+ overlayPop(this); // U-12
1426
1475
  // Guard our own `open` removal (see ContourDialog.close): re-entry
1427
1476
  // doubles the close event and the modalContain release.
1428
1477
  this._declarativeOpen = true;
@@ -1443,7 +1492,7 @@ class ContourDrawer extends ContourBase {
1443
1492
  if (e.target === this) this.close();
1444
1493
  });
1445
1494
  this.addEventListener("keydown", (e) => {
1446
- if (e.key === "Escape" && this.hasAttribute("open")) this.close();
1495
+ if (e.key === "Escape" && this.hasAttribute("open")) overlayHandleEscape(this, e);
1447
1496
  });
1448
1497
  // Swipe-to-close (deferred P3): horizontal swipe past threshold closes.
1449
1498
  let touchStartX = 0, touchStartY = 0;
@@ -1550,11 +1599,13 @@ class ContourSheet extends ContourBase {
1550
1599
  };
1551
1600
  onDispose(this, () => {
1552
1601
  if (this.hasAttribute("open") || this._overlayOpen) modalContain(this, false);
1602
+ overlayPop(this); // U-12
1553
1603
  this._removeScrim();
1554
1604
  });
1555
1605
  this.show = () => {
1556
1606
  if (this.hasAttribute("open")) return;
1557
1607
  this._overlayOpen = true;
1608
+ overlayPush(this); // U-12
1558
1609
  this._sheetLastFocus = document.activeElement;
1559
1610
  // Guard our own `open` write (see ContourDialog.show): re-entry doubles
1560
1611
  // contour:open and leaks a modalContain depth.
@@ -1577,6 +1628,7 @@ class ContourSheet extends ContourBase {
1577
1628
  // (or an open inline panel) must still release its state.
1578
1629
  if (!this.hasAttribute("open") && !this._overlayOpen) return;
1579
1630
  this._overlayOpen = false;
1631
+ overlayPop(this); // U-12
1580
1632
  // Guard our own `open` removal (see ContourDialog.close): re-entry
1581
1633
  // doubles the close event and the modalContain release.
1582
1634
  this._declarativeOpen = true;
@@ -1597,7 +1649,7 @@ class ContourSheet extends ContourBase {
1597
1649
  if (e.target === this) this.close();
1598
1650
  });
1599
1651
  this.addEventListener("keydown", (e) => {
1600
- if (e.key === "Escape" && this.hasAttribute("open")) this.close();
1652
+ if (e.key === "Escape" && this.hasAttribute("open")) overlayHandleEscape(this, e);
1601
1653
  });
1602
1654
  // Swipe-to-close (deferred P3): vertical swipe down past threshold closes.
1603
1655
  let touchStartY = 0, touchStartX = 0;