@wordpress/components
Version:
UI components for WordPress.
1 lines • 1.3 kB
Source Map (JSON)
{"version":3,"file":"component.mjs","names":[],"sources":["../../src/h-stack/component.tsx"],"sourcesContent":["import type { WordPressComponentProps } from '../context';\nimport { contextConnect } from '../context';\nimport { View } from '../view';\nimport { useHStack } from './hook';\nimport type { Props } from './types';\n\nfunction UnconnectedHStack(\n\tprops: WordPressComponentProps< Props, 'div' >,\n\tforwardedRef: React.ForwardedRef< any >\n) {\n\tconst hStackProps = useHStack( props );\n\n\treturn <View { ...hStackProps } ref={ forwardedRef } />;\n}\n\n/**\n * `HStack` (Horizontal Stack) arranges child elements in a horizontal line.\n *\n * `HStack` can render anything inside.\n *\n * ```jsx\n * import {\n * \t__experimentalHStack as HStack,\n * \t__experimentalText as Text,\n * } from `@wordpress/components`;\n *\n * function Example() {\n * \treturn (\n * \t\t<HStack>\n * \t\t\t<Text>Code</Text>\n * \t\t\t<Text>is</Text>\n * \t\t\t<Text>Poetry</Text>\n * \t\t</HStack>\n * \t);\n * }\n * ```\n */\nexport const HStack = contextConnect( UnconnectedHStack, 'HStack' );\n\nexport default HStack;\n"],"mappings":";;;;;AAMA,SAAS,kBACR,OACA,cACC;CACD,MAAM,cAAc,UAAW,KAAM;CAErC,OAAO,oBAAC,MAAD;EAAM,GAAK;EAAc,KAAM;CAAgB,CAAA;AACvD;;;;;;;;;;;;;;;;;;;;;;;AAwBA,MAAa,SAAS,eAAgB,mBAAmB,QAAS"}