-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathdefaults.ts
More file actions
92 lines (89 loc) · 2.33 KB
/
defaults.ts
File metadata and controls
92 lines (89 loc) · 2.33 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
import type { ThemeEditorDraft, ThemeEditorFields, ThemeMode } from './types';
const DEFAULT_FONT_SANS = '"Instrument Sans", "Inter", system-ui, sans-serif';
const DEFAULT_FONT_MONO = '"JetBrains Mono", "SFMono-Regular", monospace';
export const DEFAULT_FIELDS: ThemeEditorFields = {
primary: '#6e41bf',
primaryForeground: '#ffffff',
secondary: '#f5f5f7',
secondaryForeground: '#16181d',
accent: '#f3eefa',
accentForeground: '#6e41bf',
success: '#52c41a',
successForeground: '#ffffff',
info: '#1890ff',
infoForeground: '#ffffff',
warning: '#fa8c16',
warningForeground: '#ffffff',
danger: '#dc2626',
dangerForeground: '#ffffff',
base: '#ffffff',
baseForeground: 'rgba(0, 0, 0, 0.85)',
card: '#ffffff',
cardForeground: '#111827',
popover: '#ffffff',
popoverForeground: '#111827',
muted: '#f5f5f5',
mutedForeground: 'rgba(0, 0, 0, 0.55)',
border: '#d9d9d9',
input: '#d9d9d9',
ring: '#6e41bf',
chart1: '#6e41bf',
chart2: '#1890ff',
chart3: '#52c41a',
chart4: '#fa8c16',
chart5: '#eb2f96',
sidebar: '#12131a',
sidebarForeground: '#f8fafc',
sidebarPrimary: '#6e41bf',
sidebarPrimaryForeground: '#ffffff',
sidebarAccent: '#23173f',
sidebarAccentForeground: '#efe8ff',
sidebarBorder: '#2a2d36',
sidebarRing: '#8b62d0',
fontSans: DEFAULT_FONT_SANS,
fontMono: DEFAULT_FONT_MONO,
fontSizeBase: '14px',
lineHeightBase: '1.5',
h1Size: '40px',
h2Size: '32px',
letterSpacing: '-0.02em',
radius: '0.3rem',
shadowCard: '0 20px 55px rgba(17, 24, 39, 0.08)',
shadowFocus: '0 0 0 3px rgba(110, 65, 191, 0.22)',
buttonRadius: '0.3rem',
inputRadius: '0.3rem',
cardRadius: '0.3rem',
fieldPaddingSm: '8px',
fieldPaddingMd: '8px',
fieldPaddingLg: '8px',
buttonPaddingSm: '8px',
buttonPaddingMd: '15px',
buttonPaddingLg: '20px',
fieldHeightSm: '24px',
fieldHeightMd: '35px',
fieldHeightLg: '44px',
buttonHeightSm: '24px',
buttonHeightMd: '35px',
buttonHeightLg: '44px',
cardPadding: '18px',
};
export function createDraft(
id: string,
name: string,
author: string,
mode: ThemeMode,
fieldPatch: Partial<ThemeEditorFields>,
): ThemeEditorDraft {
return {
meta: { name, author },
mode,
presetId: id,
activeSection: 'colors',
activeTemplate: 'cards',
activeCodeView: 'json',
fields: {
...DEFAULT_FIELDS,
...fieldPatch,
},
};
}