daisyui_on_phlex 0.5.0 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c06ad40c76dc297ff9797fe359b68daf27c687970c534fc806ba538f38c3250
4
- data.tar.gz: 40be3a774c215ca0ac34e70d1cdd96295f1b2e1fe8faee5a941fec710b506ec2
3
+ metadata.gz: a02c3243f0a1f0e755bebddc3008d50e926f89a891b7965756ad26a4cef5c25f
4
+ data.tar.gz: 744d6269e5a2e612215db35a78aeb4ebb0dbc3539f3023d0e079e16adcd8ef78
5
5
  SHA512:
6
- metadata.gz: 7b642f267c2e92389fb1bb679bce649ce6f65f1dc987716fcda811fdae5ff01f0495dd5b3202ec4479c0369db10ad07a51df3876caae8b56e16be39001e12d9d
7
- data.tar.gz: e933135c772eb7172321e602103fbb555cf35ae1314d05853754538eed52329cbfefc73081d208f5ea2c85648452f7f7a6272694543eb562cb6ffd1ca4a27a98
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. **Configure autoloader** to serve components from vendor directory instead of gem
63
- 3. Install **phlex-rails** dependency if not already present
64
- 4. Download the latest **DaisyUI JavaScript files**
65
- 5. Configure your **Tailwind CSS** to include the DaisyUI plugin
66
- 6. Add CSS imports to your application
67
- 7. Provide usage instructions
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 " //= require daisyui_on_phlex", :cyan
123
+ say " @import '../../../vendor/daisyui_on_phlex/stylesheets/daisyui_on_phlex.css';", :cyan
114
124
  say ""
115
- say "2. Or in your JavaScript file (application.js):", :yellow
116
- say " //= require daisyui_on_phlex", :cyan
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 automatically provided via Rails Engine
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DaisyuiOnPhlex
4
- VERSION = "0.5.0"
4
+ VERSION = "0.5.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daisyui_on_phlex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - JacobAlexander