@juspay/blend-design-system 0.0.21 → 0.0.22-beta
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/assets/main.css +1 -1
- package/dist/components/Card/CardComponents.d.ts +3 -0
- package/dist/components/Card/types.d.ts +11 -0
- package/dist/components/DataTable/DataTablePagination.d.ts +2 -1
- package/dist/components/DataTable/TableBody/types.d.ts +1 -0
- package/dist/components/DataTable/TableCell/index.d.ts +2 -1
- package/dist/components/DataTable/TableCell/types.d.ts +2 -0
- package/dist/components/DataTable/TableFooter/types.d.ts +1 -0
- package/dist/components/DateRangePicker/CalendarGrid.d.ts +1 -0
- package/dist/components/DateRangePicker/dateRangePicker.tokens.d.ts +6 -0
- package/dist/components/WorkflowCanvas/WorkflowCanvas.d.ts +19 -0
- package/dist/components/WorkflowCanvas/WorkflowControls.d.ts +3 -0
- package/dist/components/WorkflowCanvas/components/NodeContent.d.ts +15 -0
- package/dist/components/WorkflowCanvas/constants.d.ts +42 -0
- package/dist/components/WorkflowCanvas/edges/DefaultEdge.d.ts +3 -0
- package/dist/components/WorkflowCanvas/index.d.ts +11 -0
- package/dist/components/WorkflowCanvas/nodes/DefaultNode.d.ts +3 -0
- package/dist/components/WorkflowCanvas/nodes/InputNode.d.ts +3 -0
- package/dist/components/WorkflowCanvas/nodes/OutputNode.d.ts +3 -0
- package/dist/components/WorkflowCanvas/types.d.ts +76 -0
- package/dist/components/WorkflowCanvas/utils.d.ts +13 -0
- package/dist/components/WorkflowCanvas/workflow.tokens.d.ts +100 -0
- package/dist/context/ThemeContext.d.ts +2 -0
- package/dist/context/useComponentToken.d.ts +2 -1
- package/dist/main.d.ts +1 -0
- package/dist/main.js +29616 -23921
- package/package.json +2 -1
package/dist/assets/main.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[data-vaul-drawer][data-vaul-drawer-direction=bottom]:after{display:none}
|
|
1
|
+
[data-vaul-drawer][data-vaul-drawer-direction=bottom]:after{display:none}.react-flow{direction:ltr}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;cursor:-webkit-grab;cursor:grab}.react-flow__pane.selection{cursor:pointer}.react-flow__pane.dragging{cursor:-webkit-grabbing;cursor:grabbing}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow .react-flow__edges{pointer-events:none;overflow:visible}.react-flow__edge-path,.react-flow__connection-path{stroke:#b1b1b7;stroke-width:1;fill:none}.react-flow__edge{pointer-events:visibleStroke;cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;-webkit-animation:dashdraw .5s linear infinite;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;-webkit-animation:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge:focus .react-flow__edge-path,.react-flow__edge:focus-visible .react-flow__edge-path{stroke:#555}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge-textbg{fill:#fff}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;-webkit-animation:dashdraw .5s linear infinite;animation:dashdraw .5s linear infinite}.react-flow__connectionline{z-index:1001}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:-webkit-grab;cursor:grab}.react-flow__node.dragging{cursor:-webkit-grabbing;cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:-webkit-grab;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background:#1a192b;border:1px solid white;border-radius:100%}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:-4px;transform:translate(-50%)}.react-flow__handle-top{left:50%;top:-4px;transform:translate(-50%)}.react-flow__handle-left{top:50%;left:-4px;transform:translateY(-50%)}.react-flow__handle-right{right:-4px;top:50%;transform:translateY(-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.center{left:50%;transform:translate(-50%)}.react-flow__attribution{font-size:10px;background:#ffffff80;padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@-webkit-keyframes dashdraw{0%{stroke-dashoffset:10}}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-default,.react-flow__node-input,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:3px;width:150px;font-size:12px;color:#222;text-align:center;border-width:1px;border-style:solid;border-color:#1a192b;background-color:#fff}.react-flow__node-default.selectable:hover,.react-flow__node-input.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:0 1px 4px 1px #00000014}.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:0 0 0 .5px #1a192b}.react-flow__node-group{background-color:#f0f0f040}.react-flow__nodesselection-rect,.react-flow__selection{background:#0059dc14;border:1px dotted rgba(0,89,220,.8)}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls{box-shadow:0 0 2px 1px #00000014}.react-flow__controls-button{border:none;background:#fefefe;border-bottom:1px solid #eee;box-sizing:content-box;display:flex;justify-content:center;align-items:center;width:16px;height:16px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:5px}.react-flow__controls-button:hover{background:#f4f4f4}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__minimap{background-color:#fff}.react-flow__minimap svg{display:block}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:4px;height:4px;border:1px solid #fff;border-radius:1px;background-color:#3367d9;transform:translate(-50%,-50%)}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:#3367d9;border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.blend-workflow-canvas .react-flow__node{cursor:pointer;padding:0;border:none;background:transparent;border-radius:0;box-shadow:none}.blend-workflow-canvas .react-flow__node:hover,.blend-workflow-canvas .react-flow__node.selected,.blend-workflow-canvas .react-flow__node.selectable:hover{padding:0;border:none;background:transparent;box-shadow:none}.blend-workflow-canvas .react-flow__edge{cursor:pointer}.blend-workflow-canvas .react-flow__attribution{display:none}
|
|
@@ -6,18 +6,21 @@ type CardComponentProps = {
|
|
|
6
6
|
variant?: CardVariant.DEFAULT;
|
|
7
7
|
}>;
|
|
8
8
|
cardToken: CardTokenType;
|
|
9
|
+
maxHeight?: string;
|
|
9
10
|
};
|
|
10
11
|
type AlignedCardComponentProps = {
|
|
11
12
|
props: Extract<CardProps, {
|
|
12
13
|
variant: CardVariant.ALIGNED;
|
|
13
14
|
}>;
|
|
14
15
|
cardToken: CardTokenType;
|
|
16
|
+
maxHeight?: string;
|
|
15
17
|
};
|
|
16
18
|
type CustomCardComponentProps = {
|
|
17
19
|
props: Extract<CardProps, {
|
|
18
20
|
variant: CardVariant.CUSTOM;
|
|
19
21
|
}>;
|
|
20
22
|
cardToken: CardTokenType;
|
|
23
|
+
maxHeight?: string;
|
|
21
24
|
};
|
|
22
25
|
export declare const DefaultCard: React.FC<CardComponentProps>;
|
|
23
26
|
export declare const AlignedCard: React.FC<AlignedCardComponentProps>;
|
|
@@ -43,4 +43,15 @@ export type CustomCardProps = {
|
|
|
43
43
|
export type CardProps = {
|
|
44
44
|
className?: string;
|
|
45
45
|
maxWidth?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Height of the card. Accepts any valid CSS height value.
|
|
48
|
+
* Examples: "200px", "100%", "50vh", "auto"
|
|
49
|
+
* Note: For percentage heights to work, parent container must have a defined height.
|
|
50
|
+
*/
|
|
51
|
+
maxHeight?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Minimum height of the card. Accepts any valid CSS height value.
|
|
54
|
+
* Useful when you want the card to grow with content but maintain a minimum height.
|
|
55
|
+
*/
|
|
56
|
+
minHeight?: string;
|
|
46
57
|
} & (DefaultCardProps | AlignedCardProps | CustomCardProps);
|
|
@@ -4,8 +4,9 @@ type DataTablePaginationProps = {
|
|
|
4
4
|
totalRows: number;
|
|
5
5
|
pageSizeOptions: number[];
|
|
6
6
|
isLoading?: boolean;
|
|
7
|
+
hasData?: boolean;
|
|
7
8
|
onPageChange: (page: number) => void;
|
|
8
9
|
onPageSizeChange: (pageSize: number) => void;
|
|
9
10
|
};
|
|
10
|
-
export declare function DataTablePagination({ currentPage, pageSize, totalRows, pageSizeOptions, isLoading, onPageChange, onPageSizeChange, }: DataTablePaginationProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function DataTablePagination({ currentPage, pageSize, totalRows, pageSizeOptions, isLoading, hasData, onPageChange, onPageSizeChange, }: DataTablePaginationProps): import("react/jsx-runtime").JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -4,6 +4,7 @@ export type TableBodyProps<T extends Record<string, unknown>> = {
|
|
|
4
4
|
currentData: T[];
|
|
5
5
|
visibleColumns: ColumnDefinition<T>[];
|
|
6
6
|
idField: string;
|
|
7
|
+
tableTitle?: string;
|
|
7
8
|
selectedRows: Record<string, boolean>;
|
|
8
9
|
editingRows: Record<string, boolean>;
|
|
9
10
|
editValues: Record<string, T>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
import { TableCellProps } from './types';
|
|
2
|
-
declare const TableCell:
|
|
3
|
+
declare const TableCell: React.ForwardRefExoticComponent<TableCellProps<Record<string, unknown>> & React.RefAttributes<HTMLTableCellElement>>;
|
|
3
4
|
export default TableCell;
|
|
@@ -11,6 +11,7 @@ type CalendarGridProps = {
|
|
|
11
11
|
customDisableDates?: (date: Date) => boolean;
|
|
12
12
|
customRangeConfig?: CustomRangeConfig;
|
|
13
13
|
showDateTimePicker?: boolean;
|
|
14
|
+
resetScrollPosition?: number;
|
|
14
15
|
};
|
|
15
16
|
declare const CalendarGrid: import('react').ForwardRefExoticComponent<CalendarGridProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
16
17
|
export default CalendarGrid;
|
|
@@ -192,7 +192,13 @@ export type CalendarTokenType = {
|
|
|
192
192
|
};
|
|
193
193
|
todayIndicator: {
|
|
194
194
|
width: CSSObject['width'];
|
|
195
|
+
height: CSSObject['height'];
|
|
195
196
|
backgroundColor: CSSObject['backgroundColor'];
|
|
197
|
+
borderRadius: CSSObject['borderRadius'];
|
|
198
|
+
position: CSSObject['position'];
|
|
199
|
+
bottom: CSSObject['bottom'];
|
|
200
|
+
left: CSSObject['left'];
|
|
201
|
+
transform: CSSObject['transform'];
|
|
196
202
|
};
|
|
197
203
|
};
|
|
198
204
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { WorkflowCanvasProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* WorkflowCanvas component for building visual workflow builders
|
|
4
|
+
*
|
|
5
|
+
* A powerful workflow canvas component built on top of ReactFlow, providing
|
|
6
|
+
* a complete solution for creating node-based workflow editors with support
|
|
7
|
+
* for custom nodes, edges, controls, and theming.
|
|
8
|
+
*
|
|
9
|
+
* @component
|
|
10
|
+
* @param {WorkflowCanvasProps} props - Canvas configuration and event handlers
|
|
11
|
+
* @returns {JSX.Element} The workflow canvas wrapped in ReactFlowProvider
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* See the full demo at `apps/site/src/demos/WorkflowCanvasDemo.tsx`
|
|
15
|
+
*
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
declare const WorkflowCanvas: (props: WorkflowCanvasProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export default WorkflowCanvas;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type NodeContentProps = {
|
|
3
|
+
icon?: ReactNode;
|
|
4
|
+
label?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
iconBackgroundColor?: string;
|
|
7
|
+
iconPadding?: string | number;
|
|
8
|
+
iconBorderRadius?: string | number;
|
|
9
|
+
labelColor?: string;
|
|
10
|
+
labelFontWeight?: number;
|
|
11
|
+
descriptionColor?: string;
|
|
12
|
+
descriptionOpacity?: number;
|
|
13
|
+
};
|
|
14
|
+
declare const _default: import('react').MemoExoticComponent<({ icon, label, description, iconBackgroundColor, iconPadding, iconBorderRadius, labelColor, labelFontWeight, descriptionColor, descriptionOpacity, }: NodeContentProps) => import("react/jsx-runtime").JSX.Element>;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WorkflowCanvas constants
|
|
3
|
+
* Internal implementation constants that should NOT be customized via tokens
|
|
4
|
+
*
|
|
5
|
+
* These are technical implementation details required for ReactFlow integration.
|
|
6
|
+
* User-customizable values (spacing, sizes, etc.) have been moved to
|
|
7
|
+
* workflow.tokens.ts where they can be themed and customized per breakpoint.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* ReactFlow-specific CSS class names
|
|
11
|
+
* These are required by ReactFlow library and should not be changed
|
|
12
|
+
*/
|
|
13
|
+
export declare const REACTFLOW_CLASSES: {
|
|
14
|
+
/** Prevents dragging on this element (ReactFlow class) */
|
|
15
|
+
readonly NO_DRAG: "nodrag";
|
|
16
|
+
/** Prevents panning on this element (ReactFlow class) */
|
|
17
|
+
readonly NO_PAN: "nopan";
|
|
18
|
+
/** Combined no-drag and no-pan classes */
|
|
19
|
+
readonly NO_DRAG_PAN: "nodrag nopan";
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* CSS transform constants
|
|
23
|
+
* Standard CSS transform values for internal positioning logic
|
|
24
|
+
*/
|
|
25
|
+
export declare const TRANSFORMS: {
|
|
26
|
+
/** Center transform for absolute positioned elements */
|
|
27
|
+
readonly CENTER: "translate(-50%, -50%)";
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Animation and transition constants
|
|
31
|
+
* Standard transition and animation values for consistent behavior
|
|
32
|
+
*/
|
|
33
|
+
export declare const TRANSITIONS: {
|
|
34
|
+
/** Default transition for smooth animations */
|
|
35
|
+
readonly DEFAULT: "all 0.2s ease-in-out";
|
|
36
|
+
/** Zoom animation duration in ms */
|
|
37
|
+
readonly ZOOM_DURATION: 200;
|
|
38
|
+
/** Fit view animation duration in ms */
|
|
39
|
+
readonly FIT_VIEW_DURATION: 200;
|
|
40
|
+
/** Fit view padding ratio */
|
|
41
|
+
readonly FIT_VIEW_PADDING: 0.2;
|
|
42
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CustomEdgeProps } from '../types';
|
|
2
|
+
declare const _default: import('react').MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, selected, data, }: CustomEdgeProps) => import("react/jsx-runtime").JSX.Element>;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { default as WorkflowCanvas } from './WorkflowCanvas';
|
|
2
|
+
export { default as DefaultNode } from './nodes/DefaultNode';
|
|
3
|
+
export { default as InputNode } from './nodes/InputNode';
|
|
4
|
+
export { default as OutputNode } from './nodes/OutputNode';
|
|
5
|
+
export { default as DefaultEdge } from './edges/DefaultEdge';
|
|
6
|
+
export { default as WorkflowControls } from './WorkflowControls';
|
|
7
|
+
export { default as NodeContent } from './components/NodeContent';
|
|
8
|
+
export * from './types';
|
|
9
|
+
export * from './workflow.tokens';
|
|
10
|
+
export * from './constants';
|
|
11
|
+
export * from './utils';
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Node, Edge, NodeProps, EdgeProps, Connection } from 'reactflow';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export type { Node, Edge, NodeProps, EdgeProps, Connection };
|
|
4
|
+
export declare enum NodeType {
|
|
5
|
+
DEFAULT = "default",
|
|
6
|
+
INPUT = "input",
|
|
7
|
+
OUTPUT = "output",
|
|
8
|
+
CUSTOM = "custom"
|
|
9
|
+
}
|
|
10
|
+
export declare enum EdgeType {
|
|
11
|
+
DEFAULT = "default",
|
|
12
|
+
STRAIGHT = "straight",
|
|
13
|
+
STEP = "step",
|
|
14
|
+
SMOOTHSTEP = "smoothstep",
|
|
15
|
+
SIMPLEBEZIER = "simplebezier"
|
|
16
|
+
}
|
|
17
|
+
export type BaseNodeData = {
|
|
18
|
+
label?: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
icon?: ReactNode;
|
|
21
|
+
status?: 'default' | 'success' | 'error' | 'warning';
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
};
|
|
24
|
+
export type BaseEdgeData = {
|
|
25
|
+
label?: string;
|
|
26
|
+
animated?: boolean;
|
|
27
|
+
[key: string]: unknown;
|
|
28
|
+
};
|
|
29
|
+
export type BlendNode = Node<BaseNodeData>;
|
|
30
|
+
export type BlendEdge = Edge<BaseEdgeData>;
|
|
31
|
+
export type WorkflowCanvasProps = {
|
|
32
|
+
nodes: BlendNode[];
|
|
33
|
+
edges: BlendEdge[];
|
|
34
|
+
onNodesChange?: (nodes: BlendNode[]) => void;
|
|
35
|
+
onEdgesChange?: (edges: BlendEdge[]) => void;
|
|
36
|
+
onConnect?: (connection: Connection) => void;
|
|
37
|
+
onNodeClick?: (event: React.MouseEvent, node: BlendNode) => void;
|
|
38
|
+
onEdgeClick?: (event: React.MouseEvent, edge: BlendEdge) => void;
|
|
39
|
+
onNodeDoubleClick?: (event: React.MouseEvent, node: BlendNode) => void;
|
|
40
|
+
onPaneClick?: (event: React.MouseEvent) => void;
|
|
41
|
+
height?: string | number;
|
|
42
|
+
width?: string | number;
|
|
43
|
+
fitView?: boolean;
|
|
44
|
+
showControls?: boolean;
|
|
45
|
+
controlsPosition?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
46
|
+
showMinimap?: boolean;
|
|
47
|
+
showBackground?: boolean;
|
|
48
|
+
panOnScroll?: boolean;
|
|
49
|
+
zoomOnScroll?: boolean;
|
|
50
|
+
nodesDraggable?: boolean;
|
|
51
|
+
nodesConnectable?: boolean;
|
|
52
|
+
elementsSelectable?: boolean;
|
|
53
|
+
minZoom?: number;
|
|
54
|
+
maxZoom?: number;
|
|
55
|
+
defaultZoom?: number;
|
|
56
|
+
children?: ReactNode;
|
|
57
|
+
};
|
|
58
|
+
export type CustomNodeProps = NodeProps<BaseNodeData> & {
|
|
59
|
+
selected: boolean;
|
|
60
|
+
};
|
|
61
|
+
export type CustomEdgeProps = EdgeProps<BaseEdgeData> & {
|
|
62
|
+
selected?: boolean;
|
|
63
|
+
};
|
|
64
|
+
export declare enum ControlButton {
|
|
65
|
+
ZOOM_IN = "zoom-in",
|
|
66
|
+
ZOOM_OUT = "zoom-out",
|
|
67
|
+
FIT_VIEW = "fit-view",
|
|
68
|
+
INTERACTIVE = "interactive",
|
|
69
|
+
LOCK = "lock"
|
|
70
|
+
}
|
|
71
|
+
export type WorkflowControlsProps = {
|
|
72
|
+
showZoom?: boolean;
|
|
73
|
+
showFitView?: boolean;
|
|
74
|
+
showInteractive?: boolean;
|
|
75
|
+
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
76
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { WorkflowTokensType } from './workflow.tokens';
|
|
2
|
+
export declare const createStyledHandle: (backgroundColor: string | undefined, borderColor: string | undefined, hoverBackgroundColor: string | undefined, hoverBorderColor: string | undefined) => import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('reactflow').HandleProps & Omit<import('react').HTMLAttributes<HTMLDivElement>, "id"> & import('react').RefAttributes<HTMLDivElement>, {
|
|
3
|
+
$tokens: WorkflowTokensType;
|
|
4
|
+
}>> & string & Omit<import('react').MemoExoticComponent<import('react').ForwardRefExoticComponent<import('reactflow').HandleProps & Omit<import('react').HTMLAttributes<HTMLDivElement>, "id"> & import('react').RefAttributes<HTMLDivElement>>>, keyof import('react').Component<any, {}, any>>;
|
|
5
|
+
export declare const createTokenStyledHandle: () => import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('reactflow').HandleProps & Omit<import('react').HTMLAttributes<HTMLDivElement>, "id"> & import('react').RefAttributes<HTMLDivElement>, {
|
|
6
|
+
$tokens: WorkflowTokensType;
|
|
7
|
+
}>> & string & Omit<import('react').MemoExoticComponent<import('react').ForwardRefExoticComponent<import('reactflow').HandleProps & Omit<import('react').HTMLAttributes<HTMLDivElement>, "id"> & import('react').RefAttributes<HTMLDivElement>>>, keyof import('react').Component<any, {}, any>>;
|
|
8
|
+
export declare const createGradientWrapper: (gradientStart: string | undefined, gradientEnd: string | undefined, borderColor: string | undefined) => import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
9
|
+
$boxShadow: string | undefined;
|
|
10
|
+
}>> & string;
|
|
11
|
+
export declare const getBoxShadow: (selected: boolean, selectedShadow: string | undefined, defaultShadow: string | undefined) => string | undefined;
|
|
12
|
+
export declare const getEdgeStroke: (selected: boolean | undefined, animated: boolean | undefined, selectedStroke: string | undefined, animatedStroke: string | undefined, defaultStroke: string | undefined) => string | undefined;
|
|
13
|
+
export declare const getEdgeStrokeWidth: (selected: boolean | undefined, selectedWidth: number | string | undefined, defaultWidth: number | string | undefined) => number | string | undefined;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { CSSObject } from 'styled-components';
|
|
2
|
+
import { FoundationTokenType } from '../../tokens/theme.token';
|
|
3
|
+
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
4
|
+
export type NodeState = 'default' | 'hover' | 'selected';
|
|
5
|
+
export type WorkflowTokensType = {
|
|
6
|
+
canvas: {
|
|
7
|
+
backgroundColor: CSSObject['backgroundColor'];
|
|
8
|
+
dotColor: CSSObject['color'];
|
|
9
|
+
dotGap: CSSObject['gap'];
|
|
10
|
+
dotSize: number;
|
|
11
|
+
};
|
|
12
|
+
node: {
|
|
13
|
+
default: {
|
|
14
|
+
backgroundColor: CSSObject['backgroundColor'];
|
|
15
|
+
border: CSSObject['border'];
|
|
16
|
+
borderRadius: CSSObject['borderRadius'];
|
|
17
|
+
color: CSSObject['color'];
|
|
18
|
+
padding: CSSObject['padding'];
|
|
19
|
+
boxShadow: CSSObject['boxShadow'];
|
|
20
|
+
fontSize: CSSObject['fontSize'];
|
|
21
|
+
fontWeight: CSSObject['fontWeight'];
|
|
22
|
+
minWidth: CSSObject['minWidth'];
|
|
23
|
+
minHeight: CSSObject['minHeight'];
|
|
24
|
+
};
|
|
25
|
+
hover: {
|
|
26
|
+
backgroundColor: CSSObject['backgroundColor'];
|
|
27
|
+
border: CSSObject['border'];
|
|
28
|
+
boxShadow: CSSObject['boxShadow'];
|
|
29
|
+
};
|
|
30
|
+
selected: {
|
|
31
|
+
backgroundColor: CSSObject['backgroundColor'];
|
|
32
|
+
border: CSSObject['border'];
|
|
33
|
+
boxShadow: CSSObject['boxShadow'];
|
|
34
|
+
};
|
|
35
|
+
content: {
|
|
36
|
+
gap: CSSObject['gap'];
|
|
37
|
+
padding: CSSObject['padding'];
|
|
38
|
+
};
|
|
39
|
+
icon: {
|
|
40
|
+
paddingSm: CSSObject['padding'];
|
|
41
|
+
paddingMd: CSSObject['padding'];
|
|
42
|
+
borderRadiusSm: CSSObject['borderRadius'];
|
|
43
|
+
borderRadiusMd: CSSObject['borderRadius'];
|
|
44
|
+
size: {
|
|
45
|
+
small: number;
|
|
46
|
+
medium: number;
|
|
47
|
+
large: number;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
handle: {
|
|
52
|
+
backgroundColor: CSSObject['backgroundColor'];
|
|
53
|
+
border: CSSObject['border'];
|
|
54
|
+
width: CSSObject['width'];
|
|
55
|
+
height: CSSObject['height'];
|
|
56
|
+
hover: {
|
|
57
|
+
backgroundColor: CSSObject['backgroundColor'];
|
|
58
|
+
border: CSSObject['border'];
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
edge: {
|
|
62
|
+
stroke: CSSObject['stroke'];
|
|
63
|
+
strokeWidth: CSSObject['strokeWidth'];
|
|
64
|
+
selected: {
|
|
65
|
+
stroke: CSSObject['stroke'];
|
|
66
|
+
strokeWidth: CSSObject['strokeWidth'];
|
|
67
|
+
};
|
|
68
|
+
animated: {
|
|
69
|
+
stroke: CSSObject['stroke'];
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
controls: {
|
|
73
|
+
backgroundColor: CSSObject['backgroundColor'];
|
|
74
|
+
border: CSSObject['border'];
|
|
75
|
+
borderRadius: CSSObject['borderRadius'];
|
|
76
|
+
boxShadow: CSSObject['boxShadow'];
|
|
77
|
+
padding: CSSObject['padding'];
|
|
78
|
+
gap: CSSObject['gap'];
|
|
79
|
+
offset: CSSObject['top'] | CSSObject['right'] | CSSObject['bottom'] | CSSObject['left'];
|
|
80
|
+
button: {
|
|
81
|
+
color: CSSObject['color'];
|
|
82
|
+
hover: {
|
|
83
|
+
backgroundColor: CSSObject['backgroundColor'];
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
minimap: {
|
|
88
|
+
backgroundColor: CSSObject['backgroundColor'];
|
|
89
|
+
border: CSSObject['border'];
|
|
90
|
+
borderRadius: CSSObject['borderRadius'];
|
|
91
|
+
maskColor: CSSObject['backgroundColor'];
|
|
92
|
+
nodeColor: CSSObject['color'];
|
|
93
|
+
nodeStrokeColor: CSSObject['color'];
|
|
94
|
+
nodeBorderRadius: CSSObject['borderRadius'];
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
export type ResponsiveWorkflowTokens = {
|
|
98
|
+
[key in keyof BreakpointType]: WorkflowTokensType;
|
|
99
|
+
};
|
|
100
|
+
export declare const getWorkflowTokens: (foundationToken: FoundationTokenType) => ResponsiveWorkflowTokens;
|
|
@@ -40,6 +40,7 @@ import { ThemeType } from '../tokens';
|
|
|
40
40
|
import { ResponsiveSkeletonTokens } from '../components/Skeleton/skeleton.tokens';
|
|
41
41
|
import { BREAKPOINTS } from '../breakpoints/breakPoints';
|
|
42
42
|
import { ResponsiveStepperTokens } from '../components/Stepper/stepper.tokens';
|
|
43
|
+
import { ResponsiveWorkflowTokens } from '../components/WorkflowCanvas/workflow.tokens';
|
|
43
44
|
export type ComponentTokenType = {
|
|
44
45
|
TAGS?: ResponsiveTagTokens;
|
|
45
46
|
SEARCH_INPUT?: ResponsiveSearchInputTokens;
|
|
@@ -81,6 +82,7 @@ export type ComponentTokenType = {
|
|
|
81
82
|
SIDEBAR?: ResponsiveSidebarTokens;
|
|
82
83
|
UPLOAD?: ResponsiveUploadTokens;
|
|
83
84
|
CODE_BLOCK?: ResponsiveCodeBlockTokens;
|
|
85
|
+
WORKFLOW_CANVAS?: ResponsiveWorkflowTokens;
|
|
84
86
|
};
|
|
85
87
|
type ThemeContextType = {
|
|
86
88
|
foundationTokens: ThemeType;
|
|
@@ -39,4 +39,5 @@ import { ResponsiveStatCardTokens } from '../components/StatCard/statcard.tokens
|
|
|
39
39
|
import { ResponsiveSidebarTokens } from '../components/Sidebar/sidebar.tokens';
|
|
40
40
|
import { ResponsiveUploadTokens } from '../components/Upload/upload.tokens';
|
|
41
41
|
import { ResponsiveCodeBlockTokens } from '../components/CodeBlock/codeBlock.token';
|
|
42
|
-
|
|
42
|
+
import { ResponsiveWorkflowTokens } from '../components/WorkflowCanvas/workflow.tokens';
|
|
43
|
+
export declare const useComponentToken: (component: keyof ComponentTokenType) => ResponsiveSearchInputTokens | ResponsiveTagTokens | ResponsiveTextAreaTokens | ResponsiveTextInputTokens | ResponsiveNumberInputTokens | ResponsiveAlertTokens | ResponsiveRadioTokens | ResponsiveOTPInputTokens | ResponsiveUnitInputTokens | ResponsiveMultiValueInputTokens | ResponsiveSwitchTokens | ResponsiveCheckboxTokens | ResponsiveTabsTokens | ResponsiveTooltipTokens | ResponsiveDropdownInputTokens | ResponsiveButtonTokens | ResponsiveModalTokens | ResponsiveBreadcrumbTokens | ResponsivePopoverTokens | ResponsiveMenuTokensType | ResponsiveMultiSelectTokens | ResponsiveSingleSelectTokens | ResponsiveTableTokens | ResponsiveCalendarTokens | ResponsiveAccordionTokens | ResponsiveStatCardTokens | ResponsiveProgressBarTokens | ResponsiveDrawerTokens | ResponsiveChartTokens | ResponsiveSnackbarTokens | ResponsiveStepperTokens | ResponsiveKeyValuePairTokens | ResponsiveCardTokens | ResponsiveSkeletonTokens | ResponsiveTopbarTokens | ResponsiveAvatarTokens | ResponsiveAvatarGroupTokens | ResponsiveSidebarTokens | ResponsiveUploadTokens | ResponsiveCodeBlockTokens | ResponsiveWorkflowTokens;
|
package/dist/main.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export * from './components/Skeleton';
|
|
|
34
34
|
export * from './components/KeyValuePair';
|
|
35
35
|
export * from './components/VirtualList';
|
|
36
36
|
export * from './components/Upload';
|
|
37
|
+
export * from './components/WorkflowCanvas';
|
|
37
38
|
export * from './components/ButtonGroup';
|
|
38
39
|
export * from './components/Button';
|
|
39
40
|
export * from './context';
|