-
-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Expand file tree
/
Copy pathtokens.ts
More file actions
269 lines (243 loc) · 8.89 KB
/
Copy pathtokens.ts
File metadata and controls
269 lines (243 loc) · 8.89 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
/**
* Design Tokens for Agentflow
*
* Single source of truth for all design values (colors, spacing, shadows, etc.)
* These tokens are used by both MUI theme and CSS variables.
*
* Architecture:
* 1. Base colors - Primitive color values (single source of truth)
* 2. Semantic colors - Referenced from base colors for consistency
*/
// Base primitive colors - define once, reference everywhere
const baseColors = {
// Neutral colors
white: '#fff',
black: '#000',
// Light mode grays
gray50: '#fafafa',
gray75: '#f5f5f5',
gray100: '#f8f9fa',
gray200: '#e2e2e2',
gray300: '#e0e0e0',
gray400: '#bdbdbd',
gray500: '#9e9e9e',
gray600: '#757575',
gray700: '#666',
gray800: '#333',
// Dark mode grays
darkBorderDefault: 'rgba(255, 255, 255, 0.145)',
darkGray100: '#1a1a1a',
darkGray200: '#1a1a2e',
darkGray300: '#252525',
darkGray350: '#23262c',
darkGray400: '#2d2d2d',
darkGray450: '#32353b',
darkGray500: '#404040',
darkBlueHover: '#233345',
darkGray600: '#525252',
darkGray700: '#555',
darkGray750: '#888',
darkGray800: '#aaa',
// Status colors
success: '#4caf50',
error: '#f44336',
warning: '#ff9800',
warningBg: '#fefcbf',
warningText: '#744210',
info: '#2196f3',
// MUI palette colors - primary (blue)
primaryLight: '#e3f2fd',
primaryMain: '#2196f3',
primaryDark: '#1e88e5',
// MUI palette colors - secondary (purple)
secondaryLight: '#ede7f6',
secondaryMain: '#673ab7',
secondaryDark: '#5e35b1',
// MUI palette colors - success (green)
successLight: '#cdf5d8',
successMain: '#00e676',
successDark: '#00c853',
// MUI palette colors - error (red)
errorLight: '#f3d2d2',
errorMain: '#f44336',
errorDark: '#c62828',
// MUI palette colors - warning (yellow)
warningLight: '#fff8e1',
warningMain: '#ffe57f',
warningDark: '#ffc107',
// Node type colors (brand colors)
nodeCondition: '#FFB938',
nodeStart: '#7EE787',
nodeLlm: '#64B5F6',
nodeAgent: '#4DD0E1',
nodeHumanInput: '#6E6EFD',
nodeLoop: '#FFA07A',
nodeDirectReply: '#4DDBBB',
nodeCustomFunction: '#E4B7FF',
nodeTool: '#d4a373',
nodeRetriever: '#b8bedd',
nodeConditionAgent: '#ff8fab',
nodeStickyNote: '#fee440',
nodeHttp: '#FF7F7F',
nodeIteration: '#9C89B8',
nodeExecuteFlow: '#a3b18a',
// Gradient colors
gradientOrange: '#FF6B6B',
gradientRed: '#FF8E53'
} as const
export const tokens = {
colors: {
// Node type colors - referenced from base
nodes: {
condition: baseColors.nodeCondition,
start: baseColors.nodeStart,
llm: baseColors.nodeLlm,
agent: baseColors.nodeAgent,
humanInput: baseColors.nodeHumanInput,
loop: baseColors.nodeLoop,
directReply: baseColors.nodeDirectReply,
customFunction: baseColors.nodeCustomFunction,
tool: baseColors.nodeTool,
retriever: baseColors.nodeRetriever,
conditionAgent: baseColors.nodeConditionAgent,
stickyNote: baseColors.nodeStickyNote,
http: baseColors.nodeHttp,
iteration: baseColors.nodeIteration,
executeFlow: baseColors.nodeExecuteFlow
},
// Semantic UI colors - referenced from base
background: {
canvas: { light: baseColors.gray100, dark: baseColors.darkGray100 },
palette: { light: baseColors.gray50, dark: baseColors.darkGray300 },
card: { light: baseColors.white, dark: baseColors.darkGray350 },
cardHover: { light: baseColors.gray75, dark: baseColors.darkGray500 },
header: { light: baseColors.white, dark: baseColors.darkGray400 },
input: { light: baseColors.white, dark: baseColors.darkGray450 },
optionHover: { light: '', dark: baseColors.darkBlueHover }
},
border: {
default: { light: baseColors.gray300, dark: baseColors.darkBorderDefault },
hover: { light: baseColors.gray400, dark: baseColors.darkGray600 },
input: { light: baseColors.gray400, dark: baseColors.darkGray750 },
validation: baseColors.nodeCondition
},
text: {
primary: { light: baseColors.gray800, dark: baseColors.white },
secondary: { light: baseColors.gray700, dark: baseColors.gray500 },
tertiary: { light: baseColors.gray600, dark: baseColors.gray500 }
},
// MUI theme palette colors - referenced from base
palette: {
primary: {
light: baseColors.primaryLight,
main: baseColors.primaryMain,
dark: baseColors.primaryDark
},
secondary: {
light: baseColors.secondaryLight,
main: baseColors.secondaryMain,
dark: baseColors.secondaryDark
},
success: {
light: baseColors.successLight,
main: baseColors.successMain,
dark: baseColors.successDark
},
error: {
light: baseColors.errorLight,
main: baseColors.errorMain,
dark: baseColors.errorDark
},
warning: {
light: baseColors.warningLight,
main: baseColors.warningMain,
dark: baseColors.warningDark
}
},
// Semantic status colors - referenced from base
semantic: {
success: baseColors.success,
error: baseColors.error,
warning: baseColors.warning,
warningBg: baseColors.warningBg,
warningText: baseColors.warningText,
info: baseColors.info
},
// ReactFlow specific colors - referenced from base
reactflow: {
minimap: {
node: { light: baseColors.gray200, dark: baseColors.darkGray400 },
nodeStroke: { light: baseColors.white, dark: baseColors.darkGray600 },
background: { light: baseColors.white, dark: baseColors.darkGray200 },
mask: { light: 'rgba(240, 240, 240, 0.6)', dark: 'rgba(45, 45, 45, 0.6)' }
},
background: {
dots: { light: baseColors.darkGray800, dark: baseColors.darkGray700 }
}
},
// Syntax highlight colors for code blocks (TipTap/lowlight)
syntaxHighlight: {
background: { light: '#f5f5f5', dark: '#2d2d2d' },
text: { light: '#333333', dark: '#d4d4d4' },
comment: { light: '#6a9955', dark: '#6a9955' },
variable: { light: '#d73a49', dark: '#9cdcfe' },
number: { light: '#e36209', dark: '#b5cea8' },
string: { light: '#22863a', dark: '#ce9178' },
title: { light: '#6f42c1', dark: '#dcdcaa' },
keyword: { light: '#005cc5', dark: '#569cd6' },
operator: { light: '#333333', dark: '#d4d4d4' },
punctuation: { light: '#333333', dark: '#d4d4d4' }
},
// Gradient definitions - referenced from base
gradients: {
generate: {
default: `linear-gradient(45deg, ${baseColors.gradientOrange} 30%, ${baseColors.gradientRed} 90%)`,
hover: `linear-gradient(45deg, ${baseColors.gradientRed} 30%, ${baseColors.gradientOrange} 90%)`
}
}
},
// Spacing scale (based on MUI's 8px base unit)
spacing: {
xs: 4, // 0.5 * 8px
sm: 8, // 1 * 8px
md: 12, // 1.5 * 8px
lg: 16, // 2 * 8px
xl: 20, // 2.5 * 8px
xxl: 24 // 3 * 8px
},
// Shadow definitions
shadows: {
card: '0 2px 8px rgba(0, 0, 0, 0.1)',
toolbar: {
light: '0 2px 14px 0 rgb(32 40 45 / 8%)',
dark: '0 2px 14px 0 rgb(0 0 0 / 20%)'
},
minimap: '0 2px 8px rgba(0, 0, 0, 0.1)',
controls: '0 2px 8px rgba(0, 0, 0, 0.1)',
stickyNote: '0 2px 4px rgba(0, 0, 0, 0.1)'
},
// Typography
typography: {
/** Matches MUI OutlinedInput's default line-height (1.4375em) so the
* RichTextEditor aligns with standard TextField height at the same row count. */
rowHeightRem: 1.4375,
/** Single-line editor height — approximates MUI small input (38.4px) */
singleLineHeightRem: 2.4,
/** Tighter line-height for single-line mode to vertically center text */
singleLineLineHeightEm: 0.875
},
// Border radius scale
borderRadius: {
sm: 4,
md: 8,
lg: 12,
round: '50%'
},
// Z-index scale for canvas overlay elements.
// All values sit below the Canvas Kit modal overlay (30–50).
zIndex: {
canvasButton: 10, // FABs and button containers
canvasPanel: 20 // Open panels/poppers anchored to buttons
}
} as const
export type Tokens = typeof tokens