@hitachivantara/uikit-react-lab 6.1.8 → 6.1.10

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 (68) hide show
  1. package/dist/Blade/Blade.js +134 -173
  2. package/dist/Blade/Blade.styles.js +54 -69
  3. package/dist/Blades/Blades.js +70 -101
  4. package/dist/Blades/Blades.styles.js +7 -10
  5. package/dist/Dashboard/Dashboard.js +57 -60
  6. package/dist/Dashboard/Dashboard.styles.js +6 -10
  7. package/dist/Flow/Background/Background.js +10 -16
  8. package/dist/Flow/Controls/Controls.js +77 -91
  9. package/dist/Flow/DroppableFlow.js +135 -200
  10. package/dist/Flow/Empty/Empty.js +12 -9
  11. package/dist/Flow/Empty/Empty.styles.js +12 -15
  12. package/dist/Flow/Flow.js +28 -30
  13. package/dist/Flow/Flow.styles.js +12 -18
  14. package/dist/Flow/FlowContext/FlowContext.js +22 -23
  15. package/dist/Flow/FlowContext/NodeMetaContext.js +36 -39
  16. package/dist/Flow/Minimap/Minimap.js +15 -28
  17. package/dist/Flow/Minimap/Minimap.styles.js +4 -9
  18. package/dist/Flow/Node/BaseNode.js +144 -190
  19. package/dist/Flow/Node/BaseNode.styles.js +122 -133
  20. package/dist/Flow/Node/Node.js +90 -108
  21. package/dist/Flow/Node/Node.styles.js +30 -40
  22. package/dist/Flow/Node/Parameters/ParamRenderer.js +17 -14
  23. package/dist/Flow/Node/Parameters/Select.js +33 -38
  24. package/dist/Flow/Node/Parameters/Slider.js +27 -29
  25. package/dist/Flow/Node/Parameters/Text.js +17 -17
  26. package/dist/Flow/Node/utils.js +44 -49
  27. package/dist/Flow/Sidebar/Sidebar.js +115 -137
  28. package/dist/Flow/Sidebar/Sidebar.styles.js +21 -22
  29. package/dist/Flow/Sidebar/SidebarGroup/SidebarGroup.js +57 -60
  30. package/dist/Flow/Sidebar/SidebarGroup/SidebarGroup.styles.js +27 -33
  31. package/dist/Flow/Sidebar/SidebarGroup/SidebarGroupItem/DraggableSidebarGroupItem.js +27 -47
  32. package/dist/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.js +14 -32
  33. package/dist/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.styles.js +17 -23
  34. package/dist/Flow/base.js +5 -5
  35. package/dist/Flow/hooks/useFlowContext.js +5 -5
  36. package/dist/Flow/hooks/useFlowInstance.js +5 -4
  37. package/dist/Flow/hooks/useFlowNode.js +92 -113
  38. package/dist/Flow/hooks/useFlowNodeMeta.js +7 -7
  39. package/dist/Flow/hooks/useNode.js +136 -154
  40. package/dist/Flow/hooks/useNodeId.js +8 -7
  41. package/dist/Flow/nodes/DashboardNode.js +64 -86
  42. package/dist/Flow/nodes/DashboardNode.styles.js +8 -14
  43. package/dist/Flow/nodes/StickyNode.js +370 -435
  44. package/dist/StepNavigation/DefaultNavigation/DefaultNavigation.js +36 -52
  45. package/dist/StepNavigation/DefaultNavigation/Step/Step.js +40 -51
  46. package/dist/StepNavigation/DefaultNavigation/Step/Step.styles.js +22 -33
  47. package/dist/StepNavigation/DefaultNavigation/utils.js +38 -30
  48. package/dist/StepNavigation/SimpleNavigation/Dot/Dot.js +24 -41
  49. package/dist/StepNavigation/SimpleNavigation/Dot/Dot.styles.js +13 -16
  50. package/dist/StepNavigation/SimpleNavigation/SimpleNavigation.js +35 -47
  51. package/dist/StepNavigation/SimpleNavigation/utils.js +10 -11
  52. package/dist/StepNavigation/StepNavigation.js +136 -179
  53. package/dist/StepNavigation/StepNavigation.styles.js +29 -32
  54. package/dist/Wizard/Wizard.js +81 -104
  55. package/dist/Wizard/Wizard.styles.js +4 -7
  56. package/dist/Wizard/WizardActions/WizardActions.js +111 -131
  57. package/dist/Wizard/WizardActions/WizardActions.styles.js +19 -20
  58. package/dist/Wizard/WizardContainer/WizardContainer.js +19 -28
  59. package/dist/Wizard/WizardContainer/WizardContainer.styles.js +8 -14
  60. package/dist/Wizard/WizardContent/WizardContent.js +103 -120
  61. package/dist/Wizard/WizardContent/WizardContent.styles.js +33 -36
  62. package/dist/Wizard/WizardContext/WizardContext.js +10 -13
  63. package/dist/Wizard/WizardTitle/WizardTitle.js +74 -79
  64. package/dist/Wizard/WizardTitle/WizardTitle.styles.js +12 -15
  65. package/dist/index.d.ts +1 -1
  66. package/dist/index.js +30 -81
  67. package/package.json +6 -6
  68. package/dist/StepNavigation/utils.js +0 -8
