UNPKG

@wordpress/components

Version:
1 lines • 1.17 kB
{"version":3,"file":"component.mjs","names":[],"sources":["../../src/heading/component.tsx"],"sourcesContent":["import type { ForwardedRef } from 'react';\nimport type { WordPressComponentProps } from '../context';\nimport { contextConnect } from '../context';\nimport { View } from '../view';\nimport { useHeading } from './hook';\nimport type { HeadingProps } from './types';\n\nfunction UnconnectedHeading(\n\tprops: WordPressComponentProps< HeadingProps, 'h1' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst headerProps = useHeading( props );\n\n\treturn <View { ...headerProps } ref={ forwardedRef } />;\n}\n\n/**\n * `Heading` renders headings and titles using the library's typography system.\n *\n * ```jsx\n * import { __experimentalHeading as Heading } from \"@wordpress/components\";\n *\n * function Example() {\n * return <Heading>Code is Poetry</Heading>;\n * }\n * ```\n */\nexport const Heading = contextConnect( UnconnectedHeading, 'Heading' );\n\nexport default Heading;\n"],"mappings":";;;;;AAOA,SAAS,mBACR,OACA,cACC;CACD,MAAM,cAAc,WAAY,KAAM;CAEtC,OAAO,oBAAC,MAAD;EAAM,GAAK;EAAc,KAAM;CAAgB,CAAA;AACvD;;;;;;;;;;;;AAaA,MAAa,UAAU,eAAgB,oBAAoB,SAAU"}