@hitachivantara/uikit-react-lab 3.54.0 → 3.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/Controls/Controls.d.ts +2 -10
  2. package/dist/Controls/RightControl/RightControl.d.ts +1 -1
  3. package/dist/StepNavigation/DefaultNavigation/DefaultNavigation.d.ts +3 -1
  4. package/dist/StepNavigation/DefaultNavigation/DefaultNavigation.js +2 -7
  5. package/dist/StepNavigation/DefaultNavigation/DefaultNavigation.js.map +1 -1
  6. package/dist/StepNavigation/DefaultNavigation/Step/Step.d.ts +7 -2
  7. package/dist/StepNavigation/DefaultNavigation/Step/Step.js +11 -4
  8. package/dist/StepNavigation/DefaultNavigation/Step/Step.js.map +1 -1
  9. package/dist/StepNavigation/DefaultNavigation/utils.js +3 -2
  10. package/dist/StepNavigation/DefaultNavigation/utils.js.map +1 -1
  11. package/dist/StepNavigation/SimpleNavigation/Dot/Dot.d.ts +1 -1
  12. package/dist/StepNavigation/SimpleNavigation/Dot/Dot.js +13 -9
  13. package/dist/StepNavigation/SimpleNavigation/Dot/Dot.js.map +1 -1
  14. package/dist/StepNavigation/SimpleNavigation/SimpleNavigation.d.ts +3 -1
  15. package/dist/StepNavigation/SimpleNavigation/SimpleNavigation.js +2 -9
  16. package/dist/StepNavigation/SimpleNavigation/SimpleNavigation.js.map +1 -1
  17. package/dist/StepNavigation/SimpleNavigation/utils.js +10 -8
  18. package/dist/StepNavigation/SimpleNavigation/utils.js.map +1 -1
  19. package/dist/StepNavigation/StepNavigation.d.ts +6 -5
  20. package/dist/StepNavigation/StepNavigation.js +21 -9
  21. package/dist/StepNavigation/StepNavigation.js.map +1 -1
  22. package/dist/Table/TableBody/TableBody.d.ts +4 -0
  23. package/dist/legacy/Controls/Controls.d.ts +2 -10
  24. package/dist/legacy/Controls/RightControl/RightControl.d.ts +1 -1
  25. package/dist/legacy/StepNavigation/DefaultNavigation/DefaultNavigation.d.ts +3 -1
  26. package/dist/legacy/StepNavigation/DefaultNavigation/DefaultNavigation.js +3 -8
  27. package/dist/legacy/StepNavigation/DefaultNavigation/DefaultNavigation.js.map +1 -1
  28. package/dist/legacy/StepNavigation/DefaultNavigation/Step/Step.d.ts +7 -2
  29. package/dist/legacy/StepNavigation/DefaultNavigation/Step/Step.js +11 -4
  30. package/dist/legacy/StepNavigation/DefaultNavigation/Step/Step.js.map +1 -1
  31. package/dist/legacy/StepNavigation/DefaultNavigation/utils.js +3 -2
  32. package/dist/legacy/StepNavigation/DefaultNavigation/utils.js.map +1 -1
  33. package/dist/legacy/StepNavigation/SimpleNavigation/Dot/Dot.d.ts +1 -1
  34. package/dist/legacy/StepNavigation/SimpleNavigation/Dot/Dot.js +15 -11
  35. package/dist/legacy/StepNavigation/SimpleNavigation/Dot/Dot.js.map +1 -1
  36. package/dist/legacy/StepNavigation/SimpleNavigation/SimpleNavigation.d.ts +3 -1
  37. package/dist/legacy/StepNavigation/SimpleNavigation/SimpleNavigation.js +3 -9
  38. package/dist/legacy/StepNavigation/SimpleNavigation/SimpleNavigation.js.map +1 -1
  39. package/dist/legacy/StepNavigation/SimpleNavigation/utils.js +9 -5
  40. package/dist/legacy/StepNavigation/SimpleNavigation/utils.js.map +1 -1
  41. package/dist/legacy/StepNavigation/StepNavigation.d.ts +6 -5
  42. package/dist/legacy/StepNavigation/StepNavigation.js +21 -9
  43. package/dist/legacy/StepNavigation/StepNavigation.js.map +1 -1
  44. package/dist/legacy/Table/TableBody/TableBody.d.ts +4 -0
  45. package/dist/modern/Controls/Controls.d.ts +2 -10
  46. package/dist/modern/Controls/RightControl/RightControl.d.ts +1 -1
  47. package/dist/modern/StepNavigation/DefaultNavigation/DefaultNavigation.d.ts +3 -1
  48. package/dist/modern/StepNavigation/DefaultNavigation/DefaultNavigation.js +3 -6
  49. package/dist/modern/StepNavigation/DefaultNavigation/DefaultNavigation.js.map +1 -1
  50. package/dist/modern/StepNavigation/DefaultNavigation/Step/Step.d.ts +7 -2
  51. package/dist/modern/StepNavigation/DefaultNavigation/Step/Step.js +11 -4
  52. package/dist/modern/StepNavigation/DefaultNavigation/Step/Step.js.map +1 -1
  53. package/dist/modern/StepNavigation/DefaultNavigation/utils.js +3 -2
  54. package/dist/modern/StepNavigation/DefaultNavigation/utils.js.map +1 -1
  55. package/dist/modern/StepNavigation/SimpleNavigation/Dot/Dot.d.ts +1 -1
  56. package/dist/modern/StepNavigation/SimpleNavigation/Dot/Dot.js +15 -9
  57. package/dist/modern/StepNavigation/SimpleNavigation/Dot/Dot.js.map +1 -1
  58. package/dist/modern/StepNavigation/SimpleNavigation/SimpleNavigation.d.ts +3 -1
  59. package/dist/modern/StepNavigation/SimpleNavigation/SimpleNavigation.js +3 -7
  60. package/dist/modern/StepNavigation/SimpleNavigation/SimpleNavigation.js.map +1 -1
  61. package/dist/modern/StepNavigation/SimpleNavigation/utils.js +7 -5
  62. package/dist/modern/StepNavigation/SimpleNavigation/utils.js.map +1 -1
  63. package/dist/modern/StepNavigation/StepNavigation.d.ts +6 -5
  64. package/dist/modern/StepNavigation/StepNavigation.js +21 -9
  65. package/dist/modern/StepNavigation/StepNavigation.js.map +1 -1
  66. package/dist/modern/Table/TableBody/TableBody.d.ts +4 -0
  67. package/package.json +3 -3
@@ -1,12 +1,11 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  var _excluded = ["numSteps", "stepSize", "getTitles", "getDynamicValues", "children"];
3
- import "core-js/modules/es.array.includes.js";
4
3
  import "core-js/modules/es.array.concat.js";
5
4
  import React from "react";
6
5
  import PropTypes from "prop-types";
7
- import { useTheme, withStyles } from "@material-ui/core";
6
+ import { withStyles } from "@material-ui/core";
8
7
  import HvDot from "./Dot";
9
- import { defaultColor, disabledColor, dotSizes } from "./utils";
8
+ import { getColor, dotSizes } from "./utils";
10
9
  import styles from "./styles";
