@baguette-studios/kernl-ui-core 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/LICENSE +13 -0
- package/README.md +11 -0
- package/dist/derive.d.ts +34 -0
- package/dist/derive.d.ts.map +1 -0
- package/dist/derive.js +234 -0
- package/dist/icons.d.ts +433 -0
- package/dist/icons.d.ts.map +1 -0
- package/dist/icons.js +249 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/panel.d.ts +31 -0
- package/dist/panel.d.ts.map +1 -0
- package/dist/panel.js +262 -0
- package/dist/styles.css +2848 -0
- package/dist/tailwind.css +40 -0
- package/dist/theme.css +171 -0
- package/dist/theme.d.ts +108 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +322 -0
- package/dist/types.d.ts +97 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/dist/utils.d.ts +9 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +80 -0
- package/package.json +65 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
@import "./theme.css";
|
|
2
|
+
|
|
3
|
+
@theme inline {
|
|
4
|
+
--color-kernl-canvas: var(--kernl-canvas);
|
|
5
|
+
--color-kernl-surface: var(--kernl-surface);
|
|
6
|
+
--color-kernl-surface-raised: var(--kernl-surface-raised);
|
|
7
|
+
--color-kernl-control: var(--kernl-control);
|
|
8
|
+
--color-kernl-control-hover: var(--kernl-control-hover);
|
|
9
|
+
--color-kernl-ink: var(--kernl-ink);
|
|
10
|
+
--color-kernl-ink-soft: var(--kernl-ink-soft);
|
|
11
|
+
--color-kernl-ink-secondary: var(--kernl-ink-secondary);
|
|
12
|
+
--color-kernl-ink-tertiary: var(--kernl-ink-tertiary);
|
|
13
|
+
--color-kernl-ink-muted: var(--kernl-ink-muted);
|
|
14
|
+
--color-kernl-border: var(--kernl-border);
|
|
15
|
+
--color-kernl-border-soft: var(--kernl-border-soft);
|
|
16
|
+
--color-kernl-border-strong: var(--kernl-border-strong);
|
|
17
|
+
--color-kernl-accent: var(--kernl-accent);
|
|
18
|
+
--color-kernl-accent-ink: var(--kernl-accent-ink);
|
|
19
|
+
--color-kernl-accent-hover: var(--kernl-accent-hover);
|
|
20
|
+
--color-kernl-accent-soft: var(--kernl-accent-soft);
|
|
21
|
+
--color-kernl-active: var(--kernl-active);
|
|
22
|
+
--color-kernl-success: var(--kernl-success);
|
|
23
|
+
--color-kernl-success-soft: var(--kernl-success-soft);
|
|
24
|
+
--color-kernl-warning: var(--kernl-warning);
|
|
25
|
+
--color-kernl-warning-soft: var(--kernl-warning-soft);
|
|
26
|
+
--color-kernl-danger: var(--kernl-danger);
|
|
27
|
+
--color-kernl-danger-soft: var(--kernl-danger-soft);
|
|
28
|
+
--spacing-kernl-1: var(--kernl-space-1);
|
|
29
|
+
--spacing-kernl-2: var(--kernl-space-2);
|
|
30
|
+
--spacing-kernl-3: var(--kernl-space-3);
|
|
31
|
+
--spacing-kernl-4: var(--kernl-space-4);
|
|
32
|
+
--radius-kernl-sm: var(--kernl-radius-sm);
|
|
33
|
+
--radius-kernl-md: var(--kernl-radius-md);
|
|
34
|
+
--radius-kernl-lg: var(--kernl-radius-lg);
|
|
35
|
+
--radius-kernl-pill: var(--kernl-radius-pill);
|
|
36
|
+
--font-kernl: var(--kernl-font);
|
|
37
|
+
--font-kernl-mono: var(--kernl-mono);
|
|
38
|
+
--shadow-kernl-message-pending: var(--kernl-message-pending-shadow);
|
|
39
|
+
--shadow-kernl-submit-menu: var(--kernl-submit-menu-shadow);
|
|
40
|
+
}
|
package/dist/theme.css
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
@layer kernl.theme {
|
|
2
|
+
:root,
|
|
3
|
+
.kernl-theme-root,
|
|
4
|
+
[data-kernl-theme] {
|
|
5
|
+
--kernl-canvas: #f6f8f7;
|
|
6
|
+
--kernl-surface: #ffffff;
|
|
7
|
+
--kernl-surface-raised: #fbfcfb;
|
|
8
|
+
--kernl-control: #f0f3f2;
|
|
9
|
+
--kernl-control-hover: #e9eeee;
|
|
10
|
+
--kernl-ink: #1f2528;
|
|
11
|
+
--kernl-ink-soft: #4b555a;
|
|
12
|
+
--kernl-ink-secondary: #4b555a;
|
|
13
|
+
--kernl-ink-tertiary: #758086;
|
|
14
|
+
--kernl-ink-muted: #9aa4a8;
|
|
15
|
+
--kernl-border: rgba(39, 48, 52, 0.13);
|
|
16
|
+
--kernl-border-soft: rgba(39, 48, 52, 0.08);
|
|
17
|
+
--kernl-border-strong: rgba(39, 48, 52, 0.22);
|
|
18
|
+
--kernl-accent: #236c5c;
|
|
19
|
+
--kernl-accent-ink: #ffffff;
|
|
20
|
+
--kernl-accent-hover: #1d5f50;
|
|
21
|
+
--kernl-accent-soft: #eef7f5;
|
|
22
|
+
--kernl-accent-border: rgba(35, 108, 92, 0.24);
|
|
23
|
+
--kernl-active: #2d6f9f;
|
|
24
|
+
--kernl-success: #24724f;
|
|
25
|
+
--kernl-success-soft: rgba(36, 114, 79, 0.13);
|
|
26
|
+
--kernl-warning: #9a6a19;
|
|
27
|
+
--kernl-warning-soft: rgba(154, 106, 25, 0.14);
|
|
28
|
+
--kernl-danger: #aa3d37;
|
|
29
|
+
--kernl-danger-soft: rgba(170, 61, 55, 0.13);
|
|
30
|
+
--kernl-focus: rgba(35, 108, 92, 0.34);
|
|
31
|
+
--kernl-on-dark: #ffffff;
|
|
32
|
+
--kernl-radius-sm: 5px;
|
|
33
|
+
--kernl-radius-md: 8px;
|
|
34
|
+
--kernl-radius-lg: 8px;
|
|
35
|
+
--kernl-radius-pill: 999px;
|
|
36
|
+
--kernl-radius-button: 5px;
|
|
37
|
+
--kernl-radius-panel: 8px;
|
|
38
|
+
--kernl-radius-message: 8px;
|
|
39
|
+
--kernl-radius-quick-action: 999px;
|
|
40
|
+
--kernl-radius-composer-input: 5px;
|
|
41
|
+
--kernl-space-1: 4px;
|
|
42
|
+
--kernl-space-2: 8px;
|
|
43
|
+
--kernl-space-3: 12px;
|
|
44
|
+
--kernl-space-4: 16px;
|
|
45
|
+
--kernl-button-height: 34px;
|
|
46
|
+
--kernl-button-padding-x: 12px;
|
|
47
|
+
--kernl-icon-button-size: 30px;
|
|
48
|
+
--kernl-conversation-background: linear-gradient(rgba(39, 48, 52, 0.04) 1px, transparent 1px), var(--kernl-surface-raised);
|
|
49
|
+
--kernl-conversation-background-size: 100% 32px;
|
|
50
|
+
--kernl-conversation-background-position: top left;
|
|
51
|
+
--kernl-conversation-background-repeat: repeat;
|
|
52
|
+
--kernl-conversation-gap: 8px;
|
|
53
|
+
--kernl-conversation-padding: 12px;
|
|
54
|
+
--kernl-quick-actions-padding: 0 12px 12px;
|
|
55
|
+
--kernl-quick-action-bg: var(--kernl-surface);
|
|
56
|
+
--kernl-quick-action-hover-bg: #eef7f5;
|
|
57
|
+
--kernl-quick-action-hover-border: rgba(45, 111, 159, 0.28);
|
|
58
|
+
--kernl-quick-action-padding-x: 12px;
|
|
59
|
+
--kernl-message-bg: var(--kernl-surface);
|
|
60
|
+
--kernl-message-border: var(--kernl-border);
|
|
61
|
+
--kernl-message-gap: 5px;
|
|
62
|
+
--kernl-message-padding: 9px 10px;
|
|
63
|
+
--kernl-message-max-width: min(82%, 520px);
|
|
64
|
+
--kernl-message-user-bg: #e7f4ef;
|
|
65
|
+
--kernl-message-user-border: rgba(35, 108, 92, 0.24);
|
|
66
|
+
--kernl-message-system-bg: #f5f1e5;
|
|
67
|
+
--kernl-message-pending-bg: var(--kernl-surface);
|
|
68
|
+
--kernl-message-pending-border: rgba(35, 108, 92, 0.2);
|
|
69
|
+
--kernl-message-pending-shadow: 0 8px 20px rgba(40, 55, 49, 0.08);
|
|
70
|
+
--kernl-message-pending-padding: 12px 14px;
|
|
71
|
+
--kernl-composer-bg: var(--kernl-surface);
|
|
72
|
+
--kernl-composer-border: var(--kernl-border);
|
|
73
|
+
--kernl-composer-gap: 8px;
|
|
74
|
+
--kernl-composer-padding: 8px;
|
|
75
|
+
--kernl-composer-input-bg: var(--kernl-control);
|
|
76
|
+
--kernl-composer-input-padding: 9px 10px;
|
|
77
|
+
--kernl-submit-mode-bg: var(--kernl-accent);
|
|
78
|
+
--kernl-submit-mode-hover-bg: #1d5f50;
|
|
79
|
+
--kernl-submit-mode-border: rgba(255, 255, 255, 0.34);
|
|
80
|
+
--kernl-submit-menu-bg: var(--kernl-surface);
|
|
81
|
+
--kernl-submit-menu-shadow: 0 14px 34px rgba(40, 55, 49, 0.16);
|
|
82
|
+
--kernl-submit-menu-item-hover-bg: #eef7f5;
|
|
83
|
+
--kernl-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
84
|
+
--kernl-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
[data-kernl-theme="compact"] {
|
|
88
|
+
--kernl-space-1: 3px;
|
|
89
|
+
--kernl-space-2: 6px;
|
|
90
|
+
--kernl-space-3: 10px;
|
|
91
|
+
--kernl-space-4: 14px;
|
|
92
|
+
--kernl-button-height: 30px;
|
|
93
|
+
--kernl-conversation-gap: 6px;
|
|
94
|
+
--kernl-conversation-padding: 10px;
|
|
95
|
+
--kernl-quick-actions-padding: 0 10px 10px;
|
|
96
|
+
--kernl-message-padding: 7px 9px;
|
|
97
|
+
--kernl-composer-padding: 6px;
|
|
98
|
+
--kernl-composer-input-padding: 7px 9px;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
[data-kernl-theme="comfortable"] {
|
|
102
|
+
--kernl-space-1: 5px;
|
|
103
|
+
--kernl-space-2: 10px;
|
|
104
|
+
--kernl-space-3: 14px;
|
|
105
|
+
--kernl-space-4: 18px;
|
|
106
|
+
--kernl-button-height: 38px;
|
|
107
|
+
--kernl-conversation-gap: 10px;
|
|
108
|
+
--kernl-conversation-padding: 16px;
|
|
109
|
+
--kernl-quick-actions-padding: 0 16px 16px;
|
|
110
|
+
--kernl-message-padding: 11px 12px;
|
|
111
|
+
--kernl-composer-padding: 10px;
|
|
112
|
+
--kernl-composer-input-padding: 11px 12px;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
[data-kernl-theme="soft"] {
|
|
116
|
+
--kernl-canvas: #f5f7f5;
|
|
117
|
+
--kernl-surface-raised: #f9fbfa;
|
|
118
|
+
--kernl-control: #eef3f1;
|
|
119
|
+
--kernl-control-hover: #e3ebe8;
|
|
120
|
+
--kernl-accent: #2f7568;
|
|
121
|
+
--kernl-accent-hover: #276357;
|
|
122
|
+
--kernl-accent-soft: #e9f5f1;
|
|
123
|
+
--kernl-message-user-bg: #e4f2ed;
|
|
124
|
+
--kernl-message-system-bg: #f3efe2;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
[data-kernl-theme="highContrast"] {
|
|
128
|
+
--kernl-canvas: #f7f7f7;
|
|
129
|
+
--kernl-surface: #ffffff;
|
|
130
|
+
--kernl-surface-raised: #ffffff;
|
|
131
|
+
--kernl-control: #ececec;
|
|
132
|
+
--kernl-control-hover: #e0e0e0;
|
|
133
|
+
--kernl-ink: #0f1112;
|
|
134
|
+
--kernl-ink-soft: #2b3033;
|
|
135
|
+
--kernl-ink-secondary: #2b3033;
|
|
136
|
+
--kernl-ink-tertiary: #4f595e;
|
|
137
|
+
--kernl-ink-muted: #626d73;
|
|
138
|
+
--kernl-border: rgba(15, 17, 18, 0.32);
|
|
139
|
+
--kernl-border-soft: rgba(15, 17, 18, 0.18);
|
|
140
|
+
--kernl-border-strong: rgba(15, 17, 18, 0.48);
|
|
141
|
+
--kernl-accent: #064f43;
|
|
142
|
+
--kernl-accent-hover: #033f35;
|
|
143
|
+
--kernl-accent-soft: #dff2ed;
|
|
144
|
+
--kernl-active: #064f79;
|
|
145
|
+
--kernl-focus: rgba(6, 79, 67, 0.52);
|
|
146
|
+
--kernl-message-user-bg: #dff2ed;
|
|
147
|
+
--kernl-message-user-border: rgba(6, 79, 67, 0.42);
|
|
148
|
+
--kernl-message-system-bg: #f1ead4;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
[data-kernl-conversation-background="plain"] {
|
|
152
|
+
--kernl-conversation-background: var(--kernl-surface-raised);
|
|
153
|
+
--kernl-conversation-background-size: auto;
|
|
154
|
+
--kernl-conversation-background-position: top left;
|
|
155
|
+
--kernl-conversation-background-repeat: repeat;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
[data-kernl-conversation-background="grid"] {
|
|
159
|
+
--kernl-conversation-background: linear-gradient(rgba(39, 48, 52, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(39, 48, 52, 0.05) 1px, transparent 1px), var(--kernl-surface-raised);
|
|
160
|
+
--kernl-conversation-background-size: 28px 28px;
|
|
161
|
+
--kernl-conversation-background-position: top left;
|
|
162
|
+
--kernl-conversation-background-repeat: repeat;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
[data-kernl-conversation-background="softGradient"] {
|
|
166
|
+
--kernl-conversation-background: radial-gradient(circle at 18% 12%, rgba(35, 108, 92, 0.12), transparent 32%), linear-gradient(180deg, var(--kernl-surface-raised), var(--kernl-control));
|
|
167
|
+
--kernl-conversation-background-size: auto;
|
|
168
|
+
--kernl-conversation-background-position: top left;
|
|
169
|
+
--kernl-conversation-background-repeat: no-repeat;
|
|
170
|
+
}
|
|
171
|
+
}
|
package/dist/theme.d.ts
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
export type AgentThemePresetId = "default" | "compact" | "comfortable" | "soft" | "highContrast";
|
|
2
|
+
export type AgentConversationBackgroundPreset = "ruled" | "plain" | "grid" | "softGradient";
|
|
3
|
+
export type AgentThemeInput = AgentThemePresetId | AgentTheme | undefined;
|
|
4
|
+
export type AgentThemeVariable = `--kernl-${string}`;
|
|
5
|
+
export type AgentThemeVars = Partial<Record<AgentThemeVariable, string>>;
|
|
6
|
+
export interface AgentTheme {
|
|
7
|
+
preset?: AgentThemePresetId | undefined;
|
|
8
|
+
colors?: Partial<AgentThemeColors> | undefined;
|
|
9
|
+
spacing?: Partial<AgentThemeSpacing> | undefined;
|
|
10
|
+
radius?: Partial<AgentThemeRadius> | undefined;
|
|
11
|
+
conversation?: AgentConversationTheme | undefined;
|
|
12
|
+
variables?: AgentThemeVars | undefined;
|
|
13
|
+
}
|
|
14
|
+
export interface AgentThemeColors {
|
|
15
|
+
canvas: string;
|
|
16
|
+
surface: string;
|
|
17
|
+
surfaceRaised: string;
|
|
18
|
+
control: string;
|
|
19
|
+
controlHover: string;
|
|
20
|
+
ink: string;
|
|
21
|
+
inkSoft: string;
|
|
22
|
+
inkSecondary: string;
|
|
23
|
+
inkTertiary: string;
|
|
24
|
+
inkMuted: string;
|
|
25
|
+
border: string;
|
|
26
|
+
borderSoft: string;
|
|
27
|
+
borderStrong: string;
|
|
28
|
+
accent: string;
|
|
29
|
+
accentInk: string;
|
|
30
|
+
accentHover: string;
|
|
31
|
+
accentSoft: string;
|
|
32
|
+
accentBorder: string;
|
|
33
|
+
active: string;
|
|
34
|
+
success: string;
|
|
35
|
+
successSoft: string;
|
|
36
|
+
warning: string;
|
|
37
|
+
warningSoft: string;
|
|
38
|
+
danger: string;
|
|
39
|
+
dangerSoft: string;
|
|
40
|
+
focus: string;
|
|
41
|
+
messageUser: string;
|
|
42
|
+
messageUserBorder: string;
|
|
43
|
+
messageSystem: string;
|
|
44
|
+
quickActionHover: string;
|
|
45
|
+
quickActionHoverBorder: string;
|
|
46
|
+
onDark: string;
|
|
47
|
+
}
|
|
48
|
+
export interface AgentThemeSpacing {
|
|
49
|
+
space1: string;
|
|
50
|
+
space2: string;
|
|
51
|
+
space3: string;
|
|
52
|
+
space4: string;
|
|
53
|
+
buttonHeight: string;
|
|
54
|
+
buttonPaddingX: string;
|
|
55
|
+
iconButtonSize: string;
|
|
56
|
+
conversationGap: string;
|
|
57
|
+
conversationPadding: string;
|
|
58
|
+
quickActionsPadding: string;
|
|
59
|
+
quickActionPaddingX: string;
|
|
60
|
+
messageGap: string;
|
|
61
|
+
messagePadding: string;
|
|
62
|
+
composerGap: string;
|
|
63
|
+
composerPadding: string;
|
|
64
|
+
composerInputPadding: string;
|
|
65
|
+
}
|
|
66
|
+
export interface AgentThemeRadius {
|
|
67
|
+
small: string;
|
|
68
|
+
medium: string;
|
|
69
|
+
large: string;
|
|
70
|
+
pill: string;
|
|
71
|
+
button: string;
|
|
72
|
+
panel: string;
|
|
73
|
+
message: string;
|
|
74
|
+
quickAction: string;
|
|
75
|
+
composerInput: string;
|
|
76
|
+
}
|
|
77
|
+
export interface AgentConversationTheme {
|
|
78
|
+
background?: AgentConversationBackgroundPreset | AgentConversationBackgroundOverride | undefined;
|
|
79
|
+
quickActionsBackground?: string | undefined;
|
|
80
|
+
}
|
|
81
|
+
export interface AgentConversationBackgroundOverride {
|
|
82
|
+
color?: string | undefined;
|
|
83
|
+
image?: string | undefined;
|
|
84
|
+
size?: string | undefined;
|
|
85
|
+
position?: string | undefined;
|
|
86
|
+
repeat?: string | undefined;
|
|
87
|
+
}
|
|
88
|
+
export interface AgentThemeAttributes {
|
|
89
|
+
"data-kernl-theme": AgentThemePresetId;
|
|
90
|
+
"data-kernl-conversation-background": AgentConversationBackgroundPreset | "custom";
|
|
91
|
+
}
|
|
92
|
+
export declare const agentThemePresets: Readonly<{
|
|
93
|
+
default: "default";
|
|
94
|
+
compact: "compact";
|
|
95
|
+
comfortable: "comfortable";
|
|
96
|
+
soft: "soft";
|
|
97
|
+
highContrast: "highContrast";
|
|
98
|
+
}>;
|
|
99
|
+
export declare const agentConversationBackgroundPresets: Readonly<{
|
|
100
|
+
ruled: "ruled";
|
|
101
|
+
plain: "plain";
|
|
102
|
+
grid: "grid";
|
|
103
|
+
softGradient: "softGradient";
|
|
104
|
+
}>;
|
|
105
|
+
export declare function createAgentThemeVars(input?: AgentThemeInput): AgentThemeVars;
|
|
106
|
+
export declare function createAgentThemeAttributes(input?: AgentThemeInput): AgentThemeAttributes;
|
|
107
|
+
export declare function isAgentThemeVariable(value: string): value is AgentThemeVariable;
|
|
108
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"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"}
|
package/dist/theme.js
ADDED
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
const DEFAULT_THEME_VARS = {
|
|
2
|
+
"--kernl-canvas": "#f6f8f7",
|
|
3
|
+
"--kernl-surface": "#ffffff",
|
|
4
|
+
"--kernl-surface-raised": "#fbfcfb",
|
|
5
|
+
"--kernl-control": "#f0f3f2",
|
|
6
|
+
"--kernl-control-hover": "#e9eeee",
|
|
7
|
+
"--kernl-ink": "#1f2528",
|
|
8
|
+
"--kernl-ink-soft": "#4b555a",
|
|
9
|
+
"--kernl-ink-secondary": "#4b555a",
|
|
10
|
+
"--kernl-ink-tertiary": "#758086",
|
|
11
|
+
"--kernl-ink-muted": "#9aa4a8",
|
|
12
|
+
"--kernl-border": "rgba(39, 48, 52, 0.13)",
|
|
13
|
+
"--kernl-border-soft": "rgba(39, 48, 52, 0.08)",
|
|
14
|
+
"--kernl-border-strong": "rgba(39, 48, 52, 0.22)",
|
|
15
|
+
"--kernl-accent": "#236c5c",
|
|
16
|
+
"--kernl-accent-ink": "#ffffff",
|
|
17
|
+
"--kernl-accent-hover": "#1d5f50",
|
|
18
|
+
"--kernl-accent-soft": "#eef7f5",
|
|
19
|
+
"--kernl-accent-border": "rgba(35, 108, 92, 0.24)",
|
|
20
|
+
"--kernl-active": "#2d6f9f",
|
|
21
|
+
"--kernl-success": "#24724f",
|
|
22
|
+
"--kernl-success-soft": "rgba(36, 114, 79, 0.13)",
|
|
23
|
+
"--kernl-warning": "#9a6a19",
|
|
24
|
+
"--kernl-warning-soft": "rgba(154, 106, 25, 0.14)",
|
|
25
|
+
"--kernl-danger": "#aa3d37",
|
|
26
|
+
"--kernl-danger-soft": "rgba(170, 61, 55, 0.13)",
|
|
27
|
+
"--kernl-focus": "rgba(35, 108, 92, 0.34)",
|
|
28
|
+
"--kernl-on-dark": "#ffffff",
|
|
29
|
+
"--kernl-radius-sm": "5px",
|
|
30
|
+
"--kernl-radius-md": "8px",
|
|
31
|
+
"--kernl-radius-lg": "8px",
|
|
32
|
+
"--kernl-radius-pill": "999px",
|
|
33
|
+
"--kernl-radius-button": "5px",
|
|
34
|
+
"--kernl-radius-panel": "8px",
|
|
35
|
+
"--kernl-radius-message": "8px",
|
|
36
|
+
"--kernl-radius-quick-action": "999px",
|
|
37
|
+
"--kernl-radius-composer-input": "5px",
|
|
38
|
+
"--kernl-space-1": "4px",
|
|
39
|
+
"--kernl-space-2": "8px",
|
|
40
|
+
"--kernl-space-3": "12px",
|
|
41
|
+
"--kernl-space-4": "16px",
|
|
42
|
+
"--kernl-button-height": "34px",
|
|
43
|
+
"--kernl-button-padding-x": "12px",
|
|
44
|
+
"--kernl-icon-button-size": "30px",
|
|
45
|
+
"--kernl-conversation-gap": "8px",
|
|
46
|
+
"--kernl-conversation-padding": "12px",
|
|
47
|
+
"--kernl-quick-actions-padding": "0 12px 12px",
|
|
48
|
+
"--kernl-quick-action-bg": "var(--kernl-surface)",
|
|
49
|
+
"--kernl-quick-action-hover-bg": "#eef7f5",
|
|
50
|
+
"--kernl-quick-action-hover-border": "rgba(45, 111, 159, 0.28)",
|
|
51
|
+
"--kernl-quick-action-padding-x": "12px",
|
|
52
|
+
"--kernl-message-bg": "var(--kernl-surface)",
|
|
53
|
+
"--kernl-message-border": "var(--kernl-border)",
|
|
54
|
+
"--kernl-message-gap": "5px",
|
|
55
|
+
"--kernl-message-padding": "9px 10px",
|
|
56
|
+
"--kernl-message-max-width": "min(82%, 520px)",
|
|
57
|
+
"--kernl-message-user-bg": "#e7f4ef",
|
|
58
|
+
"--kernl-message-user-border": "rgba(35, 108, 92, 0.24)",
|
|
59
|
+
"--kernl-message-system-bg": "#f5f1e5",
|
|
60
|
+
"--kernl-message-pending-bg": "var(--kernl-surface)",
|
|
61
|
+
"--kernl-message-pending-border": "rgba(35, 108, 92, 0.2)",
|
|
62
|
+
"--kernl-message-pending-shadow": "0 8px 20px rgba(40, 55, 49, 0.08)",
|
|
63
|
+
"--kernl-message-pending-padding": "12px 14px",
|
|
64
|
+
"--kernl-composer-bg": "var(--kernl-surface)",
|
|
65
|
+
"--kernl-composer-border": "var(--kernl-border)",
|
|
66
|
+
"--kernl-composer-gap": "8px",
|
|
67
|
+
"--kernl-composer-padding": "8px",
|
|
68
|
+
"--kernl-composer-input-bg": "var(--kernl-control)",
|
|
69
|
+
"--kernl-composer-input-padding": "9px 10px",
|
|
70
|
+
"--kernl-submit-mode-bg": "var(--kernl-accent)",
|
|
71
|
+
"--kernl-submit-mode-hover-bg": "#1d5f50",
|
|
72
|
+
"--kernl-submit-mode-border": "rgba(255, 255, 255, 0.34)",
|
|
73
|
+
"--kernl-submit-menu-bg": "var(--kernl-surface)",
|
|
74
|
+
"--kernl-submit-menu-shadow": "0 14px 34px rgba(40, 55, 49, 0.16)",
|
|
75
|
+
"--kernl-submit-menu-item-hover-bg": "#eef7f5",
|
|
76
|
+
"--kernl-font": 'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
77
|
+
"--kernl-mono": '"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace'
|
|
78
|
+
};
|
|
79
|
+
const CONVERSATION_BACKGROUND_PRESET_VARS = {
|
|
80
|
+
ruled: {
|
|
81
|
+
"--kernl-conversation-background": "linear-gradient(rgba(39, 48, 52, 0.04) 1px, transparent 1px), var(--kernl-surface-raised)",
|
|
82
|
+
"--kernl-conversation-background-size": "100% 32px",
|
|
83
|
+
"--kernl-conversation-background-position": "top left",
|
|
84
|
+
"--kernl-conversation-background-repeat": "repeat"
|
|
85
|
+
},
|
|
86
|
+
plain: {
|
|
87
|
+
"--kernl-conversation-background": "var(--kernl-surface-raised)",
|
|
88
|
+
"--kernl-conversation-background-size": "auto",
|
|
89
|
+
"--kernl-conversation-background-position": "top left",
|
|
90
|
+
"--kernl-conversation-background-repeat": "repeat"
|
|
91
|
+
},
|
|
92
|
+
grid: {
|
|
93
|
+
"--kernl-conversation-background": "linear-gradient(rgba(39, 48, 52, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(39, 48, 52, 0.05) 1px, transparent 1px), var(--kernl-surface-raised)",
|
|
94
|
+
"--kernl-conversation-background-size": "28px 28px",
|
|
95
|
+
"--kernl-conversation-background-position": "top left",
|
|
96
|
+
"--kernl-conversation-background-repeat": "repeat"
|
|
97
|
+
},
|
|
98
|
+
softGradient: {
|
|
99
|
+
"--kernl-conversation-background": "radial-gradient(circle at 18% 12%, rgba(35, 108, 92, 0.12), transparent 32%), linear-gradient(180deg, var(--kernl-surface-raised), var(--kernl-control))",
|
|
100
|
+
"--kernl-conversation-background-size": "auto",
|
|
101
|
+
"--kernl-conversation-background-position": "top left",
|
|
102
|
+
"--kernl-conversation-background-repeat": "no-repeat"
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
const PRESET_VAR_OVERRIDES = {
|
|
106
|
+
default: {},
|
|
107
|
+
compact: {
|
|
108
|
+
"--kernl-space-1": "3px",
|
|
109
|
+
"--kernl-space-2": "6px",
|
|
110
|
+
"--kernl-space-3": "10px",
|
|
111
|
+
"--kernl-space-4": "14px",
|
|
112
|
+
"--kernl-button-height": "30px",
|
|
113
|
+
"--kernl-conversation-gap": "6px",
|
|
114
|
+
"--kernl-conversation-padding": "10px",
|
|
115
|
+
"--kernl-quick-actions-padding": "0 10px 10px",
|
|
116
|
+
"--kernl-message-padding": "7px 9px",
|
|
117
|
+
"--kernl-composer-padding": "6px",
|
|
118
|
+
"--kernl-composer-input-padding": "7px 9px"
|
|
119
|
+
},
|
|
120
|
+
comfortable: {
|
|
121
|
+
"--kernl-space-1": "5px",
|
|
122
|
+
"--kernl-space-2": "10px",
|
|
123
|
+
"--kernl-space-3": "14px",
|
|
124
|
+
"--kernl-space-4": "18px",
|
|
125
|
+
"--kernl-button-height": "38px",
|
|
126
|
+
"--kernl-conversation-gap": "10px",
|
|
127
|
+
"--kernl-conversation-padding": "16px",
|
|
128
|
+
"--kernl-quick-actions-padding": "0 16px 16px",
|
|
129
|
+
"--kernl-message-padding": "11px 12px",
|
|
130
|
+
"--kernl-composer-padding": "10px",
|
|
131
|
+
"--kernl-composer-input-padding": "11px 12px"
|
|
132
|
+
},
|
|
133
|
+
soft: {
|
|
134
|
+
"--kernl-canvas": "#f5f7f5",
|
|
135
|
+
"--kernl-surface-raised": "#f9fbfa",
|
|
136
|
+
"--kernl-control": "#eef3f1",
|
|
137
|
+
"--kernl-control-hover": "#e3ebe8",
|
|
138
|
+
"--kernl-accent": "#2f7568",
|
|
139
|
+
"--kernl-accent-hover": "#276357",
|
|
140
|
+
"--kernl-accent-soft": "#e9f5f1",
|
|
141
|
+
"--kernl-message-user-bg": "#e4f2ed",
|
|
142
|
+
"--kernl-message-system-bg": "#f3efe2"
|
|
143
|
+
},
|
|
144
|
+
highContrast: {
|
|
145
|
+
"--kernl-canvas": "#f7f7f7",
|
|
146
|
+
"--kernl-surface": "#ffffff",
|
|
147
|
+
"--kernl-surface-raised": "#ffffff",
|
|
148
|
+
"--kernl-control": "#ececec",
|
|
149
|
+
"--kernl-control-hover": "#e0e0e0",
|
|
150
|
+
"--kernl-ink": "#0f1112",
|
|
151
|
+
"--kernl-ink-soft": "#2b3033",
|
|
152
|
+
"--kernl-ink-secondary": "#2b3033",
|
|
153
|
+
"--kernl-ink-tertiary": "#4f595e",
|
|
154
|
+
"--kernl-ink-muted": "#626d73",
|
|
155
|
+
"--kernl-border": "rgba(15, 17, 18, 0.32)",
|
|
156
|
+
"--kernl-border-soft": "rgba(15, 17, 18, 0.18)",
|
|
157
|
+
"--kernl-border-strong": "rgba(15, 17, 18, 0.48)",
|
|
158
|
+
"--kernl-accent": "#064f43",
|
|
159
|
+
"--kernl-accent-hover": "#033f35",
|
|
160
|
+
"--kernl-accent-soft": "#dff2ed",
|
|
161
|
+
"--kernl-active": "#064f79",
|
|
162
|
+
"--kernl-focus": "rgba(6, 79, 67, 0.52)",
|
|
163
|
+
"--kernl-message-user-bg": "#dff2ed",
|
|
164
|
+
"--kernl-message-user-border": "rgba(6, 79, 67, 0.42)",
|
|
165
|
+
"--kernl-message-system-bg": "#f1ead4"
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
const COLOR_VAR_MAP = {
|
|
169
|
+
canvas: "--kernl-canvas",
|
|
170
|
+
surface: "--kernl-surface",
|
|
171
|
+
surfaceRaised: "--kernl-surface-raised",
|
|
172
|
+
control: "--kernl-control",
|
|
173
|
+
controlHover: "--kernl-control-hover",
|
|
174
|
+
ink: "--kernl-ink",
|
|
175
|
+
inkSoft: "--kernl-ink-soft",
|
|
176
|
+
inkSecondary: "--kernl-ink-secondary",
|
|
177
|
+
inkTertiary: "--kernl-ink-tertiary",
|
|
178
|
+
inkMuted: "--kernl-ink-muted",
|
|
179
|
+
border: "--kernl-border",
|
|
180
|
+
borderSoft: "--kernl-border-soft",
|
|
181
|
+
borderStrong: "--kernl-border-strong",
|
|
182
|
+
accent: "--kernl-accent",
|
|
183
|
+
accentInk: "--kernl-accent-ink",
|
|
184
|
+
accentHover: "--kernl-accent-hover",
|
|
185
|
+
accentSoft: "--kernl-accent-soft",
|
|
186
|
+
accentBorder: "--kernl-accent-border",
|
|
187
|
+
active: "--kernl-active",
|
|
188
|
+
success: "--kernl-success",
|
|
189
|
+
successSoft: "--kernl-success-soft",
|
|
190
|
+
warning: "--kernl-warning",
|
|
191
|
+
warningSoft: "--kernl-warning-soft",
|
|
192
|
+
danger: "--kernl-danger",
|
|
193
|
+
dangerSoft: "--kernl-danger-soft",
|
|
194
|
+
focus: "--kernl-focus",
|
|
195
|
+
messageUser: "--kernl-message-user-bg",
|
|
196
|
+
messageUserBorder: "--kernl-message-user-border",
|
|
197
|
+
messageSystem: "--kernl-message-system-bg",
|
|
198
|
+
quickActionHover: "--kernl-quick-action-hover-bg",
|
|
199
|
+
quickActionHoverBorder: "--kernl-quick-action-hover-border",
|
|
200
|
+
onDark: "--kernl-on-dark"
|
|
201
|
+
};
|
|
202
|
+
const SPACING_VAR_MAP = {
|
|
203
|
+
space1: "--kernl-space-1",
|
|
204
|
+
space2: "--kernl-space-2",
|
|
205
|
+
space3: "--kernl-space-3",
|
|
206
|
+
space4: "--kernl-space-4",
|
|
207
|
+
buttonHeight: "--kernl-button-height",
|
|
208
|
+
buttonPaddingX: "--kernl-button-padding-x",
|
|
209
|
+
iconButtonSize: "--kernl-icon-button-size",
|
|
210
|
+
conversationGap: "--kernl-conversation-gap",
|
|
211
|
+
conversationPadding: "--kernl-conversation-padding",
|
|
212
|
+
quickActionsPadding: "--kernl-quick-actions-padding",
|
|
213
|
+
quickActionPaddingX: "--kernl-quick-action-padding-x",
|
|
214
|
+
messageGap: "--kernl-message-gap",
|
|
215
|
+
messagePadding: "--kernl-message-padding",
|
|
216
|
+
composerGap: "--kernl-composer-gap",
|
|
217
|
+
composerPadding: "--kernl-composer-padding",
|
|
218
|
+
composerInputPadding: "--kernl-composer-input-padding"
|
|
219
|
+
};
|
|
220
|
+
const RADIUS_VAR_MAP = {
|
|
221
|
+
small: "--kernl-radius-sm",
|
|
222
|
+
medium: "--kernl-radius-md",
|
|
223
|
+
large: "--kernl-radius-lg",
|
|
224
|
+
pill: "--kernl-radius-pill",
|
|
225
|
+
button: "--kernl-radius-button",
|
|
226
|
+
panel: "--kernl-radius-panel",
|
|
227
|
+
message: "--kernl-radius-message",
|
|
228
|
+
quickAction: "--kernl-radius-quick-action",
|
|
229
|
+
composerInput: "--kernl-radius-composer-input"
|
|
230
|
+
};
|
|
231
|
+
export const agentThemePresets = Object.freeze({
|
|
232
|
+
default: "default",
|
|
233
|
+
compact: "compact",
|
|
234
|
+
comfortable: "comfortable",
|
|
235
|
+
soft: "soft",
|
|
236
|
+
highContrast: "highContrast"
|
|
237
|
+
});
|
|
238
|
+
export const agentConversationBackgroundPresets = Object.freeze({
|
|
239
|
+
ruled: "ruled",
|
|
240
|
+
plain: "plain",
|
|
241
|
+
grid: "grid",
|
|
242
|
+
softGradient: "softGradient"
|
|
243
|
+
});
|
|
244
|
+
export function createAgentThemeVars(input) {
|
|
245
|
+
const theme = normalizeTheme(input);
|
|
246
|
+
const preset = theme.preset ?? "default";
|
|
247
|
+
const vars = {
|
|
248
|
+
...DEFAULT_THEME_VARS,
|
|
249
|
+
...CONVERSATION_BACKGROUND_PRESET_VARS.ruled,
|
|
250
|
+
...PRESET_VAR_OVERRIDES[preset]
|
|
251
|
+
};
|
|
252
|
+
applyMappedVars(vars, COLOR_VAR_MAP, theme.colors);
|
|
253
|
+
applyMappedVars(vars, SPACING_VAR_MAP, theme.spacing);
|
|
254
|
+
applyMappedVars(vars, RADIUS_VAR_MAP, theme.radius);
|
|
255
|
+
applyConversationVars(vars, theme.conversation);
|
|
256
|
+
if (theme.variables) {
|
|
257
|
+
for (const [name, value] of Object.entries(theme.variables)) {
|
|
258
|
+
if (isAgentThemeVariable(name) && value !== undefined) {
|
|
259
|
+
vars[name] = String(value);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return vars;
|
|
264
|
+
}
|
|
265
|
+
export function createAgentThemeAttributes(input) {
|
|
266
|
+
const theme = normalizeTheme(input);
|
|
267
|
+
return {
|
|
268
|
+
"data-kernl-theme": theme.preset ?? "default",
|
|
269
|
+
"data-kernl-conversation-background": getConversationBackgroundId(theme.conversation?.background)
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
export function isAgentThemeVariable(value) {
|
|
273
|
+
return value.startsWith("--kernl-");
|
|
274
|
+
}
|
|
275
|
+
function normalizeTheme(input) {
|
|
276
|
+
if (!input) {
|
|
277
|
+
return { preset: "default" };
|
|
278
|
+
}
|
|
279
|
+
if (typeof input === "string") {
|
|
280
|
+
return { preset: input };
|
|
281
|
+
}
|
|
282
|
+
return input;
|
|
283
|
+
}
|
|
284
|
+
function applyMappedVars(vars, map, values) {
|
|
285
|
+
if (!values) {
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
for (const [key, name] of Object.entries(map)) {
|
|
289
|
+
const value = values[key];
|
|
290
|
+
if (value !== undefined) {
|
|
291
|
+
vars[name] = String(value);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
function applyConversationVars(vars, conversation) {
|
|
296
|
+
const background = conversation?.background;
|
|
297
|
+
if (typeof background === "string") {
|
|
298
|
+
Object.assign(vars, CONVERSATION_BACKGROUND_PRESET_VARS[background]);
|
|
299
|
+
}
|
|
300
|
+
else if (background) {
|
|
301
|
+
const color = background.color ?? "var(--kernl-surface-raised)";
|
|
302
|
+
vars["--kernl-conversation-background"] = background.image ? `${background.image}, ${color}` : color;
|
|
303
|
+
if (background.size) {
|
|
304
|
+
vars["--kernl-conversation-background-size"] = background.size;
|
|
305
|
+
}
|
|
306
|
+
if (background.position) {
|
|
307
|
+
vars["--kernl-conversation-background-position"] = background.position;
|
|
308
|
+
}
|
|
309
|
+
if (background.repeat) {
|
|
310
|
+
vars["--kernl-conversation-background-repeat"] = background.repeat;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
if (conversation?.quickActionsBackground) {
|
|
314
|
+
vars["--kernl-quick-actions-bg"] = conversation.quickActionsBackground;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
function getConversationBackgroundId(background) {
|
|
318
|
+
if (!background) {
|
|
319
|
+
return "ruled";
|
|
320
|
+
}
|
|
321
|
+
return typeof background === "string" ? background : "custom";
|
|
322
|
+
}
|