@selfcommunity/react-ui
Version:
React UI Components to integrate a Community created with SelfCommunity Platform.
78 lines (77 loc) • 2.89 kB
TypeScript
import { BaseTextFieldProps, InputProps as StandardInputProps, FilledInputProps, OutlinedInputProps } from '@mui/material';
import { SCMediaType } from '@selfcommunity/types';
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;