@hitachivantara/uikit-react-lab 4.0.1-next.4 → 4.0.1-next.5

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 (199) hide show
  1. package/dist/StepNavigation/DefaultNavigation/DefaultNavigation.d.ts +3 -1
  2. package/dist/StepNavigation/DefaultNavigation/DefaultNavigation.js +2 -9
  3. package/dist/StepNavigation/DefaultNavigation/DefaultNavigation.js.map +1 -1
  4. package/dist/StepNavigation/DefaultNavigation/Step/Step.d.ts +2 -2
  5. package/dist/StepNavigation/DefaultNavigation/Step/Step.js +2 -2
  6. package/dist/StepNavigation/DefaultNavigation/Step/Step.js.map +1 -1
  7. package/dist/StepNavigation/DefaultNavigation/utils.js +3 -2
  8. package/dist/StepNavigation/DefaultNavigation/utils.js.map +1 -1
  9. package/dist/StepNavigation/SimpleNavigation/Dot/Dot.js +2 -5
  10. package/dist/StepNavigation/SimpleNavigation/Dot/Dot.js.map +1 -1
  11. package/dist/StepNavigation/SimpleNavigation/SimpleNavigation.d.ts +3 -1
  12. package/dist/StepNavigation/SimpleNavigation/SimpleNavigation.js +2 -11
  13. package/dist/StepNavigation/SimpleNavigation/SimpleNavigation.js.map +1 -1
  14. package/dist/StepNavigation/SimpleNavigation/utils.js +10 -8
  15. package/dist/StepNavigation/SimpleNavigation/utils.js.map +1 -1
  16. package/dist/StepNavigation/StepNavigation.js +5 -5
  17. package/dist/StepNavigation/StepNavigation.js.map +1 -1
  18. package/dist/Wizard/Wizard.d.ts +63 -0
  19. package/dist/Wizard/Wizard.js +262 -0
  20. package/dist/Wizard/Wizard.js.map +1 -0
  21. package/dist/Wizard/WizardActions/WizardActions.d.ts +61 -0
  22. package/dist/Wizard/WizardActions/WizardActions.js +270 -0
  23. package/dist/Wizard/WizardActions/WizardActions.js.map +1 -0
  24. package/dist/Wizard/WizardActions/index.d.ts +2 -0
  25. package/dist/Wizard/WizardActions/index.js +16 -0
  26. package/dist/Wizard/WizardActions/index.js.map +1 -0
  27. package/dist/Wizard/WizardActions/styles.js +30 -0
  28. package/dist/Wizard/WizardActions/styles.js.map +1 -0
  29. package/dist/Wizard/WizardContainer/WizardContainer.d.ts +28 -0
  30. package/dist/Wizard/WizardContainer/WizardContainer.js +116 -0
  31. package/dist/Wizard/WizardContainer/WizardContainer.js.map +1 -0
  32. package/dist/Wizard/WizardContainer/index.d.ts +2 -0
  33. package/dist/Wizard/WizardContainer/index.js +16 -0
  34. package/dist/Wizard/WizardContainer/index.js.map +1 -0
  35. package/dist/Wizard/WizardContainer/styles.js +23 -0
  36. package/dist/Wizard/WizardContainer/styles.js.map +1 -0
  37. package/dist/Wizard/WizardContent/LoadingContainer.js +101 -0
  38. package/dist/Wizard/WizardContent/LoadingContainer.js.map +1 -0
  39. package/dist/Wizard/WizardContent/WizardContent.d.ts +28 -0
  40. package/dist/Wizard/WizardContent/WizardContent.js +167 -0
  41. package/dist/Wizard/WizardContent/WizardContent.js.map +1 -0
  42. package/dist/Wizard/WizardContent/index.d.ts +2 -0
  43. package/dist/Wizard/WizardContent/index.js +16 -0
  44. package/dist/Wizard/WizardContent/index.js.map +1 -0
  45. package/dist/Wizard/WizardContent/styles.js +24 -0
  46. package/dist/Wizard/WizardContent/styles.js.map +1 -0
  47. package/dist/Wizard/WizardContext/WizardContext.js +21 -0
  48. package/dist/Wizard/WizardContext/WizardContext.js.map +1 -0
  49. package/dist/Wizard/WizardContext/index.js +16 -0
  50. package/dist/Wizard/WizardContext/index.js.map +1 -0
  51. package/dist/Wizard/WizardTitle/WizardTitle.d.ts +42 -0
  52. package/dist/Wizard/WizardTitle/WizardTitle.js +227 -0
  53. package/dist/Wizard/WizardTitle/WizardTitle.js.map +1 -0
  54. package/dist/Wizard/WizardTitle/index.d.ts +2 -0
  55. package/dist/Wizard/WizardTitle/index.js +16 -0
  56. package/dist/Wizard/WizardTitle/index.js.map +1 -0
  57. package/dist/Wizard/WizardTitle/styles.js +41 -0
  58. package/dist/Wizard/WizardTitle/styles.js.map +1 -0
  59. package/dist/Wizard/index.d.ts +2 -0
  60. package/dist/Wizard/index.js +56 -0
  61. package/dist/Wizard/index.js.map +1 -0
  62. package/dist/Wizard/styles.js +16 -0
  63. package/dist/Wizard/styles.js.map +1 -0
  64. package/dist/index.d.ts +8 -5
  65. package/dist/index.js +14 -5
  66. package/dist/index.js.map +1 -1
  67. package/dist/legacy/StepNavigation/DefaultNavigation/DefaultNavigation.d.ts +3 -1
  68. package/dist/legacy/StepNavigation/DefaultNavigation/DefaultNavigation.js +2 -8
  69. package/dist/legacy/StepNavigation/DefaultNavigation/DefaultNavigation.js.map +1 -1
  70. package/dist/legacy/StepNavigation/DefaultNavigation/Step/Step.d.ts +2 -2
  71. package/dist/legacy/StepNavigation/DefaultNavigation/Step/Step.js +2 -2
  72. package/dist/legacy/StepNavigation/DefaultNavigation/Step/Step.js.map +1 -1
  73. package/dist/legacy/StepNavigation/DefaultNavigation/utils.js +3 -2
  74. package/dist/legacy/StepNavigation/DefaultNavigation/utils.js.map +1 -1
  75. package/dist/legacy/StepNavigation/SimpleNavigation/Dot/Dot.js +4 -7
  76. package/dist/legacy/StepNavigation/SimpleNavigation/Dot/Dot.js.map +1 -1
  77. package/dist/legacy/StepNavigation/SimpleNavigation/SimpleNavigation.d.ts +3 -1
  78. package/dist/legacy/StepNavigation/SimpleNavigation/SimpleNavigation.js +2 -9
  79. package/dist/legacy/StepNavigation/SimpleNavigation/SimpleNavigation.js.map +1 -1
  80. package/dist/legacy/StepNavigation/SimpleNavigation/utils.js +9 -5
  81. package/dist/legacy/StepNavigation/SimpleNavigation/utils.js.map +1 -1
  82. package/dist/legacy/StepNavigation/StepNavigation.js +5 -5
  83. package/dist/legacy/StepNavigation/StepNavigation.js.map +1 -1
  84. package/dist/legacy/Wizard/Wizard.d.ts +63 -0
  85. package/dist/legacy/Wizard/Wizard.js +229 -0
  86. package/dist/legacy/Wizard/Wizard.js.map +1 -0
  87. package/dist/legacy/Wizard/WizardActions/WizardActions.d.ts +61 -0
  88. package/dist/legacy/Wizard/WizardActions/WizardActions.js +237 -0
  89. package/dist/legacy/Wizard/WizardActions/WizardActions.js.map +1 -0
  90. package/dist/legacy/Wizard/WizardActions/index.d.ts +2 -0
  91. package/dist/legacy/Wizard/WizardActions/index.js +2 -0
  92. package/dist/legacy/Wizard/WizardActions/index.js.map +1 -0
  93. package/dist/legacy/Wizard/WizardActions/styles.js +22 -0
  94. package/dist/legacy/Wizard/WizardActions/styles.js.map +1 -0
  95. package/dist/legacy/Wizard/WizardContainer/WizardContainer.d.ts +28 -0
  96. package/dist/legacy/Wizard/WizardContainer/WizardContainer.js +90 -0
  97. package/dist/legacy/Wizard/WizardContainer/WizardContainer.js.map +1 -0
  98. package/dist/legacy/Wizard/WizardContainer/index.d.ts +2 -0
  99. package/dist/legacy/Wizard/WizardContainer/index.js +2 -0
  100. package/dist/legacy/Wizard/WizardContainer/index.js.map +1 -0
  101. package/dist/legacy/Wizard/WizardContainer/styles.js +15 -0
  102. package/dist/legacy/Wizard/WizardContainer/styles.js.map +1 -0
  103. package/dist/legacy/Wizard/WizardContent/LoadingContainer.js +78 -0
  104. package/dist/legacy/Wizard/WizardContent/LoadingContainer.js.map +1 -0
  105. package/dist/legacy/Wizard/WizardContent/WizardContent.d.ts +28 -0
  106. package/dist/legacy/Wizard/WizardContent/WizardContent.js +132 -0
  107. package/dist/legacy/Wizard/WizardContent/WizardContent.js.map +1 -0
  108. package/dist/legacy/Wizard/WizardContent/index.d.ts +2 -0
  109. package/dist/legacy/Wizard/WizardContent/index.js +2 -0
  110. package/dist/legacy/Wizard/WizardContent/index.js.map +1 -0
  111. package/dist/legacy/Wizard/WizardContent/styles.js +16 -0
  112. package/dist/legacy/Wizard/WizardContent/styles.js.map +1 -0
  113. package/dist/legacy/Wizard/WizardContext/WizardContext.js +12 -0
  114. package/dist/legacy/Wizard/WizardContext/WizardContext.js.map +1 -0
  115. package/dist/legacy/Wizard/WizardContext/index.js +2 -0
  116. package/dist/legacy/Wizard/WizardContext/index.js.map +1 -0
  117. package/dist/legacy/Wizard/WizardTitle/WizardTitle.d.ts +42 -0
  118. package/dist/legacy/Wizard/WizardTitle/WizardTitle.js +204 -0
  119. package/dist/legacy/Wizard/WizardTitle/WizardTitle.js.map +1 -0
  120. package/dist/legacy/Wizard/WizardTitle/index.d.ts +2 -0
  121. package/dist/legacy/Wizard/WizardTitle/index.js +2 -0
  122. package/dist/legacy/Wizard/WizardTitle/index.js.map +1 -0
  123. package/dist/legacy/Wizard/WizardTitle/styles.js +33 -0
  124. package/dist/legacy/Wizard/WizardTitle/styles.js.map +1 -0
  125. package/dist/legacy/Wizard/index.d.ts +2 -0
  126. package/dist/legacy/Wizard/index.js +7 -0
  127. package/dist/legacy/Wizard/index.js.map +1 -0
  128. package/dist/legacy/Wizard/styles.js +8 -0
  129. package/dist/legacy/Wizard/styles.js.map +1 -0
  130. package/dist/legacy/index.d.ts +8 -5
  131. package/dist/legacy/index.js +3 -2
  132. package/dist/legacy/index.js.map +1 -1
  133. package/dist/modern/StepNavigation/DefaultNavigation/DefaultNavigation.d.ts +3 -1
  134. package/dist/modern/StepNavigation/DefaultNavigation/DefaultNavigation.js +2 -6
  135. package/dist/modern/StepNavigation/DefaultNavigation/DefaultNavigation.js.map +1 -1
  136. package/dist/modern/StepNavigation/DefaultNavigation/Step/Step.d.ts +2 -2
  137. package/dist/modern/StepNavigation/DefaultNavigation/Step/Step.js +2 -2
  138. package/dist/modern/StepNavigation/DefaultNavigation/Step/Step.js.map +1 -1
  139. package/dist/modern/StepNavigation/DefaultNavigation/utils.js +3 -2
  140. package/dist/modern/StepNavigation/DefaultNavigation/utils.js.map +1 -1
  141. package/dist/modern/StepNavigation/SimpleNavigation/Dot/Dot.js +4 -5
  142. package/dist/modern/StepNavigation/SimpleNavigation/Dot/Dot.js.map +1 -1
  143. package/dist/modern/StepNavigation/SimpleNavigation/SimpleNavigation.d.ts +3 -1
  144. package/dist/modern/StepNavigation/SimpleNavigation/SimpleNavigation.js +2 -6
  145. package/dist/modern/StepNavigation/SimpleNavigation/SimpleNavigation.js.map +1 -1
  146. package/dist/modern/StepNavigation/SimpleNavigation/utils.js +7 -5
  147. package/dist/modern/StepNavigation/SimpleNavigation/utils.js.map +1 -1
  148. package/dist/modern/StepNavigation/StepNavigation.js +5 -5
  149. package/dist/modern/StepNavigation/StepNavigation.js.map +1 -1
  150. package/dist/modern/Wizard/Wizard.d.ts +63 -0
  151. package/dist/modern/Wizard/Wizard.js +209 -0
  152. package/dist/modern/Wizard/Wizard.js.map +1 -0
  153. package/dist/modern/Wizard/WizardActions/WizardActions.d.ts +61 -0
  154. package/dist/modern/Wizard/WizardActions/WizardActions.js +197 -0
  155. package/dist/modern/Wizard/WizardActions/WizardActions.js.map +1 -0
  156. package/dist/modern/Wizard/WizardActions/index.d.ts +2 -0
  157. package/dist/modern/Wizard/WizardActions/index.js +2 -0
  158. package/dist/modern/Wizard/WizardActions/index.js.map +1 -0
  159. package/dist/modern/Wizard/WizardActions/styles.js +20 -0
  160. package/dist/modern/Wizard/WizardActions/styles.js.map +1 -0
  161. package/dist/modern/Wizard/WizardContainer/WizardContainer.d.ts +28 -0
  162. package/dist/modern/Wizard/WizardContainer/WizardContainer.js +85 -0
  163. package/dist/modern/Wizard/WizardContainer/WizardContainer.js.map +1 -0
  164. package/dist/modern/Wizard/WizardContainer/index.d.ts +2 -0
  165. package/dist/modern/Wizard/WizardContainer/index.js +2 -0
  166. package/dist/modern/Wizard/WizardContainer/index.js.map +1 -0
  167. package/dist/modern/Wizard/WizardContainer/styles.js +13 -0
  168. package/dist/modern/Wizard/WizardContainer/styles.js.map +1 -0
  169. package/dist/modern/Wizard/WizardContent/LoadingContainer.js +71 -0
  170. package/dist/modern/Wizard/WizardContent/LoadingContainer.js.map +1 -0
  171. package/dist/modern/Wizard/WizardContent/WizardContent.d.ts +28 -0
  172. package/dist/modern/Wizard/WizardContent/WizardContent.js +122 -0
  173. package/dist/modern/Wizard/WizardContent/WizardContent.js.map +1 -0
  174. package/dist/modern/Wizard/WizardContent/index.d.ts +2 -0
  175. package/dist/modern/Wizard/WizardContent/index.js +2 -0
  176. package/dist/modern/Wizard/WizardContent/index.js.map +1 -0
  177. package/dist/modern/Wizard/WizardContent/styles.js +14 -0
  178. package/dist/modern/Wizard/WizardContent/styles.js.map +1 -0
  179. package/dist/modern/Wizard/WizardContext/WizardContext.js +12 -0
  180. package/dist/modern/Wizard/WizardContext/WizardContext.js.map +1 -0
  181. package/dist/modern/Wizard/WizardContext/index.js +2 -0
  182. package/dist/modern/Wizard/WizardContext/index.js.map +1 -0
  183. package/dist/modern/Wizard/WizardTitle/WizardTitle.d.ts +42 -0
  184. package/dist/modern/Wizard/WizardTitle/WizardTitle.js +188 -0
  185. package/dist/modern/Wizard/WizardTitle/WizardTitle.js.map +1 -0
  186. package/dist/modern/Wizard/WizardTitle/index.d.ts +2 -0
  187. package/dist/modern/Wizard/WizardTitle/index.js +2 -0
  188. package/dist/modern/Wizard/WizardTitle/index.js.map +1 -0
  189. package/dist/modern/Wizard/WizardTitle/styles.js +31 -0
  190. package/dist/modern/Wizard/WizardTitle/styles.js.map +1 -0
  191. package/dist/modern/Wizard/index.d.ts +2 -0
  192. package/dist/modern/Wizard/index.js +7 -0
  193. package/dist/modern/Wizard/index.js.map +1 -0
  194. package/dist/modern/Wizard/styles.js +6 -0
  195. package/dist/modern/Wizard/styles.js.map +1 -0
  196. package/dist/modern/index.d.ts +8 -5
  197. package/dist/modern/index.js +3 -2
  198. package/dist/modern/index.js.map +1 -1
  199. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"Dot.js","names":["React","useCallback","useMemo","PropTypes","clsx","HvButton","withStyles","makeStyles","defaultColor","disabledColor","dotSizes","styles","HvDot","classes","className","state","title","size","onClick","disabled","dotSize","getBackgroundColor","theme","customClasses","backgroundColor","ghostDisabled","active","ghost","width","height","root","includes","propTypes","string","shape","isRequired","oneOf","func","bool","name"],"sources":["../../../../../src/StepNavigation/SimpleNavigation/Dot/Dot.js"],"sourcesContent":["import React, { useCallback, useMemo } from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\n\nimport { HvButton } from \"@hitachivantara/uikit-react-core\";\nimport { withStyles, makeStyles } from \"@mui/styles\";\n\nimport { defaultColor, disabledColor, dotSizes } from \"../utils\";\nimport styles from \"./styles\";\n\n/**\n * Step element of \"Simple\" Step Navigation root component\n */\nconst HvDot = ({ classes, className, state, title, size, onClick, disabled }) => {\n const dotSize = dotSizes[size] * (state === \"Current\" ? 1.5 : 1);\n const getBackgroundColor = useCallback(\n (theme) => (state === \"Disabled\" ? disabledColor(theme) : defaultColor(theme)),\n [state]\n );\n const customClasses = useMemo(\n () =>\n makeStyles((theme) => {\n const backgroundColor = getBackgroundColor(theme);\n return {\n ghostDisabled: {},\n active: {},\n ghost: {\n ...styles.ghost,\n width: dotSize,\n height: dotSize,\n backgroundColor,\n \"&:hover\": {\n backgroundColor,\n },\n \"&$ghostDisabled\": {\n ...styles.ghost[\"&$ghostDisabled\"],\n backgroundColor,\n },\n \"&$ghostDisabled&:hover\": {\n ...styles.ghost[\"&$ghostDisabled&:hover\"],\n backgroundColor,\n },\n },\n };\n }),\n [dotSize, getBackgroundColor]\n )();\n return (\n <HvButton\n className={clsx(\n classes.root,\n customClasses.ghost,\n {\n [customClasses.active]: state === \"Current\",\n [customClasses.ghostDisabled]: disabled ?? [\"Current\", \"Disabled\"].includes(state),\n },\n className\n )}\n aria-label={`step-${title}`}\n icon\n overrideIconColors={false}\n disabled={disabled ?? [\"Current\", \"Disabled\"].includes(state)}\n onClick={onClick}\n >\n {[]}\n </HvButton>\n );\n};\n\nHvDot.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 active class.\n */\n active: 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 }).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 * Title of the step.\n */\n title: PropTypes.string.isRequired,\n /**\n * Sets one of the standard sizes of the steps\n */\n size: PropTypes.oneOf([\"XS\", \"SM\", \"MD\", \"LG\", \"XL\"]).isRequired,\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: \"HvDot\" })(HvDot);\n"],"mappings":";;;;;;AAAA,OAAOA,KAAP,IAAgBC,WAAhB,EAA6BC,OAA7B,QAA4C,OAA5C;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,MAAjB;AAEA,SAASC,QAAT,QAAyB,kCAAzB;AACA,SAASC,UAAT,EAAqBC,UAArB,QAAuC,aAAvC;AAEA,SAASC,YAAT,EAAuBC,aAAvB,EAAsCC,QAAtC,QAAsD,UAAtD;AACA,OAAOC,MAAP,MAAmB,UAAnB;AAEA;AACA;AACA;;;;AACA,MAAMC,KAAK,GAAG,CAAC;EAAEC,OAAF;EAAWC,SAAX;EAAsBC,KAAtB;EAA6BC,KAA7B;EAAoCC,IAApC;EAA0CC,OAA1C;EAAmDC;AAAnD,CAAD,KAAmE;EAC/E,MAAMC,OAAO,GAAGV,QAAQ,CAACO,IAAD,CAAR,IAAkBF,KAAK,KAAK,SAAV,GAAsB,GAAtB,GAA4B,CAA9C,CAAhB;EACA,MAAMM,kBAAkB,GAAGpB,WAAW,CACnCqB,KAAD,IAAYP,KAAK,KAAK,UAAV,GAAuBN,aAAa,CAACa,KAAD,CAApC,GAA8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AAEX,SAAS,CAAC8B,MAJL;;EAKhB;AACF;AACA;EACEpB,OAAO,EAAEV,SAAS,CAAC+B,KAAV,CAAgB;IACvB;AACJ;AACA;IACIJ,IAAI,EAAE3B,SAAS,CAAC8B,MAJO;;IAKvB;AACJ;AACA;IACIP,MAAM,EAAEvB,SAAS,CAAC8B,MARK;;IASvB;AACJ;AACA;IACIN,KAAK,EAAExB,SAAS,CAAC8B,MAZM;;IAavB;AACJ;AACA;IACIR,aAAa,EAAEtB,SAAS,CAAC8B;EAhBF,CAAhB,EAiBNE,UAzBa;;EA0BhB;AACF;AACA;EACEpB,KAAK,EAAEZ,SAAS,CAACiC,KAAV,CAAgB,CAAC,SAAD,EAAY,QAAZ,EAAsB,WAAtB,EAAmC,SAAnC,EAA8C,UAA9C,CAAhB,EAA2ED,UA7BlE;;EA8BhB;AACF;AACA;EACEnB,KAAK,EAAEb,SAAS,CAAC8B,MAAV,CAAiBE,UAjCR;;EAkChB;AACF;AACA;EACElB,IAAI,EAAEd,SAAS,CAACiC,KAAV,CAAgB,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,EAAyB,IAAzB,CAAhB,EAAgDD,UArCtC;;EAsChB;AACF;AACA;EACEjB,OAAO,EAAEf,SAAS,CAACkC,IAzCH;;EA0ChB;AACF;AACA;AACA;EACElB,QAAQ,EAAEhB,SAAS,CAACmC;AA9CJ,CAAlB;AAiDA,eAAehC,UAAU,CAACK,MAAD,EAAS;EAAE4B,IAAI,EAAE;AAAR,CAAT,CAAV,CAAsC3B,KAAtC,CAAf"}
