Skip to content

Commit aa983e8

Browse files
authored
Support RTL in alert/alert_dialog/dialog/sheet components (#206)
1 parent 398415a commit aa983e8

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

lib/ruby_ui/alert/alert.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def colors
2727
end
2828

2929
def default_attrs
30-
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"
30+
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"
3131
{
3232
class: [base_classes, colors]
3333
}

lib/ruby_ui/alert_dialog/alert_dialog_footer.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def view_template(&)
1010

1111
def default_attrs
1212
{
13-
class: "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2"
13+
class: "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 rtl:space-x-reverse"
1414
}
1515
end
1616
end

lib/ruby_ui/alert_dialog/alert_dialog_header.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def view_template(&)
1010

1111
def default_attrs
1212
{
13-
class: "flex flex-col space-y-2 text-center sm:text-left"
13+
class: "flex flex-col space-y-2 text-center sm:text-left rtl:sm:text-right"
1414
}
1515
end
1616
end

lib/ruby_ui/dialog/dialog_content.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def default_attrs
4343
def close_button
4444
button(
4545
type: "button",
46-
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",
46+
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",
4747
data_action: "click->ruby-ui--dialog#dismiss"
4848
) do
4949
svg(

lib/ruby_ui/dialog/dialog_footer.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def view_template(&)
1010

1111
def default_attrs
1212
{
13-
class: "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 gap-y-2 sm:gap-y-0"
13+
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"
1414
}
1515
end
1616
end

lib/ruby_ui/dialog/dialog_header.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def view_template(&)
1010

1111
def default_attrs
1212
{
13-
class: "flex flex-col space-y-1.5 text-center sm:text-left"
13+
class: "flex flex-col space-y-1.5 text-center sm:text-left rtl:sm:text-right"
1414
}
1515
end
1616
end

lib/ruby_ui/sheet/sheet_content.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def default_attrs
4242
def close_button
4343
button(
4444
type: "button",
45-
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",
45+
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",
4646
data_action: "click->ruby-ui--sheet-content#close"
4747
) do
4848
svg(

0 commit comments

Comments
 (0)