@@ -1,64 +1,61 @@
1
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
1
+ import { gridStyles, useClasses } from "./Dashboard.styles.js";
2
2
  import { useMemo } from "react";
3
- import { WidthProvider, Responsive } from "react-grid-layout";
4
- import { Global } from "@emotion/react";
5
3
  import { useDefaultProps, useTheme } from "@hitachivantara/uikit-react-core";
6
- import { useClasses, gridStyles } from "./Dashboard.styles.js";
7
- import { staticClasses } from "./Dashboard.styles.js";
8
- const GridLayout = WidthProvider(Responsive);
9
- const defaultCols = {
10
- xs: 12,
11
- sm: 12,
12
- md: 12,
13
- lg: 12,
14
- xl: 12
15
- };
16
- const HvDashboard = (props) => {
17
- const {
18
- children,
19
- className,
20
- layout,
21
- cols: colsProp,
22
- layouts: layoutsProp,
23
- classes: classesProp,
24
- ...others
25
- } = useDefaultProps("HvDashboard", props);
26
- const { classes, cx } = useClasses(classesProp);
27
- const { activeTheme } = useTheme();
28
- const layouts = useMemo(() => {
29
- if (layoutsProp) return layoutsProp;
30
- if (!layout) return {};
31
- return { xs: layout, sm: layout, md: layout, lg: layout, xl: layout };
32
- }, [layoutsProp, layout]);
33
- const cols = useMemo(() => {
34
- if (!colsProp) return defaultCols;
35
- if (typeof colsProp === "number") {
36
- return {
37
- xs: colsProp,
38
- sm: colsProp,
39
- md: colsProp,
40
- lg: colsProp,
41
- xl: colsProp
42
- };
43
- }
44
- return colsProp;
45
- }, [colsProp]);
46
- return /* @__PURE__ */ jsxs(Fragment, { children: [
47
- /* @__PURE__ */ jsx(Global, { styles: gridStyles }),
48
- /* @__PURE__ */ jsx(
49
- GridLayout,
50
- {
51
- className: cx(classes.root, className),
52
- breakpoints: activeTheme?.breakpoints.values,
53
- cols,
54
- layouts,
55
- ...others,
56
- children
57
- }
58
- )
59
- ] });
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ import { Responsive, WidthProvider } from "react-grid-layout";
6
+ import { Global } from "@emotion/react";
7
+ //#region src/Dashboard/Dashboard.tsx
8
+ var GridLayout = WidthProvider(Responsive);
9
+ /** Default column breakpoints. For now, use always 12-column */
10
+ var defaultCols = {
11
+ xs: 12,
12
+ sm: 12,
13
+ md: 12,
14
+ lg: 12,
15
+ xl: 12
60
16
  };
61
- export {
62
- HvDashboard,
63
- staticClasses as dashboardClasses
17
+ /**
18
+ * A Dashboard grid layout component, based on `react-grid-layout`.
19
+ * The children elements are grid items and must be `key`ed.
20
+ *
21
+ * @see https://github.com/react-grid-layout/react-grid-layout?tab=readme-ov-file#grid-layout-props
22
+ *
23
+ * DISCLAIMER: This component is a work in progress and there might be breaking changes.
24
+ */
25
+ var HvDashboard = (props) => {
26
+ const { children, className, layout, cols: colsProp, layouts: layoutsProp, classes: classesProp, ...others } = useDefaultProps("HvDashboard", props);
27
+ const { classes, cx } = useClasses(classesProp);
28
+ const { activeTheme } = useTheme();
29
+ const layouts = useMemo(() => {
30
+ if (layoutsProp) return layoutsProp;
31
+ if (!layout) return {};
32
+ return {
33
+ xs: layout,
34
+ sm: layout,
35
+ md: layout,
36
+ lg: layout,
37
+ xl: layout
38
+ };
39
+ }, [layoutsProp, layout]);
40
+ const cols = useMemo(() => {
41
+ if (!colsProp) return defaultCols;
42
+ if (typeof colsProp === "number") return {
43
+ xs: colsProp,
44
+ sm: colsProp,
45
+ md: colsProp,
46
+ lg: colsProp,
47
+ xl: colsProp
48
+ };
49
+ return colsProp;
50
+ }, [colsProp]);
51
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Global, { styles: gridStyles }), /* @__PURE__ */ jsx(GridLayout, {
52
+ className: cx(classes.root, className),
53
+ breakpoints: activeTheme?.breakpoints.values,
54
+ cols,
55
+ layouts,
56
+ ...others,
57
+ children
58
+ })] });
64
59
  };
