/**
 * Inline-style helpers ported from the source design system's kernel
 * (numbers become px, strings pass through, undefined yields nothing).
 */
const dimension = ( value ) =>
	typeof value === 'number' ? `${ value }px` : value;

export const marginStyle = ( margin ) =>
	margin === undefined ? {} : { margin: dimension( margin ) };

export const marginTopStyle = ( marginTop ) =>
	marginTop === undefined ? {} : { marginTop: dimension( marginTop ) };

export const paddingStyle = ( padding ) =>
	padding === undefined ? {} : { padding: dimension( padding ) };

export const paddingTopStyle = ( paddingTop ) =>
	paddingTop === undefined ? {} : { paddingTop: dimension( paddingTop ) };

export const gapStyle = ( gap ) =>
	gap === undefined ? {} : { gap: dimension( gap ) };
