worked on GarageApp stuff
This commit is contained in:
parent
60aaf17af3
commit
eb606572b0
51919 changed files with 2168177 additions and 18 deletions
69
node_modules/@mui/material/esm/MenuItem/MenuItem.d.ts
generated
vendored
Normal file
69
node_modules/@mui/material/esm/MenuItem/MenuItem.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
import * as React from 'react';
|
||||
import { SxProps } from '@mui/system';
|
||||
import { Theme } from "../styles/index.js";
|
||||
import { ExtendButtonBase, ExtendButtonBaseTypeMap } from "../ButtonBase/index.js";
|
||||
import { OverrideProps } from "../OverridableComponent/index.js";
|
||||
import { MenuItemClasses } from "./menuItemClasses.js";
|
||||
export interface MenuItemOwnProps {
|
||||
/**
|
||||
* If `true`, the list item is focused during the first mount.
|
||||
* Focus will also be triggered if the value changes from false to true.
|
||||
* @default false
|
||||
*/
|
||||
autoFocus?: boolean;
|
||||
/**
|
||||
* Override or extend the styles applied to the component.
|
||||
*/
|
||||
classes?: Partial<MenuItemClasses>;
|
||||
/**
|
||||
* If `true`, compact vertical padding designed for keyboard and mouse input is used.
|
||||
* The prop defaults to the value inherited from the parent Menu component.
|
||||
* @default false
|
||||
*/
|
||||
dense?: boolean;
|
||||
/**
|
||||
* If `true`, the component is disabled.
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean;
|
||||
/**
|
||||
* If `true`, the left and right padding is removed.
|
||||
* @default false
|
||||
*/
|
||||
disableGutters?: boolean;
|
||||
/**
|
||||
* If `true`, a 1px light border is added to the bottom of the menu item.
|
||||
* @default false
|
||||
*/
|
||||
divider?: boolean;
|
||||
/**
|
||||
* If `true`, the component is selected.
|
||||
* @default false
|
||||
*/
|
||||
selected?: boolean;
|
||||
/**
|
||||
* The system prop that allows defining system overrides as well as additional CSS styles.
|
||||
*/
|
||||
sx?: SxProps<Theme>;
|
||||
}
|
||||
export type MenuItemTypeMap<AdditionalProps = {}, RootComponent extends React.ElementType = 'li'> = ExtendButtonBaseTypeMap<{
|
||||
props: AdditionalProps & MenuItemOwnProps;
|
||||
defaultComponent: RootComponent;
|
||||
}>;
|
||||
|
||||
/**
|
||||
*
|
||||
* Demos:
|
||||
*
|
||||
* - [Menu](https://mui.com/material-ui/react-menu/)
|
||||
*
|
||||
* API:
|
||||
*
|
||||
* - [MenuItem API](https://mui.com/material-ui/api/menu-item/)
|
||||
* - inherits [ButtonBase API](https://mui.com/material-ui/api/button-base/)
|
||||
*/
|
||||
declare const MenuItem: ExtendButtonBase<MenuItemTypeMap>;
|
||||
export type MenuItemProps<RootComponent extends React.ElementType = MenuItemTypeMap['defaultComponent'], AdditionalProps = {}> = OverrideProps<MenuItemTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
|
||||
component?: React.ElementType;
|
||||
};
|
||||
export default MenuItem;
|
||||
282
node_modules/@mui/material/esm/MenuItem/MenuItem.js
generated
vendored
Normal file
282
node_modules/@mui/material/esm/MenuItem/MenuItem.js
generated
vendored
Normal file
|
|
@ -0,0 +1,282 @@
|
|||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import rootShouldForwardProp from "../styles/rootShouldForwardProp.js";
|
||||
import { styled } from "../zero-styled/index.js";
|
||||
import memoTheme from "../utils/memoTheme.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import ListContext from "../List/ListContext.js";
|
||||
import ButtonBase from "../ButtonBase/index.js";
|
||||
import useEnhancedEffect from "../utils/useEnhancedEffect.js";
|
||||
import useForkRef from "../utils/useForkRef.js";
|
||||
import { dividerClasses } from "../Divider/index.js";
|
||||
import { listItemIconClasses } from "../ListItemIcon/index.js";
|
||||
import { listItemTextClasses } from "../ListItemText/index.js";
|
||||
import menuItemClasses, { getMenuItemUtilityClass } from "./menuItemClasses.js";
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
export const overridesResolver = (props, styles) => {
|
||||
const {
|
||||
ownerState
|
||||
} = props;
|
||||
return [styles.root, ownerState.dense && styles.dense, ownerState.divider && styles.divider, !ownerState.disableGutters && styles.gutters];
|
||||
};
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
disabled,
|
||||
dense,
|
||||
divider,
|
||||
disableGutters,
|
||||
selected,
|
||||
classes
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root', dense && 'dense', disabled && 'disabled', !disableGutters && 'gutters', divider && 'divider', selected && 'selected']
|
||||
};
|
||||
const composedClasses = composeClasses(slots, getMenuItemUtilityClass, classes);
|
||||
return {
|
||||
...classes,
|
||||
...composedClasses
|
||||
};
|
||||
};
|
||||
const MenuItemRoot = styled(ButtonBase, {
|
||||
shouldForwardProp: prop => rootShouldForwardProp(prop) || prop === 'classes',
|
||||
name: 'MuiMenuItem',
|
||||
slot: 'Root',
|
||||
overridesResolver
|
||||
})(memoTheme(({
|
||||
theme
|
||||
}) => ({
|
||||
...theme.typography.body1,
|
||||
display: 'flex',
|
||||
justifyContent: 'flex-start',
|
||||
alignItems: 'center',
|
||||
position: 'relative',
|
||||
textDecoration: 'none',
|
||||
minHeight: 48,
|
||||
paddingTop: 6,
|
||||
paddingBottom: 6,
|
||||
boxSizing: 'border-box',
|
||||
whiteSpace: 'nowrap',
|
||||
'&:hover': {
|
||||
textDecoration: 'none',
|
||||
backgroundColor: (theme.vars || theme).palette.action.hover,
|
||||
// Reset on touch devices, it doesn't add specificity
|
||||
'@media (hover: none)': {
|
||||
backgroundColor: 'transparent'
|
||||
}
|
||||
},
|
||||
[`&.${menuItemClasses.selected}`]: {
|
||||
backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, (theme.vars || theme).palette.action.selectedOpacity),
|
||||
[`&.${menuItemClasses.focusVisible}`]: {
|
||||
backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, `${(theme.vars || theme).palette.action.selectedOpacity} + ${(theme.vars || theme).palette.action.focusOpacity}`)
|
||||
}
|
||||
},
|
||||
[`&.${menuItemClasses.selected}:hover`]: {
|
||||
backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, `${(theme.vars || theme).palette.action.selectedOpacity} + ${(theme.vars || theme).palette.action.hoverOpacity}`),
|
||||
// Reset on touch devices, it doesn't add specificity
|
||||
'@media (hover: none)': {
|
||||
backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, (theme.vars || theme).palette.action.selectedOpacity)
|
||||
}
|
||||
},
|
||||
[`&.${menuItemClasses.focusVisible}`]: {
|
||||
backgroundColor: (theme.vars || theme).palette.action.focus
|
||||
},
|
||||
[`&.${menuItemClasses.disabled}`]: {
|
||||
opacity: (theme.vars || theme).palette.action.disabledOpacity
|
||||
},
|
||||
[`& + .${dividerClasses.root}`]: {
|
||||
marginTop: theme.spacing(1),
|
||||
marginBottom: theme.spacing(1)
|
||||
},
|
||||
[`& + .${dividerClasses.inset}`]: {
|
||||
marginLeft: 52
|
||||
},
|
||||
[`& .${listItemTextClasses.root}`]: {
|
||||
marginTop: 0,
|
||||
marginBottom: 0
|
||||
},
|
||||
[`& .${listItemTextClasses.inset}`]: {
|
||||
paddingLeft: 36
|
||||
},
|
||||
[`& .${listItemIconClasses.root}`]: {
|
||||
minWidth: 36
|
||||
},
|
||||
variants: [{
|
||||
props: ({
|
||||
ownerState
|
||||
}) => !ownerState.disableGutters,
|
||||
style: {
|
||||
paddingLeft: 16,
|
||||
paddingRight: 16
|
||||
}
|
||||
}, {
|
||||
props: ({
|
||||
ownerState
|
||||
}) => ownerState.divider,
|
||||
style: {
|
||||
borderBottom: `1px solid ${(theme.vars || theme).palette.divider}`,
|
||||
backgroundClip: 'padding-box'
|
||||
}
|
||||
}, {
|
||||
props: ({
|
||||
ownerState
|
||||
}) => !ownerState.dense,
|
||||
style: {
|
||||
[theme.breakpoints.up('sm')]: {
|
||||
minHeight: 'auto'
|
||||
}
|
||||
}
|
||||
}, {
|
||||
props: ({
|
||||
ownerState
|
||||
}) => ownerState.dense,
|
||||
style: {
|
||||
minHeight: 32,
|
||||
// https://m2.material.io/components/menus#specs > Dense
|
||||
paddingTop: 4,
|
||||
paddingBottom: 4,
|
||||
...theme.typography.body2,
|
||||
[`& .${listItemIconClasses.root} svg`]: {
|
||||
fontSize: '1.25rem'
|
||||
}
|
||||
}
|
||||
}]
|
||||
})));
|
||||
const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiMenuItem'
|
||||
});
|
||||
const {
|
||||
autoFocus = false,
|
||||
component = 'li',
|
||||
dense = false,
|
||||
divider = false,
|
||||
disableGutters = false,
|
||||
focusVisibleClassName,
|
||||
role = 'menuitem',
|
||||
tabIndex: tabIndexProp,
|
||||
className,
|
||||
...other
|
||||
} = props;
|
||||
const context = React.useContext(ListContext);
|
||||
const childContext = React.useMemo(() => ({
|
||||
dense: dense || context.dense || false,
|
||||
disableGutters
|
||||
}), [context.dense, dense, disableGutters]);
|
||||
const menuItemRef = React.useRef(null);
|
||||
useEnhancedEffect(() => {
|
||||
if (autoFocus) {
|
||||
if (menuItemRef.current) {
|
||||
menuItemRef.current.focus();
|
||||
} else if (process.env.NODE_ENV !== 'production') {
|
||||
console.error('MUI: Unable to set focus to a MenuItem whose component has not been rendered.');
|
||||
}
|
||||
}
|
||||
}, [autoFocus]);
|
||||
const ownerState = {
|
||||
...props,
|
||||
dense: childContext.dense,
|
||||
divider,
|
||||
disableGutters
|
||||
};
|
||||
const classes = useUtilityClasses(props);
|
||||
const handleRef = useForkRef(menuItemRef, ref);
|
||||
let tabIndex;
|
||||
if (!props.disabled) {
|
||||
tabIndex = tabIndexProp !== undefined ? tabIndexProp : -1;
|
||||
}
|
||||
return /*#__PURE__*/_jsx(ListContext.Provider, {
|
||||
value: childContext,
|
||||
children: /*#__PURE__*/_jsx(MenuItemRoot, {
|
||||
ref: handleRef,
|
||||
role: role,
|
||||
tabIndex: tabIndex,
|
||||
component: component,
|
||||
focusVisibleClassName: clsx(classes.focusVisible, focusVisibleClassName),
|
||||
className: clsx(classes.root, className),
|
||||
...other,
|
||||
ownerState: ownerState,
|
||||
classes: classes
|
||||
})
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? MenuItem.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`. │
|
||||
// └─────────────────────────────────────────────────────────────────────┘
|
||||
/**
|
||||
* If `true`, the list item is focused during the first mount.
|
||||
* Focus will also be triggered if the value changes from false to true.
|
||||
* @default false
|
||||
*/
|
||||
autoFocus: PropTypes.bool,
|
||||
/**
|
||||
* 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 component used for the root node.
|
||||
* Either a string to use a HTML element or a component.
|
||||
*/
|
||||
component: PropTypes.elementType,
|
||||
/**
|
||||
* If `true`, compact vertical padding designed for keyboard and mouse input is used.
|
||||
* The prop defaults to the value inherited from the parent Menu component.
|
||||
* @default false
|
||||
*/
|
||||
dense: PropTypes.bool,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
disabled: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, the left and right padding is removed.
|
||||
* @default false
|
||||
*/
|
||||
disableGutters: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, a 1px light border is added to the bottom of the menu item.
|
||||
* @default false
|
||||
*/
|
||||
divider: PropTypes.bool,
|
||||
/**
|
||||
* This prop can help identify which element has keyboard focus.
|
||||
* The class name will be applied when the element gains the focus through keyboard interaction.
|
||||
* It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
|
||||
* The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
|
||||
* A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
|
||||
* if needed.
|
||||
*/
|
||||
focusVisibleClassName: PropTypes.string,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
role: PropTypes /* @typescript-to-proptypes-ignore */.string,
|
||||
/**
|
||||
* If `true`, the component is selected.
|
||||
* @default false
|
||||
*/
|
||||
selected: PropTypes.bool,
|
||||
/**
|
||||
* 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]),
|
||||
/**
|
||||
* @default 0
|
||||
*/
|
||||
tabIndex: PropTypes.number
|
||||
} : void 0;
|
||||
export default MenuItem;
|
||||
4
node_modules/@mui/material/esm/MenuItem/index.d.ts
generated
vendored
Normal file
4
node_modules/@mui/material/esm/MenuItem/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
export { default } from "./MenuItem.js";
|
||||
export * from "./MenuItem.js";
|
||||
export * from "./menuItemClasses.js";
|
||||
export { default as menuItemClasses } from "./menuItemClasses.js";
|
||||
3
node_modules/@mui/material/esm/MenuItem/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/esm/MenuItem/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
export { default } from "./MenuItem.js";
|
||||
export * from "./menuItemClasses.js";
|
||||
export { default as menuItemClasses } from "./menuItemClasses.js";
|
||||
20
node_modules/@mui/material/esm/MenuItem/menuItemClasses.d.ts
generated
vendored
Normal file
20
node_modules/@mui/material/esm/MenuItem/menuItemClasses.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
export interface MenuItemClasses {
|
||||
/** Styles applied to the root element. */
|
||||
root: string;
|
||||
/** State class applied to the root element if keyboard focused. */
|
||||
focusVisible: string;
|
||||
/** Styles applied to the root element if dense. */
|
||||
dense: string;
|
||||
/** State class applied to the root element if `disabled={true}`. */
|
||||
disabled: string;
|
||||
/** Styles applied to the root element if `divider={true}`. */
|
||||
divider: string;
|
||||
/** Styles applied to the inner `component` element unless `disableGutters={true}`. */
|
||||
gutters: string;
|
||||
/** State class applied to the root element if `selected={true}`. */
|
||||
selected: string;
|
||||
}
|
||||
export type MenuItemClassKey = keyof MenuItemClasses;
|
||||
export declare function getMenuItemUtilityClass(slot: string): string;
|
||||
declare const menuItemClasses: MenuItemClasses;
|
||||
export default menuItemClasses;
|
||||
7
node_modules/@mui/material/esm/MenuItem/menuItemClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/esm/MenuItem/menuItemClasses.js
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getMenuItemUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiMenuItem', slot);
|
||||
}
|
||||
const menuItemClasses = generateUtilityClasses('MuiMenuItem', ['root', 'focusVisible', 'dense', 'disabled', 'divider', 'gutters', 'selected']);
|
||||
export default menuItemClasses;
|
||||
Loading…
Add table
Add a link
Reference in a new issue