@rededor/cura 1.4.0 → 1.5.0-alpha.1

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 (281) hide show
  1. package/dist/cjs/{cura-accordion_12.cjs.entry.js → cura-accordion_13.cjs.entry.js} +107 -29
  2. package/dist/cjs/cura-accordion_13.cjs.entry.js.map +1 -0
  3. package/dist/cjs/cura-alert.cjs.entry.js +1 -1
  4. package/dist/cjs/cura-avatar.cjs.entry.js +1 -1
  5. package/dist/cjs/cura-badge-counter.cjs.entry.js +2 -2
  6. package/dist/cjs/cura-badge-counter.cjs.entry.js.map +1 -1
  7. package/dist/cjs/cura-badge-distance.cjs.entry.js +1 -1
  8. package/dist/cjs/cura-badge-distance.cjs.entry.js.map +1 -1
  9. package/dist/cjs/cura-badge-dot.cjs.entry.js +44 -0
  10. package/dist/cjs/cura-badge-dot.cjs.entry.js.map +1 -0
  11. package/dist/cjs/cura-badge-pill.cjs.entry.js +2 -1
  12. package/dist/cjs/cura-badge-pill.cjs.entry.js.map +1 -1
  13. package/dist/cjs/cura-button-outline.cjs.entry.js +1 -1
  14. package/dist/cjs/cura-button-select.cjs.entry.js +1 -1
  15. package/dist/cjs/cura-button-transparent.cjs.entry.js +1 -1
  16. package/dist/cjs/cura-calendar.cjs.entry.js +1 -1
  17. package/dist/cjs/cura-card.cjs.entry.js +1 -1
  18. package/dist/cjs/cura-checkbox.cjs.entry.js +1 -1
  19. package/dist/cjs/cura-display.cjs.entry.js +1 -1
  20. package/dist/cjs/cura-dropdown-search-option-title.cjs.entry.js +1 -1
  21. package/dist/cjs/cura-dropdown-search-option.cjs.entry.js +2 -2
  22. package/dist/cjs/cura-dropdown-search.cjs.entry.js +27 -21
  23. package/dist/cjs/cura-dropdown-search.cjs.entry.js.map +1 -1
  24. package/dist/cjs/cura-icons-view.cjs.entry.js +1 -1
  25. package/dist/cjs/cura-input-date.cjs.entry.js +1 -1
  26. package/dist/cjs/cura-loader-bar.cjs.entry.js +1 -1
  27. package/dist/cjs/cura-progress-bar_2.cjs.entry.js +98 -0
  28. package/dist/cjs/cura-progress-bar_2.cjs.entry.js.map +1 -0
  29. package/dist/cjs/cura-radio.cjs.entry.js +1 -1
  30. package/dist/cjs/cura-stepper.cjs.entry.js +123 -0
  31. package/dist/cjs/cura-stepper.cjs.entry.js.map +1 -0
  32. package/dist/cjs/cura-switch.cjs.entry.js +1 -1
  33. package/dist/cjs/cura-toast.cjs.entry.js +1 -1
  34. package/dist/cjs/cura-tooltip.cjs.entry.js +9 -8
  35. package/dist/cjs/cura-tooltip.cjs.entry.js.map +1 -1
  36. package/dist/cjs/cura.cjs.js +1 -1
  37. package/dist/cjs/loader.cjs.js +1 -1
  38. package/dist/collection/collection-manifest.json +4 -0
  39. package/dist/collection/components/badges/cura-badge-counter/cura-badge-counter.js +2 -2
  40. package/dist/collection/components/badges/cura-badge-counter/cura-badge-counter.js.map +1 -1
  41. package/dist/collection/components/badges/cura-badge-distance/cura-badge-distance.css +2 -2
  42. package/dist/collection/components/badges/cura-badge-dot/cura-badge-dot.css +61 -0
  43. package/dist/collection/components/badges/cura-badge-dot/cura-badge-dot.js +108 -0
  44. package/dist/collection/components/badges/cura-badge-dot/cura-badge-dot.js.map +1 -0
  45. package/dist/collection/components/badges/cura-badge-dot/cura-badge-dot.stories.js +65 -0
  46. package/dist/collection/components/badges/cura-badge-dot/cura-badge-dot.stories.js.map +1 -0
  47. package/dist/collection/components/badges/cura-badge-pill/cura-badge-pill.js +2 -1
  48. package/dist/collection/components/badges/cura-badge-pill/cura-badge-pill.js.map +1 -1
  49. package/dist/collection/components/buttons/cura-button/cura-button.js +1 -1
  50. package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js +1 -1
  51. package/dist/collection/components/buttons/cura-button-select/cura-button-select.js +1 -1
  52. package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js +1 -1
  53. package/dist/collection/components/cura-alert/cura-alert.js +1 -1
  54. package/dist/collection/components/cura-avatar/cura-avatar.js +1 -1
  55. package/dist/collection/components/cura-calendar/cura-calendar.js +1 -1
  56. package/dist/collection/components/cura-card/cura-card.js +1 -1
  57. package/dist/collection/components/cura-icon/cura-icon.js +1 -1
  58. package/dist/collection/components/cura-icons-view/cura-icons-view.js +1 -1
  59. package/dist/collection/components/cura-modal/cura-modal.css +3 -3
  60. package/dist/collection/components/cura-modal/cura-modal.js +39 -1
  61. package/dist/collection/components/cura-modal/cura-modal.js.map +1 -1
  62. package/dist/collection/components/cura-modal/cura-modal.stories.js +18 -0
  63. package/dist/collection/components/cura-modal/cura-modal.stories.js.map +1 -1
  64. package/dist/collection/components/cura-page-template/cura-page-template.js +1 -1
  65. package/dist/collection/components/cura-stepper/cura-progress-bar/cura-progress-bar.css +15 -0
  66. package/dist/collection/components/cura-stepper/cura-progress-bar/cura-progress-bar.js +121 -0
  67. package/dist/collection/components/cura-stepper/cura-progress-bar/cura-progress-bar.js.map +1 -0
  68. package/dist/collection/components/cura-stepper/cura-stepper-item/cura-stepper-item.css +10 -0
  69. package/dist/collection/components/cura-stepper/cura-stepper-item/cura-stepper-item.js +153 -0
  70. package/dist/collection/components/cura-stepper/cura-stepper-item/cura-stepper-item.js.map +1 -0
  71. package/dist/collection/components/cura-stepper/cura-stepper.css +72 -0
  72. package/dist/collection/components/cura-stepper/cura-stepper.js +227 -0
  73. package/dist/collection/components/cura-stepper/cura-stepper.js.map +1 -0
  74. package/dist/collection/components/cura-stepper/cura-stepper.stories.js +97 -0
  75. package/dist/collection/components/cura-stepper/cura-stepper.stories.js.map +1 -0
  76. package/dist/collection/components/cura-stepper/stepper.type.js +2 -0
  77. package/dist/collection/components/cura-stepper/stepper.type.js.map +1 -0
  78. package/dist/collection/components/cura-toast/cura-toast.js +1 -1
  79. package/dist/collection/components/cura-tooltip/cura-tooltip.js +9 -8
  80. package/dist/collection/components/cura-tooltip/cura-tooltip.js.map +1 -1
  81. package/dist/collection/components/forms/cura-checkbox/cura-checkbox.js +1 -1
  82. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js +2 -2
  83. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.js +1 -1
  84. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.css +4 -2
  85. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js +28 -21
  86. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js.map +1 -1
  87. package/dist/collection/components/forms/cura-input-date/cura-input-date.js +1 -1
  88. package/dist/collection/components/forms/cura-label/cura-label.js +1 -1
  89. package/dist/collection/components/forms/cura-radio/cura-radio.js +1 -1
  90. package/dist/collection/components/forms/cura-select/cura-select.css +5 -1
  91. package/dist/collection/components/forms/cura-select/cura-select.js +32 -19
  92. package/dist/collection/components/forms/cura-select/cura-select.js.map +1 -1
  93. package/dist/collection/components/forms/cura-select/cura-select.stories.js +1 -1
  94. package/dist/collection/components/forms/cura-select/cura-select.stories.js.map +1 -1
  95. package/dist/collection/components/forms/cura-select-options/cura-select-option.js +1 -1
  96. package/dist/collection/components/forms/cura-switch/cura-switch.js +1 -1
  97. package/dist/collection/components/loaders/cura-loader-bar/cura-loader-bar.js +1 -1
  98. package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.js +1 -1
  99. package/dist/collection/components/text/cura-display/cura-display.js +1 -1
  100. package/dist/collection/components/text/cura-heading/cura-heading.js +1 -1
  101. package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +1 -1
  102. package/dist/components/cura-alert.js +1 -1
  103. package/dist/components/cura-avatar.js +1 -1
  104. package/dist/components/cura-badge-counter2.js +2 -2
  105. package/dist/components/cura-badge-counter2.js.map +1 -1
  106. package/dist/components/cura-badge-distance.js +1 -1
  107. package/dist/components/cura-badge-distance.js.map +1 -1
  108. package/dist/components/cura-badge-dot.d.ts +11 -0
  109. package/dist/components/cura-badge-dot.js +63 -0
  110. package/dist/components/cura-badge-dot.js.map +1 -0
  111. package/dist/components/cura-badge-pill.js +1 -113
  112. package/dist/components/cura-badge-pill.js.map +1 -1
  113. package/dist/components/cura-badge-pill2.js +118 -0
  114. package/dist/components/cura-badge-pill2.js.map +1 -0
  115. package/dist/components/cura-button-outline.js +1 -1
  116. package/dist/components/cura-button-select.js +1 -1
  117. package/dist/components/cura-button-transparent2.js +1 -1
  118. package/dist/components/cura-button.js +1 -1
  119. package/dist/components/cura-calendar2.js +1 -1
  120. package/dist/components/cura-card.js +1 -1
  121. package/dist/components/cura-checkbox.js +1 -1
  122. package/dist/components/cura-display.js +1 -1
  123. package/dist/components/cura-dropdown-search-option-title.js +1 -1
  124. package/dist/components/cura-dropdown-search-option.js +2 -2
  125. package/dist/components/cura-dropdown-search.js +29 -22
  126. package/dist/components/cura-dropdown-search.js.map +1 -1
  127. package/dist/components/cura-heading2.js +1 -1
  128. package/dist/components/cura-icon2.js +1 -1
  129. package/dist/components/cura-icons-view.js +1 -1
  130. package/dist/components/cura-input-date.js +1 -1
  131. package/dist/components/cura-label2.js +1 -1
  132. package/dist/components/cura-loader-bar2.js +1 -1
  133. package/dist/components/cura-loader-circle2.js +1 -1
  134. package/dist/components/cura-modal.js +6 -2
  135. package/dist/components/cura-modal.js.map +1 -1
  136. package/dist/components/cura-page-template.js +1 -1
  137. package/dist/components/cura-paragraph2.js +1 -1
  138. package/dist/components/cura-progress-bar.d.ts +11 -0
  139. package/dist/components/cura-progress-bar.js +8 -0
  140. package/dist/components/cura-progress-bar.js.map +1 -0
  141. package/dist/components/cura-progress-bar2.js +48 -0
  142. package/dist/components/cura-progress-bar2.js.map +1 -0
  143. package/dist/components/cura-radio.js +1 -1
  144. package/dist/components/cura-select-option2.js +1 -1
  145. package/dist/components/cura-select2.js +33 -20
  146. package/dist/components/cura-select2.js.map +1 -1
  147. package/dist/components/cura-stepper-item.d.ts +11 -0
  148. package/dist/components/cura-stepper-item.js +8 -0
  149. package/dist/components/cura-stepper-item.js.map +1 -0
  150. package/dist/components/cura-stepper-item2.js +116 -0
  151. package/dist/components/cura-stepper-item2.js.map +1 -0
  152. package/dist/components/cura-stepper.d.ts +11 -0
  153. package/dist/components/cura-stepper.js +187 -0
  154. package/dist/components/cura-stepper.js.map +1 -0
  155. package/dist/components/cura-switch.js +1 -1
  156. package/dist/components/cura-toast.js +1 -1
  157. package/dist/components/cura-tooltip.js +9 -8
  158. package/dist/components/cura-tooltip.js.map +1 -1
  159. package/dist/components/index.js +8 -0
  160. package/dist/components/index.js.map +1 -1
  161. package/dist/cura/cura.esm.js +1 -1
  162. package/dist/cura/cura.esm.js.map +1 -1
  163. package/dist/cura/{p-a91d451f.entry.js → p-04006a3e.entry.js} +2 -2
  164. package/dist/cura/{p-576c65b4.entry.js → p-0a133399.entry.js} +2 -2
  165. package/dist/cura/{p-116a1cd6.entry.js → p-164ddb46.entry.js} +2 -2
  166. package/dist/cura/{p-36dbec98.entry.js → p-235ac0b4.entry.js} +2 -2
  167. package/dist/cura/p-23fa2246.entry.js +2 -0
  168. package/dist/cura/p-23fa2246.entry.js.map +1 -0
  169. package/dist/cura/{p-c4da4c44.entry.js → p-2af6216a.entry.js} +2 -2
  170. package/dist/cura/{p-42258230.entry.js → p-3030774e.entry.js} +2 -2
  171. package/dist/cura/{p-3d958d45.entry.js → p-3c0931d3.entry.js} +2 -2
  172. package/dist/cura/{p-ef593f12.entry.js → p-46eaee31.entry.js} +2 -2
  173. package/dist/cura/p-46eaee31.entry.js.map +1 -0
  174. package/dist/cura/{p-bdb1a0c5.entry.js → p-4aefe237.entry.js} +2 -2
  175. package/dist/cura/{p-aa65cb50.entry.js → p-529332d3.entry.js} +2 -2
  176. package/dist/cura/{p-aa65cb50.entry.js.map → p-529332d3.entry.js.map} +1 -1
  177. package/dist/cura/{p-19f28fa8.entry.js → p-545e8e55.entry.js} +2 -2
  178. package/dist/cura/p-557b90c4.entry.js +2 -0
  179. package/dist/cura/p-557b90c4.entry.js.map +1 -0
  180. package/dist/cura/p-6624108e.entry.js +2 -0
  181. package/dist/cura/p-6b627841.entry.js +2 -0
  182. package/dist/cura/p-6b627841.entry.js.map +1 -0
  183. package/dist/cura/{p-3eca0f0c.entry.js → p-70adcf7b.entry.js} +2 -2
  184. package/dist/cura/{p-52f854e0.entry.js → p-7ba80d78.entry.js} +2 -2
  185. package/dist/cura/{p-52f854e0.entry.js.map → p-7ba80d78.entry.js.map} +1 -1
  186. package/dist/cura/p-8622c492.entry.js +2 -0
  187. package/dist/cura/p-8622c492.entry.js.map +1 -0
  188. package/dist/cura/p-935eeb7b.entry.js +2 -0
  189. package/dist/cura/p-935eeb7b.entry.js.map +1 -0
  190. package/dist/cura/{p-2545cfc7.entry.js → p-b3e93e74.entry.js} +2 -2
  191. package/dist/cura/{p-dcd2e5bb.entry.js → p-bce10f9b.entry.js} +2 -2
  192. package/dist/cura/p-cfbe2bce.entry.js +2 -0
  193. package/dist/cura/p-cfbe2bce.entry.js.map +1 -0
  194. package/dist/cura/{p-818c581f.entry.js → p-d13e3295.entry.js} +2 -2
  195. package/dist/cura/{p-e1a41792.entry.js → p-ec7876d3.entry.js} +2 -2
  196. package/dist/cura/{p-b1a51e81.entry.js → p-ee8db3dc.entry.js} +2 -2
  197. package/dist/cura/{p-4b496c51.entry.js → p-f96b0923.entry.js} +2 -2
  198. package/dist/esm/{cura-accordion_12.entry.js → cura-accordion_13.entry.js} +107 -30
  199. package/dist/esm/cura-accordion_13.entry.js.map +1 -0
  200. package/dist/esm/cura-alert.entry.js +1 -1
  201. package/dist/esm/cura-avatar.entry.js +1 -1
  202. package/dist/esm/cura-badge-counter.entry.js +2 -2
  203. package/dist/esm/cura-badge-counter.entry.js.map +1 -1
  204. package/dist/esm/cura-badge-distance.entry.js +1 -1
  205. package/dist/esm/cura-badge-distance.entry.js.map +1 -1
  206. package/dist/esm/cura-badge-dot.entry.js +40 -0
  207. package/dist/esm/cura-badge-dot.entry.js.map +1 -0
  208. package/dist/esm/cura-badge-pill.entry.js +2 -1
  209. package/dist/esm/cura-badge-pill.entry.js.map +1 -1
  210. package/dist/esm/cura-button-outline.entry.js +1 -1
  211. package/dist/esm/cura-button-select.entry.js +1 -1
  212. package/dist/esm/cura-button-transparent.entry.js +1 -1
  213. package/dist/esm/cura-calendar.entry.js +1 -1
  214. package/dist/esm/cura-card.entry.js +1 -1
  215. package/dist/esm/cura-checkbox.entry.js +1 -1
  216. package/dist/esm/cura-display.entry.js +1 -1
  217. package/dist/esm/cura-dropdown-search-option-title.entry.js +1 -1
  218. package/dist/esm/cura-dropdown-search-option.entry.js +2 -2
  219. package/dist/esm/cura-dropdown-search.entry.js +27 -21
  220. package/dist/esm/cura-dropdown-search.entry.js.map +1 -1
  221. package/dist/esm/cura-icons-view.entry.js +1 -1
  222. package/dist/esm/cura-input-date.entry.js +1 -1
  223. package/dist/esm/cura-loader-bar.entry.js +1 -1
  224. package/dist/esm/cura-progress-bar_2.entry.js +93 -0
  225. package/dist/esm/cura-progress-bar_2.entry.js.map +1 -0
  226. package/dist/esm/cura-radio.entry.js +1 -1
  227. package/dist/esm/cura-stepper.entry.js +119 -0
  228. package/dist/esm/cura-stepper.entry.js.map +1 -0
  229. package/dist/esm/cura-switch.entry.js +1 -1
  230. package/dist/esm/cura-toast.entry.js +1 -1
  231. package/dist/esm/cura-tooltip.entry.js +9 -8
  232. package/dist/esm/cura-tooltip.entry.js.map +1 -1
  233. package/dist/esm/cura.js +1 -1
  234. package/dist/esm/loader.js +1 -1
  235. package/dist/types/components/badges/cura-badge-dot/cura-badge-dot.d.ts +24 -0
  236. package/dist/types/components/badges/cura-badge-dot/cura-badge-dot.stories.d.ts +53 -0
  237. package/dist/types/components/cura-modal/cura-modal.d.ts +10 -0
  238. package/dist/types/components/cura-modal/cura-modal.stories.d.ts +20 -0
  239. package/dist/types/components/cura-stepper/cura-progress-bar/cura-progress-bar.d.ts +23 -0
  240. package/dist/types/components/cura-stepper/cura-stepper-item/cura-stepper-item.d.ts +60 -0
  241. package/dist/types/components/cura-stepper/cura-stepper.d.ts +62 -0
  242. package/dist/types/components/cura-stepper/cura-stepper.stories.d.ts +77 -0
  243. package/dist/types/components/cura-stepper/stepper.type.d.ts +4 -0
  244. package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search.d.ts +3 -1
  245. package/dist/types/components/forms/cura-select/cura-select.d.ts +8 -8
  246. package/dist/types/components/forms/cura-select/cura-select.stories.d.ts +1 -1
  247. package/dist/types/components.d.ts +206 -0
  248. package/package.json +2 -2
  249. package/dist/cjs/cura-accordion_12.cjs.entry.js.map +0 -1
  250. package/dist/cjs/cura-modal.cjs.entry.js +0 -71
  251. package/dist/cjs/cura-modal.cjs.entry.js.map +0 -1
  252. package/dist/cura/p-35920ac0.entry.js +0 -2
  253. package/dist/cura/p-35920ac0.entry.js.map +0 -1
  254. package/dist/cura/p-3e4ca7e7.entry.js +0 -2
  255. package/dist/cura/p-3e4ca7e7.entry.js.map +0 -1
  256. package/dist/cura/p-6e4f4fbf.entry.js +0 -2
  257. package/dist/cura/p-6e4f4fbf.entry.js.map +0 -1
  258. package/dist/cura/p-ef593f12.entry.js.map +0 -1
  259. package/dist/cura/p-f23c4ed8.entry.js +0 -2
  260. package/dist/cura/p-f23c4ed8.entry.js.map +0 -1
  261. package/dist/cura/p-f5d45776.entry.js +0 -2
  262. package/dist/esm/cura-accordion_12.entry.js.map +0 -1
  263. package/dist/esm/cura-modal.entry.js +0 -67
  264. package/dist/esm/cura-modal.entry.js.map +0 -1
  265. /package/dist/cura/{p-a91d451f.entry.js.map → p-04006a3e.entry.js.map} +0 -0
  266. /package/dist/cura/{p-576c65b4.entry.js.map → p-0a133399.entry.js.map} +0 -0
  267. /package/dist/cura/{p-116a1cd6.entry.js.map → p-164ddb46.entry.js.map} +0 -0
  268. /package/dist/cura/{p-36dbec98.entry.js.map → p-235ac0b4.entry.js.map} +0 -0
  269. /package/dist/cura/{p-c4da4c44.entry.js.map → p-2af6216a.entry.js.map} +0 -0
  270. /package/dist/cura/{p-42258230.entry.js.map → p-3030774e.entry.js.map} +0 -0
  271. /package/dist/cura/{p-3d958d45.entry.js.map → p-3c0931d3.entry.js.map} +0 -0
  272. /package/dist/cura/{p-bdb1a0c5.entry.js.map → p-4aefe237.entry.js.map} +0 -0
  273. /package/dist/cura/{p-19f28fa8.entry.js.map → p-545e8e55.entry.js.map} +0 -0
  274. /package/dist/cura/{p-f5d45776.entry.js.map → p-6624108e.entry.js.map} +0 -0
  275. /package/dist/cura/{p-3eca0f0c.entry.js.map → p-70adcf7b.entry.js.map} +0 -0
  276. /package/dist/cura/{p-2545cfc7.entry.js.map → p-b3e93e74.entry.js.map} +0 -0
  277. /package/dist/cura/{p-dcd2e5bb.entry.js.map → p-bce10f9b.entry.js.map} +0 -0
  278. /package/dist/cura/{p-818c581f.entry.js.map → p-d13e3295.entry.js.map} +0 -0
  279. /package/dist/cura/{p-e1a41792.entry.js.map → p-ec7876d3.entry.js.map} +0 -0
  280. /package/dist/cura/{p-b1a51e81.entry.js.map → p-ee8db3dc.entry.js.map} +0 -0
  281. /package/dist/cura/{p-4b496c51.entry.js.map → p-f96b0923.entry.js.map} +0 -0
