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,113 @@
import * as React from 'react';
import { SxProps } from '@mui/system';
import { Theme } from "../styles/index.js";
import { InternalStandardProps as StandardProps } from "../internal/index.js";
import { PaperProps } from "../Paper/index.js";
import { LinearProgressProps } from "../LinearProgress/index.js";
import { MobileStepperClasses } from "./mobileStepperClasses.js";
import { CreateSlotsAndSlotProps, SlotProps } from "../utils/types.js";
export interface MobileStepperSlots {
/**
* The component that renders the root slot.
* @default Paper
*/
root: React.ElementType;
/**
* The component that renders the progress slot.
* @default LinearProgress
*/
progress: React.ElementType;
/**
* The component that renders the dots slot.
* @default 'div'
*/
dots: React.ElementType;
/**
* The component that renders the dot slot.
* @default 'div'
*/
dot: React.ElementType;
}
export interface MobileStepperRootSlotPropsOverrides {}
export interface MobileStepperProgressSlotPropsOverrides {}
export interface MobileStepperDotsSlotPropsOverrides {}
export interface MobileStepperDotSlotPropsOverrides {}
export type MobileStepperSlotsAndSlotProps = CreateSlotsAndSlotProps<MobileStepperSlots, {
/**
* Props forwarded to the root slot.
* By default, the avaible props are based on the [Paper](https://mui.com/material-ui/api/paper/#props) component.
*/
root: SlotProps<React.ElementType<PaperProps>, MobileStepperRootSlotPropsOverrides, MobileStepperOwnerState>;
/**
* Props forwarded to the progress slot.
* By default, the avaible props are based on the [LinearProgress](https://mui.com/material-ui/api/linear-progress/#props) component.
*/
progress: SlotProps<React.ElementType<LinearProgressProps>, MobileStepperProgressSlotPropsOverrides, MobileStepperOwnerState>;
/**
* Props forwarded to the dots slot.
* By default, the avaible props are based on the div element.
*/
dots: SlotProps<'div', MobileStepperDotsSlotPropsOverrides, MobileStepperOwnerState>;
/**
* Props forwarded to the dot slot.
* By default, the avaible props are based on the div element.
*/
dot: SlotProps<'div', MobileStepperDotSlotPropsOverrides, MobileStepperOwnerState>;
}>;
export interface MobileStepperProps extends StandardProps<PaperProps, 'children' | 'variant'>, MobileStepperSlotsAndSlotProps {
/**
* Set the active step (zero based index).
* Defines which dot is highlighted when the variant is 'dots'.
* @default 0
*/
activeStep?: number;
/**
* A back button element. For instance, it can be a `Button` or an `IconButton`.
*/
backButton: React.ReactNode;
/**
* Override or extend the styles applied to the component.
*/
classes?: Partial<MobileStepperClasses>;
/**
* Props applied to the `LinearProgress` element.
* @deprecated Use `slotProps.progress` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
*/
LinearProgressProps?: Partial<LinearProgressProps>;
/**
* A next button element. For instance, it can be a `Button` or an `IconButton`.
*/
nextButton: React.ReactNode;
/**
* Set the positioning type.
* @default 'bottom'
*/
position?: 'bottom' | 'top' | 'static';
/**
* The total steps.
*/
steps: number;
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme>;
/**
* The variant to use.
* @default 'dots'
*/
variant?: 'text' | 'dots' | 'progress';
}
export interface MobileStepperOwnerState extends Omit<MobileStepperProps, 'slots' | 'slotProps'> {}
/**
*
* Demos:
*
* - [Stepper](https://mui.com/material-ui/react-stepper/)
*
* API:
*
* - [MobileStepper API](https://mui.com/material-ui/api/mobile-stepper/)
* - inherits [Paper API](https://mui.com/material-ui/api/paper/)
*/
export default function MobileStepper(props: MobileStepperProps): React.JSX.Element;

View file

