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

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 +29693 -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,87 @@
1
+ import * as React from 'react';
2
+ export interface CardProps {
3
+ /** CSS-классы для кастомизации внешнего вида */
4
+ className?: string;
5
+ /**
6
+ * Дочерние элементы карточки
7
+ * @default null
8
+ */
9
+ children?: React.ReactNode;
10
+ /** Отображать стрелку в правой части */
11
+ showArrow?: boolean;
12
+ /** Состояние выбора (для контролируемого режима) */
13
+ checked?: boolean;
14
+ /**
15
+ * Хэндлер изменения состояния выбора
16
+ * @param checked - новое состояние выбора
17
+ */
18
+ onSelect?: (checked: boolean) => void;
19
+ /** Хэндлер клика по карточке */
20
+ onClick?: () => void;
21
+ }
22
+ /**
23
+ * Стилизованная карточка с поддержкой выбора, действий и кастомизации
24
+ *
25
+ * @component
26
+ * @example
27
+ * <Card showArrow checked={isChecked} onSelect={setIsChecked}>
28
+ * <CardHeader>Заголовок</CardHeader>
29
+ * <CardContent>Контент</CardContent>
30
+ * </Card>
31
+ */
32
+ declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
33
+ interface CardHeaderProps {
34
+ className?: string;
35
+ children?: React.ReactNode;
36
+ checked?: boolean;
37
+ right?: React.ReactNode;
38
+ onSelect?: (checked: boolean) => void;
39
+ onClick?: () => void;
40
+ }
41
+ /**
42
+ * Заголовок карточки с возможностью выбора
43
+ */
44
+ interface CardHeaderProps {
45
+ right?: React.ReactNode;
46
+ }
47
+ /**
48
+ * @extends CardProps
49
+ */
50
+ declare const CardHeader: React.ForwardRefExoticComponent<CardHeaderProps & React.RefAttributes<HTMLDivElement>>;
51
+ interface CardTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {
52
+ leftOffset?: boolean;
53
+ }
54
+ /**
55
+ * Основной заголовок карточки
56
+ */
57
+ interface CardTitleProps {
58
+ leftOffset?: boolean;
59
+ }
60
+ declare const CardTitle: React.ForwardRefExoticComponent<CardTitleProps & React.RefAttributes<HTMLParagraphElement>>;
61
+ interface CardDescriptionProps extends React.HTMLAttributes<HTMLDivElement> {
62
+ leftOffset?: boolean;
63
+ showArrow?: boolean;
64
+ }
65
+ declare const CardDescription: React.ForwardRefExoticComponent<CardDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
66
+ interface CardContentProps extends React.HTMLAttributes<HTMLDivElement> {
67
+ leftOffset?: boolean;
68
+ }
69
+ declare const CardContent: React.ForwardRefExoticComponent<CardContentProps & React.RefAttributes<HTMLDivElement>>;
70
+ interface CardFooterProps extends React.HTMLAttributes<HTMLDivElement> {
71
+ leftOffset?: boolean;
72
+ }
73
+ declare const CardFooter: React.ForwardRefExoticComponent<CardFooterProps & React.RefAttributes<HTMLDivElement>>;
74
+ type ActionClickEvent = React.MouseEvent<SVGSVGElement, MouseEvent>;
75
+ interface CardEditActionsProps {
76
+ onSave?: (e: ActionClickEvent) => Promise<void> | void;
77
+ onRemove?: (e: ActionClickEvent) => Promise<void> | void;
78
+ }
79
+ /**
80
+ * Действия редактирования карточки (сохранение/удаление)
81
+ */
82
+ interface CardEditActionsProps {
83
+ onSave?: (e: ActionClickEvent) => Promise<void> | void;
84
+ onRemove?: (e: ActionClickEvent) => Promise<void> | void;
85
+ }
86
+ declare const CardEditActions: ({ onSave, onRemove }: CardEditActionsProps) => React.JSX.Element;
87
+ export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent, CardEditActions };
@@ -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) => React.JSX.Element;
26
+ declare const CarouselContent: ({ className, ...props }: React.ComponentProps<"div">) => React.JSX.Element;
27
+ declare const CarouselItem: ({ className, ...props }: React.ComponentProps<"div">) => React.JSX.Element;
28
+ declare const CarouselPrevious: ({ className, variant, size, ...props }: React.ComponentProps<typeof Button>) => React.JSX.Element;
29
+ declare const CarouselNext: ({ className, variant, size, ...props }: React.ComponentProps<typeof Button>) => React.JSX.Element;
30
+ declare const CarouselThumbs: ({ className, ...props }: React.ComponentProps<"div">) => React.JSX.Element;
31
+ type CarouselThumbItemProps = {
32
+ index: number;
33
+ } & React.ComponentProps<'button'>;
34
+ declare const CarouselThumbItem: ({ index, className, children, ...props }: CarouselThumbItemProps) => React.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
+ }) => React.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.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) => React.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>): React.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.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>): React.JSX.Element;
82
+ interface TruncatedCellProps {
83
+ width?: number;
84
+ children?: string;
85
+ }
86
+ export declare function TruncatedCell({ width, children }: TruncatedCellProps): React.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>): React.JSX.Element;
94
+ export {};
@@ -0,0 +1,58 @@
1
+ import { OnSelectHandler, PropsBase, PropsMulti, PropsRange, PropsSingle } from 'react-day-picker';
2
+ import { Locale } from 'date-fns/locale';
3
+ import * as React from 'react';
4
+ export interface DateRange {
5
+ from?: Date;
6
+ to?: Date;
7
+ }
8
+ interface DatePickerCommonProps {
9
+ placeholder?: string;
10
+ innerLabel?: string;
11
+ error?: string | boolean;
12
+ readOnly?: boolean;
13
+ iconClassName?: string;
14
+ showReset?: boolean;
15
+ onRemoveClick?: () => void;
16
+ }
17
+ export type DatePickerSingleProps = PropsBase & PropsSingle & DatePickerCommonProps & {
18
+ value?: Date | null;
19
+ onChange?: OnSelectHandler<Date | undefined>;
20
+ };
21
+ export type DatePickerMultipleProps = PropsBase & PropsMulti & DatePickerCommonProps & {
22
+ value?: Date[];
23
+ onChange?: OnSelectHandler<Date[]>;
24
+ };
25
+ type DatePickerRangeProps = PropsBase & PropsRange & DatePickerCommonProps & {
26
+ value?: DateRange;
27
+ onChange?: OnSelectHandler<DateRange | undefined>;
28
+ };
29
+ export type DatePickerProps = DatePickerSingleProps | DatePickerMultipleProps | (DatePickerRangeProps & {
30
+ locale?: Locale;
31
+ });
32
+ /**
33
+ * Универсальный компонент выбора даты с поддержкой различных режимов
34
+ * @component
35
+ * @param {Object} props - Свойства компонента
36
+ * @param {'single' | 'multiple' | 'range'} [props.mode] - Режим выбора даты
37
+ * @param {Date | Date[] | DateRange} [props.value] - Выбранные даты в зависимости от режима
38
+ * @param {string} [props.placeholder] - Плейсхолдер для инпута. Если задан innerLabel, placeholder будет игнорироваться (вместо него выводится маска).
39
+ * @param {string} [props.innerLabel] - Метка, отображаемая перед значением с двоеточием. Если задана, резервирует место под маску и отображает её в качестве плейсхолдера.
40
+ * @param {Function} [props.onChange] - Обработчик изменения даты
41
+ * @param {string | boolean} [props.error] - Ошибка валидации
42
+ * @param {boolean} [props.readOnly] - Режим только для чтения
43
+ * @param {string} [props.iconClassName] - Дополнительные классы для иконки календаря
44
+ * @param {Locale} [props.locale] - Локализация календаря
45
+ * @param {boolean} [props.showReset] - Показывать кнопку сброса значения
46
+ * @param {Function} [props.onRemoveClick] - Обработчик клика по кнопке сброса
47
+ * @example
48
+ * <DatePicker
49
+ * mode="single"
50
+ * value={new Date()}
51
+ * placeholder="Date filter"
52
+ * innerLabel="Дата"
53
+ * onChange={(date) => console.log(date)}
54
+ * showReset
55
+ * />
56
+ */
57
+ export declare function DatePicker({ className, locale, iconClassName, ...rawProps }: DatePickerProps): React.JSX.Element;
58
+ 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
+ }): React.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): React.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): React.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.Element;