@dnb/eufemia 10.71.1 → 10.72.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 (342) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/cjs/components/anchor/Anchor.js +1 -0
  3. package/cjs/components/anchor/Anchor.js.map +1 -1
  4. package/cjs/components/card/CardDocs.js +1 -1
  5. package/cjs/components/card/CardDocs.js.map +1 -1
  6. package/cjs/components/help-button/HelpButtonInline.js +1 -1
  7. package/cjs/components/help-button/HelpButtonInline.js.map +1 -1
  8. package/cjs/components/section/Section.d.ts +2 -1
  9. package/cjs/components/section/Section.js +2 -2
  10. package/cjs/components/section/Section.js.map +1 -1
  11. package/cjs/components/section/style/dnb-section.css +4 -0
  12. package/cjs/components/section/style/dnb-section.min.css +1 -1
  13. package/cjs/components/section/style/dnb-section.scss +5 -0
  14. package/cjs/components/step-indicator/StepIndicator.d.ts +23 -5
  15. package/cjs/components/step-indicator/StepIndicator.js +66 -21
  16. package/cjs/components/step-indicator/StepIndicator.js.map +1 -1
  17. package/cjs/components/step-indicator/StepIndicatorContext.d.ts +2 -14
  18. package/cjs/components/step-indicator/StepIndicatorContext.js +9 -56
  19. package/cjs/components/step-indicator/StepIndicatorContext.js.map +1 -1
  20. package/cjs/components/step-indicator/StepIndicatorDocs.d.ts +5 -0
  21. package/cjs/components/step-indicator/StepIndicatorDocs.js +145 -0
  22. package/cjs/components/step-indicator/StepIndicatorDocs.js.map +1 -0
  23. package/cjs/components/step-indicator/StepIndicatorItem.d.ts +10 -10
  24. package/cjs/components/step-indicator/StepIndicatorItem.js +89 -98
  25. package/cjs/components/step-indicator/StepIndicatorItem.js.map +1 -1
  26. package/cjs/components/step-indicator/StepIndicatorList.js +33 -36
  27. package/cjs/components/step-indicator/StepIndicatorList.js.map +1 -1
  28. package/cjs/components/step-indicator/StepIndicatorProps.js +2 -1
  29. package/cjs/components/step-indicator/StepIndicatorProps.js.map +1 -1
  30. package/cjs/components/step-indicator/StepIndicatorSidebar.d.ts +8 -8
  31. package/cjs/components/step-indicator/StepIndicatorSidebar.js +6 -63
  32. package/cjs/components/step-indicator/StepIndicatorSidebar.js.map +1 -1
  33. package/cjs/components/step-indicator/StepIndicatorTriggerButton.d.ts +1 -7
  34. package/cjs/components/step-indicator/StepIndicatorTriggerButton.js +70 -38
  35. package/cjs/components/step-indicator/StepIndicatorTriggerButton.js.map +1 -1
  36. package/cjs/components/step-indicator/style/dnb-step-indicator.css +99 -56
  37. package/cjs/components/step-indicator/style/dnb-step-indicator.min.css +1 -1
  38. package/cjs/components/step-indicator/style/dnb-step-indicator.scss +112 -67
  39. package/cjs/components/step-indicator/style/themes/dnb-step-indicator-theme-sbanken.css +5 -62
  40. package/cjs/components/step-indicator/style/themes/dnb-step-indicator-theme-sbanken.min.css +1 -1
  41. package/cjs/components/step-indicator/style/themes/dnb-step-indicator-theme-sbanken.scss +5 -89
  42. package/cjs/components/step-indicator/style/themes/dnb-step-indicator-theme-ui.css +1 -65
  43. package/cjs/components/step-indicator/style/themes/dnb-step-indicator-theme-ui.min.css +0 -1
  44. package/cjs/components/step-indicator/style/themes/dnb-step-indicator-theme-ui.scss +0 -91
  45. package/cjs/components/tooltip/TooltipContainer.js +23 -7
  46. package/cjs/components/tooltip/TooltipContainer.js.map +1 -1
  47. package/cjs/elements/Element.d.ts +16 -2
  48. package/cjs/elements/Element.js +1 -1
  49. package/cjs/elements/Element.js.map +1 -1
  50. package/cjs/elements/lib.d.ts +1 -1
  51. package/cjs/extensions/forms/Wizard/Container/DisplaySteps.d.ts +3 -3
  52. package/cjs/extensions/forms/Wizard/Container/DisplaySteps.js +14 -10
  53. package/cjs/extensions/forms/Wizard/Container/DisplaySteps.js.map +1 -1
  54. package/cjs/extensions/forms/Wizard/Container/WizardContainer.d.ts +12 -0
  55. package/cjs/extensions/forms/Wizard/Container/WizardContainer.js +24 -13
  56. package/cjs/extensions/forms/Wizard/Container/WizardContainer.js.map +1 -1
  57. package/cjs/extensions/forms/Wizard/Container/WizardContainerDocs.js +21 -11
  58. package/cjs/extensions/forms/Wizard/Container/WizardContainerDocs.js.map +1 -1
  59. package/cjs/extensions/forms/Wizard/style/dnb-wizard-layout.css +2 -14
  60. package/cjs/extensions/forms/Wizard/style/dnb-wizard-layout.min.css +1 -1
  61. package/cjs/extensions/forms/Wizard/style/dnb-wizard-layout.scss +3 -18
  62. package/cjs/extensions/forms/style/dnb-forms.css +2 -13
  63. package/cjs/extensions/forms/style/dnb-forms.min.css +1 -1
  64. package/cjs/shared/Eufemia.d.ts +1 -1
  65. package/cjs/shared/Eufemia.js +2 -2
  66. package/cjs/shared/Eufemia.js.map +1 -1
  67. package/cjs/shared/locales/en-GB.d.ts +0 -1
  68. package/cjs/shared/locales/en-GB.js +1 -2
  69. package/cjs/shared/locales/en-GB.js.map +1 -1
  70. package/cjs/shared/locales/en-US.d.ts +0 -1
  71. package/cjs/shared/locales/index.d.ts +0 -2
  72. package/cjs/shared/locales/nb-NO.d.ts +0 -1
  73. package/cjs/shared/locales/nb-NO.js +1 -2
  74. package/cjs/shared/locales/nb-NO.js.map +1 -1
  75. package/cjs/shared/locales/sv-SE.d.ts +0 -1
  76. package/cjs/shared/locales/sv-SE.js +0 -1
  77. package/cjs/shared/locales/sv-SE.js.map +1 -1
  78. package/cjs/style/core/scopes.scss +1 -1
  79. package/cjs/style/dnb-ui-basis.css +1 -1
  80. package/cjs/style/dnb-ui-basis.min.css +1 -1
  81. package/cjs/style/dnb-ui-body.css +1 -1
  82. package/cjs/style/dnb-ui-body.min.css +1 -1
  83. package/cjs/style/dnb-ui-components.css +101 -65
  84. package/cjs/style/dnb-ui-components.min.css +3 -3
  85. package/cjs/style/dnb-ui-core.css +1 -1
  86. package/cjs/style/dnb-ui-core.min.css +1 -1
  87. package/cjs/style/dnb-ui-extensions.css +2 -13
  88. package/cjs/style/dnb-ui-extensions.min.css +1 -1
  89. package/cjs/style/dnb-ui-forms.css +2 -13
  90. package/cjs/style/dnb-ui-forms.min.css +1 -1
  91. package/cjs/style/themes/theme-eiendom/eiendom-theme-components.css +102 -142
  92. package/cjs/style/themes/theme-eiendom/eiendom-theme-components.min.css +4 -4
  93. package/cjs/style/themes/theme-eiendom/eiendom-theme-extensions.css +2 -13
  94. package/cjs/style/themes/theme-eiendom/eiendom-theme-extensions.min.css +1 -1
  95. package/cjs/style/themes/theme-eiendom/eiendom-theme-forms.css +2 -13
  96. package/cjs/style/themes/theme-eiendom/eiendom-theme-forms.min.css +1 -1
  97. package/cjs/style/themes/theme-sbanken/sbanken-theme-components.css +107 -139
  98. package/cjs/style/themes/theme-sbanken/sbanken-theme-components.min.css +4 -4
  99. package/cjs/style/themes/theme-sbanken/sbanken-theme-extensions.css +2 -13
  100. package/cjs/style/themes/theme-sbanken/sbanken-theme-extensions.min.css +1 -1
  101. package/cjs/style/themes/theme-sbanken/sbanken-theme-forms.css +2 -13
  102. package/cjs/style/themes/theme-sbanken/sbanken-theme-forms.min.css +1 -1
  103. package/cjs/style/themes/theme-ui/ui-theme-components.css +102 -142
  104. package/cjs/style/themes/theme-ui/ui-theme-components.min.css +4 -4
  105. package/cjs/style/themes/theme-ui/ui-theme-extensions.css +2 -13
  106. package/cjs/style/themes/theme-ui/ui-theme-extensions.min.css +1 -1
  107. package/cjs/style/themes/theme-ui/ui-theme-forms.css +2 -13
  108. package/cjs/style/themes/theme-ui/ui-theme-forms.min.css +1 -1
  109. package/components/anchor/Anchor.js +1 -0
  110. package/components/anchor/Anchor.js.map +1 -1
  111. package/components/card/CardDocs.js +1 -1
  112. package/components/card/CardDocs.js.map +1 -1
  113. package/components/help-button/HelpButtonInline.js +1 -1
  114. package/components/help-button/HelpButtonInline.js.map +1 -1
  115. package/components/section/Section.d.ts +2 -1
  116. package/components/section/Section.js +2 -2
  117. package/components/section/Section.js.map +1 -1
  118. package/components/section/style/dnb-section.css +4 -0
  119. package/components/section/style/dnb-section.min.css +1 -1
  120. package/components/section/style/dnb-section.scss +5 -0
  121. package/components/step-indicator/StepIndicator.d.ts +23 -5
  122. package/components/step-indicator/StepIndicator.js +64 -21
  123. package/components/step-indicator/StepIndicator.js.map +1 -1
  124. package/components/step-indicator/StepIndicatorContext.d.ts +2 -14
  125. package/components/step-indicator/StepIndicatorContext.js +9 -53
  126. package/components/step-indicator/StepIndicatorContext.js.map +1 -1
  127. package/components/step-indicator/StepIndicatorDocs.d.ts +5 -0
  128. package/components/step-indicator/StepIndicatorDocs.js +139 -0
  129. package/components/step-indicator/StepIndicatorDocs.js.map +1 -0
  130. package/components/step-indicator/StepIndicatorItem.d.ts +10 -10
  131. package/components/step-indicator/StepIndicatorItem.js +90 -99
  132. package/components/step-indicator/StepIndicatorItem.js.map +1 -1
  133. package/components/step-indicator/StepIndicatorList.js +33 -35
  134. package/components/step-indicator/StepIndicatorList.js.map +1 -1
  135. package/components/step-indicator/StepIndicatorProps.js +2 -1
  136. package/components/step-indicator/StepIndicatorProps.js.map +1 -1
  137. package/components/step-indicator/StepIndicatorSidebar.d.ts +8 -8
  138. package/components/step-indicator/StepIndicatorSidebar.js +6 -59
  139. package/components/step-indicator/StepIndicatorSidebar.js.map +1 -1
  140. package/components/step-indicator/StepIndicatorTriggerButton.d.ts +1 -7
  141. package/components/step-indicator/StepIndicatorTriggerButton.js +71 -39
  142. package/components/step-indicator/StepIndicatorTriggerButton.js.map +1 -1
  143. package/components/step-indicator/style/dnb-step-indicator.css +99 -56
  144. package/components/step-indicator/style/dnb-step-indicator.min.css +1 -1
  145. package/components/step-indicator/style/dnb-step-indicator.scss +112 -67
  146. package/components/step-indicator/style/themes/dnb-step-indicator-theme-sbanken.css +5 -62
  147. package/components/step-indicator/style/themes/dnb-step-indicator-theme-sbanken.min.css +1 -1
  148. package/components/step-indicator/style/themes/dnb-step-indicator-theme-sbanken.scss +5 -89
  149. package/components/step-indicator/style/themes/dnb-step-indicator-theme-ui.css +1 -65
  150. package/components/step-indicator/style/themes/dnb-step-indicator-theme-ui.min.css +0 -1
  151. package/components/step-indicator/style/themes/dnb-step-indicator-theme-ui.scss +0 -91
  152. package/components/tooltip/TooltipContainer.js +23 -7
  153. package/components/tooltip/TooltipContainer.js.map +1 -1
  154. package/elements/Element.d.ts +16 -2
  155. package/elements/Element.js +1 -1
  156. package/elements/Element.js.map +1 -1
  157. package/elements/lib.d.ts +1 -1
  158. package/es/components/anchor/Anchor.js +1 -0
  159. package/es/components/anchor/Anchor.js.map +1 -1
  160. package/es/components/card/CardDocs.js +1 -1
  161. package/es/components/card/CardDocs.js.map +1 -1
  162. package/es/components/help-button/HelpButtonInline.js +1 -1
  163. package/es/components/help-button/HelpButtonInline.js.map +1 -1
  164. package/es/components/section/Section.d.ts +2 -1
  165. package/es/components/section/Section.js +2 -2
  166. package/es/components/section/Section.js.map +1 -1
  167. package/es/components/section/style/dnb-section.css +4 -0
  168. package/es/components/section/style/dnb-section.min.css +1 -1
  169. package/es/components/section/style/dnb-section.scss +5 -0
  170. package/es/components/step-indicator/StepIndicator.d.ts +23 -5
  171. package/es/components/step-indicator/StepIndicator.js +63 -21
  172. package/es/components/step-indicator/StepIndicator.js.map +1 -1
  173. package/es/components/step-indicator/StepIndicatorContext.d.ts +2 -14
  174. package/es/components/step-indicator/StepIndicatorContext.js +5 -49
  175. package/es/components/step-indicator/StepIndicatorContext.js.map +1 -1
  176. package/es/components/step-indicator/StepIndicatorDocs.d.ts +5 -0
  177. package/es/components/step-indicator/StepIndicatorDocs.js +139 -0
  178. package/es/components/step-indicator/StepIndicatorDocs.js.map +1 -0
  179. package/es/components/step-indicator/StepIndicatorItem.d.ts +10 -10
  180. package/es/components/step-indicator/StepIndicatorItem.js +82 -88
  181. package/es/components/step-indicator/StepIndicatorItem.js.map +1 -1
  182. package/es/components/step-indicator/StepIndicatorList.js +33 -35
  183. package/es/components/step-indicator/StepIndicatorList.js.map +1 -1
  184. package/es/components/step-indicator/StepIndicatorProps.js +2 -1
  185. package/es/components/step-indicator/StepIndicatorProps.js.map +1 -1
  186. package/es/components/step-indicator/StepIndicatorSidebar.d.ts +8 -8
  187. package/es/components/step-indicator/StepIndicatorSidebar.js +6 -58
  188. package/es/components/step-indicator/StepIndicatorSidebar.js.map +1 -1
  189. package/es/components/step-indicator/StepIndicatorTriggerButton.d.ts +1 -7
  190. package/es/components/step-indicator/StepIndicatorTriggerButton.js +71 -39
  191. package/es/components/step-indicator/StepIndicatorTriggerButton.js.map +1 -1
  192. package/es/components/step-indicator/style/dnb-step-indicator.css +99 -56
  193. package/es/components/step-indicator/style/dnb-step-indicator.min.css +1 -1
  194. package/es/components/step-indicator/style/dnb-step-indicator.scss +112 -67
  195. package/es/components/step-indicator/style/themes/dnb-step-indicator-theme-sbanken.css +5 -62
  196. package/es/components/step-indicator/style/themes/dnb-step-indicator-theme-sbanken.min.css +1 -1
  197. package/es/components/step-indicator/style/themes/dnb-step-indicator-theme-sbanken.scss +5 -89
  198. package/es/components/step-indicator/style/themes/dnb-step-indicator-theme-ui.css +1 -65
  199. package/es/components/step-indicator/style/themes/dnb-step-indicator-theme-ui.min.css +0 -1
  200. package/es/components/step-indicator/style/themes/dnb-step-indicator-theme-ui.scss +0 -91
  201. package/es/components/tooltip/TooltipContainer.js +23 -7
  202. package/es/components/tooltip/TooltipContainer.js.map +1 -1
  203. package/es/elements/Element.d.ts +16 -2
  204. package/es/elements/Element.js +1 -1
  205. package/es/elements/Element.js.map +1 -1
  206. package/es/elements/lib.d.ts +1 -1
  207. package/es/extensions/forms/Wizard/Container/DisplaySteps.d.ts +3 -3
  208. package/es/extensions/forms/Wizard/Container/DisplaySteps.js +14 -10
  209. package/es/extensions/forms/Wizard/Container/DisplaySteps.js.map +1 -1
  210. package/es/extensions/forms/Wizard/Container/WizardContainer.d.ts +12 -0
  211. package/es/extensions/forms/Wizard/Container/WizardContainer.js +24 -13
  212. package/es/extensions/forms/Wizard/Container/WizardContainer.js.map +1 -1
  213. package/es/extensions/forms/Wizard/Container/WizardContainerDocs.js +21 -11
  214. package/es/extensions/forms/Wizard/Container/WizardContainerDocs.js.map +1 -1
  215. package/es/extensions/forms/Wizard/style/dnb-wizard-layout.css +2 -14
  216. package/es/extensions/forms/Wizard/style/dnb-wizard-layout.min.css +1 -1
  217. package/es/extensions/forms/Wizard/style/dnb-wizard-layout.scss +3 -18
  218. package/es/extensions/forms/style/dnb-forms.css +2 -13
  219. package/es/extensions/forms/style/dnb-forms.min.css +1 -1
  220. package/es/shared/Eufemia.d.ts +1 -1
  221. package/es/shared/Eufemia.js +2 -2
  222. package/es/shared/Eufemia.js.map +1 -1
  223. package/es/shared/locales/en-GB.d.ts +0 -1
  224. package/es/shared/locales/en-GB.js +1 -2
  225. package/es/shared/locales/en-GB.js.map +1 -1
  226. package/es/shared/locales/en-US.d.ts +0 -1
  227. package/es/shared/locales/index.d.ts +0 -2
  228. package/es/shared/locales/nb-NO.d.ts +0 -1
  229. package/es/shared/locales/nb-NO.js +1 -2
  230. package/es/shared/locales/nb-NO.js.map +1 -1
  231. package/es/shared/locales/sv-SE.d.ts +0 -1
  232. package/es/shared/locales/sv-SE.js +0 -1
  233. package/es/shared/locales/sv-SE.js.map +1 -1
  234. package/es/style/core/scopes.scss +1 -1
  235. package/es/style/dnb-ui-basis.css +1 -1
  236. package/es/style/dnb-ui-basis.min.css +1 -1
  237. package/es/style/dnb-ui-body.css +1 -1
  238. package/es/style/dnb-ui-body.min.css +1 -1
  239. package/es/style/dnb-ui-components.css +101 -65
  240. package/es/style/dnb-ui-components.min.css +3 -3
  241. package/es/style/dnb-ui-core.css +1 -1
  242. package/es/style/dnb-ui-core.min.css +1 -1
  243. package/es/style/dnb-ui-extensions.css +2 -13
  244. package/es/style/dnb-ui-extensions.min.css +1 -1
  245. package/es/style/dnb-ui-forms.css +2 -13
  246. package/es/style/dnb-ui-forms.min.css +1 -1
  247. package/es/style/themes/theme-eiendom/eiendom-theme-components.css +102 -142
  248. package/es/style/themes/theme-eiendom/eiendom-theme-components.min.css +4 -4
  249. package/es/style/themes/theme-eiendom/eiendom-theme-extensions.css +2 -13
  250. package/es/style/themes/theme-eiendom/eiendom-theme-extensions.min.css +1 -1
  251. package/es/style/themes/theme-eiendom/eiendom-theme-forms.css +2 -13
  252. package/es/style/themes/theme-eiendom/eiendom-theme-forms.min.css +1 -1
  253. package/es/style/themes/theme-sbanken/sbanken-theme-components.css +107 -139
  254. package/es/style/themes/theme-sbanken/sbanken-theme-components.min.css +4 -4
  255. package/es/style/themes/theme-sbanken/sbanken-theme-extensions.css +2 -13
  256. package/es/style/themes/theme-sbanken/sbanken-theme-extensions.min.css +1 -1
  257. package/es/style/themes/theme-sbanken/sbanken-theme-forms.css +2 -13
  258. package/es/style/themes/theme-sbanken/sbanken-theme-forms.min.css +1 -1
  259. package/es/style/themes/theme-ui/ui-theme-components.css +102 -142
  260. package/es/style/themes/theme-ui/ui-theme-components.min.css +4 -4
  261. package/es/style/themes/theme-ui/ui-theme-extensions.css +2 -13
  262. package/es/style/themes/theme-ui/ui-theme-extensions.min.css +1 -1
  263. package/es/style/themes/theme-ui/ui-theme-forms.css +2 -13
  264. package/es/style/themes/theme-ui/ui-theme-forms.min.css +1 -1
  265. package/esm/dnb-ui-basis.min.mjs +1 -1
  266. package/esm/dnb-ui-components.min.mjs +1 -1
  267. package/esm/dnb-ui-elements.min.mjs +1 -1
  268. package/esm/dnb-ui-extensions.min.mjs +1 -1
  269. package/esm/dnb-ui-lib.min.mjs +1 -1
  270. package/extensions/forms/Wizard/Container/DisplaySteps.d.ts +3 -3
  271. package/extensions/forms/Wizard/Container/DisplaySteps.js +14 -10
  272. package/extensions/forms/Wizard/Container/DisplaySteps.js.map +1 -1
  273. package/extensions/forms/Wizard/Container/WizardContainer.d.ts +12 -0
  274. package/extensions/forms/Wizard/Container/WizardContainer.js +24 -13
  275. package/extensions/forms/Wizard/Container/WizardContainer.js.map +1 -1
  276. package/extensions/forms/Wizard/Container/WizardContainerDocs.js +21 -11
  277. package/extensions/forms/Wizard/Container/WizardContainerDocs.js.map +1 -1
  278. package/extensions/forms/Wizard/style/dnb-wizard-layout.css +2 -14
  279. package/extensions/forms/Wizard/style/dnb-wizard-layout.min.css +1 -1
  280. package/extensions/forms/Wizard/style/dnb-wizard-layout.scss +3 -18
  281. package/extensions/forms/style/dnb-forms.css +2 -13
  282. package/extensions/forms/style/dnb-forms.min.css +1 -1
  283. package/package.json +1 -1
  284. package/shared/Eufemia.d.ts +1 -1
  285. package/shared/Eufemia.js +2 -2
  286. package/shared/Eufemia.js.map +1 -1
  287. package/shared/locales/en-GB.d.ts +0 -1
  288. package/shared/locales/en-GB.js +1 -2
  289. package/shared/locales/en-GB.js.map +1 -1
  290. package/shared/locales/en-US.d.ts +0 -1
  291. package/shared/locales/index.d.ts +0 -2
  292. package/shared/locales/nb-NO.d.ts +0 -1
  293. package/shared/locales/nb-NO.js +1 -2
  294. package/shared/locales/nb-NO.js.map +1 -1
  295. package/shared/locales/sv-SE.d.ts +0 -1
  296. package/shared/locales/sv-SE.js +0 -1
  297. package/shared/locales/sv-SE.js.map +1 -1
  298. package/style/core/scopes.scss +1 -1
  299. package/style/dnb-ui-basis.css +1 -1
  300. package/style/dnb-ui-basis.min.css +1 -1
  301. package/style/dnb-ui-body.css +1 -1
  302. package/style/dnb-ui-body.min.css +1 -1
  303. package/style/dnb-ui-components.css +101 -65
  304. package/style/dnb-ui-components.min.css +3 -3
  305. package/style/dnb-ui-core.css +1 -1
  306. package/style/dnb-ui-core.min.css +1 -1
  307. package/style/dnb-ui-extensions.css +2 -13
  308. package/style/dnb-ui-extensions.min.css +1 -1
  309. package/style/dnb-ui-forms.css +2 -13
  310. package/style/dnb-ui-forms.min.css +1 -1
  311. package/style/themes/theme-eiendom/eiendom-theme-components.css +102 -142
  312. package/style/themes/theme-eiendom/eiendom-theme-components.min.css +4 -4
  313. package/style/themes/theme-eiendom/eiendom-theme-extensions.css +2 -13
  314. package/style/themes/theme-eiendom/eiendom-theme-extensions.min.css +1 -1
  315. package/style/themes/theme-eiendom/eiendom-theme-forms.css +2 -13
  316. package/style/themes/theme-eiendom/eiendom-theme-forms.min.css +1 -1
  317. package/style/themes/theme-sbanken/sbanken-theme-components.css +107 -139
  318. package/style/themes/theme-sbanken/sbanken-theme-components.min.css +4 -4
  319. package/style/themes/theme-sbanken/sbanken-theme-extensions.css +2 -13
  320. package/style/themes/theme-sbanken/sbanken-theme-extensions.min.css +1 -1
  321. package/style/themes/theme-sbanken/sbanken-theme-forms.css +2 -13
  322. package/style/themes/theme-sbanken/sbanken-theme-forms.min.css +1 -1
  323. package/style/themes/theme-ui/ui-theme-components.css +102 -142
  324. package/style/themes/theme-ui/ui-theme-components.min.css +4 -4
  325. package/style/themes/theme-ui/ui-theme-extensions.css +2 -13
  326. package/style/themes/theme-ui/ui-theme-extensions.min.css +1 -1
  327. package/style/themes/theme-ui/ui-theme-forms.css +2 -13
  328. package/style/themes/theme-ui/ui-theme-forms.min.css +1 -1
  329. package/umd/dnb-ui-basis.min.js +1 -1
  330. package/umd/dnb-ui-components.min.js +1 -1
  331. package/umd/dnb-ui-elements.min.js +1 -1
  332. package/umd/dnb-ui-extensions.min.js +1 -1
  333. package/umd/dnb-ui-lib.min.js +1 -1
  334. package/cjs/components/step-indicator/StepIndicatorModal.d.ts +0 -6
  335. package/cjs/components/step-indicator/StepIndicatorModal.js +0 -62
  336. package/cjs/components/step-indicator/StepIndicatorModal.js.map +0 -1
  337. package/components/step-indicator/StepIndicatorModal.d.ts +0 -6
  338. package/components/step-indicator/StepIndicatorModal.js +0 -54
  339. package/components/step-indicator/StepIndicatorModal.js.map +0 -1
  340. package/es/components/step-indicator/StepIndicatorModal.d.ts +0 -6
  341. package/es/components/step-indicator/StepIndicatorModal.js +0 -53
  342. package/es/components/step-indicator/StepIndicatorModal.js.map +0 -1
