paradiego
This commit is contained in:
314
node_modules/@mui/material/modern/Accordion/Accordion.js
generated
vendored
Normal file
314
node_modules/@mui/material/modern/Accordion/Accordion.js
generated
vendored
Normal file
@@ -0,0 +1,314 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import { isFragment } from 'react-is';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import chainPropTypes from '@mui/utils/chainPropTypes';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import { styled } from "../zero-styled/index.js";
|
||||
import memoTheme from "../utils/memoTheme.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import Collapse from "../Collapse/index.js";
|
||||
import Paper from "../Paper/index.js";
|
||||
import AccordionContext from "./AccordionContext.js";
|
||||
import useControlled from "../utils/useControlled.js";
|
||||
import useSlot from "../utils/useSlot.js";
|
||||
import accordionClasses, { getAccordionUtilityClass } from "./accordionClasses.js";
|
||||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
classes,
|
||||
square,
|
||||
expanded,
|
||||
disabled,
|
||||
disableGutters
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root', !square && 'rounded', expanded && 'expanded', disabled && 'disabled', !disableGutters && 'gutters'],
|
||||
heading: ['heading'],
|
||||
region: ['region']
|
||||
};
|
||||
return composeClasses(slots, getAccordionUtilityClass, classes);
|
||||
};
|
||||
const AccordionRoot = styled(Paper, {
|
||||
name: 'MuiAccordion',
|
||||
slot: 'Root',
|
||||
overridesResolver: (props, styles) => {
|
||||
const {
|
||||
ownerState
|
||||
} = props;
|
||||
return [{
|
||||
[`& .${accordionClasses.region}`]: styles.region
|
||||
}, styles.root, !ownerState.square && styles.rounded, !ownerState.disableGutters && styles.gutters];
|
||||
}
|
||||
})(memoTheme(({
|
||||
theme
|
||||
}) => {
|
||||
const transition = {
|
||||
duration: theme.transitions.duration.shortest
|
||||
};
|
||||
return {
|
||||
position: 'relative',
|
||||
transition: theme.transitions.create(['margin'], transition),
|
||||
overflowAnchor: 'none',
|
||||
// Keep the same scrolling position
|
||||
'&::before': {
|
||||
position: 'absolute',
|
||||
left: 0,
|
||||
top: -1,
|
||||
right: 0,
|
||||
height: 1,
|
||||
content: '""',
|
||||
opacity: 1,
|
||||
backgroundColor: (theme.vars || theme).palette.divider,
|
||||
transition: theme.transitions.create(['opacity', 'background-color'], transition)
|
||||
},
|
||||
'&:first-of-type': {
|
||||
'&::before': {
|
||||
display: 'none'
|
||||
}
|
||||
},
|
||||
[`&.${accordionClasses.expanded}`]: {
|
||||
'&::before': {
|
||||
opacity: 0
|
||||
},
|
||||
'&:first-of-type': {
|
||||
marginTop: 0
|
||||
},
|
||||
'&:last-of-type': {
|
||||
marginBottom: 0
|
||||
},
|
||||
'& + &': {
|
||||
'&::before': {
|
||||
display: 'none'
|
||||
}
|
||||
}
|
||||
},
|
||||
[`&.${accordionClasses.disabled}`]: {
|
||||
backgroundColor: (theme.vars || theme).palette.action.disabledBackground
|
||||
}
|
||||
};
|
||||
}), memoTheme(({
|
||||
theme
|
||||
}) => ({
|
||||
variants: [{
|
||||
props: props => !props.square,
|
||||
style: {
|
||||
borderRadius: 0,
|
||||
'&:first-of-type': {
|
||||
borderTopLeftRadius: (theme.vars || theme).shape.borderRadius,
|
||||
borderTopRightRadius: (theme.vars || theme).shape.borderRadius
|
||||
},
|
||||
'&:last-of-type': {
|
||||
borderBottomLeftRadius: (theme.vars || theme).shape.borderRadius,
|
||||
borderBottomRightRadius: (theme.vars || theme).shape.borderRadius,
|
||||
// Fix a rendering issue on Edge
|
||||
'@supports (-ms-ime-align: auto)': {
|
||||
borderBottomLeftRadius: 0,
|
||||
borderBottomRightRadius: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
props: props => !props.disableGutters,
|
||||
style: {
|
||||
[`&.${accordionClasses.expanded}`]: {
|
||||
margin: '16px 0'
|
||||
}
|
||||
}
|
||||
}]
|
||||
})));
|
||||
const AccordionHeading = styled('h3', {
|
||||
name: 'MuiAccordion',
|
||||
slot: 'Heading',
|
||||
overridesResolver: (props, styles) => styles.heading
|
||||
})({
|
||||
all: 'unset'
|
||||
});
|
||||
const Accordion = /*#__PURE__*/React.forwardRef(function Accordion(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiAccordion'
|
||||
});
|
||||
const {
|
||||
children: childrenProp,
|
||||
className,
|
||||
defaultExpanded = false,
|
||||
disabled = false,
|
||||
disableGutters = false,
|
||||
expanded: expandedProp,
|
||||
onChange,
|
||||
square = false,
|
||||
slots = {},
|
||||
slotProps = {},
|
||||
TransitionComponent: TransitionComponentProp,
|
||||
TransitionProps: TransitionPropsProp,
|
||||
...other
|
||||
} = props;
|
||||
const [expanded, setExpandedState] = useControlled({
|
||||
controlled: expandedProp,
|
||||
default: defaultExpanded,
|
||||
name: 'Accordion',
|
||||
state: 'expanded'
|
||||
});
|
||||
const handleChange = React.useCallback(event => {
|
||||
setExpandedState(!expanded);
|
||||
if (onChange) {
|
||||
onChange(event, !expanded);
|
||||
}
|
||||
}, [expanded, onChange, setExpandedState]);
|
||||
const [summary, ...children] = React.Children.toArray(childrenProp);
|
||||
const contextValue = React.useMemo(() => ({
|
||||
expanded,
|
||||
disabled,
|
||||
disableGutters,
|
||||
toggle: handleChange
|
||||
}), [expanded, disabled, disableGutters, handleChange]);
|
||||
const ownerState = {
|
||||
...props,
|
||||
square,
|
||||
disabled,
|
||||
disableGutters,
|
||||
expanded
|
||||
};
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
const backwardCompatibleSlots = {
|
||||
transition: TransitionComponentProp,
|
||||
...slots
|
||||
};
|
||||
const backwardCompatibleSlotProps = {
|
||||
transition: TransitionPropsProp,
|
||||
...slotProps
|
||||
};
|
||||
const externalForwardedProps = {
|
||||
slots: backwardCompatibleSlots,
|
||||
slotProps: backwardCompatibleSlotProps
|
||||
};
|
||||
const [AccordionHeadingSlot, accordionProps] = useSlot('heading', {
|
||||
elementType: AccordionHeading,
|
||||
externalForwardedProps,
|
||||
className: classes.heading,
|
||||
ownerState
|
||||
});
|
||||
const [TransitionSlot, transitionProps] = useSlot('transition', {
|
||||
elementType: Collapse,
|
||||
externalForwardedProps,
|
||||
ownerState
|
||||
});
|
||||
return /*#__PURE__*/_jsxs(AccordionRoot, {
|
||||
className: clsx(classes.root, className),
|
||||
ref: ref,
|
||||
ownerState: ownerState,
|
||||
square: square,
|
||||
...other,
|
||||
children: [/*#__PURE__*/_jsx(AccordionHeadingSlot, {
|
||||
...accordionProps,
|
||||
children: /*#__PURE__*/_jsx(AccordionContext.Provider, {
|
||||
value: contextValue,
|
||||
children: summary
|
||||
})
|
||||
}), /*#__PURE__*/_jsx(TransitionSlot, {
|
||||
in: expanded,
|
||||
timeout: "auto",
|
||||
...transitionProps,
|
||||
children: /*#__PURE__*/_jsx("div", {
|
||||
"aria-labelledby": summary.props.id,
|
||||
id: summary.props['aria-controls'],
|
||||
role: "region",
|
||||
className: classes.region,
|
||||
children: children
|
||||
})
|
||||
})]
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? Accordion.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: chainPropTypes(PropTypes.node.isRequired, props => {
|
||||
const summary = React.Children.toArray(props.children)[0];
|
||||
if (isFragment(summary)) {
|
||||
return new Error("MUI: The Accordion doesn't accept a Fragment as a child. " + 'Consider providing an array instead.');
|
||||
}
|
||||
if (! /*#__PURE__*/React.isValidElement(summary)) {
|
||||
return new Error('MUI: Expected the first child of Accordion to be a valid element.');
|
||||
}
|
||||
return null;
|
||||
}),
|
||||
/**
|
||||
* Override or extend the styles applied to the component.
|
||||
*/
|
||||
classes: PropTypes.object,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className: PropTypes.string,
|
||||
/**
|
||||
* If `true`, expands the accordion by default.
|
||||
* @default false
|
||||
*/
|
||||
defaultExpanded: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, the component is disabled.
|
||||
* @default false
|
||||
*/
|
||||
disabled: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, it removes the margin between two expanded accordion items and the increase of height.
|
||||
* @default false
|
||||
*/
|
||||
disableGutters: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, expands the accordion, otherwise collapse it.
|
||||
* Setting this prop enables control over the accordion.
|
||||
*/
|
||||
expanded: PropTypes.bool,
|
||||
/**
|
||||
* Callback fired when the expand/collapse state is changed.
|
||||
*
|
||||
* @param {React.SyntheticEvent} event The event source of the callback. **Warning**: This is a generic event not a change event.
|
||||
* @param {boolean} expanded The `expanded` state of the accordion.
|
||||
*/
|
||||
onChange: PropTypes.func,
|
||||
/**
|
||||
* The props used for each slot inside.
|
||||
* @default {}
|
||||
*/
|
||||
slotProps: PropTypes.shape({
|
||||
heading: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
||||
transition: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
||||
}),
|
||||
/**
|
||||
* The components used for each slot inside.
|
||||
* @default {}
|
||||
*/
|
||||
slots: PropTypes.shape({
|
||||
heading: PropTypes.elementType,
|
||||
transition: PropTypes.elementType
|
||||
}),
|
||||
/**
|
||||
* If `true`, rounded corners are disabled.
|
||||
* @default false
|
||||
*/
|
||||
square: 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]),
|
||||
/**
|
||||
* The component used for the transition.
|
||||
* [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
|
||||
*/
|
||||
TransitionComponent: PropTypes.elementType,
|
||||
/**
|
||||
* Props applied to the transition element.
|
||||
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
|
||||
*/
|
||||
TransitionProps: PropTypes.object
|
||||
} : void 0;
|
||||
export default Accordion;
|
||||
13
node_modules/@mui/material/modern/Accordion/AccordionContext.js
generated
vendored
Normal file
13
node_modules/@mui/material/modern/Accordion/AccordionContext.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
/**
|
||||
* @ignore - internal component.
|
||||
* @type {React.Context<{} | {expanded: boolean, disabled: boolean, toggle: () => void}>}
|
||||
*/
|
||||
const AccordionContext = /*#__PURE__*/React.createContext({});
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
AccordionContext.displayName = 'AccordionContext';
|
||||
}
|
||||
export default AccordionContext;
|
||||
7
node_modules/@mui/material/modern/Accordion/accordionClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/Accordion/accordionClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getAccordionUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiAccordion', slot);
|
||||
}
|
||||
const accordionClasses = generateUtilityClasses('MuiAccordion', ['root', 'heading', 'rounded', 'expanded', 'disabled', 'gutters', 'region']);
|
||||
export default accordionClasses;
|
||||
3
node_modules/@mui/material/modern/Accordion/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/Accordion/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default } from "./Accordion.js";
|
||||
export { default as accordionClasses } from "./accordionClasses.js";
|
||||
export * from "./accordionClasses.js";
|
||||
93
node_modules/@mui/material/modern/AccordionActions/AccordionActions.js
generated
vendored
Normal file
93
node_modules/@mui/material/modern/AccordionActions/AccordionActions.js
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import { styled } from "../zero-styled/index.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import { getAccordionActionsUtilityClass } from "./accordionActionsClasses.js";
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
classes,
|
||||
disableSpacing
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root', !disableSpacing && 'spacing']
|
||||
};
|
||||
return composeClasses(slots, getAccordionActionsUtilityClass, classes);
|
||||
};
|
||||
const AccordionActionsRoot = styled('div', {
|
||||
name: 'MuiAccordionActions',
|
||||
slot: 'Root',
|
||||
overridesResolver: (props, styles) => {
|
||||
const {
|
||||
ownerState
|
||||
} = props;
|
||||
return [styles.root, !ownerState.disableSpacing && styles.spacing];
|
||||
}
|
||||
})({
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
padding: 8,
|
||||
justifyContent: 'flex-end',
|
||||
variants: [{
|
||||
props: props => !props.disableSpacing,
|
||||
style: {
|
||||
'& > :not(style) ~ :not(style)': {
|
||||
marginLeft: 8
|
||||
}
|
||||
}
|
||||
}]
|
||||
});
|
||||
const AccordionActions = /*#__PURE__*/React.forwardRef(function AccordionActions(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiAccordionActions'
|
||||
});
|
||||
const {
|
||||
className,
|
||||
disableSpacing = false,
|
||||
...other
|
||||
} = props;
|
||||
const ownerState = {
|
||||
...props,
|
||||
disableSpacing
|
||||
};
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
return /*#__PURE__*/_jsx(AccordionActionsRoot, {
|
||||
className: clsx(classes.root, className),
|
||||
ref: ref,
|
||||
ownerState: ownerState,
|
||||
...other
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? AccordionActions.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,
|
||||
/**
|
||||
* If `true`, the actions do not have additional margin.
|
||||
* @default false
|
||||
*/
|
||||
disableSpacing: 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])
|
||||
} : void 0;
|
||||
export default AccordionActions;
|
||||
7
node_modules/@mui/material/modern/AccordionActions/accordionActionsClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/AccordionActions/accordionActionsClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getAccordionActionsUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiAccordionActions', slot);
|
||||
}
|
||||
const accordionActionsClasses = generateUtilityClasses('MuiAccordionActions', ['root', 'spacing']);
|
||||
export default accordionActionsClasses;
|
||||
3
node_modules/@mui/material/modern/AccordionActions/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/AccordionActions/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default } from "./AccordionActions.js";
|
||||
export { default as accordionActionsClasses } from "./accordionActionsClasses.js";
|
||||
export * from "./accordionActionsClasses.js";
|
||||
70
node_modules/@mui/material/modern/AccordionDetails/AccordionDetails.js
generated
vendored
Normal file
70
node_modules/@mui/material/modern/AccordionDetails/AccordionDetails.js
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import { styled } from "../zero-styled/index.js";
|
||||
import memoTheme from "../utils/memoTheme.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import { getAccordionDetailsUtilityClass } from "./accordionDetailsClasses.js";
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
classes
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root']
|
||||
};
|
||||
return composeClasses(slots, getAccordionDetailsUtilityClass, classes);
|
||||
};
|
||||
const AccordionDetailsRoot = styled('div', {
|
||||
name: 'MuiAccordionDetails',
|
||||
slot: 'Root',
|
||||
overridesResolver: (props, styles) => styles.root
|
||||
})(memoTheme(({
|
||||
theme
|
||||
}) => ({
|
||||
padding: theme.spacing(1, 2, 2)
|
||||
})));
|
||||
const AccordionDetails = /*#__PURE__*/React.forwardRef(function AccordionDetails(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiAccordionDetails'
|
||||
});
|
||||
const {
|
||||
className,
|
||||
...other
|
||||
} = props;
|
||||
const ownerState = props;
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
return /*#__PURE__*/_jsx(AccordionDetailsRoot, {
|
||||
className: clsx(classes.root, className),
|
||||
ref: ref,
|
||||
ownerState: ownerState,
|
||||
...other
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? AccordionDetails.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 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 AccordionDetails;
|
||||
7
node_modules/@mui/material/modern/AccordionDetails/accordionDetailsClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/AccordionDetails/accordionDetailsClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getAccordionDetailsUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiAccordionDetails', slot);
|
||||
}
|
||||
const accordionDetailsClasses = generateUtilityClasses('MuiAccordionDetails', ['root']);
|
||||
export default accordionDetailsClasses;
|
||||
3
node_modules/@mui/material/modern/AccordionDetails/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/AccordionDetails/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default } from "./AccordionDetails.js";
|
||||
export { default as accordionDetailsClasses } from "./accordionDetailsClasses.js";
|
||||
export * from "./accordionDetailsClasses.js";
|
||||
198
node_modules/@mui/material/modern/AccordionSummary/AccordionSummary.js
generated
vendored
Normal file
198
node_modules/@mui/material/modern/AccordionSummary/AccordionSummary.js
generated
vendored
Normal file
@@ -0,0 +1,198 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import { styled } from "../zero-styled/index.js";
|
||||
import memoTheme from "../utils/memoTheme.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import ButtonBase from "../ButtonBase/index.js";
|
||||
import AccordionContext from "../Accordion/AccordionContext.js";
|
||||
import accordionSummaryClasses, { getAccordionSummaryUtilityClass } from "./accordionSummaryClasses.js";
|
||||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
classes,
|
||||
expanded,
|
||||
disabled,
|
||||
disableGutters
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root', expanded && 'expanded', disabled && 'disabled', !disableGutters && 'gutters'],
|
||||
focusVisible: ['focusVisible'],
|
||||
content: ['content', expanded && 'expanded', !disableGutters && 'contentGutters'],
|
||||
expandIconWrapper: ['expandIconWrapper', expanded && 'expanded']
|
||||
};
|
||||
return composeClasses(slots, getAccordionSummaryUtilityClass, classes);
|
||||
};
|
||||
const AccordionSummaryRoot = styled(ButtonBase, {
|
||||
name: 'MuiAccordionSummary',
|
||||
slot: 'Root',
|
||||
overridesResolver: (props, styles) => styles.root
|
||||
})(memoTheme(({
|
||||
theme
|
||||
}) => {
|
||||
const transition = {
|
||||
duration: theme.transitions.duration.shortest
|
||||
};
|
||||
return {
|
||||
display: 'flex',
|
||||
minHeight: 48,
|
||||
padding: theme.spacing(0, 2),
|
||||
transition: theme.transitions.create(['min-height', 'background-color'], transition),
|
||||
[`&.${accordionSummaryClasses.focusVisible}`]: {
|
||||
backgroundColor: (theme.vars || theme).palette.action.focus
|
||||
},
|
||||
[`&.${accordionSummaryClasses.disabled}`]: {
|
||||
opacity: (theme.vars || theme).palette.action.disabledOpacity
|
||||
},
|
||||
[`&:hover:not(.${accordionSummaryClasses.disabled})`]: {
|
||||
cursor: 'pointer'
|
||||
},
|
||||
variants: [{
|
||||
props: props => !props.disableGutters,
|
||||
style: {
|
||||
[`&.${accordionSummaryClasses.expanded}`]: {
|
||||
minHeight: 64
|
||||
}
|
||||
}
|
||||
}]
|
||||
};
|
||||
}));
|
||||
const AccordionSummaryContent = styled('div', {
|
||||
name: 'MuiAccordionSummary',
|
||||
slot: 'Content',
|
||||
overridesResolver: (props, styles) => styles.content
|
||||
})(memoTheme(({
|
||||
theme
|
||||
}) => ({
|
||||
display: 'flex',
|
||||
flexGrow: 1,
|
||||
margin: '12px 0',
|
||||
variants: [{
|
||||
props: props => !props.disableGutters,
|
||||
style: {
|
||||
transition: theme.transitions.create(['margin'], {
|
||||
duration: theme.transitions.duration.shortest
|
||||
}),
|
||||
[`&.${accordionSummaryClasses.expanded}`]: {
|
||||
margin: '20px 0'
|
||||
}
|
||||
}
|
||||
}]
|
||||
})));
|
||||
const AccordionSummaryExpandIconWrapper = styled('div', {
|
||||
name: 'MuiAccordionSummary',
|
||||
slot: 'ExpandIconWrapper',
|
||||
overridesResolver: (props, styles) => styles.expandIconWrapper
|
||||
})(memoTheme(({
|
||||
theme
|
||||
}) => ({
|
||||
display: 'flex',
|
||||
color: (theme.vars || theme).palette.action.active,
|
||||
transform: 'rotate(0deg)',
|
||||
transition: theme.transitions.create('transform', {
|
||||
duration: theme.transitions.duration.shortest
|
||||
}),
|
||||
[`&.${accordionSummaryClasses.expanded}`]: {
|
||||
transform: 'rotate(180deg)'
|
||||
}
|
||||
})));
|
||||
const AccordionSummary = /*#__PURE__*/React.forwardRef(function AccordionSummary(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiAccordionSummary'
|
||||
});
|
||||
const {
|
||||
children,
|
||||
className,
|
||||
expandIcon,
|
||||
focusVisibleClassName,
|
||||
onClick,
|
||||
...other
|
||||
} = props;
|
||||
const {
|
||||
disabled = false,
|
||||
disableGutters,
|
||||
expanded,
|
||||
toggle
|
||||
} = React.useContext(AccordionContext);
|
||||
const handleChange = event => {
|
||||
if (toggle) {
|
||||
toggle(event);
|
||||
}
|
||||
if (onClick) {
|
||||
onClick(event);
|
||||
}
|
||||
};
|
||||
const ownerState = {
|
||||
...props,
|
||||
expanded,
|
||||
disabled,
|
||||
disableGutters
|
||||
};
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
return /*#__PURE__*/_jsxs(AccordionSummaryRoot, {
|
||||
focusRipple: false,
|
||||
disableRipple: true,
|
||||
disabled: disabled,
|
||||
component: "div",
|
||||
"aria-expanded": expanded,
|
||||
className: clsx(classes.root, className),
|
||||
focusVisibleClassName: clsx(classes.focusVisible, focusVisibleClassName),
|
||||
onClick: handleChange,
|
||||
ref: ref,
|
||||
ownerState: ownerState,
|
||||
...other,
|
||||
children: [/*#__PURE__*/_jsx(AccordionSummaryContent, {
|
||||
className: classes.content,
|
||||
ownerState: ownerState,
|
||||
children: children
|
||||
}), expandIcon && /*#__PURE__*/_jsx(AccordionSummaryExpandIconWrapper, {
|
||||
className: classes.expandIconWrapper,
|
||||
ownerState: ownerState,
|
||||
children: expandIcon
|
||||
})]
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? AccordionSummary.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 icon to display as the expand indicator.
|
||||
*/
|
||||
expandIcon: PropTypes.node,
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
onClick: PropTypes.func,
|
||||
/**
|
||||
* 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 AccordionSummary;
|
||||
7
node_modules/@mui/material/modern/AccordionSummary/accordionSummaryClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/AccordionSummary/accordionSummaryClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getAccordionSummaryUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiAccordionSummary', slot);
|
||||
}
|
||||
const accordionSummaryClasses = generateUtilityClasses('MuiAccordionSummary', ['root', 'expanded', 'focusVisible', 'disabled', 'gutters', 'contentGutters', 'content', 'expandIconWrapper']);
|
||||
export default accordionSummaryClasses;
|
||||
3
node_modules/@mui/material/modern/AccordionSummary/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/AccordionSummary/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default } from "./AccordionSummary.js";
|
||||
export { default as accordionSummaryClasses } from "./accordionSummaryClasses.js";
|
||||
export * from "./accordionSummaryClasses.js";
|
||||
354
node_modules/@mui/material/modern/Alert/Alert.js
generated
vendored
Normal file
354
node_modules/@mui/material/modern/Alert/Alert.js
generated
vendored
Normal file
@@ -0,0 +1,354 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import { darken, lighten } from '@mui/system/colorManipulator';
|
||||
import { styled } from "../zero-styled/index.js";
|
||||
import memoTheme from "../utils/memoTheme.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import useSlot from "../utils/useSlot.js";
|
||||
import capitalize from "../utils/capitalize.js";
|
||||
import createSimplePaletteValueFilter from "../utils/createSimplePaletteValueFilter.js";
|
||||
import Paper from "../Paper/index.js";
|
||||
import alertClasses, { getAlertUtilityClass } from "./alertClasses.js";
|
||||
import IconButton from "../IconButton/index.js";
|
||||
import SuccessOutlinedIcon from "../internal/svg-icons/SuccessOutlined.js";
|
||||
import ReportProblemOutlinedIcon from "../internal/svg-icons/ReportProblemOutlined.js";
|
||||
import ErrorOutlineIcon from "../internal/svg-icons/ErrorOutline.js";
|
||||
import InfoOutlinedIcon from "../internal/svg-icons/InfoOutlined.js";
|
||||
import CloseIcon from "../internal/svg-icons/Close.js";
|
||||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
variant,
|
||||
color,
|
||||
severity,
|
||||
classes
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root', `color${capitalize(color || severity)}`, `${variant}${capitalize(color || severity)}`, `${variant}`],
|
||||
icon: ['icon'],
|
||||
message: ['message'],
|
||||
action: ['action']
|
||||
};
|
||||
return composeClasses(slots, getAlertUtilityClass, classes);
|
||||
};
|
||||
const AlertRoot = styled(Paper, {
|
||||
name: 'MuiAlert',
|
||||
slot: 'Root',
|
||||
overridesResolver: (props, styles) => {
|
||||
const {
|
||||
ownerState
|
||||
} = props;
|
||||
return [styles.root, styles[ownerState.variant], styles[`${ownerState.variant}${capitalize(ownerState.color || ownerState.severity)}`]];
|
||||
}
|
||||
})(memoTheme(({
|
||||
theme
|
||||
}) => {
|
||||
const getColor = theme.palette.mode === 'light' ? darken : lighten;
|
||||
const getBackgroundColor = theme.palette.mode === 'light' ? lighten : darken;
|
||||
return {
|
||||
...theme.typography.body2,
|
||||
backgroundColor: 'transparent',
|
||||
display: 'flex',
|
||||
padding: '6px 16px',
|
||||
variants: [...Object.entries(theme.palette).filter(createSimplePaletteValueFilter(['light'])).map(([color]) => ({
|
||||
props: {
|
||||
colorSeverity: color,
|
||||
variant: 'standard'
|
||||
},
|
||||
style: {
|
||||
color: theme.vars ? theme.vars.palette.Alert[`${color}Color`] : getColor(theme.palette[color].light, 0.6),
|
||||
backgroundColor: theme.vars ? theme.vars.palette.Alert[`${color}StandardBg`] : getBackgroundColor(theme.palette[color].light, 0.9),
|
||||
[`& .${alertClasses.icon}`]: theme.vars ? {
|
||||
color: theme.vars.palette.Alert[`${color}IconColor`]
|
||||
} : {
|
||||
color: theme.palette[color].main
|
||||
}
|
||||
}
|
||||
})), ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter(['light'])).map(([color]) => ({
|
||||
props: {
|
||||
colorSeverity: color,
|
||||
variant: 'outlined'
|
||||
},
|
||||
style: {
|
||||
color: theme.vars ? theme.vars.palette.Alert[`${color}Color`] : getColor(theme.palette[color].light, 0.6),
|
||||
border: `1px solid ${(theme.vars || theme).palette[color].light}`,
|
||||
[`& .${alertClasses.icon}`]: theme.vars ? {
|
||||
color: theme.vars.palette.Alert[`${color}IconColor`]
|
||||
} : {
|
||||
color: theme.palette[color].main
|
||||
}
|
||||
}
|
||||
})), ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter(['dark'])).map(([color]) => ({
|
||||
props: {
|
||||
colorSeverity: color,
|
||||
variant: 'filled'
|
||||
},
|
||||
style: {
|
||||
fontWeight: theme.typography.fontWeightMedium,
|
||||
...(theme.vars ? {
|
||||
color: theme.vars.palette.Alert[`${color}FilledColor`],
|
||||
backgroundColor: theme.vars.palette.Alert[`${color}FilledBg`]
|
||||
} : {
|
||||
backgroundColor: theme.palette.mode === 'dark' ? theme.palette[color].dark : theme.palette[color].main,
|
||||
color: theme.palette.getContrastText(theme.palette[color].main)
|
||||
})
|
||||
}
|
||||
}))]
|
||||
};
|
||||
}));
|
||||
const AlertIcon = styled('div', {
|
||||
name: 'MuiAlert',
|
||||
slot: 'Icon',
|
||||
overridesResolver: (props, styles) => styles.icon
|
||||
})({
|
||||
marginRight: 12,
|
||||
padding: '7px 0',
|
||||
display: 'flex',
|
||||
fontSize: 22,
|
||||
opacity: 0.9
|
||||
});
|
||||
const AlertMessage = styled('div', {
|
||||
name: 'MuiAlert',
|
||||
slot: 'Message',
|
||||
overridesResolver: (props, styles) => styles.message
|
||||
})({
|
||||
padding: '8px 0',
|
||||
minWidth: 0,
|
||||
overflow: 'auto'
|
||||
});
|
||||
const AlertAction = styled('div', {
|
||||
name: 'MuiAlert',
|
||||
slot: 'Action',
|
||||
overridesResolver: (props, styles) => styles.action
|
||||
})({
|
||||
display: 'flex',
|
||||
alignItems: 'flex-start',
|
||||
padding: '4px 0 0 16px',
|
||||
marginLeft: 'auto',
|
||||
marginRight: -8
|
||||
});
|
||||
const defaultIconMapping = {
|
||||
success: /*#__PURE__*/_jsx(SuccessOutlinedIcon, {
|
||||
fontSize: "inherit"
|
||||
}),
|
||||
warning: /*#__PURE__*/_jsx(ReportProblemOutlinedIcon, {
|
||||
fontSize: "inherit"
|
||||
}),
|
||||
error: /*#__PURE__*/_jsx(ErrorOutlineIcon, {
|
||||
fontSize: "inherit"
|
||||
}),
|
||||
info: /*#__PURE__*/_jsx(InfoOutlinedIcon, {
|
||||
fontSize: "inherit"
|
||||
})
|
||||
};
|
||||
const Alert = /*#__PURE__*/React.forwardRef(function Alert(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiAlert'
|
||||
});
|
||||
const {
|
||||
action,
|
||||
children,
|
||||
className,
|
||||
closeText = 'Close',
|
||||
color,
|
||||
components = {},
|
||||
componentsProps = {},
|
||||
icon,
|
||||
iconMapping = defaultIconMapping,
|
||||
onClose,
|
||||
role = 'alert',
|
||||
severity = 'success',
|
||||
slotProps = {},
|
||||
slots = {},
|
||||
variant = 'standard',
|
||||
...other
|
||||
} = props;
|
||||
const ownerState = {
|
||||
...props,
|
||||
color,
|
||||
severity,
|
||||
variant,
|
||||
colorSeverity: color || severity
|
||||
};
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
const externalForwardedProps = {
|
||||
slots: {
|
||||
closeButton: components.CloseButton,
|
||||
closeIcon: components.CloseIcon,
|
||||
...slots
|
||||
},
|
||||
slotProps: {
|
||||
...componentsProps,
|
||||
...slotProps
|
||||
}
|
||||
};
|
||||
const [CloseButtonSlot, closeButtonProps] = useSlot('closeButton', {
|
||||
elementType: IconButton,
|
||||
externalForwardedProps,
|
||||
ownerState
|
||||
});
|
||||
const [CloseIconSlot, closeIconProps] = useSlot('closeIcon', {
|
||||
elementType: CloseIcon,
|
||||
externalForwardedProps,
|
||||
ownerState
|
||||
});
|
||||
return /*#__PURE__*/_jsxs(AlertRoot, {
|
||||
role: role,
|
||||
elevation: 0,
|
||||
ownerState: ownerState,
|
||||
className: clsx(classes.root, className),
|
||||
ref: ref,
|
||||
...other,
|
||||
children: [icon !== false ? /*#__PURE__*/_jsx(AlertIcon, {
|
||||
ownerState: ownerState,
|
||||
className: classes.icon,
|
||||
children: icon || iconMapping[severity] || defaultIconMapping[severity]
|
||||
}) : null, /*#__PURE__*/_jsx(AlertMessage, {
|
||||
ownerState: ownerState,
|
||||
className: classes.message,
|
||||
children: children
|
||||
}), action != null ? /*#__PURE__*/_jsx(AlertAction, {
|
||||
ownerState: ownerState,
|
||||
className: classes.action,
|
||||
children: action
|
||||
}) : null, action == null && onClose ? /*#__PURE__*/_jsx(AlertAction, {
|
||||
ownerState: ownerState,
|
||||
className: classes.action,
|
||||
children: /*#__PURE__*/_jsx(CloseButtonSlot, {
|
||||
size: "small",
|
||||
"aria-label": closeText,
|
||||
title: closeText,
|
||||
color: "inherit",
|
||||
onClick: onClose,
|
||||
...closeButtonProps,
|
||||
children: /*#__PURE__*/_jsx(CloseIconSlot, {
|
||||
fontSize: "small",
|
||||
...closeIconProps
|
||||
})
|
||||
})
|
||||
}) : null]
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? Alert.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 action to display. It renders after the message, at the end of the alert.
|
||||
*/
|
||||
action: PropTypes.node,
|
||||
/**
|
||||
* The content of the component.
|
||||
*/
|
||||
children: PropTypes.node,
|
||||
/**
|
||||
* Override or extend the styles applied to the component.
|
||||
*/
|
||||
classes: PropTypes.object,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className: PropTypes.string,
|
||||
/**
|
||||
* Override the default label for the *close popup* icon button.
|
||||
*
|
||||
* For localization purposes, you can use the provided [translations](https://mui.com/material-ui/guides/localization/).
|
||||
* @default 'Close'
|
||||
*/
|
||||
closeText: PropTypes.string,
|
||||
/**
|
||||
* The color of the component. Unless provided, the value is taken from the `severity` prop.
|
||||
* It supports both default and custom theme colors, which can be added as shown in the
|
||||
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
||||
*/
|
||||
color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['error', 'info', 'success', 'warning']), PropTypes.string]),
|
||||
/**
|
||||
* The components used for each slot inside.
|
||||
*
|
||||
* @deprecated use the `slots` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
||||
*
|
||||
* @default {}
|
||||
*/
|
||||
components: PropTypes.shape({
|
||||
CloseButton: PropTypes.elementType,
|
||||
CloseIcon: PropTypes.elementType
|
||||
}),
|
||||
/**
|
||||
* The extra props for the slot components.
|
||||
* You can override the existing props or add new ones.
|
||||
*
|
||||
* @deprecated use the `slotProps` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
||||
*
|
||||
* @default {}
|
||||
*/
|
||||
componentsProps: PropTypes.shape({
|
||||
closeButton: PropTypes.object,
|
||||
closeIcon: PropTypes.object
|
||||
}),
|
||||
/**
|
||||
* Override the icon displayed before the children.
|
||||
* Unless provided, the icon is mapped to the value of the `severity` prop.
|
||||
* Set to `false` to remove the `icon`.
|
||||
*/
|
||||
icon: PropTypes.node,
|
||||
/**
|
||||
* The component maps the `severity` prop to a range of different icons,
|
||||
* for instance success to `<SuccessOutlined>`.
|
||||
* If you wish to change this mapping, you can provide your own.
|
||||
* Alternatively, you can use the `icon` prop to override the icon displayed.
|
||||
*/
|
||||
iconMapping: PropTypes.shape({
|
||||
error: PropTypes.node,
|
||||
info: PropTypes.node,
|
||||
success: PropTypes.node,
|
||||
warning: PropTypes.node
|
||||
}),
|
||||
/**
|
||||
* Callback fired when the component requests to be closed.
|
||||
* When provided and no `action` prop is set, a close icon button is displayed that triggers the callback when clicked.
|
||||
* @param {React.SyntheticEvent} event The event source of the callback.
|
||||
*/
|
||||
onClose: PropTypes.func,
|
||||
/**
|
||||
* The ARIA role attribute of the element.
|
||||
* @default 'alert'
|
||||
*/
|
||||
role: PropTypes.string,
|
||||
/**
|
||||
* The severity of the alert. This defines the color and icon used.
|
||||
* @default 'success'
|
||||
*/
|
||||
severity: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['error', 'info', 'success', 'warning']), PropTypes.string]),
|
||||
/**
|
||||
* The props used for each slot inside.
|
||||
* @default {}
|
||||
*/
|
||||
slotProps: PropTypes.shape({
|
||||
closeButton: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
||||
closeIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
||||
}),
|
||||
/**
|
||||
* The components used for each slot inside.
|
||||
* @default {}
|
||||
*/
|
||||
slots: PropTypes.shape({
|
||||
closeButton: PropTypes.elementType,
|
||||
closeIcon: PropTypes.elementType
|
||||
}),
|
||||
/**
|
||||
* 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 'standard'
|
||||
*/
|
||||
variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['filled', 'outlined', 'standard']), PropTypes.string])
|
||||
} : void 0;
|
||||
export default Alert;
|
||||
7
node_modules/@mui/material/modern/Alert/alertClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/Alert/alertClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getAlertUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiAlert', slot);
|
||||
}
|
||||
const alertClasses = generateUtilityClasses('MuiAlert', ['root', 'action', 'icon', 'message', 'filled', 'colorSuccess', 'colorInfo', 'colorWarning', 'colorError', 'filledSuccess', 'filledInfo', 'filledWarning', 'filledError', 'outlined', 'outlinedSuccess', 'outlinedInfo', 'outlinedWarning', 'outlinedError', 'standard', 'standardSuccess', 'standardInfo', 'standardWarning', 'standardError']);
|
||||
export default alertClasses;
|
||||
3
node_modules/@mui/material/modern/Alert/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/Alert/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default } from "./Alert.js";
|
||||
export { default as alertClasses } from "./alertClasses.js";
|
||||
export * from "./alertClasses.js";
|
||||
76
node_modules/@mui/material/modern/AlertTitle/AlertTitle.js
generated
vendored
Normal file
76
node_modules/@mui/material/modern/AlertTitle/AlertTitle.js
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import { styled } from "../zero-styled/index.js";
|
||||
import memoTheme from "../utils/memoTheme.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import Typography from "../Typography/index.js";
|
||||
import { getAlertTitleUtilityClass } from "./alertTitleClasses.js";
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
classes
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root']
|
||||
};
|
||||
return composeClasses(slots, getAlertTitleUtilityClass, classes);
|
||||
};
|
||||
const AlertTitleRoot = styled(Typography, {
|
||||
name: 'MuiAlertTitle',
|
||||
slot: 'Root',
|
||||
overridesResolver: (props, styles) => styles.root
|
||||
})(memoTheme(({
|
||||
theme
|
||||
}) => {
|
||||
return {
|
||||
fontWeight: theme.typography.fontWeightMedium,
|
||||
marginTop: -2
|
||||
};
|
||||
}));
|
||||
const AlertTitle = /*#__PURE__*/React.forwardRef(function AlertTitle(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiAlertTitle'
|
||||
});
|
||||
const {
|
||||
className,
|
||||
...other
|
||||
} = props;
|
||||
const ownerState = props;
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
return /*#__PURE__*/_jsx(AlertTitleRoot, {
|
||||
gutterBottom: true,
|
||||
component: "div",
|
||||
ownerState: ownerState,
|
||||
ref: ref,
|
||||
className: clsx(classes.root, className),
|
||||
...other
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? AlertTitle.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 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 AlertTitle;
|
||||
7
node_modules/@mui/material/modern/AlertTitle/alertTitleClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/AlertTitle/alertTitleClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getAlertTitleUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiAlertTitle', slot);
|
||||
}
|
||||
const alertTitleClasses = generateUtilityClasses('MuiAlertTitle', ['root']);
|
||||
export default alertTitleClasses;
|
||||
3
node_modules/@mui/material/modern/AlertTitle/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/AlertTitle/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default } from "./AlertTitle.js";
|
||||
export { default as alertTitleClasses } from "./alertTitleClasses.js";
|
||||
export * from "./alertTitleClasses.js";
|
||||
227
node_modules/@mui/material/modern/AppBar/AppBar.js
generated
vendored
Normal file
227
node_modules/@mui/material/modern/AppBar/AppBar.js
generated
vendored
Normal file
@@ -0,0 +1,227 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import { styled } from "../zero-styled/index.js";
|
||||
import memoTheme from "../utils/memoTheme.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import capitalize from "../utils/capitalize.js";
|
||||
import createSimplePaletteValueFilter from "../utils/createSimplePaletteValueFilter.js";
|
||||
import Paper from "../Paper/index.js";
|
||||
import { getAppBarUtilityClass } from "./appBarClasses.js";
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
color,
|
||||
position,
|
||||
classes
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root', `color${capitalize(color)}`, `position${capitalize(position)}`]
|
||||
};
|
||||
return composeClasses(slots, getAppBarUtilityClass, classes);
|
||||
};
|
||||
|
||||
// var2 is the fallback.
|
||||
// Ex. var1: 'var(--a)', var2: 'var(--b)'; return: 'var(--a, var(--b))'
|
||||
const joinVars = (var1, var2) => var1 ? `${var1?.replace(')', '')}, ${var2})` : var2;
|
||||
const AppBarRoot = styled(Paper, {
|
||||
name: 'MuiAppBar',
|
||||
slot: 'Root',
|
||||
overridesResolver: (props, styles) => {
|
||||
const {
|
||||
ownerState
|
||||
} = props;
|
||||
return [styles.root, styles[`position${capitalize(ownerState.position)}`], styles[`color${capitalize(ownerState.color)}`]];
|
||||
}
|
||||
})(memoTheme(({
|
||||
theme
|
||||
}) => ({
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
width: '100%',
|
||||
boxSizing: 'border-box',
|
||||
// Prevent padding issue with the Modal and fixed positioned AppBar.
|
||||
flexShrink: 0,
|
||||
variants: [{
|
||||
props: {
|
||||
position: 'fixed'
|
||||
},
|
||||
style: {
|
||||
position: 'fixed',
|
||||
zIndex: (theme.vars || theme).zIndex.appBar,
|
||||
top: 0,
|
||||
left: 'auto',
|
||||
right: 0,
|
||||
'@media print': {
|
||||
// Prevent the app bar to be visible on each printed page.
|
||||
position: 'absolute'
|
||||
}
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
position: 'absolute'
|
||||
},
|
||||
style: {
|
||||
position: 'absolute',
|
||||
zIndex: (theme.vars || theme).zIndex.appBar,
|
||||
top: 0,
|
||||
left: 'auto',
|
||||
right: 0
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
position: 'sticky'
|
||||
},
|
||||
style: {
|
||||
position: 'sticky',
|
||||
zIndex: (theme.vars || theme).zIndex.appBar,
|
||||
top: 0,
|
||||
left: 'auto',
|
||||
right: 0
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
position: 'static'
|
||||
},
|
||||
style: {
|
||||
position: 'static'
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
position: 'relative'
|
||||
},
|
||||
style: {
|
||||
position: 'relative'
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
color: 'inherit'
|
||||
},
|
||||
style: {
|
||||
'--AppBar-color': 'inherit'
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
color: 'default'
|
||||
},
|
||||
style: {
|
||||
'--AppBar-background': theme.vars ? theme.vars.palette.AppBar.defaultBg : theme.palette.grey[100],
|
||||
'--AppBar-color': theme.vars ? theme.vars.palette.text.primary : theme.palette.getContrastText(theme.palette.grey[100]),
|
||||
...theme.applyStyles('dark', {
|
||||
'--AppBar-background': theme.vars ? theme.vars.palette.AppBar.defaultBg : theme.palette.grey[900],
|
||||
'--AppBar-color': theme.vars ? theme.vars.palette.text.primary : theme.palette.getContrastText(theme.palette.grey[900])
|
||||
})
|
||||
}
|
||||
}, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter(['contrastText'])).map(([color]) => ({
|
||||
props: {
|
||||
color
|
||||
},
|
||||
style: {
|
||||
'--AppBar-background': (theme.vars ?? theme).palette[color].main,
|
||||
'--AppBar-color': (theme.vars ?? theme).palette[color].contrastText
|
||||
}
|
||||
})), {
|
||||
props: props => props.enableColorOnDark === true && !['inherit', 'transparent'].includes(props.color),
|
||||
style: {
|
||||
backgroundColor: 'var(--AppBar-background)',
|
||||
color: 'var(--AppBar-color)'
|
||||
}
|
||||
}, {
|
||||
props: props => props.enableColorOnDark === false && !['inherit', 'transparent'].includes(props.color),
|
||||
style: {
|
||||
backgroundColor: 'var(--AppBar-background)',
|
||||
color: 'var(--AppBar-color)',
|
||||
...theme.applyStyles('dark', {
|
||||
backgroundColor: theme.vars ? joinVars(theme.vars.palette.AppBar.darkBg, 'var(--AppBar-background)') : null,
|
||||
color: theme.vars ? joinVars(theme.vars.palette.AppBar.darkColor, 'var(--AppBar-color)') : null
|
||||
})
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
color: 'transparent'
|
||||
},
|
||||
style: {
|
||||
'--AppBar-background': 'transparent',
|
||||
'--AppBar-color': 'inherit',
|
||||
backgroundColor: 'var(--AppBar-background)',
|
||||
color: 'var(--AppBar-color)',
|
||||
...theme.applyStyles('dark', {
|
||||
backgroundImage: 'none'
|
||||
})
|
||||
}
|
||||
}]
|
||||
})));
|
||||
const AppBar = /*#__PURE__*/React.forwardRef(function AppBar(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiAppBar'
|
||||
});
|
||||
const {
|
||||
className,
|
||||
color = 'primary',
|
||||
enableColorOnDark = false,
|
||||
position = 'fixed',
|
||||
...other
|
||||
} = props;
|
||||
const ownerState = {
|
||||
...props,
|
||||
color,
|
||||
position,
|
||||
enableColorOnDark
|
||||
};
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
return /*#__PURE__*/_jsx(AppBarRoot, {
|
||||
square: true,
|
||||
component: "header",
|
||||
ownerState: ownerState,
|
||||
elevation: 4,
|
||||
className: clsx(classes.root, className, position === 'fixed' && 'mui-fixed'),
|
||||
ref: ref,
|
||||
...other
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? AppBar.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 color of the component.
|
||||
* It supports both default and custom theme colors, which can be added as shown in the
|
||||
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
||||
* @default 'primary'
|
||||
*/
|
||||
color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['default', 'inherit', 'primary', 'secondary', 'transparent', 'error', 'info', 'success', 'warning']), PropTypes.string]),
|
||||
/**
|
||||
* If true, the `color` prop is applied in dark mode.
|
||||
* @default false
|
||||
*/
|
||||
enableColorOnDark: PropTypes.bool,
|
||||
/**
|
||||
* The positioning type. The behavior of the different options is described
|
||||
* [in the MDN web docs](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Positioning).
|
||||
* Note: `sticky` is not universally supported and will fall back to `static` when unavailable.
|
||||
* @default 'fixed'
|
||||
*/
|
||||
position: PropTypes.oneOf(['absolute', 'fixed', 'relative', 'static', 'sticky']),
|
||||
/**
|
||||
* 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 AppBar;
|
||||
7
node_modules/@mui/material/modern/AppBar/appBarClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/AppBar/appBarClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getAppBarUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiAppBar', slot);
|
||||
}
|
||||
const appBarClasses = generateUtilityClasses('MuiAppBar', ['root', 'positionFixed', 'positionAbsolute', 'positionSticky', 'positionStatic', 'positionRelative', 'colorDefault', 'colorPrimary', 'colorSecondary', 'colorInherit', 'colorTransparent', 'colorError', 'colorInfo', 'colorSuccess', 'colorWarning']);
|
||||
export default appBarClasses;
|
||||
3
node_modules/@mui/material/modern/AppBar/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/AppBar/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default } from "./AppBar.js";
|
||||
export { default as appBarClasses } from "./appBarClasses.js";
|
||||
export * from "./appBarClasses.js";
|
||||
1191
node_modules/@mui/material/modern/Autocomplete/Autocomplete.js
generated
vendored
Normal file
1191
node_modules/@mui/material/modern/Autocomplete/Autocomplete.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
7
node_modules/@mui/material/modern/Autocomplete/autocompleteClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/Autocomplete/autocompleteClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getAutocompleteUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiAutocomplete', slot);
|
||||
}
|
||||
const autocompleteClasses = generateUtilityClasses('MuiAutocomplete', ['root', 'expanded', 'fullWidth', 'focused', 'focusVisible', 'tag', 'tagSizeSmall', 'tagSizeMedium', 'hasPopupIcon', 'hasClearIcon', 'inputRoot', 'input', 'inputFocused', 'endAdornment', 'clearIndicator', 'popupIndicator', 'popupIndicatorOpen', 'popper', 'popperDisablePortal', 'paper', 'listbox', 'loading', 'noOptions', 'option', 'groupLabel', 'groupUl']);
|
||||
export default autocompleteClasses;
|
||||
3
node_modules/@mui/material/modern/Autocomplete/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/Autocomplete/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default, createFilterOptions } from "./Autocomplete.js";
|
||||
export { default as autocompleteClasses } from "./autocompleteClasses.js";
|
||||
export * from "./autocompleteClasses.js";
|
||||
297
node_modules/@mui/material/modern/Avatar/Avatar.js
generated
vendored
Normal file
297
node_modules/@mui/material/modern/Avatar/Avatar.js
generated
vendored
Normal file
@@ -0,0 +1,297 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import { styled } from "../zero-styled/index.js";
|
||||
import memoTheme from "../utils/memoTheme.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import Person from "../internal/svg-icons/Person.js";
|
||||
import { getAvatarUtilityClass } from "./avatarClasses.js";
|
||||
import useSlot from "../utils/useSlot.js";
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
classes,
|
||||
variant,
|
||||
colorDefault
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root', variant, colorDefault && 'colorDefault'],
|
||||
img: ['img'],
|
||||
fallback: ['fallback']
|
||||
};
|
||||
return composeClasses(slots, getAvatarUtilityClass, classes);
|
||||
};
|
||||
const AvatarRoot = styled('div', {
|
||||
name: 'MuiAvatar',
|
||||
slot: 'Root',
|
||||
overridesResolver: (props, styles) => {
|
||||
const {
|
||||
ownerState
|
||||
} = props;
|
||||
return [styles.root, styles[ownerState.variant], ownerState.colorDefault && styles.colorDefault];
|
||||
}
|
||||
})(memoTheme(({
|
||||
theme
|
||||
}) => ({
|
||||
position: 'relative',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
flexShrink: 0,
|
||||
width: 40,
|
||||
height: 40,
|
||||
fontFamily: theme.typography.fontFamily,
|
||||
fontSize: theme.typography.pxToRem(20),
|
||||
lineHeight: 1,
|
||||
borderRadius: '50%',
|
||||
overflow: 'hidden',
|
||||
userSelect: 'none',
|
||||
variants: [{
|
||||
props: {
|
||||
variant: 'rounded'
|
||||
},
|
||||
style: {
|
||||
borderRadius: (theme.vars || theme).shape.borderRadius
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
variant: 'square'
|
||||
},
|
||||
style: {
|
||||
borderRadius: 0
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
colorDefault: true
|
||||
},
|
||||
style: {
|
||||
color: (theme.vars || theme).palette.background.default,
|
||||
...(theme.vars ? {
|
||||
backgroundColor: theme.vars.palette.Avatar.defaultBg
|
||||
} : {
|
||||
backgroundColor: theme.palette.grey[400],
|
||||
...theme.applyStyles('dark', {
|
||||
backgroundColor: theme.palette.grey[600]
|
||||
})
|
||||
})
|
||||
}
|
||||
}]
|
||||
})));
|
||||
const AvatarImg = styled('img', {
|
||||
name: 'MuiAvatar',
|
||||
slot: 'Img',
|
||||
overridesResolver: (props, styles) => styles.img
|
||||
})({
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
textAlign: 'center',
|
||||
// Handle non-square image.
|
||||
objectFit: 'cover',
|
||||
// Hide alt text.
|
||||
color: 'transparent',
|
||||
// Hide the image broken icon, only works on Chrome.
|
||||
textIndent: 10000
|
||||
});
|
||||
const AvatarFallback = styled(Person, {
|
||||
name: 'MuiAvatar',
|
||||
slot: 'Fallback',
|
||||
overridesResolver: (props, styles) => styles.fallback
|
||||
})({
|
||||
width: '75%',
|
||||
height: '75%'
|
||||
});
|
||||
function useLoaded({
|
||||
crossOrigin,
|
||||
referrerPolicy,
|
||||
src,
|
||||
srcSet
|
||||
}) {
|
||||
const [loaded, setLoaded] = React.useState(false);
|
||||
React.useEffect(() => {
|
||||
if (!src && !srcSet) {
|
||||
return undefined;
|
||||
}
|
||||
setLoaded(false);
|
||||
let active = true;
|
||||
const image = new Image();
|
||||
image.onload = () => {
|
||||
if (!active) {
|
||||
return;
|
||||
}
|
||||
setLoaded('loaded');
|
||||
};
|
||||
image.onerror = () => {
|
||||
if (!active) {
|
||||
return;
|
||||
}
|
||||
setLoaded('error');
|
||||
};
|
||||
image.crossOrigin = crossOrigin;
|
||||
image.referrerPolicy = referrerPolicy;
|
||||
image.src = src;
|
||||
if (srcSet) {
|
||||
image.srcset = srcSet;
|
||||
}
|
||||
return () => {
|
||||
active = false;
|
||||
};
|
||||
}, [crossOrigin, referrerPolicy, src, srcSet]);
|
||||
return loaded;
|
||||
}
|
||||
const Avatar = /*#__PURE__*/React.forwardRef(function Avatar(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiAvatar'
|
||||
});
|
||||
const {
|
||||
alt,
|
||||
children: childrenProp,
|
||||
className,
|
||||
component = 'div',
|
||||
slots = {},
|
||||
slotProps = {},
|
||||
imgProps,
|
||||
sizes,
|
||||
src,
|
||||
srcSet,
|
||||
variant = 'circular',
|
||||
...other
|
||||
} = props;
|
||||
let children = null;
|
||||
|
||||
// Use a hook instead of onError on the img element to support server-side rendering.
|
||||
const loaded = useLoaded({
|
||||
...imgProps,
|
||||
src,
|
||||
srcSet
|
||||
});
|
||||
const hasImg = src || srcSet;
|
||||
const hasImgNotFailing = hasImg && loaded !== 'error';
|
||||
const ownerState = {
|
||||
...props,
|
||||
colorDefault: !hasImgNotFailing,
|
||||
component,
|
||||
variant
|
||||
};
|
||||
// This issue explains why this is required: https://github.com/mui/material-ui/issues/42184
|
||||
delete ownerState.ownerState;
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
const [ImgSlot, imgSlotProps] = useSlot('img', {
|
||||
className: classes.img,
|
||||
elementType: AvatarImg,
|
||||
externalForwardedProps: {
|
||||
slots,
|
||||
slotProps: {
|
||||
img: {
|
||||
...imgProps,
|
||||
...slotProps.img
|
||||
}
|
||||
}
|
||||
},
|
||||
additionalProps: {
|
||||
alt,
|
||||
src,
|
||||
srcSet,
|
||||
sizes
|
||||
},
|
||||
ownerState
|
||||
});
|
||||
if (hasImgNotFailing) {
|
||||
children = /*#__PURE__*/_jsx(ImgSlot, {
|
||||
...imgSlotProps
|
||||
});
|
||||
// We only render valid children, non valid children are rendered with a fallback
|
||||
// We consider that invalid children are all falsy values, except 0, which is valid.
|
||||
} else if (!!childrenProp || childrenProp === 0) {
|
||||
children = childrenProp;
|
||||
} else if (hasImg && alt) {
|
||||
children = alt[0];
|
||||
} else {
|
||||
children = /*#__PURE__*/_jsx(AvatarFallback, {
|
||||
ownerState: ownerState,
|
||||
className: classes.fallback
|
||||
});
|
||||
}
|
||||
return /*#__PURE__*/_jsx(AvatarRoot, {
|
||||
as: component,
|
||||
className: clsx(classes.root, className),
|
||||
ref: ref,
|
||||
...other,
|
||||
ownerState: ownerState,
|
||||
children: children
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? Avatar.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`. │
|
||||
// └─────────────────────────────────────────────────────────────────────┘
|
||||
/**
|
||||
* Used in combination with `src` or `srcSet` to
|
||||
* provide an alt attribute for the rendered `img` element.
|
||||
*/
|
||||
alt: PropTypes.string,
|
||||
/**
|
||||
* Used to render icon or text elements inside the Avatar if `src` is not set.
|
||||
* This can be an element, or just a string.
|
||||
*/
|
||||
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,
|
||||
/**
|
||||
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attributes) applied to the `img` element if the component is used to display an image.
|
||||
* It can be used to listen for the loading error event.
|
||||
*/
|
||||
imgProps: PropTypes.object,
|
||||
/**
|
||||
* The `sizes` attribute for the `img` element.
|
||||
*/
|
||||
sizes: PropTypes.string,
|
||||
/**
|
||||
* The props used for each slot inside.
|
||||
* @default {}
|
||||
*/
|
||||
slotProps: PropTypes.shape({
|
||||
img: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
||||
}),
|
||||
/**
|
||||
* The components used for each slot inside.
|
||||
* @default {}
|
||||
*/
|
||||
slots: PropTypes.shape({
|
||||
img: PropTypes.elementType
|
||||
}),
|
||||
/**
|
||||
* The `src` attribute for the `img` element.
|
||||
*/
|
||||
src: PropTypes.string,
|
||||
/**
|
||||
* The `srcSet` attribute for the `img` element.
|
||||
* Use this attribute for responsive image display.
|
||||
*/
|
||||
srcSet: PropTypes.string,
|
||||
/**
|
||||
* 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 shape of the avatar.
|
||||
* @default 'circular'
|
||||
*/
|
||||
variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['circular', 'rounded', 'square']), PropTypes.string])
|
||||
} : void 0;
|
||||
export default Avatar;
|
||||
7
node_modules/@mui/material/modern/Avatar/avatarClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/Avatar/avatarClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getAvatarUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiAvatar', slot);
|
||||
}
|
||||
const avatarClasses = generateUtilityClasses('MuiAvatar', ['root', 'colorDefault', 'circular', 'rounded', 'square', 'img', 'fallback']);
|
||||
export default avatarClasses;
|
||||
3
node_modules/@mui/material/modern/Avatar/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/Avatar/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default } from "./Avatar.js";
|
||||
export { default as avatarClasses } from "./avatarClasses.js";
|
||||
export * from "./avatarClasses.js";
|
||||
222
node_modules/@mui/material/modern/AvatarGroup/AvatarGroup.js
generated
vendored
Normal file
222
node_modules/@mui/material/modern/AvatarGroup/AvatarGroup.js
generated
vendored
Normal file
@@ -0,0 +1,222 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { isFragment } from 'react-is';
|
||||
import clsx from 'clsx';
|
||||
import chainPropTypes from '@mui/utils/chainPropTypes';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import { styled } from "../zero-styled/index.js";
|
||||
import memoTheme from "../utils/memoTheme.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import Avatar, { avatarClasses } from "../Avatar/index.js";
|
||||
import avatarGroupClasses, { getAvatarGroupUtilityClass } from "./avatarGroupClasses.js";
|
||||
import useSlot from "../utils/useSlot.js";
|
||||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
const SPACINGS = {
|
||||
small: -16,
|
||||
medium: -8
|
||||
};
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
classes
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root'],
|
||||
avatar: ['avatar']
|
||||
};
|
||||
return composeClasses(slots, getAvatarGroupUtilityClass, classes);
|
||||
};
|
||||
const AvatarGroupRoot = styled('div', {
|
||||
name: 'MuiAvatarGroup',
|
||||
slot: 'Root',
|
||||
overridesResolver: (props, styles) => ({
|
||||
[`& .${avatarGroupClasses.avatar}`]: styles.avatar,
|
||||
...styles.root
|
||||
})
|
||||
})(memoTheme(({
|
||||
theme
|
||||
}) => ({
|
||||
display: 'flex',
|
||||
flexDirection: 'row-reverse',
|
||||
[`& .${avatarClasses.root}`]: {
|
||||
border: `2px solid ${(theme.vars || theme).palette.background.default}`,
|
||||
boxSizing: 'content-box',
|
||||
marginLeft: 'var(--AvatarGroup-spacing, -8px)',
|
||||
'&:last-child': {
|
||||
marginLeft: 0
|
||||
}
|
||||
}
|
||||
})));
|
||||
const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiAvatarGroup'
|
||||
});
|
||||
const {
|
||||
children: childrenProp,
|
||||
className,
|
||||
component = 'div',
|
||||
componentsProps,
|
||||
max = 5,
|
||||
renderSurplus,
|
||||
slotProps = {},
|
||||
slots = {},
|
||||
spacing = 'medium',
|
||||
total,
|
||||
variant = 'circular',
|
||||
...other
|
||||
} = props;
|
||||
let clampedMax = max < 2 ? 2 : max;
|
||||
const ownerState = {
|
||||
...props,
|
||||
max,
|
||||
spacing,
|
||||
component,
|
||||
variant
|
||||
};
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
const children = React.Children.toArray(childrenProp).filter(child => {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (isFragment(child)) {
|
||||
console.error(["MUI: The AvatarGroup component doesn't accept a Fragment as a child.", 'Consider providing an array instead.'].join('\n'));
|
||||
}
|
||||
}
|
||||
return /*#__PURE__*/React.isValidElement(child);
|
||||
});
|
||||
const totalAvatars = total || children.length;
|
||||
if (totalAvatars === clampedMax) {
|
||||
clampedMax += 1;
|
||||
}
|
||||
clampedMax = Math.min(totalAvatars + 1, clampedMax);
|
||||
const maxAvatars = Math.min(children.length, clampedMax - 1);
|
||||
const extraAvatars = Math.max(totalAvatars - clampedMax, totalAvatars - maxAvatars, 0);
|
||||
const extraAvatarsElement = renderSurplus ? renderSurplus(extraAvatars) : `+${extraAvatars}`;
|
||||
const marginValue = ownerState.spacing && SPACINGS[ownerState.spacing] !== undefined ? SPACINGS[ownerState.spacing] : -ownerState.spacing || -8;
|
||||
const externalForwardedProps = {
|
||||
slots,
|
||||
slotProps: {
|
||||
surplus: slotProps.additionalAvatar ?? componentsProps?.additionalAvatar,
|
||||
...componentsProps,
|
||||
...slotProps
|
||||
}
|
||||
};
|
||||
const [SurplusSlot, surplusProps] = useSlot('surplus', {
|
||||
elementType: Avatar,
|
||||
externalForwardedProps,
|
||||
className: classes.avatar,
|
||||
ownerState,
|
||||
additionalProps: {
|
||||
variant,
|
||||
style: {
|
||||
'--AvatarRoot-spacing': marginValue ? `${marginValue}px` : undefined,
|
||||
...other.style
|
||||
}
|
||||
}
|
||||
});
|
||||
return /*#__PURE__*/_jsxs(AvatarGroupRoot, {
|
||||
as: component,
|
||||
ownerState: ownerState,
|
||||
className: clsx(classes.root, className),
|
||||
ref: ref,
|
||||
...other,
|
||||
children: [extraAvatars ? /*#__PURE__*/_jsx(SurplusSlot, {
|
||||
...surplusProps,
|
||||
children: extraAvatarsElement
|
||||
}) : null, children.slice(0, maxAvatars).reverse().map(child => {
|
||||
return /*#__PURE__*/React.cloneElement(child, {
|
||||
className: clsx(child.props.className, classes.avatar),
|
||||
variant: child.props.variant || variant
|
||||
});
|
||||
})]
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? AvatarGroup.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 avatars to stack.
|
||||
*/
|
||||
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,
|
||||
/**
|
||||
* The extra props for the slot components.
|
||||
* You can override the existing props or add new ones.
|
||||
*
|
||||
* This prop is an alias for the `slotProps` prop.
|
||||
*
|
||||
* @deprecated use the `slotProps` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
||||
*/
|
||||
componentsProps: PropTypes.shape({
|
||||
additionalAvatar: PropTypes.object
|
||||
}),
|
||||
/**
|
||||
* Max avatars to show before +x.
|
||||
* @default 5
|
||||
*/
|
||||
max: chainPropTypes(PropTypes.number, props => {
|
||||
if (props.max < 2) {
|
||||
return new Error(['MUI: The prop `max` should be equal to 2 or above.', 'A value below is clamped to 2.'].join('\n'));
|
||||
}
|
||||
return null;
|
||||
}),
|
||||
/**
|
||||
* custom renderer of extraAvatars
|
||||
* @param {number} surplus number of extra avatars
|
||||
* @returns {React.ReactNode} custom element to display
|
||||
*/
|
||||
renderSurplus: PropTypes.func,
|
||||
/**
|
||||
* The props used for each slot inside.
|
||||
* @default {}
|
||||
*/
|
||||
slotProps: PropTypes.shape({
|
||||
additionalAvatar: PropTypes.object,
|
||||
surplus: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
||||
}),
|
||||
/**
|
||||
* The components used for each slot inside.
|
||||
* @default {}
|
||||
*/
|
||||
slots: PropTypes.shape({
|
||||
surplus: PropTypes.elementType
|
||||
}),
|
||||
/**
|
||||
* Spacing between avatars.
|
||||
* @default 'medium'
|
||||
*/
|
||||
spacing: PropTypes.oneOfType([PropTypes.oneOf(['medium', 'small']), PropTypes.number]),
|
||||
/**
|
||||
* @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]),
|
||||
/**
|
||||
* The total number of avatars. Used for calculating the number of extra avatars.
|
||||
* @default children.length
|
||||
*/
|
||||
total: PropTypes.number,
|
||||
/**
|
||||
* The variant to use.
|
||||
* @default 'circular'
|
||||
*/
|
||||
variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['circular', 'rounded', 'square']), PropTypes.string])
|
||||
} : void 0;
|
||||
export default AvatarGroup;
|
||||
7
node_modules/@mui/material/modern/AvatarGroup/avatarGroupClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/AvatarGroup/avatarGroupClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getAvatarGroupUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiAvatarGroup', slot);
|
||||
}
|
||||
const avatarGroupClasses = generateUtilityClasses('MuiAvatarGroup', ['root', 'avatar']);
|
||||
export default avatarGroupClasses;
|
||||
3
node_modules/@mui/material/modern/AvatarGroup/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/AvatarGroup/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default } from "./AvatarGroup.js";
|
||||
export { default as avatarGroupClasses } from "./avatarGroupClasses.js";
|
||||
export * from "./avatarGroupClasses.js";
|
||||
205
node_modules/@mui/material/modern/Backdrop/Backdrop.js
generated
vendored
Normal file
205
node_modules/@mui/material/modern/Backdrop/Backdrop.js
generated
vendored
Normal file
@@ -0,0 +1,205 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import { styled } from "../zero-styled/index.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import useSlot from "../utils/useSlot.js";
|
||||
import Fade from "../Fade/index.js";
|
||||
import { getBackdropUtilityClass } from "./backdropClasses.js";
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
classes,
|
||||
invisible
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root', invisible && 'invisible']
|
||||
};
|
||||
return composeClasses(slots, getBackdropUtilityClass, classes);
|
||||
};
|
||||
const BackdropRoot = styled('div', {
|
||||
name: 'MuiBackdrop',
|
||||
slot: 'Root',
|
||||
overridesResolver: (props, styles) => {
|
||||
const {
|
||||
ownerState
|
||||
} = props;
|
||||
return [styles.root, ownerState.invisible && styles.invisible];
|
||||
}
|
||||
})({
|
||||
position: 'fixed',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
top: 0,
|
||||
left: 0,
|
||||
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
||||
WebkitTapHighlightColor: 'transparent',
|
||||
variants: [{
|
||||
props: {
|
||||
invisible: true
|
||||
},
|
||||
style: {
|
||||
backgroundColor: 'transparent'
|
||||
}
|
||||
}]
|
||||
});
|
||||
const Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiBackdrop'
|
||||
});
|
||||
const {
|
||||
children,
|
||||
className,
|
||||
component = 'div',
|
||||
invisible = false,
|
||||
open,
|
||||
components = {},
|
||||
componentsProps = {},
|
||||
slotProps = {},
|
||||
slots = {},
|
||||
TransitionComponent: TransitionComponentProp,
|
||||
transitionDuration,
|
||||
...other
|
||||
} = props;
|
||||
const ownerState = {
|
||||
...props,
|
||||
component,
|
||||
invisible
|
||||
};
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
const backwardCompatibleSlots = {
|
||||
transition: TransitionComponentProp,
|
||||
root: components.Root,
|
||||
...slots
|
||||
};
|
||||
const backwardCompatibleSlotProps = {
|
||||
...componentsProps,
|
||||
...slotProps
|
||||
};
|
||||
const externalForwardedProps = {
|
||||
slots: backwardCompatibleSlots,
|
||||
slotProps: backwardCompatibleSlotProps
|
||||
};
|
||||
const [RootSlot, rootProps] = useSlot('root', {
|
||||
elementType: BackdropRoot,
|
||||
externalForwardedProps,
|
||||
className: clsx(classes.root, className),
|
||||
ownerState
|
||||
});
|
||||
const [TransitionSlot, transitionProps] = useSlot('transition', {
|
||||
elementType: Fade,
|
||||
externalForwardedProps,
|
||||
ownerState
|
||||
});
|
||||
delete transitionProps.ownerState;
|
||||
return /*#__PURE__*/_jsx(TransitionSlot, {
|
||||
in: open,
|
||||
timeout: transitionDuration,
|
||||
...other,
|
||||
...transitionProps,
|
||||
children: /*#__PURE__*/_jsx(RootSlot, {
|
||||
"aria-hidden": true,
|
||||
...rootProps,
|
||||
classes: classes,
|
||||
ref: ref,
|
||||
children: children
|
||||
})
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? Backdrop.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 component used for the root node.
|
||||
* Either a string to use a HTML element or a component.
|
||||
*/
|
||||
component: PropTypes.elementType,
|
||||
/**
|
||||
* The components used for each slot inside.
|
||||
*
|
||||
* @deprecated Use the `slots` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
||||
*
|
||||
* @default {}
|
||||
*/
|
||||
components: PropTypes.shape({
|
||||
Root: PropTypes.elementType
|
||||
}),
|
||||
/**
|
||||
* The extra props for the slot components.
|
||||
* You can override the existing props or add new ones.
|
||||
*
|
||||
* @deprecated Use the `slotProps` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
||||
*
|
||||
* @default {}
|
||||
*/
|
||||
componentsProps: PropTypes.shape({
|
||||
root: PropTypes.object
|
||||
}),
|
||||
/**
|
||||
* If `true`, the backdrop is invisible.
|
||||
* It can be used when rendering a popover or a custom select component.
|
||||
* @default false
|
||||
*/
|
||||
invisible: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, the component is shown.
|
||||
*/
|
||||
open: PropTypes.bool.isRequired,
|
||||
/**
|
||||
* The props used for each slot inside.
|
||||
* @default {}
|
||||
*/
|
||||
slotProps: PropTypes.shape({
|
||||
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
||||
transition: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
||||
}),
|
||||
/**
|
||||
* The components used for each slot inside.
|
||||
* @default {}
|
||||
*/
|
||||
slots: PropTypes.shape({
|
||||
root: PropTypes.elementType,
|
||||
transition: PropTypes.elementType
|
||||
}),
|
||||
/**
|
||||
* 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 component used for the transition.
|
||||
* [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
|
||||
* @default Fade
|
||||
*/
|
||||
TransitionComponent: PropTypes.elementType,
|
||||
/**
|
||||
* The duration for the transition, in milliseconds.
|
||||
* You may specify a single timeout for all transitions, or individually with an object.
|
||||
*/
|
||||
transitionDuration: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
||||
appear: PropTypes.number,
|
||||
enter: PropTypes.number,
|
||||
exit: PropTypes.number
|
||||
})])
|
||||
} : void 0;
|
||||
export default Backdrop;
|
||||
7
node_modules/@mui/material/modern/Backdrop/backdropClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/Backdrop/backdropClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getBackdropUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiBackdrop', slot);
|
||||
}
|
||||
const backdropClasses = generateUtilityClasses('MuiBackdrop', ['root', 'invisible']);
|
||||
export default backdropClasses;
|
||||
3
node_modules/@mui/material/modern/Backdrop/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/Backdrop/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default } from "./Backdrop.js";
|
||||
export { default as backdropClasses } from "./backdropClasses.js";
|
||||
export * from "./backdropClasses.js";
|
||||
424
node_modules/@mui/material/modern/Badge/Badge.js
generated
vendored
Normal file
424
node_modules/@mui/material/modern/Badge/Badge.js
generated
vendored
Normal file
@@ -0,0 +1,424 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import usePreviousProps from '@mui/utils/usePreviousProps';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import useSlotProps from '@mui/utils/useSlotProps';
|
||||
import useBadge from "./useBadge.js";
|
||||
import { styled } from "../zero-styled/index.js";
|
||||
import memoTheme from "../utils/memoTheme.js";
|
||||
import createSimplePaletteValueFilter from "../utils/createSimplePaletteValueFilter.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import capitalize from "../utils/capitalize.js";
|
||||
import badgeClasses, { getBadgeUtilityClass } from "./badgeClasses.js";
|
||||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
const RADIUS_STANDARD = 10;
|
||||
const RADIUS_DOT = 4;
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
color,
|
||||
anchorOrigin,
|
||||
invisible,
|
||||
overlap,
|
||||
variant,
|
||||
classes = {}
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root'],
|
||||
badge: ['badge', variant, invisible && 'invisible', `anchorOrigin${capitalize(anchorOrigin.vertical)}${capitalize(anchorOrigin.horizontal)}`, `anchorOrigin${capitalize(anchorOrigin.vertical)}${capitalize(anchorOrigin.horizontal)}${capitalize(overlap)}`, `overlap${capitalize(overlap)}`, color !== 'default' && `color${capitalize(color)}`]
|
||||
};
|
||||
return composeClasses(slots, getBadgeUtilityClass, classes);
|
||||
};
|
||||
const BadgeRoot = styled('span', {
|
||||
name: 'MuiBadge',
|
||||
slot: 'Root',
|
||||
overridesResolver: (props, styles) => styles.root
|
||||
})({
|
||||
position: 'relative',
|
||||
display: 'inline-flex',
|
||||
// For correct alignment with the text.
|
||||
verticalAlign: 'middle',
|
||||
flexShrink: 0
|
||||
});
|
||||
const BadgeBadge = styled('span', {
|
||||
name: 'MuiBadge',
|
||||
slot: 'Badge',
|
||||
overridesResolver: (props, styles) => {
|
||||
const {
|
||||
ownerState
|
||||
} = props;
|
||||
return [styles.badge, styles[ownerState.variant], styles[`anchorOrigin${capitalize(ownerState.anchorOrigin.vertical)}${capitalize(ownerState.anchorOrigin.horizontal)}${capitalize(ownerState.overlap)}`], ownerState.color !== 'default' && styles[`color${capitalize(ownerState.color)}`], ownerState.invisible && styles.invisible];
|
||||
}
|
||||
})(memoTheme(({
|
||||
theme
|
||||
}) => ({
|
||||
display: 'flex',
|
||||
flexDirection: 'row',
|
||||
flexWrap: 'wrap',
|
||||
justifyContent: 'center',
|
||||
alignContent: 'center',
|
||||
alignItems: 'center',
|
||||
position: 'absolute',
|
||||
boxSizing: 'border-box',
|
||||
fontFamily: theme.typography.fontFamily,
|
||||
fontWeight: theme.typography.fontWeightMedium,
|
||||
fontSize: theme.typography.pxToRem(12),
|
||||
minWidth: RADIUS_STANDARD * 2,
|
||||
lineHeight: 1,
|
||||
padding: '0 6px',
|
||||
height: RADIUS_STANDARD * 2,
|
||||
borderRadius: RADIUS_STANDARD,
|
||||
zIndex: 1,
|
||||
// Render the badge on top of potential ripples.
|
||||
transition: theme.transitions.create('transform', {
|
||||
easing: theme.transitions.easing.easeInOut,
|
||||
duration: theme.transitions.duration.enteringScreen
|
||||
}),
|
||||
variants: [...Object.entries(theme.palette).filter(createSimplePaletteValueFilter(['contrastText'])).map(([color]) => ({
|
||||
props: {
|
||||
color
|
||||
},
|
||||
style: {
|
||||
backgroundColor: (theme.vars || theme).palette[color].main,
|
||||
color: (theme.vars || theme).palette[color].contrastText
|
||||
}
|
||||
})), {
|
||||
props: {
|
||||
variant: 'dot'
|
||||
},
|
||||
style: {
|
||||
borderRadius: RADIUS_DOT,
|
||||
height: RADIUS_DOT * 2,
|
||||
minWidth: RADIUS_DOT * 2,
|
||||
padding: 0
|
||||
}
|
||||
}, {
|
||||
props: ({
|
||||
ownerState
|
||||
}) => ownerState.anchorOrigin.vertical === 'top' && ownerState.anchorOrigin.horizontal === 'right' && ownerState.overlap === 'rectangular',
|
||||
style: {
|
||||
top: 0,
|
||||
right: 0,
|
||||
transform: 'scale(1) translate(50%, -50%)',
|
||||
transformOrigin: '100% 0%',
|
||||
[`&.${badgeClasses.invisible}`]: {
|
||||
transform: 'scale(0) translate(50%, -50%)'
|
||||
}
|
||||
}
|
||||
}, {
|
||||
props: ({
|
||||
ownerState
|
||||
}) => ownerState.anchorOrigin.vertical === 'bottom' && ownerState.anchorOrigin.horizontal === 'right' && ownerState.overlap === 'rectangular',
|
||||
style: {
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
transform: 'scale(1) translate(50%, 50%)',
|
||||
transformOrigin: '100% 100%',
|
||||
[`&.${badgeClasses.invisible}`]: {
|
||||
transform: 'scale(0) translate(50%, 50%)'
|
||||
}
|
||||
}
|
||||
}, {
|
||||
props: ({
|
||||
ownerState
|
||||
}) => ownerState.anchorOrigin.vertical === 'top' && ownerState.anchorOrigin.horizontal === 'left' && ownerState.overlap === 'rectangular',
|
||||
style: {
|
||||
top: 0,
|
||||
left: 0,
|
||||
transform: 'scale(1) translate(-50%, -50%)',
|
||||
transformOrigin: '0% 0%',
|
||||
[`&.${badgeClasses.invisible}`]: {
|
||||
transform: 'scale(0) translate(-50%, -50%)'
|
||||
}
|
||||
}
|
||||
}, {
|
||||
props: ({
|
||||
ownerState
|
||||
}) => ownerState.anchorOrigin.vertical === 'bottom' && ownerState.anchorOrigin.horizontal === 'left' && ownerState.overlap === 'rectangular',
|
||||
style: {
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
transform: 'scale(1) translate(-50%, 50%)',
|
||||
transformOrigin: '0% 100%',
|
||||
[`&.${badgeClasses.invisible}`]: {
|
||||
transform: 'scale(0) translate(-50%, 50%)'
|
||||
}
|
||||
}
|
||||
}, {
|
||||
props: ({
|
||||
ownerState
|
||||
}) => ownerState.anchorOrigin.vertical === 'top' && ownerState.anchorOrigin.horizontal === 'right' && ownerState.overlap === 'circular',
|
||||
style: {
|
||||
top: '14%',
|
||||
right: '14%',
|
||||
transform: 'scale(1) translate(50%, -50%)',
|
||||
transformOrigin: '100% 0%',
|
||||
[`&.${badgeClasses.invisible}`]: {
|
||||
transform: 'scale(0) translate(50%, -50%)'
|
||||
}
|
||||
}
|
||||
}, {
|
||||
props: ({
|
||||
ownerState
|
||||
}) => ownerState.anchorOrigin.vertical === 'bottom' && ownerState.anchorOrigin.horizontal === 'right' && ownerState.overlap === 'circular',
|
||||
style: {
|
||||
bottom: '14%',
|
||||
right: '14%',
|
||||
transform: 'scale(1) translate(50%, 50%)',
|
||||
transformOrigin: '100% 100%',
|
||||
[`&.${badgeClasses.invisible}`]: {
|
||||
transform: 'scale(0) translate(50%, 50%)'
|
||||
}
|
||||
}
|
||||
}, {
|
||||
props: ({
|
||||
ownerState
|
||||
}) => ownerState.anchorOrigin.vertical === 'top' && ownerState.anchorOrigin.horizontal === 'left' && ownerState.overlap === 'circular',
|
||||
style: {
|
||||
top: '14%',
|
||||
left: '14%',
|
||||
transform: 'scale(1) translate(-50%, -50%)',
|
||||
transformOrigin: '0% 0%',
|
||||
[`&.${badgeClasses.invisible}`]: {
|
||||
transform: 'scale(0) translate(-50%, -50%)'
|
||||
}
|
||||
}
|
||||
}, {
|
||||
props: ({
|
||||
ownerState
|
||||
}) => ownerState.anchorOrigin.vertical === 'bottom' && ownerState.anchorOrigin.horizontal === 'left' && ownerState.overlap === 'circular',
|
||||
style: {
|
||||
bottom: '14%',
|
||||
left: '14%',
|
||||
transform: 'scale(1) translate(-50%, 50%)',
|
||||
transformOrigin: '0% 100%',
|
||||
[`&.${badgeClasses.invisible}`]: {
|
||||
transform: 'scale(0) translate(-50%, 50%)'
|
||||
}
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
invisible: true
|
||||
},
|
||||
style: {
|
||||
transition: theme.transitions.create('transform', {
|
||||
easing: theme.transitions.easing.easeInOut,
|
||||
duration: theme.transitions.duration.leavingScreen
|
||||
})
|
||||
}
|
||||
}]
|
||||
})));
|
||||
const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiBadge'
|
||||
});
|
||||
const {
|
||||
anchorOrigin: anchorOriginProp = {
|
||||
vertical: 'top',
|
||||
horizontal: 'right'
|
||||
},
|
||||
className,
|
||||
classes: classesProp,
|
||||
component,
|
||||
components = {},
|
||||
componentsProps = {},
|
||||
children,
|
||||
overlap: overlapProp = 'rectangular',
|
||||
color: colorProp = 'default',
|
||||
invisible: invisibleProp = false,
|
||||
max: maxProp = 99,
|
||||
badgeContent: badgeContentProp,
|
||||
slots,
|
||||
slotProps,
|
||||
showZero = false,
|
||||
variant: variantProp = 'standard',
|
||||
...other
|
||||
} = props;
|
||||
const {
|
||||
badgeContent,
|
||||
invisible: invisibleFromHook,
|
||||
max,
|
||||
displayValue: displayValueFromHook
|
||||
} = useBadge({
|
||||
max: maxProp,
|
||||
invisible: invisibleProp,
|
||||
badgeContent: badgeContentProp,
|
||||
showZero
|
||||
});
|
||||
const prevProps = usePreviousProps({
|
||||
anchorOrigin: anchorOriginProp,
|
||||
color: colorProp,
|
||||
overlap: overlapProp,
|
||||
variant: variantProp,
|
||||
badgeContent: badgeContentProp
|
||||
});
|
||||
const invisible = invisibleFromHook || badgeContent == null && variantProp !== 'dot';
|
||||
const {
|
||||
color = colorProp,
|
||||
overlap = overlapProp,
|
||||
anchorOrigin = anchorOriginProp,
|
||||
variant = variantProp
|
||||
} = invisible ? prevProps : props;
|
||||
const displayValue = variant !== 'dot' ? displayValueFromHook : undefined;
|
||||
const ownerState = {
|
||||
...props,
|
||||
badgeContent,
|
||||
invisible,
|
||||
max,
|
||||
displayValue,
|
||||
showZero,
|
||||
anchorOrigin,
|
||||
color,
|
||||
overlap,
|
||||
variant
|
||||
};
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
|
||||
// support both `slots` and `components` for backward compatibility
|
||||
const RootSlot = slots?.root ?? components.Root ?? BadgeRoot;
|
||||
const BadgeSlot = slots?.badge ?? components.Badge ?? BadgeBadge;
|
||||
const rootSlotProps = slotProps?.root ?? componentsProps.root;
|
||||
const badgeSlotProps = slotProps?.badge ?? componentsProps.badge;
|
||||
const rootProps = useSlotProps({
|
||||
elementType: RootSlot,
|
||||
externalSlotProps: rootSlotProps,
|
||||
externalForwardedProps: other,
|
||||
additionalProps: {
|
||||
ref,
|
||||
as: component
|
||||
},
|
||||
ownerState,
|
||||
className: clsx(rootSlotProps?.className, classes.root, className)
|
||||
});
|
||||
const badgeProps = useSlotProps({
|
||||
elementType: BadgeSlot,
|
||||
externalSlotProps: badgeSlotProps,
|
||||
ownerState,
|
||||
className: clsx(classes.badge, badgeSlotProps?.className)
|
||||
});
|
||||
return /*#__PURE__*/_jsxs(RootSlot, {
|
||||
...rootProps,
|
||||
children: [children, /*#__PURE__*/_jsx(BadgeSlot, {
|
||||
...badgeProps,
|
||||
children: displayValue
|
||||
})]
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? Badge.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 anchor of the badge.
|
||||
* @default {
|
||||
* vertical: 'top',
|
||||
* horizontal: 'right',
|
||||
* }
|
||||
*/
|
||||
anchorOrigin: PropTypes.shape({
|
||||
horizontal: PropTypes.oneOf(['left', 'right']).isRequired,
|
||||
vertical: PropTypes.oneOf(['bottom', 'top']).isRequired
|
||||
}),
|
||||
/**
|
||||
* The content rendered within the badge.
|
||||
*/
|
||||
badgeContent: PropTypes.node,
|
||||
/**
|
||||
* The badge will be added relative to this node.
|
||||
*/
|
||||
children: PropTypes.node,
|
||||
/**
|
||||
* Override or extend the styles applied to the component.
|
||||
*/
|
||||
classes: PropTypes.object,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className: PropTypes.string,
|
||||
/**
|
||||
* The color of the component.
|
||||
* It supports both default and custom theme colors, which can be added as shown in the
|
||||
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
||||
* @default 'default'
|
||||
*/
|
||||
color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['default', 'primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),
|
||||
/**
|
||||
* The component used for the root node.
|
||||
* Either a string to use a HTML element or a component.
|
||||
*/
|
||||
component: PropTypes.elementType,
|
||||
/**
|
||||
* The components used for each slot inside.
|
||||
*
|
||||
* @deprecated use the `slots` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
||||
*
|
||||
* @default {}
|
||||
*/
|
||||
components: PropTypes.shape({
|
||||
Badge: PropTypes.elementType,
|
||||
Root: PropTypes.elementType
|
||||
}),
|
||||
/**
|
||||
* The extra props for the slot components.
|
||||
* You can override the existing props or add new ones.
|
||||
*
|
||||
* @deprecated use the `slotProps` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
||||
*
|
||||
* @default {}
|
||||
*/
|
||||
componentsProps: PropTypes.shape({
|
||||
badge: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
||||
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
||||
}),
|
||||
/**
|
||||
* If `true`, the badge is invisible.
|
||||
* @default false
|
||||
*/
|
||||
invisible: PropTypes.bool,
|
||||
/**
|
||||
* Max count to show.
|
||||
* @default 99
|
||||
*/
|
||||
max: PropTypes.number,
|
||||
/**
|
||||
* Wrapped shape the badge should overlap.
|
||||
* @default 'rectangular'
|
||||
*/
|
||||
overlap: PropTypes.oneOf(['circular', 'rectangular']),
|
||||
/**
|
||||
* Controls whether the badge is hidden when `badgeContent` is zero.
|
||||
* @default false
|
||||
*/
|
||||
showZero: PropTypes.bool,
|
||||
/**
|
||||
* The props used for each slot inside the Badge.
|
||||
* @default {}
|
||||
*/
|
||||
slotProps: PropTypes.shape({
|
||||
badge: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
||||
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
||||
}),
|
||||
/**
|
||||
* The components used for each slot inside the Badge.
|
||||
* Either a string to use a HTML element or a component.
|
||||
* @default {}
|
||||
*/
|
||||
slots: PropTypes.shape({
|
||||
badge: PropTypes.elementType,
|
||||
root: PropTypes.elementType
|
||||
}),
|
||||
/**
|
||||
* 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 'standard'
|
||||
*/
|
||||
variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['dot', 'standard']), PropTypes.string])
|
||||
} : void 0;
|
||||
export default Badge;
|
||||
9
node_modules/@mui/material/modern/Badge/badgeClasses.js
generated
vendored
Normal file
9
node_modules/@mui/material/modern/Badge/badgeClasses.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getBadgeUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiBadge', slot);
|
||||
}
|
||||
const badgeClasses = generateUtilityClasses('MuiBadge', ['root', 'badge', 'dot', 'standard', 'anchorOriginTopRight', 'anchorOriginBottomRight', 'anchorOriginTopLeft', 'anchorOriginBottomLeft', 'invisible', 'colorError', 'colorInfo', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorWarning', 'overlapRectangular', 'overlapCircular',
|
||||
// TODO: v6 remove the overlap value from these class keys
|
||||
'anchorOriginTopLeftCircular', 'anchorOriginTopLeftRectangular', 'anchorOriginTopRightCircular', 'anchorOriginTopRightRectangular', 'anchorOriginBottomLeftCircular', 'anchorOriginBottomLeftRectangular', 'anchorOriginBottomRightCircular', 'anchorOriginBottomRightRectangular']);
|
||||
export default badgeClasses;
|
||||
3
node_modules/@mui/material/modern/Badge/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/Badge/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default } from "./Badge.js";
|
||||
export { default as badgeClasses } from "./badgeClasses.js";
|
||||
export * from "./badgeClasses.js";
|
||||
41
node_modules/@mui/material/modern/Badge/useBadge.js
generated
vendored
Normal file
41
node_modules/@mui/material/modern/Badge/useBadge.js
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
'use client';
|
||||
|
||||
import { usePreviousProps } from '@mui/utils';
|
||||
/**
|
||||
*
|
||||
* Demos:
|
||||
*
|
||||
* - [Badge](https://mui.com/base-ui/react-badge/#hook)
|
||||
*
|
||||
* API:
|
||||
*
|
||||
* - [useBadge API](https://mui.com/base-ui/react-badge/hooks-api/#use-badge)
|
||||
*/
|
||||
function useBadge(parameters) {
|
||||
const {
|
||||
badgeContent: badgeContentProp,
|
||||
invisible: invisibleProp = false,
|
||||
max: maxProp = 99,
|
||||
showZero = false
|
||||
} = parameters;
|
||||
const prevProps = usePreviousProps({
|
||||
badgeContent: badgeContentProp,
|
||||
max: maxProp
|
||||
});
|
||||
let invisible = invisibleProp;
|
||||
if (invisibleProp === false && badgeContentProp === 0 && !showZero) {
|
||||
invisible = true;
|
||||
}
|
||||
const {
|
||||
badgeContent,
|
||||
max = maxProp
|
||||
} = invisible ? prevProps : parameters;
|
||||
const displayValue = badgeContent && Number(badgeContent) > max ? `${max}+` : badgeContent;
|
||||
return {
|
||||
badgeContent,
|
||||
invisible,
|
||||
max,
|
||||
displayValue
|
||||
};
|
||||
}
|
||||
export default useBadge;
|
||||
1
node_modules/@mui/material/modern/Badge/useBadge.types.js
generated
vendored
Normal file
1
node_modules/@mui/material/modern/Badge/useBadge.types.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
123
node_modules/@mui/material/modern/BottomNavigation/BottomNavigation.js
generated
vendored
Normal file
123
node_modules/@mui/material/modern/BottomNavigation/BottomNavigation.js
generated
vendored
Normal file
@@ -0,0 +1,123 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import { isFragment } from 'react-is';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import { styled } from "../zero-styled/index.js";
|
||||
import memoTheme from "../utils/memoTheme.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import { getBottomNavigationUtilityClass } from "./bottomNavigationClasses.js";
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
classes
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root']
|
||||
};
|
||||
return composeClasses(slots, getBottomNavigationUtilityClass, classes);
|
||||
};
|
||||
const BottomNavigationRoot = styled('div', {
|
||||
name: 'MuiBottomNavigation',
|
||||
slot: 'Root',
|
||||
overridesResolver: (props, styles) => styles.root
|
||||
})(memoTheme(({
|
||||
theme
|
||||
}) => ({
|
||||
display: 'flex',
|
||||
justifyContent: 'center',
|
||||
height: 56,
|
||||
backgroundColor: (theme.vars || theme).palette.background.paper
|
||||
})));
|
||||
const BottomNavigation = /*#__PURE__*/React.forwardRef(function BottomNavigation(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiBottomNavigation'
|
||||
});
|
||||
const {
|
||||
children,
|
||||
className,
|
||||
component = 'div',
|
||||
onChange,
|
||||
showLabels = false,
|
||||
value,
|
||||
...other
|
||||
} = props;
|
||||
const ownerState = {
|
||||
...props,
|
||||
component,
|
||||
showLabels
|
||||
};
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
return /*#__PURE__*/_jsx(BottomNavigationRoot, {
|
||||
as: component,
|
||||
className: clsx(classes.root, className),
|
||||
ref: ref,
|
||||
ownerState: ownerState,
|
||||
...other,
|
||||
children: React.Children.map(children, (child, childIndex) => {
|
||||
if (! /*#__PURE__*/React.isValidElement(child)) {
|
||||
return null;
|
||||
}
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (isFragment(child)) {
|
||||
console.error(["MUI: The BottomNavigation component doesn't accept a Fragment as a child.", 'Consider providing an array instead.'].join('\n'));
|
||||
}
|
||||
}
|
||||
const childValue = child.props.value === undefined ? childIndex : child.props.value;
|
||||
return /*#__PURE__*/React.cloneElement(child, {
|
||||
selected: childValue === value,
|
||||
showLabel: child.props.showLabel !== undefined ? child.props.showLabel : showLabels,
|
||||
value: childValue,
|
||||
onChange
|
||||
});
|
||||
})
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? BottomNavigation.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 component used for the root node.
|
||||
* Either a string to use a HTML element or a component.
|
||||
*/
|
||||
component: PropTypes.elementType,
|
||||
/**
|
||||
* Callback fired when the value changes.
|
||||
*
|
||||
* @param {React.SyntheticEvent} event The event source of the callback. **Warning**: This is a generic event not a change event.
|
||||
* @param {any} value We default to the index of the child.
|
||||
*/
|
||||
onChange: PropTypes.func,
|
||||
/**
|
||||
* If `true`, all `BottomNavigationAction`s will show their labels.
|
||||
* By default, only the selected `BottomNavigationAction` will show its label.
|
||||
* @default false
|
||||
*/
|
||||
showLabels: 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]),
|
||||
/**
|
||||
* The value of the currently selected `BottomNavigationAction`.
|
||||
*/
|
||||
value: PropTypes.any
|
||||
} : void 0;
|
||||
export default BottomNavigation;
|
||||
7
node_modules/@mui/material/modern/BottomNavigation/bottomNavigationClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/BottomNavigation/bottomNavigationClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getBottomNavigationUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiBottomNavigation', slot);
|
||||
}
|
||||
const bottomNavigationClasses = generateUtilityClasses('MuiBottomNavigation', ['root']);
|
||||
export default bottomNavigationClasses;
|
||||
3
node_modules/@mui/material/modern/BottomNavigation/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/BottomNavigation/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default } from "./BottomNavigation.js";
|
||||
export { default as bottomNavigationClasses } from "./bottomNavigationClasses.js";
|
||||
export * from "./bottomNavigationClasses.js";
|
||||
187
node_modules/@mui/material/modern/BottomNavigationAction/BottomNavigationAction.js
generated
vendored
Normal file
187
node_modules/@mui/material/modern/BottomNavigationAction/BottomNavigationAction.js
generated
vendored
Normal file
@@ -0,0 +1,187 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import { styled } from "../zero-styled/index.js";
|
||||
import memoTheme from "../utils/memoTheme.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import ButtonBase from "../ButtonBase/index.js";
|
||||
import unsupportedProp from "../utils/unsupportedProp.js";
|
||||
import bottomNavigationActionClasses, { getBottomNavigationActionUtilityClass } from "./bottomNavigationActionClasses.js";
|
||||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
classes,
|
||||
showLabel,
|
||||
selected
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root', !showLabel && !selected && 'iconOnly', selected && 'selected'],
|
||||
label: ['label', !showLabel && !selected && 'iconOnly', selected && 'selected']
|
||||
};
|
||||
return composeClasses(slots, getBottomNavigationActionUtilityClass, classes);
|
||||
};
|
||||
const BottomNavigationActionRoot = styled(ButtonBase, {
|
||||
name: 'MuiBottomNavigationAction',
|
||||
slot: 'Root',
|
||||
overridesResolver: (props, styles) => {
|
||||
const {
|
||||
ownerState
|
||||
} = props;
|
||||
return [styles.root, !ownerState.showLabel && !ownerState.selected && styles.iconOnly];
|
||||
}
|
||||
})(memoTheme(({
|
||||
theme
|
||||
}) => ({
|
||||
transition: theme.transitions.create(['color', 'padding-top'], {
|
||||
duration: theme.transitions.duration.short
|
||||
}),
|
||||
padding: '0px 12px',
|
||||
minWidth: 80,
|
||||
maxWidth: 168,
|
||||
color: (theme.vars || theme).palette.text.secondary,
|
||||
flexDirection: 'column',
|
||||
flex: '1',
|
||||
[`&.${bottomNavigationActionClasses.selected}`]: {
|
||||
color: (theme.vars || theme).palette.primary.main
|
||||
},
|
||||
variants: [{
|
||||
props: ({
|
||||
showLabel,
|
||||
selected
|
||||
}) => !showLabel && !selected,
|
||||
style: {
|
||||
paddingTop: 14
|
||||
}
|
||||
}, {
|
||||
props: ({
|
||||
showLabel,
|
||||
selected,
|
||||
label
|
||||
}) => !showLabel && !selected && !label,
|
||||
style: {
|
||||
paddingTop: 0
|
||||
}
|
||||
}]
|
||||
})));
|
||||
const BottomNavigationActionLabel = styled('span', {
|
||||
name: 'MuiBottomNavigationAction',
|
||||
slot: 'Label',
|
||||
overridesResolver: (props, styles) => styles.label
|
||||
})(memoTheme(({
|
||||
theme
|
||||
}) => ({
|
||||
fontFamily: theme.typography.fontFamily,
|
||||
fontSize: theme.typography.pxToRem(12),
|
||||
opacity: 1,
|
||||
transition: 'font-size 0.2s, opacity 0.2s',
|
||||
transitionDelay: '0.1s',
|
||||
[`&.${bottomNavigationActionClasses.selected}`]: {
|
||||
fontSize: theme.typography.pxToRem(14)
|
||||
},
|
||||
variants: [{
|
||||
props: ({
|
||||
showLabel,
|
||||
selected
|
||||
}) => !showLabel && !selected,
|
||||
style: {
|
||||
opacity: 0,
|
||||
transitionDelay: '0s'
|
||||
}
|
||||
}]
|
||||
})));
|
||||
const BottomNavigationAction = /*#__PURE__*/React.forwardRef(function BottomNavigationAction(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiBottomNavigationAction'
|
||||
});
|
||||
const {
|
||||
className,
|
||||
icon,
|
||||
label,
|
||||
onChange,
|
||||
onClick,
|
||||
// eslint-disable-next-line react/prop-types -- private, always overridden by BottomNavigation
|
||||
selected,
|
||||
showLabel,
|
||||
value,
|
||||
...other
|
||||
} = props;
|
||||
const ownerState = props;
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
const handleChange = event => {
|
||||
if (onChange) {
|
||||
onChange(event, value);
|
||||
}
|
||||
if (onClick) {
|
||||
onClick(event);
|
||||
}
|
||||
};
|
||||
return /*#__PURE__*/_jsxs(BottomNavigationActionRoot, {
|
||||
ref: ref,
|
||||
className: clsx(classes.root, className),
|
||||
focusRipple: true,
|
||||
onClick: handleChange,
|
||||
ownerState: ownerState,
|
||||
...other,
|
||||
children: [icon, /*#__PURE__*/_jsx(BottomNavigationActionLabel, {
|
||||
className: classes.label,
|
||||
ownerState: ownerState,
|
||||
children: label
|
||||
})]
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? BottomNavigationAction.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`. │
|
||||
// └─────────────────────────────────────────────────────────────────────┘
|
||||
/**
|
||||
* This prop isn't supported.
|
||||
* Use the `component` prop if you need to change the children structure.
|
||||
*/
|
||||
children: unsupportedProp,
|
||||
/**
|
||||
* Override or extend the styles applied to the component.
|
||||
*/
|
||||
classes: PropTypes.object,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className: PropTypes.string,
|
||||
/**
|
||||
* The icon to display.
|
||||
*/
|
||||
icon: PropTypes.node,
|
||||
/**
|
||||
* The label element.
|
||||
*/
|
||||
label: PropTypes.node,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onChange: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onClick: PropTypes.func,
|
||||
/**
|
||||
* If `true`, the `BottomNavigationAction` will show its label.
|
||||
* By default, only the selected `BottomNavigationAction`
|
||||
* inside `BottomNavigation` will show its label.
|
||||
*
|
||||
* The prop defaults to the value (`false`) inherited from the parent BottomNavigation component.
|
||||
*/
|
||||
showLabel: 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]),
|
||||
/**
|
||||
* You can provide your own value. Otherwise, we fallback to the child position index.
|
||||
*/
|
||||
value: PropTypes.any
|
||||
} : void 0;
|
||||
export default BottomNavigationAction;
|
||||
7
node_modules/@mui/material/modern/BottomNavigationAction/bottomNavigationActionClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/BottomNavigationAction/bottomNavigationActionClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getBottomNavigationActionUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiBottomNavigationAction', slot);
|
||||
}
|
||||
const bottomNavigationActionClasses = generateUtilityClasses('MuiBottomNavigationAction', ['root', 'iconOnly', 'selected', 'label']);
|
||||
export default bottomNavigationActionClasses;
|
||||
3
node_modules/@mui/material/modern/BottomNavigationAction/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/BottomNavigationAction/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default } from "./BottomNavigationAction.js";
|
||||
export { default as bottomNavigationActionClasses } from "./bottomNavigationActionClasses.js";
|
||||
export * from "./bottomNavigationActionClasses.js";
|
||||
35
node_modules/@mui/material/modern/Box/Box.js
generated
vendored
Normal file
35
node_modules/@mui/material/modern/Box/Box.js
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
'use client';
|
||||
|
||||
import { createBox } from '@mui/system';
|
||||
import PropTypes from 'prop-types';
|
||||
import { unstable_ClassNameGenerator as ClassNameGenerator } from "../className/index.js";
|
||||
import { createTheme } from "../styles/index.js";
|
||||
import THEME_ID from "../styles/identifier.js";
|
||||
import boxClasses from "./boxClasses.js";
|
||||
const defaultTheme = createTheme();
|
||||
const Box = createBox({
|
||||
themeId: THEME_ID,
|
||||
defaultTheme,
|
||||
defaultClassName: boxClasses.root,
|
||||
generateClassName: ClassNameGenerator.generate
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? Box.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`. │
|
||||
// └─────────────────────────────────────────────────────────────────────┘
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
children: PropTypes.node,
|
||||
/**
|
||||
* The component used for the root node.
|
||||
* Either a string to use a HTML element or a component.
|
||||
*/
|
||||
component: PropTypes.elementType,
|
||||
/**
|
||||
* 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 Box;
|
||||
3
node_modules/@mui/material/modern/Box/boxClasses.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/Box/boxClasses.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
const boxClasses = generateUtilityClasses('MuiBox', ['root']);
|
||||
export default boxClasses;
|
||||
3
node_modules/@mui/material/modern/Box/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/Box/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default } from "./Box.js";
|
||||
export { default as boxClasses } from "./boxClasses.js";
|
||||
export * from "./boxClasses.js";
|
||||
90
node_modules/@mui/material/modern/Breadcrumbs/BreadcrumbCollapsed.js
generated
vendored
Normal file
90
node_modules/@mui/material/modern/Breadcrumbs/BreadcrumbCollapsed.js
generated
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { emphasize } from '@mui/system/colorManipulator';
|
||||
import { styled } from "../zero-styled/index.js";
|
||||
import memoTheme from "../utils/memoTheme.js";
|
||||
import MoreHorizIcon from "../internal/svg-icons/MoreHoriz.js";
|
||||
import ButtonBase from "../ButtonBase/index.js";
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
const BreadcrumbCollapsedButton = styled(ButtonBase)(memoTheme(({
|
||||
theme
|
||||
}) => ({
|
||||
display: 'flex',
|
||||
marginLeft: `calc(${theme.spacing(1)} * 0.5)`,
|
||||
marginRight: `calc(${theme.spacing(1)} * 0.5)`,
|
||||
...(theme.palette.mode === 'light' ? {
|
||||
backgroundColor: theme.palette.grey[100],
|
||||
color: theme.palette.grey[700]
|
||||
} : {
|
||||
backgroundColor: theme.palette.grey[700],
|
||||
color: theme.palette.grey[100]
|
||||
}),
|
||||
borderRadius: 2,
|
||||
'&:hover, &:focus': {
|
||||
...(theme.palette.mode === 'light' ? {
|
||||
backgroundColor: theme.palette.grey[200]
|
||||
} : {
|
||||
backgroundColor: theme.palette.grey[600]
|
||||
})
|
||||
},
|
||||
'&:active': {
|
||||
boxShadow: theme.shadows[0],
|
||||
...(theme.palette.mode === 'light' ? {
|
||||
backgroundColor: emphasize(theme.palette.grey[200], 0.12)
|
||||
} : {
|
||||
backgroundColor: emphasize(theme.palette.grey[600], 0.12)
|
||||
})
|
||||
}
|
||||
})));
|
||||
const BreadcrumbCollapsedIcon = styled(MoreHorizIcon)({
|
||||
width: 24,
|
||||
height: 16
|
||||
});
|
||||
|
||||
/**
|
||||
* @ignore - internal component.
|
||||
*/
|
||||
function BreadcrumbCollapsed(props) {
|
||||
const {
|
||||
slots = {},
|
||||
slotProps = {},
|
||||
...otherProps
|
||||
} = props;
|
||||
const ownerState = props;
|
||||
return /*#__PURE__*/_jsx("li", {
|
||||
children: /*#__PURE__*/_jsx(BreadcrumbCollapsedButton, {
|
||||
focusRipple: true,
|
||||
...otherProps,
|
||||
ownerState: ownerState,
|
||||
children: /*#__PURE__*/_jsx(BreadcrumbCollapsedIcon, {
|
||||
as: slots.CollapsedIcon,
|
||||
ownerState: ownerState,
|
||||
...slotProps.collapsedIcon
|
||||
})
|
||||
})
|
||||
});
|
||||
}
|
||||
process.env.NODE_ENV !== "production" ? BreadcrumbCollapsed.propTypes = {
|
||||
/**
|
||||
* The props used for the CollapsedIcon slot.
|
||||
* @default {}
|
||||
*/
|
||||
slotProps: PropTypes.shape({
|
||||
collapsedIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
||||
}),
|
||||
/**
|
||||
* The components used for each slot inside the BreadcumbCollapsed.
|
||||
* Either a string to use a HTML element or a component.
|
||||
* @default {}
|
||||
*/
|
||||
slots: PropTypes.shape({
|
||||
CollapsedIcon: PropTypes.elementType
|
||||
}),
|
||||
/**
|
||||
* The system prop that allows defining system overrides as well as additional CSS styles.
|
||||
*/
|
||||
sx: PropTypes.object
|
||||
} : void 0;
|
||||
export default BreadcrumbCollapsed;
|
||||
240
node_modules/@mui/material/modern/Breadcrumbs/Breadcrumbs.js
generated
vendored
Normal file
240
node_modules/@mui/material/modern/Breadcrumbs/Breadcrumbs.js
generated
vendored
Normal file
@@ -0,0 +1,240 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import { isFragment } from 'react-is';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import integerPropType from '@mui/utils/integerPropType';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import useSlotProps from '@mui/utils/useSlotProps';
|
||||
import { styled } from "../zero-styled/index.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import Typography from "../Typography/index.js";
|
||||
import BreadcrumbCollapsed from "./BreadcrumbCollapsed.js";
|
||||
import breadcrumbsClasses, { getBreadcrumbsUtilityClass } from "./breadcrumbsClasses.js";
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
classes
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root'],
|
||||
li: ['li'],
|
||||
ol: ['ol'],
|
||||
separator: ['separator']
|
||||
};
|
||||
return composeClasses(slots, getBreadcrumbsUtilityClass, classes);
|
||||
};
|
||||
const BreadcrumbsRoot = styled(Typography, {
|
||||
name: 'MuiBreadcrumbs',
|
||||
slot: 'Root',
|
||||
overridesResolver: (props, styles) => {
|
||||
return [{
|
||||
[`& .${breadcrumbsClasses.li}`]: styles.li
|
||||
}, styles.root];
|
||||
}
|
||||
})({});
|
||||
const BreadcrumbsOl = styled('ol', {
|
||||
name: 'MuiBreadcrumbs',
|
||||
slot: 'Ol',
|
||||
overridesResolver: (props, styles) => styles.ol
|
||||
})({
|
||||
display: 'flex',
|
||||
flexWrap: 'wrap',
|
||||
alignItems: 'center',
|
||||
padding: 0,
|
||||
margin: 0,
|
||||
listStyle: 'none'
|
||||
});
|
||||
const BreadcrumbsSeparator = styled('li', {
|
||||
name: 'MuiBreadcrumbs',
|
||||
slot: 'Separator',
|
||||
overridesResolver: (props, styles) => styles.separator
|
||||
})({
|
||||
display: 'flex',
|
||||
userSelect: 'none',
|
||||
marginLeft: 8,
|
||||
marginRight: 8
|
||||
});
|
||||
function insertSeparators(items, className, separator, ownerState) {
|
||||
return items.reduce((acc, current, index) => {
|
||||
if (index < items.length - 1) {
|
||||
acc = acc.concat(current, /*#__PURE__*/_jsx(BreadcrumbsSeparator, {
|
||||
"aria-hidden": true,
|
||||
className: className,
|
||||
ownerState: ownerState,
|
||||
children: separator
|
||||
}, `separator-${index}`));
|
||||
} else {
|
||||
acc.push(current);
|
||||
}
|
||||
return acc;
|
||||
}, []);
|
||||
}
|
||||
const Breadcrumbs = /*#__PURE__*/React.forwardRef(function Breadcrumbs(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiBreadcrumbs'
|
||||
});
|
||||
const {
|
||||
children,
|
||||
className,
|
||||
component = 'nav',
|
||||
slots = {},
|
||||
slotProps = {},
|
||||
expandText = 'Show path',
|
||||
itemsAfterCollapse = 1,
|
||||
itemsBeforeCollapse = 1,
|
||||
maxItems = 8,
|
||||
separator = '/',
|
||||
...other
|
||||
} = props;
|
||||
const [expanded, setExpanded] = React.useState(false);
|
||||
const ownerState = {
|
||||
...props,
|
||||
component,
|
||||
expanded,
|
||||
expandText,
|
||||
itemsAfterCollapse,
|
||||
itemsBeforeCollapse,
|
||||
maxItems,
|
||||
separator
|
||||
};
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
const collapsedIconSlotProps = useSlotProps({
|
||||
elementType: slots.CollapsedIcon,
|
||||
externalSlotProps: slotProps.collapsedIcon,
|
||||
ownerState
|
||||
});
|
||||
const listRef = React.useRef(null);
|
||||
const renderItemsBeforeAndAfter = allItems => {
|
||||
const handleClickExpand = () => {
|
||||
setExpanded(true);
|
||||
|
||||
// The clicked element received the focus but gets removed from the DOM.
|
||||
// Let's keep the focus in the component after expanding.
|
||||
// Moving it to the <ol> or <nav> does not cause any announcement in NVDA.
|
||||
// By moving it to some link/button at least we have some announcement.
|
||||
const focusable = listRef.current.querySelector('a[href],button,[tabindex]');
|
||||
if (focusable) {
|
||||
focusable.focus();
|
||||
}
|
||||
};
|
||||
|
||||
// This defends against someone passing weird input, to ensure that if all
|
||||
// items would be shown anyway, we just show all items without the EllipsisItem
|
||||
if (itemsBeforeCollapse + itemsAfterCollapse >= allItems.length) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
console.error(['MUI: You have provided an invalid combination of props to the Breadcrumbs.', `itemsAfterCollapse={${itemsAfterCollapse}} + itemsBeforeCollapse={${itemsBeforeCollapse}} >= maxItems={${maxItems}}`].join('\n'));
|
||||
}
|
||||
return allItems;
|
||||
}
|
||||
return [...allItems.slice(0, itemsBeforeCollapse), /*#__PURE__*/_jsx(BreadcrumbCollapsed, {
|
||||
"aria-label": expandText,
|
||||
slots: {
|
||||
CollapsedIcon: slots.CollapsedIcon
|
||||
},
|
||||
slotProps: {
|
||||
collapsedIcon: collapsedIconSlotProps
|
||||
},
|
||||
onClick: handleClickExpand
|
||||
}, "ellipsis"), ...allItems.slice(allItems.length - itemsAfterCollapse, allItems.length)];
|
||||
};
|
||||
const allItems = React.Children.toArray(children).filter(child => {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (isFragment(child)) {
|
||||
console.error(["MUI: The Breadcrumbs component doesn't accept a Fragment as a child.", 'Consider providing an array instead.'].join('\n'));
|
||||
}
|
||||
}
|
||||
return /*#__PURE__*/React.isValidElement(child);
|
||||
}).map((child, index) => /*#__PURE__*/_jsx("li", {
|
||||
className: classes.li,
|
||||
children: child
|
||||
}, `child-${index}`));
|
||||
return /*#__PURE__*/_jsx(BreadcrumbsRoot, {
|
||||
ref: ref,
|
||||
component: component,
|
||||
color: "textSecondary",
|
||||
className: clsx(classes.root, className),
|
||||
ownerState: ownerState,
|
||||
...other,
|
||||
children: /*#__PURE__*/_jsx(BreadcrumbsOl, {
|
||||
className: classes.ol,
|
||||
ref: listRef,
|
||||
ownerState: ownerState,
|
||||
children: insertSeparators(expanded || maxItems && allItems.length <= maxItems ? allItems : renderItemsBeforeAndAfter(allItems), classes.separator, separator, ownerState)
|
||||
})
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? Breadcrumbs.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 component used for the root node.
|
||||
* Either a string to use a HTML element or a component.
|
||||
*/
|
||||
component: PropTypes.elementType,
|
||||
/**
|
||||
* Override the default label for the expand button.
|
||||
*
|
||||
* For localization purposes, you can use the provided [translations](https://mui.com/material-ui/guides/localization/).
|
||||
* @default 'Show path'
|
||||
*/
|
||||
expandText: PropTypes.string,
|
||||
/**
|
||||
* If max items is exceeded, the number of items to show after the ellipsis.
|
||||
* @default 1
|
||||
*/
|
||||
itemsAfterCollapse: integerPropType,
|
||||
/**
|
||||
* If max items is exceeded, the number of items to show before the ellipsis.
|
||||
* @default 1
|
||||
*/
|
||||
itemsBeforeCollapse: integerPropType,
|
||||
/**
|
||||
* Specifies the maximum number of breadcrumbs to display. When there are more
|
||||
* than the maximum number, only the first `itemsBeforeCollapse` and last `itemsAfterCollapse`
|
||||
* will be shown, with an ellipsis in between.
|
||||
* @default 8
|
||||
*/
|
||||
maxItems: integerPropType,
|
||||
/**
|
||||
* Custom separator node.
|
||||
* @default '/'
|
||||
*/
|
||||
separator: PropTypes.node,
|
||||
/**
|
||||
* The props used for each slot inside the Breadcumb.
|
||||
* @default {}
|
||||
*/
|
||||
slotProps: PropTypes.shape({
|
||||
collapsedIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
||||
}),
|
||||
/**
|
||||
* The components used for each slot inside the Breadcumb.
|
||||
* Either a string to use a HTML element or a component.
|
||||
* @default {}
|
||||
*/
|
||||
slots: PropTypes.shape({
|
||||
CollapsedIcon: PropTypes.elementType
|
||||
}),
|
||||
/**
|
||||
* 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 Breadcrumbs;
|
||||
7
node_modules/@mui/material/modern/Breadcrumbs/breadcrumbsClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/Breadcrumbs/breadcrumbsClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getBreadcrumbsUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiBreadcrumbs', slot);
|
||||
}
|
||||
const breadcrumbsClasses = generateUtilityClasses('MuiBreadcrumbs', ['root', 'ol', 'li', 'separator']);
|
||||
export default breadcrumbsClasses;
|
||||
3
node_modules/@mui/material/modern/Breadcrumbs/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/Breadcrumbs/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default } from "./Breadcrumbs.js";
|
||||
export { default as breadcrumbsClasses } from "./breadcrumbsClasses.js";
|
||||
export * from "./breadcrumbsClasses.js";
|
||||
471
node_modules/@mui/material/modern/Button/Button.js
generated
vendored
Normal file
471
node_modules/@mui/material/modern/Button/Button.js
generated
vendored
Normal file
@@ -0,0 +1,471 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import resolveProps from '@mui/utils/resolveProps';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import { alpha } from '@mui/system/colorManipulator';
|
||||
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 ButtonBase from "../ButtonBase/index.js";
|
||||
import capitalize from "../utils/capitalize.js";
|
||||
import createSimplePaletteValueFilter from "../utils/createSimplePaletteValueFilter.js";
|
||||
import buttonClasses, { getButtonUtilityClass } from "./buttonClasses.js";
|
||||
import ButtonGroupContext from "../ButtonGroup/ButtonGroupContext.js";
|
||||
import ButtonGroupButtonContext from "../ButtonGroup/ButtonGroupButtonContext.js";
|
||||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
color,
|
||||
disableElevation,
|
||||
fullWidth,
|
||||
size,
|
||||
variant,
|
||||
classes
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root', variant, `${variant}${capitalize(color)}`, `size${capitalize(size)}`, `${variant}Size${capitalize(size)}`, `color${capitalize(color)}`, disableElevation && 'disableElevation', fullWidth && 'fullWidth'],
|
||||
label: ['label'],
|
||||
startIcon: ['icon', 'startIcon', `iconSize${capitalize(size)}`],
|
||||
endIcon: ['icon', 'endIcon', `iconSize${capitalize(size)}`]
|
||||
};
|
||||
const composedClasses = composeClasses(slots, getButtonUtilityClass, classes);
|
||||
return {
|
||||
...classes,
|
||||
// forward the focused, disabled, etc. classes to the ButtonBase
|
||||
...composedClasses
|
||||
};
|
||||
};
|
||||
const commonIconStyles = [{
|
||||
props: {
|
||||
size: 'small'
|
||||
},
|
||||
style: {
|
||||
'& > *:nth-of-type(1)': {
|
||||
fontSize: 18
|
||||
}
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
size: 'medium'
|
||||
},
|
||||
style: {
|
||||
'& > *:nth-of-type(1)': {
|
||||
fontSize: 20
|
||||
}
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
size: 'large'
|
||||
},
|
||||
style: {
|
||||
'& > *:nth-of-type(1)': {
|
||||
fontSize: 22
|
||||
}
|
||||
}
|
||||
}];
|
||||
const ButtonRoot = styled(ButtonBase, {
|
||||
shouldForwardProp: prop => rootShouldForwardProp(prop) || prop === 'classes',
|
||||
name: 'MuiButton',
|
||||
slot: 'Root',
|
||||
overridesResolver: (props, styles) => {
|
||||
const {
|
||||
ownerState
|
||||
} = props;
|
||||
return [styles.root, styles[ownerState.variant], styles[`${ownerState.variant}${capitalize(ownerState.color)}`], styles[`size${capitalize(ownerState.size)}`], styles[`${ownerState.variant}Size${capitalize(ownerState.size)}`], ownerState.color === 'inherit' && styles.colorInherit, ownerState.disableElevation && styles.disableElevation, ownerState.fullWidth && styles.fullWidth];
|
||||
}
|
||||
})(memoTheme(({
|
||||
theme
|
||||
}) => {
|
||||
const inheritContainedBackgroundColor = theme.palette.mode === 'light' ? theme.palette.grey[300] : theme.palette.grey[800];
|
||||
const inheritContainedHoverBackgroundColor = theme.palette.mode === 'light' ? theme.palette.grey.A100 : theme.palette.grey[700];
|
||||
return {
|
||||
...theme.typography.button,
|
||||
minWidth: 64,
|
||||
padding: '6px 16px',
|
||||
border: 0,
|
||||
borderRadius: (theme.vars || theme).shape.borderRadius,
|
||||
transition: theme.transitions.create(['background-color', 'box-shadow', 'border-color', 'color'], {
|
||||
duration: theme.transitions.duration.short
|
||||
}),
|
||||
'&:hover': {
|
||||
textDecoration: 'none'
|
||||
},
|
||||
[`&.${buttonClasses.disabled}`]: {
|
||||
color: (theme.vars || theme).palette.action.disabled
|
||||
},
|
||||
variants: [{
|
||||
props: {
|
||||
variant: 'contained'
|
||||
},
|
||||
style: {
|
||||
color: `var(--variant-containedColor)`,
|
||||
backgroundColor: `var(--variant-containedBg)`,
|
||||
boxShadow: (theme.vars || theme).shadows[2],
|
||||
'&:hover': {
|
||||
boxShadow: (theme.vars || theme).shadows[4],
|
||||
// Reset on touch devices, it doesn't add specificity
|
||||
'@media (hover: none)': {
|
||||
boxShadow: (theme.vars || theme).shadows[2]
|
||||
}
|
||||
},
|
||||
'&:active': {
|
||||
boxShadow: (theme.vars || theme).shadows[8]
|
||||
},
|
||||
[`&.${buttonClasses.focusVisible}`]: {
|
||||
boxShadow: (theme.vars || theme).shadows[6]
|
||||
},
|
||||
[`&.${buttonClasses.disabled}`]: {
|
||||
color: (theme.vars || theme).palette.action.disabled,
|
||||
boxShadow: (theme.vars || theme).shadows[0],
|
||||
backgroundColor: (theme.vars || theme).palette.action.disabledBackground
|
||||
}
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
variant: 'outlined'
|
||||
},
|
||||
style: {
|
||||
padding: '5px 15px',
|
||||
border: '1px solid currentColor',
|
||||
borderColor: `var(--variant-outlinedBorder, currentColor)`,
|
||||
backgroundColor: `var(--variant-outlinedBg)`,
|
||||
color: `var(--variant-outlinedColor)`,
|
||||
[`&.${buttonClasses.disabled}`]: {
|
||||
border: `1px solid ${(theme.vars || theme).palette.action.disabledBackground}`
|
||||
}
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
variant: 'text'
|
||||
},
|
||||
style: {
|
||||
padding: '6px 8px',
|
||||
color: `var(--variant-textColor)`,
|
||||
backgroundColor: `var(--variant-textBg)`
|
||||
}
|
||||
}, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter(['dark', 'contrastText'])).map(([color]) => ({
|
||||
props: {
|
||||
color
|
||||
},
|
||||
style: {
|
||||
'--variant-textColor': (theme.vars || theme).palette[color].main,
|
||||
'--variant-outlinedColor': (theme.vars || theme).palette[color].main,
|
||||
'--variant-outlinedBorder': theme.vars ? `rgba(${theme.vars.palette[color].mainChannel} / 0.5)` : alpha(theme.palette[color].main, 0.5),
|
||||
'--variant-containedColor': (theme.vars || theme).palette[color].contrastText,
|
||||
'--variant-containedBg': (theme.vars || theme).palette[color].main,
|
||||
'@media (hover: hover)': {
|
||||
'&:hover': {
|
||||
'--variant-containedBg': (theme.vars || theme).palette[color].dark,
|
||||
'--variant-textBg': theme.vars ? `rgba(${theme.vars.palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette[color].main, theme.palette.action.hoverOpacity),
|
||||
'--variant-outlinedBorder': (theme.vars || theme).palette[color].main,
|
||||
'--variant-outlinedBg': theme.vars ? `rgba(${theme.vars.palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette[color].main, theme.palette.action.hoverOpacity)
|
||||
}
|
||||
}
|
||||
}
|
||||
})), {
|
||||
props: {
|
||||
color: 'inherit'
|
||||
},
|
||||
style: {
|
||||
'--variant-containedColor': theme.vars ?
|
||||
// this is safe because grey does not change between default light/dark mode
|
||||
theme.vars.palette.text.primary : theme.palette.getContrastText?.(inheritContainedBackgroundColor),
|
||||
'--variant-containedBg': theme.vars ? theme.vars.palette.Button.inheritContainedBg : inheritContainedBackgroundColor,
|
||||
'@media (hover: hover)': {
|
||||
'&:hover': {
|
||||
'--variant-containedBg': theme.vars ? theme.vars.palette.Button.inheritContainedHoverBg : inheritContainedHoverBackgroundColor,
|
||||
'--variant-textBg': theme.vars ? `rgba(${theme.vars.palette.text.primaryChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette.text.primary, theme.palette.action.hoverOpacity),
|
||||
'--variant-outlinedBg': theme.vars ? `rgba(${theme.vars.palette.text.primaryChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette.text.primary, theme.palette.action.hoverOpacity)
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
size: 'small',
|
||||
variant: 'text'
|
||||
},
|
||||
style: {
|
||||
padding: '4px 5px',
|
||||
fontSize: theme.typography.pxToRem(13)
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
size: 'large',
|
||||
variant: 'text'
|
||||
},
|
||||
style: {
|
||||
padding: '8px 11px',
|
||||
fontSize: theme.typography.pxToRem(15)
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
size: 'small',
|
||||
variant: 'outlined'
|
||||
},
|
||||
style: {
|
||||
padding: '3px 9px',
|
||||
fontSize: theme.typography.pxToRem(13)
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
size: 'large',
|
||||
variant: 'outlined'
|
||||
},
|
||||
style: {
|
||||
padding: '7px 21px',
|
||||
fontSize: theme.typography.pxToRem(15)
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
size: 'small',
|
||||
variant: 'contained'
|
||||
},
|
||||
style: {
|
||||
padding: '4px 10px',
|
||||
fontSize: theme.typography.pxToRem(13)
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
size: 'large',
|
||||
variant: 'contained'
|
||||
},
|
||||
style: {
|
||||
padding: '8px 22px',
|
||||
fontSize: theme.typography.pxToRem(15)
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
disableElevation: true
|
||||
},
|
||||
style: {
|
||||
boxShadow: 'none',
|
||||
'&:hover': {
|
||||
boxShadow: 'none'
|
||||
},
|
||||
[`&.${buttonClasses.focusVisible}`]: {
|
||||
boxShadow: 'none'
|
||||
},
|
||||
'&:active': {
|
||||
boxShadow: 'none'
|
||||
},
|
||||
[`&.${buttonClasses.disabled}`]: {
|
||||
boxShadow: 'none'
|
||||
}
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
fullWidth: true
|
||||
},
|
||||
style: {
|
||||
width: '100%'
|
||||
}
|
||||
}]
|
||||
};
|
||||
}));
|
||||
const ButtonStartIcon = styled('span', {
|
||||
name: 'MuiButton',
|
||||
slot: 'StartIcon',
|
||||
overridesResolver: (props, styles) => {
|
||||
const {
|
||||
ownerState
|
||||
} = props;
|
||||
return [styles.startIcon, styles[`iconSize${capitalize(ownerState.size)}`]];
|
||||
}
|
||||
})({
|
||||
display: 'inherit',
|
||||
marginRight: 8,
|
||||
marginLeft: -4,
|
||||
variants: [{
|
||||
props: {
|
||||
size: 'small'
|
||||
},
|
||||
style: {
|
||||
marginLeft: -2
|
||||
}
|
||||
}, ...commonIconStyles]
|
||||
});
|
||||
const ButtonEndIcon = styled('span', {
|
||||
name: 'MuiButton',
|
||||
slot: 'EndIcon',
|
||||
overridesResolver: (props, styles) => {
|
||||
const {
|
||||
ownerState
|
||||
} = props;
|
||||
return [styles.endIcon, styles[`iconSize${capitalize(ownerState.size)}`]];
|
||||
}
|
||||
})({
|
||||
display: 'inherit',
|
||||
marginRight: -4,
|
||||
marginLeft: 8,
|
||||
variants: [{
|
||||
props: {
|
||||
size: 'small'
|
||||
},
|
||||
style: {
|
||||
marginRight: -2
|
||||
}
|
||||
}, ...commonIconStyles]
|
||||
});
|
||||
const Button = /*#__PURE__*/React.forwardRef(function Button(inProps, ref) {
|
||||
// props priority: `inProps` > `contextProps` > `themeDefaultProps`
|
||||
const contextProps = React.useContext(ButtonGroupContext);
|
||||
const buttonGroupButtonContextPositionClassName = React.useContext(ButtonGroupButtonContext);
|
||||
const resolvedProps = resolveProps(contextProps, inProps);
|
||||
const props = useDefaultProps({
|
||||
props: resolvedProps,
|
||||
name: 'MuiButton'
|
||||
});
|
||||
const {
|
||||
children,
|
||||
color = 'primary',
|
||||
component = 'button',
|
||||
className,
|
||||
disabled = false,
|
||||
disableElevation = false,
|
||||
disableFocusRipple = false,
|
||||
endIcon: endIconProp,
|
||||
focusVisibleClassName,
|
||||
fullWidth = false,
|
||||
size = 'medium',
|
||||
startIcon: startIconProp,
|
||||
type,
|
||||
variant = 'text',
|
||||
...other
|
||||
} = props;
|
||||
const ownerState = {
|
||||
...props,
|
||||
color,
|
||||
component,
|
||||
disabled,
|
||||
disableElevation,
|
||||
disableFocusRipple,
|
||||
fullWidth,
|
||||
size,
|
||||
type,
|
||||
variant
|
||||
};
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
const startIcon = startIconProp && /*#__PURE__*/_jsx(ButtonStartIcon, {
|
||||
className: classes.startIcon,
|
||||
ownerState: ownerState,
|
||||
children: startIconProp
|
||||
});
|
||||
const endIcon = endIconProp && /*#__PURE__*/_jsx(ButtonEndIcon, {
|
||||
className: classes.endIcon,
|
||||
ownerState: ownerState,
|
||||
children: endIconProp
|
||||
});
|
||||
const positionClassName = buttonGroupButtonContextPositionClassName || '';
|
||||
return /*#__PURE__*/_jsxs(ButtonRoot, {
|
||||
ownerState: ownerState,
|
||||
className: clsx(contextProps.className, classes.root, className, positionClassName),
|
||||
component: component,
|
||||
disabled: disabled,
|
||||
focusRipple: !disableFocusRipple,
|
||||
focusVisibleClassName: clsx(classes.focusVisible, focusVisibleClassName),
|
||||
ref: ref,
|
||||
type: type,
|
||||
...other,
|
||||
classes: classes,
|
||||
children: [startIcon, children, endIcon]
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? Button.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 color of the component.
|
||||
* It supports both default and custom theme colors, which can be added as shown in the
|
||||
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
||||
* @default 'primary'
|
||||
*/
|
||||
color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['inherit', 'primary', 'secondary', 'success', 'error', 'info', 'warning']), 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`, the component is disabled.
|
||||
* @default false
|
||||
*/
|
||||
disabled: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, no elevation is used.
|
||||
* @default false
|
||||
*/
|
||||
disableElevation: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, the keyboard focus ripple is disabled.
|
||||
* @default false
|
||||
*/
|
||||
disableFocusRipple: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, the ripple effect is disabled.
|
||||
*
|
||||
* ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
|
||||
* to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
|
||||
* @default false
|
||||
*/
|
||||
disableRipple: PropTypes.bool,
|
||||
/**
|
||||
* Element placed after the children.
|
||||
*/
|
||||
endIcon: PropTypes.node,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
focusVisibleClassName: PropTypes.string,
|
||||
/**
|
||||
* If `true`, the button will take up the full width of its container.
|
||||
* @default false
|
||||
*/
|
||||
fullWidth: PropTypes.bool,
|
||||
/**
|
||||
* The URL to link to when the button is clicked.
|
||||
* If defined, an `a` element will be used as the root node.
|
||||
*/
|
||||
href: PropTypes.string,
|
||||
/**
|
||||
* The size of the component.
|
||||
* `small` is equivalent to the dense button styling.
|
||||
* @default 'medium'
|
||||
*/
|
||||
size: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['small', 'medium', 'large']), PropTypes.string]),
|
||||
/**
|
||||
* Element placed before the children.
|
||||
*/
|
||||
startIcon: PropTypes.node,
|
||||
/**
|
||||
* 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]),
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
type: PropTypes.oneOfType([PropTypes.oneOf(['button', 'reset', 'submit']), PropTypes.string]),
|
||||
/**
|
||||
* The variant to use.
|
||||
* @default 'text'
|
||||
*/
|
||||
variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['contained', 'outlined', 'text']), PropTypes.string])
|
||||
} : void 0;
|
||||
export default Button;
|
||||
7
node_modules/@mui/material/modern/Button/buttonClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/Button/buttonClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getButtonUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiButton', slot);
|
||||
}
|
||||
const buttonClasses = generateUtilityClasses('MuiButton', ['root', 'text', 'textInherit', 'textPrimary', 'textSecondary', 'textSuccess', 'textError', 'textInfo', 'textWarning', 'outlined', 'outlinedInherit', 'outlinedPrimary', 'outlinedSecondary', 'outlinedSuccess', 'outlinedError', 'outlinedInfo', 'outlinedWarning', 'contained', 'containedInherit', 'containedPrimary', 'containedSecondary', 'containedSuccess', 'containedError', 'containedInfo', 'containedWarning', 'disableElevation', 'focusVisible', 'disabled', 'colorInherit', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorError', 'colorInfo', 'colorWarning', 'textSizeSmall', 'textSizeMedium', 'textSizeLarge', 'outlinedSizeSmall', 'outlinedSizeMedium', 'outlinedSizeLarge', 'containedSizeSmall', 'containedSizeMedium', 'containedSizeLarge', 'sizeMedium', 'sizeSmall', 'sizeLarge', 'fullWidth', 'startIcon', 'endIcon', 'icon', 'iconSizeSmall', 'iconSizeMedium', 'iconSizeLarge']);
|
||||
export default buttonClasses;
|
||||
3
node_modules/@mui/material/modern/Button/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/Button/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default } from "./Button.js";
|
||||
export { default as buttonClasses } from "./buttonClasses.js";
|
||||
export * from "./buttonClasses.js";
|
||||
448
node_modules/@mui/material/modern/ButtonBase/ButtonBase.js
generated
vendored
Normal file
448
node_modules/@mui/material/modern/ButtonBase/ButtonBase.js
generated
vendored
Normal file
@@ -0,0 +1,448 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import refType from '@mui/utils/refType';
|
||||
import elementTypeAcceptingRef from '@mui/utils/elementTypeAcceptingRef';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import isFocusVisible from '@mui/utils/isFocusVisible';
|
||||
import { styled } from "../zero-styled/index.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import useForkRef from "../utils/useForkRef.js";
|
||||
import useEventCallback from "../utils/useEventCallback.js";
|
||||
import useLazyRipple from "../useLazyRipple/index.js";
|
||||
import TouchRipple from "./TouchRipple.js";
|
||||
import buttonBaseClasses, { getButtonBaseUtilityClass } from "./buttonBaseClasses.js";
|
||||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
disabled,
|
||||
focusVisible,
|
||||
focusVisibleClassName,
|
||||
classes
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root', disabled && 'disabled', focusVisible && 'focusVisible']
|
||||
};
|
||||
const composedClasses = composeClasses(slots, getButtonBaseUtilityClass, classes);
|
||||
if (focusVisible && focusVisibleClassName) {
|
||||
composedClasses.root += ` ${focusVisibleClassName}`;
|
||||
}
|
||||
return composedClasses;
|
||||
};
|
||||
export const ButtonBaseRoot = styled('button', {
|
||||
name: 'MuiButtonBase',
|
||||
slot: 'Root',
|
||||
overridesResolver: (props, styles) => styles.root
|
||||
})({
|
||||
display: 'inline-flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
position: 'relative',
|
||||
boxSizing: 'border-box',
|
||||
WebkitTapHighlightColor: 'transparent',
|
||||
backgroundColor: 'transparent',
|
||||
// Reset default value
|
||||
// We disable the focus ring for mouse, touch and keyboard users.
|
||||
outline: 0,
|
||||
border: 0,
|
||||
margin: 0,
|
||||
// Remove the margin in Safari
|
||||
borderRadius: 0,
|
||||
padding: 0,
|
||||
// Remove the padding in Firefox
|
||||
cursor: 'pointer',
|
||||
userSelect: 'none',
|
||||
verticalAlign: 'middle',
|
||||
MozAppearance: 'none',
|
||||
// Reset
|
||||
WebkitAppearance: 'none',
|
||||
// Reset
|
||||
textDecoration: 'none',
|
||||
// So we take precedent over the style of a native <a /> element.
|
||||
color: 'inherit',
|
||||
'&::-moz-focus-inner': {
|
||||
borderStyle: 'none' // Remove Firefox dotted outline.
|
||||
},
|
||||
[`&.${buttonBaseClasses.disabled}`]: {
|
||||
pointerEvents: 'none',
|
||||
// Disable link interactions
|
||||
cursor: 'default'
|
||||
},
|
||||
'@media print': {
|
||||
colorAdjust: 'exact'
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* `ButtonBase` contains as few styles as possible.
|
||||
* It aims to be a simple building block for creating a button.
|
||||
* It contains a load of style reset and some focus/ripple logic.
|
||||
*/
|
||||
const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiButtonBase'
|
||||
});
|
||||
const {
|
||||
action,
|
||||
centerRipple = false,
|
||||
children,
|
||||
className,
|
||||
component = 'button',
|
||||
disabled = false,
|
||||
disableRipple = false,
|
||||
disableTouchRipple = false,
|
||||
focusRipple = false,
|
||||
focusVisibleClassName,
|
||||
LinkComponent = 'a',
|
||||
onBlur,
|
||||
onClick,
|
||||
onContextMenu,
|
||||
onDragLeave,
|
||||
onFocus,
|
||||
onFocusVisible,
|
||||
onKeyDown,
|
||||
onKeyUp,
|
||||
onMouseDown,
|
||||
onMouseLeave,
|
||||
onMouseUp,
|
||||
onTouchEnd,
|
||||
onTouchMove,
|
||||
onTouchStart,
|
||||
tabIndex = 0,
|
||||
TouchRippleProps,
|
||||
touchRippleRef,
|
||||
type,
|
||||
...other
|
||||
} = props;
|
||||
const buttonRef = React.useRef(null);
|
||||
const ripple = useLazyRipple();
|
||||
const handleRippleRef = useForkRef(ripple.ref, touchRippleRef);
|
||||
const [focusVisible, setFocusVisible] = React.useState(false);
|
||||
if (disabled && focusVisible) {
|
||||
setFocusVisible(false);
|
||||
}
|
||||
React.useImperativeHandle(action, () => ({
|
||||
focusVisible: () => {
|
||||
setFocusVisible(true);
|
||||
buttonRef.current.focus();
|
||||
}
|
||||
}), []);
|
||||
const enableTouchRipple = ripple.shouldMount && !disableRipple && !disabled;
|
||||
React.useEffect(() => {
|
||||
if (focusVisible && focusRipple && !disableRipple) {
|
||||
ripple.pulsate();
|
||||
}
|
||||
}, [disableRipple, focusRipple, focusVisible, ripple]);
|
||||
function useRippleHandler(rippleAction, eventCallback, skipRippleAction = disableTouchRipple) {
|
||||
return useEventCallback(event => {
|
||||
if (eventCallback) {
|
||||
eventCallback(event);
|
||||
}
|
||||
const ignore = skipRippleAction;
|
||||
if (!ignore) {
|
||||
ripple[rippleAction](event);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
const handleMouseDown = useRippleHandler('start', onMouseDown);
|
||||
const handleContextMenu = useRippleHandler('stop', onContextMenu);
|
||||
const handleDragLeave = useRippleHandler('stop', onDragLeave);
|
||||
const handleMouseUp = useRippleHandler('stop', onMouseUp);
|
||||
const handleMouseLeave = useRippleHandler('stop', event => {
|
||||
if (focusVisible) {
|
||||
event.preventDefault();
|
||||
}
|
||||
if (onMouseLeave) {
|
||||
onMouseLeave(event);
|
||||
}
|
||||
});
|
||||
const handleTouchStart = useRippleHandler('start', onTouchStart);
|
||||
const handleTouchEnd = useRippleHandler('stop', onTouchEnd);
|
||||
const handleTouchMove = useRippleHandler('stop', onTouchMove);
|
||||
const handleBlur = useRippleHandler('stop', event => {
|
||||
if (!isFocusVisible(event.target)) {
|
||||
setFocusVisible(false);
|
||||
}
|
||||
if (onBlur) {
|
||||
onBlur(event);
|
||||
}
|
||||
}, false);
|
||||
const handleFocus = useEventCallback(event => {
|
||||
// Fix for https://github.com/facebook/react/issues/7769
|
||||
if (!buttonRef.current) {
|
||||
buttonRef.current = event.currentTarget;
|
||||
}
|
||||
if (isFocusVisible(event.target)) {
|
||||
setFocusVisible(true);
|
||||
if (onFocusVisible) {
|
||||
onFocusVisible(event);
|
||||
}
|
||||
}
|
||||
if (onFocus) {
|
||||
onFocus(event);
|
||||
}
|
||||
});
|
||||
const isNonNativeButton = () => {
|
||||
const button = buttonRef.current;
|
||||
return component && component !== 'button' && !(button.tagName === 'A' && button.href);
|
||||
};
|
||||
const handleKeyDown = useEventCallback(event => {
|
||||
// Check if key is already down to avoid repeats being counted as multiple activations
|
||||
if (focusRipple && !event.repeat && focusVisible && event.key === ' ') {
|
||||
ripple.stop(event, () => {
|
||||
ripple.start(event);
|
||||
});
|
||||
}
|
||||
if (event.target === event.currentTarget && isNonNativeButton() && event.key === ' ') {
|
||||
event.preventDefault();
|
||||
}
|
||||
if (onKeyDown) {
|
||||
onKeyDown(event);
|
||||
}
|
||||
|
||||
// Keyboard accessibility for non interactive elements
|
||||
if (event.target === event.currentTarget && isNonNativeButton() && event.key === 'Enter' && !disabled) {
|
||||
event.preventDefault();
|
||||
if (onClick) {
|
||||
onClick(event);
|
||||
}
|
||||
}
|
||||
});
|
||||
const handleKeyUp = useEventCallback(event => {
|
||||
// calling preventDefault in keyUp on a <button> will not dispatch a click event if Space is pressed
|
||||
// https://codesandbox.io/p/sandbox/button-keyup-preventdefault-dn7f0
|
||||
if (focusRipple && event.key === ' ' && focusVisible && !event.defaultPrevented) {
|
||||
ripple.stop(event, () => {
|
||||
ripple.pulsate(event);
|
||||
});
|
||||
}
|
||||
if (onKeyUp) {
|
||||
onKeyUp(event);
|
||||
}
|
||||
|
||||
// Keyboard accessibility for non interactive elements
|
||||
if (onClick && event.target === event.currentTarget && isNonNativeButton() && event.key === ' ' && !event.defaultPrevented) {
|
||||
onClick(event);
|
||||
}
|
||||
});
|
||||
let ComponentProp = component;
|
||||
if (ComponentProp === 'button' && (other.href || other.to)) {
|
||||
ComponentProp = LinkComponent;
|
||||
}
|
||||
const buttonProps = {};
|
||||
if (ComponentProp === 'button') {
|
||||
buttonProps.type = type === undefined ? 'button' : type;
|
||||
buttonProps.disabled = disabled;
|
||||
} else {
|
||||
if (!other.href && !other.to) {
|
||||
buttonProps.role = 'button';
|
||||
}
|
||||
if (disabled) {
|
||||
buttonProps['aria-disabled'] = disabled;
|
||||
}
|
||||
}
|
||||
const handleRef = useForkRef(ref, buttonRef);
|
||||
const ownerState = {
|
||||
...props,
|
||||
centerRipple,
|
||||
component,
|
||||
disabled,
|
||||
disableRipple,
|
||||
disableTouchRipple,
|
||||
focusRipple,
|
||||
tabIndex,
|
||||
focusVisible
|
||||
};
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
return /*#__PURE__*/_jsxs(ButtonBaseRoot, {
|
||||
as: ComponentProp,
|
||||
className: clsx(classes.root, className),
|
||||
ownerState: ownerState,
|
||||
onBlur: handleBlur,
|
||||
onClick: onClick,
|
||||
onContextMenu: handleContextMenu,
|
||||
onFocus: handleFocus,
|
||||
onKeyDown: handleKeyDown,
|
||||
onKeyUp: handleKeyUp,
|
||||
onMouseDown: handleMouseDown,
|
||||
onMouseLeave: handleMouseLeave,
|
||||
onMouseUp: handleMouseUp,
|
||||
onDragLeave: handleDragLeave,
|
||||
onTouchEnd: handleTouchEnd,
|
||||
onTouchMove: handleTouchMove,
|
||||
onTouchStart: handleTouchStart,
|
||||
ref: handleRef,
|
||||
tabIndex: disabled ? -1 : tabIndex,
|
||||
type: type,
|
||||
...buttonProps,
|
||||
...other,
|
||||
children: [children, enableTouchRipple ? /*#__PURE__*/_jsx(TouchRipple, {
|
||||
ref: handleRippleRef,
|
||||
center: centerRipple,
|
||||
...TouchRippleProps
|
||||
}) : null]
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? ButtonBase.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`. │
|
||||
// └─────────────────────────────────────────────────────────────────────┘
|
||||
/**
|
||||
* A ref for imperative actions.
|
||||
* It currently only supports `focusVisible()` action.
|
||||
*/
|
||||
action: refType,
|
||||
/**
|
||||
* If `true`, the ripples are centered.
|
||||
* They won't start at the cursor interaction position.
|
||||
* @default false
|
||||
*/
|
||||
centerRipple: 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: elementTypeAcceptingRef,
|
||||
/**
|
||||
* If `true`, the component is disabled.
|
||||
* @default false
|
||||
*/
|
||||
disabled: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, the ripple effect is disabled.
|
||||
*
|
||||
* ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
|
||||
* to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
|
||||
* @default false
|
||||
*/
|
||||
disableRipple: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, the touch ripple effect is disabled.
|
||||
* @default false
|
||||
*/
|
||||
disableTouchRipple: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, the base button will have a keyboard focus ripple.
|
||||
* @default false
|
||||
*/
|
||||
focusRipple: 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
|
||||
*/
|
||||
href: PropTypes /* @typescript-to-proptypes-ignore */.any,
|
||||
/**
|
||||
* The component used to render a link when the `href` prop is provided.
|
||||
* @default 'a'
|
||||
*/
|
||||
LinkComponent: PropTypes.elementType,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onBlur: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onClick: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onContextMenu: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onDragLeave: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onFocus: PropTypes.func,
|
||||
/**
|
||||
* Callback fired when the component is focused with a keyboard.
|
||||
* We trigger a `onFocus` callback too.
|
||||
*/
|
||||
onFocusVisible: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onKeyDown: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onKeyUp: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onMouseDown: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onMouseLeave: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onMouseUp: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onTouchEnd: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onTouchMove: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onTouchStart: PropTypes.func,
|
||||
/**
|
||||
* 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,
|
||||
/**
|
||||
* Props applied to the `TouchRipple` element.
|
||||
*/
|
||||
TouchRippleProps: PropTypes.object,
|
||||
/**
|
||||
* A ref that points to the `TouchRipple` element.
|
||||
*/
|
||||
touchRippleRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
||||
current: PropTypes.shape({
|
||||
pulsate: PropTypes.func.isRequired,
|
||||
start: PropTypes.func.isRequired,
|
||||
stop: PropTypes.func.isRequired
|
||||
})
|
||||
})]),
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
type: PropTypes.oneOfType([PropTypes.oneOf(['button', 'reset', 'submit']), PropTypes.string])
|
||||
} : void 0;
|
||||
export default ButtonBase;
|
||||
88
node_modules/@mui/material/modern/ButtonBase/Ripple.js
generated
vendored
Normal file
88
node_modules/@mui/material/modern/ButtonBase/Ripple.js
generated
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
|
||||
/**
|
||||
* @ignore - internal component.
|
||||
*/
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
function Ripple(props) {
|
||||
const {
|
||||
className,
|
||||
classes,
|
||||
pulsate = false,
|
||||
rippleX,
|
||||
rippleY,
|
||||
rippleSize,
|
||||
in: inProp,
|
||||
onExited,
|
||||
timeout
|
||||
} = props;
|
||||
const [leaving, setLeaving] = React.useState(false);
|
||||
const rippleClassName = clsx(className, classes.ripple, classes.rippleVisible, pulsate && classes.ripplePulsate);
|
||||
const rippleStyles = {
|
||||
width: rippleSize,
|
||||
height: rippleSize,
|
||||
top: -(rippleSize / 2) + rippleY,
|
||||
left: -(rippleSize / 2) + rippleX
|
||||
};
|
||||
const childClassName = clsx(classes.child, leaving && classes.childLeaving, pulsate && classes.childPulsate);
|
||||
if (!inProp && !leaving) {
|
||||
setLeaving(true);
|
||||
}
|
||||
React.useEffect(() => {
|
||||
if (!inProp && onExited != null) {
|
||||
// react-transition-group#onExited
|
||||
const timeoutId = setTimeout(onExited, timeout);
|
||||
return () => {
|
||||
clearTimeout(timeoutId);
|
||||
};
|
||||
}
|
||||
return undefined;
|
||||
}, [onExited, inProp, timeout]);
|
||||
return /*#__PURE__*/_jsx("span", {
|
||||
className: rippleClassName,
|
||||
style: rippleStyles,
|
||||
children: /*#__PURE__*/_jsx("span", {
|
||||
className: childClassName
|
||||
})
|
||||
});
|
||||
}
|
||||
process.env.NODE_ENV !== "production" ? Ripple.propTypes /* remove-proptypes */ = {
|
||||
/**
|
||||
* Override or extend the styles applied to the component.
|
||||
*/
|
||||
classes: PropTypes.object.isRequired,
|
||||
className: PropTypes.string,
|
||||
/**
|
||||
* @ignore - injected from TransitionGroup
|
||||
*/
|
||||
in: PropTypes.bool,
|
||||
/**
|
||||
* @ignore - injected from TransitionGroup
|
||||
*/
|
||||
onExited: PropTypes.func,
|
||||
/**
|
||||
* If `true`, the ripple pulsates, typically indicating the keyboard focus state of an element.
|
||||
*/
|
||||
pulsate: PropTypes.bool,
|
||||
/**
|
||||
* Diameter of the ripple.
|
||||
*/
|
||||
rippleSize: PropTypes.number,
|
||||
/**
|
||||
* Horizontal position of the ripple center.
|
||||
*/
|
||||
rippleX: PropTypes.number,
|
||||
/**
|
||||
* Vertical position of the ripple center.
|
||||
*/
|
||||
rippleY: PropTypes.number,
|
||||
/**
|
||||
* exit delay
|
||||
*/
|
||||
timeout: PropTypes.number.isRequired
|
||||
} : void 0;
|
||||
export default Ripple;
|
||||
324
node_modules/@mui/material/modern/ButtonBase/TouchRipple.js
generated
vendored
Normal file
324
node_modules/@mui/material/modern/ButtonBase/TouchRipple.js
generated
vendored
Normal file
@@ -0,0 +1,324 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { TransitionGroup } from 'react-transition-group';
|
||||
import clsx from 'clsx';
|
||||
import useTimeout from '@mui/utils/useTimeout';
|
||||
import { keyframes, styled } from "../zero-styled/index.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import Ripple from "./Ripple.js";
|
||||
import touchRippleClasses from "./touchRippleClasses.js";
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
const DURATION = 550;
|
||||
export const DELAY_RIPPLE = 80;
|
||||
const enterKeyframe = keyframes`
|
||||
0% {
|
||||
transform: scale(0);
|
||||
opacity: 0.1;
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: scale(1);
|
||||
opacity: 0.3;
|
||||
}
|
||||
`;
|
||||
const exitKeyframe = keyframes`
|
||||
0% {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
`;
|
||||
const pulsateKeyframe = keyframes`
|
||||
0% {
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
50% {
|
||||
transform: scale(0.92);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: scale(1);
|
||||
}
|
||||
`;
|
||||
export const TouchRippleRoot = styled('span', {
|
||||
name: 'MuiTouchRipple',
|
||||
slot: 'Root'
|
||||
})({
|
||||
overflow: 'hidden',
|
||||
pointerEvents: 'none',
|
||||
position: 'absolute',
|
||||
zIndex: 0,
|
||||
top: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
borderRadius: 'inherit'
|
||||
});
|
||||
|
||||
// This `styled()` function invokes keyframes. `styled-components` only supports keyframes
|
||||
// in string templates. Do not convert these styles in JS object as it will break.
|
||||
export const TouchRippleRipple = styled(Ripple, {
|
||||
name: 'MuiTouchRipple',
|
||||
slot: 'Ripple'
|
||||
})`
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
|
||||
&.${touchRippleClasses.rippleVisible} {
|
||||
opacity: 0.3;
|
||||
transform: scale(1);
|
||||
animation-name: ${enterKeyframe};
|
||||
animation-duration: ${DURATION}ms;
|
||||
animation-timing-function: ${({
|
||||
theme
|
||||
}) => theme.transitions.easing.easeInOut};
|
||||
}
|
||||
|
||||
&.${touchRippleClasses.ripplePulsate} {
|
||||
animation-duration: ${({
|
||||
theme
|
||||
}) => theme.transitions.duration.shorter}ms;
|
||||
}
|
||||
|
||||
& .${touchRippleClasses.child} {
|
||||
opacity: 1;
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
background-color: currentColor;
|
||||
}
|
||||
|
||||
& .${touchRippleClasses.childLeaving} {
|
||||
opacity: 0;
|
||||
animation-name: ${exitKeyframe};
|
||||
animation-duration: ${DURATION}ms;
|
||||
animation-timing-function: ${({
|
||||
theme
|
||||
}) => theme.transitions.easing.easeInOut};
|
||||
}
|
||||
|
||||
& .${touchRippleClasses.childPulsate} {
|
||||
position: absolute;
|
||||
/* @noflip */
|
||||
left: 0px;
|
||||
top: 0;
|
||||
animation-name: ${pulsateKeyframe};
|
||||
animation-duration: 2500ms;
|
||||
animation-timing-function: ${({
|
||||
theme
|
||||
}) => theme.transitions.easing.easeInOut};
|
||||
animation-iteration-count: infinite;
|
||||
animation-delay: 200ms;
|
||||
}
|
||||
`;
|
||||
|
||||
/**
|
||||
* @ignore - internal component.
|
||||
*
|
||||
* TODO v5: Make private
|
||||
*/
|
||||
const TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiTouchRipple'
|
||||
});
|
||||
const {
|
||||
center: centerProp = false,
|
||||
classes = {},
|
||||
className,
|
||||
...other
|
||||
} = props;
|
||||
const [ripples, setRipples] = React.useState([]);
|
||||
const nextKey = React.useRef(0);
|
||||
const rippleCallback = React.useRef(null);
|
||||
React.useEffect(() => {
|
||||
if (rippleCallback.current) {
|
||||
rippleCallback.current();
|
||||
rippleCallback.current = null;
|
||||
}
|
||||
}, [ripples]);
|
||||
|
||||
// Used to filter out mouse emulated events on mobile.
|
||||
const ignoringMouseDown = React.useRef(false);
|
||||
// We use a timer in order to only show the ripples for touch "click" like events.
|
||||
// We don't want to display the ripple for touch scroll events.
|
||||
const startTimer = useTimeout();
|
||||
|
||||
// This is the hook called once the previous timeout is ready.
|
||||
const startTimerCommit = React.useRef(null);
|
||||
const container = React.useRef(null);
|
||||
const startCommit = React.useCallback(params => {
|
||||
const {
|
||||
pulsate,
|
||||
rippleX,
|
||||
rippleY,
|
||||
rippleSize,
|
||||
cb
|
||||
} = params;
|
||||
setRipples(oldRipples => [...oldRipples, /*#__PURE__*/_jsx(TouchRippleRipple, {
|
||||
classes: {
|
||||
ripple: clsx(classes.ripple, touchRippleClasses.ripple),
|
||||
rippleVisible: clsx(classes.rippleVisible, touchRippleClasses.rippleVisible),
|
||||
ripplePulsate: clsx(classes.ripplePulsate, touchRippleClasses.ripplePulsate),
|
||||
child: clsx(classes.child, touchRippleClasses.child),
|
||||
childLeaving: clsx(classes.childLeaving, touchRippleClasses.childLeaving),
|
||||
childPulsate: clsx(classes.childPulsate, touchRippleClasses.childPulsate)
|
||||
},
|
||||
timeout: DURATION,
|
||||
pulsate: pulsate,
|
||||
rippleX: rippleX,
|
||||
rippleY: rippleY,
|
||||
rippleSize: rippleSize
|
||||
}, nextKey.current)]);
|
||||
nextKey.current += 1;
|
||||
rippleCallback.current = cb;
|
||||
}, [classes]);
|
||||
const start = React.useCallback((event = {}, options = {}, cb = () => {}) => {
|
||||
const {
|
||||
pulsate = false,
|
||||
center = centerProp || options.pulsate,
|
||||
fakeElement = false // For test purposes
|
||||
} = options;
|
||||
if (event?.type === 'mousedown' && ignoringMouseDown.current) {
|
||||
ignoringMouseDown.current = false;
|
||||
return;
|
||||
}
|
||||
if (event?.type === 'touchstart') {
|
||||
ignoringMouseDown.current = true;
|
||||
}
|
||||
const element = fakeElement ? null : container.current;
|
||||
const rect = element ? element.getBoundingClientRect() : {
|
||||
width: 0,
|
||||
height: 0,
|
||||
left: 0,
|
||||
top: 0
|
||||
};
|
||||
|
||||
// Get the size of the ripple
|
||||
let rippleX;
|
||||
let rippleY;
|
||||
let rippleSize;
|
||||
if (center || event === undefined || event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) {
|
||||
rippleX = Math.round(rect.width / 2);
|
||||
rippleY = Math.round(rect.height / 2);
|
||||
} else {
|
||||
const {
|
||||
clientX,
|
||||
clientY
|
||||
} = event.touches && event.touches.length > 0 ? event.touches[0] : event;
|
||||
rippleX = Math.round(clientX - rect.left);
|
||||
rippleY = Math.round(clientY - rect.top);
|
||||
}
|
||||
if (center) {
|
||||
rippleSize = Math.sqrt((2 * rect.width ** 2 + rect.height ** 2) / 3);
|
||||
|
||||
// For some reason the animation is broken on Mobile Chrome if the size is even.
|
||||
if (rippleSize % 2 === 0) {
|
||||
rippleSize += 1;
|
||||
}
|
||||
} else {
|
||||
const sizeX = Math.max(Math.abs((element ? element.clientWidth : 0) - rippleX), rippleX) * 2 + 2;
|
||||
const sizeY = Math.max(Math.abs((element ? element.clientHeight : 0) - rippleY), rippleY) * 2 + 2;
|
||||
rippleSize = Math.sqrt(sizeX ** 2 + sizeY ** 2);
|
||||
}
|
||||
|
||||
// Touche devices
|
||||
if (event?.touches) {
|
||||
// check that this isn't another touchstart due to multitouch
|
||||
// otherwise we will only clear a single timer when unmounting while two
|
||||
// are running
|
||||
if (startTimerCommit.current === null) {
|
||||
// Prepare the ripple effect.
|
||||
startTimerCommit.current = () => {
|
||||
startCommit({
|
||||
pulsate,
|
||||
rippleX,
|
||||
rippleY,
|
||||
rippleSize,
|
||||
cb
|
||||
});
|
||||
};
|
||||
// Delay the execution of the ripple effect.
|
||||
// We have to make a tradeoff with this delay value.
|
||||
startTimer.start(DELAY_RIPPLE, () => {
|
||||
if (startTimerCommit.current) {
|
||||
startTimerCommit.current();
|
||||
startTimerCommit.current = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
startCommit({
|
||||
pulsate,
|
||||
rippleX,
|
||||
rippleY,
|
||||
rippleSize,
|
||||
cb
|
||||
});
|
||||
}
|
||||
}, [centerProp, startCommit, startTimer]);
|
||||
const pulsate = React.useCallback(() => {
|
||||
start({}, {
|
||||
pulsate: true
|
||||
});
|
||||
}, [start]);
|
||||
const stop = React.useCallback((event, cb) => {
|
||||
startTimer.clear();
|
||||
|
||||
// The touch interaction occurs too quickly.
|
||||
// We still want to show ripple effect.
|
||||
if (event?.type === 'touchend' && startTimerCommit.current) {
|
||||
startTimerCommit.current();
|
||||
startTimerCommit.current = null;
|
||||
startTimer.start(0, () => {
|
||||
stop(event, cb);
|
||||
});
|
||||
return;
|
||||
}
|
||||
startTimerCommit.current = null;
|
||||
setRipples(oldRipples => {
|
||||
if (oldRipples.length > 0) {
|
||||
return oldRipples.slice(1);
|
||||
}
|
||||
return oldRipples;
|
||||
});
|
||||
rippleCallback.current = cb;
|
||||
}, [startTimer]);
|
||||
React.useImperativeHandle(ref, () => ({
|
||||
pulsate,
|
||||
start,
|
||||
stop
|
||||
}), [pulsate, start, stop]);
|
||||
return /*#__PURE__*/_jsx(TouchRippleRoot, {
|
||||
className: clsx(touchRippleClasses.root, classes.root, className),
|
||||
ref: container,
|
||||
...other,
|
||||
children: /*#__PURE__*/_jsx(TransitionGroup, {
|
||||
component: null,
|
||||
exit: true,
|
||||
children: ripples
|
||||
})
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? TouchRipple.propTypes /* remove-proptypes */ = {
|
||||
/**
|
||||
* If `true`, the ripple starts at the center of the component
|
||||
* rather than at the point of interaction.
|
||||
*/
|
||||
center: PropTypes.bool,
|
||||
/**
|
||||
* Override or extend the styles applied to the component.
|
||||
*/
|
||||
classes: PropTypes.object,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className: PropTypes.string
|
||||
} : void 0;
|
||||
export default TouchRipple;
|
||||
7
node_modules/@mui/material/modern/ButtonBase/buttonBaseClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/ButtonBase/buttonBaseClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getButtonBaseUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiButtonBase', slot);
|
||||
}
|
||||
const buttonBaseClasses = generateUtilityClasses('MuiButtonBase', ['root', 'disabled', 'focusVisible']);
|
||||
export default buttonBaseClasses;
|
||||
5
node_modules/@mui/material/modern/ButtonBase/index.js
generated
vendored
Normal file
5
node_modules/@mui/material/modern/ButtonBase/index.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export { default } from "./ButtonBase.js";
|
||||
export { default as buttonBaseClasses } from "./buttonBaseClasses.js";
|
||||
export * from "./buttonBaseClasses.js";
|
||||
export { default as touchRippleClasses } from "./touchRippleClasses.js";
|
||||
export * from "./touchRippleClasses.js";
|
||||
7
node_modules/@mui/material/modern/ButtonBase/touchRippleClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/ButtonBase/touchRippleClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getTouchRippleUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiTouchRipple', slot);
|
||||
}
|
||||
const touchRippleClasses = generateUtilityClasses('MuiTouchRipple', ['root', 'ripple', 'rippleVisible', 'ripplePulsate', 'child', 'childLeaving', 'childPulsate']);
|
||||
export default touchRippleClasses;
|
||||
390
node_modules/@mui/material/modern/ButtonGroup/ButtonGroup.js
generated
vendored
Normal file
390
node_modules/@mui/material/modern/ButtonGroup/ButtonGroup.js
generated
vendored
Normal file
@@ -0,0 +1,390 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import { alpha } from '@mui/system/colorManipulator';
|
||||
import getValidReactChildren from '@mui/utils/getValidReactChildren';
|
||||
import capitalize from "../utils/capitalize.js";
|
||||
import { styled } from "../zero-styled/index.js";
|
||||
import memoTheme from "../utils/memoTheme.js";
|
||||
import createSimplePaletteValueFilter from "../utils/createSimplePaletteValueFilter.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import buttonGroupClasses, { getButtonGroupUtilityClass } from "./buttonGroupClasses.js";
|
||||
import ButtonGroupContext from "./ButtonGroupContext.js";
|
||||
import ButtonGroupButtonContext from "./ButtonGroupButtonContext.js";
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
const overridesResolver = (props, styles) => {
|
||||
const {
|
||||
ownerState
|
||||
} = props;
|
||||
return [{
|
||||
[`& .${buttonGroupClasses.grouped}`]: styles.grouped
|
||||
}, {
|
||||
[`& .${buttonGroupClasses.grouped}`]: styles[`grouped${capitalize(ownerState.orientation)}`]
|
||||
}, {
|
||||
[`& .${buttonGroupClasses.grouped}`]: styles[`grouped${capitalize(ownerState.variant)}`]
|
||||
}, {
|
||||
[`& .${buttonGroupClasses.grouped}`]: styles[`grouped${capitalize(ownerState.variant)}${capitalize(ownerState.orientation)}`]
|
||||
}, {
|
||||
[`& .${buttonGroupClasses.grouped}`]: styles[`grouped${capitalize(ownerState.variant)}${capitalize(ownerState.color)}`]
|
||||
}, {
|
||||
[`& .${buttonGroupClasses.firstButton}`]: styles.firstButton
|
||||
}, {
|
||||
[`& .${buttonGroupClasses.lastButton}`]: styles.lastButton
|
||||
}, {
|
||||
[`& .${buttonGroupClasses.middleButton}`]: styles.middleButton
|
||||
}, styles.root, styles[ownerState.variant], ownerState.disableElevation === true && styles.disableElevation, ownerState.fullWidth && styles.fullWidth, ownerState.orientation === 'vertical' && styles.vertical];
|
||||
};
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
classes,
|
||||
color,
|
||||
disabled,
|
||||
disableElevation,
|
||||
fullWidth,
|
||||
orientation,
|
||||
variant
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root', variant, orientation, fullWidth && 'fullWidth', disableElevation && 'disableElevation', `color${capitalize(color)}`],
|
||||
grouped: ['grouped', `grouped${capitalize(orientation)}`, `grouped${capitalize(variant)}`, `grouped${capitalize(variant)}${capitalize(orientation)}`, `grouped${capitalize(variant)}${capitalize(color)}`, disabled && 'disabled'],
|
||||
firstButton: ['firstButton'],
|
||||
lastButton: ['lastButton'],
|
||||
middleButton: ['middleButton']
|
||||
};
|
||||
return composeClasses(slots, getButtonGroupUtilityClass, classes);
|
||||
};
|
||||
const ButtonGroupRoot = styled('div', {
|
||||
name: 'MuiButtonGroup',
|
||||
slot: 'Root',
|
||||
overridesResolver
|
||||
})(memoTheme(({
|
||||
theme
|
||||
}) => ({
|
||||
display: 'inline-flex',
|
||||
borderRadius: (theme.vars || theme).shape.borderRadius,
|
||||
variants: [{
|
||||
props: {
|
||||
variant: 'contained'
|
||||
},
|
||||
style: {
|
||||
boxShadow: (theme.vars || theme).shadows[2]
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
disableElevation: true
|
||||
},
|
||||
style: {
|
||||
boxShadow: 'none'
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
fullWidth: true
|
||||
},
|
||||
style: {
|
||||
width: '100%'
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
orientation: 'vertical'
|
||||
},
|
||||
style: {
|
||||
flexDirection: 'column',
|
||||
[`& .${buttonGroupClasses.lastButton},& .${buttonGroupClasses.middleButton}`]: {
|
||||
borderTopRightRadius: 0,
|
||||
borderTopLeftRadius: 0
|
||||
},
|
||||
[`& .${buttonGroupClasses.firstButton},& .${buttonGroupClasses.middleButton}`]: {
|
||||
borderBottomRightRadius: 0,
|
||||
borderBottomLeftRadius: 0
|
||||
}
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
orientation: 'horizontal'
|
||||
},
|
||||
style: {
|
||||
[`& .${buttonGroupClasses.firstButton},& .${buttonGroupClasses.middleButton}`]: {
|
||||
borderTopRightRadius: 0,
|
||||
borderBottomRightRadius: 0
|
||||
},
|
||||
[`& .${buttonGroupClasses.lastButton},& .${buttonGroupClasses.middleButton}`]: {
|
||||
borderTopLeftRadius: 0,
|
||||
borderBottomLeftRadius: 0
|
||||
}
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
variant: 'text',
|
||||
orientation: 'horizontal'
|
||||
},
|
||||
style: {
|
||||
[`& .${buttonGroupClasses.firstButton},& .${buttonGroupClasses.middleButton}`]: {
|
||||
borderRight: theme.vars ? `1px solid rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : `1px solid ${theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'}`,
|
||||
[`&.${buttonGroupClasses.disabled}`]: {
|
||||
borderRight: `1px solid ${(theme.vars || theme).palette.action.disabled}`
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
variant: 'text',
|
||||
orientation: 'vertical'
|
||||
},
|
||||
style: {
|
||||
[`& .${buttonGroupClasses.firstButton},& .${buttonGroupClasses.middleButton}`]: {
|
||||
borderBottom: theme.vars ? `1px solid rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : `1px solid ${theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'}`,
|
||||
[`&.${buttonGroupClasses.disabled}`]: {
|
||||
borderBottom: `1px solid ${(theme.vars || theme).palette.action.disabled}`
|
||||
}
|
||||
}
|
||||
}
|
||||
}, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).flatMap(([color]) => [{
|
||||
props: {
|
||||
variant: 'text',
|
||||
color
|
||||
},
|
||||
style: {
|
||||
[`& .${buttonGroupClasses.firstButton},& .${buttonGroupClasses.middleButton}`]: {
|
||||
borderColor: theme.vars ? `rgba(${theme.vars.palette[color].mainChannel} / 0.5)` : alpha(theme.palette[color].main, 0.5)
|
||||
}
|
||||
}
|
||||
}]), {
|
||||
props: {
|
||||
variant: 'outlined',
|
||||
orientation: 'horizontal'
|
||||
},
|
||||
style: {
|
||||
[`& .${buttonGroupClasses.firstButton},& .${buttonGroupClasses.middleButton}`]: {
|
||||
borderRightColor: 'transparent',
|
||||
'&:hover': {
|
||||
borderRightColor: 'currentColor'
|
||||
}
|
||||
},
|
||||
[`& .${buttonGroupClasses.lastButton},& .${buttonGroupClasses.middleButton}`]: {
|
||||
marginLeft: -1
|
||||
}
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
variant: 'outlined',
|
||||
orientation: 'vertical'
|
||||
},
|
||||
style: {
|
||||
[`& .${buttonGroupClasses.firstButton},& .${buttonGroupClasses.middleButton}`]: {
|
||||
borderBottomColor: 'transparent',
|
||||
'&:hover': {
|
||||
borderBottomColor: 'currentColor'
|
||||
}
|
||||
},
|
||||
[`& .${buttonGroupClasses.lastButton},& .${buttonGroupClasses.middleButton}`]: {
|
||||
marginTop: -1
|
||||
}
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
variant: 'contained',
|
||||
orientation: 'horizontal'
|
||||
},
|
||||
style: {
|
||||
[`& .${buttonGroupClasses.firstButton},& .${buttonGroupClasses.middleButton}`]: {
|
||||
borderRight: `1px solid ${(theme.vars || theme).palette.grey[400]}`,
|
||||
[`&.${buttonGroupClasses.disabled}`]: {
|
||||
borderRight: `1px solid ${(theme.vars || theme).palette.action.disabled}`
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
variant: 'contained',
|
||||
orientation: 'vertical'
|
||||
},
|
||||
style: {
|
||||
[`& .${buttonGroupClasses.firstButton},& .${buttonGroupClasses.middleButton}`]: {
|
||||
borderBottom: `1px solid ${(theme.vars || theme).palette.grey[400]}`,
|
||||
[`&.${buttonGroupClasses.disabled}`]: {
|
||||
borderBottom: `1px solid ${(theme.vars || theme).palette.action.disabled}`
|
||||
}
|
||||
}
|
||||
}
|
||||
}, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter(['dark'])).map(([color]) => ({
|
||||
props: {
|
||||
variant: 'contained',
|
||||
color
|
||||
},
|
||||
style: {
|
||||
[`& .${buttonGroupClasses.firstButton},& .${buttonGroupClasses.middleButton}`]: {
|
||||
borderColor: (theme.vars || theme).palette[color].dark
|
||||
}
|
||||
}
|
||||
}))],
|
||||
[`& .${buttonGroupClasses.grouped}`]: {
|
||||
minWidth: 40,
|
||||
boxShadow: 'none',
|
||||
props: {
|
||||
variant: 'contained'
|
||||
},
|
||||
style: {
|
||||
'&:hover': {
|
||||
boxShadow: 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
})));
|
||||
const ButtonGroup = /*#__PURE__*/React.forwardRef(function ButtonGroup(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiButtonGroup'
|
||||
});
|
||||
const {
|
||||
children,
|
||||
className,
|
||||
color = 'primary',
|
||||
component = 'div',
|
||||
disabled = false,
|
||||
disableElevation = false,
|
||||
disableFocusRipple = false,
|
||||
disableRipple = false,
|
||||
fullWidth = false,
|
||||
orientation = 'horizontal',
|
||||
size = 'medium',
|
||||
variant = 'outlined',
|
||||
...other
|
||||
} = props;
|
||||
const ownerState = {
|
||||
...props,
|
||||
color,
|
||||
component,
|
||||
disabled,
|
||||
disableElevation,
|
||||
disableFocusRipple,
|
||||
disableRipple,
|
||||
fullWidth,
|
||||
orientation,
|
||||
size,
|
||||
variant
|
||||
};
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
const context = React.useMemo(() => ({
|
||||
className: classes.grouped,
|
||||
color,
|
||||
disabled,
|
||||
disableElevation,
|
||||
disableFocusRipple,
|
||||
disableRipple,
|
||||
fullWidth,
|
||||
size,
|
||||
variant
|
||||
}), [color, disabled, disableElevation, disableFocusRipple, disableRipple, fullWidth, size, variant, classes.grouped]);
|
||||
const validChildren = getValidReactChildren(children);
|
||||
const childrenCount = validChildren.length;
|
||||
const getButtonPositionClassName = index => {
|
||||
const isFirstButton = index === 0;
|
||||
const isLastButton = index === childrenCount - 1;
|
||||
if (isFirstButton && isLastButton) {
|
||||
return '';
|
||||
}
|
||||
if (isFirstButton) {
|
||||
return classes.firstButton;
|
||||
}
|
||||
if (isLastButton) {
|
||||
return classes.lastButton;
|
||||
}
|
||||
return classes.middleButton;
|
||||
};
|
||||
return /*#__PURE__*/_jsx(ButtonGroupRoot, {
|
||||
as: component,
|
||||
role: "group",
|
||||
className: clsx(classes.root, className),
|
||||
ref: ref,
|
||||
ownerState: ownerState,
|
||||
...other,
|
||||
children: /*#__PURE__*/_jsx(ButtonGroupContext.Provider, {
|
||||
value: context,
|
||||
children: validChildren.map((child, index) => {
|
||||
return /*#__PURE__*/_jsx(ButtonGroupButtonContext.Provider, {
|
||||
value: getButtonPositionClassName(index),
|
||||
children: child
|
||||
}, index);
|
||||
})
|
||||
})
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? ButtonGroup.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 color of the component.
|
||||
* It supports both default and custom theme colors, which can be added as shown in the
|
||||
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
||||
* @default 'primary'
|
||||
*/
|
||||
color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['inherit', 'primary', 'secondary', 'error', 'info', 'success', 'warning']), 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`, the component is disabled.
|
||||
* @default false
|
||||
*/
|
||||
disabled: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, no elevation is used.
|
||||
* @default false
|
||||
*/
|
||||
disableElevation: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, the button keyboard focus ripple is disabled.
|
||||
* @default false
|
||||
*/
|
||||
disableFocusRipple: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, the button ripple effect is disabled.
|
||||
* @default false
|
||||
*/
|
||||
disableRipple: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, the buttons will take up the full width of its container.
|
||||
* @default false
|
||||
*/
|
||||
fullWidth: PropTypes.bool,
|
||||
/**
|
||||
* The component orientation (layout flow direction).
|
||||
* @default 'horizontal'
|
||||
*/
|
||||
orientation: PropTypes.oneOf(['horizontal', 'vertical']),
|
||||
/**
|
||||
* The size of the component.
|
||||
* `small` is equivalent to the dense button styling.
|
||||
* @default 'medium'
|
||||
*/
|
||||
size: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['small', 'medium', 'large']), PropTypes.string]),
|
||||
/**
|
||||
* 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 'outlined'
|
||||
*/
|
||||
variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['contained', 'outlined', 'text']), PropTypes.string])
|
||||
} : void 0;
|
||||
export default ButtonGroup;
|
||||
9
node_modules/@mui/material/modern/ButtonGroup/ButtonGroupButtonContext.js
generated
vendored
Normal file
9
node_modules/@mui/material/modern/ButtonGroup/ButtonGroupButtonContext.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import * as React from 'react';
|
||||
/**
|
||||
* @ignore - internal component.
|
||||
*/
|
||||
const ButtonGroupButtonContext = /*#__PURE__*/React.createContext(undefined);
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
ButtonGroupButtonContext.displayName = 'ButtonGroupButtonContext';
|
||||
}
|
||||
export default ButtonGroupButtonContext;
|
||||
9
node_modules/@mui/material/modern/ButtonGroup/ButtonGroupContext.js
generated
vendored
Normal file
9
node_modules/@mui/material/modern/ButtonGroup/ButtonGroupContext.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import * as React from 'react';
|
||||
/**
|
||||
* @ignore - internal component.
|
||||
*/
|
||||
const ButtonGroupContext = /*#__PURE__*/React.createContext({});
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
ButtonGroupContext.displayName = 'ButtonGroupContext';
|
||||
}
|
||||
export default ButtonGroupContext;
|
||||
7
node_modules/@mui/material/modern/ButtonGroup/buttonGroupClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/ButtonGroup/buttonGroupClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getButtonGroupUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiButtonGroup', slot);
|
||||
}
|
||||
const buttonGroupClasses = generateUtilityClasses('MuiButtonGroup', ['root', 'contained', 'outlined', 'text', 'disableElevation', 'disabled', 'firstButton', 'fullWidth', 'horizontal', 'vertical', 'colorPrimary', 'colorSecondary', 'grouped', 'groupedHorizontal', 'groupedVertical', 'groupedText', 'groupedTextHorizontal', 'groupedTextVertical', 'groupedTextPrimary', 'groupedTextSecondary', 'groupedOutlined', 'groupedOutlinedHorizontal', 'groupedOutlinedVertical', 'groupedOutlinedPrimary', 'groupedOutlinedSecondary', 'groupedContained', 'groupedContainedHorizontal', 'groupedContainedVertical', 'groupedContainedPrimary', 'groupedContainedSecondary', 'lastButton', 'middleButton']);
|
||||
export default buttonGroupClasses;
|
||||
5
node_modules/@mui/material/modern/ButtonGroup/index.js
generated
vendored
Normal file
5
node_modules/@mui/material/modern/ButtonGroup/index.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export { default } from "./ButtonGroup.js";
|
||||
export { default as buttonGroupClasses } from "./buttonGroupClasses.js";
|
||||
export * from "./buttonGroupClasses.js";
|
||||
export { default as ButtonGroupContext } from "./ButtonGroupContext.js";
|
||||
export { default as ButtonGroupButtonContext } from "./ButtonGroupButtonContext.js";
|
||||
84
node_modules/@mui/material/modern/Card/Card.js
generated
vendored
Normal file
84
node_modules/@mui/material/modern/Card/Card.js
generated
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import chainPropTypes from '@mui/utils/chainPropTypes';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import { styled } from "../zero-styled/index.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import Paper from "../Paper/index.js";
|
||||
import { getCardUtilityClass } from "./cardClasses.js";
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
classes
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root']
|
||||
};
|
||||
return composeClasses(slots, getCardUtilityClass, classes);
|
||||
};
|
||||
const CardRoot = styled(Paper, {
|
||||
name: 'MuiCard',
|
||||
slot: 'Root',
|
||||
overridesResolver: (props, styles) => styles.root
|
||||
})({
|
||||
overflow: 'hidden'
|
||||
});
|
||||
const Card = /*#__PURE__*/React.forwardRef(function Card(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiCard'
|
||||
});
|
||||
const {
|
||||
className,
|
||||
raised = false,
|
||||
...other
|
||||
} = props;
|
||||
const ownerState = {
|
||||
...props,
|
||||
raised
|
||||
};
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
return /*#__PURE__*/_jsx(CardRoot, {
|
||||
className: clsx(classes.root, className),
|
||||
elevation: raised ? 8 : undefined,
|
||||
ref: ref,
|
||||
ownerState: ownerState,
|
||||
...other
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? Card.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,
|
||||
/**
|
||||
* If `true`, the card will use raised styling.
|
||||
* @default false
|
||||
*/
|
||||
raised: chainPropTypes(PropTypes.bool, props => {
|
||||
if (props.raised && props.variant === 'outlined') {
|
||||
return new Error('MUI: Combining `raised={true}` with `variant="outlined"` has no effect.');
|
||||
}
|
||||
return null;
|
||||
}),
|
||||
/**
|
||||
* 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 Card;
|
||||
7
node_modules/@mui/material/modern/Card/cardClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/Card/cardClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getCardUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiCard', slot);
|
||||
}
|
||||
const cardClasses = generateUtilityClasses('MuiCard', ['root']);
|
||||
export default cardClasses;
|
||||
3
node_modules/@mui/material/modern/Card/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/Card/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default } from "./Card.js";
|
||||
export { default as cardClasses } from "./cardClasses.js";
|
||||
export * from "./cardClasses.js";
|
||||
117
node_modules/@mui/material/modern/CardActionArea/CardActionArea.js
generated
vendored
Normal file
117
node_modules/@mui/material/modern/CardActionArea/CardActionArea.js
generated
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import { styled } from "../zero-styled/index.js";
|
||||
import memoTheme from "../utils/memoTheme.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import cardActionAreaClasses, { getCardActionAreaUtilityClass } from "./cardActionAreaClasses.js";
|
||||
import ButtonBase from "../ButtonBase/index.js";
|
||||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
classes
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root'],
|
||||
focusHighlight: ['focusHighlight']
|
||||
};
|
||||
return composeClasses(slots, getCardActionAreaUtilityClass, classes);
|
||||
};
|
||||
const CardActionAreaRoot = styled(ButtonBase, {
|
||||
name: 'MuiCardActionArea',
|
||||
slot: 'Root',
|
||||
overridesResolver: (props, styles) => styles.root
|
||||
})(memoTheme(({
|
||||
theme
|
||||
}) => ({
|
||||
display: 'block',
|
||||
textAlign: 'inherit',
|
||||
borderRadius: 'inherit',
|
||||
// for Safari to work https://github.com/mui/material-ui/issues/36285.
|
||||
width: '100%',
|
||||
[`&:hover .${cardActionAreaClasses.focusHighlight}`]: {
|
||||
opacity: (theme.vars || theme).palette.action.hoverOpacity,
|
||||
'@media (hover: none)': {
|
||||
opacity: 0
|
||||
}
|
||||
},
|
||||
[`&.${cardActionAreaClasses.focusVisible} .${cardActionAreaClasses.focusHighlight}`]: {
|
||||
opacity: (theme.vars || theme).palette.action.focusOpacity
|
||||
}
|
||||
})));
|
||||
const CardActionAreaFocusHighlight = styled('span', {
|
||||
name: 'MuiCardActionArea',
|
||||
slot: 'FocusHighlight',
|
||||
overridesResolver: (props, styles) => styles.focusHighlight
|
||||
})(memoTheme(({
|
||||
theme
|
||||
}) => ({
|
||||
overflow: 'hidden',
|
||||
pointerEvents: 'none',
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
borderRadius: 'inherit',
|
||||
opacity: 0,
|
||||
backgroundColor: 'currentcolor',
|
||||
transition: theme.transitions.create('opacity', {
|
||||
duration: theme.transitions.duration.short
|
||||
})
|
||||
})));
|
||||
const CardActionArea = /*#__PURE__*/React.forwardRef(function CardActionArea(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiCardActionArea'
|
||||
});
|
||||
const {
|
||||
children,
|
||||
className,
|
||||
focusVisibleClassName,
|
||||
...other
|
||||
} = props;
|
||||
const ownerState = props;
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
return /*#__PURE__*/_jsxs(CardActionAreaRoot, {
|
||||
className: clsx(classes.root, className),
|
||||
focusVisibleClassName: clsx(focusVisibleClassName, classes.focusVisible),
|
||||
ref: ref,
|
||||
ownerState: ownerState,
|
||||
...other,
|
||||
children: [children, /*#__PURE__*/_jsx(CardActionAreaFocusHighlight, {
|
||||
className: classes.focusHighlight,
|
||||
ownerState: ownerState
|
||||
})]
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? CardActionArea.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,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
focusVisibleClassName: PropTypes.string,
|
||||
/**
|
||||
* 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 CardActionArea;
|
||||
7
node_modules/@mui/material/modern/CardActionArea/cardActionAreaClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/CardActionArea/cardActionAreaClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getCardActionAreaUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiCardActionArea', slot);
|
||||
}
|
||||
const cardActionAreaClasses = generateUtilityClasses('MuiCardActionArea', ['root', 'focusVisible', 'focusHighlight']);
|
||||
export default cardActionAreaClasses;
|
||||
3
node_modules/@mui/material/modern/CardActionArea/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/CardActionArea/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default } from "./CardActionArea.js";
|
||||
export { default as cardActionAreaClasses } from "./cardActionAreaClasses.js";
|
||||
export * from "./cardActionAreaClasses.js";
|
||||
94
node_modules/@mui/material/modern/CardActions/CardActions.js
generated
vendored
Normal file
94
node_modules/@mui/material/modern/CardActions/CardActions.js
generated
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import { styled } from "../zero-styled/index.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import { getCardActionsUtilityClass } from "./cardActionsClasses.js";
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
classes,
|
||||
disableSpacing
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root', !disableSpacing && 'spacing']
|
||||
};
|
||||
return composeClasses(slots, getCardActionsUtilityClass, classes);
|
||||
};
|
||||
const CardActionsRoot = styled('div', {
|
||||
name: 'MuiCardActions',
|
||||
slot: 'Root',
|
||||
overridesResolver: (props, styles) => {
|
||||
const {
|
||||
ownerState
|
||||
} = props;
|
||||
return [styles.root, !ownerState.disableSpacing && styles.spacing];
|
||||
}
|
||||
})({
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
padding: 8,
|
||||
variants: [{
|
||||
props: {
|
||||
disableSpacing: false
|
||||
},
|
||||
style: {
|
||||
'& > :not(style) ~ :not(style)': {
|
||||
marginLeft: 8
|
||||
}
|
||||
}
|
||||
}]
|
||||
});
|
||||
const CardActions = /*#__PURE__*/React.forwardRef(function CardActions(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiCardActions'
|
||||
});
|
||||
const {
|
||||
disableSpacing = false,
|
||||
className,
|
||||
...other
|
||||
} = props;
|
||||
const ownerState = {
|
||||
...props,
|
||||
disableSpacing
|
||||
};
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
return /*#__PURE__*/_jsx(CardActionsRoot, {
|
||||
className: clsx(classes.root, className),
|
||||
ownerState: ownerState,
|
||||
ref: ref,
|
||||
...other
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? CardActions.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,
|
||||
/**
|
||||
* If `true`, the actions do not have additional margin.
|
||||
* @default false
|
||||
*/
|
||||
disableSpacing: 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])
|
||||
} : void 0;
|
||||
export default CardActions;
|
||||
7
node_modules/@mui/material/modern/CardActions/cardActionsClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/CardActions/cardActionsClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getCardActionsUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiCardActions', slot);
|
||||
}
|
||||
const cardActionsClasses = generateUtilityClasses('MuiCardActions', ['root', 'spacing']);
|
||||
export default cardActionsClasses;
|
||||
3
node_modules/@mui/material/modern/CardActions/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/CardActions/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default } from "./CardActions.js";
|
||||
export { default as cardActionsClasses } from "./cardActionsClasses.js";
|
||||
export * from "./cardActionsClasses.js";
|
||||
80
node_modules/@mui/material/modern/CardContent/CardContent.js
generated
vendored
Normal file
80
node_modules/@mui/material/modern/CardContent/CardContent.js
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import { styled } from "../zero-styled/index.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import { getCardContentUtilityClass } from "./cardContentClasses.js";
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
classes
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root']
|
||||
};
|
||||
return composeClasses(slots, getCardContentUtilityClass, classes);
|
||||
};
|
||||
const CardContentRoot = styled('div', {
|
||||
name: 'MuiCardContent',
|
||||
slot: 'Root',
|
||||
overridesResolver: (props, styles) => styles.root
|
||||
})({
|
||||
padding: 16,
|
||||
'&:last-child': {
|
||||
paddingBottom: 24
|
||||
}
|
||||
});
|
||||
const CardContent = /*#__PURE__*/React.forwardRef(function CardContent(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiCardContent'
|
||||
});
|
||||
const {
|
||||
className,
|
||||
component = 'div',
|
||||
...other
|
||||
} = props;
|
||||
const ownerState = {
|
||||
...props,
|
||||
component
|
||||
};
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
return /*#__PURE__*/_jsx(CardContentRoot, {
|
||||
as: component,
|
||||
className: clsx(classes.root, className),
|
||||
ownerState: ownerState,
|
||||
ref: ref,
|
||||
...other
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? CardContent.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 component used for the root node.
|
||||
* Either a string to use a HTML element or a component.
|
||||
*/
|
||||
component: PropTypes.elementType,
|
||||
/**
|
||||
* 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 CardContent;
|
||||
7
node_modules/@mui/material/modern/CardContent/cardContentClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/CardContent/cardContentClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getCardContentUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiCardContent', slot);
|
||||
}
|
||||
const cardContentClasses = generateUtilityClasses('MuiCardContent', ['root']);
|
||||
export default cardContentClasses;
|
||||
3
node_modules/@mui/material/modern/CardContent/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/CardContent/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default } from "./CardContent.js";
|
||||
export { default as cardContentClasses } from "./cardContentClasses.js";
|
||||
export * from "./cardContentClasses.js";
|
||||
198
node_modules/@mui/material/modern/CardHeader/CardHeader.js
generated
vendored
Normal file
198
node_modules/@mui/material/modern/CardHeader/CardHeader.js
generated
vendored
Normal file
@@ -0,0 +1,198 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import Typography, { typographyClasses } from "../Typography/index.js";
|
||||
import { styled } from "../zero-styled/index.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import cardHeaderClasses, { getCardHeaderUtilityClass } from "./cardHeaderClasses.js";
|
||||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
classes
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root'],
|
||||
avatar: ['avatar'],
|
||||
action: ['action'],
|
||||
content: ['content'],
|
||||
title: ['title'],
|
||||
subheader: ['subheader']
|
||||
};
|
||||
return composeClasses(slots, getCardHeaderUtilityClass, classes);
|
||||
};
|
||||
const CardHeaderRoot = styled('div', {
|
||||
name: 'MuiCardHeader',
|
||||
slot: 'Root',
|
||||
overridesResolver: (props, styles) => ({
|
||||
[`& .${cardHeaderClasses.title}`]: styles.title,
|
||||
[`& .${cardHeaderClasses.subheader}`]: styles.subheader,
|
||||
...styles.root
|
||||
})
|
||||
})({
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
padding: 16
|
||||
});
|
||||
const CardHeaderAvatar = styled('div', {
|
||||
name: 'MuiCardHeader',
|
||||
slot: 'Avatar',
|
||||
overridesResolver: (props, styles) => styles.avatar
|
||||
})({
|
||||
display: 'flex',
|
||||
flex: '0 0 auto',
|
||||
marginRight: 16
|
||||
});
|
||||
const CardHeaderAction = styled('div', {
|
||||
name: 'MuiCardHeader',
|
||||
slot: 'Action',
|
||||
overridesResolver: (props, styles) => styles.action
|
||||
})({
|
||||
flex: '0 0 auto',
|
||||
alignSelf: 'flex-start',
|
||||
marginTop: -4,
|
||||
marginRight: -8,
|
||||
marginBottom: -4
|
||||
});
|
||||
const CardHeaderContent = styled('div', {
|
||||
name: 'MuiCardHeader',
|
||||
slot: 'Content',
|
||||
overridesResolver: (props, styles) => styles.content
|
||||
})({
|
||||
flex: '1 1 auto',
|
||||
[`.${typographyClasses.root}:where(& .${cardHeaderClasses.title})`]: {
|
||||
display: 'block'
|
||||
},
|
||||
[`.${typographyClasses.root}:where(& .${cardHeaderClasses.subheader})`]: {
|
||||
display: 'block'
|
||||
}
|
||||
});
|
||||
const CardHeader = /*#__PURE__*/React.forwardRef(function CardHeader(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiCardHeader'
|
||||
});
|
||||
const {
|
||||
action,
|
||||
avatar,
|
||||
className,
|
||||
component = 'div',
|
||||
disableTypography = false,
|
||||
subheader: subheaderProp,
|
||||
subheaderTypographyProps,
|
||||
title: titleProp,
|
||||
titleTypographyProps,
|
||||
...other
|
||||
} = props;
|
||||
const ownerState = {
|
||||
...props,
|
||||
component,
|
||||
disableTypography
|
||||
};
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
let title = titleProp;
|
||||
if (title != null && title.type !== Typography && !disableTypography) {
|
||||
title = /*#__PURE__*/_jsx(Typography, {
|
||||
variant: avatar ? 'body2' : 'h5',
|
||||
className: classes.title,
|
||||
component: "span",
|
||||
...titleTypographyProps,
|
||||
children: title
|
||||
});
|
||||
}
|
||||
let subheader = subheaderProp;
|
||||
if (subheader != null && subheader.type !== Typography && !disableTypography) {
|
||||
subheader = /*#__PURE__*/_jsx(Typography, {
|
||||
variant: avatar ? 'body2' : 'body1',
|
||||
className: classes.subheader,
|
||||
color: "textSecondary",
|
||||
component: "span",
|
||||
...subheaderTypographyProps,
|
||||
children: subheader
|
||||
});
|
||||
}
|
||||
return /*#__PURE__*/_jsxs(CardHeaderRoot, {
|
||||
className: clsx(classes.root, className),
|
||||
as: component,
|
||||
ref: ref,
|
||||
ownerState: ownerState,
|
||||
...other,
|
||||
children: [avatar && /*#__PURE__*/_jsx(CardHeaderAvatar, {
|
||||
className: classes.avatar,
|
||||
ownerState: ownerState,
|
||||
children: avatar
|
||||
}), /*#__PURE__*/_jsxs(CardHeaderContent, {
|
||||
className: classes.content,
|
||||
ownerState: ownerState,
|
||||
children: [title, subheader]
|
||||
}), action && /*#__PURE__*/_jsx(CardHeaderAction, {
|
||||
className: classes.action,
|
||||
ownerState: ownerState,
|
||||
children: action
|
||||
})]
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? CardHeader.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 action to display in the card header.
|
||||
*/
|
||||
action: PropTypes.node,
|
||||
/**
|
||||
* The Avatar element to display.
|
||||
*/
|
||||
avatar: PropTypes.node,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
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`, `subheader` and `title` won't be wrapped by a Typography component.
|
||||
* This can be useful to render an alternative Typography variant by wrapping
|
||||
* the `title` text, and optional `subheader` text
|
||||
* with the Typography component.
|
||||
* @default false
|
||||
*/
|
||||
disableTypography: PropTypes.bool,
|
||||
/**
|
||||
* The content of the component.
|
||||
*/
|
||||
subheader: PropTypes.node,
|
||||
/**
|
||||
* These props will be forwarded to the subheader
|
||||
* (as long as disableTypography is not `true`).
|
||||
*/
|
||||
subheaderTypographyProps: 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]),
|
||||
/**
|
||||
* The content of the component.
|
||||
*/
|
||||
title: PropTypes.node,
|
||||
/**
|
||||
* These props will be forwarded to the title
|
||||
* (as long as disableTypography is not `true`).
|
||||
*/
|
||||
titleTypographyProps: PropTypes.object
|
||||
} : void 0;
|
||||
export default CardHeader;
|
||||
7
node_modules/@mui/material/modern/CardHeader/cardHeaderClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/CardHeader/cardHeaderClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getCardHeaderUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiCardHeader', slot);
|
||||
}
|
||||
const cardHeaderClasses = generateUtilityClasses('MuiCardHeader', ['root', 'avatar', 'action', 'content', 'title', 'subheader']);
|
||||
export default cardHeaderClasses;
|
||||
3
node_modules/@mui/material/modern/CardHeader/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/CardHeader/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default } from "./CardHeader.js";
|
||||
export { default as cardHeaderClasses } from "./cardHeaderClasses.js";
|
||||
export * from "./cardHeaderClasses.js";
|
||||
145
node_modules/@mui/material/modern/CardMedia/CardMedia.js
generated
vendored
Normal file
145
node_modules/@mui/material/modern/CardMedia/CardMedia.js
generated
vendored
Normal file
@@ -0,0 +1,145 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import chainPropTypes from '@mui/utils/chainPropTypes';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import { styled } from "../zero-styled/index.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import { getCardMediaUtilityClass } from "./cardMediaClasses.js";
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
classes,
|
||||
isMediaComponent,
|
||||
isImageComponent
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root', isMediaComponent && 'media', isImageComponent && 'img']
|
||||
};
|
||||
return composeClasses(slots, getCardMediaUtilityClass, classes);
|
||||
};
|
||||
const CardMediaRoot = styled('div', {
|
||||
name: 'MuiCardMedia',
|
||||
slot: 'Root',
|
||||
overridesResolver: (props, styles) => {
|
||||
const {
|
||||
ownerState
|
||||
} = props;
|
||||
const {
|
||||
isMediaComponent,
|
||||
isImageComponent
|
||||
} = ownerState;
|
||||
return [styles.root, isMediaComponent && styles.media, isImageComponent && styles.img];
|
||||
}
|
||||
})({
|
||||
display: 'block',
|
||||
backgroundSize: 'cover',
|
||||
backgroundRepeat: 'no-repeat',
|
||||
backgroundPosition: 'center',
|
||||
variants: [{
|
||||
props: {
|
||||
isMediaComponent: true
|
||||
},
|
||||
style: {
|
||||
width: '100%'
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
isImageComponent: true
|
||||
},
|
||||
style: {
|
||||
objectFit: 'cover'
|
||||
}
|
||||
}]
|
||||
});
|
||||
const MEDIA_COMPONENTS = ['video', 'audio', 'picture', 'iframe', 'img'];
|
||||
const IMAGE_COMPONENTS = ['picture', 'img'];
|
||||
const CardMedia = /*#__PURE__*/React.forwardRef(function CardMedia(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiCardMedia'
|
||||
});
|
||||
const {
|
||||
children,
|
||||
className,
|
||||
component = 'div',
|
||||
image,
|
||||
src,
|
||||
style,
|
||||
...other
|
||||
} = props;
|
||||
const isMediaComponent = MEDIA_COMPONENTS.includes(component);
|
||||
const composedStyle = !isMediaComponent && image ? {
|
||||
backgroundImage: `url("${image}")`,
|
||||
...style
|
||||
} : style;
|
||||
const ownerState = {
|
||||
...props,
|
||||
component,
|
||||
isMediaComponent,
|
||||
isImageComponent: IMAGE_COMPONENTS.includes(component)
|
||||
};
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
return /*#__PURE__*/_jsx(CardMediaRoot, {
|
||||
className: clsx(classes.root, className),
|
||||
as: component,
|
||||
role: !isMediaComponent && image ? 'img' : undefined,
|
||||
ref: ref,
|
||||
style: composedStyle,
|
||||
ownerState: ownerState,
|
||||
src: isMediaComponent ? image || src : undefined,
|
||||
...other,
|
||||
children: children
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? CardMedia.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: chainPropTypes(PropTypes.node, props => {
|
||||
if (!props.children && !props.image && !props.src && !props.component) {
|
||||
return new Error('MUI: Either `children`, `image`, `src` or `component` prop must be specified.');
|
||||
}
|
||||
return null;
|
||||
}),
|
||||
/**
|
||||
* 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,
|
||||
/**
|
||||
* Image to be displayed as a background image.
|
||||
* Either `image` or `src` prop must be specified.
|
||||
* Note that caller must specify height otherwise the image will not be visible.
|
||||
*/
|
||||
image: PropTypes.string,
|
||||
/**
|
||||
* An alias for `image` property.
|
||||
* Available only with media components.
|
||||
* Media components: `video`, `audio`, `picture`, `iframe`, `img`.
|
||||
*/
|
||||
src: PropTypes.string,
|
||||
/**
|
||||
* @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 CardMedia;
|
||||
7
node_modules/@mui/material/modern/CardMedia/cardMediaClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/CardMedia/cardMediaClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getCardMediaUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiCardMedia', slot);
|
||||
}
|
||||
const cardMediaClasses = generateUtilityClasses('MuiCardMedia', ['root', 'media', 'img']);
|
||||
export default cardMediaClasses;
|
||||
3
node_modules/@mui/material/modern/CardMedia/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/CardMedia/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default } from "./CardMedia.js";
|
||||
export { default as cardMediaClasses } from "./cardMediaClasses.js";
|
||||
export * from "./cardMediaClasses.js";
|
||||
249
node_modules/@mui/material/modern/Checkbox/Checkbox.js
generated
vendored
Normal file
249
node_modules/@mui/material/modern/Checkbox/Checkbox.js
generated
vendored
Normal file
@@ -0,0 +1,249 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import refType from '@mui/utils/refType';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import { alpha } from '@mui/system/colorManipulator';
|
||||
import SwitchBase from "../internal/SwitchBase.js";
|
||||
import CheckBoxOutlineBlankIcon from "../internal/svg-icons/CheckBoxOutlineBlank.js";
|
||||
import CheckBoxIcon from "../internal/svg-icons/CheckBox.js";
|
||||
import IndeterminateCheckBoxIcon from "../internal/svg-icons/IndeterminateCheckBox.js";
|
||||
import capitalize from "../utils/capitalize.js";
|
||||
import rootShouldForwardProp from "../styles/rootShouldForwardProp.js";
|
||||
import checkboxClasses, { getCheckboxUtilityClass } from "./checkboxClasses.js";
|
||||
import { styled } from "../zero-styled/index.js";
|
||||
import memoTheme from "../utils/memoTheme.js";
|
||||
import createSimplePaletteValueFilter from "../utils/createSimplePaletteValueFilter.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
classes,
|
||||
indeterminate,
|
||||
color,
|
||||
size
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root', indeterminate && 'indeterminate', `color${capitalize(color)}`, `size${capitalize(size)}`]
|
||||
};
|
||||
const composedClasses = composeClasses(slots, getCheckboxUtilityClass, classes);
|
||||
return {
|
||||
...classes,
|
||||
// forward the disabled and checked classes to the SwitchBase
|
||||
...composedClasses
|
||||
};
|
||||
};
|
||||
const CheckboxRoot = styled(SwitchBase, {
|
||||
shouldForwardProp: prop => rootShouldForwardProp(prop) || prop === 'classes',
|
||||
name: 'MuiCheckbox',
|
||||
slot: 'Root',
|
||||
overridesResolver: (props, styles) => {
|
||||
const {
|
||||
ownerState
|
||||
} = props;
|
||||
return [styles.root, ownerState.indeterminate && styles.indeterminate, styles[`size${capitalize(ownerState.size)}`], ownerState.color !== 'default' && styles[`color${capitalize(ownerState.color)}`]];
|
||||
}
|
||||
})(memoTheme(({
|
||||
theme
|
||||
}) => ({
|
||||
color: (theme.vars || theme).palette.text.secondary,
|
||||
variants: [{
|
||||
props: {
|
||||
color: 'default',
|
||||
disableRipple: false
|
||||
},
|
||||
style: {
|
||||
'&:hover': {
|
||||
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.activeChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette.action.active, theme.palette.action.hoverOpacity)
|
||||
}
|
||||
}
|
||||
}, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color]) => ({
|
||||
props: {
|
||||
color,
|
||||
disableRipple: false
|
||||
},
|
||||
style: {
|
||||
'&:hover': {
|
||||
backgroundColor: theme.vars ? `rgba(${theme.vars.palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette[color].main, theme.palette.action.hoverOpacity)
|
||||
}
|
||||
}
|
||||
})), ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color]) => ({
|
||||
props: {
|
||||
color
|
||||
},
|
||||
style: {
|
||||
[`&.${checkboxClasses.checked}, &.${checkboxClasses.indeterminate}`]: {
|
||||
color: (theme.vars || theme).palette[color].main
|
||||
},
|
||||
[`&.${checkboxClasses.disabled}`]: {
|
||||
color: (theme.vars || theme).palette.action.disabled
|
||||
}
|
||||
}
|
||||
})), {
|
||||
// Should be last to override other colors
|
||||
props: {
|
||||
disableRipple: false
|
||||
},
|
||||
style: {
|
||||
// Reset on touch devices, it doesn't add specificity
|
||||
'&:hover': {
|
||||
'@media (hover: none)': {
|
||||
backgroundColor: 'transparent'
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
})));
|
||||
const defaultCheckedIcon = /*#__PURE__*/_jsx(CheckBoxIcon, {});
|
||||
const defaultIcon = /*#__PURE__*/_jsx(CheckBoxOutlineBlankIcon, {});
|
||||
const defaultIndeterminateIcon = /*#__PURE__*/_jsx(IndeterminateCheckBoxIcon, {});
|
||||
const Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiCheckbox'
|
||||
});
|
||||
const {
|
||||
checkedIcon = defaultCheckedIcon,
|
||||
color = 'primary',
|
||||
icon: iconProp = defaultIcon,
|
||||
indeterminate = false,
|
||||
indeterminateIcon: indeterminateIconProp = defaultIndeterminateIcon,
|
||||
inputProps,
|
||||
size = 'medium',
|
||||
disableRipple = false,
|
||||
className,
|
||||
...other
|
||||
} = props;
|
||||
const icon = indeterminate ? indeterminateIconProp : iconProp;
|
||||
const indeterminateIcon = indeterminate ? indeterminateIconProp : checkedIcon;
|
||||
const ownerState = {
|
||||
...props,
|
||||
disableRipple,
|
||||
color,
|
||||
indeterminate,
|
||||
size
|
||||
};
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
return /*#__PURE__*/_jsx(CheckboxRoot, {
|
||||
type: "checkbox",
|
||||
inputProps: {
|
||||
'data-indeterminate': indeterminate,
|
||||
...inputProps
|
||||
},
|
||||
icon: /*#__PURE__*/React.cloneElement(icon, {
|
||||
fontSize: icon.props.fontSize ?? size
|
||||
}),
|
||||
checkedIcon: /*#__PURE__*/React.cloneElement(indeterminateIcon, {
|
||||
fontSize: indeterminateIcon.props.fontSize ?? size
|
||||
}),
|
||||
ownerState: ownerState,
|
||||
ref: ref,
|
||||
className: clsx(classes.root, className),
|
||||
...other,
|
||||
classes: classes
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? Checkbox.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 component is checked.
|
||||
*/
|
||||
checked: PropTypes.bool,
|
||||
/**
|
||||
* The icon to display when the component is checked.
|
||||
* @default <CheckBoxIcon />
|
||||
*/
|
||||
checkedIcon: PropTypes.node,
|
||||
/**
|
||||
* Override or extend the styles applied to the component.
|
||||
*/
|
||||
classes: PropTypes.object,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className: PropTypes.string,
|
||||
/**
|
||||
* The color of the component.
|
||||
* It supports both default and custom theme colors, which can be added as shown in the
|
||||
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
||||
* @default 'primary'
|
||||
*/
|
||||
color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['default', 'primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),
|
||||
/**
|
||||
* The default checked state. Use when the component is not controlled.
|
||||
*/
|
||||
defaultChecked: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, the component is disabled.
|
||||
* @default false
|
||||
*/
|
||||
disabled: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, the ripple effect is disabled.
|
||||
* @default false
|
||||
*/
|
||||
disableRipple: PropTypes.bool,
|
||||
/**
|
||||
* The icon to display when the component is unchecked.
|
||||
* @default <CheckBoxOutlineBlankIcon />
|
||||
*/
|
||||
icon: PropTypes.node,
|
||||
/**
|
||||
* The id of the `input` element.
|
||||
*/
|
||||
id: PropTypes.string,
|
||||
/**
|
||||
* If `true`, the component appears indeterminate.
|
||||
* This does not set the native input element to indeterminate due
|
||||
* to inconsistent behavior across browsers.
|
||||
* However, we set a `data-indeterminate` attribute on the `input`.
|
||||
* @default false
|
||||
*/
|
||||
indeterminate: PropTypes.bool,
|
||||
/**
|
||||
* The icon to display when the component is indeterminate.
|
||||
* @default <IndeterminateCheckBoxIcon />
|
||||
*/
|
||||
indeterminateIcon: PropTypes.node,
|
||||
/**
|
||||
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
|
||||
*/
|
||||
inputProps: PropTypes.object,
|
||||
/**
|
||||
* Pass a ref to the `input` element.
|
||||
*/
|
||||
inputRef: refType,
|
||||
/**
|
||||
* Callback fired when the state is changed.
|
||||
*
|
||||
* @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
|
||||
* You can pull out the new checked state by accessing `event.target.checked` (boolean).
|
||||
*/
|
||||
onChange: PropTypes.func,
|
||||
/**
|
||||
* If `true`, the `input` element is required.
|
||||
* @default false
|
||||
*/
|
||||
required: PropTypes.bool,
|
||||
/**
|
||||
* The size of the component.
|
||||
* `small` is equivalent to the dense checkbox styling.
|
||||
* @default 'medium'
|
||||
*/
|
||||
size: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['medium', 'small']), PropTypes.string]),
|
||||
/**
|
||||
* 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 value of the component. The DOM API casts this to a string.
|
||||
* The browser uses "on" as the default value.
|
||||
*/
|
||||
value: PropTypes.any
|
||||
} : void 0;
|
||||
export default Checkbox;
|
||||
7
node_modules/@mui/material/modern/Checkbox/checkboxClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/Checkbox/checkboxClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getCheckboxUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiCheckbox', slot);
|
||||
}
|
||||
const checkboxClasses = generateUtilityClasses('MuiCheckbox', ['root', 'checked', 'disabled', 'indeterminate', 'colorPrimary', 'colorSecondary', 'sizeSmall', 'sizeMedium']);
|
||||
export default checkboxClasses;
|
||||
3
node_modules/@mui/material/modern/Checkbox/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/Checkbox/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default } from "./Checkbox.js";
|
||||
export { default as checkboxClasses } from "./checkboxClasses.js";
|
||||
export * from "./checkboxClasses.js";
|
||||
576
node_modules/@mui/material/modern/Chip/Chip.js
generated
vendored
Normal file
576
node_modules/@mui/material/modern/Chip/Chip.js
generated
vendored
Normal file
@@ -0,0 +1,576 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import { alpha } from '@mui/system/colorManipulator';
|
||||
import CancelIcon from "../internal/svg-icons/Cancel.js";
|
||||
import useForkRef from "../utils/useForkRef.js";
|
||||
import unsupportedProp from "../utils/unsupportedProp.js";
|
||||
import capitalize from "../utils/capitalize.js";
|
||||
import ButtonBase from "../ButtonBase/index.js";
|
||||
import { styled } from "../zero-styled/index.js";
|
||||
import memoTheme from "../utils/memoTheme.js";
|
||||
import createSimplePaletteValueFilter from "../utils/createSimplePaletteValueFilter.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import chipClasses, { getChipUtilityClass } from "./chipClasses.js";
|
||||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
classes,
|
||||
disabled,
|
||||
size,
|
||||
color,
|
||||
iconColor,
|
||||
onDelete,
|
||||
clickable,
|
||||
variant
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root', variant, disabled && 'disabled', `size${capitalize(size)}`, `color${capitalize(color)}`, clickable && 'clickable', clickable && `clickableColor${capitalize(color)}`, onDelete && 'deletable', onDelete && `deletableColor${capitalize(color)}`, `${variant}${capitalize(color)}`],
|
||||
label: ['label', `label${capitalize(size)}`],
|
||||
avatar: ['avatar', `avatar${capitalize(size)}`, `avatarColor${capitalize(color)}`],
|
||||
icon: ['icon', `icon${capitalize(size)}`, `iconColor${capitalize(iconColor)}`],
|
||||
deleteIcon: ['deleteIcon', `deleteIcon${capitalize(size)}`, `deleteIconColor${capitalize(color)}`, `deleteIcon${capitalize(variant)}Color${capitalize(color)}`]
|
||||
};
|
||||
return composeClasses(slots, getChipUtilityClass, classes);
|
||||
};
|
||||
const ChipRoot = styled('div', {
|
||||
name: 'MuiChip',
|
||||
slot: 'Root',
|
||||
overridesResolver: (props, styles) => {
|
||||
const {
|
||||
ownerState
|
||||
} = props;
|
||||
const {
|
||||
color,
|
||||
iconColor,
|
||||
clickable,
|
||||
onDelete,
|
||||
size,
|
||||
variant
|
||||
} = ownerState;
|
||||
return [{
|
||||
[`& .${chipClasses.avatar}`]: styles.avatar
|
||||
}, {
|
||||
[`& .${chipClasses.avatar}`]: styles[`avatar${capitalize(size)}`]
|
||||
}, {
|
||||
[`& .${chipClasses.avatar}`]: styles[`avatarColor${capitalize(color)}`]
|
||||
}, {
|
||||
[`& .${chipClasses.icon}`]: styles.icon
|
||||
}, {
|
||||
[`& .${chipClasses.icon}`]: styles[`icon${capitalize(size)}`]
|
||||
}, {
|
||||
[`& .${chipClasses.icon}`]: styles[`iconColor${capitalize(iconColor)}`]
|
||||
}, {
|
||||
[`& .${chipClasses.deleteIcon}`]: styles.deleteIcon
|
||||
}, {
|
||||
[`& .${chipClasses.deleteIcon}`]: styles[`deleteIcon${capitalize(size)}`]
|
||||
}, {
|
||||
[`& .${chipClasses.deleteIcon}`]: styles[`deleteIconColor${capitalize(color)}`]
|
||||
}, {
|
||||
[`& .${chipClasses.deleteIcon}`]: styles[`deleteIcon${capitalize(variant)}Color${capitalize(color)}`]
|
||||
}, styles.root, styles[`size${capitalize(size)}`], styles[`color${capitalize(color)}`], clickable && styles.clickable, clickable && color !== 'default' && styles[`clickableColor${capitalize(color)})`], onDelete && styles.deletable, onDelete && color !== 'default' && styles[`deletableColor${capitalize(color)}`], styles[variant], styles[`${variant}${capitalize(color)}`]];
|
||||
}
|
||||
})(memoTheme(({
|
||||
theme
|
||||
}) => {
|
||||
const textColor = theme.palette.mode === 'light' ? theme.palette.grey[700] : theme.palette.grey[300];
|
||||
return {
|
||||
maxWidth: '100%',
|
||||
fontFamily: theme.typography.fontFamily,
|
||||
fontSize: theme.typography.pxToRem(13),
|
||||
display: 'inline-flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
height: 32,
|
||||
color: (theme.vars || theme).palette.text.primary,
|
||||
backgroundColor: (theme.vars || theme).palette.action.selected,
|
||||
borderRadius: 32 / 2,
|
||||
whiteSpace: 'nowrap',
|
||||
transition: theme.transitions.create(['background-color', 'box-shadow']),
|
||||
// reset cursor explicitly in case ButtonBase is used
|
||||
cursor: 'unset',
|
||||
// We disable the focus ring for mouse, touch and keyboard users.
|
||||
outline: 0,
|
||||
textDecoration: 'none',
|
||||
border: 0,
|
||||
// Remove `button` border
|
||||
padding: 0,
|
||||
// Remove `button` padding
|
||||
verticalAlign: 'middle',
|
||||
boxSizing: 'border-box',
|
||||
[`&.${chipClasses.disabled}`]: {
|
||||
opacity: (theme.vars || theme).palette.action.disabledOpacity,
|
||||
pointerEvents: 'none'
|
||||
},
|
||||
[`& .${chipClasses.avatar}`]: {
|
||||
marginLeft: 5,
|
||||
marginRight: -6,
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: theme.vars ? theme.vars.palette.Chip.defaultAvatarColor : textColor,
|
||||
fontSize: theme.typography.pxToRem(12)
|
||||
},
|
||||
[`& .${chipClasses.avatarColorPrimary}`]: {
|
||||
color: (theme.vars || theme).palette.primary.contrastText,
|
||||
backgroundColor: (theme.vars || theme).palette.primary.dark
|
||||
},
|
||||
[`& .${chipClasses.avatarColorSecondary}`]: {
|
||||
color: (theme.vars || theme).palette.secondary.contrastText,
|
||||
backgroundColor: (theme.vars || theme).palette.secondary.dark
|
||||
},
|
||||
[`& .${chipClasses.avatarSmall}`]: {
|
||||
marginLeft: 4,
|
||||
marginRight: -4,
|
||||
width: 18,
|
||||
height: 18,
|
||||
fontSize: theme.typography.pxToRem(10)
|
||||
},
|
||||
[`& .${chipClasses.icon}`]: {
|
||||
marginLeft: 5,
|
||||
marginRight: -6
|
||||
},
|
||||
[`& .${chipClasses.deleteIcon}`]: {
|
||||
WebkitTapHighlightColor: 'transparent',
|
||||
color: theme.vars ? `rgba(${theme.vars.palette.text.primaryChannel} / 0.26)` : alpha(theme.palette.text.primary, 0.26),
|
||||
fontSize: 22,
|
||||
cursor: 'pointer',
|
||||
margin: '0 5px 0 -6px',
|
||||
'&:hover': {
|
||||
color: theme.vars ? `rgba(${theme.vars.palette.text.primaryChannel} / 0.4)` : alpha(theme.palette.text.primary, 0.4)
|
||||
}
|
||||
},
|
||||
variants: [{
|
||||
props: {
|
||||
size: 'small'
|
||||
},
|
||||
style: {
|
||||
height: 24,
|
||||
[`& .${chipClasses.icon}`]: {
|
||||
fontSize: 18,
|
||||
marginLeft: 4,
|
||||
marginRight: -4
|
||||
},
|
||||
[`& .${chipClasses.deleteIcon}`]: {
|
||||
fontSize: 16,
|
||||
marginRight: 4,
|
||||
marginLeft: -4
|
||||
}
|
||||
}
|
||||
}, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter(['contrastText'])).map(([color]) => {
|
||||
return {
|
||||
props: {
|
||||
color
|
||||
},
|
||||
style: {
|
||||
backgroundColor: (theme.vars || theme).palette[color].main,
|
||||
color: (theme.vars || theme).palette[color].contrastText,
|
||||
[`& .${chipClasses.deleteIcon}`]: {
|
||||
color: theme.vars ? `rgba(${theme.vars.palette[color].contrastTextChannel} / 0.7)` : alpha(theme.palette[color].contrastText, 0.7),
|
||||
'&:hover, &:active': {
|
||||
color: (theme.vars || theme).palette[color].contrastText
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}), {
|
||||
props: props => props.iconColor === props.color,
|
||||
style: {
|
||||
[`& .${chipClasses.icon}`]: {
|
||||
color: theme.vars ? theme.vars.palette.Chip.defaultIconColor : textColor
|
||||
}
|
||||
}
|
||||
}, {
|
||||
props: props => props.iconColor === props.color && props.color !== 'default',
|
||||
style: {
|
||||
[`& .${chipClasses.icon}`]: {
|
||||
color: 'inherit'
|
||||
}
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
onDelete: true
|
||||
},
|
||||
style: {
|
||||
[`&.${chipClasses.focusVisible}`]: {
|
||||
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.selectedChannel} / calc(${theme.vars.palette.action.selectedOpacity} + ${theme.vars.palette.action.focusOpacity}))` : alpha(theme.palette.action.selected, theme.palette.action.selectedOpacity + theme.palette.action.focusOpacity)
|
||||
}
|
||||
}
|
||||
}, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter(['dark'])).map(([color]) => {
|
||||
return {
|
||||
props: {
|
||||
color,
|
||||
onDelete: true
|
||||
},
|
||||
style: {
|
||||
[`&.${chipClasses.focusVisible}`]: {
|
||||
background: (theme.vars || theme).palette[color].dark
|
||||
}
|
||||
}
|
||||
};
|
||||
}), {
|
||||
props: {
|
||||
clickable: true
|
||||
},
|
||||
style: {
|
||||
userSelect: 'none',
|
||||
WebkitTapHighlightColor: 'transparent',
|
||||
cursor: 'pointer',
|
||||
'&:hover': {
|
||||
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.selectedChannel} / calc(${theme.vars.palette.action.selectedOpacity} + ${theme.vars.palette.action.hoverOpacity}))` : alpha(theme.palette.action.selected, theme.palette.action.selectedOpacity + theme.palette.action.hoverOpacity)
|
||||
},
|
||||
[`&.${chipClasses.focusVisible}`]: {
|
||||
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.selectedChannel} / calc(${theme.vars.palette.action.selectedOpacity} + ${theme.vars.palette.action.focusOpacity}))` : alpha(theme.palette.action.selected, theme.palette.action.selectedOpacity + theme.palette.action.focusOpacity)
|
||||
},
|
||||
'&:active': {
|
||||
boxShadow: (theme.vars || theme).shadows[1]
|
||||
}
|
||||
}
|
||||
}, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter(['dark'])).map(([color]) => ({
|
||||
props: {
|
||||
color,
|
||||
clickable: true
|
||||
},
|
||||
style: {
|
||||
[`&:hover, &.${chipClasses.focusVisible}`]: {
|
||||
backgroundColor: (theme.vars || theme).palette[color].dark
|
||||
}
|
||||
}
|
||||
})), {
|
||||
props: {
|
||||
variant: 'outlined'
|
||||
},
|
||||
style: {
|
||||
backgroundColor: 'transparent',
|
||||
border: theme.vars ? `1px solid ${theme.vars.palette.Chip.defaultBorder}` : `1px solid ${theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[700]}`,
|
||||
[`&.${chipClasses.clickable}:hover`]: {
|
||||
backgroundColor: (theme.vars || theme).palette.action.hover
|
||||
},
|
||||
[`&.${chipClasses.focusVisible}`]: {
|
||||
backgroundColor: (theme.vars || theme).palette.action.focus
|
||||
},
|
||||
[`& .${chipClasses.avatar}`]: {
|
||||
marginLeft: 4
|
||||
},
|
||||
[`& .${chipClasses.avatarSmall}`]: {
|
||||
marginLeft: 2
|
||||
},
|
||||
[`& .${chipClasses.icon}`]: {
|
||||
marginLeft: 4
|
||||
},
|
||||
[`& .${chipClasses.iconSmall}`]: {
|
||||
marginLeft: 2
|
||||
},
|
||||
[`& .${chipClasses.deleteIcon}`]: {
|
||||
marginRight: 5
|
||||
},
|
||||
[`& .${chipClasses.deleteIconSmall}`]: {
|
||||
marginRight: 3
|
||||
}
|
||||
}
|
||||
}, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()) // no need to check for mainChannel as it's calculated from main
|
||||
.map(([color]) => ({
|
||||
props: {
|
||||
variant: 'outlined',
|
||||
color
|
||||
},
|
||||
style: {
|
||||
color: (theme.vars || theme).palette[color].main,
|
||||
border: `1px solid ${theme.vars ? `rgba(${theme.vars.palette[color].mainChannel} / 0.7)` : alpha(theme.palette[color].main, 0.7)}`,
|
||||
[`&.${chipClasses.clickable}:hover`]: {
|
||||
backgroundColor: theme.vars ? `rgba(${theme.vars.palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette[color].main, theme.palette.action.hoverOpacity)
|
||||
},
|
||||
[`&.${chipClasses.focusVisible}`]: {
|
||||
backgroundColor: theme.vars ? `rgba(${theme.vars.palette[color].mainChannel} / ${theme.vars.palette.action.focusOpacity})` : alpha(theme.palette[color].main, theme.palette.action.focusOpacity)
|
||||
},
|
||||
[`& .${chipClasses.deleteIcon}`]: {
|
||||
color: theme.vars ? `rgba(${theme.vars.palette[color].mainChannel} / 0.7)` : alpha(theme.palette[color].main, 0.7),
|
||||
'&:hover, &:active': {
|
||||
color: (theme.vars || theme).palette[color].main
|
||||
}
|
||||
}
|
||||
}
|
||||
}))]
|
||||
};
|
||||
}));
|
||||
const ChipLabel = styled('span', {
|
||||
name: 'MuiChip',
|
||||
slot: 'Label',
|
||||
overridesResolver: (props, styles) => {
|
||||
const {
|
||||
ownerState
|
||||
} = props;
|
||||
const {
|
||||
size
|
||||
} = ownerState;
|
||||
return [styles.label, styles[`label${capitalize(size)}`]];
|
||||
}
|
||||
})({
|
||||
overflow: 'hidden',
|
||||
textOverflow: 'ellipsis',
|
||||
paddingLeft: 12,
|
||||
paddingRight: 12,
|
||||
whiteSpace: 'nowrap',
|
||||
variants: [{
|
||||
props: {
|
||||
variant: 'outlined'
|
||||
},
|
||||
style: {
|
||||
paddingLeft: 11,
|
||||
paddingRight: 11
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
size: 'small'
|
||||
},
|
||||
style: {
|
||||
paddingLeft: 8,
|
||||
paddingRight: 8
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
size: 'small',
|
||||
variant: 'outlined'
|
||||
},
|
||||
style: {
|
||||
paddingLeft: 7,
|
||||
paddingRight: 7
|
||||
}
|
||||
}]
|
||||
});
|
||||
function isDeleteKeyboardEvent(keyboardEvent) {
|
||||
return keyboardEvent.key === 'Backspace' || keyboardEvent.key === 'Delete';
|
||||
}
|
||||
|
||||
/**
|
||||
* Chips represent complex entities in small blocks, such as a contact.
|
||||
*/
|
||||
const Chip = /*#__PURE__*/React.forwardRef(function Chip(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiChip'
|
||||
});
|
||||
const {
|
||||
avatar: avatarProp,
|
||||
className,
|
||||
clickable: clickableProp,
|
||||
color = 'default',
|
||||
component: ComponentProp,
|
||||
deleteIcon: deleteIconProp,
|
||||
disabled = false,
|
||||
icon: iconProp,
|
||||
label,
|
||||
onClick,
|
||||
onDelete,
|
||||
onKeyDown,
|
||||
onKeyUp,
|
||||
size = 'medium',
|
||||
variant = 'filled',
|
||||
tabIndex,
|
||||
skipFocusWhenDisabled = false,
|
||||
// TODO v6: Rename to `focusableWhenDisabled`.
|
||||
...other
|
||||
} = props;
|
||||
const chipRef = React.useRef(null);
|
||||
const handleRef = useForkRef(chipRef, ref);
|
||||
const handleDeleteIconClick = event => {
|
||||
// Stop the event from bubbling up to the `Chip`
|
||||
event.stopPropagation();
|
||||
if (onDelete) {
|
||||
onDelete(event);
|
||||
}
|
||||
};
|
||||
const handleKeyDown = event => {
|
||||
// Ignore events from children of `Chip`.
|
||||
if (event.currentTarget === event.target && isDeleteKeyboardEvent(event)) {
|
||||
// Will be handled in keyUp, otherwise some browsers
|
||||
// might init navigation
|
||||
event.preventDefault();
|
||||
}
|
||||
if (onKeyDown) {
|
||||
onKeyDown(event);
|
||||
}
|
||||
};
|
||||
const handleKeyUp = event => {
|
||||
// Ignore events from children of `Chip`.
|
||||
if (event.currentTarget === event.target) {
|
||||
if (onDelete && isDeleteKeyboardEvent(event)) {
|
||||
onDelete(event);
|
||||
}
|
||||
}
|
||||
if (onKeyUp) {
|
||||
onKeyUp(event);
|
||||
}
|
||||
};
|
||||
const clickable = clickableProp !== false && onClick ? true : clickableProp;
|
||||
const component = clickable || onDelete ? ButtonBase : ComponentProp || 'div';
|
||||
const ownerState = {
|
||||
...props,
|
||||
component,
|
||||
disabled,
|
||||
size,
|
||||
color,
|
||||
iconColor: /*#__PURE__*/React.isValidElement(iconProp) ? iconProp.props.color || color : color,
|
||||
onDelete: !!onDelete,
|
||||
clickable,
|
||||
variant
|
||||
};
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
const moreProps = component === ButtonBase ? {
|
||||
component: ComponentProp || 'div',
|
||||
focusVisibleClassName: classes.focusVisible,
|
||||
...(onDelete && {
|
||||
disableRipple: true
|
||||
})
|
||||
} : {};
|
||||
let deleteIcon = null;
|
||||
if (onDelete) {
|
||||
deleteIcon = deleteIconProp && /*#__PURE__*/React.isValidElement(deleteIconProp) ? (/*#__PURE__*/React.cloneElement(deleteIconProp, {
|
||||
className: clsx(deleteIconProp.props.className, classes.deleteIcon),
|
||||
onClick: handleDeleteIconClick
|
||||
})) : /*#__PURE__*/_jsx(CancelIcon, {
|
||||
className: clsx(classes.deleteIcon),
|
||||
onClick: handleDeleteIconClick
|
||||
});
|
||||
}
|
||||
let avatar = null;
|
||||
if (avatarProp && /*#__PURE__*/React.isValidElement(avatarProp)) {
|
||||
avatar = /*#__PURE__*/React.cloneElement(avatarProp, {
|
||||
className: clsx(classes.avatar, avatarProp.props.className)
|
||||
});
|
||||
}
|
||||
let icon = null;
|
||||
if (iconProp && /*#__PURE__*/React.isValidElement(iconProp)) {
|
||||
icon = /*#__PURE__*/React.cloneElement(iconProp, {
|
||||
className: clsx(classes.icon, iconProp.props.className)
|
||||
});
|
||||
}
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (avatar && icon) {
|
||||
console.error('MUI: The Chip component can not handle the avatar ' + 'and the icon prop at the same time. Pick one.');
|
||||
}
|
||||
}
|
||||
return /*#__PURE__*/_jsxs(ChipRoot, {
|
||||
as: component,
|
||||
className: clsx(classes.root, className),
|
||||
disabled: clickable && disabled ? true : undefined,
|
||||
onClick: onClick,
|
||||
onKeyDown: handleKeyDown,
|
||||
onKeyUp: handleKeyUp,
|
||||
ref: handleRef,
|
||||
tabIndex: skipFocusWhenDisabled && disabled ? -1 : tabIndex,
|
||||
ownerState: ownerState,
|
||||
...moreProps,
|
||||
...other,
|
||||
children: [avatar || icon, /*#__PURE__*/_jsx(ChipLabel, {
|
||||
className: clsx(classes.label),
|
||||
ownerState: ownerState,
|
||||
children: label
|
||||
}), deleteIcon]
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? Chip.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 Avatar element to display.
|
||||
*/
|
||||
avatar: PropTypes.element,
|
||||
/**
|
||||
* This prop isn't supported.
|
||||
* Use the `component` prop if you need to change the children structure.
|
||||
*/
|
||||
children: unsupportedProp,
|
||||
/**
|
||||
* Override or extend the styles applied to the component.
|
||||
*/
|
||||
classes: PropTypes.object,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className: PropTypes.string,
|
||||
/**
|
||||
* If `true`, the chip will appear clickable, and will raise when pressed,
|
||||
* even if the onClick prop is not defined.
|
||||
* If `false`, the chip will not appear clickable, even if onClick prop is defined.
|
||||
* This can be used, for example,
|
||||
* along with the component prop to indicate an anchor Chip is clickable.
|
||||
* Note: this controls the UI and does not affect the onClick event.
|
||||
*/
|
||||
clickable: PropTypes.bool,
|
||||
/**
|
||||
* The color of the component.
|
||||
* It supports both default and custom theme colors, which can be added as shown in the
|
||||
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
||||
* @default 'default'
|
||||
*/
|
||||
color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['default', 'primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),
|
||||
/**
|
||||
* The component used for the root node.
|
||||
* Either a string to use a HTML element or a component.
|
||||
*/
|
||||
component: PropTypes.elementType,
|
||||
/**
|
||||
* Override the default delete icon element. Shown only if `onDelete` is set.
|
||||
*/
|
||||
deleteIcon: PropTypes.element,
|
||||
/**
|
||||
* If `true`, the component is disabled.
|
||||
* @default false
|
||||
*/
|
||||
disabled: PropTypes.bool,
|
||||
/**
|
||||
* Icon element.
|
||||
*/
|
||||
icon: PropTypes.element,
|
||||
/**
|
||||
* The content of the component.
|
||||
*/
|
||||
label: PropTypes.node,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onClick: PropTypes.func,
|
||||
/**
|
||||
* Callback fired when the delete icon is clicked.
|
||||
* If set, the delete icon will be shown.
|
||||
*/
|
||||
onDelete: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onKeyDown: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onKeyUp: PropTypes.func,
|
||||
/**
|
||||
* The size of the component.
|
||||
* @default 'medium'
|
||||
*/
|
||||
size: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['medium', 'small']), PropTypes.string]),
|
||||
/**
|
||||
* If `true`, allows the disabled chip to escape focus.
|
||||
* If `false`, allows the disabled chip to receive focus.
|
||||
* @default false
|
||||
*/
|
||||
skipFocusWhenDisabled: 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]),
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
tabIndex: PropTypes.number,
|
||||
/**
|
||||
* The variant to use.
|
||||
* @default 'filled'
|
||||
*/
|
||||
variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['filled', 'outlined']), PropTypes.string])
|
||||
} : void 0;
|
||||
export default Chip;
|
||||
7
node_modules/@mui/material/modern/Chip/chipClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/Chip/chipClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getChipUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiChip', slot);
|
||||
}
|
||||
const chipClasses = generateUtilityClasses('MuiChip', ['root', 'sizeSmall', 'sizeMedium', 'colorDefault', 'colorError', 'colorInfo', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorWarning', 'disabled', 'clickable', 'clickableColorPrimary', 'clickableColorSecondary', 'deletable', 'deletableColorPrimary', 'deletableColorSecondary', 'outlined', 'filled', 'outlinedPrimary', 'outlinedSecondary', 'filledPrimary', 'filledSecondary', 'avatar', 'avatarSmall', 'avatarMedium', 'avatarColorPrimary', 'avatarColorSecondary', 'icon', 'iconSmall', 'iconMedium', 'iconColorPrimary', 'iconColorSecondary', 'label', 'labelSmall', 'labelMedium', 'deleteIcon', 'deleteIconSmall', 'deleteIconMedium', 'deleteIconColorPrimary', 'deleteIconColorSecondary', 'deleteIconOutlinedColorPrimary', 'deleteIconOutlinedColorSecondary', 'deleteIconFilledColorPrimary', 'deleteIconFilledColorSecondary', 'focusVisible']);
|
||||
export default chipClasses;
|
||||
3
node_modules/@mui/material/modern/Chip/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/Chip/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default } from "./Chip.js";
|
||||
export { default as chipClasses } from "./chipClasses.js";
|
||||
export * from "./chipClasses.js";
|
||||
285
node_modules/@mui/material/modern/CircularProgress/CircularProgress.js
generated
vendored
Normal file
285
node_modules/@mui/material/modern/CircularProgress/CircularProgress.js
generated
vendored
Normal file
@@ -0,0 +1,285 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import chainPropTypes from '@mui/utils/chainPropTypes';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import { keyframes, css, styled } from "../zero-styled/index.js";
|
||||
import memoTheme from "../utils/memoTheme.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import capitalize from "../utils/capitalize.js";
|
||||
import createSimplePaletteValueFilter from "../utils/createSimplePaletteValueFilter.js";
|
||||
import { getCircularProgressUtilityClass } from "./circularProgressClasses.js";
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
const SIZE = 44;
|
||||
const circularRotateKeyframe = keyframes`
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
`;
|
||||
const circularDashKeyframe = keyframes`
|
||||
0% {
|
||||
stroke-dasharray: 1px, 200px;
|
||||
stroke-dashoffset: 0;
|
||||
}
|
||||
|
||||
50% {
|
||||
stroke-dasharray: 100px, 200px;
|
||||
stroke-dashoffset: -15px;
|
||||
}
|
||||
|
||||
100% {
|
||||
stroke-dasharray: 100px, 200px;
|
||||
stroke-dashoffset: -125px;
|
||||
}
|
||||
`;
|
||||
|
||||
// This implementation is for supporting both Styled-components v4+ and Pigment CSS.
|
||||
// A global animation has to be created here for Styled-components v4+ (https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#12).
|
||||
// which can be done by checking typeof indeterminate1Keyframe !== 'string' (at runtime, Pigment CSS transform keyframes`` to a string).
|
||||
const rotateAnimation = typeof circularRotateKeyframe !== 'string' ? css`
|
||||
animation: ${circularRotateKeyframe} 1.4s linear infinite;
|
||||
` : null;
|
||||
const dashAnimation = typeof circularDashKeyframe !== 'string' ? css`
|
||||
animation: ${circularDashKeyframe} 1.4s ease-in-out infinite;
|
||||
` : null;
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
classes,
|
||||
variant,
|
||||
color,
|
||||
disableShrink
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root', variant, `color${capitalize(color)}`],
|
||||
svg: ['svg'],
|
||||
circle: ['circle', `circle${capitalize(variant)}`, disableShrink && 'circleDisableShrink']
|
||||
};
|
||||
return composeClasses(slots, getCircularProgressUtilityClass, classes);
|
||||
};
|
||||
const CircularProgressRoot = styled('span', {
|
||||
name: 'MuiCircularProgress',
|
||||
slot: 'Root',
|
||||
overridesResolver: (props, styles) => {
|
||||
const {
|
||||
ownerState
|
||||
} = props;
|
||||
return [styles.root, styles[ownerState.variant], styles[`color${capitalize(ownerState.color)}`]];
|
||||
}
|
||||
})(memoTheme(({
|
||||
theme
|
||||
}) => ({
|
||||
display: 'inline-block',
|
||||
variants: [{
|
||||
props: {
|
||||
variant: 'determinate'
|
||||
},
|
||||
style: {
|
||||
transition: theme.transitions.create('transform')
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
variant: 'indeterminate'
|
||||
},
|
||||
style: rotateAnimation || {
|
||||
animation: `${circularRotateKeyframe} 1.4s linear infinite`
|
||||
}
|
||||
}, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color]) => ({
|
||||
props: {
|
||||
color
|
||||
},
|
||||
style: {
|
||||
color: (theme.vars || theme).palette[color].main
|
||||
}
|
||||
}))]
|
||||
})));
|
||||
const CircularProgressSVG = styled('svg', {
|
||||
name: 'MuiCircularProgress',
|
||||
slot: 'Svg',
|
||||
overridesResolver: (props, styles) => styles.svg
|
||||
})({
|
||||
display: 'block' // Keeps the progress centered
|
||||
});
|
||||
const CircularProgressCircle = styled('circle', {
|
||||
name: 'MuiCircularProgress',
|
||||
slot: 'Circle',
|
||||
overridesResolver: (props, styles) => {
|
||||
const {
|
||||
ownerState
|
||||
} = props;
|
||||
return [styles.circle, styles[`circle${capitalize(ownerState.variant)}`], ownerState.disableShrink && styles.circleDisableShrink];
|
||||
}
|
||||
})(memoTheme(({
|
||||
theme
|
||||
}) => ({
|
||||
stroke: 'currentColor',
|
||||
variants: [{
|
||||
props: {
|
||||
variant: 'determinate'
|
||||
},
|
||||
style: {
|
||||
transition: theme.transitions.create('stroke-dashoffset')
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
variant: 'indeterminate'
|
||||
},
|
||||
style: {
|
||||
// Some default value that looks fine waiting for the animation to kicks in.
|
||||
strokeDasharray: '80px, 200px',
|
||||
strokeDashoffset: 0 // Add the unit to fix a Edge 16 and below bug.
|
||||
}
|
||||
}, {
|
||||
props: ({
|
||||
ownerState
|
||||
}) => ownerState.variant === 'indeterminate' && !ownerState.disableShrink,
|
||||
style: dashAnimation || {
|
||||
// At runtime for Pigment CSS, `bufferAnimation` will be null and the generated keyframe will be used.
|
||||
animation: `${circularDashKeyframe} 1.4s ease-in-out infinite`
|
||||
}
|
||||
}]
|
||||
})));
|
||||
|
||||
/**
|
||||
* ## ARIA
|
||||
*
|
||||
* If the progress bar is describing the loading progress of a particular region of a page,
|
||||
* you should use `aria-describedby` to point to the progress bar, and set the `aria-busy`
|
||||
* attribute to `true` on that region until it has finished loading.
|
||||
*/
|
||||
const CircularProgress = /*#__PURE__*/React.forwardRef(function CircularProgress(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiCircularProgress'
|
||||
});
|
||||
const {
|
||||
className,
|
||||
color = 'primary',
|
||||
disableShrink = false,
|
||||
size = 40,
|
||||
style,
|
||||
thickness = 3.6,
|
||||
value = 0,
|
||||
variant = 'indeterminate',
|
||||
...other
|
||||
} = props;
|
||||
const ownerState = {
|
||||
...props,
|
||||
color,
|
||||
disableShrink,
|
||||
size,
|
||||
thickness,
|
||||
value,
|
||||
variant
|
||||
};
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
const circleStyle = {};
|
||||
const rootStyle = {};
|
||||
const rootProps = {};
|
||||
if (variant === 'determinate') {
|
||||
const circumference = 2 * Math.PI * ((SIZE - thickness) / 2);
|
||||
circleStyle.strokeDasharray = circumference.toFixed(3);
|
||||
rootProps['aria-valuenow'] = Math.round(value);
|
||||
circleStyle.strokeDashoffset = `${((100 - value) / 100 * circumference).toFixed(3)}px`;
|
||||
rootStyle.transform = 'rotate(-90deg)';
|
||||
}
|
||||
return /*#__PURE__*/_jsx(CircularProgressRoot, {
|
||||
className: clsx(classes.root, className),
|
||||
style: {
|
||||
width: size,
|
||||
height: size,
|
||||
...rootStyle,
|
||||
...style
|
||||
},
|
||||
ownerState: ownerState,
|
||||
ref: ref,
|
||||
role: "progressbar",
|
||||
...rootProps,
|
||||
...other,
|
||||
children: /*#__PURE__*/_jsx(CircularProgressSVG, {
|
||||
className: classes.svg,
|
||||
ownerState: ownerState,
|
||||
viewBox: `${SIZE / 2} ${SIZE / 2} ${SIZE} ${SIZE}`,
|
||||
children: /*#__PURE__*/_jsx(CircularProgressCircle, {
|
||||
className: classes.circle,
|
||||
style: circleStyle,
|
||||
ownerState: ownerState,
|
||||
cx: SIZE,
|
||||
cy: SIZE,
|
||||
r: (SIZE - thickness) / 2,
|
||||
fill: "none",
|
||||
strokeWidth: thickness
|
||||
})
|
||||
})
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? CircularProgress.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`. │
|
||||
// └─────────────────────────────────────────────────────────────────────┘
|
||||
/**
|
||||
* Override or extend the styles applied to the component.
|
||||
*/
|
||||
classes: PropTypes.object,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className: PropTypes.string,
|
||||
/**
|
||||
* The color of the component.
|
||||
* It supports both default and custom theme colors, which can be added as shown in the
|
||||
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
||||
* @default 'primary'
|
||||
*/
|
||||
color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['inherit', 'primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),
|
||||
/**
|
||||
* If `true`, the shrink animation is disabled.
|
||||
* This only works if variant is `indeterminate`.
|
||||
* @default false
|
||||
*/
|
||||
disableShrink: chainPropTypes(PropTypes.bool, props => {
|
||||
if (props.disableShrink && props.variant && props.variant !== 'indeterminate') {
|
||||
return new Error('MUI: You have provided the `disableShrink` prop ' + 'with a variant other than `indeterminate`. This will have no effect.');
|
||||
}
|
||||
return null;
|
||||
}),
|
||||
/**
|
||||
* The size of the component.
|
||||
* If using a number, the pixel unit is assumed.
|
||||
* If using a string, you need to provide the CSS unit, for example '3rem'.
|
||||
* @default 40
|
||||
*/
|
||||
size: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
||||
/**
|
||||
* @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]),
|
||||
/**
|
||||
* The thickness of the circle.
|
||||
* @default 3.6
|
||||
*/
|
||||
thickness: PropTypes.number,
|
||||
/**
|
||||
* The value of the progress indicator for the determinate variant.
|
||||
* Value between 0 and 100.
|
||||
* @default 0
|
||||
*/
|
||||
value: PropTypes.number,
|
||||
/**
|
||||
* The variant to use.
|
||||
* Use indeterminate when there is no progress value.
|
||||
* @default 'indeterminate'
|
||||
*/
|
||||
variant: PropTypes.oneOf(['determinate', 'indeterminate'])
|
||||
} : void 0;
|
||||
export default CircularProgress;
|
||||
7
node_modules/@mui/material/modern/CircularProgress/circularProgressClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/CircularProgress/circularProgressClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getCircularProgressUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiCircularProgress', slot);
|
||||
}
|
||||
const circularProgressClasses = generateUtilityClasses('MuiCircularProgress', ['root', 'determinate', 'indeterminate', 'colorPrimary', 'colorSecondary', 'svg', 'circle', 'circleDeterminate', 'circleIndeterminate', 'circleDisableShrink']);
|
||||
export default circularProgressClasses;
|
||||
3
node_modules/@mui/material/modern/CircularProgress/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/CircularProgress/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default } from "./CircularProgress.js";
|
||||
export { default as circularProgressClasses } from "./circularProgressClasses.js";
|
||||
export * from "./circularProgressClasses.js";
|
||||
177
node_modules/@mui/material/modern/ClickAwayListener/ClickAwayListener.js
generated
vendored
Normal file
177
node_modules/@mui/material/modern/ClickAwayListener/ClickAwayListener.js
generated
vendored
Normal file
@@ -0,0 +1,177 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { elementAcceptingRef, exactProp, unstable_ownerDocument as ownerDocument, unstable_useForkRef as useForkRef, unstable_useEventCallback as useEventCallback } from '@mui/utils';
|
||||
import getReactNodeRef from '@mui/utils/getReactNodeRef';
|
||||
|
||||
// TODO: return `EventHandlerName extends `on${infer EventName}` ? Lowercase<EventName> : never` once generatePropTypes runs with TS 4.1
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
function mapEventPropToEvent(eventProp) {
|
||||
return eventProp.substring(2).toLowerCase();
|
||||
}
|
||||
function clickedRootScrollbar(event, doc) {
|
||||
return doc.documentElement.clientWidth < event.clientX || doc.documentElement.clientHeight < event.clientY;
|
||||
}
|
||||
/**
|
||||
* Listen for click events that occur somewhere in the document, outside of the element itself.
|
||||
* For instance, if you need to hide a menu when people click anywhere else on your page.
|
||||
*
|
||||
* Demos:
|
||||
*
|
||||
* - [Click-Away Listener](https://mui.com/material-ui/react-click-away-listener/)
|
||||
* - [Menu](https://mui.com/material-ui/react-menu/)
|
||||
*
|
||||
* API:
|
||||
*
|
||||
* - [ClickAwayListener API](https://mui.com/material-ui/api/click-away-listener/)
|
||||
*/
|
||||
function ClickAwayListener(props) {
|
||||
const {
|
||||
children,
|
||||
disableReactTree = false,
|
||||
mouseEvent = 'onClick',
|
||||
onClickAway,
|
||||
touchEvent = 'onTouchEnd'
|
||||
} = props;
|
||||
const movedRef = React.useRef(false);
|
||||
const nodeRef = React.useRef(null);
|
||||
const activatedRef = React.useRef(false);
|
||||
const syntheticEventRef = React.useRef(false);
|
||||
React.useEffect(() => {
|
||||
// Ensure that this component is not "activated" synchronously.
|
||||
// https://github.com/facebook/react/issues/20074
|
||||
setTimeout(() => {
|
||||
activatedRef.current = true;
|
||||
}, 0);
|
||||
return () => {
|
||||
activatedRef.current = false;
|
||||
};
|
||||
}, []);
|
||||
const handleRef = useForkRef(getReactNodeRef(children), nodeRef);
|
||||
|
||||
// The handler doesn't take event.defaultPrevented into account:
|
||||
//
|
||||
// event.preventDefault() is meant to stop default behaviors like
|
||||
// clicking a checkbox to check it, hitting a button to submit a form,
|
||||
// and hitting left arrow to move the cursor in a text input etc.
|
||||
// Only special HTML elements have these default behaviors.
|
||||
const handleClickAway = useEventCallback(event => {
|
||||
// Given developers can stop the propagation of the synthetic event,
|
||||
// we can only be confident with a positive value.
|
||||
const insideReactTree = syntheticEventRef.current;
|
||||
syntheticEventRef.current = false;
|
||||
const doc = ownerDocument(nodeRef.current);
|
||||
|
||||
// 1. IE11 support, which trigger the handleClickAway even after the unbind
|
||||
// 2. The child might render null.
|
||||
// 3. Behave like a blur listener.
|
||||
if (!activatedRef.current || !nodeRef.current || 'clientX' in event && clickedRootScrollbar(event, doc)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Do not act if user performed touchmove
|
||||
if (movedRef.current) {
|
||||
movedRef.current = false;
|
||||
return;
|
||||
}
|
||||
let insideDOM;
|
||||
|
||||
// If not enough, can use https://github.com/DieterHolvoet/event-propagation-path/blob/master/propagationPath.js
|
||||
if (event.composedPath) {
|
||||
insideDOM = event.composedPath().indexOf(nodeRef.current) > -1;
|
||||
} else {
|
||||
insideDOM = !doc.documentElement.contains(
|
||||
// @ts-expect-error returns `false` as intended when not dispatched from a Node
|
||||
event.target) || nodeRef.current.contains(
|
||||
// @ts-expect-error returns `false` as intended when not dispatched from a Node
|
||||
event.target);
|
||||
}
|
||||
if (!insideDOM && (disableReactTree || !insideReactTree)) {
|
||||
onClickAway(event);
|
||||
}
|
||||
});
|
||||
|
||||
// Keep track of mouse/touch events that bubbled up through the portal.
|
||||
const createHandleSynthetic = handlerName => event => {
|
||||
syntheticEventRef.current = true;
|
||||
const childrenPropsHandler = children.props[handlerName];
|
||||
if (childrenPropsHandler) {
|
||||
childrenPropsHandler(event);
|
||||
}
|
||||
};
|
||||
const childrenProps = {
|
||||
ref: handleRef
|
||||
};
|
||||
if (touchEvent !== false) {
|
||||
childrenProps[touchEvent] = createHandleSynthetic(touchEvent);
|
||||
}
|
||||
React.useEffect(() => {
|
||||
if (touchEvent !== false) {
|
||||
const mappedTouchEvent = mapEventPropToEvent(touchEvent);
|
||||
const doc = ownerDocument(nodeRef.current);
|
||||
const handleTouchMove = () => {
|
||||
movedRef.current = true;
|
||||
};
|
||||
doc.addEventListener(mappedTouchEvent, handleClickAway);
|
||||
doc.addEventListener('touchmove', handleTouchMove);
|
||||
return () => {
|
||||
doc.removeEventListener(mappedTouchEvent, handleClickAway);
|
||||
doc.removeEventListener('touchmove', handleTouchMove);
|
||||
};
|
||||
}
|
||||
return undefined;
|
||||
}, [handleClickAway, touchEvent]);
|
||||
if (mouseEvent !== false) {
|
||||
childrenProps[mouseEvent] = createHandleSynthetic(mouseEvent);
|
||||
}
|
||||
React.useEffect(() => {
|
||||
if (mouseEvent !== false) {
|
||||
const mappedMouseEvent = mapEventPropToEvent(mouseEvent);
|
||||
const doc = ownerDocument(nodeRef.current);
|
||||
doc.addEventListener(mappedMouseEvent, handleClickAway);
|
||||
return () => {
|
||||
doc.removeEventListener(mappedMouseEvent, handleClickAway);
|
||||
};
|
||||
}
|
||||
return undefined;
|
||||
}, [handleClickAway, mouseEvent]);
|
||||
return /*#__PURE__*/_jsx(React.Fragment, {
|
||||
children: /*#__PURE__*/React.cloneElement(children, childrenProps)
|
||||
});
|
||||
}
|
||||
process.env.NODE_ENV !== "production" ? ClickAwayListener.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 wrapped element.
|
||||
*/
|
||||
children: elementAcceptingRef.isRequired,
|
||||
/**
|
||||
* If `true`, the React tree is ignored and only the DOM tree is considered.
|
||||
* This prop changes how portaled elements are handled.
|
||||
* @default false
|
||||
*/
|
||||
disableReactTree: PropTypes.bool,
|
||||
/**
|
||||
* The mouse event to listen to. You can disable the listener by providing `false`.
|
||||
* @default 'onClick'
|
||||
*/
|
||||
mouseEvent: PropTypes.oneOf(['onClick', 'onMouseDown', 'onMouseUp', 'onPointerDown', 'onPointerUp', false]),
|
||||
/**
|
||||
* Callback fired when a "click away" event is detected.
|
||||
*/
|
||||
onClickAway: PropTypes.func.isRequired,
|
||||
/**
|
||||
* The touch event to listen to. You can disable the listener by providing `false`.
|
||||
* @default 'onTouchEnd'
|
||||
*/
|
||||
touchEvent: PropTypes.oneOf(['onTouchEnd', 'onTouchStart', false])
|
||||
} : void 0;
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
// eslint-disable-next-line
|
||||
ClickAwayListener['propTypes' + ''] = exactProp(ClickAwayListener.propTypes);
|
||||
}
|
||||
export { ClickAwayListener };
|
||||
1
node_modules/@mui/material/modern/ClickAwayListener/index.js
generated
vendored
Normal file
1
node_modules/@mui/material/modern/ClickAwayListener/index.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export { ClickAwayListener as default } from "./ClickAwayListener.js";
|
||||
410
node_modules/@mui/material/modern/Collapse/Collapse.js
generated
vendored
Normal file
410
node_modules/@mui/material/modern/Collapse/Collapse.js
generated
vendored
Normal file
@@ -0,0 +1,410 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import clsx from 'clsx';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Transition } from 'react-transition-group';
|
||||
import useTimeout from '@mui/utils/useTimeout';
|
||||
import elementTypeAcceptingRef from '@mui/utils/elementTypeAcceptingRef';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import { styled, useTheme } from "../zero-styled/index.js";
|
||||
import memoTheme from "../utils/memoTheme.js";
|
||||
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
||||
import { duration } from "../styles/createTransitions.js";
|
||||
import { getTransitionProps } from "../transitions/utils.js";
|
||||
import { useForkRef } from "../utils/index.js";
|
||||
import { getCollapseUtilityClass } from "./collapseClasses.js";
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
orientation,
|
||||
classes
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root', `${orientation}`],
|
||||
entered: ['entered'],
|
||||
hidden: ['hidden'],
|
||||
wrapper: ['wrapper', `${orientation}`],
|
||||
wrapperInner: ['wrapperInner', `${orientation}`]
|
||||
};
|
||||
return composeClasses(slots, getCollapseUtilityClass, classes);
|
||||
};
|
||||
const CollapseRoot = styled('div', {
|
||||
name: 'MuiCollapse',
|
||||
slot: 'Root',
|
||||
overridesResolver: (props, styles) => {
|
||||
const {
|
||||
ownerState
|
||||
} = props;
|
||||
return [styles.root, styles[ownerState.orientation], ownerState.state === 'entered' && styles.entered, ownerState.state === 'exited' && !ownerState.in && ownerState.collapsedSize === '0px' && styles.hidden];
|
||||
}
|
||||
})(memoTheme(({
|
||||
theme
|
||||
}) => ({
|
||||
height: 0,
|
||||
overflow: 'hidden',
|
||||
transition: theme.transitions.create('height'),
|
||||
variants: [{
|
||||
props: {
|
||||
orientation: 'horizontal'
|
||||
},
|
||||
style: {
|
||||
height: 'auto',
|
||||
width: 0,
|
||||
transition: theme.transitions.create('width')
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
state: 'entered'
|
||||
},
|
||||
style: {
|
||||
height: 'auto',
|
||||
overflow: 'visible'
|
||||
}
|
||||
}, {
|
||||
props: {
|
||||
state: 'entered',
|
||||
orientation: 'horizontal'
|
||||
},
|
||||
style: {
|
||||
width: 'auto'
|
||||
}
|
||||
}, {
|
||||
props: ({
|
||||
ownerState
|
||||
}) => ownerState.state === 'exited' && !ownerState.in && ownerState.collapsedSize === '0px',
|
||||
style: {
|
||||
visibility: 'hidden'
|
||||
}
|
||||
}]
|
||||
})));
|
||||
const CollapseWrapper = styled('div', {
|
||||
name: 'MuiCollapse',
|
||||
slot: 'Wrapper',
|
||||
overridesResolver: (props, styles) => styles.wrapper
|
||||
})({
|
||||
// Hack to get children with a negative margin to not falsify the height computation.
|
||||
display: 'flex',
|
||||
width: '100%',
|
||||
variants: [{
|
||||
props: {
|
||||
orientation: 'horizontal'
|
||||
},
|
||||
style: {
|
||||
width: 'auto',
|
||||
height: '100%'
|
||||
}
|
||||
}]
|
||||
});
|
||||
const CollapseWrapperInner = styled('div', {
|
||||
name: 'MuiCollapse',
|
||||
slot: 'WrapperInner',
|
||||
overridesResolver: (props, styles) => styles.wrapperInner
|
||||
})({
|
||||
width: '100%',
|
||||
variants: [{
|
||||
props: {
|
||||
orientation: 'horizontal'
|
||||
},
|
||||
style: {
|
||||
width: 'auto',
|
||||
height: '100%'
|
||||
}
|
||||
}]
|
||||
});
|
||||
|
||||
/**
|
||||
* The Collapse transition is used by the
|
||||
* [Vertical Stepper](/material-ui/react-stepper/#vertical-stepper) StepContent component.
|
||||
* It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
|
||||
*/
|
||||
const Collapse = /*#__PURE__*/React.forwardRef(function Collapse(inProps, ref) {
|
||||
const props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiCollapse'
|
||||
});
|
||||
const {
|
||||
addEndListener,
|
||||
children,
|
||||
className,
|
||||
collapsedSize: collapsedSizeProp = '0px',
|
||||
component,
|
||||
easing,
|
||||
in: inProp,
|
||||
onEnter,
|
||||
onEntered,
|
||||
onEntering,
|
||||
onExit,
|
||||
onExited,
|
||||
onExiting,
|
||||
orientation = 'vertical',
|
||||
style,
|
||||
timeout = duration.standard,
|
||||
// eslint-disable-next-line react/prop-types
|
||||
TransitionComponent = Transition,
|
||||
...other
|
||||
} = props;
|
||||
const ownerState = {
|
||||
...props,
|
||||
orientation,
|
||||
collapsedSize: collapsedSizeProp
|
||||
};
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
const theme = useTheme();
|
||||
const timer = useTimeout();
|
||||
const wrapperRef = React.useRef(null);
|
||||
const autoTransitionDuration = React.useRef();
|
||||
const collapsedSize = typeof collapsedSizeProp === 'number' ? `${collapsedSizeProp}px` : collapsedSizeProp;
|
||||
const isHorizontal = orientation === 'horizontal';
|
||||
const size = isHorizontal ? 'width' : 'height';
|
||||
const nodeRef = React.useRef(null);
|
||||
const handleRef = useForkRef(ref, nodeRef);
|
||||
const normalizedTransitionCallback = callback => maybeIsAppearing => {
|
||||
if (callback) {
|
||||
const node = nodeRef.current;
|
||||
|
||||
// onEnterXxx and onExitXxx callbacks have a different arguments.length value.
|
||||
if (maybeIsAppearing === undefined) {
|
||||
callback(node);
|
||||
} else {
|
||||
callback(node, maybeIsAppearing);
|
||||
}
|
||||
}
|
||||
};
|
||||
const getWrapperSize = () => wrapperRef.current ? wrapperRef.current[isHorizontal ? 'clientWidth' : 'clientHeight'] : 0;
|
||||
const handleEnter = normalizedTransitionCallback((node, isAppearing) => {
|
||||
if (wrapperRef.current && isHorizontal) {
|
||||
// Set absolute position to get the size of collapsed content
|
||||
wrapperRef.current.style.position = 'absolute';
|
||||
}
|
||||
node.style[size] = collapsedSize;
|
||||
if (onEnter) {
|
||||
onEnter(node, isAppearing);
|
||||
}
|
||||
});
|
||||
const handleEntering = normalizedTransitionCallback((node, isAppearing) => {
|
||||
const wrapperSize = getWrapperSize();
|
||||
if (wrapperRef.current && isHorizontal) {
|
||||
// After the size is read reset the position back to default
|
||||
wrapperRef.current.style.position = '';
|
||||
}
|
||||
const {
|
||||
duration: transitionDuration,
|
||||
easing: transitionTimingFunction
|
||||
} = getTransitionProps({
|
||||
style,
|
||||
timeout,
|
||||
easing
|
||||
}, {
|
||||
mode: 'enter'
|
||||
});
|
||||
if (timeout === 'auto') {
|
||||
const duration2 = theme.transitions.getAutoHeightDuration(wrapperSize);
|
||||
node.style.transitionDuration = `${duration2}ms`;
|
||||
autoTransitionDuration.current = duration2;
|
||||
} else {
|
||||
node.style.transitionDuration = typeof transitionDuration === 'string' ? transitionDuration : `${transitionDuration}ms`;
|
||||
}
|
||||
node.style[size] = `${wrapperSize}px`;
|
||||
node.style.transitionTimingFunction = transitionTimingFunction;
|
||||
if (onEntering) {
|
||||
onEntering(node, isAppearing);
|
||||
}
|
||||
});
|
||||
const handleEntered = normalizedTransitionCallback((node, isAppearing) => {
|
||||
node.style[size] = 'auto';
|
||||
if (onEntered) {
|
||||
onEntered(node, isAppearing);
|
||||
}
|
||||
});
|
||||
const handleExit = normalizedTransitionCallback(node => {
|
||||
node.style[size] = `${getWrapperSize()}px`;
|
||||
if (onExit) {
|
||||
onExit(node);
|
||||
}
|
||||
});
|
||||
const handleExited = normalizedTransitionCallback(onExited);
|
||||
const handleExiting = normalizedTransitionCallback(node => {
|
||||
const wrapperSize = getWrapperSize();
|
||||
const {
|
||||
duration: transitionDuration,
|
||||
easing: transitionTimingFunction
|
||||
} = getTransitionProps({
|
||||
style,
|
||||
timeout,
|
||||
easing
|
||||
}, {
|
||||
mode: 'exit'
|
||||
});
|
||||
if (timeout === 'auto') {
|
||||
// TODO: rename getAutoHeightDuration to something more generic (width support)
|
||||
// Actually it just calculates animation duration based on size
|
||||
const duration2 = theme.transitions.getAutoHeightDuration(wrapperSize);
|
||||
node.style.transitionDuration = `${duration2}ms`;
|
||||
autoTransitionDuration.current = duration2;
|
||||
} else {
|
||||
node.style.transitionDuration = typeof transitionDuration === 'string' ? transitionDuration : `${transitionDuration}ms`;
|
||||
}
|
||||
node.style[size] = collapsedSize;
|
||||
node.style.transitionTimingFunction = transitionTimingFunction;
|
||||
if (onExiting) {
|
||||
onExiting(node);
|
||||
}
|
||||
});
|
||||
const handleAddEndListener = next => {
|
||||
if (timeout === 'auto') {
|
||||
timer.start(autoTransitionDuration.current || 0, next);
|
||||
}
|
||||
if (addEndListener) {
|
||||
// Old call signature before `react-transition-group` implemented `nodeRef`
|
||||
addEndListener(nodeRef.current, next);
|
||||
}
|
||||
};
|
||||
return /*#__PURE__*/_jsx(TransitionComponent, {
|
||||
in: inProp,
|
||||
onEnter: handleEnter,
|
||||
onEntered: handleEntered,
|
||||
onEntering: handleEntering,
|
||||
onExit: handleExit,
|
||||
onExited: handleExited,
|
||||
onExiting: handleExiting,
|
||||
addEndListener: handleAddEndListener,
|
||||
nodeRef: nodeRef,
|
||||
timeout: timeout === 'auto' ? null : timeout,
|
||||
...other,
|
||||
children: (state, childProps) => /*#__PURE__*/_jsx(CollapseRoot, {
|
||||
as: component,
|
||||
className: clsx(classes.root, className, {
|
||||
'entered': classes.entered,
|
||||
'exited': !inProp && collapsedSize === '0px' && classes.hidden
|
||||
}[state]),
|
||||
style: {
|
||||
[isHorizontal ? 'minWidth' : 'minHeight']: collapsedSize,
|
||||
...style
|
||||
},
|
||||
ref: handleRef,
|
||||
...childProps,
|
||||
// `ownerState` is set after `childProps` to override any existing `ownerState` property in `childProps`
|
||||
// that might have been forwarded from the Transition component.
|
||||
ownerState: {
|
||||
...ownerState,
|
||||
state
|
||||
},
|
||||
children: /*#__PURE__*/_jsx(CollapseWrapper, {
|
||||
ownerState: {
|
||||
...ownerState,
|
||||
state
|
||||
},
|
||||
className: classes.wrapper,
|
||||
ref: wrapperRef,
|
||||
children: /*#__PURE__*/_jsx(CollapseWrapperInner, {
|
||||
ownerState: {
|
||||
...ownerState,
|
||||
state
|
||||
},
|
||||
className: classes.wrapperInner,
|
||||
children: children
|
||||
})
|
||||
})
|
||||
})
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? Collapse.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`. │
|
||||
// └─────────────────────────────────────────────────────────────────────┘
|
||||
/**
|
||||
* Add a custom transition end trigger. Called with the transitioning DOM
|
||||
* node and a done callback. Allows for more fine grained transition end
|
||||
* logic. Note: Timeouts are still used as a fallback if provided.
|
||||
*/
|
||||
addEndListener: PropTypes.func,
|
||||
/**
|
||||
* The content node to be collapsed.
|
||||
*/
|
||||
children: PropTypes.node,
|
||||
/**
|
||||
* Override or extend the styles applied to the component.
|
||||
*/
|
||||
classes: PropTypes.object,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className: PropTypes.string,
|
||||
/**
|
||||
* The width (horizontal) or height (vertical) of the container when collapsed.
|
||||
* @default '0px'
|
||||
*/
|
||||
collapsedSize: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
||||
/**
|
||||
* The component used for the root node.
|
||||
* Either a string to use a HTML element or a component.
|
||||
*/
|
||||
component: elementTypeAcceptingRef,
|
||||
/**
|
||||
* The transition timing function.
|
||||
* You may specify a single easing or a object containing enter and exit values.
|
||||
*/
|
||||
easing: PropTypes.oneOfType([PropTypes.shape({
|
||||
enter: PropTypes.string,
|
||||
exit: PropTypes.string
|
||||
}), PropTypes.string]),
|
||||
/**
|
||||
* If `true`, the component will transition in.
|
||||
*/
|
||||
in: PropTypes.bool,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onEnter: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onEntered: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onEntering: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onExit: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onExited: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onExiting: PropTypes.func,
|
||||
/**
|
||||
* The transition orientation.
|
||||
* @default 'vertical'
|
||||
*/
|
||||
orientation: PropTypes.oneOf(['horizontal', 'vertical']),
|
||||
/**
|
||||
* @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]),
|
||||
/**
|
||||
* The duration for the transition, in milliseconds.
|
||||
* You may specify a single timeout for all transitions, or individually with an object.
|
||||
*
|
||||
* Set to 'auto' to automatically calculate transition time based on height.
|
||||
* @default duration.standard
|
||||
*/
|
||||
timeout: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.shape({
|
||||
appear: PropTypes.number,
|
||||
enter: PropTypes.number,
|
||||
exit: PropTypes.number
|
||||
})])
|
||||
} : void 0;
|
||||
if (Collapse) {
|
||||
Collapse.muiSupportAuto = true;
|
||||
}
|
||||
export default Collapse;
|
||||
7
node_modules/@mui/material/modern/Collapse/collapseClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/Collapse/collapseClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getCollapseUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiCollapse', slot);
|
||||
}
|
||||
const collapseClasses = generateUtilityClasses('MuiCollapse', ['root', 'horizontal', 'vertical', 'entered', 'hidden', 'wrapper', 'wrapperInner']);
|
||||
export default collapseClasses;
|
||||
3
node_modules/@mui/material/modern/Collapse/index.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/Collapse/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default } from "./Collapse.js";
|
||||
export { default as collapseClasses } from "./collapseClasses.js";
|
||||
export * from "./collapseClasses.js";
|
||||
67
node_modules/@mui/material/modern/Container/Container.js
generated
vendored
Normal file
67
node_modules/@mui/material/modern/Container/Container.js
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
'use client';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
import { createContainer } from '@mui/system';
|
||||
import capitalize from "../utils/capitalize.js";
|
||||
import styled from "../styles/styled.js";
|
||||
import useThemeProps from "../styles/useThemeProps.js";
|
||||
const Container = createContainer({
|
||||
createStyledComponent: styled('div', {
|
||||
name: 'MuiContainer',
|
||||
slot: 'Root',
|
||||
overridesResolver: (props, styles) => {
|
||||
const {
|
||||
ownerState
|
||||
} = props;
|
||||
return [styles.root, styles[`maxWidth${capitalize(String(ownerState.maxWidth))}`], ownerState.fixed && styles.fixed, ownerState.disableGutters && styles.disableGutters];
|
||||
}
|
||||
}),
|
||||
useThemeProps: inProps => useThemeProps({
|
||||
props: inProps,
|
||||
name: 'MuiContainer'
|
||||
})
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? Container.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`. │
|
||||
// └─────────────────────────────────────────────────────────────────────┘
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
children: PropTypes.node,
|
||||
/**
|
||||
* Override or extend the styles applied to the component.
|
||||
*/
|
||||
classes: PropTypes.object,
|
||||
/**
|
||||
* The component used for the root node.
|
||||
* Either a string to use a HTML element or a component.
|
||||
*/
|
||||
component: PropTypes.elementType,
|
||||
/**
|
||||
* If `true`, the left and right padding is removed.
|
||||
* @default false
|
||||
*/
|
||||
disableGutters: PropTypes.bool,
|
||||
/**
|
||||
* Set the max-width to match the min-width of the current breakpoint.
|
||||
* This is useful if you'd prefer to design for a fixed set of sizes
|
||||
* instead of trying to accommodate a fully fluid viewport.
|
||||
* It's fluid by default.
|
||||
* @default false
|
||||
*/
|
||||
fixed: PropTypes.bool,
|
||||
/**
|
||||
* Determine the max-width of the container.
|
||||
* The container width grows with the size of the screen.
|
||||
* Set to `false` to disable `maxWidth`.
|
||||
* @default 'lg'
|
||||
*/
|
||||
maxWidth: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl', false]), PropTypes.string]),
|
||||
/**
|
||||
* 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 Container;
|
||||
7
node_modules/@mui/material/modern/Container/containerClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/Container/containerClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getContainerUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiContainer', slot);
|
||||
}
|
||||
const containerClasses = generateUtilityClasses('MuiContainer', ['root', 'disableGutters', 'fixed', 'maxWidthXs', 'maxWidthSm', 'maxWidthMd', 'maxWidthLg', 'maxWidthXl']);
|
||||
export default containerClasses;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user