Sha256: 765c6b0efc03aea40b2097de909b322184482804b7b74705852b16657f936773

Contents?: true

Size: 883 Bytes

Versions: 77

Compression:

Stored size: 883 Bytes

Contents

/* @flow */

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

type FormGroupProps = {
  aria?: object,
  children?: Node,
  className?: string,
  data?: object,
  fullWidth?: boolean,
  id?: string,
}

const FormGroup = (props: FormGroupProps) => {
  const {
    aria = {},
    className,
    data = {},
    fullWidth = false,
    id,
    children,
  } = props

  const ariaProps = buildAriaProps(aria)
  const dataProps = buildDataProps(data)
  const classes = classnames(buildCss('pb_form_group_kit', { full: fullWidth }), globalProps(props), className)

  return (
    <div
        {...ariaProps}
        {...dataProps}
        className={classes}
        id={id}
    >
      {children}
    </div>
  )
}

export default FormGroup

Version data entries

77 entries across 77 versions & 1 rubygems

Version Path
playbook_ui-10.23.0.pre.cachetest app/pb_kits/playbook/pb_form_group/_form_group.jsx
playbook_ui-10.21.0.pre.alpha.lightbox.2 app/pb_kits/playbook/pb_form_group/_form_group.jsx
playbook_ui-10.21.0.pre.alpha.lightbox app/pb_kits/playbook/pb_form_group/_form_group.jsx
playbook_ui-10.21.0.pre.alpha.rg1 app/pb_kits/playbook/pb_form_group/_form_group.jsx
playbook_ui-10.21.0.pre.alpha.jg1 app/pb_kits/playbook/pb_form_group/_form_group.jsx
playbook_ui-10.21.0.pre.alpha.na1 app/pb_kits/playbook/pb_form_group/_form_group.jsx
playbook_ui-10.21.0.pre.alpha.jd1 app/pb_kits/playbook/pb_form_group/_form_group.jsx
playbook_ui-10.20.0 app/pb_kits/playbook/pb_form_group/_form_group.jsx
playbook_ui-10.19.0 app/pb_kits/playbook/pb_form_group/_form_group.jsx
playbook_ui-10.19.0.pre.lightbox app/pb_kits/playbook/pb_form_group/_form_group.jsx
playbook_ui-10.18.2 app/pb_kits/playbook/pb_form_group/_form_group.jsx
playbook_ui-10.19.0.pre.popover.alpha1 app/pb_kits/playbook/pb_form_group/_form_group.jsx
playbook_ui-10.18.1 app/pb_kits/playbook/pb_form_group/_form_group.jsx
playbook_ui-10.18.0 app/pb_kits/playbook/pb_form_group/_form_group.jsx
playbook_ui-10.17.0 app/pb_kits/playbook/pb_form_group/_form_group.jsx
playbook_ui-10.16.0 app/pb_kits/playbook/pb_form_group/_form_group.jsx
playbook_ui-10.15.1 app/pb_kits/playbook/pb_form_group/_form_group.jsx
playbook_ui-10.15.1.pre.alpha.rubocop.deps app/pb_kits/playbook/pb_form_group/_form_group.jsx
playbook_ui-10.15.0 app/pb_kits/playbook/pb_form_group/_form_group.jsx
playbook_ui-10.14.1.pre.alpha2 app/pb_kits/playbook/pb_form_group/_form_group.jsx