@atomic-ui/ui 0.1.5 → 0.2.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 (181) hide show
  1. package/README.md +17 -3
  2. package/custom-elements.json +24569 -0
  3. package/dist/base/ImpktElement.d.ts +14 -0
  4. package/dist/base/locale.d.ts +8 -0
  5. package/dist/base/say.d.ts +1 -0
  6. package/dist/base/styles.d.ts +1 -1
  7. package/dist/base/tokens.d.ts +28 -2
  8. package/dist/{chunk-KWURASAB.js → chunk-26O27BQS.js} +3 -3
  9. package/dist/chunk-2CFVV2NZ.js +494 -0
  10. package/dist/chunk-2CFVV2NZ.js.map +1 -0
  11. package/dist/chunk-3IGNZTJU.js +14 -0
  12. package/dist/chunk-3IGNZTJU.js.map +1 -0
  13. package/dist/{chunk-DR3SJ7ZV.js → chunk-3IQ73WNW.js} +3 -3
  14. package/dist/{chunk-AXQ5YBN2.js → chunk-4X723QBD.js} +135 -10
  15. package/dist/chunk-4X723QBD.js.map +1 -0
  16. package/dist/{chunk-OFAVRPRK.js → chunk-6YYAOKNI.js} +2 -2
  17. package/dist/chunk-6YYAOKNI.js.map +1 -0
  18. package/dist/{chunk-DI2CJ3MZ.js → chunk-7AJN2TIS.js} +2 -2
  19. package/dist/chunk-7BSZPUE3.js +53 -0
  20. package/dist/chunk-7BSZPUE3.js.map +1 -0
  21. package/dist/{chunk-IBTOZOGI.js → chunk-7OXTZJR4.js} +2 -2
  22. package/dist/chunk-7XEPNEVQ.js +264 -0
  23. package/dist/chunk-7XEPNEVQ.js.map +1 -0
  24. package/dist/{chunk-5NUF7ZQA.js → chunk-D6C7XEY4.js} +64 -3
  25. package/dist/chunk-D6C7XEY4.js.map +1 -0
  26. package/dist/{chunk-4JKUAA6K.js → chunk-E2VBUWJ4.js} +53 -14
  27. package/dist/chunk-E2VBUWJ4.js.map +1 -0
  28. package/dist/{chunk-57P4WO4Y.js → chunk-E3XJK7MY.js} +38 -23
  29. package/dist/chunk-E3XJK7MY.js.map +1 -0
  30. package/dist/{chunk-6UDDZQDK.js → chunk-EDSZI227.js} +3 -3
  31. package/dist/chunk-EDSZI227.js.map +1 -0
  32. package/dist/{chunk-3OSL2HMN.js → chunk-FFCIY7NM.js} +9 -6
  33. package/dist/chunk-FFCIY7NM.js.map +1 -0
  34. package/dist/{chunk-4AJPS5AU.js → chunk-FJRHZA3C.js} +16 -6
  35. package/dist/chunk-FJRHZA3C.js.map +1 -0
  36. package/dist/{chunk-JPEWRJSQ.js → chunk-GQDUHZE3.js} +3 -3
  37. package/dist/chunk-HYPPG4NF.js +553 -0
  38. package/dist/chunk-HYPPG4NF.js.map +1 -0
  39. package/dist/chunk-J4JULXUG.js +249 -0
  40. package/dist/chunk-J4JULXUG.js.map +1 -0
  41. package/dist/{chunk-CFGLOYWW.js → chunk-KFD4O7VA.js} +4 -2
  42. package/dist/chunk-KFD4O7VA.js.map +1 -0
  43. package/dist/{chunk-LLRJU7XE.js → chunk-MVEFM5QI.js} +6 -6
  44. package/dist/chunk-MVEFM5QI.js.map +1 -0
  45. package/dist/{chunk-6GKI67P7.js → chunk-NCASAXQT.js} +7 -3
  46. package/dist/chunk-NCASAXQT.js.map +1 -0
  47. package/dist/{chunk-H6L3FSQY.js → chunk-NKTMMJYD.js} +7 -6
  48. package/dist/chunk-NKTMMJYD.js.map +1 -0
  49. package/dist/{chunk-QELX47AP.js → chunk-OB7WULFK.js} +50 -27
  50. package/dist/chunk-OB7WULFK.js.map +1 -0
  51. package/dist/chunk-OHDPGIJ3.js +428 -0
  52. package/dist/chunk-OHDPGIJ3.js.map +1 -0
  53. package/dist/{chunk-TZD7IVVQ.js → chunk-OLLZFNO6.js} +13 -5
  54. package/dist/chunk-OLLZFNO6.js.map +1 -0
  55. package/dist/{chunk-5RVMMKMO.js → chunk-OMJMUFOW.js} +3 -3
  56. package/dist/{chunk-U2S7OESF.js → chunk-QB2KMV6S.js} +56 -15
  57. package/dist/chunk-QB2KMV6S.js.map +1 -0
  58. package/dist/{chunk-QH46SOPJ.js → chunk-R67PDFKE.js} +54 -11
  59. package/dist/chunk-R67PDFKE.js.map +1 -0
  60. package/dist/chunk-RZSZQMSE.js +236 -0
  61. package/dist/chunk-RZSZQMSE.js.map +1 -0
  62. package/dist/{chunk-6MLXFFH4.js → chunk-TGT7J4EG.js} +3 -3
  63. package/dist/chunk-TGT7J4EG.js.map +1 -0
  64. package/dist/{chunk-S3EQO33M.js → chunk-UCHJCUYI.js} +6 -4
  65. package/dist/chunk-UCHJCUYI.js.map +1 -0
  66. package/dist/chunk-UHLRXI6J.js +453 -0
  67. package/dist/chunk-UHLRXI6J.js.map +1 -0
  68. package/dist/chunk-UNVL3CNM.js +725 -0
  69. package/dist/chunk-UNVL3CNM.js.map +1 -0
  70. package/dist/{chunk-2RBYVWZT.js → chunk-WDDWWCHN.js} +5 -3
  71. package/dist/chunk-WDDWWCHN.js.map +1 -0
  72. package/dist/chunk-WFKSOM6O.js +498 -0
  73. package/dist/chunk-WFKSOM6O.js.map +1 -0
  74. package/dist/{chunk-HWNY6U5F.js → chunk-XEJMFFIM.js} +4 -3
  75. package/dist/chunk-XEJMFFIM.js.map +1 -0
  76. package/dist/{chunk-ZDYTNFQI.js → chunk-XJXCTGDR.js} +16 -6
  77. package/dist/chunk-XJXCTGDR.js.map +1 -0
  78. package/dist/{chunk-G6UVYMA6.js → chunk-YD6IZ2C5.js} +2 -2
  79. package/dist/chunk-YK5QI57J.js +396 -0
  80. package/dist/chunk-YK5QI57J.js.map +1 -0
  81. package/dist/components/accordion.js +2 -2
  82. package/dist/components/alert.js +2 -2
  83. package/dist/components/app-ui.d.ts +421 -0
  84. package/dist/components/app-ui.js +27 -0
  85. package/dist/components/app-ui.js.map +1 -0
  86. package/dist/components/blocks.d.ts +2 -2
  87. package/dist/components/blocks.js +3 -3
  88. package/dist/components/button.d.ts +14 -0
  89. package/dist/components/button.js +3 -3
  90. package/dist/components/changelog.d.ts +386 -0
  91. package/dist/components/changelog.js +25 -0
  92. package/dist/components/changelog.js.map +1 -0
  93. package/dist/components/checkbox-group.js +3 -3
  94. package/dist/components/checkbox.js +3 -3
  95. package/dist/components/date-input.js +3 -3
  96. package/dist/components/dialog.js +2 -2
  97. package/dist/components/estimator.d.ts +246 -0
  98. package/dist/components/estimator.js +16 -0
  99. package/dist/components/estimator.js.map +1 -0
  100. package/dist/components/fieldset.js +2 -2
  101. package/dist/components/grid.d.ts +2 -2
  102. package/dist/components/grid.js +2 -2
  103. package/dist/components/help.js +2 -2
  104. package/dist/components/icon.d.ts +2 -0
  105. package/dist/components/icon.js +2 -2
  106. package/dist/components/journey.d.ts +433 -0
  107. package/dist/components/journey.js +22 -0
  108. package/dist/components/journey.js.map +1 -0
  109. package/dist/components/layout.d.ts +34 -5
  110. package/dist/components/layout.js +2 -2
  111. package/dist/components/link.js +3 -3
  112. package/dist/components/list.d.ts +50 -0
  113. package/dist/components/list.js +8 -0
  114. package/dist/components/list.js.map +1 -0
  115. package/dist/components/marketing.d.ts +119 -6
  116. package/dist/components/marketing.js +7 -3
  117. package/dist/components/media.d.ts +10 -0
  118. package/dist/components/media.js +2 -2
  119. package/dist/components/navigation.d.ts +25 -2
  120. package/dist/components/navigation.js +3 -3
  121. package/dist/components/organisms.d.ts +559 -0
  122. package/dist/components/organisms.js +25 -0
  123. package/dist/components/organisms.js.map +1 -0
  124. package/dist/components/page.d.ts +14 -3
  125. package/dist/components/page.js +2 -2
  126. package/dist/components/price.d.ts +6 -1
  127. package/dist/components/price.js +3 -2
  128. package/dist/components/progress.js +2 -2
  129. package/dist/components/property.d.ts +389 -0
  130. package/dist/components/property.js +20 -0
  131. package/dist/components/property.js.map +1 -0
  132. package/dist/components/radio-group.js +3 -3
  133. package/dist/components/scene.d.ts +138 -0
  134. package/dist/components/scene.js +8 -0
  135. package/dist/components/scene.js.map +1 -0
  136. package/dist/components/scrubber.d.ts +86 -0
  137. package/dist/components/scrubber.js +8 -0
  138. package/dist/components/scrubber.js.map +1 -0
  139. package/dist/components/select.js +3 -3
  140. package/dist/components/selling.d.ts +407 -0
  141. package/dist/components/selling.js +25 -0
  142. package/dist/components/selling.js.map +1 -0
  143. package/dist/components/site.d.ts +283 -0
  144. package/dist/components/site.js +20 -0
  145. package/dist/components/site.js.map +1 -0
  146. package/dist/components/summary-list.js +2 -2
  147. package/dist/components/table.js +2 -2
  148. package/dist/components/text-input.js +3 -3
  149. package/dist/components/textarea.d.ts +13 -0
  150. package/dist/components/textarea.js +3 -3
  151. package/dist/index.d.ts +13 -2
  152. package/dist/index.js +180 -47
  153. package/package.json +11 -4
  154. package/dist/chunk-2RBYVWZT.js.map +0 -1
  155. package/dist/chunk-3OSL2HMN.js.map +0 -1
  156. package/dist/chunk-4AJPS5AU.js.map +0 -1
  157. package/dist/chunk-4JKUAA6K.js.map +0 -1
  158. package/dist/chunk-57P4WO4Y.js.map +0 -1
  159. package/dist/chunk-5NUF7ZQA.js.map +0 -1
  160. package/dist/chunk-6GKI67P7.js.map +0 -1
  161. package/dist/chunk-6MLXFFH4.js.map +0 -1
  162. package/dist/chunk-6UDDZQDK.js.map +0 -1
  163. package/dist/chunk-AXQ5YBN2.js.map +0 -1
  164. package/dist/chunk-CFGLOYWW.js.map +0 -1
  165. package/dist/chunk-H6L3FSQY.js.map +0 -1
  166. package/dist/chunk-HWNY6U5F.js.map +0 -1
  167. package/dist/chunk-LLRJU7XE.js.map +0 -1
  168. package/dist/chunk-OFAVRPRK.js.map +0 -1
  169. package/dist/chunk-QELX47AP.js.map +0 -1
  170. package/dist/chunk-QH46SOPJ.js.map +0 -1
  171. package/dist/chunk-S3EQO33M.js.map +0 -1
  172. package/dist/chunk-TZD7IVVQ.js.map +0 -1
  173. package/dist/chunk-U2S7OESF.js.map +0 -1
  174. package/dist/chunk-ZDYTNFQI.js.map +0 -1
  175. /package/dist/{chunk-KWURASAB.js.map → chunk-26O27BQS.js.map} +0 -0
  176. /package/dist/{chunk-DR3SJ7ZV.js.map → chunk-3IQ73WNW.js.map} +0 -0
  177. /package/dist/{chunk-DI2CJ3MZ.js.map → chunk-7AJN2TIS.js.map} +0 -0
  178. /package/dist/{chunk-IBTOZOGI.js.map → chunk-7OXTZJR4.js.map} +0 -0
  179. /package/dist/{chunk-JPEWRJSQ.js.map → chunk-GQDUHZE3.js.map} +0 -0
  180. /package/dist/{chunk-5RVMMKMO.js.map → chunk-OMJMUFOW.js.map} +0 -0
  181. /package/dist/{chunk-G6UVYMA6.js.map → chunk-YD6IZ2C5.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  iconSvg
3
- } from "./chunk-CFGLOYWW.js";
3
+ } from "./chunk-KFD4O7VA.js";
4
4
  import {
5
5
  ImpktElement,
6
6
  focusRing,
@@ -10,12 +10,12 @@ import {
10
10
  t,
11
11
  targetSize,
12
12
  visuallyHidden
13
- } from "./chunk-5NUF7ZQA.js";
13
+ } from "./chunk-D6C7XEY4.js";
14
14
 
