@breadstone/mosaik-themes 0.0.206 → 0.0.210
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 +26 -0
- package/_index.scss +0 -12
- package/index.cjs +1457 -696
- package/index.cjs.map +1 -1
- package/index.d.mts +256 -58
- package/index.d.ts +256 -58
- package/index.js +1458 -697
- package/index.js.map +1 -1
- package/package.json +2 -5
- package/tailwind/v3/index.d.ts +0 -6
- package/tailwind/v3/index.d.ts.map +1 -1
- package/tailwind/v3/index.js +1 -7
- package/tailwind/v3/index.js.map +1 -1
- package/tailwind/v3/plugins/cosmopolitanTailwindPlugin.js +272 -12
- package/tailwind/v3/plugins/cosmopolitanTailwindPlugin.js.map +1 -1
- package/tailwind/v3/plugins/joyTailwindPlugin.js +6 -0
- package/tailwind/v3/plugins/joyTailwindPlugin.js.map +1 -1
- package/tailwind/v3/plugins/memphisTailwindPlugin.js +204 -140
- package/tailwind/v3/plugins/memphisTailwindPlugin.js.map +1 -1
- package/tailwind/v3/presets/cosmopolitanTailwindPresets.js +272 -12
- package/tailwind/v3/presets/cosmopolitanTailwindPresets.js.map +1 -1
- package/tailwind/v3/presets/joyTailwindPresets.js +6 -0
- package/tailwind/v3/presets/joyTailwindPresets.js.map +1 -1
- package/tailwind/v3/presets/memphisTailwindPresets.js +204 -140
- package/tailwind/v3/presets/memphisTailwindPresets.js.map +1 -1
- package/tailwind/v4/cosmopolitanTailwindPresets.css +232 -12
- package/tailwind/v4/joyTailwindPresets.css +2 -0
- package/tailwind/v4/memphisTailwindPresets.css +188 -140
- package/themes/___cosmopolitan-tokens.css +264 -20
- package/themes/___joy-tokens.css +2 -0
- package/themes/___memphis-tokens.css +188 -140
- package/themes/cosmopolitan-tokens.scss +264 -20
- package/themes/cosmopolitan.scss +661 -77
- package/themes/joy-tokens.scss +2 -0
- package/themes/joy.scss +341 -53
- package/themes/memphis-tokens.scss +188 -140
- package/themes/memphis.scss +527 -193
- package/tailwind/v3/plugins/bootstrapTailwindPlugin.d.ts +0 -2
- package/tailwind/v3/plugins/bootstrapTailwindPlugin.d.ts.map +0 -1
- package/tailwind/v3/plugins/bootstrapTailwindPlugin.js +0 -112
- package/tailwind/v3/plugins/bootstrapTailwindPlugin.js.map +0 -1
- package/tailwind/v3/plugins/fluentTailwindPlugin.d.ts +0 -2
- package/tailwind/v3/plugins/fluentTailwindPlugin.d.ts.map +0 -1
- package/tailwind/v3/plugins/fluentTailwindPlugin.js +0 -63
- package/tailwind/v3/plugins/fluentTailwindPlugin.js.map +0 -1
- package/tailwind/v3/plugins/materialTailwindPlugin.d.ts +0 -2
- package/tailwind/v3/plugins/materialTailwindPlugin.d.ts.map +0 -1
- package/tailwind/v3/plugins/materialTailwindPlugin.js +0 -53
- package/tailwind/v3/plugins/materialTailwindPlugin.js.map +0 -1
- package/tailwind/v3/presets/bootstrapTailwindPresets.d.ts +0 -2
- package/tailwind/v3/presets/bootstrapTailwindPresets.d.ts.map +0 -1
- package/tailwind/v3/presets/bootstrapTailwindPresets.js +0 -101
- package/tailwind/v3/presets/bootstrapTailwindPresets.js.map +0 -1
- package/tailwind/v3/presets/fluentTailwindPresets.d.ts +0 -2
- package/tailwind/v3/presets/fluentTailwindPresets.d.ts.map +0 -1
- package/tailwind/v3/presets/fluentTailwindPresets.js +0 -52
- package/tailwind/v3/presets/fluentTailwindPresets.js.map +0 -1
- package/tailwind/v3/presets/materialTailwindPresets.d.ts +0 -2
- package/tailwind/v3/presets/materialTailwindPresets.d.ts.map +0 -1
- package/tailwind/v3/presets/materialTailwindPresets.js +0 -42
- package/tailwind/v3/presets/materialTailwindPresets.js.map +0 -1
- package/tailwind/v4/bootstrapTailwindPresets.css +0 -86
- package/tailwind/v4/fluentTailwindPresets.css +0 -39
- package/tailwind/v4/materialTailwindPresets.css +0 -29
- package/themes/___bootstrap-tokens.css +0 -91
- package/themes/___fluent-tokens.css +0 -30
- package/themes/___material-tokens.css +0 -22
- package/themes/bootstrap-tokens.scss +0 -89
- package/themes/bootstrap.scss +0 -163
- package/themes/fluent-tokens.scss +0 -28
- package/themes/fluent.scss +0 -1591
- package/themes/material-tokens.scss +0 -20
- package/themes/material.scss +0 -94
package/index.d.ts
CHANGED
|
@@ -31,33 +31,53 @@ declare namespace CssColor {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
|
-
* Represents a
|
|
34
|
+
* Represents the roles available in a theme scheme.
|
|
35
35
|
*
|
|
36
36
|
* @public
|
|
37
37
|
*/
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
type ThemeSchemeRole = 'surface' | 'background' | 'foreground' | 'highlight' | 'middlelight' | 'lowlight' | 'transparent' | 'semiTransparent' | 'disabled' | 'contrast' | 'selection';
|
|
39
|
+
/**
|
|
40
|
+
* Represents a semantic color scheme.
|
|
41
|
+
*
|
|
42
|
+
* ThemeSchemeRole → CssColor
|
|
43
|
+
*
|
|
44
|
+
* @public
|
|
45
|
+
*/
|
|
46
|
+
type ThemeScheme = Readonly<Partial<Record<ThemeSchemeRole, CssColor>>>;
|
|
47
|
+
/**
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
50
|
+
declare namespace ThemeScheme {
|
|
51
|
+
/**
|
|
52
|
+
* Checks whether a value is a ThemeScheme.
|
|
53
|
+
*/
|
|
54
|
+
function isThemeScheme(value: unknown): value is ThemeScheme;
|
|
40
55
|
}
|
|
41
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Represents the shade names available in a theme palette.
|
|
59
|
+
*
|
|
60
|
+
* @public
|
|
61
|
+
*/
|
|
62
|
+
type ThemeShadeName = '0' | '50' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
|
|
42
63
|
/**
|
|
43
64
|
* Represents a dynamic theme palette.
|
|
44
65
|
*
|
|
45
66
|
* @public
|
|
46
67
|
*/
|
|
47
|
-
|
|
48
|
-
[key: string]: CssColor;
|
|
49
|
-
}
|
|
68
|
+
type ThemePalette = Partial<Record<ThemeShadeName, CssColor>>;
|
|
50
69
|
/**
|
|
51
70
|
* @public
|
|
52
71
|
*/
|
|
53
|
-
declare namespace
|
|
72
|
+
declare namespace ThemePalette {
|
|
54
73
|
/**
|
|
55
74
|
* Checks if the value is a theme palette.
|
|
56
75
|
*
|
|
76
|
+
* @public
|
|
57
77
|
* @param value - The value to check.
|
|
58
78
|
* @returns The result.
|
|
59
79
|
*/
|
|
60
|
-
function isThemePalette(value: unknown): value is
|
|
80
|
+
function isThemePalette(value: unknown): value is ThemePalette;
|
|
61
81
|
}
|
|
62
82
|
|
|
63
83
|
/**
|
|
@@ -67,7 +87,11 @@ type CssLengthUnit = 'em' | 'ex' | 'ch' | 'rem' | 'vh' | 'vw' | 'vmin' | 'vmax'
|
|
|
67
87
|
/**
|
|
68
88
|
* @public
|
|
69
89
|
*/
|
|
70
|
-
type
|
|
90
|
+
type CssNumber = `${number}${CssLengthUnit}` | number;
|
|
91
|
+
/**
|
|
92
|
+
* @public
|
|
93
|
+
*/
|
|
94
|
+
type CssLength = `${number}${CssLengthUnit | '%'}` | CssNumber | 'auto';
|
|
71
95
|
declare namespace CssLength {
|
|
72
96
|
/**
|
|
73
97
|
* Determines whether the given value is a valid CSS length.
|
|
@@ -187,14 +211,54 @@ interface IThemeTypographyFontType {
|
|
|
187
211
|
textTransform: 'none' | 'capitalize' | 'uppercase' | 'lowercase';
|
|
188
212
|
}
|
|
189
213
|
|
|
214
|
+
/**
|
|
215
|
+
* Represents the typography type names available in a theme.
|
|
216
|
+
*
|
|
217
|
+
* @public
|
|
218
|
+
*/
|
|
219
|
+
type ThemeTypographyTypeName = 'headline1' | 'headline2' | 'headline3' | 'headline4' | 'headline5' | 'headline6' | 'subtitle1' | 'subtitle2' | 'body1' | 'body2' | 'button' | 'caption' | 'overline';
|
|
190
220
|
/**
|
|
191
221
|
* Represents dynamic typography styles.
|
|
192
222
|
*
|
|
223
|
+
* ThemeTypographyTypeName → IThemeTypographyFontType
|
|
224
|
+
*
|
|
193
225
|
* @public
|
|
194
226
|
*/
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
227
|
+
type ThemeTypography = Partial<Record<ThemeTypographyTypeName, Partial<IThemeTypographyFontType>>>;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Theme mode.
|
|
231
|
+
*
|
|
232
|
+
* @public
|
|
233
|
+
*/
|
|
234
|
+
type ThemeMode = 'dark' | 'light';
|
|
235
|
+
/**
|
|
236
|
+
* Theme mode with system option.
|
|
237
|
+
*
|
|
238
|
+
* @public
|
|
239
|
+
*/
|
|
240
|
+
type ThemeModeWithSystem = ThemeMode | 'system';
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Brand / design-driven semantic colors.
|
|
244
|
+
*
|
|
245
|
+
* @public
|
|
246
|
+
*/
|
|
247
|
+
type ThemeRoleName = 'primary' | 'secondary' | 'tertiary';
|
|
248
|
+
/**
|
|
249
|
+
* State / feedback-driven semantic colors.
|
|
250
|
+
*
|
|
251
|
+
* @public
|
|
252
|
+
*/
|
|
253
|
+
type ThemeStateName = 'danger' | 'warning' | 'success' | 'info' | 'highlight' | 'neutral';
|
|
254
|
+
/**
|
|
255
|
+
* @public
|
|
256
|
+
*/
|
|
257
|
+
type ThemeSemanticName = ThemeRoleName | ThemeStateName;
|
|
258
|
+
/**
|
|
259
|
+
* @public
|
|
260
|
+
*/
|
|
261
|
+
type ThemeSemantic = Record<ThemeSemanticName, ThemePalette>;
|
|
198
262
|
|
|
199
263
|
/**
|
|
200
264
|
* Represents a dynamic theme system.
|
|
@@ -202,22 +266,47 @@ interface IThemeTypography {
|
|
|
202
266
|
* @public
|
|
203
267
|
*/
|
|
204
268
|
interface ITheme {
|
|
269
|
+
/**
|
|
270
|
+
* Human-readable theme name.
|
|
271
|
+
*/
|
|
205
272
|
name: string;
|
|
206
|
-
|
|
207
|
-
|
|
273
|
+
/**
|
|
274
|
+
* Theme color schemes.
|
|
275
|
+
*
|
|
276
|
+
* ThemeMode → ThemeScheme
|
|
277
|
+
*/
|
|
278
|
+
scheme: Readonly<Record<ThemeMode, ThemeScheme>>;
|
|
279
|
+
/**
|
|
280
|
+
* Theme color palettes.
|
|
281
|
+
*
|
|
282
|
+
* ThemeMode → Semantic Color → ThemePalette | CssColor
|
|
283
|
+
*/
|
|
284
|
+
palette: Readonly<Record<ThemeMode, ThemeSemantic>>;
|
|
285
|
+
/**
|
|
286
|
+
* Base font family.
|
|
287
|
+
*/
|
|
208
288
|
fontFamily: string;
|
|
209
|
-
|
|
289
|
+
/**
|
|
290
|
+
* Typography definition.
|
|
291
|
+
*/
|
|
292
|
+
typography: ThemeTypography;
|
|
293
|
+
/**
|
|
294
|
+
* Layout definition.
|
|
295
|
+
*/
|
|
210
296
|
layout: IThemeLayout;
|
|
211
|
-
|
|
297
|
+
/**
|
|
298
|
+
* Elevation definitions.
|
|
299
|
+
*/
|
|
300
|
+
elevation: Readonly<Record<string, IThemeElevation>>;
|
|
212
301
|
}
|
|
213
302
|
/**
|
|
214
303
|
* @public
|
|
215
304
|
*/
|
|
216
305
|
declare namespace ITheme {
|
|
217
|
-
function getScheme(theme: ITheme, mode:
|
|
218
|
-
function getSchemeColor(theme: ITheme, mode:
|
|
219
|
-
function getPalette(theme: ITheme, mode:
|
|
220
|
-
function getPaletteColor(theme: ITheme, mode:
|
|
306
|
+
function getScheme(theme: ITheme, mode: ThemeMode): ThemeScheme;
|
|
307
|
+
function getSchemeColor(theme: ITheme, mode: ThemeMode, role: ThemeSchemeRole): CssColor;
|
|
308
|
+
function getPalette(theme: ITheme, mode: ThemeMode, semanticColor: ThemeSemanticName): ThemePalette;
|
|
309
|
+
function getPaletteColor(theme: ITheme, mode: ThemeMode, semanticColor: ThemeSemanticName, shade: ThemeShadeName): CssColor;
|
|
221
310
|
}
|
|
222
311
|
|
|
223
312
|
/**
|
|
@@ -234,17 +323,6 @@ interface IThemeMetadata {
|
|
|
234
323
|
typographies: Array<string>;
|
|
235
324
|
}
|
|
236
325
|
|
|
237
|
-
declare namespace BootstrapTheme {
|
|
238
|
-
const BOOTSTRAP_THEME: ITheme;
|
|
239
|
-
const BOOTSTRAP_THEME_PALETTES: string[];
|
|
240
|
-
const BOOTSTRAP_THEME_PALETTE_VARIANTS: string[];
|
|
241
|
-
const BOOTSTRAP_THEME_SCHEMES: string[];
|
|
242
|
-
const BOOTSTRAP_THEME_SCHEME_VARIANTS: string[];
|
|
243
|
-
const BOOTSTRAP_THEME_ELEVATION: string[];
|
|
244
|
-
const BOOTSTRAP_THEME_ELEVATION_VARIANTS: string[];
|
|
245
|
-
const BOOTSTRAP_THEME_METADATA: IThemeMetadata;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
326
|
declare namespace JoyTheme {
|
|
249
327
|
const JOY_THEME: ITheme;
|
|
250
328
|
const JOY_THEME_PALETTES: string[];
|
|
@@ -335,15 +413,9 @@ interface IPlatformAdapter {
|
|
|
335
413
|
/**
|
|
336
414
|
* Observes changes to document element attributes.
|
|
337
415
|
*/
|
|
338
|
-
observeDocumentAttributes(attributes: string
|
|
416
|
+
observeDocumentAttributes(attributes: Array<string>, callback: (attributeName: string, newValue: string | null) => void): () => void;
|
|
339
417
|
}
|
|
340
418
|
|
|
341
|
-
/**
|
|
342
|
-
* Theme mode.
|
|
343
|
-
*
|
|
344
|
-
* @public
|
|
345
|
-
*/
|
|
346
|
-
type ThemeMode = 'system' | 'dark' | 'light';
|
|
347
419
|
/**
|
|
348
420
|
* Observer for applying themes.
|
|
349
421
|
*
|
|
@@ -377,7 +449,14 @@ declare class ThemeObserver {
|
|
|
377
449
|
* @readonly
|
|
378
450
|
*/
|
|
379
451
|
get themeModeChanged(): IEventEmitter<ThemeMode>;
|
|
380
|
-
|
|
452
|
+
/**
|
|
453
|
+
* Applies the given theme and theme mode to the document.
|
|
454
|
+
*
|
|
455
|
+
* @public
|
|
456
|
+
* @param theme - The theme to apply (joy, cosmopolitan or memphis).
|
|
457
|
+
* @param themeMode - The theme mode to apply.
|
|
458
|
+
*/
|
|
459
|
+
applyTheme(theme: string, themeMode: ThemeModeWithSystem): void;
|
|
381
460
|
dispose(): void;
|
|
382
461
|
private observe;
|
|
383
462
|
}
|
|
@@ -398,13 +477,45 @@ declare class ThemeGenerator {
|
|
|
398
477
|
private readonly _strategies;
|
|
399
478
|
private readonly _platformAdapter;
|
|
400
479
|
/**
|
|
401
|
-
* @param platformAdapter - Optional platform adapter. Auto-detects if not provided.
|
|
402
480
|
* @public
|
|
481
|
+
* @param platformAdapter - Optional platform adapter. Auto-detects if not provided.
|
|
403
482
|
*/
|
|
404
483
|
constructor(platformAdapter?: IPlatformAdapter);
|
|
405
|
-
|
|
406
|
-
|
|
484
|
+
/**
|
|
485
|
+
* Generates a theme palette.
|
|
486
|
+
*
|
|
487
|
+
* @public
|
|
488
|
+
* @param themeName The name of the theme.
|
|
489
|
+
* @param baseColor The base color (typically a 500 level shade).
|
|
490
|
+
* @param mode The theme mode ('dark', 'light', or 'system').
|
|
491
|
+
* @returns The generated theme palette.
|
|
492
|
+
*/
|
|
493
|
+
generatePalette(themeName: string, baseColor: CssColor, mode: ThemeMode): ThemePalette;
|
|
494
|
+
/**
|
|
495
|
+
* Generates a theme scheme.
|
|
496
|
+
*
|
|
497
|
+
* @public
|
|
498
|
+
* @param themeName The name of the theme.
|
|
499
|
+
* @param baseColor The base color (typically a background level shade).
|
|
500
|
+
* @param mode The theme mode ('dark', 'light', or 'system').
|
|
501
|
+
* @returns The generated theme scheme.
|
|
502
|
+
*/
|
|
503
|
+
generateScheme(themeName: string, baseColor: CssColor, mode: ThemeMode): ThemeScheme;
|
|
504
|
+
/**
|
|
505
|
+
* Resolves the theme mode, converting 'system' to 'dark' or 'light' based on platform settings.
|
|
506
|
+
*
|
|
507
|
+
* @private
|
|
508
|
+
* @param mode The theme mode to resolve.
|
|
509
|
+
* @returns The resolved theme mode.
|
|
510
|
+
*/
|
|
407
511
|
private resolveMode;
|
|
512
|
+
/**
|
|
513
|
+
* Gets the theme generator strategy for the specified theme name.
|
|
514
|
+
*
|
|
515
|
+
* @private
|
|
516
|
+
* @param themeName The name of the theme.
|
|
517
|
+
* @returns The theme generator strategy.
|
|
518
|
+
*/
|
|
408
519
|
private getStrategy;
|
|
409
520
|
}
|
|
410
521
|
/**
|
|
@@ -430,7 +541,7 @@ interface IThemeGeneratorStrategy {
|
|
|
430
541
|
* @param mode - The color mode (dark or light)
|
|
431
542
|
* @returns The generated palette
|
|
432
543
|
*/
|
|
433
|
-
generatePalette(baseColor: CssColor, mode:
|
|
544
|
+
generatePalette(baseColor: CssColor, mode: Omit<ThemeMode, 'system'>): ThemePalette;
|
|
434
545
|
/**
|
|
435
546
|
* Generates a color scheme for the theme.
|
|
436
547
|
*
|
|
@@ -438,7 +549,7 @@ interface IThemeGeneratorStrategy {
|
|
|
438
549
|
* @param mode - The color mode (dark or light)
|
|
439
550
|
* @returns The generated scheme
|
|
440
551
|
*/
|
|
441
|
-
generateScheme(baseColor: CssColor, mode:
|
|
552
|
+
generateScheme(baseColor: CssColor, mode: Omit<ThemeMode, 'system'>): ThemeScheme;
|
|
442
553
|
}
|
|
443
554
|
|
|
444
555
|
/**
|
|
@@ -455,8 +566,24 @@ type ThemeGeneratorFactoryFn = () => IThemeGeneratorStrategy;
|
|
|
455
566
|
*/
|
|
456
567
|
declare class MaterialThemeGeneratorStrategy implements IThemeGeneratorStrategy {
|
|
457
568
|
constructor();
|
|
458
|
-
|
|
459
|
-
|
|
569
|
+
/**
|
|
570
|
+
* Generates a color palette for the Material theme.
|
|
571
|
+
*
|
|
572
|
+
* @public
|
|
573
|
+
* @param baseColor The base/accent color.
|
|
574
|
+
* @param mode 'light' or 'dark' mode.
|
|
575
|
+
* @returns The generated theme palette.
|
|
576
|
+
*/
|
|
577
|
+
generatePalette(baseColor: CssColor, mode: 'dark' | 'light'): ThemePalette;
|
|
578
|
+
/**
|
|
579
|
+
* Generates a semantic color scheme for Material theme usage, based on the generated palette.
|
|
580
|
+
*
|
|
581
|
+
* @public
|
|
582
|
+
* @param baseColor The base/accent color.
|
|
583
|
+
* @param mode 'light' or 'dark' mode.
|
|
584
|
+
* @returns The generated theme scheme.
|
|
585
|
+
*/
|
|
586
|
+
generateScheme(baseColor: CssColor, mode: 'dark' | 'light'): ThemeScheme;
|
|
460
587
|
}
|
|
461
588
|
/**
|
|
462
589
|
* Generates a Material theme generator strategy.
|
|
@@ -474,8 +601,8 @@ declare function createMaterialTheme(): ThemeGeneratorFactoryFn;
|
|
|
474
601
|
declare class JoyThemeGeneratorStrategy implements IThemeGeneratorStrategy {
|
|
475
602
|
private readonly _materialStrategy;
|
|
476
603
|
constructor();
|
|
477
|
-
generatePalette(baseColor: CssColor, mode: 'dark' | 'light'):
|
|
478
|
-
generateScheme(baseColor: CssColor, mode: 'dark' | 'light'):
|
|
604
|
+
generatePalette(baseColor: CssColor, mode: 'dark' | 'light'): ThemePalette;
|
|
605
|
+
generateScheme(baseColor: CssColor, mode: 'dark' | 'light'): ThemeScheme;
|
|
479
606
|
}
|
|
480
607
|
/**
|
|
481
608
|
* Generates a Joy theme generator strategy.
|
|
@@ -493,8 +620,8 @@ declare function createJoyTheme(): ThemeGeneratorFactoryFn;
|
|
|
493
620
|
declare class MemphisThemeGeneratorStrategy implements IThemeGeneratorStrategy {
|
|
494
621
|
private readonly _materialStrategy;
|
|
495
622
|
constructor();
|
|
496
|
-
generatePalette(baseColor: CssColor, mode: 'dark' | 'light'):
|
|
497
|
-
generateScheme(baseColor: CssColor, mode: 'dark' | 'light'):
|
|
623
|
+
generatePalette(baseColor: CssColor, mode: 'dark' | 'light'): ThemePalette;
|
|
624
|
+
generateScheme(baseColor: CssColor, mode: 'dark' | 'light'): ThemeScheme;
|
|
498
625
|
}
|
|
499
626
|
/**
|
|
500
627
|
* Generates a Memphis theme generator strategy.
|
|
@@ -511,8 +638,8 @@ declare function createMemphisTheme(): ThemeGeneratorFactoryFn;
|
|
|
511
638
|
declare class CosmopolitanThemeGeneratorStrategy implements IThemeGeneratorStrategy {
|
|
512
639
|
private readonly _materialStrategy;
|
|
513
640
|
constructor();
|
|
514
|
-
generatePalette(baseColor: CssColor, mode: 'dark' | 'light'):
|
|
515
|
-
generateScheme(baseColor: CssColor, mode: 'dark' | 'light'):
|
|
641
|
+
generatePalette(baseColor: CssColor, mode: 'dark' | 'light'): ThemePalette;
|
|
642
|
+
generateScheme(baseColor: CssColor, mode: 'dark' | 'light'): ThemeScheme;
|
|
516
643
|
}
|
|
517
644
|
/**
|
|
518
645
|
* Generates a Cosmopolitan theme generator strategy.
|
|
@@ -547,13 +674,13 @@ declare class TailwindThemeGeneratorStrategy implements IThemeGeneratorStrategy
|
|
|
547
674
|
* "900": "#0a2d4b"
|
|
548
675
|
* }
|
|
549
676
|
*/
|
|
550
|
-
generatePalette(baseColor: CssColor, mode: 'light' | 'dark'):
|
|
677
|
+
generatePalette(baseColor: CssColor, mode: 'light' | 'dark'): ThemePalette;
|
|
551
678
|
/**
|
|
552
679
|
* Generates a semantic color scheme for UI usage, based on the generated palette.
|
|
553
680
|
*
|
|
554
681
|
* @param baseColor - The base/accent color
|
|
555
682
|
* @param mode - 'light' or 'dark'
|
|
556
|
-
* @returns An
|
|
683
|
+
* @returns An scheme with semantic color roles.
|
|
557
684
|
*
|
|
558
685
|
* Returned keys:
|
|
559
686
|
* - background → shade "50"
|
|
@@ -562,7 +689,7 @@ declare class TailwindThemeGeneratorStrategy implements IThemeGeneratorStrategy
|
|
|
562
689
|
* - accent → shade "700"
|
|
563
690
|
* - muted → shade "300"
|
|
564
691
|
*/
|
|
565
|
-
generateScheme(baseColor: CssColor, mode: 'light' | 'dark'):
|
|
692
|
+
generateScheme(baseColor: CssColor, mode: 'light' | 'dark'): ThemeScheme;
|
|
566
693
|
}
|
|
567
694
|
/**
|
|
568
695
|
* Generates a Tailwind theme generator strategy.
|
|
@@ -581,7 +708,7 @@ declare class BrowserPlatformAdapter implements IPlatformAdapter {
|
|
|
581
708
|
matchMedia(query: string): boolean;
|
|
582
709
|
setDocumentAttribute(name: string, value: string): void;
|
|
583
710
|
getDocumentAttribute(name: string): string | null;
|
|
584
|
-
observeDocumentAttributes(attributes: string
|
|
711
|
+
observeDocumentAttributes(attributes: Array<string>, callback: (attributeName: string, newValue: string | null) => void): () => void;
|
|
585
712
|
}
|
|
586
713
|
|
|
587
714
|
/**
|
|
@@ -594,7 +721,7 @@ declare class NodePlatformAdapter implements IPlatformAdapter {
|
|
|
594
721
|
matchMedia(_query: string): boolean;
|
|
595
722
|
setDocumentAttribute(_name: string, _value: string): void;
|
|
596
723
|
getDocumentAttribute(_name: string): string | null;
|
|
597
|
-
observeDocumentAttributes(_attributes: string
|
|
724
|
+
observeDocumentAttributes(_attributes: Array<string>, _callback: (attributeName: string, newValue: string | null) => void): () => void;
|
|
598
725
|
}
|
|
599
726
|
|
|
600
727
|
/**
|
|
@@ -612,4 +739,75 @@ declare class PlatformAdapterFactory {
|
|
|
612
739
|
static create(): IPlatformAdapter;
|
|
613
740
|
}
|
|
614
741
|
|
|
615
|
-
|
|
742
|
+
/**
|
|
743
|
+
* @public
|
|
744
|
+
*/
|
|
745
|
+
declare function darken(hex: string, factor: number): string;
|
|
746
|
+
/**
|
|
747
|
+
* @public
|
|
748
|
+
*/
|
|
749
|
+
declare function lighten(hex: string, factor: number): string;
|
|
750
|
+
|
|
751
|
+
/**
|
|
752
|
+
* Generate an analogous color palette
|
|
753
|
+
* @param baseHex
|
|
754
|
+
* @param adjustment
|
|
755
|
+
* @returns
|
|
756
|
+
*/
|
|
757
|
+
declare function generateAnalogousPalette(baseHex: string, adjustment: number): Record<string, string>;
|
|
758
|
+
/**
|
|
759
|
+
* Generate a single analogous color
|
|
760
|
+
* @param baseHex
|
|
761
|
+
* @param adjustment
|
|
762
|
+
* @returns
|
|
763
|
+
*/
|
|
764
|
+
declare function generateAnalogousColor(baseHex: string, adjustment: number): string;
|
|
765
|
+
|
|
766
|
+
/**
|
|
767
|
+
* Generates a complementary color palette based on the given base color.
|
|
768
|
+
* @param baseHex
|
|
769
|
+
* @returns
|
|
770
|
+
*/
|
|
771
|
+
declare function generateComplementaryPalette(baseHex: string): Record<string, string>;
|
|
772
|
+
/**
|
|
773
|
+
* Generates a single complementary color based on the given base color.
|
|
774
|
+
* @param baseHex
|
|
775
|
+
* @returns
|
|
776
|
+
*/
|
|
777
|
+
declare function generateComplementaryColor(baseHex: string): string;
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* Generates a material color palette based on the given hex color.
|
|
781
|
+
* @param hexColor
|
|
782
|
+
* @returns
|
|
783
|
+
*/
|
|
784
|
+
declare function generateMaterialPalette(hexColor: string): Record<string, string>;
|
|
785
|
+
|
|
786
|
+
/**
|
|
787
|
+
* Generate a triadic color palette
|
|
788
|
+
* @param baseHex
|
|
789
|
+
* @param adjustment
|
|
790
|
+
* @returns
|
|
791
|
+
*/
|
|
792
|
+
declare function generateTriadicPalette(baseHex: string, adjustment: number): Record<string, string>;
|
|
793
|
+
/**
|
|
794
|
+
* Generate a single triadic color
|
|
795
|
+
* @param baseHex
|
|
796
|
+
* @param adjustment
|
|
797
|
+
* @returns
|
|
798
|
+
*/
|
|
799
|
+
declare function generateTriadicColor(baseHex: string, adjustment: number): string;
|
|
800
|
+
|
|
801
|
+
declare namespace Colors {
|
|
802
|
+
const toDarken: typeof darken;
|
|
803
|
+
const toLighten: typeof lighten;
|
|
804
|
+
const toMaterialPalette: typeof generateMaterialPalette;
|
|
805
|
+
const toComplementaryPalette: typeof generateComplementaryPalette;
|
|
806
|
+
const toComplementaryColor: typeof generateComplementaryColor;
|
|
807
|
+
const toAnalogousPalette: typeof generateAnalogousPalette;
|
|
808
|
+
const toAnalogousColor: typeof generateAnalogousColor;
|
|
809
|
+
const toTriadicPalette: typeof generateTriadicPalette;
|
|
810
|
+
const toTriadicColor: typeof generateTriadicColor;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
export { BrowserPlatformAdapter, Colors, CosmopolitanTheme, CosmopolitanThemeGeneratorStrategy, CssAspectRatio, CssColor, type CssHEXColor, CssLength, type CssLengthUnit, type CssNameColor, type CssNumber, type CssRGBAColor, type CssRGBColor, CssShadow, type CssShadowSingle, CssTime, type CssTimeUnit, type IPlatformAdapter, ITheme, type IThemeElevation, type IThemeGeneratorStrategy, type IThemeLayout, type IThemeMetadata, type IThemeTypographyFontType, JoyTheme, JoyThemeGeneratorStrategy, MaterialThemeGeneratorStrategy, MemphisTheme, MemphisThemeGeneratorStrategy, NodePlatformAdapter, PlatformAdapterFactory, TailwindThemeGeneratorStrategy, ThemeGenerator, ThemeGeneratorServiceLocator, type ThemeMode, ThemeObserver, ThemeObserverServiceLocator, ThemePalette, type ThemeRoleName, ThemeScheme, type ThemeSchemeRole, type ThemeSemantic, type ThemeSemanticName, type ThemeShadeName, type ThemeStateName, type ThemeTypography, type ThemeTypographyTypeName, createCosmopolitanTheme, createJoyTheme, createMaterialTheme, createMemphisTheme, createTailwindTheme };
|