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

+125
View File
@@ -0,0 +1,125 @@
import * as React from 'react';
import { SxProps } from '@mui/system';
import { Theme } from "../styles/index.js";
import { TouchRippleActions, TouchRippleProps } from "./TouchRipple.js";
import { OverrideProps, OverridableComponent, OverridableTypeMap } from "../OverridableComponent/index.js";
import { ButtonBaseClasses } from "./buttonBaseClasses.js";
export { TouchRippleActions, TouchRippleProps };
export interface ButtonBaseOwnProps {
/**
* A ref for imperative actions.
* It currently only supports `focusVisible()` action.
*/
action?: React.Ref<ButtonBaseActions>;
/**
* If `true`, the ripples are centered.
* They won't start at the cursor interaction position.
* @default false
*/
centerRipple?: boolean;
/**
* The content of the component.
*/
children?: React.ReactNode;
/**
* Override or extend the styles applied to the component.
*/
classes?: Partial<ButtonBaseClasses>;
/**
* If `true`, the component is disabled.
* @default false
*/
disabled?: boolean;
/**
* 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?: boolean;
/**
* If `true`, the touch ripple effect is disabled.
* @default false
*/
disableTouchRipple?: boolean;
/**
* If `true`, the base button will have a keyboard focus ripple.
* @default false
*/
focusRipple?: boolean;
/**
* 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?: string;
/**
* The component used to render a link when the `href` prop is provided.
* @default 'a'
*/
LinkComponent?: React.ElementType;
/**
* Callback fired when the component is focused with a keyboard.
* We trigger a `onFocus` callback too.
*/
onFocusVisible?: React.FocusEventHandler<any>;
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme>;
/**
* @default 0
*/
tabIndex?: NonNullable<React.HTMLAttributes<any>['tabIndex']>;
/**
* Props applied to the `TouchRipple` element.
*/
TouchRippleProps?: Partial<TouchRippleProps>;
/**
* A ref that points to the `TouchRipple` element.
*/
touchRippleRef?: React.Ref<TouchRippleActions>;
}
export interface ButtonBaseTypeMap<AdditionalProps = {}, RootComponent extends React.ElementType = 'button'> {
props: AdditionalProps & ButtonBaseOwnProps;
defaultComponent: RootComponent;
}
/**
* utility to create component types that inherit props from ButtonBase.
* This component has an additional overload if the `href` prop is set which
* can make extension quite tricky
*/
export interface ExtendButtonBaseTypeMap<TypeMap extends OverridableTypeMap> {
props: TypeMap['props'] & Omit<ButtonBaseTypeMap['props'], 'classes'>;
defaultComponent: TypeMap['defaultComponent'];
}
export type ExtendButtonBase<TypeMap extends OverridableTypeMap> = ((props: {
href: string;
} & OverrideProps<ExtendButtonBaseTypeMap<TypeMap>, 'a'>) => React.JSX.Element) & OverridableComponent<ExtendButtonBaseTypeMap<TypeMap>>;
/**
* `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.
*
* Demos:
*
* - [Button](https://mui.com/material-ui/react-button/)
*
* API:
*
* - [ButtonBase API](https://mui.com/material-ui/api/button-base/)
*/
declare const ButtonBase: ExtendButtonBase<ButtonBaseTypeMap>;
export type ButtonBaseProps<RootComponent extends React.ElementType = ButtonBaseTypeMap['defaultComponent'], AdditionalProps = {}> = OverrideProps<ButtonBaseTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
component?: React.ElementType;
};
export interface ButtonBaseActions {
focusVisible(): void;
}
export default ButtonBase;
+22
View File
@@ -0,0 +1,22 @@
import * as React from 'react';
import { InternalStandardProps as StandardProps } from "../index.js";
import { TouchRippleClasses, TouchRippleClassKey } from "./touchRippleClasses.js";
export { TouchRippleClassKey };
export interface StartActionOptions {
pulsate?: boolean;
center?: boolean;
}
export interface TouchRippleActions {
start: (event?: React.SyntheticEvent, options?: StartActionOptions, callback?: () => void) => void;
pulsate: (event?: React.SyntheticEvent) => void;
stop: (event?: React.SyntheticEvent, callback?: () => void) => void;
}
export type TouchRippleProps = StandardProps<React.HTMLAttributes<HTMLElement>> & {
center?: boolean;
/**
* Override or extend the styles applied to the component.
*/
classes?: Partial<TouchRippleClasses>;
};
declare const TouchRipple: React.ForwardRefRenderFunction<TouchRippleActions, TouchRippleProps>;
export default TouchRipple;
+12
View File
@@ -0,0 +1,12 @@
export interface ButtonBaseClasses {
/** Styles applied to the root element. */
root: string;
/** State class applied to the root element if `disabled={true}`. */
disabled: string;
/** State class applied to the root element if keyboard focused. */
focusVisible: string;
}
export type ButtonBaseClassKey = keyof ButtonBaseClasses;
export declare function getButtonBaseUtilityClass(slot: string): string;
declare const buttonBaseClasses: ButtonBaseClasses;
export default buttonBaseClasses;
+6
View File
@@ -0,0 +1,6 @@
export { default } from "./ButtonBase.js";
export * 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";
+20
View File
@@ -0,0 +1,20 @@
export interface TouchRippleClasses {
/** Styles applied to the root element. */
root: string;
/** Styles applied to the internal `Ripple` components `ripple` class. */
ripple: string;
/** Styles applied to the internal `Ripple` components `rippleVisible` class. */
rippleVisible: string;
/** Styles applied to the internal `Ripple` components `ripplePulsate` class. */
ripplePulsate: string;
/** Styles applied to the internal `Ripple` components `child` class. */
child: string;
/** Styles applied to the internal `Ripple` components `childLeaving` class. */
childLeaving: string;
/** Styles applied to the internal `Ripple` components `childPulsate` class. */
childPulsate: string;
}
export type TouchRippleClassKey = keyof TouchRippleClasses;
export declare function getTouchRippleUtilityClass(slot: string): string;
declare const touchRippleClasses: TouchRippleClasses;
export default touchRippleClasses;