Sha256: 46b1e95bd92fe8d7b60d821c9a96bddcc4b0d4001b8ff954b6fcfecad62bcaec
Contents?: true
Size: 1.1 KB
Versions: 1
Compression:
Stored size: 1.1 KB
Contents
/* @flow */ import React from 'react' import classnames from 'classnames' import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props' import { globalProps } from '../utilities/globalProps.js' type CaptionProps = { aria?: object, className?: String, children: Array<React.ReactNode> | React.ReactNode, dark?: Boolean, data?: object, id?: String, size?: "xs" | "sm" | "md" | "lg" | "xl", tag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "div", text?: String, } const Caption = (props: CaptionProps) => { const { aria = {}, className, children, dark = false, data = {}, id, size = 'md', tag = 'div', text, } = props const Tag = `${tag}` const ariaProps = buildAriaProps(aria) const dataProps = buildDataProps(data) const css = classnames( buildCss('pb_caption_kit', size, { dark: dark, }), className, globalProps(props) ) return ( <Tag {...ariaProps} {...dataProps} className={css} id={id} > {text || children} </Tag> ) } export default Caption
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
playbook_ui-6.0.1.pre.alpha6 | app/pb_kits/playbook/pb_caption/_caption.jsx |