This commit is contained in:
morgan
2026-03-13 19:23:37 +03:00
parent 8917f1631f
commit cc7403191a
5113 changed files with 168404 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
declare const ClassNameGenerator: {
configure(generator: (componentName: string) => string): void;
generate(componentName: string): string;
reset(): void;
};
export default ClassNameGenerator;

18
node_modules/@mui/utils/capitalize/capitalize.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = capitalize;
var _formatMuiErrorMessage = _interopRequireDefault(require("@mui/utils/formatMuiErrorMessage"));
// It should to be noted that this function isn't equivalent to `text-transform: capitalize`.
//
// A strict capitalization should uppercase the first letter of each word in the sentence.
// We only handle the first word.
function capitalize(string) {
if (typeof string !== 'string') {
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: `capitalize(string)` expects a string argument.' : (0, _formatMuiErrorMessage.default)(7));
}
return string.charAt(0).toUpperCase() + string.slice(1);
}

13
node_modules/@mui/utils/elementAcceptingRef/index.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function () {
return _elementAcceptingRef.default;
}
});
var _elementAcceptingRef = _interopRequireDefault(require("./elementAcceptingRef"));

View File

@@ -0,0 +1,14 @@
export default function HTMLElementType(props, propName, componentName, location, propFullName) {
if (process.env.NODE_ENV === 'production') {
return null;
}
const propValue = props[propName];
const safePropName = propFullName || propName;
if (propValue == null) {
return null;
}
if (propValue && propValue.nodeType !== 1) {
return new Error(`Invalid ${location} \`${safePropName}\` supplied to \`${componentName}\`. ` + `Expected an HTMLElement.`);
}
return null;
}

View File

@@ -0,0 +1 @@
export { default } from "./HTMLElementType.js";

17
node_modules/@mui/utils/esm/debounce/debounce.js generated vendored Normal file
View File

@@ -0,0 +1,17 @@
// Corresponds to 10 frames at 60 Hz.
// A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B.
export default function debounce(func, wait = 166) {
let timeout;
function debounced(...args) {
const later = () => {
// @ts-ignore
func.apply(this, args);
};
clearTimeout(timeout);
timeout = setTimeout(later, wait);
}
debounced.clear = () => {
clearTimeout(timeout);
};
return debounced;
}

View File

@@ -0,0 +1,42 @@
import PropTypes from 'prop-types';
import chainPropTypes from "../chainPropTypes/index.js";
function isClassComponent(elementType) {
// elementType.prototype?.isReactComponent
const {
prototype = {}
} = elementType;
return Boolean(prototype.isReactComponent);
}
function acceptingRef(props, propName, componentName, location, propFullName) {
const element = props[propName];
const safePropName = propFullName || propName;
if (element == null ||
// When server-side rendering React doesn't warn either.
// This is not an accurate check for SSR.
// This is only in place for Emotion compat.
// TODO: Revisit once https://github.com/facebook/react/issues/20047 is resolved.
typeof window === 'undefined') {
return null;
}
let warningHint;
const elementType = element.type;
/**
* Blacklisting instead of whitelisting
*
* Blacklisting will miss some components, such as React.Fragment. Those will at least
* trigger a warning in React.
* We can't whitelist because there is no safe way to detect React.forwardRef
* or class components. "Safe" means there's no public API.
*
*/
if (typeof elementType === 'function' && !isClassComponent(elementType)) {
warningHint = 'Did you accidentally use a plain function component for an element instead?';
}
if (warningHint !== undefined) {
return new Error(`Invalid ${location} \`${safePropName}\` supplied to \`${componentName}\`. ` + `Expected an element that can hold a ref. ${warningHint} ` + 'For more information see https://mui.com/r/caveat-with-refs-guide');
}
return null;
}
const elementAcceptingRef = chainPropTypes(PropTypes.element, acceptingRef);
elementAcceptingRef.isRequired = chainPropTypes(PropTypes.element.isRequired, acceptingRef);
export default elementAcceptingRef;

