0.2.0 - Mid migration

This commit is contained in:
Daniel Mason 2022-04-25 14:47:15 +12:00
parent 139e6a915e
commit 7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions

46
web/node_modules/@material-ui/system/es/borders.js generated vendored Normal file
View file

@ -0,0 +1,46 @@
import style from './style';
import compose from './compose';
function getBorder(value) {
if (typeof value !== 'number') {
return value;
}
return `${value}px solid`;
}
export const border = style({
prop: 'border',
themeKey: 'borders',
transform: getBorder
});
export const borderTop = style({
prop: 'borderTop',
themeKey: 'borders',
transform: getBorder
});
export const borderRight = style({
prop: 'borderRight',
themeKey: 'borders',
transform: getBorder
});
export const borderBottom = style({
prop: 'borderBottom',
themeKey: 'borders',
transform: getBorder
});
export const borderLeft = style({
prop: 'borderLeft',
themeKey: 'borders',
transform: getBorder
});
export const borderColor = style({
prop: 'borderColor',
themeKey: 'palette'
});
export const borderRadius = style({
prop: 'borderRadius',
themeKey: 'shape'
});
const borders = compose(border, borderTop, borderRight, borderBottom, borderLeft, borderColor, borderRadius);
export default borders;

74
web/node_modules/@material-ui/system/es/breakpoints.js generated vendored Normal file
View file

@ -0,0 +1,74 @@
import _extends from "@babel/runtime/helpers/esm/extends";
import PropTypes from 'prop-types';
import merge from './merge'; // The breakpoint **start** at this value.
// For instance with the first breakpoint xs: [xs, sm[.
const values = {
xs: 0,
sm: 600,
md: 960,
lg: 1280,
xl: 1920
};
const defaultBreakpoints = {
// Sorted ASC by size. That's important.
// It can't be configured as it's used statically for propTypes.
keys: ['xs', 'sm', 'md', 'lg', 'xl'],
up: key => `@media (min-width:${values[key]}px)`
};
export function handleBreakpoints(props, propValue, styleFromPropValue) {
if (process.env.NODE_ENV !== 'production') {
if (!props.theme) {
console.error('Material-UI: You are calling a style function without a theme value.');
}
}
if (Array.isArray(propValue)) {
const themeBreakpoints = props.theme.breakpoints || defaultBreakpoints;
return propValue.reduce((acc, item, index) => {
acc[themeBreakpoints.up(themeBreakpoints.keys[index])] = styleFromPropValue(propValue[index]);
return acc;
}, {});
}
if (typeof propValue === 'object') {
const themeBreakpoints = props.theme.breakpoints || defaultBreakpoints;
return Object.keys(propValue).reduce((acc, breakpoint) => {
acc[themeBreakpoints.up(breakpoint)] = styleFromPropValue(propValue[breakpoint]);
return acc;
}, {});
}
const output = styleFromPropValue(propValue);
return output;
}
function breakpoints(styleFunction) {
const newStyleFunction = props => {
const base = styleFunction(props);
const themeBreakpoints = props.theme.breakpoints || defaultBreakpoints;
const extended = themeBreakpoints.keys.reduce((acc, key) => {
if (props[key]) {
acc = acc || {};
acc[themeBreakpoints.up(key)] = styleFunction(_extends({
theme: props.theme
}, props[key]));
}
return acc;
}, null);
return merge(base, extended);
};
newStyleFunction.propTypes = process.env.NODE_ENV !== 'production' ? _extends({}, styleFunction.propTypes, {
xs: PropTypes.object,
sm: PropTypes.object,
md: PropTypes.object,
lg: PropTypes.object,
xl: PropTypes.object
}) : {};
newStyleFunction.filterProps = ['xs', 'sm', 'md', 'lg', 'xl', ...styleFunction.filterProps];
return newStyleFunction;
}
export default breakpoints;

35
web/node_modules/@material-ui/system/es/compose.js generated vendored Normal file
View file

