@atomic-ui/blocks 0.0.0-stage → 0.7.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.
- package/README.md +77 -2
- package/custom-elements.json +8688 -0
- package/dist/chunk-4JW2CHWS.js +708 -0
- package/dist/chunk-4JW2CHWS.js.map +1 -0
- package/dist/chunk-AFN7IAG2.js +379 -0
- package/dist/chunk-AFN7IAG2.js.map +1 -0
- package/dist/chunk-F4BTXUYP.js +65 -0
- package/dist/chunk-F4BTXUYP.js.map +1 -0
- package/dist/chunk-MYTYMOH6.js +193 -0
- package/dist/chunk-MYTYMOH6.js.map +1 -0
- package/dist/chunk-OTOFULMT.js +465 -0
- package/dist/chunk-OTOFULMT.js.map +1 -0
- package/dist/chunk-PORKVHAX.js +255 -0
- package/dist/chunk-PORKVHAX.js.map +1 -0
- package/dist/chunk-T7U4OPTW.js +413 -0
- package/dist/chunk-T7U4OPTW.js.map +1 -0
- package/dist/chunk-WHENVU5E.js +318 -0
- package/dist/chunk-WHENVU5E.js.map +1 -0
- package/dist/chunk-XHFUTZGU.js +228 -0
- package/dist/chunk-XHFUTZGU.js.map +1 -0
- package/dist/chunk-XJMKAK2I.js +442 -0
- package/dist/chunk-XJMKAK2I.js.map +1 -0
- package/dist/components/card-grid.d.ts +72 -0
- package/dist/components/card-grid.js +7 -0
- package/dist/components/card-grid.js.map +1 -0
- package/dist/components/changelog.d.ts +373 -0
- package/dist/components/changelog.js +16 -0
- package/dist/components/changelog.js.map +1 -0
- package/dist/components/estimator.d.ts +246 -0
- package/dist/components/estimator.js +11 -0
- package/dist/components/estimator.js.map +1 -0
- package/dist/components/marketing.d.ts +342 -0
- package/dist/components/marketing.js +17 -0
- package/dist/components/marketing.js.map +1 -0
- package/dist/components/organisms.d.ts +559 -0
- package/dist/components/organisms.js +23 -0
- package/dist/components/organisms.js.map +1 -0
- package/dist/components/property.d.ts +389 -0
- package/dist/components/property.js +17 -0
- package/dist/components/property.js.map +1 -0
- package/dist/components/scene.d.ts +138 -0
- package/dist/components/scene.js +7 -0
- package/dist/components/scene.js.map +1 -0
- package/dist/components/scrubber.d.ts +86 -0
- package/dist/components/scrubber.js +7 -0
- package/dist/components/scrubber.js.map +1 -0
- package/dist/components/selling.d.ts +409 -0
- package/dist/components/selling.js +23 -0
- package/dist/components/selling.js.map +1 -0
- package/dist/components/site.d.ts +235 -0
- package/dist/components/site.js +11 -0
- package/dist/components/site.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +114 -0
- package/dist/index.js.map +1 -0
- package/dist/standalone/atomic-ui-blocks.js +1229 -0
- package/dist/standalone/atomic-ui-blocks.js.map +7 -0
- package/dist/standalone/index.html +78 -0
- package/package.json +64 -3
- package/scripts/copy-to-product.mjs +59 -0
- package/specimen/index.html +78 -0
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
import { type TemplateResult } from 'lit';
|
|
2
|
+
import { ImpaktElement } from '@atomic-ui/ui';
|
|
3
|
+
export interface SitePlot {
|
|
4
|
+
id?: string;
|
|
5
|
+
/** What is printed on the pin, such as 14. */
|
|
6
|
+
number: string;
|
|
7
|
+
/** The house type, such as The Hawthorn. */
|
|
8
|
+
name?: string;
|
|
9
|
+
status: 'available' | 'reserved' | 'sold';
|
|
10
|
+
price?: string;
|
|
11
|
+
beds?: string;
|
|
12
|
+
/** How far across the plan the pin sits, from 0 to 100. */
|
|
13
|
+
x: number | string;
|
|
14
|
+
/** How far down the plan the pin sits, from 0 to 100. */
|
|
15
|
+
y: number | string;
|
|
16
|
+
href?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A drawing of the development with a pin on every plot. Choose a pin to see
|
|
20
|
+
* whether it is available, what it costs and where to go next.
|
|
21
|
+
*
|
|
22
|
+
* Every pin is a button named in full, such as "Plot 14, The Hawthorn,
|
|
23
|
+
* Available, £385,000". Status is shown by the pin's shape as well as its
|
|
24
|
+
* colour, so it does not rely on colour alone (1.4.1).
|
|
25
|
+
*
|
|
26
|
+
* @category content
|
|
27
|
+
* @icon map
|
|
28
|
+
* @fires {CustomEvent<{ plot: SitePlot }>} impakt-select - When a plot is chosen. The plot is in detail.plot.
|
|
29
|
+
*/
|
|
30
|
+
export declare class ImpaktSitePlan extends ImpaktElement {
|
|
31
|
+
static properties: {
|
|
32
|
+
imageSrc: {
|
|
33
|
+
type: StringConstructor;
|
|
34
|
+
attribute: string;
|
|
35
|
+
};
|
|
36
|
+
imageAlt: {
|
|
37
|
+
type: StringConstructor;
|
|
38
|
+
attribute: string;
|
|
39
|
+
};
|
|
40
|
+
plots: {
|
|
41
|
+
type: ArrayConstructor;
|
|
42
|
+
};
|
|
43
|
+
hint: {
|
|
44
|
+
type: StringConstructor;
|
|
45
|
+
};
|
|
46
|
+
selectedPlot: {
|
|
47
|
+
type: StringConstructor;
|
|
48
|
+
attribute: string;
|
|
49
|
+
};
|
|
50
|
+
panel: {
|
|
51
|
+
type: StringConstructor;
|
|
52
|
+
reflect: boolean;
|
|
53
|
+
};
|
|
54
|
+
plotWord: {
|
|
55
|
+
type: StringConstructor;
|
|
56
|
+
attribute: string;
|
|
57
|
+
};
|
|
58
|
+
actionText: {
|
|
59
|
+
type: StringConstructor;
|
|
60
|
+
attribute: string;
|
|
61
|
+
};
|
|
62
|
+
availableText: {
|
|
63
|
+
type: StringConstructor;
|
|
64
|
+
attribute: string;
|
|
65
|
+
};
|
|
66
|
+
reservedText: {
|
|
67
|
+
type: StringConstructor;
|
|
68
|
+
attribute: string;
|
|
69
|
+
};
|
|
70
|
+
soldText: {
|
|
71
|
+
type: StringConstructor;
|
|
72
|
+
attribute: string;
|
|
73
|
+
};
|
|
74
|
+
spaceAbove: {
|
|
75
|
+
type: StringConstructor;
|
|
76
|
+
reflect: boolean;
|
|
77
|
+
attribute: string;
|
|
78
|
+
};
|
|
79
|
+
spaceBelow: {
|
|
80
|
+
type: StringConstructor;
|
|
81
|
+
reflect: boolean;
|
|
82
|
+
attribute: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
imageSrc: string;
|
|
86
|
+
imageAlt: string;
|
|
87
|
+
plots: SitePlot[];
|
|
88
|
+
/** The number of the plot shown first. */
|
|
89
|
+
selectedPlot: string;
|
|
90
|
+
/** The details beside the plan, or floating over it. */
|
|
91
|
+
panel: 'beside' | 'over';
|
|
92
|
+
/** What is said before a plot is chosen. */
|
|
93
|
+
hint: string;
|
|
94
|
+
plotWord: string;
|
|
95
|
+
actionText: string;
|
|
96
|
+
availableText: string;
|
|
97
|
+
reservedText: string;
|
|
98
|
+
soldText: string;
|
|
99
|
+
spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
100
|
+
spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
101
|
+
private chosen;
|
|
102
|
+
constructor();
|
|
103
|
+
static styles: import("lit").CSSResult[];
|
|
104
|
+
willUpdate(changed: Map<string, unknown>): void;
|
|
105
|
+
private word;
|
|
106
|
+
private choose;
|
|
107
|
+
private renderPanel;
|
|
108
|
+
render(): TemplateResult;
|
|
109
|
+
}
|
|
110
|
+
/** The monthly repayment on a loan. A rate of nothing is the loan split evenly. */
|
|
111
|
+
export declare function monthlyPayment(loan: number, annualRate: number, years: number): number;
|
|
112
|
+
/**
|
|
113
|
+
* What a home would cost each month, worked out as the sliders move.
|
|
114
|
+
*
|
|
115
|
+
* The result is an estimate and the warning under it is on by default, because
|
|
116
|
+
* UK rules expect it wherever repayments are shown. Change the words for other
|
|
117
|
+
* markets, but check with whoever signs off your financial promotions first.
|
|
118
|
+
*
|
|
119
|
+
* @category form
|
|
120
|
+
* @icon pound
|
|
121
|
+
*/
|
|
122
|
+
export declare class ImpaktMortgageCalculator extends ImpaktElement {
|
|
123
|
+
static properties: {
|
|
124
|
+
heading: {
|
|
125
|
+
type: StringConstructor;
|
|
126
|
+
};
|
|
127
|
+
price: {
|
|
128
|
+
type: NumberConstructor;
|
|
129
|
+
};
|
|
130
|
+
depositPercent: {
|
|
131
|
+
type: NumberConstructor;
|
|
132
|
+
attribute: string;
|
|
133
|
+
};
|
|
134
|
+
rate: {
|
|
135
|
+
type: NumberConstructor;
|
|
136
|
+
};
|
|
137
|
+
years: {
|
|
138
|
+
type: NumberConstructor;
|
|
139
|
+
};
|
|
140
|
+
currency: {
|
|
141
|
+
type: StringConstructor;
|
|
142
|
+
};
|
|
143
|
+
smallPrint: {
|
|
144
|
+
type: StringConstructor;
|
|
145
|
+
attribute: string;
|
|
146
|
+
};
|
|
147
|
+
headingLevel: {
|
|
148
|
+
type: NumberConstructor;
|
|
149
|
+
attribute: string;
|
|
150
|
+
};
|
|
151
|
+
spaceAbove: {
|
|
152
|
+
type: StringConstructor;
|
|
153
|
+
reflect: boolean;
|
|
154
|
+
attribute: string;
|
|
155
|
+
};
|
|
156
|
+
spaceBelow: {
|
|
157
|
+
type: StringConstructor;
|
|
158
|
+
reflect: boolean;
|
|
159
|
+
attribute: string;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
heading: string;
|
|
163
|
+
price: number;
|
|
164
|
+
depositPercent: number;
|
|
165
|
+
rate: number;
|
|
166
|
+
years: number;
|
|
167
|
+
/** The three-letter currency code, such as GBP. */
|
|
168
|
+
currency: string;
|
|
169
|
+
smallPrint: string;
|
|
170
|
+
headingLevel: 2 | 3;
|
|
171
|
+
spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
172
|
+
spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
173
|
+
constructor();
|
|
174
|
+
static styles: import("lit").CSSResult[];
|
|
175
|
+
private money;
|
|
176
|
+
private field;
|
|
177
|
+
render(): TemplateResult;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Two pictures of one place with a handle to drag between them: a bare plot
|
|
181
|
+
* and the finished street, a shell and the fitted kitchen.
|
|
182
|
+
*
|
|
183
|
+
* The handle is a native range control, so it works with a finger, a mouse and
|
|
184
|
+
* the arrow keys, and a screen reader hears how far across it is. Both pictures
|
|
185
|
+
* need descriptions, because they are the content.
|
|
186
|
+
*
|
|
187
|
+
* @category content
|
|
188
|
+
* @icon image
|
|
189
|
+
*/
|
|
190
|
+
export declare class ImpaktBeforeAfter extends ImpaktElement {
|
|
191
|
+
static properties: {
|
|
192
|
+
beforeSrc: {
|
|
193
|
+
type: StringConstructor;
|
|
194
|
+
attribute: string;
|
|
195
|
+
};
|
|
196
|
+
beforeAlt: {
|
|
197
|
+
type: StringConstructor;
|
|
198
|
+
attribute: string;
|
|
199
|
+
};
|
|
200
|
+
afterSrc: {
|
|
201
|
+
type: StringConstructor;
|
|
202
|
+
attribute: string;
|
|
203
|
+
};
|
|
204
|
+
afterAlt: {
|
|
205
|
+
type: StringConstructor;
|
|
206
|
+
attribute: string;
|
|
207
|
+
};
|
|
208
|
+
beforeLabel: {
|
|
209
|
+
type: StringConstructor;
|
|
210
|
+
attribute: string;
|
|
211
|
+
};
|
|
212
|
+
afterLabel: {
|
|
213
|
+
type: StringConstructor;
|
|
214
|
+
attribute: string;
|
|
215
|
+
};
|
|
216
|
+
label: {
|
|
217
|
+
type: StringConstructor;
|
|
218
|
+
};
|
|
219
|
+
position: {
|
|
220
|
+
type: NumberConstructor;
|
|
221
|
+
};
|
|
222
|
+
spaceAbove: {
|
|
223
|
+
type: StringConstructor;
|
|
224
|
+
reflect: boolean;
|
|
225
|
+
attribute: string;
|
|
226
|
+
};
|
|
227
|
+
spaceBelow: {
|
|
228
|
+
type: StringConstructor;
|
|
229
|
+
reflect: boolean;
|
|
230
|
+
attribute: string;
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
beforeSrc: string;
|
|
234
|
+
beforeAlt: string;
|
|
235
|
+
afterSrc: string;
|
|
236
|
+
afterAlt: string;
|
|
237
|
+
beforeLabel: string;
|
|
238
|
+
afterLabel: string;
|
|
239
|
+
/** The name of the handle for a screen reader. */
|
|
240
|
+
label: string;
|
|
241
|
+
/** How far across the handle starts, from 0 to 100. */
|
|
242
|
+
position: number;
|
|
243
|
+
spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
244
|
+
spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
245
|
+
constructor();
|
|
246
|
+
static styles: import("lit").CSSResult[];
|
|
247
|
+
render(): TemplateResult;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* A bar fixed to the bottom of the screen that keeps the one thing to do in
|
|
251
|
+
* reach, such as booking a viewing.
|
|
252
|
+
*
|
|
253
|
+
* It appears once the visitor has scrolled, keeps a space for itself at the end
|
|
254
|
+
* of the page, and tells the browser to scroll focused controls clear of it so
|
|
255
|
+
* it never covers what the keyboard is on (2.4.11).
|
|
256
|
+
*
|
|
257
|
+
* @category navigation
|
|
258
|
+
* @icon bar
|
|
259
|
+
* @slot actions - The button or link to keep in reach.
|
|
260
|
+
*/
|
|
261
|
+
export declare class ImpaktStickyBar extends ImpaktElement {
|
|
262
|
+
static properties: {
|
|
263
|
+
label: {
|
|
264
|
+
type: StringConstructor;
|
|
265
|
+
};
|
|
266
|
+
heading: {
|
|
267
|
+
type: StringConstructor;
|
|
268
|
+
};
|
|
269
|
+
lead: {
|
|
270
|
+
type: StringConstructor;
|
|
271
|
+
};
|
|
272
|
+
showOn: {
|
|
273
|
+
type: StringConstructor;
|
|
274
|
+
reflect: boolean;
|
|
275
|
+
attribute: string;
|
|
276
|
+
};
|
|
277
|
+
revealAfter: {
|
|
278
|
+
type: NumberConstructor;
|
|
279
|
+
attribute: string;
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
/** The name of this region for a screen reader. */
|
|
283
|
+
label: string;
|
|
284
|
+
heading: string;
|
|
285
|
+
lead: string;
|
|
286
|
+
showOn: 'phones' | 'all';
|
|
287
|
+
/** How many pixels the visitor scrolls before it appears. */
|
|
288
|
+
revealAfter: number;
|
|
289
|
+
private shown;
|
|
290
|
+
constructor();
|
|
291
|
+
static styles: import("lit").CSSResult[];
|
|
292
|
+
private check;
|
|
293
|
+
/** Leaves room for the bar when the browser scrolls something into view. */
|
|
294
|
+
private clearance;
|
|
295
|
+
connectedCallback(): void;
|
|
296
|
+
disconnectedCallback(): void;
|
|
297
|
+
render(): TemplateResult;
|
|
298
|
+
}
|
|
299
|
+
export interface NearbyItem {
|
|
300
|
+
id?: string;
|
|
301
|
+
place: string;
|
|
302
|
+
/** How far, in words: 8 minutes by train. */
|
|
303
|
+
distance: string;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Where a place is and how to get there: a map picture, the address, opening
|
|
307
|
+
* hours, travel times and a link for directions.
|
|
308
|
+
*
|
|
309
|
+
* The map is a picture you supply, not an embedded map. An embed loads a third
|
|
310
|
+
* party's cookies before the visitor has agreed to anything.
|
|
311
|
+
*
|
|
312
|
+
* @category content
|
|
313
|
+
* @icon map-pin
|
|
314
|
+
* @role heading
|
|
315
|
+
*/
|
|
316
|
+
export declare class ImpaktLocationCard extends ImpaktElement {
|
|
317
|
+
static properties: {
|
|
318
|
+
heading: {
|
|
319
|
+
type: StringConstructor;
|
|
320
|
+
};
|
|
321
|
+
address: {
|
|
322
|
+
type: StringConstructor;
|
|
323
|
+
};
|
|
324
|
+
hours: {
|
|
325
|
+
type: StringConstructor;
|
|
326
|
+
};
|
|
327
|
+
phone: {
|
|
328
|
+
type: StringConstructor;
|
|
329
|
+
};
|
|
330
|
+
mapSrc: {
|
|
331
|
+
type: StringConstructor;
|
|
332
|
+
attribute: string;
|
|
333
|
+
};
|
|
334
|
+
mapAlt: {
|
|
335
|
+
type: StringConstructor;
|
|
336
|
+
attribute: string;
|
|
337
|
+
};
|
|
338
|
+
directionsText: {
|
|
339
|
+
type: StringConstructor;
|
|
340
|
+
attribute: string;
|
|
341
|
+
};
|
|
342
|
+
directionsHref: {
|
|
343
|
+
type: StringConstructor;
|
|
344
|
+
attribute: string;
|
|
345
|
+
};
|
|
346
|
+
nearby: {
|
|
347
|
+
type: ArrayConstructor;
|
|
348
|
+
};
|
|
349
|
+
headingLevel: {
|
|
350
|
+
type: NumberConstructor;
|
|
351
|
+
attribute: string;
|
|
352
|
+
};
|
|
353
|
+
spaceAbove: {
|
|
354
|
+
type: StringConstructor;
|
|
355
|
+
reflect: boolean;
|
|
356
|
+
attribute: string;
|
|
357
|
+
};
|
|
358
|
+
spaceBelow: {
|
|
359
|
+
type: StringConstructor;
|
|
360
|
+
reflect: boolean;
|
|
361
|
+
attribute: string;
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
heading: string;
|
|
365
|
+
address: string;
|
|
366
|
+
hours: string;
|
|
367
|
+
phone: string;
|
|
368
|
+
mapSrc: string;
|
|
369
|
+
mapAlt: string;
|
|
370
|
+
directionsText: string;
|
|
371
|
+
/** Leave empty and the link searches a map for the address. */
|
|
372
|
+
directionsHref: string;
|
|
373
|
+
nearby: NearbyItem[];
|
|
374
|
+
headingLevel: 2 | 3;
|
|
375
|
+
spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
376
|
+
spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
377
|
+
constructor();
|
|
378
|
+
static styles: import("lit").CSSResult[];
|
|
379
|
+
render(): TemplateResult;
|
|
380
|
+
}
|
|
381
|
+
declare global {
|
|
382
|
+
interface HTMLElementTagNameMap {
|
|
383
|
+
'impakt-site-plan': ImpaktSitePlan;
|
|
384
|
+
'impakt-mortgage-calculator': ImpaktMortgageCalculator;
|
|
385
|
+
'impakt-before-after': ImpaktBeforeAfter;
|
|
386
|
+
'impakt-sticky-bar': ImpaktStickyBar;
|
|
387
|
+
'impakt-location-card': ImpaktLocationCard;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ImpaktBeforeAfter,
|
|
3
|
+
ImpaktLocationCard,
|
|
4
|
+
ImpaktMortgageCalculator,
|
|
5
|
+
ImpaktSitePlan,
|
|
6
|
+
ImpaktStickyBar,
|
|
7
|
+
monthlyPayment
|
|
8
|
+
} from "../chunk-T7U4OPTW.js";
|
|
9
|
+
export {
|
|
10
|
+
ImpaktBeforeAfter,
|
|
11
|
+
ImpaktLocationCard,
|
|
12
|
+
ImpaktMortgageCalculator,
|
|
13
|
+
ImpaktSitePlan,
|
|
14
|
+
ImpaktStickyBar,
|
|
15
|
+
monthlyPayment
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=property.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { type TemplateResult, type PropertyValues } from 'lit';
|
|
2
|
+
import { ImpaktElement } from '@atomic-ui/ui';
|
|
3
|
+
export type SceneDrive = 'view' | 'page' | 'loop' | 'scrubber';
|
|
4
|
+
export type SceneLayout = 'stage' | 'split';
|
|
5
|
+
/**
|
|
6
|
+
* A scene: a stage whose children move along a progress from 0 to 1.
|
|
7
|
+
*
|
|
8
|
+
* The children declare timelines in their `motion` block, and `@atomic-ui/motion`
|
|
9
|
+
* compiles them to keyframes. This element owns only the progress, and where it
|
|
10
|
+
* comes from is the `drive` (ADR 0027):
|
|
11
|
+
*
|
|
12
|
+
* - `view` — the scene's own passage through the viewport. The stage pins
|
|
13
|
+
* while the scene scrolls past, for `length` screens, or beside the content
|
|
14
|
+
* in the default slot when `layout` is `split`.
|
|
15
|
+
* - `page` — the scroll position of the whole page.
|
|
16
|
+
* - `loop` — time, over `duration` seconds, repeating. **It always shows a
|
|
17
|
+
* pause button**, because anything that moves on its own for more than five
|
|
18
|
+
* seconds must be pausable (WCAG 2.2.2), and a scene that could forget that
|
|
19
|
+
* is one the gate would have to catch on every page.
|
|
20
|
+
* - `scrubber` — an `impakt-scrubber` placed in the `controls` slot.
|
|
21
|
+
*
|
|
22
|
+
* Progress is published three ways: the `progress` property, the
|
|
23
|
+
* `--impakt-scene-progress` custom property on the host, and an
|
|
24
|
+
* `impakt-scene-progress` event. Engines with scroll-driven animations run `view`
|
|
25
|
+
* and `page` scenes natively, and the runtime ignores the event for them.
|
|
26
|
+
*
|
|
27
|
+
* Under reduced motion a `loop` does not start, and nothing pins: the stage
|
|
28
|
+
* and the content stack, so every state of the scene can be read in order.
|
|
29
|
+
*
|
|
30
|
+
* @category layout
|
|
31
|
+
* @icon layers
|
|
32
|
+
* @slot stage - What moves, layered one over another. Pinned while the scene plays,
|
|
33
|
+
* beside the content in `split` layout, after it, so the words are read first.
|
|
34
|
+
* @slot - Content that scrolls past the stage, such as chapters.
|
|
35
|
+
* @slot controls - An `impakt-scrubber`, for a scene driven by one.
|
|
36
|
+
* @fires {CustomEvent<{ progress: number }>} impakt-scene-progress - `{ progress }` whenever the progress changes.
|
|
37
|
+
*/
|
|
38
|
+
export declare class ImpaktScene extends ImpaktElement {
|
|
39
|
+
static properties: {
|
|
40
|
+
drive: {
|
|
41
|
+
type: StringConstructor;
|
|
42
|
+
reflect: boolean;
|
|
43
|
+
};
|
|
44
|
+
layout: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
reflect: boolean;
|
|
47
|
+
};
|
|
48
|
+
length: {
|
|
49
|
+
type: NumberConstructor;
|
|
50
|
+
};
|
|
51
|
+
duration: {
|
|
52
|
+
type: NumberConstructor;
|
|
53
|
+
};
|
|
54
|
+
label: {
|
|
55
|
+
type: StringConstructor;
|
|
56
|
+
};
|
|
57
|
+
progress: {
|
|
58
|
+
type: NumberConstructor;
|
|
59
|
+
};
|
|
60
|
+
controls: {
|
|
61
|
+
type: StringConstructor;
|
|
62
|
+
reflect: boolean;
|
|
63
|
+
};
|
|
64
|
+
bleed: {
|
|
65
|
+
type: BooleanConstructor;
|
|
66
|
+
reflect: boolean;
|
|
67
|
+
};
|
|
68
|
+
hideOn: {
|
|
69
|
+
type: StringConstructor;
|
|
70
|
+
reflect: boolean;
|
|
71
|
+
attribute: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
/** Where the progress comes from. */
|
|
75
|
+
drive: 'view' | 'page' | 'loop' | 'scrubber';
|
|
76
|
+
/** `stage` pins one full-width stage; `split` pins it beside the content. */
|
|
77
|
+
layout: 'stage' | 'split';
|
|
78
|
+
/** How many screens of scrolling a `view` scene lasts, in `stage` layout. */
|
|
79
|
+
length: number;
|
|
80
|
+
/** Seconds per cycle of a `loop` scene. */
|
|
81
|
+
duration: number;
|
|
82
|
+
/** The scene's accessible name. Also names its pause button. */
|
|
83
|
+
label: string;
|
|
84
|
+
/** From 0 to 1. Set it to seek a `scrubber` scene, or where one starts. */
|
|
85
|
+
progress: number;
|
|
86
|
+
/**
|
|
87
|
+
* Where the controls sit: `below` the stage, or `over` its foot, floating
|
|
88
|
+
* on what it shows, as a video's do. Under reduced motion they sit below.
|
|
89
|
+
*/
|
|
90
|
+
controls: 'below' | 'over';
|
|
91
|
+
/** Run the stage to the window's edges, past the page's margins, as a hero drawn edge to edge does. */
|
|
92
|
+
bleed: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Leave it out on a phone, or on anything wider, for a picture drawn twice:
|
|
95
|
+
* once for a wide screen and once for a narrow one. Never both.
|
|
96
|
+
*/
|
|
97
|
+
hideOn: 'never' | 'phone' | 'wide';
|
|
98
|
+
/**
|
|
99
|
+
* Whether a loop is paused: the scene's own state, set by its pause button
|
|
100
|
+
* or by `pause()`. A plain field rather than a property, so it is never one
|
|
101
|
+
* of the settings an author is offered.
|
|
102
|
+
*/
|
|
103
|
+
private paused;
|
|
104
|
+
private frame;
|
|
105
|
+
private started;
|
|
106
|
+
private reduced;
|
|
107
|
+
private seekFrom;
|
|
108
|
+
private seekTo;
|
|
109
|
+
private seekStart;
|
|
110
|
+
private seekMs;
|
|
111
|
+
constructor();
|
|
112
|
+
static styles: import("lit").CSSResult[];
|
|
113
|
+
/** @ignore */
|
|
114
|
+
connectedCallback(): void;
|
|
115
|
+
/** @ignore */
|
|
116
|
+
disconnectedCallback(): void;
|
|
117
|
+
/** @ignore */
|
|
118
|
+
protected updated(changed: PropertyValues<this>): void;
|
|
119
|
+
/**
|
|
120
|
+
* Move to a progress. With `ms`, ease there; without, jump. A scrubber seeks
|
|
121
|
+
* a scene to a named stop this way.
|
|
122
|
+
*/
|
|
123
|
+
seek(to: number, ms?: number): void;
|
|
124
|
+
private onScroll;
|
|
125
|
+
private schedule;
|
|
126
|
+
private tick;
|
|
127
|
+
private publish;
|
|
128
|
+
private setPaused;
|
|
129
|
+
private togglePause;
|
|
130
|
+
/** Stop a loop where it is, as its pause button does. An editor scrubbing the scene calls it. */
|
|
131
|
+
pause(): void;
|
|
132
|
+
render(): TemplateResult;
|
|
133
|
+
}
|
|
134
|
+
declare global {
|
|
135
|
+
interface HTMLElementTagNameMap {
|
|
136
|
+
'impakt-scene': ImpaktScene;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { type TemplateResult } from 'lit';
|
|
2
|
+
import { ImpaktElement } from '@atomic-ui/ui';
|
|
3
|
+
export interface ScrubberStop {
|
|
4
|
+
/** Where the stop sits on the scene's progress, from 0 to 1. */
|
|
5
|
+
at: number;
|
|
6
|
+
label: string;
|
|
7
|
+
/** A short code beside it in the graph look, such as a commit hash. */
|
|
8
|
+
meta?: string;
|
|
9
|
+
/** A line under the code in the graph look, such as a commit message. */
|
|
10
|
+
note?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The colour of the line up to this stop, in the graph look: a named tone,
|
|
13
|
+
* or 1 to 5 for the brand's chart colours, as a project's phases are drawn.
|
|
14
|
+
*/
|
|
15
|
+
tone?: 'brand' | 'accent' | 'info' | 'success' | 'warning' | 'danger' | 1 | 2 | 3 | 4 | 5;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Drives the scene it sits in, by hand.
|
|
19
|
+
*
|
|
20
|
+
* Place it in an `impakt-scene`'s `controls` slot and set that scene's `drive`
|
|
21
|
+
* to `scrubber`. Dragging moves through the scene; a named stop seeks to it
|
|
22
|
+
* with an eased move rather than a cut, which is what makes the Commit-style
|
|
23
|
+
* "time travel" read as travel.
|
|
24
|
+
*
|
|
25
|
+
* **It is a native range input.** A slider built from divs has to recreate
|
|
26
|
+
* arrow keys, Page Up and Down, Home and End, the value announcement and touch
|
|
27
|
+
* handling, and every one of those is a place to get it wrong. The input
|
|
28
|
+
* already does all of it. The stops are buttons beside it, so a keyboard or
|
|
29
|
+
* switch user reaches each named moment in one action instead of nudging a
|
|
30
|
+
* thumb to find it (2.5.7, dragging movements).
|
|
31
|
+
*
|
|
32
|
+
* @category action
|
|
33
|
+
* @icon adjustments-horizontal
|
|
34
|
+
*/
|
|
35
|
+
export declare class ImpaktScrubber extends ImpaktElement {
|
|
36
|
+
static properties: {
|
|
37
|
+
label: {
|
|
38
|
+
type: StringConstructor;
|
|
39
|
+
};
|
|
40
|
+
stops: {
|
|
41
|
+
type: ArrayConstructor;
|
|
42
|
+
};
|
|
43
|
+
look: {
|
|
44
|
+
type: StringConstructor;
|
|
45
|
+
reflect: boolean;
|
|
46
|
+
};
|
|
47
|
+
hint: {
|
|
48
|
+
type: StringConstructor;
|
|
49
|
+
};
|
|
50
|
+
value: {
|
|
51
|
+
type: NumberConstructor;
|
|
52
|
+
state: boolean;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
/** The slider's accessible name. */
|
|
56
|
+
label: string;
|
|
57
|
+
stops: ScrubberStop[];
|
|
58
|
+
/**
|
|
59
|
+
* `buttons` lists the stops as buttons under the slider. `graph` draws them
|
|
60
|
+
* as commits on a line that fills in each stop's colour as it is dragged,
|
|
61
|
+
* with the current one's code and note beside it.
|
|
62
|
+
*/
|
|
63
|
+
look: 'buttons' | 'graph';
|
|
64
|
+
/** A word of help in the graph look, such as "drag to time-travel". */
|
|
65
|
+
hint: string;
|
|
66
|
+
value: number;
|
|
67
|
+
private scene;
|
|
68
|
+
constructor();
|
|
69
|
+
static styles: import("lit").CSSResult[];
|
|
70
|
+
/** @ignore */
|
|
71
|
+
connectedCallback(): void;
|
|
72
|
+
/** @ignore */
|
|
73
|
+
disconnectedCallback(): void;
|
|
74
|
+
private onProgress;
|
|
75
|
+
private onInput;
|
|
76
|
+
private goTo;
|
|
77
|
+
/** The stop nearest the current position, which the stop list marks as current. */
|
|
78
|
+
private nearest;
|
|
79
|
+
private renderGraph;
|
|
80
|
+
render(): TemplateResult;
|
|
81
|
+
}
|
|
82
|
+
declare global {
|
|
83
|
+
interface HTMLElementTagNameMap {
|
|
84
|
+
'impakt-scrubber': ImpaktScrubber;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|