Web: Components: Adapt RadioButton component to RTL interface

This commit is contained in:
Aleksandr Lushkin 2023-05-29 18:16:37 +02:00
parent 078903a5a0
commit 4f1e0a170c
3 changed files with 17 additions and 6 deletions

View File

@ -19,7 +19,14 @@ const Label = styled(ClearLabel)`
cursor: ${(props) => !props.isDisabled && "pointer"};
.radio-button {
margin-right: ${(props) => props.theme.radioButton.marginRight};
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-left: ${props.theme.radioButton.marginBeforeLabel};
`
: css`
margin-right: ${props.theme.radioButton.marginBeforeLabel};
`}
path {
fill: ${(props) =>
@ -69,9 +76,13 @@ const Label = styled(ClearLabel)`
&:not(:first-child) {
${(props) =>
props.orientation === "horizontal" &&
css`
margin-left: ${props.spacing};
`};
(props.theme.interfaceDirection === "rtl"
? css`
margin-right: ${props.spacing};
`
: css`
margin-left: ${props.spacing};
`)};
}
&:not(:last-child) {

View File

@ -496,7 +496,7 @@ const Base = {
textColor: black,
textDisableColor: gray,
marginRight: "8px",
marginBeforeLabel: "8px",
background: white,
disableBackground: grayLight,

View File

@ -491,7 +491,7 @@ const Dark = {
testColor: grayMaxLight,
textDisableColor: "#5c5c5c",
marginRight: "8px",
marginBeforeLabel: "8px",
background: "#292929",
disableBackground: "#545454",