@atomic-ui/ui 0.1.7 → 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 (168) hide show
  1. package/README.md +5 -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 +5 -1
  8. package/dist/{chunk-GSCVG2ER.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-4HU4Y23Q.js → chunk-3IQ73WNW.js} +3 -3
  14. package/dist/{chunk-7Y6UCSUS.js → chunk-4X723QBD.js} +4 -4
  15. package/dist/chunk-4X723QBD.js.map +1 -0
  16. package/dist/{chunk-OB7LC6NJ.js → chunk-6YYAOKNI.js} +2 -2
  17. package/dist/{chunk-7BIQ3K6H.js → chunk-7AJN2TIS.js} +2 -2
  18. package/dist/chunk-7BSZPUE3.js +53 -0
  19. package/dist/chunk-7BSZPUE3.js.map +1 -0
  20. package/dist/{chunk-HWWA27DN.js → chunk-7OXTZJR4.js} +2 -2
  21. package/dist/chunk-7XEPNEVQ.js +264 -0
  22. package/dist/chunk-7XEPNEVQ.js.map +1 -0
  23. package/dist/{chunk-NTNXHLTM.js → chunk-D6C7XEY4.js} +41 -1
  24. package/dist/chunk-D6C7XEY4.js.map +1 -0
  25. package/dist/{chunk-C36CZRHK.js → chunk-E2VBUWJ4.js} +43 -13
  26. package/dist/chunk-E2VBUWJ4.js.map +1 -0
  27. package/dist/{chunk-XJP45LFA.js → chunk-E3XJK7MY.js} +13 -5
  28. package/dist/chunk-E3XJK7MY.js.map +1 -0
  29. package/dist/{chunk-GO2IBRFP.js → chunk-EDSZI227.js} +2 -2
  30. package/dist/{chunk-6ICOJPMD.js → chunk-FFCIY7NM.js} +4 -3
  31. package/dist/chunk-FFCIY7NM.js.map +1 -0
  32. package/dist/{chunk-MOEMFL4K.js → chunk-FJRHZA3C.js} +5 -5
  33. package/dist/chunk-FJRHZA3C.js.map +1 -0
  34. package/dist/{chunk-ZGAOMRYD.js → chunk-GQDUHZE3.js} +3 -3
  35. package/dist/{chunk-QCNT7D5V.js → chunk-HYPPG4NF.js} +12 -8
  36. package/dist/chunk-HYPPG4NF.js.map +1 -0
  37. package/dist/chunk-J4JULXUG.js +249 -0
  38. package/dist/chunk-J4JULXUG.js.map +1 -0
  39. package/dist/{chunk-2YQA3VBY.js → chunk-KFD4O7VA.js} +4 -2
  40. package/dist/chunk-KFD4O7VA.js.map +1 -0
  41. package/dist/{chunk-ZQJD4YEJ.js → chunk-MVEFM5QI.js} +3 -3
  42. package/dist/{chunk-WECSVHIM.js → chunk-NCASAXQT.js} +7 -3
  43. package/dist/chunk-NCASAXQT.js.map +1 -0
  44. package/dist/{chunk-QDNI54ON.js → chunk-NKTMMJYD.js} +7 -6
  45. package/dist/chunk-NKTMMJYD.js.map +1 -0
  46. package/dist/{chunk-T6L3USBZ.js → chunk-OB7WULFK.js} +23 -11
  47. package/dist/chunk-OB7WULFK.js.map +1 -0
  48. package/dist/{chunk-ZBLTU67D.js → chunk-OHDPGIJ3.js} +15 -11
  49. package/dist/chunk-OHDPGIJ3.js.map +1 -0
  50. package/dist/{chunk-TPF4MOMF.js → chunk-OLLZFNO6.js} +7 -4
  51. package/dist/chunk-OLLZFNO6.js.map +1 -0
  52. package/dist/{chunk-NQKYHILD.js → chunk-OMJMUFOW.js} +3 -3
  53. package/dist/{chunk-MLVUMCQ2.js → chunk-QB2KMV6S.js} +14 -5
  54. package/dist/chunk-QB2KMV6S.js.map +1 -0
  55. package/dist/{chunk-5EA4IDUD.js → chunk-R67PDFKE.js} +2 -2
  56. package/dist/chunk-RZSZQMSE.js +236 -0
  57. package/dist/chunk-RZSZQMSE.js.map +1 -0
  58. package/dist/{chunk-XVKEM5JY.js → chunk-TGT7J4EG.js} +2 -2
  59. package/dist/{chunk-VTFCTWSX.js → chunk-UCHJCUYI.js} +2 -2
  60. package/dist/chunk-UHLRXI6J.js +453 -0
  61. package/dist/chunk-UHLRXI6J.js.map +1 -0
  62. package/dist/{chunk-X7IPZPTG.js → chunk-UNVL3CNM.js} +34 -19
  63. package/dist/chunk-UNVL3CNM.js.map +1 -0
  64. package/dist/{chunk-VWNBB7FW.js → chunk-WDDWWCHN.js} +2 -2
  65. package/dist/chunk-WFKSOM6O.js +498 -0
  66. package/dist/chunk-WFKSOM6O.js.map +1 -0
  67. package/dist/{chunk-G6OVKNL7.js → chunk-XEJMFFIM.js} +4 -3
  68. package/dist/chunk-XEJMFFIM.js.map +1 -0
  69. package/dist/{chunk-CMAU4DSB.js → chunk-XJXCTGDR.js} +5 -5
  70. package/dist/chunk-XJXCTGDR.js.map +1 -0
  71. package/dist/{chunk-BTGCUONV.js → chunk-YD6IZ2C5.js} +2 -2
  72. package/dist/chunk-YK5QI57J.js +396 -0
  73. package/dist/chunk-YK5QI57J.js.map +1 -0
  74. package/dist/components/accordion.js +2 -2
  75. package/dist/components/alert.js +2 -2
  76. package/dist/components/app-ui.js +5 -4
  77. package/dist/components/blocks.js +3 -3
  78. package/dist/components/button.d.ts +7 -0
  79. package/dist/components/button.js +3 -3
  80. package/dist/components/changelog.d.ts +386 -0
  81. package/dist/components/changelog.js +25 -0
  82. package/dist/components/changelog.js.map +1 -0
  83. package/dist/components/checkbox-group.js +3 -3
  84. package/dist/components/checkbox.js +3 -3
  85. package/dist/components/date-input.js +3 -3
  86. package/dist/components/dialog.js +2 -2
  87. package/dist/components/estimator.d.ts +246 -0
  88. package/dist/components/estimator.js +16 -0
  89. package/dist/components/estimator.js.map +1 -0
  90. package/dist/components/fieldset.js +2 -2
  91. package/dist/components/grid.js +2 -2
  92. package/dist/components/help.js +2 -2
  93. package/dist/components/icon.d.ts +2 -0
  94. package/dist/components/icon.js +2 -2
  95. package/dist/components/journey.d.ts +433 -0
  96. package/dist/components/journey.js +22 -0
  97. package/dist/components/journey.js.map +1 -0
  98. package/dist/components/layout.d.ts +24 -0
  99. package/dist/components/layout.js +2 -2
  100. package/dist/components/link.js +3 -3
  101. package/dist/components/list.d.ts +50 -0
  102. package/dist/components/list.js +8 -0
  103. package/dist/components/list.js.map +1 -0
  104. package/dist/components/marketing.js +3 -3
  105. package/dist/components/media.d.ts +10 -0
  106. package/dist/components/media.js +2 -2
  107. package/dist/components/navigation.d.ts +16 -0
  108. package/dist/components/navigation.js +3 -3
  109. package/dist/components/organisms.d.ts +12 -0
  110. package/dist/components/organisms.js +3 -3
  111. package/dist/components/page.js +2 -2
  112. package/dist/components/price.d.ts +1 -1
  113. package/dist/components/price.js +3 -2
  114. package/dist/components/progress.js +2 -2
  115. package/dist/components/property.js +4 -3
  116. package/dist/components/radio-group.js +3 -3
  117. package/dist/components/scene.d.ts +138 -0
  118. package/dist/components/scene.js +8 -0
  119. package/dist/components/scene.js.map +1 -0
  120. package/dist/components/scrubber.d.ts +86 -0
  121. package/dist/components/scrubber.js +8 -0
  122. package/dist/components/scrubber.js.map +1 -0
  123. package/dist/components/select.js +3 -3
  124. package/dist/components/selling.d.ts +407 -0
  125. package/dist/components/selling.js +25 -0
  126. package/dist/components/selling.js.map +1 -0
  127. package/dist/components/site.d.ts +283 -0
  128. package/dist/components/site.js +20 -0
  129. package/dist/components/site.js.map +1 -0
  130. package/dist/components/summary-list.js +2 -2
  131. package/dist/components/table.js +2 -2
  132. package/dist/components/text-input.js +3 -3
  133. package/dist/components/textarea.d.ts +13 -0
  134. package/dist/components/textarea.js +3 -3
  135. package/dist/index.d.ts +9 -1
  136. package/dist/index.js +134 -55
  137. package/package.json +11 -4
  138. package/dist/chunk-2YQA3VBY.js.map +0 -1
  139. package/dist/chunk-6ICOJPMD.js.map +0 -1
  140. package/dist/chunk-7Y6UCSUS.js.map +0 -1
  141. package/dist/chunk-C36CZRHK.js.map +0 -1
  142. package/dist/chunk-CMAU4DSB.js.map +0 -1
  143. package/dist/chunk-G6OVKNL7.js.map +0 -1
  144. package/dist/chunk-MLVUMCQ2.js.map +0 -1
  145. package/dist/chunk-MOEMFL4K.js.map +0 -1
  146. package/dist/chunk-NTNXHLTM.js.map +0 -1
  147. package/dist/chunk-QCNT7D5V.js.map +0 -1
  148. package/dist/chunk-QDNI54ON.js.map +0 -1
  149. package/dist/chunk-T6L3USBZ.js.map +0 -1
  150. package/dist/chunk-TPF4MOMF.js.map +0 -1
  151. package/dist/chunk-WECSVHIM.js.map +0 -1
  152. package/dist/chunk-X7IPZPTG.js.map +0 -1
  153. package/dist/chunk-XJP45LFA.js.map +0 -1
  154. package/dist/chunk-ZBLTU67D.js.map +0 -1
  155. /package/dist/{chunk-GSCVG2ER.js.map → chunk-26O27BQS.js.map} +0 -0
  156. /package/dist/{chunk-4HU4Y23Q.js.map → chunk-3IQ73WNW.js.map} +0 -0
  157. /package/dist/{chunk-OB7LC6NJ.js.map → chunk-6YYAOKNI.js.map} +0 -0
  158. /package/dist/{chunk-7BIQ3K6H.js.map → chunk-7AJN2TIS.js.map} +0 -0
  159. /package/dist/{chunk-HWWA27DN.js.map → chunk-7OXTZJR4.js.map} +0 -0
  160. /package/dist/{chunk-GO2IBRFP.js.map → chunk-EDSZI227.js.map} +0 -0
  161. /package/dist/{chunk-ZGAOMRYD.js.map → chunk-GQDUHZE3.js.map} +0 -0
  162. /package/dist/{chunk-ZQJD4YEJ.js.map → chunk-MVEFM5QI.js.map} +0 -0
  163. /package/dist/{chunk-NQKYHILD.js.map → chunk-OMJMUFOW.js.map} +0 -0
  164. /package/dist/{chunk-5EA4IDUD.js.map → chunk-R67PDFKE.js.map} +0 -0
  165. /package/dist/{chunk-XVKEM5JY.js.map → chunk-TGT7J4EG.js.map} +0 -0
  166. /package/dist/{chunk-VTFCTWSX.js.map → chunk-UCHJCUYI.js.map} +0 -0
  167. /package/dist/{chunk-VWNBB7FW.js.map → chunk-WDDWWCHN.js.map} +0 -0
  168. /package/dist/{chunk-BTGCUONV.js.map → chunk-YD6IZ2C5.js.map} +0 -0