11
10
  /**
12
11
  * Simple Navigation
@@ -20,8 +19,7 @@ var HvSimpleNavigation = function HvSimpleNavigation(_ref) {
20
19
  children = _ref.children,
21
20
  other = _objectWithoutProperties(_ref, _excluded);
22
21
 
23
- var theme = useTheme(); // step values
24
-
22
+ // step values
25
23
  var dotSize = dotSizes[stepSize];
26
24
  var StepComponent = HvDot; //
27
25
 
@@ -33,10 +31,6 @@ var HvSimpleNavigation = function HvSimpleNavigation(_ref) {
33
31
  separatorWidth = _getDynamicValues.separatorWidth; // separator values
34
32
 
35
33
 
36
- var getColor = function getColor(state) {
37
- return ["Current", "Disabled"].includes(state) ? disabledColor(theme) : defaultColor(theme);
38
- };
39
-
40
34
  var maxWidth = Math.max(titleWidth - dotSize, separatorWidth);
41
35
  var minWidth = Math.max(titleWidth - dotSize * 1.25, separatorWidth); //
42
36
 
@@ -1 +1 @@
1
- {"version":3,"file":"SimpleNavigation.js","names":["React","PropTypes","useTheme","withStyles","HvDot","defaultColor","disabledColor","dotSizes","styles","HvSimpleNavigation","numSteps","stepSize","getTitles","getDynamicValues","children","other","theme","dotSize","StepComponent","stepsWidth","width","titleWidth","separatorWidth","getColor","state","includes","maxWidth","Math","max","minWidth","Steps","titles","rawTitle","number","title","navWidth","separatorValues","height","stepValues","minSize","maxSize","propTypes","className","string","classes","shape","root","isRequired","oneOf","func","elementType","name"],"sources":["../../../../src/StepNavigation/SimpleNavigation/SimpleNavigation.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport { useTheme, withStyles } from \"@material-ui/core\";\n\nimport HvDot from \"./Dot\";\nimport { defaultColor, disabledColor, dotSizes } from \"./utils\";\nimport styles from \"./styles\";\n\n/**\n * Simple Navigation\n */\nconst HvSimpleNavigation = ({\n numSteps,\n stepSize,\n getTitles,\n getDynamicValues,\n children,\n ...other\n}) => {\n const theme = 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 getColor = (state) =>\n [\"Current\", \"Disabled\"].includes(state) ? disabledColor(theme) : defaultColor(theme);\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 title: `${number}. ${rawTitle}`,\n titleWidth,\n }));\n\n return (\n <div {...other}>\n {titles}\n <Steps\n {...{\n stepsWidth,\n navWidth: width,\n separatorValues: {\n minWidth,\n maxWidth,\n getColor,\n height: 2,\n },\n stepValues: {\n minSize: dotSize,\n maxSize: 1.5 * dotSize,\n StepComponent,\n },\n }}\n />\n </div>\n );\n};\n\nHvSimpleNavigation.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n }).isRequired,\n /**\n * Number of steps to show on the component.\n */\n numSteps: PropTypes.number.isRequired,\n /**\n * Sets one of the standard sizes of the steps\n */\n stepSize: PropTypes.oneOf([\"XS\", \"SM\", \"MD\", \"LG\", \"XL\"]).isRequired,\n /**\n * Returns dynamic width values of the component (width, titleWidth, separatorWidth).\n */\n getDynamicValues: PropTypes.func.isRequired,\n /**\n * Returns a JSX.element of the titles container.\n */\n getTitles: PropTypes.func.isRequired,\n /**\n * Component to render Step Navigation with props = {separatorValues, stepValues, stepsWidth}\n */\n children: PropTypes.elementType.isRequired,\n};\n\nexport default withStyles(styles, { name: \"HvSimpleNavigation\" })(HvSimpleNavigation);\n"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SAASC,QAAT,EAAmBC,UAAnB,QAAqC,mBAArC;AAEA,OAAOC,KAAP,MAAkB,OAAlB;AACA,SAASC,YAAT,EAAuBC,aAAvB,EAAsCC,QAAtC,QAAsD,SAAtD;AACA,OAAOC,MAAP,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AAI,EAAE;AAAR,CAAT,CAAV,CAAmD1C,kBAAnD,CAAf"}
1
+ {"version":3,"file":"SimpleNavigation.js","names":["React","PropTypes","withStyles","HvDot","getColor","dotSizes","styles","HvSimpleNavigation","numSteps","stepSize","getTitles","getDynamicValues","children","other","dotSize","StepComponent","stepsWidth","width","titleWidth","separatorWidth","maxWidth","Math","max","minWidth","Steps","titles","rawTitle","number","title","navWidth","separatorValues","height","stepValues","minSize","maxSize","propTypes","className","string","classes","shape","root","isRequired","oneOf","func","elementType","name"],"sources":["../../../../src/StepNavigation/SimpleNavigation/SimpleNavigation.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport { withStyles } from \"@material-ui/core\";\n\nimport HvDot from \"./Dot\";\nimport { getColor, dotSizes } from \"./utils\";\nimport styles from \"./styles\";\n\n/**\n * Simple Navigation\n */\nconst HvSimpleNavigation = ({\n numSteps,\n stepSize,\n getTitles,\n getDynamicValues,\n children,\n ...other\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 title: `${number}. ${rawTitle}`,\n titleWidth,\n }));\n\n return (\n <div {...other}>\n {titles}\n <Steps\n {...{\n stepsWidth,\n navWidth: width,\n separatorValues: {\n minWidth,\n maxWidth,\n getColor,\n height: 2,\n },\n stepValues: {\n minSize: dotSize,\n maxSize: 1.5 * dotSize,\n StepComponent,\n },\n }}\n />\n </div>\n );\n};\n\nHvSimpleNavigation.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n }).isRequired,\n /**\n * Number of steps to show on the component.\n */\n numSteps: PropTypes.number.isRequired,\n /**\n * Sets one of the standard sizes of the steps\n */\n stepSize: PropTypes.oneOf([\"XS\", \"SM\", \"MD\", \"LG\", \"XL\"]).isRequired,\n /**\n * Returns dynamic width values of the component (width, titleWidth, separatorWidth).\n */\n getDynamicValues: PropTypes.func.isRequired,\n /**\n * Returns a JSX.element of the titles container.\n */\n getTitles: PropTypes.func.isRequired,\n /**\n * Component to render Step Navigation with props = {separatorValues, stepValues, stepsWidth}\n */\n children: PropTypes.elementType.isRequired,\n};\n\nexport default withStyles(styles, { name: \"HvSimpleNavigation\" })(HvSimpleNavigation);\n"],"mappings":";;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SAASC,UAAT,QAA2B,mBAA3B;AAEA,OAAOC,KAAP,MAAkB,OAAlB;AACA,SAASC,QAAT,EAAmBC,QAAnB,QAAmC,SAAnC;AACA,OAAOC,MAAP,MAAmB,UAAnB;AAEA;AACA;AACA;;AACA,IAAMC,kBAAkB,GAAG,SAArBA,kBAAqB,OAOrB;EAAA,IANJC,QAMI,QANJA,QAMI;EAAA,IALJC,QAKI,QALJA,QAKI;EAAA,IAJJC,SAII,QAJJA,SAII;EAAA,IAHJC,gBAGI,QAHJA,gBAGI;EAAA,IAFJC,QAEI,QAFJA,QAEI;EAAA,IADDC,KACC;;EACJ;EACA,IAAMC,OAAO,GAAGT,QAAQ,CAACI,QAAD,CAAxB;EACA,IAAMM,aAAa,GAAGZ,KAAtB,CAHI,CAIJ;;EAEA,IAAMa,UAAU,GAAG,CAACR,QAAQ,GAAG,GAAZ,IAAmBM,OAAtC;;EACA,wBAA8CH,gBAAgB,CAACK,UAAD,CAA9D;EAAA,IAAQC,KAAR,qBAAQA,KAAR;EAAA,IAAeC,UAAf,qBAAeA,UAAf;EAAA,IAA2BC,cAA3B,qBAA2BA,cAA3B,CA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AAS,CAACyC,KAAV,CAAgB,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,EAAyB,IAAzB,CAAhB,EAAgDD,UArB7B;;EAsB7B;AACF;AACA;EACE9B,gBAAgB,EAAEV,SAAS,CAAC0C,IAAV,CAAeF,UAzBJ;;EA0B7B;AACF;AACA;EACE/B,SAAS,EAAET,SAAS,CAAC0C,IAAV,CAAeF,UA7BG;;EA8B7B;AACF;AACA;EACE7B,QAAQ,EAAEX,SAAS,CAAC2C,WAAV,CAAsBH;AAjCH,CAA/B;AAoCA,eAAevC,UAAU,CAACI,MAAD,EAAS;EAAEuC,IAAI,EAAE;AAAR,CAAT,CAAV,CAAmDtC,kBAAnD,CAAf"}
@@ -7,16 +7,20 @@ var dotSizes = {
7
7
  };
8
8
 
9
9
  var defaultColor = function defaultColor(theme) {
10
- var _theme$hv, _theme$hv$palette, _theme$hv$palette$acc;
10
+ var _theme$hv$palette$acc, _theme$hv, _theme$hv$palette, _theme$hv$palette$acc2;
11
11
 
12
- return theme === null || theme === void 0 ? void 0 : (_theme$hv = theme.hv) === null || _theme$hv === void 0 ? void 0 : (_theme$hv$palette = _theme$hv.palette) === null || _theme$hv$palette === void 0 ? void 0 : (_theme$hv$palette$acc = _theme$hv$palette.accent) === null || _theme$hv$palette$acc === void 0 ? void 0 : _theme$hv$palette$acc.acce1;
12
+ return (_theme$hv$palette$acc = theme === null || theme === void 0 ? void 0 : (_theme$hv = theme.hv) === null || _theme$hv === void 0 ? void 0 : (_theme$hv$palette = _theme$hv.palette) === null || _theme$hv$palette === void 0 ? void 0 : (_theme$hv$palette$acc2 = _theme$hv$palette.accent) === null || _theme$hv$palette$acc2 === void 0 ? void 0 : _theme$hv$palette$acc2.acce1) !== null && _theme$hv$palette$acc !== void 0 ? _theme$hv$palette$acc : "acce1";
13
13
  };
14
14
 
15
15
  var disabledColor = function disabledColor(theme) {
16
- var _theme$hv2, _theme$hv2$palette, _theme$hv2$palette$at;
16
+ var _theme$hv$palette$atm, _theme$hv2, _theme$hv2$palette, _theme$hv2$palette$at;
17
17
 
18
- return theme === null || theme === void 0 ? void 0 : (_theme$hv2 = theme.hv) === null || _theme$hv2 === void 0 ? void 0 : (_theme$hv2$palette = _theme$hv2.palette) === null || _theme$hv2$palette === void 0 ? void 0 : (_theme$hv2$palette$at = _theme$hv2$palette.atmosphere) === null || _theme$hv2$palette$at === void 0 ? void 0 : _theme$hv2$palette$at.atmo5;
18
+ return (_theme$hv$palette$atm = theme === null || theme === void 0 ? void 0 : (_theme$hv2 = theme.hv) === null || _theme$hv2 === void 0 ? void 0 : (_theme$hv2$palette = _theme$hv2.palette) === null || _theme$hv2$palette === void 0 ? void 0 : (_theme$hv2$palette$at = _theme$hv2$palette.atmosphere) === null || _theme$hv2$palette$at === void 0 ? void 0 : _theme$hv2$palette$at.atmo5) !== null && _theme$hv$palette$atm !== void 0 ? _theme$hv$palette$atm : "atmo5";
19
19
  };
20
20
 
21
- export { dotSizes, defaultColor, disabledColor };
21
+ var getColor = function getColor(state, theme) {
22
+ return state === "Disabled" ? disabledColor(theme) : defaultColor(theme);
23
+ };
24
+
25
+ export { dotSizes, getColor };
22
26
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":["dotSizes","XS","SM","MD","LG","XL","defaultColor","theme","hv","palette","accent","acce1","disabledColor","atmosphere","atmo5"],"sources":["../../../../src/StepNavigation/SimpleNavigation/utils.js"],"sourcesContent":["const dotSizes = {\n XS: 8,\n SM: 10,\n MD: 12,\n LG: 14,\n XL: 16,\n};\n\nconst defaultColor = (theme) => theme?.hv?.palette?.accent?.acce1;\nconst disabledColor = (theme) => theme?.hv?.palette?.atmosphere?.atmo5;\n\nexport { dotSizes, defaultColor, disabledColor };\n"],"mappings":"AAAA,IAAMA,QAAQ,GAAG;EACfC,EAAE,EAAE,CADW;EAEfC,EAAE,EAAE,EAFW;EAGfC,EAAE,EAAE,EAHW;EAIfC,EAAE,EAAE,EAJW;EAKfC,EAAE,EAAE;AALW,CAAjB;;AAQA,IAAMC,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD;EAAA;;EAAA,OAAWA,KAAX,aAAWA,KAAX,oCAAWA,KAAK,CAAEC,EAAlB,mEAAW,UAAWC,OAAtB,+EAAW,kBAAoBC,MAA/B,0DAAW,sBAA4BC,KAAvC;AAAA,CAArB;;AACA,IAAMC,aAAa,GAAG,SAAhBA,aAAgB,CAACL,KAAD;EAAA;;EAAA,OAAWA,KAAX,aAAWA,KAAX,qCAAWA,KAAK,CAAEC,EAAlB,qEAAW,WAAWC,OAAtB,gFAAW,mBAAoBI,UAA/B,0DAAW,sBAAgCC,KAA3C;AAAA,CAAtB;;AAEA,SAASd,QAAT,EAAmBM,YAAnB,EAAiCM,aAAjC"}
1
+ {"version":3,"file":"utils.js","names":["dotSizes","XS","SM","MD","LG","XL","defaultColor","theme","hv","palette","accent","acce1","disabledColor","atmosphere","atmo5","getColor","state"],"sources":["../../../../src/StepNavigation/SimpleNavigation/utils.js"],"sourcesContent":["const dotSizes = {\n XS: 8,\n SM: 10,\n MD: 12,\n LG: 14,\n XL: 16,\n};\n\nconst defaultColor = (theme) => theme?.hv?.palette?.accent?.acce1 ?? \"acce1\";\nconst disabledColor = (theme) => theme?.hv?.palette?.atmosphere?.atmo5 ?? \"atmo5\";\n\nconst getColor = (state, theme) =>\n state === \"Disabled\" ? disabledColor(theme) : defaultColor(theme);\n\nexport { dotSizes, getColor };\n"],"mappings":"AAAA,IAAMA,QAAQ,GAAG;EACfC,EAAE,EAAE,CADW;EAEfC,EAAE,EAAE,EAFW;EAGfC,EAAE,EAAE,EAHW;EAIfC,EAAE,EAAE,EAJW;EAKfC,EAAE,EAAE;AALW,CAAjB;;AAQA,IAAMC,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD;EAAA;;EAAA,gCAAWA,KAAX,aAAWA,KAAX,oCAAWA,KAAK,CAAEC,EAAlB,mEAAW,UAAWC,OAAtB,gFAAW,kBAAoBC,MAA/B,2DAAW,uBAA4BC,KAAvC,yEAAgD,OAAhD;AAAA,CAArB;;AACA,IAAMC,aAAa,GAAG,SAAhBA,aAAgB,CAACL,KAAD;EAAA;;EAAA,gCAAWA,KAAX,aAAWA,KAAX,qCAAWA,KAAK,CAAEC,EAAlB,qEAAW,WAAWC,OAAtB,gFAAW,mBAAoBI,UAA/B,0DAAW,sBAAgCC,KAA3C,yEAAoD,OAApD;AAAA,CAAtB;;AAEA,IAAMC,QAAQ,GAAG,SAAXA,QAAW,CAACC,KAAD,EAAQT,KAAR;EAAA,OACfS,KAAK,KAAK,UAAV,GAAuBJ,aAAa,CAACL,KAAD,CAApC,GAA8CD,YAAY,CAACC,KAAD,CAD3C;AAAA,CAAjB;;AAGA,SAASP,QAAT,EAAmBe,QAAnB"}
@@ -1,5 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { StandardProps } from "@material-ui/core";
3
+ import { Breakpoint } from "@material-ui/core/styles/createBreakpoints";
3
4
  import { HvStepProps } from "./DefaultNavigation/Step/Step";
4
5
 
5
6
  export type HvStepNavigationClassKey = "root";
@@ -15,7 +16,7 @@ export type HvStepNavigationProps = StandardProps<
15
16
  /**
16
17
  * Steps to show on the component.
17
18
  */
18
- steps: Array<Pick<HvStepProps, "state" | "title" | "onClick" | "className">> & {
19
+ steps: Array<Pick<HvStepProps, "state" | "title" | "onClick" | "className" | "disabled">> & {
19
20
  /**
20
21
  * Class names to override styles on the separator component after the step.
21
22
  */
@@ -26,15 +27,15 @@ export type HvStepNavigationProps = StandardProps<
26
27
  titleClassName: string;
27
28
  };
28
29
  /**
29
- * Sets one of the standard sizes of the steps
30
+ * Sets one of the standard sizes of the steps.
30
31
  */
31
32
  stepSize?: "XS" | "SM" | "MD" | "LG" | "XL";
32
33
  /**
33
- * Width of the component element.
34
+ * Width of the component element on each breakpoint screen resolution.
34
35
  */
35
- width?: number;
36
+ width?: { [breakpoint in Breakpoint]?: number };
36
37
  /**
37
- * Defines either show a title or only a tooltip on each step component
38
+ * Defines either show a title or only a tooltip on each step component.
38
39
  */
39
40
  showTitles?: boolean;
40
41
  };
@@ -52,8 +52,8 @@ import styles from "./styles";
52
52
  * correspondent to the current media breakpoint;
53
53
  * * Choose either you want to <b>showTitles</b> near to each step component or a tootlip on hover;
54
54
  * * Define a <b>width</b> of the component. If you don't define any value and the step component has no title
55
- * displayed above, the width of the separator element;
56
- * will be 100px. If the step component has titles, each one will have 215px of width by default.
55
+ * displayed above, the width of the separator element will be 100px.
56
+ * If the step component has titles, each one will have 215px of width by default.
57
57
  */
58
58
 
59
59
  var HvStepNavigation = function HvStepNavigation(_ref) {
@@ -153,7 +153,7 @@ var HvStepNavigation = function HvStepNavigation(_ref) {
153
153
  }, stepProps))))));
