From 7212e5712fcd769608982992d7c007cd50a4c2bf Mon Sep 17 00:00:00 2001 From: Raphael Ferrand Date: Thu, 31 Oct 2024 17:49:40 +0100 Subject: [PATCH] SWED-2337 toggle switch UI update --- .../components/Togglebox/constants.js | 18 ++++ .../components/FormComponents/Togglebox.js | 14 ++- src/less/components/togglebox.less | 92 +++++++++---------- src/less/documentation-swedbankpay.less | 24 +++-- src/less/variables-payex.less | 3 + src/less/variables-swedbankpay.less | 2 + 6 files changed, 94 insertions(+), 59 deletions(-) diff --git a/src/App/ComponentsDocumentation/components/Togglebox/constants.js b/src/App/ComponentsDocumentation/components/Togglebox/constants.js index e86eb6c8c7..49c6a71188 100644 --- a/src/App/ComponentsDocumentation/components/Togglebox/constants.js +++ b/src/App/ComponentsDocumentation/components/Togglebox/constants.js @@ -48,6 +48,24 @@ export const toggleboxShowCase = { }, ], }, + { + id: "color-theme", + title: "Color theme", + values: [ + { + name: "Grey", + value: { + colorTheme: "grey", + }, + }, + { + name: "White", + value: { + colorTheme: "white", + }, + }, + ], + }, ], }, title: "Togglebox", diff --git a/src/App/components/FormComponents/Togglebox.js b/src/App/components/FormComponents/Togglebox.js index 54be7e695f..58759e51bd 100644 --- a/src/App/components/FormComponents/Togglebox.js +++ b/src/App/components/FormComponents/Togglebox.js @@ -1,7 +1,14 @@ import React from "react"; import PropTypes from "prop-types"; -const Togglebox = ({ id, checked, disabled, label, labelTop }) => { +const Togglebox = ({ + id, + checked, + disabled, + label, + labelTop, + colorTheme = "grey", +}) => { const attrs = { type: "checkbox", id: id || null, @@ -12,7 +19,10 @@ const Togglebox = ({ id, checked, disabled, label, labelTop }) => { return (
{"\n"} - + {"\n"} {label ? (