import { merge } from 'lodash-es' import { JSX, mergeProps } from 'solid-js' export interface RaisedProps { background?: string zDepth?: 0 | 1 | 2 | 3 | 4 | 5 radius?: number styles?: Record children?: JSX.Element } export function Raised(_props: RaisedProps) { const props = mergeProps( { zDepth: 1, radius: 2, background: '#fff', styles: {}, }, _props, ) const styles = merge, Record>( { wrap: { position: 'relative', display: 'inline-block', }, content: { position: 'relative', }, bg: { position: 'absolute', inset: '0px', 'box-shadow': props.zDepth === 1 ? '0 2px 10px rgba(0,0,0,.12), 0 2px 5px rgba(0,0,0,.16)' : `0 ${props.zDepth}px ${props.zDepth * 4}px rgba(0,0,0,.24)`, 'border-radius': `${props.radius}px`, background: props.background, }, }, props.styles, ) return (
{props.children}
) }