diff --git a/packages/components/src/input-control/input-base.js b/packages/components/src/input-control/input-base.js index fd47c76473a60d..232e5c16a1f238 100644 --- a/packages/components/src/input-control/input-base.js +++ b/packages/components/src/input-control/input-base.js @@ -24,6 +24,26 @@ function useUniqueId( idProp ) { return idProp || id; } +// Adapter to map props for the new ui/flex compopnent. +function getUIFlexProps( { labelPosition } ) { + const props = {}; + switch ( labelPosition ) { + case 'top': + props.direction = 'column'; + props.gap = 0; + break; + case 'bottom': + props.direction = 'column-reverse'; + props.gap = 0; + break; + case 'edge': + props.justify = 'space-between'; + break; + } + + return props; +} + export function InputBase( { __unstableInputWidth, @@ -48,6 +68,7 @@ export function InputBase( return ( { + // Find the DefinePlugin + const plugin = config.plugins.find( ( p ) => { + return p.definitions && p.definitions[ 'process.env' ]; + } ); + // Add custom env variables + Object.keys( customEnvVariables ).forEach( ( key ) => { + plugin.definitions[ 'process.env' ][ key ] = JSON.stringify( + customEnvVariables[ key ] + ); + } ); + + return config; + }, };