From 001c6d9a6be0903711379467d36607d20605686d Mon Sep 17 00:00:00 2001 From: Arkadiusz Bachorski <60391032+arkadiuszbachorski@users.noreply.github.com> Date: Tue, 14 Jan 2025 07:45:52 +0100 Subject: [PATCH] Add center allow disabling centering to SideLabel --- .../SideLabel/SideLabel.stories.tsx | 21 +++++++++++++++++++ src/components/SideLabel/SideLabel.tsx | 15 ++++++++++--- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/components/SideLabel/SideLabel.stories.tsx b/src/components/SideLabel/SideLabel.stories.tsx index 088dd06..9ad7f50 100644 --- a/src/components/SideLabel/SideLabel.stories.tsx +++ b/src/components/SideLabel/SideLabel.stories.tsx @@ -29,6 +29,27 @@ export const Reversed = () => ( ) +const complexLabel = ( + <> +

Lorem

+

+ Lorem ipsum dolor sit amet, consectetur adipisicing elit +

+ +) + +export const Complex = () => ( + + + +) + +export const ComplexNonCentered = () => ( + + + +) + export const NoInput = () => ( input goes here diff --git a/src/components/SideLabel/SideLabel.tsx b/src/components/SideLabel/SideLabel.tsx index 0909746..595c8d9 100644 --- a/src/components/SideLabel/SideLabel.tsx +++ b/src/components/SideLabel/SideLabel.tsx @@ -11,8 +11,15 @@ import { cn } from '../../utils/className' type SideLabelProps = Omit, 'label'> & { label?: ReactNode - /* Show label on right side */ + /** + * Show label on right side + * */ reverse?: boolean + /** + * Center content vertically + * @default true + * */ + center?: boolean } /** @@ -23,17 +30,19 @@ export const SideLabel = ({ className, label, reverse, + center = true, ...props }: SideLabelProps) => ( )