@dloizides/ui-motion 1.2.0 → 1.3.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/CHANGELOG.md +15 -0
- package/README.md +20 -0
- package/dist/{constants-BrJ7VJYu.d.mts → constants-DXSyrmvQ.d.mts} +9 -2
- package/dist/{constants-BrJ7VJYu.d.ts → constants-DXSyrmvQ.d.ts} +9 -2
- package/dist/hairline/native.d.mts +2 -2
- package/dist/hairline/native.d.ts +2 -2
- package/dist/hairline/native.js +62 -30
- package/dist/hairline/native.js.map +1 -1
- package/dist/hairline/native.mjs +63 -32
- package/dist/hairline/native.mjs.map +1 -1
- package/dist/hairline/web.d.mts +2 -2
- package/dist/hairline/web.d.ts +2 -2
- package/dist/hairline/web.js +16 -5
- package/dist/hairline/web.js.map +1 -1
- package/dist/hairline/web.mjs +16 -6
- package/dist/hairline/web.mjs.map +1 -1
- package/dist/logo/index.d.mts +44 -0
- package/dist/logo/index.d.ts +44 -0
- package/dist/logo/index.js +123 -0
- package/dist/logo/index.js.map +1 -0
- package/dist/logo/index.mjs +116 -0
- package/dist/logo/index.mjs.map +1 -0
- package/package.json +20 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.3.0
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- `@dloizides/ui-motion/logo`: framework-free logo player (LOGO-1 "A logo pipeline that makes beautiful, animatable marks"). `playLogo(svg, timeline, { reducedMotion?, iterations? })` plays `data-motion-layer` beats via the Web Animations API with design-token durations/easings; reduced motion applies the final frame at once. `bindMicro(svg, timeline, hover|focus|loading)` binds micro-animations. No React in its import graph.
|
|
7
|
+
|
|
8
|
+
### Changed
|
|
9
|
+
- `react` and `react-native` peers are optional, so a non-React app can install the package for `/logo`.
|
|
10
|
+
|
|
11
|
+
## 1.2.1
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
- Hairline bundle generator now really escapes `</` (was a no-op) and fails the build if `</` or `<!--` survive.
|
|
15
|
+
- `HairlineVarName` is a `const enum` (own file) instead of a string union.
|
|
16
|
+
- Native `HairlineFigure`: exposed as an image only when a non-empty `label` is passed; `intensity` / `label` changes call the mounted figure's `update()` instead of reloading the WebView.
|
|
17
|
+
|
|
3
18
|
## 1.2.0
|
|
4
19
|
|
|
5
20
|
### Added
|
package/README.md
CHANGED
|
@@ -126,3 +126,23 @@ Wraps `@lucasmarkes/hairline@0.3.0` (exact pin) so apps never import it directly
|
|
|
126
126
|
- Web (RN-web, `browser` condition): mounts the vanilla API on the View's DOM node; destroyed on unmount.
|
|
127
127
|
- Native (`react-native` condition): renders the upstream bundle inlined as HTML in `react-native-webview` (optional peer; install it to use this subpath on iOS/Android). One figure per screen.
|
|
128
128
|
- A figure is decoration: never put information a user needs in it. On touch-first screens prefer horizontal/area figures (`terrain`, `riffle`, `keyboard`, `router`, `rail`, `dish`, `turntable`, `plot`).
|
|
129
|
+
|
|
130
|
+
## Logo player (`@dloizides/ui-motion/logo`)
|
|
131
|
+
|
|
132
|
+
Framework-free (no React in its import graph; only `@dloizides/design-tokens`), for plain HTML pages and vanilla Vite apps. The mark is drawn elsewhere; name its parts with `data-motion-layer="<name>"`.
|
|
133
|
+
|
|
134
|
+
```ts
|
|
135
|
+
import { playLogo, bindMicro, type LogoTimeline } from '@dloizides/ui-motion/logo';
|
|
136
|
+
|
|
137
|
+
const intro: LogoTimeline = [
|
|
138
|
+
{ layer: 'sheet', keyframes: [{ opacity: 0, transform: 'translateY(6px)' }, { opacity: 1, transform: 'none' }], duration: 'slow', easing: 'decelerate' },
|
|
139
|
+
{ layer: 'fold', keyframes: [{ opacity: 0 }, { opacity: 1 }], duration: 'base', delay: 160 },
|
|
140
|
+
];
|
|
141
|
+
const { finished, cancel } = playLogo(svg, intro);
|
|
142
|
+
const unbind = bindMicro(svg, pulse, 'hover');
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
- `playLogo(svg, timeline, { reducedMotion?, iterations? }) => { finished, cancel }`: one WAAPI animation per matching layer, `fill: 'both'`; `finished` resolves on completion or cancel.
|
|
146
|
+
- Beat: `{ layer, keyframes, duration: 'instant'|'fast'|'base'|'slow'|ms, easing?: 'standard'|'decelerate'|'accelerate', delay?: ms }`, resolved from `DEFAULT_MOTION`.
|
|
147
|
+
- Reduced motion (option, else `prefers-reduced-motion`) or no WAAPI: the last keyframe is applied at once, no animation.
|
|
148
|
+
- `bindMicro(svg, timeline, 'hover'|'focus'|'loading', { reducedMotion? }) => unbind`: hover = pointerenter/leave, focus = focusin/out, loading = loops until unbind; nothing under reduced motion.
|
|
@@ -30,6 +30,14 @@ declare const enum HairlineFigureName {
|
|
|
30
30
|
Vault = "vault"
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
declare const enum HairlineVarName {
|
|
34
|
+
Plate = "--hairline-plate",
|
|
35
|
+
Hi = "--hairline-hi",
|
|
36
|
+
Edge = "--hairline-edge",
|
|
37
|
+
Mid = "--hairline-mid",
|
|
38
|
+
Lo = "--hairline-lo"
|
|
39
|
+
}
|
|
40
|
+
|
|
33
41
|
interface HairlineFigureProps {
|
|
34
42
|
/** Which upstream figure to draw. */
|
|
35
43
|
figure: HairlineFigureName;
|
|
@@ -41,7 +49,6 @@ interface HairlineFigureProps {
|
|
|
41
49
|
label?: string;
|
|
42
50
|
testID?: string;
|
|
43
51
|
}
|
|
44
|
-
type HairlineVarName = '--hairline-plate' | '--hairline-hi' | '--hairline-edge' | '--hairline-mid' | '--hairline-lo';
|
|
45
52
|
type HairlineVars = Record<HairlineVarName, string>;
|
|
46
53
|
|
|
47
54
|
/** Maps one theme mode's colour tokens onto the hairline palette vars (stroke width stays upstream). */
|
|
@@ -51,4 +58,4 @@ declare const HAIRLINE_TEST_ID = "motion-hairline-figure";
|
|
|
51
58
|
declare const HAIRLINE_ASPECT_RATIO: number;
|
|
52
59
|
declare const DEFAULT_HAIRLINE_INTENSITY = 0.5;
|
|
53
60
|
|
|
54
|
-
export { DEFAULT_HAIRLINE_INTENSITY as D, type HairlineFigureProps as H, HAIRLINE_ASPECT_RATIO as a, HAIRLINE_TEST_ID as b, HairlineFigureName as c,
|
|
61
|
+
export { DEFAULT_HAIRLINE_INTENSITY as D, type HairlineFigureProps as H, HAIRLINE_ASPECT_RATIO as a, HAIRLINE_TEST_ID as b, HairlineFigureName as c, HairlineVarName as d, type HairlineVars as e, hairlineVars as h };
|
|
@@ -30,6 +30,14 @@ declare const enum HairlineFigureName {
|
|
|
30
30
|
Vault = "vault"
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
declare const enum HairlineVarName {
|
|
34
|
+
Plate = "--hairline-plate",
|
|
35
|
+
Hi = "--hairline-hi",
|
|
36
|
+
Edge = "--hairline-edge",
|
|
37
|
+
Mid = "--hairline-mid",
|
|
38
|
+
Lo = "--hairline-lo"
|
|
39
|
+
}
|
|
40
|
+
|
|
33
41
|
interface HairlineFigureProps {
|
|
34
42
|
/** Which upstream figure to draw. */
|
|
35
43
|
figure: HairlineFigureName;
|
|
@@ -41,7 +49,6 @@ interface HairlineFigureProps {
|
|
|
41
49
|
label?: string;
|
|
42
50
|
testID?: string;
|
|
43
51
|
}
|
|
44
|
-
type HairlineVarName = '--hairline-plate' | '--hairline-hi' | '--hairline-edge' | '--hairline-mid' | '--hairline-lo';
|
|
45
52
|
type HairlineVars = Record<HairlineVarName, string>;
|
|
46
53
|
|
|
47
54
|
/** Maps one theme mode's colour tokens onto the hairline palette vars (stroke width stays upstream). */
|
|
@@ -51,4 +58,4 @@ declare const HAIRLINE_TEST_ID = "motion-hairline-figure";
|
|
|
51
58
|
declare const HAIRLINE_ASPECT_RATIO: number;
|
|
52
59
|
declare const DEFAULT_HAIRLINE_INTENSITY = 0.5;
|
|
53
60
|
|
|
54
|
-
export { DEFAULT_HAIRLINE_INTENSITY as D, type HairlineFigureProps as H, HAIRLINE_ASPECT_RATIO as a, HAIRLINE_TEST_ID as b, HairlineFigureName as c,
|
|
61
|
+
export { DEFAULT_HAIRLINE_INTENSITY as D, type HairlineFigureProps as H, HAIRLINE_ASPECT_RATIO as a, HAIRLINE_TEST_ID as b, HairlineFigureName as c, HairlineVarName as d, type HairlineVars as e, hairlineVars as h };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { H as HairlineFigureProps } from '../constants-
|
|
3
|
-
export { D as DEFAULT_HAIRLINE_INTENSITY, a as HAIRLINE_ASPECT_RATIO, b as HAIRLINE_TEST_ID, c as HairlineFigureName, d as HairlineVarName, e as HairlineVars, h as hairlineVars } from '../constants-
|
|
2
|
+
import { H as HairlineFigureProps } from '../constants-DXSyrmvQ.mjs';
|
|
3
|
+
export { D as DEFAULT_HAIRLINE_INTENSITY, a as HAIRLINE_ASPECT_RATIO, b as HAIRLINE_TEST_ID, c as HairlineFigureName, d as HairlineVarName, e as HairlineVars, h as hairlineVars } from '../constants-DXSyrmvQ.mjs';
|
|
4
4
|
import '@dloizides/design-tokens';
|
|
5
5
|
|
|
6
6
|
/** Renders a hairline figure in a WebView with the upstream bundle inlined (iOS/Android). */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { H as HairlineFigureProps } from '../constants-
|
|
3
|
-
export { D as DEFAULT_HAIRLINE_INTENSITY, a as HAIRLINE_ASPECT_RATIO, b as HAIRLINE_TEST_ID, c as HairlineFigureName, d as HairlineVarName, e as HairlineVars, h as hairlineVars } from '../constants-
|
|
2
|
+
import { H as HairlineFigureProps } from '../constants-DXSyrmvQ.js';
|
|
3
|
+
export { D as DEFAULT_HAIRLINE_INTENSITY, a as HAIRLINE_ASPECT_RATIO, b as HAIRLINE_TEST_ID, c as HairlineFigureName, d as HairlineVarName, e as HairlineVars, h as hairlineVars } from '../constants-DXSyrmvQ.js';
|
|
4
4
|
import '@dloizides/design-tokens';
|
|
5
5
|
|
|
6
6
|
/** Renders a hairline figure in a WebView with the upstream bundle inlined (iOS/Android). */
|