pika-shared 1.4.12 → 1.5.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/dist/types/chatbot/chatbot-types.d.mts +186 -4
- package/dist/types/chatbot/chatbot-types.d.ts +186 -4
- package/dist/types/chatbot/chatbot-types.js.map +1 -1
- package/dist/types/chatbot/chatbot-types.mjs.map +1 -1
- package/dist/types/chatbot/theme-schema.d.mts +95 -0
- package/dist/types/chatbot/theme-schema.d.ts +95 -0
- package/dist/types/chatbot/theme-schema.js +485 -0
- package/dist/types/chatbot/theme-schema.js.map +1 -0
- package/dist/types/chatbot/theme-schema.mjs +477 -0
- package/dist/types/chatbot/theme-schema.mjs.map +1 -0
- package/dist/types/chatbot/theme-types.d.mts +163 -0
- package/dist/types/chatbot/theme-types.d.ts +163 -0
- package/dist/types/chatbot/theme-types.js +62 -0
- package/dist/types/chatbot/theme-types.js.map +1 -0
- package/dist/types/chatbot/theme-types.mjs +60 -0
- package/dist/types/chatbot/theme-types.mjs.map +1 -0
- package/dist/util/server-utils.js.map +1 -1
- package/dist/util/server-utils.mjs.map +1 -1
- package/dist/util/wc-utils.d.mts +41 -1
- package/dist/util/wc-utils.d.ts +41 -1
- package/dist/util/wc-utils.js +75 -0
- package/dist/util/wc-utils.js.map +1 -1
- package/dist/util/wc-utils.mjs +74 -1
- package/dist/util/wc-utils.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme Types for Pika UI Customization
|
|
3
|
+
*
|
|
4
|
+
* These types define the structure of theme configuration for clone projects.
|
|
5
|
+
* Import via: import type { ThemeConfig } from 'pika-shared/types/chatbot/theme-types';
|
|
6
|
+
*
|
|
7
|
+
* @since 0.16.0
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Theme configuration for Pika Chat
|
|
11
|
+
*
|
|
12
|
+
* Clone projects copy sample-purple-theme.ts, customize it, and update themeConfigPath
|
|
13
|
+
* in pika-config.ts to point to their theme file.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* import type { ThemeConfig } from 'pika-shared/types/chatbot/theme-types';
|
|
18
|
+
*
|
|
19
|
+
* export const themeConfig: ThemeConfig = {
|
|
20
|
+
* name: 'Acme Corp Theme',
|
|
21
|
+
* fontFamily: '"Inter", sans-serif',
|
|
22
|
+
* cssVariables: {
|
|
23
|
+
* light: {
|
|
24
|
+
* 'primary': 'oklch(0.47 0.2 290)',
|
|
25
|
+
* 'primary-foreground': 'oklch(1 0 0)',
|
|
26
|
+
* },
|
|
27
|
+
* dark: {
|
|
28
|
+
* 'primary': 'oklch(0.70 0.18 290)',
|
|
29
|
+
* }
|
|
30
|
+
* }
|
|
31
|
+
* };
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @since 0.16.0
|
|
35
|
+
*/
|
|
36
|
+
interface ThemeConfig {
|
|
37
|
+
/**
|
|
38
|
+
* Schema version of this theme configuration.
|
|
39
|
+
* Used by `pika theme check` to notify you of new theme variables.
|
|
40
|
+
* See theme-schema.ts for the changelog of schema versions.
|
|
41
|
+
*
|
|
42
|
+
* @default 1 (if not specified)
|
|
43
|
+
* @example schemaVersion: 1
|
|
44
|
+
*/
|
|
45
|
+
schemaVersion?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Display name for this theme (for documentation/debugging)
|
|
48
|
+
* @example 'Acme Corp Brand Theme'
|
|
49
|
+
*/
|
|
50
|
+
name?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Font family override. Applied to --font-sans CSS variable.
|
|
53
|
+
* @example '"Figtree", Arial, Helvetica, sans-serif'
|
|
54
|
+
*/
|
|
55
|
+
fontFamily?: string;
|
|
56
|
+
/**
|
|
57
|
+
* CSS custom properties to override.
|
|
58
|
+
* Keys are CSS variable names WITHOUT the -- prefix.
|
|
59
|
+
* Values should be valid CSS color values (oklch preferred for modern color handling).
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```typescript
|
|
63
|
+
* cssVariables: {
|
|
64
|
+
* light: {
|
|
65
|
+
* 'primary': 'oklch(0.47 0.2 290)',
|
|
66
|
+
* 'border': 'oklch(0.88 0.01 260)',
|
|
67
|
+
* },
|
|
68
|
+
* dark: {
|
|
69
|
+
* 'primary': 'oklch(0.70 0.18 290)',
|
|
70
|
+
* }
|
|
71
|
+
* }
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
cssVariables?: {
|
|
75
|
+
/** Light mode variable overrides */
|
|
76
|
+
light?: Record<string, string>;
|
|
77
|
+
/** Dark mode variable overrides */
|
|
78
|
+
dark?: Record<string, string>;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Custom color palettes for your brand.
|
|
82
|
+
* Creates CSS variables like --{paletteName}-{shade}
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```typescript
|
|
86
|
+
* customPalettes: {
|
|
87
|
+
* brand: {
|
|
88
|
+
* '50': 'oklch(0.97 0.01 290)',
|
|
89
|
+
* '500': 'oklch(0.47 0.2 290)',
|
|
90
|
+
* '900': 'oklch(0.20 0.08 290)',
|
|
91
|
+
* }
|
|
92
|
+
* }
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
customPalettes?: Record<string, Record<string, string>>;
|
|
96
|
+
/**
|
|
97
|
+
* Custom header icon for chat apps. Replaces the default AI sparkle icon.
|
|
98
|
+
* The icon will be constrained to roughly 44x44px.
|
|
99
|
+
*
|
|
100
|
+
* Can be specified as:
|
|
101
|
+
* - A single string URL (used for both light and dark modes)
|
|
102
|
+
* - An object with separate light/dark URLs for mode-specific icons
|
|
103
|
+
*
|
|
104
|
+
* For sync-safe storage, place your icons in:
|
|
105
|
+
* `apps/pika-chat/static/custom/assets/`
|
|
106
|
+
*
|
|
107
|
+
* @example Single icon for both modes:
|
|
108
|
+
* ```typescript
|
|
109
|
+
* chatAppHeaderIcon: '/custom/assets/my-logo.svg'
|
|
110
|
+
* ```
|
|
111
|
+
*
|
|
112
|
+
* @example Separate icons for light/dark modes:
|
|
113
|
+
* ```typescript
|
|
114
|
+
* chatAppHeaderIcon: {
|
|
115
|
+
* light: '/custom/assets/logo-dark.svg', // Dark logo on light background
|
|
116
|
+
* dark: '/custom/assets/logo-light.svg' // Light logo on dark background
|
|
117
|
+
* }
|
|
118
|
+
* ```
|
|
119
|
+
*
|
|
120
|
+
* @since 0.16.4
|
|
121
|
+
*/
|
|
122
|
+
chatAppHeaderIcon?: string | {
|
|
123
|
+
/** Icon URL for light mode */
|
|
124
|
+
light: string;
|
|
125
|
+
/** Icon URL for dark mode (falls back to light if not provided) */
|
|
126
|
+
dark?: string;
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Configuration for the custom theme feature in pika-config.ts
|
|
131
|
+
*
|
|
132
|
+
* @since 0.16.0
|
|
133
|
+
*/
|
|
134
|
+
interface CustomThemeConfig {
|
|
135
|
+
/**
|
|
136
|
+
* Whether custom theming is enabled.
|
|
137
|
+
* If false, the default Pika theme is used and the theme config is not loaded.
|
|
138
|
+
*/
|
|
139
|
+
enabled: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Path to theme config file relative to apps/pika-chat/
|
|
142
|
+
* The file must export a `themeConfig` object of type ThemeConfig.
|
|
143
|
+
*
|
|
144
|
+
* @default 'src/lib/custom/sample-purple-theme'
|
|
145
|
+
* @example 'src/lib/custom/my-theme' imports from 'apps/pika-chat/src/lib/custom/my-theme.ts'
|
|
146
|
+
*/
|
|
147
|
+
themeConfigPath?: string;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Standard semantic variable names that can be overridden in a theme.
|
|
151
|
+
* These are the shadcn-svelte standard variables plus Pika extensions.
|
|
152
|
+
*
|
|
153
|
+
* @since 0.16.0
|
|
154
|
+
*/
|
|
155
|
+
type SemanticColorVariable = 'background' | 'foreground' | 'card' | 'card-foreground' | 'popover' | 'popover-foreground' | 'primary' | 'primary-foreground' | 'secondary' | 'secondary-foreground' | 'muted' | 'muted-foreground' | 'accent' | 'accent-foreground' | 'destructive' | 'destructive-foreground' | 'border' | 'input' | 'ring' | 'chart-1' | 'chart-2' | 'chart-3' | 'chart-4' | 'chart-5' | 'sidebar-background' | 'sidebar-foreground' | 'sidebar-primary' | 'sidebar-primary-foreground' | 'sidebar-accent' | 'sidebar-accent-foreground' | 'sidebar-border' | 'sidebar-ring' | 'success' | 'success-foreground' | 'success-bg' | 'warning' | 'warning-foreground' | 'warning-bg' | 'info' | 'info-foreground' | 'info-bg' | 'ai' | 'ai-foreground' | 'ai-bg' | 'danger-bg' | 'chat-app-icon' | 'chat-app-header-icon-height' | 'chat-app-header-icon-gap';
|
|
156
|
+
/**
|
|
157
|
+
* All semantic variables as a readonly array for iteration
|
|
158
|
+
*
|
|
159
|
+
* @since 0.16.0
|
|
160
|
+
*/
|
|
161
|
+
declare const SEMANTIC_COLOR_VARIABLES: readonly SemanticColorVariable[];
|
|
162
|
+
|
|
163
|
+
export { type CustomThemeConfig, SEMANTIC_COLOR_VARIABLES, type SemanticColorVariable, type ThemeConfig };
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme Types for Pika UI Customization
|
|
3
|
+
*
|
|
4
|
+
* These types define the structure of theme configuration for clone projects.
|
|
5
|
+
* Import via: import type { ThemeConfig } from 'pika-shared/types/chatbot/theme-types';
|
|
6
|
+
*
|
|
7
|
+
* @since 0.16.0
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Theme configuration for Pika Chat
|
|
11
|
+
*
|
|
12
|
+
* Clone projects copy sample-purple-theme.ts, customize it, and update themeConfigPath
|
|
13
|
+
* in pika-config.ts to point to their theme file.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* import type { ThemeConfig } from 'pika-shared/types/chatbot/theme-types';
|
|
18
|
+
*
|
|
19
|
+
* export const themeConfig: ThemeConfig = {
|
|
20
|
+
* name: 'Acme Corp Theme',
|
|
21
|
+
* fontFamily: '"Inter", sans-serif',
|
|
22
|
+
* cssVariables: {
|
|
23
|
+
* light: {
|
|
24
|
+
* 'primary': 'oklch(0.47 0.2 290)',
|
|
25
|
+
* 'primary-foreground': 'oklch(1 0 0)',
|
|
26
|
+
* },
|
|
27
|
+
* dark: {
|
|
28
|
+
* 'primary': 'oklch(0.70 0.18 290)',
|
|
29
|
+
* }
|
|
30
|
+
* }
|
|
31
|
+
* };
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @since 0.16.0
|
|
35
|
+
*/
|
|
36
|
+
interface ThemeConfig {
|
|
37
|
+
/**
|
|
38
|
+
* Schema version of this theme configuration.
|
|
39
|
+
* Used by `pika theme check` to notify you of new theme variables.
|
|
40
|
+
* See theme-schema.ts for the changelog of schema versions.
|
|
41
|
+
*
|
|
42
|
+
* @default 1 (if not specified)
|
|
43
|
+
* @example schemaVersion: 1
|
|
44
|
+
*/
|
|
45
|
+
schemaVersion?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Display name for this theme (for documentation/debugging)
|
|
48
|
+
* @example 'Acme Corp Brand Theme'
|
|
49
|
+
*/
|
|
50
|
+
name?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Font family override. Applied to --font-sans CSS variable.
|
|
53
|
+
* @example '"Figtree", Arial, Helvetica, sans-serif'
|
|
54
|
+
*/
|
|
55
|
+
fontFamily?: string;
|
|
56
|
+
/**
|
|
57
|
+
* CSS custom properties to override.
|
|
58
|
+
* Keys are CSS variable names WITHOUT the -- prefix.
|
|
59
|
+
* Values should be valid CSS color values (oklch preferred for modern color handling).
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```typescript
|
|
63
|
+
* cssVariables: {
|
|
64
|
+
* light: {
|
|
65
|
+
* 'primary': 'oklch(0.47 0.2 290)',
|
|
66
|
+
* 'border': 'oklch(0.88 0.01 260)',
|
|
67
|
+
* },
|
|
68
|
+
* dark: {
|
|
69
|
+
* 'primary': 'oklch(0.70 0.18 290)',
|
|
70
|
+
* }
|
|
71
|
+
* }
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
cssVariables?: {
|
|
75
|
+
/** Light mode variable overrides */
|
|
76
|
+
light?: Record<string, string>;
|
|
77
|
+
/** Dark mode variable overrides */
|
|
78
|
+
dark?: Record<string, string>;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Custom color palettes for your brand.
|
|
82
|
+
* Creates CSS variables like --{paletteName}-{shade}
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```typescript
|
|
86
|
+
* customPalettes: {
|
|
87
|
+
* brand: {
|
|
88
|
+
* '50': 'oklch(0.97 0.01 290)',
|
|
89
|
+
* '500': 'oklch(0.47 0.2 290)',
|
|
90
|
+
* '900': 'oklch(0.20 0.08 290)',
|
|
91
|
+
* }
|
|
92
|
+
* }
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
customPalettes?: Record<string, Record<string, string>>;
|
|
96
|
+
/**
|
|
97
|
+
* Custom header icon for chat apps. Replaces the default AI sparkle icon.
|
|
98
|
+
* The icon will be constrained to roughly 44x44px.
|
|
99
|
+
*
|
|
100
|
+
* Can be specified as:
|
|
101
|
+
* - A single string URL (used for both light and dark modes)
|
|
102
|
+
* - An object with separate light/dark URLs for mode-specific icons
|
|
103
|
+
*
|
|
104
|
+
* For sync-safe storage, place your icons in:
|
|
105
|
+
* `apps/pika-chat/static/custom/assets/`
|
|
106
|
+
*
|
|
107
|
+
* @example Single icon for both modes:
|
|
108
|
+
* ```typescript
|
|
109
|
+
* chatAppHeaderIcon: '/custom/assets/my-logo.svg'
|
|
110
|
+
* ```
|
|
111
|
+
*
|
|
112
|
+
* @example Separate icons for light/dark modes:
|
|
113
|
+
* ```typescript
|
|
114
|
+
* chatAppHeaderIcon: {
|
|
115
|
+
* light: '/custom/assets/logo-dark.svg', // Dark logo on light background
|
|
116
|
+
* dark: '/custom/assets/logo-light.svg' // Light logo on dark background
|
|
117
|
+
* }
|
|
118
|
+
* ```
|
|
119
|
+
*
|
|
120
|
+
* @since 0.16.4
|
|
121
|
+
*/
|
|
122
|
+
chatAppHeaderIcon?: string | {
|
|
123
|
+
/** Icon URL for light mode */
|
|
124
|
+
light: string;
|
|
125
|
+
/** Icon URL for dark mode (falls back to light if not provided) */
|
|
126
|
+
dark?: string;
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Configuration for the custom theme feature in pika-config.ts
|
|
131
|
+
*
|
|
132
|
+
* @since 0.16.0
|
|
133
|
+
*/
|
|
134
|
+
interface CustomThemeConfig {
|
|
135
|
+
/**
|
|
136
|
+
* Whether custom theming is enabled.
|
|
137
|
+
* If false, the default Pika theme is used and the theme config is not loaded.
|
|
138
|
+
*/
|
|
139
|
+
enabled: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Path to theme config file relative to apps/pika-chat/
|
|
142
|
+
* The file must export a `themeConfig` object of type ThemeConfig.
|
|
143
|
+
*
|
|
144
|
+
* @default 'src/lib/custom/sample-purple-theme'
|
|
145
|
+
* @example 'src/lib/custom/my-theme' imports from 'apps/pika-chat/src/lib/custom/my-theme.ts'
|
|
146
|
+
*/
|
|
147
|
+
themeConfigPath?: string;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Standard semantic variable names that can be overridden in a theme.
|
|
151
|
+
* These are the shadcn-svelte standard variables plus Pika extensions.
|
|
152
|
+
*
|
|
153
|
+
* @since 0.16.0
|
|
154
|
+
*/
|
|
155
|
+
type SemanticColorVariable = 'background' | 'foreground' | 'card' | 'card-foreground' | 'popover' | 'popover-foreground' | 'primary' | 'primary-foreground' | 'secondary' | 'secondary-foreground' | 'muted' | 'muted-foreground' | 'accent' | 'accent-foreground' | 'destructive' | 'destructive-foreground' | 'border' | 'input' | 'ring' | 'chart-1' | 'chart-2' | 'chart-3' | 'chart-4' | 'chart-5' | 'sidebar-background' | 'sidebar-foreground' | 'sidebar-primary' | 'sidebar-primary-foreground' | 'sidebar-accent' | 'sidebar-accent-foreground' | 'sidebar-border' | 'sidebar-ring' | 'success' | 'success-foreground' | 'success-bg' | 'warning' | 'warning-foreground' | 'warning-bg' | 'info' | 'info-foreground' | 'info-bg' | 'ai' | 'ai-foreground' | 'ai-bg' | 'danger-bg' | 'chat-app-icon' | 'chat-app-header-icon-height' | 'chat-app-header-icon-gap';
|
|
156
|
+
/**
|
|
157
|
+
* All semantic variables as a readonly array for iteration
|
|
158
|
+
*
|
|
159
|
+
* @since 0.16.0
|
|
160
|
+
*/
|
|
161
|
+
declare const SEMANTIC_COLOR_VARIABLES: readonly SemanticColorVariable[];
|
|
162
|
+
|
|
163
|
+
export { type CustomThemeConfig, SEMANTIC_COLOR_VARIABLES, type SemanticColorVariable, type ThemeConfig };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/types/chatbot/theme-types.ts
|
|
4
|
+
var SEMANTIC_COLOR_VARIABLES = [
|
|
5
|
+
// Core
|
|
6
|
+
"background",
|
|
7
|
+
"foreground",
|
|
8
|
+
"card",
|
|
9
|
+
"card-foreground",
|
|
10
|
+
"popover",
|
|
11
|
+
"popover-foreground",
|
|
12
|
+
"primary",
|
|
13
|
+
"primary-foreground",
|
|
14
|
+
"secondary",
|
|
15
|
+
"secondary-foreground",
|
|
16
|
+
"muted",
|
|
17
|
+
"muted-foreground",
|
|
18
|
+
"accent",
|
|
19
|
+
"accent-foreground",
|
|
20
|
+
"destructive",
|
|
21
|
+
"destructive-foreground",
|
|
22
|
+
"border",
|
|
23
|
+
"input",
|
|
24
|
+
"ring",
|
|
25
|
+
// Charts
|
|
26
|
+
"chart-1",
|
|
27
|
+
"chart-2",
|
|
28
|
+
"chart-3",
|
|
29
|
+
"chart-4",
|
|
30
|
+
"chart-5",
|
|
31
|
+
// Sidebar
|
|
32
|
+
"sidebar-background",
|
|
33
|
+
"sidebar-foreground",
|
|
34
|
+
"sidebar-primary",
|
|
35
|
+
"sidebar-primary-foreground",
|
|
36
|
+
"sidebar-accent",
|
|
37
|
+
"sidebar-accent-foreground",
|
|
38
|
+
"sidebar-border",
|
|
39
|
+
"sidebar-ring",
|
|
40
|
+
// Extended
|
|
41
|
+
"success",
|
|
42
|
+
"success-foreground",
|
|
43
|
+
"success-bg",
|
|
44
|
+
"warning",
|
|
45
|
+
"warning-foreground",
|
|
46
|
+
"warning-bg",
|
|
47
|
+
"info",
|
|
48
|
+
"info-foreground",
|
|
49
|
+
"info-bg",
|
|
50
|
+
"ai",
|
|
51
|
+
"ai-foreground",
|
|
52
|
+
"ai-bg",
|
|
53
|
+
"danger-bg",
|
|
54
|
+
// Header/branding
|
|
55
|
+
"chat-app-icon",
|
|
56
|
+
"chat-app-header-icon-height",
|
|
57
|
+
"chat-app-header-icon-gap"
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
exports.SEMANTIC_COLOR_VARIABLES = SEMANTIC_COLOR_VARIABLES;
|
|
61
|
+
//# sourceMappingURL=theme-types.js.map
|
|
62
|
+
//# sourceMappingURL=theme-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/types/chatbot/theme-types.ts"],"names":[],"mappings":";;;AA+NO,IAAM,wBAAA,GAA6D;AAAA;AAAA,EAEtE,YAAA;AAAA,EACA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,iBAAA;AAAA,EACA,SAAA;AAAA,EACA,oBAAA;AAAA,EACA,SAAA;AAAA,EACA,oBAAA;AAAA,EACA,WAAA;AAAA,EACA,sBAAA;AAAA,EACA,OAAA;AAAA,EACA,kBAAA;AAAA,EACA,QAAA;AAAA,EACA,mBAAA;AAAA,EACA,aAAA;AAAA,EACA,wBAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA;AAAA,EAEA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA;AAAA,EAEA,oBAAA;AAAA,EACA,oBAAA;AAAA,EACA,iBAAA;AAAA,EACA,4BAAA;AAAA,EACA,gBAAA;AAAA,EACA,2BAAA;AAAA,EACA,gBAAA;AAAA,EACA,cAAA;AAAA;AAAA,EAEA,SAAA;AAAA,EACA,oBAAA;AAAA,EACA,YAAA;AAAA,EACA,SAAA;AAAA,EACA,oBAAA;AAAA,EACA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,iBAAA;AAAA,EACA,SAAA;AAAA,EACA,IAAA;AAAA,EACA,eAAA;AAAA,EACA,OAAA;AAAA,EACA,WAAA;AAAA;AAAA,EAEA,eAAA;AAAA,EACA,6BAAA;AAAA,EACA;AACJ","file":"theme-types.js","sourcesContent":["/**\n * Theme Types for Pika UI Customization\n *\n * These types define the structure of theme configuration for clone projects.\n * Import via: import type { ThemeConfig } from 'pika-shared/types/chatbot/theme-types';\n *\n * @since 0.16.0\n */\n\n/**\n * Theme configuration for Pika Chat\n *\n * Clone projects copy sample-purple-theme.ts, customize it, and update themeConfigPath\n * in pika-config.ts to point to their theme file.\n *\n * @example\n * ```typescript\n * import type { ThemeConfig } from 'pika-shared/types/chatbot/theme-types';\n *\n * export const themeConfig: ThemeConfig = {\n * name: 'Acme Corp Theme',\n * fontFamily: '\"Inter\", sans-serif',\n * cssVariables: {\n * light: {\n * 'primary': 'oklch(0.47 0.2 290)',\n * 'primary-foreground': 'oklch(1 0 0)',\n * },\n * dark: {\n * 'primary': 'oklch(0.70 0.18 290)',\n * }\n * }\n * };\n * ```\n *\n * @since 0.16.0\n */\nexport interface ThemeConfig {\n /**\n * Schema version of this theme configuration.\n * Used by `pika theme check` to notify you of new theme variables.\n * See theme-schema.ts for the changelog of schema versions.\n *\n * @default 1 (if not specified)\n * @example schemaVersion: 1\n */\n schemaVersion?: number;\n\n /**\n * Display name for this theme (for documentation/debugging)\n * @example 'Acme Corp Brand Theme'\n */\n name?: string;\n\n /**\n * Font family override. Applied to --font-sans CSS variable.\n * @example '\"Figtree\", Arial, Helvetica, sans-serif'\n */\n fontFamily?: string;\n\n /**\n * CSS custom properties to override.\n * Keys are CSS variable names WITHOUT the -- prefix.\n * Values should be valid CSS color values (oklch preferred for modern color handling).\n *\n * @example\n * ```typescript\n * cssVariables: {\n * light: {\n * 'primary': 'oklch(0.47 0.2 290)',\n * 'border': 'oklch(0.88 0.01 260)',\n * },\n * dark: {\n * 'primary': 'oklch(0.70 0.18 290)',\n * }\n * }\n * ```\n */\n cssVariables?: {\n /** Light mode variable overrides */\n light?: Record<string, string>;\n /** Dark mode variable overrides */\n dark?: Record<string, string>;\n };\n\n /**\n * Custom color palettes for your brand.\n * Creates CSS variables like --{paletteName}-{shade}\n *\n * @example\n * ```typescript\n * customPalettes: {\n * brand: {\n * '50': 'oklch(0.97 0.01 290)',\n * '500': 'oklch(0.47 0.2 290)',\n * '900': 'oklch(0.20 0.08 290)',\n * }\n * }\n * ```\n */\n customPalettes?: Record<string, Record<string, string>>;\n\n /**\n * Custom header icon for chat apps. Replaces the default AI sparkle icon.\n * The icon will be constrained to roughly 44x44px.\n *\n * Can be specified as:\n * - A single string URL (used for both light and dark modes)\n * - An object with separate light/dark URLs for mode-specific icons\n *\n * For sync-safe storage, place your icons in:\n * `apps/pika-chat/static/custom/assets/`\n *\n * @example Single icon for both modes:\n * ```typescript\n * chatAppHeaderIcon: '/custom/assets/my-logo.svg'\n * ```\n *\n * @example Separate icons for light/dark modes:\n * ```typescript\n * chatAppHeaderIcon: {\n * light: '/custom/assets/logo-dark.svg', // Dark logo on light background\n * dark: '/custom/assets/logo-light.svg' // Light logo on dark background\n * }\n * ```\n *\n * @since 0.16.4\n */\n chatAppHeaderIcon?: string | {\n /** Icon URL for light mode */\n light: string;\n /** Icon URL for dark mode (falls back to light if not provided) */\n dark?: string;\n };\n}\n\n/**\n * Configuration for the custom theme feature in pika-config.ts\n *\n * @since 0.16.0\n */\nexport interface CustomThemeConfig {\n /**\n * Whether custom theming is enabled.\n * If false, the default Pika theme is used and the theme config is not loaded.\n */\n enabled: boolean;\n\n /**\n * Path to theme config file relative to apps/pika-chat/\n * The file must export a `themeConfig` object of type ThemeConfig.\n *\n * @default 'src/lib/custom/sample-purple-theme'\n * @example 'src/lib/custom/my-theme' imports from 'apps/pika-chat/src/lib/custom/my-theme.ts'\n */\n themeConfigPath?: string;\n}\n\n/**\n * Standard semantic variable names that can be overridden in a theme.\n * These are the shadcn-svelte standard variables plus Pika extensions.\n *\n * @since 0.16.0\n */\nexport type SemanticColorVariable =\n // Core shadcn variables\n | 'background'\n | 'foreground'\n | 'card'\n | 'card-foreground'\n | 'popover'\n | 'popover-foreground'\n | 'primary'\n | 'primary-foreground'\n | 'secondary'\n | 'secondary-foreground'\n | 'muted'\n | 'muted-foreground'\n | 'accent'\n | 'accent-foreground'\n | 'destructive'\n | 'destructive-foreground'\n | 'border'\n | 'input'\n | 'ring'\n // Chart colors\n | 'chart-1'\n | 'chart-2'\n | 'chart-3'\n | 'chart-4'\n | 'chart-5'\n // Sidebar variants\n | 'sidebar-background'\n | 'sidebar-foreground'\n | 'sidebar-primary'\n | 'sidebar-primary-foreground'\n | 'sidebar-accent'\n | 'sidebar-accent-foreground'\n | 'sidebar-border'\n | 'sidebar-ring'\n // Pika extended semantic colors\n | 'success'\n | 'success-foreground'\n | 'success-bg'\n | 'warning'\n | 'warning-foreground'\n | 'warning-bg'\n | 'info'\n | 'info-foreground'\n | 'info-bg'\n | 'ai'\n | 'ai-foreground'\n | 'ai-bg'\n | 'danger-bg'\n // Header/branding\n | 'chat-app-icon'\n | 'chat-app-header-icon-height'\n | 'chat-app-header-icon-gap';\n\n/**\n * All semantic variables as a readonly array for iteration\n *\n * @since 0.16.0\n */\nexport const SEMANTIC_COLOR_VARIABLES: readonly SemanticColorVariable[] = [\n // Core\n 'background',\n 'foreground',\n 'card',\n 'card-foreground',\n 'popover',\n 'popover-foreground',\n 'primary',\n 'primary-foreground',\n 'secondary',\n 'secondary-foreground',\n 'muted',\n 'muted-foreground',\n 'accent',\n 'accent-foreground',\n 'destructive',\n 'destructive-foreground',\n 'border',\n 'input',\n 'ring',\n // Charts\n 'chart-1',\n 'chart-2',\n 'chart-3',\n 'chart-4',\n 'chart-5',\n // Sidebar\n 'sidebar-background',\n 'sidebar-foreground',\n 'sidebar-primary',\n 'sidebar-primary-foreground',\n 'sidebar-accent',\n 'sidebar-accent-foreground',\n 'sidebar-border',\n 'sidebar-ring',\n // Extended\n 'success',\n 'success-foreground',\n 'success-bg',\n 'warning',\n 'warning-foreground',\n 'warning-bg',\n 'info',\n 'info-foreground',\n 'info-bg',\n 'ai',\n 'ai-foreground',\n 'ai-bg',\n 'danger-bg',\n // Header/branding\n 'chat-app-icon',\n 'chat-app-header-icon-height',\n 'chat-app-header-icon-gap'\n] as const;\n"]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// src/types/chatbot/theme-types.ts
|
|
2
|
+
var SEMANTIC_COLOR_VARIABLES = [
|
|
3
|
+
// Core
|
|
4
|
+
"background",
|
|
5
|
+
"foreground",
|
|
6
|
+
"card",
|
|
7
|
+
"card-foreground",
|
|
8
|
+
"popover",
|
|
9
|
+
"popover-foreground",
|
|
10
|
+
"primary",
|
|
11
|
+
"primary-foreground",
|
|
12
|
+
"secondary",
|
|
13
|
+
"secondary-foreground",
|
|
14
|
+
"muted",
|
|
15
|
+
"muted-foreground",
|
|
16
|
+
"accent",
|
|
17
|
+
"accent-foreground",
|
|
18
|
+
"destructive",
|
|
19
|
+
"destructive-foreground",
|
|
20
|
+
"border",
|
|
21
|
+
"input",
|
|
22
|
+
"ring",
|
|
23
|
+
// Charts
|
|
24
|
+
"chart-1",
|
|
25
|
+
"chart-2",
|
|
26
|
+
"chart-3",
|
|
27
|
+
"chart-4",
|
|
28
|
+
"chart-5",
|
|
29
|
+
// Sidebar
|
|
30
|
+
"sidebar-background",
|
|
31
|
+
"sidebar-foreground",
|
|
32
|
+
"sidebar-primary",
|
|
33
|
+
"sidebar-primary-foreground",
|
|
34
|
+
"sidebar-accent",
|
|
35
|
+
"sidebar-accent-foreground",
|
|
36
|
+
"sidebar-border",
|
|
37
|
+
"sidebar-ring",
|
|
38
|
+
// Extended
|
|
39
|
+
"success",
|
|
40
|
+
"success-foreground",
|
|
41
|
+
"success-bg",
|
|
42
|
+
"warning",
|
|
43
|
+
"warning-foreground",
|
|
44
|
+
"warning-bg",
|
|
45
|
+
"info",
|
|
46
|
+
"info-foreground",
|
|
47
|
+
"info-bg",
|
|
48
|
+
"ai",
|
|
49
|
+
"ai-foreground",
|
|
50
|
+
"ai-bg",
|
|
51
|
+
"danger-bg",
|
|
52
|
+
// Header/branding
|
|
53
|
+
"chat-app-icon",
|
|
54
|
+
"chat-app-header-icon-height",
|
|
55
|
+
"chat-app-header-icon-gap"
|
|
56
|
+
];
|
|
57
|
+
|
|
58
|
+
export { SEMANTIC_COLOR_VARIABLES };
|
|
59
|
+
//# sourceMappingURL=theme-types.mjs.map
|
|
60
|
+
//# sourceMappingURL=theme-types.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/types/chatbot/theme-types.ts"],"names":[],"mappings":";AA+NO,IAAM,wBAAA,GAA6D;AAAA;AAAA,EAEtE,YAAA;AAAA,EACA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,iBAAA;AAAA,EACA,SAAA;AAAA,EACA,oBAAA;AAAA,EACA,SAAA;AAAA,EACA,oBAAA;AAAA,EACA,WAAA;AAAA,EACA,sBAAA;AAAA,EACA,OAAA;AAAA,EACA,kBAAA;AAAA,EACA,QAAA;AAAA,EACA,mBAAA;AAAA,EACA,aAAA;AAAA,EACA,wBAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA;AAAA,EAEA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA;AAAA,EAEA,oBAAA;AAAA,EACA,oBAAA;AAAA,EACA,iBAAA;AAAA,EACA,4BAAA;AAAA,EACA,gBAAA;AAAA,EACA,2BAAA;AAAA,EACA,gBAAA;AAAA,EACA,cAAA;AAAA;AAAA,EAEA,SAAA;AAAA,EACA,oBAAA;AAAA,EACA,YAAA;AAAA,EACA,SAAA;AAAA,EACA,oBAAA;AAAA,EACA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,iBAAA;AAAA,EACA,SAAA;AAAA,EACA,IAAA;AAAA,EACA,eAAA;AAAA,EACA,OAAA;AAAA,EACA,WAAA;AAAA;AAAA,EAEA,eAAA;AAAA,EACA,6BAAA;AAAA,EACA;AACJ","file":"theme-types.mjs","sourcesContent":["/**\n * Theme Types for Pika UI Customization\n *\n * These types define the structure of theme configuration for clone projects.\n * Import via: import type { ThemeConfig } from 'pika-shared/types/chatbot/theme-types';\n *\n * @since 0.16.0\n */\n\n/**\n * Theme configuration for Pika Chat\n *\n * Clone projects copy sample-purple-theme.ts, customize it, and update themeConfigPath\n * in pika-config.ts to point to their theme file.\n *\n * @example\n * ```typescript\n * import type { ThemeConfig } from 'pika-shared/types/chatbot/theme-types';\n *\n * export const themeConfig: ThemeConfig = {\n * name: 'Acme Corp Theme',\n * fontFamily: '\"Inter\", sans-serif',\n * cssVariables: {\n * light: {\n * 'primary': 'oklch(0.47 0.2 290)',\n * 'primary-foreground': 'oklch(1 0 0)',\n * },\n * dark: {\n * 'primary': 'oklch(0.70 0.18 290)',\n * }\n * }\n * };\n * ```\n *\n * @since 0.16.0\n */\nexport interface ThemeConfig {\n /**\n * Schema version of this theme configuration.\n * Used by `pika theme check` to notify you of new theme variables.\n * See theme-schema.ts for the changelog of schema versions.\n *\n * @default 1 (if not specified)\n * @example schemaVersion: 1\n */\n schemaVersion?: number;\n\n /**\n * Display name for this theme (for documentation/debugging)\n * @example 'Acme Corp Brand Theme'\n */\n name?: string;\n\n /**\n * Font family override. Applied to --font-sans CSS variable.\n * @example '\"Figtree\", Arial, Helvetica, sans-serif'\n */\n fontFamily?: string;\n\n /**\n * CSS custom properties to override.\n * Keys are CSS variable names WITHOUT the -- prefix.\n * Values should be valid CSS color values (oklch preferred for modern color handling).\n *\n * @example\n * ```typescript\n * cssVariables: {\n * light: {\n * 'primary': 'oklch(0.47 0.2 290)',\n * 'border': 'oklch(0.88 0.01 260)',\n * },\n * dark: {\n * 'primary': 'oklch(0.70 0.18 290)',\n * }\n * }\n * ```\n */\n cssVariables?: {\n /** Light mode variable overrides */\n light?: Record<string, string>;\n /** Dark mode variable overrides */\n dark?: Record<string, string>;\n };\n\n /**\n * Custom color palettes for your brand.\n * Creates CSS variables like --{paletteName}-{shade}\n *\n * @example\n * ```typescript\n * customPalettes: {\n * brand: {\n * '50': 'oklch(0.97 0.01 290)',\n * '500': 'oklch(0.47 0.2 290)',\n * '900': 'oklch(0.20 0.08 290)',\n * }\n * }\n * ```\n */\n customPalettes?: Record<string, Record<string, string>>;\n\n /**\n * Custom header icon for chat apps. Replaces the default AI sparkle icon.\n * The icon will be constrained to roughly 44x44px.\n *\n * Can be specified as:\n * - A single string URL (used for both light and dark modes)\n * - An object with separate light/dark URLs for mode-specific icons\n *\n * For sync-safe storage, place your icons in:\n * `apps/pika-chat/static/custom/assets/`\n *\n * @example Single icon for both modes:\n * ```typescript\n * chatAppHeaderIcon: '/custom/assets/my-logo.svg'\n * ```\n *\n * @example Separate icons for light/dark modes:\n * ```typescript\n * chatAppHeaderIcon: {\n * light: '/custom/assets/logo-dark.svg', // Dark logo on light background\n * dark: '/custom/assets/logo-light.svg' // Light logo on dark background\n * }\n * ```\n *\n * @since 0.16.4\n */\n chatAppHeaderIcon?: string | {\n /** Icon URL for light mode */\n light: string;\n /** Icon URL for dark mode (falls back to light if not provided) */\n dark?: string;\n };\n}\n\n/**\n * Configuration for the custom theme feature in pika-config.ts\n *\n * @since 0.16.0\n */\nexport interface CustomThemeConfig {\n /**\n * Whether custom theming is enabled.\n * If false, the default Pika theme is used and the theme config is not loaded.\n */\n enabled: boolean;\n\n /**\n * Path to theme config file relative to apps/pika-chat/\n * The file must export a `themeConfig` object of type ThemeConfig.\n *\n * @default 'src/lib/custom/sample-purple-theme'\n * @example 'src/lib/custom/my-theme' imports from 'apps/pika-chat/src/lib/custom/my-theme.ts'\n */\n themeConfigPath?: string;\n}\n\n/**\n * Standard semantic variable names that can be overridden in a theme.\n * These are the shadcn-svelte standard variables plus Pika extensions.\n *\n * @since 0.16.0\n */\nexport type SemanticColorVariable =\n // Core shadcn variables\n | 'background'\n | 'foreground'\n | 'card'\n | 'card-foreground'\n | 'popover'\n | 'popover-foreground'\n | 'primary'\n | 'primary-foreground'\n | 'secondary'\n | 'secondary-foreground'\n | 'muted'\n | 'muted-foreground'\n | 'accent'\n | 'accent-foreground'\n | 'destructive'\n | 'destructive-foreground'\n | 'border'\n | 'input'\n | 'ring'\n // Chart colors\n | 'chart-1'\n | 'chart-2'\n | 'chart-3'\n | 'chart-4'\n | 'chart-5'\n // Sidebar variants\n | 'sidebar-background'\n | 'sidebar-foreground'\n | 'sidebar-primary'\n | 'sidebar-primary-foreground'\n | 'sidebar-accent'\n | 'sidebar-accent-foreground'\n | 'sidebar-border'\n | 'sidebar-ring'\n // Pika extended semantic colors\n | 'success'\n | 'success-foreground'\n | 'success-bg'\n | 'warning'\n | 'warning-foreground'\n | 'warning-bg'\n | 'info'\n | 'info-foreground'\n | 'info-bg'\n | 'ai'\n | 'ai-foreground'\n | 'ai-bg'\n | 'danger-bg'\n // Header/branding\n | 'chat-app-icon'\n | 'chat-app-header-icon-height'\n | 'chat-app-header-icon-gap';\n\n/**\n * All semantic variables as a readonly array for iteration\n *\n * @since 0.16.0\n */\nexport const SEMANTIC_COLOR_VARIABLES: readonly SemanticColorVariable[] = [\n // Core\n 'background',\n 'foreground',\n 'card',\n 'card-foreground',\n 'popover',\n 'popover-foreground',\n 'primary',\n 'primary-foreground',\n 'secondary',\n 'secondary-foreground',\n 'muted',\n 'muted-foreground',\n 'accent',\n 'accent-foreground',\n 'destructive',\n 'destructive-foreground',\n 'border',\n 'input',\n 'ring',\n // Charts\n 'chart-1',\n 'chart-2',\n 'chart-3',\n 'chart-4',\n 'chart-5',\n // Sidebar\n 'sidebar-background',\n 'sidebar-foreground',\n 'sidebar-primary',\n 'sidebar-primary-foreground',\n 'sidebar-accent',\n 'sidebar-accent-foreground',\n 'sidebar-border',\n 'sidebar-ring',\n // Extended\n 'success',\n 'success-foreground',\n 'success-bg',\n 'warning',\n 'warning-foreground',\n 'warning-bg',\n 'info',\n 'info-foreground',\n 'info-bg',\n 'ai',\n 'ai-foreground',\n 'ai-bg',\n 'danger-bg',\n // Header/branding\n 'chat-app-icon',\n 'chat-app-header-icon-height',\n 'chat-app-header-icon-gap'\n] as const;\n"]}
|