154
154
 
155
155
  if (index < steps.length - 1) {
156
- var separatorElement = styledSeparatorElement(title, separatorClassName, height, [steps[index + 1].state, state].includes("Current") ? minWidth : maxWidth, getColor(state));
156
+ var separatorElement = styledSeparatorElement(title, separatorClassName, height, [steps[index + 1].state, state].includes("Current") ? minWidth : maxWidth, getColor(steps[index + 1].state === "Disabled" ? "Disabled" : state, theme));
157
157
  return [].concat(_toConsumableArray(acc), [stepElement, separatorElement]);
158
158
  }
159
159
 
@@ -165,9 +165,9 @@ var HvStepNavigation = function HvStepNavigation(_ref) {
165
165
  };
166
166
 
167
167
  var getDynamicValues = function getDynamicValues(stepsWidth) {
168
- var _theme$breakpoints$va, _theme$breakpoints$va2;
168
+ var _width$breakpoint, _theme$breakpoints$va, _theme$breakpoints$va2;
169
169
 
170
- var maxWidth = width !== null && width !== void 0 ? width : Math.max(Number(hasTitles) * (TITLE_WIDTH + TITLE_MARGIN) * steps.length - TITLE_MARGIN, SEPARATOR_WIDTH * (steps.length - 1) + stepsWidth);
170
+ var maxWidth = (_width$breakpoint = width === null || width === void 0 ? void 0 : width[breakpoint]) !== null && _width$breakpoint !== void 0 ? _width$breakpoint : Math.max(Number(hasTitles) * (TITLE_WIDTH + TITLE_MARGIN) * steps.length - TITLE_MARGIN, SEPARATOR_WIDTH * (steps.length - 1) + stepsWidth);
171
171
  var next = theme.breakpoints.keys.find(function (_, index, self) {
172
172
  return index - 1 >= 0 ? self[index - 1] === breakpoint : false;
173
173
  });
@@ -315,9 +315,15 @@ process.env.NODE_ENV !== "production" ? HvStepNavigation.propTypes = {
315
315
  title: PropTypes.string.isRequired,
316
316
 
317
317
  /**
318
- * State of the step. Values = {"Pending", "Failed", "Completed", "Current", "Disabled"}.
318
+ * State of the step. Values = {"Pending", "Failed", "Completed", "Current", "Disabled", "Enabled"}.
319
319
  */
320
- state: PropTypes.oneOf(["Pending", "Failed", "Completed", "Current", "Disabled"]).isRequired
320
+ state: PropTypes.oneOf(["Pending", "Failed", "Completed", "Current", "Disabled", "Enabled"]).isRequired,
321
+
322
+ /**
323
+ * Define if a step is disabled/enabled.
324
+ * If this property is not defined and the step is on state "Disabled", the step component will be disabled
325
+ */
326
+ disabled: PropTypes.bool
321
327
  })).isRequired,
322
328
 
323
329
  /**
@@ -326,9 +332,15 @@ process.env.NODE_ENV !== "production" ? HvStepNavigation.propTypes = {
326
332
  stepSize: PropTypes.oneOf(["XS", "SM", "MD", "LG", "XL"]),
327
333
 
328
334
  /**
329
- * Width of the component.
335
+ * Width of the component element on each breakpoint screen resolution.
330
336
  */
331
- width: PropTypes.number,
337
+ width: PropTypes.shape({
338
+ xs: PropTypes.number,
339
+ sm: PropTypes.number,
340
+ md: PropTypes.number,
341
+ lg: PropTypes.number,
342
+ xl: PropTypes.number
343
+ }),
332
344
 
