From 9fc1623f8826d2e4fb653aa0325b3e3742514f43 Mon Sep 17 00:00:00 2001 From: Harry Hogg Date: Tue, 18 Jun 2024 18:21:09 +0100 Subject: [PATCH] fix(InputLabel): Added prop to control label text alignment --- workspaces/package/src/Input/InputLabel.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/workspaces/package/src/Input/InputLabel.tsx b/workspaces/package/src/Input/InputLabel.tsx index 61648005..b2ac2e4e 100644 --- a/workspaces/package/src/Input/InputLabel.tsx +++ b/workspaces/package/src/Input/InputLabel.tsx @@ -1,6 +1,6 @@ import { forwardRef } from 'react'; import { Box, BoxProps } from '../Box/Box'; -import { Text } from '../Text/Text'; +import { Text, TextProps } from '../Text/Text'; /** * The label element of the input. This should be placed @@ -11,6 +11,10 @@ export interface InputLabelProps extends Omit { * A helpful description that can be displayed under the input. */ description?: string | JSX.Element; + /** + * Alignment of the description text. + */ + descriptionAlign?: TextProps['align']; /** * The label string that is rendered above the Input. */ @@ -21,6 +25,7 @@ export const InputLabel = forwardRef((props, ref) => { const { children, description, + descriptionAlign, label, paddingHorizontal = 'x3', tag = 'label', @@ -59,6 +64,7 @@ export const InputLabel = forwardRef((props, ref) => { {description && (