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,68 @@
import * as React from 'react';
import { SxProps } from '@mui/system';
import { SlotComponentProps } from "../utils/types.js";
import { ButtonBaseProps } from "../ButtonBase/index.js";
import { Theme } from "../styles/index.js";
import SvgIcon from "../SvgIcon/index.js";
import { TabScrollButtonClasses } from "./tabScrollButtonClasses.js";
export interface TabScrollButtonStartIconSlotPropsOverrides {}
export interface TabScrollButtonEndIconSlotPropsOverrides {}
export interface TabScrollButtonOwnerState extends TabScrollButtonProps {
isRtl: boolean;
}
export interface TabScrollButtonProps extends ButtonBaseProps {
/**
* The content of the component.
*/
children?: React.ReactNode;
/**
* Override or extend the styles applied to the component.
*/
classes?: Partial<TabScrollButtonClasses>;
/**
* The components used for each slot inside.
* @default {}
*/
slots?: {
StartScrollButtonIcon?: React.ElementType;
EndScrollButtonIcon?: React.ElementType;
};
/**
* The extra props for the slot components.
* You can override the existing props or add new ones.
* @default {}
*/
slotProps?: {
startScrollButtonIcon?: SlotComponentProps<typeof SvgIcon, TabScrollButtonStartIconSlotPropsOverrides, TabScrollButtonOwnerState>;
endScrollButtonIcon?: SlotComponentProps<typeof SvgIcon, TabScrollButtonEndIconSlotPropsOverrides, TabScrollButtonOwnerState>;
};
/**
* The direction the button should indicate.
*/
direction: 'left' | 'right';
/**
* If `true`, the component is disabled.
* @default false
*/
disabled?: boolean;
/**
* The component orientation (layout flow direction).
*/
orientation: 'horizontal' | 'vertical';
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme>;
}
/**
*
* Demos:
*
* - [Tabs](https://mui.com/material-ui/react-tabs/)
*
* API:
*
* - [TabScrollButton API](https://mui.com/material-ui/api/tab-scroll-button/)
*/
export default function TabScrollButton(props: TabScrollButtonProps): React.JSX.Element;

View file

@ -0,0 +1,172 @@
'use client';
/* eslint-disable jsx-a11y/aria-role */
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import composeClasses from '@mui/utils/composeClasses';
import { useRtl } from '@mui/system/RtlProvider';
import useSlotProps from '@mui/utils/useSlotProps';
import KeyboardArrowLeft from "../internal/svg-icons/KeyboardArrowLeft.js";
import KeyboardArrowRight from "../internal/svg-icons/KeyboardArrowRight.js";
import ButtonBase from "../ButtonBase/index.js";
import { styled } from "../zero-styled/index.js";
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
import tabScrollButtonClasses, { getTabScrollButtonUtilityClass } from "./tabScrollButtonClasses.js";
import { jsx as _jsx } from "react/jsx-runtime";
const useUtilityClasses = ownerState => {
const {
classes,
orientation,
disabled
} = ownerState;
const slots = {
root: ['root', orientation, disabled && 'disabled']
};
return composeClasses(slots, getTabScrollButtonUtilityClass, classes);
};
const TabScrollButtonRoot = styled(ButtonBase, {
name: 'MuiTabScrollButton',
slot: 'Root',
overridesResolver: (props, styles) => {
const {
ownerState
} = props;
return [styles.root, ownerState.orientation && styles[ownerState.orientation]];
}
})({
width: 40,
flexShrink: 0,
opacity: 0.8,
[`&.${tabScrollButtonClasses.disabled}`]: {
opacity: 0
},
variants: [{
props: {
orientation: 'vertical'
},
style: {
width: '100%',
height: 40,
'& svg': {
transform: 'var(--TabScrollButton-svgRotate)'
}
}
}]
});
const TabScrollButton = /*#__PURE__*/React.forwardRef(function TabScrollButton(inProps, ref) {
const props = useDefaultProps({
props: inProps,
name: 'MuiTabScrollButton'
});
const {
className,
slots = {},
slotProps = {},
direction,
orientation,
disabled,
...other
} = props;
const isRtl = useRtl();
const ownerState = {
isRtl,
...props
};
const classes = useUtilityClasses(ownerState);
const StartButtonIcon = slots.StartScrollButtonIcon ?? KeyboardArrowLeft;
const EndButtonIcon = slots.EndScrollButtonIcon ?? KeyboardArrowRight;
const startButtonIconProps = useSlotProps({
elementType: StartButtonIcon,
externalSlotProps: slotProps.startScrollButtonIcon,
additionalProps: {
fontSize: 'small'
},
ownerState
});
const endButtonIconProps = useSlotProps({
elementType: EndButtonIcon,
externalSlotProps: slotProps.endScrollButtonIcon,
additionalProps: {
fontSize: 'small'
},
ownerState
});
return /*#__PURE__*/_jsx(TabScrollButtonRoot, {
component: "div",
className: clsx(classes.root, className),
ref: ref,
role: null,
ownerState: ownerState,
tabIndex: null,
...other,
style: {
...other.style,
...(orientation === 'vertical' && {
'--TabScrollButton-svgRotate': `rotate(${isRtl ? -90 : 90}deg)`
})
},
children: direction === 'left' ? /*#__PURE__*/_jsx(StartButtonIcon, {
...startButtonIconProps
}) : /*#__PURE__*/_jsx(EndButtonIcon, {
...endButtonIconProps
})
});
});
process.env.NODE_ENV !== "production" ? TabScrollButton.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.
*/
children: PropTypes.node,
/**
* Override or extend the styles applied to the component.
*/
classes: PropTypes.object,
/**
* @ignore
*/
className: PropTypes.string,
/**
* The direction the button should indicate.
*/
direction: PropTypes.oneOf(['left', 'right']).isRequired,
/**
* If `true`, the component is disabled.
* @default false
*/
disabled: PropTypes.bool,
/**
* The component orientation (layout flow direction).
*/
orientation: PropTypes.oneOf(['horizontal', 'vertical']).isRequired,
/**
* The extra props for the slot components.
* You can override the existing props or add new ones.
* @default {}
*/
slotProps: PropTypes.shape({
endScrollButtonIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
startScrollButtonIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
}),
/**
* The components used for each slot inside.
* @default {}
*/
slots: PropTypes.shape({
EndScrollButtonIcon: PropTypes.elementType,
StartScrollButtonIcon: PropTypes.elementType
}),
/**
* @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 TabScrollButton;

View file

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

View file

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

View file

@ -0,0 +1,12 @@
export interface TabScrollButtonClasses {
/** Styles applied to the root element. */
root: string;
/** Styles applied to the root element if `orientation="vertical"`. */
vertical: string;
/** State class applied to the root element if `disabled={true}`. */
disabled: string;
}
export type TabScrollButtonClassKey = keyof TabScrollButtonClasses;
export declare function getTabScrollButtonUtilityClass(slot: string): string;
declare const tabScrollButtonClasses: TabScrollButtonClasses;
export default tabScrollButtonClasses;

View file

@ -0,0 +1,7 @@
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
import generateUtilityClass from '@mui/utils/generateUtilityClass';
export function getTabScrollButtonUtilityClass(slot) {
return generateUtilityClass('MuiTabScrollButton', slot);
}
const tabScrollButtonClasses = generateUtilityClasses('MuiTabScrollButton', ['root', 'vertical', 'horizontal', 'disabled']);
export default tabScrollButtonClasses;