app/views/examples/components/dialog.html.erb in shadcn-ui-0.0.3 vs app/views/examples/components/dialog.html.erb in shadcn-ui-0.0.4
- old
+ new
@@ -1,25 +1,16 @@
<%= render_component_header title: "Dialog",
description: "A window overlaid on either the primary window or another dialog window, rendering the content underneath inert." %>
<% content_for :preview, flush: true do %>
<div class="w-full flex justify-center">
- <%= render_dialog do %>
- <%= dialog_trigger do %>
- <%= render_button("Open Typography", variant: :outline) %>
- <% end %>
- <%= dialog_content do %>
- <h2 class="mt-10 scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight transition-colors first:mt-0">The King's Plan</h2>
- <p class="leading-7 [&:not(:first-child)]:mt-6">The king thought long and hard, and finally came up with <a href="#" class="font-medium text-primary underline underline-offset-4">a brilliant plan</a>: he would tax the jokes in the kingdom.</p>
- <blockquote class="mt-6 border-l-2 pl-6 italic">"After all," he said, "everyone enjoys a good joke, so it's only fair that they should pay for the privilege."</blockquote>
- <% end %>
- <% end %>
+ <%= render_code_preview('dialog') %>
</div>
<% end %>
<% content_for :code, flush: true do %>
- <%= code_partial("dialog/code/preview", :erb) %>
+ <%= code_partial("dialog/preview", :erb) %>
<% end %>
<%= render_preview %>
<h2 class="font-heading scroll-m-20 border-b pb-2 text-2xl font-semibold tracking-tight first:mt-0" id="installation">Installation</h2>
@@ -28,11 +19,11 @@
rails generate shadcn_ui dialog
<% end %>
<h2 class="font-heading mt-12 scroll-m-20 border-b pb-2 mb-2 text-2xl font-semibold tracking-tight first:mt-0" id="usage"><a href="/docs/components/dialog#usage">Usage</a></h2>
-<%= code_partial("dialog/code/usage", :erb) %>
+<%= code_partial("dialog/usage", :erb) %>
<%= render_usage("dialog") %>
<div class="pb-12 pt-8">
<section>
@@ -79,11 +70,11 @@
<% end %>
</div>
<% end %>
<% content_for :code, flush: true do %>
- <%= code_partial("dialog/code/notifications", :erb) %>
+ <%= code_partial("dialog/notifications", :erb) %>
<% end %>
<%= render_example %>
<% content_for :examples, flush: true do %>
@@ -137,10 +128,10 @@
<% end %>
</div>
<% end %>
<% content_for :code, flush: true do %>
- <%= code_partial("dialog/code/form", :erb) %>
+ <%= code_partial("dialog/form", :erb) %>
<% end %>
<%= render_example %>
</section>