@g9tm/lynxcontrols-foundation 2.5.7 → 2.5.9
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/catalog/catalog.json +235 -3
- package/catalog/index.md +1 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/culture/text.d.ts +2 -0
- package/dist/culture/text.d.ts.map +1 -1
- package/dist/culture/text.js +3 -2
- package/dist/culture/text.js.map +1 -1
- package/dist/services/keys.d.ts +7 -0
- package/dist/services/keys.d.ts.map +1 -1
- package/dist/services/keys.js.map +1 -1
- package/dist/theme/appearance-kit.d.ts +148 -0
- package/dist/theme/appearance-kit.d.ts.map +1 -0
- package/dist/theme/appearance-kit.js +410 -0
- package/dist/theme/appearance-kit.js.map +1 -0
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +1 -0
- package/dist/theme/recipe.d.ts.map +1 -1
- package/dist/theme/recipe.js +11 -3
- package/dist/theme/recipe.js.map +1 -1
- package/docs/api.md +29 -0
- package/package.json +1 -1
package/docs/api.md
CHANGED
|
@@ -95,6 +95,7 @@ folder) explain how the pieces fit; the migration tables map every MAUI member.
|
|
|
95
95
|
| `createBrandPalette` | function | The full palette for `scheme`. Pure and deterministic: the same brand gives the same palette everywhere (app, web, server-side previews), so it can be computed at build time or on the device. |
|
|
96
96
|
| `createBrandPalettes` | function | Both schemes at once (what a theme store's `palettes` option takes). |
|
|
97
97
|
| `createDesignRegistry` | function | Creates the registry. Colour ids are `color.<Token>` (`color.Primary`); shape ids are `shape.radius.card`, `shape.height.md`, `shape.type.body.size`, `shape.touchTarget`. A change is an override layered over the app's own overrides, so a reset returns exactly to what the app painted. |
|
|
98
|
+
| `createG9ThemeRegistry` | function | Creates a theme registry. |
|
|
98
99
|
| `createHoverColor` | function | 8 % darker: the stock hover recipe. MAUI `G9ColorHelper.CreateHoverColor`. |
|
|
99
100
|
| `createPalette` | function | Validates a complete palette (every token, every value a readable colour) and returns a frozen copy in token order. |
|
|
100
101
|
| `createPressedColor` | function | 20 % darker: the stock pressed recipe. MAUI `G9ColorHelper.CreatePressedColor`. |
|
|
@@ -107,6 +108,19 @@ folder) explain how the pieces fit; the migration tables map every MAUI member.
|
|
|
107
108
|
| `fixedNeutralScale` | function | Neutrals of a fixed hue and chroma, whatever the brand (warm paper, cool steel), on the sine curve's lightness steps (ShopManager's `fixedNeutralScale`). |
|
|
108
109
|
| `formatColor` | function | Formats a colour as CSS: `#RRGGBB` when opaque, otherwise `rgba(R, G, B, A)`. Channels are rounded to the nearest byte; the alpha is printed with the fewest digits that parse back to the same float32 value, so `parseColor(formatColor(c))` reproduces the alpha exactly. |
|
|
109
110
|
| `fromOklch` | function | OKLCH → sRGB (`G9Rgba`, channels 0..1). Out-of-gamut colours keep L and H and lose chroma until they fit (binary search, 18 steps ≈ 1e-6 chroma), so a vivid brand never shifts hue when it is darkened or lightened. |
|
|
111
|
+
| `g9ActiveThemeId` | function | The theme id in force: the chosen one, or the light / dark one for the device's scheme when following it. |
|
|
112
|
+
| `g9AppTokens` | function | The app tokens for a palette and scheme: plain colours (and one gradient), never variables. |
|
|
113
|
+
| `g9AppTokenVariables` | function | The app tokens as CSS variables (`--g9-hover`…; `prefix` default `g9-`), for G9Provider's `themeExtras`. |
|
|
114
|
+
| `g9BuildPersonalTheme` | function | The theme a draft describes: the base's recipe with the draft's accent, its surfaces tinted (cool, warm, or by the accent) through overrides measured on `palettes` (the base's palettes for the accent: `recipePalettes(...)`). |
|
|
115
|
+
| `g9EffectsEnabled` | function | Whether effects (blur, glow, motion flourishes) are on. |
|
|
116
|
+
| `g9NewPersonalThemeId` | function | A fresh personal id (`me:…`). |
|
|
117
|
+
| `g9NormalizeAppearance` | function | Stored settings read back loosely: every unknown or broken field takes its default. |
|
|
118
|
+
| `g9PersonalDraft` | function | A draft starting from `base`. |
|
|
119
|
+
| `g9SanitizeTokens` | function | Only well-formed tokens of `allowed` names (a leading `--g9-` is dropped first), from a theme that came from outside (the server, a file): values that cannot break out of a declaration, and pictures only as inline `data:` images. |
|
|
120
|
+
| `g9ScaledType` | function | The type scale at a text size (sizes and line heights rounded), for G9Provider's `shape.type`. |
|
|
121
|
+
| `g9ThemeFileName` | function | A file name for a theme export (letters, digits, dashes; any script). |
|
|
122
|
+
| `g9ThemeFromInput` | function | A theme from the server or a file, read loosely (a newer server never breaks the client); null when broken. |
|
|
123
|
+
| `g9Wallpaper` | function | A wallpaper by id (from `list`, default `g9Wallpapers`), or null. |
|
|
110
124
|
| `getContrastingTextColor` | function | Black on light backgrounds (luminance above 0.5), white otherwise. MAUI `GetContrastingTextColor`. |
|
|
111
125
|
| `getContrastRatio` | function | WCAG contrast ratio, `1` to `21`. |
|
|
112
126
|
| `getLuminance` | function | WCAG relative luminance, `0` (black) to `1` (white). Alpha is ignored, as in MAUI. |
|
|
@@ -161,13 +175,19 @@ folder) explain how the pieces fit; the migration tables map every MAUI member.
|
|
|
161
175
|
| `G9ThemeMode` | enum | Which theme the user chose (MAUI `AppTheme`: `Unspecified` is `system`, follow the platform). |
|
|
162
176
|
| `g9AccentPresets` | constant | Accent colours offered by "pick a colour" UIs (G9Hub ACCENT_PRESETS, SAC brand picker). Tested for contrast. |
|
|
163
177
|
| `g9AliasPresets` | constant | Ready-made alias maps for the four G9 apps' existing names (the migration guides start from these). |
|
|
178
|
+
| `g9AppTokenNames` | constant | The tokens an app (a messenger) adds to the library palette. |
|
|
164
179
|
| `g9BuiltInThemes` | constant | The built-in themes over the built-in recipes, one per accent preset family. |
|
|
165
180
|
| `G9Colors` | constant | Alpha recipes the G9 controls paint with (MAUI `G9Colors` constants). |
|
|
166
181
|
| `g9ContrastRules` | constant | The rules every palette must pass. |
|
|
182
|
+
| `g9DefaultAppearance` | constant | The settings of a new install. |
|
|
167
183
|
| `g9DefaultThemeSchedule` | constant | The default dark span of the scheduled mode: from 18:00 to 07:00. |
|
|
168
184
|
| `g9Easings` | constant | Named easings as cubic-bezier (Lynx reads cubic-bezier, linear, ease, ease-in, ease-out, ease-in-out). |
|
|
185
|
+
| `g9FontScaleFactors` | constant | Text size factors. |
|
|
169
186
|
| `g9TonalSteps` | constant | Steps of a tonal scale (Tailwind-like names: 50 lightest … 950 darkest). |
|
|
187
|
+
| `g9Wallpapers` | constant | Wallpapers drawn with gradients only (no pictures, no network). |
|
|
170
188
|
| `G9ColorFormatError` | class | Thrown when a string is not a colour this library can read. |
|
|
189
|
+
| `G9AppearanceSettings` | interface | What a person chose on Settings → Appearance (kept per device by the app). |
|
|
190
|
+
| `G9AppTokenOptions` | interface | Options of `g9AppTokens`. |
|
|
171
191
|
| `G9BrandColors` | interface | The colours a brand gives. Only `primary` is required; the rest are derived when missing. |
|
|
172
192
|
| `G9BrandPaletteOptions` | interface | How `createBrandPalette` builds a palette from a brand colour: grey tint, contrast target and whether the brand colour is kept as is. |
|
|
173
193
|
| `G9ContrastResult` | interface | One rule's outcome. |
|
|
@@ -178,22 +198,31 @@ folder) explain how the pieces fit; the migration tables map every MAUI member.
|
|
|
178
198
|
| `G9EnsureContrastOptions` | interface | Options of `ensureContrast`. |
|
|
179
199
|
| `G9GradientStop` | interface | A gradient stop: colour at `offset` (`0..1`). |
|
|
180
200
|
| `G9Oklch` | interface | A colour in OKLCH. `alpha` 0..1 (default 1). |
|
|
201
|
+
| `G9PersonalThemeDraft` | interface | What the personal theme editor edits. |
|
|
181
202
|
| `G9ResolvedTheme` | interface | A resolved theme: what is painted and why. Frozen. |
|
|
182
203
|
| `G9Rgba` | interface | A colour as four channels in `0..1`, stored at float32 precision exactly like MAUI `Color`. Colour arithmetic (darken, mix, contrast) runs on this shape so its results match the original helpers bit for bit; format with `formatColor` to get a CSS string back. |
|
|
183
204
|
| `G9ScaleOptions` | interface | Options of `tonalScale` and `neutralScale`. |
|
|
184
205
|
| `G9ThemeDefinition` | interface | One selectable theme. |
|
|
185
206
|
| `G9ThemeOptions` | interface | Inputs of theme resolution. |
|
|
186
207
|
| `G9ThemeRecipe` | interface | A named recipe. |
|
|
208
|
+
| `G9ThemeRegistry` | interface | Every theme: built in, the organisation's, the person's own (a store an appearance page reads). |
|
|
209
|
+
| `G9ThemeRegistryOptions` | interface | Options of `createG9ThemeRegistry`. |
|
|
210
|
+
| `G9ThemeRegistrySnapshot` | interface | The themes a person can pick, by source. |
|
|
187
211
|
| `G9ThemeSchedule` | interface | When `'scheduled'` paints dark: from `darkFrom` (hour, 0–23) to `darkTo` (exclusive), across midnight when `darkFrom > darkTo`. Default 18 → 7 (Riskara's evening theme). |
|
|
188
212
|
| `G9ThemeStore` | interface | The live theme (MAUI `G9Palette.Current` + `G9Theme`): one snapshot, replaced on every change, and listeners told once per change. Works with `useSyncExternalStore` (`subscribe` / `getSnapshot`). |
|
|
189
213
|
| `G9VariantColors` | interface | The colours a variant resolves to: fill, foreground, stroke, and whether the fill is a gradient (MAUI `G9VariantColors`). Colours are CSS strings. |
|
|
190
214
|
| `G9VariantVars` | interface | A variant painted with CSS variables: the same colours as `resolveButtonVariant`, following the theme with no script (the provider writes the variables). `gradient` names the token whose gradient a solid fill uses. |
|
|
215
|
+
| `G9Wallpaper` | interface | A chat wallpaper: layers drawn behind a thread, from the palette so it follows the theme and accent. |
|
|
216
|
+
| `G9AppTokenName` | type | The name of an app token (`hover`, `bubble-mine`…). |
|
|
191
217
|
| `G9ButtonVisualResult` | type | The colours a button finally paints, after its `baseBackgroundColor` / `textColor` escape hatches are applied over the variant (MAUI `G9Visuals.ButtonVisualResult`). Same shape as `G9VariantColors`, so a button treats both paths identically; the button itself (WP04) applies the escape hatches. |
|
|
192
218
|
| `G9Color` | type | A CSS colour string, the value type every G9 colour prop takes (plan/specs/03-API-Conventions.md §2). Use `g9Token` for a theme token reference such as `var(--g9-primary)`. |
|
|
193
219
|
| `G9ColorInput` | type | Anything the colour helpers accept: a CSS colour string or channels. |
|
|
194
220
|
| `G9ContrastRule` | type | `[foreground, background, minimum]`. 4.5 = body text (WCAG AA), 3 = large text, icons and borders that carry meaning. |
|
|
221
|
+
| `G9EffectsMode` | type | Whether effects are on, off, or decided by the device. |
|
|
195
222
|
| `G9Fill` | type | A fill: a solid colour, or a top-to-bottom linear gradient. |
|
|
223
|
+
| `G9FontScale` | type | A text size step. |
|
|
196
224
|
| `G9PaletteOverrides` | type | Some tokens replaced by CSS colours. |
|
|
225
|
+
| `G9SurfaceTone` | type | How a personal theme's surfaces are tinted. |
|
|
197
226
|
| `G9ThemeListener` | type | Listener of `G9ThemeStore`; receives the snapshot taken at notify time. |
|
|
198
227
|
| `G9ThemeSource` | type | Where a theme definition comes from: built in, the organisation's, or the person's own. |
|
|
199
228
|
| `G9TokenAliasMap` | type | App name → library token (`'TextPrimary'`) or a literal colour (`'#1B1512'`). |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@g9tm/lynxcontrols-foundation",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.9",
|
|
4
4
|
"description": "Pure TypeScript core: design tokens, theme model, culture (strings, digits, calendars, relative time, durations), icon model, safe execution, diagnostics, preference and capability contracts. No React, no UI.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|