{"size": 1300, "ext": "js", "max_stars_repo_path": "styles/utils/properties/align.js", "max_stars_repo_name": "fabula-ui/core", "max_stars_repo_stars_event_min_datetime": "2020-11-17T22:19:46.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-09T17:31:24.000Z", "max_issues_repo_path": "styles/utils/properties/align.js", "max_issues_repo_name": "fabula-ui/core", "max_issues_repo_issues_event_min_datetime": "2020-12-04T16:51:55.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-11T18:28:25.000Z", "max_forks_repo_path": "styles/utils/properties/align.js", "max_forks_repo_name": "fabula-ui/core", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": 4, "max_forks_count": null, "avg_line_length": 48.1481481481, "max_line_length": 186, "alphanum_fraction": 0.5515384615}
const alignUtils = params => {
    const { framework, props } = params;
    const alignments = {
        bottom: 'flex-end',
        center: 'center',
        end: 'flex-end',
        left: 'flex-start',
        right: 'flex-end',
        start: 'flex-start',
        top: 'flex-start'
    };
    const alignmentH = (props.al || props.alH || props.alignH) ? alignments[props.al || props.alH || props.alignH] : null;
    const alignmentV = (props.al || props.alV || props.alignV) ? alignments[props.al || props.alV || props.alignV] : null;
    const layout = (props.direction === 'column' || props.flow === 'v' || props.flow === 'vertical') ? 'v' : 'h';
    const wrapper = framework === 'angular' ? '> [data-fab-component], > [data-fab-wrapper] > [data-fab-component]' : '&[data-fab-component], &[data-fab-wrapper] > [data-fab-component]';

    return `
        ${wrapper} {
            ${(alignmentH && layout === 'v') ? `align-items: ${alignmentH}!important;` : ''}
            ${(alignmentH && layout === 'h') ? `justify-content: ${alignmentH}!important;` : ''}
            ${(alignmentV && layout === 'h') ? `align-items: ${alignmentV}!important;` : ''}
            ${(alignmentV && layout === 'v') ? `justify-content: ${alignmentV}!important;` : ''}
        }
    `
}

export default alignUtils;