-
-
Notifications
You must be signed in to change notification settings - Fork 282
Expand file tree
/
Copy path_Solo.svelte
More file actions
80 lines (73 loc) · 1.66 KB
/
_Solo.svelte
File metadata and controls
80 lines (73 loc) · 1.66 KB
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
<div class="solo-demo-container solo-container">
<Paper class="solo-paper" elevation={6}>
<Icon class="material-icons">search</Icon>
<Input
bind:value
onkeydown={handleKeyDown}
placeholder="Search"
class="solo-input"
/>
</Paper>
<Fab
onclick={doSearch}
disabled={value === ''}
color="primary"
mini
class="solo-fab"
>
<Icon class="material-icons">arrow_forward</Icon>
</Fab>
</div>
<pre class="status">Value: {value}</pre>
<script lang="ts">
import { Input } from '@smui/textfield';
import Paper from '@smui/paper';
import Fab from '@smui/fab';
import { Icon } from '@smui/common';
let value = $state('');
function doSearch() {
alert('Search for ' + value);
}
function handleKeyDown(event: KeyboardEvent) {
if (event.key === 'Enter') {
doSearch();
}
}
</script>
<style>
.solo-demo-container {
padding: 36px 18px;
background-color: var(--mdc-theme-background, #f8f8f8);
border: 1px solid
var(--mdc-theme-text-hint-on-background, rgba(0, 0, 0, 0.1));
}
.solo-container {
display: flex;
justify-content: center;
align-items: center;
}
* :global(.solo-paper) {
display: flex;
align-items: center;
flex-grow: 1;
max-width: 600px;
margin: 0 12px;
padding: 0 12px;
height: 48px;
}
* :global(.solo-paper > *) {
display: inline-block;
margin: 0 12px;
}
* :global(.solo-input) {
flex-grow: 1;
color: var(--mdc-theme-on-surface, #000);
}
* :global(.solo-input::placeholder) {
color: var(--mdc-theme-on-surface, #000);
opacity: 0.6;
}
* :global(.solo-fab) {
flex-shrink: 0;
}
</style>