Skip to content

Commit e969c68

Browse files
committed
Fix motion todo example by removing mwc components
1 parent 51d1318 commit e969c68

File tree

3 files changed

+11
-26
lines changed

3 files changed

+11
-26
lines changed

packages/lit-dev-content/samples/examples/motion-todos/motion-todos.ts

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ import {classMap} from 'lit/directives/class-map.js';
44
import {repeat} from 'lit/directives/repeat.js';
55
import {animate, fadeOut, flyBelow} from '@lit-labs/motion';
66
import {styles} from './styles.js';
7-
import {TextField} from '@material/mwc-textfield';
8-
import {Checkbox} from '@material/mwc-checkbox';
9-
import '@material/mwc-textfield';
10-
import '@material/mwc-button';
11-
import '@material/mwc-checkbox';
12-
import '@material/mwc-formfield';
137

148
const data = [
159
{id: 1, value: 'Go running.', completed: false},
@@ -34,7 +28,7 @@ export class MotionTodos extends LitElement {
3428

3529
@property({type: Array}) data = data;
3630

37-
@query('mwc-textfield') textField!: TextField;
31+
@query('input[type="text"]') textField!: HTMLInputElement;
3832

3933
addItem() {
4034
if (!this.textField.value) {
@@ -91,24 +85,22 @@ export class MotionTodos extends LitElement {
9185
skipInitial: true,
9286
})}
9387
>
94-
<mwc-formfield label="${item.id}. ${item.value}"
95-
><mwc-checkbox
88+
<label>
89+
${item.id}. ${item.value}
90+
<input
9691
type="checkbox"
9792
?checked=${completed}
9893
@change=${(e: Event) =>
99-
this.updateItem(item, (e.target! as Checkbox).checked)}
100-
></mwc-checkbox></mwc-formfield
101-
><button @click=${() => this.removeItem(item)}>
102-
remove_circle_outline
103-
</button>
94+
this.updateItem(item, (e.target! as HTMLInputElement).checked)}
95+
></label><button @click=${() => this.removeItem(item)}>x</button>
10496
</li>`
10597
)}
10698
</ul>
10799
</div>`;
108100
return html`
109-
<mwc-textfield outlined label="Enter a todo..."></mwc-textfield>
101+
<input type="text" placeholder="Enter a todo...">
110102
<div class="controls">
111-
<mwc-button @click=${this.addItem} raised>Add Todo</mwc-button>
103+
<button @click=${this.addItem}>Add Todo</button>
112104
</div>
113105
<div class="lists">${list()} ${list(true)}</div>
114106
`;

packages/lit-dev-content/samples/examples/motion-todos/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"styles.ts": {},
99
"index.html": {},
1010
"package.json": {
11-
"content": "{\n \"dependencies\": {\n \"lit\": \"^3.0.0\",\n \"@lit-labs/motion\": \"^1.0.1\",\n \"@material/mwc-textfield\": \"^0.25.1\",\n \"@material/mwc-checkbox\": \"^0.25.1\",\n \"@material/mwc-button\": \"^0.25.1\",\n \"@material/mwc-formfield\": \"^0.25.1\"\n }\n}",
11+
"content": "{\n \"dependencies\": {\n \"lit\": \"^3.0.0\",\n \"@lit-labs/motion\": \"^1.0.1\",\n }\n}",
1212
"hidden": true
1313
}
1414
},

packages/lit-dev-content/samples/examples/motion-todos/styles.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,11 @@ export const styles = [
66
display: inline-block;
77
outline: none;
88
padding: 8px;
9-
--mdc-theme-primary: #0069c0;
10-
--mdc-theme-secondary: #1b5e20;
11-
--mdc-typography-body2-font-size: 1.1rem;
12-
--mdc-typography-body2-font-weight: 600;
13-
--mdc-checkbox-unchecked-color: black;
149
}
1510
16-
mwc-textfield {
11+
input[type='text'] {
1712
display: block;
1813
margin-top: 16px;
19-
--mdc-shape-small: 12px;
2014
}
2115
2216
.controls {
@@ -54,12 +48,11 @@ export const styles = [
5448
border: none;
5549
background: none;
5650
outline: none;
57-
font-family: 'Material Icons';
5851
font-size: 24px;
5952
cursor: pointer;
6053
}
6154
62-
li > mwc-formfield {
55+
li > label {
6356
flex: 1;
6457
}
6558

0 commit comments

Comments
 (0)