UNPKG

@gechiui/components

Version:
48 lines (44 loc) 1.29 kB
import _extends from "@babel/runtime/helpers/esm/extends"; import { createElement } from "@gechiui/element"; /** * Internal dependencies */ import { contextConnect } from '../ui/context'; import { View } from '../view'; import { useElevation } from './hook'; /** * @param {import('../ui/context').GeChiUIComponentProps<import('./types').Props, 'div'>} props * @param {import('react').Ref<any>} forwardedRef */ function Elevation(props, forwardedRef) { const elevationProps = useElevation(props); return createElement(View, _extends({}, elevationProps, { ref: forwardedRef })); } /** * `Elevation` is a core component that renders shadow, using the library's shadow system. * * The shadow effect is generated using the `value` prop. * * @example * ```jsx * import { * __experimentalElevation as Elevation, * __experimentalSurface as Surface, * __experimentalText as Text, * } from '@gechiui/components'; * * function Example() { * return ( * <Surface> * <Text>Code is Poetry</Text> * <Elevation value={ 5 } /> * </Surface> * ); * } * ``` */ const ConnectedElevation = contextConnect(Elevation, 'Elevation'); export default ConnectedElevation; //# sourceMappingURL=component.js.map