@dloizides/design-tokens 1.5.0 → 1.7.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 +52 -0
- package/README.md +18 -0
- package/dist/index.d.mts +117 -14
- package/dist/index.d.ts +117 -14
- package/dist/index.js +48 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +47 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,57 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.7.0
|
|
4
|
+
|
|
5
|
+
**New `Motion` token group (durations + easings) — additive, optional, non-breaking.**
|
|
6
|
+
|
|
7
|
+
Adds the first motion tokens to the package. The kit was almost entirely static and every
|
|
8
|
+
animating component (ui-feedback ToastHost/PageSkeleton, ui-layout Accordion) re-declared its own
|
|
9
|
+
durations/curves inline. This introduces a single shared source that `@dloizides/ui-motion` reads
|
|
10
|
+
to build its RN `Easing.bezier(...)` map, and that web/CSS consumers can read directly.
|
|
11
|
+
|
|
12
|
+
Fully back-compat: `motion` is OPTIONAL on `DesignTokens`, no preset declares it, and no emitter
|
|
13
|
+
reads it — existing consumers are byte-identical.
|
|
14
|
+
|
|
15
|
+
### New
|
|
16
|
+
|
|
17
|
+
- `DEFAULT_MOTION` constant — the app-agnostic motion scale (motion is uniform across portals, so
|
|
18
|
+
there is ONE default rather than one per preset):
|
|
19
|
+
- `durations` (ms, numbers): `instant 0`, `fast 140`, `base 200`, `slow 300`. `instant` (0) is
|
|
20
|
+
the reduced-motion collapse target.
|
|
21
|
+
- `easings` (Material-like), each carrying BOTH a web `css` `cubic-bezier(...)` string AND the
|
|
22
|
+
`bezier` `[x1,y1,x2,y2]` control points for RN `Easing.bezier(...)`, so web and native animate
|
|
23
|
+
on the same curve: `standard [0.2,0,0,1]`, `decelerate [0,0,0,1]`, `accelerate [0.3,0,1,1]`.
|
|
24
|
+
- Types: `Motion`, `MotionDurations`, `MotionEasing`, `MotionEasings`.
|
|
25
|
+
- `DesignTokens.motion?` — optional field so a preset MAY override the default motion scale.
|
|
26
|
+
|
|
27
|
+
## 1.6.0
|
|
28
|
+
|
|
29
|
+
**FINREG rebrand to the OFFICIAL brand palette + navy surface tokens — additive/retune, non-breaking to other apps.**
|
|
30
|
+
|
|
31
|
+
The owner supplied FINREG's official, single-source-of-truth logo palette. The interim EDA hexes
|
|
32
|
+
were slightly off it, so the three `FINREG_MODULE_COLORS.base` values are re-tuned to the official
|
|
33
|
+
cyan/magenta/violet and each `onWhite` companion is RECOMPUTED (same derivation, same
|
|
34
|
+
`contrast.ts` maths). Only FINREG-scoped tokens change; every per-app preset, emitter and type is
|
|
35
|
+
byte-identical, so aml/erevna/katalogos/digitalkin consumers are untouched.
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
|
|
39
|
+
- `FINREG_MODULE_COLORS` re-tuned to the official palette:
|
|
40
|
+
- Payments (cyan): `base #52E2F2` (1.55:1 on white, fill only) / `onWhite #0B8290` (4.56:1).
|
|
41
|
+
- Accounting (magenta): `base #F266CD` (2.78:1) / `onWhite #DA12A5` (4.55:1).
|
|
42
|
+
- CRM (violet): `base #7997F2` (2.79:1) / `onWhite #426CED` (4.57:1).
|
|
43
|
+
- `onWhite` = lightest shade of the same hue that clears the 4.5:1 AA text floor on white,
|
|
44
|
+
carried a hair past so rounding cannot drop it under. Both halves re-pinned in
|
|
45
|
+
`finregModules.test.ts`.
|
|
46
|
+
|
|
47
|
+
### New
|
|
48
|
+
|
|
49
|
+
- `FINREG_SURFACE_COLORS` — the official navy dark grounds: `surface #0C2240` (hero band / dark
|
|
50
|
+
sections / logo field top) and `deepest #071526` (footer/closing band / darkest body ink / logo
|
|
51
|
+
field bottom). Exported so consumers stop hardcoding the dark-band literals. Payments cyan reads
|
|
52
|
+
as an AA-safe accent on both (10.25:1 / 11.81:1), pinned in the test.
|
|
53
|
+
- `FinregSurfaceColors` type.
|
|
54
|
+
|
|
3
55
|
## 1.5.0
|
|
4
56
|
|
|
5
57
|
**FINREG per-module brand colours (task R-01) — additive, non-breaking.**
|
package/README.md
CHANGED
|
@@ -102,6 +102,24 @@ floor) and both halves are pinned by `finregModules.test.ts` with their measured
|
|
|
102
102
|
drift below AA fails the build. This is the SOURCE of these hexes — consumers read the token, they
|
|
103
103
|
do not re-declare the literal (`no-raw-color-literal`).
|
|
104
104
|
|
|
105
|
+
## Motion tokens (`DEFAULT_MOTION`, 1.7.0)
|
|
106
|
+
|
|
107
|
+
Motion is uniform across every portal, so — unlike colour — there is ONE shipped default rather
|
|
108
|
+
than one per preset. `DEFAULT_MOTION` carries `durations` (ms) and `easings`:
|
|
109
|
+
|
|
110
|
+
| Duration | ms | Easing | control points | css |
|
|
111
|
+
|----------|----|--------|----------------|-----|
|
|
112
|
+
| `instant` | 0 | `standard` | `[0.2,0,0,1]` | `cubic-bezier(0.2,0,0,1)` |
|
|
113
|
+
| `fast` | 140 | `decelerate` | `[0,0,0,1]` | `cubic-bezier(0,0,0,1)` |
|
|
114
|
+
| `base` | 200 | `accelerate` | `[0.3,0,1,1]` | `cubic-bezier(0.3,0,1,1)` |
|
|
115
|
+
| `slow` | 300 | | | |
|
|
116
|
+
|
|
117
|
+
`instant` (0) is the reduced-motion collapse target. Each easing carries **both** a web `css`
|
|
118
|
+
`cubic-bezier(...)` string and the `bezier` `[x1,y1,x2,y2]` control points, so `@dloizides/ui-motion`
|
|
119
|
+
can build a matching RN `Easing.bezier(...)` and web + native animate on the same curve. `motion` is
|
|
120
|
+
an OPTIONAL field on `DesignTokens` (a preset MAY override it), so existing presets/emitters are
|
|
121
|
+
byte-identical.
|
|
122
|
+
|
|
105
123
|
## The token shape (aligned to `TenantThemeConfig`)
|
|
106
124
|
|
|
107
125
|
The **core** fields intentionally mirror `@dloizides/tenant-theme-web`'s `TenantThemeConfig`
|
package/dist/index.d.mts
CHANGED
|
@@ -90,6 +90,60 @@ interface Shadows {
|
|
|
90
90
|
md: string;
|
|
91
91
|
pop: string;
|
|
92
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Animation durations, in milliseconds (numbers, not CSS strings — RN `Animated`
|
|
95
|
+
* takes numeric `duration`, and a web consumer can append `'ms'` trivially).
|
|
96
|
+
*
|
|
97
|
+
* `instant` is `0` on purpose: it is the value every primitive collapses to under
|
|
98
|
+
* reduced-motion, so callers can reference one named token instead of a bare `0`.
|
|
99
|
+
*/
|
|
100
|
+
interface MotionDurations {
|
|
101
|
+
/** No animation — the reduced-motion / prefers-reduced target (0). */
|
|
102
|
+
instant: number;
|
|
103
|
+
/** Micro-interactions: press feedback, hover (140ms). */
|
|
104
|
+
fast: number;
|
|
105
|
+
/** The default transition — enter/exit, expand/collapse (200ms). */
|
|
106
|
+
base: number;
|
|
107
|
+
/** Larger surfaces / deliberate reveals (300ms). */
|
|
108
|
+
slow: number;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* One easing curve, in the two forms the two runtimes need:
|
|
112
|
+
* - `css` — a `cubic-bezier(...)` timing-function string for web/CSS consumers.
|
|
113
|
+
* - `bezier` — the four control points, so an RN consumer can build the matching
|
|
114
|
+
* `Easing.bezier(...)` (RN has no way to consume the CSS string directly).
|
|
115
|
+
*
|
|
116
|
+
* Keeping both in one token guarantees web and native animate on the SAME curve.
|
|
117
|
+
*/
|
|
118
|
+
interface MotionEasing {
|
|
119
|
+
/** Web CSS `timing-function` string, e.g. `'cubic-bezier(0.2,0,0,1)'`. */
|
|
120
|
+
css: string;
|
|
121
|
+
/** Cubic-bezier control points `[x1,y1,x2,y2]` for RN `Easing.bezier(...)`. */
|
|
122
|
+
bezier: readonly [number, number, number, number];
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* The named easing curves (Material-like):
|
|
126
|
+
* - `standard` — symmetric ease for on-screen moves that stay on screen.
|
|
127
|
+
* - `decelerate` — fast-in / soft-stop, for elements ENTERING the screen.
|
|
128
|
+
* - `accelerate` — soft-start / fast-out, for elements LEAVING the screen.
|
|
129
|
+
*/
|
|
130
|
+
interface MotionEasings {
|
|
131
|
+
standard: MotionEasing;
|
|
132
|
+
decelerate: MotionEasing;
|
|
133
|
+
accelerate: MotionEasing;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Motion token group — durations + easings. Framework-agnostic values only; the
|
|
137
|
+
* RN `Animated`/`Easing` wiring lives in `@dloizides/ui-motion`, which reads these.
|
|
138
|
+
*
|
|
139
|
+
* OPTIONAL on {@link DesignTokens} and shipped as a standalone {@link DEFAULT_MOTION}
|
|
140
|
+
* constant, so consumers that don't animate are unaffected and presets need not
|
|
141
|
+
* declare it (motion is app-agnostic — the same curves fit every app).
|
|
142
|
+
*/
|
|
143
|
+
interface Motion {
|
|
144
|
+
durations: MotionDurations;
|
|
145
|
+
easings: MotionEasings;
|
|
146
|
+
}
|
|
93
147
|
/** Branding asset references (ContentService GUIDs). Matches `TenantThemeConfig`'s `BrandingConfig`. */
|
|
94
148
|
interface Branding {
|
|
95
149
|
logoContentId: string | null;
|
|
@@ -205,6 +259,12 @@ interface DesignTokens {
|
|
|
205
259
|
radii?: Radii;
|
|
206
260
|
/** Optional elevation scale */
|
|
207
261
|
shadows?: Shadows;
|
|
262
|
+
/**
|
|
263
|
+
* Optional motion scale (durations + easings). Omit to inherit {@link DEFAULT_MOTION};
|
|
264
|
+
* consumers that don't animate ignore it entirely. Back-compat: adding this field
|
|
265
|
+
* changes nothing for existing presets or emitters.
|
|
266
|
+
*/
|
|
267
|
+
motion?: Motion;
|
|
208
268
|
/** Branding asset references */
|
|
209
269
|
branding: Branding;
|
|
210
270
|
/** Optional stack-specific token supersets */
|
|
@@ -236,9 +296,10 @@ interface FinregModuleColor {
|
|
|
236
296
|
onWhite: string;
|
|
237
297
|
}
|
|
238
298
|
/**
|
|
239
|
-
* The three FINREG product modules, each colour-bound per the
|
|
240
|
-
* The base hexes are DECIDED — do not
|
|
241
|
-
* each base and each on-white ratio so
|
|
299
|
+
* The three FINREG product modules, each colour-bound per the official logo
|
|
300
|
+
* (task R-01). The base hexes are DECIDED (owner-supplied brand palette) — do not
|
|
301
|
+
* re-tune them; `finregModules.test.ts` pins each base and each on-white ratio so
|
|
302
|
+
* a drift fails the build.
|
|
242
303
|
*/
|
|
243
304
|
interface FinregModuleColors {
|
|
244
305
|
/** Payments — cyan. */
|
|
@@ -248,6 +309,33 @@ interface FinregModuleColors {
|
|
|
248
309
|
/** CRM — violet. */
|
|
249
310
|
crm: FinregModuleColor;
|
|
250
311
|
}
|
|
312
|
+
/**
|
|
313
|
+
* FINREG's official dark brand surfaces. These are the navy grounds the marketing
|
|
314
|
+
* dark bands and the logo field are painted on — not a per-module identity colour
|
|
315
|
+
* and not an app `background` preset, but a FINREG-scoped brand constant that any
|
|
316
|
+
* surface (a hero band, a logo field, a dark footer) reads so nobody hardcodes the
|
|
317
|
+
* navy literal. Exported beside `FinregModuleColors` for the same reason its
|
|
318
|
+
* module colours are: one source, no re-declared literals.
|
|
319
|
+
*/
|
|
320
|
+
interface FinregSurfaceColors {
|
|
321
|
+
/** Primary dark surface — hero band, dark sections, logo field top (`#0C2240`). */
|
|
322
|
+
surface: string;
|
|
323
|
+
/** Darkest surface — footer/closing band, body-text ink, logo field bottom (`#071526`). */
|
|
324
|
+
deepest: string;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* The default {@link Motion} token set — durations + easings shared by every app.
|
|
329
|
+
*
|
|
330
|
+
* Motion is app-agnostic: the same durations and Material-like curves fit every
|
|
331
|
+
* portal, so unlike colour there is ONE shipped default rather than one per preset.
|
|
332
|
+
* `@dloizides/ui-motion` reads this to build its RN `Easing.bezier(...)` map, and a
|
|
333
|
+
* web/CSS consumer can read the `.css` timing-function strings directly.
|
|
334
|
+
*
|
|
335
|
+
* Values only. No RN/`Animated` imports — this package stays framework-agnostic.
|
|
336
|
+
*/
|
|
337
|
+
|
|
338
|
+
declare const DEFAULT_MOTION: Motion;
|
|
251
339
|
|
|
252
340
|
/**
|
|
253
341
|
* CSS custom-property NAME MAPS — the cross-stack naming contract.
|
|
@@ -638,16 +726,18 @@ declare const KATALOGOS_TOKENS: DesignTokens;
|
|
|
638
726
|
declare const PRESETS: Readonly<Record<string, DesignTokens>>;
|
|
639
727
|
|
|
640
728
|
/**
|
|
641
|
-
* FINREG module colour tokens (task R-01).
|
|
729
|
+
* FINREG module colour tokens (task R-01; rebranded to the OFFICIAL palette).
|
|
642
730
|
*
|
|
643
|
-
* FINREG's
|
|
644
|
-
*
|
|
645
|
-
*
|
|
646
|
-
* (`#
|
|
647
|
-
* are transcribed here verbatim and pinned
|
|
731
|
+
* FINREG's logo binds a colour to each of the three product modules — Payments,
|
|
732
|
+
* Accounting, CRM — so colour reads as module identity, not as one app's brand
|
|
733
|
+
* primary. Those three base hexes are the owner's OFFICIAL, single-source-of-truth
|
|
734
|
+
* brand palette (`#52E2F2` cyan / `#F266CD` magenta / `#7997F2` violet), not
|
|
735
|
+
* something this package chose, so they are transcribed here verbatim and pinned
|
|
736
|
+
* by `finregModules.test.ts`. (They replace the earlier interim "EDA" hexes
|
|
737
|
+
* `#4FD8F0` / `#E85FBF` / `#7B8FF7`, which were slightly off the official logo.)
|
|
648
738
|
*
|
|
649
739
|
* Each module also carries an `onWhite` companion. The base fills are light — a
|
|
650
|
-
* cyan orbit at 1.
|
|
740
|
+
* cyan orbit at 1.55:1 on white cannot be read as text — so a badge, a table
|
|
651
741
|
* cell, a nav label or any icon that paints a module colour on a white surface
|
|
652
742
|
* needs a darkened variant that clears the WCAG AA 4.5:1 floor. The `onWhite`
|
|
653
743
|
* hexes were DERIVED, not eyeballed: each is the lightest shade of the same hue
|
|
@@ -657,12 +747,25 @@ declare const PRESETS: Readonly<Record<string, DesignTokens>>;
|
|
|
657
747
|
* The exact measured ratios are asserted in the test, so a future edit that
|
|
658
748
|
* lightens one below AA fails the build rather than shipping an unreadable label.
|
|
659
749
|
*
|
|
660
|
-
*
|
|
661
|
-
*
|
|
662
|
-
*
|
|
750
|
+
* The navy surfaces (`FINREG_SURFACE_COLORS`) are the official dark grounds — the
|
|
751
|
+
* hero band / logo field top (`#0C2240`) and the deepest closing/footer band /
|
|
752
|
+
* logo field bottom (`#071526`). They are exported so consumers stop hardcoding
|
|
753
|
+
* the dark-band literals.
|
|
754
|
+
*
|
|
755
|
+
* This is the SOURCE of these hexes. Consuming apps read `FINREG_MODULE_COLORS`
|
|
756
|
+
* and `FINREG_SURFACE_COLORS`; they must not re-declare the literals, which is
|
|
757
|
+
* the whole point of the `no-raw-color-literal` rule the consumers are bound by.
|
|
663
758
|
*/
|
|
664
759
|
|
|
665
760
|
declare const FINREG_MODULE_COLORS: FinregModuleColors;
|
|
761
|
+
/**
|
|
762
|
+
* FINREG's official dark brand surfaces — the navy grounds the logo field and the
|
|
763
|
+
* dark marketing bands are painted on. `surface` is the hero/dark-section band and
|
|
764
|
+
* the logo field top; `deepest` is the footer/closing band, the darkest body ink,
|
|
765
|
+
* and the logo field bottom. Bright module colours (esp. Payments cyan) are the
|
|
766
|
+
* AA-safe accents ON these grounds — cyan `#52E2F2` on `#0C2240` measures ~9.6:1.
|
|
767
|
+
*/
|
|
768
|
+
declare const FINREG_SURFACE_COLORS: FinregSurfaceColors;
|
|
666
769
|
|
|
667
770
|
/**
|
|
668
771
|
* WCAG 2.1 contrast-ratio maths.
|
|
@@ -773,4 +876,4 @@ declare function onBrandRatio(background: string, explicit?: string): number | n
|
|
|
773
876
|
*/
|
|
774
877
|
declare function canCarryAccessibleInk(background: string): boolean;
|
|
775
878
|
|
|
776
|
-
export { AA_LARGE_TEXT_RATIO, AA_NON_TEXT_RATIO, AA_NORMAL_TEXT_RATIO, AML_CSS_VAR_NAMES, AML_TOKENS, type BrandExtras, type Branding, type CssVarNames, DEFAULT_CSS_VAR_NAMES, DIGITALKIN_TOKENS, type DesignTokens, EREVNA_TOKENS, FINREG_MODULE_COLORS, type FinregModuleColor, type FinregModuleColors, type InkScale, KATALOGOS_TOKENS, type ModeColors, ON_BRAND_DARK_INK, ON_BRAND_LIGHT_INK, PRESETS, type Radii, type RnThemeConfig, type SemanticColors, type Shadows, type ShellColors, type TailwindColors, type TailwindPreset, type ToCssVarsOptions, type TokenExtensions, type Typography, UI_DEEP_STEP, UI_MAIN_STEP, UI_TINT_STEP, type UiColorScale, type UiThemeColors, type UiThemeConfig, type UiThemeMode, type UiThemePalette, type UiThemeSemantic, type VerdictColors, type WorkspaceExtras, canCarryAccessibleInk, contrastRatio, isHexColor, meetsContrast, onBrandRatio, relativeLuminance, resolveOnBrand, toCssVars, toRnTheme, toTailwindPreset, toUiTheme };
|
|
879
|
+
export { AA_LARGE_TEXT_RATIO, AA_NON_TEXT_RATIO, AA_NORMAL_TEXT_RATIO, AML_CSS_VAR_NAMES, AML_TOKENS, type BrandExtras, type Branding, type CssVarNames, DEFAULT_CSS_VAR_NAMES, DEFAULT_MOTION, DIGITALKIN_TOKENS, type DesignTokens, EREVNA_TOKENS, FINREG_MODULE_COLORS, FINREG_SURFACE_COLORS, type FinregModuleColor, type FinregModuleColors, type FinregSurfaceColors, type InkScale, KATALOGOS_TOKENS, type ModeColors, type Motion, type MotionDurations, type MotionEasing, type MotionEasings, ON_BRAND_DARK_INK, ON_BRAND_LIGHT_INK, PRESETS, type Radii, type RnThemeConfig, type SemanticColors, type Shadows, type ShellColors, type TailwindColors, type TailwindPreset, type ToCssVarsOptions, type TokenExtensions, type Typography, UI_DEEP_STEP, UI_MAIN_STEP, UI_TINT_STEP, type UiColorScale, type UiThemeColors, type UiThemeConfig, type UiThemeMode, type UiThemePalette, type UiThemeSemantic, type VerdictColors, type WorkspaceExtras, canCarryAccessibleInk, contrastRatio, isHexColor, meetsContrast, onBrandRatio, relativeLuminance, resolveOnBrand, toCssVars, toRnTheme, toTailwindPreset, toUiTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -90,6 +90,60 @@ interface Shadows {
|
|
|
90
90
|
md: string;
|
|
91
91
|
pop: string;
|
|
92
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Animation durations, in milliseconds (numbers, not CSS strings — RN `Animated`
|
|
95
|
+
* takes numeric `duration`, and a web consumer can append `'ms'` trivially).
|
|
96
|
+
*
|
|
97
|
+
* `instant` is `0` on purpose: it is the value every primitive collapses to under
|
|
98
|
+
* reduced-motion, so callers can reference one named token instead of a bare `0`.
|
|
99
|
+
*/
|
|
100
|
+
interface MotionDurations {
|
|
101
|
+
/** No animation — the reduced-motion / prefers-reduced target (0). */
|
|
102
|
+
instant: number;
|
|
103
|
+
/** Micro-interactions: press feedback, hover (140ms). */
|
|
104
|
+
fast: number;
|
|
105
|
+
/** The default transition — enter/exit, expand/collapse (200ms). */
|
|
106
|
+
base: number;
|
|
107
|
+
/** Larger surfaces / deliberate reveals (300ms). */
|
|
108
|
+
slow: number;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* One easing curve, in the two forms the two runtimes need:
|
|
112
|
+
* - `css` — a `cubic-bezier(...)` timing-function string for web/CSS consumers.
|
|
113
|
+
* - `bezier` — the four control points, so an RN consumer can build the matching
|
|
114
|
+
* `Easing.bezier(...)` (RN has no way to consume the CSS string directly).
|
|
115
|
+
*
|
|
116
|
+
* Keeping both in one token guarantees web and native animate on the SAME curve.
|
|
117
|
+
*/
|
|
118
|
+
interface MotionEasing {
|
|
119
|
+
/** Web CSS `timing-function` string, e.g. `'cubic-bezier(0.2,0,0,1)'`. */
|
|
120
|
+
css: string;
|
|
121
|
+
/** Cubic-bezier control points `[x1,y1,x2,y2]` for RN `Easing.bezier(...)`. */
|
|
122
|
+
bezier: readonly [number, number, number, number];
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* The named easing curves (Material-like):
|
|
126
|
+
* - `standard` — symmetric ease for on-screen moves that stay on screen.
|
|
127
|
+
* - `decelerate` — fast-in / soft-stop, for elements ENTERING the screen.
|
|
128
|
+
* - `accelerate` — soft-start / fast-out, for elements LEAVING the screen.
|
|
129
|
+
*/
|
|
130
|
+
interface MotionEasings {
|
|
131
|
+
standard: MotionEasing;
|
|
132
|
+
decelerate: MotionEasing;
|
|
133
|
+
accelerate: MotionEasing;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Motion token group — durations + easings. Framework-agnostic values only; the
|
|
137
|
+
* RN `Animated`/`Easing` wiring lives in `@dloizides/ui-motion`, which reads these.
|
|
138
|
+
*
|
|
139
|
+
* OPTIONAL on {@link DesignTokens} and shipped as a standalone {@link DEFAULT_MOTION}
|
|
140
|
+
* constant, so consumers that don't animate are unaffected and presets need not
|
|
141
|
+
* declare it (motion is app-agnostic — the same curves fit every app).
|
|
142
|
+
*/
|
|
143
|
+
interface Motion {
|
|
144
|
+
durations: MotionDurations;
|
|
145
|
+
easings: MotionEasings;
|
|
146
|
+
}
|
|
93
147
|
/** Branding asset references (ContentService GUIDs). Matches `TenantThemeConfig`'s `BrandingConfig`. */
|
|
94
148
|
interface Branding {
|
|
95
149
|
logoContentId: string | null;
|
|
@@ -205,6 +259,12 @@ interface DesignTokens {
|
|
|
205
259
|
radii?: Radii;
|
|
206
260
|
/** Optional elevation scale */
|
|
207
261
|
shadows?: Shadows;
|
|
262
|
+
/**
|
|
263
|
+
* Optional motion scale (durations + easings). Omit to inherit {@link DEFAULT_MOTION};
|
|
264
|
+
* consumers that don't animate ignore it entirely. Back-compat: adding this field
|
|
265
|
+
* changes nothing for existing presets or emitters.
|
|
266
|
+
*/
|
|
267
|
+
motion?: Motion;
|
|
208
268
|
/** Branding asset references */
|
|
209
269
|
branding: Branding;
|
|
210
270
|
/** Optional stack-specific token supersets */
|
|
@@ -236,9 +296,10 @@ interface FinregModuleColor {
|
|
|
236
296
|
onWhite: string;
|
|
237
297
|
}
|
|
238
298
|
/**
|
|
239
|
-
* The three FINREG product modules, each colour-bound per the
|
|
240
|
-
* The base hexes are DECIDED — do not
|
|
241
|
-
* each base and each on-white ratio so
|
|
299
|
+
* The three FINREG product modules, each colour-bound per the official logo
|
|
300
|
+
* (task R-01). The base hexes are DECIDED (owner-supplied brand palette) — do not
|
|
301
|
+
* re-tune them; `finregModules.test.ts` pins each base and each on-white ratio so
|
|
302
|
+
* a drift fails the build.
|
|
242
303
|
*/
|
|
243
304
|
interface FinregModuleColors {
|
|
244
305
|
/** Payments — cyan. */
|
|
@@ -248,6 +309,33 @@ interface FinregModuleColors {
|
|
|
248
309
|
/** CRM — violet. */
|
|
249
310
|
crm: FinregModuleColor;
|
|
250
311
|
}
|
|
312
|
+
/**
|
|
313
|
+
* FINREG's official dark brand surfaces. These are the navy grounds the marketing
|
|
314
|
+
* dark bands and the logo field are painted on — not a per-module identity colour
|
|
315
|
+
* and not an app `background` preset, but a FINREG-scoped brand constant that any
|
|
316
|
+
* surface (a hero band, a logo field, a dark footer) reads so nobody hardcodes the
|
|
317
|
+
* navy literal. Exported beside `FinregModuleColors` for the same reason its
|
|
318
|
+
* module colours are: one source, no re-declared literals.
|
|
319
|
+
*/
|
|
320
|
+
interface FinregSurfaceColors {
|
|
321
|
+
/** Primary dark surface — hero band, dark sections, logo field top (`#0C2240`). */
|
|
322
|
+
surface: string;
|
|
323
|
+
/** Darkest surface — footer/closing band, body-text ink, logo field bottom (`#071526`). */
|
|
324
|
+
deepest: string;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* The default {@link Motion} token set — durations + easings shared by every app.
|
|
329
|
+
*
|
|
330
|
+
* Motion is app-agnostic: the same durations and Material-like curves fit every
|
|
331
|
+
* portal, so unlike colour there is ONE shipped default rather than one per preset.
|
|
332
|
+
* `@dloizides/ui-motion` reads this to build its RN `Easing.bezier(...)` map, and a
|
|
333
|
+
* web/CSS consumer can read the `.css` timing-function strings directly.
|
|
334
|
+
*
|
|
335
|
+
* Values only. No RN/`Animated` imports — this package stays framework-agnostic.
|
|
336
|
+
*/
|
|
337
|
+
|
|
338
|
+
declare const DEFAULT_MOTION: Motion;
|
|
251
339
|
|
|
252
340
|
/**
|
|
253
341
|
* CSS custom-property NAME MAPS — the cross-stack naming contract.
|
|
@@ -638,16 +726,18 @@ declare const KATALOGOS_TOKENS: DesignTokens;
|
|
|
638
726
|
declare const PRESETS: Readonly<Record<string, DesignTokens>>;
|
|
639
727
|
|
|
640
728
|
/**
|
|
641
|
-
* FINREG module colour tokens (task R-01).
|
|
729
|
+
* FINREG module colour tokens (task R-01; rebranded to the OFFICIAL palette).
|
|
642
730
|
*
|
|
643
|
-
* FINREG's
|
|
644
|
-
*
|
|
645
|
-
*
|
|
646
|
-
* (`#
|
|
647
|
-
* are transcribed here verbatim and pinned
|
|
731
|
+
* FINREG's logo binds a colour to each of the three product modules — Payments,
|
|
732
|
+
* Accounting, CRM — so colour reads as module identity, not as one app's brand
|
|
733
|
+
* primary. Those three base hexes are the owner's OFFICIAL, single-source-of-truth
|
|
734
|
+
* brand palette (`#52E2F2` cyan / `#F266CD` magenta / `#7997F2` violet), not
|
|
735
|
+
* something this package chose, so they are transcribed here verbatim and pinned
|
|
736
|
+
* by `finregModules.test.ts`. (They replace the earlier interim "EDA" hexes
|
|
737
|
+
* `#4FD8F0` / `#E85FBF` / `#7B8FF7`, which were slightly off the official logo.)
|
|
648
738
|
*
|
|
649
739
|
* Each module also carries an `onWhite` companion. The base fills are light — a
|
|
650
|
-
* cyan orbit at 1.
|
|
740
|
+
* cyan orbit at 1.55:1 on white cannot be read as text — so a badge, a table
|
|
651
741
|
* cell, a nav label or any icon that paints a module colour on a white surface
|
|
652
742
|
* needs a darkened variant that clears the WCAG AA 4.5:1 floor. The `onWhite`
|
|
653
743
|
* hexes were DERIVED, not eyeballed: each is the lightest shade of the same hue
|
|
@@ -657,12 +747,25 @@ declare const PRESETS: Readonly<Record<string, DesignTokens>>;
|
|
|
657
747
|
* The exact measured ratios are asserted in the test, so a future edit that
|
|
658
748
|
* lightens one below AA fails the build rather than shipping an unreadable label.
|
|
659
749
|
*
|
|
660
|
-
*
|
|
661
|
-
*
|
|
662
|
-
*
|
|
750
|
+
* The navy surfaces (`FINREG_SURFACE_COLORS`) are the official dark grounds — the
|
|
751
|
+
* hero band / logo field top (`#0C2240`) and the deepest closing/footer band /
|
|
752
|
+
* logo field bottom (`#071526`). They are exported so consumers stop hardcoding
|
|
753
|
+
* the dark-band literals.
|
|
754
|
+
*
|
|
755
|
+
* This is the SOURCE of these hexes. Consuming apps read `FINREG_MODULE_COLORS`
|
|
756
|
+
* and `FINREG_SURFACE_COLORS`; they must not re-declare the literals, which is
|
|
757
|
+
* the whole point of the `no-raw-color-literal` rule the consumers are bound by.
|
|
663
758
|
*/
|
|
664
759
|
|
|
665
760
|
declare const FINREG_MODULE_COLORS: FinregModuleColors;
|
|
761
|
+
/**
|
|
762
|
+
* FINREG's official dark brand surfaces — the navy grounds the logo field and the
|
|
763
|
+
* dark marketing bands are painted on. `surface` is the hero/dark-section band and
|
|
764
|
+
* the logo field top; `deepest` is the footer/closing band, the darkest body ink,
|
|
765
|
+
* and the logo field bottom. Bright module colours (esp. Payments cyan) are the
|
|
766
|
+
* AA-safe accents ON these grounds — cyan `#52E2F2` on `#0C2240` measures ~9.6:1.
|
|
767
|
+
*/
|
|
768
|
+
declare const FINREG_SURFACE_COLORS: FinregSurfaceColors;
|
|
666
769
|
|
|
667
770
|
/**
|
|
668
771
|
* WCAG 2.1 contrast-ratio maths.
|
|
@@ -773,4 +876,4 @@ declare function onBrandRatio(background: string, explicit?: string): number | n
|
|
|
773
876
|
*/
|
|
774
877
|
declare function canCarryAccessibleInk(background: string): boolean;
|
|
775
878
|
|
|
776
|
-
export { AA_LARGE_TEXT_RATIO, AA_NON_TEXT_RATIO, AA_NORMAL_TEXT_RATIO, AML_CSS_VAR_NAMES, AML_TOKENS, type BrandExtras, type Branding, type CssVarNames, DEFAULT_CSS_VAR_NAMES, DIGITALKIN_TOKENS, type DesignTokens, EREVNA_TOKENS, FINREG_MODULE_COLORS, type FinregModuleColor, type FinregModuleColors, type InkScale, KATALOGOS_TOKENS, type ModeColors, ON_BRAND_DARK_INK, ON_BRAND_LIGHT_INK, PRESETS, type Radii, type RnThemeConfig, type SemanticColors, type Shadows, type ShellColors, type TailwindColors, type TailwindPreset, type ToCssVarsOptions, type TokenExtensions, type Typography, UI_DEEP_STEP, UI_MAIN_STEP, UI_TINT_STEP, type UiColorScale, type UiThemeColors, type UiThemeConfig, type UiThemeMode, type UiThemePalette, type UiThemeSemantic, type VerdictColors, type WorkspaceExtras, canCarryAccessibleInk, contrastRatio, isHexColor, meetsContrast, onBrandRatio, relativeLuminance, resolveOnBrand, toCssVars, toRnTheme, toTailwindPreset, toUiTheme };
|
|
879
|
+
export { AA_LARGE_TEXT_RATIO, AA_NON_TEXT_RATIO, AA_NORMAL_TEXT_RATIO, AML_CSS_VAR_NAMES, AML_TOKENS, type BrandExtras, type Branding, type CssVarNames, DEFAULT_CSS_VAR_NAMES, DEFAULT_MOTION, DIGITALKIN_TOKENS, type DesignTokens, EREVNA_TOKENS, FINREG_MODULE_COLORS, FINREG_SURFACE_COLORS, type FinregModuleColor, type FinregModuleColors, type FinregSurfaceColors, type InkScale, KATALOGOS_TOKENS, type ModeColors, type Motion, type MotionDurations, type MotionEasing, type MotionEasings, ON_BRAND_DARK_INK, ON_BRAND_LIGHT_INK, PRESETS, type Radii, type RnThemeConfig, type SemanticColors, type Shadows, type ShellColors, type TailwindColors, type TailwindPreset, type ToCssVarsOptions, type TokenExtensions, type Typography, UI_DEEP_STEP, UI_MAIN_STEP, UI_TINT_STEP, type UiColorScale, type UiThemeColors, type UiThemeConfig, type UiThemeMode, type UiThemePalette, type UiThemeSemantic, type VerdictColors, type WorkspaceExtras, canCarryAccessibleInk, contrastRatio, isHexColor, meetsContrast, onBrandRatio, relativeLuminance, resolveOnBrand, toCssVars, toRnTheme, toTailwindPreset, toUiTheme };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
// src/motion.ts
|
|
4
|
+
var DURATION_INSTANT = 0;
|
|
5
|
+
var DURATION_FAST = 140;
|
|
6
|
+
var DURATION_BASE = 200;
|
|
7
|
+
var DURATION_SLOW = 300;
|
|
8
|
+
var DEFAULT_MOTION = {
|
|
9
|
+
durations: {
|
|
10
|
+
instant: DURATION_INSTANT,
|
|
11
|
+
fast: DURATION_FAST,
|
|
12
|
+
base: DURATION_BASE,
|
|
13
|
+
slow: DURATION_SLOW
|
|
14
|
+
},
|
|
15
|
+
easings: {
|
|
16
|
+
// Symmetric ease for on-screen moves that stay on screen.
|
|
17
|
+
standard: {
|
|
18
|
+
css: "cubic-bezier(0.2,0,0,1)",
|
|
19
|
+
bezier: [0.2, 0, 0, 1]
|
|
20
|
+
},
|
|
21
|
+
// Fast-in / soft-stop for elements ENTERING the screen.
|
|
22
|
+
decelerate: {
|
|
23
|
+
css: "cubic-bezier(0,0,0,1)",
|
|
24
|
+
bezier: [0, 0, 0, 1]
|
|
25
|
+
},
|
|
26
|
+
// Soft-start / fast-out for elements LEAVING the screen.
|
|
27
|
+
accelerate: {
|
|
28
|
+
css: "cubic-bezier(0.3,0,1,1)",
|
|
29
|
+
bezier: [0.3, 0, 1, 1]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
3
34
|
// src/varNames.ts
|
|
4
35
|
var DEFAULT_CSS_VAR_NAMES = {
|
|
5
36
|
primary: "--primary",
|
|
@@ -647,21 +678,27 @@ var PRESETS = {
|
|
|
647
678
|
// src/finregModules.ts
|
|
648
679
|
var FINREG_MODULE_COLORS = {
|
|
649
680
|
payments: {
|
|
650
|
-
// cyan — 1.
|
|
651
|
-
base: "#
|
|
652
|
-
onWhite: "#
|
|
681
|
+
// cyan — 1.55:1 on white (fill only); onWhite 4.56:1
|
|
682
|
+
base: "#52E2F2",
|
|
683
|
+
onWhite: "#0B8290"
|
|
653
684
|
},
|
|
654
685
|
accounting: {
|
|
655
|
-
// magenta —
|
|
656
|
-
base: "#
|
|
657
|
-
onWhite: "#
|
|
686
|
+
// magenta — 2.78:1 on white (fill only); onWhite 4.55:1
|
|
687
|
+
base: "#F266CD",
|
|
688
|
+
onWhite: "#DA12A5"
|
|
658
689
|
},
|
|
659
690
|
crm: {
|
|
660
|
-
// violet — 2.
|
|
661
|
-
base: "#
|
|
662
|
-
onWhite: "#
|
|
691
|
+
// violet — 2.79:1 on white (fill only); onWhite 4.57:1
|
|
692
|
+
base: "#7997F2",
|
|
693
|
+
onWhite: "#426CED"
|
|
663
694
|
}
|
|
664
695
|
};
|
|
696
|
+
var FINREG_SURFACE_COLORS = {
|
|
697
|
+
// primary dark surface — hero band, dark sections, logo field top
|
|
698
|
+
surface: "#0C2240",
|
|
699
|
+
// darkest surface — footer/closing band, body-text ink, logo field bottom
|
|
700
|
+
deepest: "#071526"
|
|
701
|
+
};
|
|
665
702
|
|
|
666
703
|
exports.AA_LARGE_TEXT_RATIO = AA_LARGE_TEXT_RATIO;
|
|
667
704
|
exports.AA_NON_TEXT_RATIO = AA_NON_TEXT_RATIO;
|
|
@@ -669,9 +706,11 @@ exports.AA_NORMAL_TEXT_RATIO = AA_NORMAL_TEXT_RATIO;
|
|
|
669
706
|
exports.AML_CSS_VAR_NAMES = AML_CSS_VAR_NAMES;
|
|
670
707
|
exports.AML_TOKENS = AML_TOKENS;
|
|
671
708
|
exports.DEFAULT_CSS_VAR_NAMES = DEFAULT_CSS_VAR_NAMES;
|
|
709
|
+
exports.DEFAULT_MOTION = DEFAULT_MOTION;
|
|
672
710
|
exports.DIGITALKIN_TOKENS = DIGITALKIN_TOKENS;
|
|
673
711
|
exports.EREVNA_TOKENS = EREVNA_TOKENS;
|
|
674
712
|
exports.FINREG_MODULE_COLORS = FINREG_MODULE_COLORS;
|
|
713
|
+
exports.FINREG_SURFACE_COLORS = FINREG_SURFACE_COLORS;
|
|
675
714
|
exports.KATALOGOS_TOKENS = KATALOGOS_TOKENS;
|
|
676
715
|
exports.ON_BRAND_DARK_INK = ON_BRAND_DARK_INK;
|
|
677
716
|
exports.ON_BRAND_LIGHT_INK = ON_BRAND_LIGHT_INK;
|