From 9106fbf1079c8d1eab277cde2191bb802b06bdc4 Mon Sep 17 00:00:00 2001 From: andresin87 Date: Fri, 17 Jan 2025 11:38:10 +0100 Subject: [PATCH] feat(components/atom/label): open classnames --- components/atom/label/src/index.tsx | 41 ++++++++++++++++++----- components/atom/label/test/index.test.tsx | 4 +-- 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/components/atom/label/src/index.tsx b/components/atom/label/src/index.tsx index 449643a81..373108ace 100644 --- a/components/atom/label/src/index.tsx +++ b/components/atom/label/src/index.tsx @@ -34,18 +34,41 @@ export interface AtomLabelProps extends Pick) => - cx(CLASSNAME, { - [`${CLASSNAME}--${fontSize as string}`]: Boolean(fontSize), - [`${CLASSNAME}--${type as string}`]: Boolean(type), - [`${CLASSNAME}--inlineLeft`]: inline === 'left', - [`${CLASSNAME}--inlineRight`]: inline === 'right' - }) +const getClass = ({ + inline, + type, + fontSize, + className +}: Pick) => + cx( + CLASSNAME, + { + [`${CLASSNAME}--${fontSize as string}`]: Boolean(fontSize), + [`${CLASSNAME}--${type as string}`]: Boolean(type), + [`${CLASSNAME}--inlineLeft`]: inline === 'left', + [`${CLASSNAME}--inlineRight`]: inline === 'right' + }, + className + ) -const AtomLabel: FC = ({name, text, inline, optionalText, type, fontSize, htmlFor, onClick}) => ( -