@krit-llc/krit-ui 0.0.0-stage → 0.0.79

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 (108) hide show
  1. package/README.md +153 -2
  2. package/dist/assets/index.d.ts +204 -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 +58 -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 +48 -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 +122 -0
  40. package/dist/components/ui/popover.d.ts +29 -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/radix-dialog-dismiss.lib.d.ts +14 -0
  50. package/dist/components/ui/radix-popover-container.lib.d.ts +7 -0
  51. package/dist/components/ui/resizable.d.ts +65 -0
  52. package/dist/components/ui/scroll-area.d.ts +5 -0
  53. package/dist/components/ui/secondary-panel-section.d.ts +20 -0
  54. package/dist/components/ui/segmented-control.d.ts +35 -0
  55. package/dist/components/ui/select-header-filter.d.ts +37 -0
  56. package/dist/components/ui/select.d.ts +91 -0
  57. package/dist/components/ui/separator.d.ts +34 -0
  58. package/dist/components/ui/sheet.d.ts +118 -0
  59. package/dist/components/ui/skeleton.d.ts +24 -0
  60. package/dist/components/ui/sort-component.d.ts +35 -0
  61. package/dist/components/ui/sortable-header.d.ts +25 -0
  62. package/dist/components/ui/switch.d.ts +25 -0
  63. package/dist/components/ui/table-column-resize-handle.d.ts +8 -0
  64. package/dist/components/ui/table-filter-editor.d.ts +11 -0
  65. package/dist/components/ui/table.d.ts +104 -0
  66. package/dist/components/ui/tabs.d.ts +52 -0
  67. package/dist/components/ui/tabsVariants.d.ts +6 -0
  68. package/dist/components/ui/text-area.d.ts +37 -0
  69. package/dist/components/ui/theme-provider.d.ts +205 -0
  70. package/dist/components/ui/time-picker.d.ts +31 -0
  71. package/dist/components/ui/time-picker.lib.d.ts +6 -0
  72. package/dist/components/ui/toast.d.ts +80 -0
  73. package/dist/components/ui/toaster.d.ts +22 -0
  74. package/dist/components/ui/tooltip.d.ts +65 -0
  75. package/dist/components/ui/tree-view.d.ts +96 -0
  76. package/dist/components/ui/widget-plan-fact.d.ts +86 -0
  77. package/dist/date.d.ts +8 -0
  78. package/dist/hooks/useColumnFilters.d.ts +6 -0
  79. package/dist/hooks/useColumnSizing.d.ts +20 -0
  80. package/dist/hooks/useCombinedRefs.d.ts +1 -0
  81. package/dist/hooks/useConfirm.d.ts +49 -0
  82. package/dist/hooks/useNotify.d.ts +28 -0
  83. package/dist/hooks/usePreviewsFilePicker.d.ts +40 -0
  84. package/dist/hooks/useSidebar.d.ts +10 -0
  85. package/dist/hooks/useStoredExpand.d.ts +18 -0
  86. package/dist/hooks/useStoredFields.d.ts +4 -0
  87. package/dist/hooks/useStoredTabs.d.ts +4 -0
  88. package/dist/hooks/useTableStates.d.ts +26 -0
  89. package/dist/hooks/useTheme.d.ts +1 -0
  90. package/dist/hooks/useToast.d.ts +44 -0
  91. package/dist/hooks/useTranslation.d.ts +4 -0
  92. package/dist/krit-ui.d.ts +2 -0
  93. package/dist/krit-ui.js +29694 -0
  94. package/dist/krit-ui.umd.cjs +137 -0
  95. package/dist/lib/attachments.d.ts +245 -0
  96. package/dist/lib/cookies.d.ts +1 -0
  97. package/dist/lib/file.d.ts +52 -0
  98. package/dist/lib/infinite-scroll.d.ts +13 -0
  99. package/dist/lib/selectUtils.d.ts +14 -0
  100. package/dist/lib/table-filter.d.ts +35 -0
  101. package/dist/lib/text.d.ts +1 -0
  102. package/dist/lib/zod.d.ts +27 -0
  103. package/dist/main.d.ts +88 -0
  104. package/dist/style.css +1 -0
  105. package/dist/utils.d.ts +2 -0
  106. package/docs/table-filters.md +481 -0
  107. package/package.json +125 -4
  108. package/tailwind.config.cjs +273 -0
