@hitachivantara/uikit-react-lab 5.9.0 → 5.11.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.
Files changed (60) hide show
  1. package/dist/cjs/components/Flow/DroppableFlow.cjs +54 -67
  2. package/dist/cjs/components/Flow/DroppableFlow.cjs.map +1 -1
  3. package/dist/cjs/components/Flow/Empty/Empty.cjs +19 -0
  4. package/dist/cjs/components/Flow/Empty/Empty.cjs.map +1 -0
  5. package/dist/cjs/components/Flow/Empty/Empty.styles.cjs +20 -0
  6. package/dist/cjs/components/Flow/Empty/Empty.styles.cjs.map +1 -0
  7. package/dist/cjs/components/Flow/Flow.cjs +2 -15
  8. package/dist/cjs/components/Flow/Flow.cjs.map +1 -1
  9. package/dist/cjs/components/Flow/Flow.styles.cjs +2 -2
  10. package/dist/cjs/components/Flow/FlowContext/FlowContext.cjs +0 -2
  11. package/dist/cjs/components/Flow/FlowContext/FlowContext.cjs.map +1 -1
  12. package/dist/cjs/components/Flow/Node/Node.cjs +6 -6
  13. package/dist/cjs/components/Flow/Node/Node.cjs.map +1 -1
  14. package/dist/cjs/components/Flow/Sidebar/Sidebar.cjs +40 -21
  15. package/dist/cjs/components/Flow/Sidebar/Sidebar.cjs.map +1 -1
  16. package/dist/cjs/components/Flow/Sidebar/SidebarGroup/SidebarGroup.cjs +3 -3
  17. package/dist/cjs/components/Flow/Sidebar/SidebarGroup/SidebarGroup.cjs.map +1 -1
  18. package/dist/cjs/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/DraggableSidebarGroupItem.cjs +12 -4
  19. package/dist/cjs/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/DraggableSidebarGroupItem.cjs.map +1 -1
  20. package/dist/cjs/components/Flow/Sidebar/utils.cjs +4 -3
  21. package/dist/cjs/components/Flow/Sidebar/utils.cjs.map +1 -1
  22. package/dist/cjs/components/Flow/base.cjs +16 -0
  23. package/dist/cjs/components/Flow/base.cjs.map +1 -0
  24. package/dist/cjs/components/Flow/hooks/useFlowContext.cjs +7 -0
  25. package/dist/cjs/components/Flow/hooks/useFlowContext.cjs.map +1 -0
  26. package/dist/cjs/components/Flow/hooks/useFlowNode.cjs +25 -0
  27. package/dist/cjs/components/Flow/hooks/useFlowNode.cjs.map +1 -0
  28. package/dist/cjs/index.cjs +6 -0
  29. package/dist/cjs/index.cjs.map +1 -1
  30. package/dist/esm/components/Flow/DroppableFlow.js +54 -67
  31. package/dist/esm/components/Flow/DroppableFlow.js.map +1 -1
  32. package/dist/esm/components/Flow/Empty/Empty.js +19 -0
  33. package/dist/esm/components/Flow/Empty/Empty.js.map +1 -0
  34. package/dist/esm/components/Flow/Empty/Empty.styles.js +20 -0
  35. package/dist/esm/components/Flow/Empty/Empty.styles.js.map +1 -0
  36. package/dist/esm/components/Flow/Flow.js +3 -16
  37. package/dist/esm/components/Flow/Flow.js.map +1 -1
  38. package/dist/esm/components/Flow/Flow.styles.js +2 -2
  39. package/dist/esm/components/Flow/FlowContext/FlowContext.js +2 -4
  40. package/dist/esm/components/Flow/FlowContext/FlowContext.js.map +1 -1
  41. package/dist/esm/components/Flow/Node/Node.js +5 -5
  42. package/dist/esm/components/Flow/Node/Node.js.map +1 -1
  43. package/dist/esm/components/Flow/Sidebar/Sidebar.js +41 -22
  44. package/dist/esm/components/Flow/Sidebar/Sidebar.js.map +1 -1
  45. package/dist/esm/components/Flow/Sidebar/SidebarGroup/SidebarGroup.js +2 -2
  46. package/dist/esm/components/Flow/Sidebar/SidebarGroup/SidebarGroup.js.map +1 -1
  47. package/dist/esm/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/DraggableSidebarGroupItem.js +12 -4
  48. package/dist/esm/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/DraggableSidebarGroupItem.js.map +1 -1
  49. package/dist/esm/components/Flow/Sidebar/utils.js +4 -3
  50. package/dist/esm/components/Flow/Sidebar/utils.js.map +1 -1
  51. package/dist/esm/components/Flow/base.js +16 -0
  52. package/dist/esm/components/Flow/base.js.map +1 -0
  53. package/dist/esm/components/Flow/hooks/useFlowContext.js +7 -0
  54. package/dist/esm/components/Flow/hooks/useFlowContext.js.map +1 -0
  55. package/dist/esm/components/Flow/hooks/useFlowNode.js +25 -0
  56. package/dist/esm/components/Flow/hooks/useFlowNode.js.map +1 -0
  57. package/dist/esm/index.js +6 -0
  58. package/dist/esm/index.js.map +1 -1
  59. package/dist/types/index.d.ts +39 -16
  60. package/package.json +4 -4
