@workday/canvas-kit-react
Version:
The parent module that contains all Workday Canvas Kit React components
27 lines (26 loc) • 714 B
JavaScript
import { buildStyleFns, buildStylePropFn } from './buildStyleFns';
export const depthStyleFnConfigs = [
{
name: 'boxShadow',
properties: ['boxShadow'],
system: 'none',
},
{
name: 'depth',
properties: ['boxShadow'],
system: 'depth',
},
];
export const depthStyleFns = buildStyleFns(depthStyleFnConfigs);
/**
* A style prop function that takes component props and returns depth styles from Canvas token values.
* If no `DepthStyleProps` are found, it returns an empty object.
*
* @example
* ```tsx
* const DepthExample = () => (
* <Box depth={3}>Hello, box shadows!</Box>
* );
* ```
*/
export const depth = buildStylePropFn(depthStyleFns);