@max-ts/kit 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/Button/Button.d.ts +11 -0
- package/lib/components/Button/button.css.d.ts +5 -0
- package/lib/components/Button/index.d.ts +1 -0
- package/lib/components/Button/types.d.ts +2 -0
- package/lib/components/ButtonGroup/ButtonGroup.d.ts +17 -0
- package/lib/components/ButtonGroup/buttonGroup.css.d.ts +3 -0
- package/lib/components/ButtonGroup/index.d.ts +1 -0
- package/lib/components/Card/Card.d.ts +8 -0
- package/lib/components/Card/card.css.d.ts +6 -0
- package/lib/components/Card/index.d.ts +1 -0
- package/lib/components/Checkbox/Checkbox.d.ts +3 -0
- package/lib/components/Checkbox/checkbox.css.d.ts +3 -0
- package/lib/components/Checkbox/index.d.ts +1 -0
- package/lib/components/CircularProgress/CircularProgress.d.ts +10 -0
- package/lib/components/CircularProgress/index.d.ts +1 -0
- package/lib/components/CircularProgress/styles.css.d.ts +5 -0
- package/lib/components/ConfirmAction/ConfirmAction.d.ts +39 -0
- package/lib/components/ConfirmAction/index.d.ts +1 -0
- package/lib/components/ConfirmAction/styles.css.d.ts +4 -0
- package/lib/components/ConfirmAction/useLogic.d.ts +9 -0
- package/lib/components/ContentState/ContentState.d.ts +34 -0
- package/lib/components/ContentState/index.d.ts +2 -0
- package/lib/components/ContentState/styles.css.d.ts +1 -0
- package/lib/components/ContentState/types.d.ts +24 -0
- package/lib/components/CopyTypography/CopyTypography.d.ts +17 -0
- package/lib/components/CopyTypography/enums.d.ts +5 -0
- package/lib/components/CopyTypography/index.d.ts +1 -0
- package/lib/components/CopyTypography/styles.css.d.ts +2 -0
- package/lib/components/CopyTypography/useLogic/index.d.ts +1 -0
- package/lib/components/CopyTypography/useLogic/useLogic.d.ts +12 -0
- package/lib/components/DataGrid/Body/Body.d.ts +5 -0
- package/lib/components/DataGrid/Body/index.d.ts +1 -0
- package/lib/components/DataGrid/Body/styles.css.d.ts +1 -0
- package/lib/components/DataGrid/Cell/Cell.d.ts +8 -0
- package/lib/components/DataGrid/Cell/index.d.ts +1 -0
- package/lib/components/DataGrid/Cell/styles.css.d.ts +2 -0
- package/lib/components/DataGrid/DataGrid.d.ts +23 -0
- package/lib/components/DataGrid/Footer/Footer.d.ts +5 -0
- package/lib/components/DataGrid/Footer/index.d.ts +1 -0
- package/lib/components/DataGrid/Footer/styles.css.d.ts +1 -0
- package/lib/components/DataGrid/Header/Header.d.ts +9 -0
- package/lib/components/DataGrid/Header/index.d.ts +1 -0
- package/lib/components/DataGrid/Header/styles.css.d.ts +1 -0
- package/lib/components/DataGrid/HeaderCell/HeaderCell.d.ts +8 -0
- package/lib/components/DataGrid/HeaderCell/index.d.ts +1 -0
- package/lib/components/DataGrid/HeaderCell/styles.css.d.ts +1 -0
- package/lib/components/DataGrid/Row/Row.d.ts +11 -0
- package/lib/components/DataGrid/Row/index.d.ts +1 -0
- package/lib/components/DataGrid/Row/styles.css.d.ts +2 -0
- package/lib/components/DataGrid/State/State.d.ts +10 -0
- package/lib/components/DataGrid/State/index.d.ts +1 -0
- package/lib/components/DataGrid/State/styles.css.d.ts +2 -0
- package/lib/components/DataGrid/constants.d.ts +1 -0
- package/lib/components/DataGrid/index.d.ts +2 -0
- package/lib/components/DataGrid/styles.css.d.ts +5 -0
- package/lib/components/DataGrid/types.d.ts +24 -0
- package/lib/components/DataGridActionCell/DataGridActionCell.d.ts +22 -0
- package/lib/components/DataGridActionCell/MainAction/MainAction.d.ts +22 -0
- package/lib/components/DataGridActionCell/MainAction/MainIconButton/MainIconButton.d.ts +21 -0
- package/lib/components/DataGridActionCell/MainAction/MainIconButton/index.d.ts +1 -0
- package/lib/components/DataGridActionCell/MainAction/MainIconButton/useLogic/index.d.ts +1 -0
- package/lib/components/DataGridActionCell/MainAction/MainIconButton/useLogic/useLogic.d.ts +10 -0
- package/lib/components/DataGridActionCell/MainAction/index.d.ts +1 -0
- package/lib/components/DataGridActionCell/SecondaryAction/SecondaryAction.d.ts +22 -0
- package/lib/components/DataGridActionCell/SecondaryAction/index.d.ts +1 -0
- package/lib/components/DataGridActionCell/index.d.ts +1 -0
- package/lib/components/DataGridActionCell/styles.css.d.ts +1 -0
- package/lib/components/DataGridActionCell/types.d.ts +100 -0
- package/lib/components/DataGridActionCell/useLogic/index.d.ts +1 -0
- package/lib/components/DataGridActionCell/useLogic/useLogic.d.ts +10 -0
- package/lib/components/DataGridSortHeader/DataGridSortHeader.d.ts +9 -0
- package/lib/components/DataGridSortHeader/index.d.ts +2 -0
- package/lib/components/DataGridSortHeader/styles.css.d.ts +2 -0
- package/lib/components/DataGridSortHeader/types.d.ts +4 -0
- package/lib/components/DataList/DataList.d.ts +55 -0
- package/lib/components/DataList/EndData/EndData.d.ts +5 -0
- package/lib/components/DataList/EndData/constants.d.ts +1 -0
- package/lib/components/DataList/EndData/index.d.ts +1 -0
- package/lib/components/DataList/EndData/styles.css.d.ts +1 -0
- package/lib/components/DataList/ErrorState/ErrorState.d.ts +5 -0
- package/lib/components/DataList/ErrorState/constants.d.ts +1 -0
- package/lib/components/DataList/ErrorState/index.d.ts +1 -0
- package/lib/components/DataList/ErrorState/styles.css.d.ts +1 -0
- package/lib/components/DataList/Loader/Loader.d.ts +1 -0
- package/lib/components/DataList/Loader/index.d.ts +1 -0
- package/lib/components/DataList/Loader/styles.css.d.ts +1 -0
- package/lib/components/DataList/NoData/NoData.d.ts +5 -0
- package/lib/components/DataList/NoData/constants.d.ts +1 -0
- package/lib/components/DataList/NoData/index.d.ts +1 -0
- package/lib/components/DataList/ScrollToTopButton/ScrollToTopButton.d.ts +5 -0
- package/lib/components/DataList/ScrollToTopButton/index.d.ts +1 -0
- package/lib/components/DataList/ScrollToTopButton/styles.css.d.ts +2 -0
- package/lib/components/DataList/constants.d.ts +2 -0
- package/lib/components/DataList/index.d.ts +1 -0
- package/lib/components/DataList/styles.css.d.ts +2 -0
- package/lib/components/Description/Description.d.ts +34 -0
- package/lib/components/Description/DescriptionContext/DescriptionContext.d.ts +6 -0
- package/lib/components/Description/DescriptionContext/DescriptionContextProvider/DescriptionContextProvider.d.ts +7 -0
- package/lib/components/Description/DescriptionContext/DescriptionContextProvider/index.d.ts +1 -0
- package/lib/components/Description/DescriptionContext/index.d.ts +2 -0
- package/lib/components/Description/Name/Name.d.ts +3 -0
- package/lib/components/Description/Name/index.d.ts +1 -0
- package/lib/components/Description/Name/styles.css.d.ts +3 -0
- package/lib/components/Description/Value/Value.d.ts +22 -0
- package/lib/components/Description/Value/index.d.ts +1 -0
- package/lib/components/Description/Value/styles.css.d.ts +3 -0
- package/lib/components/Description/Value/useLogic/index.d.ts +1 -0
- package/lib/components/Description/Value/useLogic/useLogic.d.ts +9 -0
- package/lib/components/Description/constants.d.ts +3 -0
- package/lib/components/Description/index.d.ts +2 -0
- package/lib/components/Description/styles.css.d.ts +3 -0
- package/lib/components/Description/useLogic/index.d.ts +1 -0
- package/lib/components/Description/useLogic/useLogic.d.ts +9 -0
- package/lib/components/Dialog/Dialog.d.ts +10 -0
- package/lib/components/Dialog/index.d.ts +1 -0
- package/lib/components/Dialog/styles.css.d.ts +9 -0
- package/lib/components/DropdownMenu/DropdownMenu.d.ts +24 -0
- package/lib/components/DropdownMenu/index.d.ts +1 -0
- package/lib/components/DropdownMenu/styles.css.d.ts +12 -0
- package/lib/components/ImageCarousel/ImageCarousel.d.ts +10 -0
- package/lib/components/ImageCarousel/index.d.ts +1 -0
- package/lib/components/ImageCarousel/styles.css.d.ts +9 -0
- package/lib/components/Input/Input.d.ts +11 -0
- package/lib/components/Input/index.d.ts +1 -0
- package/lib/components/Input/styles.css.d.ts +12 -0
- package/lib/components/Label/Label.d.ts +5 -0
- package/lib/components/Label/index.d.ts +1 -0
- package/lib/components/Label/label.css.d.ts +2 -0
- package/lib/components/Placeholder/Image/Image.d.ts +6 -0
- package/lib/components/Placeholder/Image/index.d.ts +1 -0
- package/lib/components/Placeholder/Image/styles.css.d.ts +3 -0
- package/lib/components/Placeholder/Placeholder.d.ts +40 -0
- package/lib/components/Placeholder/constants.d.ts +22 -0
- package/lib/components/Placeholder/index.d.ts +3 -0
- package/lib/components/Placeholder/styles.css.d.ts +6 -0
- package/lib/components/Placeholder/types.d.ts +1 -0
- package/lib/components/Popover/Popover.d.ts +2 -0
- package/lib/components/Popover/PopoverContent.d.ts +3 -0
- package/lib/components/Popover/index.d.ts +2 -0
- package/lib/components/Popover/styles.css.d.ts +1 -0
- package/lib/components/RangeInput/RangeInput.d.ts +16 -0
- package/lib/components/RangeInput/index.d.ts +1 -0
- package/lib/components/RangeInput/styles.css.d.ts +7 -0
- package/lib/components/ScrollTopButton/ScrollTopButton.d.ts +4 -0
- package/lib/components/ScrollTopButton/index.d.ts +1 -0
- package/lib/components/ScrollTopButton/styles.css.d.ts +2 -0
- package/lib/components/Select/Select.d.ts +19 -0
- package/lib/components/Select/index.d.ts +1 -0
- package/lib/components/Select/styles.css.d.ts +10 -0
- package/lib/components/Slider/Slider.d.ts +3 -0
- package/lib/components/Slider/index.d.ts +1 -0
- package/lib/components/Slider/styles.css.d.ts +4 -0
- package/lib/components/Tabs/Tabs.d.ts +1 -0
- package/lib/components/Tabs/TabsContent.d.ts +3 -0
- package/lib/components/Tabs/TabsList.d.ts +3 -0
- package/lib/components/Tabs/TabsTrigger.d.ts +3 -0
- package/lib/components/Tabs/index.d.ts +4 -0
- package/lib/components/Tabs/styles.css.d.ts +3 -0
- package/lib/components/TextField/TextField.d.ts +7 -0
- package/lib/components/TextField/index.d.ts +1 -0
- package/lib/components/TextField/styles.css.d.ts +5 -0
- package/lib/components/Tooltip/Tooltip.d.ts +13 -0
- package/lib/components/Tooltip/index.d.ts +1 -0
- package/lib/components/Tooltip/styles.css.d.ts +3 -0
- package/lib/components/Typography/Typography.d.ts +15 -0
- package/lib/components/Typography/index.d.ts +1 -0
- package/lib/components/Typography/styles.css.d.ts +9 -0
- package/lib/components/Typography/types.d.ts +3 -0
- package/lib/components/index.d.ts +28 -0
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/useToggle/index.d.ts +1 -0
- package/lib/hooks/useToggle/useToggle.d.ts +43 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.mjs +1 -0
- package/lib/styles/index.d.ts +3 -0
- package/lib/styles/reset.css.d.ts +1 -0
- package/lib/styles/theme.css.d.ts +136 -0
- package/lib/styles.css +1 -0
- package/package.json +53 -0
- package/src/index.ts +2 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { buttonSizes, buttonVariants } from './button.css';
|
|
2
|
+
import type { ButtonSize, ButtonVariant } from './types';
|
|
3
|
+
export type ButtonProps = React.ComponentProps<'button'> & {
|
|
4
|
+
asChild?: boolean;
|
|
5
|
+
isLoading?: boolean;
|
|
6
|
+
fullWidth?: boolean;
|
|
7
|
+
variant?: ButtonVariant;
|
|
8
|
+
size?: ButtonSize;
|
|
9
|
+
};
|
|
10
|
+
declare const Button: ({ className, variant, size, asChild, isLoading, fullWidth, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export { Button, buttonSizes, buttonVariants };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ButtonSize, ButtonVariant } from './types';
|
|
2
|
+
export declare const loading: string;
|
|
3
|
+
export declare const fullWidthStyle: string;
|
|
4
|
+
export declare const buttonVariants: Record<ButtonVariant, string>;
|
|
5
|
+
export declare const buttonSizes: Record<ButtonSize, string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Button';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type Value = string | number;
|
|
2
|
+
type Option<T extends Value> = {
|
|
3
|
+
value: T;
|
|
4
|
+
label: string | React.ReactNode;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
};
|
|
7
|
+
type ButtonGroupProps<TValue extends Value, Multiple extends boolean = false> = {
|
|
8
|
+
options: Option<TValue>[];
|
|
9
|
+
value: Multiple extends true ? TValue[] : TValue;
|
|
10
|
+
onChange: (value: Multiple extends true ? TValue[] : TValue) => void;
|
|
11
|
+
size?: 'sm' | 'lg' | 'md' | 'icon';
|
|
12
|
+
className?: string;
|
|
13
|
+
label?: string;
|
|
14
|
+
multiple?: Multiple;
|
|
15
|
+
};
|
|
16
|
+
export declare const ButtonGroup: <T extends Value, Multiple extends boolean = false>({ value, onChange, options, size, className, label, multiple, }: ButtonGroupProps<T, Multiple>) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ButtonGroup';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
declare const Card: ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare const CardHeader: ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare const CardTitle: ({ className, ...props }: HTMLAttributes<HTMLHeadingElement>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const CardDescription: ({ className, ...props }: HTMLAttributes<HTMLParagraphElement>) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare const CardContent: ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const CardFooter: ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Card';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Checkbox';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type CircularProgressProps = {
|
|
2
|
+
size?: number;
|
|
3
|
+
thickness?: number;
|
|
4
|
+
color?: 'primary' | 'secondary' | 'inherit';
|
|
5
|
+
value?: number;
|
|
6
|
+
variant?: 'indeterminate' | 'determinate';
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const CircularProgress: React.FC<CircularProgressProps>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CircularProgress';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const root: string;
|
|
2
|
+
export declare const svg: string;
|
|
3
|
+
export declare const circle: string;
|
|
4
|
+
export declare const variants: Record<"determinate" | "indeterminate", string>;
|
|
5
|
+
export declare const colors: Record<"primary" | "secondary" | "inherit", string>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ReactNode, SyntheticEvent } from 'react';
|
|
2
|
+
import { type PopoverContentProps } from '../Popover';
|
|
3
|
+
export type ActionComponentParams = {
|
|
4
|
+
onClick: (event: SyntheticEvent) => void;
|
|
5
|
+
};
|
|
6
|
+
export type ConfirmActionProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Поясняющий текст
|
|
9
|
+
*/
|
|
10
|
+
text?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Параметры кнопки подтверждения действия
|
|
13
|
+
*/
|
|
14
|
+
confirmButtonProps?: {
|
|
15
|
+
/**
|
|
16
|
+
* Текст кнопки
|
|
17
|
+
*/
|
|
18
|
+
text?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Если `true`, кнопка будет иметь акцент на критичность действия. Стоит использовать для важных действий, например при удалении.
|
|
21
|
+
* @default 'false'
|
|
22
|
+
*/
|
|
23
|
+
isAccented?: boolean;
|
|
24
|
+
};
|
|
25
|
+
skipConfirm?: boolean;
|
|
26
|
+
popoverProps?: {
|
|
27
|
+
side: PopoverContentProps['side'];
|
|
28
|
+
align: PopoverContentProps['align'];
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Кнопка, действие которой необходимо подтвердить
|
|
32
|
+
*/
|
|
33
|
+
actionComponent: (params: ActionComponentParams) => ReactNode;
|
|
34
|
+
/**
|
|
35
|
+
* Целевое действие, которое должно произойти после подтверждения
|
|
36
|
+
*/
|
|
37
|
+
onConfirm: () => void;
|
|
38
|
+
};
|
|
39
|
+
export declare const ConfirmAction: (props: ConfirmActionProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ConfirmAction';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ButtonProps } from '../Button';
|
|
2
|
+
import type { ConfirmActionProps } from './ConfirmAction';
|
|
3
|
+
export declare const useLogic: ({ skipConfirm, onConfirm, confirmButtonProps: externalConfirmButtonProps, }: ConfirmActionProps) => {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onActionComponentClick: () => void;
|
|
6
|
+
confirmButtonProps: Partial<ButtonProps>;
|
|
7
|
+
onCancel: () => void;
|
|
8
|
+
onOpenChange: (open: boolean) => void;
|
|
9
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { type PlaceholderProps } from '../Placeholder';
|
|
3
|
+
import type { ContentStateErrorProps } from './types';
|
|
4
|
+
export type ContentStateProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Флаг состояния загрузки
|
|
7
|
+
*/
|
|
8
|
+
isLoading?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Элемент для отображения состояния загрузки
|
|
11
|
+
*/
|
|
12
|
+
loadingContent?: ReactElement | string;
|
|
13
|
+
/**
|
|
14
|
+
* Флаг состояния ошибки
|
|
15
|
+
*/
|
|
16
|
+
isError?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Параметры для отображения состояния ошибки
|
|
19
|
+
*/
|
|
20
|
+
errorState?: ContentStateErrorProps;
|
|
21
|
+
/**
|
|
22
|
+
* Флаг для отображения custom состояния ошибки
|
|
23
|
+
*/
|
|
24
|
+
isCustom?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Параметры для отображения custom состояния ошибки
|
|
27
|
+
*/
|
|
28
|
+
customState?: PlaceholderProps;
|
|
29
|
+
/**
|
|
30
|
+
* Элементы для отображения состояния "Успех"
|
|
31
|
+
*/
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
};
|
|
34
|
+
export declare const ContentState: ({ isLoading, isError, isCustom, errorState, customState, children, loadingContent: LoadingContent, }: ContentStateProps) => string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const loadingContainer: string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type ContentStateErrorProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Название ошибки
|
|
5
|
+
*/
|
|
6
|
+
title?: string;
|
|
7
|
+
imgSrc?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Alt атрибут для изображения
|
|
10
|
+
*/
|
|
11
|
+
imgAlt?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Список ошибок для отображения
|
|
14
|
+
*/
|
|
15
|
+
errorList: string[];
|
|
16
|
+
/**
|
|
17
|
+
* Элементы кнопок для дальнейших действий
|
|
18
|
+
*/
|
|
19
|
+
actions?: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Функция для повторного действия
|
|
22
|
+
*/
|
|
23
|
+
onRetry: () => void;
|
|
24
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type TypographyProps } from '../Typography';
|
|
2
|
+
export type CopyTypographyProps = TypographyProps & {
|
|
3
|
+
/**
|
|
4
|
+
* Текст, который будет скопирован. Перекрывает обычное копирование если children является строкой
|
|
5
|
+
*/
|
|
6
|
+
copyText?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Отображает иконку слева или справа от текста
|
|
9
|
+
* @default right
|
|
10
|
+
*/
|
|
11
|
+
copyPosition?: 'right' | 'left';
|
|
12
|
+
/**
|
|
13
|
+
* Если `true`, в тултипе будет отображаться текст, который будет скопирован при нажатии
|
|
14
|
+
*/
|
|
15
|
+
isShowCopyText?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare const CopyTypography: (props: CopyTypographyProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare enum CopyStatus {
|
|
2
|
+
Copied = "\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E",
|
|
3
|
+
Error = "\u041E\u0448\u0438\u0431\u043A\u0430 \u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F",
|
|
4
|
+
CanCopy = "\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C"
|
|
5
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CopyTypography';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useLogic';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type SyntheticEvent } from 'react';
|
|
2
|
+
import type { CopyTypographyProps } from '../CopyTypography';
|
|
3
|
+
type UseLogicParams = CopyTypographyProps;
|
|
4
|
+
export declare const useLogic: ({ children, copyText, isShowCopyText, copyPosition, }: UseLogicParams) => {
|
|
5
|
+
handleMouseLeave: () => void;
|
|
6
|
+
handleClick: (event: SyntheticEvent<HTMLElement>) => void;
|
|
7
|
+
tooltipTitle: string;
|
|
8
|
+
isIconOnLeft: boolean;
|
|
9
|
+
tooltipOpen: boolean;
|
|
10
|
+
handleMouseEnter: () => void;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DataGridProps } from '../DataGrid';
|
|
2
|
+
export type BodyProps<TRow> = Pick<DataGridProps<TRow>, 'emptyState' | 'errorState' | 'isLoading' | 'isError' | 'columns' | 'rows' | 'onRowClick' | 'keyId' | 'onRetry'> & {
|
|
3
|
+
rowHeight: number;
|
|
4
|
+
};
|
|
5
|
+
export declare function Body<TRow>({ isError, isLoading, emptyState, errorState, columns, rows, rowHeight, keyId, onRowClick, }: BodyProps<TRow>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Body';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const container: string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DataGridColumn } from '../types';
|
|
2
|
+
export type CellProps<TRow> = {
|
|
3
|
+
row: TRow;
|
|
4
|
+
column: DataGridColumn<TRow>;
|
|
5
|
+
rowIndex: number;
|
|
6
|
+
height: number;
|
|
7
|
+
};
|
|
8
|
+
export declare function Cell<TRow>({ row, column, rowIndex, height }: CellProps<TRow>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Cell';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import type { DataGridColumn, DataGridState } from './types';
|
|
3
|
+
export type DataGridProps<TRow> = {
|
|
4
|
+
rows: TRow[];
|
|
5
|
+
columns: DataGridColumn<TRow>[];
|
|
6
|
+
className?: string;
|
|
7
|
+
height?: CSSProperties['height'];
|
|
8
|
+
rowHeight?: number;
|
|
9
|
+
headerHeight?: number;
|
|
10
|
+
keyId: keyof TRow;
|
|
11
|
+
isLoading?: boolean;
|
|
12
|
+
isDisabled?: boolean;
|
|
13
|
+
isError?: boolean;
|
|
14
|
+
stickyHeader?: boolean;
|
|
15
|
+
emptyState?: DataGridState;
|
|
16
|
+
errorState?: DataGridState;
|
|
17
|
+
onSelectRow?: (row: TRow[]) => void;
|
|
18
|
+
onRowClick?: (row: TRow) => void;
|
|
19
|
+
onRetry?: () => void;
|
|
20
|
+
title?: string;
|
|
21
|
+
footer?: ReactNode;
|
|
22
|
+
};
|
|
23
|
+
export declare function DataGrid<TRow>({ rows, columns, height, className, rowHeight, headerHeight, keyId, onRowClick, isLoading, isDisabled, isError, emptyState, errorState, footer, title, stickyHeader, onRetry, }: DataGridProps<TRow>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Footer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const footerClass: string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import type { DataGridColumn } from '../types';
|
|
3
|
+
type HeaderProps<TData> = {
|
|
4
|
+
columns: DataGridColumn<TData>[];
|
|
5
|
+
height: CSSProperties['height'];
|
|
6
|
+
sticky?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare function Header<TData>({ columns, height, sticky }: HeaderProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Header';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const stickyClass: string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import type { DataGridColumn } from '../types';
|
|
3
|
+
export type HeaderCellProps<T> = {
|
|
4
|
+
column: DataGridColumn<T>;
|
|
5
|
+
height?: CSSProperties['height'];
|
|
6
|
+
width?: CSSProperties['width'];
|
|
7
|
+
};
|
|
8
|
+
export declare function HeaderCell<TData>({ column, height, width, }: HeaderCellProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './HeaderCell';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const headerCellClass: string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DataGridColumn } from '../types';
|
|
2
|
+
type RowProps<TRow> = {
|
|
3
|
+
row: TRow;
|
|
4
|
+
columns: DataGridColumn<TRow>[];
|
|
5
|
+
rowIndex: number;
|
|
6
|
+
rowId: string;
|
|
7
|
+
rowHeight: number;
|
|
8
|
+
onRowClick?: (row: TRow) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare function Row<TRow>({ row, rowHeight, onRowClick, columns, rowIndex, rowId, }: RowProps<TRow>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Row';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DataGridState } from '../types';
|
|
2
|
+
export declare function State({ isLoading, isEmpty, columnsLength, emptyState, errorState, isError, onRetry, }: {
|
|
3
|
+
isLoading?: boolean;
|
|
4
|
+
isEmpty?: boolean;
|
|
5
|
+
isError?: boolean;
|
|
6
|
+
columnsLength: number;
|
|
7
|
+
errorState?: DataGridState;
|
|
8
|
+
emptyState?: DataGridState;
|
|
9
|
+
onRetry?: () => void;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './State';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ROW_HEIGHT = 40;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type DataGridColumn<TRow> = {
|
|
3
|
+
title: string;
|
|
4
|
+
field?: keyof TRow;
|
|
5
|
+
width?: number | string;
|
|
6
|
+
align?: 'left' | 'center' | 'right' | 'justify';
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
color?: string;
|
|
9
|
+
renderHeaderCell?: (column: Omit<DataGridColumn<TRow>, 'renderHeaderCell' | 'renderCell' | 'format' | 'cellClassName' | 'cellColor'>) => ReactNode;
|
|
10
|
+
renderCell?: (row: TRow, index: number) => ReactNode;
|
|
11
|
+
format?: (row: TRow) => string | number | null | undefined;
|
|
12
|
+
cellClassName?: (row: TRow) => string;
|
|
13
|
+
cellColor?: (row: TRow) => string;
|
|
14
|
+
};
|
|
15
|
+
export type DataGridColumns<TRow> = DataGridColumn<TRow>[];
|
|
16
|
+
export type AlignVariant = 'left' | 'center' | 'right' | 'justify';
|
|
17
|
+
export type DataGridState = {
|
|
18
|
+
text: string;
|
|
19
|
+
imgSrc?: string;
|
|
20
|
+
imgAlt?: string;
|
|
21
|
+
actions?: ReactNode;
|
|
22
|
+
errorList?: string[];
|
|
23
|
+
onRetry?: () => void;
|
|
24
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { MainActionKind, SecondaryActionKind } from './types';
|
|
2
|
+
export type DataGridActions<TAction> = {
|
|
3
|
+
/**
|
|
4
|
+
* Основные действия
|
|
5
|
+
*/
|
|
6
|
+
main: MainActionKind<TAction>[];
|
|
7
|
+
/**
|
|
8
|
+
* Вторичные действия
|
|
9
|
+
*/
|
|
10
|
+
secondary?: SecondaryActionKind<TAction>[];
|
|
11
|
+
};
|
|
12
|
+
export type DataGridActionCellProps<TRow> = {
|
|
13
|
+
/**
|
|
14
|
+
* Действия
|
|
15
|
+
*/
|
|
16
|
+
actions: DataGridActions<TRow>;
|
|
17
|
+
/**
|
|
18
|
+
* Данные строки
|
|
19
|
+
*/
|
|
20
|
+
row: TRow;
|
|
21
|
+
};
|
|
22
|
+
export declare const DataGridActionCell: <TRow>(props: DataGridActionCellProps<TRow>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type TooltipProps } from '../../Tooltip';
|
|
2
|
+
import type { ActionCellHandler, MainActionKind } from '../types';
|
|
3
|
+
type MainActionProps<TAction> = {
|
|
4
|
+
/**
|
|
5
|
+
* Основные действия
|
|
6
|
+
*/
|
|
7
|
+
action: MainActionKind<TAction>;
|
|
8
|
+
/**
|
|
9
|
+
* Обработчик клика на действие
|
|
10
|
+
*/
|
|
11
|
+
onActionClick: ActionCellHandler<TAction>;
|
|
12
|
+
/**
|
|
13
|
+
* Если true, action не доступен
|
|
14
|
+
*/
|
|
15
|
+
isDisabled?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Положение тултипа
|
|
18
|
+
*/
|
|
19
|
+
tooltipPlacement?: TooltipProps['side'];
|
|
20
|
+
};
|
|
21
|
+
export declare const MainAction: <TAction>({ action, onActionClick, isDisabled, tooltipPlacement, }: MainActionProps<TAction>) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type TooltipProps } from '../../../Tooltip';
|
|
2
|
+
import type { ActionCellHandler, SingleAction } from '../../types';
|
|
3
|
+
export type MainIconButtonProps<TAction> = {
|
|
4
|
+
action: SingleAction<TAction> & {
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
isLoading?: boolean;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Обработчик клика на действие
|
|
10
|
+
*/
|
|
11
|
+
onActionClick: ActionCellHandler<TAction>;
|
|
12
|
+
/**
|
|
13
|
+
* Если true, action не доступен
|
|
14
|
+
*/
|
|
15
|
+
isDisabled?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Положение тултипа
|
|
18
|
+
*/
|
|
19
|
+
tooltipPlacement?: TooltipProps['side'];
|
|
20
|
+
};
|
|
21
|
+
export declare const MainIconButton: <TAction>(props: MainIconButtonProps<TAction>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MainIconButton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useLogic';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MainIconButtonProps } from '../MainIconButton';
|
|
2
|
+
type UseLogicParam<TAction> = MainIconButtonProps<TAction>;
|
|
3
|
+
export declare const useLogic: <TAction>({ action }: UseLogicParam<TAction>) => {
|
|
4
|
+
tooltipProps: {
|
|
5
|
+
text: string;
|
|
6
|
+
open: boolean;
|
|
7
|
+
onOpenChange: (open: boolean) => void;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MainAction';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type TooltipProps } from '../../Tooltip';
|
|
2
|
+
import type { ActionCellHandler, SecondaryActionKind } from '../types';
|
|
3
|
+
type SecondaryActionProps<TAction> = {
|
|
4
|
+
/**
|
|
5
|
+
* Вторичные действия
|
|
6
|
+
*/
|
|
7
|
+
actions: SecondaryActionKind<TAction>[];
|
|
8
|
+
/**
|
|
9
|
+
* Обработчик нажатия на действие
|
|
10
|
+
*/
|
|
11
|
+
onActionClick: ActionCellHandler<TAction>;
|
|
12
|
+
/**
|
|
13
|
+
* Если true, action не доступен
|
|
14
|
+
*/
|
|
15
|
+
isDisabled?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Положение тултипа
|
|
18
|
+
*/
|
|
19
|
+
tooltipPlacement?: TooltipProps['side'];
|
|
20
|
+
};
|
|
21
|
+
export declare const SecondaryActions: <TAction>({ actions, onActionClick, tooltipPlacement, isDisabled, }: SecondaryActionProps<TAction>) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SecondaryAction';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DataGridActionCell';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const wrapper: string;
|