@rendiv/studio 0.1.0

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/ui/styles.ts ADDED
@@ -0,0 +1,283 @@
1
+ import type { CSSProperties } from 'react';
2
+
3
+ // Color palette (GitHub dark theme inspired)
4
+ export const colors = {
5
+ bg: '#0d1117',
6
+ surface: '#161b22',
7
+ surfaceHover: '#1c2128',
8
+ border: '#30363d',
9
+ textPrimary: '#e6edf3',
10
+ textSecondary: '#8b949e',
11
+ accent: '#58a6ff',
12
+ accentMuted: '#1f6feb',
13
+ badge: '#238636',
14
+ badgeStill: '#8957e5',
15
+ error: '#f85149',
16
+ };
17
+
18
+ export const fonts = {
19
+ sans: 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
20
+ mono: '"SF Mono", "Fira Code", Consolas, "Liberation Mono", Menlo, monospace',
21
+ };
22
+
23
+ export const layoutStyles: Record<string, CSSProperties> = {
24
+ root: {
25
+ display: 'flex',
26
+ flexDirection: 'column',
27
+ height: '100vh',
28
+ backgroundColor: colors.bg,
29
+ color: colors.textPrimary,
30
+ fontFamily: fonts.sans,
31
+ fontSize: 13,
32
+ },
33
+ body: {
34
+ display: 'flex',
35
+ flex: 1,
36
+ overflow: 'hidden',
37
+ },
38
+ timeline: {
39
+ flexShrink: 0,
40
+ minHeight: 120,
41
+ overflow: 'hidden',
42
+ display: 'flex',
43
+ flexDirection: 'column',
44
+ },
45
+ timelineResizeHandle: {
46
+ height: 4,
47
+ cursor: 'row-resize',
48
+ backgroundColor: colors.border,
49
+ flexShrink: 0,
50
+ },
51
+ };
52
+
53
+ export const topBarStyles: Record<string, CSSProperties> = {
54
+ container: {
55
+ display: 'flex',
56
+ alignItems: 'center',
57
+ justifyContent: 'space-between',
58
+ height: 48,
59
+ padding: '0 16px',
60
+ backgroundColor: colors.surface,
61
+ borderBottom: `1px solid ${colors.border}`,
62
+ flexShrink: 0,
63
+ },
64
+ title: {
65
+ fontSize: 14,
66
+ fontWeight: 600,
67
+ color: colors.textPrimary,
68
+ },
69
+ compositionName: {
70
+ fontSize: 13,
71
+ color: colors.textSecondary,
72
+ fontFamily: fonts.mono,
73
+ },
74
+ actions: {
75
+ display: 'flex',
76
+ alignItems: 'center',
77
+ gap: 8,
78
+ },
79
+ button: {
80
+ padding: '6px 12px',
81
+ fontSize: 12,
82
+ fontWeight: 500,
83
+ color: colors.textPrimary,
84
+ backgroundColor: colors.surfaceHover,
85
+ border: `1px solid ${colors.border}`,
86
+ borderRadius: 6,
87
+ cursor: 'pointer',
88
+ fontFamily: fonts.sans,
89
+ },
90
+ renderButton: {
91
+ padding: '6px 14px',
92
+ fontSize: 12,
93
+ fontWeight: 600,
94
+ color: '#fff',
95
+ backgroundColor: colors.accentMuted,
96
+ border: 'none',
97
+ borderRadius: 6,
98
+ cursor: 'pointer',
99
+ fontFamily: fonts.sans,
100
+ },
101
+ };
102
+
103
+ export const sidebarStyles: Record<string, CSSProperties> = {
104
+ container: {
105
+ width: 280,
106
+ minWidth: 280,
107
+ height: '100%',
108
+ backgroundColor: colors.surface,
109
+ borderRight: `1px solid ${colors.border}`,
110
+ overflowY: 'auto',
111
+ flexShrink: 0,
112
+ },
113
+ header: {
114
+ padding: '12px 16px',
115
+ fontSize: 11,
116
+ fontWeight: 600,
117
+ textTransform: 'uppercase' as const,
118
+ letterSpacing: '0.05em',
119
+ color: colors.textSecondary,
120
+ },
121
+ folderHeader: {
122
+ display: 'flex',
123
+ alignItems: 'center',
124
+ gap: 6,
125
+ padding: '8px 16px',
126
+ fontSize: 12,
127
+ fontWeight: 600,
128
+ color: colors.textSecondary,
129
+ cursor: 'pointer',
130
+ userSelect: 'none' as const,
131
+ },
132
+ item: {
133
+ display: 'flex',
134
+ alignItems: 'center',
135
+ gap: 8,
136
+ padding: '8px 16px 8px 28px',
137
+ cursor: 'pointer',
138
+ fontSize: 13,
139
+ color: colors.textPrimary,
140
+ userSelect: 'none' as const,
141
+ borderLeft: '2px solid transparent',
142
+ },
143
+ itemSelected: {
144
+ display: 'flex',
145
+ alignItems: 'center',
146
+ gap: 8,
147
+ padding: '8px 16px 8px 28px',
148
+ cursor: 'pointer',
149
+ fontSize: 13,
150
+ color: colors.accent,
151
+ userSelect: 'none' as const,
152
+ backgroundColor: 'rgba(88, 166, 255, 0.08)',
153
+ borderLeft: `2px solid ${colors.accent}`,
154
+ },
155
+ badge: {
156
+ fontSize: 10,
157
+ fontWeight: 600,
158
+ padding: '1px 5px',
159
+ borderRadius: 10,
160
+ color: '#fff',
161
+ },
162
+ duration: {
163
+ marginLeft: 'auto',
164
+ fontSize: 11,
165
+ color: colors.textSecondary,
166
+ fontFamily: fonts.mono,
167
+ fontVariantNumeric: 'tabular-nums',
168
+ },
169
+ };
170
+
171
+ // Global scrollbar CSS — injected once via <style> in StudioApp
172
+ export const scrollbarCSS = `
173
+ /* Firefox */
174
+ * {
175
+ scrollbar-width: thin;
176
+ scrollbar-color: ${colors.border} transparent;
177
+ }
178
+
179
+ /* WebKit (Chrome, Safari, Edge) */
180
+ ::-webkit-scrollbar {
181
+ width: 8px;
182
+ height: 8px;
183
+ }
184
+ ::-webkit-scrollbar-track {
185
+ background: transparent;
186
+ }
187
+ ::-webkit-scrollbar-thumb {
188
+ background: ${colors.border};
189
+ border-radius: 4px;
190
+ }
191
+ ::-webkit-scrollbar-thumb:hover {
192
+ background: ${colors.textSecondary};
193
+ }
194
+ ::-webkit-scrollbar-corner {
195
+ background: transparent;
196
+ }
197
+ `;
198
+
199
+ export const previewStyles: Record<string, CSSProperties> = {
200
+ container: {
201
+ flex: 1,
202
+ display: 'flex',
203
+ flexDirection: 'column',
204
+ overflow: 'hidden',
205
+ padding: 16,
206
+ gap: 12,
207
+ },
208
+ metadataBar: {
209
+ display: 'flex',
210
+ alignItems: 'center',
211
+ gap: 16,
212
+ padding: '8px 12px',
213
+ backgroundColor: colors.surface,
214
+ borderRadius: 8,
215
+ fontSize: 12,
216
+ color: colors.textSecondary,
217
+ fontFamily: fonts.mono,
218
+ fontVariantNumeric: 'tabular-nums',
219
+ },
220
+ metadataLabel: {
221
+ color: colors.textSecondary,
222
+ fontSize: 11,
223
+ },
224
+ metadataValue: {
225
+ color: colors.textPrimary,
226
+ fontWeight: 500,
227
+ },
228
+ playerWrapper: {
229
+ flex: 1,
230
+ display: 'flex',
231
+ alignItems: 'flex-start',
232
+ justifyContent: 'center',
233
+ overflow: 'hidden',
234
+ },
235
+ propsContainer: {
236
+ backgroundColor: colors.surface,
237
+ borderRadius: 8,
238
+ overflow: 'hidden',
239
+ },
240
+ propsHeader: {
241
+ display: 'flex',
242
+ alignItems: 'center',
243
+ justifyContent: 'space-between',
244
+ padding: '8px 12px',
245
+ fontSize: 12,
246
+ fontWeight: 600,
247
+ color: colors.textSecondary,
248
+ cursor: 'pointer',
249
+ userSelect: 'none' as const,
250
+ },
251
+ propsTextarea: {
252
+ width: '100%',
253
+ minHeight: 80,
254
+ maxHeight: 200,
255
+ padding: '8px 12px',
256
+ backgroundColor: colors.bg,
257
+ color: colors.textPrimary,
258
+ border: 'none',
259
+ borderTop: `1px solid ${colors.border}`,
260
+ fontFamily: fonts.mono,
261
+ fontSize: 12,
262
+ lineHeight: 1.5,
263
+ resize: 'vertical' as const,
264
+ outline: 'none',
265
+ },
266
+ emptyState: {
267
+ flex: 1,
268
+ display: 'flex',
269
+ alignItems: 'center',
270
+ justifyContent: 'center',
271
+ color: colors.textSecondary,
272
+ fontSize: 14,
273
+ },
274
+ speedIndicator: {
275
+ padding: '2px 8px',
276
+ fontSize: 11,
277
+ fontWeight: 600,
278
+ backgroundColor: colors.accentMuted,
279
+ color: '#fff',
280
+ borderRadius: 4,
281
+ fontFamily: fonts.mono,
282
+ },
283
+ };