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