Skip to content

Commit

Permalink
button types
Browse files Browse the repository at this point in the history
  • Loading branch information
bevacqua committed Oct 25, 2017
1 parent daa1bc2 commit f8e93e9
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/components/button/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const EuiButton = ({
size,
fill,
isDisabled,
buttonType = 'button',
...rest,
}) => {

Expand Down Expand Up @@ -73,6 +74,7 @@ export const EuiButton = ({
<button
disabled={isDisabled}
className={classes}
type={buttonType}
{...rest}
>
<span className="euiButton__content">
Expand Down
2 changes: 2 additions & 0 deletions src/components/button/button_empty/button_empty.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export const EuiButtonEmpty = ({
size,
flush,
isDisabled,
buttonType = 'button',
...rest,
}) => {

Expand Down Expand Up @@ -77,6 +78,7 @@ export const EuiButtonEmpty = ({
<button
disabled={isDisabled}
className={classes}
type={buttonType}
{...rest}
>
<span className="euiButtonEmpty__content">
Expand Down
2 changes: 2 additions & 0 deletions src/components/button/button_icon/button_icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const EuiButtonIcon = ({
iconType,
type,
isDisabled,
buttonType = 'button',
...rest,
}) => {

Expand Down Expand Up @@ -49,6 +50,7 @@ export const EuiButtonIcon = ({
<button
disabled={isDisabled}
className={classes}
type={buttonType}
{...rest}
>
{buttonIcon}
Expand Down
1 change: 1 addition & 0 deletions src/components/context_menu/context_menu_item.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const EuiContextMenuItem = ({
return (
<button
className={classes}
type="button"
{...rest}
>
<span className="euiContextMenu__itemLayout">
Expand Down
1 change: 1 addition & 0 deletions src/components/context_menu/context_menu_panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const EuiContextMenuPanel = ({
panelTitle = (
<button
className="euiContextMenuPanelTitle"
type="button"
onClick={onClose}
>
<span className="euiContextMenu__itemLayout">
Expand Down
1 change: 1 addition & 0 deletions src/components/expression/expression_item_button.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const EuiExpressionItemButton = ({
return (
<button
className={classes}
type="button"
onClick={onClick}
{...rest}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@ import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';

export const EuiHeaderSectionItemButton = ({ onClick, children, className, ...rest }) => {
export const EuiHeaderSectionItemButton = ({
onClick,
children,
className,
...rest
}) => {
const classes = classNames('euiHeaderSectionItem__button', className);

return (
<button
className={classes}
onClick={onClick}
type="button"
{...rest}
>
{children}
Expand Down
1 change: 1 addition & 0 deletions src/components/key_pad_menu/key_pad_menu_item.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const EuiKeyPadMenuItemButton = ({ onClick, label, children, className, .

return (
<button
type="button"
onClick={onClick}
className={classes}
{...rest}
Expand Down
4 changes: 3 additions & 1 deletion src/components/link/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ const colorsToClassNameMap = {

export const COLORS = Object.keys(colorsToClassNameMap);

export const EuiLink = ({ children, color, className, onClick, ...rest }) => {
export const EuiLink = ({
children, buttonType = 'button', color, className, onClick, ...rest }) => {
const classes = classNames('euiLink', colorsToClassNameMap[color], className);

let link;
if (onClick) {
link = (
<button
type={buttonType}
className={classes}
onClick={onClick}
{...rest}
Expand Down
1 change: 1 addition & 0 deletions src/components/side_nav/side_nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const EuiSideNav = ({
>
{/* Hidden from view, except in mobile */}
<button
type="button"
className="euiSideNav__mobileToggle euiLink"
onClick={toggleOpenOnMobile}
>
Expand Down
1 change: 1 addition & 0 deletions src/components/table/table_header_button.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const EuiTableHeaderButton = ({

return (
<button
type="button"
className={classes}
{...rest}
>
Expand Down
1 change: 1 addition & 0 deletions src/components/table/table_header_cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const EuiTableHeaderCell = ({
{...rest}
>
<button
type="button"
className={buttonClasses}
onClick={onSort}
aria-label={statefulAriaLabel}
Expand Down
1 change: 1 addition & 0 deletions src/components/tabs/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const EuiTab = ({ isSelected, onClick, children, className, ...rest }) =>

return (
<button
type="button"
className={classes}
onClick={onClick}
{...rest}
Expand Down
1 change: 1 addition & 0 deletions src/components/toast/toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const EuiToast = ({ title, type, iconType, onClose, children, className,
if (onClose) {
closeButton = (
<button
type="button"
className="euiToast__closeButton"
aria-label="Dismiss toast"
onClick={onClose}
Expand Down

0 comments on commit f8e93e9

Please sign in to comment.