@workday/canvas-kit-react
Version:
The parent module that contains all Workday Canvas Kit React components
25 lines (24 loc) • 585 B
JavaScript
import { space } from '@workday/canvas-kit-react/tokens';
/**
* Adds the necessary layout props to a `FormField` component.
*
* @deprecated
*/
export const useFormFieldOrientation = (orientation) => {
let layoutProps;
if (orientation === 'horizontal') {
layoutProps = {
flexDirection: 'row',
gap: space.l,
alignItems: undefined,
};
}
else {
layoutProps = {
flexDirection: 'column',
gap: space.xxxs,
alignItems: 'flex-start',
};
}
return layoutProps;
};