-
- <%= icon("x", as_button: true, data: { action: "mousedown->modal#close" }) %>
-
-
-
+ <% dialog.with_section(title: "Overview", open: true) do %>
+
+ <%= form.date_field :date, label: "Date", max: Date.current %>
+ <% end %>
-
- <%= render LinkComponent.new(
- text: "Cancel",
- variant: "ghost",
- href: transactions_path
- ) %>
-
- <%= render ButtonComponent.new(
- text: "Save",
- data: { "bulk-select-scope-param": "bulk_update", action: "bulk-select#submitBulkRequest" }
- ) %>
+ <% dialog.with_section(title: "Transactions", open: true) do %>
+
+ <%= form.collection_select :category_id, Current.family.categories.alphabetically, :id, :name, { prompt: "Select a category", label: "Category", class: "text-subdued" } %>
+ <%= form.collection_select :merchant_id, Current.family.merchants.alphabetically, :id, :name, { prompt: "Select a merchant", label: "Merchant", class: "text-subdued" } %>
+ <%= form.select :tag_ids, Current.family.tags.alphabetically.pluck(:name, :id), { include_blank: "None", multiple: true, label: "Tags", container_class: "h-40" } %>
+ <%= form.text_area :notes, label: "Notes", placeholder: "Enter a note that will be applied to selected transactions", rows: 5 %>
-
+ <% end %>
<% end %>
-
-<% end %>
+ <% end %>
+
+ <% dialog.with_action(cancel_action: true, text: "Cancel", variant: "ghost") %>
+ <% dialog.with_action(text: "Save", data: { bulk_select_scope_param: "bulk_update", action: "bulk-select#submitBulkRequest" }) %>
+<% end %>
\ No newline at end of file
diff --git a/test/components/previews/dialog_component_preview.rb b/test/components/previews/dialog_component_preview.rb
new file mode 100644
index 00000000..87e17e26
--- /dev/null
+++ b/test/components/previews/dialog_component_preview.rb
@@ -0,0 +1,46 @@
+class DialogComponentPreview < ViewComponent::Preview
+ # @param show_overflow toggle
+ def modal(show_overflow: false)
+ render DialogComponent.new(variant: "modal", open_on_load: true) do |dialog|
+ dialog.with_header(title: "Sample modal title")
+
+ dialog.with_body do
+ "Welcome to Maybe! This is some test modal content."
+ end
+
+ dialog.with_action(cancel_action: true, text: "Cancel", variant: "outline")
+ dialog.with_action(text: "Submit")
+
+ if show_overflow
+ content_tag(:div, class: "p-4 font-semibold h-[800px] bg-surface-inset") do
+ "Example of overflow content"
+ end
+ end
+ end
+ end
+
+ # @param show_overflow toggle
+ def drawer(show_overflow: false)
+ render DialogComponent.new(variant: "drawer", open_on_load: true) do |dialog|
+ dialog.with_header(title: "Drawer title")
+
+ dialog.with_body do
+ dialog.with_section(title: "Section 1", open: true) do
+ content_tag(:div, "Section 1 content", class: "p-2")
+ end
+
+ dialog.with_section(title: "Section 2", open: true) do
+ content_tag(:div, "Section 2 content", class: "p-2")
+ end
+ end
+
+ dialog.with_action(text: "Example action")
+
+ if show_overflow
+ content_tag(:div, class: "p-4 font-semibold h-[800px] bg-surface-inset") do
+ "Example of overflow content"
+ end
+ end
+ end
+ end
+end
\ No newline at end of file
diff --git a/test/components/previews/disclosure_component_preview.rb b/test/components/previews/disclosure_component_preview.rb
index 1297c9f3..ec6e6d1d 100644
--- a/test/components/previews/disclosure_component_preview.rb
+++ b/test/components/previews/disclosure_component_preview.rb
@@ -3,11 +3,11 @@ class DisclosureComponentPreview < ViewComponent::Preview
# @param align select ["left", "right"]
def default(align: "right")
render DisclosureComponent.new(title: "Title", align: align, open: true) do |disclosure|
- disclosure.with_summary_content do
+ disclosure.with_summary_content do
content_tag(:p, "$200.25", class: "text-xs font-mono font-medium")
end
- content_tag(:p, "Sample disclosure content", class: "text-sm")
+ content_tag(:p, "Sample disclosure content", class: "text-sm")
end
end
end