dolphincss 1.3.3 → 1.3.6

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 CHANGED
@@ -1,159 +1,221 @@
1
- <div align="center">
2
- <h1>=�ɼ DolphinCSS</h1>
3
- <p><strong>A Next-Generation UI Library for React + TailwindCSS</strong></p>
4
- <p><em>Where Magic Component Generation meets Beautiful Global Classes.</em></p>
5
- </div>
6
-
7
- ---
8
-
9
- DolphinCSS is not just another CSS framework. It fundamentally reimagines how developers build UI by combining the extreme customizability of **TailwindCSS**, the simplicity of **Bootstrap's Global Classes**, and an unprecedented **Vite-powered Magic Component Generator**.
10
-
11
- Say goodbye to heavy vendor lock-ins (MUI, AntD) and tedious CLI commands (Shadcn UI).
12
-
13
- ## G�� The 4 Unique Superpowers
14
-
15
- ### 1. =��� Magic Component Generation (Zero CLI)
16
- We loved the idea of Shadcn giving you ownership of the code, but hated running CLI commands for every single component.
17
-
18
- With DolphinCSS, **you never touch the terminal.** Just type a magic class in your editor and save:
19
-
20
- ```jsx
21
- // 1. You type this in your App.jsx:
22
- <div className="dolphin-card"></div>
23
-
24
- // 2. You hit Save (Ctrl+S)
25
-
26
- // 3. =��� MAGIC! Vite instantly replaces that line IN YOUR FILE with the full React Component code!
27
- <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)' }}>
28
- {/* Full customizable code is now YOURS */}
29
- </div>
30
- ```
31
-
32
- ### 2. =�Ŀ High-Level Global Classes
33
- Tired of writing 20 utility classes for a single button? DolphinCSS brings back the simplicity of Global Classes, but with breathtaking modern aesthetics (Glassmorphism, Neon Glows).
34
-
35
- ```jsx
36
- /* The Tailwind Way (Messy) */
37
- <button className="px-6 py-2 bg-blue-500 hover:bg-blue-600 text-white font-bold rounded-lg shadow-lg shadow-blue-500/50 transition-all">
38
- Click
39
- </button>
40
-
41
- /* The DolphinCSS Way (Clean & Global) */
42
- <button className="filled primary-500 glow btn-lg">
43
- Click
44
- </button>
45
- ```
46
-
47
- ### 3. =��� Infinite Class Composability (Nesting)
48
- Classes in DolphinCSS are designed to stack perfectly. Combine background colors, gradients, glows, and animations endlessly without conflicts!
49
-
50
- ```jsx
51
- // Combine classes to create complex, animated, glowing UI instantly:
52
- <button className="filled success gradient glow glow-pulse rounded-full">
53
- I am a Glowing, Pulsing, Gradient Green Button!
54
- </button>
55
-
56
- // Create a frosted glass overlay with a dark tint:
57
- <div className="overlay overlay-blur-xl overlay-dark-50"></div>
58
- ```
59
-
60
- ### 4. =�ļ World-Class Built-in Animations
61
- No need for `framer-motion` or `animate.css`. DolphinCSS ships with a complete `@layer utilities` animation engine that you can drop on any HTML element.
62
-
63
- - **Continuous:** `float`, `spin-slow`, `pulse`, `bounce`, `shimmer`, `gradient-flow`, `neon-flicker`
64
- - **Hover:** `hover-pulse`, `hover-jelly`, `hover-glow`, `hover-ripple`
65
- - **Entrance:** `fade-in`, `slide-up`, `zoom-in`, `rotate-3d`
66
- - **Controls:** `delay-200`, `duration-500`
67
-
68
- ```jsx
69
- <img src="logo.png" className="float hover-jelly fade-in delay-200" />
70
- ```
71
-
72
- ---
73
-
74
- ## =��� Installation & Setup
75
-
76
- 1. **Install via npm:**
77
- ```bash
78
- npm install tailwindcss @tailwindcss/vite dolphincss lucide-react
79
- ```
80
- *(Note: `lucide-react` is required because the generated magic components use these beautiful icons by default.)*
81
-
82
- 2. **Add the Plugins:** (In `vite.config.js`)
83
- ```javascript
84
- import { defineConfig } from 'vite'
85
- import react from '@vitejs/plugin-react'
86
- import tailwindcss from '@tailwindcss/vite'
87
- import dolphincssPlugin from 'dolphincss/vite-plugin'
88
-
89
- export default defineConfig({
90
- plugins: [react(), tailwindcss(), dolphincssPlugin()]
91
- })
92
- ```
93
-
94
- 3. **Import Styles:** (In your main `main.jsx` or `index.css`)
95
- ```javascript
96
- import 'dolphincss/dolphin-css.css';
97
- ```
98
-
99
- ---
100
-
101
- ## =�ɼ Available Magic Components
102
-
103
- Type any of these magic markers in your `.jsx` or `.tsx` file, hit save, and watch the code generate instantly:
104
-
105
- - `<div className="dolphin-form-floating"></div>` (Beautiful Floating Label Form)
106
- - `<div className="dolphin-form-standard"></div>` (Minimalist Standard Label Form)
107
- - `<div className="dolphin-table"></div>` (Responsive Data Table)
108
- - `<div className="dolphin-toast"></div>` (Notification Toast)
109
- - `<div className="dolphin-modal"></div>` (Native HTML Dialog Modal)
110
- - `<div className="dolphin-button"></div>` (Button Variants Showcase)
111
- - `<div className="dolphin-card"></div>` (Glassmorphic Profile Card)
112
- - `<div className="dolphin-grid"></div>` (Responsive Product/Car Grid)
113
- - `<div className="dolphin-navbar"></div>` (Sleek Navigation Bar)
114
- - `<div className="dolphin-header"></div>` (Modern Header/Navbar)
115
- - `<div className="dolphin-footer"></div>` (Premium Footer Section)
116
- - `<div className="dolphin-alert"></div>` (Modern Alert Box)
117
- - `<div className="dolphin-badge"></div>` (Status Badges)
118
-
119
- - <div className="dolphin-hero"></div> (Stunning Landing Page Hero)
120
- - <div className="dolphin-pricing"></div> (Premium Pricing Tables)
121
- - <div className="dolphin-timeline"></div> (Vertical Activity Timeline)
122
- - <div className="dolphin-chat"></div> (Modern Messaging Interface)
123
- - <div className="dolphin-carousel"></div> (Interactive Image Slider)
124
- - <div className="dolphin-dropzone"></div> (Drag & Drop File Upload)
125
- - <div className="dolphin-rating"></div> (Interactive 5-Star Rating)
126
- - <div className="dolphin-steps"></div> (Progress Stepper)
127
- - <div className="dolphin-pagination"></div> (Page Navigation Controls)
128
- - <div className="dolphin-drawer"></div> (Off-canvas Glass Sidebar)
129
- - <div className="dolphin-breadcrumbs"></div> (Navigation Trail)
130
-
131
- ## ?? The Power of Variants ( x-*)
1
+ <div align="center">
2
+ <h1>🐬 DolphinCSS</h1>
3
+ <p><strong>A Next-Generation UI Library for React + TailwindCSS</strong></p>
4
+ <p><em>Where Magic Component Generation meets Beautiful Global Classes.</em></p>
5
+ </div>
6
+
7
+ ---
8
+
9
+ DolphinCSS is not just another CSS framework. It fundamentally reimagines how developers build UI by combining the extreme customizability of **TailwindCSS**, the simplicity of **Bootstrap's Global Classes**, and an unprecedented **Vite-powered Magic Component Generator**.
10
+
11
+ Say goodbye to heavy vendor lock-ins (MUI, AntD) and tedious CLI commands (Shadcn UI).
12
+
13
+ ## The 4 Unique Superpowers
14
+
15
+ ### 1. 🪄 Magic Component Generation (Zero CLI)
16
+ We loved the idea of Shadcn giving you ownership of the code, but hated running CLI commands for every single component.
17
+
18
+ With DolphinCSS, **you never touch the terminal.** Just type a magic class in your editor and save:
19
+
20
+ ```jsx
21
+ // 1. You type this in your App.jsx:
22
+ <div className="dolphin-card"></div>
23
+
24
+ // 2. You hit Save (Ctrl+S)
25
+
26
+ // 3. 🪄 MAGIC! Vite instantly replaces that line IN YOUR FILE with the full React Component code!
27
+ <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)' }}>
28
+ {/* Full customizable code is now YOURS */}
29
+ </div>
30
+ ```
31
+
32
+ ### 2. 🌐 High-Level Global Classes
33
+ Tired of writing 20 utility classes for a single button? DolphinCSS brings back the simplicity of Global Classes, but with breathtaking modern aesthetics (Glassmorphism, Neon Glows).
34
+
35
+ ```jsx
36
+ /* The Tailwind Way (Messy) */
37
+ <button className="px-6 py-2 bg-blue-500 hover:bg-blue-600 text-white font-bold rounded-lg shadow-lg shadow-blue-500/50 transition-all">
38
+ Click
39
+ </button>
40
+
41
+ /* The DolphinCSS Way (Clean & Global) */
42
+ <button className="filled primary-500 glow btn-lg">
43
+ Click
44
+ </button>
45
+ ```
46
+
47
+ ### 3. 🧩 Infinite Class Composability (Nesting)
48
+ Classes in DolphinCSS are designed to stack perfectly. Combine background colors, gradients, glows, and animations endlessly without conflicts!
49
+
50
+ ```jsx
51
+ // Combine classes to create complex, animated, glowing UI instantly:
52
+ <button className="filled success gradient glow glow-pulse rounded-full">
53
+ I am a Glowing, Pulsing, Gradient Green Button!
54
+ </button>
55
+
56
+ // Create a frosted glass overlay with a dark tint:
57
+ <div className="overlay overlay-blur-xl overlay-dark-50"></div>
58
+ ```
59
+
60
+ ### 4. 🎬 World-Class Built-in Animations
61
+ No need for `framer-motion` or `animate.css`. DolphinCSS ships with a complete `@layer utilities` animation engine that you can drop on any HTML element.
62
+
63
+ - **Continuous:** `float`, `spin-slow`, `pulse`, `bounce`, `shimmer`, `gradient-flow`, `neon-flicker`
64
+ - **Hover:** `hover-pulse`, `hover-jelly`, `hover-glow`, `hover-ripple`
65
+ - **Entrance:** `fade-in`, `slide-up`, `zoom-in`, `rotate-3d`
66
+ - **Controls:** `delay-200`, `duration-500`
67
+
68
+ ```jsx
69
+ <img src="logo.png" className="float hover-jelly fade-in delay-200" />
70
+ ```
71
+
72
+ ---
73
+
74
+ ## ⚙️ Installation & Setup
75
+
76
+ 1. **Install via npm:**
77
+ ```bash
78
+ npm install tailwindcss @tailwindcss/vite dolphincss lucide-react
79
+ ```
80
+ *(Note: `lucide-react` is required because the generated magic components use these beautiful icons by default.)*
81
+
82
+ 2. **Add the Plugins:** (In `vite.config.js`)
83
+ ```javascript
84
+ import { defineConfig } from 'vite'
85
+ import react from '@vitejs/plugin-react'
86
+ import tailwindcss from '@tailwindcss/vite'
87
+ import dolphincssPlugin from 'dolphincss/vite-plugin'
88
+
89
+ export default defineConfig({
90
+ plugins: [react(), tailwindcss(), dolphincssPlugin()]
91
+ })
92
+ ```
93
+
94
+ 3. **Import Styles:** (In your main `main.jsx` or `index.css`)
95
+ ```javascript
96
+ import 'dolphincss/dolphin-css.css';
97
+ ```
98
+
99
+ ---
100
+
101
+ ## 🧠 IoT-CSS & Dynamic OKLCH Engine (`dolphincss/ub`)
102
+
103
+ DolphinCSS includes a revolutionary runtime style engine called **`ub`** (Utility Builder). It allows you to generate mathematically computed OKLCH shades (0-255 scaling) and gradients on the fly, with native browser styling speed, O(1) LRU class caching, and automatic text contrast adjustments.
104
+
105
+ This is perfect for IoT dashboards, sensor data representations, dynamic configurations, or Tailwind CSS co-existence (allowing Tailwind users to blend their classes seamlessly).
106
+
107
+ ### Why is this a Game Changer? (The Dynamic vs Static Dilemma)
108
+ * **Zero CSS Bloat:** Pre-generating all 256 shades for 9 colors (including hover, active, and responsive variants) would require **400,000+ CSS classes**, bloating the CSS file size to over **40MB**! The `ub` engine lets you access all 256 mathematical shades on-demand while keeping the core CSS bundle size at a micro-weight **319KB**.
109
+ * **True Runtime Freedom:** Standard Tailwind is strictly build-time; you cannot feed dynamic React/JS state variables directly into class names. `ub` breaks this barrier, giving you full access to responsive layouts (`lg:`) and hover states (`hover:`) dynamically at runtime.
110
+ * **Auto-Contrast Accessibility:** No more writing extra conditional logic to switch text color (white/black) when background colors change. The engine automatically analyzes background lightness and applies contrast text color on-the-fly.
111
+ * **Native C++ Rendering Speed:** By utilizing browser-native **Constructable Stylesheets** (`adoptedStyleSheets`), style injections are resolved directly at the browser's C++ rendering engine level with minimal JS overhead.
112
+
113
+ ### ⚙️ How to Import
114
+ ```javascript
115
+ import { ub, gradient, map, oklch } from 'dolphincss/ub';
116
+ ```
117
+
118
+ ### 🪄 Core Features
119
+
120
+ #### 1. Dynamic OKLCH Shading (0-255 Scale)
121
+ Generate arbitrary, dynamically computed color shades and gradients on the fly:
122
+ ```jsx
123
+ // 128 starts a medium red, 255 ends a very dark blue
124
+ <div className={ub("card glass gradient-red-128-blue-255 p-6 rounded-2xl")}>
125
+ I am a mathematically perfect gradient!
126
+ </div>
127
+
128
+ // You can feed it dynamic states or sliders:
129
+ <div className={ub(`card bg-blue-${volumeLevel} p-4 text-center`)}>
130
+ Volume Level: {Math.round((volumeLevel/255)*100)}%
131
+ </div>
132
+ ```
133
+
134
+ #### 2. Auto-Inversion Text Contrast
135
+ You never have to manually adjust text color when background colors change. The `ub` engine dynamically parses the OKLCH lightness (L) and average hue (H) of the background, and automatically applies high-contrast light or dark text color (`oklch(...) !important`) to guarantee perfect readability!
136
+
137
+ #### 3. IoT Data Mapping
138
+ Map raw numeric values (like CPU temperatures, battery percentages, or sensor values) to intuitive color spectrums automatically:
139
+ ```jsx
140
+ // map.heat(val, min, max) maps 0-100% to green-to-red oklch shades automatically:
141
+ <div className={ub(`card ${map.heat(cpuTemp, 0, 100)} p-4 rounded-xl`)}>
142
+ CPU Temperature: {cpuTemp}°C
143
+ </div>
144
+ ```
145
+ Available map presets:
146
+ * `map.fuel(val, min, max)`: Red (low) ➔ Orange (mid) ➔ Green (high)
147
+ * `map.heat(val, min, max)`: Green (low) ➔ Red (high)
148
+ * `map.coolWarm(val, min, max)`: Blue (cool) ➔ Red (warm)
149
+ * `map.rainbow(val, min, max)`: Full rainbow spectrum partition mapping
150
+
151
+ #### 4. Ultra-Fast LRU Class Caching
152
+ The engine includes a double-layer LRU Cache (caches compiled color codes and class list parses). If a class (even a standard static CSS class like `transition-all` or `p-4`) is evaluated again, the engine returns it instantly in **O(1) time** with **0ms latency**, preventing redundant browser style recalculations and regex parses.
153
+
154
+ #### 5. Dynamic Transitions & Animations
155
+ Define dynamically timed transitions in JSX:
156
+ ```jsx
157
+ // Fills background color from left to red-128 in 500ms
158
+ className={ub("card bg-fill-left-red-128-500ms")}
159
+ ```
160
+
161
+ ---
162
+
163
+ ## 🚀 Available Magic Components
164
+
165
+ Type any of these magic markers in your `.jsx` or `.tsx` file, hit save, and watch the code generate instantly:
166
+
167
+ - `<div className="dolphin-form-floating"></div>` (Beautiful Floating Label Form)
168
+ - `<div className="dolphin-form-standard"></div>` (Minimalist Standard Label Form)
169
+ - `<div className="dolphin-table"></div>` (Responsive Data Table)
170
+ - `<div className="dolphin-toast"></div>` (Notification Toast)
171
+ - `<div className="dolphin-modal"></div>` (Native HTML Dialog Modal)
172
+ - `<div className="dolphin-button"></div>` (Button Variants Showcase)
173
+ - `<div className="dolphin-card"></div>` (Glassmorphic Profile Card)
174
+ - `<div className="dolphin-grid"></div>` (Responsive Product/Car Grid)
175
+ - `<div className="dolphin-navbar"></div>` (Sleek Navigation Bar)
176
+ - `<div className="dolphin-header"></div>` (Modern Header/Navbar)
177
+ - `<div className="dolphin-footer"></div>` (Premium Footer Section)
178
+ - `<div className="dolphin-alert"></div>` (Modern Alert Box)
179
+ - `<div className="dolphin-badge"></div>` (Status Badges)
180
+
181
+ - `<div className="dolphin-hero"></div>` (Stunning Landing Page Hero)
182
+ - `<div className="dolphin-pricing"></div>` (Premium Pricing Tables)
183
+ - `<div className="dolphin-timeline"></div>` (Vertical Activity Timeline)
184
+ - `<div className="dolphin-chat"></div>` (Modern Messaging Interface)
185
+ - `<div className="dolphin-carousel"></div>` (Interactive Image Slider)
186
+ - `<div className="dolphin-dropzone"></div>` (Drag & Drop File Upload)
187
+ - `<div className="dolphin-rating"></div>` (Interactive 5-Star Rating)
188
+ - `<div className="dolphin-steps"></div>` (Progress Stepper)
189
+ - `<div className="dolphin-pagination"></div>` (Page Navigation Controls)
190
+ - `<div className="dolphin-drawer"></div>` (Off-canvas Glass Sidebar)
191
+ - `<div className="dolphin-breadcrumbs"></div>` (Navigation Trail)
192
+
193
+ ## 🎭 The Power of Variants (fx-*)
132
194
 
