[READ-ONLY] Mirror of https://github.com/flo-bit/room. tiny 3d rooms saved locally or in your bluesky account, svelte/threlte flo-bit.dev/room/
0

Configure Feed

Select the types of activity you want to include in your feed.

room / src / lib / components / base / textarea / textarea.svelte
2.0 kB 57 lines
1<script lang="ts" module> 2 import type { WithElementRef, WithoutChildren } from 'bits-ui'; 3 import { type VariantProps, tv } from 'tailwind-variants'; 4 import { cn } from '$lib/utils'; 5 6 import type { HTMLTextareaAttributes } from 'svelte/elements'; 7 8 export const inputVariants = tv({ 9 base: 'focus:ring-2 ring-1 resize-none ring-inset border-0 focus:transition-transform rounded-2xl text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed duration-300 active:duration-100', 10 variants: { 11 variant: { 12 primary: 13 'focus:ring-accent-500 dark:focus:ring-accent-500 ring-accent-500/30 dark:ring-accent-500/20 bg-accent-400/5 dark:bg-accent-600/5 text-accent-700 dark:text-accent-400 placeholder:text-accent-700/70 dark:placeholder:text-accent-400/70', 14 secondary: 15 'focus:ring-base-800 dark:focus:ring-base-200 bg-base-100/50 dark:bg-base-900/50 text-base-900 dark:text-base-50 ring-base-200 dark:ring-base-800' 16 }, 17 sizeVariant: { 18 default: 'px-3 py-1.5 text-base min-h-[80px]', 19 sm: 'px-3 text-xs py-1.5 font-base min-h-[60px]', 20 lg: 'px-4 text-lg py-2 font-semibold min-h-[100px]' 21 } 22 }, 23 defaultVariants: { 24 variant: 'primary', 25 sizeVariant: 'default' 26 } 27 }); 28 29 export type InputVariant = VariantProps<typeof inputVariants>['variant']; 30 export type InputSize = VariantProps<typeof inputVariants>['sizeVariant']; 31 32 export type InputProps = WithElementRef<HTMLTextareaAttributes> & { 33 variant?: InputVariant; 34 sizeVariant?: InputSize; 35 }; 36</script> 37 38<script lang="ts"> 39 let { 40 ref = $bindable(null), 41 value = $bindable(), 42 class: className, 43 variant = 'primary', 44 sizeVariant = 'default', 45 ...restProps 46 }: WithoutChildren<WithElementRef<HTMLTextareaAttributes>> & { 47 variant?: InputVariant; 48 sizeVariant?: InputSize; 49 } = $props(); 50</script> 51 52<textarea 53 bind:this={ref} 54 class={cn(inputVariants({ variant, sizeVariant }), className)} 55 bind:value 56 {...restProps} 57></textarea>