From 5f6761f8b6154dc9d9b44b226d3562f4035cf536 Mon Sep 17 00:00:00 2001 From: Thomas Zemp Date: Tue, 13 Feb 2024 10:50:12 +0100 Subject: [PATCH] fix: rtl cleanup (#1450) --- collections/forms/i18n/en.pot | 4 +- components/node/src/toggle.js | 35 ++-- components/switch/src/switch/switch-icons.js | 9 ++ .../switch/src/switch/switch.stories.js | 25 ++- components/table/src/table/table-cell-head.js | 4 + components/table/src/table/table-cell.js | 4 + components/table/src/table/table.stories.js | 128 +++++++++++++++ components/transfer/src/icons.js | 152 ++++++++++-------- 8 files changed, 265 insertions(+), 96 deletions(-) diff --git a/collections/forms/i18n/en.pot b/collections/forms/i18n/en.pot index fbbe186a81..b5e4f3ae1d 100644 --- a/collections/forms/i18n/en.pot +++ b/collections/forms/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2023-05-05T12:46:11.864Z\n" -"PO-Revision-Date: 2023-05-05T12:46:11.864Z\n" +"POT-Creation-Date: 2024-02-12T09:23:49.018Z\n" +"PO-Revision-Date: 2024-02-12T09:23:49.018Z\n" msgid "Upload file" msgstr "Upload file" 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'} > ( -
-