@gusarov-studio/rubik-ui 9.3.0 → 9.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/FileTabs/FileTabTriggerDragLayer.d.ts +7 -0
- package/dist/FileTabs/FileTabs.d.ts +18 -0
- package/dist/FileTabs/FileTabsDragLayer.d.ts +3 -0
- package/dist/FileTabs/FileTabsTrigger.d.ts +16 -0
- package/dist/FileTabs/constants/dropSide.d.ts +5 -0
- package/dist/FileTabs/constants/index.d.ts +2 -0
- package/dist/FileTabs/constants/triggerClassname.d.ts +2 -0
- package/dist/FileTabs/hooks/index.d.ts +4 -0
- package/dist/FileTabs/hooks/useDragFileTab.d.ts +6 -0
- package/dist/FileTabs/hooks/useDropFileTab.d.ts +15 -0
- package/dist/FileTabs/hooks/useFocusScrolling.d.ts +3 -0
- package/dist/FileTabs/hooks/useScrollbarSync.d.ts +12 -0
- package/dist/FileTabs/index.d.ts +1 -0
- package/dist/FileTabs/types.d.ts +15 -0
- package/dist/FileTabs/utils/getDropSide.d.ts +2 -0
- package/dist/FileTabs/utils/getItemStyles.d.ts +4 -0
- package/dist/FileTabs/utils/index.d.ts +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.declarations.tsbuildinfo +1 -1
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/mergeRefs.d.ts +5 -0
- package/package.json +4 -2
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { FileTab } from "./types";
|
|
3
|
+
interface FileTabsTriggerDragLayerProps {
|
|
4
|
+
tab: FileTab;
|
|
5
|
+
}
|
|
6
|
+
declare const FileTabsTriggerDragLayer: React.FC<FileTabsTriggerDragLayerProps>;
|
|
7
|
+
export { FileTabsTriggerDragLayer, type FileTabsTriggerDragLayerProps };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { FileTab, WidthValue } from "./types";
|
|
3
|
+
import "./FileTabs.scss";
|
|
4
|
+
interface FileTabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onClick"> {
|
|
5
|
+
tabs: FileTab[];
|
|
6
|
+
activeTabId: FileTab["id"];
|
|
7
|
+
onTabSelect: (tab: FileTab, event?: React.MouseEvent) => void;
|
|
8
|
+
onContextClick?: (tab: FileTab, event?: React.MouseEvent) => void;
|
|
9
|
+
onReorder?: (reorderedFileTabs: FileTab[]) => void;
|
|
10
|
+
onClose: (tab: FileTab, event?: React.MouseEvent) => void;
|
|
11
|
+
onAddClick?: (event?: React.MouseEvent) => void;
|
|
12
|
+
minTabSize?: WidthValue;
|
|
13
|
+
maxTabSize?: WidthValue;
|
|
14
|
+
draggable?: boolean;
|
|
15
|
+
dropdownInvisibleTabs?: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare const FileTabs: React.ForwardRefExoticComponent<FileTabsProps & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
export { FileTabs, type FileTabsProps };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { FileTab, DropSideType, WidthValue } from "./types";
|
|
3
|
+
interface FileTabsTriggerProps {
|
|
4
|
+
tab: FileTab;
|
|
5
|
+
active: boolean;
|
|
6
|
+
onTabSelect: (tab: FileTab, event?: React.MouseEvent) => void;
|
|
7
|
+
onContextClick?: (tab: FileTab, event?: React.MouseEvent) => void;
|
|
8
|
+
reorder: (draggedTabId: string, targetTabId: string, dropSide: DropSideType | null) => void;
|
|
9
|
+
onClose: (tab: FileTab, event?: React.MouseEvent) => void;
|
|
10
|
+
draggable?: boolean;
|
|
11
|
+
minTabSize?: WidthValue;
|
|
12
|
+
maxTabSize?: WidthValue;
|
|
13
|
+
setAutoScrollable?: (cadDrop: boolean) => void;
|
|
14
|
+
}
|
|
15
|
+
declare const FileTabsTrigger: React.ForwardRefExoticComponent<FileTabsTriggerProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export { FileTabsTrigger, type FileTabsTriggerProps };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
import { type DragElementWrapper } from "react-dnd";
|
|
3
|
+
import type { FileTab, DropSideType } from "../types";
|
|
4
|
+
interface UseDropFileTabParams {
|
|
5
|
+
tab: FileTab;
|
|
6
|
+
triggerRef: RefObject<HTMLElement>;
|
|
7
|
+
reorder: (draggedTabId: string, targetTabId: string, hoverSide: DropSideType | null) => void;
|
|
8
|
+
setAutoScrollable?: (cadDrop: boolean) => void;
|
|
9
|
+
}
|
|
10
|
+
declare const useDropFileTab: ({ tab, triggerRef, reorder, setAutoScrollable, }: UseDropFileTabParams) => [{
|
|
11
|
+
isOver: boolean;
|
|
12
|
+
canDrop: boolean;
|
|
13
|
+
dropSide: DropSideType | null;
|
|
14
|
+
}, DragElementWrapper<HTMLElement>];
|
|
15
|
+
export { useDropFileTab };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
import type { FileTab, WidthValue } from "../types";
|
|
3
|
+
interface UseScrollbarSyncParams {
|
|
4
|
+
unpinnedRef: RefObject<HTMLDivElement>;
|
|
5
|
+
scrollbarContainerRef: RefObject<HTMLDivElement>;
|
|
6
|
+
scrollbarContentRef: RefObject<HTMLDivElement>;
|
|
7
|
+
tabs: FileTab[];
|
|
8
|
+
minTabSize?: WidthValue;
|
|
9
|
+
maxTabSize?: WidthValue;
|
|
10
|
+
}
|
|
11
|
+
declare const useScrollbarSync: ({ unpinnedRef, scrollbarContainerRef, scrollbarContentRef, tabs, minTabSize, maxTabSize, }: UseScrollbarSyncParams) => void;
|
|
12
|
+
export { useScrollbarSync };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./FileTabs";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { ValueOf } from "../types/ValueOf";
|
|
3
|
+
import type { dropSide } from "./constants";
|
|
4
|
+
import type { CSSUnit } from "../types/CSSUnit";
|
|
5
|
+
interface FileTab {
|
|
6
|
+
id: string;
|
|
7
|
+
type: string;
|
|
8
|
+
label: string;
|
|
9
|
+
icon?: React.ReactNode;
|
|
10
|
+
closeable?: boolean;
|
|
11
|
+
pinned?: boolean;
|
|
12
|
+
}
|
|
13
|
+
type DropSideType = ValueOf<typeof dropSide>;
|
|
14
|
+
type WidthValue = CSSUnit | "0" | `calc(${string})` | number | "unset";
|
|
15
|
+
export type { FileTab, DropSideType, WidthValue };
|
package/dist/index.d.ts
CHANGED