Sha256: 7b7a94a5b66c3dde95d1260c63390110106fcd760b5307e1a1cc3fd304143309

Contents?: true

Size: 1.52 KB

Versions: 15

Compression:

Stored size: 1.52 KB

Contents

/* @flow */

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

type NavProps = {
  aria?: object,
  children?: React.Node,
  className?: string | array<string>,
  data?: object,
  highlight?: boolean,
  id?: string,
  onClick?: EventHandler,
  orientation?: "vertical" | "horizontal",
  link: SVGFESpecularLightingElement,
  title: string,
  variant?: "normal" | "subtle",
}
const Nav = (props: NavProps) => {
  const {
    aria = {},
    children,
    className,
    data = {},
    highlight = true,
    id,
    link = '#',
    onClick = () => {},
    orientation = 'vertical',
    title = '',
    variant = 'normal',
  } = props

  const ariaProps = buildAriaProps(aria)
  const dataProps = buildDataProps(data)
  const cardCss = classnames(buildCss('pb_nav_list', variant, orientation, {
    highlight: highlight }, className, globalProps(props)))

  return (
    <div
        {...ariaProps}
        {...dataProps}
        className={cardCss}
        id={id}
    >
      <If condition={title}>
        <div className="pb_nav_list_title">
          <a
              className="pb_nav_list_item_link_text"
              href={link}
              onClick={onClick}
          >
            <Caption
                size="md"
                text={`${title}`}
            />
          </a>
        </div>
      </If>
      <ul>{children}</ul>
    </div>
  )
}

export default Nav

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
playbook_ui-7.0.1.pre.alpha8 app/pb_kits/playbook/pb_nav/_nav.jsx
playbook_ui-7.0.1.pre.alpha7 app/pb_kits/playbook/pb_nav/_nav.jsx
playbook_ui-7.0.1.pre.alpha6 app/pb_kits/playbook/pb_nav/_nav.jsx
playbook_ui-7.0.1.pre.alpha5 app/pb_kits/playbook/pb_nav/_nav.jsx
playbook_ui-7.0.1.pre.alpha4 app/pb_kits/playbook/pb_nav/_nav.jsx
playbook_ui-7.0.1.pre.alpha3 app/pb_kits/playbook/pb_nav/_nav.jsx
playbook_ui-7.0.1.pre.alpha2 app/pb_kits/playbook/pb_nav/_nav.jsx
playbook_ui-7.0.1.pre.alpha1 app/pb_kits/playbook/pb_nav/_nav.jsx
playbook_ui-7.0.0.pre.alpha7 app/pb_kits/playbook/pb_nav/_nav.jsx
playbook_ui-7.0.0.pre.alpha6 app/pb_kits/playbook/pb_nav/_nav.jsx
playbook_ui-7.0.0.pre.alpha5 app/pb_kits/playbook/pb_nav/_nav.jsx
playbook_ui-7.0.0.pre.alpha4 app/pb_kits/playbook/pb_nav/_nav.jsx
playbook_ui-7.0.0.pre.alpha3 app/pb_kits/playbook/pb_nav/_nav.jsx
playbook_ui-7.0.0.pre.alpha2 app/pb_kits/playbook/pb_nav/_nav.jsx
playbook_ui-6.3.0 app/pb_kits/playbook/pb_nav/_nav.jsx