senren-ui 0.1.6 → 0.3.0
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/CHANGELOG.md +215 -0
- data/CONTRIBUTING.md +41 -3
- data/README.md +138 -33
- data/Rakefile +14 -1
- data/docs/components.md +10 -10
- data/docs/hot_reload.md +103 -0
- data/docs/performance_testing.md +7 -3
- data/docs/visual_style.md +80 -0
- data/lib/generators/senren/component/templates/controller.js.tt +7 -4
- data/lib/generators/senren/install/install_generator.rb +77 -0
- data/lib/generators/senren/install/templates/base_component.rb.tt +142 -4
- data/lib/generators/senren/install/templates/conventions.md.tt +57 -1
- data/lib/generators/senren/install/templates/senren_themes.css.tt +339 -0
- data/lib/senren/rails/agent_rules_writer.rb +65 -19
- data/lib/senren/rails/asset_path_guard.rb +128 -0
- data/lib/senren/rails/base_component_patch.rb +64 -0
- data/lib/senren/rails/component_copier.rb +101 -50
- data/lib/senren/rails/component_installer.rb +26 -0
- data/lib/senren/rails/doctor.rb +7 -4
- data/lib/senren/rails/engine.rb +23 -0
- data/lib/senren/rails/host_paths.rb +11 -2
- data/lib/senren/rails/marker_block.rb +81 -0
- data/lib/senren/rails/registry.rb +10 -4
- data/lib/senren/rails/safe_write.rb +169 -0
- data/lib/senren/rails/skill_writer.rb +47 -11
- data/lib/senren/rails/version.rb +1 -1
- data/lib/senren/rails.rb +1 -1
- data/lib/senren-ui.rb +15 -0
- data/lib/tasks/senren.rake +43 -17
- data/registry/components.yml +45 -0
- data/registry/recipes.yml +12 -0
- data/templates/components/accordion/accordion_component.html.erb +3 -3
- data/templates/components/alert_dialog/alert_dialog_component.html.erb +6 -3
- data/templates/components/alert_dialog/alert_dialog_component.rb +5 -1
- data/templates/components/api_key_field/api_key_field_component.html.erb +1 -1
- data/templates/components/aspect_ratio/aspect_ratio_component.rb +7 -0
- data/templates/components/avatar/avatar_component.rb +8 -1
- data/templates/components/breadcrumb/breadcrumb_component.html.erb +8 -6
- data/templates/components/button/button_component.html.erb +1 -1
- data/templates/components/button/button_component.rb +27 -1
- data/templates/components/calendar/calendar_component.html.erb +2 -2
- data/templates/components/card/card_component.html.erb +4 -6
- data/templates/components/carousel/carousel_component.html.erb +1 -1
- data/templates/components/cart/cart_component.html.erb +67 -0
- data/templates/components/cart/cart_component.rb +71 -0
- data/templates/components/checkbox/checkbox_component.rb +1 -1
- data/templates/components/clipboard/clipboard_component.html.erb +3 -3
- data/templates/components/collapsible/collapsible_component.html.erb +3 -3
- data/templates/components/combobox/combobox_component.html.erb +3 -3
- data/templates/components/command/command_component.html.erb +1 -1
- data/templates/components/command/command_component.rb +1 -1
- data/templates/components/context_menu/context_menu_component.html.erb +6 -3
- data/templates/components/date_picker/date_picker_component.html.erb +3 -3
- data/templates/components/dialog/dialog_component.html.erb +7 -3
- data/templates/components/dialog/dialog_component.rb +12 -1
- data/templates/components/dropdown_menu/dropdown_menu_component.html.erb +6 -3
- data/templates/components/dropdown_menu/dropdown_menu_component.rb +57 -5
- data/templates/components/form/form_component.rb +9 -1
- data/templates/components/hover_card/hover_card_component.html.erb +6 -3
- data/templates/components/invite_member_dialog/invite_member_dialog_component.html.erb +3 -2
- data/templates/components/invite_member_dialog/invite_member_dialog_component.rb +1 -1
- data/templates/components/link/link_component.html.erb +1 -1
- data/templates/components/native_select/native_select_component.html.erb +2 -2
- data/templates/components/pagination/pagination_component.html.erb +2 -2
- data/templates/components/popover/popover_component.html.erb +6 -3
- data/templates/components/product_card/product_card_component.html.erb +38 -0
- data/templates/components/product_card/product_card_component.rb +49 -0
- data/templates/components/progress/progress_component.html.erb +2 -2
- data/templates/components/rich_text_editor_lite/rich_text_editor_lite_component.html.erb +1 -1
- data/templates/components/rich_text_editor_lite/rich_text_editor_lite_component.rb +1 -1
- data/templates/components/search_input/search_input_component.html.erb +2 -2
- data/templates/components/separator/separator_component.rb +7 -0
- data/templates/components/sheet/sheet_component.html.erb +13 -4
- data/templates/components/sheet/sheet_component.rb +12 -1
- data/templates/components/shortcut_key/shortcut_key_component.html.erb +2 -2
- data/templates/components/sidebar/sidebar_component.html.erb +2 -2
- data/templates/components/switch/switch_component.html.erb +1 -1
- data/templates/components/table/table_component.html.erb +2 -2
- data/templates/components/tabs/tabs_component.html.erb +3 -3
- data/templates/components/tooltip/tooltip_component.html.erb +5 -3
- data/templates/components/tooltip/tooltip_component.rb +2 -2
- data/templates/components/top_nav/top_nav_component.html.erb +2 -2
- data/templates/components/typography/typography_component.rb +7 -0
- data/templates/controllers/accordion_controller.js +1 -1
- data/templates/controllers/alert_dialog_controller.js +31 -7
- data/templates/controllers/cart_controller.js +85 -0
- data/templates/controllers/clipboard_controller.js +12 -1
- data/templates/controllers/command_controller.js +3 -4
- data/templates/controllers/context_menu_controller.js +38 -11
- data/templates/controllers/data_table_controller.js +8 -3
- data/templates/controllers/dialog_controller.js +47 -21
- data/templates/controllers/dropdown_menu_controller.js +40 -27
- data/templates/controllers/hover_card_controller.js +8 -0
- data/templates/controllers/invite_member_dialog_controller.js +6 -0
- data/templates/controllers/masked_input_controller.js +8 -1
- data/templates/controllers/popover_controller.js +25 -10
- data/templates/controllers/rich_text_editor_lite_controller.js +165 -28
- data/templates/controllers/sheet_controller.js +41 -11
- metadata +14 -17
- data/lib/senren/rails/installer.rb +0 -85
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: senren-ui
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- vutt
|
|
@@ -9,20 +9,6 @@ bindir: bin
|
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
|
-
- !ruby/object:Gem::Dependency
|
|
13
|
-
name: nokogiri
|
|
14
|
-
requirement: !ruby/object:Gem::Requirement
|
|
15
|
-
requirements:
|
|
16
|
-
- - ">="
|
|
17
|
-
- !ruby/object:Gem::Version
|
|
18
|
-
version: 1.19.3
|
|
19
|
-
type: :runtime
|
|
20
|
-
prerelease: false
|
|
21
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
-
requirements:
|
|
23
|
-
- - ">="
|
|
24
|
-
- !ruby/object:Gem::Version
|
|
25
|
-
version: 1.19.3
|
|
26
12
|
- !ruby/object:Gem::Dependency
|
|
27
13
|
name: rails
|
|
28
14
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -68,6 +54,7 @@ files:
|
|
|
68
54
|
- README.md
|
|
69
55
|
- Rakefile
|
|
70
56
|
- docs/components.md
|
|
57
|
+
- docs/hot_reload.md
|
|
71
58
|
- docs/performance_testing.md
|
|
72
59
|
- docs/visual_style.md
|
|
73
60
|
- lib/commands/senren/add/add_command.rb
|
|
@@ -82,16 +69,21 @@ files:
|
|
|
82
69
|
- lib/generators/senren/install/templates/conventions.md.tt
|
|
83
70
|
- lib/generators/senren/install/templates/installed_components.yml.tt
|
|
84
71
|
- lib/generators/senren/install/templates/senren.css.tt
|
|
72
|
+
- lib/generators/senren/install/templates/senren_themes.css.tt
|
|
73
|
+
- lib/senren-ui.rb
|
|
85
74
|
- lib/senren/rails.rb
|
|
86
75
|
- lib/senren/rails/agent_rules_writer.rb
|
|
76
|
+
- lib/senren/rails/asset_path_guard.rb
|
|
77
|
+
- lib/senren/rails/base_component_patch.rb
|
|
87
78
|
- lib/senren/rails/component_copier.rb
|
|
88
79
|
- lib/senren/rails/component_installer.rb
|
|
89
80
|
- lib/senren/rails/doctor.rb
|
|
90
81
|
- lib/senren/rails/engine.rb
|
|
91
82
|
- lib/senren/rails/host_paths.rb
|
|
92
|
-
- lib/senren/rails/installer.rb
|
|
93
83
|
- lib/senren/rails/llms_writer.rb
|
|
84
|
+
- lib/senren/rails/marker_block.rb
|
|
94
85
|
- lib/senren/rails/registry.rb
|
|
86
|
+
- lib/senren/rails/safe_write.rb
|
|
95
87
|
- lib/senren/rails/skill_writer.rb
|
|
96
88
|
- lib/senren/rails/version.rb
|
|
97
89
|
- lib/tasks/senren.rake
|
|
@@ -130,6 +122,8 @@ files:
|
|
|
130
122
|
- templates/components/card/card_component.rb
|
|
131
123
|
- templates/components/carousel/carousel_component.html.erb
|
|
132
124
|
- templates/components/carousel/carousel_component.rb
|
|
125
|
+
- templates/components/cart/cart_component.html.erb
|
|
126
|
+
- templates/components/cart/cart_component.rb
|
|
133
127
|
- templates/components/checkbox/checkbox_component.html.erb
|
|
134
128
|
- templates/components/checkbox/checkbox_component.rb
|
|
135
129
|
- templates/components/checkbox_group/checkbox_group_component.html.erb
|
|
@@ -180,6 +174,8 @@ files:
|
|
|
180
174
|
- templates/components/pagination/pagination_component.rb
|
|
181
175
|
- templates/components/popover/popover_component.html.erb
|
|
182
176
|
- templates/components/popover/popover_component.rb
|
|
177
|
+
- templates/components/product_card/product_card_component.html.erb
|
|
178
|
+
- templates/components/product_card/product_card_component.rb
|
|
183
179
|
- templates/components/progress/progress_component.html.erb
|
|
184
180
|
- templates/components/progress/progress_component.rb
|
|
185
181
|
- templates/components/radio_button/radio_button_component.html.erb
|
|
@@ -227,6 +223,7 @@ files:
|
|
|
227
223
|
- templates/controllers/api_key_field_controller.js
|
|
228
224
|
- templates/controllers/calendar_controller.js
|
|
229
225
|
- templates/controllers/carousel_controller.js
|
|
226
|
+
- templates/controllers/cart_controller.js
|
|
230
227
|
- templates/controllers/clipboard_controller.js
|
|
231
228
|
- templates/controllers/collapsible_controller.js
|
|
232
229
|
- templates/controllers/combobox_controller.js
|
|
@@ -270,7 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
270
267
|
- !ruby/object:Gem::Version
|
|
271
268
|
version: '0'
|
|
272
269
|
requirements: []
|
|
273
|
-
rubygems_version: 4.0.
|
|
270
|
+
rubygems_version: 4.0.6
|
|
274
271
|
specification_version: 4
|
|
275
272
|
summary: Rails-native UI component library with ViewComponent, Hotwire, Tailwind,
|
|
276
273
|
and AI-agent skill files.
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'fileutils'
|
|
4
|
-
|
|
5
|
-
module Senren
|
|
6
|
-
module Rails
|
|
7
|
-
# Idempotent installer that lays down the .senren directory, base
|
|
8
|
-
# component, stylesheet, and agent instruction files. Reused by the install
|
|
9
|
-
# generator and by ad-hoc rake task entry points.
|
|
10
|
-
class Installer
|
|
11
|
-
attr_reader :paths, :stdout
|
|
12
|
-
|
|
13
|
-
def initialize(paths: HostPaths.new, stdout: $stdout)
|
|
14
|
-
@paths = paths
|
|
15
|
-
@stdout = stdout
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def run!(force: false)
|
|
19
|
-
paths.ensure_dirs!
|
|
20
|
-
install_static_files(force: force)
|
|
21
|
-
mirror_registry
|
|
22
|
-
SkillWriter.new(paths: paths).sync!
|
|
23
|
-
AgentRulesWriter.new(paths: paths).sync!
|
|
24
|
-
print_next_steps
|
|
25
|
-
true
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
INSTALL_GENERATOR_TEMPLATES = File.expand_path(
|
|
29
|
-
'../../generators/senren/install/templates', __dir__
|
|
30
|
-
).freeze
|
|
31
|
-
|
|
32
|
-
STATIC_FILES = {
|
|
33
|
-
'conventions.md.tt' => :conventions_file,
|
|
34
|
-
'installed_components.yml.tt' => :installed_components,
|
|
35
|
-
'base_component.rb.tt' => :base_component_path,
|
|
36
|
-
'senren.css.tt' => :stylesheet_path
|
|
37
|
-
}.freeze
|
|
38
|
-
|
|
39
|
-
private
|
|
40
|
-
|
|
41
|
-
def install_static_files(force:)
|
|
42
|
-
STATIC_FILES.each do |template_basename, paths_method|
|
|
43
|
-
src = File.join(INSTALL_GENERATOR_TEMPLATES, template_basename)
|
|
44
|
-
dest = paths.public_send(paths_method)
|
|
45
|
-
copy_template(src, dest, force: force)
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
def copy_template(src, dest, force:)
|
|
50
|
-
unless File.exist?(src)
|
|
51
|
-
stdout.puts " warn template missing: #{src}"
|
|
52
|
-
return
|
|
53
|
-
end
|
|
54
|
-
if File.exist?(dest) && !force
|
|
55
|
-
stdout.puts " skip #{dest}"
|
|
56
|
-
return
|
|
57
|
-
end
|
|
58
|
-
FileUtils.mkdir_p(File.dirname(dest))
|
|
59
|
-
FileUtils.cp(src, dest)
|
|
60
|
-
stdout.puts " copy #{dest}"
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
def mirror_registry
|
|
64
|
-
FileUtils.mkdir_p(paths.registry_mirror.dirname)
|
|
65
|
-
FileUtils.cp(Senren::Rails.registry_path, paths.registry_mirror)
|
|
66
|
-
stdout.puts " mirror #{paths.registry_mirror}"
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
def print_next_steps
|
|
70
|
-
stdout.puts <<~MSG
|
|
71
|
-
|
|
72
|
-
Senren installed. Next steps:
|
|
73
|
-
|
|
74
|
-
bin/rails senren:add button card badge alert
|
|
75
|
-
bin/rails senren:add dialog dropdown_menu
|
|
76
|
-
bundle exec rails senren:add form input textarea
|
|
77
|
-
bin/rails senren:agents:sync
|
|
78
|
-
bin/rails senren:doctor
|
|
79
|
-
|
|
80
|
-
Read .senren/skill.md and .senren/conventions.md to get oriented.
|
|
81
|
-
MSG
|
|
82
|
-
end
|
|
83
|
-
end
|
|
84
|
-
end
|
|
85
|
-
end
|