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

+17
View File
@@ -0,0 +1,17 @@
import * as React from 'react';
import { DistributiveOmit, OverridableTypeMap } from '@mui/types';
/**
* A component whose root component can be controlled explicitly with a generic type parameter.
* Adjusts valid props based on the type of `RootComponent`.
*
* @template TypeMap The interface the defines the props and a default root element of the component.
*/
export type PolymorphicComponent<TypeMap extends OverridableTypeMap> = {
<RootComponent extends React.ElementType = TypeMap['defaultComponent']>(props: PolymorphicProps<TypeMap, RootComponent>): React.JSX.Element | null;
propTypes?: any;
displayName?: string | undefined;
};
/**
* Own props of the component augmented with props of the root component.
*/
export type PolymorphicProps<TypeMap extends OverridableTypeMap, RootComponent extends React.ElementType> = TypeMap['props'] & DistributiveOmit<React.ComponentPropsWithRef<RootComponent>, keyof TypeMap['props']>;
+3
View File
@@ -0,0 +1,3 @@
type ItemComparer<Item> = (a: Item, b: Item) => boolean;
declare function areArraysEqual<Item>(array1: ReadonlyArray<Item>, array2: ReadonlyArray<Item>, itemComparer?: ItemComparer<Item>): boolean;
export default areArraysEqual;
+2
View File
@@ -0,0 +1,2 @@
import capitalize from '@mui/utils/capitalize';
export default capitalize;
+2
View File
@@ -0,0 +1,2 @@
import createChainedFunction from '@mui/utils/createChainedFunction';
export default createChainedFunction;
@@ -0,0 +1,12 @@
import { PaletteColorOptions, SimplePaletteColorOptions } from "../styles/createPalette.js";
type AdditionalPropertiesToCheck = (keyof Omit<SimplePaletteColorOptions, 'main'>)[];
/**
* Creates a filter function used to filter simple palette color options.
* The minimum requirement is that the object has a "main" property of type string, this is always checked.
* Optionally, you can pass additional properties to check.
*
* @param additionalPropertiesToCheck - Array containing "light", "dark", and/or "contrastText"
* @returns ([, value]: [any, PaletteColorOptions]) => boolean
*/
export default function createSimplePaletteValueFilter(additionalPropertiesToCheck?: AdditionalPropertiesToCheck): ([, value]: [any, PaletteColorOptions]) => boolean;
export {};
+2
View File
@@ -0,0 +1,2 @@
import SvgIcon from "../SvgIcon/index.js";
export default function createSvgIcon(path: React.ReactNode, displayName: string): typeof SvgIcon;
+2
View File
@@ -0,0 +1,2 @@
import debounce from '@mui/utils/debounce';
export default debounce;
+2
View File
@@ -0,0 +1,2 @@
import deprecatedPropType from '@mui/utils/deprecatedPropType';
export default deprecatedPropType;
+2
View File
@@ -0,0 +1,2 @@
import getScrollbarSize from '@mui/utils/getScrollbarSize';
export default getScrollbarSize;
+20
View File
@@ -0,0 +1,20 @@
export { unstable_ClassNameGenerator } from '@mui/utils';
export { default as capitalize } from "./capitalize.js";
export { default as createChainedFunction } from "./createChainedFunction.js";
export { default as createSvgIcon } from "./createSvgIcon.js";
export { default as debounce } from "./debounce.js";
export { default as deprecatedPropType } from "./deprecatedPropType.js";
export { default as isMuiElement } from "./isMuiElement.js";
export { default as unstable_memoTheme } from "./memoTheme.js";
export { default as ownerDocument } from "./ownerDocument.js";
export { default as ownerWindow } from "./ownerWindow.js";
export { default as requirePropFactory } from "./requirePropFactory.js";
export { default as setRef } from "./setRef.js";
export { default as unstable_useEnhancedEffect } from "./useEnhancedEffect.js";
export { default as unstable_useId } from "./useId.js";
export { default as unsupportedProp } from "./unsupportedProp.js";
export { default as useControlled } from "./useControlled.js";
export { default as useEventCallback } from "./useEventCallback.js";
export { default as useForkRef } from "./useForkRef.js";
export { default as mergeSlotProps } from "./mergeSlotProps.js";
export * from "./types.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;
+2
View File
@@ -0,0 +1,2 @@
import isMuiElement from '@mui/utils/isMuiElement';
export default isMuiElement;
+7
View File
@@ -0,0 +1,7 @@
import { Theme } from "../styles/createTheme.js";
declare const memoTheme: (styleFn: (props: {
theme: Theme;
}) => import("@mui/styled-engine").CSSInterpolation) => (props: {
theme: Theme;
}) => string | number | boolean | import("@mui/styled-engine").ComponentSelector | import("@mui/styled-engine").Keyframes | import("@mui/styled-engine").SerializedStyles | import("@mui/styled-engine").CSSObject | import("@mui/styled-engine").ArrayCSSInterpolation | null;
export default memoTheme;
+2
View File
@@ -0,0 +1,2 @@
import { SlotComponentProps } from '@mui/utils';
export default function mergeSlotProps<T extends SlotComponentProps<React.ElementType, {}, {}>, K = T, U = (T extends Function ? T : K extends Function ? K : T extends undefined ? K : T)>(externalSlotProps: T | undefined, defaultSlotProps: K): U;
+9
View File
@@ -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;
+2
View File
@@ -0,0 +1,2 @@
import ownerDocument from '@mui/utils/ownerDocument';
export default ownerDocument;
+2
View File
@@ -0,0 +1,2 @@
import ownerWindow from '@mui/utils/ownerWindow';
export default ownerWindow;
+2
View File
@@ -0,0 +1,2 @@
import requirePropFactory from '@mui/utils/requirePropFactory';
export default requirePropFactory;
+2
View File
@@ -0,0 +1,2 @@
import setRef from '@mui/utils/setRef';
export default setRef;
+26
View File
@@ -0,0 +1,26 @@
import { SxProps } from '@mui/system';
import { SlotComponentProps } from '@mui/utils';
import { Theme } from "../styles/index.js";
export type { EventHandlers, WithOptionalOwnerState, SlotComponentProps, SlotComponentPropsWithSlotState } from '@mui/utils';
export type SlotCommonProps = {
component?: React.ElementType;
sx?: SxProps<Theme>;
};
export type SlotProps<TSlotComponent extends React.ElementType, TOverrides, TOwnerState> = SlotComponentProps<TSlotComponent, SlotCommonProps & TOverrides, TOwnerState>;
/**
* Use the keys of `Slots` to make sure that K contains all of the keys
*
* @example CreateSlotsAndSlotProps<{ root: React.ElementType, decorator: React.ElementType }, { root: ..., decorator: ... }>
*/
export type CreateSlotsAndSlotProps<Slots, K extends Record<keyof Slots, any>> = {
/**
* The components used for each slot inside.
* @default {}
*/
slots?: Partial<Slots>;
/**
* The props used for each slot inside.
* @default {}
*/
slotProps?: { [P in keyof K]?: K[P] };
};
+2
View File
@@ -0,0 +1,2 @@
import unsupportedProp from '@mui/utils/unsupportedProp';
export default unsupportedProp;
+2
View File
@@ -0,0 +1,2 @@
import useControlled from '@mui/utils/useControlled';
export default useControlled;
+2
View File
@@ -0,0 +1,2 @@
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
export default useEnhancedEffect;
+2
View File
@@ -0,0 +1,2 @@
import useEventCallback from '@mui/utils/useEventCallback';
export default useEventCallback;
+2
View File
@@ -0,0 +1,2 @@
import useForkRef from '@mui/utils/useForkRef';
export default useForkRef;
+2
View File
@@ -0,0 +1,2 @@
import useId from '@mui/utils/useId';
export default useId;
+81
View File
@@ -0,0 +1,81 @@
import * as React from 'react';
import { ClassValue } from 'clsx';
export type WithCommonProps<T> = T & {
className?: string;
style?: React.CSSProperties;
ref?: React.Ref<any>;
};
type EventHandlers = Record<string, React.EventHandler<any>>;
type ExtractComponentProps<P> = P extends infer T | ((ownerState: any) => infer T) ? T : never;
/**
* An internal function to create a Material UI slot.
*
* This is an advanced version of Base UI `useSlotProps` because Material UI allows leaf component to be customized via `component` prop
* while Base UI does not need to support leaf component customization.
*
* @param {string} name: name of the slot
* @param {object} parameters
* @returns {[Slot, slotProps]} The slot's React component and the slot's props
*
* Note: the returned slot's props
* - will never contain `component` prop.
* - might contain `as` prop.
*/
export default function useSlot<T extends string, ElementType extends React.ElementType, SlotProps, OwnerState extends {}, ExternalSlotProps extends {
component?: React.ElementType;
ref?: React.Ref<any>;
}, ExternalForwardedProps extends {
component?: React.ElementType;
slots?: { [k in T]?: React.ElementType };
slotProps?: { [k in T]?: ExternalSlotProps | ((ownerState: OwnerState) => ExternalSlotProps) };
}, AdditionalProps, SlotOwnerState extends {}>(
/**
* The slot's name. All Material UI components should have `root` slot.
*
* If the name is `root`, the logic behaves differently from other slots,
* e.g. the `externalForwardedProps` are spread to `root` slot but not other slots.
*/
name: T, parameters: (T extends 'root' ? {
ref: React.ForwardedRef<any>;
} : {
ref?: React.ForwardedRef<any>;
}) & {
/**
* The slot's className
*/
className: ClassValue | ClassValue[];
/**
* The slot's default styled-component
*/
elementType: ElementType;
/**
* The component's ownerState
*/
ownerState: OwnerState;
/**
* The `other` props from the consumer. It has to contain `component`, `slots`, and `slotProps`.
* The function will use those props to calculate the final rendered element and the returned props.
*
* If the slot is not `root`, the rest of the `externalForwardedProps` are neglected.
*/
externalForwardedProps: ExternalForwardedProps;
getSlotProps?: (other: EventHandlers) => WithCommonProps<SlotProps>;
additionalProps?: WithCommonProps<AdditionalProps>;
/**
* props forward to `T` only if the `slotProps.*.component` is not provided.
* e.g. Autocomplete's listbox uses Popper + StyledComponent
*/
internalForwardedProps?: any;
/**
* Set to true if the `elementType` is a styled component of another Material UI component.
*
* For example, the AlertRoot is a styled component of the Paper component.
* This flag is used to forward the `component` and `slotProps.root.component` to the Paper component.
* Otherwise, the `component` prop will be converted to `as` prop which replaces the Paper component (the paper styles are gone).
*/
shouldForwardComponentProp?: boolean;
}): [ElementType, {
className: string;
ownerState: OwnerState & SlotOwnerState;
} & AdditionalProps & SlotProps & ExternalSlotProps & ExtractComponentProps<Exclude<Exclude<ExternalForwardedProps["slotProps"], undefined>[T], undefined>>];
export {};