@workday/canvas-kit-react
Version:
The parent module that contains all Workday Canvas Kit React components
79 lines (78 loc) • 1.72 kB
JavaScript
import { buildStyleFns, buildStylePropFn } from './buildStyleFns';
export const layoutStyleFnConfigs = [
{
name: 'display',
properties: ['display'],
system: 'none',
},
{
name: 'height',
properties: ['height'],
system: 'space',
},
{
name: 'listStyle',
properties: ['listStyle'],
system: 'none',
},
{
name: 'maxHeight',
properties: ['maxHeight'],
system: 'space',
},
{
name: 'maxWidth',
properties: ['maxWidth'],
system: 'space',
},
{
name: 'minHeight',
properties: ['minHeight'],
system: 'space',
},
{
name: 'minWidth',
properties: ['minWidth'],
system: 'space',
},
{
name: 'overflow',
properties: ['overflow'],
system: 'none',
},
{
name: 'overflowX',
properties: ['overflowX'],
system: 'none',
},
{
name: 'overflowY',
properties: ['overflowY'],
system: 'none',
},
{
name: 'verticalAlign',
properties: ['verticalAlign'],
system: 'none',
},
{
name: 'width',
properties: ['width'],
system: 'space',
},
];
export const layoutStyleFns = buildStyleFns(layoutStyleFnConfigs);
/**
* A style prop function that takes component props and returns layout styles.
* If no `LayoutStyleProps` are found, it returns an empty object.
*
* @example
* ```tsx
* const LayoutExample = () => (
* <Box display="inline-block" height="50%">
* Hello, layout!
* </Box>
* );
* ```
*/
export const layout = buildStylePropFn(layoutStyleFns);