Skip to content

Commit

Permalink
fix(input): L3-3958 pass className properly to input, export text ali… (
Browse files Browse the repository at this point in the history
#463)

Co-authored-by: Sam Grund <sam@Sams-MBP.fios-router.home>
Co-authored-by: Sam Grund <sam@ip-192-168-1-93.ec2.internal>
  • Loading branch information
3 people authored Jan 9, 2025
1 parent 108eac9 commit d43cda2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/Input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const Input = React.forwardRef(
{labelText}
</label>
<input
className={classnames(`${px}-input__input`, { className })}
className={classnames(`${px}-input__input`, className)}
data-testid={id}
disabled={inputProps.disabled}
id={id || generatedId}
Expand Down
6 changes: 4 additions & 2 deletions src/components/Text/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const Text = ({
className,
element: CustomElement,
variant = TextVariants.body2,
align = TextAlignments.left,
align,
...props
}: TextProps) => {
const Component = CustomElement || determineDefaultTextElement(variant);
Expand All @@ -41,7 +41,9 @@ const Text = ({
return (
<Component
{...commonProps}
className={classNames(baseClassName, className, determineTextClassName(variant), `${baseClassName}--${align}`)}
className={classNames(baseClassName, className, determineTextClassName(variant), {
[`${baseClassName}--${align}`]: !!align,
})}
{...props}
>
{children}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Text/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { TextVariants } from './types';
export { TextVariants, TextAlignments } from './types';
export { default as Text, type TextProps } from './Text';

0 comments on commit d43cda2

Please sign in to comment.