@@ -0,0 +1,264 @@
1
+ import {
2
+ ImpktElement,
3
+ fontSize,
4
+ fontWeight,
5
+ say,
6
+ space,
7
+ t,
8
+ token
9
+ } from "./chunk-D6C7XEY4.js";
10
+
11
+ // packages/ui/src/components/scene.ts
12
+ import { html, css, nothing } from "lit";
13
+ var clamp = (n) => Math.min(1, Math.max(0, n));
14
+ var ImpktScene = class extends ImpktElement {
15
+ constructor() {
16
+ super();
17
+ /**
18
+ * Whether a loop is paused: the scene's own state, set by its pause button
19
+ * or by `pause()`. A plain field rather than a property, so it is never one
20
+ * of the settings an author is offered.
21
+ */
22
+ this.paused = false;
23
+ this.frame = 0;
24
+ this.started = 0;
25
+ this.reduced = false;
26
+ this.seekFrom = 0;
27
+ this.seekTo = 0;
28
+ this.seekStart = 0;
29
+ this.seekMs = 0;
30
+ this.onScroll = () => {
31
+ if (this.drive === "view" || this.drive === "page") this.schedule();
32
+ };
33
+ this.tick = (now) => {
34
+ this.frame = 0;
35
+ if (this.seekMs) {
36
+ if (!this.seekStart) this.seekStart = now;
37
+ const p = Math.min(1, (now - this.seekStart) / this.seekMs);
38
+ const e = p < 0.5 ? 4 * p * p * p : 1 - Math.pow(-2 * p + 2, 3) / 2;
39
+ this.progress = this.seekFrom + (this.seekTo - this.seekFrom) * e;
40
+ if (p < 1) this.schedule();
41
+ else this.seekMs = 0;
42
+ return;
43
+ }
44
+ if (this.drive === "view") {
45
+ const r = this.getBoundingClientRect();
46
+ const vh = window.innerHeight || 1;
47
+ this.progress = clamp(-r.top / Math.max(1, r.height - vh));
48
+ } else if (this.drive === "page") {
49
+ const doc = document.documentElement;
50
+ this.progress = clamp(window.scrollY / Math.max(1, doc.scrollHeight - (window.innerHeight || 0)));
51
+ } else if (this.drive === "loop" && !this.paused && !this.reduced) {
52
+ if (!this.started) this.started = now - this.progress * this.duration * 1e3;
53
+ this.progress = (now - this.started) / (this.duration * 1e3) % 1;
54
+ this.schedule();
55
+ }
56
+ };
57
+ this.togglePause = () => this.setPaused(!this.paused);
58
+ this.drive = "view";
59
+ this.layout = "stage";
60
+ this.length = 3;
61
+ this.duration = 8;
62
+ this.label = "Animation";
63
+ this.progress = 0;
64
+ this.controls = "below";
65
+ this.bleed = false;
66
+ this.hideOn = "never";
67
+ }
68
+ static {
69
+ this.properties = {
70
+ drive: { type: String, reflect: true },
71
+ layout: { type: String, reflect: true },
72
+ length: { type: Number },
73
+ duration: { type: Number },
74
+ label: { type: String },
75
+ progress: { type: Number },
76
+ controls: { type: String, reflect: true },
77
+ bleed: { type: Boolean, reflect: true },
78
+ hideOn: { type: String, reflect: true, attribute: "hide-on" }
79
+ };
80
+ }
81
+ static {
82
+ this.styles = [
83
+ ...ImpktElement.styles,
84
+ css`
85
+ :host {
86
+ display: block;
87
+ position: relative;
88
+ }
89
+ :host([drive='view'][layout='stage']) {
90
+ min-height: calc(var(--impkt-scene-length, 3) * 100svh);
91
+ }
92
+ .frame {
93
+ display: grid;
94
+ grid-template-columns: minmax(0, 1fr);
95
+ }
96
+ :host([layout='split']) .frame {
97
+ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
98
+ gap: ${space(8)};
99
+ }
100
+ .stage {
101
+ position: sticky;
102
+ top: 0;
103
+ height: 100svh;
104
+ display: grid;
105
+ place-items: center;
106
+ overflow: clip;
107
+ }
108
+ /* What is on the stage is layered, as in a motion tool: each thing sits
109
+ over the one before, so a later layer's timeline can reveal it over an
110
+ earlier one. */
111
+ .stage ::slotted(*) {
112
+ grid-area: 1 / 1;
113
+ max-width: 100%;
114
+ }
115
+ :host([drive='loop']) .stage,
116
+ :host([drive='scrubber']) .stage {
117
+ position: relative;
118
+ height: auto;
119
+ min-height: 60svh;
120
+ }
121
+ .controls {
122
+ display: flex;
123
+ gap: ${space(3)};
124
+ align-items: center;
125
+ justify-content: center;
126
+ padding-block: ${space(3)};
127
+ }
128
+ :host([bleed]) { margin-inline: calc(50% - 50vw); }
129
+ @media (max-width: 40rem) { :host([hide-on='phone']) { display: none; } }
130
+ @media (min-width: 40.0625rem) { :host([hide-on='wide']) { display: none; } }
131
+ /* Over the stage, the controls float at its foot, above the layers and clear of its edges. */
132
+ .stage > .controls { position: absolute; inset-inline: ${space(6)}; inset-block-end: ${space(6)}; z-index: 2; padding: 0; }
133
+ .stage > .controls ::slotted(*) { box-shadow: 0 12px 32px rgb(16 19 23 / 14%); border-radius: 16px; background: var(--impkt-color-surface-card, #fff); }
134
+ /* A control takes the row, so a graph scrubber spans the stage; a narrower one centres itself. */
135
+ .controls ::slotted(*) { flex: 1 1 auto; min-width: 0; }
136
+ .pause {
137
+ min-width: ${token("target.min", "24px")};
138
+ min-height: ${token("target.min", "24px")};
139
+ padding: ${space(2)} ${space(4)};
140
+ border-radius: ${token("radius.full", "9999px")};
141
+ border: 1px solid ${t.border};
142
+ background: ${t.surfaceCard};
143
+ color: ${t.text};
144
+ font-size: ${fontSize("sm")};
145
+ font-weight: ${fontWeight("medium")};
146
+ cursor: pointer;
147
+ }
148
+ .pause:focus-visible {
149
+ outline: none;
150
+ box-shadow: ${token("focus.ring.shadow", "0 0 0 2px #fff, 0 0 0 4px #1a1a1a")};
151
+ }
152
+ @media (max-width: 48rem) {
153
+ :host([layout='split']) .frame {
154
+ grid-template-columns: minmax(0, 1fr);
155
+ }
156
+ :host([layout='split']) .stage {
157
+ height: 50svh;
158
+ z-index: 1;
159
+ }
160
+ }
161
+ @media (prefers-reduced-motion: reduce) {
162
+ :host {
163
+ min-height: 0 !important;
164
+ }
165
+ .stage {
166
+ position: relative;
167
+ height: auto;
168
+ gap: ${space(6)};
169
+ }
170
+ /* With less motion the layers are shown one after another, so every
171
+ state the scene would have moved through can still be seen. */
172
+ .stage ::slotted(*) {
173
+ grid-area: auto;
174
+ }
175
+ }
176
+ `
177
+ ];
178
+ }
179
+ /** @ignore */
180
+ connectedCallback() {
181
+ super.connectedCallback();
182
+ try {
183
+ this.reduced = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
184
+ } catch {
185
+ this.reduced = false;
186
+ }
187
+ window.addEventListener("scroll", this.onScroll, { passive: true, capture: true });
188
+ window.addEventListener("resize", this.onScroll);
189
+ this.schedule();
190
+ }
191
+ /** @ignore */
192
+ disconnectedCallback() {
193
+ super.disconnectedCallback();
194
+ window.removeEventListener("scroll", this.onScroll, { capture: true });
195
+ window.removeEventListener("resize", this.onScroll);
196
+ if (this.frame) cancelAnimationFrame(this.frame);
197
+ this.frame = 0;
198
+ }
199
+ /** @ignore */
200
+ updated(changed) {
201
+ if (changed.has("length")) this.style.setProperty("--impkt-scene-length", String(this.length));
202
+ if (changed.has("progress")) this.publish();
203
+ if (changed.has("drive")) {
204
+ this.started = 0;
205
+ this.schedule();
206
+ }
207
+ }
208
+ /**
209
+ * Move to a progress. With `ms`, ease there; without, jump. A scrubber seeks
210
+ * a scene to a named stop this way.
211
+ */
212
+ seek(to, ms = 0) {
213
+ if (ms <= 0 || this.reduced) {
214
+ this.progress = clamp(to);
215
+ return;
216
+ }
217
+ this.seekFrom = this.progress;
218
+ this.seekTo = clamp(to);
219
+ this.seekStart = 0;
220
+ this.seekMs = ms;
221
+ this.schedule();
222
+ }
223
+ schedule() {
224
+ if (!this.frame && typeof requestAnimationFrame === "function") this.frame = requestAnimationFrame(this.tick);
225
+ }
226
+ publish() {
227
+ this.style.setProperty("--impkt-scene-progress", this.progress.toFixed(4));
228
+ this.dispatchEvent(new CustomEvent("impkt-scene-progress", { detail: { progress: this.progress }, bubbles: true, composed: true }));
229
+ }
230
+ setPaused(paused) {
231
+ if (this.paused === paused) return;
232
+ this.paused = paused;
233
+ this.started = 0;
234
+ this.schedule();
235
+ this.requestUpdate();
236
+ }
237
+ /** Stop a loop where it is, as its pause button does. An editor scrubbing the scene calls it. */
238
+ pause() {
239
+ this.setPaused(true);
240
+ }
241
+ render() {
242
+ const loop = this.drive === "loop";
243
+ const over = this.controls === "over" && !this.reduced;
244
+ const controls = html`<div class="controls" part="controls">
245
+ <slot name="controls"></slot>
246
+ ${loop && !this.reduced ? html`<button class="pause" type="button" aria-pressed=${this.paused ? "true" : "false"} @click=${this.togglePause}>
247
+ ${this.paused ? say("Play {name}", { name: this.label }) : say("Pause {name}", { name: this.label })}
248
+ </button>` : nothing}
249
+ </div>`;
250
+ const stage = html`<div class="stage" part="stage"><slot name="stage"></slot>${over ? controls : nothing}</div>`;
251
+ return html`
252
+ <div class="frame" part="frame" role="region" aria-label=${this.label}>
253
+ ${this.layout === "split" ? html`<div class="content" part="content"><slot></slot></div>${stage}` : html`${stage}<div class="content" part="content"><slot></slot></div>`}
254
+ </div>
255
+ ${over ? nothing : controls}
256
+ `;
257
+ }
258
+ };
259
+ customElements.define("impkt-scene", ImpktScene);
260
+
261
+ export {
262
+ ImpktScene
263
+ };
264
+ //# sourceMappingURL=chunk-7XEPNEVQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/scene.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult, type PropertyValues } from 'lit';\nimport { say } from '../base/say';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { fontSize, fontWeight, space, t, token } from '../base/tokens';\n\nexport type SceneDrive = 'view' | 'page' | 'loop' | 'scrubber';\nexport type SceneLayout = 'stage' | 'split';\n\nconst clamp = (n: number) => Math.min(1, Math.max(0, n));\n\n/**\n * A scene: a stage whose children move along a progress from 0 to 1.\n *\n * The children declare timelines in their `motion` block, and `@atomic-ui/motion`\n * compiles them to keyframes. This element owns only the progress, and where it\n * comes from is the `drive` (ADR 0027):\n *\n * - `view` — the scene's own passage through the viewport. The stage pins\n * while the scene scrolls past, for `length` screens, or beside the content\n * in the default slot when `layout` is `split`.\n * - `page` — the scroll position of the whole page.\n * - `loop` — time, over `duration` seconds, repeating. **It always shows a\n * pause button**, because anything that moves on its own for more than five\n * seconds must be pausable (WCAG 2.2.2), and a scene that could forget that\n * is one the gate would have to catch on every page.\n * - `scrubber` — an `impkt-scrubber` placed in the `controls` slot.\n *\n * Progress is published three ways: the `progress` property, the\n * `--impkt-scene-progress` custom property on the host, and an\n * `impkt-scene-progress` event. Engines with scroll-driven animations run `view`\n * and `page` scenes natively, and the runtime ignores the event for them.\n *\n * Under reduced motion a `loop` does not start, and nothing pins: the stage\n * and the content stack, so every state of the scene can be read in order.\n *\n * @category layout\n * @icon layers\n * @slot stage - What moves, layered one over another. Pinned while the scene plays,\n * beside the content in `split` layout, after it, so the words are read first.\n * @slot - Content that scrolls past the stage, such as chapters.\n * @slot controls - An `impkt-scrubber`, for a scene driven by one.\n * @fires impkt-scene-progress - `{ progress }` whenever the progress changes.\n */\nexport class ImpktScene extends ImpktElement {\n static properties = {\n drive: { type: String, reflect: true },\n layout: { type: String, reflect: true },\n length: { type: Number },\n duration: { type: Number },\n label: { type: String },\n progress: { type: Number },\n controls: { type: String, reflect: true },\n bleed: { type: Boolean, reflect: true },\n hideOn: { type: String, reflect: true, attribute: 'hide-on' },\n };\n\n /** Where the progress comes from. */\n declare drive: 'view' | 'page' | 'loop' | 'scrubber';\n /** `stage` pins one full-width stage; `split` pins it beside the content. */\n declare layout: 'stage' | 'split';\n /** How many screens of scrolling a `view` scene lasts, in `stage` layout. */\n declare length: number;\n /** Seconds per cycle of a `loop` scene. */\n declare duration: number;\n /** The scene's accessible name. Also names its pause button. */\n declare label: string;\n /** From 0 to 1. Set it to seek a `scrubber` scene, or where one starts. */\n declare progress: number;\n /**\n * Where the controls sit: `below` the stage, or `over` its foot, floating\n * on what it shows, as a video's do. Under reduced motion they sit below.\n */\n declare controls: 'below' | 'over';\n /** Run the stage to the window's edges, past the page's margins, as a hero drawn edge to edge does. */\n declare bleed: boolean;\n /**\n * Leave it out on a phone, or on anything wider, for a picture drawn twice:\n * once for a wide screen and once for a narrow one. Never both.\n */\n declare hideOn: 'never' | 'phone' | 'wide';\n /**\n * Whether a loop is paused: the scene's own state, set by its pause button\n * or by `pause()`. A plain field rather than a property, so it is never one\n * of the settings an author is offered.\n */\n private paused = false;\n\n private frame = 0;\n private started = 0;\n private reduced = false;\n private seekFrom = 0;\n private seekTo = 0;\n private seekStart = 0;\n private seekMs = 0;\n\n constructor() {\n super();\n this.drive = 'view';\n this.layout = 'stage';\n this.length = 3;\n this.duration = 8;\n this.label = 'Animation';\n this.progress = 0;\n this.controls = 'below';\n this.bleed = false;\n this.hideOn = 'never';\n }\n\n static styles = [\n ...ImpktElement.styles,\n css`\n :host {\n display: block;\n position: relative;\n }\n :host([drive='view'][layout='stage']) {\n min-height: calc(var(--impkt-scene-length, 3) * 100svh);\n }\n .frame {\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n }\n :host([layout='split']) .frame {\n grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);\n gap: ${space(8)};\n }\n .stage {\n position: sticky;\n top: 0;\n height: 100svh;\n display: grid;\n place-items: center;\n overflow: clip;\n }\n /* What is on the stage is layered, as in a motion tool: each thing sits\n over the one before, so a later layer's timeline can reveal it over an\n earlier one. */\n .stage ::slotted(*) {\n grid-area: 1 / 1;\n max-width: 100%;\n }\n :host([drive='loop']) .stage,\n :host([drive='scrubber']) .stage {\n position: relative;\n height: auto;\n min-height: 60svh;\n }\n .controls {\n display: flex;\n gap: ${space(3)};\n align-items: center;\n justify-content: center;\n padding-block: ${space(3)};\n }\n :host([bleed]) { margin-inline: calc(50% - 50vw); }\n @media (max-width: 40rem) { :host([hide-on='phone']) { display: none; } }\n @media (min-width: 40.0625rem) { :host([hide-on='wide']) { display: none; } }\n /* Over the stage, the controls float at its foot, above the layers and clear of its edges. */\n .stage > .controls { position: absolute; inset-inline: ${space(6)}; inset-block-end: ${space(6)}; z-index: 2; padding: 0; }\n .stage > .controls ::slotted(*) { box-shadow: 0 12px 32px rgb(16 19 23 / 14%); border-radius: 16px; background: var(--impkt-color-surface-card, #fff); }\n /* A control takes the row, so a graph scrubber spans the stage; a narrower one centres itself. */\n .controls ::slotted(*) { flex: 1 1 auto; min-width: 0; }\n .pause {\n min-width: ${token('target.min', '24px')};\n min-height: ${token('target.min', '24px')};\n padding: ${space(2)} ${space(4)};\n border-radius: ${token('radius.full', '9999px')};\n border: 1px solid ${t.border};\n background: ${t.surfaceCard};\n color: ${t.text};\n font-size: ${fontSize('sm')};\n font-weight: ${fontWeight('medium')};\n cursor: pointer;\n }\n .pause:focus-visible {\n outline: none;\n box-shadow: ${token('focus.ring.shadow', '0 0 0 2px #fff, 0 0 0 4px #1a1a1a')};\n }\n @media (max-width: 48rem) {\n :host([layout='split']) .frame {\n grid-template-columns: minmax(0, 1fr);\n }\n :host([layout='split']) .stage {\n height: 50svh;\n z-index: 1;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n :host {\n min-height: 0 !important;\n }\n .stage {\n position: relative;\n height: auto;\n gap: ${space(6)};\n }\n /* With less motion the layers are shown one after another, so every\n state the scene would have moved through can still be seen. */\n .stage ::slotted(*) {\n grid-area: auto;\n }\n }\n `,\n ];\n\n /** @ignore */\n connectedCallback(): void {\n super.connectedCallback();\n try {\n this.reduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n } catch {\n this.reduced = false;\n }\n window.addEventListener('scroll', this.onScroll, { passive: true, capture: true });\n window.addEventListener('resize', this.onScroll);\n this.schedule();\n }\n\n /** @ignore */\n disconnectedCallback(): void {\n super.disconnectedCallback();\n window.removeEventListener('scroll', this.onScroll, { capture: true });\n window.removeEventListener('resize', this.onScroll);\n if (this.frame) cancelAnimationFrame(this.frame);\n this.frame = 0;\n }\n\n /** @ignore */\n protected updated(changed: PropertyValues<this>): void {\n if (changed.has('length')) this.style.setProperty('--impkt-scene-length', String(this.length));\n if (changed.has('progress')) this.publish();\n if (changed.has('drive')) {\n this.started = 0;\n this.schedule();\n }\n }\n\n /**\n * Move to a progress. With `ms`, ease there; without, jump. A scrubber seeks\n * a scene to a named stop this way.\n */\n seek(to: number, ms = 0): void {\n if (ms <= 0 || this.reduced) {\n this.progress = clamp(to);\n return;\n }\n this.seekFrom = this.progress;\n this.seekTo = clamp(to);\n this.seekStart = 0;\n this.seekMs = ms;\n this.schedule();\n }\n\n private onScroll = () => {\n if (this.drive === 'view' || this.drive === 'page') this.schedule();\n };\n\n private schedule(): void {\n if (!this.frame && typeof requestAnimationFrame === 'function') this.frame = requestAnimationFrame(this.tick);\n }\n\n private tick = (now: number) => {\n this.frame = 0;\n if (this.seekMs) {\n if (!this.seekStart) this.seekStart = now;\n const p = Math.min(1, (now - this.seekStart) / this.seekMs);\n // ease-in-out, so a jump between stops reads as travel rather than a cut\n const e = p < 0.5 ? 4 * p * p * p : 1 - Math.pow(-2 * p + 2, 3) / 2;\n this.progress = this.seekFrom + (this.seekTo - this.seekFrom) * e;\n if (p < 1) this.schedule();\n else this.seekMs = 0;\n return;\n }\n if (this.drive === 'view') {\n const r = this.getBoundingClientRect();\n const vh = window.innerHeight || 1;\n this.progress = clamp(-r.top / Math.max(1, r.height - vh));\n } else if (this.drive === 'page') {\n const doc = document.documentElement;\n this.progress = clamp(window.scrollY / Math.max(1, doc.scrollHeight - (window.innerHeight || 0)));\n } else if (this.drive === 'loop' && !this.paused && !this.reduced) {\n if (!this.started) this.started = now - this.progress * this.duration * 1000;\n this.progress = ((now - this.started) / (this.duration * 1000)) % 1;\n this.schedule();\n }\n };\n\n private publish(): void {\n this.style.setProperty('--impkt-scene-progress', this.progress.toFixed(4));\n this.dispatchEvent(new CustomEvent('impkt-scene-progress', { detail: { progress: this.progress }, bubbles: true, composed: true }));\n }\n\n private setPaused(paused: boolean): void {\n if (this.paused === paused) return;\n this.paused = paused;\n this.started = 0;\n this.schedule();\n this.requestUpdate();\n }\n\n private togglePause = () => this.setPaused(!this.paused);\n\n /** Stop a loop where it is, as its pause button does. An editor scrubbing the scene calls it. */\n pause(): void {\n this.setPaused(true);\n }\n\n render(): TemplateResult {\n const loop = this.drive === 'loop';\n const over = this.controls === 'over' && !this.reduced;\n const controls = html`<div class=\"controls\" part=\"controls\">\n <slot name=\"controls\"></slot>\n ${loop && !this.reduced\n ? html`<button class=\"pause\" type=\"button\" aria-pressed=${this.paused ? 'true' : 'false'} @click=${this.togglePause}>\n ${this.paused ? say('Play {name}', { name: this.label }) : say('Pause {name}', { name: this.label })}\n </button>`\n : nothing}\n </div>`;\n const stage = html`<div class=\"stage\" part=\"stage\"><slot name=\"stage\"></slot>${over ? controls : nothing}</div>`;\n return html`\n <div class=\"frame\" part=\"frame\" role=\"region\" aria-label=${this.label}>\n ${this.layout === 'split'\n ? html`<div class=\"content\" part=\"content\"><slot></slot></div>${stage}`\n : html`${stage}<div class=\"content\" part=\"content\"><slot></slot></div>`}\n </div>\n ${over ? nothing : controls}\n `;\n }\n}\n\ncustomElements.define('impkt-scene', ImpktScene);\n\ndeclare global {\n interface HTMLElementTagNameMap { 'impkt-scene': ImpktScene }\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAyD;AAQ7E,IAAM,QAAQ,CAAC,MAAc,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,CAAC,CAAC;AAmChD,IAAM,aAAN,cAAyB,aAAa;AAAA,EAoD3C,cAAc;AACZ,UAAM;AAXR;AAAA;AAAA;AAAA;AAAA;AAAA,SAAQ,SAAS;AAEjB,SAAQ,QAAQ;AAChB,SAAQ,UAAU;AAClB,SAAQ,UAAU;AAClB,SAAQ,WAAW;AACnB,SAAQ,SAAS;AACjB,SAAQ,YAAY;AACpB,SAAQ,SAAS;AAgKjB,SAAQ,WAAW,MAAM;AACvB,UAAI,KAAK,UAAU,UAAU,KAAK,UAAU,OAAQ,MAAK,SAAS;AAAA,IACpE;AAMA,SAAQ,OAAO,CAAC,QAAgB;AAC9B,WAAK,QAAQ;AACb,UAAI,KAAK,QAAQ;AACf,YAAI,CAAC,KAAK,UAAW,MAAK,YAAY;AACtC,cAAM,IAAI,KAAK,IAAI,IAAI,MAAM,KAAK,aAAa,KAAK,MAAM;AAE1D,c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AAK,QAAQ,sBAAsB,KAAK,IAAI;AAAA,EAC9G;AAAA,EA4BQ,UAAgB;AACtB,SAAK,MAAM,YAAY,0BAA0B,KAAK,SAAS,QAAQ,CAAC,CAAC;AACzE,SAAK,cAAc,IAAI,YAAY,wBAAwB,EAAE,QAAQ,EAAE,UAAU,KAAK,SAAS,GAAG,SAAS,MAAM,UAAU,KAAK,CAAC,CAAC;AAAA,EACpI;AAAA,EAEQ,UAAU,QAAuB;AACvC,QAAI,KAAK,WAAW,OAAQ;AAC5B,SAAK,SAAS;AACd,SAAK,UAAU;AACf,SAAK,SAAS;AACd,SAAK,cAAc;AAAA,EACrB;AAAA;AAAA,EAKA,QAAc;AACZ,SAAK,UAAU,IAAI;AAAA,EACrB;AAAA,EAEA,SAAyB;AACvB,UAAM,OAAO,KAAK,UAAU;AAC5B,UAAM,OAAO,KAAK,aAAa,UAAU,CAAC,KAAK;AAC/C,UAAM,WAAW;AAAA;AAAA,UAEX,QAAQ,CAAC,KAAK,UACZ,wDAAwD,KAAK,SAAS,SAAS,OAAO,WAAW,KAAK,WAAW;AAAA,gBAC7G,KAAK,SAAS,IAAI,eAAe,EAAE,MAAM,KAAK,MAAM,CAAC,IAAI,IAAI,gBAAgB,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;AAAA,yBAEtG,OAAO;AAAA;AAEf,UAAM,QAAQ,iEAAiE,OAAO,WAAW,OAAO;AACxG,WAAO;AAAA,iEACsD,KAAK,KAAK;AAAA,UACjE,KAAK,WAAW,UACd,8DAA8D,KAAK,KACnE,OAAO,KAAK,yDAAyD;AAAA;AAAA,QAEzE,OAAO,UAAU,QAAQ;AAAA;AAAA,EAE/B;AACF;AAEA,eAAe,OAAO,eAAe,UAAU;","names":[]}
@@ -32,6 +32,10 @@ var t = {
32
32
  infoSubtle: token("color.status.info.subtle", "#e4eafa"),
33
33
  fontBody: token("font.family.body", "system-ui, sans-serif"),
34
34
  fontHeading: token("font.family.heading", "system-ui, sans-serif"),
35
+ /** Code-like labels: hashes, branches, version lines. */
36
+ fontMono: token("font.family.mono", "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"),
37
+ /** The small line above a heading: the body face, or the code face for a brand that asks. */
38
+ fontEyebrow: token("font.family.eyebrow", "inherit"),
35
39
  focusShadow: token("focus.ring.shadow", "0 0 0 2px #ffffff, 0 0 0 4px #1a1a1a"),
36
40
  focusOffset: token("focus.ring.offset", "2px"),
37
41
  targetMin: token("target.min", "24px"),
@@ -130,6 +134,15 @@ var base = css2`
130
134
  }
131
135
  `;
132
136
 
137
+ // packages/ui/src/base/say.ts
138
+ var WORDING = Symbol.for("strata.wording");
139
+ function say(english, values) {
140
+ const words = globalThis[WORDING]?.words;
141
+ const chosen = words?.[english];
142
+ const text = typeof chosen === "string" && chosen.trim() ? chosen : english;
143
+ return values ? text.replace(/\{(\w+)\}/g, (whole, name) => name in values ? String(values[name]) : whole) : text;
144
+ }
145
+
133
146
  // packages/ui/src/base/ImpktElement.ts
134
147
  import { LitElement, css as css3 } from "lit";
135
148
  var counter = 0;
@@ -151,6 +164,32 @@ var ImpktElement = class extends LitElement {
151
164
  id_(part) {
152
165
  return `${this.uid}-${part}`;
153
166
  }
167
+ /** @ignore */
168
+ connectedCallback() {
169
+ super.connectedCallback();
170
+ this.sayDefaults();
171
+ }
172
+ /**
173
+ * The words a component ships with, in the page's language (ADR 0026).
174
+ *
175
+ * Defaults stay plain English in the constructor, so the component manifest
176
+ * still sees them (a prop with no default is read as required). When the
177
+ * element joins the page, each word it holds is looked up in the site's
178
+ * wording; anything that is not one of Strata's own words, such as a page's
179
+ * own text or a variant name, is left exactly as it is.
180
+ *
181
+ * @ignore
182
+ */
183
+ sayDefaults() {
184
+ const props = this.constructor.elementProperties;
185
+ const self = this;
186
+ for (const name of props.keys()) {
187
+ const value = self[name];
188
+ if (typeof value !== "string" || !value) continue;
189
+ const said = say(value);
190
+ if (said !== value) self[name] = said;
191
+ }
192
+ }
154
193
  };
155
194
 
156
195
  export {
@@ -165,6 +204,7 @@ export {
165
204
  focusRing,
166
205
  targetSize,
167
206
  visuallyHidden,
207
+ say,
168
208
  ImpktElement
169
209
  };
170
- //# sourceMappingURL=chunk-NTNXHLTM.js.map
210
+ //# sourceMappingURL=chunk-D6C7XEY4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/base/tokens.ts","../src/base/styles.ts","../src/base/say.ts","../src/base/ImpktElement.ts"],"sourcesContent":["/**\n * Token helpers.\n *\n * Components never name a colour, a size or a radius. They name a token, and a\n * brand decides what it holds — which is what makes a rebrand a content\n * publish rather than a rebuild\n * ([ADR 0005](https://github.com/matthill8286/strata/blob/main/docs/decisions/0005-design-tokens.md)).\n *\n * Every reference carries a fallback so that a component dropped onto a page\n * with no token stylesheet still renders something legible. An unstyled\n * component is indistinguishable from a broken one, and the fallback is what\n * keeps a missing stylesheet a visible annoyance rather than a blank screen.\n *\n * These return `CSSResult` rather than strings. Lit's `css` tag refuses plain\n * interpolated strings, which is a deliberate guard against injecting\n * attacker-controlled text into a stylesheet; `unsafeCSS` is the documented\n * way past it and is safe here because every value is a literal in this file,\n * never anything authored or fetched.\n */\nimport { css, unsafeCSS, type CSSResult } from 'lit';\n\n/** `color.brand.default` → `var(--impkt-color-brand-default, <fallback>)`. */\nexport const token = (path: string, fallback: string): CSSResult =>\n unsafeCSS(`var(--impkt-${path.replace(/\\./g, '-')}, ${fallback})`);\n\nexport const t = {\n brand: token('color.brand.default', '#1f4ed8'),\n brandHover: token('color.brand.hover', '#1b45be'),\n brandActive: token('color.brand.active', '#183ba4'),\n brandSubtle: token('color.brand.subtle', '#e4eafa'),\n onBrand: token('color.text.on-brand', '#ffffff'),\n\n surfaceCard: token('color.surface.card', '#ffffff'),\n surfaceInset: token('color.surface.inset', '#f4f4f4'),\n surfaceSubtle: token('color.surface.subtle', '#e4eafa'),\n\n text: token('color.text.default', '#1a1a1a'),\n textMuted: token('color.text.muted', '#717171'),\n textPlaceholder: token('color.text.placeholder', '#767676'),\n textHeading: token('color.text.heading', '#1f4ed8'),\n link: token('color.text.link', '#1f4ed8'),\n linkHover: token('color.text.link-hover', '#193ead'),\n\n border: token('color.border.default', '#929292'),\n borderStrong: token('color.border.strong', '#818181'),\n\n danger: token('color.status.danger.default', '#c8102e'),\n dangerText: token('color.status.danger.text', '#c8102e'),\n dangerSubtle: token('color.status.danger.subtle', '#f8e2e6'),\n warning: token('color.status.warning.default', '#b45309'),\n warningText: token('color.status.warning.text', '#b45309'),\n warningSubtle: token('color.status.warning.subtle', '#f6eae1'),\n success: token('color.status.success.default', '#047857'),\n successText: token('color.status.success.text', '#047857'),\n successSubtle: token('color.status.success.subtle', '#e0f0ea'),\n info: token('color.status.info.default', '#1f4ed8'),\n infoText: token('color.status.info.text', '#1f4ed8'),\n infoSubtle: token('color.status.info.subtle', '#e4eafa'),\n\n fontBody: token('font.family.body', 'system-ui, sans-serif'),\n fontHeading: token('font.family.heading', 'system-ui, sans-serif'),\n /** Code-like labels: hashes, branches, version lines. */\n fontMono: token('font.family.mono', 'ui-monospace, SFMono-Regular, Menlo, Consolas, monospace'),\n /** The small line above a heading: the body face, or the code face for a brand that asks. */\n fontEyebrow: token('font.family.eyebrow', 'inherit'),\n\n focusShadow: token('focus.ring.shadow', '0 0 0 2px #ffffff, 0 0 0 4px #1a1a1a'),\n focusOffset: token('focus.ring.offset', '2px'),\n\n targetMin: token('target.min', '24px'),\n\n radiusSm: token('radius.sm', '2px'),\n radius: token('radius.md', '4px'),\n radiusLg: token('radius.lg', '8px'),\n\n borderThin: token('border.width.thin', '1px'),\n borderThick: token('border.width.thick', '2px'),\n\n radiusXs: token('radius.xs', '2px'),\n radiusXl: token('radius.xl', '12px'),\n radius2xl: token('radius.2xl', '16px'),\n\n /** Hairline borders and rings, from the text colour, so they suit any surface. */\n hairline: unsafeCSS('color-mix(in srgb, var(--impkt-color-text-default, #1a1a1a) 10%, transparent)'),\n rule: unsafeCSS('color-mix(in srgb, var(--impkt-color-text-default, #1a1a1a) 15%, transparent)'),\n /** A wash of the text colour, for hover and pressed states on quiet controls. */\n wash: unsafeCSS('color-mix(in srgb, var(--impkt-color-text-default, #1a1a1a) 5%, transparent)'),\n /** The brand at a fifth, for focus halos round fields. */\n brandHalo: unsafeCSS('color-mix(in srgb, var(--impkt-color-brand-default, #1f4ed8) 22%, transparent)'),\n\n shadowXs: token('shadow.xs', '0 1px 2px 0 rgb(0 0 0 / 0.05)'),\n shadowSm: token('shadow.sm', '0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)'),\n shadowMd: token('shadow.md', '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)'),\n shadowLg: token('shadow.lg', '0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)'),\n shadowXl: token('shadow.xl', '0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)'),\n\n trackingTight: token('font.tracking.tight', '-0.02em'),\n trackingWide: token('font.tracking.wide', '0.06em'),\n} as const;\n\n/**\n * A size on the type scale with its own line height, so text drawn at\n * `type('xl')` has the leading that size reads best at.\n */\nexport const type = (name: string): CSSResult =>\n unsafeCSS(`font-size: var(--impkt-font-size-${name}, 1rem); line-height: var(--impkt-font-leading-${name}, 1.5);`);\n\n/** `space(3)` → `space.3`, `space(0.5)` → `space.0-5`. Spacing is always a token, never a number. */\nexport const space = (step: number): CSSResult => token(`space.${String(step).replace('.', '-')}`, `${step * 4}px`);\n/** `font.size.lg` → the custom property. */\nexport const fontSize = (name: string): CSSResult => token(`font.size.${name}`, '1rem');\nexport const lineHeight = (name: string): CSSResult => token(`font.line-height.${name}`, '1.5');\nexport const fontWeight = (name: string): CSSResult => token(`font.weight.${name}`, '400');\n\n/**\n * Space above and below a section, from the spacing scale: `none`, `sm`,\n * `md`, `lg` or `xl`, set by `space-above` and `space-below`. A section names\n * a step rather than a size, so a page keeps the brand's rhythm.\n */\nexport const spaceAround: CSSResult = css`\n :host([space-above='sm']) { margin-block-start: ${space(2)}; }\n :host([space-above='md']) { margin-block-start: ${space(4)}; }\n :host([space-above='lg']) { margin-block-start: ${space(6)}; }\n :host([space-above='xl']) { margin-block-start: ${space(8)}; }\n :host([space-above='2xl']) { margin-block-start: clamp(${space(14)}, 8vw, ${space(28)}); }\n :host([space-below='sm']) { margin-block-end: ${space(2)}; }\n :host([space-below='md']) { margin-block-end: ${space(4)}; }\n :host([space-below='lg']) { margin-block-end: ${space(6)}; }\n :host([space-below='xl']) { margin-block-end: ${space(8)}; }\n :host([space-below='2xl']) { margin-block-end: clamp(${space(14)}, 8vw, ${space(28)}); }\n`;\n","/**\n * Shared style fragments.\n *\n * Three of these carry an accessibility guarantee and are therefore not\n * negotiable per component: the focus ring, the minimum target size and the\n * reduced-motion rule. A component that wants its own focus treatment is a\n * component that will get it subtly wrong on one brand, so there is one.\n */\nimport { css } from 'lit';\nimport { t } from './tokens';\n\n/**\n * The focus ring.\n *\n * `:focus-visible` rather than `:focus`, so a mouse click on a button does not\n * draw a ring the user did not ask for while keyboard focus still does.\n *\n * The ring is two-tone — a light inner band inside a dark outer one — drawn\n * with `box-shadow` and a transparent `outline` behind it. The outline is not\n * decoration: it is what survives Windows High Contrast Mode, where box-shadow\n * is dropped entirely and a shadow-only ring disappears for exactly the users\n * who most need it.\n *\n * The colours come from locked tokens a brand cannot reach\n * ([ADR 0010](https://github.com/matthill8286/strata/blob/main/docs/decisions/0010-what-a-brand-may-set.md)).\n */\nexport const focusRing = css`\n :host(:focus-visible),\n :host(:not([disabled])) :focus-visible {\n outline: 2px solid transparent;\n outline-offset: ${t.focusOffset};\n box-shadow: ${t.focusShadow};\n }\n`;\n\n/**\n * WCAG 2.2, 2.5.8 Target Size (Minimum): 24 by 24 CSS pixels.\n *\n * Applied as a minimum rather than a fixed size so a control grows with its\n * content and never shrinks below the floor. It reads the locked token, which\n * is deliberately outside the spacing scale — otherwise a brand tightening its\n * spacing unit would shrink every tap target with it.\n */\nexport const targetSize = css`\n min-block-size: ${t.targetMin};\n min-inline-size: ${t.targetMin};\n`;\n\n/**\n * Visible to a screen reader, invisible on screen.\n *\n * `clip-path` with a 1px box rather than `display: none` or `visibility:\n * hidden`, both of which remove the text from the accessibility tree — which\n * is the one thing this must not do.\n */\nexport const visuallyHidden = css`\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n`;\n\n/**\n * 2.3.3 Animation from Interactions, and plain decency.\n *\n * `0.01ms` rather than `0` because a zero-duration transition does not fire a\n * `transitionend` event in every engine, and components that wait for one hang.\n */\nexport const reducedMotion = css`\n @media (prefers-reduced-motion: reduce) {\n :host,\n :host *,\n :host *::before,\n :host *::after {\n animation-duration: 0.01ms !important;\n animation-iteration-count: 1 !important;\n transition-duration: 0.01ms !important;\n scroll-behavior: auto !important;\n }\n }\n`;\n\n/** The base every component starts from. */\nexport const base = css`\n :host {\n box-sizing: border-box;\n font-family: ${t.fontBody};\n color: ${t.text};\n }\n :host([hidden]) {\n display: none !important;\n }\n *,\n *::before,\n *::after {\n box-sizing: inherit;\n }\n`;\n","/**\n * The library's own words, in the page's language (ADR 0026).\n *\n * Every word a component shows that a page did not give it, such as \"Skip to\n * content\", \"Next slide\" or \"There is a problem\", goes through `say`. The\n * renderer puts the site's wording in place before it draws a page\n * (`applySiteLanguage` in `@atomic-ui/renderer-core`), translated into the page's\n * language and with any of the site's own rewording. Without it, the English\n * here is shown, which is what every site did before it had languages.\n *\n * The English is the key, with `{name}` for a value put in, so the list of\n * words to translate (`SITE_WORDING` in `@atomic-ui/content-schemas`) can be\n * checked against this library by a test.\n */\nconst WORDING = Symbol.for('strata.wording');\n\ntype Store = { words?: Record<string, string> };\n\nexport function say(english: string, values?: Record<string, string | number>): string {\n const words = ((globalThis as Record<symbol, Store | undefined>)[WORDING])?.words;\n const chosen = words?.[english];\n const text = typeof chosen === 'string' && chosen.trim() ? chosen : english;\n return values ? text.replace(/\\{(\\w+)\\}/g, (whole, name: string) => (name in values ? String(values[name]) : whole)) : text;\n}\n","import { LitElement, css } from 'lit';\nimport { base, reducedMotion } from './styles';\nimport { say } from './say';\n\nlet counter = 0;\n\n/**\n * The base every Impkt component extends.\n *\n * It carries the two style fragments that are not a per-component choice — the\n * reset and the reduced-motion rule — and a stable id generator for the ARIA\n * wiring. It deliberately carries nothing else: a base class that grows\n * behaviour becomes the place every component's exceptions are negotiated.\n */\nexport class ImpktElement extends LitElement {\n static styles = [base, reducedMotion, css``];\n\n /**\n * A unique id for this instance, for `aria-describedby` and friends.\n *\n * Generated once in the constructor rather than in `render`, because an id\n * that changes between renders breaks the relationship it exists to express\n * — and it breaks it silently, since the markup still looks correct.\n */\n protected readonly uid = `impkt-${(counter += 1)}`;\n\n protected id_(part: string): string {\n return `${this.uid}-${part}`;\n }\n\n /** @ignore */\n connectedCallback(): void {\n super.connectedCallback();\n this.sayDefaults();\n }\n\n /**\n * The words a component ships with, in the page's language (ADR 0026).\n *\n * Defaults stay plain English in the constructor, so the component manifest\n * still sees them (a prop with no default is read as required). When the\n * element joins the page, each word it holds is looked up in the site's\n * wording; anything that is not one of Strata's own words, such as a page's\n * own text or a variant name, is left exactly as it is.\n *\n * @ignore\n */\n private sayDefaults(): void {\n const props = (this.constructor as typeof LitElement).elementProperties;\n const self = this as unknown as Record<string, unknown>;\n for (const name of props.keys()) {\n const value = self[name as string];\n if (typeof value !== 'string' || !value) continue;\n const said = say(value);\n if (said !== value) self[name as string] = said;\n }\n }\n}\n"],"mappings":";AAmBA,SAAS,KAAK,iBAAiC;AAGxC,IAAM,QAAQ,CAAC,MAAc,aAClC,UAAU,eAAe,KAAK,QAAQ,OAAO,GAAG,CAAC,KAAK,QAAQ,GAAG;AAE5D,IAAM,IAAI;AAAA,EACf,OAAO,MAAM,uBAAuB,SAAS;AAAA,EAC7C,YAAY,MAAM,qBAAqB,SAAS;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IAAI,UAAU;AAUP,IAAM,eAAN,cAA2B,WAAW;AAAA,EAAtC;AAAA;AAUL;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAmB,MAAM,SAAU,WAAW,CAAE;AAAA;AAAA,EAThD;AAAA,SAAO,SAAS,CAAC,MAAM,eAAeC,MAAK;AAAA;AAAA,EAWjC,IAAI,MAAsB;AAClC,WAAO,GAAG,KAAK,GAAG,IAAI,IAAI;AAAA,EAC5B;AAAA;AAAA,EAGA,oBAA0B;AACxB,UAAM,kBAAkB;AACxB,SAAK,YAAY;AAAA,EACnB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaQ,cAAoB;AAC1B,UAAM,QAAS,KAAK,YAAkC;AACtD,UAAM,OAAO;AACb,eAAW,QAAQ,MAAM,KAAK,GAAG;AAC/B,YAAM,QAAQ,KAAK,IAAc;AACjC,UAAI,OAAO,UAAU,YAAY,CAAC,MAAO;AACzC,YAAM,OAAO,IAAI,KAAK;AACtB,UAAI,SAAS,MAAO,MAAK,IAAc,IAAI;AAAA,IAC7C;AAAA,EACF;AACF;","names":["css","css","css","css"]}
@@ -1,30 +1,35 @@
1
1
  import {
2
2
  FieldElement,
3
3
  fieldWidths
4
- } from "./chunk-7BIQ3K6H.js";
4
+ } from "./chunk-7AJN2TIS.js";
5
5
  import {
6
6
  fontSize,
7
7
  space,
8
8
  t
9
- } from "./chunk-NTNXHLTM.js";
9
+ } from "./chunk-D6C7XEY4.js";
10
10
 
