From 5add05e39f88470a80e0d5c46bcbbc9f5eaf208b Mon Sep 17 00:00:00 2001 From: Micheal O'Donovan Date: Mon, 17 Mar 2025 13:10:19 +0000 Subject: [PATCH 01/14] adjusting Label Optional text --- src/components/Atoms/Input/Input.md | 1 + src/components/Atoms/Label/Label.js | 7 +++++-- src/components/Atoms/Label/Label.md | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/Atoms/Input/Input.md b/src/components/Atoms/Input/Input.md index 259588379..2348f0053 100644 --- a/src/components/Atoms/Input/Input.md +++ b/src/components/Atoms/Input/Input.md @@ -7,6 +7,7 @@ label="Label" id="input-example-1" showLabel={true} + optional /> ``` diff --git a/src/components/Atoms/Label/Label.js b/src/components/Atoms/Label/Label.js index 2b8a38a93..02f276316 100644 --- a/src/components/Atoms/Label/Label.js +++ b/src/components/Atoms/Label/Label.js @@ -3,7 +3,6 @@ import PropTypes from 'prop-types'; import styled from 'styled-components'; import Text from '../Text/Text'; -import spacing from '../../../theme/shared/spacing'; import hideVisually from '../../../theme/shared/hideVisually'; const LabelElement = styled.label` @@ -13,6 +12,10 @@ const LabelElement = styled.label` flex-direction: column; color: ${({ theme, errorMsg }) => (errorMsg ? theme.color('red') : theme.color('grey_label'))}; + @media ${({ theme }) => theme.allBreakpoints('M')} { + max-width: 290px; + } + ${({ optional, theme }) => optional === true && ` :after { position: absolute; @@ -25,7 +28,7 @@ const LabelElement = styled.label` `; const VisibleText = styled(Text)` - margin-bottom: ${spacing('sm')}; + margin-bottom: 0.5rem; font-weight: normal; `; diff --git a/src/components/Atoms/Label/Label.md b/src/components/Atoms/Label/Label.md index 3d8a41e4d..b875d76e3 100644 --- a/src/components/Atoms/Label/Label.md +++ b/src/components/Atoms/Label/Label.md @@ -15,7 +15,7 @@ const StyledInput = styled.input` border-width: 1px; `; -