@atomic-ui/blocks 0.12.1 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +201 -7
- package/dist/{chunk-WGDMORWT.js → chunk-EGNQHWY6.js} +3 -1
- package/dist/chunk-EGNQHWY6.js.map +1 -0
- package/dist/{chunk-XNRFZCNB.js → chunk-JIITZUGI.js} +10 -7
- package/dist/chunk-JIITZUGI.js.map +1 -0
- package/dist/{chunk-7X4WGV6K.js → chunk-KDDXCGEZ.js} +4 -2
- package/dist/{chunk-7X4WGV6K.js.map → chunk-KDDXCGEZ.js.map} +1 -1
- package/dist/{chunk-SYTQIQT2.js → chunk-KOYQRJKY.js} +24 -5
- package/dist/chunk-KOYQRJKY.js.map +1 -0
- package/dist/{chunk-I2DL3DRU.js → chunk-W3MK3EEO.js} +4 -3
- package/dist/chunk-W3MK3EEO.js.map +1 -0
- package/dist/chunk-X3U2SOVV.js +461 -0
- package/dist/chunk-X3U2SOVV.js.map +1 -0
- package/dist/components/g2-case.js +2 -2
- package/dist/components/g2-shared.d.ts +2 -0
- package/dist/components/g2-shared.js +3 -1
- package/dist/components/g2-site.js +2 -2
- package/dist/components/g2-tools.js +2 -2
- package/dist/components/journey.d.ts +85 -16
- package/dist/components/journey.js +7 -3
- package/dist/components/site.js +1 -1
- package/dist/index.js +6 -6
- package/dist/standalone/atomic-ui-blocks.js +1030 -983
- package/dist/standalone/atomic-ui-blocks.js.map +3 -3
- package/package.json +3 -3
- package/dist/chunk-GRKPKJZH.js +0 -275
- package/dist/chunk-GRKPKJZH.js.map +0 -1
- package/dist/chunk-I2DL3DRU.js.map +0 -1
- package/dist/chunk-SYTQIQT2.js.map +0 -1
- package/dist/chunk-WGDMORWT.js.map +0 -1
- package/dist/chunk-XNRFZCNB.js.map +0 -1
|
@@ -7,6 +7,26 @@ import { ImpaktElement } from '@atomic-ui/ui';
|
|
|
7
7
|
/** The stages a button passes through on its way to being live, in order. */
|
|
8
8
|
export declare const JOURNEY_STAGES: readonly ["note", "wireframe", "component", "code", "live"];
|
|
9
9
|
export type JourneyStage = (typeof JOURNEY_STAGES)[number];
|
|
10
|
+
/** The moves between stages, in order: the move into stage k is MOVES[k - 1]. Each easing is the motion spec's (11:830). */
|
|
11
|
+
export declare const JOURNEY_MOVES: readonly [{
|
|
12
|
+
readonly name: "flatten";
|
|
13
|
+
readonly ms: 640;
|
|
14
|
+
readonly easing: readonly [0.65, 0, 0.35, 1];
|
|
15
|
+
}, {
|
|
16
|
+
readonly name: "ink-in";
|
|
17
|
+
readonly ms: 560;
|
|
18
|
+
readonly easing: readonly [0.22, 1, 0.36, 1];
|
|
19
|
+
}, {
|
|
20
|
+
readonly name: "compile";
|
|
21
|
+
readonly ms: 720;
|
|
22
|
+
readonly easing: readonly [0.83, 0, 0.17, 1];
|
|
23
|
+
}, {
|
|
24
|
+
readonly name: "ship";
|
|
25
|
+
readonly ms: 600;
|
|
26
|
+
readonly easing: readonly [0.34, 1.56, 0.64, 1];
|
|
27
|
+
}];
|
|
28
|
+
/** A CSS cubic-bezier as a function of progress, for the frame loop, which applies the spec's easing itself. */
|
|
29
|
+
export declare function cubicBezier([x1, y1, x2, y2]: readonly number[]): (x: number) => number;
|
|
10
30
|
/**
|
|
11
31
|
* A call to action drawn as the thing it once was: a sticky note from a
|
|
12
32
|
* workshop, a wireframe box, a designed component, the code that renders it,
|
|
@@ -30,19 +50,38 @@ export type JourneyStage = (typeof JOURNEY_STAGES)[number];
|
|
|
30
50
|
*
|
|
31
51
|
* **One button can follow the page.** Give `track` a selector for the page's
|
|
32
52
|
* sections, each carrying `data-journey-stage`, and the button takes the stage
|
|
33
|
-
* of whichever section is across the middle of the screen
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* and is complete as
|
|
37
|
-
*
|
|
53
|
+
* of whichever section is across the middle of the screen. Between two
|
|
54
|
+
* sections the whole morph is scrubbed by the scroll, as the motion spec
|
|
55
|
+
* (`11:830`) asks: the shapes, the words and the design notes all follow the
|
|
56
|
+
* scroll, and the move is complete as the next section crosses the middle of
|
|
57
|
+
* the screen. Scrolling back halfway leaves it halfway.
|
|
58
|
+
*
|
|
59
|
+
* Where the browser has scroll-driven animations, the scroll drives the stage
|
|
60
|
+
* itself through a scroll timeline, with no script running as the page moves;
|
|
61
|
+
* the button only measures where the sections are, again when the page is
|
|
62
|
+
* resized. Elsewhere a frame loop reads the scroll at most once a frame, and
|
|
63
|
+
* only while the page scrolls. Either way each move between two sections is
|
|
64
|
+
* shaped by that move's easing, so ship overshoots near the end of its range.
|
|
65
|
+
*
|
|
66
|
+
* **One button can travel.** Set `travel` and the button stays in view while
|
|
67
|
+
* its sections scroll past, as the spec's one moving object does. It is sticky,
|
|
68
|
+
* so put it in a column as tall as the tracked sections, beside them, such as
|
|
69
|
+
* the second column of a grid whose first holds the sections. It sits
|
|
70
|
+
* `--impakt-journey-travel-top` from the top of the screen, a fifth of the
|
|
71
|
+
* screen unless the page sets it. On a phone, where the sections stack, leave
|
|
72
|
+
* `travel` off and give each section its own decorative copy.
|
|
38
73
|
*
|
|
39
74
|
* **Each move has its own timing**, from the motion spec: flatten 640ms, ink
|
|
40
75
|
* in 560ms, compile 720ms, ship 600ms with an overshoot, lift 180ms on hover
|
|
41
76
|
* and press 140ms. Each is read from `--impakt-motion-journey-<move>-duration`
|
|
42
|
-
* and `-easing`.
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
77
|
+
* and `-easing`. When `stage` is set by hand the move runs on that timing.
|
|
78
|
+
* **Only transforms, opacity and colour move**, so a change of stage costs no
|
|
79
|
+
* layout.
|
|
80
|
+
*
|
|
81
|
+
* **With reduced motion asked for** each stage cuts straight to its final
|
|
82
|
+
* state: there is no morph, no scale and no change of position. A tracked
|
|
83
|
+
* button swaps to a section's stage as soon as the section enters the screen,
|
|
84
|
+
* and pointing at the live button changes its colour only (2.3.3).
|
|
46
85
|
*
|
|
47
86
|
* **`annotations` draws the design notes around it**, as the site's motion
|
|
48
87
|
* frames show: the stage's caption above, a handwritten note in the margin at
|
|
@@ -59,6 +98,7 @@ export type JourneyStage = (typeof JOURNEY_STAGES)[number];
|
|
|
59
98
|
* @category action
|
|
60
99
|
* @icon button
|
|
61
100
|
* @fires {CustomEvent<{ stage: JourneyStage }>} impakt-journey-stage - When a tracked button changes stage as the page scrolls.
|
|
101
|
+
* @cssprop --impakt-journey-travel-top - With `travel`: how far from the top of the screen the button stays.
|
|
62
102
|
*/
|
|
63
103
|
export declare class ImpaktJourneyButton extends ImpaktElement {
|
|
64
104
|
static properties: {
|
|
@@ -79,6 +119,10 @@ export declare class ImpaktJourneyButton extends ImpaktElement {
|
|
|
79
119
|
track: {
|
|
80
120
|
type: StringConstructor;
|
|
81
121
|
};
|
|
122
|
+
travel: {
|
|
123
|
+
type: BooleanConstructor;
|
|
124
|
+
reflect: boolean;
|
|
125
|
+
};
|
|
82
126
|
code: {
|
|
83
127
|
type: ArrayConstructor;
|
|
84
128
|
};
|
|
@@ -119,6 +163,8 @@ export declare class ImpaktJourneyButton extends ImpaktElement {
|
|
|
119
163
|
* across the middle of the screen. Leave empty to set `stage` by hand.
|
|
120
164
|
*/
|
|
121
165
|
track: string;
|
|
166
|
+
/** With `track`: stay in view while the tracked sections scroll past. Place it in a column as tall as they are. */
|
|
167
|
+
travel: boolean;
|
|
122
168
|
/**
|
|
123
169
|
* Lines of code drawn around the words at the `code` stage, split where the
|
|
124
170
|
* words go: the lines before, then the lines after. They are decoration and
|
|
@@ -145,23 +191,46 @@ export declare class ImpaktJourneyButton extends ImpaktElement {
|
|
|
145
191
|
static styles: import("lit").CSSResult[];
|
|
146
192
|
private observer?;
|
|
147
193
|
private sections;
|
|
148
|
-
private
|
|
194
|
+
private frameRequest;
|
|
195
|
+
private resizeObserver?;
|
|
196
|
+
private easings;
|
|
149
197
|
private readonly onScroll;
|
|
198
|
+
private readonly onResize;
|
|
150
199
|
connectedCallback(): void;
|
|
151
200
|
disconnectedCallback(): void;
|
|
152
201
|
protected willUpdate(changed: Map<string, unknown>): void;
|
|
153
202
|
protected updated(changed: Map<string, unknown>): void;
|
|
154
|
-
|
|
203
|
+
private get frameEl();
|
|
204
|
+
private reduced;
|
|
205
|
+
private unwatch;
|
|
206
|
+
/**
|
|
207
|
+
* Follow the sections named by `track`. Without reduced motion the section across the middle of the screen
|
|
208
|
+
* sets the stage and the scroll scrubs the morph between sections; with it, a section sets the stage as soon as
|
|
209
|
+
* it enters the screen and nothing is scrubbed.
|
|
210
|
+
*/
|
|
155
211
|
private watch;
|
|
156
212
|
private crossed;
|
|
213
|
+
/** With reduced motion: the stage of the last section whose top has come onto the screen. */
|
|
214
|
+
private entered;
|
|
157
215
|
private become;
|
|
158
|
-
/** Scrub
|
|
216
|
+
/** Scrub with a scroll timeline where the browser has one and the page scrolls the document; otherwise with a frame loop. */
|
|
159
217
|
private startScrub;
|
|
160
|
-
|
|
218
|
+
/** Whether the tracked sections scroll with the document, which is the scroller a root scroll timeline follows. */
|
|
219
|
+
private rootScrolls;
|
|
220
|
+
/** The easing of a move, from its token if the page sets one, as four numbers. */
|
|
221
|
+
private easingOf;
|
|
222
|
+
/** Each gap between two tracked sections, as the scroll positions it runs between and the stages at its ends. */
|
|
223
|
+
private gaps;
|
|
224
|
+
/**
|
|
225
|
+
* The scroll timeline. Each gap animates its own number from 0 to 1 across the scroll between its two sections,
|
|
226
|
+
* shaped by the move's easing, and the stage is the first section's stage plus each gap's step times its number.
|
|
227
|
+
* The browser runs it as the page scrolls; this only runs again when the page is resized.
|
|
228
|
+
*/
|
|
229
|
+
private timeline;
|
|
161
230
|
/**
|
|
162
|
-
* The
|
|
163
|
-
* the
|
|
164
|
-
* the
|
|
231
|
+
* The frame loop. The section across the middle of the screen gives the whole part of the stage; how far the next
|
|
232
|
+
* section has risen toward the middle, shaped by the move's easing, gives the rest, so the move is complete as
|
|
233
|
+
* the next section crosses it.
|
|
165
234
|
*/
|
|
166
235
|
private scrub;
|
|
167
236
|
private lines;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ImpaktJourneyButton,
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
JOURNEY_MOVES,
|
|
4
|
+
JOURNEY_STAGES,
|
|
5
|
+
cubicBezier
|
|
6
|
+
} from "../chunk-X3U2SOVV.js";
|
|
5
7
|
export {
|
|
6
8
|
ImpaktJourneyButton,
|
|
7
|
-
|
|
9
|
+
JOURNEY_MOVES,
|
|
10
|
+
JOURNEY_STAGES,
|
|
11
|
+
cubicBezier
|
|
8
12
|
};
|
|
9
13
|
//# sourceMappingURL=journey.js.map
|
package/dist/components/site.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
ImpaktJourneyButton,
|
|
12
12
|
JOURNEY_STAGES
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-X3U2SOVV.js";
|
|
14
14
|
import {
|
|
15
15
|
ImpaktAnnouncement,
|
|
16
16
|
ImpaktFeatureList,
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
ImpaktSiteFooter,
|
|
52
52
|
ImpaktSiteHeader,
|
|
53
53
|
ImpaktWordmark
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-KOYQRJKY.js";
|
|
55
55
|
import {
|
|
56
56
|
ImpaktCardGrid
|
|
57
57
|
} from "./chunk-ZD75GU6J.js";
|
|
@@ -81,7 +81,7 @@ import {
|
|
|
81
81
|
ImpaktHypothesisCard,
|
|
82
82
|
ImpaktProcessLine,
|
|
83
83
|
ImpaktWeekStrip
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-W3MK3EEO.js";
|
|
85
85
|
import {
|
|
86
86
|
ImpaktColumnList,
|
|
87
87
|
ImpaktCursor,
|
|
@@ -93,11 +93,11 @@ import {
|
|
|
93
93
|
ImpaktServiceCard,
|
|
94
94
|
ImpaktStageTag,
|
|
95
95
|
STAGE_WORDS
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-JIITZUGI.js";
|
|
97
97
|
import {
|
|
98
98
|
ImpaktFlow
|
|
99
|
-
} from "./chunk-
|
|
100
|
-
import "./chunk-
|
|
99
|
+
} from "./chunk-KDDXCGEZ.js";
|
|
100
|
+
import "./chunk-EGNQHWY6.js";
|
|
101
101
|
|
|
102
102
|
// packages/blocks/src/index.ts
|
|
103
103
|
import "@atomic-ui/ui";
|