Sha256: d58db01688f371eccfc397a7463a625908e878bc1d7594a86e1d1c208943909f

Contents?: true

Size: 1.71 KB

Versions: 10

Compression:

Stored size: 1.71 KB

Contents

import React from 'react'
import classnames from 'classnames'

import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
import { globalProps, globalInlineProps } from '../utilities/globalProps'

import Caption from '../pb_caption/_caption'

type SectionSeparatorProps = {
  aria?: { [key: string]: string; },
  children?: React.ReactChild[] | React.ReactChild,
  className?: string,
  dark?: boolean,
  data?: { [key: string]: string; },
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
  id?: string,
  lineStyle?: "solid" | "dashed",
  orientation?: "horizontal" | "vertical",
  text?: string,
  variant?: "card" | "background",
}

const SectionSeparator = (props: SectionSeparatorProps): React.ReactElement => {
  const {
    aria = {},
    children,
    className,
    data = {},
    htmlOptions = {},
    id,
    lineStyle = 'solid',
    orientation = 'horizontal',
    text,
    dark = false,
    variant = 'card',
  } = props
  const ariaProps = buildAriaProps(aria)
  const dataProps = buildDataProps(data)
  const htmlProps = buildHtmlProps(htmlOptions)
  const classes = classnames(buildCss('pb_section_separator_kit', variant, orientation, lineStyle === "dashed" ? lineStyle : ""), globalProps(props), className)
  const dynamicInlineProps = globalInlineProps(props)

  return (

    <div
        {...ariaProps}
        {...dataProps}
        {...htmlProps}
        className={classes}
        id={id}
        style={dynamicInlineProps}
    >
      {
        children && children ||
        text && (
          <span>
            <Caption dark={dark}
                text={text}
            />
          </span>
        )
      }
    </div>
  )
}

export default SectionSeparator

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
playbook_ui-14.9.0.pre.alpha.pbntr700newresettodefaultprop4736 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.10.0.pre.rc.0 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.9.0 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.9.0.pre.rc.18 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.9.0.pre.rc.17 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.9.0.pre.rc.16 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.9.0.pre.rc.15 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.9.0.pre.rc.14 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.9.0.pre.rc.13 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.8.0.pre.alpha.PLAY1649rolloutheightglobalprops4635 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx