daisyui_on_phlex 0.5.1 → 0.5.2
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.
- checksums.yaml +4 -4
- data/README.md +37 -6
- data/lib/daisyui_on_phlex/generators/install_generator.rb +15 -5
- data/lib/daisyui_on_phlex/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a02c3243f0a1f0e755bebddc3008d50e926f89a891b7965756ad26a4cef5c25f
|
4
|
+
data.tar.gz: 744d6269e5a2e612215db35a78aeb4ebb0dbc3539f3023d0e079e16adcd8ef78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf9912951a18a6984d7b4af8fe18f581f8b89f4052ce8f513de853373b4c73f7c0c02e6113652b52faa14e1b027164d159ca3bac8447957139b16dfc4c5a2d47
|
7
|
+
data.tar.gz: '0851f1840f4301b338a638d77068ebf4593346961316c1924155b920d8c56790cb0464bfcb7688baeda814c9e1e810b316c26bb228af67a796e2a296b30663b5'
|
data/README.md
CHANGED
@@ -57,14 +57,41 @@ Run the install generator to set up DaisyUI components in your Rails application
|
|
57
57
|
$ rails generate daisyui_on_phlex:install
|
58
58
|
```
|
59
59
|
|
60
|
+
Next import js/css from vendor directory.
|
61
|
+
|
60
62
|
This will:
|
61
63
|
1. **Copy all 61+ components** to `vendor/daisyui_on_phlex/components/` in your Rails app
|
62
|
-
2. **
|
63
|
-
3.
|
64
|
-
4.
|
65
|
-
5.
|
66
|
-
6.
|
67
|
-
|
64
|
+
2. **Copy CSS and JS files** to `vendor/daisyui_on_phlex/stylesheets/` and `javascripts/`
|
65
|
+
3. **Configure autoloader** to serve components from vendor directory instead of gem
|
66
|
+
4. Install **phlex-rails** dependency if not already present
|
67
|
+
5. **Create vendor initializer** for automatic component loading
|
68
|
+
6. Provide usage instructions for CSS/JS integration
|
69
|
+
|
70
|
+
### Import CSS and JavaScript
|
71
|
+
|
72
|
+
After running the generator, add these imports to your application:
|
73
|
+
|
74
|
+
**For modern Rails (importmap/esbuild/webpack):**
|
75
|
+
```css
|
76
|
+
/* In app/assets/stylesheets/application.css or application.tailwind.css */
|
77
|
+
@import '../vendor/daisyui_on_phlex/stylesheets/daisyui_on_phlex.css';
|
78
|
+
```
|
79
|
+
|
80
|
+
```javascript
|
81
|
+
// In app/assets/javascripts/application.js
|
82
|
+
import '../vendor/daisyui_on_phlex/javascripts/daisyui_on_phlex.js';
|
83
|
+
```
|
84
|
+
|
85
|
+
**For Sprockets (Rails 6 and older):**
|
86
|
+
```css
|
87
|
+
/* In app/assets/stylesheets/application.css */
|
88
|
+
//= require ../vendor/daisyui_on_phlex/stylesheets/daisyui_on_phlex
|
89
|
+
```
|
90
|
+
|
91
|
+
```javascript
|
92
|
+
// In app/assets/javascripts/application.js
|
93
|
+
//= require ../vendor/daisyui_on_phlex/javascripts/daisyui_on_phlex
|
94
|
+
```
|
68
95
|
|
69
96
|
### Why Copy to Vendor?
|
70
97
|
|
@@ -363,6 +390,10 @@ After installation, your vendor directory will contain:
|
|
363
390
|
```
|
364
391
|
vendor/daisyui_on_phlex/
|
365
392
|
├── base.rb # Base class for all components
|
393
|
+
├── stylesheets/
|
394
|
+
│ └── daisyui_on_phlex.css # Complete DaisyUI CSS with themes
|
395
|
+
├── javascripts/
|
396
|
+
│ └── daisyui_on_phlex.js # Theme switching and utilities
|
366
397
|
└── components/
|
367
398
|
├── accordion.rb
|
368
399
|
├── alert.rb
|
@@ -74,6 +74,16 @@ module DaisyuiOnPhlex
|
|
74
74
|
copy_file "base.rb", Rails.root.join("vendor/daisyui_on_phlex/base.rb"), force: options["force"]
|
75
75
|
end
|
76
76
|
|
77
|
+
def copy_stylesheets_and_js
|
78
|
+
say "Copying CSS and JS files to vendor...", :green
|
79
|
+
|
80
|
+
# Copy CSS file
|
81
|
+
copy_file "stylesheets/daisyui_on_phlex.css", Rails.root.join("vendor/daisyui_on_phlex/stylesheets/daisyui_on_phlex.css"), force: options["force"]
|
82
|
+
|
83
|
+
# Copy JS file
|
84
|
+
copy_file "javascripts/daisyui_on_phlex.js", Rails.root.join("vendor/daisyui_on_phlex/javascripts/daisyui_on_phlex.js"), force: options["force"]
|
85
|
+
end
|
86
|
+
|
77
87
|
def create_vendor_initializer
|
78
88
|
vendor_initializer_path = Rails.root.join("config/initializers/daisyui_on_phlex.rb")
|
79
89
|
|
@@ -107,13 +117,13 @@ module DaisyuiOnPhlex
|
|
107
117
|
end
|
108
118
|
|
109
119
|
def update_tailwind_config
|
110
|
-
say "📝 To include DaisyUI styles in your application:", :green
|
120
|
+
say "📝 To include DaisyUI styles and JS in your application:", :green
|
111
121
|
say ""
|
112
122
|
say "1. Add to your main CSS file (application.css or application.tailwind.css):", :yellow
|
113
|
-
say "
|
123
|
+
say " @import '../../../vendor/daisyui_on_phlex/stylesheets/daisyui_on_phlex.css';", :cyan
|
114
124
|
say ""
|
115
|
-
say "2.
|
116
|
-
say "
|
125
|
+
say "2. Add to your JavaScript file (application.js):", :yellow
|
126
|
+
say " import '../../../vendor/daisyui_on_phlex/javascripts/daisyui_on_phlex.js';", :cyan
|
117
127
|
say ""
|
118
128
|
say "3. For Tailwind CSS, ensure your tailwind.config.js includes:", :yellow
|
119
129
|
say ' content: ["./vendor/daisyui_on_phlex/**/*.rb"]', :cyan
|
@@ -129,7 +139,7 @@ module DaisyuiOnPhlex
|
|
129
139
|
DaisyUI On Phlex has been installed! 🎉
|
130
140
|
|
131
141
|
✅ All #{component_count} components have been copied to vendor/daisyui_on_phlex/
|
132
|
-
✅ DaisyUI CSS & JS
|
142
|
+
✅ DaisyUI CSS & JS files copied to vendor/daisyui_on_phlex/stylesheets/ and javascripts/
|
133
143
|
✅ Vendor initializer created (config/initializers/daisyui_on_phlex.rb)
|
134
144
|
✅ Ready to use in your Phlex views
|
135
145
|
|