Sha256: 9f3b3eac70337140577c9f1af116ae134c9f919c37dfcba4c05b7e1c9b781aec
Contents?: true
Size: 1.04 KB
Versions: 13
Compression:
Stored size: 1.04 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, 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, 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), className, globalProps(props) ) return ( <Tag {...ariaProps} {...dataProps} className={css} id={id} > {text || children} </Tag> ) } export default Caption
Version data entries
13 entries across 13 versions & 1 rubygems