dolphincss 1.2.6 → 1.2.7
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 +79 -146
- package/dist/assets/css-DlLFJrG5.css +1 -0
- package/dist/index.html +1 -1
- package/dist/index.js +77 -12
- package/dolphin-css.css +2 -2
- package/package.json +19 -8
- package/scripts/components.js +195 -0
- package/scripts/dolphin-watch.js +53 -0
- package/scripts/setup-snippets.cjs +44 -0
- package/snippets/dolphincss.json +74 -0
- package/vite-plugin.js +85 -0
- package/dist/assets/css-Dg8YLqt0.css +0 -1
package/package.json
CHANGED
|
@@ -1,22 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dolphincss",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "DolphinCSS - World-class TailwindCSS + React component library",
|
|
6
6
|
"main": "dolphin-css.css",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./dolphin-css.css",
|
|
9
|
+
"./vite-plugin": "./vite-plugin.js"
|
|
10
|
+
},
|
|
7
11
|
"files": [
|
|
8
12
|
"dist/",
|
|
9
13
|
"dolphin-css.css",
|
|
10
14
|
"README.md",
|
|
11
|
-
"LICENSE"
|
|
15
|
+
"LICENSE",
|
|
16
|
+
"snippets/",
|
|
17
|
+
"scripts/",
|
|
18
|
+
"vite-plugin.js"
|
|
12
19
|
],
|
|
13
20
|
"scripts": {
|
|
14
|
-
"dev": "vite",
|
|
21
|
+
"dev": "concurrently \"vite\" \"npm run watch:dolphin\"",
|
|
22
|
+
"watch:dolphin": "node scripts/dolphin-watch.js",
|
|
15
23
|
"build:css": "npx @tailwindcss/cli -i ./src/dolphin-css/App.css -o ./dolphin-css.css --minify",
|
|
16
24
|
"watch:css": "npx @tailwindcss/cli -i ./src/dolphin-css/App.css -o ./dolphin-css.css --watch",
|
|
17
25
|
"build": "vite build && npm run build:css",
|
|
18
26
|
"lint": "eslint .",
|
|
19
|
-
"preview": "vite preview"
|
|
27
|
+
"preview": "vite preview",
|
|
28
|
+
"postinstall": "node scripts/setup-snippets.cjs"
|
|
20
29
|
},
|
|
21
30
|
"keywords": [
|
|
22
31
|
"css",
|
|
@@ -28,22 +37,24 @@
|
|
|
28
37
|
"author": "Shankar Phunyal",
|
|
29
38
|
"license": "MIT",
|
|
30
39
|
"peerDependencies": {
|
|
40
|
+
"lucide-react": ">=0.4",
|
|
31
41
|
"react": ">=18",
|
|
32
|
-
"react-dom": ">=18"
|
|
33
|
-
"lucide-react": ">=0.4"
|
|
42
|
+
"react-dom": ">=18"
|
|
34
43
|
},
|
|
35
44
|
"devDependencies": {
|
|
36
|
-
"@tailwindcss/vite": "^4.1.16",
|
|
37
|
-
"tailwindcss": "^4.1.16",
|
|
38
45
|
"@eslint/js": "^9.36.0",
|
|
46
|
+
"@tailwindcss/vite": "^4.1.16",
|
|
39
47
|
"@types/react": "^19.1.16",
|
|
40
48
|
"@types/react-dom": "^19.1.9",
|
|
41
49
|
"@vitejs/plugin-react": "^5.0.4",
|
|
50
|
+
"chokidar": "^5.0.0",
|
|
51
|
+
"concurrently": "^10.0.0",
|
|
42
52
|
"eslint": "^9.36.0",
|
|
43
53
|
"eslint-plugin-react": "^7.37.5",
|
|
44
54
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
45
55
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
46
56
|
"globals": "^16.4.0",
|
|
57
|
+
"tailwindcss": "^4.1.16",
|
|
47
58
|
"vite": "^7.1.7"
|
|
48
59
|
}
|
|
49
60
|
}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"dolphin-form": `
|
|
3
|
+
<div className="glass card p-6 lg:p-8 border border-white/20 rounded-2xl" style={{ backdropFilter: 'blur(20px)' }}>
|
|
4
|
+
<h3 className="text-xl font-bold text-white mb-6">Quick Actions</h3>
|
|
5
|
+
<form className="flex-col-left w-full gap-5">
|
|
6
|
+
<div className="w-full">
|
|
7
|
+
<div className="floatinglabel input-icon-left w-full">
|
|
8
|
+
<Mail size={20} className="icon-left text-primary-500" style={{ left: '1rem' }} />
|
|
9
|
+
<input type="email" id="email" className="floatinglabel-input lg w-full bg-white/10 border-white/20 focus:border-primary-400 transition-colors rounded-xl text-white placeholder:text-transparent" style={{ paddingLeft: '3.5rem' }} placeholder=" " />
|
|
10
|
+
<label htmlFor="email" className="floatinglabel-label text-white/70 font-medium" style={{ zIndex: 10 }}>Email Address</label>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<div className="w-full">
|
|
15
|
+
<div className="floatinglabel input-icon-both w-full">
|
|
16
|
+
<Lock size={20} className="icon-left text-primary-500" style={{ left: '1rem' }} />
|
|
17
|
+
<input type="password" id="password" className="floatinglabel-input lg w-full bg-white/10 border-white/20 focus:border-primary-400 transition-colors rounded-xl text-white placeholder:text-transparent" style={{ paddingLeft: '3.5rem', paddingRight: '3.5rem' }} placeholder=" " />
|
|
18
|
+
<label htmlFor="password" className="floatinglabel-label text-white/70 font-medium" style={{ zIndex: 10 }}>Password</label>
|
|
19
|
+
<button type="button" className="icon-right text-white/50 hover:text-white transition-colors" style={{ zIndex: 20, right: '1rem' }}>
|
|
20
|
+
<Eye size={20} />
|
|
21
|
+
</button>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<label className="radio-item flex-left gap-2 cursor-pointer w-full mt-2">
|
|
26
|
+
<input type="checkbox" className="accent-primary-500 w-4 h-4 rounded border-white/30 bg-white/10" />
|
|
27
|
+
<span className="text-sm font-medium text-white/80">Subscribe to newsletter</span>
|
|
28
|
+
</label>
|
|
29
|
+
|
|
30
|
+
<button type="button" className="filled primary-600 w-full py-3 rounded-xl text-white font-bold hover:shadow-lg hover:-translate-y-0.5 transition-all duration-300 mt-2 glow">
|
|
31
|
+
Submit Data
|
|
32
|
+
</button>
|
|
33
|
+
</form>
|
|
34
|
+
</div>
|
|
35
|
+
`.trim(),
|
|
36
|
+
"dolphin-table": `
|
|
37
|
+
<div className="glass card p-6 border border-white/20 rounded-2xl overflow-hidden" style={{ backdropFilter: 'blur(20px)' }}>
|
|
38
|
+
<div className="flex-between mb-6">
|
|
39
|
+
<h3 className="text-xl font-bold text-white m-0">Recent Transactions</h3>
|
|
40
|
+
<button className="text-primary-300 text-sm font-medium hover:underline bg-transparent border-none cursor-pointer flex-center">
|
|
41
|
+
View All <ChevronRight size={16} />
|
|
42
|
+
</button>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<div className="w-full overflow-x-auto">
|
|
46
|
+
<table className="w-full text-left border-collapse">
|
|
47
|
+
<thead>
|
|
48
|
+
<tr className="border-b border-white/10 text-white/60 text-sm uppercase tracking-wider">
|
|
49
|
+
<th className="pb-3 font-medium">Customer</th>
|
|
50
|
+
<th className="pb-3 font-medium">Date</th>
|
|
51
|
+
<th className="pb-3 font-medium">Amount</th>
|
|
52
|
+
<th className="pb-3 font-medium">Status</th>
|
|
53
|
+
</tr>
|
|
54
|
+
</thead>
|
|
55
|
+
<tbody className="text-white">
|
|
56
|
+
<tr className="border-b border-white/5 hover:bg-white/5 transition-colors">
|
|
57
|
+
<td className="py-4 flex-left gap-3">
|
|
58
|
+
<div className="circle sm filled primary-500 text-white font-bold text-xs flex-center">JD</div>
|
|
59
|
+
<span className="font-medium">John Doe</span>
|
|
60
|
+
</td>
|
|
61
|
+
<td className="py-4 text-white/70">Oct 24, 2025</td>
|
|
62
|
+
<td className="py-4 font-bold">$120.50</td>
|
|
63
|
+
<td className="py-4"><span className="px-2 py-1 rounded-md bg-success-500/20 text-success-300 text-xs font-bold">Completed</span></td>
|
|
64
|
+
</tr>
|
|
65
|
+
<tr className="hover:bg-white/5 transition-colors">
|
|
66
|
+
<td className="py-4 flex-left gap-3">
|
|
67
|
+
<div className="circle sm filled secondary-500 text-white font-bold text-xs flex-center">SS</div>
|
|
68
|
+
<span className="font-medium">Sarah Smith</span>
|
|
69
|
+
</td>
|
|
70
|
+
<td className="py-4 text-white/70">Oct 23, 2025</td>
|
|
71
|
+
<td className="py-4 font-bold">$340.00</td>
|
|
72
|
+
<td className="py-4"><span className="px-2 py-1 rounded-md bg-warning-500/20 text-warning-300 text-xs font-bold">Pending</span></td>
|
|
73
|
+
</tr>
|
|
74
|
+
</tbody>
|
|
75
|
+
</table>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
`.trim(),
|
|
79
|
+
"dolphin-toast": `
|
|
80
|
+
{/* Ultra Simple Toast */}
|
|
81
|
+
<div className="fixed bottom-6 right-6 z-[9999]">
|
|
82
|
+
<div className="toast">
|
|
83
|
+
<span className="text-2xl drop-shadow-md">✅</span>
|
|
84
|
+
<div className="flex-1">
|
|
85
|
+
<span className="font-bold block">Success!</span>
|
|
86
|
+
<span className="opacity-70 text-sm">Action completed beautifully.</span>
|
|
87
|
+
</div>
|
|
88
|
+
<button className="opacity-50 hover:opacity-100 transition-opacity cursor-pointer text-lg">✕</button>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
`.trim(),
|
|
92
|
+
"dolphin-modal": `
|
|
93
|
+
{/* Ultra Simple Native Modal */}
|
|
94
|
+
<dialog className="modal" open>
|
|
95
|
+
<h3 className="text-2xl font-bold mb-3">Action Required</h3>
|
|
96
|
+
<p className="opacity-80 mb-6 leading-relaxed">
|
|
97
|
+
This modal uses the native HTML <code><dialog></code> element.
|
|
98
|
+
No wrapper divs, no complex positioning classes. Just pure CSS magic!
|
|
99
|
+
</p>
|
|
100
|
+
<div className="flex-right gap-3">
|
|
101
|
+
<button className="outlined plain py-2 px-4 rounded-lg">Cancel</button>
|
|
102
|
+
<button className="filled primary-500 text-white py-2 px-4 rounded-lg glow">Confirm Action</button>
|
|
103
|
+
</div>
|
|
104
|
+
</dialog>
|
|
105
|
+
`.trim(),
|
|
106
|
+
"dolphin-button": `
|
|
107
|
+
<div className="flex-left gap-4 flex-wrap p-4 glass rounded-xl border border-white/10" style={{ backdropFilter: 'blur(10px)' }}>
|
|
108
|
+
<button className="filled primary-500 text-white py-2 px-6 rounded-lg font-bold hover:shadow-lg hover:-translate-y-0.5 transition-all glow">
|
|
109
|
+
Primary Action
|
|
110
|
+
</button>
|
|
111
|
+
<button className="filled secondary-500 text-white py-2 px-6 rounded-lg font-bold hover:shadow-lg hover:-translate-y-0.5 transition-all glow">
|
|
112
|
+
Secondary
|
|
113
|
+
</button>
|
|
114
|
+
<button className="outlined plain py-2 px-6 rounded-lg font-bold border-2 border-white/30 hover:border-white hover:bg-white/10 transition-all">
|
|
115
|
+
Outlined
|
|
116
|
+
</button>
|
|
117
|
+
<button className="ghost py-2 px-6 rounded-lg font-bold hover:bg-white/10 transition-colors">
|
|
118
|
+
Ghost Button
|
|
119
|
+
</button>
|
|
120
|
+
</div>
|
|
121
|
+
`.trim(),
|
|
122
|
+
"dolphin-card": `
|
|
123
|
+
<div className="glass card p-6 border border-white/20 rounded-2xl max-w-sm hover:shadow-xl hover:-translate-y-1 transition-all duration-300 relative overflow-hidden" style={{ backdropFilter: 'blur(20px)' }}>
|
|
124
|
+
<div className="absolute top-0 right-0 w-32 h-32 bg-primary-500/20 rounded-full blur-2xl"></div>
|
|
125
|
+
<div className="flex-left gap-4 mb-4 relative z-10">
|
|
126
|
+
<div className="w-16 h-16 rounded-full border-2 border-primary-400 overflow-hidden shadow-lg p-0.5">
|
|
127
|
+
<img src="https://i.pravatar.cc/150?img=11" alt="Profile" className="w-full h-full rounded-full object-cover" />
|
|
128
|
+
</div>
|
|
129
|
+
<div>
|
|
130
|
+
<h3 className="text-xl font-bold text-white m-0">Alex Developer</h3>
|
|
131
|
+
<p className="text-primary-300 text-sm font-medium">Software Engineer</p>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
<p className="text-white/70 text-sm leading-relaxed mb-6 relative z-10">
|
|
135
|
+
Passionate about building magical user experiences and world-class design systems using DolphinCSS.
|
|
136
|
+
</p>
|
|
137
|
+
<div className="flex-between relative z-10">
|
|
138
|
+
<div className="flex gap-2">
|
|
139
|
+
<span className="px-3 py-1 rounded-full bg-white/10 text-xs font-medium text-white/90">React</span>
|
|
140
|
+
<span className="px-3 py-1 rounded-full bg-white/10 text-xs font-medium text-white/90">Tailwind</span>
|
|
141
|
+
</div>
|
|
142
|
+
<button className="circle filled primary-500 text-white p-2 hover:shadow-lg hover:scale-110 transition-all flex-center">
|
|
143
|
+
<ChevronRight size={16} />
|
|
144
|
+
</button>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
`.trim(),
|
|
148
|
+
"dolphin-navbar": `
|
|
149
|
+
<nav className="glass w-full py-4 px-6 md:px-8 border-b border-white/10 flex-between sticky top-0 z-50 shadow-sm" style={{ backdropFilter: 'blur(24px)' }}>
|
|
150
|
+
<div className="flex-left gap-2 cursor-pointer">
|
|
151
|
+
<div className="circle sm filled primary-500 text-white font-bold flex-center glow">🐬</div>
|
|
152
|
+
<span className="text-xl font-bold text-white tracking-tight">Dolphin</span>
|
|
153
|
+
</div>
|
|
154
|
+
<div className="hidden md:flex gap-6">
|
|
155
|
+
<a href="#" className="text-white/80 hover:text-white font-medium transition-colors">Home</a>
|
|
156
|
+
<a href="#" className="text-white/80 hover:text-white font-medium transition-colors">Features</a>
|
|
157
|
+
<a href="#" className="text-white/80 hover:text-white font-medium transition-colors">Pricing</a>
|
|
158
|
+
<a href="#" className="text-white/80 hover:text-white font-medium transition-colors">Docs</a>
|
|
159
|
+
</div>
|
|
160
|
+
<div className="flex-right gap-3">
|
|
161
|
+
<button className="hidden md:block outlined plain py-2 px-4 rounded-lg font-medium text-sm">Log In</button>
|
|
162
|
+
<button className="filled primary-600 text-white py-2 px-4 rounded-lg font-medium text-sm hover:shadow-lg transition-all glow">Sign Up</button>
|
|
163
|
+
</div>
|
|
164
|
+
</nav>
|
|
165
|
+
`.trim(),
|
|
166
|
+
"dolphin-alert": `
|
|
167
|
+
<div className="flex flex-col gap-3">
|
|
168
|
+
<div className="w-full p-4 rounded-xl border border-info-500/30 bg-info-500/10 flex-left gap-3 text-info-100">
|
|
169
|
+
<Activity size={20} className="text-info-400 shrink-0" />
|
|
170
|
+
<div>
|
|
171
|
+
<h4 className="font-bold text-info-300 text-sm">System Update</h4>
|
|
172
|
+
<p className="text-xs opacity-80 mt-1">A new version of DolphinCSS is available with magical features.</p>
|
|
173
|
+
</div>
|
|
174
|
+
</div>
|
|
175
|
+
<div className="w-full p-4 rounded-xl border border-warning-500/30 bg-warning-500/10 flex-left gap-3 text-warning-100">
|
|
176
|
+
<Bell size={20} className="text-warning-400 shrink-0" />
|
|
177
|
+
<div>
|
|
178
|
+
<h4 className="font-bold text-warning-300 text-sm">Action Needed</h4>
|
|
179
|
+
<p className="text-xs opacity-80 mt-1">Please verify your email address to continue using all features.</p>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
`.trim(),
|
|
184
|
+
"dolphin-badge": `
|
|
185
|
+
<div className="flex gap-3 flex-wrap">
|
|
186
|
+
<span className="px-3 py-1 rounded-full bg-primary-500/20 text-primary-300 text-xs font-bold border border-primary-500/30">Primary</span>
|
|
187
|
+
<span className="px-3 py-1 rounded-full bg-success-500/20 text-success-300 text-xs font-bold border border-success-500/30 flex-left gap-1">
|
|
188
|
+
<span className="w-1.5 h-1.5 rounded-full bg-success-400"></span> Active
|
|
189
|
+
</span>
|
|
190
|
+
<span className="px-3 py-1 rounded-full bg-warning-500/20 text-warning-300 text-xs font-bold border border-warning-500/30">Pending</span>
|
|
191
|
+
<span className="px-3 py-1 rounded-full bg-danger-500/20 text-danger-300 text-xs font-bold border border-danger-500/30">Failed</span>
|
|
192
|
+
<span className="px-3 py-1 rounded-full bg-white/10 text-white/80 text-xs font-bold border border-white/20">Neutral</span>
|
|
193
|
+
</div>
|
|
194
|
+
`.trim()
|
|
195
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import chokidar from 'chokidar';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import components from './components.js';
|
|
5
|
+
|
|
6
|
+
// Setup watcher for src folder
|
|
7
|
+
const targetDir = './src';
|
|
8
|
+
const watcher = chokidar.watch(targetDir, {
|
|
9
|
+
ignored: /(^|[\/\\])\../, // ignore dotfiles
|
|
10
|
+
persistent: true
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const log = console.log.bind(console);
|
|
14
|
+
log(`\n🐬 DolphinCSS Magic Watcher Started!`);
|
|
15
|
+
log(`👀 Listening for magic markers (like <div className="dolphin-form"></div>) in ${targetDir} for .js, .jsx, .tsx, .html files\n`);
|
|
16
|
+
|
|
17
|
+
watcher.on('all', (event, filePath) => {
|
|
18
|
+
if (event !== 'add' && event !== 'change') return;
|
|
19
|
+
const ext = path.extname(filePath);
|
|
20
|
+
if (!['.jsx', '.tsx', '.js', '.html'].includes(ext)) return;
|
|
21
|
+
try {
|
|
22
|
+
let content = fs.readFileSync(filePath, 'utf8');
|
|
23
|
+
let modified = false;
|
|
24
|
+
|
|
25
|
+
for (const [marker, replacement] of Object.entries(components)) {
|
|
26
|
+
|
|
27
|
+
// Much simpler: we can just use replace directly if we don't care about the regex complexity
|
|
28
|
+
// Let's use simple string replacements for the most common cases:
|
|
29
|
+
const cases = [
|
|
30
|
+
`<div className="${marker}"></div>`,
|
|
31
|
+
`<div class="${marker}"></div>`,
|
|
32
|
+
`<div className="${marker}" />`,
|
|
33
|
+
`<div class="${marker}" />`,
|
|
34
|
+
`<div className='${marker}'></div>`,
|
|
35
|
+
`<div class='${marker}'></div>`
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
for (const pattern of cases) {
|
|
39
|
+
if (content.includes(pattern)) {
|
|
40
|
+
content = content.replace(pattern, replacement);
|
|
41
|
+
modified = true;
|
|
42
|
+
log(`✨ MAGIC INJECTION: Injected '${marker}' into ${path.basename(filePath)}`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (modified) {
|
|
48
|
+
fs.writeFileSync(filePath, content, 'utf8');
|
|
49
|
+
}
|
|
50
|
+
} catch (error) {
|
|
51
|
+
console.error(`❌ Error processing file ${filePath}:`, error);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
// Determine the root directory of the project where dolphincss is installed
|
|
5
|
+
// In npm scripts, INIT_CWD is the directory where the npm command was run
|
|
6
|
+
const projectRoot = process.env.INIT_CWD || path.resolve(process.cwd(), '../..');
|
|
7
|
+
|
|
8
|
+
console.log(`[DolphinCSS] Post-install setup...`);
|
|
9
|
+
console.log(`[DolphinCSS] Checking project root: ${projectRoot}`);
|
|
10
|
+
|
|
11
|
+
try {
|
|
12
|
+
// If we are in the dolphincss package itself (development mode), don't install snippets to its own root
|
|
13
|
+
// We check this by seeing if the package.json name is dolphincss
|
|
14
|
+
const rootPackagePath = path.join(projectRoot, 'package.json');
|
|
15
|
+
if (fs.existsSync(rootPackagePath)) {
|
|
16
|
+
const pkg = JSON.parse(fs.readFileSync(rootPackagePath, 'utf8'));
|
|
17
|
+
if (pkg.name === 'dolphincss') {
|
|
18
|
+
console.log(`[DolphinCSS] Development mode detected. Skipping snippets auto-install.`);
|
|
19
|
+
process.exit(0);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const vscodeDir = path.join(projectRoot, '.vscode');
|
|
24
|
+
const snippetsDest = path.join(vscodeDir, 'dolphincss.code-snippets');
|
|
25
|
+
const snippetsSource = path.join(__dirname, '../snippets/dolphincss.json');
|
|
26
|
+
|
|
27
|
+
// Create .vscode directory if it doesn't exist
|
|
28
|
+
if (!fs.existsSync(vscodeDir)) {
|
|
29
|
+
console.log(`[DolphinCSS] Creating .vscode directory...`);
|
|
30
|
+
fs.mkdirSync(vscodeDir, { recursive: true });
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Copy snippets file
|
|
34
|
+
if (fs.existsSync(snippetsSource)) {
|
|
35
|
+
console.log(`[DolphinCSS] Installing VS Code snippets...`);
|
|
36
|
+
fs.copyFileSync(snippetsSource, snippetsDest);
|
|
37
|
+
console.log(`[DolphinCSS] Success! IntelliSense snippets added to ${snippetsDest}`);
|
|
38
|
+
} else {
|
|
39
|
+
console.warn(`[DolphinCSS] Warning: Snippets source file not found at ${snippetsSource}`);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
} catch (error) {
|
|
43
|
+
console.warn(`[DolphinCSS] Warning: Could not install VS Code snippets automatically. (${error.message})`);
|
|
44
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"DolphinCSS Effect - Neon": { "prefix": "fx-neon", "body": ["fx-neon"], "description": "Bright cyber neon glow effect" },
|
|
3
|
+
"DolphinCSS Effect - Glass": { "prefix": "fx-glass", "body": ["fx-glass"], "description": "Translucent glassmorphism effect" },
|
|
4
|
+
"DolphinCSS Effect - Metal": { "prefix": "fx-metal", "body": ["fx-metal"], "description": "Liquid metal gradient effect" },
|
|
5
|
+
"DolphinCSS Effect - Rainbow": { "prefix": "fx-rainbow", "body": ["fx-rainbow"], "description": "Psychedelic animated rainbow gradient" },
|
|
6
|
+
"DolphinCSS Effect - Float": { "prefix": "fx-float", "body": ["fx-float"], "description": "Floating element with shadow" },
|
|
7
|
+
"DolphinCSS Effect - Flare": { "prefix": "fx-flare", "body": ["fx-flare"], "description": "Solar flare warm gradient" },
|
|
8
|
+
"DolphinCSS Effect - Holo": { "prefix": "fx-holo", "body": ["fx-holo"], "description": "Holographic matrix grid effect" },
|
|
9
|
+
"DolphinCSS Effect - Crystal": { "prefix": "fx-crystal", "body": ["fx-crystal"], "description": "Crystal clear glass effect" },
|
|
10
|
+
"DolphinCSS Effect - Aqua": { "prefix": "fx-aqua", "body": ["fx-aqua"], "description": "Deep aqua water effect" },
|
|
11
|
+
"DolphinCSS Effect - Nebula": { "prefix": "fx-nebula", "body": ["fx-nebula"], "description": "Galactic purple/blue nebula effect" },
|
|
12
|
+
"DolphinCSS Effect - Aurora": { "prefix": "fx-aurora", "body": ["fx-aurora"], "description": "Frosted aurora light effect" },
|
|
13
|
+
|
|
14
|
+
"DolphinCSS Theme - Sagarmatha": { "prefix": "bg-sagarmatha", "body": ["bg-sagarmatha"], "description": "Ice Blue to Deep Ocean Blue Premium Theme" },
|
|
15
|
+
"DolphinCSS Theme - Danphe": { "prefix": "bg-danphe", "body": ["bg-danphe"], "description": "Vibrant Multi-color Premium Theme" },
|
|
16
|
+
"DolphinCSS Theme - Munal": { "prefix": "bg-munal", "body": ["bg-munal"], "description": "Royal Deep Purple and Gold Premium Theme" },
|
|
17
|
+
"DolphinCSS Theme - Laligurans": { "prefix": "bg-laligurans", "body": ["bg-laligurans"], "description": "Crimson Red to Soft Pink Premium Theme" },
|
|
18
|
+
"DolphinCSS Theme - Machhapuchhre": { "prefix": "bg-machhapuchhre", "body": ["bg-machhapuchhre"], "description": "Dark Slate and Frosty Silver Premium Theme" },
|
|
19
|
+
"DolphinCSS Theme - Mustang": { "prefix": "bg-mustang", "body": ["bg-mustang"], "description": "Earthy Terracotta and Warm Orange Premium Theme" },
|
|
20
|
+
"DolphinCSS Theme - Tilicho": { "prefix": "bg-tilicho", "body": ["bg-tilicho"], "description": "High Altitude Turquoise to Deep Teal Premium Theme" },
|
|
21
|
+
"DolphinCSS Theme - Lumbini": { "prefix": "bg-lumbini", "body": ["bg-lumbini"], "description": "Peaceful Soft Gold and Calm White Premium Theme" },
|
|
22
|
+
|
|
23
|
+
"DolphinCSS Layout - Flex Center": { "prefix": "flex-center", "body": ["flex-center"], "description": "Flexbox centered items (both axes)" },
|
|
24
|
+
"DolphinCSS Layout - Flex Between": { "prefix": "flex-between", "body": ["flex-between"], "description": "Flexbox justify space-between" },
|
|
25
|
+
"DolphinCSS Layout - Flex Left": { "prefix": "flex-left", "body": ["flex-left"], "description": "Flexbox items-center justify-start" },
|
|
26
|
+
"DolphinCSS Layout - Flex Right": { "prefix": "flex-right", "body": ["flex-right"], "description": "Flexbox items-center justify-end" },
|
|
27
|
+
"DolphinCSS Layout - Flex Col Center": { "prefix": "flex-col-center", "body": ["flex-col-center"], "description": "Flex column centered items" },
|
|
28
|
+
"DolphinCSS Layout - Flex Col Left": { "prefix": "flex-col-left", "body": ["flex-col-left"], "description": "Flex column items start" },
|
|
29
|
+
"DolphinCSS Layout - Flex Col Right": { "prefix": "flex-col-right", "body": ["flex-col-right"], "description": "Flex column items end" },
|
|
30
|
+
|
|
31
|
+
"DolphinCSS Layout - Grid Center": { "prefix": "grid-center", "body": ["grid-center"], "description": "Grid place-items center" },
|
|
32
|
+
"DolphinCSS Layout - Grid 2 Col": { "prefix": "grid-col-2", "body": ["grid-col-2"], "description": "CSS Grid 2 columns" },
|
|
33
|
+
"DolphinCSS Layout - Grid 3 Col": { "prefix": "grid-col-3", "body": ["grid-col-3"], "description": "CSS Grid 3 columns" },
|
|
34
|
+
"DolphinCSS Layout - Grid 4 Col": { "prefix": "grid-col-4", "body": ["grid-col-4"], "description": "CSS Grid 4 columns" },
|
|
35
|
+
|
|
36
|
+
"DolphinCSS Component - Button Filled": { "prefix": "btn-filled", "body": ["filled primary"], "description": "Primary solid button" },
|
|
37
|
+
"DolphinCSS Component - Button Outlined": { "prefix": "btn-outlined", "body": ["outlined primary"], "description": "Primary outlined button" },
|
|
38
|
+
"DolphinCSS Component - Button Circle": { "prefix": "btn-circle", "body": ["circle md filled primary"], "description": "Medium circular button" },
|
|
39
|
+
"DolphinCSS Component - Card": { "prefix": "card", "body": ["card"], "description": "Base modern AI card" },
|
|
40
|
+
"DolphinCSS Component - Card Glass": { "prefix": "card-glass", "body": ["card glass"], "description": "Glassmorphism card" },
|
|
41
|
+
"DolphinCSS Component - Card Outlined": { "prefix": "card-outlined", "body": ["card outlined"], "description": "Bordered modern AI card" },
|
|
42
|
+
|
|
43
|
+
"DolphinCSS Component - Form Floating Label": {
|
|
44
|
+
"prefix": "form-floating",
|
|
45
|
+
"body": [
|
|
46
|
+
"<div className=\"floatinglabel w-full\">",
|
|
47
|
+
" <input type=\"text\" id=\"$1\" className=\"floatinglabel-input w-full\" placeholder=\" \" />",
|
|
48
|
+
" <label htmlFor=\"$1\" className=\"floatinglabel-label\">$2</label>",
|
|
49
|
+
"</div>"
|
|
50
|
+
],
|
|
51
|
+
"description": "Input with animated floating label"
|
|
52
|
+
},
|
|
53
|
+
"DolphinCSS Component - Form Standard Label": {
|
|
54
|
+
"prefix": "form-standard",
|
|
55
|
+
"body": [
|
|
56
|
+
"<div className=\"standardlabel w-full\">",
|
|
57
|
+
" <input type=\"text\" id=\"$1\" className=\"standardlabel-input w-full\" placeholder=\" \" />",
|
|
58
|
+
" <label htmlFor=\"$1\" className=\"standardlabel-label\">$2</label>",
|
|
59
|
+
"</div>"
|
|
60
|
+
],
|
|
61
|
+
"description": "Input with minimalist bottom border"
|
|
62
|
+
},
|
|
63
|
+
"DolphinCSS Component - Form Icon Left": {
|
|
64
|
+
"prefix": "form-icon-left",
|
|
65
|
+
"body": [
|
|
66
|
+
"<div className=\"floatinglabel input-icon-left w-full\">",
|
|
67
|
+
" <Icon className=\"icon-left text-muted\" />",
|
|
68
|
+
" <input type=\"text\" id=\"$1\" className=\"floatinglabel-input w-full\" placeholder=\" \" />",
|
|
69
|
+
" <label htmlFor=\"$1\" className=\"floatinglabel-label\">$2</label>",
|
|
70
|
+
"</div>"
|
|
71
|
+
],
|
|
72
|
+
"description": "Floating label input with left icon"
|
|
73
|
+
}
|
|
74
|
+
}
|
package/vite-plugin.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import components from './scripts/components.js';
|
|
4
|
+
|
|
5
|
+
export default function dolphincssPlugin() {
|
|
6
|
+
return {
|
|
7
|
+
name: 'vite-plugin-dolphincss',
|
|
8
|
+
enforce: 'pre',
|
|
9
|
+
|
|
10
|
+
// transform hook runs for every file processed by Vite
|
|
11
|
+
transform(code, id) {
|
|
12
|
+
// Only process our target files
|
|
13
|
+
const ext = path.extname(id);
|
|
14
|
+
if (!['.jsx', '.tsx', '.js', '.html'].includes(ext) || id.includes('node_modules')) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// We read the original file directly to avoid writing Vite's injected boilerplate back to disk
|
|
19
|
+
let originalCode;
|
|
20
|
+
try {
|
|
21
|
+
originalCode = fs.readFileSync(id, 'utf8');
|
|
22
|
+
} catch (err) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
let modified = false;
|
|
27
|
+
let newOriginalCode = originalCode;
|
|
28
|
+
|
|
29
|
+
for (const [marker, replacement] of Object.entries(components)) {
|
|
30
|
+
const cases = [
|
|
31
|
+
`<div className="${marker}"></div>`,
|
|
32
|
+
`<div class="${marker}"></div>`,
|
|
33
|
+
`<div className="${marker}" />`,
|
|
34
|
+
`<div class="${marker}" />`,
|
|
35
|
+
`<div className='${marker}'></div>`,
|
|
36
|
+
`<div class='${marker}'></div>`
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
for (const pattern of cases) {
|
|
40
|
+
if (newOriginalCode.includes(pattern)) {
|
|
41
|
+
newOriginalCode = newOriginalCode.split(pattern).join(replacement);
|
|
42
|
+
modified = true;
|
|
43
|
+
console.log(`\n✨ DolphinCSS: Injected '${marker}' into ${path.basename(id)}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (modified) {
|
|
49
|
+
// Write the clean replaced code back to the file system so the user sees it
|
|
50
|
+
setTimeout(() => {
|
|
51
|
+
try {
|
|
52
|
+
fs.writeFileSync(id, newOriginalCode, 'utf8');
|
|
53
|
+
} catch (err) {
|
|
54
|
+
console.error(`❌ DolphinCSS: Error writing to ${id}`, err);
|
|
55
|
+
}
|
|
56
|
+
}, 0);
|
|
57
|
+
|
|
58
|
+
// Also apply the replacement to the current transform stream
|
|
59
|
+
let newCode = code;
|
|
60
|
+
for (const [marker, replacement] of Object.entries(components)) {
|
|
61
|
+
const cases = [
|
|
62
|
+
`<div className="${marker}"></div>`,
|
|
63
|
+
`<div class="${marker}"></div>`,
|
|
64
|
+
`<div className="${marker}" />`,
|
|
65
|
+
`<div class="${marker}" />`,
|
|
66
|
+
`<div className='${marker}'></div>`,
|
|
67
|
+
`<div class='${marker}'></div>`
|
|
68
|
+
];
|
|
69
|
+
for (const pattern of cases) {
|
|
70
|
+
if (newCode.includes(pattern)) {
|
|
71
|
+
newCode = newCode.split(pattern).join(replacement);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return {
|
|
77
|
+
code: newCode,
|
|
78
|
+
map: null
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|