@ -0,0 +1,35 @@
import _extends from "@babel/runtime/helpers/esm/extends";
import merge from './merge';
function compose(...styles) {
const fn = props => styles.reduce((acc, style) => {
const output = style(props);
if (output) {
return merge(acc, output);
}
return acc;
}, {}); // Alternative approach that doesn't yield any performance gain.
// const handlers = styles.reduce((acc, style) => {
// style.filterProps.forEach(prop => {
// acc[prop] = style;
// });
// return acc;
// }, {});
// const fn = props => {
// return Object.keys(props).reduce((acc, prop) => {
// if (handlers[prop]) {
// return merge(acc, handlers[prop](props));
// }
// return acc;
// }, {});
// };
fn.propTypes = process.env.NODE_ENV !== 'production' ? styles.reduce((acc, style) => _extends(acc, style.propTypes), {}) : {};
fn.filterProps = styles.reduce((acc, style) => acc.concat(style.filterProps), []);
return fn;
}
export default compose;

27
web/node_modules/@material-ui/system/es/display.js generated vendored Normal file
View file

@ -0,0 +1,27 @@
import style from './style';
import compose from './compose';
export const displayPrint = style({
prop: 'displayPrint',
cssProperty: false,
transform: value => ({
'@media print': {
display: value
}
})
});
export const displayRaw = style({
prop: 'display'
});
export const overflow = style({
prop: 'overflow'
});
export const textOverflow = style({
prop: 'textOverflow'
});
export const visibility = style({
prop: 'visibility'
});
export const whiteSpace = style({
prop: 'whiteSpace'
});
export default compose(displayPrint, displayRaw, overflow, textOverflow, visibility, whiteSpace);

43
web/node_modules/@material-ui/system/es/flexbox.js generated vendored Normal file
View file

@ -0,0 +1,43 @@
import style from './style';
import compose from './compose';
export const flexBasis = style({
prop: 'flexBasis'
});
export const flexDirection = style({
prop: 'flexDirection'
});
export const flexWrap = style({
prop: 'flexWrap'
});
export const justifyContent = style({
prop: 'justifyContent'
});
export const alignItems = style({
prop: 'alignItems'
});
export const alignContent = style({
prop: 'alignContent'
});
export const order = style({
prop: 'order'
});
export const flex = style({
prop: 'flex'
});
export const flexGrow = style({
prop: 'flexGrow'
});
export const flexShrink = style({
prop: 'flexShrink'
});
export const alignSelf = style({
prop: 'alignSelf'
});
export const justifyItems = style({
prop: 'justifyItems'
});
export const justifySelf = style({
prop: 'justifySelf'
});
const flexbox = compose(flexBasis, flexDirection, flexWrap, justifyContent, alignItems, alignContent, order, flex, flexGrow, flexShrink, alignSelf, justifyItems, justifySelf);
export default flexbox;

40
web/node_modules/@material-ui/system/es/grid.js generated vendored Normal file
View file

@ -0,0 +1,40 @@
import style from './style';
import compose from './compose';
export const gridGap = style({
prop: 'gridGap'
});
export const gridColumnGap = style({
prop: 'gridColumnGap'
});
export const gridRowGap = style({
prop: 'gridRowGap'
});
export const gridColumn = style({
prop: 'gridColumn'
});
export const gridRow = style({
prop: 'gridRow'
});
export const gridAutoFlow = style({
prop: 'gridAutoFlow'
});
export const gridAutoColumns = style({
prop: 'gridAutoColumns'
});
export const gridAutoRows = style({
prop: 'gridAutoRows'
});
export const gridTemplateColumns = style({
prop: 'gridTemplateColumns'
});
export const gridTemplateRows = style({
prop: 'gridTemplateRows'
});
export const gridTemplateAreas = style({
prop: 'gridTemplateAreas'
});
export const gridArea = style({
prop: 'gridArea'
});
const grid = compose(gridGap, gridColumnGap, gridRowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea);
export default grid;

