1
0
Fork 0

worked on GarageApp stuff

This commit is contained in:
Techognito 2025-08-25 17:46:11 +02:00
parent 60aaf17af3
commit eb606572b0
51919 changed files with 2168177 additions and 18 deletions

View file

@ -0,0 +1,48 @@
import * as React from 'react';
import { SxProps } from '@mui/system';
import { Theme } from "../styles/index.js";
import { OverridableComponent, OverrideProps } from "../OverridableComponent/index.js";
import { ImageListItemClasses } from "./imageListItemClasses.js";
export interface ImageListItemOwnProps {
/**
* The content of the component, normally an `<img>`.
*/
children?: React.ReactNode;
/**
* Override or extend the styles applied to the component.
*/
classes?: Partial<ImageListItemClasses>;
/**
* Width of the item in number of grid columns.
* @default 1
*/
cols?: number;
/**
* Height of the item in number of grid rows.
* @default 1
*/
rows?: number;
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme>;
}
export interface ImageListItemTypeMap<AdditionalProps = {}, RootComponent extends React.ElementType = 'li'> {
props: AdditionalProps & ImageListItemOwnProps;
defaultComponent: RootComponent;
}
/**
*
* Demos:
*
* - [Image List](https://mui.com/material-ui/react-image-list/)
*
* API:
*
* - [ImageListItem API](https://mui.com/material-ui/api/image-list-item/)
*/
declare const ImageListItem: OverridableComponent<ImageListItemTypeMap>;
export type ImageListItemProps<RootComponent extends React.ElementType = ImageListItemTypeMap['defaultComponent'], AdditionalProps = {}> = OverrideProps<ImageListItemTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
component?: React.ElementType;
};
export default ImageListItem;

View file

