Skip to content

Commit 3731fc6

Browse files
committed
refactor(themes): improve Sunset and Terracotta theme accuracy
Update Sunset theme colors to match name and Coana branding: - Change from azure blue to warm orange/purple gradient - Primary: #FF8C64 (warm orange) - Secondary: #C864B4 (purple/pink) - Add purple-to-orange shimmer effect - Update link and step colors to use warm palette Rename Brick theme to Terracotta: - More descriptive name matching the actual terracotta color - Update theme name from 'brick' to 'terracotta' - Update BRICK_THEME constant to TERRACOTTA_THEME - Update all references in docs, tests, and examples
1 parent 252444f commit 3731fc6

File tree

5 files changed

+87
-76
lines changed

5 files changed

+87
-76
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5454

5555
### Added
5656

57-
- Theme system with 5 built-in themes: `socket`, `sunset`, `brick`, `lush`, `ultra`
57+
- Theme system with 5 built-in themes: `socket`, `sunset`, `terracotta`, `lush`, `ultra`
5858
- `setTheme()`, `getTheme()`, `withTheme()`, `withThemeSync()` for theme management
5959
- `createTheme()`, `extendTheme()`, `resolveColor()` helper functions
6060
- `onThemeChange()` event listener for theme reactivity

docs/themes.md

Lines changed: 60 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ Socket Lib provides a comprehensive theming system for consistent branding acros
66

77
| Theme | Use Case | Primary Color | Special Effects |
88
|-------|----------|---------------|-----------------|
9-
| **`socket`** (default) | Socket Security | Purple `#8C52FF` | Subtle shimmer |
10-
| **`coana`** | Coana analysis | Azure blue | Clean dots |
11-
| **`socket-firewall`** | Firewall security | Orange/Ember | Security warnings |
12-
| **`socket-cli-python`** | Python CLI | Steel blue + Gold | Python branding |
13-
| **`ultra`** | Celebrations 🎉 | 🌈 Rainbow | Maximum flair |
9+
| **`socket`** (default) | Socket Security | Violet `#8C52FF` | Subtle shimmer |
10+
| **`sunset`** | Vibrant twilight | Orange `#FF8C64` + Pink `#C864B4` | Purple-to-orange gradient |
11+
| **`terracotta`** | Solid warmth | Terracotta `#FF6432` | Rich shimmer |
12+
| **`lush`** | Steel elegance | Steel blue `#4682B4` + Gold `#FFD700` | Elegant harmony |
13+
| **`ultra`** | Premium intensity | 🌈 Prismatic | Rainbow shimmer |
1414

1515
### Quick Start
1616

1717
```typescript
1818
import { setTheme, Spinner } from '@socketsecurity/lib'
1919

20-
setTheme('socket-firewall') // Set once at startup
20+
setTheme('terracotta') // Set once at startup
2121
const spinner = Spinner({ text: 'Scanning...' })
22-
spinner.start() // Uses firewall theme automatically
22+
spinner.start() // Uses terracotta theme automatically
2323
```
2424

2525
---
@@ -71,15 +71,15 @@ Themes use a stack model for temporary changes:
7171
// ┌──────────┐
7272
// │ ultra │ ← popTheme() removes this
7373
// ├──────────┤
74-
//coana │ ← pushTheme() adds here
74+
//sunset │ ← pushTheme() adds here
7575
// ├──────────┤
7676
// │ socket │ ← Base theme
7777
// └──────────┘
7878

79-
pushTheme('coana') // Add to stack
79+
pushTheme('sunset') // Add to stack
8080
pushTheme('ultra') // Add another
81-
popTheme() // Remove ultra → back to coana
82-
popTheme() // Remove coana → back to socket
81+
popTheme() // Remove ultra → back to sunset
82+
popTheme() // Remove sunset → back to socket
8383
```
8484

8585
### 🎯 Scoped Themes (Recommended)
@@ -89,22 +89,22 @@ Use `withTheme()` for automatic cleanup:
8989
```typescript
9090
import { withTheme } from '@socketsecurity/lib/themes'
9191

