@chrome-consulting/krit-ui 0.0.49

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.
Files changed (102) hide show
  1. package/README.md +69 -0
  2. package/dist/assets/index.d.ts +201 -0
  3. package/dist/components/ui/attachmentsSection.d.ts +54 -0
  4. package/dist/components/ui/badge.d.ts +32 -0
  5. package/dist/components/ui/badgeVariants.d.ts +6 -0
  6. package/dist/components/ui/banner.d.ts +60 -0
  7. package/dist/components/ui/bottom-menu.d.ts +41 -0
  8. package/dist/components/ui/button.d.ts +27 -0
  9. package/dist/components/ui/buttonVariants.d.ts +4 -0
  10. package/dist/components/ui/calendar.d.ts +18 -0
  11. package/dist/components/ui/card.d.ts +87 -0
  12. package/dist/components/ui/carousel.d.ts +52 -0
  13. package/dist/components/ui/checkbox.d.ts +30 -0
  14. package/dist/components/ui/collapsible-section.d.ts +37 -0
  15. package/dist/components/ui/collapsible.d.ts +18 -0
  16. package/dist/components/ui/command.d.ts +102 -0
  17. package/dist/components/ui/confirm-modal.d.ts +33 -0
  18. package/dist/components/ui/data-table.d.ts +94 -0
  19. package/dist/components/ui/date-picker.d.ts +69 -0
  20. package/dist/components/ui/dialog.d.ts +66 -0
  21. package/dist/components/ui/dot.d.ts +10 -0
  22. package/dist/components/ui/dropdown-menu.d.ts +67 -0
  23. package/dist/components/ui/file-input.d.ts +36 -0
  24. package/dist/components/ui/filters-column-header.d.ts +28 -0
  25. package/dist/components/ui/form.d.ts +86 -0
  26. package/dist/components/ui/form.lib.d.ts +23 -0
  27. package/dist/components/ui/header.d.ts +39 -0
  28. package/dist/components/ui/input.d.ts +30 -0
  29. package/dist/components/ui/label.d.ts +23 -0
  30. package/dist/components/ui/multi-select.d.ts +100 -0
  31. package/dist/components/ui/nav-panel.d.ts +52 -0
  32. package/dist/components/ui/nav.d.ts +52 -0
  33. package/dist/components/ui/network-error-message.d.ts +46 -0
  34. package/dist/components/ui/notification.d.ts +34 -0
  35. package/dist/components/ui/notificationVariants.d.ts +4 -0
  36. package/dist/components/ui/number-input.d.ts +149 -0
  37. package/dist/components/ui/page-layout.d.ts +28 -0
  38. package/dist/components/ui/page-view-mode-toggle.d.ts +22 -0
  39. package/dist/components/ui/pagination.d.ts +121 -0
  40. package/dist/components/ui/popover.d.ts +36 -0
  41. package/dist/components/ui/post-card.d.ts +273 -0
  42. package/dist/components/ui/preloader.d.ts +23 -0
  43. package/dist/components/ui/previewFull.d.ts +40 -0
  44. package/dist/components/ui/previews.d.ts +69 -0
  45. package/dist/components/ui/previewsCompactList.d.ts +18 -0
  46. package/dist/components/ui/previewsShared.d.ts +8 -0
  47. package/dist/components/ui/profile.d.ts +41 -0
  48. package/dist/components/ui/radio-group.d.ts +48 -0
  49. package/dist/components/ui/resizable.d.ts +65 -0
  50. package/dist/components/ui/scroll-area.d.ts +5 -0
  51. package/dist/components/ui/secondary-panel-section.d.ts +20 -0
  52. package/dist/components/ui/segmented-control.d.ts +35 -0
  53. package/dist/components/ui/select-header-filter.d.ts +23 -0
  54. package/dist/components/ui/select.d.ts +91 -0
  55. package/dist/components/ui/separator.d.ts +34 -0
  56. package/dist/components/ui/sheet.d.ts +118 -0
  57. package/dist/components/ui/skeleton.d.ts +24 -0
  58. package/dist/components/ui/sort-component.d.ts +46 -0
  59. package/dist/components/ui/sortable-header.d.ts +12 -0
  60. package/dist/components/ui/switch.d.ts +25 -0
  61. package/dist/components/ui/table.d.ts +104 -0
  62. package/dist/components/ui/tabs.d.ts +52 -0
  63. package/dist/components/ui/tabsVariants.d.ts +6 -0
  64. package/dist/components/ui/text-area.d.ts +37 -0
  65. package/dist/components/ui/theme-provider.d.ts +136 -0
  66. package/dist/components/ui/time-picker.d.ts +29 -0
  67. package/dist/components/ui/time-picker.lib.d.ts +6 -0
  68. package/dist/components/ui/toast.d.ts +80 -0
  69. package/dist/components/ui/toaster.d.ts +22 -0
  70. package/dist/components/ui/tooltip.d.ts +65 -0
  71. package/dist/components/ui/tree-view.d.ts +96 -0
  72. package/dist/components/ui/widget-plan-fact.d.ts +86 -0
  73. package/dist/date.d.ts +8 -0
  74. package/dist/hooks/useColumnFilters.d.ts +6 -0
  75. package/dist/hooks/useColumnSizing.d.ts +20 -0
  76. package/dist/hooks/useCombinedRefs.d.ts +1 -0
  77. package/dist/hooks/useConfirm.d.ts +49 -0
  78. package/dist/hooks/useNotify.d.ts +28 -0
  79. package/dist/hooks/usePreviewsFilePicker.d.ts +40 -0
  80. package/dist/hooks/useSidebar.d.ts +10 -0
  81. package/dist/hooks/useStoredExpand.d.ts +18 -0
  82. package/dist/hooks/useStoredFields.d.ts +4 -0
  83. package/dist/hooks/useStoredTabs.d.ts +4 -0
  84. package/dist/hooks/useTableStates.d.ts +26 -0
  85. package/dist/hooks/useTheme.d.ts +1 -0
  86. package/dist/hooks/useToast.d.ts +44 -0
  87. package/dist/hooks/useTranslation.d.ts +4 -0
  88. package/dist/krit-ui.d.ts +2 -0
  89. package/dist/krit-ui.js +27485 -0
  90. package/dist/krit-ui.umd.cjs +140 -0
  91. package/dist/lib/attachments.d.ts +245 -0
  92. package/dist/lib/cookies.d.ts +1 -0
  93. package/dist/lib/file.d.ts +52 -0
  94. package/dist/lib/infinite-scroll.d.ts +13 -0
  95. package/dist/lib/selectUtils.d.ts +14 -0
  96. package/dist/lib/text.d.ts +1 -0
  97. package/dist/lib/zod.d.ts +27 -0
  98. package/dist/main.d.ts +85 -0
  99. package/dist/style.css +1 -0
  100. package/dist/utils.d.ts +2 -0
  101. package/package.json +122 -0
  102. package/tailwind.config.cjs +273 -0
