diff --git a/components/node/src/toggle.js b/components/node/src/toggle.js
index 0f2fbd0e45..1937586128 100644
--- a/components/node/src/toggle.js
+++ b/components/node/src/toggle.js
@@ -4,18 +4,20 @@ import PropTypes from 'prop-types'
import React from 'react'
const ArrowDown = () => (
-
+
)
export const Toggle = ({ open, onOpen, onClose, dataTest }) => {
@@ -55,20 +57,21 @@ export const Toggle = ({ open, onOpen, onClose, dataTest }) => {
z-index: 2;
fill: ${colors.grey900};
}
- div :global(svg) {
+ div :global(.nodeArrow) {
vertical-align: top;
transform: rotate(-90deg);
transition: transform 0.1s ease-out;
}
- div :global(svg:dir(rtl)) {
+ div :global(.nodeArrow:dir(rtl)) {
transform: rotate(90deg);
}
- .open :global(svg) {
+ .open :global(.nodeArrow) {
transform: rotate(0);
}
- .open :global(svg:dir(rtl)) {
+ .open :global(.nodeArrow:dir(rtl)) {
transform: rotate(0);
}
+
div:hover {
cursor: pointer;
border-radius: 3px;
diff --git a/components/switch/src/switch/switch-icons.js b/components/switch/src/switch/switch-icons.js
index cb2b9e8fcd..9f7a74c744 100644
--- a/components/switch/src/switch/switch-icons.js
+++ b/components/switch/src/switch/switch-icons.js
@@ -15,6 +15,10 @@ const styles = css`
transform: scale(-1, 1);
}
+ svg[dir='rtl'] {
+ transform: scale(-1, 1);
+ }
+
svg.dense {
height: 14px;
width: 27px;
@@ -35,6 +39,10 @@ const styles = css`
display: none;
}
+ svg[dir='rtl'] .checkmark {
+ display: none;
+ }
+
svg.checked .handle-unchecked,
svg:not(.checked) .handle-checked {
fill: none;
@@ -93,6 +101,7 @@ export function SwitchRegular({ className }) {
viewBox="0 0 42 22"
xmlns="http://www.w3.org/2000/svg"
className={className}
+ dir={document.documentElement?.dir ?? 'ltr'}
>
(
-
-
-
-
-
-)
+export const RTL = (args) => {
+ useEffect(() => {
+ document.documentElement.setAttribute('dir', 'rtl')
+ return () => {
+ document.documentElement.setAttribute('dir', 'ltr')
+ }
+ }, [])
+
+ return (
+
+
+
+
+
+ )
+}
diff --git a/components/transfer/src/icons.js b/components/transfer/src/icons.js
index 3b41cd605a..b39d47ff7f 100644
--- a/components/transfer/src/icons.js
+++ b/components/transfer/src/icons.js
@@ -7,34 +7,37 @@ const centerButtonStyles = css`
svg {
min-width: 20px;
}
- svg:dir(rtl) {
+ div.centerButton:dir(rtl) {
transform: rotate(180deg) translateX(4px);
}
`
export const IconAddAll = ({ dataTest, disabled }) => (
-
+ >
)
IconAddAll.propTypes = {
@@ -43,18 +46,21 @@ IconAddAll.propTypes = {
}
export const IconAddIndividual = ({ dataTest, disabled }) => (
-
+ >
)
IconAddIndividual.propTypes = {
@@ -63,30 +69,33 @@ IconAddIndividual.propTypes = {
}
export const IconRemoveAll = ({ dataTest, disabled }) => (
-
+ >
)
IconRemoveAll.propTypes = {
@@ -95,21 +104,24 @@ IconRemoveAll.propTypes = {
}
export const IconRemoveIndividual = ({ dataTest, disabled }) => (
-
+ >
)
IconRemoveIndividual.propTypes = {