@ -0,0 +1,304 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import integerPropType from '@mui/utils/integerPropType';
import composeClasses from '@mui/utils/composeClasses';
import Paper from "../Paper/index.js";
import capitalize from "../utils/capitalize.js";
import LinearProgress from "../LinearProgress/index.js";
import { styled } from "../zero-styled/index.js";
import memoTheme from "../utils/memoTheme.js";
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
import slotShouldForwardProp from "../styles/slotShouldForwardProp.js";
import { getMobileStepperUtilityClass } from "./mobileStepperClasses.js";
import useSlot from "../utils/useSlot.js";
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
const useUtilityClasses = ownerState => {
const {
classes,
position
} = ownerState;
const slots = {
root: ['root', `position${capitalize(position)}`],
dots: ['dots'],
dot: ['dot'],
dotActive: ['dotActive'],
progress: ['progress']
};
return composeClasses(slots, getMobileStepperUtilityClass, classes);
};
const MobileStepperRoot = styled(Paper, {
name: 'MuiMobileStepper',
slot: 'Root',
overridesResolver: (props, styles) => {
const {
ownerState
} = props;
return [styles.root, styles[`position${capitalize(ownerState.position)}`]];
}
})(memoTheme(({
theme
}) => ({
display: 'flex',
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
background: (theme.vars || theme).palette.background.default,
padding: 8,
variants: [{
props: ({
position
}) => position === 'top' || position === 'bottom',
style: {
position: 'fixed',
left: 0,
right: 0,
zIndex: (theme.vars || theme).zIndex.mobileStepper
}
}, {
props: {
position: 'top'
},
style: {
top: 0
}
}, {
props: {
position: 'bottom'
},
style: {
bottom: 0
}
}]
})));
const MobileStepperDots = styled('div', {
name: 'MuiMobileStepper',
slot: 'Dots'
})({
variants: [{
props: {
variant: 'dots'
},
style: {
display: 'flex',
flexDirection: 'row'
}
}]
});
const MobileStepperDot = styled('div', {
name: 'MuiMobileStepper',
slot: 'Dot',
shouldForwardProp: prop => slotShouldForwardProp(prop) && prop !== 'dotActive',
overridesResolver: (props, styles) => {
const {
dotActive
} = props;
return [styles.dot, dotActive && styles.dotActive];
}
})(memoTheme(({
theme
}) => ({
variants: [{
props: {
variant: 'dots'
},
style: {
transition: theme.transitions.create('background-color', {
duration: theme.transitions.duration.shortest
}),
backgroundColor: (theme.vars || theme).palette.action.disabled,
borderRadius: '50%',
width: 8,
height: 8,
margin: '0 2px'
}
}, {
props: {
variant: 'dots',
dotActive: true
},
style: {
backgroundColor: (theme.vars || theme).palette.primary.main
}
}]
})));
const MobileStepperProgress = styled(LinearProgress, {
name: 'MuiMobileStepper',
slot: 'Progress'
})({
variants: [{
props: {
variant: 'progress'
},
style: {
width: '50%'
}
}]
});
const MobileStepper = /*#__PURE__*/React.forwardRef(function MobileStepper(inProps, ref) {
const props = useDefaultProps({
props: inProps,
name: 'MuiMobileStepper'
});
const {
activeStep = 0,
backButton,
className,
LinearProgressProps,
nextButton,
position = 'bottom',
steps,
variant = 'dots',
slots = {},
slotProps = {},
...other
} = props;
const ownerState = {
...props,
activeStep,
position,
variant
};
let value;
if (variant === 'progress') {
if (steps === 1) {
value = 100;
} else {
value = Math.ceil(activeStep / (steps - 1) * 100);
}
}
const classes = useUtilityClasses(ownerState);
const externalForwardedProps = {
slots,
slotProps: {
progress: LinearProgressProps,
...slotProps
}
};
const [RootSlot, rootSlotProps] = useSlot('root', {
ref,
elementType: MobileStepperRoot,
shouldForwardComponentProp: true,
className: clsx(classes.root, className),
externalForwardedProps: {
...externalForwardedProps,
...other
},
ownerState,
additionalProps: {
square: true,
elevation: 0
}
});
const [DotsSlot, dotsSlotProps] = useSlot('dots', {
className: classes.dots,
elementType: MobileStepperDots,
externalForwardedProps,
ownerState
});
const [DotSlot, dotSlotProps] = useSlot('dot', {
elementType: MobileStepperDot,
externalForwardedProps,
ownerState
});
const [ProgressSlot, progressSlotProps] = useSlot('progress', {
className: classes.progress,
elementType: MobileStepperProgress,
shouldForwardComponentProp: true,
externalForwardedProps,
ownerState,
additionalProps: {
value,
variant: 'determinate'
}
});
return /*#__PURE__*/_jsxs(RootSlot, {
...rootSlotProps,
children: [backButton, variant === 'text' && /*#__PURE__*/_jsxs(React.Fragment, {
children: [activeStep + 1, " / ", steps]
}), variant === 'dots' && /*#__PURE__*/_jsx(DotsSlot, {
...dotsSlotProps,
children: [...new Array(steps)].map((_, index) => /*#__PURE__*/_jsx(DotSlot, {
...dotSlotProps,
className: clsx(classes.dot, dotSlotProps.className, index === activeStep && classes.dotActive),
dotActive: index === activeStep
}, index))
}), variant === 'progress' && /*#__PURE__*/_jsx(ProgressSlot, {
...progressSlotProps
}), nextButton]
});
});
process.env.NODE_ENV !== "production" ? MobileStepper.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`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* Set the active step (zero based index).
* Defines which dot is highlighted when the variant is 'dots'.
* @default 0
*/
activeStep: integerPropType,
/**
* A back button element. For instance, it can be a `Button` or an `IconButton`.
*/
backButton: PropTypes.node,
/**
* Override or extend the styles applied to the component.
*/
classes: PropTypes.object,
/**
* @ignore
*/
className: PropTypes.string,
/**
* Props applied to the `LinearProgress` element.
* @deprecated Use `slotProps.progress` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
*/
LinearProgressProps: PropTypes.object,
/**
* A next button element. For instance, it can be a `Button` or an `IconButton`.
*/
nextButton: PropTypes.node,
/**
* Set the positioning type.
* @default 'bottom'
*/
position: PropTypes.oneOf(['bottom', 'static', 'top']),
/**
* The props used for each slot inside.
* @default {}
*/
slotProps: PropTypes.shape({
dot: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
dots: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
progress: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
}),
/**
* The components used for each slot inside.
* @default {}
*/
slots: PropTypes.shape({
dot: PropTypes.elementType,
dots: PropTypes.elementType,
progress: PropTypes.elementType,
root: PropTypes.elementType
}),
/**
* The total steps.
*/
steps: integerPropType.isRequired,
/**
* 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]),
/**
* The variant to use.
* @default 'dots'
*/
variant: PropTypes.oneOf(['dots', 'progress', 'text'])
} : void 0;
export default MobileStepper;

View file

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

View file

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

View file

@ -0,0 +1,22 @@
export interface MobileStepperClasses {
/** Styles applied to the root element. */
root: string;
/** Styles applied to the root element if `position="bottom"`. */
positionBottom: string;
/** Styles applied to the root element if `position="top"`. */
positionTop: string;
/** Styles applied to the root element if `position="static"`. */
positionStatic: string;
/** Styles applied to the dots container if `variant="dots"`. */
dots: string;
/** Styles applied to each dot if `variant="dots"`. */
dot: string;
/** Styles applied to a dot if `variant="dots"` and this is the active step. */
dotActive: string;
/** Styles applied to the Linear Progress component if `variant="progress"`. */
progress: string;
}
export type MobileStepperClassKey = keyof MobileStepperClasses;
export declare function getMobileStepperUtilityClass(slot: string): string;
declare const mobileStepperClasses: MobileStepperClasses;
export default mobileStepperClasses;

View file

@ -0,0 +1,7 @@
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
import generateUtilityClass from '@mui/utils/generateUtilityClass';
export function getMobileStepperUtilityClass(slot) {
return generateUtilityClass('MuiMobileStepper', slot);
}
const mobileStepperClasses = generateUtilityClasses('MuiMobileStepper', ['root', 'positionBottom', 'positionTop', 'positionStatic', 'dots', 'dot', 'dotActive', 'progress']);
export default mobileStepperClasses;