92-
// Before: coana theme
92+
// Before: sunset theme
9393
await withTheme('ultra', async () => {
9494
// Inside: ultra theme 🌈
9595
const spinner = Spinner({ text: 'MAXIMUM POWER!' })
9696
await epicOperation()
9797
})
98-
// After: coana theme (auto-restored)
98+
// After: sunset theme (auto-restored)
9999
```
100100

101101
**Visual Flow:**
102102
```
103-
Normal Flow → [coana] → [coana] → [coana]
103+
Normal Flow → [sunset] → [sunset] → [sunset]
104104
105-
withTheme() → [coana] → [ultra] → [coana]
106-
↑─────────↑
107-
Auto-restore
105+
withTheme() → [sunset] → [ultra] → [sunset]
106+
↑─────────↑
107+
Auto-restore
108108
```
109109

110110
---
@@ -119,10 +119,10 @@ setTheme('socket')
119119

120120
| Attribute | Value |
121121
|-----------|-------|
122-
| **Primary Color** | `#8C52FF` (Purple) |
122+
| **Primary Color** | `#8C52FF` (Refined violet) |
123123
| **Best For** | Socket.dev tools, security scanning |
124124
| **Spinner** | Socket style with subtle shimmer |
125-
| **Visual Style** | Professional, focused, elegant |
125+
| **Visual Style** | Signature theme designed for focus and elegance |
126126

127127
**Preview:**
128128
```
@@ -132,44 +132,48 @@ setTheme('socket')
132132
→ Installing dependencies... # Cyan
133133
```
134134

135-
### 🔵 Coana
135+
### 🌅 Sunset
136136

137137
```typescript
138-
setTheme('coana')
138+
setTheme('sunset')
139139
```
140140

141141
| Attribute | Value |
142142
|-----------|-------|
143-
| **Primary Color** | `#64C8FF` (Azure blue) |
144-
| **Best For** | Code analysis, static analysis tools |
143+
| **Primary Color** | `#FF8C64` (Warm orange) |
144+
| **Secondary Color** | `#C864B4` (Purple/pink) |
145+
| **Best For** | Coana branding, warm interfaces, twilight aesthetics |
145146
| **Spinner** | Dots style, clean animations |
146-
| **Visual Style** | Analytical, precise, professional |
147+
| **Effects** | Purple-to-orange gradient shimmer |
148+
| **Visual Style** | Vibrant twilight gradient with warm sunset tones |
147149

148-
### 🟠 Socket Firewall
150+
### 🟠 Terracotta
149151

150152
```typescript
151-
setTheme('socket-firewall')
153+
setTheme('terracotta')
152154
```
153155

154156
| Attribute | Value |
155157
|-----------|-------|
156-
| **Primary Color** | `#FF6432` (Ember orange) |
157-
| **Best For** | Security tools, threat detection |
158-
| **Spinner** | Socket style with emphasis |
159-
| **Visual Style** | Vigilant, protective, alert |
158+
| **Primary Color** | `#FF6432` (Terracotta) |
159+
| **Secondary Color** | `#FF9664` (Light terracotta) |
160+
| **Best For** | Grounded confidence, warm interfaces |
161+
| **Spinner** | Socket style with rich shimmer |
162+
| **Visual Style** | Solid theme with rich terracotta and ember warmth |
160163

161-
### 🔷 Socket CLI Python
164+
### 🔷 Lush
162165

163166
```typescript
164-
setTheme('socket-cli-python')
167+
setTheme('lush')
165168
```
166169

167170
| Attribute | Value |
168171
|-----------|-------|
169172
| **Primary Color** | `#4682B4` (Steel blue) |
170173
| **Secondary Color** | `#FFD700` (Gold) |
171-
| **Best For** | Python package management |
172-
| **Visual Style** | Python-inspired elegance |
174+
| **Best For** | Elegant interfaces, harmonious design |
175+
| **Spinner** | Dots style, clean animations |
176+
| **Visual Style** | Elegant theme with steel blue and golden harmony |
173177

174178
### 🌈 Ultra
175179

@@ -179,16 +183,17 @@ setTheme('ultra')
179183

