Sha256: 0b6ff49a3b3a054a10b6db5d2aac85eca11b162e0e1a1a72d139a642466677c0

Contents?: true

Size: 921 Bytes

Versions: 44

Compression:

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

44 entries across 44 versions & 1 rubygems

Version Path
playbook_ui-7.0.0 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.0.0.pre.alpha11 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-6.8.1 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-6.8.0 app/pb_kits/playbook/pb_image/_image.jsx