11
11
  // packages/ui/src/components/textarea.ts
12
12
  import { html, css, nothing } from "lit";
13
13
  var ImpktTextarea = class extends FieldElement {
14
+ constructor() {
15
+ super();
16
+ this.filled = false;
17
+ /** The estimate it was filled with, kept until the visitor edits it, so a binding that has not caught up yet cannot empty the box. */
18
+ this.filledText = "";
19
+ this.width = "full";
20
+ this.rows = 4;
21
+ this.maxlength = void 0;
22
+ this.fillFrom = "none";
23
+ }
14
24
  static {
15
25
  this.properties = {
16
26
  ...FieldElement.properties,
17
27
  width: { type: String, reflect: true },
18
28
  rows: { type: Number },
19
- maxlength: { type: Number }
29
+ maxlength: { type: Number },
30
+ fillFrom: { type: String, attribute: "fill-from" }
20
31
  };
21
32
  }
22
- constructor() {
23
- super();
24
- this.width = "full";
25
- this.rows = 4;
26
- this.maxlength = void 0;
27
- }
28
33
  static {
29
34
  this.styles = [
30
35
  ...FieldElement.styles,
@@ -36,10 +41,10 @@ var ImpktTextarea = class extends FieldElement {
36
41
  font-family: inherit;
37
42
  font-size: ${fontSize("md")};
38
43
  color: ${t.text};
39
- background: ${t.surfaceCard};
44
+ background: var(--impkt-color-field-surface, ${t.surfaceCard});
40
45
  border: ${t.borderThin} solid ${t.border};
41
46
  border-radius: ${t.radiusLg};
42
- box-shadow: ${t.shadowXs};
47
+ box-shadow: var(--impkt-shadow-field, ${t.shadowXs});
43
48
  transition: border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;
44
49
  /* Resizing is left on deliberately. 1.4.4 and 1.4.12 both assume text
45
50
  can be made bigger, and a fixed box is where that stops working. */
@@ -59,6 +64,27 @@ var ImpktTextarea = class extends FieldElement {
59
64
  `
60
65
  ];
61
66
  }
67
+ /** @ignore */
68
+ willUpdate(changed) {
69
+ super.willUpdate?.(changed);
70
+ if (this.filledText && changed.has("value") && !this.value) this.value = this.filledText;
71
+ }
72
+ /** Fills the box once, when it is first asked to and is still empty. Props can arrive after the element joins the page. */
73
+ fill() {
74
+ if (this.filled || this.fillFrom !== "estimate") return;
75
+ this.filled = true;
76
+ if (this.value) return;
77
+ let saved = null;
78
+ try {
79
+ saved = sessionStorage.getItem("strata.estimate");
80
+ } catch {
81
+ saved = null;
82
+ }
83
+ if (saved) {
84
+ this.filledText = saved;
85
+ this.setFormValue(saved);
86
+ }
87
+ }
62
88
  renderControl() {
63
89
  return html`
64
90
  <textarea
@@ -72,12 +98,16 @@ var ImpktTextarea = class extends FieldElement {
72
98
  ?required=${this.required}
73
99
  aria-describedby=${this.describedBy}
74
100
  aria-invalid=${this.error ? "true" : nothing}
75
- @input=${(e) => this.setFormValue(e.target.value)}
101
+ @input=${(e) => {
102
+ this.filledText = "";
103
+ this.setFormValue(e.target.value);
104
+ }}
76
105
  >${this.value}</textarea>
77
106
  `;
78
107
  }
79
108
  updated(changed) {
80
109
  if (changed.has("error")) this.toggleAttribute("invalid", Boolean(this.error));
110
+ this.fill();
81
111
  }
82
112
  };
83
113
  customElements.define("impkt-textarea", ImpktTextarea);
@@ -85,4 +115,4 @@ customElements.define("impkt-textarea", ImpktTextarea);
85
115
  export {
86
116
  ImpktTextarea
87
117
  };
88
- //# sourceMappingURL=chunk-C36CZRHK.js.map
118
+ //# sourceMappingURL=chunk-E2VBUWJ4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/textarea.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { FieldElement, fieldWidths } from '../base/FieldElement';\nimport { fontSize, space, t } from '../base/tokens';\n\n/** Several lines of text — a delivery instruction, an additional note.\n *\n * @category form\n * @icon field\n */\nexport class ImpktTextarea extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n width: { type: String, reflect: true },\n rows: { type: Number },\n maxlength: { type: Number },\n fillFrom: { type: String, attribute: 'fill-from' },\n };\n\n declare rows: number;\n declare maxlength: number | undefined;\n /** `estimate` starts an empty box with the estimate a cost estimator sent on, so the visitor can edit it. */\n declare fillFrom: 'none' | 'estimate';\n\n /** How wide the box is, to suit the answer. Full width on a phone whatever this says. */\n declare width: 'full' | 'lg' | 'md' | 'sm' | 'xs';\n\n constructor() {\n super();\n this.width = 'full';\n this.rows = 4;\n this.maxlength = undefined;\n this.fillFrom = 'none';\n }\n\n static styles = [\n ...FieldElement.styles,\n fieldWidths,\n css`\n textarea {\n inline-size: min(100%, var(--impkt-field-width));\n padding: ${space(2.5)} ${space(3)};\n font-family: inherit;\n font-size: ${fontSize('md')};\n color: ${t.text};\n background: var(--impkt-color-field-surface, ${t.surfaceCard});\n border: ${t.borderThin} solid ${t.border};\n border-radius: ${t.radiusLg};\n box-shadow: var(--impkt-shadow-field, ${t.shadowXs});\n transition: border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;\n /* Resizing is left on deliberately. 1.4.4 and 1.4.12 both assume text\n can be made bigger, and a fixed box is where that stops working. */\n resize: vertical;\n }\n textarea:hover:not(:disabled) {\n border-color: ${t.borderStrong};\n }\n textarea:focus-visible {\n border-color: ${t.brand};\n box-shadow: ${t.focusShadow}, 0 0 0 6px ${t.brandHalo};\n }\n :host([invalid]) textarea {\n border-color: ${t.danger};\n border-width: ${t.borderThick};\n }\n `,\n ];\n\n private filled = false;\n /** The estimate it was filled with, kept until the visitor edits it, so a binding that has not caught up yet cannot empty the box. */\n private filledText = '';\n\n /** @ignore */\n protected willUpdate(changed: Map<string, unknown>): void {\n super.willUpdate?.(changed as never);\n if (this.filledText && changed.has('value') && !this.value) this.value = this.filledText;\n }\n\n /** Fills the box once, when it is first asked to and is still empty. Props can arrive after the element joins the page. */\n private fill(): void {\n if (this.filled || this.fillFrom !== 'estimate') return;\n this.filled = true;\n if (this.value) return;\n let saved: string | null = null;\n try { saved = sessionStorage.getItem('strata.estimate'); } catch { saved = null; }\n if (saved) { this.filledText = saved; this.setFormValue(saved); }\n }\n\n protected renderControl(): TemplateResult {\n return html`\n <textarea\n id=${this.controlId}\n part=\"textarea\"\n name=${this.name || nothing}\n rows=${this.rows}\n maxlength=${this.maxlength ?? nothing}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?required=${this.required}\n aria-describedby=${this.describedBy}\n aria-invalid=${this.error ? 'true' : nothing}\n @input=${(e: Event) => { this.filledText = ''; this.setFormValue((e.target as HTMLTextAreaElement).value); }}\n >${this.value}</textarea>\n `;\n }\n\n updated(changed: Map<string, unknown>): void {\n if (changed.has('error')) this.toggleAttribute('invalid', Boolean(this.error));\n this.fill();\n }\n}\n\ncustomElements.define('impkt-textarea', ImpktTextar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AAC,KAAK,MAAO,MAAK,QAAQ,KAAK;AAAA,EAChF;AAAA;AAAA,EAGQ,OAAa;AACnB,QAAI,KAAK,UAAU,KAAK,aAAa,WAAY;AACjD,SAAK,SAAS;AACd,QAAI,KAAK,MAAO;AAChB,QAAI,QAAuB;AAC3B,QAAI;AAAE,cAAQ,eAAe,QAAQ,iBAAiB;AAAA,IAAG,QAAQ;AAAE,cAAQ;AAAA,IAAM;AACjF,QAAI,OAAO;AAAE,WAAK,aAAa;AAAO,WAAK,aAAa,KAAK;AAAA,IAAG;AAAA,EAClE;AAAA,EAEU,gBAAgC;AACxC,WAAO;AAAA;AAAA,aAEE,KAAK,SAAS;AAAA;AAAA,eAEZ,KAAK,QAAQ,OAAO;AAAA,eACpB,KAAK,IAAI;AAAA,oBACJ,KAAK,aAAa,OAAO;AAAA,oBACzB,KAAK,QAAQ;AAAA,oBACb,KAAK,QAAQ;AAAA,oBACb,KAAK,QAAQ;AAAA,2BACN,KAAK,WAAW;AAAA,uBACpB,KAAK,QAAQ,SAAS,OAAO;AAAA,iBACnC,CAAC,MAAa;AAAE,WAAK,aAAa;AAAI,WAAK,aAAc,EAAE,OAA+B,KAAK;AAAA,IAAG,CAAC;AAAA,SAC3G,KAAK,KAAK;AAAA;AAAA,EAEjB;AAAA,EAEA,QAAQ,SAAqC;AAC3C,QAAI,QAAQ,IAAI,OAAO,EAAG,MAAK,gBAAgB,WAAW,QAAQ,KAAK,KAAK,CAAC;AAC7E,SAAK,KAAK;AAAA,EACZ;AACF;AAEA,eAAe,OAAO,kBAAkB,aAAa;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  iconSvg
3
- } from "./chunk-2YQA3VBY.js";
3
+ } from "./chunk-KFD4O7VA.js";
4
4
  import {
5
5
  ImpktElement,
6
6
  focusRing,
@@ -10,7 +10,7 @@ import {
10
10
  targetSize,
11
11
  type,
12
12
  visuallyHidden
13
- } from "./chunk-NTNXHLTM.js";
13
+ } from "./chunk-D6C7XEY4.js";
14
14
 
15
15
  // packages/ui/src/components/button.ts
16
16
  import { html, css, nothing } from "lit";
@@ -25,6 +25,7 @@ var ImpktButton = class extends ImpktElement {
25
25
  this.busy = false;
26
26
  this.busyLabel = "Working";
27
27
  this.full = false;
28
+ this.fullOnPhone = false;
28
29
  this.size = "md";
29
30
  this.iconBefore = "none";
30
31
  this.iconAfter = "none";
@@ -47,6 +48,7 @@ var ImpktButton = class extends ImpktElement {
47
48
  busy: { type: Boolean, reflect: true },
48
49
  busyLabel: { type: String, attribute: "busy-label" },
49
50
  full: { type: Boolean, reflect: true },
51
+ fullOnPhone: { type: Boolean, attribute: "full-on-phone", reflect: true },
50
52
  size: { type: String, reflect: true },
51
53
  iconBefore: { type: String, attribute: "icon-before" },
52
54
  iconAfter: { type: String, attribute: "icon-after" },
@@ -65,6 +67,7 @@ var ImpktButton = class extends ImpktElement {
65
67
  :host([full]) {
66
68
  display: block;
67
69
  }
70
+ @media (max-width: 40rem) { :host([full-on-phone]) { display: block; } }
68
71
  button, a {
69
72
  ${targetSize}
70
73
  box-sizing: border-box;
@@ -104,8 +107,13 @@ var ImpktButton = class extends ImpktElement {
104
107
  box-shadow: ${t.shadowXs}, inset 0 1px 0 0 rgb(255 255 255 / 0.12);
105
108
  }
106
109
  .primary:hover:not([aria-disabled='true']) {
107
- background: ${t.brandHover};
110
+ background: var(--impkt-color-action-hover, ${t.brandHover});
111
+ color: var(--impkt-color-action-on-hover, ${t.onBrand});
108
112
  }
113
+ /* A brand whose buttons turn on hover lifts the trailing arrow a quarter-turn. */
114
+ .after { transition: transform 160ms ease-out; }
115
+ :is(button, a):hover:not([aria-disabled='true']) .after { transform: rotate(var(--impkt-motion-button-turn, 0deg)); }
116
+ @media (prefers-reduced-motion: reduce) { .after { transition: none; } }
109
117
  .primary:active:not([aria-disabled='true']) {
110
118
  background: ${t.brandActive};
111
119
  }
@@ -156,7 +164,7 @@ var ImpktButton = class extends ImpktElement {
156
164
  if (this.type === "reset") this.internals?.form?.reset();
157
165
  }
158
166
  render() {
159
- const words = html`${iconSvg(this.iconBefore)}<slot></slot>${iconSvg(this.iconAfter)}`;
167
+ const words = html`${iconSvg(this.iconBefore)}<slot></slot>${this.iconAfter && this.iconAfter !== "none" ? html`<span class="after" aria-hidden="true">${iconSvg(this.iconAfter)}</span>` : nothing}`;
160
168
  if (this.href && !this.disabled) {
161
169
  return html`<a class=${this.variant} href=${this.href} part="button">${words}</a>`;
162
170
  }
@@ -181,4 +189,4 @@ customElements.define("impkt-button", ImpktButton);
181
189
  export {
182
190
  ImpktButton
183
191
  };
184
- //# sourceMappingURL=chunk-XJP45LFA.js.map
192
+ //# sourceMappingURL=chunk-E3XJK7MY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/button.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { focusRing, targetSize, visuallyHidden } from '../base/styles';\nimport { fontWeight, space, t, type } from '../base/tokens';\nimport { iconSvg } from './icon';\n\n/**\n * A button.\n *\n * Two decisions carry the accessibility weight here.\n *\n * **A busy button is not a disabled button.** While an action is in flight the\n * control keeps its place in the tab order and reports `aria-disabled`, rather\n * than taking the native `disabled` attribute. A natively disabled element is\n * removed from the tab order, so a keyboard user who had just activated it\n * loses their focus position to the top of the document — at precisely the\n * moment something is happening that they need to be told about. Activation is\n * blocked in the handler instead.\n *\n * **It renders a real `<button>`.** A `<div role=\"button\">` needs Enter and\n * Space handling, a tabindex, and a disabled story, and it will still not\n * submit a form. The native element already has all of that, correctly, in\n * every browser and every assistive technology.\n\n *\n * **A button that goes somewhere is a link.** With `href` set it renders an\n * `<a>` styled as a button, so it opens in a new tab, shows its address and is\n * announced as a link, which is what it is.\n *\n * @category action\n * @icon button\n * @slot - The button label.\n * @fires click - When the button is pressed. Not while it is busy or disabled.\n */\nexport class ImpktButton extends ImpktElement {\n static formAssociated = true;\n\n static properties = {\n hideOn: { type: String, reflect: true, attribute: 'hide-on' },\n variant: { type: String, reflect: true },\n type: { type: String },\n disabled: { type: Boolean, reflect: true },\n busy: { type: Boolean, reflect: true },\n busyLabel: { type: String, attribute: 'busy-label' },\n full: { type: Boolean, reflect: true },\n fullOnPhone: { type: Boolean, attribute: 'full-on-phone', reflect: true },\n size: { type: String, reflect: true },\n iconBefore: { type: String, attribute: 'icon-before' },\n iconAfter: { type: String, attribute: 'icon-after' },\n href: { type: String },\n };\n\n /** Leave it out on a phone, where a header has no room for it. */\n declare hideOn: 'never' | 'phone';\n declare variant: 'primary' | 'secondary' | 'ghost';\n declare type: 'button' | 'submit' | 'reset';\n declare disabled: boolean;\n declare busy: boolean;\n /** Announced when the button becomes busy. Says what is happening, not that something is. */\n declare busyLabel: string;\n declare full: boolean;\n /** As wide as its space on a phone only, such as a form's send button. */\n declare fullOnPhone: boolean;\n declare size: 'sm' | 'md' | 'lg';\n /** An icon before the words, such as phone or calendar. */\n declare iconBefore: 'none' | 'arrow-right' | 'arrow-left' | 'chevron-right' | 'chevron-down' | 'check' | 'close' | 'menu' | 'plus' | 'minus' | 'search' | 'external' | 'download' | 'home' | 'phone' | 'mail' | 'map-pin' | 'calendar' | 'clock' | 'user' | 'star' | 'heart' | 'shield' | 'leaf' | 'sun' | 'bolt' | 'key' | 'info' | 'warning' | 'document' | 'pound' | 'chat';\n /** An icon after the words, such as arrow-right. */\n declare iconAfter: 'none' | 'arrow-right' | 'arrow-left' | 'chevron-right' | 'chevron-down' | 'check' | 'close' | 'menu' | 'plus' | 'minus' | 'search' | 'external' | 'download' | 'home' | 'phone' | 'mail' | 'map-pin' | 'calendar' | 'clock' | 'user' | 'star' | 'heart' | 'shield' | 'leaf' | 'sun' | 'bolt' | 'key' | 'info' | 'warning' | 'document' | 'pound' | 'chat';\n /** Where the button goes, when it opens a page rather than doing something here. */\n declare href: string;\n\n private internals: ElementInternals | null = null;\n\n constructor() {\n super();\n this.hideOn = 'never';\n this.variant = 'primary';\n this.type = 'button';\n this.disabled = false;\n this.busy = false;\n this.busyLabel = 'Working';\n this.full = false;\n this.fullOnPhone = false;\n this.size = 'md';\n this.iconBefore = 'none';\n this.iconAfter = 'none';\n this.href = '';\n try {\n this.internals = this.attachInternals();\n } catch {\n this.internals = null;\n }\n }\n\n static styles = [\n ...ImpktElement.styles,\n focusRing,\n css`\n @media (max-width: 40rem) { :host([hide-on='phone']) { display: none; } }\n :host {\n display: inline-block;\n }\n :host([full]) {\n display: block;\n }\n @media (max-width: 40rem) { :host([full-on-phone]) { display: block; } }\n button, a {\n ${targetSize}\n box-sizing: border-box;\n text-decoration: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: ${space(2)};\n inline-size: 100%;\n min-block-size: 40px;\n padding: ${space(2)} ${space(4)};\n font-family: inherit;\n ${type('sm')}\n font-weight: ${fontWeight('semibold')};\n border-radius: ${t.radiusLg};\n border: ${t.borderThin} solid transparent;\n cursor: pointer;\n transition: background-color 120ms ease-in-out, border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;\n }\n :host([size='sm']) :is(button, a) { min-block-size: 32px; padding: ${space(1)} ${space(3)}; ${type('sm')} gap: ${space(1.5)}; }\n :host([size='lg']) :is(button, a) { min-block-size: 48px; padding: ${space(3)} ${space(6)}; ${type('md')} }\n .icon { flex: none; inline-size: 1.15em; block-size: 1.15em; }\n /* The cursor is the only thing that changes while busy. Moving or\n recolouring a control the moment it is pressed is how a user loses it. */\n button[aria-disabled='true'] {\n cursor: progress;\n }\n :host([disabled]) button {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n /* Solid: the brand, with a hairline highlight along the top edge. */\n .primary {\n background: ${t.brand};\n color: ${t.onBrand};\n box-shadow: ${t.shadowXs}, inset 0 1px 0 0 rgb(255 255 255 / 0.12);\n }\n .primary:hover:not([aria-disabled='true']) {\n background: var(--impkt-color-action-hover, ${t.brandHover});\n color: var(--impkt-color-action-on-hover, ${t.onBrand});\n }\n /* A brand whose buttons turn on hover lifts the trailing arrow a quarter-turn. */\n .after { transition: transform 160ms ease-out; }\n :is(button, a):hover:not([aria-disabled='true']) .after { transform: rotate(var(--impkt-motion-button-turn, 0deg)); }\n @media (prefers-reduced-motion: reduce) { .after { transition: none; } }\n .primary:active:not([aria-disabled='true']) {\n background: ${t.brandActive};\n }\n\n /* Outline: the card, a hairline border and the text colour, for the second choice. */\n .secondary {\n background: ${t.surfaceCard};\n color: ${t.text};\n border-color: ${t.rule};\n box-shadow: ${t.shadowXs};\n }\n .secondary:hover:not([aria-disabled='true']) {\n background: color-mix(in srgb, ${t.surfaceCard}, ${t.text} 4%);\n border-color: color-mix(in srgb, ${t.text} 25%, transparent);\n }\n\n /* Plain: words only until it is pointed at. */\n .ghost {\n background: transparent;\n color: ${t.link};\n }\n .ghost:hover:not([aria-disabled='true']) {\n background: ${t.wash};\n }\n\n .sr-only {\n ${visuallyHidden}\n }\n\n /* Windows High Contrast Mode drops background and border colours, so a\n button styled only by background becomes invisible. A forced-colors\n border puts the boundary back. */\n @media (forced-colors: active) {\n button, a {\n border-color: ButtonBorder;\n }\n }\n `,\n ];\n\n private onClick(event: MouseEvent): void {\n if (this.disabled || this.busy) {\n event.preventDefault();\n event.stopImmediatePropagation();\n return;\n }\n // A shadow-rooted button does not submit the outer form by itself, because\n // the click never reaches it. `requestSubmit` rather than `submit` so that\n // native validation and the submit event both still run.\n if (this.type === 'submit') this.internals?.form?.requestSubmit();\n if (this.type === 'reset') this.internals?.form?.reset();\n }\n\n render(): TemplateResult {\n const words = html`${iconSvg(this.iconBefore)}<slot></slot>${this.iconAfter && this.iconAfter !== 'none' ? html`<span class=\"after\" aria-hidden=\"true\">${iconSvg(this.iconAfter)}</span>` : nothing}`;\n if (this.href && !this.disabled) {\n return html`<a class=${this.variant} href=${this.href} part=\"button\">${words}</a>`;\n }\n return html`\n <button\n class=${this.variant}\n type=\"button\"\n part=\"button\"\n ?disabled=${this.disabled}\n aria-disabled=${this.busy ? 'true' : nothing}\n aria-busy=${this.busy ? 'true' : nothing}\n @click=${this.onClick}\n >\n ${words}\n ${this.busy ? html`<span class=\"sr-only\">${this.busyLabel}</span>` : nothing}\n </button>\n `;\n }\n}\n\ncustomElements.define('impkt-button', ImpktButton);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impkt-button': ImpktButton;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AAkCjD,IAAM,cAAN,cAA0B,aAAa;AAAA,EAuC5C,cAAc;AACZ,UAAM;AAHR,SAAQ,YAAqC;AAI3C,SAAK,SAAS;AACd,SAAK,UAAU;AACf,SAAK,OAAO;AACZ,SAAK,WAAW;AAChB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,OAAO;AACZ,SAAK,cAAc;AACnB,SAAK,OAAO;AACZ,SAAK,aAAa;AAClB,SAAK,YAAY;AACjB,SAAK,OAAO;AACZ,QAAI;AACF,WAAK,YAAY,KAAK,gBAAgB;AAAA,IACxC,QAAQ;AACN,WAAK,YAAY;AAAA,IACnB;AAAA,EACF;AAAA,EAzDA;AAAA,SAAO,iBAAiB;AAAA;AAAA,EAExB;AAAA,SAAO,aAAa;AAAA,MAClB,QAAQ,EAAE,MAAM,QAAQ,SAAS,MAAM,WAAW,UAAU;AAAA,MAC5D,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACvC,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,UAAU,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,MACzC,MAAM,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,MACrC,WAAW,EAAE,MAAM,QAAQ,WAAW,aAAa;AAAA,MACnD,MAAM,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,MACrC,aAAa,EAAE,MAAM,SAAS,WAAW,iBAAiB,SAAS,KAAK;AAAA,MACxE,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACpC,YAAY,EAAE,MAAM,QAAQ,WAAW,cAAc;AAAA,MACrD,WAAW,EAAE,MAAM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