Skip to content

Commit

Permalink
Added prop for more direct access to input styles
Browse files Browse the repository at this point in the history
  • Loading branch information
BurntNerve committed Apr 26, 2024
1 parent f240e3f commit 0cab3cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const AbstraxionSignin = () => {
</h2>
</div>
<Input
className="!ui-text-[16px]"
baseInputClassName="!ui-text-[16px]"
placeholder="Verification Code"
value={otp}
onChange={handleOtpChange}
Expand Down Expand Up @@ -152,7 +152,7 @@ export const AbstraxionSignin = () => {
</h2>
</div>
<Input
className="!ui-text-[16px]"
baseInputClassName="!ui-text-[16px]"
placeholder="Email address"
value={email}
onChange={handleEmailChange}
Expand Down
7 changes: 6 additions & 1 deletion packages/ui/src/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ type BaseInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "prefix">;
export interface ITextFieldProps extends BaseInputProps {
className?: string;
error?: string;
baseInputClassName?: string;
}
export function Input({
className,
placeholder,
// This should only be used for specific classes that can't override the base input styles.
baseInputClassName,
value,
error,
onBlur,
Expand Down Expand Up @@ -46,7 +49,9 @@ export function Input({
</label>
<input
{...props}
className={`ui-z-10 ui-block ui-h-8 ui-w-full ui-border-b ui-relative ${
className={`${
baseInputClassName || ""
} ui-z-10 ui-block ui-h-8 ui-w-full ui-border-b ui-relative ${
error ? "ui-border-red-400" : ""
} ui-bg-transparent ui-font-akkuratLL ui-text-sm ui-text-zinc-100 ui-font-normal ui-leading-tight ui-outline-none`}
onBlur={handleBlur}
Expand Down

0 comments on commit 0cab3cf

Please sign in to comment.