mirror of https://github.com/vector-im/riot-web
parent
8c2286a044
commit
eb05c86e50
|
@ -20,7 +20,6 @@ import React from "react";
|
|||
|
||||
interface IProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
label: string;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
// Semantic component for representing a role=group for grouping menu radios/checkboxes
|
||||
|
|
|
@ -18,12 +18,10 @@ limitations under the License.
|
|||
|
||||
import React from "react";
|
||||
|
||||
import AccessibleButton, {ButtonEvent, IProps as IAccessibleButtonProps} from "../../components/views/elements/AccessibleButton";
|
||||
import AccessibleButton from "../../components/views/elements/AccessibleButton";
|
||||
|
||||
interface IProps extends IAccessibleButtonProps {
|
||||
interface IProps extends React.ComponentProps<typeof AccessibleButton> {
|
||||
label?: string;
|
||||
className?: string;
|
||||
onClick(ev: ButtonEvent);
|
||||
}
|
||||
|
||||
// Semantic component for representing a role=menuitem
|
||||
|
@ -34,3 +32,4 @@ export const MenuItem: React.FC<IProps> = ({children, label, ...props}) => {
|
|||
</AccessibleButton>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -18,14 +18,11 @@ limitations under the License.
|
|||
|
||||
import React from "react";
|
||||
|
||||
import AccessibleButton, {ButtonEvent, IProps as IAccessibleButtonProps} from "../../components/views/elements/AccessibleButton";
|
||||
import AccessibleButton from "../../components/views/elements/AccessibleButton";
|
||||
|
||||
interface IProps extends IAccessibleButtonProps {
|
||||
interface IProps extends React.ComponentProps<typeof AccessibleButton> {
|
||||
label?: string;
|
||||
active: boolean;
|
||||
disabled?: boolean;
|
||||
className?: string;
|
||||
onClick(ev: ButtonEvent);
|
||||
}
|
||||
|
||||
// Semantic component for representing a role=menuitemcheckbox
|
||||
|
@ -36,6 +33,7 @@ export const MenuItemCheckbox: React.FC<IProps> = ({children, label, active, dis
|
|||
role="menuitemcheckbox"
|
||||
aria-checked={active}
|
||||
aria-disabled={disabled}
|
||||
disabled={disabled}
|
||||
tabIndex={-1}
|
||||
aria-label={label}
|
||||
>
|
||||
|
|
|
@ -18,14 +18,11 @@ limitations under the License.
|
|||
|
||||
import React from "react";
|
||||
|
||||
import AccessibleButton, {ButtonEvent, IProps as IAccessibleButtonProps} from "../../components/views/elements/AccessibleButton";
|
||||
import AccessibleButton from "../../components/views/elements/AccessibleButton";
|
||||
|
||||
interface IProps extends IAccessibleButtonProps {
|
||||
interface IProps extends React.ComponentProps<typeof AccessibleButton> {
|
||||
label?: string;
|
||||
active: boolean;
|
||||
disabled?: boolean;
|
||||
className?: string;
|
||||
onClick(ev: ButtonEvent);
|
||||
}
|
||||
|
||||
// Semantic component for representing a role=menuitemradio
|
||||
|
@ -36,6 +33,7 @@ export const MenuItemRadio: React.FC<IProps> = ({children, label, active, disabl
|
|||
role="menuitemradio"
|
||||
aria-checked={active}
|
||||
aria-disabled={disabled}
|
||||
disabled={disabled}
|
||||
tabIndex={-1}
|
||||
aria-label={label}
|
||||
>
|
||||
|
|
|
@ -23,7 +23,7 @@ import StyledCheckbox from "../../components/views/elements/StyledCheckbox";
|
|||
|
||||
interface IProps extends React.ComponentProps<typeof StyledCheckbox> {
|
||||
label?: string;
|
||||
onChange();
|
||||
onChange(); // we handle keyup/down ourselves so lose the ChangeEvent
|
||||
onClose(): void; // gets called after onChange on Key.ENTER
|
||||
}
|
||||
|
||||
|
|
|
@ -23,8 +23,7 @@ import StyledRadioButton from "../../components/views/elements/StyledRadioButton
|
|||
|
||||
interface IProps extends React.ComponentProps<typeof StyledRadioButton> {
|
||||
label?: string;
|
||||
disabled?: boolean;
|
||||
onChange(): void;
|
||||
onChange(); // we handle keyup/down ourselves so lose the ChangeEvent
|
||||
onClose(): void; // gets called after onChange on Key.ENTER
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue