@labpics/colors 0.6.0 → 0.6.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labpics/colors",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Framework-agnostic contrast engine: resolve accessible, perceptually-anchored colour roles for any background. WASM core, zero runtime dependencies.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -140,8 +140,18 @@ export type RoleRecipe =
140
140
  | { kind: "alpha-analog"; of: LadderSource; alpha: number }
141
141
  | { kind: "zero" };
142
142
 
143
+ /** Именованный пресет ролей. Тонкий конфиг несёт `preset` вместо простыни `roles`. */
144
+ export type RolePreset = "labui";
145
+
143
146
  /** Полный конфиг дизайн-системы клиента — вход loadConfig (JSON.stringify(config)). */
144
147
  export interface ThemeConfig {
148
+ /**
149
+ * Пресет ролей: наполняет словарь дизайн-системы целиком, чтобы клиент вносил
150
+ * ТОЛЬКО значения (якоря, ручки), не семантику. Тонкий конфиг задаёт `preset` и
151
+ * ОПУСКАЕТ `roles`/`aliases`. Задать `preset` вместе с непустыми `roles` —
152
+ * ошибка `invalid_config` (оверрайд отдельных ролей — не этот слой).
153
+ */
154
+ readonly preset?: RolePreset;
145
155
  readonly brand: ThemeAnchors;
146
156
  readonly neutral: {
147
157
  readonly anchors: { light: string; mid: string; dark: string };
@@ -166,7 +176,8 @@ export interface ThemeConfig {
166
176
  readonly chroma_fraction: number;
167
177
  };
168
178
  readonly themes: ReadonlyArray<{ name: string; preset: "srgb" | "dim" | "srgb-ic" | "dim-ic" }>;
169
- readonly roles: ReadonlyArray<{ name: string; recipe: RoleRecipe }>;
179
+ /** Опускается в тонком конфиге (задан `preset`); иначе полный словарь ролей. */
180
+ readonly roles?: ReadonlyArray<{ name: string; recipe: RoleRecipe }>;
170
181
  readonly aliases?: ReadonlyArray<{ alias: string; target: string }>;
171
182
  }
172
183
 
Binary file