@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,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-runtime").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-runtime").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-runtime").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,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 | HTMLSpanElement | HTMLObjectElement | HTMLTitleElement | HTMLSlotElement | HTMLStyleElement | HTMLLinkElement | HTMLDialogElement | HTMLFormElement | 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 | HTMLMapElement | 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
+ }) => import("react/jsx-runtime").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-runtime").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-runtime").JSX.Element;
@@ -0,0 +1,23 @@
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
+ type ColumnFilterProps<T = string | number> = {
10
+ table?: Table<any>;
11
+ column?: Column<any, unknown>;
12
+ excludeAllLabel?: string;
13
+ options?: Options<T>;
14
+ checked?: Options<T>;
15
+ disabled?: string[] | number[];
16
+ hidden?: string[] | number[];
17
+ search?: string;
18
+ radio?: boolean;
19
+ onSearchChange?: (search: string) => void;
20
+ onCheckedChange?: (checked: Options<T> | undefined) => void;
21
+ };
22
+ export declare const SelectHeaderFilter: <T>({ table, column, excludeAllLabel, options, checked, disabled, hidden, search, radio, onSearchChange, onCheckedChange, }: ColumnFilterProps<T>) => import("react/jsx-runtime").JSX.Element;
23
+ export {};
@@ -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 };
@@ -0,0 +1,118 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import * as React from 'react';
3
+ import * as SheetPrimitive from '@radix-ui/react-dialog';
4
+ /**
5
+ * Root component for Sheet. Manages the open/close state.
6
+ * @example
7
+ * ```tsx
8
+ * <Sheet>
9
+ * <SheetTrigger>Open</SheetTrigger>
10
+ * <SheetContent>Content here</SheetContent>
11
+ * </Sheet>
12
+ * ```
13
+ */
14
+ declare const Sheet: React.FC<SheetPrimitive.DialogProps>;
15
+ /**
16
+ * Trigger component for opening the sheet.
17
+ * Should be used inside Sheet component.
18
+ */
19
+ declare const SheetTrigger: React.ForwardRefExoticComponent<SheetPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
20
+ /**
21
+ * Close component for closing the sheet programmatically.
22
+ * Should be used inside SheetContent.
23
+ */
24
+ declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
25
+ /**
26
+ * Portal component that renders sheet content in a portal.
27
+ * Used internally by SheetContent.
28
+ */
29
+ declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
30
+ /**
31
+ * Overlay component that renders a backdrop behind the sheet.
32
+ * Automatically closes the sheet when clicked.
33
+ */
34
+ declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
35
+ /**
36
+ * Variants configuration for sheet positioning and animation.
37
+ * Defines how the sheet slides in from different sides.
38
+ */
39
+ declare const sheetVariants: (props?: ({
40
+ side?: "top" | "right" | "bottom" | "left" | null | undefined;
41
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
42
+ /**
43
+ * Props interface for SheetContent component.
44
+ * @property {('top'|'right'|'bottom'|'left')} [side='right'] - Side from which the sheet slides in
45
+ */
46
+ interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
47
+ }
48
+ /**
49
+ * Main content container for the sheet with configurable slide direction.
50
+ * Includes an overlay and a close button by default.
51
+ * @param {Object} props - Component props
52
+ * @param {('top'|'right'|'bottom'|'left')} [props.side='right'] - Side from which the sheet slides in
53
+ * @param {string} [props.className] - Additional CSS classes
54
+ * @param {React.ReactNode} props.children - Sheet content
55
+ * @example
56
+ * ```tsx
57
+ * <SheetContent side="left">
58
+ * <SheetHeader>
59
+ * <SheetTitle>Title</SheetTitle>
60
+ * </SheetHeader>
61
+ * Content here
62
+ * </SheetContent>
63
+ * ```
64
+ */
65
+ declare const SheetContent: React.ForwardRefExoticComponent<SheetContentProps & React.RefAttributes<HTMLDivElement>>;
66
+ /**
67
+ * Header container for the sheet.
68
+ * Provides consistent spacing and alignment for sheet titles and descriptions.
69
+ * @param {Object} props - Component props
70
+ * @param {string} [props.className] - Additional CSS classes
71
+ * @param {React.ReactNode} props.children - Header content (typically SheetTitle and SheetDescription)
72
+ * @example
73
+ * ```tsx
74
+ * <SheetHeader>
75
+ * <SheetTitle>Settings</SheetTitle>
76
+ * <SheetDescription>Manage your preferences</SheetDescription>
77
+ * </SheetHeader>
78
+ * ```
79
+ */
80
+ declare const SheetHeader: {
81
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
82
+ displayName: string;
83
+ };
84
+ /**
85
+ * Footer container for the sheet.
86
+ * Provides consistent spacing and alignment for action buttons.
87
+ * @param {Object} props - Component props
88
+ * @param {string} [props.className] - Additional CSS classes
89
+ * @param {React.ReactNode} props.children - Footer content (typically buttons)
90
+ * @example
91
+ * ```tsx
92
+ * <SheetFooter>
93
+ * <Button>Cancel</Button>
94
+ * <Button variant="theme-filled">Save</Button>
95
+ * </SheetFooter>
96
+ * ```
97
+ */
98
+ declare const SheetFooter: {
99
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
100
+ displayName: string;
101
+ };
102
+ /**
103
+ * Title component for the sheet header.
104
+ * Displays the main heading of the sheet with appropriate styling.
105
+ * @param {Object} props - Component props
106
+ * @param {string} [props.className] - Additional CSS classes
107
+ * @param {React.ReactNode} props.children - Title text
108
+ */
109
+ declare const SheetTitle: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
110
+ /**
111
+ * Description component for the sheet header.
112
+ * Displays additional explanatory text below the title.
113
+ * @param {Object} props - Component props
114
+ * @param {string} [props.className] - Additional CSS classes
115
+ * @param {React.ReactNode} props.children - Description text
116
+ */
117
+ declare const SheetDescription: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
118
+ export { Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };