Skip to content

Commit

Permalink
feat(ButtonPrimitive): add support for aria-current
Browse files Browse the repository at this point in the history
  • Loading branch information
silvenon committed Oct 15, 2020
1 parent 9e0b3e2 commit d26067b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
Expand Up @@ -21,6 +21,7 @@ Table below contains all types of the props available in ButtonPrimitive compone
| asComponent | `string \| React.Element` | `"button"` | The component used for the root node. |
| ariaControls | `string` | | Id of the element the button controls. |
| ariaExpanded | `boolean` | | Tells screen reader the controlled element from `ariaControls` is expanded. |
| arialCurrent | `string` | | Indicates whether the element represents the current item within within a container or set of related elements. |
| background | `string` | | The background of the ButtonPrimitive on initial state. |
| backgroundHover | `string` | | The background of the ButtonPrimitive on hover state. |
| backgroundActive | `string` | | The background of the ButtonPrimitive on active state. |
Expand Down
Expand Up @@ -9,6 +9,7 @@ type functionReturningString = () => string;
export interface ButtonCommonProps extends Common.Global, Common.Ref, Common.SpaceAfter {
readonly asComponent?: Common.Component;
readonly ariaControls?: string;
readonly ariaCurrent?: string;
readonly ariaExpanded?: boolean;
readonly ariaLabelledby?: string;
readonly children?: React.ReactNode;
Expand Down
Expand Up @@ -30,6 +30,7 @@ export const StyledButtonPrimitive = styled(
ariaControls,
ariaExpanded,
ariaLabelledby,
ariaCurrent,
title,
className,
rel,
Expand Down Expand Up @@ -60,6 +61,7 @@ export const StyledButtonPrimitive = styled(
ref={forwardedRef}
data-test={dataTest}
aria-controls={ariaControls}
aria-current={ariaCurrent}
aria-expanded={ariaExpanded}
aria-label={title}
aria-labelledby={ariaLabelledby}
Expand Down
Expand Up @@ -16,6 +16,7 @@ export type Size = "small" | "normal" | "large";
export type ButtonCommonProps = {|
+asComponent?: Component,
+ariaControls?: string,
+ariaCurrent?: string,
+ariaExpanded?: boolean,
+ariaLabelledby?: string,
+children?: React.Node,
Expand Down

0 comments on commit d26067b

Please sign in to comment.