1
node_modules/@mui/utils/esm/exactProp/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export { default } from "./exactProp.js";

View File

@@ -0,0 +1,18 @@
/**
* Extracts event handlers from a given object.
* A prop is considered an event handler if it is a function and its name starts with `on`.
*
* @param object An object to extract event handlers from.
* @param excludeKeys An array of keys to exclude from the returned object.
*/
function extractEventHandlers(object, excludeKeys = []) {
if (object === undefined) {
return {};
}
const result = {};
Object.keys(object).filter(prop => prop.match(/^on[A-Z]/) && typeof object[prop] === 'function' && !excludeKeys.includes(prop)).forEach(prop => {
result[prop] = object[prop];
});
return result;
}
export default extractEventHandlers;

View File

@@ -0,0 +1 @@
export { default } from "./formatMuiErrorMessage.js";

View File

@@ -0,0 +1 @@
export default function getScrollbarSize(win?: Window): number;

View File

@@ -0,0 +1 @@
export { default } from "./getScrollbarSize.js";

View File

@@ -0,0 +1,4 @@
/**
* Returns a boolean indicating if the event's target has :focus-visible
*/
export default function isFocusVisible(element: Element): boolean;

View File

@@ -0,0 +1 @@
export { default } from "./isHostComponent.js";

View File

@@ -0,0 +1 @@
export { default } from "./omitEventHandlers.js";

View File

@@ -0,0 +1 @@
export { default } from "./ponyfillGlobal.js";

1
node_modules/@mui/utils/esm/resolveProps/index.js generated vendored Normal file
View File

@@ -0,0 +1 @@
export { default } from "./resolveProps.js";

View File

@@ -0,0 +1,17 @@
/**
* Add keys, values of `defaultProps` that does not exist in `props`
* @param defaultProps
* @param props
* @param mergeClassNameAndStyle If `true`, merges `className` and `style` props instead of overriding them.
* When `false` (default), props override defaultProps. When `true`, `className` values are concatenated
* and `style` objects are merged with props taking precedence.
* @returns resolved props
*/
export default function resolveProps<T extends {
components?: Record<string, unknown> | undefined;
componentsProps?: Record<string, unknown> | undefined;
slots?: Record<string, unknown> | undefined;
slotProps?: Record<string, unknown> | undefined;
className?: string | undefined;
style?: React.CSSProperties | undefined;
} & Record<string, unknown>>(defaultProps: T, props: T, mergeClassNameAndStyle?: boolean): T;

View File

@@ -0,0 +1,45 @@
'use client';
// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler -- process.env never changes, dependency arrays are intentionally ignored
/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */
import * as React from 'react';
export default function useControlled(props) {
const {
controlled,
default: defaultProp,
name,
state = 'value'
} = props;
// isControlled is ignored in the hook dependency lists as it should never change.
const {
current: isControlled
} = React.useRef(controlled !== undefined);
const [valueState, setValue] = React.useState(defaultProp);
const value = isControlled ? controlled : valueState;
if (process.env.NODE_ENV !== 'production') {
React.useEffect(() => {
if (isControlled !== (controlled !== undefined)) {
console.error([`MUI: A component is changing the ${isControlled ? '' : 'un'}controlled ${state} state of ${name} to be ${isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled ${name} ` + 'element for the lifetime of the component.', "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", 'More info: https://fb.me/react-controlled-components'].join('\n'));
}
}, [state, name, controlled]);
const {
current: defaultValue
} = React.useRef(defaultProp);
React.useEffect(() => {
if (!isControlled && JSON.stringify(defaultProp) !== JSON.stringify(defaultValue)) {
console.error([`MUI: A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. ` + `To suppress this warning opt to use a controlled ${name}.`].join('\n'));
}
}, [JSON.stringify(defaultProp)]);
}
const setValueIfUncontrolled = React.useCallback(newValue => {
if (!isControlled) {
setValue(newValue);
}
}, []);
// TODO: provide overloads for the useControlled function to account for the case where either
// controlled or default is not undefined.
// In that case the return type should be [T, React.Dispatch<React.SetStateAction<T>>]
// otherwise it should be [T | undefined, React.Dispatch<React.SetStateAction<T | undefined>>]
return [value, setValueIfUncontrolled];
}

View File

@@ -0,0 +1,13 @@
'use client';
import * as React from 'react';
/**
* A version of `React.useLayoutEffect` that does not show a warning when server-side rendering.
* This is useful for effects that are only needed for client-side rendering but not for SSR.
*
* Before you use this hook, make sure to read https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85
* and confirm it doesn't apply to your use-case.
*/
const useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
export default useEnhancedEffect;

1
node_modules/@mui/utils/esm/useId/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export { default } from "./useId.js";

View File

@@ -0,0 +1,163 @@
'use client';
// based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js
import * as React from 'react';
import { Timeout } from "../useTimeout/useTimeout.js";
let hadKeyboardEvent = true;
let hadFocusVisibleRecently = false;
const hadFocusVisibleRecentlyTimeout = new Timeout();
const inputTypesWhitelist = {
text: true,
search: true,
url: true,
tel: true,
email: true,
password: true,
number: true,
date: true,
month: true,
week: true,
time: true,
datetime: true,
'datetime-local': true
};
/**
* Computes whether the given element should automatically trigger the
* `focus-visible` class being added, i.e. whether it should always match
* `:focus-visible` when focused.
* @param {Element} node
* @returns {boolean}
*/
function focusTriggersKeyboardModality(node) {
const {
type,
tagName
} = node;
if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {
return true;
}
if (tagName === 'TEXTAREA' && !node.readOnly) {
return true;
}
if (node.isContentEditable) {
return true;
}
return false;
}
/**
* Keep track of our keyboard modality state with `hadKeyboardEvent`.
* If the most recent user interaction was via the keyboard;
* and the key press did not include a meta, alt/option, or control key;
* then the modality is keyboard. Otherwise, the modality is not keyboard.
* @param {KeyboardEvent} event
*/
function handleKeyDown(event) {
if (event.metaKey || event.altKey || event.ctrlKey) {
return;
}
hadKeyboardEvent = true;
}
/**
* If at any point a user clicks with a pointing device, ensure that we change
* the modality away from keyboard.
* This avoids the situation where a user presses a key on an already focused
* element, and then clicks on a different element, focusing it with a
* pointing device, while we still think we're in keyboard modality.
*/
function handlePointerDown() {
hadKeyboardEvent = false;
}
function handleVisibilityChange() {
if (this.visibilityState === 'hidden') {
// If the tab becomes active again, the browser will handle calling focus
// on the element (Safari actually calls it twice).
// If this tab change caused a blur on an element with focus-visible,
// re-apply the class when the user switches back to the tab.
if (hadFocusVisibleRecently) {
hadKeyboardEvent = true;
}
}
}
function prepare(doc) {
doc.addEventListener('keydown', handleKeyDown, true);
doc.addEventListener('mousedown', handlePointerDown, true);
doc.addEventListener('pointerdown', handlePointerDown, true);
doc.addEventListener('touchstart', handlePointerDown, true);
doc.addEventListener('visibilitychange', handleVisibilityChange, true);
}
export function teardown(doc) {
doc.removeEventListener('keydown', handleKeyDown, true);
doc.removeEventListener('mousedown', handlePointerDown, true);
doc.removeEventListener('pointerdown', handlePointerDown, true);
doc.removeEventListener('touchstart', handlePointerDown, true);
doc.removeEventListener('visibilitychange', handleVisibilityChange, true);
}
function isFocusVisible(event) {
const {
target
} = event;
try {
return target.matches(':focus-visible');
} catch (error) {
// Browsers not implementing :focus-visible will throw a SyntaxError.
// We use our own heuristic for those browsers.
// Rethrow might be better if it's not the expected error but do we really
// want to crash if focus-visible malfunctioned?
}
// No need for validFocusTarget check. The user does that by attaching it to
// focusable events only.
return hadKeyboardEvent || focusTriggersKeyboardModality(target);
}
export default function useIsFocusVisible() {
const ref = React.useCallback(node => {
if (node != null) {
prepare(node.ownerDocument);
}
}, []);
const isFocusVisibleRef = React.useRef(false);
/**
* Should be called if a blur event is fired
*/
function handleBlurVisible() {
// checking against potential state variable does not suffice if we focus and blur synchronously.
// React wouldn't have time to trigger a re-render so `focusVisible` would be stale.
// Ideally we would adjust `isFocusVisible(event)` to look at `relatedTarget` for blur events.
// This doesn't work in IE11 due to https://github.com/facebook/react/issues/3751
// TODO: check again if React releases their internal changes to focus event handling (https://github.com/facebook/react/pull/19186).
if (isFocusVisibleRef.current) {
// To detect a tab/window switch, we look for a blur event followed
// rapidly by a visibility change.
// If we don't see a visibility change within 100ms, it's probably a
// regular focus change.
hadFocusVisibleRecently = true;
hadFocusVisibleRecentlyTimeout.start(100, () => {
hadFocusVisibleRecently = false;
});
isFocusVisibleRef.current = false;
return true;
}
return false;
}
/**
* Should be called if a blur event is fired
*/
function handleFocusVisible(event) {
if (isFocusVisible(event)) {
isFocusVisibleRef.current = true;
return true;
}
return false;
}
return {
isFocusVisibleRef,
onFocus: handleFocusVisible,
onBlur: handleBlurVisible,
ref
};
}

View File

@@ -0,0 +1,5 @@
import * as React from 'react';
/**
* A React.useEffect equivalent that runs once, when the component is mounted.
*/
export default function useOnMount(fn: React.EffectCallback): void;

13
node_modules/@mui/utils/getActiveElement/index.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function () {
return _getActiveElement.default;
}
});
var _getActiveElement = _interopRequireDefault(require("./getActiveElement"));

View File

@@ -0,0 +1,11 @@
import * as React from 'react';
/**
* Returns the ref of a React node handling differences between React 19 and older versions.
* It will return null if the node is not a valid React element.
*
* @param element React.ReactNode
* @returns React.Ref<any> | null
*
* @deprecated Use getReactElementRef instead
*/
export default function getReactNodeRef(element: React.ReactNode): React.Ref<any> | null;

13
node_modules/@mui/utils/getScrollbarSize/index.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function () {
return _getScrollbarSize.default;
}
});
var _getScrollbarSize = _interopRequireDefault(require("./getScrollbarSize"));

13
node_modules/@mui/utils/getValidReactChildren/index.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function () {
return _getValidReactChildren.default;
}
});
var _getValidReactChildren = _interopRequireDefault(require("./getValidReactChildren"));

13
node_modules/@mui/utils/isHostComponent/index.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function () {
return _isHostComponent.default;
}
});
var _isHostComponent = _interopRequireDefault(require("./isHostComponent"));

1
node_modules/@mui/utils/isMuiElement/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export { default } from "./isMuiElement.js";

13
node_modules/@mui/utils/mergeSlotProps/index.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function () {
return _mergeSlotProps.default;
}
});
var _mergeSlotProps = _interopRequireDefault(require("./mergeSlotProps"));

1
node_modules/@mui/utils/omitEventHandlers/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export { default } from "./omitEventHandlers.js";

View File

@@ -0,0 +1 @@
export default function ownerDocument(node: Node | null | undefined): Document;

1
node_modules/@mui/utils/refType/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export { default } from "./refType.js";

View File

@@ -0,0 +1,6 @@
/**
* If `componentProps` is a function, calls it with the provided `ownerState`.
* Otherwise, just returns `componentProps`.
*/
declare function resolveComponentProps<TProps, TOwnerState, TSlotState>(componentProps: TProps | ((ownerState: TOwnerState, slotState?: TSlotState) => TProps) | undefined, ownerState: TOwnerState, slotState?: TSlotState): TProps | undefined;
export default resolveComponentProps;

View File

@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/**
* If `componentProps` is a function, calls it with the provided `ownerState`.
* Otherwise, just returns `componentProps`.
*/
function resolveComponentProps(componentProps, ownerState, slotState) {
if (typeof componentProps === 'function') {
return componentProps(ownerState, slotState);
}
return componentProps;
}
var _default = exports.default = resolveComponentProps;

1
node_modules/@mui/utils/unsupportedProp/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export { default } from "./unsupportedProp.js";

1
node_modules/@mui/utils/useLazyRef/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export { default } from "./useLazyRef.js";

13
node_modules/@mui/utils/useLazyRef/index.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function () {
return _useLazyRef.default;
}
});
var _useLazyRef = _interopRequireDefault(require("./useLazyRef"));

View File

@@ -0,0 +1,113 @@
"use strict";
'use client';
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
// storage events only work across tabs, we'll use an event emitter to announce within the current tab
const currentTabChangeListeners = new Map();
function onCurrentTabStorageChange(key, handler) {
let listeners = currentTabChangeListeners.get(key);
if (!listeners) {
listeners = new Set();
currentTabChangeListeners.set(key, listeners);
}
listeners.add(handler);
}
function offCurrentTabStorageChange(key, handler) {
const listeners = currentTabChangeListeners.get(key);
if (!listeners) {
return;
}
listeners.delete(handler);
if (listeners.size === 0) {
currentTabChangeListeners.delete(key);
}
}
function emitCurrentTabStorageChange(key) {
const listeners = currentTabChangeListeners.get(key);
if (listeners) {
listeners.forEach(listener => listener());
}
}
function subscribe(area, key, callback) {
if (!key) {
return () => {};
}
const storageHandler = event => {
if (event.storageArea === area && event.key === key) {
callback();
}
};
window.addEventListener('storage', storageHandler);
onCurrentTabStorageChange(key, callback);
return () => {
window.removeEventListener('storage', storageHandler);
offCurrentTabStorageChange(key, callback);
};
}
function getSnapshot(area, key) {
if (!key) {
return null;
}
try {
return area.getItem(key);
} catch {
// ignore
// See https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API#feature-detecting_localstorage
return null;
}
}
function setValue(area, key, value) {
if (!key) {
return;
}
try {
if (value === null) {
area.removeItem(key);
} else {
area.setItem(key, String(value));
}
} catch {
// ignore
// See https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API#feature-detecting_localstorage
return;
}
emitCurrentTabStorageChange(key);
}
const serverValue = [null, () => {}];
function useLocalStorageStateServer() {
return serverValue;
}
/**
* Sync state to local storage so that it persists through a page refresh. Usage is
* similar to useState except we pass in a storage key so that we can default
* to that value on page load instead of the specified initial value.
*
* Since the storage API isn't available in server-rendering environments, we
* return null during SSR and hydration.
*/
function useLocalStorageStateBrowser(key, initializer = null) {
const [initialValue] = React.useState(initializer);
const area = window.localStorage;
const subscribeKey = React.useCallback(callback => subscribe(area, key, callback), [area, key]);
const getKeySnapshot = React.useCallback(() => getSnapshot(area, key) ?? initialValue, [area, initialValue, key]);
// Start with null for the hydration, and then switch to the actual value.
const getKeyServerSnapshot = () => null;
const storedValue = React.useSyncExternalStore(subscribeKey, getKeySnapshot, getKeyServerSnapshot);
const setStoredValue = React.useCallback(value => {
const valueToStore = value instanceof Function ? value(storedValue) : value;
setValue(area, key, valueToStore);
}, [area, key, storedValue]);
const [nonStoredValue, setNonStoredValue] = React.useState(initialValue);
if (!key) {
return [nonStoredValue, setNonStoredValue];
}
return [storedValue, setStoredValue];
}
var _default = exports.default = typeof window === 'undefined' ? useLocalStorageStateServer : useLocalStorageStateBrowser;

View File

@@ -0,0 +1,2 @@
declare function usePreviousProps<T>(value: T): Partial<T>;
export default usePreviousProps;