File tree Expand file tree Collapse file tree 5 files changed +11
-4
lines changed Expand file tree Collapse file tree 5 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ const useLabel = !!(label || subText || Astro.slots.has('default'))
34
34
<ConditionalWrapper condition ={ useLabel } >
35
35
<label slot =" wrapper" class:list ={ labelClasses } >
36
36
{ label && (
37
- <div class = { styles .label } > { label } </ div >
37
+ <div class = { styles .label } set : html = { label } / >
38
38
)}
39
39
<ConditionalWrapper condition ={ Astro .slots .has (' default' )} >
40
40
<div class ={ styles .wrapper } slot =" wrapper" >
Original file line number Diff line number Diff line change 48
48
>
49
49
<slot />
50
50
<input
51
- {...{ type }}
52
51
class ={classes }
53
52
bind:value
54
53
on:change ={onChange }
55
54
on:keyup ={onKeyUp }
56
55
on:input ={onInput }
57
56
on:click ={onClick }
57
+ {...{ type }}
58
58
{...$$restProps }
59
59
/>
60
60
</ConditionalWrapper >
Original file line number Diff line number Diff line change @@ -38,7 +38,10 @@ const Input = ({
38
38
</ label >
39
39
) } >
40
40
{ label && (
41
- < div className = { styles . label } > { label } </ div >
41
+ < div
42
+ className = { styles . label }
43
+ dangerouslySetInnerHTML = { { __html : label } }
44
+ />
42
45
) }
43
46
< ConditionalWrapper condition = { ! ! children } wrapper = { children => (
44
47
< div className = { styles . wrapper } >
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ const sections = getSections({
98
98
</ComponentWrapper >
99
99
100
100
<ComponentWrapper title = " Input with label" >
101
- <section.component label = " Name " />
101
+ <section.component label = " Average miles driven <b>per week</b> " />
102
102
</ComponentWrapper >
103
103
104
104
<ComponentWrapper title = " Label and sub text" >
Original file line number Diff line number Diff line change 44
44
let radio = ' '
45
45
let toggle = false
46
46
let input = ' '
47
+ let inputBinding = ' '
47
48
let slider = 50
48
49
let wordCount = 0
49
50
let select = ' '
138
139
139
140
<Card title =" Input" >
140
141
<Input
142
+ bind:value ={inputBinding }
141
143
label =" Enter a value"
142
144
placeholder =" Or change the color below"
143
145
onKeyUp ={e => input = e .currentTarget .value }
148
150
onChange ={e => input = e .currentTarget .value }
149
151
/>
150
152
153
+ <p >Binding: {inputBinding }</p >
154
+
151
155
<span class ={styles .span }>{input }</span >
152
156
</Card >
153
157
You can’t perform that action at this time.
0 commit comments