@@ -17,6 +17,7 @@ import { HvButtonProps } from '@hitachivantara/uikit-react-core';
17
17
  import { HvColorAny } from '@hitachivantara/uikit-styles';
18
18
  import { HvDialogProps } from '@hitachivantara/uikit-react-core';
19
19
  import { HvDrawerProps } from '@hitachivantara/uikit-react-core';
20
+ import { HvEmptyStateProps } from '@hitachivantara/uikit-react-core';
20
21
  import type { JSX as JSX_2 } from '@emotion/react/jsx-runtime';
21
22
  import { MiniMapProps } from 'reactflow';
22
23
  import { ModalProps } from '@mui/material';
@@ -62,7 +63,7 @@ export declare const flowSidebarClasses: {
62
63
  groupsContainer: "HvFlowSidebar-groupsContainer";
63
64
  };
64
65
 
65
- declare interface HvDroppableFlowProps<NodeData = any, NodeType extends string | undefined = string | undefined> extends Omit<ReactFlowProps, "nodes" | "edges" | "nodeTypes"> {
66
+ declare interface HvDroppableFlowProps<NodeType extends string | undefined = string | undefined, NodeData = any> extends Omit<ReactFlowProps, "nodes" | "edges" | "nodeTypes"> {
66
67
  /** Flow content: background, controls, and minimap. */
67
68
  children?: React.ReactNode;
68
69
  /** Flow nodes. */
@@ -94,6 +95,19 @@ export declare interface HvFlowBackgroundProps extends Omit<BackgroundProps, "co
94
95
 
95
96
  export declare type HvFlowClasses = ExtractNames<typeof useClasses_8>;
96
97
 
98
+ declare interface HvFlowContextValue<NodeGroups extends keyof any = string> {
99
+ /** Flow nodes types. */
100
+ nodeTypes?: HvFlowNodeTypes<NodeGroups>;
101
+ /** Flow nodes groups. */
102
+ nodeGroups?: HvFlowNodeGroups<NodeGroups>;
103
+ /** Flow nodes groups expanded on sidebar. */
104
+ expandedNodeGroups?: string[];
105
+ /** Flow default actions. */
106
+ defaultActions?: HvFlowDefaultActions[];
107
+ /** Function to set `expandedNodeGroups`. */
108
+ setExpandedNodeGroups?: Dispatch<SetStateAction<string[]>>;
109
+ }
110
+
97
111
  export declare const HvFlowControls: ({ onZoomIn: onZoomInProp, onZoomOut: onZoomOutProp, onFitView: onFitViewProp, labels: labelsProps, hideInteractive, hideFitView, hideZoom, position, orientation, onInteractiveChange, fitViewOptions, children, ...others }: HvFlowControlsProps) => JSX_2.Element;
98
112
 
99
113
  export declare type HvFlowControlsPosition = PanelPosition;
@@ -124,6 +138,11 @@ export declare type HvFlowDefaultActions = Omit<HvActionGeneric, "id"> & {
124
138
  id: HvFlowDefaultAction;
125
139
  };
126
140
 
141
+ export declare const HvFlowEmpty: ({ className, ...others }: HvFlowEmptyProps) => JSX_2.Element | null;
142
+
143
+ export declare interface HvFlowEmptyProps extends HvEmptyStateProps {
144
+ }
145
+
127
146
  export declare const HvFlowMinimap: ({ nodeColor, maskColor, maskStrokeColor, nodeStrokeColor, classes: classesProp, className, ...others }: HvFlowMinimapProps) => JSX_2.Element;
128
147
 
129
148
  export declare type HvFlowMinimapClasses = ExtractNames<typeof useClasses_9>;
@@ -145,17 +164,17 @@ export declare const HvFlowNode: ({ id, type, description, expanded, params, act
145
164
 
146
165
  export declare type HvFlowNodeClasses = ExtractNames<typeof useClasses_11>;
147
166
 
148
- export declare interface HvFlowNodeComponentClass<GroupId extends keyof any = string> extends ComponentClass<NodeProps> {
167
+ export declare interface HvFlowNodeComponentClass<GroupId extends keyof any = string, NodeData = any> extends ComponentClass<NodeProps> {
149
168
  /** Metadata used on the HvFlowSidebar component to group the node */
150
- meta?: HvFlowNodeMeta<GroupId>;
169
+ meta?: HvFlowNodeMeta<GroupId, NodeData>;
151
170
  }
152
171
 
153
- export declare type HvFlowNodeComponentType<GroupId extends keyof any = string> = HvFlowNodeComponentClass<GroupId> | HvFlowNodeFunctionComponent<GroupId>;
172
+ export declare type HvFlowNodeComponentType<GroupId extends keyof any = string, NodeData = any> = HvFlowNodeComponentClass<GroupId, NodeData> | HvFlowNodeFunctionComponent<GroupId, NodeData>;
154
173
 
155
174
  /** Node types */
156
- export declare interface HvFlowNodeFunctionComponent<GroupId extends keyof any = string> extends FunctionComponent<NodeProps> {
175
+ export declare interface HvFlowNodeFunctionComponent<GroupId extends keyof any = string, NodeData = any> extends FunctionComponent<NodeProps> {
157
176
  /** Metadata used on the HvFlowSidebar component to group the node */
158
- meta?: HvFlowNodeMeta<GroupId>;
177
+ meta?: HvFlowNodeMeta<GroupId, NodeData>;
159
178
  }
160
179
 
161
180
  /** Node groups */
@@ -174,17 +193,18 @@ export declare type HvFlowNodeInput = {
174
193
  accepts?: string[];
175
194
  };
176
195
 
177
- export declare type HvFlowNodeMeta<GroupId extends keyof any = string> = {
196
+ export declare type HvFlowNodeMeta<GroupId extends keyof any = string, NodeData = any> = {
178
197
  label: string;
179
198
  groupId: GroupId;
180
199
  inputs?: HvFlowNodeInput[];
181
200
  outputs?: HvFlowNodeOutput[];
201
+ data?: NodeData;
182
202
  };
183
203
 
184
204
  export declare type HvFlowNodeOutput = {
185
205
  label: string;
186
206
  isMandatory?: boolean;
187
- provides?: string[];
207
+ provides?: string;
188
208
  };
189
209
 
190
210
  export declare type HvFlowNodeParam = {
@@ -200,10 +220,6 @@ export declare interface HvFlowNodeProps extends Omit<HvBaseProps, "id">, NodePr
200
220
  description: string;
201
221
  /** Node expanded */
202
222
  expanded?: boolean;
203
- /** Node inputs */
204
- inputs?: HvFlowNodeInput[];
205
- /** Node outputs */
206
- outputs?: HvFlowNodeOutput[];
207
223
  /** Node parameters */
208
224
  params?: HvFlowNodeParam[];
209
225
  /** Node actions */
@@ -216,15 +232,15 @@ export declare interface HvFlowNodeProps extends Omit<HvBaseProps, "id">, NodePr
216
232
  classes?: HvFlowNodeClasses;
217
233
  }
218
234
 
219
- export declare type HvFlowNodeTypes<GroupId extends keyof any = string> = {
220
- [key: string]: HvFlowNodeComponentType<GroupId>;
235
+ export declare type HvFlowNodeTypes<GroupId extends keyof any = string, NodeData = any> = {
236
+ [key: string]: HvFlowNodeComponentType<GroupId, NodeData>;
221
237
  };
222
238
 
223
- export declare interface HvFlowProps<NodeData = any, NodeType extends string | undefined = string | undefined, NodeGroups extends keyof any = string> extends HvDroppableFlowProps<NodeData, NodeType> {
239
+ export declare interface HvFlowProps<NodeGroups extends keyof any = string, NodeType extends string | undefined = string | undefined, NodeData = any> extends HvDroppableFlowProps<NodeType, NodeData> {
224
240
  /** Flow nodes groups. */
225
241
  nodeGroups?: HvFlowNodeGroups<NodeGroups>;
226
242
  /** Flow nodes types. */
227
- nodeTypes?: HvFlowNodeTypes<NodeGroups>;
243
+ nodeTypes?: HvFlowNodeTypes<NodeGroups, NodeData>;
228
244
  /** Flow sidebar. */
229
245
  sidebar?: React.ReactNode;
230
246
  /** Flow default actions. */
@@ -633,6 +649,13 @@ declare const useClasses_9: (classesProp?: Partial<Record<"root", string>>, addS
633
649
  cx: (...args: any) => string;
634
650
  };
635
651
 
652
+ export declare const useFlowContext: () => HvFlowContextValue<string>;
653
+
654
+ export declare const useFlowNode: (id: string) => {
655
+ readonly node: Node_2 | undefined;
656
+ readonly parentNodes: Node_2[];
657
+ };
658
+
636
659
  export declare const wizardActionsClasses: {
637
660
  buttonWidth: "HvWizardActions-buttonWidth";
638
661
  actionsContainer: "HvWizardActions-actionsContainer";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hitachivantara/uikit-react-lab",
3
- "version": "5.9.0",
3
+ "version": "5.11.0",
4
4
  "private": false,
5
5
  "author": "Hitachi Vantara UI Kit Team",
6
6
  "description": "Contributed React components for the NEXT UI Kit.",
@@ -32,11 +32,11 @@
32
32
  "@dnd-kit/core": "^6.0.8",
33
33
  "@dnd-kit/modifiers": "^6.0.1",
34
34
  "@emotion/css": "^11.11.0",
35
- "@hitachivantara/uikit-react-core": "^5.29.0",
35
+ "@hitachivantara/uikit-react-core": "^5.30.1",
36
36
  "@hitachivantara/uikit-react-icons": "^5.6.8",
37
37
  "@hitachivantara/uikit-styles": "^5.13.0",
38
38
  "lodash": "^4.17.21",
39
- "reactflow": "^11.8.3",
39
+ "reactflow": "^11.9.4",
40
40
  "uid": "^2.0.2",
41
41
  "usehooks-ts": "^2.9.1",
42
42
  "zustand": "^4.4.1"
@@ -48,7 +48,7 @@
48
48
  "access": "public",
49
49
  "directory": "package"
50
50
  },
51
- "gitHead": "191f0c01ede0f034dea18409accf3b49e3051277",
51
+ "gitHead": "8b5664fad80cff7282a5a83b5e5b446687896637",
52
52
  "main": "dist/cjs/index.cjs",
53
53
  "exports": {
54
54
  ".": {