Sha256: 7ab21c81d05d9d9f415ab435c653e211bff94ad7dea1fe356ed857f3cbb2f05f

Contents?: true

Size: 1.51 KB

Versions: 37

Compression:

Stored size: 1.51 KB

Contents

/* @flow */

import React from 'react'
import classnames from 'classnames'
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
import { Button, Icon } from '../'

import type { Callback } from '../types'

import {
  noop,
} from '../utilities/props'

import { globalProps } from '../utilities/globalProps.js'

type CircleIconButtonProps = {
  aria?: object,
  className?: string,
  dark?: boolean,
  data?: object,
  disabled?: boolean,
  icon: string,
  id?: string,
  link?: string,
  onClick?: Callback,
  newWindow?: boolean,
  type?: 'button' | 'submit' | 'reset',
  variant?: 'primary' | 'secondary' | 'link',
}

const CircleIconButton = (props: CircleIconButtonProps) => {
  const {
    aria = {},
    className,
    dark,
    data = {},
    disabled,
    icon,
    id,
    onClick = noop,
    type,
    link,
    newWindow,
    variant,
  } = props

  const ariaProps = buildAriaProps(aria)
  const dataProps = buildDataProps(data)
  const classes = classnames(buildCss('pb_circle_icon_button_kit'), className, globalProps(props))

  return (
    <div
        {...ariaProps}
        {...dataProps}
        className={classes}
        id={id}
    >
      <Button
          dark={dark}
          disabled={disabled}
          link={link}
          newWindow={newWindow}
          onClick={onClick}
          text={null}
          type={type}
          variant={variant}
      >
        <Icon
            fixedWidth
            icon={icon}
        />
      </Button>
    </div>
  )
}

export default CircleIconButton

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
playbook_ui-7.3.0.pre.alpha2 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-6.7.0.pre.alpha1 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-6.7.0 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-6.6.1 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-7.0.0.pre.alpha10 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-6.6.0 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-6.5.2 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-7.0.1.pre.alpha12 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-7.0.1.pre.alpha11 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-7.0.1.pre.alpha10 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-7.0.1.pre.alpha9 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-6.5.1 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-6.5.0 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-7.0.1.pre.alpha8 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-7.0.1.pre.alpha7 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-7.0.1.pre.alpha6 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-7.0.1.pre.alpha5 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-7.0.1.pre.alpha4 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-7.0.1.pre.alpha3 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-7.0.1.pre.alpha2 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx