@selfcommunity/react-ui
Version:
React UI Components to integrate a Community created with SelfCommunity Platform.
81 lines (80 loc) • 3.04 kB
TypeScript
import { SCMediaType } from '@selfcommunity/types';
import { BaseTextFieldProps } from '@mui/material/TextField/TextField';
import { InputProps as StandardInputProps } from '@mui/material/Input/Input';
import { FilledInputProps } from '@mui/material/FilledInput';
import { OutlinedInputProps } from '@mui/material/OutlinedInput';
export interface BaseUrlTextFieldProps extends BaseTextFieldProps {
/**
* Callback fired when the media is created.
*
* @param {object} event The event source of the callback.
* You can pull out the new value by accessing `event.target.value` (string).
*/
onSuccess?: (media: SCMediaType) => void;
}
export interface StandardUrlTextFieldProps extends BaseUrlTextFieldProps {
/**
* 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`](/api/filled-input/),
* [`OutlinedInput`](/api/outlined-input/) or [`Input`](/api/input/)
* component depending on the `variant` prop value.
*/
InputProps?: Partial<StandardInputProps>;
}
export interface FilledUrlTextFieldProps extends BaseUrlTextFieldProps {
/**
* 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`](/api/filled-input/),
* [`OutlinedInput`](/api/outlined-input/) or [`Input`](/api/input/)
* component depending on the `variant` prop value.
*/
InputProps?: Partial<FilledInputProps>;
}
export interface OutlinedUrlTextFieldProps extends BaseUrlTextFieldProps {
/**
* 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`](/api/filled-input/),
* [`OutlinedInput`](/api/outlined-input/) or [`Input`](/api/input/)
* component depending on the `variant` prop value.
*/
InputProps?: Partial<OutlinedInputProps>;
}
export type UrlTextFieldProps = StandardUrlTextFieldProps | FilledUrlTextFieldProps | OutlinedUrlTextFieldProps;
declare const _default: (props: UrlTextFieldProps) => JSX.Element;
export default _default;