180184
| Attribute | Value |
181185
|-----------|-------|
182-
| **Primary Color** | Rainbow gradient |
183-
| **Best For** | Celebrations, special moments 🎉 |
184-
| **Effects** | Maximum shimmer, rainbow everything |
185-
| **Visual Style** | Exciting, joyful, maximum flair |
186+
| **Primary Color** | `#8C52FF` with rainbow shimmer |
187+
| **Best For** | Deep analysis, premium experiences |
188+
| **Effects** | Prismatic shimmer, bidirectional rainbow |
189+
| **Spinner** | Socket style with rainbow effects |
190+
| **Visual Style** | Premium intensity where complexity meets elegance |
186191

187192
**When to use Ultra:**
188-
- Successful completion of long operations
189-
- Milestone celebrations
190-
- Demo/presentation mode
191-
- April Fools' Day 😄
193+
- Complex analysis operations
194+
- Premium feature demonstrations
195+
- Deep diagnostic sessions
196+
- Maximum visual impact needed
192197

193198
---
194199

@@ -203,7 +208,7 @@ Set global theme (use at app startup)
203208
import { setTheme } from '@socketsecurity/lib/themes'
204209

205210
// By name
206-
setTheme('socket-firewall')
211+
setTheme('terracotta')
207212

208213
// By custom object
209214
setTheme(myCustomTheme)
@@ -241,7 +246,7 @@ Auto-managed theme scope (async)
241246
```typescript
242247
import { withTheme } from '@socketsecurity/lib/themes'
243248

244-
await withTheme('coana', async () => {
249+
await withTheme('sunset', async () => {
245250
await doAnalysis()
246251
})
247252
// Theme auto-restored
@@ -253,7 +258,7 @@ Auto-managed theme scope (sync)
253258
```typescript
254259
import { withThemeSync } from '@socketsecurity/lib/themes'
255260

