File tree 2 files changed +18
-7
lines changed 2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 5
5
Partial <{
6
6
selected: boolean ;
7
7
size: ' s' | ' m' ;
8
+ isClickable? : boolean ;
8
9
}>;
9
10
10
11
export let size: $$Props [' size' ] = ' m' ;
11
12
export let selected: $$Props [' selected' ] = false ;
13
+ export let isClickable: $$Props [' isClickable' ] = true ;
12
14
</script >
13
15
14
- <button class:s ={size === ' s' } on:click class:selected type ="button" {...$$restProps }>
15
- <slot />
16
- </button >
16
+ {#if isClickable }
17
+ <button class:s ={size === ' s' } on:click class:selected type ="button" {...$$restProps }>
18
+ <slot />
19
+ </button >
20
+ {:else }
21
+ <div class:s ={size === ' s' } class:selected {...$$restProps }>
22
+ <slot />
23
+ </div >
24
+ {/if }
17
25
18
26
<style lang =" scss" >
19
27
@use ' ../scss/mixins/transitions' ;
20
28
21
- button {
29
+ button ,
30
+ div {
22
31
@include transitions .common ;
23
32
24
33
--p-tag-font-family : var (--badge-font-family , var (--font-family-sansserif ));
47
56
font-weight : 500 ;
48
57
line-height : 140% ;
49
58
50
- cursor : pointer ;
51
-
52
59
& .s {
53
60
--p-tag-padding-block : var (--space-1 );
54
61
--p-tag-padding-inline : var (--space-3 );
70
77
background-color : var (--color-bgcolor-neutral-tertiary );
71
78
}
72
79
}
80
+
81
+ button {
82
+ cursor : pointer ;
83
+ }
73
84
</style >
Original file line number Diff line number Diff line change 18
18
{/if }
19
19
{#if ! hideBadge }
20
20
<div class =" badge" >
21
- <Tag size =" s" >
21
+ <Tag size ="s" isClickable ={ false } >
22
22
{#if state === ' next' }
23
23
Next
24
24
{:else if state === ' current' }
You can’t perform that action at this time.
0 commit comments