1
+ {"version":3,"file":"Dot.js","names":["React","useMemo","PropTypes","clsx","HvButton","withStyles","makeStyles","getColor","dotSizes","styles","HvDot","classes","className","state","title","size","onClick","disabled","dotSize","customClasses","theme","backgroundColor","ghostDisabled","active","ghost","width","height","root","includes","propTypes","string","shape","isRequired","oneOf","func","bool","name"],"sources":["../../../../../src/StepNavigation/SimpleNavigation/Dot/Dot.js"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\n\nimport { HvButton } from \"@hitachivantara/uikit-react-core\";\nimport { withStyles, makeStyles } from \"@mui/styles\";\n\nimport { getColor, dotSizes } from \"../utils\";\nimport styles from \"./styles\";\n\n/**\n * Step element of \"Simple\" Step Navigation root component\n */\nconst HvDot = ({ classes, className, state, title, size, onClick, disabled }) => {\n const dotSize = dotSizes[size] * (state === \"Current\" ? 1.5 : 1);\n const customClasses = useMemo(\n () =>\n makeStyles((theme) => {\n const backgroundColor = getColor(state, theme);\n return {\n ghostDisabled: {},\n active: {},\n ghost: {\n ...styles.ghost,\n width: dotSize,\n height: dotSize,\n backgroundColor,\n \"&:hover\": {\n backgroundColor,\n },\n \"&$ghostDisabled\": {\n ...styles.ghost[\"&$ghostDisabled\"],\n backgroundColor,\n },\n \"&$ghostDisabled&:hover\": {\n ...styles.ghost[\"&$ghostDisabled&:hover\"],\n backgroundColor,\n },\n },\n };\n }),\n [dotSize, state]\n )();\n return (\n <HvButton\n className={clsx(\n classes.root,\n customClasses.ghost,\n {\n [customClasses.active]: state === \"Current\",\n [customClasses.ghostDisabled]: disabled ?? [\"Current\", \"Disabled\"].includes(state),\n },\n className\n )}\n aria-label={`step-${title}`}\n icon\n overrideIconColors={false}\n disabled={disabled ?? [\"Current\", \"Disabled\"].includes(state)}\n onClick={onClick}\n >\n {[]}\n </HvButton>\n );\n};\n\nHvDot.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 active class.\n */\n active: 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 }).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 * Title of the step.\n */\n title: PropTypes.string.isRequired,\n /**\n * Sets one of the standard sizes of the steps\n */\n size: PropTypes.oneOf([\"XS\", \"SM\", \"MD\", \"LG\", \"XL\"]).isRequired,\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: \"HvDot\" })(HvDot);\n"],"mappings":";;;;;;AAAA,OAAOA,KAAP,IAAgBC,OAAhB,QAA+B,OAA/B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,MAAjB;AAEA,SAASC,QAAT,QAAyB,kCAAzB;AACA,SAASC,UAAT,EAAqBC,UAArB,QAAuC,aAAvC;AAEA,SAASC,QAAT,EAAmBC,QAAnB,QAAmC,UAAnC;AACA,OAAOC,MAAP,MAAmB,UAAnB;AAEA;AACA;AACA;;;;AACA,MAAMC,KAAK,GAAG,CAAC;EAAEC,OAAF;EAAWC,SAAX;EAAsBC,KAAtB;EAA6BC,KAA7B;EAAoCC,IAApC;EAA0CC,OAA1C;EAAmDC;AAAnD,CAAD,KAAmE;EAC/E,MAAMC,OAAO,GAAGV,QAAQ,CAACO,IAAD,CAAR,IAAkBF,KAAK,KAAK,SAAV,GAAsB,GAAtB,GAA4B,CAA9C,CAAhB;EACA,MAAMM,aAAa,GAAGlB,OAAO,CAC3B,MACEK,UAAU,CAAEc,KAAD,IAAW;IACpB,MAAMC,eAAe,GAAGd,QAAQ,CAACM,KAAD,EAAQO,KAAR,CAAhC;IACA,OAAO;MACLE,aAAa,EAAE,EADV;MAELC,MAAM,EAAE,EAFH;MAGLC,KAAK,kCACAf,MAAM,CAACe,KADP;QAEHC,KAAK,EAAEP,OAFJ;QAGHQ,MAAM,EAAER,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EAiBNE,UAzBa;;EA0BhB;AACF;AACA;EACEnB,KAAK,EAAEX,SAAS,CAAC+B,KAAV,CAAgB,CAAC,SAAD,EAAY,QAAZ,EAAsB,WAAtB,EAAmC,SAAnC,EAA8C,UAA9C,CAAhB,EAA2ED,UA7BlE;;EA8BhB;AACF;AACA;EACElB,KAAK,EAAEZ,SAAS,CAAC4B,MAAV,CAAiBE,UAjCR;;EAkChB;AACF;AACA;EACEjB,IAAI,EAAEb,SAAS,CAAC+B,KAAV,CAAgB,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,EAAyB,IAAzB,CAAhB,EAAgDD,UArCtC;;EAsChB;AACF;AACA;EACEhB,OAAO,EAAEd,SAAS,CAACgC,IAzCH;;EA0ChB;AACF;AACA;AACA;EACEjB,QAAQ,EAAEf,SAAS,CAACiC;AA9CJ,CAAlB;AAiDA,eAAe9B,UAAU,CAACI,MAAD,EAAS;EAAE2B,IAAI,EAAE;AAAR,CAAT,CAAV,CAAsC1B,KAAtC,CAAf"}
@@ -1,6 +1,8 @@
1
1
  import * as React from "react";
