From e145250308c1f64995224f05892eb3e5dd0d85a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oddbj=C3=B8rn=20=C3=98vernes?= Date: Thu, 21 Oct 2021 12:48:09 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20Fix=20radio=20and=20checkbox=20l?= =?UTF-8?q?abel=20padding=20(#1643)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 💄 Removed extra padding between input and label * 📸 Update snapshots --- .../core-react/src/components/Checkbox/Checkbox.tokens.ts | 7 ------- libraries/core-react/src/components/Checkbox/Checkbox.tsx | 3 +-- .../Checkbox/__snapshots__/Checkbox.test.tsx.snap | 1 - libraries/core-react/src/components/Radio/Radio.tokens.ts | 7 ------- libraries/core-react/src/components/Radio/Radio.tsx | 1 - .../src/components/Radio/__snapshots__/Radio.test.tsx.snap | 1 - 6 files changed, 1 insertion(+), 19 deletions(-) diff --git a/libraries/core-react/src/components/Checkbox/Checkbox.tokens.ts b/libraries/core-react/src/components/Checkbox/Checkbox.tokens.ts index 73c997999e..7acd2c0228 100644 --- a/libraries/core-react/src/components/Checkbox/Checkbox.tokens.ts +++ b/libraries/core-react/src/components/Checkbox/Checkbox.tokens.ts @@ -53,13 +53,6 @@ export const checkbox: CheckboxToken = { }, }, }, - entities: { - label: { - spacings: { - left: medium_small, - }, - }, - }, modes: { compact: { spacings: { diff --git a/libraries/core-react/src/components/Checkbox/Checkbox.tsx b/libraries/core-react/src/components/Checkbox/Checkbox.tsx index 5dda88589f..09b23e6add 100644 --- a/libraries/core-react/src/components/Checkbox/Checkbox.tsx +++ b/libraries/core-react/src/components/Checkbox/Checkbox.tsx @@ -2,7 +2,7 @@ import { forwardRef, Ref, InputHTMLAttributes } from 'react' import styled from 'styled-components' import { checkbox as tokens } from './Checkbox.tokens' -import { typographyTemplate, spacingsTemplate } from '../../utils' +import { typographyTemplate } from '../../utils' import { CheckboxInput } from './Input' type StyledLabelProps = { @@ -17,7 +17,6 @@ const StyledLabel = styled.label` const LabelText = styled.span` ${typographyTemplate(tokens.typography)}; - ${spacingsTemplate(tokens.entities.label.spacings)} ` export type CheckboxProps = { diff --git a/libraries/core-react/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap b/libraries/core-react/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap index 9ba9562fcc..a797dee450 100644 --- a/libraries/core-react/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +++ b/libraries/core-react/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap @@ -81,7 +81,6 @@ exports[`Checkbox Matches snapshot 1`] = ` -ms-letter-spacing: 0.013em; letter-spacing: 0.013em; text-align: left; - padding-left: 12px; } @media (hover:hover) and (pointer:fine) { diff --git a/libraries/core-react/src/components/Radio/Radio.tokens.ts b/libraries/core-react/src/components/Radio/Radio.tokens.ts index 5c1d728ad1..7d7a622ba8 100644 --- a/libraries/core-react/src/components/Radio/Radio.tokens.ts +++ b/libraries/core-react/src/components/Radio/Radio.tokens.ts @@ -53,13 +53,6 @@ export const comfortable: RadioToken = { }, }, }, - entities: { - label: { - spacings: { - left: medium_small, - }, - }, - }, modes: { compact: { spacings: { diff --git a/libraries/core-react/src/components/Radio/Radio.tsx b/libraries/core-react/src/components/Radio/Radio.tsx index 53385c7eae..7f728dee1c 100644 --- a/libraries/core-react/src/components/Radio/Radio.tsx +++ b/libraries/core-react/src/components/Radio/Radio.tsx @@ -84,7 +84,6 @@ const Svg = styled.svg.attrs(({ height, width, fill }) => ({ const LabelText = styled.span` ${typographyTemplate(tokens.typography)} - ${spacingsTemplate(tokens.entities.label.spacings)} ` type StyledInputWrapperProps = { disabled: boolean } diff --git a/libraries/core-react/src/components/Radio/__snapshots__/Radio.test.tsx.snap b/libraries/core-react/src/components/Radio/__snapshots__/Radio.test.tsx.snap index f056efa009..09ea33140b 100644 --- a/libraries/core-react/src/components/Radio/__snapshots__/Radio.test.tsx.snap +++ b/libraries/core-react/src/components/Radio/__snapshots__/Radio.test.tsx.snap @@ -71,7 +71,6 @@ exports[`Radio Matches snapshot 1`] = ` -ms-letter-spacing: 0.013em; letter-spacing: 0.013em; text-align: left; - padding-left: 12px; } .c1 {