@atomic-ui/ui 0.13.2 → 0.14.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 +71 -2
- package/dist/base/motion.d.ts +44 -0
- package/dist/{chunk-DKVLA7AF.js → chunk-22XEQ4HD.js} +2 -2
- package/dist/{chunk-X57BTN6V.js → chunk-46DONRMK.js} +11 -1
- package/dist/chunk-46DONRMK.js.map +1 -0
- package/dist/{chunk-H5HWJ2D4.js → chunk-7RZYC2IX.js} +2 -2
- package/dist/chunk-FF6GQADC.js +241 -0
- package/dist/chunk-FF6GQADC.js.map +1 -0
- package/dist/{chunk-WGFHYSXH.js → chunk-FJOZL25F.js} +3 -2
- package/dist/{chunk-WGFHYSXH.js.map → chunk-FJOZL25F.js.map} +1 -1
- package/dist/{chunk-NCVBRUJM.js → chunk-FQ4I6TD6.js} +11 -6
- package/dist/chunk-FQ4I6TD6.js.map +1 -0
- package/dist/{chunk-K5QFVLCI.js → chunk-GHUVRNWS.js} +8 -3
- package/dist/chunk-GHUVRNWS.js.map +1 -0
- package/dist/{chunk-VR543SMV.js → chunk-IBBW4CVA.js} +2 -2
- package/dist/{chunk-EFP7PJ6C.js → chunk-J3XAAGFG.js} +7 -2
- package/dist/chunk-J3XAAGFG.js.map +1 -0
- package/dist/{chunk-JDKOHA3B.js → chunk-JBEPS77S.js} +2 -2
- package/dist/chunk-K542UBDD.js +100 -0
- package/dist/chunk-K542UBDD.js.map +1 -0
- package/dist/{chunk-C767LTJE.js → chunk-KBCCL45Y.js} +3 -3
- package/dist/chunk-KBCCL45Y.js.map +1 -0
- package/dist/{chunk-BTACNWU6.js → chunk-KXHRD4FK.js} +2 -2
- package/dist/{chunk-CN4J5RS2.js → chunk-LRDK2G3E.js} +2 -2
- package/dist/{chunk-JX5RJRME.js → chunk-MXPFOBXZ.js} +15 -3
- package/dist/chunk-MXPFOBXZ.js.map +1 -0
- package/dist/{chunk-KDU2POFS.js → chunk-NN6L3HLD.js} +2 -2
- package/dist/{chunk-GIIJ32FN.js → chunk-NTRIND3W.js} +2 -2
- package/dist/{chunk-6IQIFKY6.js → chunk-SLNHUYGJ.js} +2 -2
- package/dist/{chunk-273AYERA.js → chunk-YOJF5ESL.js} +2 -2
- package/dist/components/app-bar.js +2 -2
- package/dist/components/app-ui.js +2 -2
- package/dist/components/button.js +2 -1
- package/dist/components/checkbox-group.js +2 -2
- package/dist/components/checkbox.js +2 -2
- package/dist/components/chip-group.js +3 -2
- package/dist/components/chip.js +1 -1
- package/dist/components/date-input.js +2 -2
- package/dist/components/journey.js +2 -2
- package/dist/components/link.js +2 -1
- package/dist/components/navigation.d.ts +3 -2
- package/dist/components/navigation.js +1 -1
- package/dist/components/page.js +1 -1
- package/dist/components/radio-group.js +2 -2
- package/dist/components/select.js +2 -2
- package/dist/components/switch.js +2 -2
- package/dist/components/text-input.js +2 -2
- package/dist/components/textarea.js +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +41 -17
- package/dist/reveal.d.ts +54 -0
- package/dist/reveal.js +19 -0
- package/dist/reveal.js.map +1 -0
- package/dist/standalone/atomic-ui-reveal.js +3 -0
- package/dist/standalone/atomic-ui-reveal.js.map +7 -0
- package/dist/standalone/atomic-ui.js +773 -689
- package/dist/standalone/atomic-ui.js.map +4 -4
- package/package.json +10 -2
- package/dist/chunk-C767LTJE.js.map +0 -1
- package/dist/chunk-EFP7PJ6C.js.map +0 -1
- package/dist/chunk-JX5RJRME.js.map +0 -1
- package/dist/chunk-K5QFVLCI.js.map +0 -1
- package/dist/chunk-NCVBRUJM.js.map +0 -1
- package/dist/chunk-X57BTN6V.js.map +0 -1
- /package/dist/{chunk-DKVLA7AF.js.map → chunk-22XEQ4HD.js.map} +0 -0
- /package/dist/{chunk-H5HWJ2D4.js.map → chunk-7RZYC2IX.js.map} +0 -0
- /package/dist/{chunk-VR543SMV.js.map → chunk-IBBW4CVA.js.map} +0 -0
- /package/dist/{chunk-JDKOHA3B.js.map → chunk-JBEPS77S.js.map} +0 -0
- /package/dist/{chunk-BTACNWU6.js.map → chunk-KXHRD4FK.js.map} +0 -0
- /package/dist/{chunk-CN4J5RS2.js.map → chunk-LRDK2G3E.js.map} +0 -0
- /package/dist/{chunk-KDU2POFS.js.map → chunk-NN6L3HLD.js.map} +0 -0
- /package/dist/{chunk-GIIJ32FN.js.map → chunk-NTRIND3W.js.map} +0 -0
- /package/dist/{chunk-6IQIFKY6.js.map → chunk-SLNHUYGJ.js.map} +0 -0
- /package/dist/{chunk-273AYERA.js.map → chunk-YOJF5ESL.js.map} +0 -0
package/custom-elements.json
CHANGED
|
@@ -13806,7 +13806,7 @@
|
|
|
13806
13806
|
"type": {
|
|
13807
13807
|
"text": "'links' | 'tabs'"
|
|
13808
13808
|
},
|
|
13809
|
-
"description": "`links` is a row of words. `tabs` is the G2 site header's file tabs: a\nbordered group on the soft surface, each tab
|
|
13809
|
+
"description": "`links` is a row of words. `tabs` is the G2 site header's file tabs: a\nbordered group on the soft surface as wide as its tabs, each tab 32px\ntall, and the page you are on a white 34px tab with a dot before it\n(frame 9:264). The current tab is\nstill `aria-current`, so it is not said by colour alone.",
|
|
13810
13810
|
"default": "'links'",
|
|
13811
13811
|
"attribute": "look",
|
|
13812
13812
|
"reflects": true
|
|
@@ -14029,7 +14029,7 @@
|
|
|
14029
14029
|
"type": {
|
|
14030
14030
|
"text": "'links' | 'tabs'"
|
|
14031
14031
|
},
|
|
14032
|
-
"description": "`links` is a row of words. `tabs` is the G2 site header's file tabs: a\nbordered group on the soft surface, each tab
|
|
14032
|
+
"description": "`links` is a row of words. `tabs` is the G2 site header's file tabs: a\nbordered group on the soft surface as wide as its tabs, each tab 32px\ntall, and the page you are on a white 34px tab with a dot before it\n(frame 9:264). The current tab is\nstill `aria-current`, so it is not said by colour alone.",
|
|
14033
14033
|
"default": "'links'",
|
|
14034
14034
|
"fieldName": "look"
|
|
14035
14035
|
},
|
|
@@ -22082,6 +22082,75 @@
|
|
|
22082
22082
|
}
|
|
22083
22083
|
]
|
|
22084
22084
|
},
|
|
22085
|
+
{
|
|
22086
|
+
"kind": "javascript-module",
|
|
22087
|
+
"path": "src/base/motion.ts",
|
|
22088
|
+
"declarations": [
|
|
22089
|
+
{
|
|
22090
|
+
"kind": "variable",
|
|
22091
|
+
"name": "R",
|
|
22092
|
+
"type": {
|
|
22093
|
+
"text": "object"
|
|
22094
|
+
},
|
|
22095
|
+
"default": "{ /** Arriving: the curve for anything coming into place. */ arrive: token('motion.reveal.arrive', 'cubic-bezier(0.22, 1, 0.36, 1)'), /** A shape changing, such as a frame drawn round words or a line drawn across. */ shape: token('motion.reveal.shape', 'cubic-bezier(0.65, 0, 0.35, 1)'), stagger: token('motion.reveal.stagger', '60ms'), select: token('motion.reveal.select.duration', '260ms'), line: token('motion.reveal.line.duration', '640ms'), type: token('motion.reveal.type.duration', '240ms'), drop: token('motion.reveal.drop.duration', '420ms'), dropDistance: token('motion.reveal.drop.distance', '12px'), count: token('motion.reveal.count.duration', '900ms'), /** A handle or a point appearing. */ mark: token('motion.reveal.mark.duration', '180ms'), arrowDistance: token('motion.reveal.arrow.distance', '0px'), arrowDuration: token('motion.reveal.arrow.duration', '160ms'), arrowEasing: token('motion.reveal.arrow.easing', 'ease-out'), linkDistance: token('motion.reveal.link.distance', '2px'), linkDuration: token('motion.reveal.link.duration', '120ms'), linkEasing: token('motion.reveal.link.easing', 'ease-in-out'), /** How far a hover fill starts across: 1 fades it in whole, 0 wipes it in from the left. */ wipeFrom: token('motion.reveal.wipe.from', '1'), wipeDuration: token('motion.reveal.wipe.duration', '140ms'), wipeEasing: token('motion.reveal.wipe.easing', 'ease-out'), /** How long an arrow leads the shape it belongs to, such as the journey button's lift. */ lead: token('motion.reveal.lead', '0ms'), }"
|
|
22096
|
+
},
|
|
22097
|
+
{
|
|
22098
|
+
"kind": "function",
|
|
22099
|
+
"name": "revealAt",
|
|
22100
|
+
"return": {
|
|
22101
|
+
"type": {
|
|
22102
|
+
"text": "CSSResult"
|
|
22103
|
+
}
|
|
22104
|
+
},
|
|
22105
|
+
"parameters": [
|
|
22106
|
+
{
|
|
22107
|
+
"name": "steps",
|
|
22108
|
+
"default": "'var(--i, 0)'",
|
|
22109
|
+
"type": {
|
|
22110
|
+
"text": "string | number"
|
|
22111
|
+
}
|
|
22112
|
+
},
|
|
22113
|
+
{
|
|
22114
|
+
"name": "extra",
|
|
22115
|
+
"default": "'0ms'"
|
|
22116
|
+
}
|
|
22117
|
+
],
|
|
22118
|
+
"description": "When a part starts: the element's own start, set by `startReveal`, plus `steps` staggers."
|
|
22119
|
+
},
|
|
22120
|
+
{
|
|
22121
|
+
"kind": "variable",
|
|
22122
|
+
"name": "revealStyles",
|
|
22123
|
+
"default": "css` :host([data-motion='armed']), :host([data-motion='armed']) *, :host([data-motion='armed']) *::before, :host([data-motion='armed']) *::after { animation-play-state: paused !important; } [data-ik-count][data-count] { position: relative; -webkit-text-fill-color: transparent; } [data-ik-count][data-count]::after { content: attr(data-count); content: attr(data-count) / ''; position: absolute; inset: 0; -webkit-text-fill-color: currentColor; white-space: nowrap; pointer-events: none; } @keyframes ik-reveal-type { from { clip-path: inset(-4px 100% -4px -4px); } to { clip-path: inset(-4px -4px -4px -4px); } } @keyframes ik-reveal-drop { from { translate: 0 calc(-1 * var(--impakt-motion-reveal-drop-distance, 12px)); opacity: 0; } } @keyframes ik-reveal-settle { from { border-block-end-color: transparent; } } @keyframes ik-reveal-fade { from { opacity: 0; } } @keyframes ik-reveal-mark { from { opacity: 0; scale: 0.4; } } @media (prefers-reduced-motion: reduce) { :host([data-motion]), :host([data-motion]) *, :host([data-motion]) *::before, :host([data-motion]) *::after { animation: none !important; } } `",
|
|
22124
|
+
"description": "What every element that draws itself in shares: its animations wait at their first frame while\nit is armed, a figure being counted is drawn over its own words, which stay the words a screen\nreader reads, and with reduced motion nothing runs at all."
|
|
22125
|
+
}
|
|
22126
|
+
],
|
|
22127
|
+
"exports": [
|
|
22128
|
+
{
|
|
22129
|
+
"kind": "js",
|
|
22130
|
+
"name": "R",
|
|
22131
|
+
"declaration": {
|
|
22132
|
+
"name": "R",
|
|
22133
|
+
"module": "src/base/motion.ts"
|
|
22134
|
+
}
|
|
22135
|
+
},
|
|
22136
|
+
{
|
|
22137
|
+
"kind": "js",
|
|
22138
|
+
"name": "revealAt",
|
|
22139
|
+
"declaration": {
|
|
22140
|
+
"name": "revealAt",
|
|
22141
|
+
"module": "src/base/motion.ts"
|
|
22142
|
+
}
|
|
22143
|
+
},
|
|
22144
|
+
{
|
|
22145
|
+
"kind": "js",
|
|
22146
|
+
"name": "revealStyles",
|
|
22147
|
+
"declaration": {
|
|
22148
|
+
"name": "revealStyles",
|
|
22149
|
+
"module": "src/base/motion.ts"
|
|
22150
|
+
}
|
|
22151
|
+
}
|
|
22152
|
+
]
|
|
22153
|
+
},
|
|
22085
22154
|
{
|
|
22086
22155
|
"kind": "javascript-module",
|
|
22087
22156
|
"path": "src/base/say.ts",
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The reveal set's timing and the styles every element that draws itself in shares.
|
|
3
|
+
*
|
|
4
|
+
* The values are the `motion.reveal.*` tokens. Every brand derives the set off and Impakt sets the
|
|
5
|
+
* G2 Noire values (impkt-web#51), so the fallbacks here are Impakt's. An element's own animations
|
|
6
|
+
* are written under `:host([data-motion])`, which only `startReveal` sets, so the element is drawn
|
|
7
|
+
* in its final state on the server, with no script and with reduced motion.
|
|
8
|
+
*/
|
|
9
|
+
import { type CSSResult } from 'lit';
|
|
10
|
+
export declare const R: {
|
|
11
|
+
/** Arriving: the curve for anything coming into place. */
|
|
12
|
+
arrive: CSSResult;
|
|
13
|
+
/** A shape changing, such as a frame drawn round words or a line drawn across. */
|
|
14
|
+
shape: CSSResult;
|
|
15
|
+
stagger: CSSResult;
|
|
16
|
+
select: CSSResult;
|
|
17
|
+
line: CSSResult;
|
|
18
|
+
type: CSSResult;
|
|
19
|
+
drop: CSSResult;
|
|
20
|
+
dropDistance: CSSResult;
|
|
21
|
+
count: CSSResult;
|
|
22
|
+
/** A handle or a point appearing. */
|
|
23
|
+
mark: CSSResult;
|
|
24
|
+
arrowDistance: CSSResult;
|
|
25
|
+
arrowDuration: CSSResult;
|
|
26
|
+
arrowEasing: CSSResult;
|
|
27
|
+
linkDistance: CSSResult;
|
|
28
|
+
linkDuration: CSSResult;
|
|
29
|
+
linkEasing: CSSResult;
|
|
30
|
+
/** How far a hover fill starts across: 1 fades it in whole, 0 wipes it in from the left. */
|
|
31
|
+
wipeFrom: CSSResult;
|
|
32
|
+
wipeDuration: CSSResult;
|
|
33
|
+
wipeEasing: CSSResult;
|
|
34
|
+
/** How long an arrow leads the shape it belongs to, such as the journey button's lift. */
|
|
35
|
+
lead: CSSResult;
|
|
36
|
+
};
|
|
37
|
+
/** When a part starts: the element's own start, set by `startReveal`, plus `steps` staggers. */
|
|
38
|
+
export declare const revealAt: (steps?: string | number, extra?: string) => CSSResult;
|
|
39
|
+
/**
|
|
40
|
+
* What every element that draws itself in shares: its animations wait at their first frame while
|
|
41
|
+
* it is armed, a figure being counted is drawn over its own words, which stay the words a screen
|
|
42
|
+
* reader reads, and with reduced motion nothing runs at all.
|
|
43
|
+
*/
|
|
44
|
+
export declare const revealStyles: CSSResult;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FieldElement
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-46DONRMK.js";
|
|
4
4
|
import {
|
|
5
5
|
targetSize
|
|
6
6
|
} from "./chunk-72WNCCDC.js";
|
|
@@ -130,4 +130,4 @@ customElements.define("impakt-checkbox-group", ImpaktCheckboxGroup);
|
|
|
130
130
|
export {
|
|
131
131
|
ImpaktCheckboxGroup
|
|
132
132
|
};
|
|
133
|
-
//# sourceMappingURL=chunk-
|
|
133
|
+
//# sourceMappingURL=chunk-22XEQ4HD.js.map
|
|
@@ -143,6 +143,16 @@ var FieldElement = class extends ImpaktElement {
|
|
|
143
143
|
--impakt-field-label-transform: uppercase;
|
|
144
144
|
--impakt-field-label-space: ${space(2)};
|
|
145
145
|
}
|
|
146
|
+
/*
|
|
147
|
+
* The site's field (20:1175, 20:1211): the label on its 1.4 line, 8px over the box, and the box 14 by 16 inside with
|
|
148
|
+
* its words in Body M, 16px on 1.45, so a field is 76px tall with its label and the message box at least 140px.
|
|
149
|
+
*/
|
|
150
|
+
:host([look='site']) .label { line-height: 1.4; }
|
|
151
|
+
:host([look='site']) :is(input, textarea) { display: block; box-sizing: border-box; padding-block: 14px; padding-inline: 16px; line-height: 1.45; }
|
|
152
|
+
:host([look='site']) textarea { min-block-size: max(140px, calc(var(--impakt-textarea-rows, 4) * 1lh + 30px)); }
|
|
153
|
+
:host([look='site']) .search input { padding-inline-start: ${space(10)}; }
|
|
154
|
+
/* The error region stays in the page for its live announcement, but takes no room until there is an error. */
|
|
155
|
+
:host([look='site']:not([invalid])) .error { margin-block-start: 0; }
|
|
146
156
|
.required {
|
|
147
157
|
font-weight: ${fontWeight("regular")};
|
|
148
158
|
color: ${t.textMuted};
|
|
@@ -259,4 +269,4 @@ export {
|
|
|
259
269
|
fieldControl,
|
|
260
270
|
FieldElement
|
|
261
271
|
};
|
|
262
|
-
//# sourceMappingURL=chunk-
|
|
272
|
+
//# sourceMappingURL=chunk-46DONRMK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/base/FieldElement.ts"],"sourcesContent":["import { html, css, nothing, unsafeCSS, type CSSResult, type TemplateResult } from 'lit';\nimport { ImpaktElement } from './ImpaktElement';\nimport { focusRing, visuallyHidden } from './styles';\nimport { fontSize, fontWeight, lineHeight, space, t, token } from './tokens';\n\n/**\n * The shared anatomy of a form control: a label, an optional description, a\n * control, and an error.\n *\n * This exists because the ARIA wiring between those four is where accessible\n * forms actually fail, and it fails the same way every time — a description\n * that is never announced, an error that appears silently, a label that points\n * at nothing. Written once, it is right once.\n *\n * Everything is rendered inside this component's own shadow root, including\n * the native control. That is not an implementation detail: `aria-describedby`\n * cannot cross a shadow boundary, so a component that slotted the input from\n * outside could not describe it. Keeping the whole relationship in one tree is\n * what makes the wiring work at all.\n */\n/**\n * How wide a single-line control is, from what it holds: a postcode is short,\n * an email address is long. A width that matches the answer is a hint about\n * what to type (1.3.5 is about the purpose, this is about the size). Applied by\n * the controls that take a `width`, through `--impakt-field-width`.\n */\nexport const fieldWidths = css`\n :host { --impakt-field-width: 100%; }\n :host([width='xs']) { --impakt-field-width: 8ch; }\n :host([width='sm']) { --impakt-field-width: 14ch; }\n :host([width='md']) { --impakt-field-width: 24ch; }\n :host([width='lg']) { --impakt-field-width: 40ch; }\n`;\n\n/**\n * The field's shape, from the brand (`field.*` in `@atomic-ui/design-tokens`). Each fallback is\n * the shape every brand derives: a 44px box with the grey border that darkens when pointed at,\n * and the brand's halo round the focus ring. The Impakt theme sets the G2 Noire shape over it:\n * a 50px box with an ink edge and the plain focus ring (frames 33:492 and 36:398).\n *\n * An edge is how much of the text colour it takes, mixed here rather than on the root, so a\n * band that repaints the text colour repaints the edge with it.\n */\nexport const F = {\n height: token('field.height', '44px'),\n paddingBlock: token('field.padding-block', '10px'),\n paddingInline: token('field.padding-inline', '12px'),\n lineHeight: token('field.line-height', 'normal'),\n radius: token('field.radius', '8px'),\n edge: token('field.edge', '0%'),\n focusEdge: token('field.focus-edge', '0%'),\n focusHalo: token('field.focus-halo', '6px'),\n};\n\n/**\n * The box a single control is drawn in, shared by the text input, the select and\n * the textarea so they match, in the brand's field shape (`F` above).\n * A product can still set `--impakt-shadow-field` or `--impakt-color-field-border`.\n */\nexport const fieldControl = (selector: string): CSSResult => {\n const s = unsafeCSS(selector);\n return css`\n ${s} {\n inline-size: min(100%, var(--impakt-field-width));\n min-block-size: ${F.height};\n padding: ${F.paddingBlock} ${F.paddingInline};\n font-family: inherit;\n font-size: ${fontSize('md')};\n line-height: ${F.lineHeight};\n color: ${t.text};\n background: var(--impakt-color-field-surface, ${t.surfaceCard});\n border: ${t.borderThin} solid var(--impakt-color-field-border, color-mix(in srgb, ${t.text} ${F.edge}, ${t.border}));\n border-radius: ${F.radius};\n box-shadow: var(--impakt-shadow-field, ${t.shadowXs});\n transition: border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;\n }\n ${s}:hover:not(:disabled) {\n border-color: var(--impakt-color-field-border, color-mix(in srgb, ${t.text} ${F.edge}, ${t.borderStrong}));\n }\n /* The focus ring, and the brand's halo round it where the brand draws one, so the field being typed in is plain at a glance. */\n ${s}:focus-visible {\n border-color: color-mix(in srgb, ${t.text} ${F.focusEdge}, ${t.brand});\n box-shadow: ${t.focusShadow}, 0 0 0 ${F.focusHalo} ${t.brandHalo};\n }\n ${s}::placeholder {\n color: ${t.textPlaceholder};\n }\n ${s}:disabled {\n background: ${t.surfaceInset};\n cursor: not-allowed;\n }\n /* The border thickens as well as reddening, and the message below says it in words (1.4.1). */\n :host([invalid]) ${s} {\n border-color: ${t.danger};\n border-width: ${t.borderThick};\n }\n `;\n};\n\n/**\n * The base of every form control.\n *\n * @fires {CustomEvent<{ value: string }>} impakt-change - When the answer changes. The answer is in detail.value.\n */\nexport abstract class FieldElement extends ImpaktElement {\n /** Form controls participate in a `<form>` like native ones. */\n static formAssociated = true;\n\n static properties = {\n label: { type: String },\n name: { type: String },\n value: { type: String },\n description: { type: String },\n error: { type: String },\n required: { type: Boolean, reflect: true },\n disabled: { type: Boolean, reflect: true },\n readonly: { type: Boolean, reflect: true },\n requiredText: { type: String, attribute: 'required-text' },\n look: { type: String, reflect: true },\n };\n\n declare label: string;\n declare name: string;\n declare value: string;\n declare description: string;\n declare error: string;\n declare required: boolean;\n declare disabled: boolean;\n declare readonly: boolean;\n /**\n * How \"you must answer this\" is said.\n *\n * Words, not an asterisk. 3.3.2 asks for labels or instructions, and an\n * asterisk is neither until a legend explains it — which puts the\n * explanation somewhere other than the field it explains. It is a property\n * so a partner can reword it, not so they can empty it.\n */\n declare requiredText: string;\n /**\n * `default` takes the brand's field label; `site` is the mono uppercase label of the site's\n * forms, as the G2 contact frame (20:1100) draws \"NAME\" and \"MESSAGE\" and as\n * `impakt-chip-group look=\"site\"` draws its own (#66).\n */\n declare look: 'default' | 'site';\n\n protected internals: ElementInternals | null = null;\n\n constructor() {\n super();\n this.label = '';\n this.name = '';\n this.value = '';\n this.description = '';\n this.error = '';\n this.required = false;\n this.disabled = false;\n this.readonly = false;\n this.requiredText = 'required';\n this.look = 'default';\n // happy-dom and older engines do not implement attachInternals. A control\n // that cannot associate with a form is still a usable control, so this\n // degrades rather than throwing on construction.\n try {\n this.internals = this.attachInternals();\n } catch {\n this.internals = null;\n }\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n css`\n :host {\n display: block;\n margin-block-end: ${space(4)};\n }\n /*\n * The question, at 14px in the ink: semibold in the body face, or under Noire in the code\n * face (G2). The brand sets the face and weight (field.label.*); a page can set it\n * another way through these properties, such as the site's contact form, which sets its\n * labels in capitals at 11px (frame 20:1157).\n */\n .label {\n display: block;\n font-family: var(--impakt-field-label-font, ${t.fontBody});\n font-size: var(--impakt-field-label-size, ${fontSize('sm')});\n font-weight: var(--impakt-field-label-weight, ${fontWeight('semibold')});\n letter-spacing: var(--impakt-field-label-tracking, normal);\n text-transform: var(--impakt-field-label-transform, none);\n line-height: ${lineHeight('normal')};\n margin-block-end: var(--impakt-field-label-space, ${space(1)});\n color: ${t.text};\n }\n /* The site's form label (20:1100): G2 Mono S, IBM Plex Mono medium at 11px, in capitals, 8px above the box (#66). */\n :host([look='site']) {\n --impakt-field-label-font: ${t.fontMono};\n --impakt-field-label-size: 0.6875rem;\n --impakt-field-label-weight: ${fontWeight('medium')};\n --impakt-field-label-tracking: 0.06em;\n --impakt-field-label-transform: uppercase;\n --impakt-field-label-space: ${space(2)};\n }\n /*\n * The site's field (20:1175, 20:1211): the label on its 1.4 line, 8px over the box, and the box 14 by 16 inside with\n * its words in Body M, 16px on 1.45, so a field is 76px tall with its label and the message box at least 140px.\n */\n :host([look='site']) .label { line-height: 1.4; }\n :host([look='site']) :is(input, textarea) { display: block; box-sizing: border-box; padding-block: 14px; padding-inline: 16px; line-height: 1.45; }\n :host([look='site']) textarea { min-block-size: max(140px, calc(var(--impakt-textarea-rows, 4) * 1lh + 30px)); }\n :host([look='site']) .search input { padding-inline-start: ${space(10)}; }\n /* The error region stays in the page for its live announcement, but takes no room until there is an error. */\n :host([look='site']:not([invalid])) .error { margin-block-start: 0; }\n .required {\n font-weight: ${fontWeight('regular')};\n color: ${t.textMuted};\n }\n .description {\n font-size: ${fontSize('sm')};\n line-height: ${lineHeight('normal')};\n color: ${t.textMuted};\n margin-block-end: ${space(2)};\n }\n .error {\n font-size: ${fontSize('sm')};\n line-height: ${lineHeight('normal')};\n color: ${t.dangerText};\n margin-block-start: ${space(1)};\n display: flex;\n gap: ${space(1)};\n }\n .error:empty {\n display: none;\n }\n .visually-hidden {\n ${visuallyHidden}\n }\n /*\n * Only the control is dimmed. Dimming the whole host took the question,\n * the hint and the error below 4.5:1, and a disabled field still has to\n * say what it is and why it cannot be changed. The native disabled\n * control itself is exempt from the contrast criterion.\n */\n :host([disabled]) :is(input, select, textarea, button) {\n opacity: 0.6;\n cursor: not-allowed;\n }\n `,\n ];\n\n protected get controlId(): string {\n return this.id_('control');\n }\n\n /**\n * What the control points `aria-describedby` at.\n *\n * The error id is included only while there is an error. A describedby that\n * always names an empty element trains a screen-reader user to expect\n * nothing after the description, and then the one time it matters they have\n * already learned to ignore it.\n */\n protected get describedBy(): string | typeof nothing {\n const ids = [this.description ? this.id_('description') : '', this.error ? this.id_('error') : ''].filter(Boolean);\n return ids.length ? ids.join(' ') : nothing;\n }\n\n /**\n * Focusing the element focuses its control, so `el.focus()` from an app, a\n * React ref or the error summary's link lands where someone can type, rather\n * than on a host that cannot take focus and so silently does nothing.\n */\n focus(options?: FocusOptions): void {\n const control =\n this.renderRoot?.querySelector<HTMLElement>(`#${this.controlId}`) ?? this.renderRoot?.querySelector<HTMLElement>('input, select, textarea, button');\n if (control) control.focus(options);\n else super.focus(options);\n }\n\n /** Subclasses render the control itself; everything round it is here. */\n protected abstract renderControl(): TemplateResult;\n\n /**\n * `<label for>` by default. A group of controls — radios, checkboxes —\n * cannot use one, because `for` names a single control, so those override\n * this and render a `<fieldset>` and `<legend>` instead.\n */\n protected renderLabel(): TemplateResult {\n return html`\n <label class=\"label\" for=${this.controlId} part=\"label\">\n ${this.label}${this.required ? html`<span class=\"required\"> (${this.requiredText})</span>` : nothing}\n </label>\n `;\n }\n\n render(): TemplateResult {\n return html`\n ${this.renderLabel()}\n ${\n this.description\n ? html`<div class=\"description\" id=${this.id_('description')} part=\"description\">\n ${this.description}\n </div>`\n : nothing\n }\n ${this.renderControl()}\n <!--\n The error region is always present, even when empty. A live region\n inserted at the same moment as its content is announced unreliably\n across screen readers; one that already exists and is then filled is\n announced consistently. \"polite\" rather than \"assertive\" because a\n validation message should not interrupt what is being read.\n -->\n <div\n class=\"error\"\n id=${this.id_('error')}\n part=\"error\"\n aria-live=\"polite\"\n >\n ${this.error || nothing}\n </div>\n `;\n }\n\n /** Keep the form value in step with the control. */\n protected setFormValue(value: string): void {\n this.value = value;\n this.internals?.setFormValue(value);\n this.dispatchEvent(new CustomEvent('impakt-change', { detail: this.changeDetail(value), bubbles: true, composed: true }));\n }\n\n /** What `impakt-change` carries. A control with more to say than its value adds it here. */\n protected changeDetail(value: string): { value: string } {\n return { value };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,SAAS,iBAAsD;AA0B5E,IAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBpB,IAAM,IAAI;AAAA,EACf,QAAQ,MAAM,gBAAgB,MAAM;AAAA,EACpC,cAAc,MAAM,uBAAuB,MAAM;AAAA,EACjD,eAAe,MAAM,wBAAwB,MAAM;AAAA,EACnD,YAAY,MAAM,qBAAqB,QAAQ;AAAA,EAC/C,QAAQ,MAAM,gBAAgB,KAAK;AAAA,EACnC,MAAM,MAAM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A,EAEA,SAAyB;AACvB,WAAO;AAAA,QACH,KAAK,YAAY,CAAC;AAAA,QAElB,KAAK,cACD,mCAAmC,KAAK,IAAI,aAAa,CAAC;AAAA,cACxD,KAAK,WAAW;AAAA,oBAElB,OACN;AAAA,QACE,KAAK,cAAc,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAUf,KAAK,IAAI,OAAO,CAAC;AAAA;AAAA;AAAA;AAAA,UAIpB,KAAK,SAAS,OAAO;AAAA;AAAA;AAAA,EAG7B;AAAA;AAAA,EAGU,aAAa,OAAqB;AAC1C,SAAK,QAAQ;AACb,SAAK,WAAW,aAAa,KAAK;AAClC,SAAK,cAAc,IAAI,YAAY,iBAAiB,EAAE,QAAQ,KAAK,aAAa,KAAK,GAAG,SAAS,MAAM,UAAU,KAAK,CAAC,CAAC;AAAA,EAC1H;AAAA;AAAA,EAGU,aAAa,OAAkC;AACvD,WAAO,EAAE,MAAM;AAAA,EACjB;AACF;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FieldElement
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-46DONRMK.js";
|
|
4
4
|
import {
|
|
5
5
|
targetSize
|
|
6
6
|
} from "./chunk-72WNCCDC.js";
|
|
@@ -138,4 +138,4 @@ customElements.define("impakt-radio-group", ImpaktRadioGroup);
|
|
|
138
138
|
export {
|
|
139
139
|
ImpaktRadioGroup
|
|
140
140
|
};
|
|
141
|
-
//# sourceMappingURL=chunk-
|
|
141
|
+
//# sourceMappingURL=chunk-7RZYC2IX.js.map
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
// packages/ui/src/reveal.ts
|
|
2
|
+
var REVEAL_SELECTOR = [
|
|
3
|
+
"impakt-highlight",
|
|
4
|
+
"impakt-process-line",
|
|
5
|
+
"impakt-section-head",
|
|
6
|
+
"impakt-stage-tag",
|
|
7
|
+
"impakt-service-card",
|
|
8
|
+
"impakt-stat-row",
|
|
9
|
+
"impakt-work-list",
|
|
10
|
+
"[data-reveal]"
|
|
11
|
+
].join(", ");
|
|
12
|
+
var REVEAL_STATE = "data-motion";
|
|
13
|
+
function revealMode(doc = document) {
|
|
14
|
+
const view = doc.defaultView;
|
|
15
|
+
if (!view) return "none";
|
|
16
|
+
return view.getComputedStyle(doc.documentElement).getPropertyValue("--impakt-motion-reveal-mode").trim() || "none";
|
|
17
|
+
}
|
|
18
|
+
function revealAllowed(doc = document) {
|
|
19
|
+
const view = doc.defaultView;
|
|
20
|
+
if (!view || typeof view.IntersectionObserver !== "function") return false;
|
|
21
|
+
if (view.matchMedia?.("(prefers-reduced-motion: reduce)").matches) return false;
|
|
22
|
+
return revealMode(doc) === "once";
|
|
23
|
+
}
|
|
24
|
+
function revealTargets(root) {
|
|
25
|
+
const out = [];
|
|
26
|
+
const walk = (node) => {
|
|
27
|
+
if (node.nodeType === 1 && node.matches(REVEAL_SELECTOR)) out.push(node);
|
|
28
|
+
for (const el of Array.from(node.querySelectorAll("*"))) {
|
|
29
|
+
if (el.matches(REVEAL_SELECTOR)) out.push(el);
|
|
30
|
+
if (el.shadowRoot) walk(el.shadowRoot);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
walk(root);
|
|
34
|
+
return [...new Set(out)];
|
|
35
|
+
}
|
|
36
|
+
var ms = (value, fallback) => {
|
|
37
|
+
const v = value.trim();
|
|
38
|
+
if (!v) return fallback;
|
|
39
|
+
const n = parseFloat(v);
|
|
40
|
+
if (!Number.isFinite(n)) return fallback;
|
|
41
|
+
return v.endsWith("ms") ? n : v.endsWith("s") ? n * 1e3 : n;
|
|
42
|
+
};
|
|
43
|
+
function bezierOf(value) {
|
|
44
|
+
const m = value.match(/cubic-bezier\(([^)]+)\)/);
|
|
45
|
+
const [x1, y1, x2, y2] = m ? m[1].split(",").map((n) => parseFloat(n)) : [0.22, 1, 0.36, 1];
|
|
46
|
+
const at = (a, b, t) => 3 * a * (1 - t) * (1 - t) * t + 3 * b * (1 - t) * t * t + t * t * t;
|
|
47
|
+
return (x) => {
|
|
48
|
+
if (x <= 0) return 0;
|
|
49
|
+
if (x >= 1) return 1;
|
|
50
|
+
let lo = 0;
|
|
51
|
+
let hi = 1;
|
|
52
|
+
let t = x;
|
|
53
|
+
for (let i = 0; i < 30; i++) {
|
|
54
|
+
const v = at(x1, x2, t);
|
|
55
|
+
if (Math.abs(v - x) < 1e-5) break;
|
|
56
|
+
if (v < x) lo = t;
|
|
57
|
+
else hi = t;
|
|
58
|
+
t = (lo + hi) / 2;
|
|
59
|
+
}
|
|
60
|
+
return at(y1, y2, t);
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function countsIn(el) {
|
|
64
|
+
const found = [];
|
|
65
|
+
const add = (root) => found.push(...Array.from(root.querySelectorAll("[data-ik-count]")));
|
|
66
|
+
if (el.matches("[data-ik-count]")) found.push(el);
|
|
67
|
+
else if (el.matches('[data-reveal~="count"]')) {
|
|
68
|
+
el.setAttribute("data-ik-count", "");
|
|
69
|
+
found.push(el);
|
|
70
|
+
}
|
|
71
|
+
add(el);
|
|
72
|
+
if (el.shadowRoot) add(el.shadowRoot);
|
|
73
|
+
return found;
|
|
74
|
+
}
|
|
75
|
+
var NUMBER = /\d[\d,]*(?:\.\d+)?/;
|
|
76
|
+
var NUMBER_ALL = /\d[\d,]*(?:\.\d+)?/g;
|
|
77
|
+
function countUp(el, delay, view) {
|
|
78
|
+
const inText = el.getAttribute("data-ik-count") === "text";
|
|
79
|
+
const node = inText ? findTextNode(el) : null;
|
|
80
|
+
const words = (inText ? node?.data : el.textContent)?.replace(/\s+/g, " ").trim() ?? "";
|
|
81
|
+
const match = [...words.matchAll(NUMBER_ALL)].sort((a, b) => parseFloat(b[0].replace(/,/g, "")) - parseFloat(a[0].replace(/,/g, "")))[0];
|
|
82
|
+
if (!match || inText && !node) return Promise.resolve();
|
|
83
|
+
const raw = match[0];
|
|
84
|
+
const target = parseFloat(raw.replace(/,/g, ""));
|
|
85
|
+
const decimals = (raw.split(".")[1] ?? "").length;
|
|
86
|
+
const grouped = raw.includes(",");
|
|
87
|
+
const style = view.getComputedStyle(el);
|
|
88
|
+
const duration = ms(style.getPropertyValue("--ik-count-duration"), ms(style.getPropertyValue("--impakt-motion-reveal-count-duration"), 900));
|
|
89
|
+
const ease = bezierOf(style.getPropertyValue("--impakt-motion-reveal-arrive"));
|
|
90
|
+
const original = node?.data ?? "";
|
|
91
|
+
const at = node ? original.lastIndexOf(raw, original.length) : 0;
|
|
92
|
+
const write = (n) => {
|
|
93
|
+
let figure = n.toFixed(decimals);
|
|
94
|
+
if (grouped) figure = Number(figure).toLocaleString("en-GB", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
95
|
+
if (node) node.data = original.slice(0, at) + figure + original.slice(at + raw.length);
|
|
96
|
+
else el.setAttribute("data-count", words.slice(0, match.index) + figure + words.slice(match.index + raw.length));
|
|
97
|
+
};
|
|
98
|
+
const finish = () => {
|
|
99
|
+
if (node) node.data = original;
|
|
100
|
+
else el.removeAttribute("data-count");
|
|
101
|
+
};
|
|
102
|
+
write(0);
|
|
103
|
+
return new Promise((done) => {
|
|
104
|
+
let start = 0;
|
|
105
|
+
const step = (now) => {
|
|
106
|
+
if (!start) start = now + delay;
|
|
107
|
+
const t = (now - start) / duration;
|
|
108
|
+
if (t >= 1 || !el.isConnected) {
|
|
109
|
+
finish();
|
|
110
|
+
done();
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
write(t <= 0 ? 0 : target * ease(t));
|
|
114
|
+
view.requestAnimationFrame(step);
|
|
115
|
+
};
|
|
116
|
+
view.requestAnimationFrame(step);
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function findTextNode(el) {
|
|
120
|
+
const walker = el.ownerDocument.createTreeWalker(el, NodeFilter.SHOW_TEXT);
|
|
121
|
+
for (let n = walker.nextNode(); n; n = walker.nextNode()) if (NUMBER.test(n.data)) return n;
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
function arm(el) {
|
|
125
|
+
el.setAttribute(REVEAL_STATE, "armed");
|
|
126
|
+
if (el.matches('[data-reveal~="drop"]')) Array.from(el.children).forEach((child, i) => child.style.setProperty("--ik-reveal-i", String(i)));
|
|
127
|
+
}
|
|
128
|
+
function settle(el) {
|
|
129
|
+
el.removeAttribute(REVEAL_STATE);
|
|
130
|
+
el.style?.removeProperty("--ik-reveal-delay");
|
|
131
|
+
}
|
|
132
|
+
function animationsOf(el) {
|
|
133
|
+
const list = new Set(el.getAnimations?.({ subtree: true }) ?? []);
|
|
134
|
+
for (const a of el.shadowRoot?.getAnimations?.() ?? []) list.add(a);
|
|
135
|
+
return [...list];
|
|
136
|
+
}
|
|
137
|
+
function play(el, delay, view) {
|
|
138
|
+
if (!el.hasAttribute(REVEAL_STATE)) arm(el);
|
|
139
|
+
el.style.setProperty("--ik-reveal-delay", `${Math.round(delay)}ms`);
|
|
140
|
+
el.setAttribute(REVEAL_STATE, "play");
|
|
141
|
+
const counts = countsIn(el).map((c) => {
|
|
142
|
+
const i = Number(view.getComputedStyle(c).getPropertyValue("--i")) || 0;
|
|
143
|
+
const stagger = ms(view.getComputedStyle(c).getPropertyValue("--impakt-motion-reveal-stagger"), 60);
|
|
144
|
+
return countUp(c, delay + i * stagger, view);
|
|
145
|
+
});
|
|
146
|
+
return new Promise((done) => {
|
|
147
|
+
view.requestAnimationFrame(() => {
|
|
148
|
+
const safety = new Promise((resolve) => view.setTimeout(resolve, delay + 4e3));
|
|
149
|
+
const finished = Promise.all([...animationsOf(el).map((a) => a.finished.catch(() => void 0)), ...counts]);
|
|
150
|
+
Promise.race([finished, safety]).then(() => {
|
|
151
|
+
settle(el);
|
|
152
|
+
done();
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
var byPlace = (a, b) => Math.abs(a.top - b.top) > 4 ? a.top - b.top : a.left - b.left;
|
|
158
|
+
function startReveal(doc = document) {
|
|
159
|
+
const view = doc.defaultView;
|
|
160
|
+
if (!view || view.__impaktReveal || !revealAllowed(doc)) return;
|
|
161
|
+
const armed = /* @__PURE__ */ new Set();
|
|
162
|
+
const height = () => view.innerHeight || doc.documentElement.clientHeight;
|
|
163
|
+
const stagger = () => ms(view.getComputedStyle(doc.documentElement).getPropertyValue("--impakt-motion-reveal-stagger"), 60);
|
|
164
|
+
const release = (list) => {
|
|
165
|
+
const boxes = list.map((el) => ({ el, box: el.getBoundingClientRect() }));
|
|
166
|
+
boxes.sort((a, b) => byPlace(a.box, b.box));
|
|
167
|
+
boxes.forEach(({ el }, i) => {
|
|
168
|
+
armed.delete(el);
|
|
169
|
+
middle.unobserve(el);
|
|
170
|
+
whole.unobserve(el);
|
|
171
|
+
void play(el, Math.min(i, 8) * stagger(), view);
|
|
172
|
+
});
|
|
173
|
+
};
|
|
174
|
+
const onEntries = (entries) => release(entries.filter((e) => e.isIntersecting && armed.has(e.target)).map((e) => e.target));
|
|
175
|
+
const middle = new view.IntersectionObserver(onEntries, { rootMargin: "0px 0px -50% 0px" });
|
|
176
|
+
const whole = new view.IntersectionObserver(onEntries, { threshold: 0.98 });
|
|
177
|
+
let frame = 0;
|
|
178
|
+
const onScroll = () => {
|
|
179
|
+
if (frame) return;
|
|
180
|
+
frame = view.requestAnimationFrame(() => {
|
|
181
|
+
frame = 0;
|
|
182
|
+
for (const el of armed) {
|
|
183
|
+
if (el.getBoundingClientRect().bottom < 0) {
|
|
184
|
+
armed.delete(el);
|
|
185
|
+
middle.unobserve(el);
|
|
186
|
+
whole.unobserve(el);
|
|
187
|
+
settle(el);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
const painted = (view.performance?.getEntriesByType?.("paint") ?? []).length > 0;
|
|
193
|
+
for (const el of revealTargets(doc)) {
|
|
194
|
+
if (el.hasAttribute(REVEAL_STATE)) continue;
|
|
195
|
+
const box = el.getBoundingClientRect();
|
|
196
|
+
if (box.width === 0 && box.height === 0) continue;
|
|
197
|
+
if (box.bottom < 0) continue;
|
|
198
|
+
if (box.top < height() && painted) continue;
|
|
199
|
+
arm(el);
|
|
200
|
+
armed.add(el);
|
|
201
|
+
middle.observe(el);
|
|
202
|
+
whole.observe(el);
|
|
203
|
+
}
|
|
204
|
+
const stop = () => {
|
|
205
|
+
middle.disconnect();
|
|
206
|
+
whole.disconnect();
|
|
207
|
+
view.removeEventListener("scroll", onScroll);
|
|
208
|
+
for (const el of armed) settle(el);
|
|
209
|
+
armed.clear();
|
|
210
|
+
};
|
|
211
|
+
view.addEventListener("scroll", onScroll, { passive: true });
|
|
212
|
+
view.matchMedia?.("(prefers-reduced-motion: reduce)").addEventListener?.("change", (e) => {
|
|
213
|
+
if (e.matches) stop();
|
|
214
|
+
});
|
|
215
|
+
view.__impaktReveal = { armed, stop };
|
|
216
|
+
}
|
|
217
|
+
function replayReveal(root = document) {
|
|
218
|
+
const doc = root.nodeType === 9 ? root : root.ownerDocument;
|
|
219
|
+
const view = doc.defaultView;
|
|
220
|
+
if (!view || !revealAllowed(doc)) return Promise.resolve();
|
|
221
|
+
const targets = revealTargets(root);
|
|
222
|
+
targets.forEach(arm);
|
|
223
|
+
return new Promise(
|
|
224
|
+
(done) => view.requestAnimationFrame(() => {
|
|
225
|
+
const boxes = targets.map((el) => ({ el, box: el.getBoundingClientRect() })).sort((a, b) => byPlace(a.box, b.box));
|
|
226
|
+
const step = ms(view.getComputedStyle(doc.documentElement).getPropertyValue("--impakt-motion-reveal-stagger"), 60);
|
|
227
|
+
Promise.all(boxes.map(({ el }, i) => play(el, i * step, view))).then(() => done());
|
|
228
|
+
})
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export {
|
|
233
|
+
REVEAL_SELECTOR,
|
|
234
|
+
REVEAL_STATE,
|
|
235
|
+
revealMode,
|
|
236
|
+
revealAllowed,
|
|
237
|
+
revealTargets,
|
|
238
|
+
startReveal,
|
|
239
|
+
replayReveal
|
|
240
|
+
};
|
|
241
|
+
//# sourceMappingURL=chunk-FF6GQADC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/reveal.ts"],"sourcesContent":["/**\n * Reveal once: the page draws itself in as the reader reaches it, once, and then holds still.\n *\n * This is the one mechanism behind the G2 Noire motion set (impkt-web#51). It has no dependency, not\n * even Lit, so a page drawn on the server can load it on its own (`atomic-ui-reveal.js`, a few KB)\n * and have its blocks draw themselves in without hydrating anything.\n *\n * How it works:\n *\n * - Every element is drawn in its final state, on the server and in the browser. A page with no\n * script, or with reduced motion asked for, shows that and nothing else moves.\n * - With motion, each element the reader has not reached yet is marked `data-motion=\"armed\"`. An\n * element's own styles start its animations under `[data-motion]` and pause them while it is\n * armed, so it waits at its first frame, out of sight below the fold.\n * - When its top reaches the middle of the screen (or it is wholly on the screen, at the foot of a\n * page), it is marked `data-motion=\"play\"` and its animations run. Elements that arrive together\n * go one after another, `motion.reveal.stagger` apart, in the order they are drawn on the screen.\n * - When they have finished the mark is taken off, so the element is in the state it was drawn in,\n * and it is never animated again, however often it is scrolled past.\n * - An element already on the screen when the page has been painted is left as it is: nothing moves\n * under words someone may be reading. An element scrolled past without being reached, such as by\n * following a link to a section further down, is let go in its final state.\n *\n * The brand decides whether any of this happens: only a brand whose `--impakt-motion-reveal-mode`\n * is `once` arms anything. Every brand derives `none`, and Impakt sets `once`, so Harbour holds still.\n *\n * Figures count up: an element marked `data-ik-count` has the first number in its words counted\n * from 0 over `motion.reveal.count.duration`. The words themselves never change, so a screen\n * reader reads the real figure throughout: the count is drawn over them, from `data-count`, by the\n * element's styles. `data-ik-count=\"text\"` counts in the words themselves, for decoration that is\n * hidden from a screen reader, such as a size label.\n */\n\n/** The blocks that draw themselves in, and any element that asks to with `data-reveal`. */\nexport const REVEAL_SELECTOR = [\n 'impakt-highlight',\n 'impakt-process-line',\n 'impakt-section-head',\n 'impakt-stage-tag',\n 'impakt-service-card',\n 'impakt-stat-row',\n 'impakt-work-list',\n '[data-reveal]',\n].join(', ');\n\n/** The attribute that carries an element's state: `armed`, then `play`, then none. */\nexport const REVEAL_STATE = 'data-motion';\n\ntype Box = { top: number; bottom: number; left: number; width: number; height: number };\n\ninterface Controller {\n /** The elements waiting to be reached. */\n armed: Set<Element>;\n stop(): void;\n}\n\ntype RevealWindow = Window & typeof globalThis & { __impaktReveal?: Controller };\n\n/** The brand's choice, read from the theme: `once` turns the set on. */\nexport function revealMode(doc: Document = document): string {\n const view = doc.defaultView;\n if (!view) return 'none';\n return view.getComputedStyle(doc.documentElement).getPropertyValue('--impakt-motion-reveal-mode').trim() || 'none';\n}\n\n/** Whether this page should move at all: the brand turns the set on, and the reader has not asked for less motion. */\nexport function revealAllowed(doc: Document = document): boolean {\n const view = doc.defaultView;\n if (!view || typeof view.IntersectionObserver !== 'function') return false;\n if (view.matchMedia?.('(prefers-reduced-motion: reduce)').matches) return false;\n return revealMode(doc) === 'once';\n}\n\n/** Every element that draws itself in, under `root` and inside the shadow roots of the elements there, such as a section head's stage tag. */\nexport function revealTargets(root: Document | Element | ShadowRoot): Element[] {\n const out: Element[] = [];\n const walk = (node: Document | Element | ShadowRoot) => {\n if (node.nodeType === 1 && (node as Element).matches(REVEAL_SELECTOR)) out.push(node as Element);\n for (const el of Array.from(node.querySelectorAll('*'))) {\n if (el.matches(REVEAL_SELECTOR)) out.push(el);\n if (el.shadowRoot) walk(el.shadowRoot);\n }\n };\n walk(root);\n return [...new Set(out)];\n}\n\nconst ms = (value: string, fallback: number): number => {\n const v = value.trim();\n if (!v) return fallback;\n const n = parseFloat(v);\n if (!Number.isFinite(n)) return fallback;\n return v.endsWith('ms') ? n : v.endsWith('s') ? n * 1000 : n;\n};\n\n/** A CSS cubic-bezier() as a function from time to progress. */\nfunction bezierOf(value: string): (x: number) => number {\n const m = value.match(/cubic-bezier\\(([^)]+)\\)/);\n const [x1, y1, x2, y2] = m ? m[1]!.split(',').map((n) => parseFloat(n)) : [0.22, 1, 0.36, 1];\n const at = (a: number, b: number, t: number) => 3 * a * (1 - t) * (1 - t) * t + 3 * b * (1 - t) * t * t + t * t * t;\n return (x) => {\n if (x <= 0) return 0;\n if (x >= 1) return 1;\n let lo = 0;\n let hi = 1;\n let t = x;\n for (let i = 0; i < 30; i++) {\n const v = at(x1!, x2!, t);\n if (Math.abs(v - x) < 1e-5) break;\n if (v < x) lo = t;\n else hi = t;\n t = (lo + hi) / 2;\n }\n return at(y1!, y2!, t);\n };\n}\n\n/** The elements inside `el` (and `el` itself) whose figures count up. */\nfunction countsIn(el: Element): HTMLElement[] {\n const found: HTMLElement[] = [];\n const add = (root: Element | ShadowRoot) => found.push(...(Array.from(root.querySelectorAll('[data-ik-count]')) as HTMLElement[]));\n if (el.matches('[data-ik-count]')) found.push(el as HTMLElement);\n else if (el.matches('[data-reveal~=\"count\"]')) {\n el.setAttribute('data-ik-count', '');\n found.push(el as HTMLElement);\n }\n add(el);\n if (el.shadowRoot) add(el.shadowRoot);\n return found;\n}\n\nconst NUMBER = /\\d[\\d,]*(?:\\.\\d+)?/;\nconst NUMBER_ALL = /\\d[\\d,]*(?:\\.\\d+)?/g;\n\n/**\n * Count the first number in an element's words up from 0, once. Its own words are left alone and\n * the count is drawn over them from `data-count`, unless the element asks for its words to change\n * (`data-ik-count=\"text\"`), which only decoration hidden from a screen reader does.\n */\nfunction countUp(el: HTMLElement, delay: number, view: RevealWindow): Promise<void> {\n const inText = el.getAttribute('data-ik-count') === 'text';\n const node = inText ? findTextNode(el) : null;\n const words = (inText ? node?.data : el.textContent)?.replace(/\\s+/g, ' ').trim() ?? '';\n // The largest number in the words is the figure: \"161 ms\" counts 161, and \"H1 / 120\" counts the 120, not the level.\n const match = [...words.matchAll(NUMBER_ALL)].sort((a, b) => parseFloat(b[0].replace(/,/g, '')) - parseFloat(a[0].replace(/,/g, '')))[0];\n if (!match || (inText && !node)) return Promise.resolve();\n const raw = match[0];\n const target = parseFloat(raw.replace(/,/g, ''));\n const decimals = (raw.split('.')[1] ?? '').length;\n const grouped = raw.includes(',');\n const style = view.getComputedStyle(el);\n const duration = ms(style.getPropertyValue('--ik-count-duration'), ms(style.getPropertyValue('--impakt-motion-reveal-count-duration'), 900));\n const ease = bezierOf(style.getPropertyValue('--impakt-motion-reveal-arrive'));\n const original = node?.data ?? '';\n // Where the figure is in the text node's own words, which may have more space round them than \\`words\\`.\n const at = node ? original.lastIndexOf(raw, original.length) : 0;\n const write = (n: number) => {\n let figure = n.toFixed(decimals);\n if (grouped) figure = Number(figure).toLocaleString('en-GB', { minimumFractionDigits: decimals, maximumFractionDigits: decimals });\n if (node) node.data = original.slice(0, at) + figure + original.slice(at + raw.length);\n else el.setAttribute('data-count', words.slice(0, match.index) + figure + words.slice(match.index! + raw.length));\n };\n const finish = () => {\n if (node) node.data = original;\n else el.removeAttribute('data-count');\n };\n write(0);\n return new Promise((done) => {\n let start = 0;\n const step = (now: number) => {\n if (!start) start = now + delay;\n const t = (now - start) / duration;\n if (t >= 1 || !el.isConnected) {\n finish();\n done();\n return;\n }\n write(t <= 0 ? 0 : target * ease(t));\n view.requestAnimationFrame(step);\n };\n view.requestAnimationFrame(step);\n });\n}\n\nfunction findTextNode(el: Element): Text | null {\n const walker = el.ownerDocument.createTreeWalker(el, NodeFilter.SHOW_TEXT);\n for (let n = walker.nextNode(); n; n = walker.nextNode()) if (NUMBER.test((n as Text).data)) return n as Text;\n return null;\n}\n\n/** Mark an element as waiting at its first frame. A list of parts that drop in (`data-reveal=\"drop\"`) numbers its children for their stagger. */\nfunction arm(el: Element): void {\n el.setAttribute(REVEAL_STATE, 'armed');\n if (el.matches('[data-reveal~=\"drop\"]')) Array.from(el.children).forEach((child, i) => (child as HTMLElement).style.setProperty('--ik-reveal-i', String(i)));\n}\n\n/** Let an element go in the state it was drawn in. */\nfunction settle(el: Element): void {\n el.removeAttribute(REVEAL_STATE);\n (el as HTMLElement).style?.removeProperty('--ik-reveal-delay');\n}\n\n/** Every animation the element runs, on itself, its children and inside its shadow root. */\nfunction animationsOf(el: Element): Animation[] {\n const list = new Set<Animation>(el.getAnimations?.({ subtree: true }) ?? []);\n for (const a of el.shadowRoot?.getAnimations?.() ?? []) list.add(a);\n return [...list];\n}\n\n/** Run an element's animations now, `delay` ms from now, and let it go when they have finished. */\nfunction play(el: Element, delay: number, view: RevealWindow): Promise<void> {\n if (!el.hasAttribute(REVEAL_STATE)) arm(el);\n (el as HTMLElement).style.setProperty('--ik-reveal-delay', `${Math.round(delay)}ms`);\n el.setAttribute(REVEAL_STATE, 'play');\n const counts = countsIn(el).map((c) => {\n const i = Number(view.getComputedStyle(c).getPropertyValue('--i')) || 0;\n const stagger = ms(view.getComputedStyle(c).getPropertyValue('--impakt-motion-reveal-stagger'), 60);\n return countUp(c, delay + i * stagger, view);\n });\n return new Promise((done) => {\n // The animations exist once the style has been worked out, on the next frame.\n view.requestAnimationFrame(() => {\n const safety = new Promise<void>((resolve) => view.setTimeout(resolve, delay + 4000));\n const finished = Promise.all([...animationsOf(el).map((a) => a.finished.catch(() => undefined)), ...counts]);\n Promise.race([finished, safety]).then(() => {\n settle(el);\n done();\n });\n });\n });\n}\n\n/** The order elements that arrive together go in: as they are drawn, top to bottom, then left to right. */\nconst byPlace = (a: Box, b: Box) => (Math.abs(a.top - b.top) > 4 ? a.top - b.top : a.left - b.left);\n\n/**\n * Start the set on a page: arm what the reader has not reached, and draw each in as it is reached.\n * Safe to call more than once; the second call does nothing. Does nothing at all when the brand has\n * the set off, when reduced motion is asked for, or with no IntersectionObserver.\n */\nexport function startReveal(doc: Document = document): void {\n const view = doc.defaultView as RevealWindow | null;\n if (!view || view.__impaktReveal || !revealAllowed(doc)) return;\n const armed = new Set<Element>();\n const height = () => view.innerHeight || doc.documentElement.clientHeight;\n const stagger = () => ms(view.getComputedStyle(doc.documentElement).getPropertyValue('--impakt-motion-reveal-stagger'), 60);\n\n const release = (list: Element[]) => {\n const boxes = list.map((el) => ({ el, box: el.getBoundingClientRect() as Box }));\n boxes.sort((a, b) => byPlace(a.box, b.box));\n boxes.forEach(({ el }, i) => {\n armed.delete(el);\n middle.unobserve(el);\n whole.unobserve(el);\n // A long run that arrives at once, such as after a quick scroll, is capped at eight steps, so nothing waits long.\n void play(el, Math.min(i, 8) * stagger(), view);\n });\n };\n const onEntries = (entries: IntersectionObserverEntry[]) => release(entries.filter((e) => e.isIntersecting && armed.has(e.target)).map((e) => e.target));\n // The middle of the screen: an element is reached when its top crosses it.\n const middle = new view.IntersectionObserver(onEntries, { rootMargin: '0px 0px -50% 0px' });\n // Wholly on the screen: the elements at the foot of a page, which never reach the middle.\n const whole = new view.IntersectionObserver(onEntries, { threshold: 0.98 });\n\n // An element passed without being reached, such as by following a link further down, is let go as drawn.\n let frame = 0;\n const onScroll = () => {\n if (frame) return;\n frame = view.requestAnimationFrame(() => {\n frame = 0;\n for (const el of armed) {\n if (el.getBoundingClientRect().bottom < 0) {\n armed.delete(el);\n middle.unobserve(el);\n whole.unobserve(el);\n settle(el);\n }\n }\n });\n };\n\n // Painted already: what is on the screen has been seen, and stays as it is.\n const painted = (view.performance?.getEntriesByType?.('paint') ?? []).length > 0;\n for (const el of revealTargets(doc)) {\n if (el.hasAttribute(REVEAL_STATE)) continue;\n const box = el.getBoundingClientRect();\n if (box.width === 0 && box.height === 0) continue;\n if (box.bottom < 0) continue;\n if (box.top < height() && painted) continue;\n arm(el);\n armed.add(el);\n middle.observe(el);\n whole.observe(el);\n }\n\n const stop = () => {\n middle.disconnect();\n whole.disconnect();\n view.removeEventListener('scroll', onScroll);\n for (const el of armed) settle(el);\n armed.clear();\n };\n view.addEventListener('scroll', onScroll, { passive: true });\n // Asking for reduced motion part way down the page lets everything waiting go, as drawn.\n view.matchMedia?.('(prefers-reduced-motion: reduce)').addEventListener?.('change', (e) => {\n if (e.matches) stop();\n });\n view.__impaktReveal = { armed, stop };\n}\n\n/**\n * Draw the elements under `root` in again now, whether or not they are on the screen, and resolve\n * when they have finished: for a page that shows the set, such as the Storybook's Motion stories.\n * It does nothing, and resolves at once, when the brand has the set off or reduced motion is asked for.\n */\nexport function replayReveal(root: Element | ShadowRoot | Document = document): Promise<void> {\n const doc = root.nodeType === 9 ? (root as Document) : (root as Element).ownerDocument;\n const view = doc.defaultView as RevealWindow | null;\n if (!view || !revealAllowed(doc)) return Promise.resolve();\n const targets = revealTargets(root);\n targets.forEach(arm);\n return new Promise((done) =>\n view.requestAnimationFrame(() => {\n const boxes = targets.map((el) => ({ el, box: el.getBoundingClientRect() as Box })).sort((a, b) => byPlace(a.box, b.box));\n const step = ms(view.getComputedStyle(doc.documentElement).getPropertyValue('--impakt-motion-reveal-stagger'), 60);\n Promise.all(boxes.map(({ el }, i) => play(el, i * step, view))).then(() => done());\n }),\n );\n}\n"],"mappings":";AAkCO,IAAM,kBAAkB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,IAAI;AAGJ,IAAM,eAAe;AAarB,SAAS,WAAW,MAAgB,UAAkB;AAC3D,QAAM,OAAO,IAAI;AACjB,MAAI,CAAC,KAAM,QAAO;AAClB,SAAO,KAAK,iBAAiB,IAAI,eAAe,EAAE,iBAAiB,6BAA6B,EAAE,KAAK,KAAK;AAC9G;AAGO,SAAS,cAAc,MAAgB,UAAmB;AAC/D,QAAM,OAAO,IAAI;AACjB,MAAI,CAAC,QAAQ,OAAO,KAAK,yBAAyB,WAAY,QAAO;AACrE,MAAI,KAAK,aAAa,kCAAkC,EAAE,QAAS,QAAO;AAC1E,SAAO,WAAW,GAAG,MAAM;AAC7B;AAGO,SAAS,cAAc,MAAkD;AAC9E,QAAM,MAAiB,CAAC;AACxB,QAAM,OAAO,CAAC,SAA0C;AACtD,QAAI,KAAK,aAAa,KAAM,KAAiB,QAAQ,eAAe,EAAG,KAAI,KAAK,IAAe;AAC/F,eAAW,MAAM,MAAM,KAAK,KAAK,iBAAiB,GAAG,CAAC,GAAG;AACvD,UAAI,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C5F,QAAM,MAAM,KAAK,aAAa,IAAK,OAAqB,KAAiB;AACzE,QAAM,OAAO,IAAI;AACjB,MAAI,CAAC,QAAQ,CAAC,cAAc,GAAG,EAAG,QAAO,QAAQ,QAAQ;AACzD,QAAM,UAAU,cAAc,IAAI;AAClC,UAAQ,QAAQ,GAAG;AACnB,SAAO,IAAI;AAAA,IAAQ,CAAC,SAClB,KAAK,sBAAsB,MAAM;AAC/B,YAAM,QAAQ,QAAQ,IAAI,CAAC,QAAQ,EAAE,IAAI,KAAK,GAAG,sBAAsB,EAAS,EAAE,EAAE,KAAK,CAAC,GAAG,MAAM,QAAQ,EAAE,KAAK,EAAE,GAAG,CAAC;AACxH,YAAM,OAAO,GAAG,KAAK,iBAAiB,IAAI,eAAe,EAAE,iBAAiB,gCAAgC,GAAG,EAAE;AACjH,cAAQ,IAAI,MAAM,IAAI,CAAC,EAAE,GAAG,GAAG,MAAM,KAAK,IAAI,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,KAAK,MAAM,KAAK,CAAC;AAAA,IACnF,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
@@ -217,7 +217,8 @@ var ImpaktSection = class extends ImpaktElement {
|
|
|
217
217
|
:host([pattern]:not([pattern='none'])) .band { --impakt-pattern-line: color-mix(in srgb, currentColor 10%, transparent); }
|
|
218
218
|
:host(:is([pattern='grid'], [pattern='blueprint'])) .band { background-image: linear-gradient(to right, var(--impakt-pattern-line) 1px, transparent 1px), linear-gradient(to bottom, var(--impakt-pattern-line) 1px, transparent 1px); background-size: 7rem 7rem; }
|
|
219
219
|
:host([pattern='blueprint']) .band { background-size: 1.75rem 1.75rem; }
|
|
220
|
-
|
|
220
|
+
/* Column lines 90px apart from the band's edge to 1260px, fifteen lines in all, as the G2 column grid draws them (10:532, 34:485), with none past it. */
|
|
221
|
+
:host([pattern='columns']) .band { background-image: repeating-linear-gradient(to right, var(--impakt-pattern-line) 0 1px, transparent 1px 5.625rem); background-size: min(100%, 78.8125rem) 100%; background-repeat: no-repeat; }
|
|
221
222
|
:host([pattern='ruled']) .band { background-image: linear-gradient(to bottom, var(--impakt-pattern-line) 1px, transparent 1px); background-size: 100% 2.5rem; }
|
|
222
223
|
@media (forced-colors: active) { .band { background-image: none !important; } }
|
|
223
224
|
:host(:not([bleed]):not([tone='none'])) .band { padding-inline: ${space(6)}; }
|
|
@@ -242,4 +243,4 @@ export {
|
|
|
242
243
|
ImpaktPage,
|
|
243
244
|
ImpaktSection
|
|
244
245
|
};
|
|
245
|
-
//# sourceMappingURL=chunk-
|
|
246
|
+
//# sourceMappingURL=chunk-FJOZL25F.js.map
|