Skip to content

Commit

Permalink
chore(buttons): update prop descriptions (#953)
Browse files Browse the repository at this point in the history
Co-authored-by: Mikaela <mikaela.gurney@zendesk.com>
  • Loading branch information
Mikaelia and mikaelagurney authored Dec 15, 2020
1 parent 96b174e commit c46923f
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 18 deletions.
8 changes: 4 additions & 4 deletions packages/buttons/src/elements/Anchor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import PropTypes from 'prop-types';
import { StyledAnchor, StyledExternalIcon } from '../styled';

export interface IAnchorProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
/** Apply danger styling */
/** Applies danger styling */
isDanger?: boolean;
/**
* Used when the anchor navigates to an external resource. Applies `target="_blank"`
* along with `rel="noopener noreferrer"` to ensure safe
* [cross-origin destination links](https://web.dev/external-anchors-use-rel-noopener/).
* Attaches `target="_blank"` and `rel="noopener noreferrer"` to an anchor that
* navigates to an external resource. This ensures ensures that the anchor is a
* safe [cross-origin destination link](https://web.dev/external-anchors-use-rel-noopener/).
**/
isExternal?: boolean;
}
Expand Down
7 changes: 4 additions & 3 deletions packages/buttons/src/elements/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@ import { useButtonGroupContext } from '../utils/useButtonGroupContext';
import { useSplitButtonContext } from '../utils/useSplitButtonContext';

export interface IButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
/** Apply danger styling */
/** Applies danger styling */
isDanger?: boolean;
/** Specifies the buton size */
size?: 'small' | 'medium' | 'large';
/** Stretch the button to its container width */
/** Stretches the button fill to its container width */
isStretched?: boolean;
/** Applies primary button styling */
isPrimary?: boolean;
/** Applies basic button styling */
isBasic?: boolean;
/** Applies link (anchor) button styling */
isLink?: boolean;
/** Applies pill styling */
/** Applies pill button styling */
isPill?: boolean;
/** Applies inset `box-shadow` styling on focus */
focusInset?: boolean;
Expand Down
8 changes: 7 additions & 1 deletion packages/buttons/src/elements/ButtonGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,18 @@ import { StyledButtonGroup } from '../styled';
import { ButtonGroupContext } from '../utils/useButtonGroupContext';

export interface IButtonGroupProps extends HTMLAttributes<HTMLDivElement> {
/** Defines the currently selected button in the group */
selectedItem?: any;
/**
* Handles button selection
*
* @param {any} item The selected item
*/
onSelect?: (item: any) => void;
}

/**
* High-level abstraction for basic ButtonGroup implementations.
* High-level abstraction for basic ButtonGroup implementations
*/
const ButtonGroup: React.FunctionComponent<IButtonGroupProps> = ({
children,
Expand Down
5 changes: 3 additions & 2 deletions packages/buttons/src/elements/IconButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ import { useSplitButtonContext } from '../utils/useSplitButtonContext';
export interface IIconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
/** Applies primary button styling */
isPrimary?: boolean;
/** Apply danger styling */
/** Applies danger button styling */
isDanger?: boolean;
/** Applies basic button styling */
isBasic?: boolean;
/** Applies pill styling */
/** Applies pill button styling */
isPill?: boolean;
/** Applies inset `box-shadow` styling on focus */
focusInset?: boolean;
/** Rotates icon 180 degrees */
isRotated?: boolean;
/** Specifies icon button size */
size?: 'small' | 'medium' | 'large';
}

Expand Down
7 changes: 3 additions & 4 deletions packages/buttons/src/elements/ToggleButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@ import Button, { IButtonProps } from './Button';

export interface IToggleButtonProps extends IButtonProps {
/**
* Determine if the button is pressed or not. Use `'mixed'` to indicate
* whether the toggle controls other elements which do not share the same
* value.
* Determines if the button is pressed. Use "mixed" to indicate that
* the toggle controls other elements which do not share the same value.
*/
isPressed?: boolean | 'mixed';
}

/**
* A `Button` with the [ARIA
* attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/button_role#Toggle_buttons)
* to indicate a pressed state.
* to indicate a pressed state
*/
const ToggleButton: React.FunctionComponent<
IToggleButtonProps & React.RefAttributes<HTMLButtonElement>
Expand Down
7 changes: 3 additions & 4 deletions packages/buttons/src/elements/ToggleIconButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@ import IconButton, { IIconButtonProps } from './IconButton';

export interface IToggleIconButtonProps extends IIconButtonProps {
/**
* Determine if the icon button is pressed or not. Use `'mixed'` to indicate
* whether the toggle controls other elements which do not share the same
* value.
* Determines if the button is pressed. Use "mixed" to indicate that the
* toggle controls other elements which do not share the same value.
*/
isPressed?: boolean | 'mixed';
}

/**
* A `IconButton` with the [ARIA
* attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/button_role#Toggle_buttons)
* to indicate a pressed state.
* to indicate a pressed state
*/
const ToggleIconButton: React.FunctionComponent<
IToggleIconButtonProps & React.RefAttributes<HTMLButtonElement>
Expand Down

0 comments on commit c46923f

Please sign in to comment.