maquina-components 0.5.0 → 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 +3 -1
- data/app/assets/stylesheets/breadcrumbs.css +21 -0
- data/app/assets/stylesheets/combobox.css +36 -1
- data/app/assets/stylesheets/drawer.css +15 -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 +3 -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/icons_helper.rb +58 -0
- 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 +43 -9
- data/app/javascript/controllers/drawer_trigger_controller.js +33 -3
- 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 +8 -2
- 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 +1 -1
- data/app/views/components/drawer/_content.html.erb +1 -1
- data/app/views/components/drawer/_footer.html.erb +1 -1
- data/app/views/components/drawer/_header.html.erb +2 -2
- data/app/views/components/drawer/_provider.html.erb +2 -2
- data/app/views/components/drawer/_trigger.html.erb +1 -1
- 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 +1 -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 +33 -2
- data/app/assets/stylesheets/maquina_components.css +0 -178
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<%# locals: (id: nil, state: :closed, side: :right, css_classes: "", **html_options) %>
|
|
1
|
+
<%# locals: (id: nil, state: :closed, side: :right, aria_label: "Drawer", css_classes: "", **html_options) %>
|
|
2
2
|
<% stable_id = id || "drawer-#{side}"
|
|
3
|
-
merged_data = (html_options
|
|
3
|
+
merged_data = merge_component_data(html_options,
|
|
4
4
|
drawer_part: :root,
|
|
5
5
|
drawer_target: "drawer",
|
|
6
6
|
state: state,
|
|
@@ -22,6 +22,12 @@
|
|
|
22
22
|
<div
|
|
23
23
|
id="<%= stable_id %>-panel"
|
|
24
24
|
data-drawer-part="panel"
|
|
25
|
+
data-drawer-target="panel"
|
|
26
|
+
role="dialog"
|
|
27
|
+
aria-modal="true"
|
|
28
|
+
aria-label="<%= aria_label %>"
|
|
29
|
+
tabindex="-1"
|
|
30
|
+
<%= tag.attributes(aria: {hidden: true}, inert: true) if state.to_s == "closed" %>
|
|
25
31
|
>
|
|
26
32
|
<%# Inner drawer content wrapper %>
|
|
27
33
|
<div id="<%= stable_id %>-inner" data-drawer-part="inner">
|
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
<%# locals: (id: nil, side: :top, align: :start, css_classes: "", **html_options) %>
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
|
+
"menu-button-part": "content",
|
|
4
|
+
"menu-button-target": "content",
|
|
5
|
+
side: side,
|
|
6
|
+
align: align,
|
|
7
|
+
state: "closed"
|
|
8
|
+
) %>
|
|
9
|
+
<% aria_attrs = { orientation: "vertical" } %>
|
|
10
|
+
<% aria_attrs[:labelledby] = "#{id}-trigger" if id.present? %>
|
|
11
|
+
|
|
12
|
+
<%= content_tag :div,
|
|
13
|
+
id: (id.present? ? "#{id}-content" : nil),
|
|
14
|
+
role: "menu",
|
|
15
|
+
tabindex: "-1",
|
|
16
|
+
aria: aria_attrs,
|
|
17
|
+
class: css_classes.presence,
|
|
18
|
+
data: merged_data,
|
|
19
|
+
hidden: true,
|
|
20
|
+
**html_options do %>
|
|
21
21
|
<%= yield %>
|
|
22
|
-
|
|
23
|
-
<!--
|
|
24
|
-
<div role="separator" aria-orientation="horizontal" class="separator"></div>
|
|
25
|
-
-->
|
|
22
|
+
<% end %>
|
|
@@ -1,44 +1,39 @@
|
|
|
1
|
-
<%# locals: (title: "", subtitle: nil, icon: nil, text_icon: nil, icon_classes: "", submenu: false) %>
|
|
1
|
+
<%# locals: (title: "", subtitle: nil, icon: nil, text_icon: nil, icon_classes: "", submenu: false, id: nil, css_classes: "", **html_options) %>
|
|
2
|
+
<% menu_button_id = id || "menu-button-#{title.to_s.parameterize.presence || "menu"}" %>
|
|
3
|
+
<% merged_data = merge_component_data(html_options,
|
|
4
|
+
component: "menu-button"
|
|
5
|
+
) %>
|
|
2
6
|
|
|
3
|
-
|
|
4
|
-
<li
|
|
7
|
+
<%= content_tag :ul, class: css_classes.presence, data: merged_data, **html_options do %>
|
|
8
|
+
<li data-menu-button-part="item" data-controller="menu-button">
|
|
5
9
|
<button
|
|
10
|
+
type="button"
|
|
11
|
+
id="<%= menu_button_id %>-trigger"
|
|
6
12
|
data-state="closed"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50
|
|
13
|
-
data-[state=open]:bg-sidebar-accent
|
|
14
|
-
data-[state=open]text-sidebar-accent-foreground
|
|
15
|
-
group-data-[collapsible=icon]:size-8! [&>span:last-child]:truncate
|
|
16
|
-
[&>svg]:size-4 [&>svg]:shrink-0 hover:bg-sidebar-accent
|
|
17
|
-
hover:text-sidebar-accent-foreground h-12 text-sm
|
|
18
|
-
group-data-[collapsible=icon]:p-0!
|
|
19
|
-
", data-action="menu-button#toggle", data-menu-button-target="button" }
|
|
13
|
+
data-menu-button-part="trigger"
|
|
14
|
+
data-menu-button-target="button"
|
|
15
|
+
data-action="menu-button#toggle"
|
|
16
|
+
aria-haspopup="menu"
|
|
17
|
+
aria-expanded="false"
|
|
20
18
|
>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
</div>
|
|
32
|
-
<% end %>
|
|
33
|
-
<div class="grid flex-1 text-left text-sm leading-tight">
|
|
34
|
-
<span class="truncate font-semibold"><%= title %></span>
|
|
19
|
+
<% if icon.present? %>
|
|
20
|
+
<%= image_tag icon, alt: title.presence || "", class: icon_classes.presence %>
|
|
21
|
+
<% elsif text_icon.present? %>
|
|
22
|
+
<span data-menu-button-part="avatar">
|
|
23
|
+
<span class="<%= icon_classes %>"><%= text_icon %></span>
|
|
24
|
+
</span>
|
|
25
|
+
<% end %>
|
|
26
|
+
|
|
27
|
+
<span data-menu-button-part="text">
|
|
28
|
+
<span data-menu-button-part="title"><%= title %></span>
|
|
35
29
|
<% if subtitle.present? %>
|
|
36
|
-
<span
|
|
30
|
+
<span data-menu-button-part="subtitle"><%= subtitle %></span>
|
|
37
31
|
<% end %>
|
|
38
|
-
</
|
|
32
|
+
</span>
|
|
33
|
+
|
|
39
34
|
<%= builtin_icon_for(:chevron_up_down, class: "ml-auto") if submenu %>
|
|
40
35
|
</button>
|
|
41
36
|
|
|
42
|
-
<%= yield %>
|
|
37
|
+
<%= yield menu_button_id %>
|
|
43
38
|
</li>
|
|
44
|
-
|
|
39
|
+
<% end %>
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
<%# locals: (orientation: :horizontal)
|
|
1
|
+
<%# locals: (orientation: :horizontal, css_classes: "", **html_options) %>
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
|
+
component: :separator,
|
|
4
|
+
orientation: orientation
|
|
5
|
+
) %>
|
|
2
6
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
bg-border shrink-0 data-[orientation=horizontal]:h-px
|
|
8
|
-
data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px mx-2
|
|
9
|
-
data-[orientation=vertical]:h-4
|
|
10
|
-
"
|
|
11
|
-
></div>
|
|
7
|
+
<%= tag.div role: "none",
|
|
8
|
+
class: css_classes.presence,
|
|
9
|
+
data: merged_data,
|
|
10
|
+
**html_options %>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<%# locals: (id: nil, state: :collapsed, collapsible: :offcanvas, variant: :inset, side: :left, css_classes: "", **html_options) %>
|
|
2
2
|
<% stable_id = id || "sidebar-#{side}"
|
|
3
3
|
|
|
4
|
-
merged_data = (html_options
|
|
4
|
+
merged_data = merge_component_data(html_options,
|
|
5
5
|
sidebar_part: :root,
|
|
6
6
|
sidebar_target: "sidebar",
|
|
7
7
|
state: state,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
<%# locals: (collection:, columns:, caption: nil, variant: nil, table_variant: nil, empty_message: "No data available", row_id: nil, html_options: {}) %>
|
|
1
|
+
<%# locals: (collection:, columns:, caption: nil, variant: nil, table_variant: nil, empty_message: "No data available", row_id: nil, html_options: {}, **extra_html_options) %>
|
|
2
|
+
<%# html_options: {} is the legacy call style; bare keyword passthrough is the standard one %>
|
|
3
|
+
<% html_options = html_options.merge(extra_html_options) %>
|
|
2
4
|
<%= render "components/table", variant: variant, table_variant: table_variant, **html_options do %>
|
|
3
5
|
<% if caption.present? %>
|
|
4
6
|
<%= render "components/table/caption" do %><%= caption %><% end %>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<%# locals: (css_classes: "", container: true, variant: nil, table_variant: nil, **html_options) %>
|
|
2
2
|
<%
|
|
3
3
|
# Table data attributes - merge user data with component defaults
|
|
4
|
-
table_data = (html_options
|
|
4
|
+
table_data = merge_component_data(html_options, component: :table)
|
|
5
5
|
table_data[:variant] = table_variant if table_variant
|
|
6
6
|
|
|
7
7
|
# Container data attributes
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<%# locals: (variant: :default, title: nil, description: nil, icon: nil, duration: 5000, dismissible: true, content: nil, css_classes: "", **html_options) %>
|
|
2
2
|
<%
|
|
3
|
+
# :destructive is the library-wide danger variant; toast renders it
|
|
4
|
+
# with its existing error styling
|
|
5
|
+
variant = variant.to_s.to_sym
|
|
6
|
+
variant = :error if variant == :destructive
|
|
7
|
+
|
|
3
8
|
# Auto-select icon based on variant if not provided
|
|
4
9
|
default_icons = {
|
|
5
10
|
default: nil,
|
|
@@ -10,7 +15,7 @@
|
|
|
10
15
|
}
|
|
11
16
|
toast_icon = icon || default_icons[variant]
|
|
12
17
|
%>
|
|
13
|
-
<% merged_data = (html_options
|
|
18
|
+
<% merged_data = merge_component_data(html_options,
|
|
14
19
|
component: :toast,
|
|
15
20
|
controller: "toast",
|
|
16
21
|
variant: variant,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%# locals: (position: :bottom_right, content: nil, css_classes: "", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
3
|
component: :toaster,
|
|
4
4
|
controller: "toaster",
|
|
5
5
|
position: position.to_s.dasherize,
|
|
@@ -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: :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, 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,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%# locals: (css_classes: "", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
3
|
drawer_part: :content
|
|
4
4
|
) %>
|
|
5
5
|
<%= content_tag :div, class: css_classes, data: merged_data, **html_options do %>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%# locals: (css_classes: "", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
3
|
drawer_part: :footer
|
|
4
4
|
) %>
|
|
5
5
|
<%= content_tag :div, class: css_classes, data: merged_data, **html_options do %>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<%# locals: (show_close: true, css_classes: "", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
3
|
drawer_part: :header
|
|
4
4
|
) %>
|
|
5
5
|
<%= content_tag :div, class: css_classes, data: merged_data, **html_options do %>
|
|
6
|
-
<div
|
|
6
|
+
<div data-drawer-part="header-content">
|
|
7
7
|
<%= yield %>
|
|
8
8
|
</div>
|
|
9
9
|
<% if show_close %>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%# locals: (id: nil, default_open: false, css_classes: "", cookie_name: "drawer_state", keyboard_shortcut: "d", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
3
|
component: :drawer,
|
|
4
4
|
controller: "drawer",
|
|
5
5
|
outlet: "drawer",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
drawer_open_value: default_open,
|
|
8
8
|
drawer_cookie_name_value: cookie_name,
|
|
9
9
|
drawer_keyboard_shortcut_value: keyboard_shortcut,
|
|
10
|
-
action: "keydown.meta+#{keyboard_shortcut}@window->drawer#toggleWithKeyboard keydown.ctrl+#{keyboard_shortcut}@window->drawer#toggleWithKeyboard"
|
|
10
|
+
action: "keydown.meta+#{keyboard_shortcut}@window->drawer#toggleWithKeyboard keydown.ctrl+#{keyboard_shortcut}@window->drawer#toggleWithKeyboard keydown.esc@window->drawer#closeOnEscape"
|
|
11
11
|
) %>
|
|
12
12
|
<%= content_tag :div, id: id || "drawer-provider", class: css_classes, data: merged_data, **html_options do %>
|
|
13
13
|
<%= yield %>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%# locals: (variant: :default, size: :default, icon_name: nil, css_classes: "", **html_options) %>
|
|
2
|
-
<% merged_data = (html_options
|
|
2
|
+
<% merged_data = merge_component_data(html_options,
|
|
3
3
|
drawer_part: :trigger,
|
|
4
4
|
controller: "drawer-trigger",
|
|
5
5
|
action: "click->drawer-trigger#triggerClick",
|
|
@@ -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
|
) %>
|