15
15
  // packages/ui/src/components/navigation.ts
16
16
  import { css, html, nothing } from "lit";
17
17
  function where(href) {
18
- if (typeof location === "undefined" || !href) return null;
18
+ if (typeof location === "undefined" || !href || href.startsWith("#")) return null;
19
19
  let path;
20
20
  try {
21
21
  path = new URL(href, location.href).pathname.replace(/\/$/, "") || "/";
@@ -31,9 +31,13 @@ var ImpktNav = class extends ImpktElement {
31
31
  super();
32
32
  /** Whether the menu is open on a narrow screen. Not a setting: it is the visitor's. */
33
33
  this.menuOpen = false;
34
+ /** The width the links need in one row. Measured once for each set of links, and again while folded it cannot be read. */
35
+ this.needs = 0;
34
36
  this.links = [];
35
37
  this.label = "Main";
36
38
  this.menuText = "Menu";
39
+ this.menuLook = "button";
40
+ this.size = "md";
37
41
  this.align = "end";
38
42
  }
39
43
  static {
@@ -41,6 +45,8 @@ var ImpktNav = class extends ImpktElement {
41
45
  links: { type: Array },
42
46
  label: { type: String },
43
47
  menuText: { type: String, attribute: "menu-text" },
48
+ menuLook: { type: String, reflect: true, attribute: "menu-look" },
49
+ size: { type: String, reflect: true },
44
50
  align: { type: String, reflect: true }
45
51
  };
46
52
  }
@@ -54,25 +60,60 @@ var ImpktNav = class extends ImpktElement {
54
60
  static {
55
61
  this.styles = [...ImpktElement.styles, focusRing, css`
56
62
  /* It grows to fill a row it sits in, because it measures itself to decide when to fold. */
57
- :host { display: block; container-type: inline-size; flex: 1 1 8rem; min-inline-size: 0; }
63
+ :host { display: block; flex: 1 1 8rem; min-inline-size: 0; }
58
64
  nav { display: flex; flex-direction: column; position: relative; }
59
- ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: ${space(1)} ${space(4)}; align-items: center; justify-content: flex-end; }
65
+ li { flex: none; }
66
+ ul { list-style: none; margin: 0; padding: 0; display: flex; gap: ${space(1)} ${space(6)}; align-items: center; justify-content: flex-end; }
60
67
  :host([align='start']) ul { justify-content: flex-start; }
61
68
  :host([align='center']) ul { justify-content: center; }
62
69
  a { ${targetSize} display: inline-flex; align-items: center; padding: ${space(2)} ${space(1)}; color: inherit; font-weight: ${fontWeight("semibold")}; text-decoration: none; border-radius: ${t.radiusSm}; }
63
70
  a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
64
71
  a[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.35em; }
65
72
  .toggle { display: none; ${targetSize} align-items: center; gap: ${space(2)}; align-self: flex-end; padding: ${space(2)} ${space(3)}; font: inherit; font-weight: ${fontWeight("semibold")}; color: inherit; background: transparent; border: ${t.borderThin} solid currentColor; border-radius: ${t.radius}; cursor: pointer; }
66
- /* On a narrow screen the links fold behind a Menu button and open as a panel under it. */
67
- @container (max-width: 36rem) {
68
- .toggle { display: inline-flex; }
69
- ul { display: none; position: absolute; inset-block-start: calc(100% + ${space(2)}); inset-inline-end: 0; z-index: 30; flex-direction: column; align-items: stretch; gap: 0; min-inline-size: 14rem; padding: ${space(2)}; background: ${t.surfaceCard}; color: ${t.text}; border: ${t.borderThin} solid ${t.border}; border-radius: ${t.radiusLg}; box-shadow: 0 8px 24px rgb(0 0 0 / 14%); }
70
- ul.open { display: flex; }
71
- li { text-align: start; }
72
- a { display: flex; padding: ${space(3)} ${space(3)}; }
73
- }
73
+ /* When they do not fit, the links fold behind a Menu button and open as a panel under it. */
74
+ :host([folded]) { flex: 0 0 auto; }
75
+ :host([folded]) .toggle { display: inline-flex; }
76
+ :host([menu-look='icon']) .toggle { inline-size: 44px; block-size: 44px; padding: 0; justify-content: center; border: 0; border-radius: 50%; background: ${t.brand}; color: ${t.onBrand}; }
77
+ :host([menu-look='icon']) .toggle .words { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
78
+ :host([size='sm']) ul { column-gap: ${space(6)}; }
79
+ :host([size='sm']) a { padding-inline: 0; font-size: ${fontSize("sm")}; font-weight: ${fontWeight("medium")}; }
80
+ :host([size='sm'][folded]) a { padding-inline: ${space(3)}; }
81
+ :host([folded]) ul { display: none; position: absolute; inset-block-start: calc(100% + ${space(2)}); inset-inline-end: 0; z-index: 30; flex-direction: column; align-items: stretch; gap: 0; min-inline-size: 14rem; padding: ${space(2)}; background: ${t.surfaceCard}; color: ${t.text}; border: ${t.borderThin} solid ${t.border}; border-radius: ${t.radiusLg}; box-shadow: 0 8px 24px rgb(0 0 0 / 14%); }
82
+ :host([folded]) ul.open { display: flex; }
83
+ :host([folded]) li { text-align: start; }
84
+ :host([folded]) a { display: flex; padding: ${space(3)} ${space(3)}; }
74
85
  `];
75
86
  }
87
+ fit() {
88
+ const room = this.getBoundingClientRect().width;
89
+ if (room <= 0) return;
90
+ if (!this.needs) {
91
+ this.removeAttribute("folded");
92
+ const items = Array.from(this.renderRoot.querySelectorAll("li"));
93
+ const gap = Number.parseFloat(getComputedStyle(this.renderRoot.querySelector("ul")).columnGap) || 0;
94
+ this.needs = items.reduce((total, item) => total + item.getBoundingClientRect().width, 0) + gap * Math.max(0, items.length - 1);
95
+ }
96
+ const fold = this.needs > room;
97
+ this.toggleAttribute("folded", fold);
98
+ if (!fold && this.menuOpen) this.open = false;
99
+ }
100
+ updated(changed) {
101
+ if (changed.has("links")) {
102
+ this.needs = 0;
103
+ this.fit();
104
+ }
105
+ }
106
+ connectedCallback() {
107
+ super.connectedCallback();
108
+ if (typeof ResizeObserver === "function") {
109
+ this.resize = new ResizeObserver(() => this.fit());
110
+ this.resize.observe(this);
111
+ }
112
+ }
113
+ disconnectedCallback() {
114
+ super.disconnectedCallback();
115
+ this.resize?.disconnect();
116
+ }
76
117
  toggle() {
77
118
  this.open = !this.open;
78
119
  }
@@ -84,7 +125,7 @@ var ImpktNav = class extends ImpktElement {
84
125
  render() {
85
126
  const list = this.id_("links");
86
127
  return html`<nav aria-label=${this.label || nothing} part="nav" @keydown=${this.onKey}>
87
- <button class="toggle" type="button" aria-expanded=${this.open ? "true" : "false"} aria-controls=${list} @click=${this.toggle}>${iconSvg(this.open ? "close" : "menu")}${this.menuText}</button>
128
+ <button class="toggle" type="button" aria-expanded=${this.open ? "true" : "false"} aria-controls=${list} @click=${this.toggle}>${iconSvg(this.open ? "close" : this.menuLook === "icon" ? "menu-two" : "menu")}<span class="words">${this.menuText}</span></button>
88
129
  <ul id=${list} class=${this.open ? "open" : ""} part="list">
89
130
  ${(this.links ?? []).map((link) => {
90
131
  const current = where(link.href);
@@ -132,4 +173,4 @@ export {
132
173
  ImpktNav,
133
174
  ImpktBreadcrumbs
134
175
  };
135
- //# sourceMappingURL=chunk-U2S7OESF.js.map
176
+ //# sourceMappingURL=chunk-QB2KMV6S.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/navigation.ts"],"sourcesContent":["import { css, html, nothing, type TemplateResult } from 'lit';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { focusRing, targetSize, visuallyHidden } from '../base/styles';\nimport { fontSize, fontWeight, space, t } from '../base/tokens';\nimport { iconSvg } from './icon';\n\n/** One link in a navigation or a trail. */\nexport interface NavLink {\n label: string;\n href: string;\n}\n\n/** Whether a link is the page the visitor is on, or a page above it. */\nfunction where(href: string): 'page' | 'section' | null {\n // A link to a place on this page, or to nowhere yet (\"#\"), is not where the reader is.\n if (typeof location === 'undefined' || !href || href.startsWith('#')) return null;\n let path: string;\n try { path = new URL(href, location.href).pathname.replace(/\\/$/, '') || '/'; } catch { return null; }\n const here = location.pathname.replace(/\\/$/, '') || '/';\n if (path === here) return 'page';\n return path !== '/' && here.startsWith(`${path}/`) ? 'section' : null;\n}\n\n/**\n * The site's main navigation: a row of links that folds into a Menu button\n * when there is not room for all of them, whatever the screen.\n *\n * **The page you are on is marked in words as well as colour.** Its link\n * carries `aria-current=\"page\"`, which a screen reader announces, and an\n * underline, so it does not rely on colour alone (1.4.1).\n *\n * **The menu is a disclosure, not a pop-up.** The Menu button says whether the\n * list is open (`aria-expanded`), the links follow it in the reading order, and\n * Escape closes it and returns focus to the button.\n *\n * @category action\n * @icon menu\n */\nexport class ImpktNav extends ImpktElement {\n static properties = {\n links: { type: Array },\n label: { type: String },\n menuText: { type: String, attribute: 'menu-text' },\n menuLook: { type: String, reflect: true, attribute: 'menu-look' },\n size: { type: String, reflect: true },\n align: { type: String, reflect: true },\n };\n /** The links, in order. */\n declare links: NavLink[];\n /** What the navigation is called for a screen reader, such as \"Main\". */\n declare label: string;\n /** The words on the button that opens the links on a narrow screen. */\n declare menuText: string;\n /**\n * The Menu button: `button` with its words, or `icon`, a round button with\n * only the icon, the words kept as its name for screen readers.\n */\n declare menuLook: 'button' | 'icon';\n /** `sm` sets the links a step smaller and closer, as a site header's are. */\n declare size: 'md' | 'sm';\n /** Where the links sit along the row. */\n declare align: 'start' | 'center' | 'end';\n /** Whether the menu is open on a narrow screen. Not a setting: it is the visitor's. */\n private menuOpen = false;\n private get open(): boolean { return this.menuOpen; }\n private set open(next: boolean) { this.menuOpen = next; this.requestUpdate(); }\n\n constructor() {\n super();\n this.links = [];\n this.label = 'Main';\n this.menuText = 'Menu';\n this.menuLook = 'button';\n this.size = 'md';\n this.align = 'end';\n }\n\n static styles = [...ImpktElement.styles, focusRing, css`\n /* It grows to fill a row it sits in, because it measures itself to decide when to fold. */\n :host { display: block; flex: 1 1 8rem; min-inline-size: 0; }\n nav { display: flex; flex-direction: column; position: relative; }\n li { flex: none; }\n ul { list-style: none; margin: 0; padding: 0; display: flex; gap: ${space(1)} ${space(6)}; align-items: center; justify-content: flex-end; }\n :host([align='start']) ul { justify-content: flex-start; }\n :host([align='center']) ul { justify-content: center; }\n a { ${targetSize} display: inline-flex; align-items: center; padding: ${space(2)} ${space(1)}; color: inherit; font-weight: ${fontWeight('semibold')}; text-decoration: none; border-radius: ${t.radiusSm}; }\n a:hover { text-decoration: underline; text-underline-offset: 0.25em; }\n a[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.35em; }\n .toggle { display: none; ${targetSize} align-items: center; gap: ${space(2)}; align-self: flex-end; padding: ${space(2)} ${space(3)}; font: inherit; font-weight: ${fontWeight('semibold')}; color: inherit; background: transparent; border: ${t.borderThin} solid currentColor; border-radius: ${t.radius}; cursor: pointer; }\n /* When they do not fit, the links fold behind a Menu button and open as a panel under it. */\n :host([folded]) { flex: 0 0 auto; }\n :host([folded]) .toggle { display: inline-flex; }\n :host([menu-look='icon']) .toggle { inline-size: 44px; block-size: 44px; padding: 0; justify-content: center; border: 0; border-radius: 50%; background: ${t.brand}; color: ${t.onBrand}; }\n :host([menu-look='icon']) .toggle .words { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n :host([size='sm']) ul { column-gap: ${space(6)}; }\n :host([size='sm']) a { padding-inline: 0; font-size: ${fontSize('sm')}; font-weight: ${fontWeight('medium')}; }\n :host([size='sm'][folded]) a { padding-inline: ${space(3)}; }\n :host([folded]) ul { display: none; position: absolute; inset-block-start: calc(100% + ${space(2)}); inset-inline-end: 0; z-index: 30; flex-direction: column; align-items: stretch; gap: 0; min-inline-size: 14rem; padding: ${space(2)}; background: ${t.surfaceCard}; color: ${t.text}; border: ${t.borderThin} solid ${t.border}; border-radius: ${t.radiusLg}; box-shadow: 0 8px 24px rgb(0 0 0 / 14%); }\n :host([folded]) ul.open { display: flex; }\n :host([folded]) li { text-align: start; }\n :host([folded]) a { display: flex; padding: ${space(3)} ${space(3)}; }\n `];\n\n /** The width the links need in one row. Measured once for each set of links, and again while folded it cannot be read. */\n private needs = 0;\n private resize?: ResizeObserver;\n\n private fit(): void {\n const room = this.getBoundingClientRect().width;\n if (room <= 0) return;\n if (!this.needs) {\n this.removeAttribute('folded');\n const items = Array.from(this.renderRoot.querySelectorAll('li'));\n const gap = Number.parseFloat(getComputedStyle(this.renderRoot.querySelector('ul')!).columnGap) || 0;\n this.needs = items.reduce((total, item) => total + item.getBoundingClientRect().width, 0) + gap * Math.max(0, items.length - 1);\n }\n const fold = this.needs > room;\n this.toggleAttribute('folded', fold);\n if (!fold && this.menuOpen) this.open = false;\n }\n\n protected updated(changed: Map<string, unknown>): void {\n if (changed.has('links')) { this.needs = 0; this.fit(); }\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n if (typeof ResizeObserver === 'function') {\n this.resize = new ResizeObserver(() => this.fit());\n this.resize.observe(this);\n }\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.resize?.disconnect();\n }\n\n private toggle(): void {\n this.open = !this.open;\n }\n\n private onKey(event: KeyboardEvent): void {\n if (event.key !== 'Escape' || !this.open) return;\n this.open = false;\n this.renderRoot.querySelector<HTMLButtonElement>('.toggle')?.focus();\n }\n\n render(): TemplateResult {\n const list = this.id_('links');\n return html`<nav aria-label=${this.label || nothing} part=\"nav\" @keydown=${this.onKey}>\n <button class=\"toggle\" type=\"button\" aria-expanded=${this.open ? 'true' : 'false'} aria-controls=${list} @click=${this.toggle}>${iconSvg(this.open ? 'close' : this.menuLook === 'icon' ? 'menu-two' : 'menu')}<span class=\"words\">${this.menuText}</span></button>\n <ul id=${list} class=${this.open ? 'open' : ''} part=\"list\">\n ${(this.links ?? []).map((link) => {\n const current = where(link.href);\n return html`<li><a href=${link.href} aria-current=${current === 'page' ? 'page' : current === 'section' ? 'true' : nothing} part=\"link\">${link.label}</a></li>`;\n })}\n </ul>\n </nav>`;\n }\n}\n\n/**\n * Where the page sits in the site, as a trail of links back to the top: Home,\n * then Developments, then this page.\n *\n * The last item is the page itself. It is not a link, and it carries\n * `aria-current=\"page\"`. The separators are drawn, not written, so a screen\n * reader reads the trail as a list rather than a string of slashes.\n *\n * @category action\n * @icon breadcrumbs\n */\nexport class ImpktBreadcrumbs extends ImpktElement {\n static properties = {\n items: { type: Array },\n label: { type: String },\n };\n /** The trail, from the top of the site down to this page. */\n declare items: NavLink[];\n /** What the trail is called for a screen reader. */\n declare label: string;\n\n constructor() {\n super();\n this.items = [];\n this.label = 'Breadcrumb';\n }\n\n static styles = [...ImpktElement.styles, focusRing, css`\n :host { display: block; font-size: ${fontSize('sm')}; }\n ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: ${space(1)}; }\n li { display: inline-flex; align-items: center; gap: ${space(1)}; }\n li + li::before { content: ''; inline-size: 0.45em; block-size: 0.45em; border-block-start: 1.5px solid ${t.textMuted}; border-inline-end: 1.5px solid ${t.textMuted}; transform: rotate(45deg); margin-inline: ${space(1)} ${space(2)}; }\n a { color: ${t.link}; text-decoration: underline; text-underline-offset: 0.2em; border-radius: ${t.radiusSm}; }\n a:hover { color: ${t.linkHover}; }\n [aria-current] { color: ${t.textMuted}; }\n .sr-only { ${visuallyHidden} }\n `];\n\n render(): TemplateResult {\n const items = this.items ?? [];\n return html`<nav aria-label=${this.label} part=\"nav\"><ol>\n ${items.map((item, i) => html`<li>${i === items.length - 1\n ? html`<span aria-current=\"page\">${item.label}</span>`\n : html`<a href=${item.href} part=\"link\">${item.label}</a>`}</li>`)}\n </ol></nav>`;\n }\n}\n\ncustomElements.define('impkt-nav', ImpktNav);\ncustomElements.define('impkt-breadcrumbs', ImpktBreadcrumbs);\ndeclare global { interface HTMLElementTagNameMap { 'impkt-nav': Impkt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 
10
10
  // packages/ui/src/components/page.ts
11
11
  import { css, html, nothing } from "lit";
@@ -20,6 +20,26 @@ var margins = css`
20
20
  @container impkt-page (min-width: 64rem) { .frame { --impkt-page-margin: ${token("layout.margin.desktop", "64px")}; } }
21
21
  `;
22
22
  var ImpktPage = class extends ImpktElement {
23
+ constructor() {
24
+ super();
25
+ /**
26
+ * The header floats when the page opens on a full-picture hero, sitting on the
27
+ * picture itself, so nothing has to be set for it. It stays an ordinary bar
28
+ * while editing, where the blocks are kept inside the page's box.
29
+ */
30
+ this.place = () => {
31
+ const hero = this.querySelector('impkt-hero[treatment="cover"]');
32
+ const editing = getComputedStyle(this).getPropertyValue("--impkt-bleed").trim() === "0";
33
+ const floats = !!hero && !editing && this.opensOn(hero);
34
+ this.toggleAttribute("floating", floats);
35
+ if (!floats) return;
36
+ const frame = this.renderRoot.querySelector(".frame");
37
+ if (frame) this.style.setProperty("--impkt-header-top", `${Math.round(hero.getBoundingClientRect().top - frame.getBoundingClientRect().top)}px`);
38
+ };
39
+ this.width = "standard";
40
+ this.stickyHeader = false;
41
+ this.skipText = "Skip to content";
42
+ }
23
43
  static {
24
44
  this.properties = {
25
45
  width: { type: String, reflect: true },
@@ -27,16 +47,10 @@ var ImpktPage = class extends ImpktElement {
27
47
  skipText: { type: String, attribute: "skip-text" }
28
48
  };
29
49
  }
30
- constructor() {
31
- super();
32
- this.width = "standard";
33
- this.stickyHeader = false;
34
- this.skipText = "Skip to content";
35
- }
36
50
  static {
37
51
  this.styles = [...ImpktElement.styles, focusRing, widths, margins, css`
38
52
  :host { display: block; container: impkt-page / inline-size; }
39
- .frame { display: flex; flex-direction: column; min-block-size: 100%; overflow-x: clip; }
53
+ .frame { position: relative; display: flex; flex-direction: column; min-block-size: 100%; overflow-x: clip; }
40
54
  .inner { box-sizing: border-box; inline-size: 100%; max-inline-size: calc(var(--impkt-page-inner) + 2 * var(--impkt-page-margin)); margin-inline: auto; padding-inline: var(--impkt-page-margin); }
41
55
  header { background: ${token("color.surface.header", "transparent")}; color: ${token("color.text.on-header", "inherit")}; padding-block: ${space(4)}; }
42
56
  /* What sits in the header and footer takes their text colour, so words on a dark footer stay readable. */
@@ -45,8 +59,13 @@ var ImpktPage = class extends ImpktElement {
45
59
  :host([sticky-header]) header { position: sticky; inset-block-start: 0; z-index: 10; }
46
60
  main { flex: 1; padding-block: ${space(6)} ${space(10)}; }
47
61
  main:focus { outline: none; }
62
+ /* A page that opens on a full-picture hero: the header floats over it as a rounded bar. */
63
+ :host([floating]) header { position: absolute; z-index: 20; inset-inline: 0; inset-block-start: var(--impkt-header-top, 0px); padding-block: ${space(6)} 0; background: transparent; border: 0; }
64
+ :host([floating]) header .inner { inline-size: calc(100% - 2 * var(--impkt-page-margin)); max-inline-size: var(--impkt-page-inner); padding: ${space(3)} ${space(4)} ${space(3)} ${space(6)}; background: ${token("color.surface.header", "#fff")}; border-radius: ${t.radius2xl}; box-shadow: ${t.shadowLg}; }
65
+ :host([floating]) main { padding-block-start: 0; }
48
66
  footer { background: ${token("color.surface.footer", "transparent")}; color: ${token("color.text.on-footer", "inherit")}; padding-block: ${space(8)}; border-block-start: ${t.borderThin} solid ${token("color.border.subtle", "transparent")}; }
49
67
  .skip { position: absolute; inset-inline-start: ${space(2)}; inset-block-start: ${space(2)}; z-index: 20; padding: ${space(2)} ${space(4)}; background: ${t.surfaceCard}; color: ${t.link}; border-radius: ${t.radius}; transform: translateY(-200%); }
68
+ .skip:not(:focus) { clip-path: inset(50%); }
50
69
  .skip:focus { transform: none; }
51
70
  .empty { display: none; }
52
71
  `];
@@ -70,15 +89,35 @@ var ImpktPage = class extends ImpktElement {
70
89
  ${footer ? html`<footer part="footer"><div class="inner"><slot name="footer"></slot></div></footer>` : nothing}
71
90
  </div>`;
72
91
  }
92
+ /** Whether nothing a reader would notice comes before this block, other than an announcement. */
93
+ opensOn(hero) {
94
+ for (const element of Array.from(this.querySelectorAll("*"))) {
95
+ if (element === hero) return true;
96
+ if (element.closest('[slot="header"],[slot="footer"]')) continue;
97
+ if (element.tagName.startsWith("IMPKT-") && !/^IMPKT-(STACK|SECTION|GRID|ANNOUNCEMENT)$/.test(element.tagName)) return false;
98
+ }
99
+ return false;
100
+ }
73
101
  // A header or footer added after the first render still gets its landmark.
74
102
  connectedCallback() {
75
103
  super.connectedCallback();
76
104
  this.observer = new MutationObserver(() => this.requestUpdate());
77
105
  this.observer.observe(this, { childList: true, attributes: true, subtree: false, attributeFilter: ["slot"] });
106
+ this.watcher = new MutationObserver(this.place);
107
+ this.watcher.observe(this, { childList: true, subtree: true, attributes: true, attributeFilter: ["treatment"] });
108
+ if (typeof ResizeObserver === "function") {
109
+ this.resize = new ResizeObserver(this.place);
110
+ this.resize.observe(this);
111
+ }
78
112
  }
79
113
  disconnectedCallback() {
80
114
  super.disconnectedCallback();
81
115
  this.observer?.disconnect();
116
+ this.watcher?.disconnect();
117
+ this.resize?.disconnect();
118
+ }
119
+ firstUpdated() {
120
+ this.place();
82
121
  }
83
122
  };
84
123
  var ImpktSection = class extends ImpktElement {
@@ -106,17 +145,21 @@ var ImpktSection = class extends ImpktElement {
106
145
  static {
107
146
  this.styles = [...ImpktElement.styles, spaceAround, widths, css`
108
147
  :host { display: block; --impkt-page-margin: inherit; }
148
+ /* What a solid card on a brand band goes back to, since the band repaints these for its own text. */
149
+ :host([tone='brand']) { --impkt-solid-card: ${t.surfaceCard}; --impkt-solid-text: ${t.text}; --impkt-solid-heading: var(--impkt-color-text-heading, ${t.text}); --impkt-solid-muted: ${t.textMuted}; }
109
150
  .band { box-sizing: border-box; border-radius: ${t.radiusLg}; }
110
- :host([bleed]) .band { border-radius: 0; margin-inline: calc(50% - 50vw); padding-inline: calc(50vw - 50%); }
151
+ /* --impkt-bleed is 0 while editing, so a full-width block stays inside the box it is being edited in. */
152
+ :host([bleed]) .band { border-radius: 0; margin-inline: calc(var(--impkt-bleed, 1) * (50% - 50vw)); padding-inline: max(${space(4)}, calc(var(--impkt-bleed, 1) * (50vw - 50%))); }
111
153
  :host([tone='subtle']) .band { background: ${t.surfaceSubtle}; }
112
154
  :host([tone='inset']) .band { background: ${t.surfaceInset}; }
113
155
  :host([tone='card']) .band { background: ${t.surfaceCard}; }
114
- :host([tone='brand']) .band { background: ${t.brand}; color: ${t.onBrand}; --impkt-color-text-heading: ${t.onBrand}; --impkt-color-text-default: ${t.onBrand}; --impkt-color-text-muted: ${t.onBrand}; --impkt-color-text-link: ${t.onBrand}; --impkt-color-text-link-hover: ${t.onBrand}; }
156
+ :host([tone='brand']) .band { background: ${t.brand}; color: ${t.onBrand}; --impkt-eyebrow: ${t.onBrand}; --impkt-color-surface-card: color-mix(in srgb, ${t.onBrand} 10%, transparent); --impkt-color-text-heading: ${t.onBrand}; --impkt-color-text-default: ${t.onBrand}; --impkt-color-text-muted: ${t.onBrand}; --impkt-color-text-link: ${t.onBrand}; --impkt-color-text-link-hover: ${t.onBrand}; }
115
157
  :host(:not([bleed]):not([tone='none'])) .band { padding-inline: ${space(6)}; }
116
158
  :host([padding='sm']) .band { padding-block: ${space(4)}; }
117
159
  :host([padding='md']) .band { padding-block: ${space(8)}; }
118
160
  :host([padding='lg']) .band { padding-block: ${space(12)}; }
119
161
  :host([padding='xl']) .band { padding-block: ${space(16)}; }
162
+ :host([padding='2xl']) .band { padding-block: clamp(${space(14)}, 8vw, ${space(28)}); }
120
163
  .content { max-inline-size: var(--impkt-page-inner); margin-inline: auto; }
121
164
  `];
122
165
  }
@@ -131,4 +174,4 @@ export {
131
174
  ImpktPage,
132
175
  ImpktSection
133
176
  };
134
- //# sourceMappingURL=chunk-QH46SOPJ.js.map
177
+ //# sourceMappingURL=chunk-R67PDFKE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/page.ts"],"sourcesContent":["import { css, html, nothing, type TemplateResult } from 'lit';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { focusRing } from '../base/styles';\nimport { space, spaceAround, t, token } from '../base/tokens';\n\n/** The widest a line of content runs, for each choice of `width`. */\nconst widths = css`\n :host { --impkt-page-inner: ${token('layout.page-width', '1200px')}; }\n :host([width='narrow']) { --impkt-page-inner: 760px; }\n :host([width='wide']) { --impkt-page-inner: 1440px; }\n`;\n\n/**\n * The side margins, from the brand's layout: narrow on a phone, wider on a\n * tablet and a desktop. Measured against the page itself, so a page drawn in a\n * narrow preview gets phone margins whatever the window is.\n */\nconst margins = css`\n :host { --impkt-page-margin: ${token('layout.margin.phone', '16px')}; }\n @container impkt-page (min-width: 40rem) { .frame { --impkt-page-margin: ${token('layout.margin.tablet', '32px')}; } }\n @container impkt-page (min-width: 64rem) { .frame { --impkt-page-margin: ${token('layout.margin.desktop', '64px')}; } }\n`;\n\n/**\n * The frame every page sits in: a header, the page's own content, and a\n * footer, each kept to the brand's page width with the brand's side margins.\n *\n * A layout puts this at its root, with the site's header and footer in their\n * slots and the page content in the middle, so an app draws the same frame the\n * CMS shows. Without it, a page runs edge to edge.\n *\n * **It gives the page its landmarks.** The header, main content and footer are\n * `header`, `main` and `footer` elements, so a screen reader can jump between\n * them (1.3.1), and the first thing in the page is a \"Skip to content\" link\n * that appears when it has focus (2.4.1).\n *\n * @category layout\n * @icon layout\n * @slot header - The site's header: its logo, navigation and a call to action.\n * @slot - The page's own content.\n * @slot footer - The site's footer.\n */\nexport class ImpktPage extends ImpktElement {\n static properties = {\n width: { type: String, reflect: true },\n stickyHeader: { type: Boolean, reflect: true, attribute: 'sticky-header' },\n skipText: { type: String, attribute: 'skip-text' },\n };\n /** How wide the content runs. Standard is the brand's page width. */\n declare width: 'narrow' | 'standard' | 'wide';\n /** Keep the header at the top of the screen while the page scrolls. */\n declare stickyHeader: boolean;\n /** The words of the link that skips past the header to the content. */\n declare skipText: string;\n\n constructor() {\n super();\n this.width = 'standard';\n this.stickyHeader = false;\n this.skipText = 'Skip to content';\n }\n\n static styles = [...ImpktElement.styles, focusRing, widths, margins, css`\n :host { display: block; container: impkt-page / inline-size; }\n .frame { position: relative; display: flex; flex-direction: column; min-block-size: 100%; overflow-x: clip; }\n .inner { box-sizing: border-box; inline-size: 100%; max-inline-size: calc(var(--impkt-page-inner) + 2 * var(--impkt-page-margin)); margin-inline: auto; padding-inline: var(--impkt-page-margin); }\n header { background: ${token('color.surface.header', 'transparent')}; color: ${token('color.text.on-header', 'inherit')}; padding-block: ${space(4)}; }\n /* What sits in the header and footer takes their text colour, so words on a dark footer stay readable. */\n header { --impkt-color-text-default: ${token('color.text.on-header', 'inherit')}; --impkt-color-text-heading: ${token('color.text.on-header', 'inherit')}; }\n footer { --impkt-color-text-default: ${token('color.text.on-footer', 'inherit')}; --impkt-color-text-heading: ${token('color.text.on-footer', 'inherit')}; --impkt-color-text-muted: ${token('color.text.on-footer', 'inherit')}; --impkt-color-text-link: ${token('color.text.on-footer', 'inherit')}; --impkt-color-text-link-hover: ${token('color.text.on-footer', 'inherit')}; }\n :host([sticky-header]) header { position: sticky; inset-block-start: 0; z-index: 10; }\n main { flex: 1; padding-block: ${space(6)} ${space(10)}; }\n main:focus { outline: none; }\n /* A page that opens on a full-picture hero: the header floats over it as a rounded bar. */\n :host([floating]) header { position: absolute; z-index: 20; inset-inline: 0; inset-block-start: var(--impkt-header-top, 0px); padding-block: ${space(6)} 0; background: transparent; border: 0; }\n :host([floating]) header .inner { inline-size: calc(100% - 2 * var(--impkt-page-margin)); max-inline-size: var(--impkt-page-inner); padding: ${space(3)} ${space(4)} ${space(3)} ${space(6)}; background: ${token('color.surface.header', '#fff')}; border-radius: ${t.radius2xl}; box-shadow: ${t.shadowLg}; }\n :host([floating]) main { padding-block-start: 0; }\n footer { background: ${token('color.surface.footer', 'transparent')}; color: ${token('color.text.on-footer', 'inherit')}; padding-block: ${space(8)}; border-block-start: ${t.borderThin} solid ${token('color.border.subtle', 'transparent')}; }\n .skip { position: absolute; inset-inline-start: ${space(2)}; inset-block-start: ${space(2)}; z-index: 20; padding: ${space(2)} ${space(4)}; background: ${t.surfaceCard}; color: ${t.link}; border-radius: ${t.radius}; transform: translateY(-200%); }\n .skip:not(:focus) { clip-path: inset(50%); }\n .skip:focus { transform: none; }\n .empty { display: none; }\n `];\n\n private hasSlot(name: string): boolean {\n return Array.from(this.children).some((c) => c.getAttribute('slot') === name);\n }\n\n private skip(event: Event): void {\n event.preventDefault();\n const main = this.renderRoot.querySelector('main');\n main?.focus();\n main?.scrollIntoView();\n }\n\n render(): TemplateResult {\n // The header and footer are left out when nothing is in them, so a page\n // with no site header has no empty landmark for a screen reader to land on.\n const header = this.hasSlot('header');\n const footer = this.hasSlot('footer');\n return html`<div class=\"frame\" part=\"frame\">\n <a class=\"skip\" href=\"#content\" part=\"skip\" @click=${this.skip}>${this.skipText}</a>\n ${header ? html`<header part=\"header\"><div class=\"inner\"><slot name=\"header\"></slot></div></header>` : nothing}\n <main id=\"content\" tabindex=\"-1\" part=\"main\"><div class=\"inner\"><slot></slot></div></main>\n ${footer ? html`<footer part=\"footer\"><div class=\"inner\"><slot name=\"footer\"></slot></div></footer>` : nothing}\n </div>`;\n }\n\n /**\n * The header floats when the page opens on a full-picture hero, sitting on the\n * picture itself, so nothing has to be set for it. It stays an ordinary bar\n * while editing, where the blocks are kept inside the page's box.\n */\n private place = (): void => {\n const hero = this.querySelector('impkt-hero[treatment=\"cover\"]');\n const editing = getComputedStyle(this).getPropertyValue('--impkt-bleed').trim() === '0';\n const floats = !!hero && !editing && this.opensOn(hero);\n this.toggleAttribute('floating', floats);\n if (!floats) return;\n const frame = this.renderRoot.querySelector('.frame');\n if (frame) this.style.setProperty('--impkt-header-top', `${Math.round(hero!.getBoundingClientRect().top - frame.getBoundingClientRect().top)}px`);\n };\n\n /** Whether nothing a reader would notice comes before this block, other than an announcement. */\n private opensOn(hero: Element): boolean {\n for (const element of Array.from(this.querySelectorAll('*'))) {\n if (element === hero) return true;\n if (element.closest('[slot=\"header\"],[slot=\"footer\"]')) continue;\n if (element.tagName.startsWith('IMPKT-') && !/^IMPKT-(STACK|SECTION|GRID|ANNOUNCEMENT)$/.test(element.tagName)) return false;\n }\n return false;\n }\n\n // A header or footer added after the first render still gets its landmark.\n connectedCallback(): void {\n super.connectedCallback();\n this.observer = new MutationObserver(() => this.requestUpdate());\n this.observer.observe(this, { childList: true, attributes: true, subtree: false, attributeFilter: ['slot'] });\n this.watcher = new MutationObserver(this.place);\n this.watcher.observe(this, { childList: true, subtree: true, attributes: true, attributeFilter: ['treatment'] });\n if (typeof ResizeObserver === 'function') {\n this.resize = new ResizeObserver(this.place);\n this.resize.observe(this);\n }\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.observer?.disconnect();\n this.watcher?.disconnect();\n this.resize?.disconnect();\n }\n\n protected firstUpdated(): void {\n this.place();\n }\n\n private observer?: MutationObserver;\n private watcher?: MutationObserver;\n private resize?: ResizeObserver;\n}\n\n/**\n * A band across the whole width of the page, with its own background, and its\n * content kept to the page width inside it: a coloured strip of features, a\n * quote on a tinted background, a call to action at the foot of a page.\n *\n * Inside a Page it reaches the edges of the screen whatever the page width is,\n * so a page can alternate bands without any of them knowing the frame. Set\n * `bleed` off to keep the band to the page width, as a panel.\n *\n * @category layout\n * @icon section\n * @slot - The section's content.\n */\nexport class ImpktSection extends ImpktElement {\n static properties = {\n tone: { type: String, reflect: true },\n padding: { type: String, reflect: true },\n width: { type: String, reflect: true },\n bleed: { type: Boolean, reflect: true },\n label: { type: String },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n /** The band's background. Text on it takes the matching colour, so it stays readable. */\n declare tone: 'none' | 'subtle' | 'inset' | 'brand' | 'card';\n /** Space inside the band, above and below its content. */\n declare padding: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n /** How wide the content inside runs. */\n declare width: 'narrow' | 'standard' | 'wide';\n /** Run the background to the edges of the screen. */\n declare bleed: boolean;\n /** A name for the section, so a screen reader can find it in the page's regions. Leave empty for none. */\n declare label: string;\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n constructor() {\n super();\n this.tone = 'none';\n this.padding = 'lg';\n this.width = 'standard';\n this.bleed = true;\n this.label = '';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpktElement.styles, spaceAround, widths, css`\n :host { display: block; --impkt-page-margin: inherit; }\n /* What a solid card on a brand band goes back to, since the band repaints these for its own text. */\n :host([tone='brand']) { --impkt-solid-card: ${t.surfaceCard}; --impkt-solid-text: ${t.text}; --impkt-solid-heading: var(--impkt-color-text-heading, ${t.text}); --impkt-solid-muted: ${t.textMuted}; }\n .band { box-sizing: border-box; border-radius: ${t.radiusLg}; }\n /* --impkt-bleed is 0 while editing, so a full-width block stays inside the box it is being edited in. */\n :host([bleed]) .band { border-radius: 0; margin-inline: calc(var(--impkt-bleed, 1) * (50% - 50vw)); padding-inline: max(${space(4)}, calc(var(--impkt-bleed, 1) * (50vw - 50%))); }\n :host([tone='subtle']) .band { background: ${t.surfaceSubtle}; }\n :host([tone='inset']) .band { background: ${t.surfaceInset}; }\n :host([tone='card']) .band { background: ${t.surfaceCard}; }\n :host([tone='brand']) .band { background: ${t.brand}; color: ${t.onBrand}; --impkt-eyebrow: ${t.onBrand}; --impkt-color-surface-card: color-mix(in srgb, ${t.onBrand} 10%, transparent); --impkt-color-text-heading: ${t.onBrand}; --impkt-color-text-default: ${t.onBrand}; --impkt-color-text-muted: ${t.onBrand}; --impkt-color-text-link: ${t.onBrand}; --impkt-color-text-link-hover: ${t.onBrand}; }\n :host(:not([bleed]):not([tone='none'])) .band { padding-inline: ${space(6)}; }\n :host([padding='sm']) .band { padding-block: ${space(4)}; }\n :host([padding='md']) .band { padding-block: ${space(8)}; }\n :host([padding='lg']) .band { padding-block: ${space(12)}; }\n :host([padding='xl']) .band { padding-block: ${space(16)}; }\n :host([padding='2xl']) .band { padding-block: clamp(${space(14)}, 8vw, ${space(28)}); }\n .content { max-inline-size: var(--impkt-page-inner); margin-inline: auto; }\n `];\n\n render(): TemplateResult {\n return html`<section class=\"band\" part=\"band\" aria-label=${this.label || nothing} role=${this.label ? nothing : 'presentation'}><div class=\"content\" part=\"content\"><slot></slot></div></section>`;\n }\n}\n\ncustomElements.define('impkt-page', ImpktPage);\ncustomElements.define('impkt-section', ImpktSection);\ndeclare global { interface HTMLElementTagNameMap { 'impkt-page': ImpktPage; 'impkt-section': ImpktSection } }\n"],"mappings":";;;;;;;;;;AAAA,SAAS,KAAK,MAAM,eAAoC;AAMxD,IAAM,SAAS;AAAA,gCACiB,MAAM,qBAAqB,QAAQ,CAAC;AAAA;AAAA;AAAA;AAUpE,IAAM,UAAU;AAAA,iCACiB,MAAM,uBAAuB,MAAM,CAAC;AAAA,6EACQ,MAAM,wBAAwB,MAAM,CAAC;AAAA,6EACrC,MAAM,yBAAyB,MAAM,CAAC;AAAA;AAsB5G,IAAM,YAAN,cAAwB,aAAa;AAAA,EAa1C,cAAc;AACZ,UAAM;AAyDR;AAAA;AAAA;AAAA;AAAA;AAAA,SAAQ,QAAQ,MAAY;AAC1B,YAAM,OAAO,KAAK,cAAc,+BAA+B;AAC/D,YAAM,UAAU,iBAAiB,IAAI,EAAE,iBAAiB,eAAe,EAAE,KAAK,MAAM;AACpF,YAAM,SAAS,CAAC,CAAC,QAAQ,CAAC,WAAW,KAAK,QAAQ,IAAI;AACtD,WAAK,gBAAgB,YAAY,MAAM;AACvC,UAAI,CAAC,OAAQ;AACb,YAAM,QAAQ,KAAK,WAAW,cAAc,QAAQ;AACpD,UAAI,MAAO,MAAK,MAAM,YAAY,sBAAsB,GAAG,KAAK,MAAM,KAAM,sBAAsB,EAAE,MAAM,MAAM,sBAAsB,EAAE,GAAG,CAAC,IAAI;AAAA,IAClJ;AAhEE,SAAK,QAAQ;AACb,SAAK,eAAe;AACpB,SAAK,WAAW;AAAA,EAClB;AAAA,EAjBA;AAAA,SAAO,aAAa;AAAA,MAClB,OAAO,EAAE,MAAM,QAAQ,SAAS,KAA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AAO,oDAAoD,EAAE,OAAO,mDAAmD,EAAE,OAAO,iCAAiC,EAAE,OAAO,+BAA+B,EAAE,OAAO,8BAA8B,EAAE,OAAO,oCAAoC,EAAE,OAAO;AAAA,sEACpU,MAAM,CAAC,CAAC;AAAA,mDAC3B,MAAM,CAAC,CAAC;AAAA,mDACR,MAAM,CAAC,CAAC;AAAA,mDACR,MAAM,EAAE,CAAC;AAAA,mDACT,MAAM,EAAE,CAAC;AAAA,0DACF,MAAM,EAAE,CAAC,UAAU,MAAM,EAAE,CAAC;AAAA;AAAA,GAEnF;AAAA;AAAA,EAED,SAAyB;AACvB,WAAO,oDAAoD,KAAK,SAAS,OAAO,SAAS,KAAK,QAAQ,UAAU,cAAc;AAAA,EAChI;AACF;AAEA,eAAe,OAAO,cAAc,SAAS;AAC7C,eAAe,OAAO,iBAAiB,YAAY;","names":[]}
@@ -0,0 +1,236 @@
1
+ import {
2
+ ImpktElement,
3
+ fontSize,
4
+ fontWeight,
5
+ say,
6
+ space,
7
+ t,
8
+ token,
9
+ visuallyHidden
10
+ } from "./chunk-D6C7XEY4.js";
11
+
12
+ // packages/ui/src/components/scrubber.ts
13
+ import { html, css } from "lit";
14
+ var TONES = {
15
+ brand: "var(--impkt-color-brand-default, #1f4ed8)",
16
+ accent: "var(--impkt-color-accent-default, #c8a15a)",
17
+ info: "var(--impkt-color-status-info-default, #1f4ed8)",
18
+ success: "var(--impkt-color-status-success-default, #047857)",
19
+ warning: "var(--impkt-color-status-warning-default, #b45309)",
20
+ danger: "var(--impkt-color-status-danger-default, #c8102e)"
21
+ };
22
+ var ImpktScrubber = class extends ImpktElement {
23
+ constructor() {
24
+ super();
25
+ this.scene = null;
26
+ this.onProgress = (e) => {
27
+ this.value = e.detail.progress;
28
+ };
29
+ this.onInput = (e) => {
30
+ const v = Number(e.target.value) / 1e3;
31
+ this.value = v;
32
+ this.scene?.seek(v);
33
+ };
34
+ this.label = "Scene progress";
35
+ this.stops = [];
36
+ this.look = "buttons";
37
+ this.hint = "";
38
+ this.value = 0;
39
+ }
40
+ static {
41
+ this.properties = {
42
+ label: { type: String },
43
+ stops: { type: Array },
44
+ look: { type: String, reflect: true },
45
+ hint: { type: String },
46
+ value: { type: Number, state: true }
47
+ };
48
+ }
49
+ static {
50
+ this.styles = [
51
+ ...ImpktElement.styles,
52
+ css`
53
+ :host {
54
+ display: block;
55
+ width: 100%;
56
+ max-width: 48rem;
57
+ margin-inline: auto;
58
+ }
59
+ .wrap {
60
+ display: grid;
61
+ gap: ${space(2)};
62
+ padding: ${space(3)} ${space(4)};
63
+ border-radius: ${token("radius.xl", "16px")};
64
+ background: ${t.surfaceCard};
65
+ box-shadow: ${token("shadow.lg", "0 10px 15px -3px rgba(0,0,0,.1)")};
66
+ border: 1px solid ${t.border};
67
+ }
68
+ input {
69
+ width: 100%;
70
+ min-height: ${token("target.min", "24px")};
71
+ accent-color: ${t.brand};
72
+ margin: 0;
73
+ }
74
+ .stops {
75
+ position: relative;
76
+ display: flex;
77
+ flex-wrap: wrap;
78
+ gap: ${space(2)};
79
+ list-style: none;
80
+ margin: 0;
81
+ padding: 0;
82
+ }
83
+ button {
84
+ min-height: ${token("target.min", "24px")};
85
+ padding: ${space(1)} ${space(3)};
86
+ border-radius: ${token("radius.full", "9999px")};
87
+ border: 1px solid ${t.border};
88
+ background: transparent;
89
+ color: ${t.textMuted};
90
+ font-size: ${fontSize("xs")};
91
+ font-weight: ${fontWeight("medium")};
92
+ cursor: pointer;
93
+ }
94
+ button[aria-current='true'] {
95
+ color: ${t.text};
96
+ border-color: ${t.text};
97
+ }
98
+ .sr-only {
99
+ ${visuallyHidden}
100
+ }
101
+ /* The graph look: the code of where you are, the line of stops, where you are. */
102
+ :host([look='graph']) { max-width: none; }
103
+ .graph { display: grid; grid-template-columns: minmax(8rem, auto) minmax(0, 1fr) auto; gap: ${space(6)}; align-items: center; padding: ${space(4)} ${space(6)}; border-radius: ${token("radius.xl", "16px")}; background: ${t.surfaceCard}; box-shadow: ${token("shadow.lg", "0 10px 15px -3px rgba(0,0,0,.1)")}; border: 1px solid ${t.border}; }
104
+ .mono { font-family: ${t.fontMono}; font-size: ${fontSize("xs")}; letter-spacing: 0.04em; }
105
+ .head { display: grid; gap: 2px; }
106
+ .head .k { color: ${t.textMuted}; text-transform: uppercase; }
107
+ .head .code { font-size: ${fontSize("md")}; color: ${t.text}; }
108
+ .head .note { color: ${t.textMuted}; }
109
+ .line { position: relative; block-size: 48px; }
110
+ .track, .fill { position: absolute; inset-inline: 0; inset-block-start: 14px; block-size: 3px; border-radius: 3px; background: ${t.border}; opacity: 0.5; }
111
+ .fill { opacity: 1; background: none; display: flex; overflow: hidden; }
112
+ .fill span { block-size: 100%; }
113
+ .dot { position: absolute; inset-block-start: 15px; inline-size: 14px; block-size: 14px; translate: -50% -50%; border-radius: 50%; border: 2px solid var(--c); background: ${t.surfaceCard}; padding: 0; min-height: 0; cursor: pointer; }
114
+ .dot[data-passed] { background: var(--c); }
115
+ .dot[aria-current='true'] { inline-size: 24px; block-size: 24px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); }
116
+ .dot-label { position: absolute; inset-block-start: 30px; translate: -50% 0; white-space: nowrap; color: ${t.textMuted}; text-transform: uppercase; pointer-events: none; }
117
+ .dot-label[data-current] { color: ${t.text}; font-weight: ${fontWeight("bold")}; }
118
+ .line input { position: absolute; inset: 0 0 auto; block-size: 30px; opacity: 0; cursor: grab; }
119
+ .line input:focus-visible { opacity: 1; }
120
+ .where { display: grid; gap: ${space(2)}; justify-items: end; }
121
+ .chip { display: inline-flex; align-items: center; gap: ${space(2)}; padding: ${space(1)} ${space(3)}; border-radius: ${token("radius.full", "9999px")}; border: 1px solid ${t.border}; color: ${t.text}; text-transform: uppercase; }
122
+ .chip::before { content: ''; inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--c); }
123
+ .hint { color: ${t.textMuted}; text-transform: uppercase; }
124
+ @media (max-width: 48rem) {
125
+ .graph { grid-template-columns: minmax(0, 1fr); }
126
+ .where { justify-items: start; }
127
+ .dot-label:not([data-current]) { display: none; }
128
+ }
129
+ button:focus-visible,
130
+ input:focus-visible {
131
+ outline: none;
132
+ box-shadow: ${token("focus.ring.shadow", "0 0 0 2px #fff, 0 0 0 4px #1a1a1a")};
133
+ }
134
+ `
135
+ ];
136
+ }
137
+ /** @ignore */
138
+ connectedCallback() {
139
+ super.connectedCallback();
140
+ this.scene = this.closest("impkt-scene");
141
+ this.scene?.addEventListener("impkt-scene-progress", this.onProgress);
142
+ if (this.scene) this.value = this.scene.progress;
143
+ }
144
+ /** @ignore */
145
+ disconnectedCallback() {
146
+ super.disconnectedCallback();
147
+ this.scene?.removeEventListener("impkt-scene-progress", this.onProgress);
148
+ this.scene = null;
149
+ }
150
+ goTo(stop) {
151
+ this.scene?.seek(stop.at, 600);
152
+ }
153
+ /** The stop nearest the current position, which the stop list marks as current. */
154
+ nearest() {
155
+ let best = -1;
156
+ let gap = Infinity;
157
+ this.stops.forEach((s, i) => {
158
+ const d = Math.abs(s.at - this.value);
159
+ if (d < gap) {
160
+ gap = d;
161
+ best = i;
162
+ }
163
+ });
164
+ return best;
165
+ }
166
+ renderGraph(nearestIndex, valueText) {
167
+ let current = nearestIndex;
168
+ const stops = [...this.stops ?? []].sort((a, b) => a.at - b.at);
169
+ current = stops.indexOf(this.stops[current]);
170
+ const colour = (s) => {
171
+ const tone = s?.tone ?? "brand";
172
+ return typeof tone === "number" ? `var(--impkt-color-chart-${tone}, ${TONES.brand})` : TONES[tone] ?? TONES.brand;
173
+ };
174
+ const now = stops[current] ?? stops[0];
175
+ const segments = stops.map((s, i) => {
176
+ const from = i === 0 ? 0 : stops[i - 1].at;
177
+ const to = Math.min(s.at, this.value);
178
+ return { width: Math.round(Math.max(0, to - from) * 1e4) / 100, c: colour(s) };
179
+ });
180
+ return html`<div class="graph" part="wrap">
181
+ <div class="head mono" aria-hidden="true">
182
+ <span class="k">HEAD</span>
183
+ <span class="code">${now?.meta ?? now?.label ?? ""}</span>
184
+ ${now?.note ? html`<span class="note">${now.note}</span>` : null}
185
+ </div>
186
+ <div class="line">
187
+ <div class="track"></div>
188
+ <div class="fill" aria-hidden="true">${segments.map((g) => html`<span style=${`width:${g.width}%;background:${g.c}`}></span>`)}</div>
189
+ ${stops.map((s, i) => html`
190
+ <button type="button" class="dot" style=${`left:${s.at * 100}%;--c:${colour(s)}`} ?data-passed=${s.at <= this.value + 1e-4} aria-current=${i === current ? "true" : "false"} @click=${() => this.goTo(s)}>
191
+ <span class="sr-only">${say("Go to {name}", { name: s.label })}</span>
192
+ </button>
193
+ <span class="dot-label mono" style=${`left:${s.at * 100}%`} ?data-current=${i === current} aria-hidden="true">${s.label}</span>`)}
194
+ <input type="range" min="0" max="1000" step="1" .value=${String(Math.round(this.value * 1e3))} aria-label=${this.label} aria-valuetext=${valueText} @input=${this.onInput} />
195
+ </div>
196
+ <div class="where" aria-hidden="true">
197
+ ${now ? html`<span class="chip mono" style=${`--c:${colour(now)}`}>${now.label}${now.meta ? html`&nbsp;<span style="opacity:.6">${now.meta}</span>` : null}</span>` : null}
198
+ ${this.hint ? html`<span class="hint mono">${this.hint}</span>` : null}
199
+ </div>
200
+ </div>`;
201
+ }
202
+ render() {
203
+ const current = this.nearest();
204
+ const valueText = current >= 0 ? this.stops[current].label : `${Math.round(this.value * 100)}%`;
205
+ if (this.look === "graph") return this.renderGraph(current, valueText);
206
+ return html`
207
+ <div class="wrap" part="wrap">
208
+ <input
209
+ type="range"
210
+ min="0"
211
+ max="1000"
212
+ step="1"
213
+ .value=${String(Math.round(this.value * 1e3))}
214
+ aria-label=${this.label}
215
+ aria-valuetext=${valueText}
216
+ @input=${this.onInput}
217
+ />
218
+ ${this.stops.length ? html`<ul class="stops" part="stops">
219
+ ${this.stops.map(
220
+ (s, i) => html`<li>
221
+ <button type="button" aria-current=${i === current ? "true" : "false"} @click=${() => this.goTo(s)}>
222
+ <span aria-hidden="true">${s.label}</span><span class="sr-only">${say("Go to {name}", { name: s.label })}</span>
223
+ </button>
224
+ </li>`
225
+ )}
226
+ </ul>` : null}
227
+ </div>
228
+ `;
229
+ }
230
+ };
231
+ customElements.define("impkt-scrubber", ImpktScrubber);
232
+
233
+ export {
234
+ ImpktScrubber
235
+ };
236
+ //# sourceMappingURL=chunk-RZSZQMSE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/scrubber.ts"],"sourcesContent":["import { html, css, type TemplateResult } from 'lit';\nimport { say } from '../base/say';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { visuallyHidden } from '../base/styles';\nimport { fontSize, fontWeight, space, t, token } from '../base/tokens';\nimport type { ImpktScene } from './scene';\n\nexport interface ScrubberStop {\n /** Where the stop sits on the scene's progress, from 0 to 1. */\n at: number;\n label: string;\n /** A short code beside it in the graph look, such as a commit hash. */\n meta?: string;\n /** A line under the code in the graph look, such as a commit message. */\n note?: string;\n /**\n * The colour of the line up to this stop, in the graph look: a named tone,\n * or 1 to 5 for the brand's chart colours, as a project's phases are drawn.\n */\n tone?: 'brand' | 'accent' | 'info' | 'success' | 'warning' | 'danger' | 1 | 2 | 3 | 4 | 5;\n}\n\nconst TONES = {\n brand: 'var(--impkt-color-brand-default, #1f4ed8)',\n accent: 'var(--impkt-color-accent-default, #c8a15a)',\n info: 'var(--impkt-color-status-info-default, #1f4ed8)',\n success: 'var(--impkt-color-status-success-default, #047857)',\n warning: 'var(--impkt-color-status-warning-default, #b45309)',\n danger: 'var(--impkt-color-status-danger-default, #c8102e)',\n} as const;\n\n/**\n * Drives the scene it sits in, by hand.\n *\n * Place it in an `impkt-scene`'s `controls` slot and set that scene's `drive`\n * to `scrubber`. Dragging moves through the scene; a named stop seeks to it\n * with an eased move rather than a cut, which is what makes the Commit-style\n * \"time travel\" read as travel.\n *\n * **It is a native range input.** A slider built from divs has to recreate\n * arrow keys, Page Up and Down, Home and End, the value announcement and touch\n * handling, and every one of those is a place to get it wrong. The input\n * already does all of it. The stops are buttons beside it, so a keyboard or\n * switch user reaches each named moment in one action instead of nudging a\n * thumb to find it (2.5.7, dragging movements).\n *\n * @category action\n * @icon adjustments-horizontal\n */\nexport class ImpktScrubber extends ImpktElement {\n static properties = {\n label: { type: String },\n stops: { type: Array },\n look: { type: String, reflect: true },\n hint: { type: String },\n value: { type: Number, state: true },\n };\n\n /** The slider's accessible name. */\n declare label: string;\n declare stops: ScrubberStop[];\n /**\n * `buttons` lists the stops as buttons under the slider. `graph` draws them\n * as commits on a line that fills in each stop's colour as it is dragged,\n * with the current one's code and note beside it.\n */\n declare look: 'buttons' | 'graph';\n /** A word of help in the graph look, such as \"drag to time-travel\". */\n declare hint: string;\n declare value: number;\n\n private scene: ImpktScene | null = null;\n\n constructor() {\n super();\n this.label = 'Scene progress';\n this.stops = [];\n this.look = 'buttons';\n this.hint = '';\n this.value = 0;\n }\n\n static styles = [\n ...ImpktElement.styles,\n css`\n :host {\n display: block;\n width: 100%;\n max-width: 48rem;\n margin-inline: auto;\n }\n .wrap {\n display: grid;\n gap: ${space(2)};\n padding: ${space(3)} ${space(4)};\n border-radius: ${token('radius.xl', '16px')};\n background: ${t.surfaceCard};\n box-shadow: ${token('shadow.lg', '0 10px 15px -3px rgba(0,0,0,.1)')};\n border: 1px solid ${t.border};\n }\n input {\n width: 100%;\n min-height: ${token('target.min', '24px')};\n accent-color: ${t.brand};\n margin: 0;\n }\n .stops {\n position: relative;\n display: flex;\n flex-wrap: wrap;\n gap: ${space(2)};\n list-style: none;\n margin: 0;\n padding: 0;\n }\n button {\n min-height: ${token('target.min', '24px')};\n padding: ${space(1)} ${space(3)};\n border-radius: ${token('radius.full', '9999px')};\n border: 1px solid ${t.border};\n background: transparent;\n color: ${t.textMuted};\n font-size: ${fontSize('xs')};\n font-weight: ${fontWeight('medium')};\n cursor: pointer;\n }\n button[aria-current='true'] {\n color: ${t.text};\n border-color: ${t.text};\n }\n .sr-only {\n ${visuallyHidden}\n }\n /* The graph look: the code of where you are, the line of stops, where you are. */\n :host([look='graph']) { max-width: none; }\n .graph { display: grid; grid-template-columns: minmax(8rem, auto) minmax(0, 1fr) auto; gap: ${space(6)}; align-items: center; padding: ${space(4)} ${space(6)}; border-radius: ${token('radius.xl', '16px')}; background: ${t.surfaceCard}; box-shadow: ${token('shadow.lg', '0 10px 15px -3px rgba(0,0,0,.1)')}; border: 1px solid ${t.border}; }\n .mono { font-family: ${t.fontMono}; font-size: ${fontSize('xs')}; letter-spacing: 0.04em; }\n .head { display: grid; gap: 2px; }\n .head .k { color: ${t.textMuted}; text-transform: uppercase; }\n .head .code { font-size: ${fontSize('md')}; color: ${t.text}; }\n .head .note { color: ${t.textMuted}; }\n .line { position: relative; block-size: 48px; }\n .track, .fill { position: absolute; inset-inline: 0; inset-block-start: 14px; block-size: 3px; border-radius: 3px; background: ${t.border}; opacity: 0.5; }\n .fill { opacity: 1; background: none; display: flex; overflow: hidden; }\n .fill span { block-size: 100%; }\n .dot { position: absolute; inset-block-start: 15px; inline-size: 14px; block-size: 14px; translate: -50% -50%; border-radius: 50%; border: 2px solid var(--c); background: ${t.surfaceCard}; padding: 0; min-height: 0; cursor: pointer; }\n .dot[data-passed] { background: var(--c); }\n .dot[aria-current='true'] { inline-size: 24px; block-size: 24px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); }\n .dot-label { position: absolute; inset-block-start: 30px; translate: -50% 0; white-space: nowrap; color: ${t.textMuted}; text-transform: uppercase; pointer-events: none; }\n .dot-label[data-current] { color: ${t.text}; font-weight: ${fontWeight('bold')}; }\n .line input { position: absolute; inset: 0 0 auto; block-size: 30px; opacity: 0; cursor: grab; }\n .line input:focus-visible { opacity: 1; }\n .where { display: grid; gap: ${space(2)}; justify-items: end; }\n .chip { display: inline-flex; align-items: center; gap: ${space(2)}; padding: ${space(1)} ${space(3)}; border-radius: ${token('radius.full', '9999px')}; border: 1px solid ${t.border}; color: ${t.text}; text-transform: uppercase; }\n .chip::before { content: ''; inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--c); }\n .hint { color: ${t.textMuted}; text-transform: uppercase; }\n @media (max-width: 48rem) {\n .graph { grid-template-columns: minmax(0, 1fr); }\n .where { justify-items: start; }\n .dot-label:not([data-current]) { display: none; }\n }\n button:focus-visible,\n input:focus-visible {\n outline: none;\n box-shadow: ${token('focus.ring.shadow', '0 0 0 2px #fff, 0 0 0 4px #1a1a1a')};\n }\n `,\n ];\n\n /** @ignore */\n connectedCallback(): void {\n super.connectedCallback();\n this.scene = this.closest('impkt-scene');\n this.scene?.addEventListener('impkt-scene-progress', this.onProgress);\n if (this.scene) this.value = this.scene.progress;\n }\n\n /** @ignore */\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.scene?.removeEventListener('impkt-scene-progress', this.onProgress);\n this.scene = null;\n }\n\n private onProgress = (e: Event) => {\n this.value = (e as CustomEvent<{ progress: number }>).detail.progress;\n };\n\n private onInput = (e: Event) => {\n const v = Number((e.target as HTMLInputElement).value) / 1000;\n this.value = v;\n this.scene?.seek(v);\n };\n\n private goTo(stop: ScrubberStop) {\n this.scene?.seek(stop.at, 600);\n }\n\n /** The stop nearest the current position, which the stop list marks as current. */\n private nearest(): number {\n let best = -1;\n let gap = Infinity;\n this.stops.forEach((s, i) => {\n const d = Math.abs(s.at - this.value);\n if (d < gap) {\n gap = d;\n best = i;\n }\n });\n return best;\n }\n\n private renderGraph(nearestIndex: number, valueText: string): TemplateResult {\n let current = nearestIndex;\n const stops = [...(this.stops ?? [])].sort((a, b) => a.at - b.at);\n // Where you are, among the stops in the order they are drawn.\n current = stops.indexOf(this.stops[current]!);\n const colour = (s: ScrubberStop | undefined) => {\n const tone = s?.tone ?? 'brand';\n return typeof tone === 'number' ? `var(--impkt-color-chart-${tone}, ${TONES.brand})` : TONES[tone] ?? TONES.brand;\n };\n const now = stops[current] ?? stops[0];\n // The line fills in each stop's colour, from the stop before it to it, as far as the playhead.\n const segments = stops.map((s, i) => {\n const from = i === 0 ? 0 : stops[i - 1]!.at;\n const to = Math.min(s.at, this.value);\n return { width: Math.round(Math.max(0, to - from) * 10000) / 100, c: colour(s) };\n });\n return html`<div class=\"graph\" part=\"wrap\">\n <div class=\"head mono\" aria-hidden=\"true\">\n <span class=\"k\">HEAD</span>\n <span class=\"code\">${now?.meta ?? now?.label ?? ''}</span>\n ${now?.note ? html`<span class=\"note\">${now.note}</span>` : null}\n </div>\n <div class=\"line\">\n <div class=\"track\"></div>\n <div class=\"fill\" aria-hidden=\"true\">${segments.map((g) => html`<span style=${`width:${g.width}%;background:${g.c}`}></span>`)}</div>\n ${stops.map((s, i) => html`\n <button type=\"button\" class=\"dot\" style=${`left:${s.at * 100}%;--c:${colour(s)}`} ?data-passed=${s.at <= this.value + 0.0001} aria-current=${i === current ? 'true' : 'false'} @click=${() => this.goTo(s)}>\n <span class=\"sr-only\">${say('Go to {name}', { name: s.label })}</span>\n </button>\n <span class=\"dot-label mono\" style=${`left:${s.at * 100}%`} ?data-current=${i === current} aria-hidden=\"true\">${s.label}</span>`)}\n <input type=\"range\" min=\"0\" max=\"1000\" step=\"1\" .value=${String(Math.round(this.value * 1000))} aria-label=${this.label} aria-valuetext=${valueText} @input=${this.onInput} />\n </div>\n <div class=\"where\" aria-hidden=\"true\">\n ${now ? html`<span class=\"chip mono\" style=${`--c:${colour(now)}`}>${now.label}${now.meta ? html`&nbsp;<span style=\"opacity:.6\">${now.meta}</span>` : null}</span>` : null}\n ${this.hint ? html`<span class=\"hint mono\">${this.hint}</span>` : null}\n </div>\n </div>`;\n }\n\n render(): TemplateResult {\n const current = this.nearest();\n const valueText = current >= 0 ? this.stops[current].label : `${Math.round(this.value * 100)}%`;\n if (this.look === 'graph') return this.renderGraph(current, valueText);\n return html`\n <div class=\"wrap\" part=\"wrap\">\n <input\n type=\"range\"\n min=\"0\"\n max=\"1000\"\n step=\"1\"\n .value=${String(Math.round(this.value * 1000))}\n aria-label=${this.label}\n aria-valuetext=${valueText}\n @input=${this.onInput}\n />\n ${this.stops.length\n ? html`<ul class=\"stops\" part=\"stops\">\n ${this.stops.map(\n (s, i) => html`<li>\n <button type=\"button\" aria-current=${i === current ? 'true' : 'false'} @click=${() => this.goTo(s)}>\n <span aria-hidden=\"true\">${s.label}</span><span class=\"sr-only\">${say('Go to {name}', { name: s.label })}</span>\n </button>\n </li>`,\n )}\n </ul>`\n : null}\n </div>\n `;\n }\n}\n\ncustomElements.define('impkt-scrubber', ImpktScrubber);\n\ndeclare global {\n interface HTMLElementTagNameMap { 'impkt-scrubber': ImpktScrubber }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,MAAM,WAAgC;AAsB/C,IAAM,QAAQ;AAAA,EACZ,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AACV;AAoBO,IAAM,gBAAN,cAA4B,aAAa;AAAA,EAwB9C,cAAc;AACZ,UAAM;AAHR,SAAQ,QAA2B;AAiHnC,SAAQ,aAAa,CAAC,MAAa;AACjC,WAAK,QAAS,EAAwC,OAAO;AAAA,IAC/D;AAEA,SAAQ,UAAU,CAAC,MAAa;AAC9B,YAAM,IAAI,OAAQ,EAAE,OAA4B,KAAK,IAAI;AACzD,WAAK,QAAQ;AACb,WAAK,OAAO,KAAK,CAAC;AAAA,IACpB;AArHE,SAAK,QAAQ;AACb,SAAK,QAAQ,CAAC;AACd,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,QAAQ;AAAA,EACf;AAAA,EA9BA;AAAA,SAAO,aAAa;AAAA,MAClB,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,OAAO,EAAE,MAAM,MAAM;AAAA,MACrB,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACpC,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,OAAO,EAAE,MAAM,QAAQ,OAAO,KAAK;AAAA,IACrC;AAAA;AAAA,EA0BA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,aAAa;AAAA,MAChB;AAAA;AAAA;AAAA;A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