23
web/node_modules/@material-ui/system/es/index.js generated vendored Normal file
View file

@ -0,0 +1,23 @@
export { default as borders } from './borders';
export * from './borders';
export { default as breakpoints } from './breakpoints';
export { default as compose } from './compose';
export { default as styleFunctionSx } from './styleFunctionSx';
export * from './styleFunctionSx';
export { default as display } from './display';
export { default as flexbox } from './flexbox';
export * from './flexbox';
export { default as grid } from './grid';
export * from './grid';
export { default as palette } from './palette';
export * from './palette';
export { default as positions } from './positions';
export * from './positions';
export { default as shadows } from './shadows';
export { default as sizing } from './sizing';
export * from './sizing';
export { default as spacing } from './spacing';
export * from './spacing';
export { default as style } from './style';
export { default as typography } from './typography';
export * from './typography';

10
web/node_modules/@material-ui/system/es/memoize.js generated vendored Normal file
View file

@ -0,0 +1,10 @@
export default function memoize(fn) {
const cache = {};
return arg => {
if (cache[arg] === undefined) {
cache[arg] = fn(arg);
}
return cache[arg];
};
}

14
web/node_modules/@material-ui/system/es/merge.js generated vendored Normal file
View file

@ -0,0 +1,14 @@
import { deepmerge } from '@material-ui/utils';
function merge(acc, item) {
if (!item) {
return acc;
}
return deepmerge(acc, item, {
clone: false // No need to clone deep, it's way faster.
});
}
export default merge;

13
web/node_modules/@material-ui/system/es/palette.js generated vendored Normal file
View file

@ -0,0 +1,13 @@
import style from './style';
import compose from './compose';
export const color = style({
prop: 'color',
themeKey: 'palette'
});
export const bgcolor = style({
prop: 'bgcolor',
cssProperty: 'backgroundColor',
themeKey: 'palette'
});
const palette = compose(color, bgcolor);
export default palette;

22
web/node_modules/@material-ui/system/es/positions.js generated vendored Normal file
View file

@ -0,0 +1,22 @@
import style from './style';
import compose from './compose';
export const position = style({
prop: 'position'
});
export const zIndex = style({
prop: 'zIndex',
themeKey: 'zIndex'
});
export const top = style({
prop: 'top'
});
export const right = style({
prop: 'right'
});
export const bottom = style({
prop: 'bottom'
});
export const left = style({
prop: 'left'
});
export default compose(position, zIndex, top, right, bottom, left);

View file

@ -0,0 +1,3 @@
import PropTypes from 'prop-types';
const responsivePropType = process.env.NODE_ENV !== 'production' ? PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.object, PropTypes.array]) : {};
export default responsivePropType;

6
web/node_modules/@material-ui/system/es/shadows.js generated vendored Normal file
View file

@ -0,0 +1,6 @@
import style from './style';
const boxShadow = style({
prop: 'boxShadow',
themeKey: 'shadows'
});
export default boxShadow;

46
web/node_modules/@material-ui/system/es/sizing.js generated vendored Normal file
View file

@ -0,0 +1,46 @@
import style from './style';
import compose from './compose';
function transform(value) {
return value <= 1 ? `${value * 100}%` : value;
}
export const width = style({
prop: 'width',
transform
});
export const maxWidth = style({
prop: 'maxWidth',
transform
});
export const minWidth = style({
prop: 'minWidth',
transform
});
export const height = style({
prop: 'height',
transform
});
export const maxHeight = style({
prop: 'maxHeight',
transform
});
export const minHeight = style({
prop: 'minHeight',
transform
});
export const sizeWidth = style({
prop: 'size',
cssProperty: 'width',
transform
});
export const sizeHeight = style({
prop: 'size',
cssProperty: 'height',
transform
});
export const boxSizing = style({
prop: 'boxSizing'
});
const sizing = compose(width, maxWidth, minWidth, height, maxHeight, minHeight, boxSizing);
export default sizing;