@@ -8,7 +8,7 @@ import { StepIndicatorContextValues } from './StepIndicatorContext';
8
8
  import type { SpacingProps } from '../../shared/types';
9
9
  import type { SkeletonShow } from '../Skeleton';
10
10
  import type { StepIndicatorItemProps, StepItemWrapper } from './StepIndicatorItem';
11
- import { StepIndicatorTriggerButtonProps } from './StepIndicatorTriggerButton';
11
+ import { FormStatusState, FormStatusText } from '../form-status/FormStatus';
12
12
  export type StepIndicatorMode = 'static' | 'strict' | 'loose';
13
13
  export type StepIndicatorDataItem = Pick<StepIndicatorItemProps, 'title' | 'is_current' | 'inactive' | 'disabled' | 'status' | 'status_state' | 'on_click' | 'on_render'>;
14
14
  export type StepIndicatorData = string | string[] | StepIndicatorDataItem[];
@@ -19,8 +19,11 @@ export type StepIndicatorMouseEvent = {
19
19
  current_step: number;
20
20
  };
21
21
  export type StepIndicatorRenderCallback = {
22
+ /** A component that will render the item with the correct props. */
22
23
  StepItem: typeof StepItemWrapper;
24
+ /** Element that was originally going to be rendered */
23
25
  element: React.ReactNode;
26
+ /** @deprecated never has values */
24
27
  attributes: React.HTMLProps<HTMLElement>;
25
28
  props: StepIndicatorItemProps;
26
29
  context: StepIndicatorContextValues;
@@ -28,6 +31,7 @@ export type StepIndicatorRenderCallback = {
28
31
  export type StepIndicatorProps = Omit<React.HTMLProps<HTMLAnchorElement>, 'ref' | 'data'> & SpacingProps & {
29
32
  /**
30
33
  * <em>(required with `<StepIndicator.Sidebar />`)</em> a unique string-based ID in order to bind together the main component and the sidebar (`<StepIndicator.Sidebar />`). Both have to get the same ID.
34
+ * @deprecated StepIndicator.Sidebar variant is no longer supported
31
35
  */
32
36
  sidebar_id?: string;
33
37
  /**
@@ -57,6 +61,7 @@ export type StepIndicatorProps = Omit<React.HTMLProps<HTMLAnchorElement>, 'ref'
57
61
  * `%step` is used to place the current step into the text
58
62
  * `%count` is used to place the step total into the text
59
63
  * Defaults to `You are on step %step of %count`
64
+ * @deprecated only `step_title`is used
60
65
  */
61
66
  step_title_extended?: string;
62
67
  /**
@@ -73,6 +78,7 @@ export type StepIndicatorProps = Omit<React.HTMLProps<HTMLAnchorElement>, 'ref'
73
78
  on_click?: ({ event, item, current_step, currentStep, }: StepIndicatorMouseEvent) => void;
74
79
  /**
75
80
  * Callback function to manipulate or wrap every item. Has to return a React Node. You receive an object you can use in your custom HOC `{ StepItem, element, attributes, props, context }`.
81
+ * @deprecated no longer does anything other than the step item `title` prop
76
82
  */
77
83
  on_item_render?: ({ StepItem, element, attributes, props, context, }: StepIndicatorRenderCallback) => React.ReactNode;
78
84
  /**
@@ -80,19 +86,31 @@ export type StepIndicatorProps = Omit<React.HTMLProps<HTMLAnchorElement>, 'ref'
80
86
  */
81
87
  on_change?: ({ event, item, current_step, currentStep, }: StepIndicatorMouseEvent) => void;
82
88
  /**
83
- * The props for the trigger button.
84
- * Used internally to pass the props such as a status to the trigger button.
89
+ * Status text. Status is only shown if this prop has text. Defaults to `undefined`
85
90
  */
86
- triggerButtonProps?: StepIndicatorTriggerButtonProps;
91
+ status?: FormStatusText;
92
+ /**
93
+ * The type of status for the `status` prop. Is either `info`, `error` or `warn`.
94
+ * Defaults to `warn`.
95
+ */
96
+ status_state?: FormStatusState;
87
97
  /**
88
98
  * If set to `true`, the height animation on the step items and the drawer button will be omitted. Defaults to `false`.
89
99
  */
90
100
  no_animation?: boolean;
101
+ /**
102
+ * Set to `true` to have the list be expanded initially. Defaults to `false`.
103
+ */
104
+ expandedInitially?: boolean;
105
+ /**
106
+ * Whether or not to break out (using negative margins) on larger screens. Defaults to `false`.
107
+ */
108
+ outset?: boolean;
91
109
  skeleton?: SkeletonShow;
92
110
  className?: string;
93
111
  children?: React.ReactNode;
94
112
  };
95
- declare function StepIndicator({ data, skeleton, current_step, hide_numbers, no_animation, ...restOfProps }: StepIndicatorProps): import("react/jsx-runtime").JSX.Element;
113
+ declare function StepIndicator({ status, status_state, data, skeleton, current_step, hide_numbers, no_animation, expandedInitially, ...restOfProps }: StepIndicatorProps): import("react/jsx-runtime").JSX.Element;
96
114
  declare namespace StepIndicator {
97
115
  var Sidebar: typeof StepIndicatorSidebar;
98
116
  var _supportsSpacingProps: boolean;
@@ -1,38 +1,80 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
1
+ "use client";
2
+
2
3
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
- var _div;
5
- const _excluded = ["data", "skeleton", "current_step", "hide_numbers", "no_animation"];
5
+ var _StepIndicatorTrigger, _StepIndicatorList;
6
+ const _excluded = ["sidebar_id", "step_title_extended"],
7
+ _excluded2 = ["status", "status_state", "data", "skeleton", "current_step", "hide_numbers", "no_animation", "expandedInitially"],
8
+ _excluded3 = ["outset"];
6
9
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
7
10
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
8
- import React from 'react';
11
+ import React, { useContext } from 'react';
12
+ import classnames from 'classnames';
13
+ import { createSpacingClasses } from '../space/SpacingHelper';
14
+ import Card from '../Card';
15
+ import StepIndicatorTriggerButton from './StepIndicatorTriggerButton';
9
16
  import StepIndicatorSidebar from './StepIndicatorSidebar';
10
- import StepIndicatorModal from './StepIndicatorModal';
11
- import { StepIndicatorProvider } from './StepIndicatorContext';
17
+ import StepIndicatorList from './StepIndicatorList';
18
+ import StepIndicatorContext, { StepIndicatorProvider } from './StepIndicatorContext';
12
19
  import { stepIndicatorDefaultProps } from './StepIndicatorProps';
13
- import useId from '../../shared/helpers/useId';
20
+ import FormStatus from '../form-status/FormStatus';
21
+ function handleDeprecatedProps(props) {
22
+ const {
23
+ sidebar_id,
24
+ step_title_extended
25
+ } = props,
26
+ rest = _objectWithoutProperties(props, _excluded);
27
+ return rest;
28
+ }
14
29
  function StepIndicator(_ref) {
15
30
  let {
31
+ status,
32
+ status_state = 'warn',
16
33
  data = stepIndicatorDefaultProps.data,
17
34
  skeleton = stepIndicatorDefaultProps.skeleton,
18
35
  current_step = stepIndicatorDefaultProps.current_step,
19
36
  hide_numbers = stepIndicatorDefaultProps.hide_numbers,
20
- no_animation = stepIndicatorDefaultProps.no_animation
37
+ no_animation = stepIndicatorDefaultProps.no_animation,
38
+ expandedInitially = stepIndicatorDefaultProps.expandedInitially
21
39
  } = _ref,
22
- restOfProps = _objectWithoutProperties(_ref, _excluded);
23
- const props = _objectSpread({
24
- data,
25
- skeleton,
26
- current_step,
27
- hide_numbers,
28
- no_animation
29
- }, restOfProps);
30
- const sidebarId = useId(props.sidebar_id);
31
- return React.createElement(StepIndicatorProvider, _extends({}, props, {
32
- sidebar_id: sidebarId
33
- }), _div || (_div = React.createElement("div", {
40
+ restOfProps = _objectWithoutProperties(_ref, _excluded2);
41
+ const _handleDeprecatedProp = handleDeprecatedProps(_objectSpread({
42
+ data,
43
+ skeleton,
44
+ current_step,
45
+ hide_numbers,
46
+ no_animation,
47
+ expandedInitially
48
+ }, restOfProps)),
49
+ {
50
+ outset
51
+ } = _handleDeprecatedProp,
52
+ props = _objectWithoutProperties(_handleDeprecatedProp, _excluded3);
53
+ return React.createElement(StepIndicatorProvider, props, React.createElement("div", {
34
54
  className: "dnb-step-indicator-wrapper"
35
- }, React.createElement(StepIndicatorModal, null))));
55
+ }, React.createElement(Card, {
56
+ align: "stretch",
57
+ className: classnames('dnb-step-indicator', createSpacingClasses(restOfProps)),
58
+ outset: outset
59
+ }, _StepIndicatorTrigger || (_StepIndicatorTrigger = React.createElement(StepIndicatorTriggerButton, null)), _StepIndicatorList || (_StepIndicatorList = React.createElement(StepIndicatorList, null))), React.createElement(StepIndicatorStatus, {
60
+ status: status,
61
+ status_state: status_state
62
+ })));
63
+ }
64
+ function StepIndicatorStatus({
65
+ status,
66
+ status_state
67
+ }) {
68
+ const {
69
+ openState,
70
+ no_animation
71
+ } = useContext(StepIndicatorContext);
72
+ const show = !openState && !!status;
73
+ return React.createElement(FormStatus, {
74
+ show: show,
75
+ no_animation: no_animation,
76
+ state: status && status_state
77
+ }, status);
36
78
  }
37
79
  StepIndicator.Sidebar = StepIndicatorSidebar;
38
80
  StepIndicator._supportsSpacingProps = true;
@@ -1 +1 @@
1
- {"version":3,"file":"StepIndicator.js","names":["React","StepIndicatorSidebar","StepIndicatorModal","StepIndicatorProvider","stepIndicatorDefaultProps","useId","StepIndicator","_ref","data","skeleton","current_step","hide_numbers","no_animation","restOfProps","_objectWithoutProperties","_excluded","props","_objectSpread","sidebarId","sidebar_id","createElement","_extends","_div","className","Sidebar","_supportsSpacingProps"],"sources":["../../../../src/components/step-indicator/StepIndicator.tsx"],"sourcesContent":["/**\n * Web StepIndicator Component\n *\n */\n\nimport React from 'react'\n\nimport StepIndicatorSidebar from './StepIndicatorSidebar'\n\nimport StepIndicatorModal from './StepIndicatorModal'\nimport {\n StepIndicatorContextValues,\n StepIndicatorProvider,\n} from './StepIndicatorContext'\n\nimport type { SpacingProps } from '../../shared/types'\nimport type { SkeletonShow } from '../Skeleton'\nimport type {\n StepIndicatorItemProps,\n StepItemWrapper,\n} from './StepIndicatorItem'\nimport { stepIndicatorDefaultProps } from './StepIndicatorProps'\nimport useId from '../../shared/helpers/useId'\nimport { StepIndicatorTriggerButtonProps } from './StepIndicatorTriggerButton'\n\nexport type StepIndicatorMode = 'static' | 'strict' | 'loose'\nexport type StepIndicatorDataItem = Pick<\n StepIndicatorItemProps,\n | 'title'\n | 'is_current'\n | 'inactive'\n | 'disabled'\n | 'status'\n | 'status_state'\n | 'on_click'\n | 'on_render'\n>\nexport type StepIndicatorData = string | string[] | StepIndicatorDataItem[]\n\nexport type StepIndicatorMouseEvent = {\n event: React.MouseEvent<HTMLButtonElement>\n item: StepIndicatorItemProps\n currentStep: number\n current_step: number\n}\n\nexport type StepIndicatorRenderCallback = {\n StepItem: typeof StepItemWrapper\n element: React.ReactNode\n attributes: React.HTMLProps<HTMLElement>\n props: StepIndicatorItemProps\n context: StepIndicatorContextValues\n}\n\nexport type StepIndicatorProps = Omit<\n React.HTMLProps<HTMLAnchorElement>,\n 'ref' | 'data'\n> &\n SpacingProps & {\n /**\n * <em>(required with `<StepIndicator.Sidebar />`)</em> a unique string-based ID in order to bind together the main component and the sidebar (`<StepIndicator.Sidebar />`). Both have to get the same ID.\n */\n sidebar_id?: string\n /**\n * <em>(required)</em> defines how the StepIndicator should work. Use `static` for non-interactive steps. Use `strict` for a chronological step order, also, the user can navigate between visited steps. Use `loose` if the user should be able to navigate freely.\n */\n mode: StepIndicatorMode\n /**\n * <em>(required)</em> defines the data/steps showing up in a JavaScript Array or JSON format like `[{title,is_current}]`. See parameters and the example above.\n */\n data: StepIndicatorData\n /**\n * The title shown inside the `<StepIndicatorModal />` supplemental screen reader text for the `<StepIndicatorTriggerButton />`\n * Defaults to `Steps Overview`\n */\n overview_title?: string\n /**\n * The label for `<StepIndicatorTriggerButton />` and supplemental screen reader text for `<StepIndicatorItem />`\n * This value need to contain `%step` and `%count` if you want to display the current step and total amount of steps\n * `%step` is used to place the current step into the text\n * `%count` is used to place the step total into the text\n * Defaults to `Step %step of %count`\n */\n step_title?: string\n /**\n * A descriptive label used in `<StepIndicatorModal />`\n * This value need to contain `%step` and `%count` if you want to display the current step and total amount of steps\n * `%step` is used to place the current step into the text\n * `%count` is used to place the step total into the text\n * Defaults to `You are on step %step of %count`\n */\n step_title_extended?: string\n /**\n * Defines the active number marked step starting by 0. Defaults to `0`.\n */\n current_step?: number\n /**\n * Define whether to show automatically counted numbers or not. Defaults to `false`.\n */\n hide_numbers?: boolean\n /**\n * Will be called once the user clicks on the current or another step. Will be emitted on every click. Returns an object `{ event, item, current_step, currentStep }`.\n */\n on_click?: ({\n event,\n item,\n current_step,\n currentStep,\n }: StepIndicatorMouseEvent) => void\n /**\n * Callback function to manipulate or wrap every item. Has to return a React Node. You receive an object you can use in your custom HOC `{ StepItem, element, attributes, props, context }`.\n */\n on_item_render?: ({\n StepItem,\n element,\n attributes,\n props,\n context,\n }: StepIndicatorRenderCallback) => React.ReactNode\n /**\n * Will be called once the user visits actively a new step. Will be emitted only once. Returns an object `{ event, item, current_step, currentStep }`.\n */\n on_change?: ({\n event,\n item,\n current_step,\n currentStep,\n }: StepIndicatorMouseEvent) => void\n\n /**\n * The props for the trigger button.\n * Used internally to pass the props such as a status to the trigger button.\n */\n triggerButtonProps?: StepIndicatorTriggerButtonProps\n\n /**\n * If set to `true`, the height animation on the step items and the drawer button will be omitted. Defaults to `false`.\n */\n no_animation?: boolean\n skeleton?: SkeletonShow\n className?: string\n children?: React.ReactNode\n }\n\nfunction StepIndicator({\n data = stepIndicatorDefaultProps.data,\n skeleton = stepIndicatorDefaultProps.skeleton,\n current_step = stepIndicatorDefaultProps.current_step,\n hide_numbers = stepIndicatorDefaultProps.hide_numbers,\n no_animation = stepIndicatorDefaultProps.no_animation,\n ...restOfProps\n}: StepIndicatorProps) {\n const props = {\n data,\n skeleton,\n current_step,\n hide_numbers,\n no_animation,\n ...restOfProps,\n }\n\n const sidebarId = useId(props.sidebar_id)\n\n return (\n <StepIndicatorProvider {...props} sidebar_id={sidebarId}>\n <div className=\"dnb-step-indicator-wrapper\">\n <StepIndicatorModal />\n </div>\n </StepIndicatorProvider>\n )\n}\n\nStepIndicator.Sidebar = StepIndicatorSidebar\n\nStepIndicator._supportsSpacingProps = true\n\nexport default StepIndicator\n"],"mappings":";;;;;;;AAKA,OAAOA,KAAK,MAAM,OAAO;AAEzB,OAAOC,oBAAoB,MAAM,wBAAwB;AAEzD,OAAOC,kBAAkB,MAAM,sBAAsB;AACrD,SAEEC,qBAAqB,QAChB,wBAAwB;AAQ/B,SAASC,yBAAyB,QAAQ,sBAAsB;AAChE,OAAOC,KAAK,MAAM,4BAA4B;AA0H9C,SAASC,aAAaA,CAAAC,IAAA,EAOC;EAAA,IAPA;MACrBC,IAAI,GAAGJ,yBAAyB,CAACI,IAAI;MACrCC,QAAQ,GAAGL,yBAAyB,CAACK,QAAQ;MAC7CC,YAAY,GAAGN,yBAAyB,CAACM,YAAY;MACrDC,YAAY,GAAGP,yBAAyB,CAACO,YAAY;MACrDC,YAAY,GAAGR,yBAAyB,CAACQ;IAEvB,CAAC,GAAAL,IAAA;IADhBM,WAAW,GAAAC,wBAAA,CAAAP,IAAA,EAAAQ,SAAA;EAEd,MAAMC,KAAK,GAAAC,aAAA;IACTT,IAAI;IACJC,QAAQ;IACRC,YAAY;IACZC,YAAY;IACZC;EAAY,GACTC,WAAW,CACf;EAED,MAAMK,SAAS,GAAGb,KAAK,CAACW,KAAK,CAACG,UAAU,CAAC;EAEzC,OACEnB,KAAA,CAAAoB,aAAA,CAACjB,qBAAqB,EAAAkB,QAAA,KAAKL,KAAK;IAAEG,UAAU,EAAED;EAAU,IAAAI,IAAA,KAAAA,IAAA,GACtDtB,KAAA,CAAAoB,aAAA;IAAKG,SAAS,EAAC;EAA4B,GACzCvB,KAAA,CAAAoB,aAAA,CAAClB,kBAAkB,MAAE,CAClB,CAAC,CACe,CAAC;AAE5B;AAEAI,aAAa,CAACkB,OAAO,GAAGvB,oBAAoB;AAE5CK,aAAa,CAACmB,qBAAqB,GAAG,IAAI;AAE1C,eAAenB,aAAa","ignoreList":[]}
1
+ {"version":3,"file":"StepIndicator.js","names":["React","useContext","classnames","createSpacingClasses","Card","StepIndicatorTriggerButton","StepIndicatorSidebar","StepIndicatorList","StepIndicatorContext","StepIndicatorProvider","stepIndicatorDefaultProps","FormStatus","handleDeprecatedProps","props","sidebar_id","step_title_extended","rest","_objectWithoutProperties","_excluded","StepIndicator","_ref","status","status_state","data","skeleton","current_step","hide_numbers","no_animation","expandedInitially","restOfProps","_excluded2","_handleDeprecatedProp","_objectSpread","outset","_excluded3","createElement","className","align","_StepIndicatorTrigger","_StepIndicatorList","StepIndicatorStatus","openState","show","state","Sidebar","_supportsSpacingProps"],"sources":["../../../../src/components/step-indicator/StepIndicator.tsx"],"sourcesContent":["/**\n * Web StepIndicator Component\n *\n */\n\nimport React, { useContext } from 'react'\nimport classnames from 'classnames'\n\nimport { createSpacingClasses } from '../space/SpacingHelper'\nimport Card from '../Card'\nimport StepIndicatorTriggerButton from './StepIndicatorTriggerButton'\nimport StepIndicatorSidebar from './StepIndicatorSidebar'\nimport StepIndicatorList from './StepIndicatorList'\nimport StepIndicatorContext, {\n StepIndicatorContextValues,\n StepIndicatorProvider,\n} from './StepIndicatorContext'\n\nimport type { SpacingProps } from '../../shared/types'\nimport type { SkeletonShow } from '../Skeleton'\nimport type {\n StepIndicatorItemProps,\n StepItemWrapper,\n} from './StepIndicatorItem'\nimport { stepIndicatorDefaultProps } from './StepIndicatorProps'\nimport FormStatus, {\n FormStatusState,\n FormStatusText,\n} from '../form-status/FormStatus'\n\nexport type StepIndicatorMode = 'static' | 'strict' | 'loose'\nexport type StepIndicatorDataItem = Pick<\n StepIndicatorItemProps,\n | 'title'\n | 'is_current'\n | 'inactive'\n | 'disabled'\n | 'status'\n | 'status_state'\n | 'on_click'\n | 'on_render'\n>\nexport type StepIndicatorData = string | string[] | StepIndicatorDataItem[]\n\nexport type StepIndicatorMouseEvent = {\n event: React.MouseEvent<HTMLButtonElement>\n item: StepIndicatorItemProps\n currentStep: number\n current_step: number\n}\n\nexport type StepIndicatorRenderCallback = {\n /** A component that will render the item with the correct props. */\n StepItem: typeof StepItemWrapper\n /** Element that was originally going to be rendered */\n element: React.ReactNode\n /** @deprecated never has values */\n attributes: React.HTMLProps<HTMLElement>\n props: StepIndicatorItemProps\n context: StepIndicatorContextValues\n}\n\nexport type StepIndicatorProps = Omit<\n React.HTMLProps<HTMLAnchorElement>,\n 'ref' | 'data'\n> &\n SpacingProps & {\n /**\n * <em>(required with `<StepIndicator.Sidebar />`)</em> a unique string-based ID in order to bind together the main component and the sidebar (`<StepIndicator.Sidebar />`). Both have to get the same ID.\n * @deprecated StepIndicator.Sidebar variant is no longer supported\n */\n sidebar_id?: string\n /**\n * <em>(required)</em> defines how the StepIndicator should work. Use `static` for non-interactive steps. Use `strict` for a chronological step order, also, the user can navigate between visited steps. Use `loose` if the user should be able to navigate freely.\n */\n mode: StepIndicatorMode\n /**\n * <em>(required)</em> defines the data/steps showing up in a JavaScript Array or JSON format like `[{title,is_current}]`. See parameters and the example above.\n */\n data: StepIndicatorData\n /**\n * The title shown inside the `<StepIndicatorModal />` supplemental screen reader text for the `<StepIndicatorTriggerButton />`\n * Defaults to `Steps Overview`\n */\n overview_title?: string\n /**\n * The label for `<StepIndicatorTriggerButton />` and supplemental screen reader text for `<StepIndicatorItem />`\n * This value need to contain `%step` and `%count` if you want to display the current step and total amount of steps\n * `%step` is used to place the current step into the text\n * `%count` is used to place the step total into the text\n * Defaults to `Step %step of %count`\n */\n step_title?: string\n /**\n * A descriptive label used in `<StepIndicatorModal />`\n * This value need to contain `%step` and `%count` if you want to display the current step and total amount of steps\n * `%step` is used to place the current step into the text\n * `%count` is used to place the step total into the text\n * Defaults to `You are on step %step of %count`\n * @deprecated only `step_title`is used\n */\n step_title_extended?: string\n /**\n * Defines the active number marked step starting by 0. Defaults to `0`.\n */\n current_step?: number\n /**\n * Define whether to show automatically counted numbers or not. Defaults to `false`.\n */\n hide_numbers?: boolean\n /**\n * Will be called once the user clicks on the current or another step. Will be emitted on every click. Returns an object `{ event, item, current_step, currentStep }`.\n */\n on_click?: ({\n event,\n item,\n current_step,\n currentStep,\n }: StepIndicatorMouseEvent) => void\n /**\n * Callback function to manipulate or wrap every item. Has to return a React Node. You receive an object you can use in your custom HOC `{ StepItem, element, attributes, props, context }`.\n * @deprecated no longer does anything other than the step item `title` prop\n */\n on_item_render?: ({\n StepItem,\n element,\n attributes,\n props,\n context,\n }: StepIndicatorRenderCallback) => React.ReactNode\n /**\n * Will be called once the user visits actively a new step. Will be emitted only once. Returns an object `{ event, item, current_step, currentStep }`.\n */\n on_change?: ({\n event,\n item,\n current_step,\n currentStep,\n }: StepIndicatorMouseEvent) => void\n /**\n * Status text. Status is only shown if this prop has text. Defaults to `undefined`\n */\n status?: FormStatusText\n /**\n * The type of status for the `status` prop. Is either `info`, `error` or `warn`.\n * Defaults to `warn`.\n */\n status_state?: FormStatusState\n /**\n * If set to `true`, the height animation on the step items and the drawer button will be omitted. Defaults to `false`.\n */\n no_animation?: boolean\n /**\n * Set to `true` to have the list be expanded initially. Defaults to `false`.\n */\n expandedInitially?: boolean\n /**\n * Whether or not to break out (using negative margins) on larger screens. Defaults to `false`.\n */\n outset?: boolean\n skeleton?: SkeletonShow\n className?: string\n children?: React.ReactNode\n }\n\nfunction handleDeprecatedProps(\n props: StepIndicatorProps\n): Omit<StepIndicatorProps, 'sidebar_id' | 'step_title_extended'> {\n const { sidebar_id, step_title_extended, ...rest } = props\n return rest\n}\n\nfunction StepIndicator({\n status,\n status_state = 'warn',\n data = stepIndicatorDefaultProps.data,\n skeleton = stepIndicatorDefaultProps.skeleton,\n current_step = stepIndicatorDefaultProps.current_step,\n hide_numbers = stepIndicatorDefaultProps.hide_numbers,\n no_animation = stepIndicatorDefaultProps.no_animation,\n expandedInitially = stepIndicatorDefaultProps.expandedInitially,\n ...restOfProps\n}: StepIndicatorProps) {\n const { outset, ...props } = handleDeprecatedProps({\n data,\n skeleton,\n current_step,\n hide_numbers,\n no_animation,\n expandedInitially,\n ...restOfProps,\n })\n\n return (\n <StepIndicatorProvider {...props}>\n <div className=\"dnb-step-indicator-wrapper\">\n <Card\n align=\"stretch\"\n className={classnames(\n 'dnb-step-indicator',\n createSpacingClasses(restOfProps)\n )}\n outset={outset}\n >\n <StepIndicatorTriggerButton />\n <StepIndicatorList />\n </Card>\n <StepIndicatorStatus status={status} status_state={status_state} />\n </div>\n </StepIndicatorProvider>\n )\n}\n\nfunction StepIndicatorStatus({ status, status_state }) {\n const { openState, no_animation } = useContext(StepIndicatorContext)\n const show = !openState && !!status\n return (\n <FormStatus\n show={show}\n no_animation={no_animation}\n state={status && status_state}\n >\n {status}\n </FormStatus>\n )\n}\n/**\n * @deprecated StepIndicator.Sidebar variant is no longer supported\n */\nStepIndicator.Sidebar = StepIndicatorSidebar\n\nStepIndicator._supportsSpacingProps = true\n\nexport default StepIndicator\n"],"mappings":";;;;;;;;;;AAKA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,UAAU,MAAM,YAAY;AAEnC,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,OAAOC,IAAI,MAAM,SAAS;AAC1B,OAAOC,0BAA0B,MAAM,8BAA8B;AACrE,OAAOC,oBAAoB,MAAM,wBAAwB;AACzD,OAAOC,iBAAiB,MAAM,qBAAqB;AACnD,OAAOC,oBAAoB,IAEzBC,qBAAqB,QAChB,wBAAwB;AAQ/B,SAASC,yBAAyB,QAAQ,sBAAsB;AAChE,OAAOC,UAAU,MAGV,2BAA2B;AAyIlC,SAASC,qBAAqBA,CAC5BC,KAAyB,EACuC;EAChE,MAAM;MAAEC,UAAU;MAAEC;IAA6B,CAAC,GAAGF,KAAK;IAAdG,IAAI,GAAAC,wBAAA,CAAKJ,KAAK,EAAAK,SAAA;EAC1D,OAAOF,IAAI;AACb;AAEA,SAASG,aAAaA,CAAAC,IAAA,EAUC;EAAA,IAVA;MACrBC,MAAM;MACNC,YAAY,GAAG,MAAM;MACrBC,IAAI,GAAGb,yBAAyB,CAACa,IAAI;MACrCC,QAAQ,GAAGd,yBAAyB,CAACc,QAAQ;MAC7CC,YAAY,GAAGf,yBAAyB,CAACe,YAAY;MACrDC,YAAY,GAAGhB,yBAAyB,CAACgB,YAAY;MACrDC,YAAY,GAAGjB,yBAAyB,CAACiB,YAAY;MACrDC,iBAAiB,GAAGlB,yBAAyB,CAACkB;IAE5B,CAAC,GAAAR,IAAA;IADhBS,WAAW,GAAAZ,wBAAA,CAAAG,IAAA,EAAAU,UAAA;EAEd,MAAAC,qBAAA,GAA6BnB,qBAAqB,CAAAoB,aAAA;MAChDT,IAAI;MACJC,QAAQ;MACRC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,IAAI;AAE1C,eAAe1B,aAAa","ignoreList":[]}
@@ -6,15 +6,10 @@ import React from 'react';
6
6
  import { ContextProps } from '../../shared/Context';
7
7
  import { StepIndicatorData, StepIndicatorMode, StepIndicatorProps } from './StepIndicator';
8
8
  import { StepIndicatorItemProps } from './StepIndicatorItem';
9
- import { StepIndicatorTriggerButtonProps } from './StepIndicatorTriggerButton';
10
9
  export type StepIndicatorContextValues = StepIndicatorProviderProps & StepIndicatorProviderStates & ContextProps;
11
10
  declare const StepIndicatorContext: React.Context<StepIndicatorContextValues>;
12
11
  export default StepIndicatorContext;
13
- export type StepIndicatorProviderProps = Omit<StepIndicatorProps, 'mode' | 'data'> & {
14
- /**
15
- * <em>(required)</em> a unique string-based ID in order to bind together the main component and the sidebar (`<StepIndicator.Sidebar />`). Both have to get the same ID.
16
- */
17
- sidebar_id: string;
12
+ export type StepIndicatorProviderProps = Omit<StepIndicatorProps, 'mode' | 'data' | 'sidebar_id' | 'step_title_extended'> & {
18
13
  /**
19
14
  * <em>(required)</em> defines the data/steps showing up in a JavaScript Array or JSON format like `[{title,is_current}]`. See parameters and the example above.
20
15
  */
@@ -24,24 +19,17 @@ export type StepIndicatorProviderProps = Omit<StepIndicatorProps, 'mode' | 'data
24
19
  */
25
20
  mode?: StepIndicatorMode;
26
21
  children: React.ReactNode;
27
- isSidebar?: boolean;
28
- triggerButtonProps?: StepIndicatorTriggerButtonProps;
29
22
  };
30
23
  export type StepIndicatorProviderStates = {
31
24
  data: (string | StepIndicatorItemProps)[];
32
- hasSidebar: boolean;
33
- hideSidebar: boolean;
34
25
  activeStep: number;
35
26
  openState: boolean;
36
27
  listOfReachedSteps: number[];
37
28
  countSteps: number;
38
29
  stepsLabel: string;
39
- stepsLabelExtended: string;
40
30
  filterAttributes: string[];
41
31
  setActiveStep: React.Dispatch<React.SetStateAction<number>>;
42
- sidebarIsVisible: boolean;
43
- onChangeState: () => void;
44
32
  openHandler: () => void;
45
33
  closeHandler: () => void;
46
34
  };
47
- export declare function StepIndicatorProvider({ isSidebar, ...restOfProps }: StepIndicatorProviderProps): import("react/jsx-runtime").JSX.Element;
35
+ export declare function StepIndicatorProvider(props: StepIndicatorProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -1,42 +1,22 @@
1
1
  "use client";
2
2
 
3
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
- const _excluded = ["isSidebar"];
6
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
7
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
8
3
  import React, { useCallback, useContext, useEffect, useMemo, useReducer, useRef, useState } from 'react';
9
4
  import Context from '../../shared/Context';
10
5
  import { stepIndicatorDefaultProps } from './StepIndicatorProps';
11
6
  import { extendPropsWithContext } from '../../shared/component-helper';
12
- import { onMediaQueryChange } from '../../shared/MediaQueryUtils';
13
7
  const filterAttributes = Object.keys(stepIndicatorDefaultProps).filter(item => {
14
8
  return !['class', 'className'].includes(item);
15
- }).concat(['internalId', 'isSidebar', 'hasSidebar', 'hideSidebar', 'sidebarIsVisible', 'mainTitle', 'stepsLabel', 'stepsLabelExtended', 'listOfReachedSteps', 'setActiveStep', 'activeStep', 'countSteps', 'openState', 'onChangeState', 'openHandler', 'closeHandler', 'innerRef', 'hasSkeletonData', 'filterAttributes', 'onChangeState']);
9
+ }).concat(['internalId', 'mainTitle', 'stepsLabel', 'listOfReachedSteps', 'setActiveStep', 'activeStep', 'countSteps', 'openState', 'openHandler', 'closeHandler', 'innerRef', 'hasSkeletonData', 'filterAttributes']);
16
10
  const StepIndicatorContext = React.createContext(null);
17
11
  export default StepIndicatorContext;
18
- export function StepIndicatorProvider(_ref) {
19
- let {
20
- isSidebar = false
21
- } = _ref,
22
- restOfProps = _objectWithoutProperties(_ref, _excluded);
23
- const props = useMemo(() => {
24
- return _objectSpread({
25
- isSidebar
26
- }, restOfProps);
27
- }, [isSidebar, restOfProps]);
12
+ export function StepIndicatorProvider(props) {
28
13
  const data = useMemo(() => {
29
14
  if (typeof props.data === 'string') {
30
15
  return props.data[0] === '[' ? JSON.parse(props.data) : [];
31
16
  }
32
17
  return props.data || [];
33
18
  }, [props]);
34
- const [hasSidebar, setHasSidebar] = useState(true);
35
- const [hideSidebar, setHideSidebar] = useState(false);
36
- const [openState, setOpenState] = useState(false);
37
- const onChangeState = useCallback(() => {
38
- setOpenState(false);
39
- }, []);
19
+ const [openState, setOpenState] = useState(props.expandedInitially);
40
20
  const openHandler = useCallback(() => {
41
21
  setOpenState(true);
42
22
  }, []);
@@ -59,7 +39,6 @@ export function StepIndicatorProvider(_ref) {
59
39
  forceUpdate();
60
40
  }, []);
61
41
  const listOfReachedSteps = useRef([activeStepRef.current].filter(Boolean)).current;
62
- const mediaQueryListener = useRef(null);
63
42
  const context = useContext(Context);
64
43
  const updateStepTitle = useCallback(title => {
65
44
  return title === null || title === void 0 ? void 0 : title.replace('%step', String((activeStepRef.current || 0) + 1)).replace('%count', String((data === null || data === void 0 ? void 0 : data.length) || 1));
@@ -74,43 +53,20 @@ export function StepIndicatorProvider(_ref) {
74
53
  defaultProps: stepIndicatorDefaultProps,
75
54
  props
76
55
  }, {
77
- hasSidebar,
78
- hideSidebar,
79
56
  activeStep: activeStepRef.current,
80
57
  openState,
81
58
  listOfReachedSteps,
82
59
  data,
83
60
  countSteps,
84
- stepsLabel: updateStepTitle(globalContext.step_title),
85
- stepsLabelExtended: updateStepTitle(globalContext.step_title_extended)
61
+ stepsLabel: updateStepTitle(globalContext.step_title)
86
62
  }, {
87
63
  setActiveStep,
88
- onChangeState,
89
64
  openHandler,
90
65
  closeHandler
91
66
  });
92
- value.sidebarIsVisible = value.hasSidebar && !value.hideSidebar;
93
67
  return value;
94
- }, [closeHandler, context, countSteps, data, hasSidebar, hideSidebar, listOfReachedSteps, onChangeState, openHandler, openState, props, setActiveStep, updateStepTitle]);
68
+ }, [closeHandler, context, countSteps, data, listOfReachedSteps, openHandler, openState, props, setActiveStep, updateStepTitle]);
95
69
  const contextValue = makeContextValue();
96
- useEffect(() => {
97
- var _document;
98
- const container = (_document = document) === null || _document === void 0 ? void 0 : _document.getElementById('sidebar__' + props.sidebar_id);
99
- setHasSidebar(Boolean(container));
100
- mediaQueryListener.current = onMediaQueryChange({
101
- min: '0',
102
- max: 'medium'
103
- }, hideSidebar => {
104
- setHideSidebar(hideSidebar);
105
- }, {
106
- runOnInit: true
107
- });
108
- return () => {
109
- if (mediaQueryListener.current) {
110
- mediaQueryListener.current();
111
- }
112
- };
113
- }, [props.sidebar_id]);
114
70
  useEffect(() => {
115
71
  const currentStepFromProps = getActiveStepFromProps();
116
72
  if (currentStepFromProps !== activeStepRef.current) {
@@ -1 +1 @@
1
- {"version":3,"file":"StepIndicatorContext.js","names":["React","useCallback","useContext","useEffect","useMemo","useReducer","useRef","useState","Context","stepIndicatorDefaultProps","extendPropsWithContext","onMediaQueryChange","filterAttributes","Object","keys","filter","item","includes","concat","StepIndicatorContext","createContext","StepIndicatorProvider","_ref","isSidebar","restOfProps","_objectWithoutProperties","_excluded","props","_objectSpread","data","JSON","parse","hasSidebar","setHasSidebar","hideSidebar","setHideSidebar","openState","setOpenState","onChangeState","openHandler","closeHandler","getActiveStepFromProps","current_step","dataWithItems","itemWithCurrentStep","find","is_current","indexOf","countSteps","length","activeStepRef","forceUpdate","setActiveStep","step","current","listOfReachedSteps","Boolean","mediaQueryListener","context","updateStepTitle","title","replace","String","makeContextValue","globalContext","skeleton","getTranslation","StepIndicator","value","extendSafe","defaultProps","activeStep","stepsLabel","step_title","stepsLabelExtended","step_title_extended","sidebarIsVisible","contextValue","_document","container","document","getElementById","sidebar_id","min","max","runOnInit","currentStepFromProps","push","window","forEach","key","startsWith","createElement","Provider","children","objects","obj","itm","entries","reduce","acc","k","v"],"sources":["../../../../src/components/step-indicator/StepIndicatorContext.tsx"],"sourcesContent":["/**\n * Web StepIndicator Context\n *\n */\n\nimport React, {\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useReducer,\n useRef,\n useState,\n} from 'react'\nimport Context, { ContextProps } from '../../shared/Context'\nimport { stepIndicatorDefaultProps } from './StepIndicatorProps'\nimport { extendPropsWithContext } from '../../shared/component-helper'\nimport { onMediaQueryChange } from '../../shared/MediaQueryUtils'\nimport {\n StepIndicatorData,\n StepIndicatorDataItem,\n StepIndicatorMode,\n StepIndicatorProps,\n} from './StepIndicator'\nimport { StepIndicatorItemProps } from './StepIndicatorItem'\nimport { StepIndicatorTriggerButtonProps } from './StepIndicatorTriggerButton'\n\n// We use this array to filter out unwanted properties\nconst filterAttributes = Object.keys(stepIndicatorDefaultProps)\n .filter((item) => {\n return !['class', 'className'].includes(item)\n })\n .concat([\n 'internalId',\n 'isSidebar',\n 'hasSidebar',\n 'hideSidebar',\n 'sidebarIsVisible',\n 'mainTitle',\n 'stepsLabel',\n 'stepsLabelExtended',\n 'listOfReachedSteps',\n 'setActiveStep',\n 'activeStep',\n 'countSteps',\n 'openState',\n 'onChangeState',\n 'openHandler',\n 'closeHandler',\n 'innerRef',\n 'hasSkeletonData',\n 'filterAttributes',\n 'onChangeState',\n ])\n\nexport type StepIndicatorContextValues = StepIndicatorProviderProps &\n StepIndicatorProviderStates &\n ContextProps\n\nconst StepIndicatorContext =\n React.createContext<StepIndicatorContextValues>(null)\n\nexport default StepIndicatorContext\n\nexport type StepIndicatorProviderProps = Omit<\n StepIndicatorProps,\n 'mode' | 'data'\n> & {\n /**\n * <em>(required)</em> a unique string-based ID in order to bind together the main component and the sidebar (`<StepIndicator.Sidebar />`). Both have to get the same ID.\n */\n sidebar_id: string\n /**\n * <em>(required)</em> defines the data/steps showing up in a JavaScript Array or JSON format like `[{title,is_current}]`. See parameters and the example above.\n */\n data?: StepIndicatorData\n /**\n * <em>(required)</em> defines how the StepIndicator should work. Use `static` for non-interactive steps. Use `strict` for a chronological step order, also, the user can navigate between visited steps. Use `loose` if the user should be able to navigate freely.\n */\n mode?: StepIndicatorMode\n children: React.ReactNode\n isSidebar?: boolean\n triggerButtonProps?: StepIndicatorTriggerButtonProps\n}\n\nexport type StepIndicatorProviderStates = {\n data: (string | StepIndicatorItemProps)[]\n hasSidebar: boolean\n hideSidebar: boolean\n activeStep: number\n openState: boolean\n listOfReachedSteps: number[]\n countSteps: number\n stepsLabel: string\n stepsLabelExtended: string\n filterAttributes: string[]\n setActiveStep: React.Dispatch<React.SetStateAction<number>>\n sidebarIsVisible: boolean\n onChangeState: () => void\n openHandler: () => void\n closeHandler: () => void\n}\n\nexport function StepIndicatorProvider({\n isSidebar = false,\n ...restOfProps\n}: StepIndicatorProviderProps) {\n const props = useMemo(() => {\n return { isSidebar, ...restOfProps }\n }, [isSidebar, restOfProps])\n\n const data = useMemo(() => {\n if (typeof props.data === 'string') {\n return props.data[0] === '[' ? JSON.parse(props.data) : []\n }\n\n return props.data || []\n }, [props])\n\n const [hasSidebar, setHasSidebar] = useState<boolean>(true)\n const [hideSidebar, setHideSidebar] = useState<boolean>(false)\n const [openState, setOpenState] = useState<boolean>(false)\n\n const onChangeState = useCallback(() => {\n setOpenState(false)\n }, [])\n\n const openHandler = useCallback(() => {\n setOpenState(true)\n }, [])\n\n const closeHandler = useCallback(() => {\n setOpenState(false)\n }, [])\n\n const getActiveStepFromProps = useCallback(() => {\n if (typeof data[0] === 'string') {\n return props.current_step\n }\n\n const dataWithItems = data as StepIndicatorDataItem[]\n\n const itemWithCurrentStep = dataWithItems.find(\n (item) => item.is_current\n )\n // Is current on data item has precedence(?) over current_step prop\n return itemWithCurrentStep\n ? dataWithItems.indexOf(itemWithCurrentStep)\n : props.current_step\n }, [data, props.current_step])\n\n const countSteps = data.length\n const activeStepRef = useRef<number>(getActiveStepFromProps())\n const [, forceUpdate] = useReducer(() => ({}), {})\n const setActiveStep = useCallback((step: number) => {\n activeStepRef.current = step\n forceUpdate()\n }, [])\n const listOfReachedSteps = useRef(\n [activeStepRef.current].filter(Boolean)\n ).current\n const mediaQueryListener = useRef(null)\n const context = useContext(Context)\n\n const updateStepTitle = useCallback(\n (title: string) => {\n return title\n ?.replace('%step', String((activeStepRef.current || 0) + 1))\n .replace('%count', String(data?.length || 1))\n },\n [data?.length]\n )\n\n const makeContextValue = useCallback(() => {\n const globalContext = extendPropsWithContext(\n props,\n stepIndicatorDefaultProps,\n { skeleton: context?.skeleton },\n context.getTranslation(context).StepIndicator,\n context.StepIndicator\n )\n\n const value = extendSafe(\n { filterAttributes },\n globalContext,\n // Props\n {\n defaultProps: stepIndicatorDefaultProps,\n props,\n },\n // State\n {\n hasSidebar,\n hideSidebar,\n activeStep: activeStepRef.current,\n openState,\n listOfReachedSteps,\n data,\n countSteps,\n stepsLabel: updateStepTitle(globalContext.step_title),\n stepsLabelExtended: updateStepTitle(\n globalContext.step_title_extended\n ),\n },\n // Functions\n {\n setActiveStep,\n onChangeState,\n openHandler,\n closeHandler,\n }\n ) as StepIndicatorContextValues\n\n value.sidebarIsVisible = value.hasSidebar && !value.hideSidebar\n\n return value\n }, [\n closeHandler,\n context,\n countSteps,\n data,\n hasSidebar,\n hideSidebar,\n listOfReachedSteps,\n onChangeState,\n openHandler,\n openState,\n props,\n setActiveStep,\n updateStepTitle,\n ])\n\n const contextValue = makeContextValue() as StepIndicatorContextValues\n\n // Mount and dismount\n useEffect(() => {\n const container = document?.getElementById(\n 'sidebar__' + props.sidebar_id\n )\n\n setHasSidebar(Boolean(container))\n\n mediaQueryListener.current = onMediaQueryChange(\n {\n min: '0',\n max: 'medium',\n },\n (hideSidebar) => {\n setHideSidebar(hideSidebar)\n },\n { runOnInit: true }\n )\n\n return () => {\n if (mediaQueryListener.current) {\n mediaQueryListener.current()\n }\n }\n }, [props.sidebar_id])\n\n // Keeps the activeStep state updated with changes to the current_step and data props\n useEffect(() => {\n const currentStepFromProps = getActiveStepFromProps()\n\n if (currentStepFromProps !== activeStepRef.current) {\n setActiveStep(currentStepFromProps)\n }\n }, [props.current_step, data, getActiveStepFromProps, setActiveStep])\n\n // Keeps the listOfReachedSteps state up to date with the activeStep state\n const activeStep = activeStepRef.current\n useEffect(() => {\n if (!listOfReachedSteps.includes(activeStep)) {\n listOfReachedSteps.push(activeStep)\n }\n }, [activeStep, listOfReachedSteps])\n\n if (typeof window !== 'undefined' && window['IS_TEST']) {\n contextValue['no_animation'] = true\n }\n\n // Filter out unwanted HTML attributes\n Object.keys(contextValue).forEach((key) => {\n if (key.startsWith('_')) {\n delete contextValue[key]\n }\n })\n\n return (\n <StepIndicatorContext.Provider value={contextValue}>\n {props.children}\n </StepIndicatorContext.Provider>\n )\n}\n\n/**\n * Like \"Object.assign\" – but safe\n * A new falsy value will not be used, if it exists already\n *\n * @param {...object} objects\n * @returns object\n */\nfunction extendSafe(...objects): Record<string, unknown> {\n const obj = {}\n\n objects.forEach((itm) => {\n if (itm.defaultProps && itm.props) {\n itm = Object.entries(itm.props).reduce((acc, [k, v]) => {\n if (itm.defaultProps[k] !== v) {\n acc[k] = v\n }\n return acc\n }, {})\n }\n\n Object.entries(itm).forEach(([k, v]) => {\n if (!obj[k] || (obj[k] && v)) {\n obj[k] = v\n }\n })\n })\n\n return obj\n}\n"],"mappings":";;;;;;;AAKA,OAAOA,KAAK,IACVC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,UAAU,EACVC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,OAAOC,OAAO,MAAwB,sBAAsB;AAC5D,SAASC,yBAAyB,QAAQ,sBAAsB;AAChE,SAASC,sBAA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sE,GAAG,GAAGpF,MAAM,CAACqF,OAAO,CAACD,GAAG,CAACtE,KAAK,CAAC,CAACwE,MAAM,CAAC,CAACC,GAAG,EAAE,CAACC,CAAC,EAAEC,CAAC,CAAC,KAAK;QACtD,IAAIL,GAAG,CAAC3B,YAAY,CAAC+B,CAAC,CAAC,KAAKC,CAAC,EAAE;UAC7BF,GAAG,CAACC,CAAC,CAAC,GAAGC,CAAC;QACZ;QACA,OAAOF,GAAG;MACZ,CAAC,EAAE,CAAC,CAAC,CAAC;IACR;IAEAvF,MAAM,CAACqF,OAAO,CAACD,GAAG,CAAC,CAACR,OAAO,CAAC,CAAC,CAACY,CAAC,EAAEC,CAAC,CAAC,KAAK;MACtC,IAAI,CAACN,GAAG,CAACK,CAAC,CAAC,IAAKL,GAAG,CAACK,CAAC,CAAC,IAAIC,CAAE,EAAE;QAC5BN,GAAG,CAACK,CAAC,CAAC,GAAGC,CAAC;MACZ;IACF,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAON,GAAG;AACZ","ignoreList":[]}
1
+ {"version":3,"file":"StepIndicatorContext.js","names":["React","useCallback","useContext","useEffect","useMemo","useReducer","useRef","useState","Context","stepIndicatorDefaultProps","extendPropsWithContext","filterAttributes","Object","keys","filter","item","includes","concat","StepIndicatorContext","createContext","StepIndicatorProvider","props","data","JSON","parse","openState","setOpenState","expandedInitially","openHandler","closeHandler","getActiveStepFromProps","current_step","dataWithItems","itemWithCurrentStep","find","is_current","indexOf","countSteps","length","activeStepRef","forceUpdate","setActiveStep","step","current","listOfReachedSteps","Boolean","context","updateStepTitle","title","replace","String","makeContextValue","globalContext","skeleton","getTranslation","StepIndicator","value","extendSafe","defaultProps","activeStep","stepsLabel","step_title","contextValue","currentStepFromProps","push","window","forEach","key","startsWith","createElement","Provider","children","objects","obj","itm","entries","reduce","acc","k","v"],"sources":["../../../../src/components/step-indicator/StepIndicatorContext.tsx"],"sourcesContent":["/**\n * Web StepIndicator Context\n *\n */\n\nimport React, {\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useReducer,\n useRef,\n useState,\n} from 'react'\nimport Context, { ContextProps } from '../../shared/Context'\nimport { stepIndicatorDefaultProps } from './StepIndicatorProps'\nimport { extendPropsWithContext } from '../../shared/component-helper'\nimport {\n StepIndicatorData,\n StepIndicatorDataItem,\n StepIndicatorMode,\n StepIndicatorProps,\n} from './StepIndicator'\nimport { StepIndicatorItemProps } from './StepIndicatorItem'\n\n// We use this array to filter out unwanted properties\nconst filterAttributes = Object.keys(stepIndicatorDefaultProps)\n .filter((item) => {\n return !['class', 'className'].includes(item)\n })\n .concat([\n 'internalId',\n 'mainTitle',\n 'stepsLabel',\n 'listOfReachedSteps',\n 'setActiveStep',\n 'activeStep',\n 'countSteps',\n 'openState',\n 'openHandler',\n 'closeHandler',\n 'innerRef',\n 'hasSkeletonData',\n 'filterAttributes',\n ])\n\nexport type StepIndicatorContextValues = StepIndicatorProviderProps &\n StepIndicatorProviderStates &\n ContextProps\n\nconst StepIndicatorContext =\n React.createContext<StepIndicatorContextValues>(null)\n\nexport default StepIndicatorContext\n\nexport type StepIndicatorProviderProps = Omit<\n StepIndicatorProps,\n 'mode' | 'data' | 'sidebar_id' | 'step_title_extended'\n> & {\n /**\n * <em>(required)</em> defines the data/steps showing up in a JavaScript Array or JSON format like `[{title,is_current}]`. See parameters and the example above.\n */\n data?: StepIndicatorData\n /**\n * <em>(required)</em> defines how the StepIndicator should work. Use `static` for non-interactive steps. Use `strict` for a chronological step order, also, the user can navigate between visited steps. Use `loose` if the user should be able to navigate freely.\n */\n mode?: StepIndicatorMode\n children: React.ReactNode\n}\n\nexport type StepIndicatorProviderStates = {\n data: (string | StepIndicatorItemProps)[]\n activeStep: number\n openState: boolean\n listOfReachedSteps: number[]\n countSteps: number\n stepsLabel: string\n filterAttributes: string[]\n setActiveStep: React.Dispatch<React.SetStateAction<number>>\n openHandler: () => void\n closeHandler: () => void\n}\n\nexport function StepIndicatorProvider(props: StepIndicatorProviderProps) {\n const data = useMemo(() => {\n if (typeof props.data === 'string') {\n return props.data[0] === '[' ? JSON.parse(props.data) : []\n }\n\n return props.data || []\n }, [props])\n\n const [openState, setOpenState] = useState<boolean>(\n props.expandedInitially\n )\n\n const openHandler = useCallback(() => {\n setOpenState(true)\n }, [])\n\n const closeHandler = useCallback(() => {\n setOpenState(false)\n }, [])\n\n const getActiveStepFromProps = useCallback(() => {\n if (typeof data[0] === 'string') {\n return props.current_step\n }\n\n const dataWithItems = data as StepIndicatorDataItem[]\n\n const itemWithCurrentStep = dataWithItems.find(\n (item) => item.is_current\n )\n // Is current on data item has precedence(?) over current_step prop\n return itemWithCurrentStep\n ? dataWithItems.indexOf(itemWithCurrentStep)\n : props.current_step\n }, [data, props.current_step])\n\n const countSteps = data.length\n const activeStepRef = useRef<number>(getActiveStepFromProps())\n const [, forceUpdate] = useReducer(() => ({}), {})\n const setActiveStep = useCallback((step: number) => {\n activeStepRef.current = step\n forceUpdate()\n }, [])\n const listOfReachedSteps = useRef(\n [activeStepRef.current].filter(Boolean)\n ).current\n const context = useContext(Context)\n\n const updateStepTitle = useCallback(\n (title: string) => {\n return title\n ?.replace('%step', String((activeStepRef.current || 0) + 1))\n .replace('%count', String(data?.length || 1))\n },\n [data?.length]\n )\n\n const makeContextValue = useCallback(() => {\n const globalContext = extendPropsWithContext(\n props,\n stepIndicatorDefaultProps,\n { skeleton: context?.skeleton },\n context.getTranslation(context).StepIndicator,\n context.StepIndicator\n )\n\n const value = extendSafe(\n { filterAttributes },\n globalContext,\n // Props\n {\n defaultProps: stepIndicatorDefaultProps,\n props,\n },\n // State\n {\n activeStep: activeStepRef.current,\n openState,\n listOfReachedSteps,\n data,\n countSteps,\n stepsLabel: updateStepTitle(globalContext.step_title),\n },\n // Functions\n {\n setActiveStep,\n openHandler,\n closeHandler,\n }\n ) as StepIndicatorContextValues\n\n return value\n }, [\n closeHandler,\n context,\n countSteps,\n data,\n listOfReachedSteps,\n openHandler,\n openState,\n props,\n setActiveStep,\n updateStepTitle,\n ])\n\n const contextValue = makeContextValue() as StepIndicatorContextValues\n\n // Keeps the activeStep state updated with changes to the current_step and data props\n useEffect(() => {\n const currentStepFromProps = getActiveStepFromProps()\n\n if (currentStepFromProps !== activeStepRef.current) {\n setActiveStep(currentStepFromProps)\n }\n }, [props.current_step, data, getActiveStepFromProps, setActiveStep])\n\n // Keeps the listOfReachedSteps state up to date with the activeStep state\n const activeStep = activeStepRef.current\n useEffect(() => {\n if (!listOfReachedSteps.includes(activeStep)) {\n listOfReachedSteps.push(activeStep)\n }\n }, [activeStep, listOfReachedSteps])\n\n if (typeof window !== 'undefined' && window['IS_TEST']) {\n contextValue['no_animation'] = true\n }\n\n // Filter out unwanted HTML attributes\n Object.keys(contextValue).forEach((key) => {\n if (key.startsWith('_')) {\n delete contextValue[key]\n }\n })\n\n return (\n <StepIndicatorContext.Provider value={contextValue}>\n {props.children}\n </StepIndicatorContext.Provider>\n )\n}\n\n/**\n * Like \"Object.assign\" – but safe\n * A new falsy value will not be used, if it exists already\n *\n * @param {...object} objects\n * @returns object\n */\nfunction extendSafe(...objects): Record<string, unknown> {\n const obj = {}\n\n objects.forEach((itm) => {\n if (itm.defaultProps && itm.props) {\n itm = Object.entries(itm.props).reduce((acc, [k, v]) => {\n if (itm.defaultProps[k] !== v) {\n acc[k] = v\n }\n return acc\n }, {})\n }\n\n Object.entries(itm).forEach(([k, v]) => {\n if (!obj[k] || (obj[k] && v)) {\n obj[k] = v\n }\n })\n })\n\n return obj\n}\n"],"mappings":";;AAKA,OAAOA,KAAK,IACVC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,UAAU,EACVC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,OAAOC,OAAO,MAAwB,sBAAsB;AAC5D,SAASC,yBAAyB,QAAQ,sBAAsB;AAChE,SAASC,sBAAsB,QAAQ,+BAA+B;AAUtE,MAAMC,gBAAgB,GAAGC,MAAM,CAACC,IAAI,CAACJ,yBAAyB,CAAC,CAC5D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,CAAC,CAAC,KAAK;MACtC,IAAI,CAACN,GAAG,CAACK,CAAC,CAAC,IAAKL,GAAG,CAACK,CAAC,CAAC,IAAIC,CAAE,EAAE;QAC5BN,GAAG,CAACK,CAAC,CAAC,GAAGC,CAAC;MACZ;IACF,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAON,GAAG;AACZ","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ import { PropertiesTableProps } from '../../shared/types';
2
+ export declare const StepIndicatorProperties: PropertiesTableProps;
3
+ export declare const StepIndicatorEvents: PropertiesTableProps;
4
+ export declare const StepIndicatorStepProperties: PropertiesTableProps;
5
+ export declare const StepIndicatorStepEvents: PropertiesTableProps;
@@ -0,0 +1,139 @@
1
+ export const StepIndicatorProperties = {
2
+ mode: {
3
+ doc: 'Defines how the StepIndicator should work. Use `static` for non-interactive steps. Use `strict` for a chronological step order, also, the user can navigate between visited steps. Use `loose` if the user should be able to navigate freely.',
4
+ type: [`'static'`, `'strict'`, `'loose'`],
5
+ status: 'required'
6
+ },
7
+ data: {
8
+ doc: 'Defines the data/steps showing up in a JavaScript Array or JSON format like `[{title,is_current}]`. See below for properties of `STEP_DATA`.',
9
+ type: ['[Step Item](#step-item-properties)[]', 'string[]'],
10
+ status: 'required'
11
+ },
12
+ current_step: {
13
+ doc: 'Defines the initial step starting from 0. Also defines the furthest step visited when `mode="strict"`. Will update to the new step if changed (but will not trigger the `on_change` event). Defaults to `0`.',
14
+ type: 'number',
15
+ status: 'optional'
16
+ },
17
+ overview_title: {
18
+ doc: 'The title shown inside the `<StepIndicatorModal />` supplemental screen reader text for the `<StepIndicatorTriggerButton />`. Defaults to `Steps Overview`.',
19
+ type: 'string',
20
+ status: 'optional'
21
+ },
22
+ step_title: {
23
+ doc: 'Label for `<StepIndicatorTriggerButton />` and screen reader text for `<StepIndicatorItem />`. Must contain `%step` and `%count` to interpolate `current_step` and `stepCount` into the text. Defaults to `Step %step of %count`.',
24
+ type: 'string',
25
+ status: 'optional'
26
+ },
27
+ hide_numbers: {
28
+ doc: 'Define whether to show automatically counted numbers or not. Defaults to `false`.',
29
+ type: 'boolean',
30
+ status: 'optional'
31
+ },
32
+ no_animation: {
33
+ doc: 'If set to `true`, the height animation on step change and list expansion will be omitted. Defaults to `false`.',
34
+ type: 'boolean',
35
+ status: 'optional'
36
+ },
37
+ expandedInitially: {
38
+ doc: 'Set to `true` to have the list be expanded initially. Defaults to `false`.',
39
+ type: 'boolean',
40
+ status: 'optional'
41
+ },
42
+ outset: {
43
+ doc: 'Same as `outset` in [Card](/uilib/components/card/properties). Defaults to `false`',
44
+ type: 'boolean',
45
+ status: 'optional'
46
+ },
47
+ status: {
48
+ doc: 'Text for status shown below the step indicator when it is not expanded. Defaults to `undefined`',
49
+ type: 'string',
50
+ status: 'optional'
51
+ },
52
+ status_state: {
53
+ doc: 'The type of status shown when the `status` prop is set. Defaults to `warn`.',
54
+ type: `['warn', 'info', 'error']`,
55
+ status: 'optional'
56
+ },
57
+ skeleton: {
58
+ doc: 'If set to `true`, an overlaying skeleton with animation will be shown.',
59
+ type: 'boolean',
60
+ status: 'optional'
61
+ },
62
+ '[Space](/uilib/layout/space/properties)': {
63
+ doc: 'Spacing properties like `top` or `bottom` are supported.',
64
+ type: ['string', 'object'],
65
+ status: 'optional'
66
+ },
67
+ sidebar_id: {
68
+ doc: 'A unique string-based ID in order to bind together the main component and the sidebar (`<StepIndicator.Sidebar />`). Both have to get the same ID.',
69
+ type: 'string',
70
+ status: 'deprecated'
71
+ },
72
+ step_title_extended: {
73
+ doc: 'Descriptive label for `<StepIndicatorModal />`. Must contain `%step` and `%count` to interpolate `current_step` and `stepCount` into the text. Defaults to `You are on step %step of %count`.',
74
+ type: 'string',
75
+ status: 'deprecated'
76
+ },
77
+ on_item_render: {
78
+ doc: 'Deprecated, just use step item `title`. Callback function whose return is rendered inside each step instead of the default render. Has to return a React Node. Receives parameter `{ StepItem, element, attributes, props, context }`, where `props` also includes all props from the step object (like `title` or `status`) and the `<StepItem>` is a component that can be used to wrap your returned content.',
79
+ type: 'function',
80
+ status: 'deprecated'
81
+ }
82
+ };
83
+ export const StepIndicatorEvents = {
84
+ on_click: {
85
+ doc: 'Will be called when the user clicks on any clickable step in the list. Is called right before `on_change`. Receives parameter `{ event, item, current_step, currentStep }`',
86
+ type: 'function',
87
+ status: 'optional'
88
+ },
89
+ on_change: {
90
+ doc: 'Will be called when the user changes step by clicking in the steps list (changing the `current_step` prop does not trigger the event). Receives parameter `{ event, item, current_step, currentStep }`',
91
+ type: 'function',
92
+ status: 'optional'
93
+ }
94
+ };
95
+ export const StepIndicatorStepProperties = {
96
+ title: {
97
+ doc: 'The title of the step.',
98
+ type: ['string', 'React.ReactNode'],
99
+ status: 'required'
100
+ },
101
+ is_current: {
102
+ doc: 'If set to `true`, this item step will be set as the current selected step. This can be used instead of `current_step` on the main component.',
103
+ type: 'boolean',
104
+ status: 'optional'
105
+ },
106
+ inactive: {
107
+ doc: 'If set to `true`, this item step will be handled as an inactive step and will not be clickable. Defaults to `false`.',
108
+ type: 'boolean',
109
+ status: 'optional'
110
+ },
111
+ disabled: {
112
+ doc: 'If set to `true`, this step will be handled the same as `inactive` as well as getting a disabled mouseover and `aria-disabled="true`. Defaults to `false`.',
113
+ type: 'boolean',
114
+ status: 'optional'
115
+ },
116
+ status: {
117
+ doc: 'Is used to set the status text.',
118
+ type: ['string', 'React.ReactNode'],
119
+ status: 'optional'
120
+ },
121
+ status_state: {
122
+ doc: 'In case the status state should be `info` or `error`. Defaults to `warn`.',
123
+ type: [`'warn'`, `'info'`, `'error'`],
124
+ status: 'optional'
125
+ },
126
+ on_render: {
127
+ doc: 'Deprecated, just use `title`. Callback function whose return is rendered inside the step instead of the default render (or `on_item_render`). Has to return a React Node. <br/> Receives parameter `{ StepItem, element, attributes, props, context }`, where `props` also includes all props in the step object (like `title` or `status`) and the `<StepItem>` is a component that can be used to wrap your returned content.',
128
+ type: 'function',
129
+ status: 'deprecated'
130
+ }
131
+ };
132
+ export const StepIndicatorStepEvents = {
133
+ on_click: {
134
+ doc: "Called when user clicks the step. Is called right before the main component's `on_click`. Receives parameter `{ event, item, current_step, currentStep }`",
135
+ type: 'function',
136
+ status: 'optional'
137
+ }
138
+ };
139
+ //# sourceMappingURL=StepIndicatorDocs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StepIndicatorDocs.js","names":["StepIndicatorProperties","mode","doc","type","status","data","current_step","overview_title","step_title","hide_numbers","no_animation","expandedInitially","outset","status_state","skeleton","sidebar_id","step_title_extended","on_item_render","StepIndicatorEvents","on_click","on_change","StepIndicatorStepProperties","title","is_current","inactive","disabled","on_render","StepIndicatorStepEvents"],"sources":["../../../../src/components/step-indicator/StepIndicatorDocs.ts"],"sourcesContent":["import { PropertiesTableProps } from '../../shared/types'\n\nexport const StepIndicatorProperties: PropertiesTableProps = {\n mode: {\n doc: 'Defines how the StepIndicator should work. Use `static` for non-interactive steps. Use `strict` for a chronological step order, also, the user can navigate between visited steps. Use `loose` if the user should be able to navigate freely.',\n type: [`'static'`, `'strict'`, `'loose'`],\n status: 'required',\n },\n data: {\n doc: 'Defines the data/steps showing up in a JavaScript Array or JSON format like `[{title,is_current}]`. See below for properties of `STEP_DATA`.',\n type: ['[Step Item](#step-item-properties)[]', 'string[]'],\n status: 'required',\n },\n current_step: {\n doc: 'Defines the initial step starting from 0. Also defines the furthest step visited when `mode=\"strict\"`. Will update to the new step if changed (but will not trigger the `on_change` event). Defaults to `0`.',\n type: 'number',\n status: 'optional',\n },\n overview_title: {\n doc: 'The title shown inside the `<StepIndicatorModal />` supplemental screen reader text for the `<StepIndicatorTriggerButton />`. Defaults to `Steps Overview`.',\n type: 'string',\n status: 'optional',\n },\n step_title: {\n doc: 'Label for `<StepIndicatorTriggerButton />` and screen reader text for `<StepIndicatorItem />`. Must contain `%step` and `%count` to interpolate `current_step` and `stepCount` into the text. Defaults to `Step %step of %count`.',\n type: 'string',\n status: 'optional',\n },\n hide_numbers: {\n doc: 'Define whether to show automatically counted numbers or not. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n no_animation: {\n doc: 'If set to `true`, the height animation on step change and list expansion will be omitted. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n expandedInitially: {\n doc: 'Set to `true` to have the list be expanded initially. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n outset: {\n doc: 'Same as `outset` in [Card](/uilib/components/card/properties). Defaults to `false`',\n type: 'boolean',\n status: 'optional',\n },\n status: {\n doc: 'Text for status shown below the step indicator when it is not expanded. Defaults to `undefined`',\n type: 'string',\n status: 'optional',\n },\n status_state: {\n doc: 'The type of status shown when the `status` prop is set. Defaults to `warn`.',\n type: `['warn', 'info', 'error']`,\n status: 'optional',\n },\n skeleton: {\n doc: 'If set to `true`, an overlaying skeleton with animation will be shown.',\n type: 'boolean',\n status: 'optional',\n },\n '[Space](/uilib/layout/space/properties)': {\n doc: 'Spacing properties like `top` or `bottom` are supported.',\n type: ['string', 'object'],\n status: 'optional',\n },\n sidebar_id: {\n doc: 'A unique string-based ID in order to bind together the main component and the sidebar (`<StepIndicator.Sidebar />`). Both have to get the same ID.',\n type: 'string',\n status: 'deprecated',\n },\n step_title_extended: {\n doc: 'Descriptive label for `<StepIndicatorModal />`. Must contain `%step` and `%count` to interpolate `current_step` and `stepCount` into the text. Defaults to `You are on step %step of %count`.',\n type: 'string',\n status: 'deprecated',\n },\n on_item_render: {\n doc: 'Deprecated, just use step item `title`. Callback function whose return is rendered inside each step instead of the default render. Has to return a React Node. Receives parameter `{ StepItem, element, attributes, props, context }`, where `props` also includes all props from the step object (like `title` or `status`) and the `<StepItem>` is a component that can be used to wrap your returned content.',\n type: 'function',\n status: 'deprecated',\n },\n}\n\nexport const StepIndicatorEvents: PropertiesTableProps = {\n on_click: {\n doc: 'Will be called when the user clicks on any clickable step in the list. Is called right before `on_change`. Receives parameter `{ event, item, current_step, currentStep }`',\n type: 'function',\n status: 'optional',\n },\n on_change: {\n doc: 'Will be called when the user changes step by clicking in the steps list (changing the `current_step` prop does not trigger the event). Receives parameter `{ event, item, current_step, currentStep }`',\n type: 'function',\n status: 'optional',\n },\n}\n\nexport const StepIndicatorStepProperties: PropertiesTableProps = {\n title: {\n doc: 'The title of the step.',\n type: ['string', 'React.ReactNode'],\n status: 'required',\n },\n is_current: {\n doc: 'If set to `true`, this item step will be set as the current selected step. This can be used instead of `current_step` on the main component.',\n type: 'boolean',\n status: 'optional',\n },\n inactive: {\n doc: 'If set to `true`, this item step will be handled as an inactive step and will not be clickable. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n disabled: {\n doc: 'If set to `true`, this step will be handled the same as `inactive` as well as getting a disabled mouseover and `aria-disabled=\"true`. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n status: {\n doc: 'Is used to set the status text.',\n type: ['string', 'React.ReactNode'],\n status: 'optional',\n },\n status_state: {\n doc: 'In case the status state should be `info` or `error`. Defaults to `warn`.',\n type: [`'warn'`, `'info'`, `'error'`],\n status: 'optional',\n },\n on_render: {\n doc: 'Deprecated, just use `title`. Callback function whose return is rendered inside the step instead of the default render (or `on_item_render`). Has to return a React Node. <br/> Receives parameter `{ StepItem, element, attributes, props, context }`, where `props` also includes all props in the step object (like `title` or `status`) and the `<StepItem>` is a component that can be used to wrap your returned content.',\n type: 'function',\n status: 'deprecated',\n },\n}\n\nexport const StepIndicatorStepEvents: PropertiesTableProps = {\n on_click: {\n doc: \"Called when user clicks the step. Is called right before the main component's `on_click`. Receives parameter `{ event, item, current_step, currentStep }`\",\n type: 'function',\n status: 'optional',\n },\n}\n"],"mappings":"AAEA,OAAO,MAAMA,uBAA6C,GAAG;EAC3DC,IAAI,EAAE;IACJC,GAAG,EAAE,+OAA+O;IACpPC,IAAI,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,SAAS,CAAC;IACzCC,MAAM,EAAE;EACV,CAAC;EACDC,IAAI,EAAE;IACJH,GAAG,EAAE,8IAA8I;IACnJC,IAAI,EAAE,C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