133
195
  DolphinCSS ships with world-class, pre-built global variants. Instead of writing 15 Tailwind utility classes to create a glassmorphism effect, just use one class!
134
196
 
135
- ### ?? Premium Effects
197
+ ### 🌟 Premium Effects
136
198
  Combine these on any div, card, or container:
137
- - x-glass (Classic Frosted Glass)
138
- - x-crystal (Ultra-clear Crystal Border)
139
- - x-neon (Cyberpunk Neon Glow)
140
- - x-holo (Holographic Matrix)
141
- - x-flare (Solar Flare Gradient)
142
- - x-cyber (Cyberpunk Aesthetic)
143
- - x-nebula (Galactic Nebula Depth)
144
- - x-metal (Liquid Mercury)
145
- - x-aurora (Frosted Aurora)
146
- - x-float (Quantum Float on Hover)
147
-
148
- ### ?? Advanced Glows & Animations
199
+ - fx-glass (Classic Frosted Glass)
200
+ - fx-crystal (Ultra-clear Crystal Border)
201
+ - fx-neon (Cyberpunk Neon Glow)
202
+ - fx-holo (Holographic Matrix)
203
+ - fx-flare (Solar Flare Gradient)
204
+ - fx-cyber (Cyberpunk Aesthetic)
205
+ - fx-nebula (Galactic Nebula Depth)
206
+ - fx-metal (Liquid Mercury)
207
+ - fx-aurora (Frosted Aurora)
208
+ - fx-float (Quantum Float on Hover)
209
+
210
+ ### 🔥 Advanced Glows & Animations
149
211
  Bring your UI to life instantly:
150
212
  - glow (Standard Hover Glow)
151
213
  - glow pulse (Continuous Pulsing Glow)
152
214
  - glow wave (Ocean Wave Animation)
153
215
 
154
- ### ?? Global Colors & Buttons
216
+ ### 🎨 Global Colors & Buttons
155
217
  Propagate theme colors cleanly:
156
- `jsx
218
+ ```jsx
157
219
  <button className="filled primary px-6 py-2 glow wave">Primary Action</button>
158
220
  <button className="outlined success px-6 py-2">Success Outline</button>
159
221
  <button className="plain danger px-6 py-2">Danger Plain</button>
@@ -162,8 +224,7 @@ Propagate theme colors cleanly:
162
224
  <button className="circle lg fx-aurora glow wave">
163
225
  <Icon />
164
226
  </button>
165
- `
166
-
227
+ ```
167
228
 
168
229
  ---
169
230