Skip to content

File tree

1 file changed

+63
-3
lines changed

1 file changed

+63
-3
lines changed

src/jsx/intrinsic-elements.ts

+63-3
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ export namespace JSX {
347347
datetime?: string | undefined
348348
}
349349

350-
type HTMLInputTypeAttribute =
350+
type HTMLInputTypeAttribute = StringLiteralUnion<
351351
| 'button'
352352
| 'checkbox'
353353
| 'color'
@@ -370,12 +370,72 @@ export namespace JSX {
370370
| 'time'
371371
| 'url'
372372
| 'week'
373-
| string
373+
>
374+
type AutoFillAddressKind = 'billing' | 'shipping'
375+
type AutoFillBase = '' | 'off' | 'on'
376+
type AutoFillContactField =
377+
| 'email'
378+
| 'tel'
379+
| 'tel-area-code'
380+
| 'tel-country-code'
381+
| 'tel-extension'
382+
| 'tel-local'
383+
| 'tel-local-prefix'
384+
| 'tel-local-suffix'
385+
| 'tel-national'
386+
type AutoFillContactKind = 'home' | 'mobile' | 'work'
387+
type AutoFillCredentialField = 'webauthn'
388+
type AutoFillNormalField =
389+
| 'additional-name'
390+
| 'address-level1'
391+
| 'address-level2'
392+
| 'address-level3'
393+
| 'address-level4'
394+
| 'address-line1'
395+
| 'address-line2'
396+
| 'address-line3'
397+
| 'bday-day'
398+
| 'bday-month'
399+
| 'bday-year'
400+
| 'cc-csc'
401+
| 'cc-exp'
402+
| 'cc-exp-month'
403+
| 'cc-exp-year'
404+
| 'cc-family-name'
405+
| 'cc-given-name'
406+
| 'cc-name'
407+
| 'cc-number'
408+
| 'cc-type'
409+
| 'country'
410+
| 'country-name'
411+
| 'current-password'
412+
| 'family-name'
413+
| 'given-name'
414+
| 'honorific-prefix'
415+
| 'honorific-suffix'
416+
| 'name'
417+
| 'new-password'
418+
| 'one-time-code'
419+
| 'organization'
420+
| 'postal-code'
421+
| 'street-address'
422+
| 'transaction-amount'
423+
| 'transaction-currency'
424+
| 'username'
425+
type OptionalPrefixToken<T extends string> = `${T} ` | ''
426+
type OptionalPostfixToken<T extends string> = ` ${T}` | ''
427+
type AutoFillField =
428+
| AutoFillNormalField
429+
| `${OptionalPrefixToken<AutoFillContactKind>}${AutoFillContactField}`
430+
type AutoFillSection = `section-${string}`
431+
type AutoFill =
432+
| AutoFillBase
433+
| `${OptionalPrefixToken<AutoFillSection>}${OptionalPrefixToken<AutoFillAddressKind>}${AutoFillField}${OptionalPostfixToken<AutoFillCredentialField>}`
374434

375435
interface InputHTMLAttributes extends HTMLAttributes {
376436
accept?: string | undefined
377437
alt?: string | undefined
378-
autocomplete?: string | undefined
438+
autocomplete?: StringLiteralUnion<AutoFill> | undefined
379439
capture?: boolean | 'user' | 'environment' | undefined // https://www.w3.org/TR/html-media-capture/#the-capture-attribute
380440
checked?: boolean | undefined
381441
disabled?: boolean | undefined

0 commit comments

Comments
 (0)