From 168adbbd1db574612c4f5f214b94f98219adf287 Mon Sep 17 00:00:00 2001 From: stephann <3025661+stephannv@users.noreply.github.com> Date: Sun, 24 Nov 2024 11:05:54 -0300 Subject: [PATCH] Update alert, alert dialog, dialog and sheet components --- Gemfile.lock | 2 +- app/components/ruby_ui/alert.rb | 2 +- app/components/ruby_ui/alert_dialog/alert_dialog_footer.rb | 2 +- app/components/ruby_ui/alert_dialog/alert_dialog_header.rb | 2 +- app/components/ruby_ui/dialog/dialog_content.rb | 2 +- app/components/ruby_ui/dialog/dialog_footer.rb | 2 +- app/components/ruby_ui/dialog/dialog_header.rb | 2 +- app/components/ruby_ui/sheet/sheet_content.rb | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b64db73..53c7e27 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -14,7 +14,7 @@ GIT GIT remote: https://github.com/ruby-ui/ruby_ui.git - revision: 398415a462e170a1c9d7af06b588fa5f2b879465 + revision: aa983e83f1ece8a3f62c4e816c07d2a2f17b6b90 branch: main specs: ruby_ui (1.0.0.beta1) diff --git a/app/components/ruby_ui/alert.rb b/app/components/ruby_ui/alert.rb index 0c7881e..c83352d 100644 --- a/app/components/ruby_ui/alert.rb +++ b/app/components/ruby_ui/alert.rb @@ -27,7 +27,7 @@ def colors end def default_attrs - base_classes = "backdrop-blur relative w-full ring-1 ring-inset rounded-lg px-4 py-4 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg~*]:pl-8" + base_classes = "backdrop-blur relative w-full ring-1 ring-inset rounded-lg px-4 py-4 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:start-4 [&>svg]:top-4 [&>svg~*]:ps-8" { class: [base_classes, colors] } diff --git a/app/components/ruby_ui/alert_dialog/alert_dialog_footer.rb b/app/components/ruby_ui/alert_dialog/alert_dialog_footer.rb index 07c0e6e..f548106 100644 --- a/app/components/ruby_ui/alert_dialog/alert_dialog_footer.rb +++ b/app/components/ruby_ui/alert_dialog/alert_dialog_footer.rb @@ -10,7 +10,7 @@ def view_template(&) def default_attrs { - class: "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2" + class: "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 rtl:space-x-reverse" } end end diff --git a/app/components/ruby_ui/alert_dialog/alert_dialog_header.rb b/app/components/ruby_ui/alert_dialog/alert_dialog_header.rb index 1331fa1..0494988 100644 --- a/app/components/ruby_ui/alert_dialog/alert_dialog_header.rb +++ b/app/components/ruby_ui/alert_dialog/alert_dialog_header.rb @@ -10,7 +10,7 @@ def view_template(&) def default_attrs { - class: "flex flex-col space-y-2 text-center sm:text-left" + class: "flex flex-col space-y-2 text-center sm:text-left rtl:sm:text-right" } end end diff --git a/app/components/ruby_ui/dialog/dialog_content.rb b/app/components/ruby_ui/dialog/dialog_content.rb index 3c9df6d..41b01d6 100644 --- a/app/components/ruby_ui/dialog/dialog_content.rb +++ b/app/components/ruby_ui/dialog/dialog_content.rb @@ -43,7 +43,7 @@ def default_attrs def close_button button( type: "button", - class: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", + class: "absolute end-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", data_action: "click->ruby-ui--dialog#dismiss" ) do svg( diff --git a/app/components/ruby_ui/dialog/dialog_footer.rb b/app/components/ruby_ui/dialog/dialog_footer.rb index 88277df..bf2b35a 100644 --- a/app/components/ruby_ui/dialog/dialog_footer.rb +++ b/app/components/ruby_ui/dialog/dialog_footer.rb @@ -10,7 +10,7 @@ def view_template(&) def default_attrs { - class: "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 gap-y-2 sm:gap-y-0" + class: "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 gap-y-2 sm:gap-y-0 rtl:space-x-reverse" } end end diff --git a/app/components/ruby_ui/dialog/dialog_header.rb b/app/components/ruby_ui/dialog/dialog_header.rb index cb7d9b5..c6a12aa 100644 --- a/app/components/ruby_ui/dialog/dialog_header.rb +++ b/app/components/ruby_ui/dialog/dialog_header.rb @@ -10,7 +10,7 @@ def view_template(&) def default_attrs { - class: "flex flex-col space-y-1.5 text-center sm:text-left" + class: "flex flex-col space-y-1.5 text-center sm:text-left rtl:sm:text-right" } end end diff --git a/app/components/ruby_ui/sheet/sheet_content.rb b/app/components/ruby_ui/sheet/sheet_content.rb index 60f733d..bf3a311 100644 --- a/app/components/ruby_ui/sheet/sheet_content.rb +++ b/app/components/ruby_ui/sheet/sheet_content.rb @@ -42,7 +42,7 @@ def default_attrs def close_button button( type: "button", - class: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", + class: "absolute end-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", data_action: "click->ruby-ui--sheet-content#close" ) do svg(