@@ -0,0 +1,40 @@
1
+ import { ReactNode } from 'react';
2
+ import { ContentType } from '../../lib/attachments';
3
+ interface PreviewFullProps {
4
+ children?: ReactNode;
5
+ src?: string;
6
+ name?: string;
7
+ type?: ContentType;
8
+ onPrev?: () => void;
9
+ onNext?: () => void;
10
+ onRemove?: () => Promise<void>;
11
+ }
12
+ /**
13
+ * Компонент для полноэкранного просмотра медиа-контента с поддержкой навигации, поворота и управления.
14
+ * Поддерживает изображения, видео, аудио и PDF файлы.
15
+ *
16
+ * @component
17
+ * @param {PreviewFullProps} props - Параметры компонента
18
+ * @param {ReactNode} [props.children] - Элемент, который будет триггером открытия модального окна
19
+ * @param {string} [props.src] - URL источника медиа-контента
20
+ * @param {string} [props.name] - Название файла (особенно важно для PDF)
21
+ * @param {ContentType} [props.type] - Тип контента (image, video, audio, pdf)
22
+ * @param {function} [props.onPrev] - Функция перехода к предыдущему элементу в галерее
23
+ * @param {function} [props.onNext] - Функция перехода к следующему элементу в галерее
24
+ * @param {function} [props.onRemove] - Функция удаления текущего элемента
25
+ * @returns {React.ReactElement} Модальное окно для просмотра медиа-контента
26
+ *
27
+ * @example
28
+ * <PreviewFull
29
+ * src="/path/to/image.jpg"
30
+ * type="image"
31
+ * name="Image.jpg"
32
+ * onPrev={() => console.log('Previous')}
33
+ * onNext={() => console.log('Next')}
34
+ * onRemove={() => console.log('Remove')}
35
+ * >
36
+ * <button>Open Preview</button>
37
+ * </PreviewFull>
38
+ */
39
+ export declare const PreviewFull: ({ children, src, name, type, onPrev, onNext, onRemove, }: PreviewFullProps) => import("react").JSX.Element;
40
+ export {};
@@ -0,0 +1,69 @@
1
+ import { AttachmentItem, ContentType } from '../../lib/attachments';
2
+ export interface PreviewsProps {
3
+ className?: string;
4
+ placeholder?: string;
5
+ data?: AttachmentItem[];
6
+ accepts?: ContentType[];
7
+ multiple?: boolean;
8
+ max?: number;
9
+ hint?: string;
10
+ previewSize?: number;
11
+ gap?: number;
12
+ title?: string;
13
+ orientation?: 'vertical' | 'horizontal';
14
+ maxSizes?: {
15
+ image?: number;
16
+ video?: number;
17
+ total?: number;
18
+ audio?: number;
19
+ pdf?: number;
20
+ word?: number;
21
+ excel?: number;
22
+ archive?: number;
23
+ };
24
+ withCompress?: boolean;
25
+ handleFileLimit?: (filetype: ContentType) => void;
26
+ handleAllFilesLimit?: () => void;
27
+ onAdd?: (files: File[]) => void;
28
+ onRemove?: (index: number) => void;
29
+ }
30
+ /**
31
+ * Компонент для отображения и управления вложениями различных типов (изображения, видео, аудио, PDF).
32
+ * Поддерживает предпросмотр, добавление, удаление и сжатие файлов с проверкой ограничений по размеру.
33
+ *
34
+ * @component
35
+ * @param {PreviewsProps} props - Параметры компонента
36
+ * @param {string} [props.className] - Дополнительные CSS-классы для контейнера
37
+ * @param {string} [props.placeholder] - Текст-заполнитель при отсутствии вложений
38
+ * @param {AttachmentItem[]} [props.data=[]] - Массив вложений для отображения
39
+ * @param {ContentType[]} [props.accepts=defaultAccepts] - Разрешенные типы файлов
40
+ * @param {boolean} [props.multiple=true] - Разрешить множественный выбор файлов
41
+ * @param {number} [props.max=10] - Максимальное количество файлов
42
+ * @param {string} [props.hint] - Подсказка под кнопкой добавления файла
43
+ * @param {number} [props.previewSize=130] - Размер превью в пикселях
44
+ * @param {number} [props.gap=2] - Отступ между элементами
45
+ * @param {string} [props.title] - Заголовок для изображений
46
+ * @param {'vertical' | 'horizontal'} [props.orientation='horizontal'] - Ориентация элементов
47
+ * @param {object} [props.maxSizes] - Максимальные размеры файлов по типам
48
+ * @param {number} [props.maxSizes.image=MAX_IMAGE_SIZE_MB] - Макс. размер изображений (МБ)
49
+ * @param {number} [props.maxSizes.video=MAX_VIDEO_SIZE_MB] - Макс. размер видео (МБ)
50
+ * @param {number} [props.maxSizes.total=MAX_TOTAL_SIZE_MB] - Макс. общий размер (МБ)
51
+ * @param {number} [props.maxSizes.audio=MAX_AUDIO_SIZE_MB] - Макс. размер аудио (МБ)
52
+ * @param {number} [props.maxSizes.pdf=MAX_PDF_SIZE_MB] - Макс. размер PDF (МБ)
53
+ * @param {boolean} [props.withCompress=true] - Включить сжатие файлов
54
+ * @param {function} [props.onAdd] - Обработчик добавления файлов
55
+ * @param {function} [props.onRemove] - Обработчик удаления файлов
56
+ * @returns {React.ReactElement} Компонент для управления вложениями
57
+ *
58
+ * @example
59
+ * <Previews
60
+ * data={attachments}
61
+ * onAdd={(files) => console.log('Added files:', files)}
62
+ * onRemove={(index) => console.log('Remove file at index:', index)}
63
+ * max={5}
64
+ * orientation="vertical"
65
+ * />
66
+ *
67
+ * Для компактного списка и кнопки в другом месте экрана см. `PreviewsCompactList` и `usePreviewsFilePicker`.
68
+ */
69
+ export declare const Previews: (props: PreviewsProps) => import("react").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { AttachmentItem } from '../../lib/attachments';
2
+ export interface PreviewsCompactListProps {
3
+ className?: string;
4
+ data?: AttachmentItem[];
5
+ onRemove?: (index: number) => void;
6
+ /** Подпись поверх миниатюры изображения (как в Previews) */
7
+ title?: string;
8
+ /**
9
+ * Резерв под макет Figma: превью всегда 40×40 (size S).
10
+ * Значение `M` оставлено для совместимости и также даёт 40×40.
11
+ */
12
+ cardSize?: 'S' | 'M';
13
+ }
14
+ /**
15
+ * Компактный горизонтальный список вложений (макет Figma File Upload New). Логика удаления и модального превью — как у Previews.
16
+ * В паре с `usePreviewsFilePicker`: список и кнопка-скрепка в разных местах разметки.
17
+ */
18
+ export declare const PreviewsCompactList: ({ className, data, onRemove, title, }: PreviewsCompactListProps) => import("react").JSX.Element | null;
@@ -0,0 +1,8 @@
1
+ import { AttachmentItem, ContentType } from '../../lib/attachments';
2
+ /** Типы вложений, открываемых в модальном превью */
3
+ export declare const PREVIEW_TYPES: ContentType[];
4
+ export declare const getContentTypeFromMime: (mimeType: string) => ContentType | null;
5
+ export declare const getAttachmentContentType: (attachment?: AttachmentItem) => ContentType;
6
+ export declare const getAttachmentPreviewUrl: (attachment?: AttachmentItem) => string | undefined;
7
+ export declare const getAttachmentDownloadUrl: (attachment?: AttachmentItem) => string | undefined;
8
+ export declare const filterValidAttachmentItems: (data: AttachmentItem[] | undefined) => AttachmentItem[];
@@ -0,0 +1,41 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * Пропсы компонента Profile
4
+ */
5
+ export interface ProfileProps extends React.ComponentPropsWithoutRef<'div'> {
6
+ /** URL изображения аватара */
7
+ avatarUrl?: string;
8
+ /** Альтернативный текст для аватара */
9
+ avatarAlt?: string;
10
+ /** Имя пользователя */
11
+ name: string;
12
+ /** Email адрес пользователя */
13
+ email?: string;
14
+ /** Роль пользователя */
15
+ role?: string;
16
+ }
17
+ /**
18
+ * Компонент для отображения профиля пользователя с аватаром, именем, email и ролью.
19
+ * Соответствует дизайну из Figma.
20
+ *
21
+ * @component
22
+ * @param {ProfileProps} props - Параметры компонента
23
+ * @returns {React.ReactElement} Компонент профиля
24
+ *
25
+ * @example
26
+ * <Profile
27
+ * avatarUrl="/path/to/avatar.jpg"
28
+ * name="Семенова А.И."
29
+ * email="a.semenova@mail.ru"
30
+ * role="Автор"
31
+ * />
32
+ *
33
+ * @example
34
+ * <Profile
35
+ * name="Иванов И.И."
36
+ * email="ivanov@example.com"
37
+ * role="Разработчик"
38
+ * />
39
+ */
40
+ declare const Profile: React.ForwardRefExoticComponent<ProfileProps & React.RefAttributes<HTMLDivElement>>;
41
+ export { Profile };
@@ -0,0 +1,48 @@
1
+ import * as React from 'react';
2
+ import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
3
+ /**
4
+ * Группа радиокнопок для выбора одной опции из нескольких.
5
+ * Основан на Radix UI RadioGroup с дополнительными стилями.
6
+ *
7
+ * @component
8
+ * @param {object} props - Параметры компонента
9
+ * @param {string} [props.className] - Дополнительные CSS-классы
10
+ * @param {string} [props.defaultValue] - Значение выбранной по умолчанию опции
11
+ * @param {string} [props.value] - Управляемое значение выбранной опции
12
+ * @param {function} [props.onValueChange] - Обработчик изменения выбранной опции
13
+ * @param {boolean} [props.disabled] - Отключение всей группы
14
+ * @param {boolean} [props.required] - Обязательность выбора
15
+ * @param {string} [props.name] - Имя группы (для форм)
16
+ * @param {string} [props.orientation] - Ориентация группы (horizontal/vertical)
17
+ * @param {React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>} props - Стандартные свойства RadioGroup из Radix UI
18
+ * @param {React.Ref<React.ElementRef<typeof RadioGroupPrimitive.Root>>} ref - Реф для доступа к DOM-элементу
19
+ * @returns {React.ReactElement} Группа радиокнопок
20
+ *
21
+ * @example
22
+ * <RadioGroup defaultValue="option1">
23
+ * <RadioGroupItem value="option1" id="option1" />
24
+ * <Label htmlFor="option1">Option 1</Label>
25
+ * <RadioGroupItem value="option2" id="option2" />
26
+ * <Label htmlFor="option2">Option 2</Label>
27
+ * </RadioGroup>
28
+ */
29
+ declare const RadioGroup: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
30
+ /**
31
+ * Отдельный элемент радиокнопки в группе.
32
+ * Основан на Radix UI RadioGroupItem с дополнительными стилями.
33
+ *
34
+ * @component
35
+ * @param {object} props - Параметры компонента
36
+ * @param {string} [props.className] - Дополнительные CSS-классы
37
+ * @param {string} props.value - Значение элемента, уникальное в группе
38
+ * @param {boolean} [props.disabled] - Отключение элемента
39
+ * @param {boolean} [props.required] - Обязательность выбора элемента
40
+ * @param {React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>} props - Стандартные свойства RadioGroupItem из Radix UI
41
+ * @param {React.Ref<React.ElementRef<typeof RadioGroupPrimitive.Item>>} ref - Реф для доступа к DOM-элементу
42
+ * @returns {React.ReactElement} Элемент радиокнопки
43
+ *
44
+ * @example
45
+ * <RadioGroupItem value="option1" id="option1" />
46
+ */
47
+ declare const RadioGroupItem: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
48
+ export { RadioGroup, RadioGroupItem };
@@ -0,0 +1,14 @@
1
+ import type * as React from 'react';
2
+ import type * as DialogPrimitive from '@radix-ui/react-dialog';
3
+ type DialogContentProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>;
4
+ declare const createDialogOutsideInteractionHandlers: (options: Pick<DialogContentProps, "onPointerDownOutside" | "onInteractOutside">) => {
5
+ onPointerDownOutside: (event: CustomEvent<{
6
+ originalEvent: PointerEvent;
7
+ }>) => void;
8
+ onInteractOutside: (event: CustomEvent<{
9
+ originalEvent: PointerEvent;
10
+ }> | CustomEvent<{
11
+ originalEvent: FocusEvent;
12
+ }>) => void;
13
+ };
14
+ export { createDialogOutsideInteractionHandlers };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Finds the nearest Radix dialog container for portal nesting.
3
+ * When a popover is rendered inside a dialog, prefer this container and
4
+ * disable nested modal locking to avoid stuck body pointer-events.
5
+ */
6
+ declare const getDialogContainer: (node: HTMLElement | null) => HTMLElement | null;
7
+ export { getDialogContainer };
@@ -0,0 +1,65 @@
1
+ import { ImperativePanelGroupHandle, PanelGroupProps } from 'react-resizable-panels';
2
+ import * as React from 'react';
3
+ import * as ResizablePrimitive from 'react-resizable-panels';
4
+ /**
5
+ * Контейнер для группы изменяемых панелей. Позволяет создавать интерфейсы с изменяемыми размерами панелей.
6
+ * Основан на react-resizable-panels с дополнительными стилями.
7
+ *
8
+ * @component
9
+ * @param {object} props - Параметры компонента
10
+ * @param {string} [props.className] - Дополнительные CSS-классы
11
+ * @param {'horizontal' | 'vertical'} [props.direction] - Направление размещения панелей
12
+ * @param {object} props - Стандартные свойства PanelGroup (PanelGroupProps) из react-resizable-panels
13
+ * @returns {React.ReactElement} Контейнер для группы изменяемых панелей
14
+ *
15
+ * @example
16
+ * <ResizablePanelGroup direction="horizontal">
17
+ * <ResizablePanel defaultSize={50}>
18
+ * <div>Левая панель</div>
19
+ * </ResizablePanel>
20
+ * <ResizableHandle withHandle />
21
+ * <ResizablePanel defaultSize={50}>
22
+ * <div>Правая панель</div>
23
+ * </ResizablePanel>
24
+ * </ResizablePanelGroup>
25
+ */
26
+ declare const ResizablePanelGroup: React.ForwardRefExoticComponent<PanelGroupProps & React.RefAttributes<ImperativePanelGroupHandle>>;
27
+ /**
28
+ * Изменяемая панель, которая может быть перетаскиваема для изменения размера.
29
+ * Прямой ре-экспорт Panel из react-resizable-panels.
30
+ */
31
+ declare const ResizablePanel: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement | HTMLElement | HTMLButtonElement | HTMLFormElement | HTMLSpanElement | HTMLObjectElement | HTMLTitleElement | HTMLSlotElement | HTMLStyleElement | HTMLLinkElement | HTMLMapElement | HTMLDialogElement | HTMLImageElement | HTMLOptionElement | HTMLTableElement | HTMLTimeElement | HTMLAnchorElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLHeadingElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLInputElement | HTMLLabelElement | HTMLLegendElement | HTMLLIElement | HTMLMetaElement | HTMLMeterElement | HTMLOListElement | HTMLOptGroupElement | HTMLOutputElement | HTMLParagraphElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSourceElement | HTMLTemplateElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTextAreaElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLVideoElement | HTMLTableCaptionElement | HTMLMenuElement | HTMLPictureElement>, "id" | "onResize"> & {
32
+ className?: string | undefined;
33
+ collapsedSize?: number | undefined;
34
+ collapsible?: boolean | undefined;
35
+ defaultSize?: number | undefined;
36
+ id?: string | undefined;
37
+ maxSize?: number | undefined;
38
+ minSize?: number | undefined;
39
+ onCollapse?: ResizablePrimitive.PanelOnCollapse | undefined;
40
+ onExpand?: ResizablePrimitive.PanelOnExpand | undefined;
41
+ onResize?: ResizablePrimitive.PanelOnResize | undefined;
42
+ order?: number | undefined;
43
+ style?: object | undefined;
44
+ tagName?: keyof HTMLElementTagNameMap | undefined;
45
+ } & {
46
+ children?: import('react').ReactNode;
47
+ } & React.RefAttributes<ResizablePrimitive.ImperativePanelHandle>>;
48
+ /**
49
+ * Элемент для изменения размера панелей. Может отображаться с ручкой для перетаскивания.
50
+ * Основан на PanelResizeHandle из react-resizable-panels с дополнительными стилями.
51
+ *
52
+ * @component
53
+ * @param {object} props - Параметры компонента
54
+ * @param {string} [props.className] - Дополнительные CSS-классы
55
+ * @param {boolean} [props.withHandle] - Отображать ли видимую ручку для перетаскивания
56
+ * @param {React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle>} props - Стандартные свойства PanelResizeHandle из react-resizable-panels
57
+ * @returns {React.ReactElement} Элемент для изменения размера панелей
58
+ *
59
+ * @example
60
+ * <ResizableHandle withHandle />
61
+ */
62
+ declare const ResizableHandle: ({ withHandle, className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
63
+ withHandle?: boolean;
64
+ }) => React.JSX.Element;
65
+ export { ResizablePanelGroup, ResizablePanel, ResizableHandle };
@@ -0,0 +1,5 @@
1
+ import * as React from "react";
2
+ import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
3
+ declare const ScrollArea: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
+ declare const ScrollBar: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
+ export { ScrollArea, ScrollBar };
@@ -0,0 +1,20 @@
1
+ import { ReactNode } from 'react';
2
+ export interface SecondaryPanelSectionProps {
3
+ /** Текст при отсутствии данных */
4
+ emptyStateText: ReactNode;
5
+ /** Слот для кнопки или панели действий над контентом */
6
+ actionsSlot?: ReactNode;
7
+ /** Контент при наличии данных (список и т.п.) */
8
+ children?: ReactNode;
9
+ /** Показать пустое состояние вместо children */
10
+ isEmpty: boolean;
11
+ /** Дополнительные классы для внешнего контейнера */
12
+ className?: string;
13
+ /** Дополнительные классы для внутренней колонки */
14
+ innerClassName?: string;
15
+ }
16
+ /**
17
+ * Секция на вторичном фоне: слот действий, затем либо пустое состояние с текстом, либо основной контент.
18
+ * Скругление — `rounded-lg` (`--krit-radius` в tailwind.css), отступы — `p-6` (шкала spacing Tailwind).
19
+ */
20
+ export declare const SecondaryPanelSection: ({ emptyStateText, actionsSlot, children, isEmpty, className, innerClassName, }: SecondaryPanelSectionProps) => import("react").JSX.Element;
@@ -0,0 +1,35 @@
1
+ import { ReactNode } from 'react';
2
+ export interface SegmentedControlProps {
3
+ defaultValue?: string;
4
+ options?: {
5
+ value: string;
6
+ label: string;
7
+ icon?: ReactNode;
8
+ }[];
9
+ onClick?: (value: string) => void;
10
+ }
11
+ /**
12
+ * Сегментированный контрол для переключения между опциями.
13
+ * Построен на основе компонента Tabs с упрощенным API.
14
+ *
15
+ * @component
16
+ * @param {object} props - Параметры компонента
17
+ * @param {string} [props.defaultValue] - Значение выбранной по умолчанию опции
18
+ * @param {Array} [props.options] - Массив опций для отображения
19
+ * @param {string} props.options[].value - Уникальное значение опции
20
+ * @param {string} props.options[].label - Текстовая метка опции
21
+ * @param {ReactNode} [props.options[].icon] - Иконка опции (опционально)
22
+ * @param {function} [props.onClick] - Обработчик клика по опции
23
+ * @returns {React.ReactElement} Сегментированный контрол
24
+ *
25
+ * @example
26
+ * <SegmentedControl
27
+ * defaultValue="option1"
28
+ * options={[
29
+ * { value: "option1", label: "Опция 1" },
30
+ * { value: "option2", label: "Опция 2", icon: <Icon /> },
31
+ * ]}
32
+ * onClick={(value) => console.log(value)}
33
+ * />
34
+ */
35
+ export declare const SegmentedControl: ({ defaultValue, options, onClick }: SegmentedControlProps) => import("react").JSX.Element;
@@ -0,0 +1,37 @@
1
+ import { ReactNode } from 'react';
2
+ import { Column, Table } from '@tanstack/react-table';
3
+ export type Options<T> = T[] | {
4
+ value: T;
5
+ label?: ReactNode;
6
+ labelText?: string;
7
+ }[];
8
+ export type Option<T = string | number> = Options<T>[number];
9
+ /** Состояние источника. Запросы, debounce и cursor принадлежат приложению. */
10
+ export interface HeaderFilterOptionsState {
11
+ search?: string;
12
+ onSearchChange?: (search: string) => void;
13
+ filterOptionsBySearch?: boolean;
14
+ loading?: boolean;
15
+ loadingMore?: boolean;
16
+ hasMore?: boolean;
17
+ onLoadMore?: () => void;
18
+ error?: string;
19
+ onRetry?: () => void;
20
+ }
21
+ export interface SelectHeaderFilterProps<T = string | number, TData = unknown> extends HeaderFilterOptionsState {
22
+ table?: Table<TData>;
23
+ column?: Column<TData, unknown>;
24
+ excludeAllLabel?: string;
25
+ options?: Options<T>;
26
+ /** Подписи сохранённых значений, отсутствующих в текущей странице options. */
27
+ selectedOptions?: Options<T>;
28
+ checked?: Options<T>;
29
+ disabled?: T[];
30
+ hidden?: T[];
31
+ radio?: boolean;
32
+ maxSelected?: number;
33
+ showSelectAll?: boolean;
34
+ showSelected?: boolean;
35
+ onCheckedChange?: (checked: Options<T> | undefined) => void;
36
+ }
37
+ export declare const SelectHeaderFilter: <T, TData = unknown>({ excludeAllLabel, options, selectedOptions, checked, disabled, hidden, search: controlledSearch, onSearchChange, filterOptionsBySearch, loading, loadingMore, hasMore, onLoadMore, error, onRetry, radio, maxSelected, showSelectAll, showSelected, onCheckedChange, }: SelectHeaderFilterProps<T, TData>) => import("react").JSX.Element;
@@ -0,0 +1,91 @@
1
+ import * as React from 'react';
2
+ import * as SelectPrimitive from '@radix-ui/react-select';
3
+ export interface OptionType {
4
+ label: string;
5
+ value: string;
6
+ disabled?: boolean;
7
+ }
8
+ export interface SelectProps extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Root> {
9
+ placeholder?: React.ReactNode;
10
+ options: OptionType[];
11
+ triggerClassName?: string;
12
+ clearable?: boolean;
13
+ borderless?: boolean;
14
+ isLoading?: boolean;
15
+ isError?: boolean;
16
+ error?: string | boolean;
17
+ readOnly?: boolean;
18
+ autoSelectSingleOption?: boolean;
19
+ renderValue?: (option: OptionType) => React.ReactNode;
20
+ renderOption?: (option: OptionType) => React.ReactNode;
21
+ onRefetch?: () => void;
22
+ onChange?: (value: string, label: string) => void;
23
+ onClick?: () => void;
24
+ }
25
+ /**
26
+ * Расширенный компонент выбора (select) с поддержкой виртуализации, загрузки, ошибок и кастомного рендеринга.
27
+ * Основан на Radix UI Select с дополнительными функциями и стилями.
28
+ *
29
+ * @component
30
+ * @param {object} props - Параметры компонента
31
+ * @param {string} [props.placeholder] - Текст-заполнитель при отсутствии выбора
32
+ * @param {OptionType[]} props.options - Массив опций для выбора
33
+ * @param {string} [props.triggerClassName] - Дополнительные классы для триггера
34
+ * @param {boolean} [props.clearable] - Возможность очистки выбора
35
+ * @param {boolean} [props.borderless] - Стиль без границ
36
+ * @param {boolean} [props.isLoading] - Флаг загрузки данных
37
+ * @param {boolean} [props.isError] - Флаг ошибки загрузки
38
+ * @param {string|boolean} [props.error] - Сообщение об ошибке
39
+ * @param {boolean} [props.readOnly] - Режим только для чтения
40
+ * @param {boolean} [props.autoSelectSingleOption] - Автоматически выбирать единственную доступную опцию
41
+ * @param {function} [props.renderValue] - Функция кастомного рендеринга выбранного значения
42
+ * @param {function} [props.renderOption] - Функция кастомного рендеринга опций
43
+ * @param {function} [props.onRefetch] - Обработчик повторной загрузки данных
44
+ * @param {function} [props.onChange] - Обработчик изменения значения
45
+ * @param {function} [props.onClick] - Обработчик клика по триггеру
46
+ * @param {React.Ref<React.ElementRef<typeof SelectPrimitive.Trigger>>} ref - Реф для доступа к DOM-элементу
47
+ * @returns {React.ReactElement} Компонент выбора с расширенными возможностями
48
+ *
49
+ * @example
50
+ * <Select
51
+ * options={[
52
+ * { value: "option1", label: "Option 1" },
53
+ * { value: "option2", label: "Option 2" }
54
+ * ]}
55
+ * placeholder="Select an option"
56
+ * clearable
57
+ * onChange={(value, label) => console.log(value, label)}
58
+ * />
59
+ */
60
+ declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLButtonElement>>;
61
+ /**
62
+ * Компонент для отображения выбранного значения в Select.
63
+ * Основан на Radix UI SelectValue.
64
+ */
65
+ declare const SelectValue: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
66
+ /**
67
+ * Триггер для открытия выпадающего списка Select.
68
+ * Основан на Radix UI SelectTrigger с кастомными стилями.
69
+ */
70
+ declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
71
+ /**
72
+ * Контейнер для выпадающего списка опций Select.
73
+ * Основан на Radix UI SelectContent с кастомными стилями.
74
+ */
75
+ declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
76
+ /**
77
+ * Компонент для группировки опций в Select.
78
+ * Основан на Radix UI SelectLabel.
79
+ */
80
+ declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
81
+ /**
82
+ * Элемент опции в выпадающем списке Select.
83
+ * Основан на Radix UI SelectItem с кастомными стилями.
84
+ */
85
+ declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
86
+ /**
87
+ * Разделитель для группировки опций в Select.
88
+ * Основан на Radix UI SelectSeparator.
89
+ */
90
+ declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
91
+ export { Select, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, };
@@ -0,0 +1,34 @@
1
+ import * as React from 'react';
2
+ import * as SeparatorPrimitive from '@radix-ui/react-separator';
3
+ /**
4
+ * Разделитель для визуального отделения элементов интерфейса.
5
+ * Основан на Radix UI Separator с кастомизацией стилей.
6
+ *
7
+ * @component
8
+ * @param {object} props - Параметры компонента
9
+ * @param {string} [props.className] - Дополнительные CSS-классы
10
+ * @param {"horizontal" | "vertical"} [props.orientation="horizontal"] - Ориентация разделителя
11
+ * @param {boolean} [props.decorative=true] - Флаг декоративного элемента (не влияет на доступность)
12
+ * @param {"default" | "sidebar"} [props.intent="default"] - `sidebar` задаёт фон `bg-line-sidebar` для панели сайдбара
13
+ * @param {React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>} props - Стандартные свойства Separator из Radix UI
14
+ * @param {React.Ref<React.ElementRef<typeof SeparatorPrimitive.Root>>} ref - Реф для доступа к DOM-элементу
15
+ * @returns {React.ReactElement} Разделитель с заданными свойствами
16
+ *
17
+ * @example
18
+ * <Separator />
19
+ * <Separator orientation="vertical" className="my-4" />
20
+ * <Separator intent="sidebar" className="ml-3 w-[calc(100%-24px)]" />
21
+ */
22
+ export type SeparatorProps = React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root> & {
23
+ /**
24
+ * `sidebar` — токен `--krit-line-sidebar` для разделителей на фоне `background-sidebar`.
25
+ */
26
+ intent?: 'default' | 'sidebar';
27
+ };
28
+ declare const Separator: React.ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
29
+ /**
30
+ * `sidebar` — токен `--krit-line-sidebar` для разделителей на фоне `background-sidebar`.
31
+ */
32
+ intent?: "default" | "sidebar";
33
+ } & React.RefAttributes<HTMLDivElement>>;
34
+ export { Separator };