@labpics/colors 0.6.0 → 0.6.2

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.2",
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",
@@ -137,11 +137,22 @@ export type RoleRecipe =
137
137
  | { kind: "ladder"; source: LadderSource; position: string }
138
138
  | { kind: "glow"; source: LadderSource; step: "subtle" | "base" | "bloom" }
139
139
  | { kind: "pair-fill"; source: LadderSource }
140
+ | { kind: "pair-label"; source: LadderSource; fraction: number; floor: "aa-text" | "aa-ui" | "none" }
140
141
  | { kind: "alpha-analog"; of: LadderSource; alpha: number }
141
142
  | { kind: "zero" };
142
143
 
144
+ /** Именованный пресет ролей. Тонкий конфиг несёт `preset` вместо простыни `roles`. */
145
+ export type RolePreset = "labui";
146
+
143
147
  /** Полный конфиг дизайн-системы клиента — вход loadConfig (JSON.stringify(config)). */
144
148
  export interface ThemeConfig {
149
+ /**
150
+ * Пресет ролей: наполняет словарь дизайн-системы целиком, чтобы клиент вносил
151
+ * ТОЛЬКО значения (якоря, ручки), не семантику. Тонкий конфиг задаёт `preset` и
152
+ * ОПУСКАЕТ `roles`/`aliases`. Задать `preset` вместе с непустыми `roles` —
153
+ * ошибка `invalid_config` (оверрайд отдельных ролей — не этот слой).
154
+ */
155
+ readonly preset?: RolePreset;
145
156
  readonly brand: ThemeAnchors;
146
157
  readonly neutral: {
147
158
  readonly anchors: { light: string; mid: string; dark: string };
@@ -166,7 +177,8 @@ export interface ThemeConfig {
166
177
  readonly chroma_fraction: number;
167
178
  };
168
179
  readonly themes: ReadonlyArray<{ name: string; preset: "srgb" | "dim" | "srgb-ic" | "dim-ic" }>;
169
- readonly roles: ReadonlyArray<{ name: string; recipe: RoleRecipe }>;
180
+ /** Опускается в тонком конфиге (задан `preset`); иначе полный словарь ролей. */
181
+ readonly roles?: ReadonlyArray<{ name: string; recipe: RoleRecipe }>;
170
182
  readonly aliases?: ReadonlyArray<{ alias: string; target: string }>;
171
183
  }
172
184
 
Binary file