-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/input form field suffix prefix #242
base: main
Are you sure you want to change the base?
Feature/input form field suffix prefix #242
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Left some comments :) excited for this 😍
@@ -4,7 +4,7 @@ import { cva, VariantProps } from 'class-variance-authority'; | |||
import { ClassValue } from 'clsx'; | |||
|
|||
export const inputVariants = cva( | |||
'flex rounded-md border font-normal border-input bg-transparent text-sm ring-offset-background file:border-0 file:text-foreground file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50', | |||
'flex rounded-md border font-normal border-input bg-transparent text-sm ring-offset-background file:border-0 file:text-foreground file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious about the reason behind this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when focused, it was adding a "double" ring around the input, which looks really bad when it has an error, or even when focused without an error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you send me a screenshot of what you see? I am wondering if this is just how it looks with shadcn or if there's something wrong. Thank you!
<div class="relative block {{ class }}"> | ||
@if (hasPrefix) { | ||
<div class="absolute left-4 top-0 flex h-10 items-center justify-center"> | ||
<ng-content select="[hlmInputPrefix]"></ng-content> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use self closing tags everywhere please
standalone: true, | ||
selector: 'hlm-input-form-field', | ||
imports: [HlmInputDirective, HlmInputSuffixDirective, HlmInputPrefixDirective, HlmLabelDirective, NgClass], | ||
templateUrl: './hlm-input-form-field.component.html', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move the template into the component directly
@Rafik-Belkadi let me know if there's anything you need me to do to support you on this |
PR Checklist
Please check if your PR fulfills the following requirements:
guidelines: https://github.com/goetzrobin/spartan/blob/main/CONTRIBUTING.md#-commit-message-guidelines
PR Type
What kind of change does this PR introduce?
Which package are you modifying?
What is the new behavior?
Added ability to have prefix/suffix inside an input
Does this PR introduce a breaking change?