@@ -0,0 +1,52 @@
1
+ import { default as useEmblaCarousel, UseEmblaCarouselType } from 'embla-carousel-react';
2
+ import { Button } from './button';
3
+ import * as React from 'react';
4
+ type CarouselApi = UseEmblaCarouselType[1];
5
+ type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
6
+ type CarouselOptions = UseCarouselParameters[0];
7
+ type CarouselPlugin = UseCarouselParameters[1];
8
+ type CarouselProps = {
9
+ opts?: CarouselOptions;
10
+ plugins?: CarouselPlugin;
11
+ orientation?: 'horizontal' | 'vertical';
12
+ setApi?: (api: CarouselApi) => void;
13
+ };
14
+ /**
15
+ * Кастомная карусель на базе Embla Carousel с поддержкой миниатюр и навигации
16
+ * @component
17
+ * @subcomponent CarouselContent - Контейнер для слайдов
18
+ * @subcomponent CarouselItem - Отдельный слайд карусели
19
+ * @subcomponent CarouselPrevious - Кнопка "Назад"
20
+ * @subcomponent CarouselNext - Кнопка "Вперед"
21
+ * @subcomponent CarouselThumbs - Контейнер для миниатюр
22
+ * @subcomponent CarouselThumbItem - Миниатюра слайда
23
+ * @subcomponent GalleryImages - Галерея изображений
24
+ */
25
+ declare const Carousel: ({ orientation, opts, setApi, plugins, className, children, ...props }: React.ComponentProps<"div"> & CarouselProps) => import("react/jsx-runtime").JSX.Element;
26
+ declare const CarouselContent: ({ className, ...props }: React.ComponentProps<"div">) => import("react/jsx-runtime").JSX.Element;
27
+ declare const CarouselItem: ({ className, ...props }: React.ComponentProps<"div">) => import("react/jsx-runtime").JSX.Element;
28
+ declare const CarouselPrevious: ({ className, variant, size, ...props }: React.ComponentProps<typeof Button>) => import("react/jsx-runtime").JSX.Element;
29
+ declare const CarouselNext: ({ className, variant, size, ...props }: React.ComponentProps<typeof Button>) => import("react/jsx-runtime").JSX.Element;
30
+ declare const CarouselThumbs: ({ className, ...props }: React.ComponentProps<"div">) => import("react/jsx-runtime").JSX.Element;
31
+ type CarouselThumbItemProps = {
32
+ index: number;
33
+ } & React.ComponentProps<'button'>;
34
+ declare const CarouselThumbItem: ({ index, className, children, ...props }: CarouselThumbItemProps) => import("react/jsx-runtime").JSX.Element;
35
+ /**
36
+ * Галерея изображений с превью и навигацией
37
+ * @template T - Тип элементов галереи
38
+ * @param {Object} props - Параметры компонента
39
+ * @param {T[]} [props.items] - Массив элементов галереи
40
+ * @param {(item: T) => string} props.getUrl - Функция получения URL изображения
41
+ * @param {(item: T) => string | number} props.getId - Функция получения уникального идентификатора
42
+ * @param {string} [props.classNameMainImage] - Дополнительные классы для основного изображения
43
+ * @param {string} [props.classNameOtherImages] - Дополнительные классы для миниатюр
44
+ */
45
+ export declare const GalleryImages: <T>({ items, getUrl, getId, classNameMainImage, classNameOtherImages, }: {
46
+ items?: T[];
47
+ getUrl: (item: T) => string;
48
+ getId: (item: T) => number | string;
49
+ classNameMainImage?: string;
50
+ classNameOtherImages?: string;
51
+ }) => import("react/jsx-runtime").JSX.Element;
52
+ export { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, CarouselThumbs, CarouselThumbItem, };
@@ -0,0 +1,30 @@
1
+ import * as React from 'react';
2
+ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
3
+ /**
4
+ * Кастомный чекбокс на базе Radix UI с поддержкой лейбла
5
+ *
6
+ * @component
7
+ * @param {React.ComponentProps<typeof CheckboxPrimitive.Root>} props - Пропсы компонента
8
+ * @param {string} [props.className] - Дополнительные классы стилей
9
+ * @param {React.ReactNode} [props.children] - Лейбл чекбокса
10
+ * @param {boolean} [props.checked] - Состояние выбора
11
+ * @param {function} [props.onCheckedChange] - Колбэк изменения состояния
12
+ * @param {boolean} [props.disabled] - Неактивное состояние
13
+ * @returns {React.ReactElement} Кастомный чекбокс
14
+ */
15
+ declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
16
+ /**
17
+ * Чекбокс с кликабельным лейблом
18
+ *
19
+ * @component
20
+ * @extends Checkbox
21
+ * @param {Object} props - Пропсы компонента
22
+ * @param {string} [props.className] - Дополнительные классы стилей
23
+ * @param {React.ReactNode} props.children - Текст лейбла
24
+ * @param {boolean} [props.checked] - Состояние выбора
25
+ * @param {function} [props.onCheckedChange] - Колбэк изменения состояния
26
+ * @param {boolean} [props.disabled] - Неактивное состояние
27
+ * @returns {React.ReactElement} Чекбокс с интерактивным лейблом
28
+ */
29
+ declare const CheckboxWithLabel: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
30
+ export { Checkbox, CheckboxWithLabel };
@@ -0,0 +1,37 @@
1
+ import { ReactNode } from 'react';
2
+ interface CollapsibleSectionProps {
3
+ title: string;
4
+ icon?: ReactNode;
5
+ defaultExpanded?: boolean;
6
+ showExpanderButton?: boolean;
7
+ expandOnAdd?: boolean;
8
+ count?: number;
9
+ placeholder?: string;
10
+ right?: ReactNode;
11
+ children?: ReactNode;
12
+ isLoading?: boolean;
13
+ isError?: boolean;
14
+ onRefetch?: () => Promise<unknown>;
15
+ onAdd?: () => void;
16
+ }
17
+ /**
18
+ * Раскрывающаяся секция с поддержкой состояний загрузки, ошибок и динамическим контентом
19
+ *
20
+ * @component
21
+ * @param {Object} props - Параметры компонента
22
+ * @param {string} props.title - Заголовок секции
23
+ * @param {ReactNode} [props.icon] - Иконка перед заголовком
24
+ * @param {boolean} [props.defaultExpanded] - Начальное состояние раскрытия
25
+ * @param {boolean} [props.showExpanderButton] - Показать кнопку "Развернуть"
26
+ * @param {boolean} [props.expandOnAdd=true] - Автораскрытие при добавлении
27
+ * @param {number} [props.count] - Счетчик элементов
28
+ * @param {string} [props.placeholder] - Текст при отсутствии элементов
29
+ * @param {ReactNode} [props.right] - Дополнительные элементы справа
30
+ * @param {ReactNode} [props.children] - Контент секции
31
+ * @param {boolean} [props.isLoading] - Состояние загрузки
32
+ * @param {boolean} [props.isError] - Состояние ошибки
33
+ * @param {function} [props.onRefetch] - Колбэк повторной загрузки
34
+ * @param {function} [props.onAdd] - Колбэк добавления элемента
35
+ */
36
+ export declare const CollapsibleSection: (props: CollapsibleSectionProps) => import("react/jsx-runtime").JSX.Element;
37
+ export {};
@@ -0,0 +1,18 @@
1
+ import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
2
+ /**
3
+ * Примитив для создания раскрывающихся элементов
4
+ * @component
5
+ * @see {@link https://www.radix-ui.com/primitives/docs/components/collapsible Radix UI Collapsible}
6
+ */
7
+ declare const Collapsible: import('react').ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleProps & import('react').RefAttributes<HTMLDivElement>>;
8
+ /**
9
+ * Триггер для управления состоянием раскрытия
10
+ * @component
11
+ */
12
+ declare const CollapsibleTrigger: import('react').ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleTriggerProps & import('react').RefAttributes<HTMLButtonElement>>;
13
+ /**
14
+ * Контейнер для скрываемого контента
15
+ * @component
16
+ */
17
+ declare const CollapsibleContent: import('react').ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleContentProps & import('react').RefAttributes<HTMLDivElement>>;
18
+ export { Collapsible, CollapsibleTrigger, CollapsibleContent };
@@ -0,0 +1,102 @@
1
+ import { DialogProps } from '@radix-ui/react-dialog';
2
+ import * as React from 'react';
3
+ /**
4
+ * Командное меню с поиском и навигацией по типу Spotlight
5
+ * @component
6
+ * @see {@link https://cmdk.paco.me/ Документация CMDK}
7
+ */
8
+ declare const Command: React.ForwardRefExoticComponent<Omit<{
9
+ children?: React.ReactNode;
10
+ } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
11
+ ref?: React.Ref<HTMLDivElement>;
12
+ } & {
13
+ asChild?: boolean;
14
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "asChild" | "key"> & {
15
+ label?: string;
16
+ shouldFilter?: boolean;
17
+ filter?: (value: string, search: string, keywords?: string[]) => number;
18
+ defaultValue?: string;
19
+ value?: string;
20
+ onValueChange?: (value: string) => void;
21
+ loop?: boolean;
22
+ disablePointerSelection?: boolean;
23
+ vimBindings?: boolean;
24
+ } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
25
+ interface CommandDialogProps extends DialogProps {
26
+ }
27
+ /**
28
+ * Модальное окно с командным меню
29
+ * @component
30
+ * @param {DialogProps} props - Пропсы диалога Radix UI
31
+ */
32
+ declare const CommandDialog: ({ children, ...props }: CommandDialogProps) => import("react/jsx-runtime").JSX.Element;
33
+ /**
34
+ * Поле ввода для поиска по командам
35
+ * @component
36
+ * @param {React.ComponentProps<typeof CommandPrimitive.Input>} props - Пропсы инпута
37
+ */
38
+ declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React.InputHTMLAttributes<HTMLInputElement>> & {
39
+ ref?: React.Ref<HTMLInputElement>;
40
+ } & {
41
+ asChild?: boolean;
42
+ }, "asChild" | "key" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
43
+ value?: string;
44
+ onValueChange?: (search: string) => void;
45
+ } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
46
+ /**
47
+ * Контейнер для списка команд
48
+ * @component
49
+ * @param {React.ComponentProps<typeof CommandPrimitive.List>} props - Пропсы списка
50
+ */
51
+ declare const CommandList: React.ForwardRefExoticComponent<Omit<{
52
+ children?: React.ReactNode;
53
+ } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
54
+ ref?: React.Ref<HTMLDivElement>;
55
+ } & {
56
+ asChild?: boolean;
57
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "asChild" | "key"> & {
58
+ label?: string;
59
+ } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
60
+ declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
61
+ children?: React.ReactNode;
62
+ } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
63
+ ref?: React.Ref<HTMLDivElement>;
64
+ } & {
65
+ asChild?: boolean;
66
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "asChild" | "key"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
67
+ declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
68
+ children?: React.ReactNode;
69
+ } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
70
+ ref?: React.Ref<HTMLDivElement>;
71
+ } & {
72
+ asChild?: boolean;
73
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "asChild" | "key">, "heading" | "value"> & {
74
+ heading?: React.ReactNode;
75
+ value?: string;
76
+ forceMount?: boolean;
77
+ } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
78
+ declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
79
+ ref?: React.Ref<HTMLDivElement>;
80
+ } & {
81
+ asChild?: boolean;
82
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "asChild" | "key"> & {
83
+ alwaysRender?: boolean;
84
+ } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
85
+ declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
86
+ children?: React.ReactNode;
87
+ } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
88
+ ref?: React.Ref<HTMLDivElement>;
89
+ } & {
90
+ asChild?: boolean;
91
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "asChild" | "key">, "onSelect" | "disabled" | "value"> & {
92
+ disabled?: boolean;
93
+ onSelect?: (value: string) => void;
94
+ value?: string;
95
+ keywords?: string[];
96
+ forceMount?: boolean;
97
+ } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
98
+ declare const CommandShortcut: {
99
+ ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
100
+ displayName: string;
101
+ };
102
+ export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
@@ -0,0 +1,33 @@
1
+ import { ReactNode } from 'react';
2
+ import { PromptOptions } from '../../hooks/useConfirm';
3
+ interface ConfirmModalProps extends PromptOptions {
4
+ children?: ReactNode;
5
+ visible?: boolean;
6
+ onVisibleChange?: (visible: boolean) => void;
7
+ onConfirm?: (input?: string) => void;
8
+ onCancel?: () => void;
9
+ }
10
+ /**
11
+ * Модальное окно подтверждения действия с поддержкой кастомного ввода
12
+ * @component
13
+ * @param {Object} props - Параметры компонента
14
+ * @param {string} [props.title] - Заголовок модального окна
15
+ * @param {string} [props.description] - Описание действия
16
+ * @param {'contrast' | 'destructive'} [props.confirmType='contrast'] - Стиль кнопки подтверждения
17
+ * @param {string} [props.confirmText='OK'] - Текст кнопки подтверждения
18
+ * @param {boolean} [props.confirmHidden] - Скрыть кнопку подтверждения
19
+ * @param {string} [props.cancelText] - Текст кнопки отмены
20
+ * @param {boolean} [props.cancelHidden] - Скрыть кнопку отмены
21
+ * @param {React.ElementType} [props.input] - Кастомный компонент ввода
22
+ * @param {string} [props.inputPlaceholder] - Плейсхолдер для поля ввода
23
+ * @param {string} [props.inputRequiredLabel] - Сообщение при обязательном поле
24
+ * @param {number} [props.inputMaxLength] - Максимальная длина ввода
25
+ * @param {boolean} [props.inputRequired] - Обязательность заполнения поля
26
+ * @param {ReactNode} [props.children] - Триггер для открытия модального окна
27
+ * @param {boolean} [props.visible] - Состояние видимости модального окна
28
+ * @param {function} [props.onVisibleChange] - Колбэк изменения видимости
29
+ * @param {function} [props.onConfirm] - Колбэк подтверждения
30
+ * @param {function} [props.onCancel] - Колбэк отмены
31
+ */
32
+ export declare const ConfirmModal: (props: ConfirmModalProps) => import("react/jsx-runtime").JSX.Element;
33
+ export {};
@@ -0,0 +1,94 @@
1
+ import { default as React } from 'react';
2
+ import { ColumnDef, ColumnFiltersState, ExpandedState, OnChangeFn, PaginationState, Row, RowSelectionState, SortingState, Table as TanTable, VisibilityState } from '@tanstack/react-table';
3
+ import { PaginationProps } from './pagination';
4
+ interface DataTableProps<TData, TValue> {
5
+ columns: ColumnDef<TData, TValue>[];
6
+ data: TData[];
7
+ horizontalPadding?: 'small' | 'medium' | 'large';
8
+ rowCount?: number;
9
+ noResultsText?: string;
10
+ enableRowSelection?: boolean;
11
+ enableMultiRowSelection?: boolean;
12
+ selection?: RowSelectionState;
13
+ pagination?: PaginationState;
14
+ sorting?: SortingState;
15
+ expanded?: ExpandedState;
16
+ manualSorting?: boolean;
17
+ paginationProps?: PaginationProps;
18
+ className?: string;
19
+ selectedRowClassName?: string;
20
+ onSortingChange?: OnChangeFn<SortingState>;
21
+ getRowId?: (originalRow: TData, index: number, parent?: Row<TData> | undefined) => string;
22
+ onPaginationChange?: OnChangeFn<PaginationState>;
23
+ onRowSelectionChange?: OnChangeFn<RowSelectionState>;
24
+ onRowClick?: (row: TData) => void;
25
+ onExpandedChange?: OnChangeFn<ExpandedState>;
26
+ loading?: boolean;
27
+ skeletonClassName?: string;
28
+ isStickyHeader?: boolean;
29
+ additionalSlot?: React.ReactNode;
30
+ headerClassName?: string;
31
+ columnVisibility?: VisibilityState;
32
+ onColumnVisibilityChange?: OnChangeFn<VisibilityState>;
33
+ columnFilters?: ColumnFiltersState;
34
+ onColumnFiltersChange?: OnChangeFn<ColumnFiltersState>;
35
+ rowHoverContent?: (row: TData) => React.ReactNode;
36
+ hideHeader?: boolean;
37
+ variant?: 'table' | 'list';
38
+ striped?: boolean;
39
+ /**
40
+ * Уникальный ключ таблицы для сохранения ширин столбцов в localStorage.
41
+ * Если не передан — ресайзинг работает только в рамках текущей сессии (без сохранения).
42
+ * Если проп вообще не нужен — не передавайте его, поведение таблицы не изменится.
43
+ */
44
+ columnSizingStorageKey?: string;
45
+ /**
46
+ * Включить поддержку множественной сортировки.
47
+ * По умолчанию false (обычная одиночная сортировка).
48
+ */
49
+ enableMultiSort?: boolean;
50
+ /**
51
+ * Максимальное количество колонок для множественной сортировки.
52
+ * Игнорируется если enableMultiSort=false.
53
+ */
54
+ maxMultiSortColumns?: number;
55
+ }
56
+ /**
57
+ * Расширенная таблица данных с пагинацией, сортировкой и виртуализацией
58
+ * @component
59
+ * @template TData - Тип элементов данных
60
+ * @template TValue - Тип значений колонок
61
+ * @param {Object} props - Параметры компонента
62
+ * @param {ColumnDef<TData, TValue>[]} props.columns - Конфигурация колонок
63
+ * @param {TData[]} props.data - Данные для отображения
64
+ * @param {'small' | 'medium' | 'large'} [props.horizontalPadding='medium'] - Горизонтальные отступы
65
+ * @param {number} [props.rowCount] - Общее количество строк (для серверной пагинации)
66
+ * @param {string} [props.noResultsText='No results.'] - Текст при отсутствии данных
67
+ * @param {boolean} [props.enableRowSelection=false] - Разрешить выбор строк
68
+ * @param {boolean} [props.enableMultiRowSelection=false] - Разрешить множественный выбор
69
+ * @param {RowSelectionState} [props.selection] - Состояние выбранных строк
70
+ * @param {PaginationState} [props.pagination] - Состояние пагинации
71
+ * @param {SortingState} [props.sorting] - Состояние сортировки
72
+ * @param {boolean} [props.manualSorting=true] - Ручное управление сортировкой
73
+ * @param {PaginationProps} [props.paginationProps] - Свойства пагинации
74
+ * @param {string} [props.className] - Дополнительные классы
75
+ * @param {function} [props.onRowClick] - Обработчик клика по строке
76
+ * @param {boolean} [props.loading] - Состояние загрузки
77
+ * @param {boolean} [props.isStickyHeader] - Фиксированный заголовок
78
+ * @param {boolean} [props.hideHeader=false] - Скрыть строку с заголовками
79
+ * @param {'table' | 'list'} [props.variant='table'] - Вариант стиля таблицы: 'table' - стандартный стиль с границами, 'list' - стиль списка без вертикальных границ и фона строк
80
+ */
81
+ export declare function DataTable<TData, TValue>({ columns, data, horizontalPadding, rowCount, noResultsText, enableRowSelection, enableMultiRowSelection, selection, pagination, sorting, expanded, manualSorting, paginationProps, className, additionalSlot, selectedRowClassName, onSortingChange, getRowId, onPaginationChange, onRowSelectionChange, onRowClick, onExpandedChange, loading, skeletonClassName, isStickyHeader, headerClassName, columnVisibility, onColumnVisibilityChange, columnFilters, onColumnFiltersChange, rowHoverContent, hideHeader, variant, striped, columnSizingStorageKey, enableMultiSort, maxMultiSortColumns, }: DataTableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
82
+ interface TruncatedCellProps {
83
+ width?: number;
84
+ children?: string;
85
+ }
86
+ export declare function TruncatedCell({ width, children }: TruncatedCellProps): import("react/jsx-runtime").JSX.Element;
87
+ interface DataTablePaginationProps<TData> {
88
+ table: TanTable<TData>;
89
+ horizontalPadding?: 'small' | 'medium' | 'large';
90
+ paginationProps?: PaginationProps;
91
+ variant?: 'table' | 'list';
92
+ }
93
+ export declare function DataTablePagination<TData>({ table, horizontalPadding, paginationProps, variant, }: DataTablePaginationProps<TData>): import("react/jsx-runtime").JSX.Element;
94
+ export {};
@@ -0,0 +1,69 @@
1
+ import { DayPickerMultipleProps, DayPickerRangeProps, DayPickerSingleProps, SelectMultipleEventHandler, SelectRangeEventHandler, SelectSingleEventHandler } from 'react-day-picker';
2
+ import { Locale } from 'date-fns/locale';
3
+ export interface DateRange {
4
+ from?: Date;
5
+ to?: Date;
6
+ }
7
+ export interface DatePickerSingleProps extends DayPickerSingleProps {
8
+ placeholder?: string;
9
+ innerLabel?: string;
10
+ value?: Date | null;
11
+ onChange?: SelectSingleEventHandler;
12
+ error?: string | boolean;
13
+ readOnly?: boolean;
14
+ iconClassName?: string;
15
+ showReset?: boolean;
16
+ onRemoveClick?: () => void;
17
+ }
18
+ export interface DatePickerMultipleProps extends DayPickerMultipleProps {
19
+ placeholder?: string;
20
+ innerLabel?: string;
21
+ value?: Date[];
22
+ onChange?: SelectMultipleEventHandler;
23
+ error?: string | boolean;
24
+ readOnly?: boolean;
25
+ iconClassName?: string;
26
+ showReset?: boolean;
27
+ onRemoveClick?: () => void;
28
+ }
29
+ interface DatePickerRangeProps extends DayPickerRangeProps {
30
+ placeholder?: string;
31
+ innerLabel?: string;
32
+ value?: DateRange;
33
+ onChange?: SelectRangeEventHandler;
34
+ error?: string | boolean;
35
+ readOnly?: boolean;
36
+ iconClassName?: string;
37
+ showReset?: boolean;
38
+ onRemoveClick?: () => void;
39
+ }
40
+ export type DatePickerProps = DatePickerSingleProps | DatePickerMultipleProps | (DatePickerRangeProps & {
41
+ locale?: Locale;
42
+ });
43
+ /**
44
+ * Универсальный компонент выбора даты с поддержкой различных режимов
45
+ * @component
46
+ * @param {Object} props - Свойства компонента
47
+ * @param {'single' | 'multiple' | 'range'} [props.mode] - Режим выбора даты
48
+ * @param {Date | Date[] | DateRange} [props.value] - Выбранные даты в зависимости от режима
49
+ * @param {string} [props.placeholder] - Плейсхолдер для инпута. Если задан innerLabel, placeholder будет игнорироваться (вместо него выводится маска).
50
+ * @param {string} [props.innerLabel] - Метка, отображаемая перед значением с двоеточием. Если задана, резервирует место под маску и отображает её в качестве плейсхолдера.
51
+ * @param {Function} [props.onChange] - Обработчик изменения даты
52
+ * @param {string | boolean} [props.error] - Ошибка валидации
53
+ * @param {boolean} [props.readOnly] - Режим только для чтения
54
+ * @param {string} [props.iconClassName] - Дополнительные классы для иконки календаря
55
+ * @param {Locale} [props.locale] - Локализация календаря
56
+ * @param {boolean} [props.showReset] - Показывать кнопку сброса значения
57
+ * @param {Function} [props.onRemoveClick] - Обработчик клика по кнопке сброса
58
+ * @example
59
+ * <DatePicker
60
+ * mode="single"
61
+ * value={new Date()}
62
+ * placeholder="Date filter"
63
+ * innerLabel="Дата"
64
+ * onChange={(date) => console.log(date)}
65
+ * showReset
66
+ * />
67
+ */
68
+ export declare function DatePicker({ className, locale, iconClassName, ...rawProps }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
69
+ export {};
@@ -0,0 +1,66 @@
1
+ import * as React from 'react';
2
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
3
+ declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
4
+ declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
+ declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
6
+ declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
7
+ declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
+ interface DialogSectionProps extends React.HTMLAttributes<HTMLDivElement> {
9
+ scrollableSection?: boolean;
10
+ }
11
+ /**
12
+ * Диалоговое окно с поддержкой различных секций и режимов отображения
13
+ * @component
14
+ * @param {boolean} [aside] - Режим боковой панели
15
+ * @param {boolean} [scrollableSection] - Включение прокрутки в секции содержимого
16
+ * @param {React.ReactNode} children - Дочерние элементы (Header, Section, Footer)
17
+ * @example
18
+ * <Dialog>
19
+ * <DialogTrigger>Open</DialogTrigger>
20
+ * <DialogContent>
21
+ * <DialogHeader>Title</DialogHeader>
22
+ * <DialogSection>Content</DialogSection>
23
+ * <DialogFooter>Actions</DialogFooter>
24
+ * </DialogContent>
25
+ * </Dialog>
26
+ */
27
+ declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
28
+ aside?: boolean;
29
+ scrollableSection?: boolean;
30
+ } & React.RefAttributes<HTMLDivElement>>;
31
+ /**
32
+ * Шапка диалогового окна
33
+ * @component
34
+ * @param {boolean} [hideCloseButton] - Скрыть кнопку закрытия
35
+ * @param {React.ReactNode} children - Заголовок и дополнительный контент
36
+ */
37
+ declare const DialogHeader: {
38
+ ({ className, hideCloseButton, ...props }: React.HTMLAttributes<HTMLDivElement> & {
39
+ hideCloseButton?: boolean;
40
+ }): import("react/jsx-runtime").JSX.Element;
41
+ displayName: string;
42
+ };
43
+ /**
44
+ * Футер диалогового окна для действий
45
+ * @component
46
+ * @param {React.ReactNode} children - Кнопки или другие интерактивные элементы
47
+ */
48
+ interface DialogFooterProps extends React.HTMLAttributes<HTMLDivElement> {
49
+ align?: 'start' | 'end';
50
+ }
51
+ declare const DialogFooter: {
52
+ ({ className, align, ...props }: DialogFooterProps): import("react/jsx-runtime").JSX.Element;
53
+ displayName: string;
54
+ };
55
+ declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
56
+ declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
57
+ /**
58
+ * Секция содержимого диалога с поддержкой прокрутки
59
+ * @component
60
+ * @param {boolean} [scrollableSection] - Активировать прокрутку содержимого
61
+ */
62
+ declare const DialogSection: {
63
+ ({ className, scrollableSection, ...props }: DialogSectionProps): import("react/jsx-runtime").JSX.Element;
64
+ displayName: string;
65
+ };
66
+ export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, DialogSection, };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Компонент точки для разделения элементов с кастомизируемым стилем
3
+ * @component
4
+ * @param {string} [className] - Дополнительные CSS-классы для кастомизации
5
+ * @example
6
+ * <Dot className="text-red-500 text-xl" />
7
+ */
8
+ export declare const Dot: ({ className }: {
9
+ className?: string;
10
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,67 @@
1
+ import * as React from 'react';
2
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
3
+ /**
4
+ * Составной компонент выпадающего меню с поддержкой различных типов элементов
5
+ * @component
6
+ * @see https://www.radix-ui.com/primitives/docs/components/dropdown-menu
7
+ */
8
+ declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
9
+ declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
10
+ declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
11
+ declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
12
+ declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
13
+ declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
14
+ declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
15
+ inset?: boolean;
16
+ } & React.RefAttributes<HTMLDivElement>>;
17
+ declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
18
+ declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
19
+ declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
20
+ inset?: boolean;
21
+ } & React.RefAttributes<HTMLDivElement>>;
22
+ /**
23
+ * Элемент меню с поддержкой чекбокса
24
+ * @component
25
+ * @param {boolean} checked - Состояние чекбокса
26
+ */
27
+ declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
28
+ /**
29
+ * Элемент меню с поддержкой радио-кнопки
30
+ * @component
31
+ * @param {string} value - Значение радио-кнопки
32
+ */
33
+ declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
34
+ declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
35
+ inset?: boolean;
36
+ } & React.RefAttributes<HTMLDivElement>>;
37
+ declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
38
+ declare const DropdownMenuShortcut: {
39
+ ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
40
+ displayName: string;
41
+ };
42
+ interface DropdownActionItem {
43
+ label: string;
44
+ icon?: React.ReactNode;
45
+ onClick?: () => void;
46
+ }
47
+ interface DropdownActionsProps {
48
+ triggerClassName?: string;
49
+ actions: (DropdownActionItem | null)[];
50
+ children?: React.ReactNode;
51
+ renderItem?: (item: DropdownActionItem) => React.ReactNode;
52
+ }
53
+ /**
54
+ * Кастомный элемент меню действий с иконками и обработчиками
55
+ * @component
56
+ * @param {Object} props - Свойства компонента
57
+ * @param {DropdownActionItem[]} props.actions - Массив элементов меню
58
+ * @param {string} [props.triggerClassName] - Дополнительные классы для триггера
59
+ * @param {React.ReactNode} [props.children] - Кастомный элемент триггера
60
+ * @param {Function} [props.renderItem] - Функция кастомного рендера элемента
61
+ * @example
62
+ * <DropdownActions actions={[{ label: 'Edit', onClick: handleEdit }]}>
63
+ * <Button>Actions</Button>
64
+ * </DropdownActions>
65
+ */
66
+ export declare const DropdownActions: ({ triggerClassName, actions, children, renderItem, }: DropdownActionsProps) => import("react/jsx-runtime").JSX.Element;
67
+ export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
@@ -0,0 +1,36 @@
1
+ import * as React from 'react';
2
+ export interface FileInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
3
+ /** Callback при добавлении файла */
4
+ onAdd: (file: File, error?: {
5
+ fileSizeError?: string;
6
+ fileTypeError?: string;
7
+ }) => void;
8
+ /** Callback при удалении файла */
9
+ onFileRemove?: (onConfirmCallback?: () => void) => void;
10
+ /** Callback при клике на поле ввода */
11
+ onClick?: () => void;
12
+ /** Текст ошибки или флаг наличия ошибки */
13
+ error?: string | boolean;
14
+ /** Максимальный размер файла в байтах */
15
+ maxFileSize: number;
16
+ /** Значение по умолчанию для имени файла */
17
+ defaultValue?: string;
18
+ }
19
+ /**
20
+ * Компонент для выбора файла с валидацией и превью.
21
+ * Поддерживает кастомизацию через стандартные атрибуты input.
22
+ *
23
+ * @component
24
+ * @param {FileInputProps} props - Пропсы компонента
25
+ * @returns {JSX.Element}
26
+ *
27
+ * @example
28
+ * <FileInput
29
+ * onAdd={(file) => console.log(file)}
30
+ * maxFileSize={5242880}
31
+ * accept="image/*"
32
+ * placeholder="Выберите файл"
33
+ * />
34
+ */
35
+ declare const FileInput: React.ForwardRefExoticComponent<FileInputProps & React.RefAttributes<HTMLInputElement>>;
36
+ export { FileInput };