@contentstudio/ui 0.1.57 → 0.2.1

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.
@@ -0,0 +1,107 @@
1
+ declare type ColorName = 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info' | 'green' | 'yellow' | 'orange' | 'red';
2
+
3
+ /**
4
+ * Create a theme preset - a predefined theme configuration
5
+ */
6
+ export declare function createThemePreset(name: string, theme: Partial<ThemeOptions>): ThemePreset;
7
+
8
+ /**
9
+ * Export configuration as a string that can be written to tailwind.config.js
10
+ */
11
+ export declare function exportTailwindConfig(theme: ThemeOptions, options?: TailwindConfigOptions): string;
12
+
13
+ /**
14
+ * Extend the default theme with custom colors
15
+ */
16
+ export declare function extendTheme(customTheme: Partial<ThemeOptions>): ThemeOptions;
17
+
18
+ /**
19
+ * Generate complete CSTU color configuration for client-side usage
20
+ * Returns static color config matching tailwind.config.js with cstu- prefix
21
+ * Usage: cstu-bg-primary-500, cstu-text-danger-600, etc.
22
+ */
23
+ export declare function generateCstuColorConfig(): Record<string, Record<string, string>>;
24
+
25
+ export declare function generatePalette(options: ThemeOptions): Palette;
26
+
27
+ /**
28
+ * Generate Tailwind safelist patterns for dynamic classes
29
+ */
30
+ export declare function generateSafelist(palette: Palette): string[];
31
+
32
+ /**
33
+ * Generate Tailwind color configuration from palette using direct RGB values
34
+ */
35
+ export declare function generateTailwindColors(palette: Palette): Record<string, Record<string, string>>;
36
+
37
+ /**
38
+ * Deep merge two theme objects, with the second theme taking precedence
39
+ */
40
+ export declare function mergeThemes(baseTheme: ThemeOptions, extendTheme: Partial<ThemeOptions>): ThemeOptions;
41
+
42
+ /**
43
+ * A mapping of color -> shade -> hex string
44
+ */
45
+ export declare type Palette = Record<ColorName, Record<Shade, string>>;
46
+
47
+ export declare type Shade = 50 | 100 | 200 | 250 | 300 | 400 | 450 | 500 | 550 | 575 | 600 | 700 | 800 | 900;
48
+
49
+ declare interface TailwindConfigOptions {
50
+ content?: string[];
51
+ darkMode?: 'media' | 'class';
52
+ extendTheme?: Record<string, any>;
53
+ plugins?: any[];
54
+ }
55
+
56
+ export declare interface ThemeOptions {
57
+ /** Seed color to generate primary palette. Hex string */
58
+ primary?: string;
59
+ /** Seed color to generate secondary/gray palette */
60
+ secondary?: string;
61
+ /** Seed color to generate success palette */
62
+ success?: string;
63
+ /** Seed color to generate warning palette */
64
+ warning?: string;
65
+ /** Seed color to generate danger palette */
66
+ danger?: string;
67
+ /** Seed color to generate info palette */
68
+ info?: string;
69
+ /** Seed color to generate green palette (legacy) */
70
+ green?: string;
71
+ /** Seed color to generate yellow palette (legacy) */
72
+ yellow?: string;
73
+ /** Seed color to generate orange palette (legacy) */
74
+ orange?: string;
75
+ /** Seed color to generate red palette (legacy) */
76
+ red?: string;
77
+ }
78
+
79
+ /**
80
+ * Theme preset interface
81
+ */
82
+ export declare interface ThemePreset {
83
+ name: string;
84
+ theme: ThemeOptions;
85
+ metadata: {
86
+ created: string;
87
+ version: string;
88
+ description?: string;
89
+ author?: string;
90
+ };
91
+ }
92
+
93
+ /**
94
+ * Theme validation result
95
+ */
96
+ export declare interface ThemeValidationResult {
97
+ isValid: boolean;
98
+ errors: string[];
99
+ warnings: string[];
100
+ }
101
+
102
+ /**
103
+ * Validate a theme configuration
104
+ */
105
+ export declare function validateTheme(theme: Partial<ThemeOptions>): ThemeValidationResult;
106
+
107
+ export { }
@@ -0,0 +1,12 @@
1
+ import { b as s, p as t, e as r, k as n, g as o, l as g, j as i, m as l, v as m } from "./tailwind-9ac4bb2b.js";
2
+ export {
3
+ s as createThemePreset,
4
+ t as exportTailwindConfig,
5
+ r as extendTheme,
6
+ n as generateCstuColorConfig,
7
+ o as generatePalette,
8
+ g as generateSafelist,
9
+ i as generateTailwindColors,
10
+ l as mergeThemes,
11
+ m as validateTheme
12
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./tailwind-6a119e86.cjs");exports.createThemePreset=e.createThemePreset;exports.exportTailwindConfig=e.exportTailwindConfig;exports.extendTheme=e.extendTheme;exports.generateCstuColorConfig=e.generateCstuColorConfig;exports.generatePalette=e.generatePalette;exports.generateSafelist=e.generateSafelist;exports.generateTailwindColors=e.generateTailwindColors;exports.mergeThemes=e.mergeThemes;exports.validateTheme=e.validateTheme;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentstudio/ui",
3
- "version": "0.1.57",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -15,16 +15,25 @@
15
15
  "require": "./dist/index.js",
16
16
  "types": "./dist/index.d.ts"
17
17
  },
18
- "./dist/style.css": "./dist/style.css"
18
+ "./dist/style.css": "./dist/style.css",
19
+ "./dist/tailwind": {
20
+ "import": "./dist/tailwind.js",
21
+ "require": "./dist/tailwind.umd.cjs",
22
+ "types": "./dist/tailwind.d.ts"
23
+ }
19
24
  },
20
25
  "dependencies": {
26
+ "@types/tinycolor2": "^1.4.6",
27
+ "chroma-js": "^2.4.2",
21
28
  "lucide-vue-next": "^0.525.0",
29
+ "tinycolor2": "^1.6.0",
22
30
  "vue": "^3.2.47",
23
31
  "vue-router": "^4.5.0",
24
32
  "vue3-toastify": "0.1.4"
25
33
  },
26
34
  "devDependencies": {
27
35
  "@floating-ui/vue": "^1.1.5",
36
+ "@types/chroma-js": "^3.1.1",
28
37
  "@types/node": "^22.10.1",
29
38
  "@vitejs/plugin-vue": "^4.6.2",
30
39
  "@vueuse/core": "^12.0.0",