UNPKG

@wordpress/components

Version:
1 lines • 1.54 kB
{"version":3,"file":"component.cjs","names":["useElevation","View","contextConnect"],"sources":["../../src/elevation/component.tsx"],"sourcesContent":["import type { ForwardedRef } from 'react';\nimport type { WordPressComponentProps } from '../context';\nimport { contextConnect } from '../context';\nimport { View } from '../view';\nimport { useElevation } from './hook';\nimport type { ElevationProps } from './types';\n\nexport function UnconnectedElevation(\n\tprops: WordPressComponentProps< ElevationProps, 'div' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst elevationProps = useElevation( props );\n\n\treturn <View { ...elevationProps } ref={ forwardedRef } />;\n}\n\n/**\n * `Elevation` is a core component that renders shadow, using the component\n * system's shadow system.\n *\n * The shadow effect is generated using the `value` prop.\n *\n * ```jsx\n * import {\n *\t__experimentalElevation as Elevation,\n *\t__experimentalText as Text,\n * } from '@wordpress/components';\n *\n * function Example() {\n * return (\n * <div>\n * <Text>Code is Poetry</Text>\n * <Elevation value={ 5 } />\n * </div>\n * );\n * }\n * ```\n */\nexport const Elevation = contextConnect( UnconnectedElevation, 'Elevation' );\n\nexport default Elevation;\n"],"mappings":";;;;;;;;;;AAOA,SAAgB,qBACf,OACA,cACC;CACD,MAAM,kBAAA,GAAiBA,UAAAA,aAAAA,CAAc,KAAM;CAE3C,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,iBAAAA,MAAD;EAAM,GAAK;EAAiB,KAAM;CAAgB,CAAA;AAC1D;;;;;;;;;;;;;;;;;;;;;;;AAwBA,MAAa,aAAA,GAAYC,oBAAAA,eAAAA,CAAgB,sBAAsB,WAAY"}