worked on GarageApp stuff
This commit is contained in:
parent
60aaf17af3
commit
eb606572b0
51919 changed files with 2168177 additions and 18 deletions
13
node_modules/@mui/system/esm/Grid/Grid.d.ts
generated
vendored
Normal file
13
node_modules/@mui/system/esm/Grid/Grid.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/**
|
||||
*
|
||||
* Demos:
|
||||
*
|
||||
* - [Grid (Joy UI)](https://mui.com/joy-ui/react-grid/)
|
||||
* - [Grid (Material UI)](https://mui.com/material-ui/react-grid/)
|
||||
*
|
||||
* API:
|
||||
*
|
||||
* - [Grid API](https://mui.com/system/api/grid/)
|
||||
*/
|
||||
declare const Grid: import("@mui/types").OverridableComponent<import("./GridProps.js").GridTypeMap<{}, "div">>;
|
||||
export default Grid;
|
||||
106
node_modules/@mui/system/esm/Grid/Grid.js
generated
vendored
Normal file
106
node_modules/@mui/system/esm/Grid/Grid.js
generated
vendored
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
'use client';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
import createGrid from "./createGrid.js";
|
||||
/**
|
||||
*
|
||||
* Demos:
|
||||
*
|
||||
* - [Grid (Joy UI)](https://mui.com/joy-ui/react-grid/)
|
||||
* - [Grid (Material UI)](https://mui.com/material-ui/react-grid/)
|
||||
*
|
||||
* API:
|
||||
*
|
||||
* - [Grid API](https://mui.com/system/api/grid/)
|
||||
*/
|
||||
const Grid = createGrid();
|
||||
process.env.NODE_ENV !== "production" ? Grid.propTypes /* remove-proptypes */ = {
|
||||
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
||||
// │ These PropTypes are generated from the TypeScript type definitions. │
|
||||
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
||||
// └─────────────────────────────────────────────────────────────────────┘
|
||||
/**
|
||||
* The content of the component.
|
||||
*/
|
||||
children: PropTypes.node,
|
||||
/**
|
||||
* The number of columns.
|
||||
* @default 12
|
||||
*/
|
||||
columns: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number, PropTypes.object]),
|
||||
/**
|
||||
* Defines the horizontal space between the type `item` components.
|
||||
* It overrides the value of the `spacing` prop.
|
||||
*/
|
||||
columnSpacing: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
|
||||
/**
|
||||
* If `true`, the component will have the flex *container* behavior.
|
||||
* You should be wrapping *items* with a *container*.
|
||||
* @default false
|
||||
*/
|
||||
container: PropTypes.bool,
|
||||
/**
|
||||
* Defines the `flex-direction` style property.
|
||||
* It is applied for all screen sizes.
|
||||
* @default 'row'
|
||||
*/
|
||||
direction: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), PropTypes.arrayOf(PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), PropTypes.object]),
|
||||
/**
|
||||
* Defines the offset value for the type `item` components.
|
||||
*/
|
||||
offset: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.string, PropTypes.number, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])), PropTypes.object]),
|
||||
/**
|
||||
* Defines the vertical space between the type `item` components.
|
||||
* It overrides the value of the `spacing` prop.
|
||||
*/
|
||||
rowSpacing: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
|
||||
/**
|
||||
* Defines the size of the the type `item` components.
|
||||
*/
|
||||
size: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.string, PropTypes.bool, PropTypes.number, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.bool, PropTypes.number])), PropTypes.object]),
|
||||
/**
|
||||
* Defines the space between the type `item` components.
|
||||
* It can only be used on a type `container` component.
|
||||
* @default 0
|
||||
*/
|
||||
spacing: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
||||
/**
|
||||
* @internal
|
||||
* The level of the grid starts from `0` and increases when the grid nests
|
||||
* inside another grid. Nesting is defined as a container Grid being a direct
|
||||
* child of a container Grid.
|
||||
*
|
||||
* ```js
|
||||
* <Grid container> // level 0
|
||||
* <Grid container> // level 1
|
||||
* <Grid container> // level 2
|
||||
* ```
|
||||
*
|
||||
* Only consecutive grid is considered nesting. A grid container will start at
|
||||
* `0` if there are non-Grid container element above it.
|
||||
*
|
||||
* ```js
|
||||
* <Grid container> // level 0
|
||||
* <div>
|
||||
* <Grid container> // level 0
|
||||
* ```
|
||||
*
|
||||
* ```js
|
||||
* <Grid container> // level 0
|
||||
* <Grid>
|
||||
* <Grid container> // level 0
|
||||
* ```
|
||||
*/
|
||||
unstable_level: PropTypes.number,
|
||||
/**
|
||||
* Defines the `flex-wrap` style property.
|
||||
* It's applied for all screen sizes.
|
||||
* @default 'wrap'
|
||||
*/
|
||||
wrap: PropTypes.oneOf(['nowrap', 'wrap-reverse', 'wrap'])
|
||||
} : void 0;
|
||||
export default Grid;
|
||||
103
node_modules/@mui/system/esm/Grid/GridProps.d.ts
generated
vendored
Normal file
103
node_modules/@mui/system/esm/Grid/GridProps.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
import * as React from 'react';
|
||||
import { OverrideProps, PartiallyRequired } from '@mui/types';
|
||||
import { SxProps } from "../styleFunctionSx/index.js";
|
||||
import { Theme, Breakpoint } from "../createTheme/index.js";
|
||||
import { SystemProps } from "../Box/index.js";
|
||||
type ResponsiveStyleValue<T> = T | Array<T | null> | { [key in Breakpoint]?: T | null };
|
||||
export type GridDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
|
||||
export type GridSpacing = number | string;
|
||||
export type GridWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
|
||||
export type GridSize = 'auto' | 'grow' | number | false;
|
||||
export type GridOffset = 'auto' | number;
|
||||
export interface GridBaseProps {
|
||||
/**
|
||||
* The content of the component.
|
||||
*/
|
||||
children?: React.ReactNode;
|
||||
/**
|
||||
* The number of columns.
|
||||
* @default 12
|
||||
*/
|
||||
columns?: ResponsiveStyleValue<number>;
|
||||
/**
|
||||
* Defines the horizontal space between the type `item` components.
|
||||
* It overrides the value of the `spacing` prop.
|
||||
*/
|
||||
columnSpacing?: ResponsiveStyleValue<GridSpacing>;
|
||||
/**
|
||||
* If `true`, the component will have the flex *container* behavior.
|
||||
* You should be wrapping *items* with a *container*.
|
||||
* @default false
|
||||
*/
|
||||
container?: boolean;
|
||||
/**
|
||||
* Defines the `flex-direction` style property.
|
||||
* It is applied for all screen sizes.
|
||||
* @default 'row'
|
||||
*/
|
||||
direction?: ResponsiveStyleValue<GridDirection>;
|
||||
/**
|
||||
* Defines the offset value for the type `item` components.
|
||||
*/
|
||||
offset?: ResponsiveStyleValue<GridOffset>;
|
||||
/**
|
||||
* @internal
|
||||
* The level of the grid starts from `0` and increases when the grid nests
|
||||
* inside another grid. Nesting is defined as a container Grid being a direct
|
||||
* child of a container Grid.
|
||||
*
|
||||
* ```js
|
||||
* <Grid container> // level 0
|
||||
* <Grid container> // level 1
|
||||
* <Grid container> // level 2
|
||||
* ```
|
||||
*
|
||||
* Only consecutive grid is considered nesting. A grid container will start at
|
||||
* `0` if there are non-Grid container element above it.
|
||||
*
|
||||
* ```js
|
||||
* <Grid container> // level 0
|
||||
* <div>
|
||||
* <Grid container> // level 0
|
||||
* ```
|
||||
*
|
||||
* ```js
|
||||
* <Grid container> // level 0
|
||||
* <Grid>
|
||||
* <Grid container> // level 0
|
||||
* ```
|
||||
*/
|
||||
unstable_level?: number;
|
||||
/**
|
||||
* Defines the vertical space between the type `item` components.
|
||||
* It overrides the value of the `spacing` prop.
|
||||
*/
|
||||
rowSpacing?: ResponsiveStyleValue<GridSpacing>;
|
||||
/**
|
||||
* Defines the size of the the type `item` components.
|
||||
*/
|
||||
size?: ResponsiveStyleValue<GridSize>;
|
||||
/**
|
||||
* Defines the space between the type `item` components.
|
||||
* It can only be used on a type `container` component.
|
||||
* @default 0
|
||||
*/
|
||||
spacing?: ResponsiveStyleValue<GridSpacing> | undefined;
|
||||
/**
|
||||
* Defines the `flex-wrap` style property.
|
||||
* It's applied for all screen sizes.
|
||||
* @default 'wrap'
|
||||
*/
|
||||
wrap?: GridWrap;
|
||||
}
|
||||
export type GridOwnerState = PartiallyRequired<GridBaseProps, 'size' | 'offset' | 'unstable_level'>;
|
||||
export interface GridTypeMap<AdditionalProps = {}, DefaultComponent extends React.ElementType = 'div'> {
|
||||
props: AdditionalProps & GridBaseProps & {
|
||||
sx?: SxProps<Theme>;
|
||||
} & SystemProps<Theme>;
|
||||
defaultComponent: DefaultComponent;
|
||||
}
|
||||
export type GridProps<RootComponent extends React.ElementType = GridTypeMap['defaultComponent'], AdditionalProps = {
|
||||
component?: React.ElementType;
|
||||
}> = OverrideProps<GridTypeMap<AdditionalProps, RootComponent>, RootComponent>;
|
||||
export {};
|
||||
1
node_modules/@mui/system/esm/Grid/GridProps.js
generated
vendored
Normal file
1
node_modules/@mui/system/esm/Grid/GridProps.js
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export {};
|
||||
13
node_modules/@mui/system/esm/Grid/createGrid.d.ts
generated
vendored
Normal file
13
node_modules/@mui/system/esm/Grid/createGrid.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import * as React from 'react';
|
||||
import { OverridableComponent } from '@mui/types';
|
||||
import useThemeSystem from "../useTheme/index.js";
|
||||
import { GridTypeMap } from "./GridProps.js";
|
||||
declare const defaultCreateStyledComponent: import("@mui/styled-engine").CreateStyledComponent<import("../createStyled/index.js").MUIStyledCommonProps<any>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, {}, any>;
|
||||
declare function useThemePropsDefault<T extends {}>(props: T): T;
|
||||
export default function createGrid(options?: {
|
||||
createStyledComponent?: typeof defaultCreateStyledComponent;
|
||||
useThemeProps?: typeof useThemePropsDefault;
|
||||
useTheme?: typeof useThemeSystem;
|
||||
componentName?: string;
|
||||
}): OverridableComponent<GridTypeMap<{}, "div">>;
|
||||
export {};
|
||||
154
node_modules/@mui/system/esm/Grid/createGrid.js
generated
vendored
Normal file
154
node_modules/@mui/system/esm/Grid/createGrid.js
generated
vendored
Normal file
|
|
@ -0,0 +1,154 @@
|
|||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import isMuiElement from '@mui/utils/isMuiElement';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import systemStyled from "../styled/index.js";
|
||||
import useThemePropsSystem from "../useThemeProps/index.js";
|
||||
import useThemeSystem from "../useTheme/index.js";
|
||||
import { extendSxProp } from "../styleFunctionSx/index.js";
|
||||
import createTheme from "../createTheme/index.js";
|
||||
import { generateGridStyles, generateGridSizeStyles, generateGridColumnsStyles, generateGridColumnSpacingStyles, generateGridRowSpacingStyles, generateGridDirectionStyles, generateGridOffsetStyles, generateSizeClassNames, generateSpacingClassNames, generateDirectionClasses } from "./gridGenerator.js";
|
||||
import deleteLegacyGridProps from "./deleteLegacyGridProps.js";
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
const defaultTheme = createTheme();
|
||||
|
||||
// widening Theme to any so that the consumer can own the theme structure.
|
||||
const defaultCreateStyledComponent = systemStyled('div', {
|
||||
name: 'MuiGrid',
|
||||
slot: 'Root'
|
||||
});
|
||||
function useThemePropsDefault(props) {
|
||||
return useThemePropsSystem({
|
||||
props,
|
||||
name: 'MuiGrid',
|
||||
defaultTheme
|
||||
});
|
||||
}
|
||||
export default function createGrid(options = {}) {
|
||||
const {
|
||||
// This will allow adding custom styled fn (for example for custom sx style function)
|
||||
createStyledComponent = defaultCreateStyledComponent,
|
||||
useThemeProps = useThemePropsDefault,
|
||||
useTheme = useThemeSystem,
|
||||
componentName = 'MuiGrid'
|
||||
} = options;
|
||||
const useUtilityClasses = (ownerState, theme) => {
|
||||
const {
|
||||
container,
|
||||
direction,
|
||||
spacing,
|
||||
wrap,
|
||||
size
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root', container && 'container', wrap !== 'wrap' && `wrap-xs-${String(wrap)}`, ...generateDirectionClasses(direction), ...generateSizeClassNames(size), ...(container ? generateSpacingClassNames(spacing, theme.breakpoints.keys[0]) : [])]
|
||||
};
|
||||
return composeClasses(slots, slot => generateUtilityClass(componentName, slot), {});
|
||||
};
|
||||
function parseResponsiveProp(propValue, breakpoints, shouldUseValue = () => true) {
|
||||
const parsedProp = {};
|
||||
if (propValue === null) {
|
||||
return parsedProp;
|
||||
}
|
||||
if (Array.isArray(propValue)) {
|
||||
propValue.forEach((value, index) => {
|
||||
if (value !== null && shouldUseValue(value) && breakpoints.keys[index]) {
|
||||
parsedProp[breakpoints.keys[index]] = value;
|
||||
}
|
||||
});
|
||||
} else if (typeof propValue === 'object') {
|
||||
Object.keys(propValue).forEach(key => {
|
||||
const value = propValue[key];
|
||||
if (value !== null && value !== undefined && shouldUseValue(value)) {
|
||||
parsedProp[key] = value;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
parsedProp[breakpoints.keys[0]] = propValue;
|
||||
}
|
||||
return parsedProp;
|
||||
}
|
||||
const GridRoot = createStyledComponent(generateGridColumnsStyles, generateGridColumnSpacingStyles, generateGridRowSpacingStyles, generateGridSizeStyles, generateGridDirectionStyles, generateGridStyles, generateGridOffsetStyles);
|
||||
const Grid = /*#__PURE__*/React.forwardRef(function Grid(inProps, ref) {
|
||||
const theme = useTheme();
|
||||
const themeProps = useThemeProps(inProps);
|
||||
const props = extendSxProp(themeProps); // `color` type conflicts with html color attribute.
|
||||
|
||||
// TODO v8: Remove when removing the legacy Grid component
|
||||
deleteLegacyGridProps(props, theme.breakpoints);
|
||||
const {
|
||||
className,
|
||||
children,
|
||||
columns: columnsProp = 12,
|
||||
container = false,
|
||||
component = 'div',
|
||||
direction = 'row',
|
||||
wrap = 'wrap',
|
||||
size: sizeProp = {},
|
||||
offset: offsetProp = {},
|
||||
spacing: spacingProp = 0,
|
||||
rowSpacing: rowSpacingProp = spacingProp,
|
||||
columnSpacing: columnSpacingProp = spacingProp,
|
||||
unstable_level: level = 0,
|
||||
...other
|
||||
} = props;
|
||||
const size = parseResponsiveProp(sizeProp, theme.breakpoints, val => val !== false);
|
||||
const offset = parseResponsiveProp(offsetProp, theme.breakpoints);
|
||||
const columns = inProps.columns ?? (level ? undefined : columnsProp);
|
||||
const spacing = inProps.spacing ?? (level ? undefined : spacingProp);
|
||||
const rowSpacing = inProps.rowSpacing ?? inProps.spacing ?? (level ? undefined : rowSpacingProp);
|
||||
const columnSpacing = inProps.columnSpacing ?? inProps.spacing ?? (level ? undefined : columnSpacingProp);
|
||||
const ownerState = {
|
||||
...props,
|
||||
level,
|
||||
columns,
|
||||
container,
|
||||
direction,
|
||||
wrap,
|
||||
spacing,
|
||||
rowSpacing,
|
||||
columnSpacing,
|
||||
size,
|
||||
offset
|
||||
};
|
||||
const classes = useUtilityClasses(ownerState, theme);
|
||||
return /*#__PURE__*/_jsx(GridRoot, {
|
||||
ref: ref,
|
||||
as: component,
|
||||
ownerState: ownerState,
|
||||
className: clsx(classes.root, className),
|
||||
...other,
|
||||
children: React.Children.map(children, child => {
|
||||
if (/*#__PURE__*/React.isValidElement(child) && isMuiElement(child, ['Grid']) && container && child.props.container) {
|
||||
return /*#__PURE__*/React.cloneElement(child, {
|
||||
unstable_level: child.props?.unstable_level ?? level + 1
|
||||
});
|
||||
}
|
||||
return child;
|
||||
})
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? Grid.propTypes /* remove-proptypes */ = {
|
||||
children: PropTypes.node,
|
||||
className: PropTypes.string,
|
||||
columns: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number, PropTypes.object]),
|
||||
columnSpacing: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
|
||||
component: PropTypes.elementType,
|
||||
container: PropTypes.bool,
|
||||
direction: PropTypes.oneOfType([PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), PropTypes.arrayOf(PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), PropTypes.object]),
|
||||
offset: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])), PropTypes.object]),
|
||||
rowSpacing: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
|
||||
size: PropTypes.oneOfType([PropTypes.string, PropTypes.bool, PropTypes.number, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.bool, PropTypes.number])), PropTypes.object]),
|
||||
spacing: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
|
||||
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
||||
wrap: PropTypes.oneOf(['nowrap', 'wrap-reverse', 'wrap'])
|
||||
} : void 0;
|
||||
|
||||
// @ts-ignore internal logic for nested grid
|
||||
Grid.muiName = 'Grid';
|
||||
return Grid;
|
||||
}
|
||||
11
node_modules/@mui/system/esm/Grid/deleteLegacyGridProps.d.ts
generated
vendored
Normal file
11
node_modules/@mui/system/esm/Grid/deleteLegacyGridProps.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { Breakpoint, Breakpoints } from "../createTheme/index.js";
|
||||
/**
|
||||
* Deletes the legacy Grid component props from the `props` object and warns once about them if found.
|
||||
*
|
||||
* @param {object} props The props object to remove the legacy Grid props from.
|
||||
* @param {Breakpoints} breakpoints The breakpoints object.
|
||||
*/
|
||||
export default function deleteLegacyGridProps(props: {
|
||||
item?: boolean;
|
||||
zeroMinWidth?: boolean;
|
||||
} & Partial<Record<Breakpoint, 'auto' | number | boolean>> & Record<string, any>, breakpoints: Breakpoints): void;
|
||||
41
node_modules/@mui/system/esm/Grid/deleteLegacyGridProps.js
generated
vendored
Normal file
41
node_modules/@mui/system/esm/Grid/deleteLegacyGridProps.js
generated
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
const getLegacyGridWarning = propName => {
|
||||
if (['item', 'zeroMinWidth'].includes(propName)) {
|
||||
return `The \`${propName}\` prop has been removed and is no longer necessary. You can safely remove it.`;
|
||||
}
|
||||
|
||||
// #host-reference
|
||||
return `The \`${propName}\` prop has been removed. See https://mui.com/material-ui/migration/upgrade-to-grid-v2/ for migration instructions.`;
|
||||
};
|
||||
const warnedAboutProps = [];
|
||||
|
||||
/**
|
||||
* Deletes the legacy Grid component props from the `props` object and warns once about them if found.
|
||||
*
|
||||
* @param {object} props The props object to remove the legacy Grid props from.
|
||||
* @param {Breakpoints} breakpoints The breakpoints object.
|
||||
*/
|
||||
export default function deleteLegacyGridProps(props, breakpoints) {
|
||||
const propsToWarn = [];
|
||||
if (props.item !== undefined) {
|
||||
delete props.item;
|
||||
propsToWarn.push('item');
|
||||
}
|
||||
if (props.zeroMinWidth !== undefined) {
|
||||
delete props.zeroMinWidth;
|
||||
propsToWarn.push('zeroMinWidth');
|
||||
}
|
||||
breakpoints.keys.forEach(breakpoint => {
|
||||
if (props[breakpoint] !== undefined) {
|
||||
propsToWarn.push(breakpoint);
|
||||
delete props[breakpoint];
|
||||
}
|
||||
});
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
propsToWarn.forEach(prop => {
|
||||
if (!warnedAboutProps.includes(prop)) {
|
||||
warnedAboutProps.push(prop);
|
||||
console.warn(`MUI Grid: ${getLegacyGridWarning(prop)}\n`);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
20
node_modules/@mui/system/esm/Grid/gridClasses.d.ts
generated
vendored
Normal file
20
node_modules/@mui/system/esm/Grid/gridClasses.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
export interface GridClasses {
|
||||
/** Styles applied to the root element. */
|
||||
root: string;
|
||||
/** Styles applied to the root element if `container={true}`. */
|
||||
container: string;
|
||||
/** Styles applied to the root element if `direction="column"`. */
|
||||
'direction-xs-column': string;
|
||||
/** Styles applied to the root element if `direction="column-reverse"`. */
|
||||
'direction-xs-column-reverse': string;
|
||||
/** Styles applied to the root element if `direction="row-reverse"`. */
|
||||
'direction-xs-row-reverse': string;
|
||||
/** Styles applied to the root element if `wrap="nowrap"`. */
|
||||
'wrap-xs-nowrap': string;
|
||||
/** Styles applied to the root element if `wrap="reverse"`. */
|
||||
'wrap-xs-wrap-reverse': string;
|
||||
}
|
||||
export type GridClassKey = keyof GridClasses;
|
||||
export declare function getGridUtilityClass(slot: string): string;
|
||||
declare const gridClasses: GridClasses;
|
||||
export default gridClasses;
|
||||
19
node_modules/@mui/system/esm/Grid/gridClasses.js
generated
vendored
Normal file
19
node_modules/@mui/system/esm/Grid/gridClasses.js
generated
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getGridUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiGrid', slot);
|
||||
}
|
||||
const SPACINGS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
||||
const DIRECTIONS = ['column-reverse', 'column', 'row-reverse', 'row'];
|
||||
const WRAPS = ['nowrap', 'wrap-reverse', 'wrap'];
|
||||
const GRID_SIZES = ['auto', 'grow', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
||||
const gridClasses = generateUtilityClasses('MuiGrid', ['root', 'container', 'item',
|
||||
// spacings
|
||||
...SPACINGS.map(spacing => `spacing-xs-${spacing}`),
|
||||
// direction values
|
||||
...DIRECTIONS.map(direction => `direction-xs-${direction}`),
|
||||
// wrap values
|
||||
...WRAPS.map(wrap => `wrap-xs-${wrap}`),
|
||||
// grid sizes for all breakpoints
|
||||
...GRID_SIZES.map(size => `grid-xs-${size}`), ...GRID_SIZES.map(size => `grid-sm-${size}`), ...GRID_SIZES.map(size => `grid-md-${size}`), ...GRID_SIZES.map(size => `grid-lg-${size}`), ...GRID_SIZES.map(size => `grid-xl-${size}`)]);
|
||||
export default gridClasses;
|
||||
42
node_modules/@mui/system/esm/Grid/gridGenerator.d.ts
generated
vendored
Normal file
42
node_modules/@mui/system/esm/Grid/gridGenerator.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
import { Breakpoints } from "../createBreakpoints/createBreakpoints.js";
|
||||
import { Spacing } from "../createTheme/createSpacing.js";
|
||||
import { ResponsiveStyleValue } from "../styleFunctionSx/index.js";
|
||||
import { GridDirection, GridOwnerState } from "./GridProps.js";
|
||||
interface Props {
|
||||
theme: {
|
||||
breakpoints: Breakpoints;
|
||||
spacing?: Spacing;
|
||||
};
|
||||
ownerState: GridOwnerState;
|
||||
}
|
||||
export declare const generateGridSizeStyles: ({
|
||||
theme,
|
||||
ownerState
|
||||
}: Props) => {};
|
||||
export declare const generateGridOffsetStyles: ({
|
||||
theme,
|
||||
ownerState
|
||||
}: Props) => {};
|
||||
export declare const generateGridColumnsStyles: ({
|
||||
theme,
|
||||
ownerState
|
||||
}: Props) => {};
|
||||
export declare const generateGridRowSpacingStyles: ({
|
||||
theme,
|
||||
ownerState
|
||||
}: Props) => {};
|
||||
export declare const generateGridColumnSpacingStyles: ({
|
||||
theme,
|
||||
ownerState
|
||||
}: Props) => {};
|
||||
export declare const generateGridDirectionStyles: ({
|
||||
theme,
|
||||
ownerState
|
||||
}: Props) => {};
|
||||
export declare const generateGridStyles: ({
|
||||
ownerState
|
||||
}: Props) => {};
|
||||
export declare const generateSizeClassNames: (size: GridOwnerState["size"]) => string[];
|
||||
export declare const generateSpacingClassNames: (spacing: GridOwnerState["spacing"], smallestBreakpoint?: string) => string[];
|
||||
export declare const generateDirectionClasses: (direction: ResponsiveStyleValue<GridDirection> | undefined) => string[];
|
||||
export {};
|
||||
193
node_modules/@mui/system/esm/Grid/gridGenerator.js
generated
vendored
Normal file
193
node_modules/@mui/system/esm/Grid/gridGenerator.js
generated
vendored
Normal file
|
|
@ -0,0 +1,193 @@
|
|||
import { traverseBreakpoints } from "./traverseBreakpoints.js";
|
||||
function getSelfSpacingVar(axis) {
|
||||
return `--Grid-${axis}Spacing`;
|
||||
}
|
||||
function getParentSpacingVar(axis) {
|
||||
return `--Grid-parent-${axis}Spacing`;
|
||||
}
|
||||
const selfColumnsVar = '--Grid-columns';
|
||||
const parentColumnsVar = '--Grid-parent-columns';
|
||||
export const generateGridSizeStyles = ({
|
||||
theme,
|
||||
ownerState
|
||||
}) => {
|
||||
const styles = {};
|
||||
traverseBreakpoints(theme.breakpoints, ownerState.size, (appendStyle, value) => {
|
||||
let style = {};
|
||||
if (value === 'grow') {
|
||||
style = {
|
||||
flexBasis: 0,
|
||||
flexGrow: 1,
|
||||
maxWidth: '100%'
|
||||
};
|
||||
}
|
||||
if (value === 'auto') {
|
||||
style = {
|
||||
flexBasis: 'auto',
|
||||
flexGrow: 0,
|
||||
flexShrink: 0,
|
||||
maxWidth: 'none',
|
||||
width: 'auto'
|
||||
};
|
||||
}
|
||||
if (typeof value === 'number') {
|
||||
style = {
|
||||
flexGrow: 0,
|
||||
flexBasis: 'auto',
|
||||
width: `calc(100% * ${value} / var(${parentColumnsVar}) - (var(${parentColumnsVar}) - ${value}) * (var(${getParentSpacingVar('column')}) / var(${parentColumnsVar})))`
|
||||
};
|
||||
}
|
||||
appendStyle(styles, style);
|
||||
});
|
||||
return styles;
|
||||
};
|
||||
export const generateGridOffsetStyles = ({
|
||||
theme,
|
||||
ownerState
|
||||
}) => {
|
||||
const styles = {};
|
||||
traverseBreakpoints(theme.breakpoints, ownerState.offset, (appendStyle, value) => {
|
||||
let style = {};
|
||||
if (value === 'auto') {
|
||||
style = {
|
||||
marginLeft: 'auto'
|
||||
};
|
||||
}
|
||||
if (typeof value === 'number') {
|
||||
style = {
|
||||
marginLeft: value === 0 ? '0px' : `calc(100% * ${value} / var(${parentColumnsVar}) + var(${getParentSpacingVar('column')}) * ${value} / var(${parentColumnsVar}))`
|
||||
};
|
||||
}
|
||||
appendStyle(styles, style);
|
||||
});
|
||||
return styles;
|
||||
};
|
||||
export const generateGridColumnsStyles = ({
|
||||
theme,
|
||||
ownerState
|
||||
}) => {
|
||||
if (!ownerState.container) {
|
||||
return {};
|
||||
}
|
||||
const styles = {
|
||||
[selfColumnsVar]: 12
|
||||
};
|
||||
traverseBreakpoints(theme.breakpoints, ownerState.columns, (appendStyle, value) => {
|
||||
const columns = value ?? 12;
|
||||
appendStyle(styles, {
|
||||
[selfColumnsVar]: columns,
|
||||
'> *': {
|
||||
[parentColumnsVar]: columns
|
||||
}
|
||||
});
|
||||
});
|
||||
return styles;
|
||||
};
|
||||
export const generateGridRowSpacingStyles = ({
|
||||
theme,
|
||||
ownerState
|
||||
}) => {
|
||||
if (!ownerState.container) {
|
||||
return {};
|
||||
}
|
||||
const styles = {};
|
||||
traverseBreakpoints(theme.breakpoints, ownerState.rowSpacing, (appendStyle, value) => {
|
||||
const spacing = typeof value === 'string' ? value : theme.spacing?.(value);
|
||||
appendStyle(styles, {
|
||||
[getSelfSpacingVar('row')]: spacing,
|
||||
'> *': {
|
||||
[getParentSpacingVar('row')]: spacing
|
||||
}
|
||||
});
|
||||
});
|
||||
return styles;
|
||||
};
|
||||
export const generateGridColumnSpacingStyles = ({
|
||||
theme,
|
||||
ownerState
|
||||
}) => {
|
||||
if (!ownerState.container) {
|
||||
return {};
|
||||
}
|
||||
const styles = {};
|
||||
traverseBreakpoints(theme.breakpoints, ownerState.columnSpacing, (appendStyle, value) => {
|
||||
const spacing = typeof value === 'string' ? value : theme.spacing?.(value);
|
||||
appendStyle(styles, {
|
||||
[getSelfSpacingVar('column')]: spacing,
|
||||
'> *': {
|
||||
[getParentSpacingVar('column')]: spacing
|
||||
}
|
||||
});
|
||||
});
|
||||
return styles;
|
||||
};
|
||||
export const generateGridDirectionStyles = ({
|
||||
theme,
|
||||
ownerState
|
||||
}) => {
|
||||
if (!ownerState.container) {
|
||||
return {};
|
||||
}
|
||||
const styles = {};
|
||||
traverseBreakpoints(theme.breakpoints, ownerState.direction, (appendStyle, value) => {
|
||||
appendStyle(styles, {
|
||||
flexDirection: value
|
||||
});
|
||||
});
|
||||
return styles;
|
||||
};
|
||||
export const generateGridStyles = ({
|
||||
ownerState
|
||||
}) => {
|
||||
return {
|
||||
minWidth: 0,
|
||||
boxSizing: 'border-box',
|
||||
...(ownerState.container && {
|
||||
display: 'flex',
|
||||
flexWrap: 'wrap',
|
||||
...(ownerState.wrap && ownerState.wrap !== 'wrap' && {
|
||||
flexWrap: ownerState.wrap
|
||||
}),
|
||||
gap: `var(${getSelfSpacingVar('row')}) var(${getSelfSpacingVar('column')})`
|
||||
})
|
||||
};
|
||||
};
|
||||
export const generateSizeClassNames = size => {
|
||||
const classNames = [];
|
||||
Object.entries(size).forEach(([key, value]) => {
|
||||
if (value !== false && value !== undefined) {
|
||||
classNames.push(`grid-${key}-${String(value)}`);
|
||||
}
|
||||
});
|
||||
return classNames;
|
||||
};
|
||||
export const generateSpacingClassNames = (spacing, smallestBreakpoint = 'xs') => {
|
||||
function isValidSpacing(val) {
|
||||
if (val === undefined) {
|
||||
return false;
|
||||
}
|
||||
return typeof val === 'string' && !Number.isNaN(Number(val)) || typeof val === 'number' && val > 0;
|
||||
}
|
||||
if (isValidSpacing(spacing)) {
|
||||
return [`spacing-${smallestBreakpoint}-${String(spacing)}`];
|
||||
}
|
||||
if (typeof spacing === 'object' && !Array.isArray(spacing)) {
|
||||
const classNames = [];
|
||||
Object.entries(spacing).forEach(([key, value]) => {
|
||||
if (isValidSpacing(value)) {
|
||||
classNames.push(`spacing-${key}-${String(value)}`);
|
||||
}
|
||||
});
|
||||
return classNames;
|
||||
}
|
||||
return [];
|
||||
};
|
||||
export const generateDirectionClasses = direction => {
|
||||
if (direction === undefined) {
|
||||
return [];
|
||||
}
|
||||
if (typeof direction === 'object') {
|
||||
return Object.entries(direction).map(([key, value]) => `direction-${key}-${value}`);
|
||||
}
|
||||
return [`direction-xs-${String(direction)}`];
|
||||
};
|
||||
7
node_modules/@mui/system/esm/Grid/index.d.ts
generated
vendored
Normal file
7
node_modules/@mui/system/esm/Grid/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
export { default } from "./Grid.js";
|
||||
export { default as createGrid } from "./createGrid.js";
|
||||
export * from "./GridProps.js";
|
||||
export { default as gridClasses } from "./gridClasses.js";
|
||||
export * from "./gridClasses.js";
|
||||
export { traverseBreakpoints as unstable_traverseBreakpoints } from "./traverseBreakpoints.js";
|
||||
export { generateDirectionClasses as unstable_generateDirectionClasses, generateSizeClassNames as unstable_generateSizeClassNames, generateSpacingClassNames as unstable_generateSpacingClassNames } from "./gridGenerator.js";
|
||||
7
node_modules/@mui/system/esm/Grid/index.js
generated
vendored
Normal file
7
node_modules/@mui/system/esm/Grid/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
export { default } from "./Grid.js";
|
||||
export { default as createGrid } from "./createGrid.js";
|
||||
export * from "./GridProps.js";
|
||||
export { default as gridClasses } from "./gridClasses.js";
|
||||
export * from "./gridClasses.js";
|
||||
export { traverseBreakpoints as unstable_traverseBreakpoints } from "./traverseBreakpoints.js";
|
||||
export { generateDirectionClasses as unstable_generateDirectionClasses, generateSizeClassNames as unstable_generateSizeClassNames, generateSpacingClassNames as unstable_generateSpacingClassNames } from "./gridGenerator.js";
|
||||
7
node_modules/@mui/system/esm/Grid/traverseBreakpoints.d.ts
generated
vendored
Normal file
7
node_modules/@mui/system/esm/Grid/traverseBreakpoints.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import { Breakpoints, Breakpoint } from "../createBreakpoints/createBreakpoints.js";
|
||||
export declare const filterBreakpointKeys: (breakpointsKeys: Breakpoint[], responsiveKeys: string[]) => Breakpoint[];
|
||||
interface Iterator<T> {
|
||||
(appendStyle: (responsiveStyles: Record<string, any>, style: object) => void, value: T): void;
|
||||
}
|
||||
export declare const traverseBreakpoints: <T = unknown>(breakpoints: Breakpoints, responsive: T | T[] | Record<string, any> | undefined, iterator: Iterator<T>) => void;
|
||||
export {};
|
||||
42
node_modules/@mui/system/esm/Grid/traverseBreakpoints.js
generated
vendored
Normal file
42
node_modules/@mui/system/esm/Grid/traverseBreakpoints.js
generated
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
export const filterBreakpointKeys = (breakpointsKeys, responsiveKeys) => breakpointsKeys.filter(key => responsiveKeys.includes(key));
|
||||
export const traverseBreakpoints = (breakpoints, responsive, iterator) => {
|
||||
const smallestBreakpoint = breakpoints.keys[0]; // the keys is sorted from smallest to largest by `createBreakpoints`.
|
||||
|
||||
if (Array.isArray(responsive)) {
|
||||
responsive.forEach((breakpointValue, index) => {
|
||||
iterator((responsiveStyles, style) => {
|
||||
if (index <= breakpoints.keys.length - 1) {
|
||||
if (index === 0) {
|
||||
Object.assign(responsiveStyles, style);
|
||||
} else {
|
||||
responsiveStyles[breakpoints.up(breakpoints.keys[index])] = style;
|
||||
}
|
||||
}
|
||||
}, breakpointValue);
|
||||
});
|
||||
} else if (responsive && typeof responsive === 'object') {
|
||||
// prevent null
|
||||
// responsive could be a very big object, pick the smallest responsive values
|
||||
|
||||
const keys = Object.keys(responsive).length > breakpoints.keys.length ? breakpoints.keys : filterBreakpointKeys(breakpoints.keys, Object.keys(responsive));
|
||||
keys.forEach(key => {
|
||||
if (breakpoints.keys.includes(key)) {
|
||||
// @ts-ignore already checked that responsive is an object
|
||||
const breakpointValue = responsive[key];
|
||||
if (breakpointValue !== undefined) {
|
||||
iterator((responsiveStyles, style) => {
|
||||
if (smallestBreakpoint === key) {
|
||||
Object.assign(responsiveStyles, style);
|
||||
} else {
|
||||
responsiveStyles[breakpoints.up(key)] = style;
|
||||
}
|
||||
}, breakpointValue);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (typeof responsive === 'number' || typeof responsive === 'string') {
|
||||
iterator((responsiveStyles, style) => {
|
||||
Object.assign(responsiveStyles, style);
|
||||
}, responsive);
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue