-
-
Notifications
You must be signed in to change notification settings - Fork 284
/
_ShapedOutlined.svelte
96 lines (89 loc) · 2.18 KB
/
_ShapedOutlined.svelte
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<div class="columns margins">
<div>
<Textfield
class="shaped-outlined"
variant="outlined"
bind:value={valueA}
label="Label"
>
<HelperText slot="helper">Helper Text</HelperText>
</Textfield>
<pre class="status">Value: {valueA}</pre>
</div>
<div>
<Textfield
class="shaped-outlined"
variant="outlined"
bind:value={valueB}
label="Leading Icon"
>
<Icon class="material-icons" slot="leadingIcon">event</Icon>
<HelperText slot="helper">Helper Text</HelperText>
</Textfield>
<pre class="status">Value: {valueB}</pre>
</div>
<div>
<Textfield
class="shaped-outlined"
variant="outlined"
bind:value={valueC}
label="Trailing Icon"
>
<Icon class="material-icons" slot="trailingIcon">delete</Icon>
<HelperText slot="helper">Helper Text</HelperText>
</Textfield>
<pre class="status">Value: {valueC}</pre>
</div>
<div>
<Textfield
class="shaped-outlined"
variant="outlined"
invalid
bind:value={valueD}
label="Invalid"
>
<HelperText slot="helper">Helper Text</HelperText>
</Textfield>
<pre class="status">Value: {valueD}</pre>
</div>
</div>
<script lang="ts">
import Textfield from '@smui/textfield';
import Icon from '@smui/textfield/icon';
import HelperText from '@smui/textfield/helper-text';
let valueA = '';
let valueB = '';
let valueC = '';
let valueD = '';
</script>
<style>
*
:global(
.shaped-outlined .mdc-notched-outline .mdc-notched-outline__leading
) {
border-radius: 28px 0 0 28px;
width: 28px;
}
*
:global(
.shaped-outlined .mdc-notched-outline .mdc-notched-outline__trailing
) {
border-radius: 0 28px 28px 0;
}
* :global(.shaped-outlined .mdc-notched-outline .mdc-notched-outline__notch) {
max-width: calc(100% - 28px * 2);
}
*
:global(
.shaped-outlined.mdc-text-field--with-leading-icon:not(
.mdc-text-field--label-floating
)
.mdc-floating-label
) {
left: 16px;
}
* :global(.shaped-outlined + .mdc-text-field-helper-line) {
padding-left: 32px;
padding-right: 28px;
}
</style>