Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Rafik-Belkadi
Copy link

@Rafik-Belkadi Rafik-Belkadi commented Apr 1, 2024

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

Which package are you modifying?

  • accordion
  • alert
  • alert-dialog
  • aspect-ratio
  • avatar
  • badge
  • button
  • calendar
  • card
  • checkbox
  • collapsible
  • combobox
  • command
  • context-menu
  • data-table
  • date-picker
  • dialog
  • dropdown-menu
  • hover-card
  • icon
  • input
  • label
  • menubar
  • navigation-menu
  • pagination
  • popover
  • progress
  • radio-group
  • scroll-area
  • select
  • separator
  • sheet
  • skeleton
  • slider
  • sonner
  • spinner
  • switch
  • table
  • tabs
  • textarea
  • toast
  • toggle
  • tooltip
  • typography

What is the new behavior?

Added ability to have prefix/suffix inside an input

Does this PR introduce a breaking change?

  • Yes
  • No

Copy link
Owner

@goetzrobin goetzrobin left a 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',
Copy link
Owner

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?

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

Copy link
Owner

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>
Copy link
Owner

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',
Copy link
Owner

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

@goetzrobin
Copy link
Owner

@Rafik-Belkadi let me know if there's anything you need me to do to support you on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants