paperclip-theme 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/README.md +47 -0
- package/dist/constants.d.ts +82 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +644 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/manifest.d.ts +4 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +31 -0
- package/dist/manifest.js.map +1 -0
- package/dist/ui/index.js +815 -0
- package/dist/ui/index.js.map +7 -0
- package/dist/worker.d.ts +4 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +73 -0
- package/dist/worker.js.map +1 -0
- package/package.json +44 -0
- package/scripts/build-ui.mjs +24 -0
- package/src/constants.ts +668 -0
- package/src/index.ts +2 -0
- package/src/manifest.ts +39 -0
- package/src/ui/index.tsx +914 -0
- package/src/worker.ts +105 -0
- package/tsconfig.json +21 -0
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# @blazo/paperclip-theme
|
|
2
|
+
|
|
3
|
+
In-app theme customizer for [Paperclip](https://github.com/paperclipai/paperclip) with live preview, curated presets, and shareable configurations.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Live Preview** — Changes apply instantly via CSS custom property injection. No rebuild, no refresh.
|
|
8
|
+
- **Curated Presets** — Ship with 6 carefully designed themes (dark + light variants).
|
|
9
|
+
- **Token Editor** — Fine-tune individual design tokens with color pickers grouped by role.
|
|
10
|
+
- **Border Radius** — Adjust global corner rounding with a visual slider.
|
|
11
|
+
- **Persistent** — Theme choices are saved server-side and restored on page load.
|
|
12
|
+
- **Shareable** — Export/import theme configs as JSON (coming soon).
|
|
13
|
+
|
|
14
|
+
## Presets
|
|
15
|
+
|
|
16
|
+
| Preset | Mode | Description |
|
|
17
|
+
|--------|------|-------------|
|
|
18
|
+
| Paperclip Dark | Dark | The stock Paperclip dark theme |
|
|
19
|
+
| Paperclip Light | Light | The stock Paperclip light theme |
|
|
20
|
+
| Midnight Blue | Dark | Deep navy surfaces with electric blue accents |
|
|
21
|
+
| Emerald Noir | Dark | Elegant dark with rich green highlights |
|
|
22
|
+
| Warm Sand | Light | Soft warm light theme with earthy tones |
|
|
23
|
+
| Rosé Twilight | Dark | Dusky pink-tinted dark theme with warm accents |
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# From the monorepo root
|
|
29
|
+
pnpm install
|
|
30
|
+
pnpm build
|
|
31
|
+
|
|
32
|
+
# Install into your Paperclip instance
|
|
33
|
+
paperclipai plugin install ./plugins/theme
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Usage
|
|
37
|
+
|
|
38
|
+
After installation, navigate to **Settings** in Paperclip. You'll find a new **Theme** section where you can:
|
|
39
|
+
|
|
40
|
+
1. Click a preset to instantly preview it
|
|
41
|
+
2. Fine-tune any token with the color picker
|
|
42
|
+
3. Adjust border radius with the slider
|
|
43
|
+
4. Click **Save Theme** to persist your choice
|
|
44
|
+
|
|
45
|
+
## License
|
|
46
|
+
|
|
47
|
+
MIT
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export declare const PLUGIN_ID = "blazo.paperclip-theme";
|
|
2
|
+
export declare const PLUGIN_VERSION = "0.1.0";
|
|
3
|
+
export declare const SLOT_IDS: {
|
|
4
|
+
readonly settingsPage: "theme-settings-page";
|
|
5
|
+
};
|
|
6
|
+
export declare const EXPORT_NAMES: {
|
|
7
|
+
readonly settingsPage: "ThemeSettingsPage";
|
|
8
|
+
};
|
|
9
|
+
export declare const STATE_KEYS: {
|
|
10
|
+
readonly activeTheme: "active-theme";
|
|
11
|
+
};
|
|
12
|
+
export declare const DATA_ENDPOINTS: {
|
|
13
|
+
readonly activeTheme: "active-theme";
|
|
14
|
+
readonly presets: "presets";
|
|
15
|
+
};
|
|
16
|
+
export declare const ACTION_NAMES: {
|
|
17
|
+
readonly applyTheme: "apply-theme";
|
|
18
|
+
readonly resetTheme: "reset-theme";
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Semantic CSS custom properties that control Paperclip's entire look.
|
|
22
|
+
* Grouped by role for the settings UI.
|
|
23
|
+
*/
|
|
24
|
+
export declare const TOKEN_GROUPS: {
|
|
25
|
+
readonly surface: {
|
|
26
|
+
readonly label: "Surfaces";
|
|
27
|
+
readonly description: "Background and card colors";
|
|
28
|
+
readonly tokens: readonly ["--background", "--card", "--muted", "--accent"];
|
|
29
|
+
};
|
|
30
|
+
readonly text: {
|
|
31
|
+
readonly label: "Text";
|
|
32
|
+
readonly description: "Foreground and label colors";
|
|
33
|
+
readonly tokens: readonly ["--foreground", "--card-foreground", "--muted-foreground", "--accent-foreground"];
|
|
34
|
+
};
|
|
35
|
+
readonly interactive: {
|
|
36
|
+
readonly label: "Interactive";
|
|
37
|
+
readonly description: "Buttons, links, and primary actions";
|
|
38
|
+
readonly tokens: readonly ["--primary", "--primary-foreground"];
|
|
39
|
+
};
|
|
40
|
+
readonly feedback: {
|
|
41
|
+
readonly label: "Feedback";
|
|
42
|
+
readonly description: "Errors and destructive actions";
|
|
43
|
+
readonly tokens: readonly ["--destructive", "--destructive-foreground"];
|
|
44
|
+
};
|
|
45
|
+
readonly structure: {
|
|
46
|
+
readonly label: "Structure";
|
|
47
|
+
readonly description: "Borders, radius, and layout";
|
|
48
|
+
readonly tokens: readonly ["--border", "--input", "--ring"];
|
|
49
|
+
};
|
|
50
|
+
readonly charts: {
|
|
51
|
+
readonly label: "Charts";
|
|
52
|
+
readonly description: "Dashboard visualization colors";
|
|
53
|
+
readonly tokens: readonly ["--chart-1", "--chart-2", "--chart-3", "--chart-4", "--chart-5"];
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Complete theme configuration shape.
|
|
58
|
+
* Values are raw CSS values (oklch, hex, px, etc.).
|
|
59
|
+
*/
|
|
60
|
+
export interface ThemeConfig {
|
|
61
|
+
id: string;
|
|
62
|
+
name: string;
|
|
63
|
+
description: string;
|
|
64
|
+
author: string;
|
|
65
|
+
isDark: boolean;
|
|
66
|
+
tokens: Record<string, string>;
|
|
67
|
+
radius: string;
|
|
68
|
+
createdAt: string;
|
|
69
|
+
updatedAt: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The default Paperclip dark theme — extracted from the shipped CSS.
|
|
73
|
+
* This is the baseline; all presets override from here.
|
|
74
|
+
*/
|
|
75
|
+
export declare const PAPERCLIP_DARK_DEFAULTS: Record<string, string>;
|
|
76
|
+
export declare const PAPERCLIP_LIGHT_DEFAULTS: Record<string, string>;
|
|
77
|
+
/**
|
|
78
|
+
* Curated theme presets.
|
|
79
|
+
* Each preset provides a complete token override set.
|
|
80
|
+
*/
|
|
81
|
+
export declare const THEME_PRESETS: ThemeConfig[];
|
|
82
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,0BAA0B,CAAC;AACjD,eAAO,MAAM,cAAc,UAAU,CAAC;AAEtC,eAAO,MAAM,QAAQ;;CAEX,CAAC;AAEX,eAAO,MAAM,YAAY;;CAEf,CAAC;AAEX,eAAO,MAAM,UAAU;;CAEb,CAAC;AAEX,eAAO,MAAM,cAAc;;;CAGjB,CAAC;AAEX,eAAO,MAAM,YAAY;;;CAGf,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+Bf,CAAC;AAEX;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAqB1D,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAqB3D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,WAAW,EAuhBtC,CAAC"}
|