@invana/styling 0.0.7 → 0.0.12

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.
@@ -18,52 +18,32 @@ export interface Theme {
18
18
  }
19
19
 
20
20
  /**
21
- * Theme Presets contributed as first-class themes. Unlike the classic themes
22
- * (which vary by light/dark/system), each preset is a single mode and its
23
- * selectable accent swatches become the "variant" axis — e.g. theme `dark-gold`
24
- * with variants `dark-gold-gold`, `dark-gold-ocean`, … The colours for every
25
- * combination are plain CSS in `themes/presets.css`; only the ids/names/modes
26
- * are listed here so they register with the toolbar and `applyTheme()`.
21
+ * Colour-preset themes contributed as first-class themes. Each preset is a named
22
+ * palette (Gold, Ocean, Forest, Rose, Minimal) carrying its own signature accent,
23
+ * and — like the classic themes — varies by light/dark/system. The variants are
24
+ * `${id}-light`, `${id}-dark`, `${id}-system`; the colours for the light and dark
25
+ * blocks are plain CSS in `themes/presets.css`. Only the ids/names/modes are
26
+ * listed here so they register with the toolbar and `applyTheme()`.
27
27
  */
28
- const DARK_ACCENTS: [string, string][] = [
29
- ['gold', 'Gold'], ['ocean', 'Ocean'], ['emerald', 'Emerald'], ['rose', 'Rose'],
30
- ['purple', 'Purple'], ['amber', 'Amber'], ['teal', 'Teal'], ['silver', 'Silver'],
31
- ];
32
- const LIGHT_ACCENTS: [string, string][] = [
33
- ['indigo', 'Indigo'], ['ocean', 'Ocean'], ['emerald', 'Emerald'], ['rose', 'Rose'],
34
- ['purple', 'Purple'], ['amber', 'Amber'], ['teal', 'Teal'], ['slate', 'Slate'],
35
- ];
36
-
37
- // `default` is each preset's signature accent. It is
38
- // placed FIRST so it becomes the theme's default variant (variants[0]) — the value
39
- // consumers fall back to when no accent is specified.
40
- const PRESET_THEMES: { id: string; name: string; dark: boolean; accents: [string, string][]; default: string }[] = [
41
- { id: 'dark-gold', name: 'Dark Gold', dark: true, accents: DARK_ACCENTS, default: 'gold' },
42
- { id: 'dark-ocean', name: 'Dark Ocean', dark: true, accents: DARK_ACCENTS, default: 'ocean' },
43
- { id: 'dark-forest', name: 'Dark Forest', dark: true, accents: DARK_ACCENTS, default: 'emerald' },
44
- { id: 'dark-rose', name: 'Dark Rose', dark: true, accents: DARK_ACCENTS, default: 'rose' },
45
- { id: 'light-minimal', name: 'Light Minimal', dark: false, accents: LIGHT_ACCENTS, default: 'indigo' },
28
+ const PRESET_THEMES: { id: string; name: string; description: string }[] = [
29
+ { id: 'gold', name: 'Gold', description: 'Warm gold accent — near-black canvas (dark) or cream (light)' },
30
+ { id: 'ocean', name: 'Ocean', description: 'Cool blue accent — deep navy canvas (dark) or soft sky-grey (light)' },
31
+ { id: 'forest', name: 'Forest', description: 'Emerald accent — deep green-black canvas (dark) or pale green (light)' },
32
+ { id: 'rose', name: 'Rose', description: 'Rose accent — warm near-black canvas (dark) or blush (light)' },
33
+ { id: 'minimal', name: 'Minimal', description: 'Indigo accent on a clean neutral canvas, light or dark' },
46
34
  ];
47
35
 
48
36
  function buildPresetThemes(): Theme[] {
49
- return PRESET_THEMES.map((p) => {
50
- // Signature accent first → it becomes variants[0] (the theme's default).
51
- const ordered = [
52
- ...p.accents.filter(([id]) => id === p.default),
53
- ...p.accents.filter(([id]) => id !== p.default),
54
- ];
55
- return {
56
- id: p.id,
57
- name: p.name,
58
- description: `${p.name} preset — pick an accent swatch (${p.dark ? 'dark' : 'light'} mode)`,
59
- variants: ordered.map(([accentId, accentName]) => ({
60
- id: `${p.id}-${accentId}`,
61
- name: accentName,
62
- mode: (p.dark ? 'dark' : 'light') as ThemeVariant['mode'],
63
- icon: 'circle',
64
- })),
65
- };
66
- });
37
+ return PRESET_THEMES.map((p) => ({
38
+ id: p.id,
39
+ name: p.name,
40
+ description: p.description,
41
+ variants: [
42
+ { id: `${p.id}-light`, name: `${p.name} Light`, mode: 'light', icon: 'sun' },
43
+ { id: `${p.id}-dark`, name: `${p.name} Dark`, mode: 'dark', icon: 'moon' },
44
+ { id: `${p.id}-system`, name: `${p.name} System`, mode: 'system', icon: 'circle' },
45
+ ],
46
+ }));
67
47
  }
68
48
 
69
49
  export const themes: Theme[] = [