@@ -0,0 +1,153 @@
1
+ import { Host, h } from "@stencil/core";
2
+ export class CuraStepperItem {
3
+ constructor() {
4
+ this.statusMap = {
5
+ active: {
6
+ badgeColor: 'info',
7
+ textColor: 'info-dark',
8
+ icon: '',
9
+ iconOnly: false,
10
+ },
11
+ stop: {
12
+ badgeColor: 'error',
13
+ textColor: 'error-darker',
14
+ icon: 'alertCircle',
15
+ iconOnly: true,
16
+ },
17
+ done: {
18
+ badgeColor: 'success',
19
+ textColor: 'success-darker',
20
+ icon: 'checkCircle',
21
+ iconOnly: true,
22
+ },
23
+ default: {
24
+ badgeColor: 'neutral',
25
+ textColor: 'neutral',
26
+ icon: '',
27
+ iconOnly: false,
28
+ },
29
+ };
30
+ this.displayHeading = false;
31
+ this.heading = undefined;
32
+ this.label = undefined;
33
+ this.status = 'default';
34
+ this.styles = {};
35
+ }
36
+ connectedCallback() {
37
+ this.updateStyles();
38
+ }
39
+ getStatusProperties() {
40
+ return this.statusMap[this.status] || this.statusMap.default;
41
+ }
42
+ updateStyles() {
43
+ const { fonts, colors, spacing } = window.CuraAPI.theme;
44
+ const weights = fonts.getWeights();
45
+ this.styles = {
46
+ '--base-spacing': spacing.getSpacing(),
47
+ '--neutral-purewhite': colors.getColor('neutral-purewhite'),
48
+ '--neutral-lighter': colors.getColor('neutral-lighter'),
49
+ '--neutral-base': colors.getColor('neutral-base'),
50
+ '--font-size': fonts.getSize(),
51
+ '--font-color': fonts.getColor(),
52
+ '--font-family': fonts.getFamily(),
53
+ '--font-weight-regular': weights.regular,
54
+ };
55
+ }
56
+ render() {
57
+ const { badgeColor, textColor, icon, iconOnly } = this.getStatusProperties();
58
+ return (h(Host, { key: 'c226daf451d9c861d5303474ef0fc31c1602371b' }, h("div", { key: '7aece988946e4bef02c597a80ea1a505c201e188', class: "item-container", style: this.styles }, h("cura-badge-pill", { key: 'd0362b4a4ee3c047173399ea5f7c912a5a0f7810', type: "solid", color: badgeColor, "icon-name": icon, "icon-only": iconOnly, "border-radius": "50%" }, this.label), this.displayHeading && this.heading && (h("cura-paragraph", { key: '015effecdb26be22386363e77bd5a0e671701d60', marginBlock: "0", size: "xsmall", color: textColor }, this.heading)))));
59
+ }
60
+ static get is() { return "cura-stepper-item"; }
61
+ static get encapsulation() { return "shadow"; }
62
+ static get originalStyleUrls() {
63
+ return {
64
+ "$": ["cura-stepper-item.scss"]
65
+ };
66
+ }
67
+ static get styleUrls() {
68
+ return {
69
+ "$": ["cura-stepper-item.css"]
70
+ };
71
+ }
72
+ static get properties() {
73
+ return {
74
+ "displayHeading": {
75
+ "type": "boolean",
76
+ "mutable": false,
77
+ "complexType": {
78
+ "original": "boolean",
79
+ "resolved": "boolean",
80
+ "references": {}
81
+ },
82
+ "required": false,
83
+ "optional": false,
84
+ "docs": {
85
+ "tags": [],
86
+ "text": "Determines if the step title is displayed (default: false)"
87
+ },
88
+ "attribute": "display-heading",
89
+ "reflect": true,
90
+ "defaultValue": "false"
91
+ },
92
+ "heading": {
93
+ "type": "string",
94
+ "mutable": false,
95
+ "complexType": {
96
+ "original": "string",
97
+ "resolved": "string",
98
+ "references": {}
99
+ },
100
+ "required": false,
101
+ "optional": false,
102
+ "docs": {
103
+ "tags": [],
104
+ "text": "The title of the step (displayed if `displayHeading` is true)"
105
+ },
106
+ "attribute": "heading",
107
+ "reflect": true
108
+ },
109
+ "label": {
110
+ "type": "string",
111
+ "mutable": false,
112
+ "complexType": {
113
+ "original": "string",
114
+ "resolved": "string",
115
+ "references": {}
116
+ },
117
+ "required": false,
118
+ "optional": false,
119
+ "docs": {
120
+ "tags": [],
121
+ "text": "The label displayed inside the badge"
122
+ },
123
+ "attribute": "label",
124
+ "reflect": true
125
+ },
126
+ "status": {
127
+ "type": "string",
128
+ "mutable": false,
129
+ "complexType": {
130
+ "original": "'done' | 'stop' | 'active' | 'default'",
131
+ "resolved": "\"active\" | \"default\" | \"done\" | \"stop\"",
132
+ "references": {}
133
+ },
134
+ "required": false,
135
+ "optional": false,
136
+ "docs": {
137
+ "tags": [],
138
+ "text": "The current status of the step\nCan be:\n - 'done' for completed steps\n - 'stop' for failed steps\n - 'active' for the current active step\n - 'default' for steps that are neither done, active nor stopped."
139
+ },
140
+ "attribute": "status",
141
+ "reflect": true,
142
+ "defaultValue": "'default'"
143
+ }
144
+ };
145
+ }
146
+ static get states() {
147
+ return {
148
+ "styles": {}
149
+ };
150
+ }
151
+ static get elementRef() { return "hostElement"; }
152
+ }
153
+ //# sourceMappingURL=cura-stepper-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cura-stepper-item.js","sourceRoot":"","sources":["../../../../src/components/cura-stepper/cura-stepper-item/cura-stepper-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOzE,MAAM,OAAO,eAAe;;Q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B,cAAc,EAAE,KAAK,CAAC,QAAQ,EAAE;YAChC,eAAe,EAAE,KAAK,CAAC,SAAS,EAAE;YAClC,uBAAuB,EAAE,OAAO,CAAC,OAAO;SACzC,CAAC;IACJ,CAAC;IAED,MAAM;QACJ,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC7E,OAAO,CACL,EAAC,IAAI;YACH,4DAAK,KAAK,EAAC,gBAAgB,EAAC,KAAK,EAAE,IAAI,CAAC,MAAM;gBAC5C,wEACE,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,UAAuG,eACnG,IAAI,eACJ,QAAQ,mBACL,KAAK,IAElB,IAAI,CAAC,KAAK,CACK;gBACjB,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,OAAO,IAAI,CACtC,uEAAgB,WAAW,EAAC,GAAG,EAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAE,SAAS,IAC3D,IAAI,CAAC,OAAO,CACE,CAClB,CACG,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, Prop, State, h } from '@stencil/core';\n\n@Component({\n tag: 'cura-stepper-item',\n styleUrl: 'cura-stepper-item.scss',\n shadow: true,\n})\nexport class CuraStepperItem {\n /**\n * Determines if the step title is displayed (default: false)\n */\n @Prop({ reflect: true }) displayHeading: boolean = false;\n\n /**\n * The title of the step (displayed if `displayHeading` is true)\n */\n @Prop({ reflect: true }) heading: string;\n\n /**\n * The label displayed inside the badge\n */\n @Prop({ reflect: true }) label: string;\n\n /**\n * The current status of the step\n * Can be:\n * - 'done' for completed steps\n * - 'stop' for failed steps\n * - 'active' for the current active step\n * - 'default' for steps that are neither done, active nor stopped.\n */\n @Prop({ reflect: true }) status: 'done' | 'stop' | 'active' | 'default' = 'default';\n\n @State() styles = {};\n\n @Element() hostElement: HTMLElement;\n\n connectedCallback() {\n this.updateStyles();\n }\n\n statusMap = {\n active: {\n badgeColor: 'info',\n textColor: 'info-dark',\n icon: '',\n iconOnly: false,\n },\n stop: {\n badgeColor: 'error',\n textColor: 'error-darker',\n icon: 'alertCircle',\n iconOnly: true,\n },\n done: {\n badgeColor: 'success',\n textColor: 'success-darker',\n icon: 'checkCircle',\n iconOnly: true,\n },\n default: {\n badgeColor: 'neutral',\n textColor: 'neutral',\n icon: '',\n iconOnly: false,\n },\n };\n\n getStatusProperties() {\n return this.statusMap[this.status] || this.statusMap.default;\n }\n\n updateStyles() {\n const { fonts, colors, spacing } = window.CuraAPI.theme;\n const weights = fonts.getWeights();\n\n this.styles = {\n '--base-spacing': spacing.getSpacing(),\n '--neutral-purewhite': colors.getColor('neutral-purewhite'),\n '--neutral-lighter': colors.getColor('neutral-lighter'),\n '--neutral-base': colors.getColor('neutral-base'),\n '--font-size': fonts.getSize(),\n '--font-color': fonts.getColor(),\n '--font-family': fonts.getFamily(),\n '--font-weight-regular': weights.regular,\n };\n }\n\n render() {\n const { badgeColor, textColor, icon, iconOnly } = this.getStatusProperties();\n return (\n <Host>\n <div class=\"item-container\" style={this.styles}>\n <cura-badge-pill\n type=\"solid\"\n color={badgeColor as 'info' | 'error' | 'success' | 'neutral' | 'primary' | 'secondary' | 'accent' | 'warning'}\n icon-name={icon}\n icon-only={iconOnly}\n border-radius=\"50%\"\n >\n {this.label}\n </cura-badge-pill>\n {this.displayHeading && this.heading && (\n <cura-paragraph marginBlock=\"0\" size=\"xsmall\" color={textColor}>\n {this.heading}\n </cura-paragraph>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -0,0 +1,72 @@
1
+ :host {
2
+ display: block;
3
+ box-sizing: border-box;
4
+ width: 100%;
5
+ }
6
+
7
+ cura-heading {
8
+ --margin-block: 0 !important;
9
+ }
10
+
11
+ .container {
12
+ display: flex;
13
+ }
14
+
15
+ .compact {
16
+ display: flex;
17
+ padding: 0px;
18
+ justify-content: space-between;
19
+ align-items: center;
20
+ }
21
+ .compact .heading {
22
+ text-align: right;
23
+ }
24
+
25
+ .stepper-list {
26
+ gap: 4px;
27
+ display: flex;
28
+ flex-shrink: 0;
29
+ align-items: center;
30
+ padding: 0;
31
+ flex: 1;
32
+ width: 100%;
33
+ justify-content: space-between;
34
+ }
35
+
36
+ .step {
37
+ display: flex;
38
+ align-items: center;
39
+ flex-direction: row;
40
+ flex: 1;
41
+ gap: 4px;
42
+ }
43
+ .step .wrapper {
44
+ flex: 1;
45
+ position: relative;
46
+ }
47
+ .step .divider {
48
+ background-color: var(--neutral-light);
49
+ height: 2px;
50
+ flex: 1;
51
+ transition: all 1s;
52
+ }
53
+ .step .animation {
54
+ position: absolute;
55
+ top: 0;
56
+ left: 0;
57
+ right: 0;
58
+ width: var(--progress-width);
59
+ }
60
+ .step .done {
61
+ background-color: var(--success-light);
62
+ }
63
+ .step .stop {
64
+ background-color: var(--error-light);
65
+ }
66
+ .step .active {
67
+ background-color: var(--info-light);
68
+ }
69
+
70
+ .last {
71
+ flex: 0;
72
+ }
@@ -0,0 +1,227 @@
1
+ import { Host, h } from "@stencil/core";
2
+ export class CuraStepper {
3
+ constructor() {
4
+ this.activeStepIndex = undefined;
5
+ this.errorInCurrentStep = false;
6
+ this.displayHeading = false;
7
+ this.variant = 'default';
8
+ this.steps = [];
9
+ this.styles = {};
10
+ this.stepList = [];
11
+ }
12
+ connectedCallback() {
13
+ this.initializeSteps();
14
+ const { fonts, colors, spacing } = window.CuraAPI.theme;
15
+ const weights = fonts.getWeights();
16
+ this.styles = this.generateStyles(colors, fonts, spacing, weights);
17
+ }
18
+ generateStyles(colors, fonts, spacing, weights) {
19
+ return {
20
+ '--base-spacing': spacing.getSpacing(),
21
+ '--neutral-purewhite': colors.getColor('neutral-purewhite'),
22
+ '--neutral-lighter': colors.getColor('neutral-lighter'),
23
+ '--neutral-base': colors.getColor('neutral-base'),
24
+ '--neutral-light': colors.getColor('neutral-light'),
25
+ '--success-light': colors.getColor('success-light'),
26
+ '--info-light': colors.getColor('info-light'),
27
+ '--error-light': colors.getColor('error-light'),
28
+ '--font-size': fonts.getSize(),
29
+ '--font-color': fonts.getColor(),
30
+ '--font-family': fonts.getFamily(),
31
+ '--font-weight-regular': weights.regular,
32
+ };
33
+ }
34
+ initializeSteps() {
35
+ if (typeof this.steps === 'string') {
36
+ this.stepList = JSON.parse(this.steps || '[]');
37
+ }
38
+ else {
39
+ this.stepList = this.steps;
40
+ }
41
+ }
42
+ getStepStatus(step) {
43
+ if (this.activeStepIndex === step && this.errorInCurrentStep)
44
+ return 'stop';
45
+ if (this.activeStepIndex === step && this.stepList.length !== step)
46
+ return 'active';
47
+ if (this.activeStepIndex >= step)
48
+ return 'done';
49
+ return 'default';
50
+ }
51
+ getProgressStyles() {
52
+ const progressStyles = {
53
+ default: {
54
+ progressColor: 'var(--info-light)',
55
+ activeStepTextColor: 'info-darker',
56
+ nextStepTextColor: 'info-dark',
57
+ },
58
+ firstStep: {
59
+ progressColor: 'var(--info-light)',
60
+ activeStepTextColor: 'neutral-dark',
61
+ nextStepTextColor: 'neutral-medium',
62
+ },
63
+ completed: {
64
+ progressColor: 'var(--success-light)',
65
+ activeStepTextColor: 'success-darker',
66
+ nextStepTextColor: 'success-dark',
67
+ },
68
+ error: {
69
+ progressColor: 'var(--error-light)',
70
+ activeStepTextColor: 'error-darker',
71
+ nextStepTextColor: 'error-dark',
72
+ },
73
+ };
74
+ if (this.errorInCurrentStep) {
75
+ return progressStyles.error;
76
+ }
77
+ if (this.activeStepIndex === 0) {
78
+ return progressStyles.firstStep;
79
+ }
80
+ if (this.activeStepIndex === this.stepList.length) {
81
+ return progressStyles.completed;
82
+ }
83
+ return progressStyles.default;
84
+ }
85
+ renderCompactStepper() {
86
+ var _a;
87
+ const title = this.activeStepIndex === 0 ? this.stepList[this.activeStepIndex].title : this.stepList[this.activeStepIndex - 1].title;
88
+ const subtitle = this.activeStepIndex === 0 ? this.stepList[this.activeStepIndex + 1].title : (_a = this.stepList[this.activeStepIndex]) === null || _a === void 0 ? void 0 : _a.title;
89
+ const completed = this.activeStepIndex === this.stepList.length;
90
+ const inProgress = !(completed || this.errorInCurrentStep);
91
+ const { progressColor, activeStepTextColor, nextStepTextColor } = this.getProgressStyles();
92
+ // Representa a porcentagem de progresso (step atual / quantidade de steps;)
93
+ const progress = (this.activeStepIndex * 100) / this.stepList.length;
94
+ return (h("div", { class: "container compact", style: this.styles }, h("cura-progress-bar", { progress: progress, progressColor: progressColor, active: this.activeStepIndex !== 0 }, !inProgress ? (h("cura-icon", { name: this.errorInCurrentStep ? 'alertCircle' : 'checkCircle', color: this.errorInCurrentStep ? 'error-dark' : 'success-dark', size: "16" })) : (h("cura-heading", { color: "neutral-dark", size: "xsmall" }, this.activeStepIndex, "/", this.stepList.length))), this.displayHeading && (h("div", { class: "heading" }, h("cura-heading", { size: "small", weight: "bold", color: activeStepTextColor }, title), !completed && (h("cura-heading", { size: "xsmall", weight: "regular", color: nextStepTextColor }, "Pr\u00F3ximo: ", subtitle))))));
95
+ }
96
+ renderStep(step, stepIndex) {
97
+ const stepStatus = this.getStepStatus(stepIndex + 1);
98
+ const lastStep = stepIndex === this.stepList.length - 1;
99
+ const progressWidth = stepStatus !== 'default' ? '100%' : '0';
100
+ return (h("div", { class: `step ${lastStep ? 'last' : ''}`, key: step.title }, h("cura-stepper-item", { heading: step.title, label: step.label, displayHeading: this.displayHeading, status: stepStatus }), stepIndex < this.stepList.length - 1 && (h("div", { class: "wrapper" }, h("div", { class: "divider" }), h("div", { class: `divider ${stepStatus} animation`, style: { '--progress-width': progressWidth } })))));
101
+ }
102
+ renderStepper() {
103
+ return (h("div", { class: "container", style: this.styles }, h("div", { class: "stepper-list" }, this.stepList.map((step, stepIndex) => this.renderStep(step, stepIndex)))));
104
+ }
105
+ render() {
106
+ return h(Host, { key: 'a3c23a43dc82cba74b777a7e28ae7de1632ec95d' }, this.variant === 'default' ? this.renderStepper() : this.renderCompactStepper());
107
+ }
108
+ static get is() { return "cura-stepper"; }
109
+ static get encapsulation() { return "shadow"; }
110
+ static get originalStyleUrls() {
111
+ return {
112
+ "$": ["cura-stepper.scss"]
113
+ };
114
+ }
115
+ static get styleUrls() {
116
+ return {
117
+ "$": ["cura-stepper.css"]
118
+ };
119
+ }
120
+ static get properties() {
121
+ return {
122
+ "activeStepIndex": {
123
+ "type": "number",
124
+ "mutable": false,
125
+ "complexType": {
126
+ "original": "number",
127
+ "resolved": "number",
128
+ "references": {}
129
+ },
130
+ "required": false,
131
+ "optional": false,
132
+ "docs": {
133
+ "tags": [],
134
+ "text": "The current active step index"
135
+ },
136
+ "attribute": "active-step-index",
137
+ "reflect": true
138
+ },
139
+ "errorInCurrentStep": {
140
+ "type": "boolean",
141
+ "mutable": false,
142
+ "complexType": {
143
+ "original": "boolean",
144
+ "resolved": "boolean",
145
+ "references": {}
146
+ },
147
+ "required": false,
148
+ "optional": false,
149
+ "docs": {
150
+ "tags": [],
151
+ "text": "Indicates if a step has encountered an error\nIf `true`, the current step will be marked as 'stop'"
152
+ },
153
+ "attribute": "error-in-current-step",
154
+ "reflect": true,
155
+ "defaultValue": "false"
156
+ },
157
+ "displayHeading": {
158
+ "type": "boolean",
159
+ "mutable": false,
160
+ "complexType": {
161
+ "original": "boolean",
162
+ "resolved": "boolean",
163
+ "references": {}
164
+ },
165
+ "required": false,
166
+ "optional": false,
167
+ "docs": {
168
+ "tags": [],
169
+ "text": "Whether to display the title (default: false)"
170
+ },
171
+ "attribute": "display-heading",
172
+ "reflect": true,
173
+ "defaultValue": "false"
174
+ },
175
+ "variant": {
176
+ "type": "string",
177
+ "mutable": false,
178
+ "complexType": {
179
+ "original": "'compact' | 'default'",
180
+ "resolved": "\"compact\" | \"default\"",
181
+ "references": {}
182
+ },
183
+ "required": false,
184
+ "optional": false,
185
+ "docs": {
186
+ "tags": [],
187
+ "text": "Allows you to set the appearance of the component (default: default)"
188
+ },
189
+ "attribute": "variant",
190
+ "reflect": true,
191
+ "defaultValue": "'default'"
192
+ },
193
+ "steps": {
194
+ "type": "string",
195
+ "mutable": false,
196
+ "complexType": {
197
+ "original": "Step[] | string",
198
+ "resolved": "Step[] | string",
199
+ "references": {
200
+ "Step": {
201
+ "location": "import",
202
+ "path": "./stepper.type",
203
+ "id": "src/components/cura-stepper/stepper.type.ts::Step"
204
+ }
205
+ }
206
+ },
207
+ "required": false,
208
+ "optional": false,
209
+ "docs": {
210
+ "tags": [],
211
+ "text": "List of steps in the stepper."
212
+ },
213
+ "attribute": "steps",
214
+ "reflect": false,
215
+ "defaultValue": "[]"
216
+ }
217
+ };
218
+ }
219
+ static get states() {
220
+ return {
221
+ "styles": {},
222
+ "stepList": {}
223
+ };
224
+ }
225
+ static get elementRef() { return "host"; }
226
+ }
227
+ //# sourceMappingURL=cura-stepper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cura-stepper.js","sourceRoot":"","sources":["../../../src/components/cura-stepper/cura-stepper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAQzE,MAAM,OAAO,WAAW;;;kCAUiC,KAAK;8BAKT,KAAK;uBAKE,SAAS;qBAKlC,EAAE;sBAMjB,EAAE;wBAQQ,EAAE;;IAE9B,iBAAiB;QACf,IAAI,CAAC,eAAe,EAAE,CAAC;QAEvB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;QACxD,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC;QAEnC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACrE,CAAC;IAED,cAAc,CAAC,MAAM,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E,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAO,CACtG,CACP,CAAC;IACJ,CAAC;IAED,MAAM;QACJ,OAAO,EAAC,IAAI,uDAAE,IAAI,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAQ,CAAC;IACxG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, State, h, Element, Prop } from '@stencil/core';\nimport { Step } from './stepper.type';\n\n@Component({\n tag: 'cura-stepper',\n styleUrl: 'cura-stepper.scss',\n shadow: true,\n})\nexport class CuraStepper {\n /**\n * The current active step index\n */\n @Prop({ reflect: true }) activeStepIndex: number;\n\n /**\n * Indicates if a step has encountered an error\n * If `true`, the current step will be marked as 'stop'\n */\n @Prop({ reflect: true }) errorInCurrentStep: boolean = false;\n\n /**\n * Whether to display the title (default: false)\n */\n @Prop({ reflect: true }) displayHeading: boolean = false;\n\n /**\n * Allows you to set the appearance of the component (default: default)\n */\n @Prop({ reflect: true }) variant: 'compact' | 'default' = 'default';\n\n /**\n * List of steps in the stepper.\n */\n @Prop() steps: Step[] | string = [];\n /**\n * Reference to the host element.\n */\n @Element() host: HTMLElement;\n\n @State() styles = {};\n\n /**\n * Array of steps in the stepper.\n *\n * @type {Date[]}\n * @default []\n */\n @State() stepList: Step[] = [];\n\n connectedCallback() {\n this.initializeSteps();\n\n const { fonts, colors, spacing } = window.CuraAPI.theme;\n const weights = fonts.getWeights();\n\n this.styles = this.generateStyles(colors, fonts, spacing, weights);\n }\n\n generateStyles(colors, fonts, spacing, weights) {\n return {\n '--base-spacing': spacing.getSpacing(),\n '--neutral-purewhite': colors.getColor('neutral-purewhite'),\n '--neutral-lighter': colors.getColor('neutral-lighter'),\n '--neutral-base': colors.getColor('neutral-base'),\n '--neutral-light': colors.getColor('neutral-light'),\n '--success-light': colors.getColor('success-light'),\n '--info-light': colors.getColor('info-light'),\n '--error-light': colors.getColor('error-light'),\n '--font-size': fonts.getSize(),\n '--font-color': fonts.getColor(),\n '--font-family': fonts.getFamily(),\n '--font-weight-regular': weights.regular,\n };\n }\n\n initializeSteps() {\n if (typeof this.steps === 'string') {\n this.stepList = JSON.parse(this.steps || '[]');\n } else {\n this.stepList = this.steps;\n }\n }\n\n getStepStatus(step: number): 'done' | 'stop' | 'active' | 'default' {\n if (this.activeStepIndex === step && this.errorInCurrentStep) return 'stop';\n if (this.activeStepIndex === step && this.stepList.length !== step) return 'active';\n if (this.activeStepIndex >= step) return 'done';\n\n return 'default';\n }\n\n getProgressStyles() {\n const progressStyles = {\n default: {\n progressColor: 'var(--info-light)',\n activeStepTextColor: 'info-darker',\n nextStepTextColor: 'info-dark',\n },\n firstStep: {\n progressColor: 'var(--info-light)',\n activeStepTextColor: 'neutral-dark',\n nextStepTextColor: 'neutral-medium',\n },\n completed: {\n progressColor: 'var(--success-light)',\n activeStepTextColor: 'success-darker',\n nextStepTextColor: 'success-dark',\n },\n error: {\n progressColor: 'var(--error-light)',\n activeStepTextColor: 'error-darker',\n nextStepTextColor: 'error-dark',\n },\n };\n\n if (this.errorInCurrentStep) {\n return progressStyles.error;\n }\n\n if (this.activeStepIndex === 0) {\n return progressStyles.firstStep;\n }\n\n if (this.activeStepIndex === this.stepList.length) {\n return progressStyles.completed;\n }\n\n return progressStyles.default;\n }\n\n renderCompactStepper() {\n const title = this.activeStepIndex === 0 ? this.stepList[this.activeStepIndex].title : this.stepList[this.activeStepIndex - 1].title;\n const subtitle = this.activeStepIndex === 0 ? this.stepList[this.activeStepIndex + 1].title : this.stepList[this.activeStepIndex]?.title;\n const completed = this.activeStepIndex === this.stepList.length;\n const inProgress = !(completed || this.errorInCurrentStep);\n const { progressColor, activeStepTextColor, nextStepTextColor } = this.getProgressStyles();\n\n // Representa a porcentagem de progresso (step atual / quantidade de steps;)\n const progress = (this.activeStepIndex * 100) / this.stepList.length;\n\n return (\n <div class=\"container compact\" style={this.styles}>\n <cura-progress-bar progress={progress} progressColor={progressColor} active={this.activeStepIndex !== 0}>\n {!inProgress ? (\n <cura-icon name={this.errorInCurrentStep ? 'alertCircle' : 'checkCircle'} color={this.errorInCurrentStep ? 'error-dark' : 'success-dark'} size=\"16\"></cura-icon>\n ) : (\n <cura-heading color=\"neutral-dark\" size=\"xsmall\">\n {this.activeStepIndex}/{this.stepList.length}\n </cura-heading>\n )}\n </cura-progress-bar>\n {this.displayHeading && (\n <div class=\"heading\">\n <cura-heading size=\"small\" weight=\"bold\" color={activeStepTextColor}>\n {title}\n </cura-heading>\n {!completed && (\n <cura-heading size=\"xsmall\" weight=\"regular\" color={nextStepTextColor}>\n Próximo: {subtitle}\n </cura-heading>\n )}\n </div>\n )}\n </div>\n );\n }\n\n renderStep(step: Step, stepIndex: number) {\n const stepStatus = this.getStepStatus(stepIndex + 1);\n const lastStep = stepIndex === this.stepList.length - 1;\n const progressWidth = stepStatus !== 'default' ? '100%' : '0';\n\n return (\n <div class={`step ${lastStep ? 'last' : ''}`} key={step.title}>\n <cura-stepper-item heading={step.title} label={step.label} displayHeading={this.displayHeading} status={stepStatus} />\n {stepIndex < this.stepList.length - 1 && (\n <div class=\"wrapper\">\n <div class=\"divider\" />\n <div class={`divider ${stepStatus} animation`} style={{ '--progress-width': progressWidth }} />\n </div>\n )}\n </div>\n );\n }\n renderStepper() {\n return (\n <div class=\"container\" style={this.styles}>\n <div class=\"stepper-list\">{this.stepList.map((step, stepIndex) => this.renderStep(step, stepIndex))}</div>\n </div>\n );\n }\n\n render() {\n return <Host>{this.variant === 'default' ? this.renderStepper() : this.renderCompactStepper()}</Host>;\n }\n}\n"]}
@@ -0,0 +1,97 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s)
4
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ const renderCuraStepper = (args) => {
14
+ const maxActiveStepIndex = Math.min(args.steps.length, args.activeStepIndex);
15
+ console.log(args.activeStepIndex);
16
+ return `<div style="width: 100%; height: 80px;">
17
+ <cura-stepper
18
+ steps='${JSON.stringify(args.steps)}'
19
+ ${args.displayHeading && `display-heading="${args.displayHeading}"`}
20
+ ${args.activeStepIndex >= 0 && `active-step-index="${maxActiveStepIndex}"`}
21
+ ${args.errorInCurrentStep && `error-in-current-step="${args.errorInCurrentStep}"`}
22
+ ${args.variant && args.variant !== 'default'
23
+ ? `
24
+ variant="${args.variant}"`
25
+ : ''}
26
+ ></cura-stepper>
27
+ </div>`;
28
+ };
29
+ export default {
30
+ title: 'Componentes/Stepper/Stepper',
31
+ tags: ['autodocs'],
32
+ render: (_a) => {
33
+ var args = __rest(_a, []);
34
+ return renderCuraStepper(args);
35
+ },
36
+ argTypes: {
37
+ steps: {
38
+ control: 'object',
39
+ description: 'Define a lista de passos',
40
+ table: {
41
+ category: 'Properties',
42
+ defaultValue: { summary: null },
43
+ },
44
+ },
45
+ activeStepIndex: {
46
+ control: 'number',
47
+ description: 'Passo atual',
48
+ required: false,
49
+ table: {
50
+ category: 'Properties',
51
+ defaultValue: { summary: 0 },
52
+ },
53
+ },
54
+ errorInCurrentStep: {
55
+ control: 'boolean',
56
+ description: 'Define se ocorreu um erro no passo atual (se este estiver ativo)',
57
+ table: {
58
+ category: 'Properties',
59
+ defaultValue: { summary: false },
60
+ },
61
+ },
62
+ variant: {
63
+ control: { type: 'inline-radio' },
64
+ options: ['default', 'compact'],
65
+ description: 'Define a forma como o componente será apresentado',
66
+ table: {
67
+ category: 'Properties',
68
+ defaultValue: { summary: 'default' },
69
+ },
70
+ name: 'variant',
71
+ },
72
+ displayHeading: {
73
+ control: 'boolean',
74
+ description: 'Define se deve exibir os títulos de cada passo',
75
+ table: {
76
+ category: 'Properties',
77
+ defaultValue: { summary: true },
78
+ },
79
+ },
80
+ },
81
+ };
82
+ export const Stepper = {
83
+ args: {
84
+ steps: [
85
+ { title: 'Inicio', label: '1' },
86
+ { title: 'Exemplo', label: '2' },
87
+ { title: 'Passo Tres', label: '3' },
88
+ { title: 'Teste', label: '4' },
89
+ { title: 'Final', label: '5' },
90
+ ],
91
+ displayHeading: 'true',
92
+ errorInCurrentStep: 'false',
93
+ activeStepIndex: 0,
94
+ variant: 'default',
95
+ },
96
+ };
97
+ //# sourceMappingURL=cura-stepper.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cura-stepper.stories.js","sourceRoot":"","sources":["../../../src/components/cura-stepper/cura-stepper.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,MAAM,iBAAiB,GAAG,CAAC,IAAS,EAAE,EAAE;IACtC,MAAM,kBAAkB,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;IAE7E,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAElC,OAAO;;eAEM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC;QACjC,IAAI,CAAC,cAAc,IAAI,oBAAoB,IAAI,CAAC,cAAc,GAAG;QACjE,IAAI,CAAC,eAAe,IAAI,CAAC,IAAI,sBAAsB,kBAAkB,GAAG;QACxE,IAAI,CAAC,kBAAkB,IAAI,0BAA0B,IAAI,CAAC,kBAAk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,SAAS;YAClB,WAAW,EAAE,gDAAgD;YAC7D,KAAK,EAAE;gBACL,QAAQ,EAAE,YAAY;gBACtB,YAAY,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;aAChC;SACF;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,IAAI,EAAE;QACJ,KAAK,EAAE;YACL,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE;YAC/B,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;YAChC,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,EAAE;YACnC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE;YAC9B,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE;SAC/B;QACD,cAAc,EAAE,MAAM;QACtB,kBAAkB,EAAE,OAAO;QAC3B,eAAe,EAAE,CAAC;QAClB,OAAO,EAAE,SAAS;KACnB;CACF,CAAC","sourcesContent":["const renderCuraStepper = (args: any) => {\n const maxActiveStepIndex = Math.min(args.steps.length, args.activeStepIndex);\n\n console.log(args.activeStepIndex);\n\n return `<div style=\"width: 100%; height: 80px;\">\n <cura-stepper\n steps='${JSON.stringify(args.steps)}'\n ${args.displayHeading && `display-heading=\"${args.displayHeading}\"`}\n ${args.activeStepIndex >= 0 && `active-step-index=\"${maxActiveStepIndex}\"`}\n ${args.errorInCurrentStep && `error-in-current-step=\"${args.errorInCurrentStep}\"`}\n ${\n args.variant && args.variant !== 'default'\n ? `\n variant=\"${args.variant}\"`\n : ''\n }\n ></cura-stepper>\n </div>`;\n};\n\nexport default {\n title: 'Componentes/Stepper/Stepper',\n tags: ['autodocs'],\n render: ({ ...args }) => {\n return renderCuraStepper(args);\n },\n argTypes: {\n steps: {\n control: 'object',\n description: 'Define a lista de passos',\n table: {\n category: 'Properties',\n defaultValue: { summary: null },\n },\n },\n activeStepIndex: {\n control: 'number',\n description: 'Passo atual',\n required: false,\n table: {\n category: 'Properties',\n defaultValue: { summary: 0 },\n },\n },\n errorInCurrentStep: {\n control: 'boolean',\n description: 'Define se ocorreu um erro no passo atual (se este estiver ativo)',\n table: {\n category: 'Properties',\n defaultValue: { summary: false },\n },\n },\n variant: {\n control: { type: 'inline-radio' },\n options: ['default', 'compact'],\n description: 'Define a forma como o componente será apresentado',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'default' },\n },\n name: 'variant',\n },\n displayHeading: {\n control: 'boolean',\n description: 'Define se deve exibir os títulos de cada passo',\n table: {\n category: 'Properties',\n defaultValue: { summary: true },\n },\n },\n },\n};\n\nexport const Stepper = {\n args: {\n steps: [\n { title: 'Inicio', label: '1' },\n { title: 'Exemplo', label: '2' },\n { title: 'Passo Tres', label: '3' },\n { title: 'Teste', label: '4' },\n { title: 'Final', label: '5' },\n ],\n displayHeading: 'true',\n errorInCurrentStep: 'false',\n activeStepIndex: 0,\n variant: 'default',\n },\n};\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=stepper.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stepper.type.js","sourceRoot":"","sources":["../../../src/components/cura-stepper/stepper.type.ts"],"names":[],"mappings":"","sourcesContent":["export interface Step {\n label: string;\n title: string;\n}\n"]}
@@ -21,7 +21,7 @@ export class CuraToast {
21
21
  this.setStyle();
22
22
  }
