feat(Input): create ghost variant styling
This commit is contained in:
@@ -16,22 +16,29 @@ type Props = ComponentProps<typeof Input> & {
|
|||||||
* Additional CSS classes for the container
|
* Additional CSS classes for the container
|
||||||
*/
|
*/
|
||||||
class?: string;
|
class?: string;
|
||||||
|
|
||||||
|
variant?: 'default' | 'ghost';
|
||||||
};
|
};
|
||||||
|
|
||||||
let {
|
let {
|
||||||
value = $bindable(''),
|
value = $bindable(''),
|
||||||
class: className,
|
class: className,
|
||||||
|
variant = 'default',
|
||||||
...rest
|
...rest
|
||||||
}: Props = $props();
|
}: Props = $props();
|
||||||
|
|
||||||
|
const isGhost = $derived(variant === 'ghost');
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Input
|
<Input
|
||||||
bind:value={value}
|
bind:value={value}
|
||||||
class={cn(
|
class={cn(
|
||||||
'h-12 sm:h-14 md:h-16 w-full text-sm sm:text-base',
|
'h-12 sm:h-14 md:h-16 w-full text-sm sm:text-base',
|
||||||
'backdrop-blur-md bg-white/80',
|
'backdrop-blur-md',
|
||||||
|
isGhost ? 'bg-transparent' : 'bg-white/80',
|
||||||
'border border-gray-300/50',
|
'border border-gray-300/50',
|
||||||
'shadow-[0_1px_3px_rgba(0,0,0,0.04)]',
|
isGhost ? 'border-transparent' : 'border-gray-300/50',
|
||||||
|
isGhost ? 'shadow-none' : 'shadow-[0_1px_3px_rgba(0,0,0,0.04)]',
|
||||||
'focus-visible:border-gray-400/60',
|
'focus-visible:border-gray-400/60',
|
||||||
'focus-visible:outline-none',
|
'focus-visible:outline-none',
|
||||||
'focus-visible:ring-1',
|
'focus-visible:ring-1',
|
||||||
|
|||||||
Reference in New Issue
Block a user