@atomic-ui/blocks 0.12.0 → 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.
Files changed (35) hide show
  1. package/custom-elements.json +201 -7
  2. package/dist/{chunk-WGDMORWT.js → chunk-EGNQHWY6.js} +3 -1
  3. package/dist/chunk-EGNQHWY6.js.map +1 -0
  4. package/dist/{chunk-XNRFZCNB.js → chunk-JIITZUGI.js} +10 -7
  5. package/dist/chunk-JIITZUGI.js.map +1 -0
  6. package/dist/{chunk-7X4WGV6K.js → chunk-KDDXCGEZ.js} +4 -2
  7. package/dist/{chunk-7X4WGV6K.js.map → chunk-KDDXCGEZ.js.map} +1 -1
  8. package/dist/{chunk-SYTQIQT2.js → chunk-KOYQRJKY.js} +24 -5
  9. package/dist/chunk-KOYQRJKY.js.map +1 -0
  10. package/dist/{chunk-PIUPEB4I.js → chunk-VXQS5TAN.js} +4 -2
  11. package/dist/chunk-VXQS5TAN.js.map +1 -0
  12. package/dist/{chunk-2URXTXNQ.js → chunk-W3MK3EEO.js} +8 -6
  13. package/dist/chunk-W3MK3EEO.js.map +1 -0
  14. package/dist/chunk-X3U2SOVV.js +461 -0
  15. package/dist/chunk-X3U2SOVV.js.map +1 -0
  16. package/dist/components/changelog.js +1 -1
  17. package/dist/components/g2-case.js +2 -2
  18. package/dist/components/g2-shared.d.ts +2 -0
  19. package/dist/components/g2-shared.js +3 -1
  20. package/dist/components/g2-site.js +2 -2
  21. package/dist/components/g2-tools.js +2 -2
  22. package/dist/components/journey.d.ts +85 -16
  23. package/dist/components/journey.js +7 -3
  24. package/dist/components/site.js +1 -1
  25. package/dist/index.js +7 -7
  26. package/dist/standalone/atomic-ui-blocks.js +1069 -1019
  27. package/dist/standalone/atomic-ui-blocks.js.map +3 -3
  28. package/package.json +3 -3
  29. package/dist/chunk-2URXTXNQ.js.map +0 -1
  30. package/dist/chunk-GRKPKJZH.js +0 -275
  31. package/dist/chunk-GRKPKJZH.js.map +0 -1
  32. package/dist/chunk-PIUPEB4I.js.map +0 -1
  33. package/dist/chunk-SYTQIQT2.js.map +0 -1
  34. package/dist/chunk-WGDMORWT.js.map +0 -1
  35. package/dist/chunk-XNRFZCNB.js.map +0 -1
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  accent,
3
3
  accentOn,
4
+ accentOnInk,
4
5
  band,
5
6
  bandLine,
6
7
  bandMuted,
@@ -14,10 +15,11 @@ import {
14
15
  monoLabel,
15
16
  pad,
16
17
  paper
17
- } from "../chunk-WGDMORWT.js";
18
+ } from "../chunk-EGNQHWY6.js";
18
19
  export {
19
20
  accent,
20
21
  accentOn,
22
+ accentOnInk,
21
23
  band,
22
24
  bandLine,
23
25
  bandMuted,
@@ -9,8 +9,8 @@ import {
9
9
  ImpaktServiceCard,
10
10
  ImpaktStageTag,
11
11
  STAGE_WORDS
12
- } from "../chunk-XNRFZCNB.js";
13
- import "../chunk-WGDMORWT.js";
12
+ } from "../chunk-JIITZUGI.js";
13
+ import "../chunk-EGNQHWY6.js";
14
14
  export {
15
15
  ImpaktColumnList,
16
16
  ImpaktCursor,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ImpaktFlow
3
- } from "../chunk-7X4WGV6K.js";
4
- import "../chunk-WGDMORWT.js";
3
+ } from "../chunk-KDDXCGEZ.js";
4
+ import "../chunk-EGNQHWY6.js";
5
5
  export {
6
6
  ImpaktFlow
7
7
  };
@@ -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; an
34
- * IntersectionObserver watches for that. Between two sections the move is
35
- * scrubbed by the scroll: the next stage fades in as the next section rises,
36
- * and is complete as it crosses the middle of the screen. The scroll is read
37
- * at most once a frame, and only while a tracked section is on screen.
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`. **Only transforms, opacity and colour move**, so a change of
43
- * stage costs no layout. With reduced motion asked for, a stage cuts straight
44
- * to the next, nothing is scrubbed, and pointing at the live button changes
45
- * its colour only (2.3.3).
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 frame;
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
- /** Follow the sections named by `track`: the one across the middle of the screen sets the stage. */
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 between stages with the scroll, unless reduced motion is asked for. */
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
- private stopScrub;
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 stage as a number. The section across the middle of the screen gives
163
- * the whole part; how far the next section has risen toward the middle gives
164
- * the rest, so the move is complete as the next section crosses it.
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
- JOURNEY_STAGES
4
- } from "../chunk-GRKPKJZH.js";
3
+ JOURNEY_MOVES,
4
+ JOURNEY_STAGES,
5
+ cubicBezier
6
+ } from "../chunk-X3U2SOVV.js";
5
7
  export {
6
8
  ImpaktJourneyButton,
7
- JOURNEY_STAGES
9
+ JOURNEY_MOVES,
10
+ JOURNEY_STAGES,
11
+ cubicBezier
8
12
  };
9
13
  //# sourceMappingURL=journey.js.map
@@ -2,7 +2,7 @@ import {
2
2
  ImpaktSiteFooter,
3
3
  ImpaktSiteHeader,
4
4
  ImpaktWordmark
5
- } from "../chunk-SYTQIQT2.js";
5
+ } from "../chunk-KOYQRJKY.js";
6
6
  export {
7
7
  ImpaktSiteFooter,
8
8
  ImpaktSiteHeader,
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  ImpaktJourneyButton,
12
12
  JOURNEY_STAGES
13
- } from "./chunk-GRKPKJZH.js";
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-SYTQIQT2.js";
54
+ } from "./chunk-KOYQRJKY.js";
55
55
  import {
56
56
  ImpaktCardGrid
57
57
  } from "./chunk-ZD75GU6J.js";
@@ -61,7 +61,7 @@ import {
61
61
  ImpaktCheckList,
62
62
  ImpaktReleaseCard,
63
63
  ImpaktReleaseList
64
- } from "./chunk-PIUPEB4I.js";
64
+ } from "./chunk-VXQS5TAN.js";
65
65
  import {
66
66
  ImpaktBeforeAfter,
67
67
  ImpaktLocationCard,
@@ -81,7 +81,7 @@ import {
81
81
  ImpaktHypothesisCard,
82
82
  ImpaktProcessLine,
83
83
  ImpaktWeekStrip
84
- } from "./chunk-2URXTXNQ.js";
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-XNRFZCNB.js";
96
+ } from "./chunk-JIITZUGI.js";
97
97
  import {
98
98
  ImpaktFlow
99
- } from "./chunk-7X4WGV6K.js";
100
- import "./chunk-WGDMORWT.js";
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";