File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
packages/kit-fluffy/src/components/input Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { QwikIntrinsicElements , component$ } from '@builder.io/qwik' ;
2
+ import { stringifyClassList } from '@qwik-ui/cva' ;
3
+ import type { OmitSignalClass } from '@qwik-ui/type-utils' ;
4
+ import { twMerge } from 'tailwind-merge' ;
5
+
6
+ export type InputProps = OmitSignalClass <
7
+ Omit < QwikIntrinsicElements [ 'input' ] , 'children' >
8
+ > ;
9
+
10
+ export const Input = component$ < InputProps > (
11
+ ( { class : classList , type, ...restOfProps } ) => {
12
+ const inputClasses = [
13
+ `flex h-10 w-full rounded-md border border-input
14
+ bg-background px-3 py-2 text-sm ring-offset-background
15
+ file:border-0 file:bg-transparent file:text-sm
16
+ file:font-medium placeholder:text-muted-foreground focus-visible:outline-none
17
+ focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
18
+ disabled:cursor-not-allowed disabled:opacity-50` ,
19
+ classList ,
20
+ ] ;
21
+ const twOptimizedClassesString = twMerge ( stringifyClassList ( inputClasses ) ) ;
22
+
23
+ return < input { ...restOfProps } type = { type } class = { twOptimizedClassesString } /> ;
24
+ } ,
25
+ ) ;
You can’t perform that action at this time.
0 commit comments