-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
111 lines (98 loc) · 2.46 KB
/
types.ts
File metadata and controls
111 lines (98 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/**
* @fileoverview Elegant theme type system.
* Type-safe theming for spinners, loggers, prompts, and links.
*/
import type { ColorValue } from '../colors'
import type { SpinnerStyle } from '../spinner'
import type { ShimmerDirection } from '../effects/text-shimmer'
/**
* Color reference — direct value or semantic keyword.
* Keywords: 'primary', 'secondary', 'inherit', 'rainbow'
*/
export type ColorReference =
| ColorValue
| 'primary'
| 'secondary'
| 'inherit'
| 'rainbow'
/**
* Theme color palette — semantic colors for visual harmony.
*/
export type ThemeColors = {
/** Primary brand identity */
primary: ColorValue
/** Secondary accent (optional) */
secondary?: ColorValue | undefined
/** Success indicator ✓ */
success: ColorValue
/** Error indicator ✗ */
error: ColorValue
/** Warning indicator ⚠ */
warning: ColorValue
/** Information indicator ℹ */
info: ColorValue
/** Progress indicator → */
step: ColorValue
/** Primary text */
text: ColorValue
/** Dimmed text */
textDim: ColorValue
/** Hyperlinks */
link: ColorReference
/** Interactive prompts */
prompt: ColorReference
}
/**
* Theme effects — animations and visual enhancements.
*/
export type ThemeEffects = {
/** Spinner configuration */
spinner?: {
/** Color (supports theme references) */
color?: ColorReference | undefined
/** Animation style */
style?: SpinnerStyle | string | undefined
}
/** Shimmer configuration */
shimmer?: {
/** Enable shimmer */
enabled?: boolean | undefined
/** Color (single, gradient, or keyword) */
color?: ColorReference | ColorValue[] | undefined
/** Direction */
direction?: ShimmerDirection | undefined
/** Speed (steps per frame) */
speed?: number | undefined
}
/** Pulse configuration */
pulse?: {
/** Speed (milliseconds) */
speed?: number | undefined
}
}
/**
* Theme metadata — descriptive information.
*/
export type ThemeMeta = {
/** Description */
description?: string | undefined
/** Author */
author?: string | undefined
/** Version */
version?: string | undefined
}
/**
* Theme definition — complete visual identity.
*/
export type Theme = {
/** Unique identifier (kebab-case) */
name: string
/** Display name */
displayName: string
/** Color palette */
colors: ThemeColors
/** Visual effects (optional) */
effects?: ThemeEffects | undefined
/** Metadata (optional) */
meta?: ThemeMeta | undefined
}