UNPKG

@wordpress/components

Version:
1 lines • 1.46 kB
{"version":3,"file":"component.cjs","names":["useCardDivider","Divider","contextConnect"],"sources":["../../../src/card/card-divider/component.tsx"],"sourcesContent":["import type { ForwardedRef } from 'react';\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect } from '../../context';\nimport type { DividerProps } from '../../divider';\nimport { Divider } from '../../divider';\nimport { useCardDivider } from './hook';\n\nfunction UnconnectedCardDivider(\n\tprops: WordPressComponentProps< DividerProps, 'hr', false >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst dividerProps = useCardDivider( props );\n\n\treturn <Divider { ...dividerProps } ref={ forwardedRef } />;\n}\n\n/**\n * `CardDivider` renders an optional divider within a `Card`.\n * It is typically used to divide multiple `CardBody` components from each other.\n *\n * ```jsx\n * import { Card, CardBody, CardDivider } from `@wordpress/components`;\n *\n * <Card>\n * <CardBody>...</CardBody>\n * <CardDivider />\n * <CardBody>...</CardBody>\n * </Card>\n * ```\n */\nexport const CardDivider = contextConnect(\n\tUnconnectedCardDivider,\n\t'CardDivider'\n);\n\nexport default CardDivider;\n"],"mappings":";;;;;;;;;;AAOA,SAAS,uBACR,OACA,cACC;CACD,MAAM,gBAAA,GAAeA,UAAAA,eAAAA,CAAgB,KAAM;CAE3C,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,uBAAAA,SAAD;EAAS,GAAK;EAAe,KAAM;CAAgB,CAAA;AAC3D;;;;;;;;;;;;;;;AAgBA,MAAa,eAAA,GAAcC,uBAAAA,eAAAA,CAC1B,wBACA,aACD"}