maquina-components 0.1.2 → 0.2.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/README.md +349 -138
- data/app/assets/images/maquina.svg +1 -0
- data/app/assets/stylesheets/alert.css +143 -0
- data/app/assets/stylesheets/badge.css +145 -0
- data/app/assets/stylesheets/breadcrumbs.css +163 -0
- data/app/assets/stylesheets/card.css +128 -0
- data/app/assets/stylesheets/dropdown_menu.css +248 -0
- data/app/assets/stylesheets/empty.css +133 -0
- data/app/assets/stylesheets/form.css +617 -0
- data/app/assets/stylesheets/header.css +61 -0
- data/app/assets/stylesheets/maquina_components.css +143 -64
- data/app/assets/stylesheets/pagination.css +154 -0
- data/app/assets/stylesheets/sidebar.css +477 -0
- data/app/assets/stylesheets/table.css +205 -0
- data/app/assets/stylesheets/toggle_group.css +151 -0
- data/app/assets/tailwind/maquina_components_engine/engine.css +16 -0
- data/app/helpers/maquina_components/breadcrumbs_helper.rb +118 -0
- data/app/helpers/maquina_components/dropdown_menu_helper.rb +249 -0
- data/app/helpers/maquina_components/empty_helper.rb +102 -0
- data/app/helpers/{components → maquina_components}/icons_helper.rb +40 -3
- data/app/helpers/maquina_components/pagination_helper.rb +153 -0
- data/app/helpers/maquina_components/sidebar_helper.rb +63 -0
- data/app/helpers/maquina_components/table_helper.rb +144 -0
- data/app/helpers/maquina_components/toggle_group_helper.rb +172 -0
- data/app/javascript/controllers/breadcrumb_controller.js +71 -0
- data/app/javascript/controllers/dropdown_menu_controller.js +203 -0
- data/app/javascript/controllers/menu_button_controller.js +59 -0
- data/app/javascript/controllers/sidebar_controller.js +316 -0
- data/app/javascript/controllers/sidebar_trigger_controller.js +32 -0
- data/app/javascript/controllers/toggle_group_controller.js +178 -0
- data/app/views/components/_alert.html.erb +11 -10
- data/app/views/components/_badge.html.erb +10 -0
- data/app/views/components/_breadcrumbs.html.erb +16 -0
- data/app/views/components/_card.html.erb +4 -8
- data/app/views/components/_dropdown.html.erb +25 -0
- data/app/views/components/_dropdown_menu.html.erb +9 -0
- data/app/views/components/_empty.html.erb +10 -0
- data/app/views/components/_header.html.erb +8 -0
- data/app/views/components/_menu_button.html.erb +44 -0
- data/app/views/components/_pagination.html.erb +12 -33
- data/app/views/components/_separator.html.erb +11 -0
- data/app/views/components/_sidebar.html.erb +30 -20
- data/app/views/components/_simple_table.html.erb +49 -0
- data/app/views/components/_table.html.erb +21 -0
- data/app/views/components/_toggle_group.html.erb +24 -0
- data/app/views/components/alert/_description.html.erb +6 -0
- data/app/views/components/alert/_title.html.erb +6 -0
- data/app/views/components/breadcrumbs/_ellipsis.html.erb +9 -0
- data/app/views/components/breadcrumbs/_item.html.erb +8 -0
- data/app/views/components/breadcrumbs/_link.html.erb +8 -0
- data/app/views/components/breadcrumbs/_list.html.erb +8 -0
- data/app/views/components/breadcrumbs/_page.html.erb +8 -0
- data/app/views/components/breadcrumbs/_separator.html.erb +17 -0
- data/app/views/components/card/_action.html.erb +6 -0
- data/app/views/components/card/_content.html.erb +9 -0
- data/app/views/components/card/_description.html.erb +6 -0
- data/app/views/components/card/_footer.html.erb +17 -0
- data/app/views/components/card/_header.html.erb +9 -0
- data/app/views/components/card/_title.html.erb +9 -0
- data/app/views/components/dropdown_menu/_content.html.erb +20 -0
- data/app/views/components/dropdown_menu/_group.html.erb +12 -0
- data/app/views/components/dropdown_menu/_item.html.erb +29 -0
- data/app/views/components/dropdown_menu/_label.html.erb +13 -0
- data/app/views/components/dropdown_menu/_separator.html.erb +11 -0
- data/app/views/components/dropdown_menu/_shortcut.html.erb +12 -0
- data/app/views/components/dropdown_menu/_trigger.html.erb +24 -0
- data/app/views/components/empty/_content.html.erb +8 -0
- data/app/views/components/empty/_description.html.erb +12 -0
- data/app/views/components/empty/_header.html.erb +8 -0
- data/app/views/components/empty/_media.html.erb +13 -0
- data/app/views/components/empty/_title.html.erb +12 -0
- data/app/views/components/pagination/_content.html.erb +8 -0
- data/app/views/components/pagination/_ellipsis.html.erb +28 -0
- data/app/views/components/pagination/_item.html.erb +8 -0
- data/app/views/components/pagination/_link.html.erb +23 -0
- data/app/views/components/pagination/_next.html.erb +57 -0
- data/app/views/components/pagination/_previous.html.erb +57 -0
- data/app/views/components/sidebar/_content.html.erb +8 -0
- data/app/views/components/sidebar/_footer.html.erb +8 -0
- data/app/views/components/sidebar/_group.html.erb +12 -0
- data/app/views/components/sidebar/_header.html.erb +8 -0
- data/app/views/components/sidebar/_inset.html.erb +8 -0
- data/app/views/components/sidebar/_menu.html.erb +8 -0
- data/app/views/components/sidebar/_menu_button.html.erb +14 -0
- data/app/views/components/sidebar/_menu_item.html.erb +7 -0
- data/app/views/components/sidebar/_menu_link.html.erb +32 -0
- data/app/views/components/sidebar/_provider.html.erb +16 -0
- data/app/views/components/sidebar/_trigger.html.erb +12 -0
- data/app/views/components/stats/_stats_card.html.erb +100 -0
- data/app/views/components/stats/_stats_grid.html.erb +38 -0
- data/app/views/components/table/_body.html.erb +5 -0
- data/app/views/components/table/_caption.html.erb +5 -0
- data/app/views/components/table/_cell.html.erb +5 -0
- data/app/views/components/table/_footer.html.erb +5 -0
- data/app/views/components/table/_head.html.erb +8 -0
- data/app/views/components/table/_header.html.erb +8 -0
- data/app/views/components/table/_row.html.erb +8 -0
- data/app/views/components/toggle_group/_item.html.erb +19 -0
- data/config/importmap.rb +1 -0
- data/lib/generators/maquina_components/install/USAGE +39 -0
- data/lib/generators/maquina_components/install/install_generator.rb +123 -0
- data/lib/generators/maquina_components/install/templates/maquina_components_helper.rb.tt +68 -0
- data/lib/generators/maquina_components/install/templates/theme.css.tt +179 -0
- data/lib/maquina_components/engine.rb +10 -0
- data/lib/maquina_components/version.rb +1 -1
- metadata +116 -12
- data/app/helpers/components/pagination_helper.rb +0 -15
- data/app/views/components/_card_content.html.erb +0 -5
- data/app/views/components/_card_header.html.erb +0 -8
- data/app/views/components/_sidebar_content.html.erb +0 -8
- data/app/views/components/_sidebar_group.html.erb +0 -42
- data/app/views/components/_sidebar_header.html.erb +0 -3
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: maquina-components
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mario Alberto Chávez
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: rails
|
|
@@ -15,14 +15,28 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version:
|
|
18
|
+
version: 7.2.0
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version:
|
|
25
|
+
version: 7.2.0
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: tailwindcss-rails
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - "~>"
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '4.2'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - "~>"
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '4.2'
|
|
26
40
|
description: ERB, TailwindCSS, and StimulusJS UI components based on Shadcn/UI.
|
|
27
41
|
email:
|
|
28
42
|
- mario.chavez@gmail.com
|
|
@@ -33,18 +47,108 @@ files:
|
|
|
33
47
|
- MIT-LICENSE
|
|
34
48
|
- README.md
|
|
35
49
|
- Rakefile
|
|
50
|
+
- app/assets/images/maquina.svg
|
|
51
|
+
- app/assets/stylesheets/alert.css
|
|
52
|
+
- app/assets/stylesheets/badge.css
|
|
53
|
+
- app/assets/stylesheets/breadcrumbs.css
|
|
54
|
+
- app/assets/stylesheets/card.css
|
|
55
|
+
- app/assets/stylesheets/dropdown_menu.css
|
|
56
|
+
- app/assets/stylesheets/empty.css
|
|
57
|
+
- app/assets/stylesheets/form.css
|
|
58
|
+
- app/assets/stylesheets/header.css
|
|
36
59
|
- app/assets/stylesheets/maquina_components.css
|
|
37
|
-
- app/
|
|
38
|
-
- app/
|
|
60
|
+
- app/assets/stylesheets/pagination.css
|
|
61
|
+
- app/assets/stylesheets/sidebar.css
|
|
62
|
+
- app/assets/stylesheets/table.css
|
|
63
|
+
- app/assets/stylesheets/toggle_group.css
|
|
64
|
+
- app/assets/tailwind/maquina_components_engine/engine.css
|
|
65
|
+
- app/helpers/maquina_components/breadcrumbs_helper.rb
|
|
66
|
+
- app/helpers/maquina_components/dropdown_menu_helper.rb
|
|
67
|
+
- app/helpers/maquina_components/empty_helper.rb
|
|
68
|
+
- app/helpers/maquina_components/icons_helper.rb
|
|
69
|
+
- app/helpers/maquina_components/pagination_helper.rb
|
|
70
|
+
- app/helpers/maquina_components/sidebar_helper.rb
|
|
71
|
+
- app/helpers/maquina_components/table_helper.rb
|
|
72
|
+
- app/helpers/maquina_components/toggle_group_helper.rb
|
|
73
|
+
- app/javascript/controllers/breadcrumb_controller.js
|
|
74
|
+
- app/javascript/controllers/dropdown_menu_controller.js
|
|
75
|
+
- app/javascript/controllers/menu_button_controller.js
|
|
76
|
+
- app/javascript/controllers/sidebar_controller.js
|
|
77
|
+
- app/javascript/controllers/sidebar_trigger_controller.js
|
|
78
|
+
- app/javascript/controllers/toggle_group_controller.js
|
|
39
79
|
- app/views/components/_alert.html.erb
|
|
80
|
+
- app/views/components/_badge.html.erb
|
|
81
|
+
- app/views/components/_breadcrumbs.html.erb
|
|
40
82
|
- app/views/components/_card.html.erb
|
|
41
|
-
- app/views/components/
|
|
42
|
-
- app/views/components/
|
|
83
|
+
- app/views/components/_dropdown.html.erb
|
|
84
|
+
- app/views/components/_dropdown_menu.html.erb
|
|
85
|
+
- app/views/components/_empty.html.erb
|
|
86
|
+
- app/views/components/_header.html.erb
|
|
87
|
+
- app/views/components/_menu_button.html.erb
|
|
43
88
|
- app/views/components/_pagination.html.erb
|
|
89
|
+
- app/views/components/_separator.html.erb
|
|
44
90
|
- app/views/components/_sidebar.html.erb
|
|
45
|
-
- app/views/components/
|
|
46
|
-
- app/views/components/
|
|
47
|
-
- app/views/components/
|
|
91
|
+
- app/views/components/_simple_table.html.erb
|
|
92
|
+
- app/views/components/_table.html.erb
|
|
93
|
+
- app/views/components/_toggle_group.html.erb
|
|
94
|
+
- app/views/components/alert/_description.html.erb
|
|
95
|
+
- app/views/components/alert/_title.html.erb
|
|
96
|
+
- app/views/components/breadcrumbs/_ellipsis.html.erb
|
|
97
|
+
- app/views/components/breadcrumbs/_item.html.erb
|
|
98
|
+
- app/views/components/breadcrumbs/_link.html.erb
|
|
99
|
+
- app/views/components/breadcrumbs/_list.html.erb
|
|
100
|
+
- app/views/components/breadcrumbs/_page.html.erb
|
|
101
|
+
- app/views/components/breadcrumbs/_separator.html.erb
|
|
102
|
+
- app/views/components/card/_action.html.erb
|
|
103
|
+
- app/views/components/card/_content.html.erb
|
|
104
|
+
- app/views/components/card/_description.html.erb
|
|
105
|
+
- app/views/components/card/_footer.html.erb
|
|
106
|
+
- app/views/components/card/_header.html.erb
|
|
107
|
+
- app/views/components/card/_title.html.erb
|
|
108
|
+
- app/views/components/dropdown_menu/_content.html.erb
|
|
109
|
+
- app/views/components/dropdown_menu/_group.html.erb
|
|
110
|
+
- app/views/components/dropdown_menu/_item.html.erb
|
|
111
|
+
- app/views/components/dropdown_menu/_label.html.erb
|
|
112
|
+
- app/views/components/dropdown_menu/_separator.html.erb
|
|
113
|
+
- app/views/components/dropdown_menu/_shortcut.html.erb
|
|
114
|
+
- app/views/components/dropdown_menu/_trigger.html.erb
|
|
115
|
+
- app/views/components/empty/_content.html.erb
|
|
116
|
+
- app/views/components/empty/_description.html.erb
|
|
117
|
+
- app/views/components/empty/_header.html.erb
|
|
118
|
+
- app/views/components/empty/_media.html.erb
|
|
119
|
+
- app/views/components/empty/_title.html.erb
|
|
120
|
+
- app/views/components/pagination/_content.html.erb
|
|
121
|
+
- app/views/components/pagination/_ellipsis.html.erb
|
|
122
|
+
- app/views/components/pagination/_item.html.erb
|
|
123
|
+
- app/views/components/pagination/_link.html.erb
|
|
124
|
+
- app/views/components/pagination/_next.html.erb
|
|
125
|
+
- app/views/components/pagination/_previous.html.erb
|
|
126
|
+
- app/views/components/sidebar/_content.html.erb
|
|
127
|
+
- app/views/components/sidebar/_footer.html.erb
|
|
128
|
+
- app/views/components/sidebar/_group.html.erb
|
|
129
|
+
- app/views/components/sidebar/_header.html.erb
|
|
130
|
+
- app/views/components/sidebar/_inset.html.erb
|
|
131
|
+
- app/views/components/sidebar/_menu.html.erb
|
|
132
|
+
- app/views/components/sidebar/_menu_button.html.erb
|
|
133
|
+
- app/views/components/sidebar/_menu_item.html.erb
|
|
134
|
+
- app/views/components/sidebar/_menu_link.html.erb
|
|
135
|
+
- app/views/components/sidebar/_provider.html.erb
|
|
136
|
+
- app/views/components/sidebar/_trigger.html.erb
|
|
137
|
+
- app/views/components/stats/_stats_card.html.erb
|
|
138
|
+
- app/views/components/stats/_stats_grid.html.erb
|
|
139
|
+
- app/views/components/table/_body.html.erb
|
|
140
|
+
- app/views/components/table/_caption.html.erb
|
|
141
|
+
- app/views/components/table/_cell.html.erb
|
|
142
|
+
- app/views/components/table/_footer.html.erb
|
|
143
|
+
- app/views/components/table/_head.html.erb
|
|
144
|
+
- app/views/components/table/_header.html.erb
|
|
145
|
+
- app/views/components/table/_row.html.erb
|
|
146
|
+
- app/views/components/toggle_group/_item.html.erb
|
|
147
|
+
- config/importmap.rb
|
|
148
|
+
- lib/generators/maquina_components/install/USAGE
|
|
149
|
+
- lib/generators/maquina_components/install/install_generator.rb
|
|
150
|
+
- lib/generators/maquina_components/install/templates/maquina_components_helper.rb.tt
|
|
151
|
+
- lib/generators/maquina_components/install/templates/theme.css.tt
|
|
48
152
|
- lib/maquina-components.rb
|
|
49
153
|
- lib/maquina_components/engine.rb
|
|
50
154
|
- lib/maquina_components/version.rb
|
|
@@ -70,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
70
174
|
- !ruby/object:Gem::Version
|
|
71
175
|
version: '0'
|
|
72
176
|
requirements: []
|
|
73
|
-
rubygems_version:
|
|
177
|
+
rubygems_version: 4.0.1
|
|
74
178
|
specification_version: 4
|
|
75
179
|
summary: ERB, TailwindCSS, and StimulusJS UI components based on Shadcn/UI.
|
|
76
180
|
test_files: []
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
module Components
|
|
2
|
-
module PaginationHelper
|
|
3
|
-
def paginated_page_param(pagy, page)
|
|
4
|
-
@page_param ||= pagy.vars[:page_param] || Pagy::VARS[:page_param]
|
|
5
|
-
@query_parameters ||= request.query_parameters
|
|
6
|
-
|
|
7
|
-
@query_parameters.merge(@page_param => page)
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def paginated_path(path_helper, pagy, page, param)
|
|
11
|
-
page_query = paginated_page_param(pagy, page)
|
|
12
|
-
send(path_helper, param, page_query)
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<%# locals: (title:, custom_classes: "", icon: nil, icon_classes: "h-4 w-4 text-muted-foreground") -%>
|
|
2
|
-
|
|
3
|
-
<div
|
|
4
|
-
class="<%= class_names("p-6 flex flex-row items-center justify-between space-y-0 pb-2", custom_classes) %>"
|
|
5
|
-
>
|
|
6
|
-
<h3 class="tracking-tight text-sm font-medium"><%= title %></h3>
|
|
7
|
-
<%= icon_for(icon, class: icon_classes) if icon.present? %>
|
|
8
|
-
</div>
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
<%# locals: (title: nil, title_action: {}, menu: []) -%>
|
|
2
|
-
<%- title ||= nil -%>
|
|
3
|
-
<%- title_action ||= {} -%>
|
|
4
|
-
<%- menu ||= [] -%>
|
|
5
|
-
|
|
6
|
-
<div class="relative flex w-full min-w-0 flex-col p-2">
|
|
7
|
-
<% if title.present? %>
|
|
8
|
-
<div
|
|
9
|
-
class="
|
|
10
|
-
duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium
|
|
11
|
-
text-sidebar-foreground/70 outline-none ring-sidebar-ring
|
|
12
|
-
transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4
|
|
13
|
-
[&>svg]:shrink-0 group-data-[collapsible=icon]:-mt-8
|
|
14
|
-
group-data-[collapsible=icon]:opacity-0
|
|
15
|
-
"
|
|
16
|
-
>
|
|
17
|
-
<%= title %>
|
|
18
|
-
|
|
19
|
-
<% if title_action.any? %>
|
|
20
|
-
<%= link_to title_action[:url], class: "flex aspect-square w-5 items-center justify-center rounded-md p-0 ml-auto text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0 after:absolute after:-inset-2 after:md:hidden" do %>
|
|
21
|
-
<%= render_icon(title_action[:icon]) %>
|
|
22
|
-
<span class="sr-only"><%= title_action[:title] %></span>
|
|
23
|
-
<% end %>
|
|
24
|
-
<% end %>
|
|
25
|
-
</div>
|
|
26
|
-
<% end %>
|
|
27
|
-
|
|
28
|
-
<% if menu.any? %>
|
|
29
|
-
<ul class="flex w-full min-w-0 flex-col gap-1">
|
|
30
|
-
<% menu.each do |item| %>
|
|
31
|
-
<li class="group/menu-item relative">
|
|
32
|
-
<%= sidebar_menu_item(
|
|
33
|
-
title: item[:title],
|
|
34
|
-
url: item[:url],
|
|
35
|
-
icon: item[:icon],
|
|
36
|
-
current: item[:active],
|
|
37
|
-
) %>
|
|
38
|
-
</li>
|
|
39
|
-
<% end %>
|
|
40
|
-
</ul>
|
|
41
|
-
<% end %>
|
|
42
|
-
</div>
|