2
2
  import { StandardProps } from "@mui/material";
3
3
 
4
+ import { HvTheme } from "@hitachivantara/uikit-react-core";
5
+
4
6
  import { HvStepNavigationProps } from "../StepNavigation";
5
7
  import { HvDotProps } from "./Dot";
6
8
 
@@ -12,7 +14,7 @@ export type ComponentChildProps = {
12
14
  separatorValues: {
13
15
  minWidth: number;
14
16
  maxWidth: number;
15
- getColor: (state: HvDotProps["state"]) => any;
17
+ getColor: (state: HvDotProps["state"], theme: HvTheme) => any;
16
18
  height: number;
17
19
  };
18
20
  stepValues: {
@@ -8,10 +8,9 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
8
8
 
9
9
  import React from "react";
10
10
  import PropTypes from "prop-types";
11
- import { useTheme } from "@mui/material";
12
11
  import { withStyles } from "@mui/styles";
13
12
  import HvDot from "./Dot";
14
- import { defaultColor, disabledColor, dotSizes } from "./utils";
13
+ import { getColor, dotSizes } from "./utils";
15
14
  import styles from "./styles";
16
15
  /**
17
16
  * Simple Navigation
@@ -30,8 +29,7 @@ const HvSimpleNavigation = _ref => {
30
29
  } = _ref,
31
30
  other = _objectWithoutProperties(_ref, _excluded);
32
31
 
33
- const theme = useTheme(); // step values
34
-
32
+ // step values
35
33
  const dotSize = dotSizes[stepSize];
36
34
  const StepComponent = HvDot; //
37
35
 
@@ -42,8 +40,6 @@ const HvSimpleNavigation = _ref => {
42
40
  separatorWidth
43
41
  } = getDynamicValues(stepsWidth); // separator values
44
42
 
45
- const getColor = state => ["Current", "Disabled"].includes(state) ? disabledColor(theme) : defaultColor(theme);
46
-
47
43
  const maxWidth = Math.max(titleWidth - dotSize, separatorWidth);
48
44
  const minWidth = Math.max(titleWidth - dotSize * 1.25, separatorWidth); //
49
45
 
@@ -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 } from \"@mui/material\";\nimport { withStyles } from \"@mui/styles\";\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,QAAyB,eAAzB;AACA,SAASC,UAAT,QAA2B,aAA3B;AAEA,OAAOC,KAAP,MAAkB,OAA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AAC,KAAD;MAEIZ,UAFJ;MAGIgB,QAAQ,EAAEf,KAHd;MAIIgB,eAAe,EAAE;QACfP,QADe;QAEfH,QAFe;QAGfH,QAHe;QAIfc,MAAM,EAAE;MAJO,CAJrB;MAUIC,UAAU,EAAE;QACVC,OAAO,EAAEtB,OADC;QAEVuB,OAAO,EAAE,MAAMvB,OAFL;QAGVC;MAHU;IAVhB,EAFF;EAAA,GADF;AAsBD,CAtDD;;AAwDA,wCAAAT,kBAAkB,CAACgC,SAAnB,GAA+B;EAC7B;AACF;AACA;EACEC,SAAS,EAAEzC,SAAS,CAAC0C,MAJQ;;EAK7B;AACF;AACA;EACEC,OAAO,EAAE3C,SAAS,CAAC4C,KAAV,CAAgB;IACvB;AACJ;AACA;IACIC,IAAI,EAAE7C,SAAS,CAAC0C;EAJO,CAAhB,EAKNI,UAb0B;;EAc7B;AACF;AACA;EACErC,QAAQ,EAAET,SAAS,CAACgC,MAAV,CAAiBc,UAjBE;;EAkB7B;AACF;AACA;EACEpC,QAAQ,EAAEV,SAAS,CAAC+C,KAAV,CAAgB,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,EAAyB,IAAzB,CAAhB,EAAgDD,UArB7B;;EAsB7B;AACF;AACA;EACElC,gBAAgB,EAAEZ,SAAS,CAACgD,IAAV,CAAeF,UAzBJ;;EA0B7B;AACF;AACA;EACEnC,SAAS,EAAEX,SAAS,CAACgD,IAAV,CAAeF,UA7BG;;EA8B7B;AACF;AACA;EACEjC,QAAQ,EAAEb,SAAS,CAACiD,WAAV,CAAsBH;AAjCH,CAA/B;AAoCA,eAAe5C,UAAU,CAACK,MAAD,EAAS;EAAE2C,IAAI,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 \"@mui/styles\";\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,aAA3B;AAEA,OAAOC,KAAP,MAAkB,OAAlB;AACA,SAASC,QAAT,EAAmBC,QAAnB,QAAmC,SAAnC;AACA,OAAOC,MAAP,MAAmB,UAAnB;AAEA;AACA;AACA;;;;;AACA,MAAMC,kBAAkB,GAAG,QAOrB;EAAA,IAPsB;IAC1BC,QAD0B;IAE1BC,QAF0B;IAG1BC,SAH0B;IAI1BC,gBAJ0B;IAK1BC;EAL0B,CAOtB;EAAA,IADDC,KACC;;EACJ;EACA,MAAMC,OAAO,GAAGT,QAAQ,CAACI,QAAD,CAAxB;EACA,MAAMM,aAAa,GAAGZ,KAAtB,CAHI,CAIJ;;EAEA,MAAMa,UAAU,GAAG,CAACR,QAAQ,GAAG,GAAZ,IAAmBM,OAAtC;EACA,MAAM;IAAEG,KAAF;IAASC,UAAT;IAAqBC;EAArB,IAAwCR,gBAAgB,CAACK,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,GAAGJ,OAAO,GAAG,IAAhC,EAAsCK,cAAtC,CAAjB,CAXI,CAYJ;;EAEA,MAAMK,KAAK,GAAGZ,QAAd;EAEA,MAAMa,MAAM,GAAGf,SAAS,CAAC,CAAC;IAAEgB,QAA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AAmDtC,kBAAnD,CAAf"}
@@ -7,16 +7,18 @@ const dotSizes = {
7
7
  };
8
8
 
9
9
  const 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
  const 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
+ const getColor = (state, theme) => state === "Disabled" ? disabledColor(theme) : defaultColor(theme);
22
+
23
+ export { dotSizes, getColor };
22
24
  //# 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,MAAMA,QAAQ,GAAG;EACfC,EAAE,EAAE,CADW;EAEfC,EAAE,EAAE,EAFW;EAGfC,EAAE,EAAE,EAHW;EAIfC,EAAE,EAAE,EAJW;EAKfC,EAAE,EAAE;AALW,CAAjB;;AAQA,MAAMC,YAAY,GAAIC,KAAD;EAAA;;EAAA,OAAWA,KAAX,aAAWA,KAAX,oCAAWA,KAAK,CAAEC,EAAlB,mEAAW,UAAWC,OAAtB,+EAAW,kBAAoBC,MAA/B,0DAAW,sBAA4BC,KAAvC;AAAA,CAArB;;AACA,MAAMC,aAAa,GAAIL,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,MAAMA,QAAQ,GAAG;EACfC,EAAE,EAAE,CADW;EAEfC,EAAE,EAAE,EAFW;EAGfC,EAAE,EAAE,EAHW;EAIfC,EAAE,EAAE,EAJW;EAKfC,EAAE,EAAE;AALW,CAAjB;;AAQA,MAAMC,YAAY,GAAIC,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,MAAMC,aAAa,GAAIL,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,MAAMC,QAAQ,GAAG,CAACC,KAAD,EAAQT,KAAR,KACfS,KAAK,KAAK,UAAV,GAAuBJ,aAAa,CAACL,KAAD,CAApC,GAA8CD,YAAY,CAACC,KAAD,CAD5D;;AAGA,SAASP,QAAT,EAAmBe,QAAnB"}
@@ -37,8 +37,8 @@ import styles from "./styles";
37
37
  * correspondent to the current media breakpoint;
38
38
  * * Choose either you want to <b>showTitles</b> near to each step component or a tootlip on hover;
39
39
  * * Define a <b>width</b> of the component. If you don't define any value and the step component has no title
40
- * displayed above, the width of the separator element;
41
- * will be 100px. If the step component has titles, each one will have 215px of width by default.
40
+ * displayed above, the width of the separator element will be 100px.
41
+ * If the step component has titles, each one will have 215px of width by default.
42
42
  */
43
43
 
44
44
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -148,7 +148,7 @@ const HvStepNavigation = _ref => {
148
148
  }, `step-${title}`);
149
149
 
150
150
  if (index < steps.length - 1) {
151
- const separatorElement = styledSeparatorElement(title, separatorClassName, height, [steps[index + 1].state, state].includes("Current") ? minWidth : maxWidth, getColor(state));
151
+ const separatorElement = styledSeparatorElement(title, separatorClassName, height, [steps[index + 1].state, state].includes("Current") ? minWidth : maxWidth, getColor(steps[index + 1].state === "Disabled" ? "Disabled" : state, theme));
152
152
  return [...acc, stepElement, separatorElement];
153
153
  }
154
154
 
@@ -308,9 +308,9 @@ process.env.NODE_ENV !== "production" ? HvStepNavigation.propTypes = {
308
308
  title: PropTypes.string.isRequired,
309
309
 
310
310
  /**
311
- * State of the step. Values = {"Pending", "Failed", "Completed", "Current", "Disabled"}.
311
+ * State of the step. Values = {"Pending", "Failed", "Completed", "Current", "Disabled", "Enabled"}.
312
312
  */
313
- state: PropTypes.oneOf(["Pending", "Failed", "Completed", "Current", "Disabled"]).isRequired,
313
+ state: PropTypes.oneOf(["Pending", "Failed", "Completed", "Current", "Disabled", "Enabled"]).isRequired,
314
314
 
315
315
  /**
316
316
  * Define if a step is disabled/enabled.
@@ -1 +1 @@
1
- {"version":3,"file":"StepNavigation.js","names":["React","PropTypes","clsx","Typography","styled","useTheme","withStyles","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 { Typography, styled, useTheme } from \"@mui/material\";\nimport { withStyles } from \"@mui/styles\";\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?.[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\"}.\n */\n state: PropTypes.oneOf([\"Pending\", \"Failed\", \"Completed\", \"Current\", \"Disabled\"]).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 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,MAArB,EAA6BC,QAA7B,QAA6C,eAA7C;AACA,SAASC,UAAT,QAA2B,aAA3B;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,MAAMC,gBAAgB,GAAG,QASnB;EAAA,IAToB;IACxBC,SADwB;IAExBC,OAFwB;IAGxBC,KAHwB;IAIxBC,KAJwB;IAKxBC,QALwB;IAMxBC,UANwB;IAOxBC,IAAI,GAAG;EAPiB,CASpB;EAAA,IADDC,MACC;;EACJ,MAAMC,KAAK,GAAGpB,QAAQ,EAAtB,CADI,CAEJ;;EACA,MAAMqB,UAAU,GAAGjB,QAAQ,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;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,CAzEoB;;EAgF3B;AACF;AACA;EACE1C,UAAU,EAAErB,SAAS,CAAC4G;AAnFK,CAA7B;AAsFA,eAAevG,UAAU,CAACS,MAAD,EAAS;EAAEoG,IAAI,EAAE;AAAR,CAAT,CAAV,CAAiDnG,gBAAjD,CAAf"}
1
+ {"version":3,"file":"StepNavigation.js","names":["React","PropTypes","clsx","Typography","styled","useTheme","withStyles","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 { Typography, styled, useTheme } from \"@mui/material\";\nimport { withStyles } from \"@mui/styles\";\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 withStyles(styles, { name: \"HvStepNavigation\" })(HvStepNavigation);\n"],"mappings":";;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP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AAjD,CAAf"}
@@ -0,0 +1,63 @@
1
+ import * as React from "react";
2
+ import { StandardProps, ModalProps } from "@mui/material";
3
+ import { HvWizardActionsProps } from "./WizardActions";
4
+ import { HvWizardTitleProps } from "./WizardTitle";
5
+ import { HvStepNavigationProps } from "../StepNavigation";
6
+
7
+ export type HvWizardClassKey = "root";
8
+
9
+ export type HvWizardProps = StandardProps<
10
+ React.HTMLAttributes<HTMLDivElement>,
11
+ HvWizardClassKey
12
+ > & {
13
+ /**
14
+ * Class names to be applied.
15
+ */
16
+ className: string;
17
+ /**
18
+ * Current state of the Wizard.
19
+ */
20
+ open: boolean;
21
+ /**
22
+ * Function executed on close.
23
+ */
24
+ onClose: ModalProps["onClose"];
25
+ /**
26
+ * Function executed on submit.
27
+ */
28
+ onSubmit: any;
29
+ /**
30
+ * Title for the wizard.
31
+ */
32
+ title: string;
33
+ /**
34
+ * The content of the component.
35
+ */
36
+ children: React.ReactNode;
37
+ /**
38
+ * An object containing all the labels for the wizard.
39
+ */
40
+ labels: HvWizardActionsProps["labels"] & HvWizardTitleProps["labels"];
41
+ /**
42
+ * Shows the summary button.
43
+ */
44
+ hasSummary?: boolean;
45
+ /**
46
+ * Enables the skip button.
47
+ */
48
+ skippable?: boolean;
49
+ /**
50
+ * Forces minimum height to the component.
51
+ */
52
+ fixedHeight?: boolean;
53
+ /**
54
+ * Whether the loading animation is shown.
55
+ */
56
+ loading?: boolean;
57
+ /**
58
+ * Custom object to define type, size and width of the StepNavigation component
59
+ */
60
+ customStep?: Pick<HvStepNavigationProps, "type" | "stepSize" | "width">;
61
+ };
62
+
63
+ export default function HvWizard(props: HvWizardProps): JSX.Element | null;
@@ -0,0 +1,209 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ const _excluded = ["className", "children", "onClose", "onSubmit", "title", "open", "skippable", "loading", "hasSummary", "labels", "fixedHeight", "customStep"];
4
+
5
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
+
7
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8
+
9
+ import "core-js/modules/web.dom-collections.iterator.js";
10
+ import React from "react";
11
+ import PropTypes from "prop-types";
12
+ import { withStyles } from "@mui/styles";
13
+ import WizardContext from "./WizardContext";
14
+ import WizardContainer from "./WizardContainer";
15
+ import WizardTitle from "./WizardTitle";
16
+ import WizardContent from "./WizardContent";
17
+ import WizardActions from "./WizardActions";
18
+ import styles from "./styles";
19
+ import { jsx as _jsx } from "react/jsx-runtime";
20
+ import { jsxs as _jsxs } from "react/jsx-runtime";
21
+
22
+ const HvWizard = _ref => {
23
+ let {
24
+ className,
25
+ children,
26
+ onClose,
27
+ onSubmit,
28
+ title,
29
+ open,
30
+ skippable = true,
31
+ loading = false,
32
+ hasSummary = false,
33
+ labels = {
34
+ cancel: "Cancel",
35
+ next: "Next",
36
+ previous: "Previous",
37
+ skip: "Skip",
38
+ submit: "Submit",
39
+ summary: "Summary"
40
+ },
41
+ fixedHeight = false,
42
+ customStep
43
+ } = _ref,
44
+ others = _objectWithoutProperties(_ref, _excluded);
45
+
46
+ const [context, setContext] = React.useState({});
47
+ const [tab, setTab] = React.useState(0);
48
+ const contextValue = React.useMemo(() => ({
49
+ context,
50
+ setContext
51
+ }), [context, setContext]);
52
+ React.useEffect(() => {
53
+ if (!open) {
54
+ setTab(0);
55
+ }
56
+ }, [open]);
57
+ const handleClose = React.useCallback((evt, reason) => {
58
+ if (reason !== "backdropClick") {
59
+ onClose(evt, reason);
60
+ }
61
+ }, [onClose]);
62
+ return /*#__PURE__*/_jsx(WizardContext.Provider, {
63
+ value: contextValue,
64
+ children: /*#__PURE__*/_jsxs(WizardContainer, _objectSpread(_objectSpread({
65
+ className: className,
66
+ handleClose: handleClose,
67
+ open: open
68
+ }, others), {}, {
69
+ children: [/*#__PURE__*/_jsx(WizardTitle, {
70
+ title: title,
71
+ hasSummary: hasSummary,
72
+ labels: labels,
73
+ tab: tab,
74
+ changeTab: setTab,
75
+ customStep: customStep
76
+ }), /*#__PURE__*/_jsx(WizardContent, {
77
+ loading: loading,
78
+ fixedHeight: fixedHeight,
79
+ tab: tab,
80
+ children: children
81
+ }), /*#__PURE__*/_jsx(WizardActions, {
82
+ loading: loading,
83
+ skippable: skippable,
84
+ labels: labels,
85
+ tab: tab,
86
+ changeTab: setTab,
87
+ handleClose: handleClose,
88
+ onSubmit: onSubmit
89
+ })]
90
+ }))
91
+ });
92
+ };
93
+
94
+ process.env.NODE_ENV !== "production" ? HvWizard.propTypes = {
95
+ /**
96
+ * Class names to be applied.
97
+ */
98
+ className: PropTypes.string,
99
+
100
+ /**
101
+ * Current state of the Wizard.
102
+ */
103
+ open: PropTypes.bool.isRequired,
104
+
105
+ /**
106
+ * Function executed on close.
107
+ */
108
+ onClose: PropTypes.func.isRequired,
109
+
110
+ /**
111
+ * Function executed on submit.
112
+ */
113
+ onSubmit: PropTypes.func.isRequired,
114
+
115
+ /**
116
+ * Enables the skip button.
117
+ */
118
+ skippable: PropTypes.bool,
119
+
120
+ /**
121
+ * Title for the wizard.
122
+ */
123
+ title: PropTypes.string,
124
+
125
+ /**
126
+ * Shows the summary button.
127
+ */
128
+ hasSummary: PropTypes.bool,
129
+
130
+ /**
131
+ * The content of the component.
132
+ */
133
+ children: PropTypes.node,
134
+
135
+ /**
136
+ * An object containing all the labels for the wizard.
137
+ */
138
+ labels: PropTypes.shape({
139
+ /**
140
+ * Cancel button label.
141
+ */
142
+ cancel: PropTypes.string,
143
+
144
+ /**
145
+ * Skip button label.
146
+ */
147
+ skip: PropTypes.string,
148
+
149
+ /**
150
+ * Previous button label.
151
+ */
152
+ previous: PropTypes.string,
153
+
154
+ /**
155
+ * Next button label.
156
+ */
157
+ next: PropTypes.string,
158
+
159
+ /**
160
+ * Submit button label.
161
+ */
162
+ submit: PropTypes.string,
163
+
164
+ /**
165
+ * Summary button label.
166
+ */
167
+ summary: PropTypes.string
168
+ }),
169
+
170
+ /**
171
+ * Forces minimum height to the component.
172
+ */
173
+ fixedHeight: PropTypes.bool,
174
+
175
+ /**
176
+ * Whether the loading animation is shown.
177
+ */
178
+ loading: PropTypes.bool,
179
+
180
+ /**
181
+ * Custom object to define type, size and width of the StepNavigation component
182
+ */
183
+ customStep: PropTypes.shape({
184
+ /**
185
+ * Type of step navigation. Values = {"Simple", "Default"}.
186
+ */
187
+ type: PropTypes.oneOf(["Simple", "Default"]),
188
+
189
+ /**
190
+ * Sets one of the standard sizes of the steps. Values = {"XS", "SM", "MD", "LG", "XL"}
191
+ */
192
+ stepSize: PropTypes.oneOf(["XS", "SM", "MD", "LG", "XL"]),
193
+
194
+ /**
195
+ * Width of the component element on each breakpoint screen resolution.
196
+ */
197
+ width: PropTypes.shape({
198
+ xs: PropTypes.number,
199
+ sm: PropTypes.number,
200
+ md: PropTypes.number,
201
+ lg: PropTypes.number,
202
+ xl: PropTypes.number
203
+ })
204
+ })
205
+ } : void 0;
206
+ export default withStyles(styles, {
207
+ name: "HvWizard"
208
+ })(HvWizard);
209
+ //# sourceMappingURL=Wizard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Wizard.js","names":["React","PropTypes","withStyles","WizardContext","WizardContainer","WizardTitle","WizardContent","WizardActions","styles","HvWizard","className","children","onClose","onSubmit","title","open","skippable","loading","hasSummary","labels","cancel","next","previous","skip","submit","summary","fixedHeight","customStep","others","context","setContext","useState","tab","setTab","contextValue","useMemo","useEffect","handleClose","useCallback","evt","reason","propTypes","string","bool","isRequired","func","node","shape","type","oneOf","stepSize","width","xs","number","sm","md","lg","xl","name"],"sources":["../../../src/Wizard/Wizard.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { withStyles } from \"@mui/styles\";\nimport WizardContext from \"./WizardContext\";\nimport WizardContainer from \"./WizardContainer\";\nimport WizardTitle from \"./WizardTitle\";\nimport WizardContent from \"./WizardContent\";\nimport WizardActions from \"./WizardActions\";\n\nimport styles from \"./styles\";\n\nconst HvWizard = ({\n className,\n children,\n onClose,\n onSubmit,\n title,\n open,\n skippable = true,\n loading = false,\n hasSummary = false,\n labels = {\n cancel: \"Cancel\",\n next: \"Next\",\n previous: \"Previous\",\n skip: \"Skip\",\n submit: \"Submit\",\n summary: \"Summary\",\n },\n fixedHeight = false,\n customStep,\n ...others\n}) => {\n const [context, setContext] = React.useState({});\n const [tab, setTab] = React.useState(0);\n\n const contextValue = React.useMemo(\n () => ({\n context,\n setContext,\n }),\n [context, setContext]\n );\n\n React.useEffect(() => {\n if (!open) {\n setTab(0);\n }\n }, [open]);\n\n const handleClose = React.useCallback(\n (evt, reason) => {\n if (reason !== \"backdropClick\") {\n onClose(evt, reason);\n }\n },\n [onClose]\n );\n\n return (\n <WizardContext.Provider value={contextValue}>\n <WizardContainer className={className} handleClose={handleClose} open={open} {...others}>\n <WizardTitle\n title={title}\n hasSummary={hasSummary}\n labels={labels}\n tab={tab}\n changeTab={setTab}\n customStep={customStep}\n />\n <WizardContent loading={loading} fixedHeight={fixedHeight} tab={tab}>\n {children}\n </WizardContent>\n <WizardActions\n loading={loading}\n skippable={skippable}\n labels={labels}\n tab={tab}\n changeTab={setTab}\n handleClose={handleClose}\n onSubmit={onSubmit}\n />\n </WizardContainer>\n </WizardContext.Provider>\n );\n};\n\nHvWizard.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * Current state of the Wizard.\n */\n open: PropTypes.bool.isRequired,\n /**\n * Function executed on close.\n */\n onClose: PropTypes.func.isRequired,\n /**\n * Function executed on submit.\n */\n onSubmit: PropTypes.func.isRequired,\n /**\n * Enables the skip button.\n */\n skippable: PropTypes.bool,\n /**\n * Title for the wizard.\n */\n title: PropTypes.string,\n /**\n * Shows the summary button.\n */\n hasSummary: PropTypes.bool,\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * An object containing all the labels for the wizard.\n */\n labels: PropTypes.shape({\n /**\n * Cancel button label.\n */\n cancel: PropTypes.string,\n /**\n * Skip button label.\n */\n skip: PropTypes.string,\n /**\n * Previous button label.\n */\n previous: PropTypes.string,\n /**\n * Next button label.\n */\n next: PropTypes.string,\n /**\n * Submit button label.\n */\n submit: PropTypes.string,\n /**\n * Summary button label.\n */\n summary: PropTypes.string,\n }),\n /**\n * Forces minimum height to the component.\n */\n fixedHeight: PropTypes.bool,\n /**\n * Whether the loading animation is shown.\n */\n loading: PropTypes.bool,\n /**\n * Custom object to define type, size and width of the StepNavigation component\n */\n customStep: PropTypes.shape({\n /**\n * Type of step navigation. Values = {\"Simple\", \"Default\"}.\n */\n type: PropTypes.oneOf([\"Simple\", \"Default\"]),\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};\n\nexport default withStyles(styles, { name: \"HvWizard\" })(HvWizard);\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAASC,UAAT,QAA2B,aAA3B;AACA,OAAOC,aAAP,MAA0B,iBAA1B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