@hitachivantara/uikit-react-lab 5.5.1 → 5.5.3
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/cjs/components/Flow/Background/Background.cjs +2 -5
- package/dist/cjs/components/Flow/Background/Background.cjs.map +1 -1
- package/dist/cjs/components/Flow/Controls/Controls.cjs +8 -41
- package/dist/cjs/components/Flow/Controls/Controls.cjs.map +1 -1
- package/dist/cjs/components/Flow/DroppableFlow.cjs +2 -16
- package/dist/cjs/components/Flow/DroppableFlow.cjs.map +1 -1
- package/dist/cjs/components/Flow/Flow.cjs +6 -23
- package/dist/cjs/components/Flow/Flow.cjs.map +1 -1
- package/dist/cjs/components/Flow/FlowContext/FlowContext.cjs +2 -5
- package/dist/cjs/components/Flow/FlowContext/FlowContext.cjs.map +1 -1
- package/dist/cjs/components/Flow/Minimap/Minimap.cjs +2 -9
- package/dist/cjs/components/Flow/Minimap/Minimap.cjs.map +1 -1
- package/dist/cjs/components/Flow/Sidebar/Sidebar.cjs +20 -54
- package/dist/cjs/components/Flow/Sidebar/Sidebar.cjs.map +1 -1
- package/dist/cjs/components/Flow/Sidebar/SidebarGroup/SidebarGroup.cjs +14 -41
- package/dist/cjs/components/Flow/Sidebar/SidebarGroup/SidebarGroup.cjs.map +1 -1
- package/dist/cjs/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/DraggableSidebarGroupItem.cjs +2 -10
- package/dist/cjs/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/DraggableSidebarGroupItem.cjs.map +1 -1
- package/dist/cjs/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.cjs +7 -13
- package/dist/cjs/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.cjs.map +1 -1
- package/dist/cjs/components/StepNavigation/DefaultNavigation/DefaultNavigation.cjs +6 -6
- package/dist/cjs/components/StepNavigation/DefaultNavigation/DefaultNavigation.cjs.map +1 -1
- package/dist/cjs/components/StepNavigation/DefaultNavigation/Step/Step.cjs +6 -29
- package/dist/cjs/components/StepNavigation/DefaultNavigation/Step/Step.cjs.map +1 -1
- package/dist/cjs/components/StepNavigation/SimpleNavigation/Dot/Dot.cjs +12 -20
- package/dist/cjs/components/StepNavigation/SimpleNavigation/Dot/Dot.cjs.map +1 -1
- package/dist/cjs/components/StepNavigation/SimpleNavigation/SimpleNavigation.cjs +6 -6
- package/dist/cjs/components/StepNavigation/SimpleNavigation/SimpleNavigation.cjs.map +1 -1
- package/dist/cjs/components/StepNavigation/StepNavigation.cjs +37 -87
- package/dist/cjs/components/StepNavigation/StepNavigation.cjs.map +1 -1
- package/dist/cjs/components/Wizard/Wizard.cjs +8 -30
- package/dist/cjs/components/Wizard/Wizard.cjs.map +1 -1
- package/dist/cjs/components/Wizard/WizardActions/WizardActions.cjs +12 -45
- package/dist/cjs/components/Wizard/WizardActions/WizardActions.cjs.map +1 -1
- package/dist/cjs/components/Wizard/WizardContainer/WizardContainer.cjs +5 -13
- package/dist/cjs/components/Wizard/WizardContainer/WizardContainer.cjs.map +1 -1
- package/dist/cjs/components/Wizard/WizardContent/LoadingContainer.cjs +16 -26
- package/dist/cjs/components/Wizard/WizardContent/LoadingContainer.cjs.map +1 -1
- package/dist/cjs/components/Wizard/WizardContent/WizardContent.cjs +23 -38
- package/dist/cjs/components/Wizard/WizardContent/WizardContent.cjs.map +1 -1
- package/dist/cjs/components/Wizard/WizardTitle/WizardTitle.cjs +16 -37
- package/dist/cjs/components/Wizard/WizardTitle/WizardTitle.cjs.map +1 -1
- package/dist/esm/components/Flow/Background/Background.js +2 -5
- package/dist/esm/components/Flow/Background/Background.js.map +1 -1
- package/dist/esm/components/Flow/Controls/Controls.js +8 -41
- package/dist/esm/components/Flow/Controls/Controls.js.map +1 -1
- package/dist/esm/components/Flow/DroppableFlow.js +2 -16
- package/dist/esm/components/Flow/DroppableFlow.js.map +1 -1
- package/dist/esm/components/Flow/Flow.js +6 -23
- package/dist/esm/components/Flow/Flow.js.map +1 -1
- package/dist/esm/components/Flow/FlowContext/FlowContext.js +2 -5
- package/dist/esm/components/Flow/FlowContext/FlowContext.js.map +1 -1
- package/dist/esm/components/Flow/Minimap/Minimap.js +2 -9
- package/dist/esm/components/Flow/Minimap/Minimap.js.map +1 -1
- package/dist/esm/components/Flow/Sidebar/Sidebar.js +20 -54
- package/dist/esm/components/Flow/Sidebar/Sidebar.js.map +1 -1
- package/dist/esm/components/Flow/Sidebar/SidebarGroup/SidebarGroup.js +14 -41
- package/dist/esm/components/Flow/Sidebar/SidebarGroup/SidebarGroup.js.map +1 -1
- package/dist/esm/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/DraggableSidebarGroupItem.js +2 -10
- package/dist/esm/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/DraggableSidebarGroupItem.js.map +1 -1
- package/dist/esm/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.js +7 -13
- package/dist/esm/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.js.map +1 -1
- package/dist/esm/components/StepNavigation/DefaultNavigation/DefaultNavigation.js +6 -6
- package/dist/esm/components/StepNavigation/DefaultNavigation/DefaultNavigation.js.map +1 -1
- package/dist/esm/components/StepNavigation/DefaultNavigation/Step/Step.js +6 -29
- package/dist/esm/components/StepNavigation/DefaultNavigation/Step/Step.js.map +1 -1
- package/dist/esm/components/StepNavigation/SimpleNavigation/Dot/Dot.js +12 -20
- package/dist/esm/components/StepNavigation/SimpleNavigation/Dot/Dot.js.map +1 -1
- package/dist/esm/components/StepNavigation/SimpleNavigation/SimpleNavigation.js +6 -6
- package/dist/esm/components/StepNavigation/SimpleNavigation/SimpleNavigation.js.map +1 -1
- package/dist/esm/components/StepNavigation/StepNavigation.js +37 -87
- package/dist/esm/components/StepNavigation/StepNavigation.js.map +1 -1
- package/dist/esm/components/Wizard/Wizard.js +8 -30
- package/dist/esm/components/Wizard/Wizard.js.map +1 -1
- package/dist/esm/components/Wizard/WizardActions/WizardActions.js +12 -45
- package/dist/esm/components/Wizard/WizardActions/WizardActions.js.map +1 -1
- package/dist/esm/components/Wizard/WizardContainer/WizardContainer.js +5 -13
- package/dist/esm/components/Wizard/WizardContainer/WizardContainer.js.map +1 -1
- package/dist/esm/components/Wizard/WizardContent/LoadingContainer.js +16 -26
- package/dist/esm/components/Wizard/WizardContent/LoadingContainer.js.map +1 -1
- package/dist/esm/components/Wizard/WizardContent/WizardContent.js +23 -38
- package/dist/esm/components/Wizard/WizardContent/WizardContent.js.map +1 -1
- package/dist/esm/components/Wizard/WizardTitle/WizardTitle.js +16 -37
- package/dist/esm/components/Wizard/WizardTitle/WizardTitle.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarGroup.cjs","sources":["../../../../../../src/components/Flow/Sidebar/SidebarGroup/SidebarGroup.tsx"],"sourcesContent":["import { useCallback, useMemo } from \"react\";\n\nimport { Down, Up } from \"@hitachivantara/uikit-react-icons\";\nimport {\n ExtractNames,\n HvButton,\n HvButtonProps,\n HvTypography,\n} from \"@hitachivantara/uikit-react-core\";\nimport { getColor } from \"@hitachivantara/uikit-styles\";\n\nimport { HvFlowNodeGroup } from \"../../types\";\nimport { staticClasses, useClasses } from \"./SidebarGroup.styles\";\nimport {\n HvFlowDraggableSidebarGroupItem,\n HvFlowDraggableSidebarGroupItemProps,\n} from \"./SidebarGroupItem\";\nimport { useFlowContext } from \"../../FlowContext\";\n\nexport { staticClasses as flowSidebarGroupClasses };\n\nexport type HvFlowSidebarGroupClasses = ExtractNames<typeof useClasses>;\n\nexport type HvFlowSidebarGroupNodes = {\n id: string;\n label: string;\n}[];\n\nexport interface HvFlowSidebarGroupProps extends HvFlowNodeGroup {\n /** Group id. */\n id: string;\n /** Group nodes. */\n nodes: HvFlowSidebarGroupNodes;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvFlowSidebarGroupClasses;\n /** Expand button props. */\n expandButtonProps?: HvButtonProps;\n /** Item group props. */\n itemProps?: Partial<HvFlowDraggableSidebarGroupItemProps>;\n}\n\nexport const HvFlowSidebarGroup = ({\n id,\n label,\n nodes,\n color,\n description,\n icon,\n expandButtonProps,\n classes: classesProp,\n itemProps,\n}: HvFlowSidebarGroupProps) => {\n const { classes, cx, css } = useClasses(classesProp);\n\n const { expandedNodeGroups, setExpandedNodeGroups } = useFlowContext();\n\n const opened = useMemo(\n () => !!expandedNodeGroups?.find((groupId) => groupId === id),\n [expandedNodeGroups, id]\n );\n\n const handleClick = useCallback(() => {\n setExpandedNodeGroups?.((prev) =>\n opened ? prev.filter((groupId) => id !== groupId) : [...prev, id]\n );\n }, [id, opened, setExpandedNodeGroups]);\n\n return (\n <li className={cx(css({ borderColor: getColor(color) }), classes.root)}>\n <div className={classes.titleContainer}>\n <div className={classes.labelContainer}>\n <div className={classes.icon} role=\"none\">\n {icon}\n </div>\n <HvTypography variant=\"title4\">\n {nodes.length > 1 ? `${label} (${nodes.length})` : label}\n </HvTypography>\n </div>\n <HvButton\n icon\n onClick={handleClick}\n aria-expanded={opened}\n {...expandButtonProps}\n >\n {opened ? <Up role=\"none\" /> : <Down role=\"none\" />}\n </HvButton>\n </div>\n {description && (\n <div className={classes.descriptionContainer}>\n <HvTypography>{description}</HvTypography>\n </div>\n )}\n {opened && (\n <div className={classes.itemsContainer}>\n {nodes.map((obj) => (\n <HvFlowDraggableSidebarGroupItem\n key={obj.id}\n {...itemProps}\n {...obj}\n />\n ))}\n </div>\n )}\n </li>\n );\n};\n"],"names":["HvFlowSidebarGroup","id","label","nodes","color","description","icon","expandButtonProps","classes","classesProp","itemProps","cx","css","useClasses","expandedNodeGroups","setExpandedNodeGroups","useFlowContext","opened","useMemo","find","groupId","handleClick","useCallback","prev","filter","
|
|
1
|
+
{"version":3,"file":"SidebarGroup.cjs","sources":["../../../../../../src/components/Flow/Sidebar/SidebarGroup/SidebarGroup.tsx"],"sourcesContent":["import { useCallback, useMemo } from \"react\";\n\nimport { Down, Up } from \"@hitachivantara/uikit-react-icons\";\nimport {\n ExtractNames,\n HvButton,\n HvButtonProps,\n HvTypography,\n} from \"@hitachivantara/uikit-react-core\";\nimport { getColor } from \"@hitachivantara/uikit-styles\";\n\nimport { HvFlowNodeGroup } from \"../../types\";\nimport { staticClasses, useClasses } from \"./SidebarGroup.styles\";\nimport {\n HvFlowDraggableSidebarGroupItem,\n HvFlowDraggableSidebarGroupItemProps,\n} from \"./SidebarGroupItem\";\nimport { useFlowContext } from \"../../FlowContext\";\n\nexport { staticClasses as flowSidebarGroupClasses };\n\nexport type HvFlowSidebarGroupClasses = ExtractNames<typeof useClasses>;\n\nexport type HvFlowSidebarGroupNodes = {\n id: string;\n label: string;\n}[];\n\nexport interface HvFlowSidebarGroupProps extends HvFlowNodeGroup {\n /** Group id. */\n id: string;\n /** Group nodes. */\n nodes: HvFlowSidebarGroupNodes;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvFlowSidebarGroupClasses;\n /** Expand button props. */\n expandButtonProps?: HvButtonProps;\n /** Item group props. */\n itemProps?: Partial<HvFlowDraggableSidebarGroupItemProps>;\n}\n\nexport const HvFlowSidebarGroup = ({\n id,\n label,\n nodes,\n color,\n description,\n icon,\n expandButtonProps,\n classes: classesProp,\n itemProps,\n}: HvFlowSidebarGroupProps) => {\n const { classes, cx, css } = useClasses(classesProp);\n\n const { expandedNodeGroups, setExpandedNodeGroups } = useFlowContext();\n\n const opened = useMemo(\n () => !!expandedNodeGroups?.find((groupId) => groupId === id),\n [expandedNodeGroups, id]\n );\n\n const handleClick = useCallback(() => {\n setExpandedNodeGroups?.((prev) =>\n opened ? prev.filter((groupId) => id !== groupId) : [...prev, id]\n );\n }, [id, opened, setExpandedNodeGroups]);\n\n return (\n <li className={cx(css({ borderColor: getColor(color) }), classes.root)}>\n <div className={classes.titleContainer}>\n <div className={classes.labelContainer}>\n <div className={classes.icon} role=\"none\">\n {icon}\n </div>\n <HvTypography variant=\"title4\">\n {nodes.length > 1 ? `${label} (${nodes.length})` : label}\n </HvTypography>\n </div>\n <HvButton\n icon\n onClick={handleClick}\n aria-expanded={opened}\n {...expandButtonProps}\n >\n {opened ? <Up role=\"none\" /> : <Down role=\"none\" />}\n </HvButton>\n </div>\n {description && (\n <div className={classes.descriptionContainer}>\n <HvTypography>{description}</HvTypography>\n </div>\n )}\n {opened && (\n <div className={classes.itemsContainer}>\n {nodes.map((obj) => (\n <HvFlowDraggableSidebarGroupItem\n key={obj.id}\n {...itemProps}\n {...obj}\n />\n ))}\n </div>\n )}\n </li>\n );\n};\n"],"names":["HvFlowSidebarGroup","id","label","nodes","color","description","icon","expandButtonProps","classes","classesProp","itemProps","cx","css","useClasses","expandedNodeGroups","setExpandedNodeGroups","useFlowContext","opened","useMemo","find","groupId","handleClick","useCallback","prev","filter","jsxs","borderColor","getColor","root","titleContainer","labelContainer","jsx","HvTypography","length","HvButton","Up","Down","descriptionContainer","itemsContainer","map","obj","HvFlowDraggableSidebarGroupItem"],"mappings":";;;;;;;;;;AAyCO,MAAMA,qBAAqBA,CAAC;AAAA,EACjCC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,SAASC;AAAAA,EACTC;AACuB,MAAM;AACvB,QAAA;AAAA,IAAEF;AAAAA,IAASG;AAAAA,IAAIC;AAAAA,EAAAA,IAAQC,oBAAAA,WAAWJ,WAAW;AAE7C,QAAA;AAAA,IAAEK;AAAAA,IAAoBC;AAAAA,MAA0BC,YAAe,eAAA;AAErE,QAAMC,SAASC,MAAAA,QACb,MAAM,CAAC,EAACJ,yDAAoBK,KAAMC,CAAYA,YAAAA,YAAYnB,MAC1D,CAACa,oBAAoBb,EAAE,CACzB;AAEMoB,QAAAA,cAAcC,MAAAA,YAAY,MAAM;AACpCP,mEAAyBQ,CACvBN,SAAAA,SAASM,KAAKC,OAAQJ,CAAYnB,YAAAA,OAAOmB,OAAO,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js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
3
4
|
const material = require("@mui/material");
|
|
4
5
|
const React = require("react");
|
|
5
6
|
const core = require("@dnd-kit/core");
|
|
6
7
|
const SidebarGroupItem = require("./SidebarGroupItem.cjs");
|
|
7
|
-
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
8
8
|
const HvFlowDraggableSidebarGroupItem = ({
|
|
9
9
|
label,
|
|
10
10
|
id,
|
|
@@ -34,15 +34,7 @@ const HvFlowDraggableSidebarGroupItem = ({
|
|
|
34
34
|
const style = transform ? {
|
|
35
35
|
transform: `translate3d(${transform.x}px, ${transform.y}px, 0)`
|
|
36
36
|
} : void 0;
|
|
37
|
-
return /* @__PURE__ */ jsxRuntime.jsx(SidebarGroupItem.HvFlowSidebarGroupItem, {
|
|
38
|
-
ref: forkedRef,
|
|
39
|
-
style,
|
|
40
|
-
label,
|
|
41
|
-
isDragging,
|
|
42
|
-
...listeners,
|
|
43
|
-
...attributes,
|
|
44
|
-
...others
|
|
45
|
-
});
|
|
37
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SidebarGroupItem.HvFlowSidebarGroupItem, { ref: forkedRef, style, label, isDragging, ...listeners, ...attributes, ...others });
|
|
46
38
|
};
|
|
47
39
|
exports.HvFlowDraggableSidebarGroupItem = HvFlowDraggableSidebarGroupItem;
|
|
48
40
|
//# sourceMappingURL=DraggableSidebarGroupItem.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DraggableSidebarGroupItem.cjs","sources":["../../../../../../../src/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/DraggableSidebarGroupItem.tsx"],"sourcesContent":["import { useForkRef } from \"@mui/material\";\n\nimport { useRef } from \"react\";\n\nimport { useDraggable } from \"@dnd-kit/core\";\n\nimport {\n HvFlowSidebarGroupItem,\n HvFlowSidebarGroupItemProps,\n} from \"./SidebarGroupItem\";\n\nexport interface HvFlowDraggableSidebarGroupItemProps\n extends HvFlowSidebarGroupItemProps {\n /** Item id: the item type. */\n id: string;\n}\n\nexport const HvFlowDraggableSidebarGroupItem = ({\n label,\n id,\n ...others\n}: HvFlowDraggableSidebarGroupItemProps) => {\n const itemRef = useRef<HTMLElement>(null);\n\n const { attributes, listeners, setNodeRef, isDragging, transform } =\n useDraggable({\n id,\n data: {\n hvFlow: {\n // Needed for the drag overlay: otherwise the item is cut by the drawer because of overflow\n label,\n // Item position: used to position the item when dropped\n x: itemRef.current?.getBoundingClientRect().x,\n y: itemRef.current?.getBoundingClientRect().y,\n },\n },\n });\n\n const forkedRef = useForkRef(itemRef, setNodeRef);\n\n const style = transform\n ? {\n transform: `translate3d(${transform.x}px, ${transform.y}px, 0)`,\n }\n : undefined;\n\n return (\n <HvFlowSidebarGroupItem\n ref={forkedRef}\n style={style}\n label={label}\n isDragging={isDragging}\n {...listeners}\n {...attributes}\n {...others}\n />\n );\n};\n"],"names":["HvFlowDraggableSidebarGroupItem","label","id","others","itemRef","useRef","attributes","listeners","setNodeRef","isDragging","transform","useDraggable","data","hvFlow","x","current","getBoundingClientRect","y","forkedRef","useForkRef","style","undefined","
|
|
1
|
+
{"version":3,"file":"DraggableSidebarGroupItem.cjs","sources":["../../../../../../../src/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/DraggableSidebarGroupItem.tsx"],"sourcesContent":["import { useForkRef } from \"@mui/material\";\n\nimport { useRef } from \"react\";\n\nimport { useDraggable } from \"@dnd-kit/core\";\n\nimport {\n HvFlowSidebarGroupItem,\n HvFlowSidebarGroupItemProps,\n} from \"./SidebarGroupItem\";\n\nexport interface HvFlowDraggableSidebarGroupItemProps\n extends HvFlowSidebarGroupItemProps {\n /** Item id: the item type. */\n id: string;\n}\n\nexport const HvFlowDraggableSidebarGroupItem = ({\n label,\n id,\n ...others\n}: HvFlowDraggableSidebarGroupItemProps) => {\n const itemRef = useRef<HTMLElement>(null);\n\n const { attributes, listeners, setNodeRef, isDragging, transform } =\n useDraggable({\n id,\n data: {\n hvFlow: {\n // Needed for the drag overlay: otherwise the item is cut by the drawer because of overflow\n label,\n // Item position: used to position the item when dropped\n x: itemRef.current?.getBoundingClientRect().x,\n y: itemRef.current?.getBoundingClientRect().y,\n },\n },\n });\n\n const forkedRef = useForkRef(itemRef, setNodeRef);\n\n const style = transform\n ? {\n transform: `translate3d(${transform.x}px, ${transform.y}px, 0)`,\n }\n : undefined;\n\n return (\n <HvFlowSidebarGroupItem\n ref={forkedRef}\n style={style}\n label={label}\n isDragging={isDragging}\n {...listeners}\n {...attributes}\n {...others}\n />\n );\n};\n"],"names":["HvFlowDraggableSidebarGroupItem","label","id","others","itemRef","useRef","attributes","listeners","setNodeRef","isDragging","transform","useDraggable","data","hvFlow","x","current","getBoundingClientRect","y","forkedRef","useForkRef","style","undefined","jsx","HvFlowSidebarGroupItem"],"mappings":";;;;;;;AAiBO,MAAMA,kCAAkCA,CAAC;AAAA,EAC9CC;AAAAA,EACAC;AAAAA,EACA,GAAGC;AACiC,MAAM;;AACpCC,QAAAA,UAAUC,aAAoB,IAAI;AAElC,QAAA;AAAA,IAAEC;AAAAA,IAAYC;AAAAA,IAAWC;AAAAA,IAAYC;AAAAA,IAAYC;AAAAA,MACrDC,kBAAa;AAAA,IACXT;AAAAA,IACAU,MAAM;AAAA,MACJC,QAAQ;AAAA;AAAA,QAENZ;AAAAA;AAAAA,QAEAa,IAAGV,aAAQW,YAARX,mBAAiBY,wBAAwBF;AAAAA,QAC5CG,IAAGb,aAAQW,YAARX,mBAAiBY,wBAAwBC;AAAAA,MAC9C;AAAA,IACF;AAAA,EAAA,CACD;AAEGC,QAAAA,YAAYC,SAAAA,WAAWf,SAASI,UAAU;AAEhD,QAAMY,QAAQV,YACV;AAAA,IACEA,WAAY,eAAcA,UAAUI,CAAE,OAAMJ,UAAUO,CAAE;AAAA,EAE1DI,IAAAA;AAEJ,SACGC,2BAAA,IAAAC,iBAAA,wBAAA,EACC,KAAKL,WACL,OACA,OACA,YACIX,GAAAA,cACAD,YACAH,GAAAA,OACJ,CAAA;AAEN;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
3
4
|
const React = require("react");
|
|
4
5
|
const uikitReactCore = require("@hitachivantara/uikit-react-core");
|
|
5
6
|
const uikitReactIcons = require("@hitachivantara/uikit-react-icons");
|
|
6
7
|
const SidebarGroupItem_styles = require("./SidebarGroupItem.styles.cjs");
|
|
7
|
-
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
8
8
|
const HvFlowSidebarGroupItem = React.forwardRef(({
|
|
9
9
|
label,
|
|
10
10
|
isDragging,
|
|
@@ -16,18 +16,12 @@ const HvFlowSidebarGroupItem = React.forwardRef(({
|
|
|
16
16
|
classes,
|
|
17
17
|
cx
|
|
18
18
|
} = SidebarGroupItem_styles.useClasses(classesProp);
|
|
19
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
children: [/* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvTypography, {
|
|
26
|
-
children: label
|
|
27
|
-
}), /* @__PURE__ */ jsxRuntime.jsx(uikitReactIcons.Drag, {
|
|
28
|
-
role: "none"
|
|
29
|
-
})]
|
|
30
|
-
});
|
|
19
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cx(classes.root, {
|
|
20
|
+
[classes.dragging]: isDragging
|
|
21
|
+
}, className), ...others, children: [
|
|
22
|
+
/* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvTypography, { children: label }),
|
|
23
|
+
/* @__PURE__ */ jsxRuntime.jsx(uikitReactIcons.Drag, { role: "none" })
|
|
24
|
+
] });
|
|
31
25
|
});
|
|
32
26
|
exports.flowSidebarGroupItemClasses = SidebarGroupItem_styles.staticClasses;
|
|
33
27
|
exports.HvFlowSidebarGroupItem = HvFlowSidebarGroupItem;
|
package/dist/cjs/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarGroupItem.cjs","sources":["../../../../../../../src/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n\nimport {\n ExtractNames,\n HvBaseProps,\n HvTypography,\n} from \"@hitachivantara/uikit-react-core\";\nimport { Drag } from \"@hitachivantara/uikit-react-icons\";\n\nimport { staticClasses, useClasses } from \"./SidebarGroupItem.styles\";\n\nexport { staticClasses as flowSidebarGroupItemClasses };\n\nexport type HvFlowSidebarGroupItemClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvFlowSidebarGroupItemProps extends HvBaseProps {\n /** Item label. */\n label: string;\n /** Whether the item is being dragged. */\n isDragging?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvFlowSidebarGroupItemClasses;\n}\n\nexport const HvFlowSidebarGroupItem = forwardRef<\n HTMLDivElement,\n HvFlowSidebarGroupItemProps\n>(\n (\n {\n label,\n isDragging,\n classes: classesProp,\n className,\n ...others\n }: HvFlowSidebarGroupItemProps,\n ref\n ) => {\n const { classes, cx } = useClasses(classesProp);\n\n return (\n <div\n ref={ref}\n className={cx(\n classes.root,\n { [classes.dragging]: isDragging },\n className\n )}\n {...others}\n >\n <HvTypography>{label}</HvTypography>\n <Drag role=\"none\" />\n </div>\n );\n }\n);\n"],"names":["HvFlowSidebarGroupItem","forwardRef","label","isDragging","classes","classesProp","className","others","ref","cx","useClasses","root","dragging","
|
|
1
|
+
{"version":3,"file":"SidebarGroupItem.cjs","sources":["../../../../../../../src/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n\nimport {\n ExtractNames,\n HvBaseProps,\n HvTypography,\n} from \"@hitachivantara/uikit-react-core\";\nimport { Drag } from \"@hitachivantara/uikit-react-icons\";\n\nimport { staticClasses, useClasses } from \"./SidebarGroupItem.styles\";\n\nexport { staticClasses as flowSidebarGroupItemClasses };\n\nexport type HvFlowSidebarGroupItemClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvFlowSidebarGroupItemProps extends HvBaseProps {\n /** Item label. */\n label: string;\n /** Whether the item is being dragged. */\n isDragging?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvFlowSidebarGroupItemClasses;\n}\n\nexport const HvFlowSidebarGroupItem = forwardRef<\n HTMLDivElement,\n HvFlowSidebarGroupItemProps\n>(\n (\n {\n label,\n isDragging,\n classes: classesProp,\n className,\n ...others\n }: HvFlowSidebarGroupItemProps,\n ref\n ) => {\n const { classes, cx } = useClasses(classesProp);\n\n return (\n <div\n ref={ref}\n className={cx(\n classes.root,\n { [classes.dragging]: isDragging },\n className\n )}\n {...others}\n >\n <HvTypography>{label}</HvTypography>\n <Drag role=\"none\" />\n </div>\n );\n }\n);\n"],"names":["HvFlowSidebarGroupItem","forwardRef","label","isDragging","classes","classesProp","className","others","ref","cx","useClasses","root","dragging","jsx","HvTypography","Drag"],"mappings":";;;;;;;AAwBaA,MAAAA,yBAAyBC,iBAIpC,CACE;AAAA,EACEC;AAAAA,EACAC;AAAAA,EACAC,SAASC;AAAAA,EACTC;AAAAA,EACA,GAAGC;AACwB,GAC7BC,QACG;AACG,QAAA;AAAA,IAAEJ;AAAAA,IAASK;AAAAA,EAAAA,IAAOC,wBAAAA,WAAWL,WAAW;AAE9C,yCACG,OACC,EAAA,KACA,WAAWI,GACTL,QAAQO,MACR;AAAA,IAAE,CAACP,QAAQQ,QAAQ,GAAGT;AAAAA,EACtBG,GAAAA,SACF,GACA,GAAIC,QAEJ,UAAA;AAAA,IAAAM,2BAAAA,IAACC,+BAAcZ,UAAM,MAAA,CAAA;AAAA,IACrBW,2BAAAA,IAACE,gBAAK,MAAA,EAAA,MAAK,OAAM,CAAA;AAAA,EACnB,EAAA,CAAA;AAEJ,CACF;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
3
4
|
const uikitReactCore = require("@hitachivantara/uikit-react-core");
|
|
4
5
|
const utils = require("./utils.cjs");
|
|
5
|
-
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
6
6
|
const Step = require("./Step/Step.cjs");
|
|
7
7
|
const HvDefaultNavigation = ({
|
|
8
8
|
numSteps,
|
|
@@ -37,9 +37,8 @@ const HvDefaultNavigation = ({
|
|
|
37
37
|
titleWidth,
|
|
38
38
|
titleDisabled: state === "Disabled"
|
|
39
39
|
}));
|
|
40
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
41
|
-
...
|
|
42
|
-
children: [/* @__PURE__ */ jsxRuntime.jsx(Steps, {
|
|
40
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ...other, children: [
|
|
41
|
+
/* @__PURE__ */ jsxRuntime.jsx(Steps, { ...{
|
|
43
42
|
stepsWidth,
|
|
44
43
|
navWidth: width,
|
|
45
44
|
separatorValues: {
|
|
@@ -53,8 +52,9 @@ const HvDefaultNavigation = ({
|
|
|
53
52
|
maxSize,
|
|
54
53
|
StepComponent
|
|
55
54
|
}
|
|
56
|
-
}),
|
|
57
|
-
|
|
55
|
+
} }),
|
|
56
|
+
titles
|
|
57
|
+
] });
|
|
58
58
|
};
|
|
59
59
|
exports.HvDefaultNavigation = HvDefaultNavigation;
|
|
60
60
|
//# sourceMappingURL=DefaultNavigation.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultNavigation.cjs","sources":["../../../../../src/components/StepNavigation/DefaultNavigation/DefaultNavigation.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\nimport {\n HvBaseProps,\n HvTheme,\n useTheme,\n} from \"@hitachivantara/uikit-react-core\";\n\nimport { HvStep, HvStepProps } from \"./Step\";\nimport { getColor, stepSizes } from \"./utils\";\n\nexport type ComponentChildProps = {\n stepsWidth: number;\n navWidth: number;\n separatorValues: {\n minWidth: number;\n maxWidth: number;\n getColor: (state: HvStepProps[\"state\"], activeTheme: HvTheme) => any;\n height: number;\n };\n stepValues: {\n minSize: number;\n maxSize: number;\n StepComponent: React.ComponentType<HvStepProps>;\n };\n};\n\nexport interface HvDefaultNavigationProps\n extends Omit<HvBaseProps, \"children\"> {\n /** Number of steps to show on the component. */\n numSteps: number;\n /** Sets one of the standard sizes of the steps. */\n stepSize: \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n /** Returns a `ReactNode` of the titles container. */\n getTitles: (\n getTitleProps?: (params: {\n state: HvStepProps[\"state\"];\n rawTitle: string;\n number: number;\n }) => { variant?: string; title?: string }\n ) => ReactNode;\n /** Returns dynamic width values of the component (width, titleWidth, separatorWidth). */\n getDynamicValues: (stepsWidth: number) => {\n width: number;\n titleWidth: number;\n separatorWidth: number;\n };\n /** Component to render Step Navigation with props = {separatorValues, stepValues, stepsWidth} */\n children: React.FunctionComponent<ComponentChildProps>;\n}\n\nexport const HvDefaultNavigation = ({\n numSteps,\n stepSize,\n getTitles,\n getDynamicValues,\n className,\n children,\n ...other\n}: HvDefaultNavigationProps) => {\n const { activeTheme } = useTheme();\n\n // step values\n const { container: maxSize, avatar: minSize } = stepSizes[stepSize];\n const StepComponent = HvStep;\n //\n\n const stepsWidth = maxSize + minSize * (numSteps - 1);\n const { width, titleWidth, separatorWidth } = getDynamicValues(stepsWidth);\n\n // separator values\n const maxWidth = Math.max(titleWidth - minSize, separatorWidth);\n const minWidth = Math.max(\n titleWidth - (maxSize + minSize) * 0.5,\n separatorWidth\n );\n //\n\n const Steps = children;\n\n const titles = getTitles(({ state }) => ({\n variant: \"label\",\n titleWidth,\n titleDisabled: state === \"Disabled\",\n }));\n\n return (\n <div {...other}>\n <Steps\n {...{\n stepsWidth,\n navWidth: width,\n separatorValues: {\n minWidth,\n maxWidth,\n getColor,\n height: activeTheme?.stepNavigation.defaultSeparatorHeight || 0,\n },\n stepValues: {\n minSize,\n maxSize,\n StepComponent,\n },\n }}\n />\n {titles}\n </div>\n );\n};\n"],"names":["HvDefaultNavigation","numSteps","stepSize","getTitles","getDynamicValues","className","children","other","activeTheme","useTheme","container","maxSize","avatar","minSize","stepSizes","StepComponent","HvStep","stepsWidth","width","titleWidth","separatorWidth","maxWidth","Math","max","minWidth","Steps","titles","state","variant","titleDisabled","
|
|
1
|
+
{"version":3,"file":"DefaultNavigation.cjs","sources":["../../../../../src/components/StepNavigation/DefaultNavigation/DefaultNavigation.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\nimport {\n HvBaseProps,\n HvTheme,\n useTheme,\n} from \"@hitachivantara/uikit-react-core\";\n\nimport { HvStep, HvStepProps } from \"./Step\";\nimport { getColor, stepSizes } from \"./utils\";\n\nexport type ComponentChildProps = {\n stepsWidth: number;\n navWidth: number;\n separatorValues: {\n minWidth: number;\n maxWidth: number;\n getColor: (state: HvStepProps[\"state\"], activeTheme: HvTheme) => any;\n height: number;\n };\n stepValues: {\n minSize: number;\n maxSize: number;\n StepComponent: React.ComponentType<HvStepProps>;\n };\n};\n\nexport interface HvDefaultNavigationProps\n extends Omit<HvBaseProps, \"children\"> {\n /** Number of steps to show on the component. */\n numSteps: number;\n /** Sets one of the standard sizes of the steps. */\n stepSize: \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n /** Returns a `ReactNode` of the titles container. */\n getTitles: (\n getTitleProps?: (params: {\n state: HvStepProps[\"state\"];\n rawTitle: string;\n number: number;\n }) => { variant?: string; title?: string }\n ) => ReactNode;\n /** Returns dynamic width values of the component (width, titleWidth, separatorWidth). */\n getDynamicValues: (stepsWidth: number) => {\n width: number;\n titleWidth: number;\n separatorWidth: number;\n };\n /** Component to render Step Navigation with props = {separatorValues, stepValues, stepsWidth} */\n children: React.FunctionComponent<ComponentChildProps>;\n}\n\nexport const HvDefaultNavigation = ({\n numSteps,\n stepSize,\n getTitles,\n getDynamicValues,\n className,\n children,\n ...other\n}: HvDefaultNavigationProps) => {\n const { activeTheme } = useTheme();\n\n // step values\n const { container: maxSize, avatar: minSize } = stepSizes[stepSize];\n const StepComponent = HvStep;\n //\n\n const stepsWidth = maxSize + minSize * (numSteps - 1);\n const { width, titleWidth, separatorWidth } = getDynamicValues(stepsWidth);\n\n // separator values\n const maxWidth = Math.max(titleWidth - minSize, separatorWidth);\n const minWidth = Math.max(\n titleWidth - (maxSize + minSize) * 0.5,\n separatorWidth\n );\n //\n\n const Steps = children;\n\n const titles = getTitles(({ state }) => ({\n variant: \"label\",\n titleWidth,\n titleDisabled: state === \"Disabled\",\n }));\n\n return (\n <div {...other}>\n <Steps\n {...{\n stepsWidth,\n navWidth: width,\n separatorValues: {\n minWidth,\n maxWidth,\n getColor,\n height: activeTheme?.stepNavigation.defaultSeparatorHeight || 0,\n },\n stepValues: {\n minSize,\n maxSize,\n StepComponent,\n },\n }}\n />\n {titles}\n </div>\n );\n};\n"],"names":["HvDefaultNavigation","numSteps","stepSize","getTitles","getDynamicValues","className","children","other","activeTheme","useTheme","container","maxSize","avatar","minSize","stepSizes","StepComponent","HvStep","stepsWidth","width","titleWidth","separatorWidth","maxWidth","Math","max","minWidth","Steps","titles","state","variant","titleDisabled","jsxs","jsx","navWidth","separatorValues","getColor","height","stepNavigation","defaultSeparatorHeight","stepValues"],"mappings":";;;;;;AAkDO,MAAMA,sBAAsBA,CAAC;AAAA,EAClCC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACA,GAAGC;AACqB,MAAM;AACxB,QAAA;AAAA,IAAEC;AAAAA,MAAgBC,eAAS,SAAA;AAG3B,QAAA;AAAA,IAAEC,WAAWC;AAAAA,IAASC,QAAQC;AAAAA,EAAAA,IAAYC,MAAAA,UAAUZ,QAAQ;AAClE,QAAMa,gBAAgBC,KAAAA;AAGhBC,QAAAA,aAAaN,UAAUE,WAAWZ,WAAW;AAC7C,QAAA;AAAA,IAAEiB;AAAAA,IAAOC;AAAAA,IAAYC;AAAAA,EAAAA,IAAmBhB,iBAAiBa,UAAU;AAGzE,QAAMI,WAAWC,KAAKC,IAAIJ,aAAaN,SAASO,cAAc;AAC9D,QAAMI,WAAWF,KAAKC,IACpBJ,cAAcR,UAAUE,WAAW,KACnCO,cACF;AAGA,QAAMK,QAAQnB;AAERoB,QAAAA,SAASvB,UAAU,CAAC;AAAA,IAAEwB;AAAAA,EAAAA,OAAa;AAAA,IACvCC,SAAS;AAAA,IACTT;AAAAA,IACAU,eAAeF,UAAU;AAAA,EACzB,EAAA;AAGA,SAAAG,2BAAA,KAAC,OAAI,EAAA,GAAIvB,OACP,UAAA;AAAA,IAAAwB,2BAAA,IAAC,SACK,GAAA;AAAA,MACFd;AAAAA,MACAe,UAAUd;AAAAA,MACVe,iBAAiB;AAAA,QACfT;AAAAA,QACAH;AAAAA,QAAAA,UACAa,MAAAA;AAAAA,QACAC,SAAQ3B,2CAAa4B,eAAeC,2BAA0B;AAAA,MAChE;AAAA,MACAC,YAAY;AAAA,QACVzB;AAAAA,QACAF;AAAAA,QACAI;AAAAA,MACF;AAAA,IAAA,GACA;AAAA,IAEHW;AAAAA,EACH,EAAA,CAAA;AAEJ;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
3
4
|
const uikitReactIcons = require("@hitachivantara/uikit-react-icons");
|
|
4
5
|
const uikitReactCore = require("@hitachivantara/uikit-react-core");
|
|
5
6
|
const utils = require("../utils.cjs");
|
|
6
7
|
const Step_styles = require("./Step.styles.cjs");
|
|
7
|
-
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
8
8
|
const HvStep = ({
|
|
9
9
|
className,
|
|
10
10
|
classes: classesProp,
|
|
@@ -47,34 +47,11 @@ const HvStep = ({
|
|
|
47
47
|
Failed: uikitReactIcons.Level3Bad,
|
|
48
48
|
Completed: uikitReactIcons.Level0Good
|
|
49
49
|
}[state];
|
|
50
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
className: cx(classes.ghost, {
|
|
56
|
-
[classes.ghostDisabled]: state === "Current"
|
|
57
|
-
}),
|
|
58
|
-
"aria-label": `${title}`,
|
|
59
|
-
icon: true,
|
|
60
|
-
overrideIconColors: false,
|
|
61
|
-
disabled: disabled ?? ["Current", "Disabled"].includes(state),
|
|
62
|
-
onClick,
|
|
63
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvAvatar, {
|
|
64
|
-
className: cx(classes.avatar, classes[size]),
|
|
65
|
-
backgroundColor,
|
|
66
|
-
status,
|
|
67
|
-
size,
|
|
68
|
-
children: IconComponent ? /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {
|
|
69
|
-
color,
|
|
70
|
-
semantic,
|
|
71
|
-
width: svgSize,
|
|
72
|
-
height: svgSize,
|
|
73
|
-
iconSize
|
|
74
|
-
}) : number
|
|
75
|
-
})
|
|
76
|
-
})
|
|
77
|
-
});
|
|
50
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx(classes.root, {
|
|
51
|
+
[classes.notCurrent]: state !== "Current"
|
|
52
|
+
}, className), children: /* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvButton, { className: cx(classes.ghost, {
|
|
53
|
+
[classes.ghostDisabled]: state === "Current"
|
|
54
|
+
}), "aria-label": `${title}`, icon: true, overrideIconColors: false, disabled: disabled ?? ["Current", "Disabled"].includes(state), onClick, children: /* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvAvatar, { className: cx(classes.avatar, classes[size]), backgroundColor, status, size, children: IconComponent ? /* @__PURE__ */ jsxRuntime.jsx(IconComponent, { color, semantic, width: svgSize, height: svgSize, iconSize }) : number }) }) });
|
|
78
55
|
};
|
|
79
56
|
exports.HvStep = HvStep;
|
|
80
57
|
//# sourceMappingURL=Step.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Step.cjs","sources":["../../../../../../src/components/StepNavigation/DefaultNavigation/Step/Step.tsx"],"sourcesContent":["import {\n Level0Good,\n Level3Bad,\n HourGlass,\n} from \"@hitachivantara/uikit-react-icons\";\nimport {\n HvAvatarSize,\n HvButtonProps,\n HvBaseProps,\n ExtractNames,\n HvAvatar,\n HvButton,\n} from \"@hitachivantara/uikit-react-core\";\n\nimport { getColor, getSemantic } from \"../utils\";\nimport { useClasses } from \"./Step.styles\";\n\ntype HvStepClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvStepProps\n extends Pick<HvButtonProps, \"onClick\">,\n Omit<HvBaseProps, \"onClick\"> {\n /** A Jss Object used to override or extend the styles applied to the empty state StepNavigation. */\n classes?: HvStepClasses;\n /** State of the step. Values = {\"Pending\", \"Failed\", \"Completed\", \"Current\", \"Disabled\", \"Enabled\"} */\n state:\n | \"Pending\"\n | \"Failed\"\n | \"Completed\"\n | \"Current\"\n | \"Disabled\"\n | \"Enabled\";\n /** Title of the step. */\n title: string;\n /** Sets one of the standard sizes of the step */\n size?: HvAvatarSize;\n /** Number of the step. */\n number?: number;\n /**\n * Define if a step is disabled/enabled.\n * If this property is not defined and the step is on state \"Disabled\", the step component will be disabled\n */\n disabled?: boolean;\n}\n\n/**\n * Step element of \"Default\" Step Navigation root component\n */\nexport const HvStep = ({\n className,\n classes: classesProp,\n state,\n title,\n onClick,\n disabled,\n size = \"md\",\n number = 1,\n}: HvStepProps) => {\n const { classes, cx } = useClasses(classesProp);\n\n const iconSize = {\n xs: \"XS\",\n sm: \"XS\",\n md: \"S\",\n ml: \"M\",\n xl: \"M\",\n }[size];\n\n const squareL = {\n Pending: 16,\n Failed: 24,\n Completed: 24,\n }[state];\n\n const svgSize = {\n xs: squareL - 8,\n sm: squareL,\n md: squareL + 8,\n lg: squareL + 16,\n xl: squareL + 24,\n }[size];\n\n const backgroundColor = getColor(state);\n\n const color = state === \"Pending\" ? \"atmo2\" : undefined;\n const semantic = state !== \"Pending\" ? getSemantic(state) : undefined;\n const status = state === \"Current\" ? \"secondary_60\" : undefined;\n\n const IconComponent = {\n Pending: HourGlass,\n Failed: Level3Bad,\n Completed: Level0Good,\n }[state];\n\n return (\n <div\n className={cx(\n classes.root,\n {\n [classes.notCurrent]: state !== \"Current\",\n },\n className\n )}\n >\n <HvButton\n className={cx(classes.ghost, {\n [classes.ghostDisabled]: state === \"Current\",\n })}\n aria-label={`${title}`}\n icon\n overrideIconColors={false}\n disabled={disabled ?? [\"Current\", \"Disabled\"].includes(state)}\n onClick={onClick}\n >\n <HvAvatar\n className={cx(classes.avatar, classes[size])}\n backgroundColor={backgroundColor}\n status={status}\n size={size}\n >\n {IconComponent ? (\n <IconComponent\n color={color}\n semantic={semantic}\n width={svgSize}\n height={svgSize}\n iconSize={iconSize}\n />\n ) : (\n number\n )}\n </HvAvatar>\n </HvButton>\n </div>\n );\n};\n"],"names":["HvStep","className","classes","classesProp","state","title","onClick","disabled","size","number","cx","useClasses","iconSize","xs","sm","md","ml","xl","squareL","Pending","Failed","Completed","svgSize","lg","backgroundColor","getColor","color","undefined","semantic","getSemantic","status","IconComponent","HourGlass","Level3Bad","Level0Good","
|
|
1
|
+
{"version":3,"file":"Step.cjs","sources":["../../../../../../src/components/StepNavigation/DefaultNavigation/Step/Step.tsx"],"sourcesContent":["import {\n Level0Good,\n Level3Bad,\n HourGlass,\n} from \"@hitachivantara/uikit-react-icons\";\nimport {\n HvAvatarSize,\n HvButtonProps,\n HvBaseProps,\n ExtractNames,\n HvAvatar,\n HvButton,\n} from \"@hitachivantara/uikit-react-core\";\n\nimport { getColor, getSemantic } from \"../utils\";\nimport { useClasses } from \"./Step.styles\";\n\ntype HvStepClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvStepProps\n extends Pick<HvButtonProps, \"onClick\">,\n Omit<HvBaseProps, \"onClick\"> {\n /** A Jss Object used to override or extend the styles applied to the empty state StepNavigation. */\n classes?: HvStepClasses;\n /** State of the step. Values = {\"Pending\", \"Failed\", \"Completed\", \"Current\", \"Disabled\", \"Enabled\"} */\n state:\n | \"Pending\"\n | \"Failed\"\n | \"Completed\"\n | \"Current\"\n | \"Disabled\"\n | \"Enabled\";\n /** Title of the step. */\n title: string;\n /** Sets one of the standard sizes of the step */\n size?: HvAvatarSize;\n /** Number of the step. */\n number?: number;\n /**\n * Define if a step is disabled/enabled.\n * If this property is not defined and the step is on state \"Disabled\", the step component will be disabled\n */\n disabled?: boolean;\n}\n\n/**\n * Step element of \"Default\" Step Navigation root component\n */\nexport const HvStep = ({\n className,\n classes: classesProp,\n state,\n title,\n onClick,\n disabled,\n size = \"md\",\n number = 1,\n}: HvStepProps) => {\n const { classes, cx } = useClasses(classesProp);\n\n const iconSize = {\n xs: \"XS\",\n sm: \"XS\",\n md: \"S\",\n ml: \"M\",\n xl: \"M\",\n }[size];\n\n const squareL = {\n Pending: 16,\n Failed: 24,\n Completed: 24,\n }[state];\n\n const svgSize = {\n xs: squareL - 8,\n sm: squareL,\n md: squareL + 8,\n lg: squareL + 16,\n xl: squareL + 24,\n }[size];\n\n const backgroundColor = getColor(state);\n\n const color = state === \"Pending\" ? \"atmo2\" : undefined;\n const semantic = state !== \"Pending\" ? getSemantic(state) : undefined;\n const status = state === \"Current\" ? \"secondary_60\" : undefined;\n\n const IconComponent = {\n Pending: HourGlass,\n Failed: Level3Bad,\n Completed: Level0Good,\n }[state];\n\n return (\n <div\n className={cx(\n classes.root,\n {\n [classes.notCurrent]: state !== \"Current\",\n },\n className\n )}\n >\n <HvButton\n className={cx(classes.ghost, {\n [classes.ghostDisabled]: state === \"Current\",\n })}\n aria-label={`${title}`}\n icon\n overrideIconColors={false}\n disabled={disabled ?? [\"Current\", \"Disabled\"].includes(state)}\n onClick={onClick}\n >\n <HvAvatar\n className={cx(classes.avatar, classes[size])}\n backgroundColor={backgroundColor}\n status={status}\n size={size}\n >\n {IconComponent ? (\n <IconComponent\n color={color}\n semantic={semantic}\n width={svgSize}\n height={svgSize}\n iconSize={iconSize}\n />\n ) : (\n number\n )}\n </HvAvatar>\n </HvButton>\n </div>\n );\n};\n"],"names":["HvStep","className","classes","classesProp","state","title","onClick","disabled","size","number","cx","useClasses","iconSize","xs","sm","md","ml","xl","squareL","Pending","Failed","Completed","svgSize","lg","backgroundColor","getColor","color","undefined","semantic","getSemantic","status","IconComponent","HourGlass","Level3Bad","Level0Good","jsx","root","notCurrent","HvButton","ghost","ghostDisabled","includes","HvAvatar","avatar"],"mappings":";;;;;;;AAgDO,MAAMA,SAASA,CAAC;AAAA,EACrBC;AAAAA,EACAC,SAASC;AAAAA,EACTC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,OAAO;AAAA,EACPC,SAAS;AACE,MAAM;AACX,QAAA;AAAA,IAAEP;AAAAA,IAASQ;AAAAA,EAAAA,IAAOC,YAAAA,WAAWR,WAAW;AAE9C,QAAMS,WAAW;AAAA,IACfC,IAAI;AAAA,IACJC,IAAI;AAAA,IACJC,IAAI;AAAA,IACJC,IAAI;AAAA,IACJC,IAAI;AAAA,IACJT,IAAI;AAEN,QAAMU,UAAU;AAAA,IACdC,SAAS;AAAA,IACTC,QAAQ;AAAA,IACRC,WAAW;AAAA,IACXjB,KAAK;AAEP,QAAMkB,UAAU;AAAA,IACdT,IAAIK,UAAU;AAAA,IACdJ,IAAII;AAAAA,IACJH,IAAIG,UAAU;AAAA,IACdK,IAAIL,UAAU;AAAA,IACdD,IAAIC,UAAU;AAAA,IACdV,IAAI;AAEAgB,QAAAA,kBAAkBC,eAASrB,KAAK;AAEhCsB,QAAAA,QAAQtB,UAAU,YAAY,UAAUuB;AAC9C,QAAMC,WAAWxB,UAAU,YAAYyB,MAAAA,YAAYzB,KAAK,IAAIuB;AACtDG,QAAAA,SAAS1B,UAAU,YAAY,iBAAiBuB;AAEtD,QAAMI,gBAAgB;AAAA,IACpBZ,SAASa,gBAAAA;AAAAA,IACTZ,QAAQa,gBAAAA;AAAAA,IACRZ,WAAWa,gBAAAA;AAAAA,IACX9B,KAAK;AAEP,SACG+B,2BAAAA,IAAA,OAAA,EACC,WAAWzB,GACTR,QAAQkC,MACR;AAAA,IACE,CAAClC,QAAQmC,UAAU,GAAGjC,UAAU;AAAA,EAAA,GAElCH,SACF,GAEA,UAAAkC,+BAACG,eAAAA,YACC,WAAW5B,GAAGR,QAAQqC,OAAO;AAAA,IAC3B,CAACrC,QAAQsC,aAAa,GAAGpC,UAAU;AAAA,EACpC,CAAA,GACD,cAAa,GAAEC,KAAM,IACrB,MAAI,MACJ,oBAAoB,OACpB,UAAUE,YAAY,CAAC,WAAW,UAAU,EAAEkC,SAASrC,KAAK,GAC5D,SAEA,UAAA+B,+BAACO,eAAAA,UACC,EAAA,WAAWhC,GAAGR,QAAQyC,QAAQzC,QAAQM,IAAI,CAAC,GAC3C,iBACA,QACA,MAECuB,UACC,gBAAAI,2BAAA,IAAC,iBACC,OACA,UACA,OAAOb,SACP,QAAQA,SACR,SAAmB,CAAA,IAGrBb,OAEJ,CAAA,EACF,CAAA,EACF,CAAA;AAEJ;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
3
4
|
const uikitReactCore = require("@hitachivantara/uikit-react-core");
|
|
4
5
|
const utils = require("../utils.cjs");
|
|
5
6
|
const Dot_styles = require("./Dot.styles.cjs");
|
|
6
|
-
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
7
7
|
const HvDot = ({
|
|
8
8
|
classes: classesProp,
|
|
9
9
|
className,
|
|
@@ -19,25 +19,17 @@ const HvDot = ({
|
|
|
19
19
|
css
|
|
20
20
|
} = Dot_styles.useClasses(classesProp);
|
|
21
21
|
const dotSize = utils.dotSizes[size] * (state === "Current" ? 1.5 : 1);
|
|
22
|
-
return /* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvButton, {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}, className),
|
|
34
|
-
"aria-label": `${title}`,
|
|
35
|
-
icon: true,
|
|
36
|
-
overrideIconColors: false,
|
|
37
|
-
disabled: disabled ?? ["Current", "Disabled"].includes(state),
|
|
38
|
-
onClick,
|
|
39
|
-
children: []
|
|
40
|
-
});
|
|
22
|
+
return /* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvButton, { className: cx(css({
|
|
23
|
+
backgroundColor: utils.getColor(state),
|
|
24
|
+
width: dotSize,
|
|
25
|
+
height: dotSize,
|
|
26
|
+
"&:hover, &:disabled": {
|
|
27
|
+
backgroundColor: utils.getColor(state)
|
|
28
|
+
}
|
|
29
|
+
}), classes.root, {
|
|
30
|
+
[classes.active]: state === "Current",
|
|
31
|
+
[classes.ghostDisabled]: disabled ?? ["Current", "Disabled"].includes(state)
|
|
32
|
+
}, className), "aria-label": `${title}`, icon: true, overrideIconColors: false, disabled: disabled ?? ["Current", "Disabled"].includes(state), onClick, children: [] });
|
|
41
33
|
};
|
|
42
34
|
exports.dotClasses = Dot_styles.staticClasses;
|
|
43
35
|
exports.HvDot = HvDot;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dot.cjs","sources":["../../../../../../src/components/StepNavigation/SimpleNavigation/Dot/Dot.tsx"],"sourcesContent":["import {\n ExtractNames,\n HvBaseProps,\n HvButton,\n} from \"@hitachivantara/uikit-react-core\";\n\nimport { HvStepProps } from \"../../DefaultNavigation\";\nimport { getColor, dotSizes } from \"../utils\";\nimport { staticClasses, useClasses } from \"./Dot.styles\";\n\nexport { staticClasses as dotClasses };\n\nexport type HvDotClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvDotProps\n extends Pick<\n HvStepProps,\n \"size\" | \"title\" | \"state\" | \"onClick\" | \"disabled\"\n >,\n Omit<HvBaseProps, \"title\" | \"onClick\"> {\n /** A Jss Object used to override or extend the styles applied to the empty state StepNavigation. */\n classes?: HvDotClasses;\n}\n\nexport const HvDot = ({\n classes: classesProp,\n className,\n state,\n title,\n size = \"sm\",\n onClick,\n disabled,\n}: HvDotProps) => {\n const { classes, cx, css } = useClasses(classesProp);\n\n const dotSize = dotSizes[size] * (state === \"Current\" ? 1.5 : 1);\n\n return (\n <HvButton\n className={cx(\n css({\n backgroundColor: getColor(state),\n width: dotSize,\n height: dotSize,\n \"&:hover, &:disabled\": {\n backgroundColor: getColor(state),\n },\n }),\n classes.root,\n {\n [classes.active]: state === \"Current\",\n [classes.ghostDisabled]:\n disabled ?? [\"Current\", \"Disabled\"].includes(state),\n },\n className\n )}\n aria-label={`${title}`}\n icon\n overrideIconColors={false}\n disabled={disabled ?? [\"Current\", \"Disabled\"].includes(state)}\n onClick={onClick}\n >\n {[]}\n </HvButton>\n );\n};\n"],"names":["HvDot","classes","classesProp","className","state","title","size","onClick","disabled","cx","css","useClasses","dotSize","dotSizes","HvButton","backgroundColor","getColor","width","height","root","active","ghostDisabled","includes"
|
|
1
|
+
{"version":3,"file":"Dot.cjs","sources":["../../../../../../src/components/StepNavigation/SimpleNavigation/Dot/Dot.tsx"],"sourcesContent":["import {\n ExtractNames,\n HvBaseProps,\n HvButton,\n} from \"@hitachivantara/uikit-react-core\";\n\nimport { HvStepProps } from \"../../DefaultNavigation\";\nimport { getColor, dotSizes } from \"../utils\";\nimport { staticClasses, useClasses } from \"./Dot.styles\";\n\nexport { staticClasses as dotClasses };\n\nexport type HvDotClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvDotProps\n extends Pick<\n HvStepProps,\n \"size\" | \"title\" | \"state\" | \"onClick\" | \"disabled\"\n >,\n Omit<HvBaseProps, \"title\" | \"onClick\"> {\n /** A Jss Object used to override or extend the styles applied to the empty state StepNavigation. */\n classes?: HvDotClasses;\n}\n\nexport const HvDot = ({\n classes: classesProp,\n className,\n state,\n title,\n size = \"sm\",\n onClick,\n disabled,\n}: HvDotProps) => {\n const { classes, cx, css } = useClasses(classesProp);\n\n const dotSize = dotSizes[size] * (state === \"Current\" ? 1.5 : 1);\n\n return (\n <HvButton\n className={cx(\n css({\n backgroundColor: getColor(state),\n width: dotSize,\n height: dotSize,\n \"&:hover, &:disabled\": {\n backgroundColor: getColor(state),\n },\n }),\n classes.root,\n {\n [classes.active]: state === \"Current\",\n [classes.ghostDisabled]:\n disabled ?? [\"Current\", \"Disabled\"].includes(state),\n },\n className\n )}\n aria-label={`${title}`}\n icon\n overrideIconColors={false}\n disabled={disabled ?? [\"Current\", \"Disabled\"].includes(state)}\n onClick={onClick}\n >\n {[]}\n </HvButton>\n );\n};\n"],"names":["HvDot","classes","classesProp","className","state","title","size","onClick","disabled","cx","css","useClasses","dotSize","dotSizes","jsx","HvButton","backgroundColor","getColor","width","height","root","active","ghostDisabled","includes"],"mappings":";;;;;;AAwBO,MAAMA,QAAQA,CAAC;AAAA,EACpBC,SAASC;AAAAA,EACTC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,OAAO;AAAA,EACPC;AAAAA,EACAC;AACU,MAAM;AACV,QAAA;AAAA,IAAEP;AAAAA,IAASQ;AAAAA,IAAIC;AAAAA,EAAAA,IAAQC,WAAAA,WAAWT,WAAW;AAEnD,QAAMU,UAAUC,MAASP,SAAAA,IAAI,KAAKF,UAAU,YAAY,MAAM;AAE9D,SACGU,2BAAA,IAAAC,eAAA,UAAA,EACC,WAAWN,GACTC,IAAI;AAAA,IACFM,iBAAiBC,eAASb,KAAK;AAAA,IAC/Bc,OAAON;AAAAA,IACPO,QAAQP;AAAAA,IACR,uBAAuB;AAAA,MACrBI,iBAAiBC,eAASb,KAAK;AAAA,IACjC;AAAA,EAAA,CACD,GACDH,QAAQmB,MACR;AAAA,IACE,CAACnB,QAAQoB,MAAM,GAAGjB,UAAU;AAAA,IAC5B,CAACH,QAAQqB,aAAa,GACpBd,YAAY,CAAC,WAAW,UAAU,EAAEe,SAASnB,KAAK;AAAA,EAAA,GAEtDD,SACF,GACA,cAAa,GAAEE,KAAM,IACrB,MAAI,MACJ,oBAAoB,OACpB,UAAUG,YAAY,CAAC,WAAW,UAAU,EAAEe,SAASnB,KAAK,GAC5D,SAEC,UAAA,CACH,EAAA,CAAA;AAEJ;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
3
4
|
const uikitReactCore = require("@hitachivantara/uikit-react-core");
|
|
4
5
|
const utils = require("./utils.cjs");
|
|
5
|
-
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
6
6
|
const Dot = require("./Dot/Dot.cjs");
|
|
7
7
|
const HvSimpleNavigation = ({
|
|
8
8
|
numSteps,
|
|
@@ -34,9 +34,9 @@ const HvSimpleNavigation = ({
|
|
|
34
34
|
title: `${number}. ${rawTitle}`,
|
|
35
35
|
titleWidth
|
|
36
36
|
}));
|
|
37
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ...others, children: [
|
|
38
|
+
titles,
|
|
39
|
+
/* @__PURE__ */ jsxRuntime.jsx(Steps, { ...{
|
|
40
40
|
stepsWidth,
|
|
41
41
|
navWidth: width,
|
|
42
42
|
separatorValues: {
|
|
@@ -50,8 +50,8 @@ const HvSimpleNavigation = ({
|
|
|
50
50
|
maxSize: 1.5 * dotSize,
|
|
51
51
|
StepComponent
|
|
52
52
|
}
|
|
53
|
-
})
|
|
54
|
-
});
|
|
53
|
+
} })
|
|
54
|
+
] });
|
|
55
55
|
};
|
|
56
56
|
exports.HvSimpleNavigation = HvSimpleNavigation;
|
|
57
57
|
//# sourceMappingURL=SimpleNavigation.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleNavigation.cjs","sources":["../../../../../src/components/StepNavigation/SimpleNavigation/SimpleNavigation.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\nimport {\n HvBaseProps,\n HvTheme,\n useTheme,\n} from \"@hitachivantara/uikit-react-core\";\n\nimport { HvDot, HvDotProps } from \"./Dot\";\nimport { getColor, dotSizes } from \"./utils\";\n\nexport type ComponentChildProps = {\n stepsWidth: number;\n navWidth: number;\n separatorValues: {\n minWidth: number;\n maxWidth: number;\n getColor: (state: HvDotProps[\"state\"], activeTheme: HvTheme) => any;\n height: number;\n };\n stepValues: {\n minSize: number;\n maxSize: number;\n StepComponent: React.ComponentType<HvDotProps>;\n };\n};\n\nexport interface HvSimpleNavigationProps extends Omit<HvBaseProps, \"children\"> {\n /** Sets one of the standard sizes of the steps. */\n stepSize?: \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n /** Number of steps to show on the component. */\n numSteps: number;\n /** Returns a `ReactNode` of the titles container. */\n getTitles: (\n getTitleProps?: (params: {\n state: HvDotProps[\"state\"];\n rawTitle: string;\n number: number;\n }) => { variant: string; title: string }\n ) => ReactNode;\n /** Returns dynamic width values of the component (width, titleWidth, separatorWidth). */\n getDynamicValues: (stepsWidth: number) => {\n width: number;\n titleWidth: number;\n separatorWidth: number;\n };\n /** Component to render Step Navigation with props = {separatorValues, stepValues, stepsWidth} */\n children: React.FunctionComponent<ComponentChildProps>;\n}\n\nexport const HvSimpleNavigation = ({\n numSteps,\n stepSize = \"sm\",\n getTitles,\n getDynamicValues,\n children,\n ...others\n}: HvSimpleNavigationProps) => {\n const { activeTheme } = useTheme();\n\n // step values\n const dotSize = dotSizes[stepSize];\n const StepComponent = HvDot;\n //\n\n const stepsWidth = (numSteps + 0.5) * dotSize;\n const { width, titleWidth, separatorWidth } = getDynamicValues(stepsWidth);\n\n // separator values\n const maxWidth = Math.max(titleWidth - dotSize, separatorWidth);\n const minWidth = Math.max(titleWidth - dotSize * 1.25, separatorWidth);\n //\n\n const Steps = children;\n\n const titles = getTitles(({ rawTitle, number }) => ({\n variant: \"label\",\n title: `${number}. ${rawTitle}`,\n titleWidth,\n }));\n\n return (\n <div {...others}>\n {titles}\n <Steps\n {...{\n stepsWidth,\n navWidth: width,\n separatorValues: {\n minWidth,\n maxWidth,\n getColor,\n height: activeTheme?.stepNavigation.simpleSeparatorHeight || 0,\n },\n stepValues: {\n minSize: dotSize,\n maxSize: 1.5 * dotSize,\n StepComponent,\n },\n }}\n />\n </div>\n );\n};\n"],"names":["HvSimpleNavigation","numSteps","stepSize","getTitles","getDynamicValues","children","others","activeTheme","useTheme","dotSize","dotSizes","StepComponent","HvDot","stepsWidth","width","titleWidth","separatorWidth","maxWidth","Math","max","minWidth","Steps","titles","rawTitle","number","variant","title","
|
|
1
|
+
{"version":3,"file":"SimpleNavigation.cjs","sources":["../../../../../src/components/StepNavigation/SimpleNavigation/SimpleNavigation.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\nimport {\n HvBaseProps,\n HvTheme,\n useTheme,\n} from \"@hitachivantara/uikit-react-core\";\n\nimport { HvDot, HvDotProps } from \"./Dot\";\nimport { getColor, dotSizes } from \"./utils\";\n\nexport type ComponentChildProps = {\n stepsWidth: number;\n navWidth: number;\n separatorValues: {\n minWidth: number;\n maxWidth: number;\n getColor: (state: HvDotProps[\"state\"], activeTheme: HvTheme) => any;\n height: number;\n };\n stepValues: {\n minSize: number;\n maxSize: number;\n StepComponent: React.ComponentType<HvDotProps>;\n };\n};\n\nexport interface HvSimpleNavigationProps extends Omit<HvBaseProps, \"children\"> {\n /** Sets one of the standard sizes of the steps. */\n stepSize?: \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n /** Number of steps to show on the component. */\n numSteps: number;\n /** Returns a `ReactNode` of the titles container. */\n getTitles: (\n getTitleProps?: (params: {\n state: HvDotProps[\"state\"];\n rawTitle: string;\n number: number;\n }) => { variant: string; title: string }\n ) => ReactNode;\n /** Returns dynamic width values of the component (width, titleWidth, separatorWidth). */\n getDynamicValues: (stepsWidth: number) => {\n width: number;\n titleWidth: number;\n separatorWidth: number;\n };\n /** Component to render Step Navigation with props = {separatorValues, stepValues, stepsWidth} */\n children: React.FunctionComponent<ComponentChildProps>;\n}\n\nexport const HvSimpleNavigation = ({\n numSteps,\n stepSize = \"sm\",\n getTitles,\n getDynamicValues,\n children,\n ...others\n}: HvSimpleNavigationProps) => {\n const { activeTheme } = useTheme();\n\n // step values\n const dotSize = dotSizes[stepSize];\n const StepComponent = HvDot;\n //\n\n const stepsWidth = (numSteps + 0.5) * dotSize;\n const { width, titleWidth, separatorWidth } = getDynamicValues(stepsWidth);\n\n // separator values\n const maxWidth = Math.max(titleWidth - dotSize, separatorWidth);\n const minWidth = Math.max(titleWidth - dotSize * 1.25, separatorWidth);\n //\n\n const Steps = children;\n\n const titles = getTitles(({ rawTitle, number }) => ({\n variant: \"label\",\n title: `${number}. ${rawTitle}`,\n titleWidth,\n }));\n\n return (\n <div {...others}>\n {titles}\n <Steps\n {...{\n stepsWidth,\n navWidth: width,\n separatorValues: {\n minWidth,\n maxWidth,\n getColor,\n height: activeTheme?.stepNavigation.simpleSeparatorHeight || 0,\n },\n stepValues: {\n minSize: dotSize,\n maxSize: 1.5 * dotSize,\n StepComponent,\n },\n }}\n />\n </div>\n );\n};\n"],"names":["HvSimpleNavigation","numSteps","stepSize","getTitles","getDynamicValues","children","others","activeTheme","useTheme","dotSize","dotSizes","StepComponent","HvDot","stepsWidth","width","titleWidth","separatorWidth","maxWidth","Math","max","minWidth","Steps","titles","rawTitle","number","variant","title","jsxs","jsx","navWidth","separatorValues","getColor","height","stepNavigation","simpleSeparatorHeight","stepValues","minSize","maxSize"],"mappings":";;;;;;AAiDO,MAAMA,qBAAqBA,CAAC;AAAA,EACjCC;AAAAA,EACAC,WAAW;AAAA,EACXC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACA,GAAGC;AACoB,MAAM;AACvB,QAAA;AAAA,IAAEC;AAAAA,MAAgBC,eAAS,SAAA;AAG3BC,QAAAA,UAAUC,eAASR,QAAQ;AACjC,QAAMS,gBAAgBC,IAAAA;AAGhBC,QAAAA,cAAcZ,WAAW,OAAOQ;AAChC,QAAA;AAAA,IAAEK;AAAAA,IAAOC;AAAAA,IAAYC;AAAAA,EAAAA,IAAmBZ,iBAAiBS,UAAU;AAGzE,QAAMI,WAAWC,KAAKC,IAAIJ,aAAaN,SAASO,cAAc;AAC9D,QAAMI,WAAWF,KAAKC,IAAIJ,aAAaN,UAAU,MAAMO,cAAc;AAGrE,QAAMK,QAAQhB;AAERiB,QAAAA,SAASnB,UAAU,CAAC;AAAA,IAAEoB;AAAAA,IAAUC;AAAAA,EAAAA,OAAc;AAAA,IAClDC,SAAS;AAAA,IACTC,OAAQ,GAAEF,MAAO,KAAID,QAAS;AAAA,IAC9BR;AAAAA,EACA,EAAA;AAGA,SAAAY,2BAAA,KAAC,OAAI,EAAA,GAAIrB,QACNgB,UAAAA;AAAAA,IAAAA;AAAAA,IACDM,2BAAA,IAAC,SACK,GAAA;AAAA,MACFf;AAAAA,MACAgB,UAAUf;AAAAA,MACVgB,iBAAiB;AAAA,QACfV;AAAAA,QACAH;AAAAA,QAAAA,UACAc,MAAAA;AAAAA,QACAC,SAAQzB,2CAAa0B,eAAeC,0BAAyB;AAAA,MAC/D;AAAA,MACAC,YAAY;AAAA,QACVC,SAAS3B;AAAAA,QACT4B,SAAS,MAAM5B;AAAAA,QACfE;AAAAA,MACF;AAAA,IAAA,GACA;AAAA,EAEN,EAAA,CAAA;AAEJ;;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
3
4
|
const _styled = require("@emotion/styled/base");
|
|
4
5
|
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
5
6
|
const uikitReactCore = require("@hitachivantara/uikit-react-core");
|
|
6
7
|
const utils = require("./utils.cjs");
|
|
7
8
|
const StepNavigation_styles = require("./StepNavigation.styles.cjs");
|
|
8
|
-
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
9
9
|
const DefaultNavigation = require("./DefaultNavigation/DefaultNavigation.cjs");
|
|
10
10
|
const SimpleNavigation = require("./SimpleNavigation/SimpleNavigation.cjs");
|
|
11
11
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
@@ -52,18 +52,12 @@ const HvStepNavigation = ({
|
|
|
52
52
|
}, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3J1bm5lci93b3JrL2h2LXVpa2l0LXJlYWN0L2h2LXVpa2l0LXJlYWN0L3BhY2thZ2VzL2xhYi9zcmMvY29tcG9uZW50cy9TdGVwTmF2aWdhdGlvbi9TdGVwTmF2aWdhdGlvbi50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBdUdJIiwiZmlsZSI6Ii9ob21lL3J1bm5lci93b3JrL2h2LXVpa2l0LXJlYWN0L2h2LXVpa2l0LXJlYWN0L3BhY2thZ2VzL2xhYi9zcmMvY29tcG9uZW50cy9TdGVwTmF2aWdhdGlvbi9TdGVwTmF2aWdhdGlvbi50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBSZWFjdE5vZGUgfSBmcm9tIFwicmVhY3RcI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TmFtZX0gLz5cbiAgICAgIDwvbGk+XG4gICAgKTtcbiAgfTtcblxuICBjb25zdCBkcmF3SXRlbXMgPSAoe1xuICAgIHNlcGFyYXRvclZhbHVlczogeyBtaW5XaWR0aCwgbWF4V2lkdGgsIGdldENvbG9yLCBoZWlnaHQgfSxcbiAgICBzdGVwVmFsdWVzOiB7IG1pblNpemUsIG1heFNpemUsIFN0ZXBDb21wb25lbnQgfSxcbiAgfTogYW55KSA9PiB7XG4gICAgY29uc3QgaXRlbXMgPSBzdGVwcy5yZWR1Y2U8UmVhY3ROb2RlW10+KFxuICAgICAgKGFjYywgeyBzdGF0ZSwgdGl0bGUsIHNlcGFyYXRvckNsYXNzTmFtZSwgLi4ucHJvcHMgfSwgaW5kZXgpOiBhbnkgPT4ge1xuICAgICAgICBjb25zdCBjb250YWluZXJTaXplID0gc3RhdGUgPT09IFwiQ3VycmVudFwiID8gbWF4U2l6ZSA6IG1pblNpemU7XG4gICAgICAgIGNvbnN0IFN0ZXBDb250YWluZXIgPSBzdHlsZWRMaShjb250YWluZXJTaXplKTtcbiAgICAgICAgY29uc3QgU3RlcCA9IHN0eWxlZERpdihNYXRoLm1heChjb250YWluZXJTaXplLCAzMCkpO1xuICAgICAgICBjb25zdCBzdGVwUHJvcHMgPSB7XG4gICAgICAgICAgLi4ue1xuICAgICAgICAgICAgc2l6ZTogc3RlcFNpemVLZXksXG4gICAgICAgICAgICBzdGF0ZSxcbiAgICAgICAgICAgIHRpdGxlLFxuICAgICAgICAgICAgbnVtYmVyOiBpbmRleCArIDEsXG4gICAgICAgICAgICAuLi5wcm9wcyxcbiAgICAgICAgICB9LFxuICAgICAgICB9O1xuICAgICAgICBjb25zdCBzdGVwRWxlbWVudCA9IChcbiAgICAgICAgICA8U3RlcENvbnRhaW5lciBrZXk9e2BzdGVwLSR7dGl0bGV9YH0gY2xhc3NOYW1lPXtjbGFzc2VzLmxpfT5cbiAgICAgICAgICAgIHtoYXNUaXRsZXMgPyAoXG4gICAgICAgICAgICAgIDxTdGVwQ29tcG9uZW50XG4gICAgICAgICAgICAgICAga2V5PXtgc3RlcC0ke3RpdGxlfWB9XG4gICAgICAgICAgICAgICAgYXJpYS1sYWJlbD17YCR7dGl0bGV9YH1cbiAgICAgICAgICAgICAgICB7Li4uc3RlcFByb3BzfVxuICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgKSA6IChcbiAgICAgICAgICAgICAgPEh2VG9vbHRpcFxuICAgICAgICAgICAgICAgIHBsYWNlbWVudD1cImJvdHRvbVwiXG4gICAgICAgICAgICAgICAgdGl0bGU9ezxIdlR5cG9ncmFwaHk+e2Ake2luZGV4ICsgMX0uICR7dGl0bGV9YH08L0h2VHlwb2dyYXBoeT59XG4gICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICA8ZGl2PlxuICAgICAgICAgICAgICAgICAgPFN0ZXAgY2xhc3NOYW1lPXtjbGFzc2VzLmxpfT5cbiAgICAgICAgICAgICAgICAgICAgPFN0ZXBDb21wb25lbnQgYXJpYS1sYWJlbD17YCR7dGl0bGV9YH0gey4uLnN0ZXBQcm9wc30gLz5cbiAgICAgICAgICAgICAgICAgIDwvU3RlcD5cbiAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgPC9IdlRvb2x0aXA+XG4gICAgICAgICAgICApfVxuICAgICAgICAgIDwvU3RlcENvbnRhaW5lcj5cbiAgICAgICAgKTtcbiAgICAgICAgaWYgKGluZGV4IDwgc3RlcHMubGVuZ3RoIC0gMSkge1xuICAgICAgICAgIGNvbnN0IHNlcGFyYXRvckVsZW1lbnQgPSBzdHlsZWRTZXBhcmF0b3JFbGVtZW50KFxuICAgICAgICAgICAgdGl0bGUsXG4gICAgICAgICAgICBzZXBhcmF0b3JDbGFzc05hbWUsXG4gICAgICAgICAgICBoZWlnaHQsXG4gICAgICAgICAgICBbc3RlcHNbaW5kZXggKyAxXS5zdGF0ZSwgc3RhdGVdLmluY2x1ZGVzKFwiQ3VycmVudFwiKVxuICAgICAgICAgICAgICA/IG1pbldpZHRoXG4gICAgICAgICAgICAgIDogbWF4V2lkdGgsXG4gICAgICAgICAgICBnZXRDb2xvcihcbiAgICAgICAgICAgICAgc3RlcHNbaW5kZXggKyAxXS5zdGF0ZSA9PT0gXCJEaXNhYmxlZFwiID8gXCJEaXNhYmxlZFwiIDogc3RhdGUsXG4gICAgICAgICAgICAgIHRoZW1lXG4gICAgICAgICAgICApXG4gICAgICAgICAgKTtcbiAgICAgICAgICByZXR1cm4gWy4uLmFjYywgc3RlcEVsZW1lbnQsIHNlcGFyYXRvckVsZW1lbnRdO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBbLi4uYWNjLCBzdGVwRWxlbWVudF07XG4gICAgICB9LFxuICAgICAgW11cbiAgICApO1xuXG4gICAgcmV0dXJuIDxvbCBjbGFzc05hbWU9e2NsYXNzZXMub2x9PntpdGVtc308L29sPjtcbiAgfTtcblxuICBjb25zdCBnZXREeW5hbWljVmFsdWVzOiBIdkRlZmF1bHROYXZpZ2F0aW9uUHJvcHNbXCJnZXREeW5hbWljVmFsdWVzXCJdID0gKFxuICAgIHN0ZXBzV2lkdGhcbiAgKSA9PiB7XG4gICAgY29uc3QgdGhlbWVCcmVha3BvaW50cyA9IGFjdGl2ZVRoZW1lPy5icmVha3BvaW50cy52YWx1ZXMgfHwge307XG4gICAgY29uc3QgbWF4V2lkdGggPVxuICAgICAgd2lkdGg/LlticmVha3BvaW50XSA/P1xuICAgICAgTWF0aC5tYXgoXG4gICAgICAgIE51bWJlcihoYXNUaXRsZXMpICogKFRJVExFX1dJRFRIICsgVElUTEVfTUFSR0lOKSAqIHN0ZXBzLmxlbmd0aCAtXG4gICAgICAgICAgVElUTEVfTUFSR0lOLFxuICAgICAgICBTRVBBUkFUT1JfV0lEVEggKiAoc3RlcHMubGVuZ3RoIC0gMSkgKyBzdGVwc1dpZHRoXG4gICAgICApO1xuICAgIGNvbnN0IG5leHQgPSBPYmplY3Qua2V5cyh0aGVtZUJyZW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AgICAgICAgIH0gPSBnZXRUaXRsZVByb3BzKHtcbiAgICAgICAgICAgIHN0YXRlLFxuICAgICAgICAgICAgcmF3VGl0bGUsXG4gICAgICAgICAgICBudW1iZXI6IGluZGV4ICsgMSxcbiAgICAgICAgICB9KTtcblxuICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICA8SHZUeXBvZ3JhcGh5XG4gICAgICAgICAgICAgIHZhcmlhbnQ9e3ZhcmlhbnR9XG4gICAgICAgICAgICAgIGNsYXNzTmFtZT17Y3goXG4gICAgICAgICAgICAgICAgY3NzKHtcbiAgICAgICAgICAgICAgICAgIHRleHRBbGlnbjogXCJjZW50ZXJcIixcbiAgICAgICAgICAgICAgICAgIHdpZHRoOiB0aXRsZVdpZHRoIC0gVElUTEVfTUFSR0lOLFxuICAgICAgICAgICAgICAgICAgbWFyZ2luUmlnaHQ6IFRJVExFX01BUkdJTixcbiAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICB0aXRsZUNsYXNzTmFtZVxuICAgICAgICAgICAgICApfVxuICAgICAgICAgICAgICBkaXNhYmxlZD17dGl0bGVEaXNhYmxlZH1cbiAgICAgICAgICAgICAga2V5PXt0aXRsZX1cbiAgICAgICAgICAgID5cbiAgICAgICAgICAgICAge3RpdGxlfVxuICAgICAgICAgICAgPC9IdlR5cG9ncmFwaHk+XG4gICAgICAgICAgKTtcbiAgICAgICAgfSl9XG4gICAgICA8L2Rpdj5cbiAgICApIDogbnVsbDtcblxuICBjb25zdCBTdGVwTmF2aWdhdGlvbiA9IHtcbiAgICBEZWZhdWx0OiBIdkRlZmF1bHROYXZpZ2F0aW9uLFxuICAgIFNpbXBsZTogSHZTaW1wbGVOYXZpZ2F0aW9uLFxuICB9W3R5cGVdO1xuXG4gIHJldHVybiAoXG4gICAgPFN0ZXBOYXZpZ2F0aW9uXG4gICAgICBudW1TdGVwcz17c3RlcHMubGVuZ3RofVxuICAgICAgc3RlcFNpemU9e3N0ZXBTaXplS2V5fVxuICAgICAgZ2V0VGl0bGVzPXtnZXRUaXRsZXN9XG4gICAgICBnZXREeW5hbWljVmFsdWVzPXtnZXREeW5hbWljVmFsdWVzfVxuICAgICAgY2xhc3NOYW1lPXtjeChjbGFzc2VzLnJvb3QsIGNsYXNzTmFtZSl9XG4gICAgICB7Li4ub3RoZXJzfVxuICAgID5cbiAgICAgIHsoeyBzdGVwc1dpZHRoLCBuYXZXaWR0aCwgLi4uaXRlbXNQcm9wcyB9KSA9PiAoXG4gICAgICAgIDxIdkJveFxuICAgICAgICAgIGNvbXBvbmVudD1cIm5hdlwiXG4gICAgICAgICAgc3R5bGU9e3tcbiAgICAgICAgICAgIHdpZHRoOiBgJHtuYXZXaWR0aH1weGAsXG4gICAgICAgICAgICBtYXJnaW46IDAsXG4gICAgICAgICAgfX1cbiAgICAgICAgICBhcmlhLWxhYmVsPXthcmlhTGFiZWx9XG4gICAgICAgID5cbiAgICAgICAgICB7ZHJhd0l0ZW1zKGl0ZW1zUHJvcHMpfVxuICAgICAgICA8L0h2Qm94PlxuICAgICAgKX1cbiAgICA8L1N0ZXBOYXZpZ2F0aW9uPlxuICApO1xufTtcbiJdfQ== */");
|
|
53
53
|
const styledSeparatorElement = (title, separatorClassName, separatorHeight, separatorWidth, backgroundColor) => {
|
|
54
54
|
const widthValue = separatorWidth - 2 * Number(((activeTheme == null ? void 0 : activeTheme.stepNavigation.separatorMargin) || "0px").replace("px", ""));
|
|
55
|
-
return /* @__PURE__ */ jsxRuntime.jsx("li", {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
margin: `0 ${uikitStyles.theme.stepNavigation.separatorMargin}`
|
|
62
|
-
}), classes.separator),
|
|
63
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
64
|
-
className: separatorClassName
|
|
65
|
-
})
|
|
66
|
-
}, `separator-${title}`);
|
|
55
|
+
return /* @__PURE__ */ jsxRuntime.jsx("li", { "aria-hidden": true, className: cx(css({
|
|
56
|
+
height: separatorHeight,
|
|
57
|
+
width: widthValue,
|
|
58
|
+
backgroundColor,
|
|
59
|
+
margin: `0 ${uikitStyles.theme.stepNavigation.separatorMargin}`
|
|
60
|
+
}), classes.separator), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: separatorClassName }) }, `separator-${title}`);
|
|
67
61
|
};
|
|
68
62
|
const drawItems = ({
|
|
69
63
|
separatorValues: {
|
|
@@ -96,37 +90,14 @@ const HvStepNavigation = ({
|
|
|
96
90
|
...props
|
|
97
91
|
}
|
|
98
92
|
};
|
|
99
|
-
const stepElement = /* @__PURE__ */ jsxRuntime.jsx(StepContainer, {
|
|
100
|
-
className: classes.li,
|
|
101
|
-
children: hasTitles ? /* @__PURE__ */ jsxRuntime.jsx(StepComponent, {
|
|
102
|
-
"aria-label": `${title}`,
|
|
103
|
-
...stepProps
|
|
104
|
-
}, `step-${title}`) : /* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvTooltip, {
|
|
105
|
-
placement: "bottom",
|
|
106
|
-
title: /* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvTypography, {
|
|
107
|
-
children: `${index + 1}. ${title}`
|
|
108
|
-
}),
|
|
109
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
110
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Step, {
|
|
111
|
-
className: classes.li,
|
|
112
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(StepComponent, {
|
|
113
|
-
"aria-label": `${title}`,
|
|
114
|
-
...stepProps
|
|
115
|
-
})
|
|
116
|
-
})
|
|
117
|
-
})
|
|
118
|
-
})
|
|
119
|
-
}, `step-${title}`);
|
|
93
|
+
const stepElement = /* @__PURE__ */ jsxRuntime.jsx(StepContainer, { className: classes.li, children: hasTitles ? /* @__PURE__ */ jsxRuntime.jsx(StepComponent, { "aria-label": `${title}`, ...stepProps }, `step-${title}`) : /* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvTooltip, { placement: "bottom", title: /* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvTypography, { children: `${index + 1}. ${title}` }), children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(Step, { className: classes.li, children: /* @__PURE__ */ jsxRuntime.jsx(StepComponent, { "aria-label": `${title}`, ...stepProps }) }) }) }) }, `step-${title}`);
|
|
120
94
|
if (index < steps.length - 1) {
|
|
121
95
|
const separatorElement = styledSeparatorElement(title, separatorClassName, height, [steps[index + 1].state, state].includes("Current") ? minWidth : maxWidth, getColor(steps[index + 1].state === "Disabled" ? "Disabled" : state, uikitStyles.theme));
|
|
122
96
|
return [...acc, stepElement, separatorElement];
|
|
123
97
|
}
|
|
124
98
|
return [...acc, stepElement];
|
|
125
99
|
}, []);
|
|
126
|
-
return /* @__PURE__ */ jsxRuntime.jsx("ol", {
|
|
127
|
-
className: classes.ol,
|
|
128
|
-
children: items
|
|
129
|
-
});
|
|
100
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ol", { className: classes.ol, children: items });
|
|
130
101
|
};
|
|
131
102
|
const getDynamicValues = (stepsWidth) => {
|
|
132
103
|
const themeBreakpoints = (activeTheme == null ? void 0 : activeTheme.breakpoints.values) || {};
|
|
@@ -141,60 +112,39 @@ const HvStepNavigation = ({
|
|
|
141
112
|
separatorWidth
|
|
142
113
|
};
|
|
143
114
|
};
|
|
144
|
-
const getTitles = (getTitleProps) => hasTitles ? /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
115
|
+
const getTitles = (getTitleProps) => hasTitles ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes.titles, children: steps.map(({
|
|
116
|
+
title: rawTitle,
|
|
117
|
+
state,
|
|
118
|
+
titleClassName
|
|
119
|
+
}, index) => {
|
|
120
|
+
const {
|
|
121
|
+
variant = "label",
|
|
122
|
+
title = rawTitle,
|
|
123
|
+
titleWidth = 0,
|
|
124
|
+
titleDisabled = false
|
|
125
|
+
} = getTitleProps({
|
|
148
126
|
state,
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
rawTitle,
|
|
159
|
-
number: index + 1
|
|
160
|
-
});
|
|
161
|
-
return /* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvTypography, {
|
|
162
|
-
variant,
|
|
163
|
-
className: cx(css({
|
|
164
|
-
textAlign: "center",
|
|
165
|
-
width: titleWidth - utils.TITLE_MARGIN,
|
|
166
|
-
marginRight: utils.TITLE_MARGIN
|
|
167
|
-
}), titleClassName),
|
|
168
|
-
disabled: titleDisabled,
|
|
169
|
-
children: title
|
|
170
|
-
}, title);
|
|
171
|
-
})
|
|
172
|
-
}) : null;
|
|
127
|
+
rawTitle,
|
|
128
|
+
number: index + 1
|
|
129
|
+
});
|
|
130
|
+
return /* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvTypography, { variant, className: cx(css({
|
|
131
|
+
textAlign: "center",
|
|
132
|
+
width: titleWidth - utils.TITLE_MARGIN,
|
|
133
|
+
marginRight: utils.TITLE_MARGIN
|
|
134
|
+
}), titleClassName), disabled: titleDisabled, children: title }, title);
|
|
135
|
+
}) }) : null;
|
|
173
136
|
const StepNavigation = {
|
|
174
137
|
Default: DefaultNavigation.HvDefaultNavigation,
|
|
175
138
|
Simple: SimpleNavigation.HvSimpleNavigation
|
|
176
139
|
}[type];
|
|
177
|
-
return /* @__PURE__ */ jsxRuntime.jsx(StepNavigation, {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
stepsWidth,
|
|
186
|
-
navWidth,
|
|
187
|
-
...itemsProps
|
|
188
|
-
}) => /* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvBox, {
|
|
189
|
-
component: "nav",
|
|
190
|
-
style: {
|
|
191
|
-
width: `${navWidth}px`,
|
|
192
|
-
margin: 0
|
|
193
|
-
},
|
|
194
|
-
"aria-label": ariaLabel,
|
|
195
|
-
children: drawItems(itemsProps)
|
|
196
|
-
})
|
|
197
|
-
});
|
|
140
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StepNavigation, { numSteps: steps.length, stepSize: stepSizeKey, getTitles, getDynamicValues, className: cx(classes.root, className), ...others, children: ({
|
|
141
|
+
stepsWidth,
|
|
142
|
+
navWidth,
|
|
143
|
+
...itemsProps
|
|
144
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvBox, { component: "nav", style: {
|
|
145
|
+
width: `${navWidth}px`,
|
|
146
|
+
margin: 0
|
|
147
|
+
}, "aria-label": ariaLabel, children: drawItems(itemsProps) }) });
|
|
198
148
|
};
|
|
199
149
|
exports.stepNavigationClasses = StepNavigation_styles.staticClasses;
|
|
200
150
|
exports.HvStepNavigation = HvStepNavigation;
|