<commit_before>import PropTypes from 'prop-types';
import styled from '@emotion/styled';
import Base from './Base';

const BREAKPOINTS = {
	default: 0,
	small: 1,
	medium: 2,
	large: 3,
	huge: 4,
};
const BREAKPOINT_NAMES = Object.keys(BREAKPOINTS);

const push = direction => props => props.push === direction && 'auto';

const size = breakpoint => props => {
	const width = props.width[BREAKPOINTS[breakpoint]];
	if (width === 'auto') {
		return width;
	}
	return width && `${width * 100}%`;
};

const widthStyle = (props, breakpoint) => {
	const width = size(breakpoint)(props);
	if (!width) {
		return null;
	}
	return `width: ${width};`;
};

const column = props => breakpoint => {
	const styles = [widthStyle(props, breakpoint)].filter(Boolean).join('');

	const minWidth = props.theme.breakpoints[breakpoint];
	if (!minWidth) {
		return styles;
	}

	return `
		@media (min-width: ${minWidth}) {
			${styles};
		}
	`;
};

const Column = styled(Base)`
	margin-left: ${push('right')};
	margin-right: ${push('left')};
	text-align: ${props => props.align};
	order: ${props => props.order};
	${props => BREAKPOINT_NAMES.map(column(props))};
`;

Column.propTypes = {
	/** Array of 1/6, 5/6, 1/4, 3/3, 1/3, 2/3, 1/2, 1, auto */
	width: PropTypes.arrayOf(
		PropTypes.oneOf([
			1 / 6,
			5 / 6,
			1 / 4,
			3 / 4,
			1 / 3,
			2 / 3,
			1 / 2,
			1,
			'auto',
		])
	),
	align: PropTypes.oneOf(['left', 'center', 'right']),
	push: PropTypes.oneOf(['left', 'right']),
	order: PropTypes.number,
	className: PropTypes.string,
	as: PropTypes.any,<commit_msg>Feat: add padding props to Column<commit_after>import PropTypes from 'prop-types';
import styled from '@emotion/styled';
import Base from './Base';

const BREAKPOINTS = {
	default: 0,
	small: 1,
	medium: 2,
	large: 3,
	huge: 4,
};
const SIZES = ['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl'];
const BREAKPOINT_NAMES = Object.keys(BREAKPOINTS);

const push = direction => props => props.push === direction && 'auto';

const size = breakpoint => props => {
	const width = props.width[BREAKPOINTS[breakpoint]];
	if (width === 'auto') {
		return width;
	}
	return width && `${width * 100}%`;
};

const widthStyle = (props, breakpoint) => {
	const width = size(breakpoint)(props);
	if (!width) {
		return null;
	}
	return `width: ${width};`;
};

const column = props => breakpoint => {
	const styles = [widthStyle(props, breakpoint)].filter(Boolean).join('');

	const minWidth = props.theme.breakpoints[breakpoint];
	if (!minWidth) {
		return styles;
	}

	return `
		@media (min-width: ${minWidth}) {
			${styles};
		}
	`;
};

const Column = styled(Base)`
	margin-left: ${push('right')};
	margin-right: ${push('left')};
	padding: ${size('p')};
	padding-top: ${size('pt', 'py')};
	padding-right: ${size('pr', 'px')};
	padding-bottom: ${size('pb', 'py')};
	padding-left: ${size('pl', 'px')};
	text-align: ${props => props.align};
	order: ${props => props.order};
	${props => BREAKPOINT_NAMES.map(column(props))};
`;

Column.propTypes = {
	/** Array of 1/6, 5/6, 1/4, 3/3, 1/3, 2/3, 1/2, 1, auto */
	width: PropTypes.arrayOf(
		PropTypes.oneOf([
			1 / 6,
			5 / 6,
			1 / 4,
			3 / 4,
			1 / 3,
			2 / 3,
			1 / 2,
			1,
			'auto',
		])
	),
	p: PropTypes.oneOf(SIZES),
	pt: PropTypes.oneOf(SIZES),
	pr: PropTypes.oneOf(SIZES),
	pb: PropTypes.oneOf(SIZES),
	pl: PropTypes.oneOf(SIZES),
	px: PropTypes.oneOf(SIZES),
	py: PropTypes.oneOf(SIZES),
	align: PropTypes.oneOf(['left', 'center', 'right']),
	push: PropTypes.oneOf(['left', 'right']),
	order: PropTypes.number,
	className: PropTypes.string,
	as: PropTypes.any,
{'fraction_non_alphanumeric': 0.20663480461062694, 'fraction_numerical': 0.02136631993252741, 'mean_word_length': 3.9348127600554785, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '780152', 'n_tokens_mistral': 1474, 'n_tokens_neox': 1391, 'n_words': 327}