-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(types): more accurate form types (#5067)
* fix(types): more accurate form types * WIP * amend
- Loading branch information
Showing
18 changed files
with
105 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
import * as React from 'react'; | ||
|
||
import Collapse, { CollapseProps } from './Collapse'; | ||
import { CollapseProps } from './Collapse'; | ||
|
||
import { BsPrefixComponent } from './helpers'; | ||
import { BsPrefixRefForwardingComponent } from './helpers'; | ||
|
||
export interface AccordionCollapseProps | ||
extends CollapseProps, | ||
React.HTMLAttributes<HTMLDivElement> { | ||
eventKey: string; | ||
} | ||
|
||
declare class AccordionCollapse extends BsPrefixComponent< | ||
typeof Collapse, | ||
AccordionCollapseProps | ||
> {} | ||
declare interface AccordionCollapse | ||
extends BsPrefixRefForwardingComponent<'div', AccordionCollapseProps> {} | ||
declare const AccordionCollapse: AccordionCollapse; | ||
|
||
export default AccordionCollapse; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
import * as React from 'react'; | ||
|
||
import { BsPrefixComponent } from './helpers'; | ||
import { BsPrefixRefForwardingComponent } from './helpers'; | ||
|
||
export interface FormCheckInputProps { | ||
id?: string; | ||
type?: 'checkbox' | 'radio'; | ||
isStatic?: boolean; | ||
isValid?: boolean; | ||
isInvalid?: boolean; | ||
innerRef?: React.LegacyRef<this>; | ||
} | ||
|
||
declare class FormCheckInput< | ||
As extends React.ElementType = 'input' | ||
> extends BsPrefixComponent<As, FormCheckInputProps> {} | ||
declare interface FormCheckInput | ||
extends BsPrefixRefForwardingComponent<'input', FormCheckInputProps> {} | ||
|
||
declare const FormCheckInput: FormCheckInput; | ||
|
||
export default FormCheckInput; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
import * as React from 'react'; | ||
|
||
import { BsPrefixComponent } from './helpers'; | ||
import { BsPrefixRefForwardingComponent } from './helpers'; | ||
|
||
export interface FormCheckLabelProps { | ||
htmlFor?: string; | ||
innerRef?: React.LegacyRef<this>; | ||
} | ||
|
||
declare class FormCheckLabel extends BsPrefixComponent< | ||
'label', | ||
FormCheckLabelProps | ||
> {} | ||
declare interface FormCheckLabel | ||
extends BsPrefixRefForwardingComponent<'label', FormCheckLabelProps> {} | ||
|
||
declare const FormCheckLabel: FormCheckLabel; | ||
|
||
export default FormCheckLabel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
import * as React from 'react'; | ||
import Feedback from './Feedback'; | ||
import { BsPrefixComponent } from './helpers'; | ||
import { BsPrefixRefForwardingComponent } from './helpers'; | ||
|
||
type FormControlElement = | ||
| HTMLInputElement | ||
| HTMLSelectElement | ||
| HTMLTextAreaElement; | ||
|
||
export interface FormControlProps { | ||
innerRef?: React.LegacyRef<FormControlElement>; | ||
size?: 'sm' | 'lg'; | ||
plaintext?: boolean; | ||
readOnly?: boolean; | ||
disabled?: boolean; | ||
value?: string | string[] | number; | ||
onChange?: React.FormEventHandler<FormControlElement>; | ||
onChange?: React.ChangeEventHandler<FormControlElement>; | ||
custom?: boolean; | ||
type?: string; | ||
id?: string; | ||
isValid?: boolean; | ||
isInvalid?: boolean; | ||
} | ||
|
||
declare class FormControl< | ||
As extends React.ElementType = 'input' | ||
> extends BsPrefixComponent<As, FormControlProps> { | ||
static Feedback: typeof Feedback; | ||
declare interface FormControl | ||
extends BsPrefixRefForwardingComponent<'input', FormControlProps> { | ||
Feedback: typeof Feedback; | ||
} | ||
|
||
declare const FormControl: FormControl; | ||
|
||
export default FormControl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
import * as React from 'react'; | ||
|
||
import { BsPrefixComponent } from './helpers'; | ||
import { BsPrefixRefForwardingComponent } from './helpers'; | ||
|
||
export interface FormFileLabelProps { | ||
htmlFor?: string; | ||
} | ||
|
||
declare class FormFileLabel extends BsPrefixComponent< | ||
'label', | ||
FormFileLabelProps | ||
> {} | ||
declare interface FormFileLabel | ||
extends BsPrefixRefForwardingComponent<'label', FormFileLabelProps> {} | ||
|
||
declare const FormFileLabel: FormFileLabel; | ||
|
||
export default FormFileLabel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
import * as React from 'react'; | ||
import { BsPrefixComponent } from './helpers'; | ||
import { BsPrefixRefForwardingComponent } from './helpers'; | ||
|
||
export interface FormGroupProps { | ||
innerRef?: React.LegacyRef<this>; | ||
controlId?: string; | ||
} | ||
|
||
declare class FormGroup< | ||
As extends React.ElementType = 'div' | ||
> extends BsPrefixComponent<As, FormGroupProps> {} | ||
declare interface FormGroup | ||
extends BsPrefixRefForwardingComponent<'div', FormGroupProps> {} | ||
|
||
declare const FormGroup: FormGroup; | ||
export default FormGroup; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
import * as React from 'react'; | ||
|
||
import { BsPrefixComponent } from './helpers'; | ||
import { BsPrefixRefForwardingComponent } from './helpers'; | ||
|
||
export interface FormTextProps { | ||
innerRef?: React.LegacyRef<this>; | ||
muted?: boolean; | ||
} | ||
|
||
declare class FormText< | ||
As extends React.ElementType = 'small' | ||
> extends BsPrefixComponent<As, FormTextProps> {} | ||
declare interface FormText | ||
extends BsPrefixRefForwardingComponent<'small', FormTextProps> {} | ||
|
||
declare const FormText: FormText; | ||
|
||
export default FormText; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.