UNPKG

@ucheeddev/refine-antd

Version:

Custom Ant Design components for Refine framework

374 lines (309 loc) 11.9 kB
import * as React$1 from 'react'; import React__default, { CSSProperties, ReactNode, PropsWithChildren, SVGProps, ComponentProps } from 'react'; import { BootstrapProps as BootstrapProps$1 } from '@ucheeddev/refine-core'; import { ThemeConfig, ConfigProviderProps, AvatarProps, TableColumnProps, UploadFile, UploadProps, FormItemProps, FormProps, Typography } from 'antd'; import { AntdIconProps } from '@ant-design/icons/lib/components/AntdIcon'; import * as antd_style from 'antd-style'; import * as react_jsx_runtime from 'react/jsx-runtime'; import { ITreeMenu, BaseRecord, UseFormProps, BaseKey } from '@refinedev/core'; import { RefineLayoutThemedTitleProps, ShowButtonProps } from '@refinedev/antd'; import { SizeType } from 'antd/es/config-provider/SizeContext'; import { CustomIconComponentProps } from '@ant-design/icons/lib/components/Icon'; import { UploadProps as UploadProps$1 } from 'antd/es/upload'; type BootstrapProps = Omit<BootstrapProps$1, 'Loading' | 'Error'> & { theme?: ThemeConfig; forceLightTheme?: boolean; configProviderProps?: ConfigProviderProps; }; declare const Bootstrap: React__default.FC<BootstrapProps>; interface CustomAvatarProps extends AvatarProps { name?: string; style?: CSSProperties; } declare const CustomAvatar: React__default.NamedExoticComponent<CustomAvatarProps>; interface EmailLinkProps { email: string; style?: React__default.CSSProperties; } declare const EmailLink: React__default.FC<EmailLinkProps>; type FieldFormTitleProps = { title: string; Icon?: React__default.FC<AntdIconProps>; iconProps?: AntdIconProps; titleStyle?: CSSProperties; } & React__default.HTMLAttributes<HTMLDivElement>; declare const FieldFormTitle: React__default.FC<FieldFormTitleProps>; type AntdFilterDropdownProps = React.ComponentProps<Exclude<TableColumnProps<any>['filterDropdown'], ReactNode>>; type MapValueEvent = 'onChange' | 'value'; type FilterDropdownProps = AntdFilterDropdownProps & { mapValue?: (selectedKeys: React.Key[], event: MapValueEvent) => any; children: JSX.Element; }; declare const FilterDropdown: React__default.FC<FilterDropdownProps>; declare const FullScreenLoading: React__default.FC; type SearchProps$1 = {}; type HeaderWithMenu = { Search?: React.FC<SearchProps$1>; logo?: string; logoWidth?: number; logoHeight?: number; hideThemeButton?: boolean; }; declare const useStyles: (props?: unknown) => antd_style.ReturnStyles<{ headerContainer: { backgroundColor: string; padding: string; minHeight: string; height: string; }; flexContainer: { width: string; maxWidth: string; margin: string; height: string; }; headerTitleRefine: { fontFamily: "Bricolage Grotesque, sans-serif"; color: string; }; headerTitleInvoicer: { fontFamily: "Bricolage Grotesque, sans-serif"; color: string; fontWeight: number; }; tabs: antd_style.SerializedStyles; inputSuffix: { width: string; height: string; display: "flex"; alignItems: "center"; justifyContent: "center"; backgroundColor: string; color: string; borderRadius: string; fontSize: string; }; inputPrefix: { color: string; marginRight: string; }; languageSwitchText: { color: string; }; languageSwitchIcon: { color: string; width: string; }; themeSwitch: { display: "flex"; alignItems: "center"; justifyContent: "center"; height: string; width: string; borderRadius: string; cursor: "pointer"; flexShrink: number; backgroundColor: string; }; rightSlot: { marginLeft: string; '@media (max-width: 1000px)': { padding: string; }; }; }>; type FullWidthLayoutProps = PropsWithChildren & { headerProps?: HeaderWithMenu; }; declare const FullWidthLayout: React__default.FC<FullWidthLayoutProps>; type SearchProps = {}; type HeaderWithSearchProps = { Search?: React__default.FC<SearchProps>; }; declare const HeaderWithSearch: React__default.FC<HeaderWithSearchProps>; declare const IconInvoicerLogo: (props: SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element; declare const IconMoon: () => react_jsx_runtime.JSX.Element; declare const IconSun: () => react_jsx_runtime.JSX.Element; type ImageUploadProps = { fileList?: UploadFile[]; listType?: UploadProps['listType']; onPreview?: (file: UploadFile) => void; onChange?: UploadProps['onChange']; previewImage?: string; previewImageOpen?: boolean; onVisibleChange?: (visible: boolean) => void; afterOpenChange?: (visible: boolean) => void; onRemove?: (file: UploadFile<any>) => void; multiple?: boolean; disabled?: boolean; }; declare const ImageUpload: React.FC<ImageUploadProps>; type TitleProps = RefineLayoutThemedTitleProps & { name: string; logo: string; logoWidth?: number; logoHeight?: number; gap?: string; flexRow?: boolean; }; declare const Title: React__default.FC<TitleProps>; type TitlePropsWithoutCollapse = Omit<TitleProps, 'collapsed'>; interface SiderProps { titleProps: TitlePropsWithoutCollapse; } interface DrawerSiderProps { titleProps: TitlePropsWithoutCollapse; } interface ICollapseSider { titleProps: TitlePropsWithoutCollapse; } type SiderMenuProps = { selectedKey: string; defaultOpenKeys: Array<string>; setMobileSiderOpen: (open: boolean) => void; menuItems: ITreeMenu[]; Link: React.FC<PropsWithChildren & { to: string; style?: CSSProperties; }>; siderCollapsed: boolean; }; type RenderSiderMenu = (props: SiderMenuProps) => ReactNode; interface MenuItemsProps { tree: ITreeMenu[]; selectedKey?: string; Link: React.FC<PropsWithChildren & { to: string; style?: CSSProperties; }>; siderCollapsed: boolean; } type RenderMenuItems = (props: MenuItemsProps) => ReactNode; declare const Sider: React__default.FC<SiderProps>; type LayoutProps = PropsWithChildren & { siderProps: SiderProps; headerProps?: HeaderWithSearchProps; }; declare const Layout: React__default.FC<LayoutProps>; type ListPageProps = { resource: string; titleText?: string; isFetching?: boolean; searchFormProps?: any; children?: ReactNode; extra?: ReactNode; headerButtonsBefore?: ReactNode; headerButtonsAfter?: ReactNode; titleStyle?: React.CSSProperties; }; declare const ListPage: React.FC<ListPageProps>; interface ListTitleButtonProps { resource: string; buttonText?: string; textStyle?: CSSProperties; accessControl?: { enabled?: boolean; hideIfUnauthorized?: boolean; }; meta?: Record<string, unknown>; size?: SizeType; marginTop?: string | number; } declare const ListTitleButton: React__default.FC<ListTitleButtonProps>; type LogoProps = { src: string; height?: number; width?: number; alt?: string; }; declare const Logo: React.FC<LogoProps>; interface PaginationTotalProps { total: number; entityName: string; } declare const PaginationTotal: React__default.FC<PaginationTotalProps>; interface PhoneNumberLinkProps { phone: string; style?: React.CSSProperties; } declare const PhoneNumberLink: React__default.FC<PhoneNumberLinkProps>; interface SelectOptionWithAvatarProps { name: string; avatarUrl?: string; shape?: "circle" | "square"; } declare const SelectOptionWithAvatar: React__default.FC<SelectOptionWithAvatarProps>; type ShowLinkButtonProps = Omit<Omit<ShowButtonProps, 'icon'>, 'style'>; declare const ShowLinkButton: React__default.FC<ShowLinkButtonProps>; type SingleElementFormProps<T extends BaseRecord = BaseRecord> = { children?: React.ReactNode; icon?: React.ReactNode; itemProps?: FormItemProps; extra?: React.ReactNode; view?: React.ReactNode; state?: 'empty' | 'form' | 'view'; onUpdate?: (values: BaseRecord) => void; onCancel?: () => void; onClick?: () => void; loading?: boolean; style?: React.CSSProperties; useFormProps?: UseFormProps<T>; formProps?: FormProps<T>; isDisabled?: boolean; resource?: string; id?: BaseKey; minimal?: boolean; parseValues?: (values: BaseRecord) => BaseRecord; formItemStyle?: React.CSSProperties; wrapContent?: boolean; tooltip?: ReactNode; }; type FallbackProps = { view?: ReactNode; onClick?: () => void; isDisabled?: boolean; }; type Fallback$1 = React.FC<FallbackProps>; type SingleElementForm$1<T extends BaseRecord = BaseRecord> = React.FC<SingleElementFormProps<T>>; declare const Fallback: Fallback$1; declare const SingleElementForm: SingleElementForm$1; type TextProps = { size?: "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "huge" | "xhuge" | "xxhuge"; } & ComponentProps<typeof Typography.Text>; declare const Text: React__default.FC<TextProps>; declare const TextIcon: (props: Partial<CustomIconComponentProps>) => react_jsx_runtime.JSX.Element; type LayoutContextProviderType = React.FC<PropsWithChildren>; declare const LayoutContextProvider: LayoutContextProviderType; declare const Unauthorized: () => react_jsx_runtime.JSX.Element; type UploadButtonProps = { icon?: ReactNode; label?: string; }; declare const UploadButton: React.FC<UploadButtonProps>; type UserPhotoUploadProps<T = Blob> = { photo?: string; name?: string; onChange: UploadProps$1<T>['onChange']; onRemove?: UploadProps$1<T>['onRemove']; readOnly?: boolean; size?: number; }; declare const UserPhotoUpload: <T extends object>({ photo, size, name, onChange, readOnly, onRemove, }: UserPhotoUploadProps<T>) => react_jsx_runtime.JSX.Element; declare const DEFAULT_THEME_CONFIG: ThemeConfig; type LayoutContextValue = { noPadding: boolean; disableLayoutPadding: () => void; enableLayoutPadding: () => void; }; declare const LayoutContext: React$1.Context<LayoutContextValue>; declare const useLayoutContext: () => LayoutContextValue; type ColorMode = 'dark' | 'light'; type UseThemeConfigProps = { mode: ColorMode; overrides?: ThemeConfig; }; type UseThemeConfigResult = ThemeConfig; declare const useThemeConfig: (props: UseThemeConfigProps) => UseThemeConfigResult; declare const isUrl: (url: string | undefined) => boolean; declare const lightenHexColor: (color?: string, amount?: number) => string; export { Bootstrap, type BootstrapProps, CustomAvatar, type CustomAvatarProps, DEFAULT_THEME_CONFIG, type DrawerSiderProps, EmailLink, type EmailLinkProps, Fallback, FieldFormTitle, type FieldFormTitleProps, FilterDropdown, type FilterDropdownProps, FullScreenLoading, FullWidthLayout, type FullWidthLayoutProps, type HeaderWithMenu, HeaderWithSearch, type HeaderWithSearchProps, type ICollapseSider, IconInvoicerLogo, IconMoon, IconSun, ImageUpload, type ImageUploadProps, Layout, LayoutContext, LayoutContextProvider, type LayoutContextProviderType, type LayoutContextValue, type LayoutProps, ListPage, type ListPageProps, ListTitleButton, type ListTitleButtonProps, Logo, type LogoProps, type MapValueEvent, type MenuItemsProps, PaginationTotal, type PaginationTotalProps, PhoneNumberLink, type PhoneNumberLinkProps, type RenderMenuItems, type RenderSiderMenu, SelectOptionWithAvatar, type SelectOptionWithAvatarProps, ShowLinkButton, type ShowLinkButtonProps, Sider, type SiderMenuProps, type SiderProps, SingleElementForm, Text, TextIcon, type TextProps, Title, type TitleProps, Unauthorized, UploadButton, type UploadButtonProps, type UseThemeConfigProps, type UseThemeConfigResult, UserPhotoUpload, type UserPhotoUploadProps, isUrl, lightenHexColor, useLayoutContext, useStyles, useThemeConfig };