maquina-components 0.4.4 → 0.5.1
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 +19 -1
- data/app/assets/stylesheets/breadcrumbs.css +21 -0
- data/app/assets/stylesheets/combobox.css +36 -1
- data/app/assets/stylesheets/drawer.css +135 -0
- data/app/assets/stylesheets/menu_button.css +155 -0
- data/app/assets/stylesheets/separator.css +20 -0
- data/app/assets/stylesheets/sidebar.css +12 -0
- data/app/assets/stylesheets/stats.css +101 -0
- data/app/assets/tailwind/maquina_components_engine/engine.css +4 -0
- data/app/helpers/maquina_components/combobox_helper.rb +2 -1
- data/app/helpers/maquina_components/components_helper.rb +33 -0
- data/app/helpers/maquina_components/drawer_helper.rb +19 -0
- data/app/helpers/maquina_components/icons_helper.rb +68 -1
- data/app/javascript/controllers/breadcrumb_controller.js +39 -30
- data/app/javascript/controllers/combobox_controller.js +9 -0
- data/app/javascript/controllers/drawer_controller.js +287 -0
- data/app/javascript/controllers/drawer_trigger_controller.js +58 -0
- data/app/javascript/controllers/menu_button_controller.js +107 -29
- data/app/javascript/controllers/sidebar_controller.js +6 -8
- data/app/javascript/controllers/sidebar_trigger_controller.js +33 -4
- data/app/javascript/controllers/toaster_controller.js +12 -0
- data/app/views/components/_alert.html.erb +3 -1
- data/app/views/components/_badge.html.erb +7 -1
- data/app/views/components/_breadcrumbs.html.erb +1 -1
- data/app/views/components/_calendar.html.erb +1 -1
- data/app/views/components/_card.html.erb +1 -1
- data/app/views/components/_combobox.html.erb +3 -2
- data/app/views/components/_date_picker.html.erb +4 -3
- data/app/views/components/_drawer.html.erb +37 -0
- data/app/views/components/_dropdown.html.erb +21 -24
- data/app/views/components/_dropdown_menu.html.erb +1 -1
- data/app/views/components/_empty.html.erb +1 -1
- data/app/views/components/_header.html.erb +1 -1
- data/app/views/components/_menu_button.html.erb +29 -34
- data/app/views/components/_pagination.html.erb +1 -1
- data/app/views/components/_separator.html.erb +9 -10
- data/app/views/components/_sidebar.html.erb +1 -1
- data/app/views/components/_simple_table.html.erb +3 -1
- data/app/views/components/_table.html.erb +1 -1
- data/app/views/components/_toast.html.erb +6 -1
- data/app/views/components/_toaster.html.erb +1 -1
- data/app/views/components/_toggle_group.html.erb +1 -1
- data/app/views/components/alert/_description.html.erb +1 -1
- data/app/views/components/alert/_title.html.erb +1 -1
- data/app/views/components/breadcrumbs/_ellipsis.html.erb +1 -1
- data/app/views/components/breadcrumbs/_item.html.erb +1 -1
- data/app/views/components/breadcrumbs/_link.html.erb +1 -1
- data/app/views/components/breadcrumbs/_list.html.erb +1 -1
- data/app/views/components/breadcrumbs/_page.html.erb +1 -1
- data/app/views/components/breadcrumbs/_separator.html.erb +1 -1
- data/app/views/components/calendar/_header.html.erb +1 -1
- data/app/views/components/calendar/_week.html.erb +1 -1
- data/app/views/components/card/_action.html.erb +1 -1
- data/app/views/components/card/_content.html.erb +1 -1
- data/app/views/components/card/_description.html.erb +1 -1
- data/app/views/components/card/_footer.html.erb +1 -1
- data/app/views/components/card/_header.html.erb +1 -1
- data/app/views/components/card/_title.html.erb +1 -1
- data/app/views/components/combobox/_content.html.erb +1 -1
- data/app/views/components/combobox/_empty.html.erb +3 -3
- data/app/views/components/combobox/_group.html.erb +1 -1
- data/app/views/components/combobox/_input.html.erb +1 -1
- data/app/views/components/combobox/_label.html.erb +1 -1
- data/app/views/components/combobox/_list.html.erb +1 -1
- data/app/views/components/combobox/_option.html.erb +1 -1
- data/app/views/components/combobox/_separator.html.erb +1 -1
- data/app/views/components/combobox/_trigger.html.erb +1 -1
- data/app/views/components/drawer/_close.html.erb +14 -0
- data/app/views/components/drawer/_content.html.erb +7 -0
- data/app/views/components/drawer/_footer.html.erb +7 -0
- data/app/views/components/drawer/_header.html.erb +12 -0
- data/app/views/components/drawer/_provider.html.erb +14 -0
- data/app/views/components/drawer/_trigger.html.erb +14 -0
- data/app/views/components/dropdown_menu/_content.html.erb +1 -1
- data/app/views/components/dropdown_menu/_group.html.erb +1 -1
- data/app/views/components/dropdown_menu/_item.html.erb +1 -1
- data/app/views/components/dropdown_menu/_label.html.erb +3 -7
- data/app/views/components/dropdown_menu/_separator.html.erb +1 -1
- data/app/views/components/dropdown_menu/_shortcut.html.erb +3 -7
- data/app/views/components/dropdown_menu/_trigger.html.erb +1 -1
- data/app/views/components/empty/_content.html.erb +1 -1
- data/app/views/components/empty/_description.html.erb +3 -7
- data/app/views/components/empty/_header.html.erb +1 -1
- data/app/views/components/empty/_media.html.erb +5 -3
- data/app/views/components/empty/_title.html.erb +3 -7
- data/app/views/components/pagination/_content.html.erb +1 -1
- data/app/views/components/pagination/_item.html.erb +1 -1
- data/app/views/components/pagination/_link.html.erb +1 -1
- data/app/views/components/pagination/_next.html.erb +1 -1
- data/app/views/components/pagination/_previous.html.erb +1 -1
- data/app/views/components/sidebar/_content.html.erb +1 -1
- data/app/views/components/sidebar/_footer.html.erb +1 -1
- data/app/views/components/sidebar/_group.html.erb +1 -1
- data/app/views/components/sidebar/_header.html.erb +1 -1
- data/app/views/components/sidebar/_inset.html.erb +1 -1
- data/app/views/components/sidebar/_menu.html.erb +1 -1
- data/app/views/components/sidebar/_menu_button.html.erb +1 -1
- data/app/views/components/sidebar/_menu_item.html.erb +1 -1
- data/app/views/components/sidebar/_menu_link.html.erb +4 -7
- data/app/views/components/sidebar/_provider.html.erb +1 -1
- data/app/views/components/sidebar/_trigger.html.erb +1 -1
- data/app/views/components/stats/_stats_card.html.erb +32 -92
- data/app/views/components/stats/_stats_grid.html.erb +18 -24
- data/app/views/components/table/_body.html.erb +1 -1
- data/app/views/components/table/_caption.html.erb +3 -3
- data/app/views/components/table/_cell.html.erb +3 -3
- data/app/views/components/table/_footer.html.erb +1 -1
- data/app/views/components/table/_head.html.erb +3 -3
- data/app/views/components/table/_header.html.erb +1 -1
- data/app/views/components/table/_row.html.erb +1 -1
- data/app/views/components/toast/_action.html.erb +1 -1
- data/app/views/components/toast/_description.html.erb +1 -1
- data/app/views/components/toast/_title.html.erb +1 -1
- data/app/views/components/toggle_group/_item.html.erb +1 -1
- data/lib/generators/maquina_components/install/templates/maquina_components_helper.rb.tt +8 -0
- data/lib/generators/maquina_components/scaffold_templates/scaffold_templates_generator.rb +40 -0
- data/lib/generators/maquina_components/scaffold_templates/templates/_form.html.erb.tt +49 -0
- data/lib/generators/maquina_components/scaffold_templates/templates/edit.html.erb.tt +29 -0
- data/lib/generators/maquina_components/scaffold_templates/templates/index.html.erb.tt +58 -0
- data/lib/generators/maquina_components/scaffold_templates/templates/new.html.erb.tt +26 -0
- data/lib/generators/maquina_components/scaffold_templates/templates/partial.html.erb.tt +17 -0
- data/lib/generators/maquina_components/scaffold_templates/templates/show.html.erb.tt +53 -0
- data/lib/maquina-components.rb +5 -0
- data/lib/maquina_components/engine.rb +7 -3
- data/lib/maquina_components/version.rb +1 -1
- metadata +52 -3
- data/app/assets/stylesheets/maquina_components.css +0 -178
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%# locals: (text: nil, content: nil, css_classes: "", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
2
|
+
<% merged_data = merge_component_data(html_options, alert_part: :title) %>
|
|
3
3
|
|
|
4
4
|
<%= content_tag :div, class: css_classes.presence, data: merged_data, **html_options do %>
|
|
5
5
|
<%= text || content %>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%# locals: (month:, year:, month_name:, css_classes: "", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
2
|
+
<% merged_data = merge_component_data(html_options, "calendar-part": "header") %>
|
|
3
3
|
|
|
4
4
|
<%= content_tag :div, class: css_classes.presence, data: merged_data, **html_options do %>
|
|
5
5
|
<button type="button"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%# locals: (days:, display_month:, selected_date: nil, selected_end_date: nil, mode: :single, min_date: nil, max_date: nil, disabled_dates: [], show_outside_days: true, css_classes: "", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
2
|
+
<% merged_data = merge_component_data(html_options, "calendar-part": "week") %>
|
|
3
3
|
|
|
4
4
|
<%= content_tag :div, role: "row", class: css_classes.presence, data: merged_data, **html_options do %>
|
|
5
5
|
<% days.each do |day| %>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%# locals: (css_classes: "", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
2
|
+
<% merged_data = merge_component_data(html_options, card_part: :action) %>
|
|
3
3
|
|
|
4
4
|
<%= content_tag :div, class: css_classes.presence, data: merged_data, **html_options do %>
|
|
5
5
|
<%= yield %>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%# locals: (text: nil, content: nil, css_classes: "", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
2
|
+
<% merged_data = merge_component_data(html_options, card_part: :description) %>
|
|
3
3
|
|
|
4
4
|
<%= content_tag :div, class: css_classes.presence, data: merged_data, **html_options do %>
|
|
5
5
|
<%= text || content %>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%# locals: (text: nil, content: nil, size: :default, css_classes: "", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
3
|
card_part: :title,
|
|
4
4
|
size: (size == :sm ? :sm : nil)
|
|
5
5
|
).compact %>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%# locals: (id:, align: :start, width: :default, css_classes: "", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
3
|
combobox_part: "content",
|
|
4
4
|
combobox_target: "content",
|
|
5
5
|
align: align,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
<%# locals: (text: "No results found.", css_classes: "", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
1
|
+
<%# locals: (text: "No results found.", content: nil, css_classes: "", **html_options) %>
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
3
|
combobox_part: "empty",
|
|
4
4
|
combobox_target: "empty"
|
|
5
5
|
) %>
|
|
6
6
|
|
|
7
7
|
<%= content_tag :div, class: css_classes.presence, data: merged_data, hidden: true, **html_options do %>
|
|
8
|
-
<%= text %>
|
|
8
|
+
<%= content.presence || text %>
|
|
9
9
|
<% end %>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%# locals: (placeholder: "Search...", css_classes: "", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
3
|
combobox_part: "input",
|
|
4
4
|
combobox_target: "input",
|
|
5
5
|
action: "input->combobox#filter"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%# locals: (value:, selected: false, disabled: false, css_classes: "", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
3
|
combobox_part: "option",
|
|
4
4
|
combobox_target: "option",
|
|
5
5
|
value: value,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%# locals: (for_id:, placeholder: "Select...", variant: :outline, size: :default, css_classes: "", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
3
|
component: :button,
|
|
4
4
|
variant: variant,
|
|
5
5
|
size: size,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<%# locals: (show_icon: true, css_classes: "btn btn-ghost", **html_options) %>
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
|
+
drawer_part: :close,
|
|
4
|
+
action: "click->drawer#close"
|
|
5
|
+
) %>
|
|
6
|
+
<%= content_tag :button, type: :button, class: css_classes, data: merged_data, **html_options do %>
|
|
7
|
+
<% if show_icon %>
|
|
8
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
9
|
+
<path d="M18 6 6 18"></path>
|
|
10
|
+
<path d="m6 6 12 12"></path>
|
|
11
|
+
</svg>
|
|
12
|
+
<% end %>
|
|
13
|
+
<%= yield %>
|
|
14
|
+
<% end %>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<%# locals: (show_close: true, css_classes: "", **html_options) %>
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
|
+
drawer_part: :header
|
|
4
|
+
) %>
|
|
5
|
+
<%= content_tag :div, class: css_classes, data: merged_data, **html_options do %>
|
|
6
|
+
<div data-drawer-part="header-content">
|
|
7
|
+
<%= yield %>
|
|
8
|
+
</div>
|
|
9
|
+
<% if show_close %>
|
|
10
|
+
<%= render "components/drawer/close", css_classes: "btn btn-ghost btn-icon-sm" %>
|
|
11
|
+
<% end %>
|
|
12
|
+
<% end %>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<%# locals: (id: nil, default_open: false, css_classes: "", cookie_name: "drawer_state", keyboard_shortcut: "d", **html_options) %>
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
|
+
component: :drawer,
|
|
4
|
+
controller: "drawer",
|
|
5
|
+
outlet: "drawer",
|
|
6
|
+
drawer_default_open_value: default_open,
|
|
7
|
+
drawer_open_value: default_open,
|
|
8
|
+
drawer_cookie_name_value: cookie_name,
|
|
9
|
+
drawer_keyboard_shortcut_value: keyboard_shortcut,
|
|
10
|
+
action: "keydown.meta+#{keyboard_shortcut}@window->drawer#toggleWithKeyboard keydown.ctrl+#{keyboard_shortcut}@window->drawer#toggleWithKeyboard keydown.esc@window->drawer#closeOnEscape"
|
|
11
|
+
) %>
|
|
12
|
+
<%= content_tag :div, id: id || "drawer-provider", class: css_classes, data: merged_data, **html_options do %>
|
|
13
|
+
<%= yield %>
|
|
14
|
+
<% end %>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<%# locals: (variant: :default, size: :default, icon_name: nil, css_classes: "", **html_options) %>
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
|
+
drawer_part: :trigger,
|
|
4
|
+
controller: "drawer-trigger",
|
|
5
|
+
action: "click->drawer-trigger#triggerClick",
|
|
6
|
+
drawer_trigger_drawer_outlet: "[data-outlet='drawer']"
|
|
7
|
+
) %>
|
|
8
|
+
<% button_data = merged_data.merge(
|
|
9
|
+
component: "button"
|
|
10
|
+
) %>
|
|
11
|
+
<%= content_tag :button, type: :button, class: css_classes, data: button_data, **html_options do %>
|
|
12
|
+
<%= icon_for(icon_name) if icon_name %>
|
|
13
|
+
<%= yield %>
|
|
14
|
+
<% end %>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%# locals: (align: :start, side: :bottom, width: :default, css_classes: "", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
3
|
"dropdown-menu-part": "content",
|
|
4
4
|
"dropdown-menu-target": "content",
|
|
5
5
|
align: align,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%# locals: (href: nil, method: nil, variant: :default, disabled: false, css_classes: "", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
3
|
"dropdown-menu-part": "item",
|
|
4
4
|
variant: variant
|
|
5
5
|
) %>
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
<%# locals: (text: nil, inset: false, css_classes: "", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
1
|
+
<%# locals: (text: nil, content: nil, inset: false, css_classes: "", **html_options) %>
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
3
|
"dropdown-menu-part": "label",
|
|
4
4
|
inset: inset
|
|
5
5
|
) %>
|
|
6
6
|
|
|
7
7
|
<%= content_tag :div, class: css_classes.presence, data: merged_data, **html_options do %>
|
|
8
|
-
|
|
9
|
-
<%= text %>
|
|
10
|
-
<% else %>
|
|
11
|
-
<%= yield %>
|
|
12
|
-
<% end %>
|
|
8
|
+
<%= text.presence || content || yield %>
|
|
13
9
|
<% end %>
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
<%# locals: (text: nil, css_classes: "", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
1
|
+
<%# locals: (text: nil, content: nil, css_classes: "", **html_options) %>
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
3
|
"dropdown-menu-part": "shortcut"
|
|
4
4
|
) %>
|
|
5
5
|
|
|
6
6
|
<%= content_tag :span, class: css_classes.presence, data: merged_data, **html_options do %>
|
|
7
|
-
|
|
8
|
-
<%= text %>
|
|
9
|
-
<% else %>
|
|
10
|
-
<%= yield %>
|
|
11
|
-
<% end %>
|
|
7
|
+
<%= text.presence || content || yield %>
|
|
12
8
|
<% end %>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%# locals: (variant: :outline, size: :default, as_child: false, css_classes: "", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
3
|
"dropdown-menu-target": "trigger",
|
|
4
4
|
action: "dropdown-menu#toggle"
|
|
5
5
|
) %>
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
<%# locals: (text: nil, css_classes: "", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
1
|
+
<%# locals: (text: nil, content: nil, css_classes: "", **html_options) %>
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
3
|
"empty-part": "description"
|
|
4
4
|
) %>
|
|
5
5
|
|
|
6
6
|
<%= content_tag :p, class: css_classes.presence, data: merged_data, **html_options do %>
|
|
7
|
-
|
|
8
|
-
<%= text %>
|
|
9
|
-
<% else %>
|
|
10
|
-
<%= yield %>
|
|
11
|
-
<% end %>
|
|
7
|
+
<%= text.presence || content || yield %>
|
|
12
8
|
<% end %>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<%# locals: (icon: nil, variant: :icon, css_classes: "", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
1
|
+
<%# locals: (icon: nil, content: nil, variant: :icon, css_classes: "", **html_options) %>
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
3
|
"empty-part": "media",
|
|
4
4
|
variant: variant
|
|
5
5
|
) %>
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
<%= content_tag :div, class: css_classes.presence, data: merged_data, **html_options do %>
|
|
8
8
|
<% if icon.present? && respond_to?(:icon_for) %>
|
|
9
9
|
<%= icon_for(icon) %>
|
|
10
|
-
<% elsif
|
|
10
|
+
<% elsif content %>
|
|
11
|
+
<%= content %>
|
|
12
|
+
<% else %>
|
|
11
13
|
<%= yield %>
|
|
12
14
|
<% end %>
|
|
13
15
|
<% end %>
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
<%# locals: (text: nil, css_classes: "", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
1
|
+
<%# locals: (text: nil, content: nil, css_classes: "", **html_options) %>
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
3
|
"empty-part": "title"
|
|
4
4
|
) %>
|
|
5
5
|
|
|
6
6
|
<%= content_tag :h3, class: css_classes.presence, data: merged_data, **html_options do %>
|
|
7
|
-
|
|
8
|
-
<%= text %>
|
|
9
|
-
<% else %>
|
|
10
|
-
<%= yield %>
|
|
11
|
-
<% end %>
|
|
7
|
+
<%= text.presence || content || yield %>
|
|
12
8
|
<% end %>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<%# locals: (href: nil, label: nil, disabled: false, show_label: true, css_classes: "", **html_options) %>
|
|
2
2
|
<% is_disabled = disabled || href.nil?
|
|
3
3
|
display_label = label || t("maquina_components.pagination.next", default: "Next")
|
|
4
|
-
merged_data = (html_options
|
|
4
|
+
merged_data = merge_component_data(html_options, "pagination-part": "next") %>
|
|
5
5
|
|
|
6
6
|
<% if is_disabled %>
|
|
7
7
|
<span
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<%# locals: (href: nil, label: nil, disabled: false, show_label: true, css_classes: "", **html_options) %>
|
|
2
2
|
<% is_disabled = disabled || href.nil?
|
|
3
3
|
display_label = label || t("maquina_components.pagination.previous", default: "Previous")
|
|
4
|
-
merged_data = (html_options
|
|
4
|
+
merged_data = merge_component_data(html_options, "pagination-part": "previous") %>
|
|
5
5
|
|
|
6
6
|
<% if is_disabled %>
|
|
7
7
|
<span
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%# locals: (title:, url:, icon_name: nil, size: :default, active: false, css_classes: "", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
3
|
sidebar_part: "menu-button",
|
|
4
4
|
size: size,
|
|
5
5
|
active: active
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<%# locals: (css_classes: "", **html_options) %>
|
|
2
2
|
<% merged_data =
|
|
3
|
-
(html_options
|
|
3
|
+
merge_component_data(html_options, sidebar_part: "menu-item") %>
|
|
4
4
|
|
|
5
5
|
<%= content_tag :li, class: "group/menu-item #{css_classes}", data: merged_data, **html_options do %>
|
|
6
6
|
<%= yield %>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%# locals: (url: "#", active: false, title: nil, subtitle: nil, icon: nil, text_icon: nil, icon_classes: "", css_classes: "", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
3
|
sidebar_part: "menu-link",
|
|
4
4
|
active: active
|
|
5
5
|
) %>
|
|
@@ -16,16 +16,13 @@
|
|
|
16
16
|
<% end %>
|
|
17
17
|
|
|
18
18
|
<% if title.present? || subtitle.present? %>
|
|
19
|
-
<div
|
|
20
|
-
class="flex flex-col gap-0.5 leading-none"
|
|
21
|
-
data-sidebar-hide-on-collapse
|
|
22
|
-
>
|
|
19
|
+
<div data-sidebar-part="menu-link-text" data-sidebar-hide-on-collapse>
|
|
23
20
|
<% if title.present? %>
|
|
24
|
-
<span
|
|
21
|
+
<span data-sidebar-part="menu-link-title"><%= title %></span>
|
|
25
22
|
<% end %>
|
|
26
23
|
|
|
27
24
|
<% if subtitle.present? %>
|
|
28
|
-
<span
|
|
25
|
+
<span data-sidebar-part="menu-link-subtitle"><%= subtitle %></span>
|
|
29
26
|
<% end %>
|
|
30
27
|
</div>
|
|
31
28
|
<% end %>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%# locals: (id: nil, default_open: true, variant: :inset, css_classes: "", cookie_name: "sidebar_state", keyboard_shortcut: "b", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
3
|
component: :sidebar,
|
|
4
4
|
variant: variant,
|
|
5
5
|
controller: "sidebar",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%# locals: (icon_name: :left_panel, css_classes: "", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
3
|
sidebar_part: :trigger,
|
|
4
4
|
controller: "sidebar-trigger",
|
|
5
5
|
action: "click->sidebar-trigger#triggerClick",
|