Open History to see the last commit
1import { html } from 'lit'
2import { textField } from './text-field'
3import type { LitFormType } from '@tanstack/lit-form'
4import type { peopleFormOptions } from './shared-form'
5β
6export function addressFields(form: LitFormType<typeof peopleFormOptions>) {
7 return html`
8 <section>
9 <h2>Address</h2>
10 ${form.field({ name: 'address.line1' }, (field) =>
11 textField(field, 'Address Line 1'),
12 )}
13 ${form.field({ name: 'address.line2' }, (field) =>
14 textField(field, 'Address Line 2'),
15 )}
16 ${form.field({ name: 'address.city' }, (field) =>
17 textField(field, 'City'),
18 )}
19 ${form.field({ name: 'address.state' }, (field) =>
20 textField(field, 'State'),
21 )}
22 ${form.field({ name: 'address.zip' }, (field) =>
23 textField(field, 'ZIP Code'),
24 )}
25 </section>
26 `
27}