Sha256: d2b1a0edcbe4d8340f712e0ea848603753adac8aac00b9b2775239d239c9ad29

Contents?: true

Size: 1.81 KB

Versions: 37

Compression:

Stored size: 1.81 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,
  color?: "default" | "primary",
  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,
    color ="default",
    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 : "", color !== "default" ? `color_${color}` : ''), 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

37 entries across 37 versions & 1 rubygems

Version Path
playbook_ui-14.10.0.pre.alpha.play1465attempt25272 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.10.0.pre.alpha.play16825244 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.11.0.pre.rc.11 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.11.0.pre.rc.10 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.10.0.pre.alpha.play1662cssbargraph5214 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.10.0.pre.alpha.play1662cssbargraph5213 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.10.0.pre.alpha.play1662cssbargraph5210 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.10.0.pre.alpha.play1662cssbargraph5208 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.10.0.pre.alpha.play1662cssbargraph5207 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.10.0.pre.alpha.play16825206 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.10.0.pre.alpha.play1662cssbargraph5204 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.10.0.pre.alpha.play1662cssbargraph5201 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.11.0.pre.rc.9 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.10.0.pre.alpha.play1662cssbargraph5200 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.11.0.pre.rc.8 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.11.0.pre.rc.7 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.11.0.pre.rc.6 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx