File tree 3 files changed +3
-26
lines changed
3 files changed +3
-26
lines changed Original file line number Diff line number Diff line change 2
2
import type { ColorMode , FillMode , ButtonType } from ' $lib/types' ;
3
3
4
4
import { COLOR_MODE , FILL_MODE , BUTTON_TYPE } from ' $lib/types' ;
5
- import { createEventDispatcher } from ' svelte' ;
6
5
7
6
export let type: ButtonType = BUTTON_TYPE .BUTTON ;
8
7
export let color: ColorMode ;
9
8
export let fill: FillMode ;
10
9
export let disabled = false ;
11
-
12
- const dispatch = createEventDispatcher ();
13
-
14
- function dispatchEvent(event : Event ) {
15
- dispatch (event .type );
16
- }
17
10
</script >
18
11
19
12
<button
20
13
{disabled }
21
14
type ={type === BUTTON_TYPE .SUBMIT ? ' submit' : ' button' }
22
- on:click ={ dispatchEvent }
15
+ on:click
23
16
class =" w-full rounded-md border px-4 py-2 focus:outline-none"
24
17
class:bg-transparent ={fill === FILL_MODE .RING }
25
18
class:bg-spek-primary- 600={fill === FILL _MODE.FILL && color === COLOR _MODE.PRIMARY }
Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
- import { createEventDispatcher } from ' svelte' ;
3
-
4
2
export let value: string ;
5
3
export let name = ' ' ;
6
-
7
- const dispatch = createEventDispatcher ();
8
-
9
- function dispatchEvent(event : Event ) {
10
- dispatch (event .type );
11
- }
12
4
</script >
13
5
14
6
<input
15
7
{name }
16
8
type =" date"
17
9
bind:value
18
- on:change ={ dispatchEvent }
10
+ on:change
19
11
class =" w-full rounded border bg-spek-facade-50 p-1 text-sm outline-none outline-offset-0 focus:outline-spek-primary-400 dark:border-transparent dark:bg-spek-facade-500"
20
12
/>
Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
- import { createEventDispatcher } from ' svelte' ;
3
-
4
2
export let value: string ;
5
3
export let name = ' ' ;
6
-
7
- const dispatch = createEventDispatcher ();
8
-
9
- function dispatchEvent(event : Event ) {
10
- dispatch (event .type );
11
- }
12
4
</script >
13
5
14
6
<input
15
7
{name }
16
8
type =" text"
17
9
bind:value
18
- on:change ={ dispatchEvent }
10
+ on:change
19
11
class =" w-full rounded border bg-spek-facade-50 p-1 text-sm outline-none outline-offset-0 focus:outline-spek-primary-400 dark:border-transparent dark:bg-spek-facade-500"
20
12
/>
You can’t perform that action at this time.
0 commit comments