@xsolla/switch-theme-customization 0.155.0 → 0.156.0-pr277.1779161117

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/index.d.mts CHANGED
@@ -219,6 +219,276 @@ declare const themesBaseColorsArray: {
219
219
  declare const themesBaseColors: Record<string, BaseColors>;
220
220
  declare const themesColorsScheme: Record<string, (base: BaseColors) => void>;
221
221
 
222
+ interface PentagramBaseColors {
223
+ content: Colord;
224
+ contentInverse: Colord;
225
+ background: Colord;
226
+ backgroundInverse: Colord;
227
+ brand: Colord;
228
+ brandExtra: Colord;
229
+ success: Colord;
230
+ warning: Colord;
231
+ alert: Colord;
232
+ neutral: Colord;
233
+ mono: Colord;
234
+ linkPrimary: Colord;
235
+ linkSecondary: Colord;
236
+ onBrand: Colord;
237
+ onBrandExtra: Colord;
238
+ onSuccess: Colord;
239
+ onWarning: Colord;
240
+ onAlert: Colord;
241
+ onNeutral: Colord;
242
+ }
243
+ interface ControlVariant {
244
+ bg: string;
245
+ bgHover: string;
246
+ bgPress: string;
247
+ border: string;
248
+ borderHover: string;
249
+ borderPress: string;
250
+ }
251
+ interface ControlVariantWithDisable extends ControlVariant {
252
+ bgDisable: string;
253
+ borderDisable: string;
254
+ }
255
+ interface ThemeScheme {
256
+ background: {
257
+ primary: string;
258
+ secondary: string;
259
+ brand: {
260
+ primary: string;
261
+ secondary: string;
262
+ };
263
+ brandExtra: {
264
+ primary: string;
265
+ secondary: string;
266
+ };
267
+ success: {
268
+ primary: string;
269
+ secondary: string;
270
+ };
271
+ warning: {
272
+ primary: string;
273
+ secondary: string;
274
+ };
275
+ alert: {
276
+ primary: string;
277
+ secondary: string;
278
+ };
279
+ neutral: {
280
+ primary: string;
281
+ secondary: string;
282
+ };
283
+ inverse: string;
284
+ static: {
285
+ light: string;
286
+ dark: string;
287
+ };
288
+ };
289
+ content: {
290
+ primary: string;
291
+ secondary: string;
292
+ tertiary: string;
293
+ brand: {
294
+ primary: string;
295
+ secondary: string;
296
+ };
297
+ brandExtra: {
298
+ primary: string;
299
+ secondary: string;
300
+ };
301
+ success: {
302
+ primary: string;
303
+ secondary: string;
304
+ };
305
+ warning: {
306
+ primary: string;
307
+ secondary: string;
308
+ };
309
+ alert: {
310
+ primary: string;
311
+ secondary: string;
312
+ };
313
+ neutral: {
314
+ primary: string;
315
+ secondary: string;
316
+ };
317
+ inverse: string;
318
+ static: {
319
+ light: string;
320
+ dark: string;
321
+ };
322
+ on: {
323
+ brand: string;
324
+ brandExtra: string;
325
+ success: string;
326
+ warning: string;
327
+ alert: string;
328
+ neutral: string;
329
+ };
330
+ };
331
+ border: {
332
+ primary: string;
333
+ secondary: string;
334
+ inverse: string;
335
+ brand: string;
336
+ brandExtra: string;
337
+ success: string;
338
+ warning: string;
339
+ alert: string;
340
+ neutral: string;
341
+ };
342
+ overlay: {
343
+ mono: string;
344
+ brand: string;
345
+ brandExtra: string;
346
+ success: string;
347
+ warning: string;
348
+ alert: string;
349
+ neutral: string;
350
+ };
351
+ layer: {
352
+ scrim: string;
353
+ float: string;
354
+ };
355
+ control: {
356
+ brand: {
357
+ primary: ControlVariantWithDisable;
358
+ secondary: ControlVariant;
359
+ tertiary: ControlVariant;
360
+ text: {
361
+ primary: string;
362
+ secondary: string;
363
+ tertiary: string;
364
+ disable: string;
365
+ };
366
+ };
367
+ mono: {
368
+ primary: ControlVariant;
369
+ secondary: ControlVariant;
370
+ tertiary: ControlVariant;
371
+ text: {
372
+ primary: string;
373
+ secondary: string;
374
+ tertiary: string;
375
+ };
376
+ };
377
+ brandExtra: {
378
+ primary: ControlVariant;
379
+ secondary: ControlVariant;
380
+ tertiary: ControlVariant;
381
+ text: {
382
+ primary: string;
383
+ secondary: string;
384
+ tertiary: string;
385
+ };
386
+ };
387
+ alert: {
388
+ bg: string;
389
+ border: string;
390
+ primary: ControlVariant;
391
+ secondary: ControlVariant;
392
+ tertiary: ControlVariant;
393
+ text: {
394
+ primary: string;
395
+ secondary: string;
396
+ tertiary: string;
397
+ };
398
+ };
399
+ input: {
400
+ bg: string;
401
+ bgHover: string;
402
+ bgDisable: string;
403
+ border: string;
404
+ borderHover: string;
405
+ borderDisable: string;
406
+ text: string;
407
+ placeholder: string;
408
+ textDisable: string;
409
+ };
410
+ focus: {
411
+ bg: string;
412
+ border: string;
413
+ };
414
+ check: {
415
+ bg: string;
416
+ bgHover: string;
417
+ bgDisable: string;
418
+ border: string;
419
+ borderHover: string;
420
+ borderDisable: string;
421
+ icon: string;
422
+ };
423
+ faint: {
424
+ bg: string;
425
+ bgHover: string;
426
+ border: string;
427
+ borderHover: string;
428
+ };
429
+ slider: {
430
+ bg: string;
431
+ bgHover: string;
432
+ bgDisable: string;
433
+ };
434
+ switch: {
435
+ bg: string;
436
+ bgHover: string;
437
+ bgDisable: string;
438
+ border: string;
439
+ borderHover: string;
440
+ borderDisable: string;
441
+ };
442
+ knob: {
443
+ bg: string;
444
+ bgHover: string;
445
+ bgInactive: string;
446
+ };
447
+ text: {
448
+ primary: string;
449
+ disable: string;
450
+ };
451
+ link: {
452
+ primary: string;
453
+ primaryHover: string;
454
+ secondary: string;
455
+ secondaryHover: string;
456
+ };
457
+ segmented: {
458
+ bg: string;
459
+ bgHover: string;
460
+ bgActive: string;
461
+ border: string;
462
+ borderHover: string;
463
+ borderActive: string;
464
+ text: string;
465
+ textDisable: string;
466
+ };
467
+ toggleButton: {
468
+ bg: string;
469
+ bgHover: string;
470
+ bgActive: string;
471
+ bgDisable: string;
472
+ border: string;
473
+ borderHover: string;
474
+ borderActive: string;
475
+ borderDisable: string;
476
+ text: string;
477
+ textActive: string;
478
+ textDisable: string;
479
+ };
480
+ };
481
+ }
482
+ type PresetName = string;
483
+
484
+ declare const baseDark: PentagramBaseColors;
485
+ declare const createDarkScheme: (b: PentagramBaseColors) => ThemeScheme;
486
+ declare const payStationDarkScheme: ThemeScheme;
487
+
488
+ declare const base: PentagramBaseColors;
489
+ declare const createScheme: (b: PentagramBaseColors) => ThemeScheme;
490
+ declare const payStationScheme: ThemeScheme;
491
+
222
492
  declare const themes: Record<string, Theme>;
223
493
 
224
494
  declare const palettes: {
@@ -1671,13 +1941,27 @@ interface ThemeGenerateType {
1671
1941
  globalStyle?: GlobalStyles;
1672
1942
  }
1673
1943
 
1944
+ declare const pentagramColorsScheme: Record<string, (b: PentagramBaseColors) => ThemeScheme>;
1945
+ type PentagramSchemeName = keyof typeof pentagramColorsScheme;
1674
1946
  type ThemeFunctionType = {
1675
1947
  schemeName: string;
1676
1948
  baseColors?: BaseColors;
1677
1949
  customParams?: ThemeGenerateType;
1678
1950
  parentTheme?: Theme;
1679
1951
  };
1680
- declare const generateWithScheme: ({ schemeName, baseColors, parentTheme }: ThemeFunctionType) => Theme & void;
1681
- declare const themeGenerator: (props: ThemeFunctionType) => Theme;
1952
+ declare const generateWithScheme: ({ schemeName, baseColors, parentTheme, }: ThemeFunctionType) => Theme & void;
1953
+ /**
1954
+ * Supports two theme generation systems via overloads:
1955
+ * - Legacy (Switch-based): accepts old BaseColors (10 tokens), returns Theme with typo/misc/shadows
1956
+ * - Pentagram: accepts PentagramBaseColors (19 tokens), returns flat ThemeScheme
1957
+ *
1958
+ * Overloads allow product-themes to call themeGenerator with a unified API —
1959
+ * only schemeName and baseColors change, return type is inferred automatically.
1960
+ */
1961
+ declare function themeGenerator(props: {
1962
+ schemeName: PentagramSchemeName;
1963
+ baseColors?: PentagramBaseColors;
1964
+ }): ThemeScheme;
1965
+ declare function themeGenerator(props: ThemeFunctionType): Theme;
1682
1966
 
1683
- export { type BaseColors, type BaseColorsIndex, type ColorValue, type Colors$1 as Colors, type ComponentBaseColors$1 as ComponentBaseColors, type Misc, type Shadows, type Size, type Theme, type ThemeFunctionType, type ThemeVariant, type Typography, emails, emailsDark, emailsThemes, generateWithScheme, palettes, paystation4, paystation4Dark, paystation4Gaijin, paystation4Nexters, paystation4Take2, paystation4Themes, primaryPalette, publisherV2, publisherV2Dark, publisherV2Themes, themeGenerator, themes, themesBaseColors, themesBaseColorsArray, themesColorsScheme };
1967
+ export { type BaseColors, type BaseColorsIndex, type ColorValue, type Colors$1 as Colors, type ComponentBaseColors$1 as ComponentBaseColors, type Misc, type PentagramBaseColors, type PresetName, type Shadows, type Size, type Theme, type ThemeFunctionType, type ThemeScheme, type ThemeVariant, type Typography, base, baseDark, createDarkScheme, createScheme, emails, emailsDark, emailsThemes, generateWithScheme, palettes, payStationDarkScheme, payStationScheme, paystation4, paystation4Dark, paystation4Gaijin, paystation4Nexters, paystation4Take2, paystation4Themes, primaryPalette, publisherV2, publisherV2Dark, publisherV2Themes, themeGenerator, themes, themesBaseColors, themesBaseColorsArray, themesColorsScheme };
package/index.d.ts CHANGED
@@ -219,6 +219,276 @@ declare const themesBaseColorsArray: {
219
219
  declare const themesBaseColors: Record<string, BaseColors>;
220
220
  declare const themesColorsScheme: Record<string, (base: BaseColors) => void>;
221
221
 
222
+ interface PentagramBaseColors {
223
+ content: Colord;
224
+ contentInverse: Colord;
225
+ background: Colord;
226
+ backgroundInverse: Colord;
227
+ brand: Colord;
228
+ brandExtra: Colord;
229
+ success: Colord;
230
+ warning: Colord;
231
+ alert: Colord;
232
+ neutral: Colord;
233
+ mono: Colord;
234
+ linkPrimary: Colord;
235
+ linkSecondary: Colord;
236
+ onBrand: Colord;
237
+ onBrandExtra: Colord;
238
+ onSuccess: Colord;
239
+ onWarning: Colord;
240
+ onAlert: Colord;
241
+ onNeutral: Colord;
242
+ }
243
+ interface ControlVariant {
244
+ bg: string;
245
+ bgHover: string;
246
+ bgPress: string;
247
+ border: string;
248
+ borderHover: string;
249
+ borderPress: string;
250
+ }
251
+ interface ControlVariantWithDisable extends ControlVariant {
252
+ bgDisable: string;
253
+ borderDisable: string;
254
+ }
255
+ interface ThemeScheme {
256
+ background: {
257
+ primary: string;
258
+ secondary: string;
259
+ brand: {
260
+ primary: string;
261
+ secondary: string;
262
+ };
263
+ brandExtra: {
264
+ primary: string;
265
+ secondary: string;
266
+ };
267
+ success: {
268
+ primary: string;
269
+ secondary: string;
270
+ };
271
+ warning: {
272
+ primary: string;
273
+ secondary: string;
274
+ };
275
+ alert: {
276
+ primary: string;
277
+ secondary: string;
278
+ };
279
+ neutral: {
280
+ primary: string;
281
+ secondary: string;
282
+ };
283
+ inverse: string;
284
+ static: {
285
+ light: string;
286
+ dark: string;
287
+ };
288
+ };
289
+ content: {
290
+ primary: string;
291
+ secondary: string;
292
+ tertiary: string;
293
+ brand: {
294
+ primary: string;
295
+ secondary: string;
296
+ };
297
+ brandExtra: {
298
+ primary: string;
299
+ secondary: string;
300
+ };
301
+ success: {
302
+ primary: string;
303
+ secondary: string;
304
+ };
305
+ warning: {
306
+ primary: string;
307
+ secondary: string;
308
+ };
309
+ alert: {
310
+ primary: string;
311
+ secondary: string;
312
+ };
313
+ neutral: {
314
+ primary: string;
315
+ secondary: string;
316
+ };
317
+ inverse: string;
318
+ static: {
319
+ light: string;
320
+ dark: string;
321
+ };
322
+ on: {
323
+ brand: string;
324
+ brandExtra: string;
325
+ success: string;
326
+ warning: string;
327
+ alert: string;
328
+ neutral: string;
329
+ };
330
+ };
331
+ border: {
332
+ primary: string;
333
+ secondary: string;
334
+ inverse: string;
335
+ brand: string;
336
+ brandExtra: string;
337
+ success: string;
338
+ warning: string;
339
+ alert: string;
340
+ neutral: string;
341
+ };
342
+ overlay: {
343
+ mono: string;
344
+ brand: string;
345
+ brandExtra: string;
346
+ success: string;
347
+ warning: string;
348
+ alert: string;
349
+ neutral: string;
350
+ };
351
+ layer: {
352
+ scrim: string;
353
+ float: string;
354
+ };
355
+ control: {
356
+ brand: {
357
+ primary: ControlVariantWithDisable;
358
+ secondary: ControlVariant;
359
+ tertiary: ControlVariant;
360
+ text: {
361
+ primary: string;
362
+ secondary: string;
363
+ tertiary: string;
364
+ disable: string;
365
+ };
366
+ };
367
+ mono: {
368
+ primary: ControlVariant;
369
+ secondary: ControlVariant;
370
+ tertiary: ControlVariant;
371
+ text: {
372
+ primary: string;
373
+ secondary: string;
374
+ tertiary: string;
375
+ };
376
+ };
377
+ brandExtra: {
378
+ primary: ControlVariant;
379
+ secondary: ControlVariant;
380
+ tertiary: ControlVariant;
381
+ text: {
382
+ primary: string;
383
+ secondary: string;
384
+ tertiary: string;
385
+ };
386
+ };
387
+ alert: {
388
+ bg: string;
389
+ border: string;
390
+ primary: ControlVariant;
391
+ secondary: ControlVariant;
392
+ tertiary: ControlVariant;
393
+ text: {
394
+ primary: string;
395
+ secondary: string;
396
+ tertiary: string;
397
+ };
398
+ };
399
+ input: {
400
+ bg: string;
401
+ bgHover: string;
402
+ bgDisable: string;
403
+ border: string;
404
+ borderHover: string;
405
+ borderDisable: string;
406
+ text: string;
407
+ placeholder: string;
408
+ textDisable: string;
409
+ };
410
+ focus: {
411
+ bg: string;
412
+ border: string;
413
+ };
414
+ check: {
415
+ bg: string;
416
+ bgHover: string;
417
+ bgDisable: string;
418
+ border: string;
419
+ borderHover: string;
420
+ borderDisable: string;
421
+ icon: string;
422
+ };
423
+ faint: {
424
+ bg: string;
425
+ bgHover: string;
426
+ border: string;
427
+ borderHover: string;
428
+ };
429
+ slider: {
430
+ bg: string;
431
+ bgHover: string;
432
+ bgDisable: string;
433
+ };
434
+ switch: {
435
+ bg: string;
436
+ bgHover: string;
437
+ bgDisable: string;
438
+ border: string;
439
+ borderHover: string;
440
+ borderDisable: string;
441
+ };
442
+ knob: {
443
+ bg: string;
444
+ bgHover: string;
445
+ bgInactive: string;
446
+ };
447
+ text: {
448
+ primary: string;
449
+ disable: string;
450
+ };
451
+ link: {
452
+ primary: string;
453
+ primaryHover: string;
454
+ secondary: string;
455
+ secondaryHover: string;
456
+ };
457
+ segmented: {
458
+ bg: string;
459
+ bgHover: string;
460
+ bgActive: string;
461
+ border: string;
462
+ borderHover: string;
463
+ borderActive: string;
464
+ text: string;
465
+ textDisable: string;
466
+ };
467
+ toggleButton: {
468
+ bg: string;
469
+ bgHover: string;
470
+ bgActive: string;
471
+ bgDisable: string;
472
+ border: string;
473
+ borderHover: string;
474
+ borderActive: string;
475
+ borderDisable: string;
476
+ text: string;
477
+ textActive: string;
478
+ textDisable: string;
479
+ };
480
+ };
481
+ }
482
+ type PresetName = string;
483
+
484
+ declare const baseDark: PentagramBaseColors;
485
+ declare const createDarkScheme: (b: PentagramBaseColors) => ThemeScheme;
486
+ declare const payStationDarkScheme: ThemeScheme;
487
+
488
+ declare const base: PentagramBaseColors;
489
+ declare const createScheme: (b: PentagramBaseColors) => ThemeScheme;
490
+ declare const payStationScheme: ThemeScheme;
491
+
222
492
  declare const themes: Record<string, Theme>;
223
493
 
224
494
  declare const palettes: {
@@ -1671,13 +1941,27 @@ interface ThemeGenerateType {
1671
1941
  globalStyle?: GlobalStyles;
1672
1942
  }
1673
1943
 
1944
+ declare const pentagramColorsScheme: Record<string, (b: PentagramBaseColors) => ThemeScheme>;
1945
+ type PentagramSchemeName = keyof typeof pentagramColorsScheme;
1674
1946
  type ThemeFunctionType = {
1675
1947
  schemeName: string;
1676
1948
  baseColors?: BaseColors;
1677
1949
  customParams?: ThemeGenerateType;
1678
1950
  parentTheme?: Theme;
1679
1951
  };
1680
- declare const generateWithScheme: ({ schemeName, baseColors, parentTheme }: ThemeFunctionType) => Theme & void;
1681
- declare const themeGenerator: (props: ThemeFunctionType) => Theme;
1952
+ declare const generateWithScheme: ({ schemeName, baseColors, parentTheme, }: ThemeFunctionType) => Theme & void;
1953
+ /**
1954
+ * Supports two theme generation systems via overloads:
1955
+ * - Legacy (Switch-based): accepts old BaseColors (10 tokens), returns Theme with typo/misc/shadows
1956
+ * - Pentagram: accepts PentagramBaseColors (19 tokens), returns flat ThemeScheme
1957
+ *
1958
+ * Overloads allow product-themes to call themeGenerator with a unified API —
1959
+ * only schemeName and baseColors change, return type is inferred automatically.
1960
+ */
1961
+ declare function themeGenerator(props: {
1962
+ schemeName: PentagramSchemeName;
1963
+ baseColors?: PentagramBaseColors;
1964
+ }): ThemeScheme;
1965
+ declare function themeGenerator(props: ThemeFunctionType): Theme;
1682
1966
 
1683
- export { type BaseColors, type BaseColorsIndex, type ColorValue, type Colors$1 as Colors, type ComponentBaseColors$1 as ComponentBaseColors, type Misc, type Shadows, type Size, type Theme, type ThemeFunctionType, type ThemeVariant, type Typography, emails, emailsDark, emailsThemes, generateWithScheme, palettes, paystation4, paystation4Dark, paystation4Gaijin, paystation4Nexters, paystation4Take2, paystation4Themes, primaryPalette, publisherV2, publisherV2Dark, publisherV2Themes, themeGenerator, themes, themesBaseColors, themesBaseColorsArray, themesColorsScheme };
1967
+ export { type BaseColors, type BaseColorsIndex, type ColorValue, type Colors$1 as Colors, type ComponentBaseColors$1 as ComponentBaseColors, type Misc, type PentagramBaseColors, type PresetName, type Shadows, type Size, type Theme, type ThemeFunctionType, type ThemeScheme, type ThemeVariant, type Typography, base, baseDark, createDarkScheme, createScheme, emails, emailsDark, emailsThemes, generateWithScheme, palettes, payStationDarkScheme, payStationScheme, paystation4, paystation4Dark, paystation4Gaijin, paystation4Nexters, paystation4Take2, paystation4Themes, primaryPalette, publisherV2, publisherV2Dark, publisherV2Themes, themeGenerator, themes, themesBaseColors, themesBaseColorsArray, themesColorsScheme };