@hitachivantara/uikit-react-lab 6.1.9 → 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.
- package/dist/Blade/Blade.js +134 -173
- package/dist/Blade/Blade.styles.js +54 -69
- package/dist/Blades/Blades.js +70 -101
- package/dist/Blades/Blades.styles.js +7 -10
- package/dist/Dashboard/Dashboard.js +57 -60
- package/dist/Dashboard/Dashboard.styles.js +6 -10
- package/dist/Flow/Background/Background.js +10 -16
- package/dist/Flow/Controls/Controls.js +77 -91
- package/dist/Flow/DroppableFlow.js +135 -200
- package/dist/Flow/Empty/Empty.js +12 -9
- package/dist/Flow/Empty/Empty.styles.js +12 -15
- package/dist/Flow/Flow.js +28 -30
- package/dist/Flow/Flow.styles.js +12 -18
- package/dist/Flow/FlowContext/FlowContext.js +22 -23
- package/dist/Flow/FlowContext/NodeMetaContext.js +36 -39
- package/dist/Flow/Minimap/Minimap.js +15 -28
- package/dist/Flow/Minimap/Minimap.styles.js +4 -9
- package/dist/Flow/Node/BaseNode.js +144 -190
- package/dist/Flow/Node/BaseNode.styles.js +122 -133
- package/dist/Flow/Node/Node.js +90 -108
- package/dist/Flow/Node/Node.styles.js +30 -40
- package/dist/Flow/Node/Parameters/ParamRenderer.js +17 -14
- package/dist/Flow/Node/Parameters/Select.js +33 -38
- package/dist/Flow/Node/Parameters/Slider.js +27 -29
- package/dist/Flow/Node/Parameters/Text.js +17 -17
- package/dist/Flow/Node/utils.js +44 -49
- package/dist/Flow/Sidebar/Sidebar.js +115 -137
- package/dist/Flow/Sidebar/Sidebar.styles.js +21 -22
- package/dist/Flow/Sidebar/SidebarGroup/SidebarGroup.js +57 -60
- package/dist/Flow/Sidebar/SidebarGroup/SidebarGroup.styles.js +27 -33
- package/dist/Flow/Sidebar/SidebarGroup/SidebarGroupItem/DraggableSidebarGroupItem.js +27 -47
- package/dist/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.js +14 -32
- package/dist/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.styles.js +17 -23
- package/dist/Flow/base.js +5 -5
- package/dist/Flow/hooks/useFlowContext.js +5 -5
- package/dist/Flow/hooks/useFlowInstance.js +5 -4
- package/dist/Flow/hooks/useFlowNode.js +92 -113
- package/dist/Flow/hooks/useFlowNodeMeta.js +7 -7
- package/dist/Flow/hooks/useNode.js +136 -154
- package/dist/Flow/hooks/useNodeId.js +8 -7
- package/dist/Flow/nodes/DashboardNode.js +64 -86
- package/dist/Flow/nodes/DashboardNode.styles.js +8 -14
- package/dist/Flow/nodes/StickyNode.js +370 -435
- package/dist/StepNavigation/DefaultNavigation/DefaultNavigation.js +36 -52
- package/dist/StepNavigation/DefaultNavigation/Step/Step.js +40 -51
- package/dist/StepNavigation/DefaultNavigation/Step/Step.styles.js +22 -33
- package/dist/StepNavigation/DefaultNavigation/utils.js +38 -30
- package/dist/StepNavigation/SimpleNavigation/Dot/Dot.js +24 -41
- package/dist/StepNavigation/SimpleNavigation/Dot/Dot.styles.js +13 -16
- package/dist/StepNavigation/SimpleNavigation/SimpleNavigation.js +35 -47
- package/dist/StepNavigation/SimpleNavigation/utils.js +10 -11
- package/dist/StepNavigation/StepNavigation.js +136 -179
- package/dist/StepNavigation/StepNavigation.styles.js +29 -32
- package/dist/Wizard/Wizard.js +81 -104
- package/dist/Wizard/Wizard.styles.js +4 -7
- package/dist/Wizard/WizardActions/WizardActions.js +111 -131
- package/dist/Wizard/WizardActions/WizardActions.styles.js +19 -20
- package/dist/Wizard/WizardContainer/WizardContainer.js +19 -28
- package/dist/Wizard/WizardContainer/WizardContainer.styles.js +8 -14
- package/dist/Wizard/WizardContent/WizardContent.js +103 -120
- package/dist/Wizard/WizardContent/WizardContent.styles.js +33 -36
- package/dist/Wizard/WizardContext/WizardContext.js +10 -13
- package/dist/Wizard/WizardTitle/WizardTitle.js +74 -79
- package/dist/Wizard/WizardTitle/WizardTitle.styles.js +12 -15
- package/dist/index.d.ts +1 -1
- package/dist/index.js +30 -81
- package/package.json +6 -6
- package/dist/StepNavigation/utils.js +0 -8
|
@@ -1,54 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { stepSizes, getColor } from "./utils.js";
|
|
1
|
+
import { getColor, stepSizes } from "./utils.js";
|
|
3
2
|
import { HvStep } from "./Step/Step.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
maxWidth,
|
|
38
|
-
getColor,
|
|
39
|
-
height: 1
|
|
40
|
-
},
|
|
41
|
-
stepValues: {
|
|
42
|
-
minSize,
|
|
43
|
-
maxSize,
|
|
44
|
-
StepComponent
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
),
|
|
49
|
-
titles
|
|
50
|
-
] });
|
|
51
|
-
};
|
|
52
|
-
export {
|
|
53
|
-
HvDefaultNavigation
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/StepNavigation/DefaultNavigation/DefaultNavigation.tsx
|
|
5
|
+
var HvDefaultNavigation = ({ numSteps, stepSize, getTitles, getDynamicValues, className, children, ...other }) => {
|
|
6
|
+
const { container: maxSize, avatar: minSize } = stepSizes[stepSize];
|
|
7
|
+
const StepComponent = HvStep;
|
|
8
|
+
const stepsWidth = maxSize + minSize * (numSteps - 1);
|
|
9
|
+
const { width, titleWidth, separatorWidth } = getDynamicValues(stepsWidth);
|
|
10
|
+
const maxWidth = Math.max(titleWidth - minSize, separatorWidth);
|
|
11
|
+
const minWidth = Math.max(titleWidth - (maxSize + minSize) * .5, separatorWidth);
|
|
12
|
+
const Steps = children;
|
|
13
|
+
const titles = getTitles(({ state }) => ({
|
|
14
|
+
variant: "label",
|
|
15
|
+
titleWidth,
|
|
16
|
+
titleDisabled: state === "Disabled"
|
|
17
|
+
}));
|
|
18
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
19
|
+
...other,
|
|
20
|
+
children: [/* @__PURE__ */ jsx(Steps, {
|
|
21
|
+
stepsWidth,
|
|
22
|
+
navWidth: width,
|
|
23
|
+
separatorValues: {
|
|
24
|
+
minWidth,
|
|
25
|
+
maxWidth,
|
|
26
|
+
getColor,
|
|
27
|
+
height: 1
|
|
28
|
+
},
|
|
29
|
+
stepValues: {
|
|
30
|
+
minSize,
|
|
31
|
+
maxSize,
|
|
32
|
+
StepComponent
|
|
33
|
+
}
|
|
34
|
+
}), titles]
|
|
35
|
+
});
|
|
54
36
|
};
|
|
37
|
+
//#endregion
|
|
38
|
+
export { HvDefaultNavigation };
|
|
@@ -1,56 +1,45 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { HvButtonBase, HvAvatar } from "@hitachivantara/uikit-react-core";
|
|
3
|
-
import { Level0Good, Level3Bad, HourGlass } from "@hitachivantara/uikit-react-icons";
|
|
4
1
|
import { getSemantic } from "../utils.js";
|
|
5
2
|
import { useClasses } from "./Step.styles.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
Completed: Level0Good
|
|
3
|
+
import { HvAvatar, HvButtonBase } from "@hitachivantara/uikit-react-core";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { HourGlass, Level0Good, Level3Bad } from "@hitachivantara/uikit-react-icons";
|
|
6
|
+
//#region src/StepNavigation/DefaultNavigation/Step/Step.tsx
|
|
7
|
+
var iconSizeObject = {
|
|
8
|
+
xs: 8,
|
|
9
|
+
sm: 16,
|
|
10
|
+
md: 24,
|
|
11
|
+
lg: 32,
|
|
12
|
+
xl: 40
|
|
17
13
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
title,
|
|
23
|
-
onClick,
|
|
24
|
-
disabled,
|
|
25
|
-
size = "md",
|
|
26
|
-
number = 1
|
|
27
|
-
}) => {
|
|
28
|
-
const { classes, cx } = useClasses(classesProp);
|
|
29
|
-
const color = state === "Pending" ? "bgPage" : getSemantic(state);
|
|
30
|
-
const status = state === "Current" ? "textDisabled" : void 0;
|
|
31
|
-
const IconComponent = iconStateObject[state];
|
|
32
|
-
return /* @__PURE__ */ jsx(
|
|
33
|
-
HvButtonBase,
|
|
34
|
-
{
|
|
35
|
-
className: cx(classes.root, className, {
|
|
36
|
-
[classes.notCurrent]: state !== "Current"
|
|
37
|
-
}),
|
|
38
|
-
"aria-label": title,
|
|
39
|
-
disabled: disabled ?? ["Current", "Disabled"].includes(state),
|
|
40
|
-
onClick,
|
|
41
|
-
children: /* @__PURE__ */ jsx(
|
|
42
|
-
HvAvatar,
|
|
43
|
-
{
|
|
44
|
-
className: cx(classes.avatar, classes[size]),
|
|
45
|
-
backgroundColor: getSemantic(state),
|
|
46
|
-
status,
|
|
47
|
-
size,
|
|
48
|
-
children: IconComponent ? /* @__PURE__ */ jsx(IconComponent, { color, size: iconSizeObject[size] }) : number
|
|
49
|
-
}
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
);
|
|
14
|
+
var iconStateObject = {
|
|
15
|
+
Pending: HourGlass,
|
|
16
|
+
Failed: Level3Bad,
|
|
17
|
+
Completed: Level0Good
|
|
53
18
|
};
|
|
54
|
-
|
|
55
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Step element of "Default" Step Navigation root component
|
|
21
|
+
*/
|
|
22
|
+
var HvStep = ({ className, classes: classesProp, state, title, onClick, disabled, size = "md", number = 1 }) => {
|
|
23
|
+
const { classes, cx } = useClasses(classesProp);
|
|
24
|
+
const color = state === "Pending" ? "bgPage" : getSemantic(state);
|
|
25
|
+
const status = state === "Current" ? "textDisabled" : void 0;
|
|
26
|
+
const IconComponent = iconStateObject[state];
|
|
27
|
+
return /* @__PURE__ */ jsx(HvButtonBase, {
|
|
28
|
+
className: cx(classes.root, className, { [classes.notCurrent]: state !== "Current" }),
|
|
29
|
+
"aria-label": title,
|
|
30
|
+
disabled: disabled ?? ["Current", "Disabled"].includes(state),
|
|
31
|
+
onClick,
|
|
32
|
+
children: /* @__PURE__ */ jsx(HvAvatar, {
|
|
33
|
+
className: cx(classes.avatar, classes[size]),
|
|
34
|
+
backgroundColor: getSemantic(state),
|
|
35
|
+
status,
|
|
36
|
+
size,
|
|
37
|
+
children: IconComponent ? /* @__PURE__ */ jsx(IconComponent, {
|
|
38
|
+
color,
|
|
39
|
+
size: iconSizeObject[size]
|
|
40
|
+
}) : number
|
|
41
|
+
})
|
|
42
|
+
});
|
|
56
43
|
};
|
|
44
|
+
//#endregion
|
|
45
|
+
export { HvStep };
|
|
@@ -1,35 +1,24 @@
|
|
|
1
1
|
import { createClasses, theme } from "@hitachivantara/uikit-react-core";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
fontSize: "1.5rem"
|
|
23
|
-
},
|
|
24
|
-
"&$lg": {
|
|
25
|
-
fontSize: "2rem"
|
|
26
|
-
},
|
|
27
|
-
"&$xl": {
|
|
28
|
-
fontSize: "2.5rem"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
2
|
+
//#region src/StepNavigation/DefaultNavigation/Step/Step.styles.tsx
|
|
3
|
+
var { staticClasses, useClasses } = createClasses("HvStep", {
|
|
4
|
+
root: {
|
|
5
|
+
width: "fit-content",
|
|
6
|
+
height: "fit-content",
|
|
7
|
+
fontWeight: theme.fontWeights.semibold
|
|
8
|
+
},
|
|
9
|
+
notCurrent: { margin: "-8px" },
|
|
10
|
+
xs: {},
|
|
11
|
+
sm: {},
|
|
12
|
+
md: {},
|
|
13
|
+
lg: {},
|
|
14
|
+
xl: {},
|
|
15
|
+
avatar: {
|
|
16
|
+
"&$xs": { fontSize: "0.625rem" },
|
|
17
|
+
"&$sm": { fontSize: "1rem" },
|
|
18
|
+
"&$md": { fontSize: "1.5rem" },
|
|
19
|
+
"&$lg": { fontSize: "2rem" },
|
|
20
|
+
"&$xl": { fontSize: "2.5rem" }
|
|
21
|
+
}
|
|
31
22
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
useClasses
|
|
35
|
-
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { useClasses };
|
|
@@ -1,34 +1,42 @@
|
|
|
1
1
|
import { theme } from "@hitachivantara/uikit-styles";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
//#region src/StepNavigation/DefaultNavigation/utils.ts
|
|
3
|
+
var getColor$1 = (state) => ({
|
|
4
|
+
Pending: theme.colors.warning ?? "warning",
|
|
5
|
+
Failed: theme.colors.negative ?? "negative",
|
|
6
|
+
Completed: theme.colors.positive ?? "positive",
|
|
7
|
+
Current: theme.colors.text ?? "text",
|
|
8
|
+
Disabled: theme.colors.textDisabled ?? "textDisabled",
|
|
9
|
+
Enabled: theme.colors.text ?? "text"
|
|
9
10
|
})[state];
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
var getSemantic = (state) => ({
|
|
12
|
+
Pending: "warning",
|
|
13
|
+
Failed: "negative",
|
|
14
|
+
Completed: "positive",
|
|
15
|
+
Current: "text",
|
|
16
|
+
Disabled: "textDisabled",
|
|
17
|
+
Enabled: "text"
|
|
17
18
|
})[state];
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
19
|
+
var stepSizes = {
|
|
20
|
+
xs: {
|
|
21
|
+
container: 32,
|
|
22
|
+
avatar: 24
|
|
23
|
+
},
|
|
24
|
+
sm: {
|
|
25
|
+
container: 40,
|
|
26
|
+
avatar: 32
|
|
27
|
+
},
|
|
28
|
+
md: {
|
|
29
|
+
container: 48,
|
|
30
|
+
avatar: 40
|
|
31
|
+
},
|
|
32
|
+
lg: {
|
|
33
|
+
container: 60,
|
|
34
|
+
avatar: 52
|
|
35
|
+
},
|
|
36
|
+
xl: {
|
|
37
|
+
container: 96,
|
|
38
|
+
avatar: 88
|
|
39
|
+
}
|
|
34
40
|
};
|
|
41
|
+
//#endregion
|
|
42
|
+
export { getColor$1 as getColor, getSemantic, stepSizes };
|
|
@@ -1,44 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { dotSizes, getColor } from "../utils.js";
|
|
2
|
+
import { useClasses } from "./Dot.styles.js";
|
|
2
3
|
import { HvButton } from "@hitachivantara/uikit-react-core";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
5
|
import { mergeStyles } from "@hitachivantara/uikit-react-utils";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"--dotColor": getColor(state),
|
|
24
|
-
"--dotSize": `${dotSize}px`
|
|
25
|
-
}),
|
|
26
|
-
className: cx(
|
|
27
|
-
classes.root,
|
|
28
|
-
{
|
|
29
|
-
[classes.active]: state === "Current",
|
|
30
|
-
[classes.ghostDisabled]: disabled
|
|
31
|
-
},
|
|
32
|
-
className
|
|
33
|
-
),
|
|
34
|
-
"aria-label": title,
|
|
35
|
-
icon: true,
|
|
36
|
-
disabled,
|
|
37
|
-
onClick
|
|
38
|
-
}
|
|
39
|
-
);
|
|
40
|
-
};
|
|
41
|
-
export {
|
|
42
|
-
HvDot,
|
|
43
|
-
staticClasses as dotClasses
|
|
6
|
+
//#region src/StepNavigation/SimpleNavigation/Dot/Dot.tsx
|
|
7
|
+
var HvDot = ({ classes: classesProp, className, state, title, size = "sm", onClick, disabled: disabledProp }) => {
|
|
8
|
+
const { classes, cx } = useClasses(classesProp);
|
|
9
|
+
const dotSize = dotSizes[size] * (state === "Current" ? 1.5 : 1);
|
|
10
|
+
const disabled = disabledProp ?? ["Current", "Disabled"].includes(state);
|
|
11
|
+
return /* @__PURE__ */ jsx(HvButton, {
|
|
12
|
+
style: mergeStyles(void 0, {
|
|
13
|
+
"--dotColor": getColor(state),
|
|
14
|
+
"--dotSize": `${dotSize}px`
|
|
15
|
+
}),
|
|
16
|
+
className: cx(classes.root, {
|
|
17
|
+
[classes.active]: state === "Current",
|
|
18
|
+
[classes.ghostDisabled]: disabled
|
|
19
|
+
}, className),
|
|
20
|
+
"aria-label": title,
|
|
21
|
+
icon: true,
|
|
22
|
+
disabled,
|
|
23
|
+
onClick
|
|
24
|
+
});
|
|
44
25
|
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { HvDot };
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { createClasses, theme } from "@hitachivantara/uikit-react-core";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
ghostDisabled: {}
|
|
2
|
+
//#region src/StepNavigation/SimpleNavigation/Dot/Dot.styles.tsx
|
|
3
|
+
var { staticClasses, useClasses } = createClasses("HvDot", {
|
|
4
|
+
root: {
|
|
5
|
+
borderRadius: theme.radii.full,
|
|
6
|
+
zIndex: 1,
|
|
7
|
+
width: "var(--dotSize)",
|
|
8
|
+
height: "var(--dotSize)",
|
|
9
|
+
"&,:hover,:disabled": { backgroundColor: "var(--dotColor)" }
|
|
10
|
+
},
|
|
11
|
+
active: {},
|
|
12
|
+
ghostDisabled: {}
|
|
14
13
|
});
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
useClasses
|
|
18
|
-
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { useClasses };
|
|
@@ -1,50 +1,38 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
1
|
import { dotSizes, getColor } from "./utils.js";
|
|
3
2
|
import { HvDot } from "./Dot/Dot.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
stepValues: {
|
|
39
|
-
minSize: dotSize,
|
|
40
|
-
maxSize: 1.5 * dotSize,
|
|
41
|
-
StepComponent
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
)
|
|
46
|
-
] });
|
|
47
|
-
};
|
|
48
|
-
export {
|
|
49
|
-
HvSimpleNavigation
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/StepNavigation/SimpleNavigation/SimpleNavigation.tsx
|
|
5
|
+
var HvSimpleNavigation = ({ numSteps, stepSize = "sm", getTitles, getDynamicValues, children, ...others }) => {
|
|
6
|
+
const dotSize = dotSizes[stepSize];
|
|
7
|
+
const StepComponent = HvDot;
|
|
8
|
+
const stepsWidth = (numSteps + .5) * dotSize;
|
|
9
|
+
const { width, titleWidth, separatorWidth } = getDynamicValues(stepsWidth);
|
|
10
|
+
const maxWidth = Math.max(titleWidth - dotSize, separatorWidth);
|
|
11
|
+
const minWidth = Math.max(titleWidth - dotSize * 1.25, separatorWidth);
|
|
12
|
+
const Steps = children;
|
|
13
|
+
const titles = getTitles(({ rawTitle, number }) => ({
|
|
14
|
+
variant: "label",
|
|
15
|
+
title: `${number}. ${rawTitle}`,
|
|
16
|
+
titleWidth
|
|
17
|
+
}));
|
|
18
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
19
|
+
...others,
|
|
20
|
+
children: [titles, /* @__PURE__ */ jsx(Steps, {
|
|
21
|
+
stepsWidth,
|
|
22
|
+
navWidth: width,
|
|
23
|
+
separatorValues: {
|
|
24
|
+
minWidth,
|
|
25
|
+
maxWidth,
|
|
26
|
+
getColor,
|
|
27
|
+
height: 1
|
|
28
|
+
},
|
|
29
|
+
stepValues: {
|
|
30
|
+
minSize: dotSize,
|
|
31
|
+
maxSize: 1.5 * dotSize,
|
|
32
|
+
StepComponent
|
|
33
|
+
}
|
|
34
|
+
})]
|
|
35
|
+
});
|
|
50
36
|
};
|
|
37
|
+
//#endregion
|
|
38
|
+
export { HvSimpleNavigation };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { theme } from "@hitachivantara/uikit-styles";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const getColor = (state) => state === "Disabled" ? theme.colors.textDisabled : theme.colors.text;
|
|
10
|
-
export {
|
|
11
|
-
dotSizes,
|
|
12
|
-
getColor
|
|
2
|
+
//#region src/StepNavigation/SimpleNavigation/utils.ts
|
|
3
|
+
var dotSizes = {
|
|
4
|
+
xs: 8,
|
|
5
|
+
sm: 10,
|
|
6
|
+
md: 12,
|
|
7
|
+
lg: 14,
|
|
8
|
+
xl: 16
|
|
13
9
|
};
|
|
10
|
+
var getColor$1 = (state) => state === "Disabled" ? theme.colors.textDisabled : theme.colors.text;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { dotSizes, getColor$1 as getColor };
|