Sha256: ca70b3fb2adbe8bee34ea07269eb41641813152113586434e425f5cba2297998

Contents?: true

Size: 1.53 KB

Versions: 155

Compression:

Stored size: 1.53 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'),
    globalProps(props),
    className
  )

  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

155 entries across 155 versions & 1 rubygems

Version Path
playbook_ui-9.9.0.alpha.inline1 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-9.9.0 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-9.8.0 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-9.7.0.pre.alphawidth1 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-9.7.0.pre.alpha.a11y.btn app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-9.7.0 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-9.6.1 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-9.6.1.pre.deps1 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-9.6.0 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-9.5.0.alpha.rs.downgrade app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-9.5.0 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-9.4.0.alpha.sisense app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-9.4.0.alpha.user.kit.bug app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-9.4.0 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-9.3.1.pre.alpha2 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-9.4.0.pre.alpha2 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-9.4.0.pre.alpha1 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-9.3.1.pre.alpha1 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-9.3.0.alpha.inline3 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
playbook_ui-9.3.0.pre.alpha.password.strength.2 app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx