Začetni commit projekta rezervacije

This commit is contained in:
Mark Poljanšek committed 2025-04-23 20:19:33 +02:00
commit 328731b32f
56062 files changed
+2485242

No files matched your search

@@ -0,0 +1,6 @@
declare const ClassNameGenerator: {
configure(generator: (componentName: string) => string): void;
generate(componentName: string): string;
reset(): void;
};
export default ClassNameGenerator;
+1
View File
@@ -0,0 +1 @@
export { default } from "./ClassNameGenerator.js";
+3
View File
@@ -0,0 +1,3 @@
export default function HTMLElementType(props: {
[key: string]: unknown;
}, propName: string, componentName: string, location: string, propFullName: string): Error | null;
+1
View File
@@ -0,0 +1 @@
export { default } from "./HTMLElementType.js";
+20
View File
@@ -0,0 +1,20 @@
import * as React from 'react';
import { Simplify } from '@mui/types';
/**
* Type of the ownerState based on the type of an element it applies to.
* This resolves to the provided OwnerState for React components and `undefined` for host components.
* Falls back to `OwnerState | undefined` when the exact type can't be determined in development time.
*/
type OwnerStateWhenApplicable<ElementType extends React.ElementType, OwnerState> = ElementType extends React.ComponentType<any> ? OwnerState : ElementType extends keyof React.JSX.IntrinsicElements ? undefined : OwnerState | undefined;
export type AppendOwnerStateReturnType<ElementType extends React.ElementType, OtherProps, OwnerState> = Simplify<OtherProps & {
ownerState: OwnerStateWhenApplicable<ElementType, OwnerState>;
}>;
/**
* Appends the ownerState object to the props, merging with the existing one if necessary.
*
* @param elementType Type of the element that owns the `existingProps`. If the element is a DOM node or undefined, `ownerState` is not applied.
* @param otherProps Props of the element.
* @param ownerState
*/
declare function appendOwnerState<ElementType extends React.ElementType, OtherProps extends Record<string, any>, OwnerState>(elementType: ElementType | undefined, otherProps: OtherProps, ownerState: OwnerState): AppendOwnerStateReturnType<ElementType, OtherProps, OwnerState>;
export default appendOwnerState;
+2
View File
@@ -0,0 +1,2 @@
export { default } from "./appendOwnerState.js";
export type { AppendOwnerStateReturnType } from "./appendOwnerState.js";
+1
View File
@@ -0,0 +1 @@
export default function capitalize(string: string): string;
+1
View File
@@ -0,0 +1 @@
export { default } from "./capitalize.js";
+2
View File
@@ -0,0 +1,2 @@
import PropTypes from 'prop-types';
export default function chainPropTypes<A, B>(propType1: PropTypes.Validator<A>, propType2: PropTypes.Validator<B>): PropTypes.Validator<A & B>;
+1
View File
@@ -0,0 +1 @@
export { default } from "./chainPropTypes.js";
+2
View File
@@ -0,0 +1,2 @@
declare function clamp(val: number, min?: number, max?: number): number;
export default clamp;
+1
View File
@@ -0,0 +1 @@
export { default } from "./clamp.js";
+29
View File
@@ -0,0 +1,29 @@
/**
* Compose classes from multiple sources.
*
* @example
* ```tsx
* const slots = {
* root: ['root', 'primary'],
* label: ['label'],
* };
*
* const getUtilityClass = (slot) => `MuiButton-${slot}`;
*
* const classes = {
* root: 'my-root-class',
* };
*
* const output = composeClasses(slots, getUtilityClass, classes);
* // {
* // root: 'MuiButton-root MuiButton-primary my-root-class',
* // label: 'MuiButton-label',
* // }
* ```
*
* @param slots a list of classes for each possible slot
* @param getUtilityClass a function to resolve the class based on the slot name
* @param classes the input classes from props
* @returns the resolved classes for all slots
*/
export default function composeClasses<ClassKey extends string>(slots: Record<ClassKey, ReadonlyArray<string | false | undefined | null>>, getUtilityClass: (slot: string) => string, classes?: Record<string, string> | undefined): Record<ClassKey, string>;
+1
View File
@@ -0,0 +1 @@
export { default } from "./composeClasses.js";
@@ -0,0 +1,7 @@
/**
* Safe chained function.
*
* Will only create a new function if needed,
* otherwise will pass back existing functions or null.
*/
export default function createChainedFunction<Args extends any[], This>(...funcs: Array<(this: This, ...args: Args) => any>): (this: This, ...args: Args) => void;
+1
View File
@@ -0,0 +1 @@
export { default } from "./createChainedFunction.js";
+4
View File
@@ -0,0 +1,4 @@
export interface Cancelable {
clear(): void;
}
export default function debounce<T extends (...args: any[]) => any>(func: T, wait?: number): T & Cancelable;
+2
View File
@@ -0,0 +1,2 @@
export { default } from "./debounce.js";
export * from "./debounce.js";
+23
View File
@@ -0,0 +1,23 @@
export declare function isPlainObject(item: unknown): item is Record<keyof any, unknown>;
export interface DeepmergeOptions {
clone?: boolean;
}
/**
* Merge objects deeply.
* It will shallow copy React elements.
*
* If `options.clone` is set to `false` the source object will be merged directly into the target object.
*
* @example
* ```ts
* deepmerge({ a: { b: 1 }, d: 2 }, { a: { c: 2 }, d: 4 });
* // => { a: { b: 1, c: 2 }, d: 4 }
* ````
*
* @param target The target object.
* @param source The source object.
* @param options The merge options.
* @param options.clone Set to `false` to merge the source object directly into the target object.
* @returns The merged object.
*/
export default function deepmerge<T>(target: T, source: unknown, options?: DeepmergeOptions): T;
+2
View File
@@ -0,0 +1,2 @@
export { default } from "./deepmerge.js";
export * from "./deepmerge.js";
@@ -0,0 +1 @@
export default function deprecatedPropType<T>(validator: T, reason: string): T;
+1
View File
@@ -0,0 +1 @@
export { default } from "./deprecatedPropType.js";
@@ -0,0 +1,3 @@
import PropTypes from 'prop-types';
declare const elementAcceptingRef: PropTypes.Requireable<unknown>;
export default elementAcceptingRef;
+1
View File
@@ -0,0 +1 @@
export { default } from "./elementAcceptingRef.js";
@@ -0,0 +1,3 @@
import PropTypes from 'prop-types';
declare const _default: PropTypes.Validator<PropTypes.ReactComponentLike | null | undefined>;
export default _default;
+1
View File
@@ -0,0 +1 @@
export { default } from "./elementTypeAcceptingRef.js";
+2
View File
@@ -0,0 +1,2 @@
import { ValidationMap } from 'prop-types';
export default function exactProp<T>(propTypes: ValidationMap<T>): ValidationMap<T>;
+1
View File
@@ -0,0 +1 @@
export { default } from "./exactProp.js";
@@ -0,0 +1,10 @@
import { EventHandlers } from "../types/index.js";
/**
* 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.
*/
declare function extractEventHandlers(object: Record<string, any> | undefined, excludeKeys?: string[]): EventHandlers;
export default extractEventHandlers;
+1
View File
@@ -0,0 +1 @@
export { default } from "./extractEventHandlers.js";
@@ -0,0 +1,11 @@
/**
* WARNING: Don't import this directly. It's imported by the code generated by
* `@mui/interal-babel-plugin-minify-errors`. Make sure to always use string literals in `Error`
* constructors to ensure the plugin works as expected. Supported patterns include:
* throw new Error('My message');
* throw new Error(`My message: ${foo}`);
* throw new Error(`My message: ${foo}` + 'another string');
* ...
* @param {number} code
*/
export default function formatMuiErrorMessage(code: number, ...args: string[]): string;
+1
View File
@@ -0,0 +1 @@
export { default } from "./formatMuiErrorMessage.js";
@@ -0,0 +1,17 @@
export type GlobalStateSlot = keyof typeof globalStateClasses;
export declare const globalStateClasses: {
active: string;
checked: string;
completed: string;
disabled: string;
error: string;
expanded: string;
focused: string;
focusVisible: string;
open: string;
readOnly: string;
required: string;
selected: string;
};
export default function generateUtilityClass(componentName: string, slot: string, globalStatePrefix?: string): string;
export declare function isGlobalState(slot: string): boolean;
+2
View File
@@ -0,0 +1,2 @@
export { default } from "./generateUtilityClass.js";
export * from "./generateUtilityClass.js";
@@ -0,0 +1 @@
export default function generateUtilityClasses<T extends string>(componentName: string, slots: T[], globalStatePrefix?: string): Record<T, string>;
+1
View File
@@ -0,0 +1 @@
export { default } from "./generateUtilityClasses.js";
+7
View File
@@ -0,0 +1,7 @@
import * as React from 'react';
/**
* cherry-pick from
* https://github.com/facebook/react/blob/769b1f270e1251d9dbdce0fcbd9e92e502d059b8/packages/shared/getComponentName.js
* originally forked from recompose/getDisplayName
*/
export default function getDisplayName(Component: React.ElementType): string | undefined;
+1
View File
@@ -0,0 +1 @@
export { default } from "./getDisplayName.js";
@@ -0,0 +1,9 @@
import * as React from 'react';
/**
* Returns the ref of a React element handling differences between React 19 and older versions.
* It will throw runtime error if the element is not a valid React element.
*
* @param element React.ReactElement
* @returns React.Ref<any> | null
*/
export default function getReactElementRef(element: React.ReactElement): React.Ref<any> | null;
+1
View File
@@ -0,0 +1 @@
export { default } from "./getReactElementRef.js";
+11
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;
+1
View File
@@ -0,0 +1 @@
export { default } from "./getReactNodeRef.js";
@@ -0,0 +1 @@
export default function getScrollbarSize(win?: Window): number;
+1
View File
@@ -0,0 +1 @@
export { default } from "./getScrollbarSize.js";
@@ -0,0 +1,8 @@
import * as React from 'react';
/**
* Gets only the valid children of a component,
* and ignores any nullish or falsy child.
*
* @param children the children
*/
export default function getValidReactChildren(children: React.ReactNode): React.ReactElement<unknown>[];
+1
View File
@@ -0,0 +1 @@
export { default } from "./getValidReactChildren.js";
+51
View File
@@ -0,0 +1,51 @@
export { default as chainPropTypes } from "./chainPropTypes/index.js";
export { default as deepmerge } from "./deepmerge/index.js";
export { isPlainObject } from "./deepmerge/index.js";
export { default as elementAcceptingRef } from "./elementAcceptingRef/index.js";
export { default as elementTypeAcceptingRef } from "./elementTypeAcceptingRef/index.js";
export { default as exactProp } from "./exactProp/index.js";
export { default as formatMuiErrorMessage } from "./formatMuiErrorMessage/index.js";
export { default as getDisplayName } from "./getDisplayName/index.js";
export { default as HTMLElementType } from "./HTMLElementType/index.js";
export { default as ponyfillGlobal } from "./ponyfillGlobal/index.js";
export { default as refType } from "./refType/index.js";
export { default as unstable_capitalize } from "./capitalize/index.js";
export { default as unstable_createChainedFunction } from "./createChainedFunction/index.js";
export { default as unstable_debounce } from "./debounce/index.js";
export { default as unstable_deprecatedPropType } from "./deprecatedPropType/index.js";
export { default as unstable_isMuiElement } from "./isMuiElement/index.js";
export { default as unstable_ownerDocument } from "./ownerDocument/index.js";
export { default as unstable_ownerWindow } from "./ownerWindow/index.js";
export { default as unstable_requirePropFactory } from "./requirePropFactory/index.js";
export { default as unstable_setRef } from "./setRef/index.js";
export { default as unstable_useEnhancedEffect } from "./useEnhancedEffect/index.js";
export { default as unstable_useId } from "./useId/index.js";
export { default as unstable_unsupportedProp } from "./unsupportedProp/index.js";
export { default as unstable_useControlled } from "./useControlled/index.js";
export { default as unstable_useEventCallback } from "./useEventCallback/index.js";
export { default as unstable_useForkRef } from "./useForkRef/index.js";
export { default as unstable_useLazyRef } from "./useLazyRef/index.js";
export { default as unstable_useTimeout, Timeout as unstable_Timeout } from "./useTimeout/index.js";
export { default as unstable_useOnMount } from "./useOnMount/index.js";
export { default as unstable_useIsFocusVisible } from "./useIsFocusVisible/index.js";
export { default as unstable_isFocusVisible } from "./isFocusVisible/index.js";
export { default as unstable_getScrollbarSize } from "./getScrollbarSize/index.js";
export { default as usePreviousProps } from "./usePreviousProps/index.js";
export { default as getValidReactChildren } from "./getValidReactChildren/index.js";
export { default as visuallyHidden } from "./visuallyHidden/index.js";
export { default as integerPropType } from "./integerPropType/index.js";
export { default as internal_resolveProps } from "./resolveProps/index.js";
export { default as unstable_composeClasses } from "./composeClasses/index.js";
export { default as unstable_generateUtilityClass } from "./generateUtilityClass/index.js";
export { isGlobalState as unstable_isGlobalState } from "./generateUtilityClass/index.js";
export * from "./generateUtilityClass/index.js";
export { default as unstable_generateUtilityClasses } from "./generateUtilityClasses/index.js";
export { default as unstable_ClassNameGenerator } from "./ClassNameGenerator/index.js";
export { default as clamp } from "./clamp/index.js";
export { default as unstable_useSlotProps } from "./useSlotProps/index.js";
export type { UseSlotPropsParameters, UseSlotPropsResult } from "./useSlotProps/index.js";
export { default as unstable_resolveComponentProps } from "./resolveComponentProps/index.js";
export { default as unstable_extractEventHandlers } from "./extractEventHandlers/index.js";
export { default as unstable_getReactNodeRef } from "./getReactNodeRef/index.js";
export { default as unstable_getReactElementRef } from "./getReactElementRef/index.js";
export * from "./types/index.js";
+2
View File
@@ -0,0 +1,2 @@
export { default } from "./integerPropType.js";
export * from "./integerPropType.js";
+3
View File
@@ -0,0 +1,3 @@
import PropTypes from 'prop-types';
declare const integerPropType: PropTypes.Requireable<number>;
export default integerPropType;
+1
View File
@@ -0,0 +1 @@
export { default } from "./isFocusVisible.js";
+4
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;
+1
View File
@@ -0,0 +1 @@
export { default } from "./isHostComponent.js";
+6
View File
@@ -0,0 +1,6 @@
import * as React from 'react';
/**
* Determines if a given element is a DOM element name (i.e. not a React component).
*/
declare function isHostComponent(element: React.ElementType): element is "symbol" | "object" | "center" | "button" | "meter" | "textarea" | "style" | "progress" | "text" | "ruby" | "table" | "small" | "sub" | "circle" | "embed" | "pre" | "caption" | "menu" | "clipPath" | "filter" | "menuitem" | "mask" | "marker" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "canvas" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "meta" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "q" | "rp" | "rt" | "s" | "samp" | "search" | "slot" | "script" | "section" | "select" | "source" | "span" | "strong" | "summary" | "sup" | "template" | "tbody" | "td" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "set" | "stop" | "switch" | "textPath" | "tspan" | "use" | "view";
export default isHostComponent;
+1
View File
@@ -0,0 +1 @@
export { default } from "./isMuiElement.js";
+1
View File
@@ -0,0 +1 @@
export default function isMuiElement(element: any, muiNames: readonly string[]): boolean;
+2
View File
@@ -0,0 +1,2 @@
export { default } from "./mergeSlotProps.js";
export type { WithCommonProps, MergeSlotPropsParameters, MergeSlotPropsResult } from "./mergeSlotProps.js";
+56
View File
@@ -0,0 +1,56 @@
import * as React from 'react';
import { ClassValue } from 'clsx';
import { Simplify } from '@mui/types';
import { EventHandlers } from "../types/index.js";
export type WithCommonProps<OtherProps> = OtherProps & {
className?: string;
style?: React.CSSProperties;
ref?: React.Ref<any>;
};
export interface MergeSlotPropsParameters<SlotProps, ExternalForwardedProps, ExternalSlotProps, AdditionalProps> {
/**
* A function that returns the internal props of the component.
* It accepts the event handlers passed into the component by the user
* and is responsible for calling them where appropriate.
*/
getSlotProps?: (other: EventHandlers) => WithCommonProps<SlotProps>;
/**
* Props provided to the `slotProps.*` of the Base UI component.
*/
externalSlotProps?: WithCommonProps<ExternalSlotProps>;
/**
* Extra props placed on the Base UI component that should be forwarded to the slot.
* This should usually be used only for the root slot.
*/
externalForwardedProps?: WithCommonProps<ExternalForwardedProps>;
/**
* Additional props to be placed on the slot.
*/
additionalProps?: WithCommonProps<AdditionalProps>;
/**
* Extra class name(s) to be placed on the slot.
*/
className?: ClassValue | ClassValue[];
}
export type MergeSlotPropsResult<SlotProps, ExternalForwardedProps, ExternalSlotProps, AdditionalProps> = {
props: Simplify<SlotProps & ExternalForwardedProps & ExternalSlotProps & AdditionalProps & {
className?: string;
style?: React.CSSProperties;
}>;
internalRef: React.Ref<any> | undefined;
};
/**
* Merges the slot component internal props (usually coming from a hook)
* with the externally provided ones.
*
* The merge order is (the latter overrides the former):
* 1. The internal props (specified as a getter function to work with get*Props hook result)
* 2. Additional props (specified internally on a Base UI component)
* 3. External props specified on the owner component. These should only be used on a root slot.
* 4. External props specified in the `slotProps.*` prop.
* 5. The `className` prop - combined from all the above.
* @param parameters
* @returns
*/
declare function mergeSlotProps<SlotProps, ExternalForwardedProps extends Record<string, unknown>, ExternalSlotProps extends Record<string, unknown>, AdditionalProps>(parameters: MergeSlotPropsParameters<SlotProps, ExternalForwardedProps, ExternalSlotProps, AdditionalProps>): MergeSlotPropsResult<SlotProps, ExternalForwardedProps, ExternalSlotProps, AdditionalProps>;
export default mergeSlotProps;
+1
View File
@@ -0,0 +1 @@
export { default } from "./omitEventHandlers.js";
@@ -0,0 +1,9 @@
/**
* Removes event handlers from the given object.
* A field is considered an event handler if it is a function with a name beginning with `on`.
*
* @param object Object to remove event handlers from.
* @returns Object with event handlers removed.
*/
declare function omitEventHandlers<Props extends Record<string, unknown>>(object: Props | undefined): {};
export default omitEventHandlers;
+1
View File
@@ -0,0 +1 @@
export { default } from "./ownerDocument.js";
+1
View File
@@ -0,0 +1 @@
export default function ownerDocument(node: Node | null | undefined): Document;
+1
View File
@@ -0,0 +1 @@
export { default } from "./ownerWindow.js";
+1
View File
@@ -0,0 +1 @@
export default function ownerWindow(node: Node | undefined): Window;
+1
View File
@@ -0,0 +1 @@
export { default } from "./ponyfillGlobal.js";
+6
View File
@@ -0,0 +1,6 @@
/**
* https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
* @deprecated Use `globalThis` instead.
*/
declare const _default: any;
export default _default;
+1
View File
@@ -0,0 +1 @@
export { default } from "./refType.js";
+3
View File
@@ -0,0 +1,3 @@
import PropTypes from 'prop-types';
declare const refType: PropTypes.Requireable<object>;
export default refType;
+1
View File
@@ -0,0 +1 @@
export { default } from "./requirePropFactory.js";
@@ -0,0 +1,2 @@
import * as React from 'react';
export default function requirePropFactory(componentNameInError: string, Component?: React.JSXElementConstructor<unknown>): any;
+1
View File
@@ -0,0 +1 @@
export { default } from "./resolveComponentProps.js";
@@ -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;
+1
View File
@@ -0,0 +1 @@
export { default } from "./resolveProps.js";
+12
View File
@@ -0,0 +1,12 @@
/**
* Add keys, values of `defaultProps` that does not exist in `props`
* @param defaultProps
* @param props
* @returns resolved props
*/
export default function resolveProps<T extends {
components?: Record<string, unknown>;
componentsProps?: Record<string, unknown>;
slots?: Record<string, unknown>;
slotProps?: Record<string, unknown>;
} & Record<string, unknown>>(defaultProps: T, props: T): T;
+1
View File
@@ -0,0 +1 @@
export { default } from "./setRef.js";
+15
View File
@@ -0,0 +1,15 @@
import * as React from 'react';
/**
* TODO v5: consider making it private
*
* passes {value} to {ref}
*
* WARNING: Be sure to only call this inside a callback that is passed as a ref.
* Otherwise, make sure to cleanup the previous {ref} if it changes. See
* https://github.com/mui/material-ui/issues/13539
*
* Useful if you want to expose the ref of an inner component to the public API
* while still using it inside the component.
* @param ref A ref callback or ref object. If anything falsy, this is a no-op.
*/
export default function setRef<T>(ref: React.MutableRefObject<T | null> | ((instance: T | null) => void) | null | undefined, value: T | null): void;
+7
View File
@@ -0,0 +1,7 @@
import * as React from 'react';
export type EventHandlers = Record<string, React.EventHandler<any>>;
export type WithOptionalOwnerState<Props extends {
ownerState: unknown;
}> = Omit<Props, 'ownerState'> & Partial<Pick<Props, 'ownerState'>>;
export type SlotComponentProps<TSlotComponent extends React.ElementType, TOverrides, TOwnerState> = (Partial<React.ComponentPropsWithRef<TSlotComponent>> & TOverrides) | ((ownerState: TOwnerState) => Partial<React.ComponentPropsWithRef<TSlotComponent>> & TOverrides);
export type SlotComponentPropsWithSlotState<TSlotComponent extends React.ElementType, TOverrides, TOwnerState, TSlotState> = (Partial<React.ComponentPropsWithRef<TSlotComponent>> & TOverrides) | ((ownerState: TOwnerState, slotState: TSlotState) => Partial<React.ComponentPropsWithRef<TSlotComponent>> & TOverrides);
+1
View File
@@ -0,0 +1 @@
export { default } from "./unsupportedProp.js";
+3
View File
@@ -0,0 +1,3 @@
export default function unsupportedProp(props: {
[key: string]: any;
}, propName: string, componentName: string, location: string, propFullName: string): Error | null;
+2
View File
@@ -0,0 +1,2 @@
export { default } from "./useControlled.js";
export * from "./useControlled.js";
+19
View File
@@ -0,0 +1,19 @@
export interface UseControlledProps<T = unknown> {
/**
* Holds the component value when it's controlled.
*/
controlled: T | undefined;
/**
* The default value when uncontrolled.
*/
default: T | undefined;
/**
* The component name displayed in warnings.
*/
name: string;
/**
* The name of the state variable displayed in warnings.
*/
state?: string;
}
export default function useControlled<T = unknown>(props: UseControlledProps<T>): [T, (newValue: T | ((prevValue: T) => T)) => void];
+1
View File
@@ -0,0 +1 @@
export { default } from "./useEnhancedEffect.js";
@@ -0,0 +1,10 @@
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.
*/
declare const useEnhancedEffect: typeof React.useLayoutEffect;
export default useEnhancedEffect;
+1
View File
@@ -0,0 +1 @@
export { default } from "./useEventCallback.js";
@@ -0,0 +1,7 @@
/**
* Inspired by https://github.com/facebook/react/issues/14099#issuecomment-440013892
* See RFC in https://github.com/reactjs/rfcs/pull/220
*/
declare function useEventCallback<Fn extends (...args: any[]) => any = (...args: unknown[]) => unknown>(fn: Fn): Fn;
declare function useEventCallback<Args extends unknown[], Return>(fn: (...args: Args) => Return): (...args: Args) => Return;
export default useEventCallback;
+1
View File
@@ -0,0 +1 @@
export { default } from "./useForkRef.js";
+17
View File
@@ -0,0 +1,17 @@
import * as React from 'react';
/**
* Merges refs into a single memoized callback ref or `null`.
*
* ```tsx
* const rootRef = React.useRef<Instance>(null);
* const refFork = useForkRef(rootRef, props.ref);
*
* return (
* <Root {...props} ref={refFork} />
* );
* ```
*
* @param {Array<React.Ref<Instance> | undefined>} refs The ref array.
* @returns {React.RefCallback<Instance> | null} The new ref callback.
*/
export default function useForkRef<Instance>(...refs: Array<React.Ref<Instance> | undefined>): React.RefCallback<Instance> | null;
+1
View File
@@ -0,0 +1 @@
export { default } from "./useId.js";
+7
View File
@@ -0,0 +1,7 @@
/**
*
* @example <div id={useId()} />
* @param idOverride
* @returns {string}
*/
export default function useId(idOverride?: string): string | undefined;
+2
View File
@@ -0,0 +1,2 @@
export { default } from "./useIsFocusVisible.js";
export * from "./useIsFocusVisible.js";
@@ -0,0 +1,9 @@
import * as React from 'react';
export declare function teardown(doc: Document): void;
export interface UseIsFocusVisibleResult {
isFocusVisibleRef: React.MutableRefObject<boolean>;
onBlur: (event: React.FocusEvent<any>) => void;
onFocus: (event: React.FocusEvent<any>) => void;
ref: React.RefCallback<Element>;
}
export default function useIsFocusVisible(): UseIsFocusVisibleResult;
+1
View File
@@ -0,0 +1 @@
export { default } from "./useLazyRef.js";
+9
View File
@@ -0,0 +1,9 @@
import * as React from 'react';
/**
* A React.useRef() that is initialized lazily with a function. Note that it accepts an optional
* initialization argument, so the initialization function doesn't need to be an inline closure.
*
* @usage
* const ref = useLazyRef(sortColumns, columns)
*/
export default function useLazyRef<T, U>(init: (arg?: U) => T, initArg?: U): React.RefObject<T>;
+1
View File
@@ -0,0 +1 @@
export { default } from "./useLocalStorageState.js";
@@ -0,0 +1,14 @@
import * as React from 'react';
type Initializer = () => string | null;
type UseStorageStateHookResult = [string | null, React.Dispatch<React.SetStateAction<string | null>>];
/**
* 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.
*/
declare function useLocalStorageStateBrowser(key: string | null, initializer?: string | null | Initializer): UseStorageStateHookResult;
declare const _default: typeof useLocalStorageStateBrowser;
export default _default;
+1
View File
@@ -0,0 +1 @@
export { default } from "./useOnMount.js";
+5
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;
+1
View File
@@ -0,0 +1 @@
export { default } from "./usePreviousProps.js";
@@ -0,0 +1,2 @@
declare const usePreviousProps: <T>(value: T) => Partial<T>;
export default usePreviousProps;
+2
View File
@@ -0,0 +1,2 @@
export { default } from "./useSlotProps.js";
export type { UseSlotPropsParameters, UseSlotPropsResult } from "./useSlotProps.js";
+41
View File
@@ -0,0 +1,41 @@
import * as React from 'react';
import { AppendOwnerStateReturnType } from "../appendOwnerState/index.js";
import { MergeSlotPropsParameters, MergeSlotPropsResult, WithCommonProps } from "../mergeSlotProps/index.js";
export type UseSlotPropsParameters<ElementType extends React.ElementType, SlotProps, ExternalForwardedProps, ExternalSlotProps, AdditionalProps, OwnerState> = Omit<MergeSlotPropsParameters<SlotProps, ExternalForwardedProps, ExternalSlotProps, AdditionalProps>, 'externalSlotProps'> & {
/**
* The type of the component used in the slot.
*/
elementType: ElementType | undefined;
/**
* The `slotProps.*` of the Base UI component.
*/
externalSlotProps: ExternalSlotProps | ((ownerState: OwnerState) => ExternalSlotProps) | undefined;
/**
* The ownerState of the Base UI component.
*/
ownerState: OwnerState;
/**
* Set to true if the slotProps callback should receive more props.
*/
skipResolvingSlotProps?: boolean;
};
export type UseSlotPropsResult<ElementType extends React.ElementType, SlotProps, AdditionalProps, OwnerState> = AppendOwnerStateReturnType<ElementType, MergeSlotPropsResult<SlotProps, object, object, AdditionalProps>['props'] & {
ref: ((instance: any | null) => void) | null;
}, OwnerState>;
/**
* @ignore - do not document.
* Builds the props to be passed into the slot of an unstyled component.
* It merges the internal props of the component with the ones supplied by the user, allowing to customize the behavior.
* If the slot component is not a host component, it also merges in the `ownerState`.
*
* @param parameters.getSlotProps - A function that returns the props to be passed to the slot component.
*/
declare function useSlotProps<ElementType extends React.ElementType, SlotProps, AdditionalProps, OwnerState>(parameters: UseSlotPropsParameters<ElementType, SlotProps, object, WithCommonProps<Record<string, any>>, AdditionalProps, OwnerState>): import("@mui/types").Simplify<import("@mui/types").Simplify<SlotProps & object & AdditionalProps & {
className?: string;
style?: React.CSSProperties;
}> & {
ref: ((instance: any | null) => void) | null;
} & {
ownerState: ElementType extends React.ComponentType<any> ? OwnerState : ElementType extends keyof React.JSX.IntrinsicElements ? undefined : OwnerState | undefined;
}>;
export default useSlotProps;
Loaded 100 of 56062 files, more files were not shown because too many files have changed in this diff. Show more