Initial commit: Crypto trader application

This commit is contained in:
2025-12-25 20:20:40 -05:00
commit 07a04c1bb8
47895 changed files with 2042266 additions and 0 deletions
+288
View File
@@ -0,0 +1,288 @@
import * as React from 'react';
import { SxProps } from '@mui/system';
import { OverridableStringUnion } from '@mui/types';
import { InternalStandardProps as StandardProps } from '..';
import { FormControlProps } from '../FormControl';
import { FormHelperTextProps } from '../FormHelperText';
import { InputBaseProps } from '../InputBase';
import { InputProps as StandardInputProps } from '../Input';
import { FilledInputProps } from '../FilledInput';
import { OutlinedInputProps } from '../OutlinedInput';
import { InputLabelProps } from '../InputLabel';
import { SelectProps } from '../Select';
import { Theme } from '../styles';
import { TextFieldClasses } from './textFieldClasses';
export interface TextFieldPropsColorOverrides {}
export interface TextFieldPropsSizeOverrides {}
export interface BaseTextFieldProps
extends StandardProps<
FormControlProps,
// event handlers are declared on derived interfaces
'onChange' | 'onBlur' | 'onFocus' | 'defaultValue'
> {
/**
* This prop helps users to fill forms faster, especially on mobile devices.
* The name can be confusing, as it's more like an autofill.
* You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).
*/
autoComplete?: string;
/**
* If `true`, the `input` element is focused during the first mount.
* @default false
*/
autoFocus?: boolean;
/**
* @ignore
*/
children?: FormControlProps['children'];
/**
* Override or extend the styles applied to the component.
*/
classes?: Partial<TextFieldClasses>;
/**
* The color of the component.
* It supports both default and custom theme colors, which can be added as shown in the
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
* @default 'primary'
*/
color?: OverridableStringUnion<
'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning',
TextFieldPropsColorOverrides
>;
/**
* The default value. Use when the component is not controlled.
*/
defaultValue?: unknown;
/**
* If `true`, the component is disabled.
* @default false
*/
disabled?: boolean;
/**
* If `true`, the label is displayed in an error state.
* @default false
*/
error?: boolean;
/**
* Props applied to the [`FormHelperText`](/material-ui/api/form-helper-text/) element.
*/
FormHelperTextProps?: Partial<FormHelperTextProps>;
/**
* If `true`, the input will take up the full width of its container.
* @default false
*/
fullWidth?: boolean;
/**
* The helper text content.
*/
helperText?: React.ReactNode;
/**
* The id of the `input` element.
* Use this prop to make `label` and `helperText` accessible for screen readers.
*/
id?: string;
/**
* Props applied to the [`InputLabel`](/material-ui/api/input-label/) element.
* Pointer events like `onClick` are enabled if and only if `shrink` is `true`.
*/
InputLabelProps?: Partial<InputLabelProps>;
/**
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
*/
inputProps?: InputBaseProps['inputProps'];
/**
* Pass a ref to the `input` element.
*/
inputRef?: React.Ref<any>;
/**
* The label content.
*/
label?: React.ReactNode;
/**
* If `true`, a `textarea` element is rendered instead of an input.
* @default false
*/
multiline?: boolean;
/**
* Name attribute of the `input` element.
*/
name?: string;
onBlur?: InputBaseProps['onBlur'];
onFocus?: StandardInputProps['onFocus'];
/**
* The short hint displayed in the `input` before the user enters a value.
*/
placeholder?: string;
/**
* If `true`, the label is displayed as required and the `input` element is required.
* @default false
*/
required?: boolean;
/**
* Number of rows to display when multiline option is set to true.
*/
rows?: string | number;
/**
* Maximum number of rows to display when multiline option is set to true.
*/
maxRows?: string | number;
/**
* Minimum number of rows to display when multiline option is set to true.
*/
minRows?: string | number;
/**
* Render a [`Select`](/material-ui/api/select/) element while passing the Input element to `Select` as `input` parameter.
* If this option is set you must pass the options of the select as children.
* @default false
*/
select?: boolean;
/**
* Props applied to the [`Select`](/material-ui/api/select/) element.
*/
SelectProps?: Partial<SelectProps>;
/**
* The size of the component.
*/
size?: OverridableStringUnion<'small' | 'medium', TextFieldPropsSizeOverrides>;
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme>;
/**
* Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).
*/
type?: React.InputHTMLAttributes<unknown>['type'];
/**
* The value of the `input` element, required for a controlled component.
*/
value?: unknown;
}
export interface StandardTextFieldProps extends BaseTextFieldProps {
/**
* Callback fired when the value is changed.
*
* @param {object} event The event source of the callback.
* You can pull out the new value by accessing `event.target.value` (string).
*/
onChange?: StandardInputProps['onChange'];
/**
* The variant to use.
* @default 'outlined'
*/
variant?: 'standard';
/**
* Props applied to the Input element.
* It will be a [`FilledInput`](/material-ui/api/filled-input/),
* [`OutlinedInput`](/material-ui/api/outlined-input/) or [`Input`](/material-ui/api/input/)
* component depending on the `variant` prop value.
*/
InputProps?: Partial<StandardInputProps>;
}
export interface FilledTextFieldProps extends BaseTextFieldProps {
/**
* Callback fired when the value is changed.
*
* @param {object} event The event source of the callback.
* You can pull out the new value by accessing `event.target.value` (string).
*/
onChange?: FilledInputProps['onChange'];
/**
* The variant to use.
* @default 'outlined'
*/
variant: 'filled';
/**
* Props applied to the Input element.
* It will be a [`FilledInput`](/material-ui/api/filled-input/),
* [`OutlinedInput`](/material-ui/api/outlined-input/) or [`Input`](/material-ui/api/input/)
* component depending on the `variant` prop value.
*/
InputProps?: Partial<FilledInputProps>;
}
export interface OutlinedTextFieldProps extends BaseTextFieldProps {
/**
* Callback fired when the value is changed.
*
* @param {object} event The event source of the callback.
* You can pull out the new value by accessing `event.target.value` (string).
*/
onChange?: OutlinedInputProps['onChange'];
/**
* The variant to use.
* @default 'outlined'
*/
variant: 'outlined';
/**
* Props applied to the Input element.
* It will be a [`FilledInput`](/material-ui/api/filled-input/),
* [`OutlinedInput`](/material-ui/api/outlined-input/) or [`Input`](/material-ui/api/input/)
* component depending on the `variant` prop value.
*/
InputProps?: Partial<OutlinedInputProps>;
}
export type TextFieldVariants = 'outlined' | 'standard' | 'filled';
export type TextFieldProps<Variant extends TextFieldVariants = TextFieldVariants> =
Variant extends 'filled'
? FilledTextFieldProps
: Variant extends 'standard'
? StandardTextFieldProps
: OutlinedTextFieldProps;
/**
* The `TextField` is a convenience wrapper for the most common cases (80%).
* It cannot be all things to all people, otherwise the API would grow out of control.
*
* ## Advanced Configuration
*
* It's important to understand that the text field is a simple abstraction
* on top of the following components:
*
* * [FormControl](https://mui.com/material-ui/api/form-control/)
* * [InputLabel](https://mui.com/material-ui/api/input-label/)
* * [FilledInput](https://mui.com/material-ui/api/filled-input/)
* * [OutlinedInput](https://mui.com/material-ui/api/outlined-input/)
* * [Input](https://mui.com/material-ui/api/input/)
* * [FormHelperText](https://mui.com/material-ui/api/form-helper-text/)
*
* If you wish to alter the props applied to the `input` element, you can do so as follows:
*
* ```jsx
* const inputProps = {
* step: 300,
* };
*
* return <TextField id="time" type="time" inputProps={inputProps} />;
* ```
*
* For advanced cases, please look at the source of TextField by clicking on the
* "Edit this page" button above. Consider either:
*
* * using the upper case props for passing values directly to the components
* * using the underlying components directly as shown in the demos
*
* Demos:
*
* - [Autocomplete](https://mui.com/material-ui/react-autocomplete/)
* - [Text Field](https://mui.com/material-ui/react-text-field/)
*
* API:
*
* - [TextField API](https://mui.com/material-ui/api/text-field/)
* - inherits [FormControl API](https://mui.com/material-ui/api/form-control/)
*/
export default function TextField<Variant extends TextFieldVariants>(
props: {
/**
* The variant to use.
* @default 'outlined'
*/
variant?: Variant;
} & Omit<TextFieldProps, 'variant'>,
): React.JSX.Element;
+376
View File
@@ -0,0 +1,376 @@
'use client';
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
const _excluded = ["autoComplete", "autoFocus", "children", "className", "color", "defaultValue", "disabled", "error", "FormHelperTextProps", "fullWidth", "helperText", "id", "InputLabelProps", "inputProps", "InputProps", "inputRef", "label", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onFocus", "placeholder", "required", "rows", "select", "SelectProps", "type", "value", "variant"];
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import composeClasses from '@mui/utils/composeClasses';
import useId from '@mui/utils/useId';
import refType from '@mui/utils/refType';
import styled from '../styles/styled';
import { useDefaultProps } from '../DefaultPropsProvider';
import Input from '../Input';
import FilledInput from '../FilledInput';
import OutlinedInput from '../OutlinedInput';
import InputLabel from '../InputLabel';
import FormControl from '../FormControl';
import FormHelperText from '../FormHelperText';
import Select from '../Select';
import { getTextFieldUtilityClass } from './textFieldClasses';
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
const variantComponent = {
standard: Input,
filled: FilledInput,
outlined: OutlinedInput
};
const useUtilityClasses = ownerState => {
const {
classes
} = ownerState;
const slots = {
root: ['root']
};
return composeClasses(slots, getTextFieldUtilityClass, classes);
};
const TextFieldRoot = styled(FormControl, {
name: 'MuiTextField',
slot: 'Root',
overridesResolver: (props, styles) => styles.root
})({});
/**
* The `TextField` is a convenience wrapper for the most common cases (80%).
* It cannot be all things to all people, otherwise the API would grow out of control.
*
* ## Advanced Configuration
*
* It's important to understand that the text field is a simple abstraction
* on top of the following components:
*
* - [FormControl](/material-ui/api/form-control/)
* - [InputLabel](/material-ui/api/input-label/)
* - [FilledInput](/material-ui/api/filled-input/)
* - [OutlinedInput](/material-ui/api/outlined-input/)
* - [Input](/material-ui/api/input/)
* - [FormHelperText](/material-ui/api/form-helper-text/)
*
* If you wish to alter the props applied to the `input` element, you can do so as follows:
*
* ```jsx
* const inputProps = {
* step: 300,
* };
*
* return <TextField id="time" type="time" inputProps={inputProps} />;
* ```
*
* For advanced cases, please look at the source of TextField by clicking on the
* "Edit this page" button above. Consider either:
*
* - using the upper case props for passing values directly to the components
* - using the underlying components directly as shown in the demos
*/
const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref) {
const props = useDefaultProps({
props: inProps,
name: 'MuiTextField'
});
const {
autoComplete,
autoFocus = false,
children,
className,
color = 'primary',
defaultValue,
disabled = false,
error = false,
FormHelperTextProps,
fullWidth = false,
helperText,
id: idOverride,
InputLabelProps,
inputProps,
InputProps,
inputRef,
label,
maxRows,
minRows,
multiline = false,
name,
onBlur,
onChange,
onFocus,
placeholder,
required = false,
rows,
select = false,
SelectProps,
type,
value,
variant = 'outlined'
} = props,
other = _objectWithoutPropertiesLoose(props, _excluded);
const ownerState = _extends({}, props, {
autoFocus,
color,
disabled,
error,
fullWidth,
multiline,
required,
select,
variant
});
const classes = useUtilityClasses(ownerState);
if (process.env.NODE_ENV !== 'production') {
if (select && !children) {
console.error('MUI: `children` must be passed when using the `TextField` component with `select`.');
}
}
const InputMore = {};
if (variant === 'outlined') {
if (InputLabelProps && typeof InputLabelProps.shrink !== 'undefined') {
InputMore.notched = InputLabelProps.shrink;
}
InputMore.label = label;
}
if (select) {
// unset defaults from textbox inputs
if (!SelectProps || !SelectProps.native) {
InputMore.id = undefined;
}
InputMore['aria-describedby'] = undefined;
}
const id = useId(idOverride);
const helperTextId = helperText && id ? `${id}-helper-text` : undefined;
const inputLabelId = label && id ? `${id}-label` : undefined;
const InputComponent = variantComponent[variant];
const InputElement = /*#__PURE__*/_jsx(InputComponent, _extends({
"aria-describedby": helperTextId,
autoComplete: autoComplete,
autoFocus: autoFocus,
defaultValue: defaultValue,
fullWidth: fullWidth,
multiline: multiline,
name: name,
rows: rows,
maxRows: maxRows,
minRows: minRows,
type: type,
value: value,
id: id,
inputRef: inputRef,
onBlur: onBlur,
onChange: onChange,
onFocus: onFocus,
placeholder: placeholder,
inputProps: inputProps
}, InputMore, InputProps));
return /*#__PURE__*/_jsxs(TextFieldRoot, _extends({
className: clsx(classes.root, className),
disabled: disabled,
error: error,
fullWidth: fullWidth,
ref: ref,
required: required,
color: color,
variant: variant,
ownerState: ownerState
}, other, {
children: [label != null && label !== '' && /*#__PURE__*/_jsx(InputLabel, _extends({
htmlFor: id,
id: inputLabelId
}, InputLabelProps, {
children: label
})), select ? /*#__PURE__*/_jsx(Select, _extends({
"aria-describedby": helperTextId,
id: id,
labelId: inputLabelId,
value: value,
input: InputElement
}, SelectProps, {
children: children
})) : InputElement, helperText && /*#__PURE__*/_jsx(FormHelperText, _extends({
id: helperTextId
}, FormHelperTextProps, {
children: helperText
}))]
}));
});
process.env.NODE_ENV !== "production" ? TextField.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`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* This prop helps users to fill forms faster, especially on mobile devices.
* The name can be confusing, as it's more like an autofill.
* You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).
*/
autoComplete: PropTypes.string,
/**
* If `true`, the `input` element is focused during the first mount.
* @default false
*/
autoFocus: PropTypes.bool,
/**
* @ignore
*/
children: PropTypes.node,
/**
* Override or extend the styles applied to the component.
*/
classes: PropTypes.object,
/**
* @ignore
*/
className: PropTypes.string,
/**
* The color of the component.
* It supports both default and custom theme colors, which can be added as shown in the
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
* @default 'primary'
*/
color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),
/**
* The default value. Use when the component is not controlled.
*/
defaultValue: PropTypes.any,
/**
* If `true`, the component is disabled.
* @default false
*/
disabled: PropTypes.bool,
/**
* If `true`, the label is displayed in an error state.
* @default false
*/
error: PropTypes.bool,
/**
* Props applied to the [`FormHelperText`](/material-ui/api/form-helper-text/) element.
*/
FormHelperTextProps: PropTypes.object,
/**
* If `true`, the input will take up the full width of its container.
* @default false
*/
fullWidth: PropTypes.bool,
/**
* The helper text content.
*/
helperText: PropTypes.node,
/**
* The id of the `input` element.
* Use this prop to make `label` and `helperText` accessible for screen readers.
*/
id: PropTypes.string,
/**
* Props applied to the [`InputLabel`](/material-ui/api/input-label/) element.
* Pointer events like `onClick` are enabled if and only if `shrink` is `true`.
*/
InputLabelProps: PropTypes.object,
/**
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
*/
inputProps: PropTypes.object,
/**
* Props applied to the Input element.
* It will be a [`FilledInput`](/material-ui/api/filled-input/),
* [`OutlinedInput`](/material-ui/api/outlined-input/) or [`Input`](/material-ui/api/input/)
* component depending on the `variant` prop value.
*/
InputProps: PropTypes.object,
/**
* Pass a ref to the `input` element.
*/
inputRef: refType,
/**
* The label content.
*/
label: PropTypes.node,
/**
* If `dense` or `normal`, will adjust vertical spacing of this and contained components.
* @default 'none'
*/
margin: PropTypes.oneOf(['dense', 'none', 'normal']),
/**
* Maximum number of rows to display when multiline option is set to true.
*/
maxRows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
/**
* Minimum number of rows to display when multiline option is set to true.
*/
minRows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
/**
* If `true`, a `textarea` element is rendered instead of an input.
* @default false
*/
multiline: PropTypes.bool,
/**
* Name attribute of the `input` element.
*/
name: PropTypes.string,
/**
* @ignore
*/
onBlur: PropTypes.func,
/**
* Callback fired when the value is changed.
*
* @param {object} event The event source of the callback.
* You can pull out the new value by accessing `event.target.value` (string).
*/
onChange: PropTypes.func,
/**
* @ignore
*/
onFocus: PropTypes.func,
/**
* The short hint displayed in the `input` before the user enters a value.
*/
placeholder: PropTypes.string,
/**
* If `true`, the label is displayed as required and the `input` element is required.
* @default false
*/
required: PropTypes.bool,
/**
* Number of rows to display when multiline option is set to true.
*/
rows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
/**
* Render a [`Select`](/material-ui/api/select/) element while passing the Input element to `Select` as `input` parameter.
* If this option is set you must pass the options of the select as children.
* @default false
*/
select: PropTypes.bool,
/**
* Props applied to the [`Select`](/material-ui/api/select/) element.
*/
SelectProps: PropTypes.object,
/**
* The size of the component.
*/
size: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['medium', 'small']), PropTypes.string]),
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
/**
* Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).
*/
type: PropTypes /* @typescript-to-proptypes-ignore */.string,
/**
* The value of the `input` element, required for a controlled component.
*/
value: PropTypes.any,
/**
* The variant to use.
* @default 'outlined'
*/
variant: PropTypes.oneOf(['filled', 'outlined', 'standard'])
} : void 0;
export default TextField;
+5
View File
@@ -0,0 +1,5 @@
export { default } from './TextField';
export * from './TextField';
export { default as textFieldClasses } from './textFieldClasses';
export * from './textFieldClasses';
+5
View File
@@ -0,0 +1,5 @@
'use client';
export { default } from './TextField';
export { default as textFieldClasses } from './textFieldClasses';
export * from './textFieldClasses';
+6
View File
@@ -0,0 +1,6 @@
{
"sideEffects": false,
"module": "./index.js",
"main": "../node/TextField/index.js",
"types": "./index.d.ts"
}
+8
View File
@@ -0,0 +1,8 @@
export interface TextFieldClasses {
/** Styles applied to the root element. */
root: string;
}
export type TextFieldClassKey = keyof TextFieldClasses;
export declare function getTextFieldUtilityClass(slot: string): string;
declare const textFieldClasses: TextFieldClasses;
export default textFieldClasses;
+7
View File
@@ -0,0 +1,7 @@
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
import generateUtilityClass from '@mui/utils/generateUtilityClass';
export function getTextFieldUtilityClass(slot) {
return generateUtilityClass('MuiTextField', slot);
}
const textFieldClasses = generateUtilityClasses('MuiTextField', ['root']);
export default textFieldClasses;