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.11.1.pre.alpha.PLAY1750pbcontenttagkitbutton5341 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.11.1.pre.alpha.PLAY1750pbcontenttagkitbutton5340 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.11.1.pre.alpha.PLAY1750pbcontenttagkitbutton5339 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.12.0.pre.rc.3 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.12.0.pre.rc.2 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.12.0.pre.rc.1 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.12.0.pre.rc.0 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.10.0.pre.alpha.PLAY1774timelinelabelstepspacing5315 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.10.0.pre.alpha.PLAY1774timelinelabelstepspacing5314 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.10.0.pre.alpha.PLAY1750pbcontenttagkitbutton5308 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.11.1 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.11.0.pre.rc.17 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.11.0 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.11.0.pre.rc.16 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.10.0.pre.alpha.play16825301 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.11.0.pre.rc.15 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.11.0.pre.rc.14 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.11.0.pre.rc.13 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.11.0.pre.rc.12 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
playbook_ui-14.10.0.pre.alpha.PLAY1774timelinelabelstepspacing5274 app/pb_kits/playbook/pb_section_separator/_section_separator.tsx