@dloizides/ui-motion 1.1.0 → 1.2.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 +5 -0
- package/README.md +8 -0
- package/dist/constants-BrJ7VJYu.d.mts +54 -0
- package/dist/constants-BrJ7VJYu.d.ts +54 -0
- package/dist/hairline/native.d.mts +9 -0
- package/dist/hairline/native.d.ts +9 -0
- package/dist/hairline/native.js +114 -0
- package/dist/hairline/native.js.map +1 -0
- package/dist/hairline/native.mjs +107 -0
- package/dist/hairline/native.mjs.map +1 -0
- package/dist/hairline/web.d.mts +9 -0
- package/dist/hairline/web.d.ts +9 -0
- package/dist/hairline/web.js +131 -0
- package/dist/hairline/web.js.map +1 -0
- package/dist/hairline/web.mjs +124 -0
- package/dist/hairline/web.mjs.map +1 -0
- package/package.json +37 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- `@dloizides/ui-motion/hairline`: `HairlineFigure` (web: vanilla `@lucasmarkes/hairline@0.3.0` on the host DOM node; native: inlined bundle in `react-native-webview`, optional peer), `HairlineFigureName`, `hairlineVars` token mapping (HAIRLINE-1 "Adopt hairline isometric line figures").
|
|
7
|
+
|
|
3
8
|
## 1.1.0
|
|
4
9
|
|
|
5
10
|
### Added
|
package/README.md
CHANGED
|
@@ -118,3 +118,11 @@ verified in the app E2E suites.
|
|
|
118
118
|
## License
|
|
119
119
|
|
|
120
120
|
MIT © dloizides
|
|
121
|
+
|
|
122
|
+
## HairlineFigure (`@dloizides/ui-motion/hairline`)
|
|
123
|
+
|
|
124
|
+
Wraps `@lucasmarkes/hairline@0.3.0` (exact pin) so apps never import it directly. Props: `figure` (`HairlineFigureName`), `colors` (a `ModeColors` from `@dloizides/design-tokens`, mapped onto `--hairline-*` by `hairlineVars`), `intensity` (0-1), `label` (translated), `testID`.
|
|
125
|
+
|
|
126
|
+
- Web (RN-web, `browser` condition): mounts the vanilla API on the View's DOM node; destroyed on unmount.
|
|
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
|
+
- 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`).
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ModeColors } from '@dloizides/design-tokens';
|
|
2
|
+
|
|
3
|
+
declare const enum HairlineFigureName {
|
|
4
|
+
Basket = "basket",
|
|
5
|
+
Branches = "branches",
|
|
6
|
+
Cabinet = "cabinet",
|
|
7
|
+
Dish = "dish",
|
|
8
|
+
Drawer = "drawer",
|
|
9
|
+
Elevator = "elevator",
|
|
10
|
+
Exploded = "exploded",
|
|
11
|
+
Keyboard = "keyboard",
|
|
12
|
+
Laptop = "laptop",
|
|
13
|
+
Lockers = "lockers",
|
|
14
|
+
Loupe = "loupe",
|
|
15
|
+
Padlock = "padlock",
|
|
16
|
+
Patch = "patch",
|
|
17
|
+
Phone = "phone",
|
|
18
|
+
Phosphor = "phosphor",
|
|
19
|
+
Plot = "plot",
|
|
20
|
+
Plug = "plug",
|
|
21
|
+
Query = "query",
|
|
22
|
+
Rail = "rail",
|
|
23
|
+
Riffle = "riffle",
|
|
24
|
+
Router = "router",
|
|
25
|
+
Sieve = "sieve",
|
|
26
|
+
Slow = "slow",
|
|
27
|
+
Terminal = "terminal",
|
|
28
|
+
Terrain = "terrain",
|
|
29
|
+
Turntable = "turntable",
|
|
30
|
+
Vault = "vault"
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface HairlineFigureProps {
|
|
34
|
+
/** Which upstream figure to draw. */
|
|
35
|
+
figure: HairlineFigureName;
|
|
36
|
+
/** Mode colours of the current theme; mapped onto the `--hairline-*` vars. */
|
|
37
|
+
colors: ModeColors;
|
|
38
|
+
/** Pointer response strength, 0 (subtle) to 1 (strong). */
|
|
39
|
+
intensity?: number;
|
|
40
|
+
/** Accessible name of the figure (pass a translated string). */
|
|
41
|
+
label?: string;
|
|
42
|
+
testID?: string;
|
|
43
|
+
}
|
|
44
|
+
type HairlineVarName = '--hairline-plate' | '--hairline-hi' | '--hairline-edge' | '--hairline-mid' | '--hairline-lo';
|
|
45
|
+
type HairlineVars = Record<HairlineVarName, string>;
|
|
46
|
+
|
|
47
|
+
/** Maps one theme mode's colour tokens onto the hairline palette vars (stroke width stays upstream). */
|
|
48
|
+
declare const hairlineVars: (colors: ModeColors) => HairlineVars;
|
|
49
|
+
|
|
50
|
+
declare const HAIRLINE_TEST_ID = "motion-hairline-figure";
|
|
51
|
+
declare const HAIRLINE_ASPECT_RATIO: number;
|
|
52
|
+
declare const DEFAULT_HAIRLINE_INTENSITY = 0.5;
|
|
53
|
+
|
|
54
|
+
export { DEFAULT_HAIRLINE_INTENSITY as D, type HairlineFigureProps as H, HAIRLINE_ASPECT_RATIO as a, HAIRLINE_TEST_ID as b, HairlineFigureName as c, type HairlineVarName as d, type HairlineVars as e, hairlineVars as h };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ModeColors } from '@dloizides/design-tokens';
|
|
2
|
+
|
|
3
|
+
declare const enum HairlineFigureName {
|
|
4
|
+
Basket = "basket",
|
|
5
|
+
Branches = "branches",
|
|
6
|
+
Cabinet = "cabinet",
|
|
7
|
+
Dish = "dish",
|
|
8
|
+
Drawer = "drawer",
|
|
9
|
+
Elevator = "elevator",
|
|
10
|
+
Exploded = "exploded",
|
|
11
|
+
Keyboard = "keyboard",
|
|
12
|
+
Laptop = "laptop",
|
|
13
|
+
Lockers = "lockers",
|
|
14
|
+
Loupe = "loupe",
|
|
15
|
+
Padlock = "padlock",
|
|
16
|
+
Patch = "patch",
|
|
17
|
+
Phone = "phone",
|
|
18
|
+
Phosphor = "phosphor",
|
|
19
|
+
Plot = "plot",
|
|
20
|
+
Plug = "plug",
|
|
21
|
+
Query = "query",
|
|
22
|
+
Rail = "rail",
|
|
23
|
+
Riffle = "riffle",
|
|
24
|
+
Router = "router",
|
|
25
|
+
Sieve = "sieve",
|
|
26
|
+
Slow = "slow",
|
|
27
|
+
Terminal = "terminal",
|
|
28
|
+
Terrain = "terrain",
|
|
29
|
+
Turntable = "turntable",
|
|
30
|
+
Vault = "vault"
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface HairlineFigureProps {
|
|
34
|
+
/** Which upstream figure to draw. */
|
|
35
|
+
figure: HairlineFigureName;
|
|
36
|
+
/** Mode colours of the current theme; mapped onto the `--hairline-*` vars. */
|
|
37
|
+
colors: ModeColors;
|
|
38
|
+
/** Pointer response strength, 0 (subtle) to 1 (strong). */
|
|
39
|
+
intensity?: number;
|
|
40
|
+
/** Accessible name of the figure (pass a translated string). */
|
|
41
|
+
label?: string;
|
|
42
|
+
testID?: string;
|
|
43
|
+
}
|
|
44
|
+
type HairlineVarName = '--hairline-plate' | '--hairline-hi' | '--hairline-edge' | '--hairline-mid' | '--hairline-lo';
|
|
45
|
+
type HairlineVars = Record<HairlineVarName, string>;
|
|
46
|
+
|
|
47
|
+
/** Maps one theme mode's colour tokens onto the hairline palette vars (stroke width stays upstream). */
|
|
48
|
+
declare const hairlineVars: (colors: ModeColors) => HairlineVars;
|
|
49
|
+
|
|
50
|
+
declare const HAIRLINE_TEST_ID = "motion-hairline-figure";
|
|
51
|
+
declare const HAIRLINE_ASPECT_RATIO: number;
|
|
52
|
+
declare const DEFAULT_HAIRLINE_INTENSITY = 0.5;
|
|
53
|
+
|
|
54
|
+
export { DEFAULT_HAIRLINE_INTENSITY as D, type HairlineFigureProps as H, HAIRLINE_ASPECT_RATIO as a, HAIRLINE_TEST_ID as b, HairlineFigureName as c, type HairlineVarName as d, type HairlineVars as e, hairlineVars as h };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { H as HairlineFigureProps } from '../constants-BrJ7VJYu.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-BrJ7VJYu.mjs';
|
|
4
|
+
import '@dloizides/design-tokens';
|
|
5
|
+
|
|
6
|
+
/** Renders a hairline figure in a WebView with the upstream bundle inlined (iOS/Android). */
|
|
7
|
+
declare const HairlineFigure: ({ figure, colors, intensity, label, testID, }: HairlineFigureProps) => React.ReactElement;
|
|
8
|
+
|
|
9
|
+
export { HairlineFigure, HairlineFigureProps };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { H as HairlineFigureProps } from '../constants-BrJ7VJYu.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-BrJ7VJYu.js';
|
|
4
|
+
import '@dloizides/design-tokens';
|
|
5
|
+
|
|
6
|
+
/** Renders a hairline figure in a WebView with the upstream bundle inlined (iOS/Android). */
|
|
7
|
+
declare const HairlineFigure: ({ figure, colors, intensity, label, testID, }: HairlineFigureProps) => React.ReactElement;
|
|
8
|
+
|
|
9
|
+
export { HairlineFigure, HairlineFigureProps };
|