dolphincss 1.2.9 → 1.3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dolphincss",
3
- "version": "1.2.9",
3
+ "version": "1.3.1",
4
4
  "type": "module",
5
5
  "description": "DolphinCSS - World-class TailwindCSS + React component library",
6
6
  "main": "dolphin-css.css",
@@ -31,6 +31,68 @@ export default {
31
31
  Submit Data
32
32
  </button>
33
33
  </form>
34
+ </div>
35
+ `.trim(),
36
+ "dolphin-form-floating": `
37
+ <div className="glass card p-6 lg:p-8 border border-white/20 rounded-2xl" style={{ backdropFilter: 'blur(20px)' }}>
38
+ <h3 className="text-xl font-bold text-white mb-6">Quick Actions</h3>
39
+ <form className="flex-col-left w-full gap-5">
40
+ <div className="w-full">
41
+ <div className="floatinglabel input-icon-left w-full">
42
+ <Mail size={20} className="icon-left text-primary-500" style={{ left: '1rem' }} />
43
+ <input type="email" id="email-float" 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=" " />
44
+ <label htmlFor="email-float" className="floatinglabel-label text-white/70 font-medium" style={{ zIndex: 10 }}>Email Address</label>
45
+ </div>
46
+ </div>
47
+
48
+ <div className="w-full">
49
+ <div className="floatinglabel input-icon-both w-full">
50
+ <Lock size={20} className="icon-left text-primary-500" style={{ left: '1rem' }} />
51
+ <input type="password" id="password-float" 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=" " />
52
+ <label htmlFor="password-float" className="floatinglabel-label text-white/70 font-medium" style={{ zIndex: 10 }}>Password</label>
53
+ <button type="button" className="icon-right text-white/50 hover:text-white transition-colors" style={{ zIndex: 20, right: '1rem' }}>
54
+ <Eye size={20} />
55
+ </button>
56
+ </div>
57
+ </div>
58
+
59
+ <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">
60
+ Submit Data
61
+ </button>
62
+ </form>
63
+ </div>
64
+ `.trim(),
65
+ "dolphin-form-standard": `
66
+ <div className="card p-6 lg:p-10 border border-border rounded-2xl bg-surface-alt shadow-lg">
67
+ <h3 className="text-2xl font-bold text-text mb-2">Welcome Back</h3>
68
+ <p className="text-text-muted text-sm mb-8">Please enter your details to sign in.</p>
69
+ <form className="flex-col-left w-full gap-8">
70
+ <div className="w-full mt-2">
71
+ <div className="standardlabel w-full">
72
+ <input type="email" id="email-std" className="standardlabel-input lg w-full text-text placeholder:text-transparent bg-transparent" placeholder=" " />
73
+ <label htmlFor="email-std" className="standardlabel-label text-text-muted font-medium bg-transparent! left-0! px-0!">Email Address</label>
74
+ </div>
75
+ </div>
76
+
77
+ <div className="w-full">
78
+ <div className="standardlabel w-full">
79
+ <input type="password" id="password-std" className="standardlabel-input lg w-full text-text placeholder:text-transparent bg-transparent" placeholder=" " />
80
+ <label htmlFor="password-std" className="standardlabel-label text-text-muted font-medium bg-transparent! left-0! px-0!">Password</label>
81
+ </div>
82
+ </div>
83
+
84
+ <div className="flex-between w-full">
85
+ <label className="radio-item flex-left gap-2 cursor-pointer">
86
+ <input type="checkbox" className="accent-primary-500 w-4 h-4 rounded border-border" />
87
+ <span className="text-sm font-medium text-text-muted">Remember me</span>
88
+ </label>
89
+ <a href="#" className="text-sm font-bold text-primary-500 hover:underline">Forgot password?</a>
90
+ </div>
91
+
92
+ <button type="button" className="filled primary-500 w-full py-3.5 rounded-xl text-white font-bold hover:shadow-xl hover:-translate-y-0.5 transition-all mt-2 glow">
93
+ Sign In
94
+ </button>
95
+ </form>
34
96
  </div>
35
97
  `.trim(),
36
98
  "dolphin-table": `
@@ -190,6 +252,137 @@ export default {
190
252
  <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
253
  <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
254
  <span className="px-3 py-1 rounded-full bg-white/10 text-white/80 text-xs font-bold border border-white/20">Neutral</span>
255
+ </div>
256
+ `.trim(),
257
+ "dolphin-header": `
258
+ <nav className="glass w-full py-4 px-6 md:px-8 border-b border-border flex-between sticky top-0 z-50 shadow-sm" style={{ backdropFilter: 'blur(24px)' }}>
259
+ <div className="flex-left gap-2 cursor-pointer">
260
+ <div className="circle sm filled primary-500 text-white font-bold flex-center glow">🐬</div>
261
+ <span className="text-xl font-bold text-text tracking-tight">Dolphin</span>
262
+ </div>
263
+ <div className="hidden md:flex gap-6">
264
+ <a href="#" className="text-text-muted hover:text-primary-500 font-medium transition-colors">Home</a>
265
+ <a href="#" className="text-text-muted hover:text-primary-500 font-medium transition-colors">Features</a>
266
+ <a href="#" className="text-text-muted hover:text-primary-500 font-medium transition-colors">Pricing</a>
267
+ <a href="#" className="text-text-muted hover:text-primary-500 font-medium transition-colors">Docs</a>
268
+ </div>
269
+ <div className="flex-right gap-3">
270
+ <button className="hidden md:block outlined plain py-2 px-4 rounded-lg font-medium text-sm border-border text-text hover:bg-surface">Log In</button>
271
+ <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>
272
+ </div>
273
+ </nav>
274
+ `.trim(),
275
+ "dolphin-footer": `
276
+ <footer className="w-full bg-surface-dark py-12 px-6 border-t border-border mt-auto">
277
+ <div className="max-w-7xl mx-auto grid grid-cols-1 md:grid-cols-4 gap-8">
278
+ <div className="col-span-1 md:col-span-2">
279
+ <div className="flex-left gap-2 mb-4">
280
+ <div className="circle sm filled primary-500 text-white font-bold flex-center glow">🐬</div>
281
+ <span className="text-2xl font-bold text-text-light tracking-tight">DolphinCSS</span>
282
+ </div>
283
+ <p className="text-text-muted max-w-sm mb-6 leading-relaxed">
284
+ The next-generation UI library that combines the magic of auto-generation with breathtaking aesthetics.
285
+ </p>
286
+ <div className="flex-left gap-4">
287
+ <button className="circle sm bg-white/5 hover:bg-primary-500 hover:text-white transition-all text-text-muted border border-border">š•</button>
288
+ <button className="circle sm bg-white/5 hover:bg-primary-500 hover:text-white transition-all text-text-muted border border-border">in</button>
289
+ <button className="circle sm bg-white/5 hover:bg-primary-500 hover:text-white transition-all text-text-muted border border-border">GH</button>
290
+ </div>
291
+ </div>
292
+
293
+ <div>
294
+ <h4 className="font-bold text-lg mb-4 text-text-light">Resources</h4>
295
+ <ul className="flex-col-left gap-3 text-text-muted">
296
+ <li><a href="#" className="hover:text-primary-500 transition-colors">Documentation</a></li>
297
+ <li><a href="#" className="hover:text-primary-500 transition-colors">Components</a></li>
298
+ <li><a href="#" className="hover:text-primary-500 transition-colors">Themes</a></li>
299
+ <li><a href="#" className="hover:text-primary-500 transition-colors">Showcase</a></li>
300
+ </ul>
301
+ </div>
302
+
303
+ <div>
304
+ <h4 className="font-bold text-lg mb-4 text-text-light">Legal</h4>
305
+ <ul className="flex-col-left gap-3 text-text-muted">
306
+ <li><a href="#" className="hover:text-primary-500 transition-colors">Privacy Policy</a></li>
307
+ <li><a href="#" className="hover:text-primary-500 transition-colors">Terms of Service</a></li>
308
+ <li><a href="#" className="hover:text-primary-500 transition-colors">License</a></li>
309
+ </ul>
310
+ </div>
311
+ </div>
312
+
313
+ <div className="max-w-7xl mx-auto mt-12 pt-6 border-t border-border/20 flex-between flex-wrap gap-4 text-sm text-text-muted">
314
+ <p>Ā© 2026 DolphinCSS. All rights reserved.</p>
315
+ <p className="flex-center gap-1">Made with <span className="text-danger-500 animate-pulse">ā¤ļø</span> in Nepal</p>
316
+ </div>
317
+ </footer>
318
+ `.trim(),
319
+ "dolphin-grid": `
320
+ <div className="w-full">
321
+ <div className="flex-between mb-8">
322
+ <div>
323
+ <h2 className="text-2xl font-bold text-text mb-1">Featured Collections</h2>
324
+ <p className="text-text-muted text-sm">Discover our magical products and items.</p>
325
+ </div>
326
+ <button className="outlined plain text-sm py-2 px-4 rounded-lg flex-center gap-2 border-border text-text hover:bg-surface transition-colors cursor-pointer">
327
+ View All <ChevronRight size={16} />
328
+ </button>
329
+ </div>
330
+
331
+ <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6">
332
+ {/* Product Card 1 */}
333
+ <div className="card glass p-4 rounded-2xl group hover:-translate-y-1 transition-all duration-300">
334
+ <div className="w-full aspect-[4/3] bg-surface-dark rounded-xl mb-4 overflow-hidden relative">
335
+ <div className="absolute top-2 right-2 badge primary sm z-10 shadow-lg">New</div>
336
+ <img src="https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=500&q=80" alt="Product" className="w-full h-full object-cover group-hover:scale-110 transition-transform duration-500" />
337
+ </div>
338
+ <h3 className="font-bold text-text mb-1">Premium Headphones</h3>
339
+ <p className="text-text-muted text-sm mb-4 line-clamp-2">High fidelity audio with magical active noise cancellation.</p>
340
+ <div className="flex-between">
341
+ <span className="text-lg font-bold text-primary-500">$299.00</span>
342
+ <button className="circle sm filled primary-500 text-white glow cursor-pointer hover:scale-110 transition-transform"><ShoppingCart size={16} /></button>
343
+ </div>
344
+ </div>
345
+
346
+ {/* Product Card 2 */}
347
+ <div className="card glass p-4 rounded-2xl group hover:-translate-y-1 transition-all duration-300">
348
+ <div className="w-full aspect-[4/3] bg-surface-dark rounded-xl mb-4 overflow-hidden relative">
349
+ <img src="https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=500&q=80" alt="Product" className="w-full h-full object-cover group-hover:scale-110 transition-transform duration-500" />
350
+ </div>
351
+ <h3 className="font-bold text-text mb-1">Smart Watch Pro</h3>
352
+ <p className="text-text-muted text-sm mb-4 line-clamp-2">Track your fitness with the ultimate smart companion.</p>
353
+ <div className="flex-between">
354
+ <span className="text-lg font-bold text-primary-500">$199.00</span>
355
+ <button className="circle sm filled primary-500 text-white glow cursor-pointer hover:scale-110 transition-transform"><ShoppingCart size={16} /></button>
356
+ </div>
357
+ </div>
358
+
359
+ {/* Product Card 3 */}
360
+ <div className="card glass p-4 rounded-2xl group hover:-translate-y-1 transition-all duration-300">
361
+ <div className="w-full aspect-[4/3] bg-surface-dark rounded-xl mb-4 overflow-hidden relative">
362
+ <div className="absolute top-2 right-2 badge danger sm z-10 shadow-lg">-20%</div>
363
+ <img src="https://images.unsplash.com/photo-1526170375885-4d8ecf77b99f?w=500&q=80" alt="Product" className="w-full h-full object-cover group-hover:scale-110 transition-transform duration-500" />
364
+ </div>
365
+ <h3 className="font-bold text-text mb-1">Polaroid Camera</h3>
366
+ <p className="text-text-muted text-sm mb-4 line-clamp-2">Capture your magical moments instantly with retro style.</p>
367
+ <div className="flex-between">
368
+ <span className="text-lg font-bold text-primary-500">$89.00</span>
369
+ <button className="circle sm filled primary-500 text-white glow cursor-pointer hover:scale-110 transition-transform"><ShoppingCart size={16} /></button>
370
+ </div>
371
+ </div>
372
+
373
+ {/* Product Card 4 */}
374
+ <div className="card glass p-4 rounded-2xl group hover:-translate-y-1 transition-all duration-300">
375
+ <div className="w-full aspect-[4/3] bg-surface-dark rounded-xl mb-4 overflow-hidden relative">
376
+ <img src="https://images.unsplash.com/photo-1542291026-7eec264c27ff?w=500&q=80" alt="Product" className="w-full h-full object-cover group-hover:scale-110 transition-transform duration-500" />
377
+ </div>
378
+ <h3 className="font-bold text-text mb-1">Neon Kicks</h3>
379
+ <p className="text-text-muted text-sm mb-4 line-clamp-2">Step into the future with glowing soles and comfort.</p>
380
+ <div className="flex-between">
381
+ <span className="text-lg font-bold text-primary-500">$120.00</span>
382
+ <button className="circle sm filled primary-500 text-white glow cursor-pointer hover:scale-110 transition-transform"><ShoppingCart size={16} /></button>
383
+ </div>
384
+ </div>
385
+ </div>
193
386
  </div>
194
387
  `.trim()
195
388
  };
package/vite-plugin.js CHANGED
@@ -27,14 +27,16 @@ export default function dolphincssPlugin() {
27
27
  let newOriginalCode = originalCode;
28
28
 
29
29
  for (const [marker, replacement] of Object.entries(components)) {
30
- // Regex matches <div className="marker"></div> with optional spaces/newlines inside, or self-closing <div className="marker" />
30
+ // Regex to match <div className="marker"></div> with any spacing/newlines inside
31
+ // Using [\"'] instead of capture groups to simplify and avoid backreference issues
31
32
  const regex = new RegExp(
32
- `<div\\s+class(?:Name)?=(["'])${marker}\\1\\s*>\\s*</div>|<div\\s+class(?:Name)?=(["'])${marker}\\2\\s*/>`,
33
+ `<div\\s+class(?:Name)?=[\"']${marker}[\"']\\s*>\\s*</div>|<div\\s+class(?:Name)?=[\"']${marker}[\"']\\s*/>`,
33
34
  'g'
34
35
  );
35
36
 
36
37
  if (regex.test(newOriginalCode)) {
37
- newOriginalCode = newOriginalCode.replace(regex, replacement);
38
+ // IMPORTANT: Use () => replacement to avoid $1, $2 substitution from things like $120.50
39
+ newOriginalCode = newOriginalCode.replace(regex, () => replacement);
38
40
  modified = true;
39
41
  console.log(`\n✨ DolphinCSS: Injected '${marker}' into ${path.basename(id)}`);
40
42
  }
@@ -54,11 +56,11 @@ export default function dolphincssPlugin() {
54
56
  let newCode = code;
55
57
  for (const [marker, replacement] of Object.entries(components)) {
56
58
  const regex = new RegExp(
57
- `<div\\s+class(?:Name)?=(["'])${marker}\\1\\s*>\\s*</div>|<div\\s+class(?:Name)?=(["'])${marker}\\2\\s*/>`,
59
+ `<div\\s+class(?:Name)?=[\"']${marker}[\"']\\s*>\\s*</div>|<div\\s+class(?:Name)?=[\"']${marker}[\"']\\s*/>`,
58
60
  'g'
59
61
  );
60
62
  if (regex.test(newCode)) {
61
- newCode = newCode.replace(regex, replacement);
63
+ newCode = newCode.replace(regex, () => replacement);
62
64
  }
63
65
  }
64
66