kozenet_ui 0.1.2 ā 0.1.4
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/lib/generators/kozenet_ui/install/install_generator.rb +115 -37
- data/lib/kozenet_ui/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b0fcc9958c3055b42e04b2d7e2064c88631daf27af857035cb9deca16716496c
|
|
4
|
+
data.tar.gz: f684b39ea638522c85204cb658c41b6c6d5317b53a9c1e0d8490e0b64fc0c424
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aa089f5a87d6164a65ca494bab87f723b3d83343554efb82e989274f52bbbbb7b0f9622521cdcecc226e407fa93f0938015ee218c1ef10a3645cbc5d8b90a328
|
|
7
|
+
data.tar.gz: 47a02c24ec42c5e3a298cafa525ecc2d3f408f26202d61fe45e3dfad17cd6361ba69ac5b6de44e845a99013f8c21c64cd8ef64b06355ebec692721fd31fa6620
|
|
@@ -5,6 +5,7 @@ require "rails/generators/base"
|
|
|
5
5
|
module KozenetUi
|
|
6
6
|
module Generators
|
|
7
7
|
# Generator for installing Kozenet UI into a Rails application
|
|
8
|
+
# Copies stylesheets, creates initializer, and updates application CSS
|
|
8
9
|
class InstallGenerator < Rails::Generators::Base
|
|
9
10
|
source_root File.expand_path("templates", __dir__)
|
|
10
11
|
|
|
@@ -14,53 +15,130 @@ module KozenetUi
|
|
|
14
15
|
template "kozenet_ui.rb", "config/initializers/kozenet_ui.rb"
|
|
15
16
|
end
|
|
16
17
|
|
|
17
|
-
def
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
def copy_stylesheets
|
|
19
|
+
say "š¦ Copying Kozenet UI stylesheets...", :blue
|
|
20
|
+
setup_directories
|
|
21
|
+
copy_main_stylesheets
|
|
22
|
+
copy_component_stylesheets
|
|
23
|
+
say "ā
Stylesheets copied successfully!", :green
|
|
23
24
|
end
|
|
24
25
|
|
|
25
|
-
# rubocop:disable Metrics/MethodLength
|
|
26
26
|
def add_stylesheets_to_application
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
27
|
+
css_file = find_application_css
|
|
28
|
+
return warn_no_css_file unless css_file
|
|
29
|
+
|
|
30
|
+
update_css_file(css_file)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def show_readme
|
|
34
|
+
display_success_message
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
private
|
|
38
|
+
|
|
39
|
+
def setup_directories
|
|
40
|
+
dest_dir = Rails.root.join("app/assets/stylesheets/kozenet_ui")
|
|
41
|
+
FileUtils.mkdir_p(dest_dir)
|
|
42
|
+
FileUtils.mkdir_p(dest_dir.join("components"))
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def copy_main_stylesheets
|
|
46
|
+
%w[tokens.css base.css components.css].each do |file|
|
|
47
|
+
copy_stylesheet_file(file)
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def copy_component_stylesheets
|
|
52
|
+
component_files = Dir.glob(File.join(gem_stylesheets_path, "components", "*.css"))
|
|
53
|
+
component_files.each { |src| copy_component_file(src) }
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def copy_stylesheet_file(filename)
|
|
57
|
+
src = File.join(gem_stylesheets_path, filename)
|
|
58
|
+
dest = Rails.root.join("app/assets/stylesheets/kozenet_ui", filename)
|
|
59
|
+
|
|
60
|
+
if File.exist?(src)
|
|
61
|
+
FileUtils.cp(src, dest)
|
|
62
|
+
say " ā Copied #{filename}", :green
|
|
43
63
|
else
|
|
44
|
-
say "
|
|
45
|
-
"Please manually import Kozenet UI stylesheets.", :yellow
|
|
64
|
+
say " ā #{filename} not found!", :red
|
|
46
65
|
end
|
|
47
66
|
end
|
|
48
|
-
# rubocop:enable Metrics/MethodLength
|
|
49
67
|
|
|
50
|
-
def
|
|
51
|
-
|
|
68
|
+
def copy_component_file(src_path)
|
|
69
|
+
filename = File.basename(src_path)
|
|
70
|
+
dest = Rails.root.join("app/assets/stylesheets/kozenet_ui/components", filename)
|
|
71
|
+
FileUtils.cp(src_path, dest)
|
|
72
|
+
say " ā Copied components/#{filename}", :green
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def gem_stylesheets_path
|
|
76
|
+
@gem_stylesheets_path ||= begin
|
|
77
|
+
gem_spec = Gem::Specification.find_by_name("kozenet_ui")
|
|
78
|
+
File.join(gem_spec.gem_dir, "app/assets/stylesheets/kozenet_ui")
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def find_application_css
|
|
83
|
+
%w[
|
|
84
|
+
app/assets/stylesheets/application.tailwind.css
|
|
85
|
+
app/assets/stylesheets/application.css
|
|
86
|
+
].find { |path| File.exist?(path) }
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
def update_css_file(css_file)
|
|
90
|
+
content = File.read(css_file)
|
|
91
|
+
|
|
92
|
+
if content.include?("kozenet_ui/base.css")
|
|
93
|
+
say "File unchanged! Kozenet UI styles already present", :yellow
|
|
94
|
+
else
|
|
95
|
+
append_to_file css_file, stylesheet_imports
|
|
96
|
+
say "ā
Added imports to #{css_file}", :green
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
def stylesheet_imports
|
|
101
|
+
<<~CSS
|
|
102
|
+
|
|
103
|
+
/* Kozenet UI Styles */
|
|
104
|
+
@import "kozenet_ui/tokens.css";
|
|
105
|
+
@import "kozenet_ui/base.css";
|
|
106
|
+
@import "kozenet_ui/components.css";
|
|
107
|
+
CSS
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
def warn_no_css_file
|
|
111
|
+
say "ā ļø Could not find application CSS file", :yellow
|
|
112
|
+
say "Add these imports manually:", :yellow
|
|
113
|
+
say stylesheet_imports.strip, :cyan
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def display_success_message
|
|
117
|
+
say_header
|
|
118
|
+
say_next_steps
|
|
119
|
+
say_documentation
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
def say_header
|
|
123
|
+
say "\n#{"=" * 60}", :green
|
|
124
|
+
say "ā
Kozenet UI installed successfully!", :green
|
|
125
|
+
say ("=" * 60).to_s, :green
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
def say_next_steps
|
|
52
129
|
say "\nNext steps:", :cyan
|
|
53
|
-
say " 1. Add
|
|
54
|
-
say "
|
|
55
|
-
say "
|
|
56
|
-
say "
|
|
130
|
+
say " 1. Add to layout <head>:", :white
|
|
131
|
+
say " <%= kozenet_ui_theme_variables_tag %>", :yellow
|
|
132
|
+
say "\n 2. Restart server:", :white
|
|
133
|
+
say " bin/dev", :yellow
|
|
134
|
+
say "\n 3. Use components:", :white
|
|
135
|
+
say " <%= kz_button { 'Click me' } %>", :yellow
|
|
136
|
+
say "\n 4. Customize colors:", :white
|
|
137
|
+
say " config/initializers/kozenet_ui.rb", :yellow
|
|
57
138
|
end
|
|
58
139
|
|
|
59
|
-
def
|
|
60
|
-
|
|
61
|
-
copy_css_files_to_app
|
|
62
|
-
add_stylesheets_to_application
|
|
63
|
-
show_readme
|
|
140
|
+
def say_documentation
|
|
141
|
+
say "\nš Documentation: https://github.com/kozenetpro/kozenet_ui\n\n", :blue
|
|
64
142
|
end
|
|
65
143
|
end
|
|
66
144
|
end
|
data/lib/kozenet_ui/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kozenet_ui
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kozenet Pro
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-11-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: color
|
|
@@ -218,10 +218,11 @@ dependencies:
|
|
|
218
218
|
- - "~>"
|
|
219
219
|
- !ruby/object:Gem::Version
|
|
220
220
|
version: '4.0'
|
|
221
|
-
description:
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
221
|
+
description: |
|
|
222
|
+
Kozenet UI is a modern, production-ready component library for Ruby on Rails.
|
|
223
|
+
Built with ViewComponent and Tailwind CSS, it provides beautiful, accessible,
|
|
224
|
+
and customizable UI components with dynamic theming support. Features CSP-compliant
|
|
225
|
+
styling, dark mode, and smooth animations.
|
|
225
226
|
email:
|
|
226
227
|
- kozenetpro@gmail.com
|
|
227
228
|
executables: []
|