128
web/node_modules/@material-ui/system/es/spacing.js generated vendored Normal file
View file

@ -0,0 +1,128 @@
import responsivePropType from './responsivePropType';
import { handleBreakpoints } from './breakpoints';
import merge from './merge';
import memoize from './memoize';
const properties = {
m: 'margin',
p: 'padding'
};
const directions = {
t: 'Top',
r: 'Right',
b: 'Bottom',
l: 'Left',
x: ['Left', 'Right'],
y: ['Top', 'Bottom']
};
const aliases = {
marginX: 'mx',
marginY: 'my',
paddingX: 'px',
paddingY: 'py'
}; // memoize() impact:
// From 300,000 ops/sec
// To 350,000 ops/sec
const getCssProperties = memoize(prop => {
// It's not a shorthand notation.
if (prop.length > 2) {
if (aliases[prop]) {
prop = aliases[prop];
} else {
return [prop];
}
}
const [a, b] = prop.split('');
const property = properties[a];
const direction = directions[b] || '';
return Array.isArray(direction) ? direction.map(dir => property + dir) : [property + direction];
});
const spacingKeys = ['m', 'mt', 'mr', 'mb', 'ml', 'mx', 'my', 'p', 'pt', 'pr', 'pb', 'pl', 'px', 'py', 'margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'marginX', 'marginY', 'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'paddingX', 'paddingY'];
export function createUnarySpacing(theme) {
const themeSpacing = theme.spacing || 8;
if (typeof themeSpacing === 'number') {
return abs => {
if (process.env.NODE_ENV !== 'production') {
if (typeof abs !== 'number') {
console.error(`Material-UI: Expected spacing argument to be a number, got ${abs}.`);
}
}
return themeSpacing * abs;
};
}
if (Array.isArray(themeSpacing)) {
return abs => {
if (process.env.NODE_ENV !== 'production') {
if (abs > themeSpacing.length - 1) {
console.error([`Material-UI: The value provided (${abs}) overflows.`, `The supported values are: ${JSON.stringify(themeSpacing)}.`, `${abs} > ${themeSpacing.length - 1}, you need to add the missing values.`].join('\n'));
}
}
return themeSpacing[abs];
};
}
if (typeof themeSpacing === 'function') {
return themeSpacing;
}
if (process.env.NODE_ENV !== 'production') {
console.error([`Material-UI: The \`theme.spacing\` value (${themeSpacing}) is invalid.`, 'It should be a number, an array or a function.'].join('\n'));
}
return () => undefined;
}
function getValue(transformer, propValue) {
if (typeof propValue === 'string' || propValue == null) {
return propValue;
}
const abs = Math.abs(propValue);
const transformed = transformer(abs);
if (propValue >= 0) {
return transformed;
}
if (typeof transformed === 'number') {
return -transformed;
}
return `-${transformed}`;
}
function getStyleFromPropValue(cssProperties, transformer) {
return propValue => cssProperties.reduce((acc, cssProperty) => {
acc[cssProperty] = getValue(transformer, propValue);
return acc;
}, {});
}
function spacing(props) {
const theme = props.theme;
const transformer = createUnarySpacing(theme);
return Object.keys(props).map(prop => {
// Using a hash computation over an array iteration could be faster, but with only 28 items,
// it's doesn't worth the bundle size.
if (spacingKeys.indexOf(prop) === -1) {
return null;
}
const cssProperties = getCssProperties(prop);
const styleFromPropValue = getStyleFromPropValue(cssProperties, transformer);
const propValue = props[prop];
return handleBreakpoints(props, propValue, styleFromPropValue);
}).reduce(merge, {});
}
spacing.propTypes = process.env.NODE_ENV !== 'production' ? spacingKeys.reduce((obj, key) => {
obj[key] = responsivePropType;
return obj;
}, {}) : {};
spacing.filterProps = spacingKeys;
export default spacing;

63
web/node_modules/@material-ui/system/es/style.js generated vendored Normal file
View file