@ -0,0 +1,188 @@
'use client';
import composeClasses from '@mui/utils/composeClasses';
import integerPropType from '@mui/utils/integerPropType';
import clsx from 'clsx';
import PropTypes from 'prop-types';
import * as React from 'react';
import { isFragment } from 'react-is';
import ImageListContext from "../ImageList/ImageListContext.js";
import { styled } from "../zero-styled/index.js";
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
import isMuiElement from "../utils/isMuiElement.js";
import imageListItemClasses, { getImageListItemUtilityClass } from "./imageListItemClasses.js";
import { jsx as _jsx } from "react/jsx-runtime";
const useUtilityClasses = ownerState => {
const {
classes,
variant
} = ownerState;
const slots = {
root: ['root', variant],
img: ['img']
};
return composeClasses(slots, getImageListItemUtilityClass, classes);
};
const ImageListItemRoot = styled('li', {
name: 'MuiImageListItem',
slot: 'Root',
overridesResolver: (props, styles) => {
const {
ownerState
} = props;
return [{
[`& .${imageListItemClasses.img}`]: styles.img
}, styles.root, styles[ownerState.variant]];
}
})({
display: 'block',
position: 'relative',
[`& .${imageListItemClasses.img}`]: {
objectFit: 'cover',
width: '100%',
height: '100%',
display: 'block'
},
variants: [{
props: {
variant: 'standard'
},
style: {
// For titlebar under list item
display: 'flex',
flexDirection: 'column'
}
}, {
props: {
variant: 'woven'
},
style: {
height: '100%',
alignSelf: 'center',
'&:nth-of-type(even)': {
height: '70%'
}
}
}, {
props: {
variant: 'standard'
},
style: {
[`& .${imageListItemClasses.img}`]: {
height: 'auto',
flexGrow: 1
}
}
}]
});
const ImageListItem = /*#__PURE__*/React.forwardRef(function ImageListItem(inProps, ref) {
const props = useDefaultProps({
props: inProps,
name: 'MuiImageListItem'
});
// TODO: - Use jsdoc @default?: "cols rows default values are for docs only"
const {
children,
className,
cols = 1,
component = 'li',
rows = 1,
style,
...other
} = props;
const {
rowHeight = 'auto',
gap,
variant
} = React.useContext(ImageListContext);
let height = 'auto';
if (variant === 'woven') {
height = undefined;
} else if (rowHeight !== 'auto') {
height = rowHeight * rows + gap * (rows - 1);
}
const ownerState = {
...props,
cols,
component,
gap,
rowHeight,
rows,
variant
};
const classes = useUtilityClasses(ownerState);
return /*#__PURE__*/_jsx(ImageListItemRoot, {
as: component,
className: clsx(classes.root, classes[variant], className),
ref: ref,
style: {
height,
gridColumnEnd: variant !== 'masonry' ? `span ${cols}` : undefined,
gridRowEnd: variant !== 'masonry' ? `span ${rows}` : undefined,
marginBottom: variant === 'masonry' ? gap : undefined,
breakInside: variant === 'masonry' ? 'avoid' : undefined,
...style
},
ownerState: ownerState,
...other,
children: React.Children.map(children, child => {
if (! /*#__PURE__*/React.isValidElement(child)) {
return null;
}
if (process.env.NODE_ENV !== 'production') {
if (isFragment(child)) {
console.error(["MUI: The ImageListItem component doesn't accept a Fragment as a child.", 'Consider providing an array instead.'].join('\n'));
}
}
if (child.type === 'img' || isMuiElement(child, ['Image'])) {
return /*#__PURE__*/React.cloneElement(child, {
className: clsx(classes.img, child.props.className)
});
}
return child;
})
});
});
process.env.NODE_ENV !== "production" ? ImageListItem.propTypes /* remove-proptypes */ = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
// │ These PropTypes are generated from the TypeScript type definitions. │
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* The content of the component, normally an `<img>`.
*/
children: PropTypes.node,
/**
* Override or extend the styles applied to the component.
*/
classes: PropTypes.object,
/**
* @ignore
*/
className: PropTypes.string,
/**
* Width of the item in number of grid columns.
* @default 1
*/
cols: integerPropType,
/**
* The component used for the root node.
* Either a string to use a HTML element or a component.
*/
component: PropTypes.elementType,
/**
* Height of the item in number of grid rows.
* @default 1
*/
rows: integerPropType,
/**
* @ignore
*/
style: PropTypes.object,
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
} : void 0;
export default ImageListItem;

View file

@ -0,0 +1,18 @@
export interface ImageListItemClasses {
/** Styles applied to the root element. */
root: string;
/** Styles applied to an `img` element to ensure it covers the item. */
img: string;
/** Styles applied to the root element if `variant="standard"`. */
standard: string;
/** Styles applied to the root element if `variant="woven"`. */
woven: string;
/** Styles applied to the root element if `variant="masonry"`. */
masonry: string;
/** Styles applied to the root element if `variant="quilted"`. */
quilted: string;
}
export type ImageListItemClassKey = keyof ImageListItemClasses;
export declare function getImageListItemUtilityClass(slot: string): string;
declare const imageListItemClasses: ImageListItemClasses;
export default imageListItemClasses;

View file

@ -0,0 +1,7 @@
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
import generateUtilityClass from '@mui/utils/generateUtilityClass';
export function getImageListItemUtilityClass(slot) {
return generateUtilityClass('MuiImageListItem', slot);
}
const imageListItemClasses = generateUtilityClasses('MuiImageListItem', ['root', 'img', 'standard', 'woven', 'masonry', 'quilted']);
export default imageListItemClasses;

View file

@ -0,0 +1,4 @@
export * from "./ImageListItem.js";
export { default } from "./ImageListItem.js";
export * from "./imageListItemClasses.js";
export { default as imageListItemClasses } from "./imageListItemClasses.js";

View file

@ -0,0 +1,3 @@
export { default } from "./ImageListItem.js";
export * from "./imageListItemClasses.js";
export { default as imageListItemClasses } from "./imageListItemClasses.js";