ai-design-system 0.1.11 → 0.1.13
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/components/blocks/AppSidebar/AppSidebar.tsx +2 -18
- package/components/blocks/AppSidebar/index.ts +1 -1
- package/components/blocks/AppSidebar/interfaces.ts +19 -0
- package/components/blocks/SectionLayout/SectionLayout.tsx +3 -31
- package/components/blocks/SectionLayout/index.ts +1 -1
- package/components/blocks/SectionLayout/interfaces.ts +21 -0
- package/components/blocks/WorkflowCanvas/WorkflowCanvas.tsx +3 -34
- package/components/blocks/WorkflowCanvas/index.ts +1 -1
- package/components/blocks/WorkflowCanvas/interfaces.ts +34 -0
- package/components/composites/AppHeader/AppHeader.tsx +1 -16
- package/components/composites/AppHeader/index.ts +1 -1
- package/components/composites/AppHeader/interfaces.ts +17 -0
- package/components/composites/FileQueue/FileQueue.tsx +1 -32
- package/components/composites/FileQueue/index.ts +1 -14
- package/components/composites/FileQueue/interfaces.ts +30 -0
- package/components/composites/NavigationList/index.ts +2 -1
- package/components/composites/NavigationList/interfaces.ts +7 -0
- package/components/composites/WorkflowToolbar/WorkflowToolbar.tsx +5 -48
- package/components/composites/WorkflowToolbar/index.ts +1 -1
- package/components/composites/WorkflowToolbar/interfaces.ts +30 -0
- package/components/features/RefinementPanel/index.ts +1 -1
- package/components/features/WorkflowBuilder/index.ts +1 -0
- package/components/features/WorkflowBuilder/useWorkflowBuilder.d.ts +2 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +5054 -101
- package/dist/index.d.ts +327 -9
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
|
@@ -12,25 +12,9 @@ import {
|
|
|
12
12
|
SidebarGroupLabel,
|
|
13
13
|
} from "@/components/primitives/Sidebar"
|
|
14
14
|
import { Icon } from "@/components/primitives/Icon"
|
|
15
|
-
import { NavigationList
|
|
15
|
+
import { NavigationList } from "@/components/composites/NavigationList"
|
|
16
16
|
import { NavUser } from "@/components/composites/NavUser"
|
|
17
|
-
|
|
18
|
-
export interface AppSidebarProps extends React.ComponentPropsWithoutRef<typeof Sidebar> {
|
|
19
|
-
logo?: {
|
|
20
|
-
icon: string
|
|
21
|
-
text: string
|
|
22
|
-
href: string
|
|
23
|
-
}
|
|
24
|
-
mainNavigation: NavigationItem[]
|
|
25
|
-
secondaryNavigation?: NavigationItem[]
|
|
26
|
-
documents?: NavigationItem[]
|
|
27
|
-
user: {
|
|
28
|
-
name: string
|
|
29
|
-
email: string
|
|
30
|
-
avatar?: string
|
|
31
|
-
}
|
|
32
|
-
userActions?: { label: string; onClick: () => void }[]
|
|
33
|
-
}
|
|
17
|
+
import type { AppSidebarProps } from "./interfaces"
|
|
34
18
|
|
|
35
19
|
export const AppSidebar = React.memo<AppSidebarProps>(
|
|
36
20
|
({ logo, mainNavigation, secondaryNavigation, documents, user, userActions, ...props }) => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { AppSidebar } from './AppSidebar'
|
|
2
|
-
export type { AppSidebarProps } from './
|
|
2
|
+
export type { AppSidebarProps } from './interfaces'
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { NavigationItem } from "@/components/composites/NavigationList/interfaces";
|
|
2
|
+
|
|
3
|
+
export interface AppSidebarProps {
|
|
4
|
+
logo?: {
|
|
5
|
+
icon: string;
|
|
6
|
+
text: string;
|
|
7
|
+
href: string;
|
|
8
|
+
};
|
|
9
|
+
mainNavigation: NavigationItem[];
|
|
10
|
+
secondaryNavigation?: NavigationItem[];
|
|
11
|
+
documents?: NavigationItem[];
|
|
12
|
+
user: {
|
|
13
|
+
name: string;
|
|
14
|
+
email: string;
|
|
15
|
+
avatar?: string;
|
|
16
|
+
};
|
|
17
|
+
userActions?: { label: string; onClick: () => void }[];
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
@@ -1,35 +1,7 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
|
-
import { AdjustableLayout
|
|
3
|
-
import { AppHeader
|
|
4
|
-
|
|
5
|
-
export interface SectionLayoutSection extends AdjustableLayoutSection {
|
|
6
|
-
header?: AppHeaderProps
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface SectionLayoutProps extends React.ComponentPropsWithoutRef<"div"> {
|
|
10
|
-
/**
|
|
11
|
-
* Layout sections with optional headers
|
|
12
|
-
*/
|
|
13
|
-
sections: SectionLayoutSection[]
|
|
14
|
-
/**
|
|
15
|
-
* Layout orientation for adjustable layout
|
|
16
|
-
* @default "horizontal"
|
|
17
|
-
*/
|
|
18
|
-
orientation?: "horizontal" | "vertical"
|
|
19
|
-
/**
|
|
20
|
-
* Storage key for layout panel sizes persistence
|
|
21
|
-
*/
|
|
22
|
-
storageKey?: string
|
|
23
|
-
/**
|
|
24
|
-
* Callback for section resize events
|
|
25
|
-
*/
|
|
26
|
-
onSectionResize?: (sectionId: string, newSize: number) => void
|
|
27
|
-
/**
|
|
28
|
-
* Color theme for drag handles
|
|
29
|
-
* @default "border"
|
|
30
|
-
*/
|
|
31
|
-
dragHandleColor?: "primary" | "secondary" | "accent" | "border" | "muted"
|
|
32
|
-
}
|
|
2
|
+
import { AdjustableLayout } from "@/components/composites/AdjustableLayout"
|
|
3
|
+
import { AppHeader } from "@/components/composites/AppHeader"
|
|
4
|
+
import type { SectionLayoutProps } from "./interfaces"
|
|
33
5
|
|
|
34
6
|
/**
|
|
35
7
|
* SectionLayout Block
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { SectionLayout } from './SectionLayout'
|
|
2
|
-
export type { SectionLayoutProps } from './
|
|
2
|
+
export type { SectionLayoutProps, SectionLayoutSection } from './interfaces'
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { AppHeaderProps } from "@/components/composites/AppHeader/interfaces";
|
|
3
|
+
|
|
4
|
+
export interface SectionLayoutSection {
|
|
5
|
+
id: string;
|
|
6
|
+
content: React.ReactNode;
|
|
7
|
+
defaultSize?: number;
|
|
8
|
+
minSize?: number;
|
|
9
|
+
maxSize?: number;
|
|
10
|
+
collapsible?: boolean;
|
|
11
|
+
collapsedSize?: number;
|
|
12
|
+
header?: AppHeaderProps;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface SectionLayoutProps extends React.ComponentPropsWithoutRef<"div"> {
|
|
16
|
+
sections: SectionLayoutSection[];
|
|
17
|
+
orientation?: "horizontal" | "vertical";
|
|
18
|
+
storageKey?: string;
|
|
19
|
+
onSectionResize?: (sectionId: string, newSize: number) => void;
|
|
20
|
+
dragHandleColor?: "primary" | "secondary" | "accent" | "border" | "muted";
|
|
21
|
+
}
|
|
@@ -18,42 +18,11 @@ import { Connection as ConnectionLine } from "@/components/ai-elements/connectio
|
|
|
18
18
|
import { Controls } from "@/components/ai-elements/controls";
|
|
19
19
|
import { Edge } from "@/components/ai-elements/edge";
|
|
20
20
|
import { Panel } from "@/components/ai-elements/panel";
|
|
21
|
-
import { StateNode
|
|
22
|
-
import { TransitionNode
|
|
21
|
+
import { StateNode } from "@/components/composites/StateNode";
|
|
22
|
+
import { TransitionNode } from "@/components/composites/TransitionNode";
|
|
23
|
+
import type { WorkflowCanvasProps, WorkflowEdge } from "./interfaces";
|
|
23
24
|
import "@xyflow/react/dist/style.css";
|
|
24
25
|
|
|
25
|
-
export type WorkflowNodeData = StateNodeData | TransitionNodeData;
|
|
26
|
-
export type WorkflowNode = Node<WorkflowNodeData>;
|
|
27
|
-
export type WorkflowEdge = {
|
|
28
|
-
id: string;
|
|
29
|
-
source: string;
|
|
30
|
-
target: string;
|
|
31
|
-
sourceHandle?: string | null;
|
|
32
|
-
targetHandle?: string | null;
|
|
33
|
-
type?: string;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export interface WorkflowCanvasProps {
|
|
37
|
-
nodes: WorkflowNode[];
|
|
38
|
-
edges: WorkflowEdge[];
|
|
39
|
-
onNodesChange?: (changes: NodeChange[]) => void;
|
|
40
|
-
onEdgesChange?: (changes: EdgeChange[]) => void;
|
|
41
|
-
onConnect?: (connection: Connection) => void;
|
|
42
|
-
onConnectStart?: (event: MouseEvent | TouchEvent, params: OnConnectStartParams) => void;
|
|
43
|
-
onConnectEnd?: (event: MouseEvent | TouchEvent) => void;
|
|
44
|
-
onPaneClick?: () => void;
|
|
45
|
-
onNodeClick?: (event: React.MouseEvent, node: WorkflowNode) => void;
|
|
46
|
-
onEdgeClick?: (event: React.MouseEvent, edge: WorkflowEdge) => void;
|
|
47
|
-
showMinimap?: boolean;
|
|
48
|
-
/** Enable/disable manual drawing of connections and node dragging. Default: false */
|
|
49
|
-
interactive?: boolean;
|
|
50
|
-
/** Floating overlay rendered top-left inside the canvas */
|
|
51
|
-
topLeft?: ReactNode;
|
|
52
|
-
/** Floating overlay rendered top-right inside the canvas */
|
|
53
|
-
topRight?: ReactNode;
|
|
54
|
-
className?: string;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
26
|
const edgeTypes = {
|
|
58
27
|
animated: Edge.Animated,
|
|
59
28
|
temporary: Edge.Temporary,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { WorkflowCanvas } from "./WorkflowCanvas";
|
|
2
|
-
export type { WorkflowCanvasProps, WorkflowNode, WorkflowEdge, WorkflowNodeData } from "./
|
|
2
|
+
export type { WorkflowCanvasProps, WorkflowNode, WorkflowEdge, WorkflowNodeData } from "./interfaces";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Connection, EdgeChange, Node, NodeChange, OnConnectStartParams } from "@xyflow/react";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
import type { StateNodeData } from "@/components/composites/StateNode";
|
|
4
|
+
import type { TransitionNodeData } from "@/components/composites/TransitionNode";
|
|
5
|
+
|
|
6
|
+
export type WorkflowNodeData = StateNodeData | TransitionNodeData;
|
|
7
|
+
export type WorkflowNode = Node<WorkflowNodeData>;
|
|
8
|
+
|
|
9
|
+
export interface WorkflowEdge {
|
|
10
|
+
id: string;
|
|
11
|
+
source: string;
|
|
12
|
+
target: string;
|
|
13
|
+
sourceHandle?: string | null;
|
|
14
|
+
targetHandle?: string | null;
|
|
15
|
+
type?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface WorkflowCanvasProps {
|
|
19
|
+
nodes: WorkflowNode[];
|
|
20
|
+
edges: WorkflowEdge[];
|
|
21
|
+
onNodesChange?: (changes: NodeChange[]) => void;
|
|
22
|
+
onEdgesChange?: (changes: EdgeChange[]) => void;
|
|
23
|
+
onConnect?: (connection: Connection) => void;
|
|
24
|
+
onConnectStart?: (event: MouseEvent | TouchEvent, params: OnConnectStartParams) => void;
|
|
25
|
+
onConnectEnd?: (event: MouseEvent | TouchEvent) => void;
|
|
26
|
+
onPaneClick?: () => void;
|
|
27
|
+
onNodeClick?: (event: React.MouseEvent, node: WorkflowNode) => void;
|
|
28
|
+
onEdgeClick?: (event: React.MouseEvent, edge: WorkflowEdge) => void;
|
|
29
|
+
showMinimap?: boolean;
|
|
30
|
+
interactive?: boolean;
|
|
31
|
+
topLeft?: React.ReactNode;
|
|
32
|
+
topRight?: React.ReactNode;
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
@@ -2,22 +2,7 @@ import * as React from "react"
|
|
|
2
2
|
import { SidebarTrigger } from "@/components/primitives/Sidebar"
|
|
3
3
|
import { Separator } from "@/components/primitives/Separator"
|
|
4
4
|
import { Tabs, TabsList, TabsTrigger } from "@/components/primitives/Tabs"
|
|
5
|
-
|
|
6
|
-
export interface TabItem {
|
|
7
|
-
value: string
|
|
8
|
-
label: string
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface AppHeaderProps {
|
|
12
|
-
title?: string
|
|
13
|
-
actions?: React.ReactNode
|
|
14
|
-
tabs?: TabItem[]
|
|
15
|
-
defaultTab?: string
|
|
16
|
-
onTabChange?: (value: string) => void
|
|
17
|
-
className?: string
|
|
18
|
-
showSidebarToggle?: boolean
|
|
19
|
-
showTitle?: boolean
|
|
20
|
-
}
|
|
5
|
+
import type { AppHeaderProps } from "./interfaces"
|
|
21
6
|
|
|
22
7
|
export const AppHeader = React.memo<AppHeaderProps>(({
|
|
23
8
|
title,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { AppHeader } from './AppHeader'
|
|
2
|
-
export type { AppHeaderProps, TabItem } from './
|
|
2
|
+
export type { AppHeaderProps, TabItem } from './interfaces'
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
|
|
3
|
+
export interface TabItem {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface AppHeaderProps {
|
|
9
|
+
title?: string;
|
|
10
|
+
actions?: React.ReactNode;
|
|
11
|
+
tabs?: TabItem[];
|
|
12
|
+
defaultTab?: string;
|
|
13
|
+
onTabChange?: (value: string) => void;
|
|
14
|
+
className?: string;
|
|
15
|
+
showSidebarToggle?: boolean;
|
|
16
|
+
showTitle?: boolean;
|
|
17
|
+
}
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
} from "@/components/ai-elements/queue";
|
|
12
12
|
import { Icon } from "@/components/primitives/Icon";
|
|
13
13
|
import { cn } from "@/lib/utils";
|
|
14
|
+
import type { FileQueueProps } from "./interfaces";
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* FileQueue Block
|
|
@@ -23,46 +24,14 @@ import { cn } from "@/lib/utils";
|
|
|
23
24
|
/**
|
|
24
25
|
* File item structure
|
|
25
26
|
*/
|
|
26
|
-
export interface FileItem {
|
|
27
|
-
/** Unique identifier for the file */
|
|
28
|
-
id: string;
|
|
29
|
-
/** File name to display */
|
|
30
|
-
name: string;
|
|
31
|
-
/** Optional file path to display */
|
|
32
|
-
path?: string;
|
|
33
|
-
}
|
|
34
27
|
|
|
35
28
|
/**
|
|
36
29
|
* File group structure
|
|
37
30
|
*/
|
|
38
|
-
export interface FileGroup {
|
|
39
|
-
/** Unique identifier for the group */
|
|
40
|
-
id: string;
|
|
41
|
-
/** Display title for the group */
|
|
42
|
-
title: string;
|
|
43
|
-
/** Optional icon name from icon registry */
|
|
44
|
-
icon?: string;
|
|
45
|
-
/** Optional icon color class */
|
|
46
|
-
iconColor?: string;
|
|
47
|
-
/** Array of files in this group */
|
|
48
|
-
files: FileItem[];
|
|
49
|
-
/** Whether group should be open by default */
|
|
50
|
-
defaultOpen?: boolean;
|
|
51
|
-
}
|
|
52
31
|
|
|
53
32
|
/**
|
|
54
33
|
* FileQueue component props
|
|
55
34
|
*/
|
|
56
|
-
export interface FileQueueProps {
|
|
57
|
-
/** Array of file groups to display */
|
|
58
|
-
groups: FileGroup[];
|
|
59
|
-
/** ID of currently selected file */
|
|
60
|
-
selectedFileId?: string;
|
|
61
|
-
/** Callback when a file is selected */
|
|
62
|
-
onFileSelect?: (fileId: string) => void;
|
|
63
|
-
/** Additional CSS classes */
|
|
64
|
-
className?: string;
|
|
65
|
-
}
|
|
66
35
|
|
|
67
36
|
/**
|
|
68
37
|
* FileQueue component - displays files organized into collapsible groups
|
|
@@ -4,21 +4,8 @@
|
|
|
4
4
|
* Central export point for the FileQueue block component and its related types.
|
|
5
5
|
*/
|
|
6
6
|
export { FileQueue } from "./FileQueue";
|
|
7
|
-
export type { FileQueueProps, FileGroup, FileItem } from "./
|
|
7
|
+
export type { FileQueueProps, FileGroup, FileItem, FileChangeData } from "./interfaces";
|
|
8
8
|
|
|
9
9
|
// Legacy exports for backward compatibility (used by RefinementPanel)
|
|
10
10
|
export { FileStatusBadge } from "./FileStatusBadge";
|
|
11
11
|
export type { FileStatusBadgeProps, FileStatus } from "./FileStatusBadge";
|
|
12
|
-
|
|
13
|
-
import type { FileStatus } from "./FileStatusBadge";
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Legacy FileChangeData type for backward compatibility
|
|
17
|
-
* @deprecated Use FileGroup and FileItem instead
|
|
18
|
-
*/
|
|
19
|
-
export interface FileChangeData {
|
|
20
|
-
id: string;
|
|
21
|
-
filename: string;
|
|
22
|
-
status: FileStatus;
|
|
23
|
-
path: string;
|
|
24
|
-
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { FileStatus } from "./FileStatusBadge";
|
|
2
|
+
|
|
3
|
+
export interface FileItem {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
path?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface FileGroup {
|
|
10
|
+
id: string;
|
|
11
|
+
title: string;
|
|
12
|
+
icon?: string;
|
|
13
|
+
iconColor?: string;
|
|
14
|
+
files: FileItem[];
|
|
15
|
+
defaultOpen?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface FileQueueProps {
|
|
19
|
+
groups: FileGroup[];
|
|
20
|
+
selectedFileId?: string;
|
|
21
|
+
onFileSelect?: (fileId: string) => void;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface FileChangeData {
|
|
26
|
+
id: string;
|
|
27
|
+
filename: string;
|
|
28
|
+
status: FileStatus;
|
|
29
|
+
path: string;
|
|
30
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { Check, ChevronDown, Loader2 } from "lucide-react";
|
|
4
|
-
import type { ReactNode } from "react";
|
|
5
4
|
import { Button } from "@/components/primitives/Button";
|
|
6
5
|
import { ButtonGroup } from "@/components/primitives/ButtonGroup";
|
|
7
6
|
import {
|
|
@@ -12,47 +11,16 @@ import {
|
|
|
12
11
|
} from "@/components/primitives/DropdownMenu";
|
|
13
12
|
import { Icon } from "@/components/primitives/Icon";
|
|
14
13
|
import { cn } from "@/lib/utils";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export interface WorkflowVersion {
|
|
21
|
-
id: string;
|
|
22
|
-
label: string;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface ToolbarAction {
|
|
26
|
-
id: string;
|
|
27
|
-
/**
|
|
28
|
-
* Icon to render inside the button.
|
|
29
|
-
* Pass a string icon name from the icon registry (preferred — no icon package needed in consumer)
|
|
30
|
-
* or a ReactNode for custom icons.
|
|
31
|
-
*/
|
|
32
|
-
icon: string | ReactNode;
|
|
33
|
-
/** Tooltip text */
|
|
34
|
-
title: string;
|
|
35
|
-
onClick?: () => void;
|
|
36
|
-
disabled?: boolean;
|
|
37
|
-
/** Show spinner instead of icon */
|
|
38
|
-
loading?: boolean;
|
|
39
|
-
/** Show dot indicator (e.g. unsaved changes) */
|
|
40
|
-
indicator?: boolean;
|
|
41
|
-
}
|
|
14
|
+
import type {
|
|
15
|
+
ToolbarAction,
|
|
16
|
+
WorkflowToolbarActionsProps,
|
|
17
|
+
WorkflowToolbarProps,
|
|
18
|
+
} from "./interfaces";
|
|
42
19
|
|
|
43
20
|
// ---------------------------------------------------------------------------
|
|
44
21
|
// WorkflowToolbarActions — generic grouped icon buttons
|
|
45
22
|
// ---------------------------------------------------------------------------
|
|
46
23
|
|
|
47
|
-
export interface WorkflowToolbarActionsProps {
|
|
48
|
-
/**
|
|
49
|
-
* Groups of actions. Each group renders as a `ButtonGroup`.
|
|
50
|
-
* The caller decides which buttons to show and what they do.
|
|
51
|
-
*/
|
|
52
|
-
actionGroups?: ToolbarAction[][];
|
|
53
|
-
className?: string;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
24
|
/**
|
|
57
25
|
* Generic toolbar actions component.
|
|
58
26
|
*
|
|
@@ -101,17 +69,6 @@ export function WorkflowToolbarActions({
|
|
|
101
69
|
// WorkflowToolbar — full toolbar row
|
|
102
70
|
// ---------------------------------------------------------------------------
|
|
103
71
|
|
|
104
|
-
export interface WorkflowToolbarProps {
|
|
105
|
-
// Left: title text + version dropdown
|
|
106
|
-
workflowName?: string;
|
|
107
|
-
versions?: WorkflowVersion[];
|
|
108
|
-
currentVersionId?: string;
|
|
109
|
-
onVersionSelect?: (versionId: string) => void;
|
|
110
|
-
// Right: action buttons
|
|
111
|
-
actionGroups?: ToolbarAction[][];
|
|
112
|
-
className?: string;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
72
|
/**
|
|
116
73
|
* WorkflowToolbar composite.
|
|
117
74
|
*
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
|
|
3
|
+
export interface WorkflowVersion {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface ToolbarAction {
|
|
9
|
+
id: string;
|
|
10
|
+
icon: string | React.ReactNode;
|
|
11
|
+
title: string;
|
|
12
|
+
onClick?: () => void;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
loading?: boolean;
|
|
15
|
+
indicator?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface WorkflowToolbarActionsProps {
|
|
19
|
+
actionGroups?: ToolbarAction[][];
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface WorkflowToolbarProps {
|
|
24
|
+
workflowName?: string;
|
|
25
|
+
versions?: WorkflowVersion[];
|
|
26
|
+
currentVersionId?: string;
|
|
27
|
+
onVersionSelect?: (versionId: string) => void;
|
|
28
|
+
actionGroups?: ToolbarAction[][];
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
@@ -18,7 +18,7 @@ export { RefinementPanel } from "./RefinementPanel";
|
|
|
18
18
|
export type { RefinementPanelProps, RefinementMessage } from "./RefinementPanel";
|
|
19
19
|
|
|
20
20
|
// Hook contract definition (implement in your application)
|
|
21
|
-
export type { UseRefinementPanelReturn } from "./useRefinementPanel";
|
|
21
|
+
export type { UseRefinementPanelReturn } from "./useRefinementPanel.d";
|
|
22
22
|
|
|
23
23
|
// Mock hook for testing and development
|
|
24
24
|
export { useRefinementPanelMock as useMockRefinementPanel } from "./useRefinementPanel.mock";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { WorkflowBuilder } from "./WorkflowBuilder";
|
|
2
2
|
export type { WorkflowBuilderProps } from "./WorkflowBuilder";
|
|
3
|
+
export type { UseWorkflowBuilder, UseWorkflowBuilderReturn } from "./useWorkflowBuilder.d";
|
|
3
4
|
export type { ToolbarAction } from "@/components/composites/WorkflowToolbar";
|
|
@@ -39,6 +39,8 @@ export interface UseWorkflowBuilderReturn {
|
|
|
39
39
|
currentWorkflowId?: string;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
export type UseWorkflowBuilder = (workflowId?: string) => UseWorkflowBuilderReturn;
|
|
43
|
+
|
|
42
44
|
export function useWorkflowBuilder(workflowId?: string): UseWorkflowBuilderReturn {
|
|
43
45
|
throw new Error("useWorkflowBuilder must be implemented by the consuming application");
|
|
44
46
|
}
|