worked on GarageApp stuff
This commit is contained in:
parent
60aaf17af3
commit
eb606572b0
51919 changed files with 2168177 additions and 18 deletions
38
node_modules/@mui/material/esm/RadioGroup/RadioGroup.d.ts
generated
vendored
Normal file
38
node_modules/@mui/material/esm/RadioGroup/RadioGroup.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import * as React from 'react';
|
||||
import { FormGroupProps } from "../FormGroup/index.js";
|
||||
export interface RadioGroupProps extends Omit<FormGroupProps, 'onChange'> {
|
||||
/**
|
||||
* The default value. Use when the component is not controlled.
|
||||
*/
|
||||
defaultValue?: any;
|
||||
/**
|
||||
* The name used to reference the value of the control.
|
||||
* If you don't provide this prop, it falls back to a randomly generated name.
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Callback fired when a radio button is selected.
|
||||
*
|
||||
* @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
|
||||
* @param {string} value The value of the selected radio button.
|
||||
* You can pull out the new value by accessing `event.target.value` (string).
|
||||
*/
|
||||
onChange?: (event: React.ChangeEvent<HTMLInputElement>, value: string) => void;
|
||||
/**
|
||||
* Value of the selected radio button. The DOM API casts this to a string.
|
||||
*/
|
||||
value?: any;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Demos:
|
||||
*
|
||||
* - [Radio Group](https://mui.com/material-ui/react-radio-button/)
|
||||
*
|
||||
* API:
|
||||
*
|
||||
* - [RadioGroup API](https://mui.com/material-ui/api/radio-group/)
|
||||
* - inherits [FormGroup API](https://mui.com/material-ui/api/form-group/)
|
||||
*/
|
||||
export default function RadioGroup(props: RadioGroupProps): React.JSX.Element;
|
||||
114
node_modules/@mui/material/esm/RadioGroup/RadioGroup.js
generated
vendored
Normal file
114
node_modules/@mui/material/esm/RadioGroup/RadioGroup.js
generated
vendored
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import FormGroup from "../FormGroup/index.js";
|
||||
import { getRadioGroupUtilityClass } from "./radioGroupClasses.js";
|
||||
import useForkRef from "../utils/useForkRef.js";
|
||||
import useControlled from "../utils/useControlled.js";
|
||||
import RadioGroupContext from "./RadioGroupContext.js";
|
||||
import useId from "../utils/useId.js";
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
const useUtilityClasses = props => {
|
||||
const {
|
||||
classes,
|
||||
row,
|
||||
error
|
||||
} = props;
|
||||
const slots = {
|
||||
root: ['root', row && 'row', error && 'error']
|
||||
};
|
||||
return composeClasses(slots, getRadioGroupUtilityClass, classes);
|
||||
};
|
||||
const RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref) {
|
||||
const {
|
||||
// private
|
||||
// eslint-disable-next-line react/prop-types
|
||||
actions,
|
||||
children,
|
||||
className,
|
||||
defaultValue,
|
||||
name: nameProp,
|
||||
onChange,
|
||||
value: valueProp,
|
||||
...other
|
||||
} = props;
|
||||
const rootRef = React.useRef(null);
|
||||
const classes = useUtilityClasses(props);
|
||||
const [value, setValueState] = useControlled({
|
||||
controlled: valueProp,
|
||||
default: defaultValue,
|
||||
name: 'RadioGroup'
|
||||
});
|
||||
React.useImperativeHandle(actions, () => ({
|
||||
focus: () => {
|
||||
let input = rootRef.current.querySelector('input:not(:disabled):checked');
|
||||
if (!input) {
|
||||
input = rootRef.current.querySelector('input:not(:disabled)');
|
||||
}
|
||||
if (input) {
|
||||
input.focus();
|
||||
}
|
||||
}
|
||||
}), []);
|
||||
const handleRef = useForkRef(ref, rootRef);
|
||||
const name = useId(nameProp);
|
||||
const contextValue = React.useMemo(() => ({
|
||||
name,
|
||||
onChange(event) {
|
||||
setValueState(event.target.value);
|
||||
if (onChange) {
|
||||
onChange(event, event.target.value);
|
||||
}
|
||||
},
|
||||
value
|
||||
}), [name, onChange, setValueState, value]);
|
||||
return /*#__PURE__*/_jsx(RadioGroupContext.Provider, {
|
||||
value: contextValue,
|
||||
children: /*#__PURE__*/_jsx(FormGroup, {
|
||||
role: "radiogroup",
|
||||
ref: handleRef,
|
||||
className: clsx(classes.root, className),
|
||||
...other,
|
||||
children: children
|
||||
})
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? RadioGroup.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,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className: PropTypes.string,
|
||||
/**
|
||||
* The default value. Use when the component is not controlled.
|
||||
*/
|
||||
defaultValue: PropTypes.any,
|
||||
/**
|
||||
* The name used to reference the value of the control.
|
||||
* If you don't provide this prop, it falls back to a randomly generated name.
|
||||
*/
|
||||
name: PropTypes.string,
|
||||
/**
|
||||
* Callback fired when a radio button is selected.
|
||||
*
|
||||
* @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
|
||||
* @param {string} value The value of the selected radio button.
|
||||
* You can pull out the new value by accessing `event.target.value` (string).
|
||||
*/
|
||||
onChange: PropTypes.func,
|
||||
/**
|
||||
* Value of the selected radio button. The DOM API casts this to a string.
|
||||
*/
|
||||
value: PropTypes.any
|
||||
} : void 0;
|
||||
export default RadioGroup;
|
||||
11
node_modules/@mui/material/esm/RadioGroup/RadioGroupContext.d.ts
generated
vendored
Normal file
11
node_modules/@mui/material/esm/RadioGroup/RadioGroupContext.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import * as React from 'react';
|
||||
export interface RadioGroupContextValue {
|
||||
name: string | undefined;
|
||||
onChange: (event: React.ChangeEvent<HTMLInputElement>, value: string) => void;
|
||||
value: any;
|
||||
}
|
||||
/**
|
||||
* @ignore - internal component.
|
||||
*/
|
||||
declare const RadioGroupContext: React.Context<RadioGroupContextValue | undefined>;
|
||||
export default RadioGroupContext;
|
||||
11
node_modules/@mui/material/esm/RadioGroup/RadioGroupContext.js
generated
vendored
Normal file
11
node_modules/@mui/material/esm/RadioGroup/RadioGroupContext.js
generated
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
/**
|
||||
* @ignore - internal component.
|
||||
*/
|
||||
const RadioGroupContext = /*#__PURE__*/React.createContext(undefined);
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
RadioGroupContext.displayName = 'RadioGroupContext';
|
||||
}
|
||||
export default RadioGroupContext;
|
||||
5
node_modules/@mui/material/esm/RadioGroup/index.d.ts
generated
vendored
Normal file
5
node_modules/@mui/material/esm/RadioGroup/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
export { default } from "./RadioGroup.js";
|
||||
export * from "./RadioGroup.js";
|
||||
export { default as useRadioGroup, RadioGroupState } from "./useRadioGroup.js";
|
||||
export { default as radioGroupClasses } from "./radioGroupClasses.js";
|
||||
export * from "./radioGroupClasses.js";
|
||||
4
node_modules/@mui/material/esm/RadioGroup/index.js
generated
vendored
Normal file
4
node_modules/@mui/material/esm/RadioGroup/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
export { default } from "./RadioGroup.js";
|
||||
export { default as useRadioGroup } from "./useRadioGroup.js";
|
||||
export { default as radioGroupClasses } from "./radioGroupClasses.js";
|
||||
export * from "./radioGroupClasses.js";
|
||||
6
node_modules/@mui/material/esm/RadioGroup/radioGroupClasses.d.ts
generated
vendored
Normal file
6
node_modules/@mui/material/esm/RadioGroup/radioGroupClasses.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import { FormGroupClasses } from "../FormGroup/index.js";
|
||||
export type RadioGroupClassKey = keyof FormGroupClasses;
|
||||
export type RadioGroupClasses = FormGroupClasses;
|
||||
export declare function getRadioGroupUtilityClass(slot: string): string;
|
||||
declare const radioGroupClasses: RadioGroupClasses;
|
||||
export default radioGroupClasses;
|
||||
7
node_modules/@mui/material/esm/RadioGroup/radioGroupClasses.js
generated
vendored
Normal file
7
node_modules/@mui/material/esm/RadioGroup/radioGroupClasses.js
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getRadioGroupUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiRadioGroup', slot);
|
||||
}
|
||||
const radioGroupClasses = generateUtilityClasses('MuiRadioGroup', ['root', 'row', 'error']);
|
||||
export default radioGroupClasses;
|
||||
3
node_modules/@mui/material/esm/RadioGroup/useRadioGroup.d.ts
generated
vendored
Normal file
3
node_modules/@mui/material/esm/RadioGroup/useRadioGroup.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import { RadioGroupContextValue } from "./RadioGroupContext.js";
|
||||
export interface RadioGroupState extends RadioGroupContextValue {}
|
||||
export default function useRadioGroup(): RadioGroupState | undefined;
|
||||
7
node_modules/@mui/material/esm/RadioGroup/useRadioGroup.js
generated
vendored
Normal file
7
node_modules/@mui/material/esm/RadioGroup/useRadioGroup.js
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import RadioGroupContext from "./RadioGroupContext.js";
|
||||
export default function useRadioGroup() {
|
||||
return React.useContext(RadioGroupContext);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue