@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atomic-ui/blocks",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "The section blocks Impakt sites are built from: marketing blocks, property and selling tools, the site frame and the changelog blocks, as standard custom elements built on @atomic-ui/ui to WCAG 2.2 AA.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"lit": "^3.3.3",
|
|
34
|
-
"@atomic-ui/ui": "^0.
|
|
34
|
+
"@atomic-ui/ui": "^0.13.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@custom-elements-manifest/analyzer": "^0.11.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"tsx": "^4.16.0",
|
|
45
45
|
"typescript": "^5.5.0",
|
|
46
46
|
"vitest": "^2.0.0",
|
|
47
|
-
"@atomic-ui/design-tokens": "^0.
|
|
47
|
+
"@atomic-ui/design-tokens": "^0.13.0"
|
|
48
48
|
},
|
|
49
49
|
"customElements": "custom-elements.json",
|
|
50
50
|
"files": [
|
package/dist/chunk-GRKPKJZH.js
DELETED
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
// packages/blocks/src/components/journey.ts
|
|
2
|
-
import { css, html, nothing, unsafeCSS } from "lit";
|
|
3
|
-
import { ImpaktElement, focusRing, fontWeight, say, space, t, token } from "@atomic-ui/ui";
|
|
4
|
-
var JOURNEY_STAGES = ["note", "wireframe", "component", "code", "live"];
|
|
5
|
-
var isStage = (value) => JOURNEY_STAGES.includes(value);
|
|
6
|
-
var indexOf = (stage) => JOURNEY_STAGES.indexOf(stage);
|
|
7
|
-
var arrow = html`<svg class="arrow" viewBox="0 0 20 12" width="20" height="12" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true" focusable="false">
|
|
8
|
-
<path d="M0 6h18M13 1l5 5-5 5" />
|
|
9
|
-
</svg>`;
|
|
10
|
-
var pointer = html`<svg class="pointer" viewBox="0 0 16 20" width="16" height="20" aria-hidden="true" focusable="false">
|
|
11
|
-
<path d="M1 1v16l4.2-4 2.9 6.2 2.6-1.2-2.9-6.1H14Z" stroke-width="1.2" stroke-linejoin="round" />
|
|
12
|
-
</svg>`;
|
|
13
|
-
var move = (name, ms, easing) => unsafeCSS(`--jt: var(--impakt-motion-journey-${name}-duration, ${ms}ms); --je: var(--impakt-motion-journey-${name}-easing, ${easing});`);
|
|
14
|
-
var showAt = (k) => `clamp(0, min(calc(1 + var(--jp) - ${k}), calc(1 - var(--jp) + ${k})), 1)`;
|
|
15
|
-
var ImpaktJourneyButton = class extends ImpaktElement {
|
|
16
|
-
constructor() {
|
|
17
|
-
super();
|
|
18
|
-
this.sections = [];
|
|
19
|
-
this.frame = 0;
|
|
20
|
-
this.onScroll = () => {
|
|
21
|
-
if (this.frame) return;
|
|
22
|
-
this.frame = requestAnimationFrame(() => {
|
|
23
|
-
this.frame = 0;
|
|
24
|
-
this.scrub();
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
this.stage = "live";
|
|
28
|
-
this.label = "";
|
|
29
|
-
this.href = "";
|
|
30
|
-
this.decorative = false;
|
|
31
|
-
this.track = "";
|
|
32
|
-
this.code = {};
|
|
33
|
-
this.annotations = false;
|
|
34
|
-
this.captions = [];
|
|
35
|
-
this.marginNote = "";
|
|
36
|
-
this.specs = [];
|
|
37
|
-
this.markWidth = "400";
|
|
38
|
-
this.markHeight = "96";
|
|
39
|
-
}
|
|
40
|
-
static {
|
|
41
|
-
this.properties = {
|
|
42
|
-
stage: { type: String, reflect: true },
|
|
43
|
-
label: { type: String },
|
|
44
|
-
href: { type: String },
|
|
45
|
-
decorative: { type: Boolean, reflect: true },
|
|
46
|
-
track: { type: String },
|
|
47
|
-
code: { type: Array },
|
|
48
|
-
annotations: { type: Boolean, reflect: true },
|
|
49
|
-
captions: { type: Array },
|
|
50
|
-
marginNote: { type: String, attribute: "margin-note" },
|
|
51
|
-
specs: { type: Array },
|
|
52
|
-
markWidth: { type: String, attribute: "mark-width" },
|
|
53
|
-
markHeight: { type: String, attribute: "mark-height" }
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
static {
|
|
57
|
-
this.styles = [
|
|
58
|
-
...ImpaktElement.styles,
|
|
59
|
-
focusRing,
|
|
60
|
-
css`
|
|
61
|
-
:host {
|
|
62
|
-
display: block; inline-size: min(100%, 35rem); container-type: inline-size;
|
|
63
|
-
--impakt-journey-accent: ${token("color.accent.default", "#ffd43b")}; --impakt-journey-on-accent: ${token("color.accent.on", "#1a1a1a")};
|
|
64
|
-
--hand: var(--impakt-font-family-hand, ${t.fontBody});
|
|
65
|
-
${move("flatten", 640, "cubic-bezier(0.65, 0, 0.35, 1)")}
|
|
66
|
-
}
|
|
67
|
-
/* The move into a stage takes that move's timing; back out of it, the same move runs in reverse. */
|
|
68
|
-
:host([stage='component']) { ${move("ink-in", 560, "cubic-bezier(0.22, 1, 0.36, 1)")} }
|
|
69
|
-
:host([stage='code']) { ${move("compile", 720, "cubic-bezier(0.83, 0, 0.17, 1)")} }
|
|
70
|
-
:host([stage='live']) { ${move("ship", 600, "cubic-bezier(0.34, 1.56, 0.64, 1)")} }
|
|
71
|
-
/* About 14 wide to 9 tall at any width. Every size inside is a share of the width (cqi). */
|
|
72
|
-
.frame { position: relative; aspect-ratio: 14 / 9; }
|
|
73
|
-
/* Each plate is one stage's shape. Only its opacity and transform ever change. */
|
|
74
|
-
.plate { position: absolute; box-sizing: border-box; opacity: 0; pointer-events: none; transition: opacity var(--jt) var(--je), transform var(--jt) var(--je); }
|
|
75
|
-
.bar { inset-inline-start: 14.29cqi; inline-size: 71.43cqi; inset-block-start: calc(50% - 8.57cqi); block-size: 17.14cqi; }
|
|
76
|
-
.note { inset-inline-start: 22cqi; inset-block-start: 9cqi; inline-size: 46cqi; block-size: 46cqi; background: var(--impakt-journey-accent); box-shadow: 0 1.1rem 2.2rem rgb(0 0 0 / 0.18); transform: rotate(-4deg); }
|
|
77
|
-
.wire { background: ${t.surfaceCard}; border: ${t.borderThin} dashed ${t.textMuted}; }
|
|
78
|
-
.wire svg { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; color: ${t.rule}; }
|
|
79
|
-
.solid { background: var(--impakt-journey-accent); transform: scale(0.92); }
|
|
80
|
-
.shadow { box-shadow: 0 0.9rem 1.75rem rgb(0 0 0 / 0.22); transform: scale(0.9); }
|
|
81
|
-
:host(:is([stage='component'], [stage='live'])) .solid, :host([stage='live']) .shadow { transform: none; }
|
|
82
|
-
/* The code window is the raised ink and its muted words, a pair the theme measures, so it stays a dark window on paper and on an ink band alike. */
|
|
83
|
-
.window { inset-inline: 14.29cqi; inset-block: 8cqi; padding: 4cqi; background: var(--impakt-color-surface-ink-raised, ${t.text}); border: ${t.borderThin} solid var(--impakt-color-line-inverse, transparent); border-radius: ${t.radius}; font-family: ${t.fontMono}; font-size: clamp(0.625rem, 2.15cqi, 0.8125rem); line-height: 1.6; color: var(--impakt-color-text-inverse-muted, color-mix(in srgb, ${t.surfaceCard} 78%, ${t.text})); white-space: pre; overflow: hidden; display: grid; grid-template-rows: minmax(0, 1fr) 44px minmax(0, 1fr); }
|
|
84
|
-
/* On a small button the lines furthest from the words are cut off, so a line never runs under the words. */
|
|
85
|
-
.window .before { align-self: end; display: flex; flex-direction: column; justify-content: flex-end; max-block-size: 100%; overflow: hidden; }
|
|
86
|
-
.window .after { align-self: start; display: flex; flex-direction: column; max-block-size: 100%; overflow: hidden; }
|
|
87
|
-
.window .comment { font-style: italic; }
|
|
88
|
-
.window .rule { display: block; block-size: 0.5em; margin-block: 0.55em; background: currentColor; opacity: 0.35; }
|
|
89
|
-
|
|
90
|
-
/* A stage that has passed shrinks toward the next shape as it fades; one still to come starts from the last. */
|
|
91
|
-
/* The note flattens without growing wider, so a shape that is not showing never reaches past the block (1.4.10). */
|
|
92
|
-
:host(:not([stage='note'])) .note { transform: rotate(0deg) scale(1, 0.45); }
|
|
93
|
-
:host([stage='note']) .wire { transform: rotate(-4deg) scale(0.6, 1.9); }
|
|
94
|
-
:host(:not([stage='code'])) .window { transform: scale(0.94, 0.5); }
|
|
95
|
-
:host([stage='note']) .note, :host([stage='wireframe']) .wire, :host(:is([stage='component'], [stage='live'])) .solid, :host([stage='code']) .window, :host([stage='live']) .shadow { opacity: 1; }
|
|
96
|
-
|
|
97
|
-
/* Scrubbed by the scroll, a plate's opacity follows the stage as a number, --jp, and only its shape still moves on its own. */
|
|
98
|
-
:host([scrub]) .plate { transition-property: transform; }
|
|
99
|
-
:host([scrub]) .note { opacity: ${unsafeCSS(showAt(0))}; }
|
|
100
|
-
:host([scrub]) .wire { opacity: ${unsafeCSS(showAt(1))}; }
|
|
101
|
-
:host([scrub]) .solid { opacity: max(${unsafeCSS(showAt(2))}, ${unsafeCSS(showAt(4))}); }
|
|
102
|
-
:host([scrub]) .window { opacity: ${unsafeCSS(showAt(3))}; }
|
|
103
|
-
:host([scrub]) .shadow { opacity: ${unsafeCSS(showAt(4))}; }
|
|
104
|
-
|
|
105
|
-
/* The words. One element at every stage: a link, or a picture of one. */
|
|
106
|
-
.words { position: absolute; inset-inline-start: 14.29cqi; inline-size: 71.43cqi; inset-block-start: calc(50% - 8.57cqi); box-sizing: border-box; min-block-size: max(44px, 17.14cqi); display: flex; align-items: center; justify-content: space-between; gap: ${space(4)}; padding-inline: 4.3cqi; font-family: ${t.fontBody}; font-size: clamp(0.9375rem, 3.57cqi, 1.25rem); font-weight: ${fontWeight("medium")}; line-height: 1.2; color: var(--impakt-journey-on-accent); text-decoration: none; transition: color var(--jt) var(--je), transform var(--jt) var(--je); }
|
|
107
|
-
.arrow { flex: none; }
|
|
108
|
-
/* At the note stage the words are handwritten, bold, with a line drawn under them. */
|
|
109
|
-
:host([stage='note']) .words { inset-inline-start: 22cqi; inset-block-start: 9cqi; inline-size: 46cqi; min-block-size: 46cqi; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 4.5cqi; font-family: var(--hand); font-size: clamp(1.25rem, 5.4cqi, 2rem); font-weight: ${fontWeight("bold")}; line-height: 1.1; letter-spacing: -0.01em; transform: rotate(-4deg); }
|
|
110
|
-
:host([stage='note']) .text::after { content: ''; display: block; block-size: 0.28em; margin-block-start: 0.12em; inline-size: 92%; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 10' preserveAspectRatio='none'%3E%3Cpath d='M2 6c30-4 60-5 98-3s66 3 98-1' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 10' preserveAspectRatio='none'%3E%3Cpath d='M2 6c30-4 60-5 98-3s66 3 98-1' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
|
|
111
|
-
:host([stage='note']) .arrow { align-self: flex-end; }
|
|
112
|
-
:host([stage='wireframe']) .words { justify-content: center; font-family: ${t.fontMono}; font-size: clamp(0.6875rem, 2.5cqi, 0.875rem); font-weight: ${fontWeight("regular")}; color: ${t.textMuted}; }
|
|
113
|
-
:host([stage='code']) .words { inset-inline-start: 14.29cqi; inline-size: 71.43cqi; justify-content: flex-start; min-block-size: 44px; inset-block-start: calc(50% - 22px); padding-inline: calc(4cqi + 3ch) 4cqi; font-family: ${t.fontMono}; font-size: clamp(0.625rem, 2.15cqi, 0.8125rem); font-weight: ${fontWeight("regular")}; color: var(--impakt-journey-code-words, var(--ik-ink-inverse, ${t.surfaceCard})); }
|
|
114
|
-
:host([stage='code']) .words .arrow { display: none; }
|
|
115
|
-
/* Live, it answers a pointer: it lifts when pointed at and sits when pressed, and its fill deepens a little. */
|
|
116
|
-
:host([stage='live']) .frame:has(a.words:hover) .solid { background: color-mix(in srgb, var(--impakt-journey-accent) 90%, ${t.text}); }
|
|
117
|
-
:host([stage='live']) a.words:hover { transform: translateY(-2px); transition: color 180ms, transform var(--impakt-motion-journey-lift-duration, 180ms) var(--impakt-motion-journey-lift-easing, cubic-bezier(0.2, 0, 0, 1)); }
|
|
118
|
-
:host([stage='live']) a.words:active { transform: translateY(1px); transition: color 140ms, transform var(--impakt-motion-journey-press-duration, 140ms) var(--impakt-motion-journey-press-easing, cubic-bezier(0.4, 0, 0.2, 1)); }
|
|
119
|
-
a.words:focus-visible { outline: none; box-shadow: ${t.focusShadow}; }
|
|
120
|
-
|
|
121
|
-
/* The design notes. Each shows at its own stages, and none is read. */
|
|
122
|
-
.ann { position: absolute; opacity: 0; pointer-events: none; transition: opacity var(--jt) var(--je); color: ${t.text}; }
|
|
123
|
-
.caption { inset-block-start: 0; inset-inline-start: 0; font-family: ${t.fontMono}; font-size: 0.6875rem; letter-spacing: ${t.trackingWide}; text-transform: uppercase; color: ${t.textMuted}; white-space: nowrap; }
|
|
124
|
-
.caption span { position: absolute; inset-block-start: 0; inset-inline-start: 0; opacity: 0; transition: opacity var(--jt) var(--je); }
|
|
125
|
-
:host([stage='note']) .caption span:nth-child(1), :host([stage='wireframe']) .caption span:nth-child(2), :host([stage='component']) .caption span:nth-child(3), :host([stage='code']) .caption span:nth-child(4), :host([stage='live']) .caption span:nth-child(5) { opacity: 1; }
|
|
126
|
-
.caption { opacity: 1; }
|
|
127
|
-
.margin { inset-inline-start: 71cqi; inset-block-start: 10cqi; inline-size: 27cqi; font-family: var(--hand); font-size: clamp(0.75rem, 2.9cqi, 1rem); line-height: 1.25; transform: rotate(4deg); }
|
|
128
|
-
.width { inset-inline-start: 14.29cqi; inline-size: 71.43cqi; inset-block-start: calc(50% - 8.57cqi - 5cqi); block-size: 2cqi; border-inline: 1px solid currentColor; }
|
|
129
|
-
.width::before { content: ''; position: absolute; inset-inline: 0; inset-block-start: 50%; border-block-start: 1px solid currentColor; }
|
|
130
|
-
.width b, .height b { position: absolute; font-family: ${t.fontMono}; font-size: 0.6875rem; font-weight: ${fontWeight("regular")}; line-height: 1; background: var(--impakt-journey-mark-ground, ${t.surfaceCard}); padding-inline: 0.4em; }
|
|
131
|
-
.width b { inset-block-start: 50%; inset-inline-start: 50%; transform: translate(-50%, -50%); }
|
|
132
|
-
.height { inset-inline-start: calc(14.29cqi + 71.43cqi + 2.5cqi); inline-size: 2cqi; inset-block-start: calc(50% - 8.57cqi); block-size: 17.14cqi; border-block: 1px solid currentColor; }
|
|
133
|
-
.height::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 50%; border-inline-start: 1px solid currentColor; }
|
|
134
|
-
.height b { inset-block-start: 50%; inset-inline-start: calc(100% + 0.2em); transform: translateY(-50%); background: none; }
|
|
135
|
-
.specs { inset-inline-start: 14.29cqi; inset-block-start: calc(50% + 8.57cqi + 3cqi); display: flex; flex-wrap: wrap; gap: 1.5cqi; inline-size: 75cqi; }
|
|
136
|
-
.specs span { padding: 0.15em 0.6em; font-family: ${t.fontMono}; font-size: clamp(0.5625rem, 1.9cqi, 0.6875rem); letter-spacing: ${t.trackingWide}; text-transform: uppercase; white-space: nowrap; border: 1px solid currentColor; background: ${t.surfaceCard}; }
|
|
137
|
-
.cursor { inset-inline-start: calc(14.29cqi + 71.43cqi - 4cqi); inset-block-start: calc(50% + 8.57cqi - 4cqi); }
|
|
138
|
-
.pointer { display: block; fill: ${t.text}; stroke: ${t.surfaceCard}; }
|
|
139
|
-
:host([stage='note']) .margin, :host(:is([stage='wireframe'], [stage='component'])) :is(.width, .height), :host([stage='component']) .specs, :host([stage='live']) .cursor { opacity: 1; }
|
|
140
|
-
|
|
141
|
-
@media (prefers-reduced-motion: reduce) {
|
|
142
|
-
.plate, .words, .ann, .caption span { transition: none; }
|
|
143
|
-
:host([stage='live']) a.words:hover, :host([stage='live']) a.words:active { transform: none; transition: none; }
|
|
144
|
-
}
|
|
145
|
-
@media (forced-colors: active) {
|
|
146
|
-
.plate { forced-color-adjust: none; }
|
|
147
|
-
.note, .solid { background: Highlight; }
|
|
148
|
-
.window { background: Canvas; border: 1px solid CanvasText; color: CanvasText; }
|
|
149
|
-
.wire { background: Canvas; border-color: CanvasText; }
|
|
150
|
-
.words, :host([stage='wireframe']) .words, :host([stage='code']) .words { color: LinkText; forced-color-adjust: none; }
|
|
151
|
-
:host(:is([stage='note'], [stage='component'], [stage='live'])) .words { color: HighlightText; }
|
|
152
|
-
.ann { color: CanvasText; }
|
|
153
|
-
}
|
|
154
|
-
`
|
|
155
|
-
];
|
|
156
|
-
}
|
|
157
|
-
connectedCallback() {
|
|
158
|
-
super.connectedCallback();
|
|
159
|
-
if (this.hasUpdated) this.watch();
|
|
160
|
-
}
|
|
161
|
-
disconnectedCallback() {
|
|
162
|
-
super.disconnectedCallback();
|
|
163
|
-
this.observer?.disconnect();
|
|
164
|
-
this.observer = void 0;
|
|
165
|
-
this.stopScrub();
|
|
166
|
-
}
|
|
167
|
-
willUpdate(changed) {
|
|
168
|
-
if (changed.has("stage") && !isStage(this.stage)) this.stage = "live";
|
|
169
|
-
}
|
|
170
|
-
updated(changed) {
|
|
171
|
-
if (changed.has("track")) this.watch();
|
|
172
|
-
}
|
|
173
|
-
/** Follow the sections named by `track`: the one across the middle of the screen sets the stage. */
|
|
174
|
-
watch() {
|
|
175
|
-
this.observer?.disconnect();
|
|
176
|
-
this.observer = void 0;
|
|
177
|
-
this.stopScrub();
|
|
178
|
-
this.sections = [];
|
|
179
|
-
if (!this.track || !this.isConnected || typeof IntersectionObserver !== "function") return;
|
|
180
|
-
let sections;
|
|
181
|
-
try {
|
|
182
|
-
sections = Array.from(this.ownerDocument.querySelectorAll(this.track)).filter((el) => isStage(el.getAttribute("data-journey-stage")));
|
|
183
|
-
} catch {
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
if (!sections.length) return;
|
|
187
|
-
this.sections = sections;
|
|
188
|
-
this.observer = new IntersectionObserver((entries) => this.crossed(entries), { rootMargin: "-50% 0px -50% 0px", threshold: 0 });
|
|
189
|
-
for (const section of sections) this.observer.observe(section);
|
|
190
|
-
this.startScrub();
|
|
191
|
-
}
|
|
192
|
-
crossed(entries) {
|
|
193
|
-
const entry = entries.find((e) => e.isIntersecting);
|
|
194
|
-
const stage = entry?.target.getAttribute("data-journey-stage");
|
|
195
|
-
if (isStage(stage)) this.become(stage);
|
|
196
|
-
}
|
|
197
|
-
become(stage) {
|
|
198
|
-
if (stage === this.stage) return;
|
|
199
|
-
this.stage = stage;
|
|
200
|
-
this.dispatchEvent(new CustomEvent("impakt-journey-stage", { detail: { stage }, bubbles: true, composed: true }));
|
|
201
|
-
}
|
|
202
|
-
/** Scrub between stages with the scroll, unless reduced motion is asked for. */
|
|
203
|
-
startScrub() {
|
|
204
|
-
const view = this.ownerDocument.defaultView;
|
|
205
|
-
if (!view || typeof view.requestAnimationFrame !== "function" || view.matchMedia?.("(prefers-reduced-motion: reduce)").matches) return;
|
|
206
|
-
view.addEventListener("scroll", this.onScroll, { passive: true });
|
|
207
|
-
view.addEventListener("resize", this.onScroll, { passive: true });
|
|
208
|
-
this.style.setProperty("--jp", String(indexOf(this.stage)));
|
|
209
|
-
this.toggleAttribute("scrub", true);
|
|
210
|
-
}
|
|
211
|
-
stopScrub() {
|
|
212
|
-
const view = this.ownerDocument?.defaultView;
|
|
213
|
-
view?.removeEventListener("scroll", this.onScroll);
|
|
214
|
-
view?.removeEventListener("resize", this.onScroll);
|
|
215
|
-
if (this.frame) cancelAnimationFrame(this.frame);
|
|
216
|
-
this.frame = 0;
|
|
217
|
-
this.removeAttribute("scrub");
|
|
218
|
-
this.style.removeProperty("--jp");
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* The stage as a number. The section across the middle of the screen gives
|
|
222
|
-
* the whole part; how far the next section has risen toward the middle gives
|
|
223
|
-
* the rest, so the move is complete as the next section crosses it.
|
|
224
|
-
*/
|
|
225
|
-
scrub() {
|
|
226
|
-
const view = this.ownerDocument.defaultView;
|
|
227
|
-
if (!view || !this.sections.length) return;
|
|
228
|
-
const middle = view.innerHeight / 2;
|
|
229
|
-
const tops = this.sections.map((s) => s.getBoundingClientRect().top);
|
|
230
|
-
let at = 0;
|
|
231
|
-
tops.forEach((top, i) => {
|
|
232
|
-
if (top <= middle) at = i;
|
|
233
|
-
});
|
|
234
|
-
const stageAt = (i) => indexOf(this.sections[i].getAttribute("data-journey-stage"));
|
|
235
|
-
const next = at + 1 < this.sections.length ? at + 1 : at;
|
|
236
|
-
const span = tops[next] - tops[at];
|
|
237
|
-
const f = next === at || span <= 0 ? 0 : Math.min(1, Math.max(0, (middle - tops[at]) / span));
|
|
238
|
-
const p = stageAt(at) + f * (stageAt(next) - stageAt(at));
|
|
239
|
-
this.style.setProperty("--jp", p.toFixed(3));
|
|
240
|
-
this.become(JOURNEY_STAGES[Math.round(p)]);
|
|
241
|
-
}
|
|
242
|
-
lines(lines, fallback) {
|
|
243
|
-
return lines?.length ? lines.map((line) => html`<span class=${line.trim().startsWith("//") ? "comment" : ""}>${line}</span>`) : Array.from({ length: fallback }, (_, i) => html`<span class="rule" style=${`inline-size:${[58, 72, 44][i % 3]}%`}></span>`);
|
|
244
|
-
}
|
|
245
|
-
/** The design notes around the button. All decoration. */
|
|
246
|
-
notes() {
|
|
247
|
-
const captions = this.captions?.length ? this.captions : [say("Note \u2014 Discover"), say("Wireframe \u2014 Design low-fi"), say("Component \u2014 Design hi-fi"), say("Code \u2014 Build"), say("Live \u2014 Launch")];
|
|
248
|
-
const specs = this.specs?.length ? this.specs : [say("Fill \xB7 Accent/Signal"), say("Radius \xB7 0"), say("Type \xB7 Archivo 20")];
|
|
249
|
-
return html`<span class="ann caption" part="caption">${JOURNEY_STAGES.map((_, i) => html`<span>${String(i + 1).padStart(2, "0")} · ${captions[i] ?? ""}</span>`)}</span>
|
|
250
|
-
<span class="ann margin" part="margin-note">${this.marginNote || say("make it the biggest thing on the page")}</span>
|
|
251
|
-
<span class="ann width"><b>${this.markWidth}</b></span>
|
|
252
|
-
<span class="ann height"><b>${this.markHeight}</b></span>
|
|
253
|
-
<span class="ann specs" part="specs">${specs.map((spec) => html`<span>${spec}</span>`)}</span>
|
|
254
|
-
<span class="ann cursor">${pointer}</span>`;
|
|
255
|
-
}
|
|
256
|
-
render() {
|
|
257
|
-
const words = html`<span class="text">${this.label}</span>${arrow}`;
|
|
258
|
-
return html`<div class="frame" part="frame" aria-hidden=${this.decorative ? "true" : nothing}>
|
|
259
|
-
<span class="plate note" aria-hidden="true"></span>
|
|
260
|
-
<span class="plate bar wire" aria-hidden="true"><svg viewBox="0 0 100 100" preserveAspectRatio="none" fill="none" stroke="currentColor" focusable="false"><path d="M0 0 100 100M0 100 100 0" vector-effect="non-scaling-stroke" /></svg></span>
|
|
261
|
-
<span class="plate bar shadow" aria-hidden="true"></span>
|
|
262
|
-
<span class="plate bar solid" aria-hidden="true"></span>
|
|
263
|
-
<span class="plate window" aria-hidden="true"><span class="before">${this.lines(this.code?.before, 3)}</span><span></span><span class="after">${this.lines(this.code?.after, 2)}</span></span>
|
|
264
|
-
${this.annotations ? html`<span class="notes" aria-hidden="true">${this.notes()}</span>` : nothing}
|
|
265
|
-
${this.decorative || !this.href ? html`<span class="words" part="button">${words}</span>` : html`<a class="words" part="button" href=${this.href}>${words}</a>`}
|
|
266
|
-
</div>`;
|
|
267
|
-
}
|
|
268
|
-
};
|
|
269
|
-
customElements.define("impakt-journey-button", ImpaktJourneyButton);
|
|
270
|
-
|
|
271
|
-
export {
|
|
272
|
-
JOURNEY_STAGES,
|
|
273
|
-
ImpaktJourneyButton
|
|
274
|
-
};
|
|
275
|
-
//# sourceMappingURL=chunk-GRKPKJZH.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/journey.ts"],"sourcesContent":["/**\n * The journey button: a site's one call to action, drawn at the stage a\n * section of the page is about.\n */\nimport { css, html, nothing, unsafeCSS, type TemplateResult } from 'lit';\nimport { ImpaktElement, focusRing, fontWeight, say, space, t, token } from '@atomic-ui/ui';\n\n/** The stages a button passes through on its way to being live, in order. */\nexport const JOURNEY_STAGES = ['note', 'wireframe', 'component', 'code', 'live'] as const;\nexport type JourneyStage = (typeof JOURNEY_STAGES)[number];\n\nconst isStage = (value: unknown): value is JourneyStage => (JOURNEY_STAGES as readonly string[]).includes(value as string);\nconst indexOf = (stage: JourneyStage): number => JOURNEY_STAGES.indexOf(stage);\n\n/** The arrow after the words. Drawn, so no font has to hold the glyph. */\nconst arrow = html`<svg class=\"arrow\" viewBox=\"0 0 20 12\" width=\"20\" height=\"12\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" aria-hidden=\"true\" focusable=\"false\">\n <path d=\"M0 6h18M13 1l5 5-5 5\" />\n</svg>`;\n\n/** A pointer, drawn at the live button when the annotations are on. */\nconst pointer = html`<svg class=\"pointer\" viewBox=\"0 0 16 20\" width=\"16\" height=\"20\" aria-hidden=\"true\" focusable=\"false\">\n <path d=\"M1 1v16l4.2-4 2.9 6.2 2.6-1.2-2.9-6.1H14Z\" stroke-width=\"1.2\" stroke-linejoin=\"round\" />\n</svg>`;\n\n/** One move of the motion spec, read from its tokens with the spec's values as the fallback. */\nconst move = (name: string, ms: number, easing: string) =>\n unsafeCSS(`--jt: var(--impakt-motion-journey-${name}-duration, ${ms}ms); --je: var(--impakt-motion-journey-${name}-easing, ${easing});`);\n\n/**\n * How much of a plate shows while the page is scrubbed: 1 at its own stage,\n * fading to 0 one stage either side. `--jp` is the stage as a number, 0 to 4.\n */\nconst showAt = (k: number) => `clamp(0, min(calc(1 + var(--jp) - ${k}), calc(1 - var(--jp) + ${k})), 1)`;\n\n/**\n * A call to action drawn as the thing it once was: a sticky note from a\n * workshop, a wireframe box, a designed component, the code that renders it,\n * and at last the live button. A page shows it at the stage each section is\n * about, so the same button is seen being made as the page is read.\n *\n * **It is the same link at every stage.** Whatever it is drawn as, it is one\n * `<a>` whose name is its words, so a screen reader and a keyboard meet an\n * ordinary link; the note, the wireframe cross, the measuring marks and the\n * lines of code around it are decoration and are hidden (1.3.1, 4.1.2). Its\n * target is at least 44px tall at every stage (2.5.8).\n *\n * **A page that shows it more than once sets `decorative` on the copies.** A\n * decorative one is a picture of the button, not a control: it has no link\n * and is hidden from a screen reader, so the page does not hold five links\n * that say the same thing (2.4.4).\n *\n * **It keeps its shape as it scales.** The drawing is about 14 wide to 9\n * tall at any width, 560 by 360 on a wide page and 347 by 223 on a phone, and\n * everything in it is sized from its own width.\n *\n * **One button can follow the page.** Give `track` a selector for the page's\n * sections, each carrying `data-journey-stage`, and the button takes the stage\n * of whichever section is across the middle of the screen; an\n * IntersectionObserver watches for that. Between two sections the move is\n * scrubbed by the scroll: the next stage fades in as the next section rises,\n * and is complete as it crosses the middle of the screen. The scroll is read\n * at most once a frame, and only while a tracked section is on screen.\n *\n * **Each move has its own timing**, from the motion spec: flatten 640ms, ink\n * in 560ms, compile 720ms, ship 600ms with an overshoot, lift 180ms on hover\n * and press 140ms. Each is read from `--impakt-motion-journey-<move>-duration`\n * and `-easing`. **Only transforms, opacity and colour move**, so a change of\n * stage costs no layout. With reduced motion asked for, a stage cuts straight\n * to the next, nothing is scrubbed, and pointing at the live button changes\n * its colour only (2.3.3).\n *\n * **`annotations` draws the design notes around it**, as the site's motion\n * frames show: the stage's caption above, a handwritten note in the margin at\n * the note stage, the width and height marks at the wireframe and component,\n * the spec tags under the component and a pointer at the live button. They\n * are decoration and are hidden from a screen reader. Leave it off when the\n * button is a plain call to action.\n *\n * The words on every fill are a pair the tokens already measured: the accent\n * with its own text colour, and the text colour with the card colour (1.4.3).\n * A brand whose ink is dark may colour the words in the code window by\n * setting `--impakt-journey-code-words`.\n *\n * @category action\n * @icon button\n * @fires {CustomEvent<{ stage: JourneyStage }>} impakt-journey-stage - When a tracked button changes stage as the page scrolls.\n */\nexport class ImpaktJourneyButton extends ImpaktElement {\n static properties = {\n stage: { type: String, reflect: true },\n label: { type: String },\n href: { type: String },\n decorative: { type: Boolean, reflect: true },\n track: { type: String },\n code: { type: Array },\n annotations: { type: Boolean, reflect: true },\n captions: { type: Array },\n marginNote: { type: String, attribute: 'margin-note' },\n specs: { type: Array },\n markWidth: { type: String, attribute: 'mark-width' },\n markHeight: { type: String, attribute: 'mark-height' },\n };\n /** What the button is drawn as. */\n declare stage: JourneyStage;\n /** The button's words, such as \"Book a 30-minute call\". */\n declare label: string;\n /** Where the button goes. */\n declare href: string;\n /** Draw it as a picture only, with no link, for a page that already has the real button. */\n declare decorative: boolean;\n /**\n * A selector for the sections of the page that each carry\n * `data-journey-stage`. The button then takes the stage of the section\n * across the middle of the screen. Leave empty to set `stage` by hand.\n */\n declare track: string;\n /**\n * Lines of code drawn around the words at the `code` stage, split where the\n * words go: the lines before, then the lines after. They are decoration and\n * are not read. A line that starts with `//` is drawn dimmer, as a comment.\n * Left empty, plain bars are drawn instead.\n */\n declare code: { before?: string[]; after?: string[] };\n /** Draw the design notes around the button: captions, marks, spec tags, a margin note and a pointer. */\n declare annotations: boolean;\n /** With `annotations`: the caption above each stage, in order, such as \"Note — Discover\". Numbered for you. */\n declare captions: string[];\n /** With `annotations`: the handwritten note beside the sticky note. */\n declare marginNote: string;\n /** With `annotations`: the tags under the component, such as \"Fill · Accent/Signal\". */\n declare specs: string[];\n /** With `annotations`: the width written on the width mark, such as \"400\". */\n declare markWidth: string;\n /** With `annotations`: the height written on the height mark, such as \"96\". */\n declare markHeight: string;\n\n constructor() {\n super();\n this.stage = 'live';\n this.label = '';\n this.href = '';\n this.decorative = false;\n this.track = '';\n this.code = {};\n this.annotations = false;\n this.captions = [];\n this.marginNote = '';\n this.specs = [];\n this.markWidth = '400';\n this.markHeight = '96';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n css`\n :host {\n display: block; inline-size: min(100%, 35rem); container-type: inline-size;\n --impakt-journey-accent: ${token('color.accent.default', '#ffd43b')}; --impakt-journey-on-accent: ${token('color.accent.on', '#1a1a1a')};\n --hand: var(--impakt-font-family-hand, ${t.fontBody});\n ${move('flatten', 640, 'cubic-bezier(0.65, 0, 0.35, 1)')}\n }\n /* The move into a stage takes that move's timing; back out of it, the same move runs in reverse. */\n :host([stage='component']) { ${move('ink-in', 560, 'cubic-bezier(0.22, 1, 0.36, 1)')} }\n :host([stage='code']) { ${move('compile', 720, 'cubic-bezier(0.83, 0, 0.17, 1)')} }\n :host([stage='live']) { ${move('ship', 600, 'cubic-bezier(0.34, 1.56, 0.64, 1)')} }\n /* About 14 wide to 9 tall at any width. Every size inside is a share of the width (cqi). */\n .frame { position: relative; aspect-ratio: 14 / 9; }\n /* Each plate is one stage's shape. Only its opacity and transform ever change. */\n .plate { position: absolute; box-sizing: border-box; opacity: 0; pointer-events: none; transition: opacity var(--jt) var(--je), transform var(--jt) var(--je); }\n .bar { inset-inline-start: 14.29cqi; inline-size: 71.43cqi; inset-block-start: calc(50% - 8.57cqi); block-size: 17.14cqi; }\n .note { inset-inline-start: 22cqi; inset-block-start: 9cqi; inline-size: 46cqi; block-size: 46cqi; background: var(--impakt-journey-accent); box-shadow: 0 1.1rem 2.2rem rgb(0 0 0 / 0.18); transform: rotate(-4deg); }\n .wire { background: ${t.surfaceCard}; border: ${t.borderThin} dashed ${t.textMuted}; }\n .wire svg { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; color: ${t.rule}; }\n .solid { background: var(--impakt-journey-accent); transform: scale(0.92); }\n .shadow { box-shadow: 0 0.9rem 1.75rem rgb(0 0 0 / 0.22); transform: scale(0.9); }\n :host(:is([stage='component'], [stage='live'])) .solid, :host([stage='live']) .shadow { transform: none; }\n /* The code window is the raised ink and its muted words, a pair the theme measures, so it stays a dark window on paper and on an ink band alike. */\n .window { inset-inline: 14.29cqi; inset-block: 8cqi; padding: 4cqi; background: var(--impakt-color-surface-ink-raised, ${t.text}); border: ${t.borderThin} solid var(--impakt-color-line-inverse, transparent); border-radius: ${t.radius}; font-family: ${t.fontMono}; font-size: clamp(0.625rem, 2.15cqi, 0.8125rem); line-height: 1.6; color: var(--impakt-color-text-inverse-muted, color-mix(in srgb, ${t.surfaceCard} 78%, ${t.text})); white-space: pre; overflow: hidden; display: grid; grid-template-rows: minmax(0, 1fr) 44px minmax(0, 1fr); }\n /* On a small button the lines furthest from the words are cut off, so a line never runs under the words. */\n .window .before { align-self: end; display: flex; flex-direction: column; justify-content: flex-end; max-block-size: 100%; overflow: hidden; }\n .window .after { align-self: start; display: flex; flex-direction: column; max-block-size: 100%; overflow: hidden; }\n .window .comment { font-style: italic; }\n .window .rule { display: block; block-size: 0.5em; margin-block: 0.55em; background: currentColor; opacity: 0.35; }\n\n /* A stage that has passed shrinks toward the next shape as it fades; one still to come starts from the last. */\n /* The note flattens without growing wider, so a shape that is not showing never reaches past the block (1.4.10). */\n :host(:not([stage='note'])) .note { transform: rotate(0deg) scale(1, 0.45); }\n :host([stage='note']) .wire { transform: rotate(-4deg) scale(0.6, 1.9); }\n :host(:not([stage='code'])) .window { transform: scale(0.94, 0.5); }\n :host([stage='note']) .note, :host([stage='wireframe']) .wire, :host(:is([stage='component'], [stage='live'])) .solid, :host([stage='code']) .window, :host([stage='live']) .shadow { opacity: 1; }\n\n /* Scrubbed by the scroll, a plate's opacity follows the stage as a number, --jp, and only its shape still moves on its own. */\n :host([scrub]) .plate { transition-property: transform; }\n :host([scrub]) .note { opacity: ${unsafeCSS(showAt(0))}; }\n :host([scrub]) .wire { opacity: ${unsafeCSS(showAt(1))}; }\n :host([scrub]) .solid { opacity: max(${unsafeCSS(showAt(2))}, ${unsafeCSS(showAt(4))}); }\n :host([scrub]) .window { opacity: ${unsafeCSS(showAt(3))}; }\n :host([scrub]) .shadow { opacity: ${unsafeCSS(showAt(4))}; }\n\n /* The words. One element at every stage: a link, or a picture of one. */\n .words { position: absolute; inset-inline-start: 14.29cqi; inline-size: 71.43cqi; inset-block-start: calc(50% - 8.57cqi); box-sizing: border-box; min-block-size: max(44px, 17.14cqi); display: flex; align-items: center; justify-content: space-between; gap: ${space(4)}; padding-inline: 4.3cqi; font-family: ${t.fontBody}; font-size: clamp(0.9375rem, 3.57cqi, 1.25rem); font-weight: ${fontWeight('medium')}; line-height: 1.2; color: var(--impakt-journey-on-accent); text-decoration: none; transition: color var(--jt) var(--je), transform var(--jt) var(--je); }\n .arrow { flex: none; }\n /* At the note stage the words are handwritten, bold, with a line drawn under them. */\n :host([stage='note']) .words { inset-inline-start: 22cqi; inset-block-start: 9cqi; inline-size: 46cqi; min-block-size: 46cqi; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 4.5cqi; font-family: var(--hand); font-size: clamp(1.25rem, 5.4cqi, 2rem); font-weight: ${fontWeight('bold')}; line-height: 1.1; letter-spacing: -0.01em; transform: rotate(-4deg); }\n :host([stage='note']) .text::after { content: ''; display: block; block-size: 0.28em; margin-block-start: 0.12em; inline-size: 92%; background: currentColor; -webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 10' preserveAspectRatio='none'%3E%3Cpath d='M2 6c30-4 60-5 98-3s66 3 98-1' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E\") center / 100% 100% no-repeat; mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 10' preserveAspectRatio='none'%3E%3Cpath d='M2 6c30-4 60-5 98-3s66 3 98-1' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E\") center / 100% 100% no-repeat; }\n :host([stage='note']) .arrow { align-self: flex-end; }\n :host([stage='wireframe']) .words { justify-content: center; font-family: ${t.fontMono}; font-size: clamp(0.6875rem, 2.5cqi, 0.875rem); font-weight: ${fontWeight('regular')}; color: ${t.textMuted}; }\n :host([stage='code']) .words { inset-inline-start: 14.29cqi; inline-size: 71.43cqi; justify-content: flex-start; min-block-size: 44px; inset-block-start: calc(50% - 22px); padding-inline: calc(4cqi + 3ch) 4cqi; font-family: ${t.fontMono}; font-size: clamp(0.625rem, 2.15cqi, 0.8125rem); font-weight: ${fontWeight('regular')}; color: var(--impakt-journey-code-words, var(--ik-ink-inverse, ${t.surfaceCard})); }\n :host([stage='code']) .words .arrow { display: none; }\n /* Live, it answers a pointer: it lifts when pointed at and sits when pressed, and its fill deepens a little. */\n :host([stage='live']) .frame:has(a.words:hover) .solid { background: color-mix(in srgb, var(--impakt-journey-accent) 90%, ${t.text}); }\n :host([stage='live']) a.words:hover { transform: translateY(-2px); transition: color 180ms, transform var(--impakt-motion-journey-lift-duration, 180ms) var(--impakt-motion-journey-lift-easing, cubic-bezier(0.2, 0, 0, 1)); }\n :host([stage='live']) a.words:active { transform: translateY(1px); transition: color 140ms, transform var(--impakt-motion-journey-press-duration, 140ms) var(--impakt-motion-journey-press-easing, cubic-bezier(0.4, 0, 0.2, 1)); }\n a.words:focus-visible { outline: none; box-shadow: ${t.focusShadow}; }\n\n /* The design notes. Each shows at its own stages, and none is read. */\n .ann { position: absolute; opacity: 0; pointer-events: none; transition: opacity var(--jt) var(--je); color: ${t.text}; }\n .caption { inset-block-start: 0; inset-inline-start: 0; font-family: ${t.fontMono}; font-size: 0.6875rem; letter-spacing: ${t.trackingWide}; text-transform: uppercase; color: ${t.textMuted}; white-space: nowrap; }\n .caption span { position: absolute; inset-block-start: 0; inset-inline-start: 0; opacity: 0; transition: opacity var(--jt) var(--je); }\n :host([stage='note']) .caption span:nth-child(1), :host([stage='wireframe']) .caption span:nth-child(2), :host([stage='component']) .caption span:nth-child(3), :host([stage='code']) .caption span:nth-child(4), :host([stage='live']) .caption span:nth-child(5) { opacity: 1; }\n .caption { opacity: 1; }\n .margin { inset-inline-start: 71cqi; inset-block-start: 10cqi; inline-size: 27cqi; font-family: var(--hand); font-size: clamp(0.75rem, 2.9cqi, 1rem); line-height: 1.25; transform: rotate(4deg); }\n .width { inset-inline-start: 14.29cqi; inline-size: 71.43cqi; inset-block-start: calc(50% - 8.57cqi - 5cqi); block-size: 2cqi; border-inline: 1px solid currentColor; }\n .width::before { content: ''; position: absolute; inset-inline: 0; inset-block-start: 50%; border-block-start: 1px solid currentColor; }\n .width b, .height b { position: absolute; font-family: ${t.fontMono}; font-size: 0.6875rem; font-weight: ${fontWeight('regular')}; line-height: 1; background: var(--impakt-journey-mark-ground, ${t.surfaceCard}); padding-inline: 0.4em; }\n .width b { inset-block-start: 50%; inset-inline-start: 50%; transform: translate(-50%, -50%); }\n .height { inset-inline-start: calc(14.29cqi + 71.43cqi + 2.5cqi); inline-size: 2cqi; inset-block-start: calc(50% - 8.57cqi); block-size: 17.14cqi; border-block: 1px solid currentColor; }\n .height::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 50%; border-inline-start: 1px solid currentColor; }\n .height b { inset-block-start: 50%; inset-inline-start: calc(100% + 0.2em); transform: translateY(-50%); background: none; }\n .specs { inset-inline-start: 14.29cqi; inset-block-start: calc(50% + 8.57cqi + 3cqi); display: flex; flex-wrap: wrap; gap: 1.5cqi; inline-size: 75cqi; }\n .specs span { padding: 0.15em 0.6em; font-family: ${t.fontMono}; font-size: clamp(0.5625rem, 1.9cqi, 0.6875rem); letter-spacing: ${t.trackingWide}; text-transform: uppercase; white-space: nowrap; border: 1px solid currentColor; background: ${t.surfaceCard}; }\n .cursor { inset-inline-start: calc(14.29cqi + 71.43cqi - 4cqi); inset-block-start: calc(50% + 8.57cqi - 4cqi); }\n .pointer { display: block; fill: ${t.text}; stroke: ${t.surfaceCard}; }\n :host([stage='note']) .margin, :host(:is([stage='wireframe'], [stage='component'])) :is(.width, .height), :host([stage='component']) .specs, :host([stage='live']) .cursor { opacity: 1; }\n\n @media (prefers-reduced-motion: reduce) {\n .plate, .words, .ann, .caption span { transition: none; }\n :host([stage='live']) a.words:hover, :host([stage='live']) a.words:active { transform: none; transition: none; }\n }\n @media (forced-colors: active) {\n .plate { forced-color-adjust: none; }\n .note, .solid { background: Highlight; }\n .window { background: Canvas; border: 1px solid CanvasText; color: CanvasText; }\n .wire { background: Canvas; border-color: CanvasText; }\n .words, :host([stage='wireframe']) .words, :host([stage='code']) .words { color: LinkText; forced-color-adjust: none; }\n :host(:is([stage='note'], [stage='component'], [stage='live'])) .words { color: HighlightText; }\n .ann { color: CanvasText; }\n }\n `,\n ];\n\n private observer?: IntersectionObserver;\n private sections: Element[] = [];\n private frame = 0;\n private readonly onScroll = (): void => {\n if (this.frame) return;\n this.frame = requestAnimationFrame(() => {\n this.frame = 0;\n this.scrub();\n });\n };\n\n connectedCallback(): void {\n super.connectedCallback();\n // The first render starts the watch; this is for a button taken off the page and put back.\n if (this.hasUpdated) this.watch();\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.observer?.disconnect();\n this.observer = undefined;\n this.stopScrub();\n }\n\n protected willUpdate(changed: Map<string, unknown>): void {\n // A stage that is not one of the five would draw nothing at all, so it falls back to the finished button.\n if (changed.has('stage') && !isStage(this.stage)) this.stage = 'live';\n }\n\n protected updated(changed: Map<string, unknown>): void {\n if (changed.has('track')) this.watch();\n }\n\n /** Follow the sections named by `track`: the one across the middle of the screen sets the stage. */\n private watch(): void {\n this.observer?.disconnect();\n this.observer = undefined;\n this.stopScrub();\n this.sections = [];\n if (!this.track || !this.isConnected || typeof IntersectionObserver !== 'function') return;\n let sections: Element[];\n try {\n sections = Array.from(this.ownerDocument.querySelectorAll(this.track)).filter((el) => isStage(el.getAttribute('data-journey-stage')));\n } catch {\n // Not a selector: nothing to follow.\n return;\n }\n if (!sections.length) return;\n this.sections = sections;\n // A line across the middle of the screen. A section is \"current\" while it crosses that line.\n this.observer = new IntersectionObserver((entries) => this.crossed(entries), { rootMargin: '-50% 0px -50% 0px', threshold: 0 });\n for (const section of sections) this.observer.observe(section);\n this.startScrub();\n }\n\n private crossed(entries: IntersectionObserverEntry[]): void {\n const entry = entries.find((e) => e.isIntersecting);\n const stage = entry?.target.getAttribute('data-journey-stage');\n if (isStage(stage)) this.become(stage);\n }\n\n private become(stage: JourneyStage): void {\n if (stage === this.stage) return;\n this.stage = stage;\n this.dispatchEvent(new CustomEvent('impakt-journey-stage', { detail: { stage }, bubbles: true, composed: true }));\n }\n\n /** Scrub between stages with the scroll, unless reduced motion is asked for. */\n private startScrub(): void {\n const view = this.ownerDocument.defaultView;\n if (!view || typeof view.requestAnimationFrame !== 'function' || view.matchMedia?.('(prefers-reduced-motion: reduce)').matches) return;\n view.addEventListener('scroll', this.onScroll, { passive: true });\n view.addEventListener('resize', this.onScroll, { passive: true });\n // It starts where the button is; the first scroll takes it from there.\n this.style.setProperty('--jp', String(indexOf(this.stage)));\n this.toggleAttribute('scrub', true);\n }\n\n private stopScrub(): void {\n const view = this.ownerDocument?.defaultView;\n view?.removeEventListener('scroll', this.onScroll);\n view?.removeEventListener('resize', this.onScroll);\n if (this.frame) cancelAnimationFrame(this.frame);\n this.frame = 0;\n this.removeAttribute('scrub');\n this.style.removeProperty('--jp');\n }\n\n /**\n * The stage as a number. The section across the middle of the screen gives\n * the whole part; how far the next section has risen toward the middle gives\n * the rest, so the move is complete as the next section crosses it.\n */\n private scrub(): void {\n const view = this.ownerDocument.defaultView;\n if (!view || !this.sections.length) return;\n const middle = view.innerHeight / 2;\n const tops = this.sections.map((s) => s.getBoundingClientRect().top);\n let at = 0;\n tops.forEach((top, i) => {\n if (top <= middle) at = i;\n });\n const stageAt = (i: number) => indexOf(this.sections[i]!.getAttribute('data-journey-stage') as JourneyStage);\n const next = at + 1 < this.sections.length ? at + 1 : at;\n const span = tops[next]! - tops[at]!;\n const f = next === at || span <= 0 ? 0 : Math.min(1, Math.max(0, (middle - tops[at]!) / span));\n const p = stageAt(at) + f * (stageAt(next) - stageAt(at));\n this.style.setProperty('--jp', p.toFixed(3));\n this.become(JOURNEY_STAGES[Math.round(p)]!);\n }\n\n private lines(lines: string[] | undefined, fallback: number): TemplateResult[] {\n return lines?.length\n ? lines.map((line) => html`<span class=${line.trim().startsWith('//') ? 'comment' : ''}>${line}</span>`)\n : Array.from({ length: fallback }, (_, i) => html`<span class=\"rule\" style=${`inline-size:${[58, 72, 44][i % 3]}%`}></span>`);\n }\n\n /** The design notes around the button. All decoration. */\n private notes(): TemplateResult {\n const captions = this.captions?.length\n ? this.captions\n : [say('Note — Discover'), say('Wireframe — Design low-fi'), say('Component — Design hi-fi'), say('Code — Build'), say('Live — Launch')];\n const specs = this.specs?.length ? this.specs : [say('Fill · Accent/Signal'), say('Radius · 0'), say('Type · Archivo 20')];\n return html`<span class=\"ann caption\" part=\"caption\">${JOURNEY_STAGES.map((_, i) => html`<span>${String(i + 1).padStart(2, '0')} · ${captions[i] ?? ''}</span>`)}</span>\n <span class=\"ann margin\" part=\"margin-note\">${this.marginNote || say('make it the biggest thing on the page')}</span>\n <span class=\"ann width\"><b>${this.markWidth}</b></span>\n <span class=\"ann height\"><b>${this.markHeight}</b></span>\n <span class=\"ann specs\" part=\"specs\">${specs.map((spec) => html`<span>${spec}</span>`)}</span>\n <span class=\"ann cursor\">${pointer}</span>`;\n }\n\n render(): TemplateResult {\n const words = html`<span class=\"text\">${this.label}</span>${arrow}`;\n return html`<div class=\"frame\" part=\"frame\" aria-hidden=${this.decorative ? 'true' : nothing}>\n <span class=\"plate note\" aria-hidden=\"true\"></span>\n <span class=\"plate bar wire\" aria-hidden=\"true\"><svg viewBox=\"0 0 100 100\" preserveAspectRatio=\"none\" fill=\"none\" stroke=\"currentColor\" focusable=\"false\"><path d=\"M0 0 100 100M0 100 100 0\" vector-effect=\"non-scaling-stroke\" /></svg></span>\n <span class=\"plate bar shadow\" aria-hidden=\"true\"></span>\n <span class=\"plate bar solid\" aria-hidden=\"true\"></span>\n <span class=\"plate window\" aria-hidden=\"true\"><span class=\"before\">${this.lines(this.code?.before, 3)}</span><span></span><span class=\"after\">${this.lines(this.code?.after, 2)}</span></span>\n ${this.annotations ? html`<span class=\"notes\" aria-hidden=\"true\">${this.notes()}</span>` : nothing}\n ${this.decorative || !this.href ? html`<span class=\"words\" part=\"button\">${words}</span>` : html`<a class=\"words\" part=\"button\" href=${this.href}>${words}</a>`}\n </div>`;\n }\n}\n\ncustomElements.define('impakt-journey-button', ImpaktJourneyButton);\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-journey-button': ImpaktJourneyButton;\n }\n}\n"],"mappings":";AAIA,SAAS,KAAK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AKrB,KAAK,MAAM,KAAK,MAAM,QAAQ,CAAC,CAAC,2CAA2C,KAAK,MAAM,KAAK,MAAM,OAAO,CAAC,CAAC;AAAA,QAC7K,KAAK,cAAc,8CAA8C,KAAK,MAAM,CAAC,YAAY,OAAO;AAAA,QAChG,KAAK,cAAc,CAAC,KAAK,OAAO,yCAAyC,KAAK,YAAY,2CAA2C,KAAK,IAAI,IAAI,KAAK,MAAM;AAAA;AAAA,EAEnK;AACF;AAEA,eAAe,OAAO,yBAAyB,mBAAmB;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/g2-case.ts"],"sourcesContent":["/**\n * The G2 Noire blocks for a case study and the studio's process: the process\n * line, the week strip, the \"how might we\" callout, the hypothesis card and the\n * browser frame a product screenshot sits in.\n */\nimport { css, html, nothing, svg, type TemplateResult } from 'lit';\nimport { ImpaktElement, fontWeight, say, space, t, visuallyHidden } from '@atomic-ui/ui';\nimport { accent, accentOn, band, bandLine, bandMuted, bandOn, bandRaised, ink, inkLine, levelOf, monoLabel, paper } from './g2-shared';\n\n/** One point on the process line. */\nexport interface ProcessNode {\n /** What happens here, such as \"Discovery\". */\n label: string;\n /** How far the line dips here: 0 on the main line, 1 a step below, 2 two steps. */\n depth?: number;\n /** The point the project is at now, filled in the accent. */\n current?: boolean;\n /** A flag above the point, such as \"Build merged\" or \"v1.0 launch\". */\n flag?: string;\n}\n\nconst STEP = 40;\nconst TOP = 72;\n\n/**\n * A project's process drawn as one main line that dips to a different depth\n * for each phase, like a branch in version control: hollow rings for each\n * point, the current one filled in the accent, a mono label by each (above a\n * point on the main line, below one that dips) and accent flags such as\n * \"Build merged\" and \"v1.0 launch\". A flag on the main line stands in for\n * its point's label there.\n *\n * **The drawing is decoration; the list is the content.** A screen reader\n * meets an ordered list of the points, in order, with their flags and the\n * current one marked as the current step (1.1.1, 1.3.1). On a narrow column,\n * measured against its own width, the same list is drawn as a vertical rail\n * and the drawing is not shown, so nothing is lost at 320px (1.4.10).\n *\n * It is drawn for an ink band and takes the band's colours; outside one it\n * draws its own ink panel. The current point keeps a ring in the band's text\n * colour, so it is not told by its colour alone (1.4.1, 1.4.11).\n *\n * @category content\n * @icon git-commit\n */\nexport class ImpaktProcessLine extends ImpaktElement {\n static properties = {\n nodes: { type: Array },\n lineLabel: { type: String, attribute: 'line-label' },\n label: { type: String },\n };\n /** The points, left to right. */\n declare nodes: ProcessNode[];\n /** A label at the start of the line, such as \"main\". */\n declare lineLabel: string;\n /** A name for the list, for a screen reader, such as \"How a project runs\". */\n declare label: string;\n\n constructor() {\n super();\n this.nodes = [];\n this.lineLabel = '';\n this.label = '';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n css`\n :host { display: block; container-type: inline-size; background: ${band}; color: ${bandOn}; }\n .visual { display: none; position: relative; }\n .visual svg { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; overflow: visible; }\n .visual path { fill: none; stroke: ${bandOn}; stroke-width: 1.5; vector-effect: non-scaling-stroke; }\n .ring { position: absolute; inline-size: 10px; block-size: 10px; box-sizing: border-box; border-radius: 50%; border: 1.5px solid ${bandOn}; background: ${band}; transform: translate(-50%, -50%); }\n .ring.current { inline-size: 12px; block-size: 12px; background: ${accent}; }\n /* Each label keeps to the space between its point and the next, wrapping rather than running into its neighbour. */\n .vlabel { position: absolute; transform: translateX(-50%); ${monoLabel}; color: ${bandMuted}; inline-size: max-content; max-inline-size: var(--slot); text-align: center; text-wrap: balance; }\n .lineLabel { position: absolute; inset-inline-start: 0; ${monoLabel}; color: ${bandMuted}; }\n .flag { display: inline-block; padding: 4px 8px; ${monoLabel}; font-weight: ${fontWeight('medium')}; background: ${accent}; color: ${accentOn}; white-space: nowrap; }\n .visual .flag { position: absolute; transform: translate(-50%, -100%); }\n\n ol { margin: 0; padding: ${space(6)} ${space(4)}; list-style: none; }\n li { position: relative; padding: 0 0 ${space(5)} 28px; }\n li::before { content: ''; position: absolute; inset-inline-start: 0; inset-block-start: 4px; inline-size: 10px; block-size: 10px; box-sizing: border-box; border-radius: 50%; border: 1.5px solid ${bandOn}; background: ${band}; }\n li[aria-current]::before { background: ${accent}; }\n li:not(:last-child)::after { content: ''; position: absolute; inset-inline-start: 4.25px; inset-block-start: 14px; inset-block-end: -4px; inline-size: 1.5px; background: ${bandOn}; }\n .rlabel { ${monoLabel}; font-size: 0.75rem; color: ${bandOn}; }\n li .flag { margin-inline-start: ${space(2)}; }\n\n @container (min-width: 60rem) {\n .visual { display: block; }\n ol { ${visuallyHidden} }\n }\n @media (forced-colors: active) {\n .visual path { stroke: CanvasText; }\n .ring, li::before { border-color: CanvasText; background: Canvas; }\n .ring.current, li[aria-current]::before { background: Highlight; }\n li::after { background: CanvasText; }\n .flag { border: 1px solid CanvasText; }\n }\n `,\n ];\n\n render(): TemplateResult {\n const nodes = this.nodes ?? [];\n if (!nodes.length) return html``;\n const n = nodes.length;\n const depthOf = (node: ProcessNode) => Math.max(0, Math.min(4, Number(node.depth) || 0));\n const maxDepth = Math.max(...nodes.map(depthOf));\n const height = TOP + maxDepth * STEP + 44;\n const pts = nodes.map((node, i) => ({ x: ((i + 0.5) / n) * 1000, y: TOP + depthOf(node) * STEP }));\n let d = `M0 ${pts[0]!.y} L${pts[0]!.x} ${pts[0]!.y}`;\n for (let i = 1; i < n; i++) {\n const a = pts[i - 1]!;\n const b = pts[i]!;\n if (a.y === b.y) d += ` L${b.x} ${b.y}`;\n else {\n const mid = (a.x + b.x) / 2;\n d += ` C${mid} ${a.y} ${mid} ${b.y} ${b.x} ${b.y}`;\n }\n }\n d += ` L1000 ${pts[n - 1]!.y}`;\n const pct = (i: number) => `${((i + 0.5) / n) * 100}%`;\n return html`<div class=\"visual\" part=\"drawing\" aria-hidden=\"true\" style=\"block-size:${height}px;--slot:calc(${100 / n}% - 0.5rem)\">\n <svg viewBox=\"0 0 1000 ${height}\" preserveAspectRatio=\"none\" focusable=\"false\">${svg`<path d=${d} />`}</svg>\n ${this.lineLabel ? html`<span class=\"lineLabel\" style=\"inset-block-start:${TOP - 64}px\">${this.lineLabel}</span>` : nothing}\n ${nodes.map((node, i) => {\n const y = pts[i]!.y;\n // On the main line the label sits above the point, clear of the curves that leave it; a\n // flag there stands in for it. Below the main line the label hangs under the point.\n const onMain = depthOf(node) === 0;\n const label = onMain\n ? node.flag\n ? nothing\n : html`<span class=\"vlabel\" style=\"inset-inline-start:${pct(i)};inset-block-end:${height - y + 12}px\">${node.label}</span>`\n : html`<span class=\"vlabel\" style=\"inset-inline-start:${pct(i)};inset-block-start:${y + 14}px\">${node.label}</span>`;\n return html`<span class=\"ring ${node.current ? 'current' : ''}\" style=\"inset-inline-start:${pct(i)};inset-block-start:${y}px\"></span>\n ${label}\n ${node.flag ? html`<span class=\"flag\" style=\"inset-inline-start:${pct(i)};inset-block-start:${y - 12}px\">${node.flag}</span>` : nothing}`;\n })}\n </div>\n <ol part=\"list\" role=\"list\" aria-label=${this.label || nothing}>\n ${nodes.map(\n (node) => html`<li part=\"item\" aria-current=${node.current ? 'step' : nothing}>\n <span class=\"rlabel\">${node.label}</span>${node.flag ? html`<span class=\"flag\">${node.flag}</span>` : nothing}\n </li>`,\n )}\n </ol>`;\n }\n}\n\n/** One day of the week strip. */\nexport interface WeekDay {\n /** The day, such as \"Mon\". Set in mono capitals. */\n day: string;\n /** What happens, such as \"Plan\". */\n heading: string;\n /** A line about it. */\n text?: string;\n /** Pick this day out in the accent, such as the demo. */\n highlight?: boolean;\n}\n\n/**\n * A working week in five tiles, such as Mon Plan, Tue Make, Wed Review, Thu\n * Make and Fri Demo: a mono day, a heading and a line, on tiles raised off an\n * ink band, with one day picked out in the accent.\n *\n * A list, each heading at the level the page asks for (1.3.1). The accent day\n * is also the only one with ink words, and its heading says what it is, so it\n * is not told by colour alone (1.4.1). The tiles wrap on a narrow screen\n * (1.4.10).\n *\n * @category content\n * @icon calendar\n */\nexport class ImpaktWeekStrip extends ImpaktElement {\n static properties = {\n days: { type: Array },\n headingLevel: { type: Number, attribute: 'heading-level' },\n label: { type: String },\n };\n declare days: WeekDay[];\n declare headingLevel: number;\n /** A name for the list, for a screen reader. Leave empty for none. */\n declare label: string;\n\n constructor() {\n super();\n this.days = [];\n this.headingLevel = 3;\n this.label = '';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n css`\n :host { display: block; }\n ol { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr)); gap: 10px; }\n li { box-sizing: border-box; min-block-size: 150px; padding: ${space(5)}; background: ${bandRaised}; border: 1px solid ${bandLine}; color: ${bandOn}; }\n li.highlight { background: ${accent}; border-color: ${accent}; color: ${accentOn}; }\n .day { margin: 0; ${monoLabel}; color: ${bandMuted}; }\n .heading { margin: ${space(2)} 0 0; font-family: ${t.fontHeading}; font-size: 2rem; font-weight: ${fontWeight('semibold')}; line-height: 1.1; letter-spacing: -0.03em; }\n .text { margin: ${space(3)} 0 0; font-size: 0.875rem; line-height: 1.45; color: ${bandMuted}; }\n li.highlight :is(.day, .text) { color: ${accentOn}; }\n @media (forced-colors: active) { li, li.highlight { border-color: CanvasText; } li.highlight { border-width: 3px; } }\n `,\n ];\n\n render(): TemplateResult {\n if (!this.days?.length) return html``;\n const level = levelOf(this.headingLevel);\n return html`<ol part=\"list\" role=\"list\" aria-label=${this.label || nothing}>\n ${this.days.map(\n (day) => html`<li part=\"day\" class=${day.highlight ? 'highlight' : ''}>\n <p class=\"day\">${day.day}</p>\n <div class=\"heading\" role=\"heading\" aria-level=${level}>${day.heading}</div>\n ${day.text ? html`<p class=\"text\">${day.text}</p>` : nothing}\n </li>`,\n )}\n </ol>`;\n }\n}\n\n/**\n * A statement set apart on an ink panel, under a mono accent label: the \"How\n * might we\" of a case study.\n *\n * The panel stays ink in both themes, so the accent label on it keeps its\n * contrast (1.4.3). The label and statement are plain text, read in order.\n *\n * @category content\n * @icon quote\n * @slot - The statement, when it holds more than words. Replaces `text`.\n */\nexport class ImpaktCallout extends ImpaktElement {\n static properties = {\n label: { type: String },\n text: { type: String },\n };\n /** The label above, such as \"How might we\". */\n declare label: string;\n /** The statement. */\n declare text: string;\n\n constructor() {\n super();\n this.label = '';\n this.text = '';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n css`\n :host { display: block; }\n .panel { padding: ${space(8)} ${space(8)} ${space(10)}; background: ${ink}; color: ${paper}; border: 1px solid ${ink}; }\n .label { margin: 0 0 ${space(4)}; ${monoLabel}; font-weight: ${fontWeight('medium')}; color: ${accent}; }\n .text { margin: 0; max-inline-size: 26em; font-family: ${t.fontHeading}; font-size: clamp(1.5rem, 1rem + 2vw, 2rem); font-weight: ${fontWeight('semibold')}; line-height: 1.2; letter-spacing: -0.02em; }\n @media (prefers-color-scheme: dark) { .panel { border-color: ${inkLine}; } }\n @media (max-width: 30rem) { .panel { padding: ${space(6)}; } }\n @media (forced-colors: active) { .panel { border-color: CanvasText; } }\n `,\n ];\n\n render(): TemplateResult {\n return html`<div class=\"panel\" part=\"panel\">\n ${this.label ? html`<p class=\"label\" part=\"label\">${this.label}</p>` : nothing}\n <p class=\"text\" part=\"text\"><slot>${this.text}</slot></p>\n </div>`;\n }\n}\n\n/**\n * A hypothesis to test: its number such as \"H1\", how much it matters, a\n * statement, and the metric that will tell, on a white card with an ink border.\n * Lay six out two to a row.\n *\n * `impact` draws the tag: \"High impact\" on the accent, \"Medium impact\" and\n * \"Low impact\" outlined in ink. The tag says the impact in words, so it is not\n * told by its colour (1.4.1).\n *\n * @category content\n * @icon flask\n */\nexport class ImpaktHypothesisCard extends ImpaktElement {\n static properties = {\n number: { type: String },\n statement: { type: String },\n metric: { type: String },\n impact: { type: String, reflect: true },\n impactLabel: { type: String, attribute: 'impact-label' },\n };\n /** The hypothesis's number, such as \"H1\". */\n declare number: string;\n /** What the team believes, such as \"A jobs board grouped by stage shows stuck cars faster than a shared spreadsheet.\" */\n declare statement: string;\n /** What will be measured, such as \"Time a car waits unnoticed\". */\n declare metric: string;\n /** How much it matters. Leave empty for no tag. */\n declare impact: 'high' | 'medium' | 'low' | '';\n /** The tag's words, in place of the impact's own. */\n declare impactLabel: string;\n\n constructor() {\n super();\n this.number = '';\n this.statement = '';\n this.metric = '';\n this.impact = '';\n this.impactLabel = '';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n css`\n :host { display: block; block-size: 100%; }\n article { box-sizing: border-box; block-size: 100%; display: grid; align-content: start; gap: ${space(4)}; padding: ${space(6)}; background: ${t.surfaceCard}; color: ${t.text}; border: 1px solid ${t.text}; }\n .top { display: flex; justify-content: space-between; align-items: center; gap: ${space(2)}; flex-wrap: wrap; min-block-size: 22px; }\n .number { font-family: ${t.fontMono}; font-size: 0.75rem; letter-spacing: 0.06em; }\n .impact { margin: 0; padding: 3px 7px; ${monoLabel}; font-weight: ${fontWeight('medium')}; border: 1px solid ${t.text}; color: ${t.text}; }\n :host([impact='high']) .impact { background: ${accent}; color: ${accentOn}; border-color: ${accentOn}; }\n .statement { margin: 0; font-family: ${t.fontHeading}; font-size: 1.25rem; line-height: 1.35; letter-spacing: -0.01em; }\n .metric { margin: 0; ${monoLabel}; color: ${t.textMuted}; }\n @media (forced-colors: active) { article, .impact { border-color: CanvasText; } }\n `,\n ];\n\n render(): TemplateResult {\n const words: Record<string, string> = { high: 'High impact', medium: 'Medium impact', low: 'Low impact' };\n const impact = this.impactLabel || (this.impact && words[this.impact] ? say(words[this.impact]!) : '');\n return html`<article part=\"card\">\n ${\n this.number || impact\n ? html`<div class=\"top\">\n <span class=\"number\" part=\"number\">${this.number}</span>\n ${impact ? html`<p class=\"impact\" part=\"impact\">${impact}</p>` : nothing}\n </div>`\n : nothing\n }\n ${this.statement ? html`<p class=\"statement\" part=\"statement\">${this.statement}</p>` : nothing}\n ${this.metric ? html`<p class=\"metric\" part=\"metric\">${say('Metric')} · ${this.metric}</p>` : nothing}\n </article>`;\n }\n}\n\n/**\n * A window frame for a product screenshot on an ink band: a 40px bar with\n * three dots, the first in the accent, and a mono caption, over a canvas that\n * holds the picture. With no picture in it, the canvas shows a grid, as a\n * placeholder.\n *\n * **The frame is decoration; the picture carries the words.** Give the image\n * its own `alt`. The bar is hidden from a screen reader (1.1.1).\n *\n * @category media\n * @icon browser\n * @slot - The picture, such as an `<img>` with its `alt`.\n */\nexport class ImpaktBrowserFrame extends ImpaktElement {\n static properties = {\n caption: { type: String },\n ratio: { type: String },\n filled: { state: true },\n };\n /** The caption in the bar, such as \"Harbour · Cover\". It is decoration. */\n declare caption: string;\n /** The canvas's shape while it is empty, as a CSS aspect ratio. */\n declare ratio: string;\n declare protected filled: boolean;\n\n constructor() {\n super();\n this.caption = '';\n this.ratio = '16 / 9';\n this.filled = false;\n }\n\n static styles = [\n ...ImpaktElement.styles,\n css`\n :host { display: block; }\n .frame { border: 1px solid ${bandLine}; background: ${band}; color: ${bandOn}; }\n .bar { display: flex; align-items: center; gap: 6px; block-size: 40px; padding-inline: ${space(3)}; background: ${bandRaised}; border-block-end: 1px solid ${bandLine}; overflow: hidden; }\n .dot { flex: none; inline-size: 8px; block-size: 8px; border-radius: 50%; background: ${bandLine}; }\n .dot:first-child { background: ${accent}; }\n .caption { margin-inline-start: ${space(1.5)}; ${monoLabel}; color: ${bandMuted}; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n .canvas { position: relative; }\n .canvas.empty { background-image: linear-gradient(to right, ${bandLine} 1px, transparent 1px), linear-gradient(to bottom, ${bandLine} 1px, transparent 1px); background-size: 28px 28px; }\n ::slotted(img), ::slotted(picture), ::slotted(video) { display: block; inline-size: 100%; block-size: auto; }\n @media (forced-colors: active) { .frame, .bar { border-color: CanvasText; } .dot { background: CanvasText; } }\n `,\n ];\n\n render(): TemplateResult {\n return html`<div class=\"frame\" part=\"frame\">\n <div class=\"bar\" part=\"bar\" aria-hidden=\"true\">\n <span class=\"dot\"></span><span class=\"dot\"></span><span class=\"dot\"></span>\n ${this.caption ? html`<span class=\"caption\" part=\"caption\">${this.caption}</span>` : nothing}\n </div>\n <div class=\"canvas ${this.filled ? '' : 'empty'}\" part=\"canvas\" style=${this.filled ? '' : `aspect-ratio: ${this.ratio || '16 / 9'}`}>\n <slot @slotchange=${this.onSlot}></slot>\n </div>\n </div>`;\n }\n\n private onSlot(e: Event): void {\n this.filled = (e.target as HTMLSlotElement).assignedElements().length > 0;\n }\n}\n\ncustomElements.define('impakt-process-line', ImpaktProcessLine);\ncustomElements.define('impakt-week-strip', ImpaktWeekStrip);\ncustomElements.define('impakt-callout', ImpaktCallout);\ncustomElements.define('impakt-hypothesis-card', ImpaktHypothesisCard);\ncustomElements.define('impakt-browser-frame', ImpaktBrowserFrame);\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-process-line': ImpaktProcessLine;\n 'impakt-week-strip': ImpaktWeekStrip;\n 'impakt-callout': ImpaktCallout;\n 'impakt-hypothesis-card': ImpaktHypothesisCard;\n 'impakt-browser-frame': ImpaktBrowserFrame;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAKA,SAAS,KAAK,MAAM,SAAS,WAAgC;AAC7D,SAAS,eAAe,YAAY,KAAK,OAAO,GAAG,sBAAsB;AAezE,IAAM,OAAO;AACb,IAAM,MAAM;AAuBL,IAAM,oBAAN,cAAgC,cAAc;AAAA,EACnD;AAAA,SAAO,aAAa;AAAA,MAClB,OAAO,EAAE,MAAM,MAAM;AAAA,MACrB,WAAW,EAAE,MAAM,QAAQ,WAAW,aAAa;AAAA,MACnD,OAAO,EAAE,MAAM,OAAO;AAAA,IACxB;AAAA;AAAA,EAQA,cAAc;AACZ,UAAM;AACN,SAAK,QAAQ,CAAC;AACd,SAAK,YAAY;AACjB,SAAK,QAAQ;AAAA,EACf;AAAA,EAEA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,cAAc;AAAA,MACjB;AAAA,yEACqE,IAAI,YAAY,MAAM;AAAA;AAAA;AAAA,2CAGpD,MAAM;AAAA,yIACwF,MAAM,iBAAiB,IAAI;AAAA,yEAC3F,MAAM;AAAA;AAAA,mEAEZ,SAAS,YAAY,SAAS;A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AQ;AAAA,uCAC/D,MAAM;AAAA,wCACL,MAAM,GAAG,CAAC,KAAK,SAAS,YAAY,SAAS;AAAA;AAAA,oEAEjB,QAAQ,sDAAsD,QAAQ;AAAA;AAAA;AAAA;AAAA,IAIxI;AAAA;AAAA,EAEA,SAAyB;AACvB,WAAO;AAAA;AAAA;AAAA,UAGD,KAAK,UAAU,4CAA4C,KAAK,OAAO,YAAY,OAAO;AAAA;AAAA,2BAEzE,KAAK,SAAS,KAAK,OAAO,yBAAyB,KAAK,SAAS,KAAK,iBAAiB,KAAK,SAAS,QAAQ,EAAE;AAAA,4BAC9G,KAAK,MAAM;AAAA;AAAA;AAAA,EAGrC;AAAA,EAEQ,OAAO,GAAgB;AAC7B,SAAK,SAAU,EAAE,OAA2B,iBAAiB,EAAE,SAAS;AAAA,EAC1E;AACF;AAEA,eAAe,OAAO,uBAAuB,iBAAiB;AAC9D,eAAe,OAAO,qBAAqB,eAAe;AAC1D,eAAe,OAAO,kBAAkB,aAAa;AACrD,eAAe,OAAO,0BAA0B,oBAAoB;AACpE,eAAe,OAAO,wBAAwB,kBAAkB;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/site.ts"],"sourcesContent":["/**\n * A site's own header and footer, drawn as one piece each, for the layout's\n * header and footer slots, and the wordmark that starts a header.\n *\n * The chip that sits beside a wordmark is a product component, `impakt-chip`,\n * and comes from `@atomic-ui/ui`.\n *\n * The page frame (`impakt-page`) gives them their landmarks, so neither draws a\n * `<header>` or `<footer>` of its own: a second banner would be one a screen\n * reader announces twice.\n */\nimport { css, html, nothing, type TemplateResult } from 'lit';\n// The base, the tokens and the nav and button these draw come from @atomic-ui/ui, which defines its elements on import.\nimport { ImpaktElement, focusRing, hideOn, fontSize, fontWeight, space, t, token, type, toneOf, type NavLink, type Tone } from '@atomic-ui/ui';\n\n/** The footer stripe's colours, left to right. */\n/** The stripe's segments take the brand's chart colours in order. */\nconst STRIPE = [0, 1, 2, 3, 4];\n\n/** Code-like labels: a branch, a hash, a commit message. */\nconst MONO = t.fontMono;\n\n// Quieter words are faded to 0.72, no further: that keeps them at 4.5:1 on the page and card colours (1.4.3).\n\n/**\n * The site header: the brand, the main links and one call to action, with an\n * optional chip beside the brand and a status before the action.\n *\n * The links fold behind a Menu button when they do not fit, as `impakt-nav`\n * does. The chip and the status are labels, not controls, and they are left\n * out on a phone so the brand, the menu and the action keep the row.\n *\n * **Build your own.** Place components in its three slots, start, middle and\n * end, and each slot that holds something replaces what the props draw there:\n * a wordmark and chips at the start, a nav in the middle, a status and a\n * button at the end, in any order. Give a component `hideOn: 'phone'` to leave\n * it out on a phone, so the phone's header is built from the same pieces.\n *\n * **A header for a studio's canvas.** `mark` draws a 28px ink square with a\n * letter in it before the name, `context` a path after it (\"/ home.canvas\"),\n * and `status-at=\"start\"` moves the status chip, a square with a dot and a\n * word such as \"Live\", up beside them. `nav-look=\"tabs\"` draws the links as\n * file tabs. `presence` draws a few small overlapping avatars of the people in\n * the file before the action; each is named for a screen reader.\n *\n * @category layout\n * @icon header\n * @slot start - The brand: a wordmark or logo, and any chips beside it.\n * @slot middle - The links, usually one nav.\n * @slot presence - Avatars of the people in the file, before the action. Replaces what `presence` draws.\n * @slot end - A status and the call to action.\n * @fires {CustomEvent<null>} impakt-action - When the call to action is pressed.\n */\nexport class ImpaktSiteHeader extends ImpaktElement {\n static properties = {\n brand: { type: String },\n logoSrc: { type: String, attribute: 'logo-src' },\n logoAlt: { type: String, attribute: 'logo-alt' },\n home: { type: String },\n badge: { type: String },\n meta: { type: String },\n links: { type: Array },\n label: { type: String },\n menuText: { type: String, attribute: 'menu-text' },\n status: { type: String },\n statusMeta: { type: String, attribute: 'status-meta' },\n statusTone: { type: String, attribute: 'status-tone' },\n actionText: { type: String, attribute: 'action-text' },\n actionHref: { type: String, attribute: 'action-href' },\n fold: { type: String, reflect: true },\n mark: { type: String },\n context: { type: String },\n statusAt: { type: String, reflect: true, attribute: 'status-at' },\n navLook: { type: String, attribute: 'nav-look' },\n current: { type: String },\n presence: { type: Array },\n };\n /** The site's name, set as a wordmark when there is no logo picture. */\n declare brand: string;\n /** A logo picture, used instead of the wordmark. */\n declare logoSrc: string;\n /** What the logo says. Leave empty to use the brand name. */\n declare logoAlt: string;\n /** Where the brand links to. */\n declare home: string;\n /** A short chip beside the brand, such as \"main\". */\n declare badge: string;\n /** A code-like line after the chip, such as a commit hash. */\n declare meta: string;\n declare links: NavLink[];\n /** The name of the links' landmark. */\n declare label: string;\n /** The words on the button that opens the links on a narrow screen. */\n declare menuText: string;\n /** A status before the action, such as the stage the site is at. */\n declare status: string;\n /** A code-like line in the status, such as a hash. */\n declare statusMeta: string;\n declare statusTone: Tone;\n declare actionText: string;\n declare actionHref: string;\n /**\n * How the links fold on a narrow screen. `measure` folds them when they do not fit, which needs\n * script. `narrow` folds them at 40rem in CSS: the Menu button then opens a whole-screen menu\n * with no script, and the header's action moves into that menu. Use `narrow` on a page that may\n * be shown without script.\n */\n declare fold: 'measure' | 'narrow';\n /** A letter or two in a 28px ink square before the name, such as \"i\". Decoration: the name is what is read. */\n declare mark: string;\n /** A path after the name, such as \"home.canvas\", drawn as \"/ home.canvas\". */\n declare context: string;\n /** Where the status sits: `end`, before the action, or `start`, after the name. */\n declare statusAt: 'start' | 'end';\n /** How the links are drawn, passed to `impakt-nav` as its `look`, such as `tabs` for file tabs. */\n declare navLook: string;\n /** The href of the link to mark as the page you are on, passed to the nav; unset, the nav works it out from the address. */\n declare current: string;\n /** The people in the file, drawn as small overlapping avatars. `accent` fills one in the accent. */\n declare presence: Array<{ name: string; initials?: string; accent?: boolean }>;\n\n constructor() {\n super();\n this.brand = '';\n this.logoSrc = '';\n this.logoAlt = '';\n this.home = '/';\n this.badge = '';\n this.meta = '';\n this.links = [];\n this.label = 'Main';\n this.menuText = 'Menu';\n this.status = '';\n this.statusMeta = '';\n this.statusTone = 'success';\n this.actionText = '';\n this.actionHref = '';\n this.fold = 'measure';\n this.mark = '';\n this.context = '';\n this.statusAt = 'end';\n this.navLook = '';\n this.current = '';\n this.presence = [];\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n css`\n :host { display: block; container-type: inline-size; }\n /* With a mark, the name is set small beside it, as in the canvas header. */\n .brand.marked { gap: ${space(3)}; font-size: ${fontSize('md')}; letter-spacing: -0.01em; }\n .mark { display: inline-grid; place-items: center; inline-size: 28px; block-size: 28px; flex: none; background: ${t.text}; color: ${t.surfaceCard}; font-size: ${fontSize('sm')}; font-weight: ${fontWeight('medium')}; }\n .context { font-size: ${fontSize('sm')}; white-space: nowrap; }\n .context .slash { margin-inline-end: ${space(2)}; opacity: 0.72; }\n .presence { display: flex; }\n .presence .avatar { display: inline-grid; place-items: center; inline-size: 22px; block-size: 22px; box-sizing: border-box; margin-inline-start: -6px; border-radius: 50%; border: ${t.borderThin} solid ${t.text}; background: ${t.surfaceCard}; color: ${t.text}; font-family: ${MONO}; font-size: 0.625rem; line-height: 1; }\n .presence .avatar:first-child { margin-inline-start: 0; }\n .presence .avatar.accent { background: ${token('color.accent.default', '#ffd43b')}; color: ${token('color.accent.on', '#111111')}; }\n .bar { display: flex; align-items: center; gap: ${space(6)}; }\n .start { display: flex; align-items: center; gap: ${space(3)}; flex: none; }\n .middle { flex: 1 1 8rem; min-inline-size: 0; display: flex; align-items: center; justify-content: center; }\n .middle ::slotted(*) { flex: 1 1 auto; min-inline-size: 0; }\n slot { display: contents; }\n .brand { display: inline-flex; align-items: center; min-block-size: ${t.targetMin}; color: inherit; text-decoration: none; font-family: ${t.fontHeading}; font-weight: ${fontWeight('semibold')}; ${type('2xl')} letter-spacing: -0.02em; line-height: 1; border-radius: ${t.radiusSm}; }\n .brand img { display: block; block-size: 32px; inline-size: auto; }\n .chip { display: inline-flex; align-items: center; gap: ${space(1)}; padding: 2px ${space(2)}; border-radius: ${t.radius}; background: color-mix(in srgb, currentColor 7%, transparent); font-family: ${MONO}; font-size: ${fontSize('xs')}; }\n .chip svg { inline-size: 12px; block-size: 12px; }\n .meta { font-family: ${MONO}; font-size: ${fontSize('xs')}; opacity: 0.72; }\n .middle impakt-nav { flex: 1 1 8rem; }\n /* File tabs sit in one box as wide as the tabs, centred between the name and the action. */\n :host([fold='narrow']) .middle impakt-nav[look='tabs'] { flex: 0 1 auto; }\n .end { display: flex; align-items: center; gap: ${space(3)}; flex: none; }\n .end:empty, .start:empty { display: none; }\n .status { display: inline-flex; align-items: center; gap: ${space(2)}; padding: ${space(1)} ${space(3)}; border: ${t.borderThin} solid ${t.border}; border-radius: var(--impakt-radius-pill, calc(var(--impakt-radius-md, 0.5rem) * 9999)); background: ${t.surfaceCard}; font-family: ${MONO}; font-size: ${fontSize('xs')}; white-space: nowrap; }\n /* Beside the name it is a small square chip: an ink outline, a dot, and the word in monospace capitals. */\n .start .status { padding: 2px ${space(2)}; border-color: ${t.text}; border-radius: ${t.radius}; font-size: 0.6875rem; letter-spacing: ${t.trackingWide}; text-transform: uppercase; }\n .start .status .dot { inline-size: 6px; block-size: 6px; }\n .status .dot { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--tone); }\n .status .hash { opacity: 0.72; }\n @container (max-width: 22rem) { :host(:not([fold='narrow'])) .bar { flex-wrap: wrap; row-gap: ${space(2)}; } :host(:not([fold='narrow'])) .end { flex: 1 1 100%; } }\n @container (max-width: 56rem) { .chip, .meta, .status, .context, .presence { display: none; } .bar { gap: ${space(3)}; } }\n /* With no script the links cannot fold behind a Menu button. On a narrow screen they take a\n line of their own under the name and the action, and wrap there. */\n @container (max-width: 40rem) {\n :host(:not(:defined):not([fold='narrow'])) .bar { flex-wrap: wrap; row-gap: ${space(1)}; }\n :host(:not(:defined):not([fold='narrow'])) .start { flex: 1 1 auto; }\n :host(:not(:defined):not([fold='narrow'])) .middle { order: 3; flex: 1 1 100%; justify-content: flex-start; }\n /* fold=\"narrow\": the links are behind the Menu button, which sits at the end, and the action moves into the menu. */\n :host([fold='narrow']) .middle { justify-content: flex-end; }\n /* On the narrowest bars the action takes its own row, so the Menu button never spills over the brand. */\n :host(:not([fold='narrow'])) .middle { justify-content: flex-end; min-inline-size: max-content; }\n :host([fold='narrow']) .end > slot > impakt-button { display: none; }\n }\n `,\n ];\n\n private act(): void {\n this.dispatchEvent(new CustomEvent('impakt-action', { bubbles: true, composed: true }));\n }\n\n render(): TemplateResult {\n const wordmark = this.logoSrc ? html`<img src=${this.logoSrc} alt=${this.logoAlt || this.brand} />` : html`${this.brand}`;\n const status = this.status\n ? html`<span class=\"status\" part=\"status\" style=${`--tone:${toneOf(this.statusTone, 0)}`}><span class=\"dot\" aria-hidden=\"true\"></span>${this.status}${this.statusMeta ? html` <span class=\"hash\">${this.statusMeta}</span>` : nothing}</span>`\n : nothing;\n const presence = this.presence ?? [];\n // Each region shows what is placed in its slot, or, when nothing is, what the props describe.\n return html`<div class=\"bar\" part=\"bar\">\n <div class=\"start\"><slot name=\"start\">\n ${this.brand || this.logoSrc ? html`<a class=${this.mark ? 'brand marked' : 'brand'} href=${this.home || '/'} part=\"brand\">${this.mark ? html`<span class=\"mark\" part=\"mark\" aria-hidden=\"true\">${this.mark}</span>` : nothing}${wordmark}</a>` : nothing}\n ${this.context ? html`<span class=\"context\" part=\"context\"><span class=\"slash\" aria-hidden=\"true\">/</span>${this.context}</span>` : nothing}\n ${this.statusAt === 'start' ? status : nothing}\n ${this.badge ? html`<span class=\"chip\" part=\"badge\"><svg viewBox=\"0 0 14 14\" aria-hidden=\"true\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\"><circle cx=\"3.5\" cy=\"3\" r=\"1.5\"/><circle cx=\"3.5\" cy=\"11\" r=\"1.5\"/><circle cx=\"10.5\" cy=\"4.5\" r=\"1.5\"/><path d=\"M3.5 4.5v5M10.5 6c0 2.5-3 2.5-6 4\"/></svg>${this.badge}</span>` : nothing}\n ${this.meta ? html`<span class=\"meta\" part=\"meta\">${this.meta}</span>` : nothing}\n </slot></div>\n <div class=\"middle\"><slot name=\"middle\">${(this.links ?? []).length ? html`<impakt-nav align=\"center\" size=\"sm\" fold=${this.fold} look=${this.navLook || nothing} .current=${this.current} .links=${this.links} .label=${this.label} .menuText=${this.menuText} .actionText=${this.fold === 'narrow' ? this.actionText : ''} .actionHref=${this.actionHref}></impakt-nav>` : nothing}</slot></div>\n <div class=\"end\"><slot name=\"presence\">${\n presence.length\n ? html`<span class=\"presence\" part=\"presence\">${presence.map(\n (person) =>\n html`<span class=${person.accent ? 'avatar accent' : 'avatar'} role=\"img\" aria-label=${person.name}>${person.initials ?? person.name.slice(0, 1).toUpperCase()}</span>`,\n )}</span>`\n : nothing\n }</slot><slot name=\"end\">\n ${this.statusAt === 'start' ? nothing : status}\n ${this.actionText ? html`<impakt-button variant=\"primary\" size=\"sm\" icon-after=\"arrow-right\" href=${this.actionHref || nothing} @click=${this.act}>${this.actionText}</impakt-button>` : nothing}\n </slot></div>\n </div>`;\n }\n}\n\n/**\n * The site's name as a wordmark, or its logo, linking home: the start of a\n * site header.\n *\n * @category layout\n * @icon logo\n */\nexport class ImpaktWordmark extends ImpaktElement {\n static properties = {\n text: { type: String },\n src: { type: String },\n alt: { type: String },\n href: { type: String },\n size: { type: String, reflect: true },\n hideOn: { type: String, reflect: true, attribute: 'hide-on' },\n };\n /** The name, set in the heading face. */\n declare text: string;\n /** A logo picture, used instead of the name. */\n declare src: string;\n /** What the logo says. Leave empty to use the name. */\n declare alt: string;\n declare href: string;\n /** Larger on a wide header, smaller on a phone's. */\n declare size: 'sm' | 'md' | 'lg';\n declare hideOn: 'never' | 'phone' | 'wide';\n\n constructor() {\n super();\n this.text = '';\n this.src = '';\n this.alt = '';\n this.href = '/';\n this.size = 'md';\n this.hideOn = 'never';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n hideOn,\n css`\n :host { display: inline-flex; align-items: center; flex: none; }\n a { color: inherit; text-decoration: none; font-family: ${t.fontHeading}; font-weight: ${fontWeight('semibold')}; letter-spacing: -0.02em; line-height: 1; border-radius: ${t.radiusSm}; }\n :host([size='sm']) a { ${type('xl')} } :host([size='md']) a { ${type('2xl')} } :host([size='lg']) a { ${type('3xl')} }\n img { display: block; block-size: 32px; inline-size: auto; }\n @media (max-width: 40rem) { :host([size='md']) a, :host([size='lg']) a { ${type('xl')} } }\n `,\n ];\n\n render(): TemplateResult {\n // The name arrives as the element's words when a page places it, or as `text` when it is set directly.\n return html`<a href=${this.href || '/'} part=\"link\">${this.src ? html`<img src=${this.src} alt=${this.alt || this.text || this.textContent?.trim() || ''} />` : html`<slot>${this.text}</slot>`}</a>`;\n }\n}\n\n/** One line of a footer's log: a code, what it says, and the colour of its dot. */\nexport interface FooterLogLine {\n meta?: string;\n text: string;\n tone?: Tone;\n}\n\n/** A column of footer links under a short heading. */\nexport interface FooterColumn {\n heading: string;\n links: NavLink[];\n}\n\n/**\n * The site footer: the footer band with the brand set large, an optional log of\n * lines beside it, columns of links, a legal line and a stripe of the brand's\n * colours along the foot.\n *\n * Each column is a list under its own heading, so a screen reader can move\n * from one to the next. The log is a list too; its dots are decoration.\n *\n * `action-text` and `action-href` put one outlined action at the end of the\n * columns' row, such as \"Back to top\". `tagline` sets a short line at the\n * other end of the legal line, such as \"Pixel to production\". On a phone the\n * columns sit two by two.\n *\n * @category layout\n * @icon footer\n */\nexport class ImpaktSiteFooter extends ImpaktElement {\n static properties = {\n brand: { type: String },\n brandSize: { type: String, reflect: true, attribute: 'brand-size' },\n log: { type: Array },\n columns: { type: Array },\n columnsOnPhone: { type: String, attribute: 'columns-on-phone', reflect: true },\n legal: { type: String },\n stripe: { type: Boolean, reflect: true },\n headingLevel: { type: Number, attribute: 'heading-level' },\n actionText: { type: String, attribute: 'action-text' },\n actionHref: { type: String, attribute: 'action-href' },\n tagline: { type: String },\n };\n /** The site's name, set large. */\n declare brand: string;\n /**\n * How large the name is set. `display` runs it the full width of the footer,\n * under the columns, sized by the footer's own width so it never spills at\n * 320px.\n */\n declare brandSize: 'lg' | 'display';\n /** Lines set in code type under the brand, newest first. The first is bright. */\n declare log: FooterLogLine[];\n declare columns: FooterColumn[];\n /** `hidden` leaves the link columns out on a phone, so the footer there is the name, the lines and the legal line. */\n declare columnsOnPhone: 'shown' | 'hidden';\n /** The line at the foot, such as the copyright. */\n declare legal: string;\n /** A stripe of the brand's colours along the bottom edge. */\n declare stripe: boolean;\n /** The level of each column's heading. */\n declare headingLevel: 2 | 3 | 4;\n /** The words on an outlined action at the end of the columns' row, such as \"Back to top\". */\n declare actionText: string;\n /** Where that action goes, such as \"#top\". */\n declare actionHref: string;\n /** A short line at the end of the legal line, such as \"Pixel to production\". */\n declare tagline: string;\n\n constructor() {\n super();\n this.brand = '';\n this.brandSize = 'lg';\n this.log = [];\n this.columns = [];\n this.columnsOnPhone = 'shown';\n this.legal = '';\n this.stripe = false;\n this.headingLevel = 2;\n this.actionText = '';\n this.actionHref = '';\n this.tagline = '';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n css`\n /* The page frame's footer band gives the colours; this sits flush with its foot so the stripe meets the edge. */\n :host { display: block; container-type: inline-size; position: relative; padding-block: ${space(8)} ${space(4)}; margin-block-end: calc(-1 * ${space(8)}); }\n .top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: ${space(10)}; }\n .brand { margin: 0; font-family: ${t.fontHeading}; font-weight: ${fontWeight('bold')}; font-size: clamp(3rem, 6vw, 4.5rem); line-height: 1; letter-spacing: -0.03em; }\n /* The name as a wordmark across the whole footer, under the columns. */\n :host([brand-size='display']) .top { grid-template-columns: 1fr; }\n :host([brand-size='display']) .top > div:first-child { order: 2; }\n :host([brand-size='display']) .brand { font-weight: ${fontWeight('semibold')}; font-size: clamp(3rem, 27cqi, 24rem); line-height: 0.9; letter-spacing: -0.06em; overflow-wrap: anywhere; }\n ul { list-style: none; margin: 0; padding: 0; }\n .log { margin-block-start: ${space(8)}; display: grid; gap: ${space(3)}; font-family: ${MONO}; font-size: ${fontSize('sm')}; }\n .log li { display: flex; align-items: center; gap: ${space(3)}; opacity: 0.72; }\n .log li:first-child { opacity: 1; }\n .log .dot { flex: none; inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--tone); }\n .log .code { margin-inline-end: ${space(3)}; }\n .columns { display: grid; grid-template-columns: repeat(var(--count, 4), minmax(0, 1fr)); gap: ${space(8)}; }\n .h { margin: 0 0 ${space(4)}; font-family: ${MONO}; font-size: ${fontSize('xs')}; font-weight: ${fontWeight('medium')}; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.72; }\n .columns ul { display: grid; gap: ${space(3)}; }\n a { color: inherit; text-decoration: none; font-weight: ${fontWeight('medium')}; border-radius: ${t.radiusSm}; }\n a:hover { text-decoration: underline; text-underline-offset: 0.25em; }\n .legal { margin: ${space(16)} 0 0; font-family: ${MONO}; font-size: ${fontSize('xs')}; opacity: 0.72; }\n .foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: ${space(2)} ${space(6)}; margin-block-start: ${space(16)}; }\n .foot .legal { margin: 0; }\n .tagline { margin: 0; font-family: ${MONO}; font-size: ${fontSize('xs')}; opacity: 0.72; text-align: end; }\n .row { display: flex; align-items: flex-start; gap: ${space(8)}; }\n .row .columns { flex: 1; }\n .row impakt-button { flex: none; }\n .stripe { position: absolute; inset-inline: -100vmax; inset-block-end: 0; block-size: 6px; display: flex; }\n .stripe span { flex: 1; }\n @container (max-width: 48rem) { .top { grid-template-columns: 1fr; } .columns { grid-template-columns: repeat(2, minmax(0, 1fr)); } .row { flex-direction: column; } }\n @container (max-width: 40rem) { :host([columns-on-phone='hidden']) .columns { display: none; } }\n @media (forced-colors: active) { :host { border-block-start: 1px solid CanvasText; } .log .dot { border: 1px solid CanvasText; } }\n `,\n ];\n\n private heading(text: string): TemplateResult {\n const level = Math.min(Math.max(this.headingLevel || 2, 2), 4);\n return level === 3 ? html`<h3 class=\"h\">${text}</h3>` : level === 4 ? html`<h4 class=\"h\">${text}</h4>` : html`<h2 class=\"h\">${text}</h2>`;\n }\n\n render(): TemplateResult {\n const log = this.log ?? [];\n return html`<div part=\"footer\">\n <div class=\"top\">\n <div>\n ${this.brand ? html`<p class=\"brand\" part=\"brand\">${this.brand}</p>` : nothing}\n ${log.length ? html`<ul class=\"log\" part=\"log\">${log.map((line, i) => html`<li style=${`--tone:${toneOf(line.tone ?? (i === 0 ? 'success' : 'accent'), i)}`}><span class=\"dot\" aria-hidden=\"true\"></span><span>${line.meta ? html`<span class=\"code\">${line.meta}</span>` : nothing}${line.text}</span></li>`)}</ul>` : nothing}\n </div>\n <div class=\"row\">\n <div class=\"columns\" part=\"columns\" style=${`--count:${Math.max(1, (this.columns ?? []).length)}`}>\n ${(this.columns ?? []).map((column) => html`<div>${this.heading(column.heading)}<ul>${(column.links ?? []).map((link) => html`<li><a href=${link.href}>${link.label}</a></li>`)}</ul></div>`)}\n </div>\n ${this.actionText ? html`<impakt-button variant=\"outline\" icon-after=\"arrow-right\" href=${this.actionHref || nothing} part=\"action\">${this.actionText}</impakt-button>` : nothing}\n </div>\n </div>\n ${\n this.tagline\n ? html`<div class=\"foot\">${this.legal ? html`<p class=\"legal\" part=\"legal\">${this.legal}</p>` : html`<span></span>`}<p class=\"tagline\" part=\"tagline\">${this.tagline}</p></div>`\n : this.legal\n ? html`<p class=\"legal\" part=\"legal\">${this.legal}</p>`\n : nothing\n }\n ${this.stripe ? html`<div class=\"stripe\" aria-hidden=\"true\">${STRIPE.map((i) => html`<span style=${`background:${toneOf(undefined, i)}`}></span>`)}</div>` : nothing}\n </div>`;\n }\n}\n\ncustomElements.define('impakt-site-header', ImpaktSiteHeader);\ncustomElements.define('impakt-wordmark', ImpaktWordmark);\ncustomElements.define('impakt-site-footer', ImpaktSiteFooter);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-site-header': ImpaktSiteHeader;\n 'impakt-wordmark': ImpaktWordmark;\n 'impakt-site-footer': ImpaktSiteFooter;\n }\n}\n"],"mappings":";AAWA,SAAS,KAAK,MAAM,eAAoC;AAExD,SAAS,eAAe,WAAW,QAAQ,UAAU,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ACvD,eAAe,OAAO,sBAAsB,gBAAgB;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/g2-shared.ts"],"sourcesContent":["/**\n * The colours the G2 Noire blocks share.\n *\n * Two kinds. The fixed ink set is for a surface that stays ink in both themes,\n * such as a stage tag or a callout, so the yellow on it stays readable in dark.\n * The band set follows the `impakt-section` band a block sits on: `tone=\"ink\"`\n * sets `--impakt-band` and `--impakt-band-on`, and a block drawn outside any band\n * falls back to the ink values, so it is drawn as an ink panel of its own.\n *\n * Every value is a token with the G2 literal as its fallback, so the theme can\n * take them over without a change here.\n */\nimport { css, unsafeCSS } from 'lit';\nimport { token } from '@atomic-ui/ui';\n\n/** Ink, `#111111`. It does not flip in dark. */\nexport const ink = token('color.ink', '#111111');\n/** Paper, `#EFEFED`: text on ink. */\nexport const paper = token('color.paper', '#EFEFED');\n/** A raised surface on ink, `#1C1C1C`. */\nexport const inkRaised = token('color.ink-raised', '#1C1C1C');\n/** A line on ink, `#2E2E2E`. */\nexport const inkLine = token('color.ink-line', '#2E2E2E');\n/** Quiet text on ink, 7:1 on `#111111`. */\nexport const inkMuted = token('color.ink-muted', '#A8A8A6');\nexport const accent = token('color.accent.default', '#FFD43B');\nexport const accentOn = token('color.accent.on', '#111111');\n\n/** The band behind the block. */\nexport const band = unsafeCSS('var(--impakt-band, var(--impakt-color-ink, #111111))');\n/** Text on the band. */\nexport const bandOn = unsafeCSS('var(--impakt-band-on, var(--impakt-color-paper, #EFEFED))');\n/** Quiet text on the band. */\nexport const bandMuted = unsafeCSS('var(--impakt-band-muted, var(--impakt-color-ink-muted, #A8A8A6))');\n/** A tile raised off the band: `#1C1C1C` on an ink band. */\nexport const bandRaised = unsafeCSS(\n 'var(--impakt-color-band-raised, color-mix(in srgb, var(--impakt-band-on, #EFEFED) 6%, var(--impakt-band, var(--impakt-color-ink, #111111))))',\n);\n/** A line on the band: `#2E2E2E` on an ink band. */\nexport const bandLine = unsafeCSS(\n 'var(--impakt-color-band-line, color-mix(in srgb, var(--impakt-band-on, #EFEFED) 16%, var(--impakt-band, var(--impakt-color-ink, #111111))))',\n);\n\n/** Small uppercase mono, the G2 label: 11px, +6% tracking. */\nexport const monoLabel = css`\n font-family: var(--impakt-font-family-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);\n font-size: 0.6875rem;\n font-weight: 400;\n line-height: 1.4;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n`;\n\n/** The level a heading is given, kept between 1 and 6. */\nexport const levelOf = (n: number | undefined, fallback = 3): number => Math.min(Math.max(Number(n) || fallback, 1), 6);\n\n/** \"1\" → \"01\". */\nexport const pad = (n: number): string => String(n).padStart(2, '0');\n"],"mappings":";AAYA,SAAS,KAAK,iBAAiB;AAC/B,SAAS,aAAa;AAGf,IAAM,MAAM,MAAM,aAAa,SAAS;AAExC,IAAM,QAAQ,MAAM,eAAe,SAAS;AAE5C,IAAM,YAAY,MAAM,oBAAoB,SAAS;AAErD,IAAM,UAAU,MAAM,kBAAkB,SAAS;AAEjD,IAAM,WAAW,MAAM,mBAAmB,SAAS;AACnD,IAAM,SAAS,MAAM,wBAAwB,SAAS;AACtD,IAAM,WAAW,MAAM,mBAAmB,SAAS;AAGnD,IAAM,OAAO,UAAU,sDAAsD;AAE7E,IAAM,SAAS,UAAU,2DAA2D;AAEpF,IAAM,YAAY,UAAU,kEAAkE;AAE9F,IAAM,aAAa;AAAA,EACxB;AACF;AAEO,IAAM,WAAW;AAAA,EACtB;AACF;AAGO,IAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUlB,IAAM,UAAU,CAAC,GAAuB,WAAW,MAAc,KAAK,IAAI,KAAK,IAAI,OAAO,CAAC,KAAK,UAAU,CAAC,GAAG,CAAC;AAG/G,IAAM,MAAM,CAAC,MAAsB,OAAO,CAAC,EAAE,SAAS,GAAG,GAAG;","names":[]}
|