333
345
  /**
334
346
  * Defines either show a title or only a tooltip on each step component
@@ -1 +1 @@
1
- {"version":3,"file":"StepNavigation.js","names":["React","PropTypes","clsx","withStyles","Typography","styled","useTheme","HvTooltip","HvTypography","useWidth","HvDefaultNavigation","HvSimpleNavigation","SEPARATOR_WIDTH","TITLE_MARGIN","TITLE_WIDTH","styles","HvStepNavigation","className","classes","width","steps","stepSize","showTitles","type","others","theme","breakpoint","stepSizeKey","includes","hasTitles","styledLi","containerSize","height","styledDiv","styledSeparatorElement","title","separatorClassName","separatorHeight","separatorWidth","backgroundColor","Separator","separatorElement","separator","drawItems","separatorValues","minWidth","maxWidth","getColor","stepValues","minSize","maxSize","StepComponent","items","reduce","acc","index","state","props","StepContainer","Step","Math","max","stepProps","size","number","stepElement","li","length","ol","getDynamicValues","stepsWidth","Number","next","breakpoints","keys","find","_","self","navWidth","min","values","titleWidth","ceil","styledTitle","titleClassName","variant","stepTitle","textAlign","marginRight","getTitles","getTitleProps","titles","map","rawTitle","Title","StepNavigation","Default","Simple","numSteps","root","itemsProps","margin","propTypes","string","shape","isRequired","oneOf","arrayOf","bool","name"],"sources":["../../../src/StepNavigation/StepNavigation.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\n\nimport { withStyles, Typography, styled, useTheme } from \"@material-ui/core\";\nimport { HvTooltip, HvTypography, useWidth } from \"@hitachivantara/uikit-react-core\";\n\nimport HvDefaultNavigation from \"./DefaultNavigation\";\nimport HvSimpleNavigation from \"./SimpleNavigation\";\nimport { SEPARATOR_WIDTH, TITLE_MARGIN, TITLE_WIDTH } from \"./utils\";\nimport styles from \"./styles\";\n\n/**\n * Navigation page with steps.\n *\n * You need to define the <b>steps<b/> displayed on the component so that itself can be drawn on the UI.\n * On each step, you need to define a <b>state</b> - 'Pending', 'Failed', 'Completed', 'Current', 'Disabled' -\n * and a <b>title</b> to be shown as a tooltip or a text above of the step. You can also:\n * * Define a <b>className</b> on each step element;\n * * Define a <b>separatorClassName</b> to specify a className for the separator element. The default height\n * values of the separator element are 2px/3px on 'Simple'/'Default' layouts respectively;\n * * Define a <b>titleClassName</b> to specify a className for the title above each step element.\n *\n * For the root element, you can:\n * * Define a <b>className</b>;\n * * Choose a <b>type</b> of layout: 'Simple' or 'Default';\n * * Choose the <b>stepSize</b> of the step component: \"XS\", \"SM\", \"MD\", \"LG\", \"XL\". The default size will be\n * correspondent to the current media breakpoint;\n * * Choose either you want to <b>showTitles</b> near to each step component or a tootlip on hover;\n * * Define a <b>width</b> of the component. If you don't define any value and the step component has no title\n * displayed above, the width of the separator element;\n * will be 100px. If the step component has titles, each one will have 215px of width by default.\n */\nconst HvStepNavigation = ({\n className,\n classes,\n width,\n steps,\n stepSize,\n showTitles,\n type = \"Default\",\n ...others\n}) => {\n const theme = useTheme();\n // current breakpoint 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n const breakpoint = useWidth();\n // step configurations\n const stepSizeKey = stepSize ?? ([\"xs\", \"sm\"].includes(breakpoint) ? \"SM\" : \"MD\");\n const hasTitles = showTitles ?? ![\"xs\", \"sm\"].includes(breakpoint);\n\n const styledLi = (containerSize) =>\n styled(\"li\")({\n width: containerSize,\n height: containerSize,\n });\n\n const styledDiv = (containerSize) =>\n styled(\"div\")({\n width: containerSize,\n height: containerSize,\n });\n\n const styledSeparatorElement = (\n title,\n separatorClassName,\n separatorHeight,\n separatorWidth,\n backgroundColor\n ) => {\n const Separator = withStyles({\n separatorElement: {\n height: separatorHeight,\n width: separatorWidth,\n backgroundColor,\n },\n })(({ classes: { separatorElement } }) => (\n <div\n aria-label={`separator-${title}`}\n className={clsx(separatorElement, separatorClassName)}\n />\n ));\n return (\n <li aria-hidden key={`separator-${title}`} className={classes.separator}>\n <Separator />\n </li>\n );\n };\n\n const drawItems = ({\n separatorValues: { minWidth, maxWidth, getColor, height },\n stepValues: { minSize, maxSize, StepComponent },\n }) => {\n const items = steps.reduce((acc, { state, title, separatorClassName, ...props }, index) => {\n const containerSize = state === \"Current\" ? maxSize : minSize;\n const StepContainer = styledLi(containerSize);\n const Step = styledDiv(Math.max(containerSize, 30), Math.max(containerSize, 30));\n const stepProps = {\n ...{\n size: stepSizeKey,\n state,\n title,\n number: index + 1,\n ...props,\n },\n };\n const stepElement = (\n <StepContainer key={`step-${title}`} className={classes.li}>\n {hasTitles ? (\n <StepComponent aria-label={`step-${title}`} {...stepProps} />\n ) : (\n <HvTooltip\n placement=\"bottom\"\n title={<HvTypography>{`${index + 1}. ${title}`}</HvTypography>}\n >\n <div aria-label={`step-container-${title}`}>\n <Step className={classes.li}>\n <StepComponent aria-label={`step-${title}`} {...stepProps} />\n </Step>\n </div>\n </HvTooltip>\n )}\n </StepContainer>\n );\n if (index < steps.length - 1) {\n const separatorElement = styledSeparatorElement(\n title,\n separatorClassName,\n height,\n [steps[index + 1].state, state].includes(\"Current\") ? minWidth : maxWidth,\n getColor(state)\n );\n return [...acc, stepElement, separatorElement];\n }\n return [...acc, stepElement];\n }, []);\n\n return <ol className={classes.ol}>{items}</ol>;\n };\n\n const getDynamicValues = (stepsWidth) => {\n const maxWidth =\n width ??\n Math.max(\n Number(hasTitles) * (TITLE_WIDTH + TITLE_MARGIN) * steps.length - TITLE_MARGIN,\n SEPARATOR_WIDTH * (steps.length - 1) + stepsWidth\n );\n const next = theme.breakpoints.keys.find((_, index, self) =>\n index - 1 >= 0 ? self[index - 1] === breakpoint : false\n );\n const navWidth = Math.min(maxWidth, theme.breakpoints.values?.[next] ?? maxWidth);\n const titleWidth = Number(hasTitles) * Math.ceil((navWidth + TITLE_MARGIN) / steps.length);\n const separatorWidth =\n Number(!hasTitles) * Math.ceil((navWidth - stepsWidth) / (steps.length - 1));\n return { width: navWidth, titleWidth, separatorWidth };\n };\n\n const styledTitle = (titleClassName, variant, title, titleWidth) =>\n withStyles({\n stepTitle: {\n textAlign: \"center\",\n width: titleWidth - TITLE_MARGIN,\n marginRight: TITLE_MARGIN,\n },\n })(({ classes: { stepTitle } }) =>\n title ? (\n <HvTypography variant={variant} className={clsx(stepTitle, titleClassName)}>\n {title}\n </HvTypography>\n ) : null\n );\n\n const getTitles = (getTitleProps) =>\n hasTitles ? (\n <div className={classes.titles}>\n {steps.map(({ title: rawTitle, state, titleClassName }, index) => {\n const {\n variant = \"highlightText\",\n title = rawTitle,\n titleWidth = 0,\n } = getTitleProps({\n state,\n rawTitle,\n number: index + 1,\n });\n const Title = styledTitle(titleClassName, variant, title, titleWidth);\n return <Title key={`step-title-${rawTitle}`} />;\n })}\n </div>\n ) : null;\n\n const StepNavigation = {\n Default: HvDefaultNavigation,\n Simple: HvSimpleNavigation,\n }[type];\n\n return (\n <StepNavigation\n {...{\n stepSize: stepSizeKey,\n numSteps: steps.length,\n getTitles,\n getDynamicValues,\n className: clsx(className, classes.root),\n ...others,\n }}\n >\n {({ stepsWidth, navWidth, ...itemsProps }) => (\n <Typography\n component=\"nav\"\n style={{\n width: `${navWidth}px`,\n margin: 0,\n }}\n >\n {drawItems(itemsProps)}\n </Typography>\n )}\n </StepNavigation>\n );\n};\n\nHvStepNavigation.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the li element.\n */\n li: PropTypes.string,\n /**\n * Styles applied to the ol element.\n */\n ol: PropTypes.string,\n /**\n * Styles applied to the separator element.\n */\n separator: PropTypes.string,\n /**\n * Styles applied to the titles container element.\n */\n titles: PropTypes.string,\n }).isRequired,\n /**\n * Type of step navigation. Values = {\"Simple\", \"Default\"}.\n */\n type: PropTypes.oneOf([\"Simple\", \"Default\"]),\n /**\n * Steps to show on the component.\n */\n steps: PropTypes.arrayOf(\n PropTypes.shape({\n /**\n * Class names to override styles on the step component.\n */\n className: PropTypes.string,\n /**\n * Class names to override styles on the separator component after the step.\n */\n separatorClassName: PropTypes.string,\n /**\n * Class names to override styles on the title component above the step.\n */\n titleClassName: PropTypes.string,\n /**\n * Title of the step.\n */\n title: PropTypes.string.isRequired,\n /**\n * State of the step. Values = {\"Pending\", \"Failed\", \"Completed\", \"Current\", \"Disabled\"}.\n */\n state: PropTypes.oneOf([\"Pending\", \"Failed\", \"Completed\", \"Current\", \"Disabled\"]).isRequired,\n })\n ).isRequired,\n /**\n * Sets one of the standard sizes of the steps. Values = {\"XS\", \"SM\", \"MD\", \"LG\", \"XL\"}\n */\n stepSize: PropTypes.oneOf([\"XS\", \"SM\", \"MD\", \"LG\", \"XL\"]),\n /**\n * Width of the component.\n */\n width: PropTypes.number,\n /**\n * Defines either show a title or only a tooltip on each step component\n */\n showTitles: PropTypes.bool,\n};\n\nexport default withStyles(styles, { name: \"HvStepNavigation\" })(HvStepNavigation);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,MAAjB;AAEA,SAASC,UAAT,EAAqBC,UAArB,EAAiCC,MAAjC,EAAyCC,QAAzC,QAAyD,mBAAzD;AACA,SAASC,SAAT,EAAoBC,YAApB,EAAkCC,QAAlC,QAAkD,kCAAlD;AAEA,OAAOC,mBAAP,MAAgC,qBAAhC;AACA,OAAOC,kBAAP,MAA+B,oBAA/B;AACA,SAASC,eAAT,EAA0BC,YAA1B,EAAwCC,WAAxC,QAA2D,SAA3D;AACA,OAAOC,MAAP,MAAmB,UAAnB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB,OASnB;EAAA,IARJC,SAQI,QARJA,SAQI;EAAA,IAPJC,OAOI,QAPJA,OAOI;EAAA,IANJC,KAMI,QANJA,KAMI;EAAA,IALJC,KAKI,QALJA,KAKI;EAAA,IAJJC,QAII,QAJJA,QAII;EAAA,IAHJC,UAGI,QAHJA,UAGI;EAAA,qBAFJC,IAEI;EAAA,IAFJA,IAEI,0BAFG,SAEH;EAAA,IADDC,MACC;;EACJ,IAAMC,KAAK,GAAGnB,QAAQ,EAAtB,CADI,CAEJ;;EACA,IAAMoB,UAAU,GAAGjB,QAAQ,EAA3B,CAHI,CAIJ;;EACA,IAAMkB,WAAW,GAAGN,QAAH,aAAGA,QAAH,cAAGA,QAAH,GAAgB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V;;IAiBd;AACN;AACA;IACMjD,KAAK,EAAEvD,SAAS,CAACyG,KAAV,CAAgB,CAAC,SAAD,EAAY,QAAZ,EAAsB,WAAtB,EAAmC,SAAnC,EAA8C,UAA9C,CAAhB,EAA2ED;EApBpE,CAAhB,CADK,EAuBLA,UA5DyB;;EA6D3B;AACF;AACA;EACEpF,QAAQ,EAAEpB,SAAS,CAACyG,KAAV,CAAgB,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,EAAyB,IAAzB,CAAhB,CAhEiB;;EAiE3B;AACF;AACA;EACEvF,KAAK,EAAElB,SAAS,CAAC+D,MApEU;;EAqE3B;AACF;AACA;EACE1C,UAAU,EAAErB,SAAS,CAAC2G;AAxEK,CAA7B;AA2EA,eAAezG,UAAU,CAACY,MAAD,EAAS;EAAE8F,IAAI,EAAE;AAAR,CAAT,CAAV,CAAiD7F,gBAAjD,CAAf"}
1
+ {"version":3,"file":"StepNavigation.js","names":["React","PropTypes","clsx","withStyles","Typography","styled","useTheme","HvTooltip","HvTypography","useWidth","HvDefaultNavigation","HvSimpleNavigation","SEPARATOR_WIDTH","TITLE_MARGIN","TITLE_WIDTH","styles","HvStepNavigation","className","classes","width","steps","stepSize","showTitles","type","others","theme","breakpoint","stepSizeKey","includes","hasTitles","styledLi","containerSize","height","styledDiv","styledSeparatorElement","title","separatorClassName","separatorHeight","separatorWidth","backgroundColor","Separator","separatorElement","separator","drawItems","separatorValues","minWidth","maxWidth","getColor","stepValues","minSize","maxSize","StepComponent","items","reduce","acc","index","state","props","StepContainer","Step","Math","max","stepProps","size","number","stepElement","li","length","ol","getDynamicValues","stepsWidth","Number","next","breakpoints","keys","find","_","self","navWidth","min","values","titleWidth","ceil","styledTitle","titleClassName","variant","stepTitle","textAlign","marginRight","getTitles","getTitleProps","titles","map","rawTitle","Title","StepNavigation","Default","Simple","numSteps","root","itemsProps","margin","propTypes","string","shape","isRequired","oneOf","arrayOf","disabled","bool","xs","sm","md","lg","xl","name"],"sources":["../../../src/StepNavigation/StepNavigation.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\n\nimport { withStyles, Typography, styled, useTheme } from \"@material-ui/core\";\nimport { HvTooltip, HvTypography, useWidth } from \"@hitachivantara/uikit-react-core\";\n\nimport HvDefaultNavigation from \"./DefaultNavigation\";\nimport HvSimpleNavigation from \"./SimpleNavigation\";\nimport { SEPARATOR_WIDTH, TITLE_MARGIN, TITLE_WIDTH } from \"./utils\";\nimport styles from \"./styles\";\n\n/**\n * Navigation page with steps.\n *\n * You need to define the <b>steps<b/> displayed on the component so that itself can be drawn on the UI.\n * On each step, you need to define a <b>state</b> - 'Pending', 'Failed', 'Completed', 'Current', 'Disabled' -\n * and a <b>title</b> to be shown as a tooltip or a text above of the step. You can also:\n * * Define a <b>className</b> on each step element;\n * * Define a <b>separatorClassName</b> to specify a className for the separator element. The default height\n * values of the separator element are 2px/3px on 'Simple'/'Default' layouts respectively;\n * * Define a <b>titleClassName</b> to specify a className for the title above each step element.\n *\n * For the root element, you can:\n * * Define a <b>className</b>;\n * * Choose a <b>type</b> of layout: 'Simple' or 'Default';\n * * Choose the <b>stepSize</b> of the step component: \"XS\", \"SM\", \"MD\", \"LG\", \"XL\". The default size will be\n * correspondent to the current media breakpoint;\n * * Choose either you want to <b>showTitles</b> near to each step component or a tootlip on hover;\n * * Define a <b>width</b> of the component. If you don't define any value and the step component has no title\n * displayed above, the width of the separator element will be 100px.\n * If the step component has titles, each one will have 215px of width by default.\n */\nconst HvStepNavigation = ({\n className,\n classes,\n width,\n steps,\n stepSize,\n showTitles,\n type = \"Default\",\n ...others\n}) => {\n const theme = useTheme();\n // current breakpoint 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n const breakpoint = useWidth();\n // step configurations\n const stepSizeKey = stepSize ?? ([\"xs\", \"sm\"].includes(breakpoint) ? \"SM\" : \"MD\");\n const hasTitles = showTitles ?? ![\"xs\", \"sm\"].includes(breakpoint);\n\n const styledLi = (containerSize) =>\n styled(\"li\")({\n width: containerSize,\n height: containerSize,\n });\n\n const styledDiv = (containerSize) =>\n styled(\"div\")({\n width: containerSize,\n height: containerSize,\n });\n\n const styledSeparatorElement = (\n title,\n separatorClassName,\n separatorHeight,\n separatorWidth,\n backgroundColor\n ) => {\n const Separator = withStyles({\n separatorElement: {\n height: separatorHeight,\n width: separatorWidth,\n backgroundColor,\n },\n })(({ classes: { separatorElement } }) => (\n <div\n aria-label={`separator-${title}`}\n className={clsx(separatorElement, separatorClassName)}\n />\n ));\n return (\n <li aria-hidden key={`separator-${title}`} className={classes.separator}>\n <Separator />\n </li>\n );\n };\n\n const drawItems = ({\n separatorValues: { minWidth, maxWidth, getColor, height },\n stepValues: { minSize, maxSize, StepComponent },\n }) => {\n const items = steps.reduce((acc, { state, title, separatorClassName, ...props }, index) => {\n const containerSize = state === \"Current\" ? maxSize : minSize;\n const StepContainer = styledLi(containerSize);\n const Step = styledDiv(Math.max(containerSize, 30), Math.max(containerSize, 30));\n const stepProps = {\n ...{\n size: stepSizeKey,\n state,\n title,\n number: index + 1,\n ...props,\n },\n };\n const stepElement = (\n <StepContainer key={`step-${title}`} className={classes.li}>\n {hasTitles ? (\n <StepComponent aria-label={`step-${title}`} {...stepProps} />\n ) : (\n <HvTooltip\n placement=\"bottom\"\n title={<HvTypography>{`${index + 1}. ${title}`}</HvTypography>}\n >\n <div aria-label={`step-container-${title}`}>\n <Step className={classes.li}>\n <StepComponent aria-label={`step-${title}`} {...stepProps} />\n </Step>\n </div>\n </HvTooltip>\n )}\n </StepContainer>\n );\n if (index < steps.length - 1) {\n const separatorElement = styledSeparatorElement(\n title,\n separatorClassName,\n height,\n [steps[index + 1].state, state].includes(\"Current\") ? minWidth : maxWidth,\n getColor(steps[index + 1].state === \"Disabled\" ? \"Disabled\" : state, theme)\n );\n return [...acc, stepElement, separatorElement];\n }\n return [...acc, stepElement];\n }, []);\n\n return <ol className={classes.ol}>{items}</ol>;\n };\n\n const getDynamicValues = (stepsWidth) => {\n const maxWidth =\n width?.[breakpoint] ??\n Math.max(\n Number(hasTitles) * (TITLE_WIDTH + TITLE_MARGIN) * steps.length - TITLE_MARGIN,\n SEPARATOR_WIDTH * (steps.length - 1) + stepsWidth\n );\n const next = theme.breakpoints.keys.find((_, index, self) =>\n index - 1 >= 0 ? self[index - 1] === breakpoint : false\n );\n const navWidth = Math.min(maxWidth, theme.breakpoints.values?.[next] ?? maxWidth);\n const titleWidth = Number(hasTitles) * Math.ceil((navWidth + TITLE_MARGIN) / steps.length);\n const separatorWidth =\n Number(!hasTitles) * Math.ceil((navWidth - stepsWidth) / (steps.length - 1));\n return { width: navWidth, titleWidth, separatorWidth };\n };\n\n const styledTitle = (titleClassName, variant, title, titleWidth) =>\n withStyles({\n stepTitle: {\n textAlign: \"center\",\n width: titleWidth - TITLE_MARGIN,\n marginRight: TITLE_MARGIN,\n },\n })(({ classes: { stepTitle } }) =>\n title ? (\n <HvTypography variant={variant} className={clsx(stepTitle, titleClassName)}>\n {title}\n </HvTypography>\n ) : null\n );\n\n const getTitles = (getTitleProps) =>\n hasTitles ? (\n <div className={classes.titles}>\n {steps.map(({ title: rawTitle, state, titleClassName }, index) => {\n const {\n variant = \"highlightText\",\n title = rawTitle,\n titleWidth = 0,\n } = getTitleProps({\n state,\n rawTitle,\n number: index + 1,\n });\n const Title = styledTitle(titleClassName, variant, title, titleWidth);\n return <Title key={`step-title-${rawTitle}`} />;\n })}\n </div>\n ) : null;\n\n const StepNavigation = {\n Default: HvDefaultNavigation,\n Simple: HvSimpleNavigation,\n }[type];\n\n return (\n <StepNavigation\n {...{\n stepSize: stepSizeKey,\n numSteps: steps.length,\n getTitles,\n getDynamicValues,\n className: clsx(className, classes.root),\n ...others,\n }}\n >\n {({ stepsWidth, navWidth, ...itemsProps }) => (\n <Typography\n component=\"nav\"\n style={{\n width: `${navWidth}px`,\n margin: 0,\n }}\n >\n {drawItems(itemsProps)}\n </Typography>\n )}\n </StepNavigation>\n );\n};\n\nHvStepNavigation.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the li element.\n */\n li: PropTypes.string,\n /**\n * Styles applied to the ol element.\n */\n ol: PropTypes.string,\n /**\n * Styles applied to the separator element.\n */\n separator: PropTypes.string,\n /**\n * Styles applied to the titles container element.\n */\n titles: PropTypes.string,\n }).isRequired,\n /**\n * Type of step navigation. Values = {\"Simple\", \"Default\"}.\n */\n type: PropTypes.oneOf([\"Simple\", \"Default\"]),\n /**\n * Steps to show on the component.\n */\n steps: PropTypes.arrayOf(\n PropTypes.shape({\n /**\n * Class names to override styles on the step component.\n */\n className: PropTypes.string,\n /**\n * Class names to override styles on the separator component after the step.\n */\n separatorClassName: PropTypes.string,\n /**\n * Class names to override styles on the title component above the step.\n */\n titleClassName: PropTypes.string,\n /**\n * Title of the step.\n */\n title: PropTypes.string.isRequired,\n /**\n * State of the step. Values = {\"Pending\", \"Failed\", \"Completed\", \"Current\", \"Disabled\", \"Enabled\"}.\n */\n state: PropTypes.oneOf([\"Pending\", \"Failed\", \"Completed\", \"Current\", \"Disabled\", \"Enabled\"])\n .isRequired,\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: PropTypes.bool,\n })\n ).isRequired,\n /**\n * Sets one of the standard sizes of the steps. Values = {\"XS\", \"SM\", \"MD\", \"LG\", \"XL\"}\n */\n stepSize: PropTypes.oneOf([\"XS\", \"SM\", \"MD\", \"LG\", \"XL\"]),\n /**\n * Width of the component element on each breakpoint screen resolution.\n */\n width: PropTypes.shape({\n xs: PropTypes.number,\n sm: PropTypes.number,\n md: PropTypes.number,\n lg: PropTypes.number,\n xl: PropTypes.number,\n }),\n /**\n * Defines either show a title or only a tooltip on each step component\n */\n showTitles: PropTypes.bool,\n};\n\nexport default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IACMjD,KAAK,EAAEvD,SAAS,CAACyG,KAAV,CAAgB,CAAC,SAAD,EAAY,QAAZ,EAAsB,WAAtB,EAAmC,SAAnC,EAA8C,UAA9C,EAA0D,SAA1D,CAAhB,EACJD,UArBW;;IAsBd;AACN;AACA;AACA;IACMG,QAAQ,EAAE3G,SAAS,CAAC4G;EA1BN,CAAhB,CADK,EA6BLJ,UAlEyB;;EAmE3B;AACF;AACA;EACEpF,QAAQ,EAAEpB,SAAS,CAACyG,KAAV,CAAgB,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,EAAyB,IAAzB,CAAhB,CAtEiB;;EAuE3B;AACF;AACA;EACEvF,KAAK,EAAElB,SAAS,CAACuG,KAAV,CAAgB;IACrBM,EAAE,EAAE7G,SAAS,CAAC+D,MADO;IAErB+C,EAAE,EAAE9G,SAAS,CAAC+D,MAFO;IAGrBgD,EAAE,EAAE/G,SAAS,CAAC+D,MAHO;IAIrBiD,EAAE,EAAEhH,SAAS,CAAC+D,MAJO;IAKrBkD,EAAE,EAAEjH,SAAS,CAAC+D;EALO,CAAhB,CA1EoB;;EAiF3B;AACF;AACA;EACE1C,UAAU,EAAErB,SAAS,CAAC4G;AApFK,CAA7B;AAuFA,eAAe1G,UAAU,CAACY,MAAD,EAAS;EAAEoG,IAAI,EAAE;AAAR,CAAT,CAAV,CAAiDnG,gBAAjD,CAAf"}
@@ -9,6 +9,10 @@ export interface HvTableBodyProps
9
9
  * Defaults to `thead`.
10
10
  */
11
11
  component?: React.ElementType<React.HTMLAttributes<HTMLElement>>;
12
+ /**
13
+ * Sets whether or not there should be arrow navigation between the table rows
14
+ */
15
+ withNavigation: boolean;
12
16
  }
13
17
 
14
18
  export default function HvTableBody(props: HvTableBodyProps): JSX.Element | null;
@@ -1,22 +1,14 @@
1
1
  import { StandardProps } from "@material-ui/core";
2
+ import { HvTableInstance } from "../Table";
2
3
 
3
4
  export type HvControlsClassKey = "root" | "rightSection" | "leftSection";
4
5
 
5
- export interface HvControlsSortValue {
6
- id: string;
7
- desc: string;
8
- }
9
6
  export interface HvControlsViewConfiguration extends Record<string, unknown> {
10
7
  id: string;
11
8
  label: string;
12
9
  icon: React.ReactNode;
13
10
  }
14
11
 
15
- export interface HvControlsCallbacks extends Record<string, unknown> {
16
- setSortBy?: (v: HvControlsSortValue[]) => void;
17
- setGlobalFilter?: (v: string) => void;
18
- }
19
-
20
12
  export interface HvControlsProps
21
13
  extends StandardProps<React.HTMLAttributes<HTMLDivElement>, HvControlsClassKey> {
22
14
  /** Children to be rendered. */
@@ -29,7 +21,7 @@ export interface HvControlsProps
29
21
  * An instance of useHvTable or useTable used to manage the data
30
22
  * if this is not provided data sorting and search must be handled externally
31
23
  */
32
- callbacks?: HvControlsCallbacks;
24
+ callbacks?: Pick<HvTableInstance, "setSortBy" | "setGlobalFilter">;
33
25
  /**
34
26
  * Views configuration required for the view buttons
35
27
  */
@@ -10,7 +10,7 @@ export interface HvControlsViewConfiguration extends Record<string, unknown> {
10
10
  }
11
11
 
12
12
  export interface RightListControls extends ListValueProp {
13
- accesor: string;
13
+ accessor: string;
14
14
  desc: boolean;
15
15
  }
16
16
 
@@ -1,6 +1,8 @@
1
1
  import * as React from "react";
2
2
  import { StandardProps } from "@material-ui/core";
3
3
 
4
+ import { HvTheme } from "@hitachivantara/uikit-react-core";
5
+
4
6
  import { HvStepNavigationProps } from "../StepNavigation";
5
7
  import { HvStepProps } from "./Step";
6
8
 
@@ -12,7 +14,7 @@ export type ComponentChildProps = {
12
14
  separatorValues: {
13
15
  minWidth: number;
14
16
  maxWidth: number;
15
- getColor: (state: HvStepProps["state"]) => any;
17
+ getColor: (state: HvStepProps["state"], theme: HvTheme) => any;
16
18
  height: number;
17
19
  };
18
20
  stepValues: {
@@ -2,9 +2,9 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
2
2
  const _excluded = ["numSteps", "stepSize", "getTitles", "getDynamicValues", "children"];
3
3
  import React from "react";
4
4
  import PropTypes from "prop-types";
5
- import { useTheme, withStyles } from "@material-ui/core";
5
+ import { withStyles } from "@material-ui/core";
6
6
  import HvStep from "./Step";
7
- import { getColor as getStateColor, stepSizes } from "./utils";
7
+ import { getColor, stepSizes } from "./utils";
8
8
  import styles from "./styles";
9
9
  /**
10
10
  * Default Navigation
@@ -20,8 +20,7 @@ const HvDefaultNavigation = _ref => {
20
20
  } = _ref,
21
21
  other = _objectWithoutProperties(_ref, _excluded);
22
22
 
23
- const theme = useTheme(); // step values
24
-
23
+ // step values
25
24
  const {
26
25
  container: maxSize,
27
26
  avatar: minSize
@@ -35,8 +34,6 @@ const HvDefaultNavigation = _ref => {
35
34
  separatorWidth
36
35
  } = getDynamicValues(stepsWidth); // separator values
37
36
 
38
- const getColor = state => getStateColor(state === "Current" ? "Disabled" : state, theme);
39
-
40
37
  const maxWidth = Math.max(titleWidth - minSize, separatorWidth);
41
38
  const minWidth = Math.max(titleWidth - (maxSize + minSize) * 0.5, separatorWidth); //
42
39
 
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultNavigation.js","names":["React","PropTypes","useTheme","withStyles","HvStep","getColor","getStateColor","stepSizes","styles","HvDefaultNavigation","numSteps","stepSize","getTitles","getDynamicValues","children","other","theme","container","maxSize","avatar","minSize","StepComponent","stepsWidth","width","titleWidth","separatorWidth","state","maxWidth","Math","max","minWidth","Steps","titles","variant","navWidth","separatorValues","height","stepValues","propTypes","className","string","classes","shape","root","isRequired","number","oneOf","func","elementType","name"],"sources":["../../../../src/StepNavigation/DefaultNavigation/DefaultNavigation.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport { useTheme, withStyles } from \"@material-ui/core\";\n\nimport HvStep from \"./Step\";\nimport { getColor as getStateColor, stepSizes } from \"./utils\";\nimport styles from \"./styles\";\n\n/**\n * Default Navigation\n */\nconst HvDefaultNavigation = ({\n numSteps,\n stepSize,\n getTitles,\n getDynamicValues,\n children,\n ...other\n}) => {\n const theme = 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 getColor = (state) => getStateColor(state === \"Current\" ? \"Disabled\" : state, theme);\n const maxWidth = Math.max(titleWidth - minSize, separatorWidth);\n const minWidth = Math.max(titleWidth - (maxSize + minSize) * 0.5, separatorWidth);\n //\n\n const Steps = children;\n\n const titles = getTitles(({ state }) => ({\n variant: state === \"Disabled\" ? \"disabledText\" : \"highlightText\",\n titleWidth,\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: 3,\n },\n stepValues: {\n minSize,\n maxSize,\n StepComponent,\n },\n }}\n />\n {titles}\n </div>\n );\n};\n\nHvDefaultNavigation.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n }).isRequired,\n /**\n * Number of steps to show on the component.\n */\n numSteps: PropTypes.number.isRequired,\n /**\n * Sets one of the standard sizes of the steps\n */\n stepSize: PropTypes.oneOf([\"XS\", \"SM\", \"MD\", \"LG\", \"XL\"]).isRequired,\n /**\n * Returns dynamic width values of the component (width, titleWidth, separatorWidth).\n */\n getDynamicValues: PropTypes.func.isRequired,\n /**\n * Returns a JSX.element of the titles container.\n */\n getTitles: PropTypes.func.isRequired,\n /**\n * Component to render Step Navigation with props = {separatorValues, stepValues, stepsWidth}\n */\n children: PropTypes.elementType.isRequired,\n};\n\nexport default withStyles(styles, { name: \"HvDefaultNavigation\" })(HvDefaultNavigation);\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SAASC,QAAT,EAAmBC,UAAnB,QAA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EAFuC,CAAhB,CAAD,CAAxB;EAKA,oBACE,2BAAST,KAAT,eACE,oBAAC,KAAD;IAEIO,UAFJ;IAGIY,QAAQ,EAAEX,KAHd;IAIIY,eAAe,EAAE;MACfL,QADe;MAEfH,QAFe;MAGftB,QAHe;MAIf+B,MAAM,EAAE;IAJO,CAJrB;IAUIC,UAAU,EAAE;MACVjB,OADU;MAEVF,OAFU;MAGVG;IAHU;EAVhB,EADF,EAkBGW,MAlBH,CADF;AAsBD,CArDD;;AAuDA,wCAAAvB,mBAAmB,CAAC6B,SAApB,GAAgC;EAC9B;AACF;AACA;EACEC,SAAS,EAAEtC,SAAS,CAACuC,MAJS;;EAK9B;AACF;AACA;EACEC,OAAO,EAAExC,SAAS,CAACyC,KAAV,CAAgB;IACvB;AACJ;AACA;IACIC,IAAI,EAAE1C,SAAS,CAACuC;EAJO,CAAhB,EAKNI,UAb2B;;EAc9B;AACF;AACA;EACElC,QAAQ,EAAET,SAAS,CAAC4C,MAAV,CAAiBD,UAjBG;;EAkB9B;AACF;AACA;EACEjC,QAAQ,EAAEV,SAAS,CAAC6C,KAAV,CAAgB,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,EAAyB,IAAzB,CAAhB,EAAgDF,UArB5B;;EAsB9B;AACF;AACA;EACE/B,gBAAgB,EAAEZ,SAAS,CAAC8C,IAAV,CAAeH,UAzBH;;EA0B9B;AACF;AACA;EACEhC,SAAS,EAAEX,SAAS,CAAC8C,IAAV,CAAeH,UA7BI;;EA8B9B;AACF;AACA;EACE9B,QAAQ,EAAEb,SAAS,CAAC+C,WAAV,CAAsBJ;AAjCF,CAAhC;AAoCA,eAAezC,UAAU,CAACK,MAAD,EAAS;EAAEyC,IAAI,EAAE;AAAR,CAAT,CAAV,CAAoDxC,mBAApD,CAAf"}
1
+ {"version":3,"file":"DefaultNavigation.js","names":["React","PropTypes","withStyles","HvStep","getColor","stepSizes","styles","HvDefaultNavigation","numSteps","stepSize","getTitles","getDynamicValues","children","other","container","maxSize","avatar","minSize","StepComponent","stepsWidth","width","titleWidth","separatorWidth","maxWidth","Math","max","minWidth","Steps","titles","state","variant","navWidth","separatorValues","height","stepValues","propTypes","className","string","classes","shape","root","isRequired","number","oneOf","func","elementType","name"],"sources":["../../../../src/StepNavigation/DefaultNavigation/DefaultNavigation.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport { withStyles } from \"@material-ui/core\";\n\nimport HvStep from \"./Step\";\nimport { getColor, stepSizes } from \"./utils\";\nimport styles from \"./styles\";\n\n/**\n * Default Navigation\n */\nconst HvDefaultNavigation = ({\n numSteps,\n stepSize,\n getTitles,\n getDynamicValues,\n children,\n ...other\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(titleWidth - (maxSize + minSize) * 0.5, separatorWidth);\n //\n\n const Steps = children;\n\n const titles = getTitles(({ state }) => ({\n variant: state === \"Disabled\" ? \"disabledText\" : \"highlightText\",\n titleWidth,\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: 3,\n },\n stepValues: {\n minSize,\n maxSize,\n StepComponent,\n },\n }}\n />\n {titles}\n </div>\n );\n};\n\nHvDefaultNavigation.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n }).isRequired,\n /**\n * Number of steps to show on the component.\n */\n numSteps: PropTypes.number.isRequired,\n /**\n * Sets one of the standard sizes of the steps\n */\n stepSize: PropTypes.oneOf([\"XS\", \"SM\", \"MD\", \"LG\", \"XL\"]).isRequired,\n /**\n * Returns dynamic width values of the component (width, titleWidth, separatorWidth).\n */\n getDynamicValues: PropTypes.func.isRequired,\n /**\n * Returns a JSX.element of the titles container.\n */\n getTitles: PropTypes.func.isRequired,\n /**\n * Component to render Step Navigation with props = {separatorValues, stepValues, stepsWidth}\n */\n children: PropTypes.elementType.isRequired,\n};\n\nexport default withStyles(styles, { name: \"HvDefaultNavigation\" })(HvDefaultNavigation);\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SAASC,UAAT,QAA2B,mBAA3B;AAEA,OAAOC,MAAP,MAAmB,QAAnB;AACA,SAASC,QAAT,EAAmBC,SAAnB,QAAoC,SAApC;AACA,OAAOC,MAAP,MAAmB,UAAnB;AAEA;AACA;AACA;;AACA,MAAMC,mBAAmB,GAAG,QAOtB;EAAA,IAPuB;IAC3BC,QAD2B;IAE3BC,QAF2B;IAG3BC,SAH2B;IAI3BC,gBAJ2B;IAK3BC;EAL2B,CAOvB;EAAA,IADDC,KACC;;EACJ;EACA,MAAM;IAAEC,SAAS,EAAEC,OAAb;IAAsBC,MAAM,EAAEC;EAA9B,IAA0CZ,SAAS,CAACI,QAAD,CAAzD;EACA,MAAMS,aAAa,GAAGf,MAAtB,CAHI,CAIJ;;EAEA,MAAMgB,UAAU,GAAGJ,OAAO,GAAGE,OAAO,IAAIT,QAAQ,GAAG,CAAf,CAApC;EACA,MAAM;IAAEY,KAAF;IAASC,UAAT;IAAqBC;EAArB,IAAwCX,gBAAgB,CAACQ,UAAD,CAA9D,CAPI,CASJ;;EACA,MAAMI,QAAQ,GAAGC,IAAI,CAACC,GAAL,CAASJ,UAAU,GAAGJ,OAAtB,EAA+BK,cAA/B,CAAjB;EACA,MAAMI,QAAQ,GAAGF,IAAI,CAACC,GAAL,CAASJ,UAAU,GAAG,CAACN,OAAO,GAAGE,OAAX,IAAsB,GAA5C,EAAiDK,cAAjD,CAA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UAAU,CAACI,MAAD,EAAS;EAAEwC,IAAI,EAAE;AAAR,CAAT,CAAV,CAAoDvC,mBAApD,CAAf"}
@@ -7,9 +7,9 @@ export type HvStepClassKey = "root";
7
7
  export type HvStepProps = StandardProps<React.HTMLAttributes<HTMLDivElement>, HvStepClassKey> &
8
8
  Pick<HvButtonProps, "onClick"> & {
9
9
  /**
10
- * State of the step. Values = {"Pending", "Failed", "Completed", "Current", "Disabled"}
10
+ * State of the step. Values = {"Pending", "Failed", "Completed", "Current", "Disabled", "Enabled"}
11
11
  */
12
- state: "Pending" | "Failed" | "Completed" | "Current" | "Disabled";
12
+ state: "Pending" | "Failed" | "Completed" | "Current" | "Disabled" | "Enabled";
13
13
  /**
14
14
  * Title of the step.
15
15
  */
@@ -22,6 +22,11 @@ export type HvStepProps = StandardProps<React.HTMLAttributes<HTMLDivElement>, Hv
22
22
  * Number of the step.
23
23
  */
24
24
  number?: number;
25
+ /**
26
+ * Define if a step is disabled/enabled.
27
+ * If this property is not defined and the step is on state "Disabled", the step component will be disabled
28
+ */
29
+ disabled?: boolean;
25
30
  };
26
31
 
27
32
  export default function HvStep(props: HvStepProps): JSX.Element | null;
@@ -17,6 +17,7 @@ const HvStep = ({
17
17
  state,
18
18
  title,
19
19
  onClick,
20
+ disabled,
20
21
  size = "SM",
21
22
  number = 1
22
23
  }) => {
@@ -55,7 +56,7 @@ const HvStep = ({
55
56
  "aria-label": `step-${title}`,
56
57
  icon: true,
57
58
  overrideIconColors: false,
58
- disabled: ["Current", "Disabled"].includes(state),
59
+ disabled: disabled !== null && disabled !== void 0 ? disabled : ["Current", "Disabled"].includes(state),
59
60
  onClick: onClick
60
61
  }, /*#__PURE__*/React.createElement(HvAvatar, {
61
62
  className: clsx(classes.avatar, classes[size]),
@@ -143,9 +144,9 @@ process.env.NODE_ENV !== "production" ? HvStep.propTypes = {
143
144
  size: PropTypes.oneOf(["XS", "SM", "MD", "LG", "XL"]),
144
145
 
145
146
  /**
146
- * State of the step. Values = {"Pending", "Failed", "Completed", "Current", "Disabled"}
147
+ * State of the step. Values = {"Pending", "Failed", "Completed", "Current", "Disabled", "Enabled"}
147
148
  */
148
- state: PropTypes.oneOf(["Pending", "Failed", "Completed", "Current", "Disabled"]).isRequired,
149
+ state: PropTypes.oneOf(["Pending", "Failed", "Completed", "Current", "Disabled", "Enabled"]).isRequired,
149
150
 
150
151
  /**
151
152
  * Title of the step.
@@ -160,7 +161,13 @@ process.env.NODE_ENV !== "production" ? HvStep.propTypes = {
160
161
  /**
161
162
  * Event onClick of the step.
162
163
  */
163
- onClick: PropTypes.func
164
+ onClick: PropTypes.func,
165
+
166
+ /**
167
+ * Define if a step is disabled/enabled.
168
+ * If this property is not defined and the step is on state "Disabled", the step component will be disabled
169
+ */
170
+ disabled: PropTypes.bool
164
171
  } : void 0;
165
172
  export default withStyles(styles, {
166
173
  name: "HvStep"
@@ -1 +1 @@
1
- {"version":3,"file":"Step.js","names":["React","PropTypes","clsx","withStyles","Level0Good","Level3Bad","HourGlass","HvAvatar","HvButton","getColor","styles","HvStep","className","classes","state","title","onClick","size","number","iconSize","XS","SM","MD","LG","XL","squareL","Pending","Failed","Completed","svgSize","backgroundColor","color","undefined","semantic","status","IconComponent","root","ghost","ghostDisabled","includes","avatar","propTypes","string","shape","stepTitle","isRequired","oneOf","func","name"],"sources":["../../../../../src/StepNavigation/DefaultNavigation/Step/Step.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\n\nimport { withStyles } from \"@material-ui/core\";\n\nimport { Level0Good, Level3Bad, HourGlass } from \"@hitachivantara/uikit-react-icons\";\nimport { HvAvatar, HvButton } from \"@hitachivantara/uikit-react-core\";\n\nimport { getColor } from \"../utils\";\nimport styles from \"./styles\";\n\n/**\n * Step element of \"Default\" Step Navigation root component\n */\nconst HvStep = ({ className, classes, state, title, onClick, size = \"SM\", number = 1 }) => {\n const iconSize = {\n XS: \"XS\",\n SM: \"XS\",\n MD: \"S\",\n LG: \"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\n const semantic = state !== \"Pending\" ? backgroundColor : undefined;\n\n const status = state === \"Current\" ? \"atmo5\" : undefined;\n\n const IconComponent = {\n Pending: HourGlass,\n Failed: Level3Bad,\n Completed: Level0Good,\n }[state];\n\n return (\n <div\n className={clsx(className, classes.root, { [classes[\"not-current\"]]: state !== \"Current\" })}\n >\n <HvButton\n className={clsx(classes.ghost, { [classes.ghostDisabled]: state === \"Current\" })}\n aria-label={`step-${title}`}\n icon\n overrideIconColors={false}\n disabled={[\"Current\", \"Disabled\"].includes(state)}\n onClick={onClick}\n >\n <HvAvatar\n className={clsx(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\nHvStep.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the ghost class.\n */\n ghost: PropTypes.string,\n /**\n * Styles applied to the ghostDisabled class.\n */\n ghostDisabled: PropTypes.string,\n /**\n * Styles applied to the root element when step is not in \"current\" state.\n */\n \"not-current\": PropTypes.string,\n /**\n * Styles applied to the root element when size is XS.\n */\n XS: PropTypes.string,\n /**\n * Styles applied to the root element when size is SM.\n */\n SM: PropTypes.string,\n /**\n * Styles applied to the root element when size is MD.\n */\n MD: PropTypes.string,\n /**\n * Styles applied to the root element when size is LG.\n */\n LG: PropTypes.string,\n /**\n * Styles applied to the root element when size is XL.\n */\n XL: PropTypes.string,\n /**\n * Styles applied to the avatar element.\n */\n avatar: PropTypes.string,\n /**\n * Styles applied to the title of a step element.\n */\n stepTitle: PropTypes.string,\n }).isRequired,\n /**\n * Sets one of the standard sizes of the step\n */\n size: PropTypes.oneOf([\"XS\", \"SM\", \"MD\", \"LG\", \"XL\"]),\n /**\n * State of the step. Values = {\"Pending\", \"Failed\", \"Completed\", \"Current\", \"Disabled\"}\n */\n state: PropTypes.oneOf([\"Pending\", \"Failed\", \"Completed\", \"Current\", \"Disabled\"]).isRequired,\n /**\n * Title of the step.\n */\n title: PropTypes.string.isRequired,\n /**\n * Number of the step.\n */\n number: PropTypes.number,\n /**\n * Event onClick of the step.\n */\n onClick: PropTypes.func,\n};\n\nexport default withStyles(styles, { name: \"HvStep\" })(HvStep);\n"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,MAAjB;AAEA,SAASC,UAAT,QAA2B,mBAA3B;AAEA,SAASC,UAAT,EAAqBC,SAArB,EAAgCC,SAAhC,QAAiD,mCAAjD;AACA,SAASC,QAAT,EAAmBC,QAAnB,QAAmC,kCAAnC;AAEA,SAASC,QAAT,QAAyB,UAAzB;AACA,OAAOC,MAAP,MAAmB,UAAnB;AAEA;AACA;AACA;;AACA,MAAMC,MAAM,GAAG,CAAC;EAAEC,SAAF;EAAaC,OAAb;EAAsBC,KAAtB;EAA6BC,KAA7B;EAAoCC,OAApC;EAA6CC,IAAI,GAAG,IAApD;EAA0DC,MAAM,GAAG;AAAnE,CAAD,KAA4E;EACzF,MAAMC,QAAQ,GAAG;IACfC,EAAE,EAAE,IADW;IAEfC,EAAE,EAAE,IAFW;IAGfC,EAAE,EAAE,GAHW;IAIfC,EAAE,EAAE,GAJW;IAKfC,EAAE,EAAE;EALW,EAMfP,IANe,CAAjB;EAQ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c;;EAsDjB;AACF;AACA;EACE5B,IAAI,EAAEhB,SAAS,CAAC6C,KAAV,CAAgB,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,EAAyB,IAAzB,CAAhB,CAzDW;;EA0DjB;AACF;AACA;EACEhC,KAAK,EAAEb,SAAS,CAAC6C,KAAV,CAAgB,CAAC,SAAD,EAAY,QAAZ,EAAsB,WAAtB,EAAmC,SAAnC,EAA8C,UAA9C,CAAhB,EAA2ED,UA7DjE;;EA8DjB;AACF;AACA;EACE9B,KAAK,EAAEd,SAAS,CAACyC,MAAV,CAAiBG,UAjEP;;EAkEjB;AACF;AACA;EACE3B,MAAM,EAAEjB,SAAS,CAACiB,MArED;;EAsEjB;AACF;AACA;EACEF,OAAO,EAAEf,SAAS,CAAC8C;AAzEF,CAAnB;AA4EA,eAAe5C,UAAU,CAACO,MAAD,EAAS;EAAEsC,IAAI,EAAE;AAAR,CAAT,CAAV,CAAuCrC,MAAvC,CAAf"}
1
+ {"version":3,"file":"Step.js","names":["React","PropTypes","clsx","withStyles","Level0Good","Level3Bad","HourGlass","HvAvatar","HvButton","getColor","styles","HvStep","className","classes","state","title","onClick","disabled","size","number","iconSize","XS","SM","MD","LG","XL","squareL","Pending","Failed","Completed","svgSize","backgroundColor","color","undefined","semantic","status","IconComponent","root","ghost","ghostDisabled","includes","avatar","propTypes","string","shape","stepTitle","isRequired","oneOf","func","bool","name"],"sources":["../../../../../src/StepNavigation/DefaultNavigation/Step/Step.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\n\nimport { withStyles } from \"@material-ui/core\";\n\nimport { Level0Good, Level3Bad, HourGlass } from \"@hitachivantara/uikit-react-icons\";\nimport { HvAvatar, HvButton } from \"@hitachivantara/uikit-react-core\";\n\nimport { getColor } from \"../utils\";\nimport styles from \"./styles\";\n\n/**\n * Step element of \"Default\" Step Navigation root component\n */\nconst HvStep = ({\n className,\n classes,\n state,\n title,\n onClick,\n disabled,\n size = \"SM\",\n number = 1,\n}) => {\n const iconSize = {\n XS: \"XS\",\n SM: \"XS\",\n MD: \"S\",\n LG: \"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\n const semantic = state !== \"Pending\" ? backgroundColor : undefined;\n\n const status = state === \"Current\" ? \"atmo5\" : undefined;\n\n const IconComponent = {\n Pending: HourGlass,\n Failed: Level3Bad,\n Completed: Level0Good,\n }[state];\n\n return (\n <div\n className={clsx(className, classes.root, { [classes[\"not-current\"]]: state !== \"Current\" })}\n >\n <HvButton\n className={clsx(classes.ghost, { [classes.ghostDisabled]: state === \"Current\" })}\n aria-label={`step-${title}`}\n icon\n overrideIconColors={false}\n disabled={disabled ?? [\"Current\", \"Disabled\"].includes(state)}\n onClick={onClick}\n >\n <HvAvatar\n className={clsx(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\nHvStep.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the ghost class.\n */\n ghost: PropTypes.string,\n /**\n * Styles applied to the ghostDisabled class.\n */\n ghostDisabled: PropTypes.string,\n /**\n * Styles applied to the root element when step is not in \"current\" state.\n */\n \"not-current\": PropTypes.string,\n /**\n * Styles applied to the root element when size is XS.\n */\n XS: PropTypes.string,\n /**\n * Styles applied to the root element when size is SM.\n */\n SM: PropTypes.string,\n /**\n * Styles applied to the root element when size is MD.\n */\n MD: PropTypes.string,\n /**\n * Styles applied to the root element when size is LG.\n */\n LG: PropTypes.string,\n /**\n * Styles applied to the root element when size is XL.\n */\n XL: PropTypes.string,\n /**\n * Styles applied to the avatar element.\n */\n avatar: PropTypes.string,\n /**\n * Styles applied to the title of a step element.\n */\n stepTitle: PropTypes.string,\n }).isRequired,\n /**\n * Sets one of the standard sizes of the step\n */\n size: PropTypes.oneOf([\"XS\", \"SM\", \"MD\", \"LG\", \"XL\"]),\n /**\n * State of the step. Values = {\"Pending\", \"Failed\", \"Completed\", \"Current\", \"Disabled\", \"Enabled\"}\n */\n state: PropTypes.oneOf([\"Pending\", \"Failed\", \"Completed\", \"Current\", \"Disabled\", \"Enabled\"])\n .isRequired,\n /**\n * Title of the step.\n */\n title: PropTypes.string.isRequired,\n /**\n * Number of the step.\n */\n number: PropTypes.number,\n /**\n * Event onClick of the step.\n */\n onClick: PropTypes.func,\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: PropTypes.bool,\n};\n\nexport default withStyles(styles, { name: \"HvStep\" })(HvStep);\n"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,MAAjB;AAEA,SAASC,UAAT,QAA2B,mBAA3B;AAEA,SAASC,UAAT,EAAqBC,SAArB,EAAgCC,SAAhC,QAAiD,mCAAjD;AACA,SAASC,QAAT,EAAmBC,QAAnB,QAAmC,kCAAnC;AAEA,SAASC,QAAT,QAAyB,UAAzB;AACA,OAAOC,MAAP,MAAmB,UAAnB;AAEA;AACA;AACA;;AACA,MAAMC,MAAM,GAAG,CAAC;EACdC,SADc;EAEdC,OAFc;EAGdC,KAHc;EAIdC,KAJc;EAKdC,OALc;EAMdC,QANc;EAOdC,IAAI,GAAG,IAPO;EAQd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;AACJ;AACA;IACInB,EAAE,EAAEvB,SAAS,CAAC0C,MAhCS;;IAiCvB;AACJ;AACA;IACIlB,EAAE,EAAExB,SAAS,CAAC0C,MApCS;;IAqCvB;AACJ;AACA;IACIF,MAAM,EAAExC,SAAS,CAAC0C,MAxCK;;IAyCvB;AACJ;AACA;IACIE,SAAS,EAAE5C,SAAS,CAAC0C;EA5CE,CAAhB,EA6CNG,UArDc;;EAsDjB;AACF;AACA;EACE5B,IAAI,EAAEjB,SAAS,CAAC8C,KAAV,CAAgB,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,EAAyB,IAAzB,CAAhB,CAzDW;;EA0DjB;AACF;AACA;EACEjC,KAAK,EAAEb,SAAS,CAAC8C,KAAV,CAAgB,CAAC,SAAD,EAAY,QAAZ,EAAsB,WAAtB,EAAmC,SAAnC,EAA8C,UAA9C,EAA0D,SAA1D,CAAhB,EACJD,UA9Dc;;EA+DjB;AACF;AACA;EACE/B,KAAK,EAAEd,SAAS,CAAC0C,MAAV,CAAiBG,UAlEP;;EAmEjB;AACF;AACA;EACE3B,MAAM,EAAElB,SAAS,CAACkB,MAtED;;EAuEjB;AACF;AACA;EACEH,OAAO,EAAEf,SAAS,CAAC+C,IA1EF;;EA2EjB;AACF;AACA;AACA;EACE/B,QAAQ,EAAEhB,SAAS,CAACgD;AA/EH,CAAnB;AAkFA,eAAe9C,UAAU,CAACO,MAAD,EAAS;EAAEwC,IAAI,EAAE;AAAR,CAAT,CAAV,CAAuCvC,MAAvC,CAAf"}
@@ -1,12 +1,13 @@
1
1
  const getColor = (state, theme) => {
2
- var _theme$hv$palette$sem, _theme$hv, _theme$hv$palette, _theme$hv$palette$sem2, _theme$hv$palette$sem3, _theme$hv2, _theme$hv2$palette, _theme$hv2$palette$se, _theme$hv$palette$sem4, _theme$hv3, _theme$hv3$palette, _theme$hv3$palette$se, _theme$hv$palette$acc, _theme$hv4, _theme$hv4$palette, _theme$hv4$palette$ac, _theme$hv$palette$atm, _theme$hv5, _theme$hv5$palette, _theme$hv5$palette$at;
2
+ var _theme$hv$palette$sem, _theme$hv, _theme$hv$palette, _theme$hv$palette$sem2, _theme$hv$palette$sem3, _theme$hv2, _theme$hv2$palette, _theme$hv2$palette$se, _theme$hv$palette$sem4, _theme$hv3, _theme$hv3$palette, _theme$hv3$palette$se, _theme$hv$palette$acc, _theme$hv4, _theme$hv4$palette, _theme$hv4$palette$ac, _theme$hv$palette$atm, _theme$hv5, _theme$hv5$palette, _theme$hv5$palette$at, _theme$hv$palette$acc2, _theme$hv6, _theme$hv6$palette, _theme$hv6$palette$ac;
3
3
 
4
4
  return {
5
5
  Pending: (_theme$hv$palette$sem = theme === null || theme === void 0 ? void 0 : (_theme$hv = theme.hv) === null || _theme$hv === void 0 ? void 0 : (_theme$hv$palette = _theme$hv.palette) === null || _theme$hv$palette === void 0 ? void 0 : (_theme$hv$palette$sem2 = _theme$hv$palette.semantic) === null || _theme$hv$palette$sem2 === void 0 ? void 0 : _theme$hv$palette$sem2.sema3) !== null && _theme$hv$palette$sem !== void 0 ? _theme$hv$palette$sem : "sema3",
6
6
  Failed: (_theme$hv$palette$sem3 = theme === null || theme === void 0 ? void 0 : (_theme$hv2 = theme.hv) === null || _theme$hv2 === void 0 ? void 0 : (_theme$hv2$palette = _theme$hv2.palette) === null || _theme$hv2$palette === void 0 ? void 0 : (_theme$hv2$palette$se = _theme$hv2$palette.semantic) === null || _theme$hv2$palette$se === void 0 ? void 0 : _theme$hv2$palette$se.sema4) !== null && _theme$hv$palette$sem3 !== void 0 ? _theme$hv$palette$sem3 : "sema4",
7
7
  Completed: (_theme$hv$palette$sem4 = theme === null || theme === void 0 ? void 0 : (_theme$hv3 = theme.hv) === null || _theme$hv3 === void 0 ? void 0 : (_theme$hv3$palette = _theme$hv3.palette) === null || _theme$hv3$palette === void 0 ? void 0 : (_theme$hv3$palette$se = _theme$hv3$palette.semantic) === null || _theme$hv3$palette$se === void 0 ? void 0 : _theme$hv3$palette$se.sema1) !== null && _theme$hv$palette$sem4 !== void 0 ? _theme$hv$palette$sem4 : "sema1",
8
8
  Current: (_theme$hv$palette$acc = theme === null || theme === void 0 ? void 0 : (_theme$hv4 = theme.hv) === null || _theme$hv4 === void 0 ? void 0 : (_theme$hv4$palette = _theme$hv4.palette) === null || _theme$hv4$palette === void 0 ? void 0 : (_theme$hv4$palette$ac = _theme$hv4$palette.accent) === null || _theme$hv4$palette$ac === void 0 ? void 0 : _theme$hv4$palette$ac.acce1) !== null && _theme$hv$palette$acc !== void 0 ? _theme$hv$palette$acc : "acce1",
9
- Disabled: (_theme$hv$palette$atm = theme === null || theme === void 0 ? void 0 : (_theme$hv5 = theme.hv) === null || _theme$hv5 === void 0 ? void 0 : (_theme$hv5$palette = _theme$hv5.palette) === null || _theme$hv5$palette === void 0 ? void 0 : (_theme$hv5$palette$at = _theme$hv5$palette.atmosphere) === null || _theme$hv5$palette$at === void 0 ? void 0 : _theme$hv5$palette$at.atmo5) !== null && _theme$hv$palette$atm !== void 0 ? _theme$hv$palette$atm : "atmo5"
9
+ Disabled: (_theme$hv$palette$atm = theme === null || theme === void 0 ? void 0 : (_theme$hv5 = theme.hv) === null || _theme$hv5 === void 0 ? void 0 : (_theme$hv5$palette = _theme$hv5.palette) === null || _theme$hv5$palette === void 0 ? void 0 : (_theme$hv5$palette$at = _theme$hv5$palette.atmosphere) === null || _theme$hv5$palette$at === void 0 ? void 0 : _theme$hv5$palette$at.atmo5) !== null && _theme$hv$palette$atm !== void 0 ? _theme$hv$palette$atm : "atmo5",
10
+ Enabled: (_theme$hv$palette$acc2 = theme === null || theme === void 0 ? void 0 : (_theme$hv6 = theme.hv) === null || _theme$hv6 === void 0 ? void 0 : (_theme$hv6$palette = _theme$hv6.palette) === null || _theme$hv6$palette === void 0 ? void 0 : (_theme$hv6$palette$ac = _theme$hv6$palette.accent) === null || _theme$hv6$palette$ac === void 0 ? void 0 : _theme$hv6$palette$ac.acce1) !== null && _theme$hv$palette$acc2 !== void 0 ? _theme$hv$palette$acc2 : "acce1"
10
11
  }[state];
11
12
  };
12
13