256-
const result = withThemeSync('socket-firewall', () => {
261+
const result = withThemeSync('terracotta', () => {
257262
return processSecurity()
258263
})
259264
```
@@ -346,18 +351,18 @@ Logger symbols use theme colors:
346351
```typescript
347352
import { logger, setTheme } from '@socketsecurity/lib'
348353

349-
setTheme('socket-firewall')
354+
setTheme('terracotta')
350355

351-
logger.success('Firewall enabled') // ✓ in green
352-
logger.error('Threat detected') // ✗ in red
356+
logger.success('Build complete') // ✓ in green
357+
logger.error('Build failed') // ✗ in red
353358
logger.warn('Update available') // ⚠ in yellow
354359
logger.info('System status: OK') // ℹ in blue
355360
```
356361

357362
**Output Preview:**
358363
```
359-
Firewall enabled # Theme success color
360-
Threat detected # Theme error color
364+
Build complete # Theme success color
365+
Build failed # Theme error color
361366
⚠ Update available # Theme warning color
362367
ℹ System status: OK # Theme info color
363368
```
@@ -374,7 +379,7 @@ console.log(link('Documentation', 'https://socket.dev'))
374379

375380
// Override theme
376381
console.log(link('API', 'https://api.socket.dev', {
377-
theme: 'coana'
382+
theme: 'sunset'
378383
}))
379384

380385
// Show URL fallback
@@ -445,10 +450,10 @@ colors: {
445450
import { setTheme, Spinner } from '@socketsecurity/lib'
446451

447452
// Set theme once at startup
448-
setTheme('socket-firewall')
453+
setTheme('terracotta')
449454

450455
// All components inherit theme
451-
const spinner = Spinner({ text: 'Scanning for threats...' })
456+
const spinner = Spinner({ text: 'Building project...' })
452457
spinner.start()
453458
```
454459

@@ -601,8 +606,8 @@ colors: {
601606
}
602607

603608
// Changes automatically when theme changes!
604-
setTheme('coana') // Links become blue
605-
setTheme('firewall') // Links become orange
609+
setTheme('sunset') // Links become warm orange
610+
setTheme('terracotta') // Links become warm peachy coral (secondary)
606611
```
607612

608613
### Q: Theme not restoring after crash?

src/themes/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* import { setTheme, THEMES } from '@socketsecurity/lib/themes'
88
*
99
* // Set global theme
10-
* setTheme('brick')
10+
* setTheme('terracotta')
1111
* ```
1212
*
1313
* @example
@@ -55,10 +55,10 @@ export type {
5555

5656
// Curated themes
5757
export {
58-
BRICK_THEME,
5958
LUSH_THEME,
6059
SOCKET_THEME,
6160
SUNSET_THEME,
61+
TERRACOTTA_THEME,
6262
THEMES,
6363
ULTRA_THEME,
6464
type ThemeName,

src/themes/themes.ts

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,44 +47,50 @@ export const SOCKET_THEME: Theme = {
4747
}
4848

4949
/**
50-
* Sunset — Crisp azure.
51-
* Clean analytical theme with precise blue tones.
50+
* Sunset — Vibrant twilight gradient.
51+
* Warm sunset palette with orange and purple/pink tones.
5252
*/
5353
export const SUNSET_THEME: Theme = {
5454
name: 'sunset',
5555
displayName: 'Sunset',
5656
colors: {
57-
primary: [100, 200, 255],
58-
secondary: [50, 150, 200],
57+
primary: [255, 140, 100],
58+
secondary: [200, 100, 180],
5959
success: 'greenBright',
6060
error: 'redBright',
6161
warning: 'yellowBright',
62-
info: 'blueBright',
63-
step: 'cyanBright',
62+
info: 'magentaBright',
63+
step: 'primary',
6464
text: 'white',
6565
textDim: 'gray',
66-
link: 'cyanBright',
66+
link: 'primary',
6767
prompt: 'primary',
6868
},
6969
effects: {
7070
spinner: {
7171
color: 'primary',
7272
style: 'dots',
7373
},
74+
shimmer: {
75+
enabled: true,
76+
color: ['secondary', 'primary'],
77+
direction: 'ltr',
78+
speed: 0.4,
79+
},
7480
},
7581
meta: {
76-
description: 'Crisp azure theme for precision and clarity',
77-
version: '1.0.0',
82+
description: 'Warm sunset theme with purple-to-orange gradient',
83+
version: '2.0.0',
7884
},
7985
}
8086

8187
/**
82-
* Brick — Solid warmth.
88+
* Terracotta — Solid warmth.
8389
* Rich terracotta and ember tones for grounded confidence.
8490
*/
85-
export const BRICK_THEME: Theme = {
86-
name: 'brick',
87-
displayName: 'Brick',
91+
export const TERRACOTTA_THEME: Theme = {
92+
name: 'terracotta',
93+
displayName: 'Terracotta',
8894
colors: {
8995
primary: [255, 100, 50],
9096
secondary: [255, 150, 100],
@@ -192,7 +198,7 @@ export const THEMES = {
192198
__proto__: null,
193199
socket: SOCKET_THEME,
194200
sunset: SUNSET_THEME,
195-
brick: BRICK_THEME,
201+
terracotta: TERRACOTTA_THEME,
196202
lush: LUSH_THEME,
197203
ultra: ULTRA_THEME,
198204
} as const

test/isolated/themes.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe('themes', () => {
2929
it('should have all default themes', () => {
3030
expect(THEMES).toHaveProperty('socket')
3131
expect(THEMES).toHaveProperty('sunset')
32-
expect(THEMES).toHaveProperty('brick')
32+
expect(THEMES).toHaveProperty('terracotta')
3333
expect(THEMES).toHaveProperty('lush')
3434
expect(THEMES).toHaveProperty('ultra')
3535
})
@@ -53,8 +53,8 @@ describe('themes', () => {
5353
})
5454

5555
it('should set theme by object', () => {
56-
setTheme(THEMES['brick'])
57-
expect(getTheme().name).toBe('brick')
56+
setTheme(THEMES['terracotta'])
57+
expect(getTheme().name).toBe('terracotta')
5858
})
5959

6060
it('should default to socket theme', () => {
@@ -129,7 +129,7 @@ describe('themes', () => {
129129

130130
it('should resolve secondary color reference', () => {
131131
const resolved = resolveColor('secondary', THEMES.sunset.colors)
132-
expect(resolved).toEqual([50, 150, 200])
132+
expect(resolved).toEqual([200, 100, 180])
133133
})
134134

135135
it('should resolve secondary to primary if not defined', () => {

0 commit comments

Comments
 (0)