File tree Expand file tree Collapse file tree 4 files changed +46
-8
lines changed
platforms/metagram/src/lib/ui Expand file tree Collapse file tree 4 files changed +46
-8
lines changed Original file line number Diff line number Diff line change @@ -52,11 +52,3 @@ export const Password = {
52
52
placeholder : "Please enter password" ,
53
53
} ,
54
54
} ;
55
-
56
- export const Radio = {
57
- args : {
58
- type : "radio" ,
59
- value : "option1" ,
60
- name : "option-1" ,
61
- } ,
62
- } ;
Original file line number Diff line number Diff line change
1
+ import type { ComponentProps } from "svelte" ;
2
+ import { Textarea } from ".." ;
3
+
4
+ export default {
5
+ title : "UI/Textarea" ,
6
+ component : Textarea ,
7
+ tags : [ "autodocs" ] ,
8
+ render : ( args : {
9
+ Component : Textarea ;
10
+ props : ComponentProps < typeof Textarea > ;
11
+ } ) => ( {
12
+ Component : Textarea ,
13
+ props : args ,
14
+ } ) ,
15
+ } ;
16
+
17
+ export const Primary = {
18
+ args : {
19
+ rows : 5 ,
20
+ placeholder : "Hey guys..." ,
21
+ } ,
22
+ } ;
Original file line number Diff line number Diff line change
1
+ <script lang =" ts" >
2
+ import { cn } from ' $lib/utils' ;
3
+ import type { HTMLAttributes } from ' svelte/elements' ;
4
+
5
+ interface ITextareaProps extends HTMLAttributes <HTMLTextAreaElement > {
6
+ name? : string ;
7
+ placeholder? : string ;
8
+ value: string ;
9
+ rows? : number ;
10
+ }
11
+
12
+ let {
13
+ name = ' ' ,
14
+ placeholder = ' ' ,
15
+ value = $bindable (),
16
+ rows,
17
+ ... restProps
18
+ }: ITextareaProps = $props ();
19
+
20
+ const cBase = ' rounded-xl bg-grey/80 resize-none w-full p-5' ;
21
+ </script >
22
+
23
+ <textarea {...restProps } {rows } name ={name } id ={name } bind:value {placeholder } class ={cn ([cBase , restProps .class ].join (' ' ))}></textarea >
Original file line number Diff line number Diff line change @@ -6,3 +6,4 @@ export { default as Label } from "./Label/Label.svelte";
6
6
export { default as Toggle } from "./Toggle/Toggle.svelte" ;
7
7
export { default as Helper } from "./Helper/Helper.svelte" ;
8
8
export { default as InputRadio } from "./InputRadio/InputRadio.svelte" ;
9
+ export { default as Textarea } from "./Textarea/Textarea.svelte" ;
You can’t perform that action at this time.
0 commit comments