Sha256: 20aa3652720642c309e2925f86256ef4f4695adf9692c6ec041448bd90ba9052

Contents?: true

Size: 905 Bytes

Versions: 37

Compression:

Stored size: 905 Bytes

Contents

/* @flow */

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

type ImageProps = {
  alt?: string,
  aria?: object,
  className?: string,
  data?: object,
  id?: string,
  url: string,
}

const Image = (props: ImageProps) => {
  const {
    alt = '',
    aria = {},
    className,
    data = {},
    id,
    url = '',
  } = props

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

  return (
    <div>
      <img
          {...ariaProps}
          {...dataProps}
          alt={alt}
          className={classes}
          data-src={url}
          id={id}
          src={url}
      />
    </div>
  )
}

export default Image

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
playbook_ui-6.4.2 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.0.1.pre.alpha1 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.0.0.pre.alpha9 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.0.0.pre.alpha8 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.0.0.pre.alpha7 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-6.4.1 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.0.0.pre.alpha6 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.0.0.pre.alpha5 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-6.4.0 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-6.3.1 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.0.0.pre.alpha4 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.0.0.pre.alpha3 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.0.0.pre.alpha2 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-6.3.0 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-6.2.1 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-6.2.0 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.0.0.pre.alpha1 app/pb_kits/playbook/pb_image/_image.jsx