60
+ //#endregion
61
+ export { HvDashboard };
@@ -1,9 +1,8 @@
1
- import { css } from "@emotion/react";
2
1
  import { createClasses, theme } from "@hitachivantara/uikit-react-core";
3
- const { staticClasses, useClasses } = createClasses("HvDashboard", {
4
- root: {}
5
- });
6
- const gridStyles = css`
2
+ import { css } from "@emotion/react";
3
+ //#region src/Dashboard/Dashboard.styles.ts
4
+ var { staticClasses, useClasses } = createClasses("HvDashboard", { root: {} });
5
+ var gridStyles = css`
7
6
  .react-grid-layout {
8
7
  position: relative;
9
8
  transition: height 200ms ease;
@@ -189,8 +188,5 @@ const gridStyles = css`
189
188
  transform: rotate(45deg);
190
189
  }
191
190
  `;
192
- export {
193
- gridStyles,
194
- staticClasses,
195
- useClasses
196
- };
191
+ //#endregion
192
+ export { gridStyles, staticClasses, useClasses };
@@ -1,19 +1,13 @@
1
+ import { getColor, theme } from "@hitachivantara/uikit-styles";
1
2
  import { jsx } from "react/jsx-runtime";
2
3
  import { Background } from "reactflow";
3
- import { getColor, theme } from "@hitachivantara/uikit-styles";
4
- const HvFlowBackground = ({
5
- color = "text",
6
- ...others
7
- }) => {
8
- return /* @__PURE__ */ jsx(
9
- Background,
10
- {
11
- color: getColor(color, theme.colors.textSubtle),
12
- gap: 16,
13
- ...others
14
- }
15
- );
16
- };
17
- export {
18
- HvFlowBackground
4
+ //#region src/Flow/Background/Background.tsx
5
+ var HvFlowBackground = ({ color = "text", ...others }) => {
6
+ return /* @__PURE__ */ jsx(Background, {
7
+ color: getColor(color, theme.colors.textSubtle),
8
+ gap: 16,
9
+ ...others
10
+ });
19
11
  };
12
+ //#endregion
13
+ export { HvFlowBackground };
@@ -1,96 +1,82 @@
1
+ import { useFlowInstance } from "../hooks/useFlowInstance.js";
2
+ import { HvButton, HvMultiButton, useLabels } from "@hitachivantara/uikit-react-core";
1
3
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { useStore, useStoreApi, Panel } from "reactflow";
4
+ import { Panel, useStore, useStoreApi } from "reactflow";
3
5
  import { shallow } from "zustand/shallow";
4
- import { useLabels, HvMultiButton, HvButton } from "@hitachivantara/uikit-react-core";
5
- import { ZoomIn, ZoomOut, Focus, Unlock, Lock } from "@hitachivantara/uikit-react-icons";
6
- import { useFlowInstance } from "../hooks/useFlowInstance.js";
7
- const DEFAULT_LABELS = {
8
- fitView: "Fit view",
9
- zoomIn: "Zoom in",
10
- zoomOut: "Zoom out",
11
- interactive: "Interactive"
6
+ import { Focus, Lock, Unlock, ZoomIn, ZoomOut } from "@hitachivantara/uikit-react-icons";
7
+ //#region src/Flow/Controls/Controls.tsx
8
+ var DEFAULT_LABELS = {
9
+ fitView: "Fit view",
10
+ zoomIn: "Zoom in",
11
+ zoomOut: "Zoom out",
12
+ interactive: "Interactive"
12
13
  };
13
- const selector = (state) => ({
14
- isInteractive: state.nodesDraggable || state.nodesConnectable || state.elementsSelectable,
15
- minZoomReached: state.transform[2] <= state.minZoom,
16
- maxZoomReached: state.transform[2] >= state.maxZoom
14
+ var selector = (state) => ({
15
+ isInteractive: state.nodesDraggable || state.nodesConnectable || state.elementsSelectable,
16
+ minZoomReached: state.transform[2] <= state.minZoom,
17
+ maxZoomReached: state.transform[2] >= state.maxZoom
17
18
  });
18
- const HvFlowControls = ({
19
- onZoomIn: onZoomInProp,
20
- onZoomOut: onZoomOutProp,
21
- onFitView: onFitViewProp,
22
- labels: labelsProps,
23
- hideInteractive,
24
- hideFitView,
25
- hideZoom,
26
- position = "bottom-center",
27
- orientation = "horizontal",
28
- onInteractiveChange,
29
- fitViewOptions,
30
- children,
31
- ...others
32
- }) => {
33
- const { isInteractive, minZoomReached, maxZoomReached } = useStore(
34
- selector,
35
- shallow
36
- );
37
- const store = useStoreApi();
38
- const { zoomIn, zoomOut, fitView } = useFlowInstance();
39
- const labels = useLabels(DEFAULT_LABELS, labelsProps);
40
- const handleZoomIn = () => {
41
- zoomIn();
42
- onZoomInProp?.();
43
- };
44
- const handleZoomOut = () => {
45
- zoomOut();
46
- onZoomOutProp?.();
47
- };
48
- const handleFitView = () => {
49
- fitView(fitViewOptions);
50
- onFitViewProp?.();
51
- };
52
- const handleInteractive = () => {
53
- store.setState({
54
- nodesDraggable: !isInteractive,
55
- nodesConnectable: !isInteractive,
56
- elementsSelectable: !isInteractive
57
- });
58
- onInteractiveChange?.(!isInteractive);
59
- };
60
- return /* @__PURE__ */ jsx(Panel, { position, ...others, children: /* @__PURE__ */ jsxs(HvMultiButton, { vertical: orientation === "vertical", children: [
61
- !hideZoom && /* @__PURE__ */ jsx(
62
- HvButton,
63
- {
64
- icon: true,
65
- title: labels?.zoomIn,
66
- onClick: handleZoomIn,
67
- disabled: maxZoomReached,
68
- children: /* @__PURE__ */ jsx(ZoomIn, {})
69
- }
70
- ),
71
- !hideZoom && /* @__PURE__ */ jsx(
72
- HvButton,
73
- {
74
- icon: true,
75
- title: labels?.zoomOut,
76
- onClick: handleZoomOut,
77
- disabled: minZoomReached,
78
- children: /* @__PURE__ */ jsx(ZoomOut, {})
79
- }
80
- ),
81
- !hideFitView && /* @__PURE__ */ jsx(HvButton, { icon: true, title: labels?.fitView, onClick: handleFitView, children: /* @__PURE__ */ jsx(Focus, {}) }),
82
- !hideInteractive && /* @__PURE__ */ jsx(
83
- HvButton,
84
- {
85
- icon: true,
86
- title: labels?.interactive,
87
- onClick: handleInteractive,
88
- children: isInteractive ? /* @__PURE__ */ jsx(Unlock, {}) : /* @__PURE__ */ jsx(Lock, {})
89
- }
90
- ),
91
- children
92
- ] }) });
93
- };
94
- export {
95
- HvFlowControls
19
+ var HvFlowControls = ({ onZoomIn: onZoomInProp, onZoomOut: onZoomOutProp, onFitView: onFitViewProp, labels: labelsProps, hideInteractive, hideFitView, hideZoom, position = "bottom-center", orientation = "horizontal", onInteractiveChange, fitViewOptions, children, ...others }) => {
20
+ const { isInteractive, minZoomReached, maxZoomReached } = useStore(selector, shallow);
21
+ const store = useStoreApi();
22
+ const { zoomIn, zoomOut, fitView } = useFlowInstance();
23
+ const labels = useLabels(DEFAULT_LABELS, labelsProps);
24
+ const handleZoomIn = () => {
25
+ zoomIn();
26
+ onZoomInProp?.();
27
+ };
28
+ const handleZoomOut = () => {
29
+ zoomOut();
30
+ onZoomOutProp?.();
31
+ };
32
+ const handleFitView = () => {
33
+ fitView(fitViewOptions);
34
+ onFitViewProp?.();
35
+ };
36
+ const handleInteractive = () => {
37
+ store.setState({
38
+ nodesDraggable: !isInteractive,
39
+ nodesConnectable: !isInteractive,
40
+ elementsSelectable: !isInteractive
41
+ });
42
+ onInteractiveChange?.(!isInteractive);
43
+ };
44
+ return /* @__PURE__ */ jsx(Panel, {
45
+ position,
46
+ ...others,
47
+ children: /* @__PURE__ */ jsxs(HvMultiButton, {
48
+ vertical: orientation === "vertical",
49
+ children: [
50
+ !hideZoom && /* @__PURE__ */ jsx(HvButton, {
51
+ icon: true,
52
+ title: labels?.zoomIn,
53
+ onClick: handleZoomIn,
54
+ disabled: maxZoomReached,
55
+ children: /* @__PURE__ */ jsx(ZoomIn, {})
56
+ }),
57
+ !hideZoom && /* @__PURE__ */ jsx(HvButton, {
58
+ icon: true,
59
+ title: labels?.zoomOut,
60
+ onClick: handleZoomOut,
61
+ disabled: minZoomReached,
62
+ children: /* @__PURE__ */ jsx(ZoomOut, {})
63
+ }),
64
+ !hideFitView && /* @__PURE__ */ jsx(HvButton, {
65
+ icon: true,
66
+ title: labels?.fitView,
67
+ onClick: handleFitView,
68
+ children: /* @__PURE__ */ jsx(Focus, {})
69
+ }),
70
+ !hideInteractive && /* @__PURE__ */ jsx(HvButton, {
71
+ icon: true,
72
+ title: labels?.interactive,
73
+ onClick: handleInteractive,
74
+ children: isInteractive ? /* @__PURE__ */ jsx(Unlock, {}) : /* @__PURE__ */ jsx(Lock, {})
75
+ }),
76
+ children
77
+ ]
78
+ })
79
+ });
96
80
  };
81
+ //#endregion
82
+ export { HvFlowControls };