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'} > ( -
-