@ -0,0 +1,63 @@
import responsivePropType from './responsivePropType';
import { handleBreakpoints } from './breakpoints';
function getPath(obj, path) {
if (!path || typeof path !== 'string') {
return null;
}
return path.split('.').reduce((acc, item) => acc && acc[item] ? acc[item] : null, obj);
}
function style(options) {
const {
prop,
cssProperty = options.prop,
themeKey,
transform
} = options;
const fn = props => {
if (props[prop] == null) {
return null;
}
const propValue = props[prop];
const theme = props.theme;
const themeMapping = getPath(theme, themeKey) || {};
const styleFromPropValue = propValueFinal => {
let value;
if (typeof themeMapping === 'function') {
value = themeMapping(propValueFinal);
} else if (Array.isArray(themeMapping)) {
value = themeMapping[propValueFinal] || propValueFinal;
} else {
value = getPath(themeMapping, propValueFinal) || propValueFinal;
if (transform) {
value = transform(value);
}
}
if (cssProperty === false) {
return value;
}
return {
[cssProperty]: value
};
};
return handleBreakpoints(props, propValue, styleFromPropValue);
};
fn.propTypes = process.env.NODE_ENV !== 'production' ? {
[prop]: responsivePropType
} : {};
fn.filterProps = [prop];
return fn;
}
export default style;

View file

@ -0,0 +1,65 @@
import _extends from "@babel/runtime/helpers/esm/extends";
import PropTypes from 'prop-types';
import { chainPropTypes } from '@material-ui/utils';
import merge from './merge';
function omit(input, fields) {
const output = {};
Object.keys(input).forEach(prop => {
if (fields.indexOf(prop) === -1) {
output[prop] = input[prop];
}
});
return output;
}
let warnedOnce = false;
function styleFunctionSx(styleFunction) {
const newStyleFunction = props => {
const output = styleFunction(props);
if (props.css) {
return _extends({}, merge(output, styleFunction(_extends({
theme: props.theme
}, props.css))), omit(props.css, [styleFunction.filterProps]));
}
if (props.sx) {
return _extends({}, merge(output, styleFunction(_extends({
theme: props.theme
}, props.sx))), omit(props.sx, [styleFunction.filterProps]));
}
return output;
};
newStyleFunction.propTypes = process.env.NODE_ENV !== 'production' ? _extends({}, styleFunction.propTypes, {
css: chainPropTypes(PropTypes.object, props => {
if (!warnedOnce && props.css !== undefined) {
warnedOnce = true;
return new Error('Material-UI: The `css` prop is deprecated, please use the `sx` prop instead.');
}
return null;
}),
sx: PropTypes.object
}) : {};
newStyleFunction.filterProps = ['css', 'sx', ...styleFunction.filterProps];
return newStyleFunction;
}
/**
*
* @deprecated
* The css style function is deprecated. Use the `styleFunctionSx` instead.
*/
export function css(styleFunction) {
if (process.env.NODE_ENV !== 'production') {
console.warn('Material-UI: The `css` function is deprecated. Use the `styleFunctionSx` instead.');
}
return styleFunctionSx(styleFunction);
}
export default styleFunctionSx;

29
web/node_modules/@material-ui/system/es/typography.js generated vendored Normal file
View file

@ -0,0 +1,29 @@
import style from './style';
import compose from './compose';
export const fontFamily = style({
prop: 'fontFamily',
themeKey: 'typography'
});
export const fontSize = style({
prop: 'fontSize',
themeKey: 'typography'
});
export const fontStyle = style({
prop: 'fontStyle',
themeKey: 'typography'
});
export const fontWeight = style({
prop: 'fontWeight',
themeKey: 'typography'
});
export const letterSpacing = style({
prop: 'letterSpacing'
});
export const lineHeight = style({
prop: 'lineHeight'
});
export const textAlign = style({
prop: 'textAlign'
});
const typography = compose(fontFamily, fontSize, fontStyle, fontWeight, letterSpacing, lineHeight, textAlign);
export default typography;