23
23
  render() {
24
- return (h(Host, { key: '0265d288e95db1331400e60d2ca694be22397294' }, h("div", { key: '2aee45d4fd237b703846272582e8258fbabb5238', class: this.getClasses(), style: this.styles }, h("cura-icon", { key: 'c75ea1c8aceaf039e8d525c1ff406bcbf25b8554', class: "default-icon", name: this.getNameIcon(), size: 16, color: `${this.type}-dark` }), h("div", { key: 'e4d75da71aef899ec260666095f977caec86c19f', class: "content" }, h("cura-heading", { key: '3523fb7c3674854322dad502252cda7dd3bdca9e', level: 4, size: "xsmall", color: `${this.type}-dark`, weight: "bold", "margin-block": "0" }, this.label), h("cura-paragraph", { key: 'a4d639691820e4e242a178604d9b20a97da7bccb', color: `${this.type}-darker`, size: "xsmall", marginBlock: "0", lineHeight: "133.33%" }, h("slot", { key: '4b86678d47455798a0f5455a406c02eaf8000ba8' })), h("slot", { key: '28b9088b76b7b2084cf7024eb1f35f28b344e098', name: "actions" })), this.closeButton && h("cura-icon", { key: '20a3b18030bfc418439f75795bd98ebacbb1aeca', class: "close-icon", name: "close", size: 16, color: "error-dark", onClick: this.handleClose }), this.loader && !!this.autoCloseDelay && h("cura-loader-bar", { key: '82b7e205ad8c5abae481bbed409109cd17661ce1', color: `${this.type}-base`, progress: this.progress }))));
24
+ return (h(Host, { key: '4dc290042792d96f31c2e63936d70a77bc37917d' }, h("div", { key: '668c102d3a31d0a0e39c390546fcf5422e954246', class: this.getClasses(), style: this.styles }, h("cura-icon", { key: '502b24915e1000877ccd4ae25806b152b4a72948', class: "default-icon", name: this.getNameIcon(), size: 16, color: `${this.type}-dark` }), h("div", { key: 'd7afe4d1a9740d3bd1bce04858f6e71e0c857da2', class: "content" }, h("cura-heading", { key: '419e0d64e12e828efa2fecebe0eb86c74ff86dda', level: 4, size: "xsmall", color: `${this.type}-dark`, weight: "bold", "margin-block": "0" }, this.label), h("cura-paragraph", { key: 'bc6f5c120f0b32858cbda9ebf16c5d79366452bb', color: `${this.type}-darker`, size: "xsmall", marginBlock: "0", lineHeight: "133.33%" }, h("slot", { key: '9cc8ba28b3e5ee5d8137351cfbb5dc07b417b7e9' })), h("slot", { key: 'f260ca44fa6cc515a1bda3ecb94dd1ac90f880d7', name: "actions" })), this.closeButton && h("cura-icon", { key: '7db6c2e5c3c66ab0b12822fc8099e17b77ed2c39', class: "close-icon", name: "close", size: 16, color: "error-dark", onClick: this.handleClose }), this.loader && !!this.autoCloseDelay && h("cura-loader-bar", { key: 'd0a6f1e838ec98f6dac5773214e1e5cf501e3e2e', color: `${this.type}-base`, progress: this.progress }))));
25
25
  }
26
26
  componentDidLoad() {
27
27
  this.openContainer();