@rededor/cura 1.4.0-alpha.1 → 1.4.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 (257) hide show
  1. package/dist/cjs/cura-accordion_12.cjs.entry.js +12 -16
  2. package/dist/cjs/cura-accordion_12.cjs.entry.js.map +1 -1
  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 +63 -0
  6. package/dist/cjs/cura-badge-counter.cjs.entry.js.map +1 -0
  7. package/dist/cjs/cura-badge-distance.cjs.entry.js +1 -1
  8. package/dist/cjs/cura-badge-pill.cjs.entry.js +83 -0
  9. package/dist/cjs/cura-badge-pill.cjs.entry.js.map +1 -0
  10. package/dist/cjs/cura-button-outline.cjs.entry.js +1 -1
  11. package/dist/cjs/cura-button-select.cjs.entry.js +2 -11
  12. package/dist/cjs/cura-button-select.cjs.entry.js.map +1 -1
  13. package/dist/cjs/cura-button-transparent.cjs.entry.js +1 -1
  14. package/dist/cjs/cura-calendar.cjs.entry.js +1 -1
  15. package/dist/cjs/cura-card.cjs.entry.js +1 -1
  16. package/dist/cjs/cura-checkbox.cjs.entry.js +1 -1
  17. package/dist/cjs/cura-display.cjs.entry.js +1 -1
  18. package/dist/cjs/cura-dropdown-search-option-title.cjs.entry.js +1 -1
  19. package/dist/cjs/cura-dropdown-search-option.cjs.entry.js +2 -2
  20. package/dist/cjs/cura-dropdown-search.cjs.entry.js +2 -2
  21. package/dist/cjs/{cura-icon.definitions-8d714f6a.js → cura-icon.definitions-5223028b.js} +2 -4
  22. package/dist/cjs/cura-icon.definitions-5223028b.js.map +1 -0
  23. package/dist/cjs/cura-icons-view.cjs.entry.js +2 -5
  24. package/dist/cjs/cura-icons-view.cjs.entry.js.map +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-modal.cjs.entry.js +28 -7
  28. package/dist/cjs/cura-modal.cjs.entry.js.map +1 -1
  29. package/dist/cjs/cura-radio.cjs.entry.js +1 -1
  30. package/dist/cjs/cura-switch.cjs.entry.js +1 -1
  31. package/dist/cjs/cura-toast.cjs.entry.js +1 -1
  32. package/dist/cjs/cura-tooltip.cjs.entry.js +1 -1
  33. package/dist/cjs/cura.cjs.js +1 -1
  34. package/dist/cjs/loader.cjs.js +1 -1
  35. package/dist/collection/collection-manifest.json +2 -1
  36. package/dist/collection/components/badges/cura-badge-counter/cura-badge-counter.css +51 -0
  37. package/dist/collection/components/badges/cura-badge-counter/cura-badge-counter.js +149 -0
  38. package/dist/collection/components/badges/cura-badge-counter/cura-badge-counter.js.map +1 -0
  39. package/dist/collection/components/badges/{cura-badge-number/cura-badge-number.stories.js → cura-badge-counter/cura-badge-counter.stories.js} +33 -13
  40. package/dist/collection/components/badges/cura-badge-counter/cura-badge-counter.stories.js.map +1 -0
  41. package/dist/collection/components/badges/cura-badge-distance/cura-badge-distance.js +1 -1
  42. package/dist/collection/components/badges/cura-badge-pill/cura-badge-pill.css +73 -0
  43. package/dist/collection/components/badges/cura-badge-pill/cura-badge-pill.js +219 -0
  44. package/dist/collection/components/badges/cura-badge-pill/cura-badge-pill.js.map +1 -0
  45. package/dist/collection/components/badges/cura-badge-pill/cura-badge-pill.stories.js +126 -0
  46. package/dist/collection/components/badges/cura-badge-pill/cura-badge-pill.stories.js.map +1 -0
  47. package/dist/collection/components/buttons/cura-button/cura-button.js +1 -1
  48. package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js +1 -1
  49. package/dist/collection/components/buttons/cura-button-select/cura-button-select.js +5 -14
  50. package/dist/collection/components/buttons/cura-button-select/cura-button-select.js.map +1 -1
  51. package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js +1 -1
  52. package/dist/collection/components/cura-alert/cura-alert.js +1 -1
  53. package/dist/collection/components/cura-avatar/cura-avatar.js +1 -1
  54. package/dist/collection/components/cura-calendar/cura-calendar.js +1 -1
  55. package/dist/collection/components/cura-card/cura-card.js +1 -1
  56. package/dist/collection/components/cura-icon/cura-icon.definitions.js +1 -2
  57. package/dist/collection/components/cura-icon/cura-icon.definitions.js.map +1 -1
  58. package/dist/collection/components/cura-icon/cura-icon.js +2 -6
  59. package/dist/collection/components/cura-icon/cura-icon.js.map +1 -1
  60. package/dist/collection/components/cura-icon/cura-icon.stories.js +1 -3
  61. package/dist/collection/components/cura-icon/cura-icon.stories.js.map +1 -1
  62. package/dist/collection/components/cura-icons-view/cura-icons-view.js +2 -5
  63. package/dist/collection/components/cura-icons-view/cura-icons-view.js.map +1 -1
  64. package/dist/collection/components/cura-modal/cura-modal.css +4 -2
  65. package/dist/collection/components/cura-modal/cura-modal.js +91 -10
  66. package/dist/collection/components/cura-modal/cura-modal.js.map +1 -1
  67. package/dist/collection/components/cura-modal/cura-modal.stories.js +54 -18
  68. package/dist/collection/components/cura-modal/cura-modal.stories.js.map +1 -1
  69. package/dist/collection/components/cura-page-template/cura-page-template.js +1 -1
  70. package/dist/collection/components/cura-toast/cura-toast.js +1 -1
  71. package/dist/collection/components/cura-tooltip/cura-tooltip.js +1 -1
  72. package/dist/collection/components/forms/cura-checkbox/cura-checkbox.js +1 -1
  73. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js +2 -2
  74. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.js +1 -1
  75. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js +2 -2
  76. package/dist/collection/components/forms/cura-input-date/cura-input-date.js +1 -1
  77. package/dist/collection/components/forms/cura-label/cura-label.js +1 -1
  78. package/dist/collection/components/forms/cura-radio/cura-radio.js +1 -1
  79. package/dist/collection/components/forms/cura-select/cura-select.js +3 -3
  80. package/dist/collection/components/forms/cura-select-options/cura-select-option.js +1 -1
  81. package/dist/collection/components/forms/cura-switch/cura-switch.js +1 -1
  82. package/dist/collection/components/loaders/cura-loader-bar/cura-loader-bar.js +1 -1
  83. package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.js +1 -1
  84. package/dist/collection/components/text/cura-display/cura-display.js +1 -1
  85. package/dist/collection/components/text/cura-heading/cura-heading.js +1 -1
  86. package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +1 -1
  87. package/dist/collection/utils/utils.js +1 -0
  88. package/dist/collection/utils/utils.js.map +1 -1
  89. package/dist/components/cura-alert.js +1 -1
  90. package/dist/components/cura-avatar.js +1 -1
  91. package/dist/components/cura-badge-counter.d.ts +11 -0
  92. package/dist/components/cura-badge-counter.js +8 -0
  93. package/dist/components/cura-badge-counter.js.map +1 -0
  94. package/dist/components/cura-badge-counter2.js +90 -0
  95. package/dist/components/cura-badge-counter2.js.map +1 -0
  96. package/dist/components/cura-badge-distance.js +1 -1
  97. package/dist/components/{cura-badge-number.d.ts → cura-badge-pill.d.ts} +4 -4
  98. package/dist/components/cura-badge-pill.js +120 -0
  99. package/dist/components/cura-badge-pill.js.map +1 -0
  100. package/dist/components/cura-button-outline.js +1 -1
  101. package/dist/components/cura-button-select.js +6 -15
  102. package/dist/components/cura-button-select.js.map +1 -1
  103. package/dist/components/cura-button-transparent2.js +1 -1
  104. package/dist/components/cura-button.js +1 -1
  105. package/dist/components/cura-calendar2.js +1 -1
  106. package/dist/components/cura-card.js +1 -1
  107. package/dist/components/cura-checkbox.js +1 -1
  108. package/dist/components/cura-display.js +1 -1
  109. package/dist/components/cura-dropdown-search-option-title.js +1 -1
  110. package/dist/components/cura-dropdown-search-option.js +2 -2
  111. package/dist/components/cura-dropdown-search.js +2 -2
  112. package/dist/components/cura-heading2.js +1 -1
  113. package/dist/components/cura-icon2.js +3 -8
  114. package/dist/components/cura-icon2.js.map +1 -1
  115. package/dist/components/cura-icons-view.js +7 -16
  116. package/dist/components/cura-icons-view.js.map +1 -1
  117. package/dist/components/cura-input-date.js +1 -1
  118. package/dist/components/cura-label2.js +1 -1
  119. package/dist/components/cura-loader-bar2.js +1 -1
  120. package/dist/components/cura-loader-circle2.js +1 -1
  121. package/dist/components/cura-modal.js +36 -9
  122. package/dist/components/cura-modal.js.map +1 -1
  123. package/dist/components/cura-page-template.js +1 -1
  124. package/dist/components/cura-paragraph2.js +1 -1
  125. package/dist/components/cura-radio.js +1 -1
  126. package/dist/components/cura-select-option2.js +1 -1
  127. package/dist/components/cura-select2.js +3 -3
  128. package/dist/components/cura-switch.js +1 -1
  129. package/dist/components/cura-toast.js +1 -1
  130. package/dist/components/cura-tooltip.js +1 -1
  131. package/dist/components/index.js +4 -2
  132. package/dist/components/index.js.map +1 -1
  133. package/dist/cura/cura.esm.js +1 -1
  134. package/dist/cura/cura.esm.js.map +1 -1
  135. package/dist/cura/{p-01e301d4.entry.js → p-116a1cd6.entry.js} +2 -2
  136. package/dist/cura/{p-5bb8302c.entry.js → p-19f28fa8.entry.js} +2 -2
  137. package/dist/cura/p-19f28fa8.entry.js.map +1 -0
  138. package/dist/cura/{p-eda28278.entry.js → p-2545cfc7.entry.js} +2 -2
  139. package/dist/cura/{p-deadde8d.entry.js → p-35920ac0.entry.js} +2 -2
  140. package/dist/cura/{p-eea093b2.entry.js → p-36dbec98.entry.js} +2 -2
  141. package/dist/cura/{p-ed839f1e.entry.js → p-3d958d45.entry.js} +2 -2
  142. package/dist/cura/{p-3536c96b.entry.js → p-3e4ca7e7.entry.js} +2 -2
  143. package/dist/cura/{p-e5b0dd74.entry.js → p-3eca0f0c.entry.js} +2 -2
  144. package/dist/cura/{p-1f53580a.entry.js → p-42258230.entry.js} +2 -2
  145. package/dist/cura/p-48f9289b.js +2 -0
  146. package/dist/cura/p-48f9289b.js.map +1 -0
  147. package/dist/cura/{p-dbd9eab3.entry.js → p-4b496c51.entry.js} +2 -2
  148. package/dist/cura/p-52f854e0.entry.js +2 -0
  149. package/dist/cura/p-52f854e0.entry.js.map +1 -0
  150. package/dist/cura/{p-81c66f2b.entry.js → p-576c65b4.entry.js} +2 -2
  151. package/dist/cura/{p-bfb5e9e1.entry.js → p-6e4f4fbf.entry.js} +2 -2
  152. package/dist/cura/{p-0e28f1c8.entry.js → p-818c581f.entry.js} +2 -2
  153. package/dist/cura/{p-b0451cb3.entry.js → p-a91d451f.entry.js} +2 -2
  154. package/dist/cura/p-aa65cb50.entry.js +2 -0
  155. package/dist/cura/p-aa65cb50.entry.js.map +1 -0
  156. package/dist/cura/{p-075b02de.entry.js → p-b1a51e81.entry.js} +2 -2
  157. package/dist/cura/{p-f375a612.entry.js → p-bdb1a0c5.entry.js} +2 -2
  158. package/dist/cura/p-c4da4c44.entry.js +2 -0
  159. package/dist/cura/p-c4da4c44.entry.js.map +1 -0
  160. package/dist/cura/{p-a7ecea4a.entry.js → p-dcd2e5bb.entry.js} +2 -2
  161. package/dist/cura/{p-7853ab16.entry.js → p-e1a41792.entry.js} +2 -2
  162. package/dist/cura/p-ef593f12.entry.js +2 -0
  163. package/dist/cura/p-ef593f12.entry.js.map +1 -0
  164. package/dist/cura/p-f23c4ed8.entry.js +2 -0
  165. package/dist/cura/p-f23c4ed8.entry.js.map +1 -0
  166. package/dist/cura/p-f5d45776.entry.js +2 -0
  167. package/dist/esm/cura-accordion_12.entry.js +12 -16
  168. package/dist/esm/cura-accordion_12.entry.js.map +1 -1
  169. package/dist/esm/cura-alert.entry.js +1 -1
  170. package/dist/esm/cura-avatar.entry.js +1 -1
  171. package/dist/esm/cura-badge-counter.entry.js +59 -0
  172. package/dist/esm/cura-badge-counter.entry.js.map +1 -0
  173. package/dist/esm/cura-badge-distance.entry.js +1 -1
  174. package/dist/esm/cura-badge-pill.entry.js +79 -0
  175. package/dist/esm/cura-badge-pill.entry.js.map +1 -0
  176. package/dist/esm/cura-button-outline.entry.js +1 -1
  177. package/dist/esm/cura-button-select.entry.js +2 -11
  178. package/dist/esm/cura-button-select.entry.js.map +1 -1
  179. package/dist/esm/cura-button-transparent.entry.js +1 -1
  180. package/dist/esm/cura-calendar.entry.js +1 -1
  181. package/dist/esm/cura-card.entry.js +1 -1
  182. package/dist/esm/cura-checkbox.entry.js +1 -1
  183. package/dist/esm/cura-display.entry.js +1 -1
  184. package/dist/esm/cura-dropdown-search-option-title.entry.js +1 -1
  185. package/dist/esm/cura-dropdown-search-option.entry.js +2 -2
  186. package/dist/esm/cura-dropdown-search.entry.js +2 -2
  187. package/dist/esm/cura-icon.definitions-a892c0e2.js +17 -0
  188. package/dist/esm/cura-icon.definitions-a892c0e2.js.map +1 -0
  189. package/dist/esm/cura-icons-view.entry.js +2 -5
  190. package/dist/esm/cura-icons-view.entry.js.map +1 -1
  191. package/dist/esm/cura-input-date.entry.js +1 -1
  192. package/dist/esm/cura-loader-bar.entry.js +1 -1
  193. package/dist/esm/cura-modal.entry.js +28 -7
  194. package/dist/esm/cura-modal.entry.js.map +1 -1
  195. package/dist/esm/cura-radio.entry.js +1 -1
  196. package/dist/esm/cura-switch.entry.js +1 -1
  197. package/dist/esm/cura-toast.entry.js +1 -1
  198. package/dist/esm/cura-tooltip.entry.js +1 -1
  199. package/dist/esm/cura.js +1 -1
  200. package/dist/esm/loader.js +1 -1
  201. package/dist/types/components/badges/cura-badge-counter/cura-badge-counter.d.ts +30 -0
  202. package/dist/types/components/badges/{cura-badge-number/cura-badge-number.stories.d.ts → cura-badge-counter/cura-badge-counter.stories.d.ts} +26 -1
  203. package/dist/types/components/badges/cura-badge-pill/cura-badge-pill.d.ts +44 -0
  204. package/dist/types/components/badges/cura-badge-pill/cura-badge-pill.stories.d.ts +119 -0
  205. package/dist/types/components/buttons/cura-button-select/cura-button-select.d.ts +1 -2
  206. package/dist/types/components/cura-icon/cura-icon.definitions.d.ts +0 -1
  207. package/dist/types/components/cura-modal/cura-modal.d.ts +22 -3
  208. package/dist/types/components/cura-modal/cura-modal.stories.d.ts +42 -3
  209. package/dist/types/components.d.ts +140 -19
  210. package/dist/types/utils/utils.d.ts +1 -0
  211. package/package.json +2 -2
  212. package/dist/cjs/cura-badge-number.cjs.entry.js +0 -29
  213. package/dist/cjs/cura-badge-number.cjs.entry.js.map +0 -1
  214. package/dist/cjs/cura-icon.definitions-8d714f6a.js.map +0 -1
  215. package/dist/collection/components/badges/cura-badge-number/cura-badge-number.css +0 -28
  216. package/dist/collection/components/badges/cura-badge-number/cura-badge-number.js +0 -66
  217. package/dist/collection/components/badges/cura-badge-number/cura-badge-number.js.map +0 -1
  218. package/dist/collection/components/badges/cura-badge-number/cura-badge-number.stories.js.map +0 -1
  219. package/dist/components/cura-badge-number.js +0 -8
  220. package/dist/components/cura-badge-number.js.map +0 -1
  221. package/dist/components/cura-badge-number2.js +0 -49
  222. package/dist/components/cura-badge-number2.js.map +0 -1
  223. package/dist/cura/p-0308cf6b.entry.js +0 -2
  224. package/dist/cura/p-0308cf6b.entry.js.map +0 -1
  225. package/dist/cura/p-5bb8302c.entry.js.map +0 -1
  226. package/dist/cura/p-71a2dcef.entry.js +0 -2
  227. package/dist/cura/p-71a2dcef.entry.js.map +0 -1
  228. package/dist/cura/p-9a7e3f48.entry.js +0 -2
  229. package/dist/cura/p-9a7e3f48.entry.js.map +0 -1
  230. package/dist/cura/p-a7221f0c.js +0 -2
  231. package/dist/cura/p-a7221f0c.js.map +0 -1
  232. package/dist/cura/p-d635501a.entry.js +0 -2
  233. package/dist/cura/p-d635501a.entry.js.map +0 -1
  234. package/dist/cura/p-ebed83d1.entry.js +0 -2
  235. package/dist/esm/cura-badge-number.entry.js +0 -25
  236. package/dist/esm/cura-badge-number.entry.js.map +0 -1
  237. package/dist/esm/cura-icon.definitions-aaa4e80f.js +0 -18
  238. package/dist/esm/cura-icon.definitions-aaa4e80f.js.map +0 -1
  239. package/dist/types/components/badges/cura-badge-number/cura-badge-number.d.ts +0 -8
  240. /package/dist/cura/{p-01e301d4.entry.js.map → p-116a1cd6.entry.js.map} +0 -0
  241. /package/dist/cura/{p-eda28278.entry.js.map → p-2545cfc7.entry.js.map} +0 -0
  242. /package/dist/cura/{p-deadde8d.entry.js.map → p-35920ac0.entry.js.map} +0 -0
  243. /package/dist/cura/{p-eea093b2.entry.js.map → p-36dbec98.entry.js.map} +0 -0
  244. /package/dist/cura/{p-ed839f1e.entry.js.map → p-3d958d45.entry.js.map} +0 -0
  245. /package/dist/cura/{p-3536c96b.entry.js.map → p-3e4ca7e7.entry.js.map} +0 -0
  246. /package/dist/cura/{p-e5b0dd74.entry.js.map → p-3eca0f0c.entry.js.map} +0 -0
  247. /package/dist/cura/{p-1f53580a.entry.js.map → p-42258230.entry.js.map} +0 -0
  248. /package/dist/cura/{p-dbd9eab3.entry.js.map → p-4b496c51.entry.js.map} +0 -0
  249. /package/dist/cura/{p-81c66f2b.entry.js.map → p-576c65b4.entry.js.map} +0 -0
  250. /package/dist/cura/{p-bfb5e9e1.entry.js.map → p-6e4f4fbf.entry.js.map} +0 -0
  251. /package/dist/cura/{p-0e28f1c8.entry.js.map → p-818c581f.entry.js.map} +0 -0
  252. /package/dist/cura/{p-b0451cb3.entry.js.map → p-a91d451f.entry.js.map} +0 -0
  253. /package/dist/cura/{p-075b02de.entry.js.map → p-b1a51e81.entry.js.map} +0 -0
  254. /package/dist/cura/{p-f375a612.entry.js.map → p-bdb1a0c5.entry.js.map} +0 -0
  255. /package/dist/cura/{p-a7ecea4a.entry.js.map → p-dcd2e5bb.entry.js.map} +0 -0
  256. /package/dist/cura/{p-7853ab16.entry.js.map → p-e1a41792.entry.js.map} +0 -0
  257. /package/dist/cura/{p-ebed83d1.entry.js.map → p-f5d45776.entry.js.map} +0 -0
@@ -10,22 +10,23 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  }
11
11
  return t;
12
12
  };
13
- import { getColorsWithDepths } from "../../../utils/utils";
14
- const renderCuraBadgeNumber = (args) => {
15
- const block = `<cura-badge-number
16
- color="${args.color}">
17
- ${args.number}
18
- </cura-badge-number>
13
+ import { baseColors } from "../../../utils/utils";
14
+ const renderCuraBadgeCounter = (args) => {
15
+ const block = `<cura-badge-counter${args.color && args.color !== 'primary' ? `
16
+ color="${args.color}"` : ''}${args.disabled ? `
17
+ disabled` : ''}${args.type && args.type !== 'solid' ? `
18
+ type="${args.type}"` : ''}
19
+ number="${args.number}">
20
+ </cura-badge-counter>
19
21
  `;
20
22
  return `${block}`;
21
23
  };
22
- const colors = getColorsWithDepths();
23
24
  export default {
24
- title: 'Componentes/Badges/Badge Number',
25
+ title: 'Componentes/Badges/Badge Counter',
25
26
  tags: ['autodocs'],
26
27
  render: (_a) => {
27
28
  var args = __rest(_a, []);
28
- return renderCuraBadgeNumber(args);
29
+ return renderCuraBadgeCounter(args);
29
30
  },
30
31
  argTypes: {
31
32
  number: {
@@ -38,19 +39,38 @@ export default {
38
39
  },
39
40
  color: {
40
41
  control: { type: 'select' },
41
- options: ['', ...colors],
42
+ options: ['', ...baseColors],
42
43
  description: 'Cor fundamental do Design System sem profundidade (ex: primary).',
43
44
  table: {
44
45
  category: 'Properties',
45
46
  defaultValue: { summary: 'primary' },
46
47
  },
47
48
  },
49
+ type: {
50
+ control: { type: 'select' },
51
+ options: ['solid', 'outline', 'transparent'],
52
+ description: 'Estilo do badge. Valores válidos são solid (padrão), outline ou transparent.',
53
+ table: {
54
+ category: 'Properties',
55
+ defaultValue: { summary: 'solid' },
56
+ },
57
+ },
58
+ disabled: {
59
+ control: 'boolean',
60
+ description: 'Estado desabilitado.',
61
+ table: {
62
+ category: 'State',
63
+ defaultValue: { summary: false }
64
+ }
65
+ },
48
66
  },
49
67
  };
50
- export const CuraBadgeNumber = {
68
+ export const CuraBadgeCounter = {
51
69
  args: {
52
70
  number: 1,
53
71
  color: 'primary',
54
- },
72
+ disabled: false,
73
+ type: 'solid'
74
+ }
55
75
  };
56
- //# sourceMappingURL=cura-badge-number.stories.js.map
76
+ //# sourceMappingURL=cura-badge-counter.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cura-badge-counter.stories.js","sourceRoot":"","sources":["../../../../src/components/badges/cura-badge-counter/cura-badge-counter.stories.tsx"],"names":[],"m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,EAAE;YACJ,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC3B,OAAO,EAAE,CAAC,OAAO,EAAC,SAAS,EAAC,aAAa,CAAC;YAC1C,WAAW,EAAE,8EAA8E;YAC3F,KAAK,EAAE;gBACH,QAAQ,EAAE,YAAY;gBACtB,YAAY,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;aACrC;SACJ;QACC,QAAQ,EAAE;YACR,OAAO,EAAE,SAAS;YAClB,WAAW,EAAE,sBAAsB;YACnC,KAAK,EAAE;gBACL,QAAQ,EAAE,OAAO;gBACjB,YAAY,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;aACjC;SACF;KACJ;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,IAAI,EAAE;QACJ,MAAM,EAAE,CAAC;QACT,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,OAAO;KACd;CACJ,CAAC","sourcesContent":["import { baseColors } from \"../../../utils/utils\";\n\nconst renderCuraBadgeCounter = (args: any) => {\n const block = `<cura-badge-counter${args.color && args.color !== 'primary' ? `\n color=\"${args.color}\"` : ''}${args.disabled ? `\n disabled` : ''}${args.type && args.type !== 'solid' ? `\n type=\"${args.type}\"` : ''}\n number=\"${args.number}\">\n</cura-badge-counter>\n `;\n return `${block}`;\n};\n\nexport default {\n title: 'Componentes/Badges/Badge Counter',\n tags: ['autodocs'],\n render: ({ ...args }) => {\n return renderCuraBadgeCounter(args);\n },\n argTypes: {\n number: {\n control: 'number',\n description: 'Número que será exibido',\n table: {\n category: 'Properties',\n defaultValue: { summary: 1 },\n },\n },\n color: {\n control: { type: 'select' },\n options: ['', ...baseColors],\n description: 'Cor fundamental do Design System sem profundidade (ex: primary).',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'primary' },\n },\n },\n type: {\n control: { type: 'select' },\n options: ['solid','outline','transparent'],\n description: 'Estilo do badge. Valores válidos são solid (padrão), outline ou transparent.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'solid' },\n },\n },\n disabled: {\n control: 'boolean',\n description: 'Estado desabilitado.',\n table: {\n category: 'State',\n defaultValue: { summary: false }\n }\n },\n },\n};\n\nexport const CuraBadgeCounter = {\n args: {\n number: 1,\n color: 'primary',\n disabled: false,\n type: 'solid'\n }\n};\n"]}
@@ -18,7 +18,7 @@ export class CuraDistance {
18
18
  this.formatDistance();
19
19
  }
20
20
  render() {
21
- return (h(Host, { key: '7027189b17f2ad1759f9d43bc5dbc9cbb1fe47cc' }, h("div", { key: 'bc57ac9c32c0651469d4bd6ee75d0f97408fde34', class: "container", style: this.styles }, h("cura-label", { key: '913db081273caf2e7d46d92b22e1988cf28ddeb3', size: 'xsmall', weight: 'bold', color: 'neutral-black' }, this.displayDistance, this.isThousandRounded ? 'K' : ''), h("cura-label", { key: '4c327bd9d55466bb2d9c614d9aa0420e42da23ce', size: 'xsmall', weight: 'bold', color: 'neutral-dark' }, this.label))));
21
+ return (h(Host, { key: 'cdc206deecbed2e069befda5d21ddcaf03049afc' }, h("div", { key: 'd22d2b5b97964281e8588fbc17a66f3fddcd875e', class: "container", style: this.styles }, h("cura-label", { key: '0d54ab1ad403ba23a57fb78a422ed8c577cd627e', size: 'xsmall', weight: 'bold', color: 'neutral-black' }, this.displayDistance, this.isThousandRounded ? 'K' : ''), h("cura-label", { key: 'd4929a67484bbfd6d6f3edce82414951ea4778c8', size: 'xsmall', weight: 'bold', color: 'neutral-dark' }, this.label))));
22
22
  }
23
23
  setCssProperties() {
24
24
  this.styles = {
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Global Spacing Definitions.
3
+ * Required CSS Properties:
4
+ * --base-spacing
5
+ */
6
+ /* None: 0px */
7
+ /* Tiny default: 4px */
8
+ /* Mini default: 8px */
9
+ /* XXXS default: 12px */
10
+ /* XXS default: 16px */
11
+ /* XS default: 20px */
12
+ /* S default: 20px */
13
+ /* M default: 32px */
14
+ /* L default: 40px */
15
+ /* XL default: 48px */
16
+ /* XXL default: 64px */
17
+ /* XXXL default: 72px */
18
+ /* Huge default: 96px */
19
+ .badge-container {
20
+ display: flex;
21
+ align-items: center;
22
+ justify-content: center;
23
+ gap: calc(var(--base-spacing) * 1px);
24
+ padding: calc(var(--base-spacing) * 1px);
25
+ border-radius: var(--border-radius);
26
+ font-family: var(--font-family);
27
+ font-size: var(--font-size);
28
+ position: relative;
29
+ box-sizing: border-box;
30
+ width: fit-content;
31
+ height: calc(var(--base-spacing) * 5px);
32
+ min-width: calc(var(--base-spacing) * 5px);
33
+ background-color: var(--color-background);
34
+ }
35
+ .badge-container::before {
36
+ content: "";
37
+ width: 100%;
38
+ height: 100%;
39
+ position: absolute;
40
+ left: 0px;
41
+ top: 0px;
42
+ box-sizing: border-box;
43
+ border: 1px solid transparent;
44
+ border-radius: var(--border-radius);
45
+ pointer-events: none;
46
+ }
47
+ .badge-container.icon-only cura-label {
48
+ display: none !important;
49
+ }
50
+ .badge-container.disabled {
51
+ background-color: var(--color-background-disabled);
52
+ }
53
+ .badge-container.outline {
54
+ background-color: transparent;
55
+ }
56
+ .badge-container.outline::before {
57
+ border: 1px solid var(--color-base);
58
+ }
59
+ .badge-container.outline.disabled::before {
60
+ border: 1px solid var(--color-outline-disabled);
61
+ }
62
+ .badge-container.transparent {
63
+ background-color: transparent;
64
+ }
65
+ .badge-container.transparent::before {
66
+ border: 1px solid transparent;
67
+ }
68
+ .badge-container.transparent.disabled {
69
+ background-color: transparent;
70
+ }
71
+ .badge-container cura-icon {
72
+ display: flex;
73
+ }
@@ -0,0 +1,219 @@
1
+ import { Host, h } from "@stencil/core";
2
+ export class CuraBadgePill {
3
+ constructor() {
4
+ this.theme = window.CuraAPI.theme;
5
+ this.type = 'solid';
6
+ this.color = 'primary';
7
+ this.iconName = undefined;
8
+ this.iconset = 'default';
9
+ this.disabled = false;
10
+ this.iconOnly = false;
11
+ this.borderRadius = "2px";
12
+ this.styles = {};
13
+ }
14
+ handleColorChange() {
15
+ this.setColors();
16
+ }
17
+ connectedCallback() {
18
+ this.setBaseStyles();
19
+ this.setColors();
20
+ }
21
+ setBaseStyles() {
22
+ this.styles['--base-spacing'] = this.theme.spacing.getSpacing();
23
+ this.styles['--font-family'] = this.theme.fonts.getFamily();
24
+ this.styles['--font-size'] = this.theme.fonts.getSize();
25
+ this.styles = Object.assign({}, this.styles);
26
+ }
27
+ setColors() {
28
+ const colors = [
29
+ { name: '--color-background', theme: `${this.color}-lighter` },
30
+ { name: '--color-base', theme: `${this.color}-dark` },
31
+ { name: '--color-background-disabled', theme: 'neutral-pale' },
32
+ { name: '--color-outline-disabled', theme: 'neutral-medium' },
33
+ ];
34
+ colors.forEach(color => {
35
+ this.styles[color.name] = this.theme.colors.getColor(color.theme);
36
+ });
37
+ }
38
+ hostCSSProperties() {
39
+ return {
40
+ '--border-radius': this.borderRadius || '2px',
41
+ };
42
+ }
43
+ getClasses() {
44
+ const classes = {};
45
+ classes['badge-container'] = true;
46
+ classes[`icon-only`] = this.iconOnly;
47
+ classes['disabled'] = this.disabled;
48
+ classes[`${this.type}`] = true;
49
+ return classes;
50
+ }
51
+ getSymbolColor() {
52
+ return this.disabled
53
+ ? 'neutral-medium'
54
+ : `${this.color}-dark`;
55
+ }
56
+ getIcon() {
57
+ if (!this.iconName)
58
+ return '';
59
+ return h("cura-icon", { name: this.iconName, iconset: this.iconset, size: 'micro', color: this.getSymbolColor() });
60
+ }
61
+ render() {
62
+ const symbolColor = this.getSymbolColor();
63
+ return (h(Host, { key: 'b6870052543347fdc83a75629b30251ddab35e12', style: this.hostCSSProperties() }, h("div", { key: 'ae8b14c1c9c323b8387e7ed4e3a97bade9c712f4', class: this.getClasses(), style: this.styles }, this.getIcon(), h("cura-label", { key: 'd14ab9efd48f33c7b8153cf85699b2fc96ecd7af', size: 'xsmall', "line-height": "117%", color: symbolColor }, h("slot", { key: 'b684ca1b248d04700a2b8a7245c455fb9bdef474' })))));
64
+ }
65
+ static get is() { return "cura-badge-pill"; }
66
+ static get encapsulation() { return "shadow"; }
67
+ static get originalStyleUrls() {
68
+ return {
69
+ "$": ["cura-badge-pill.scss"]
70
+ };
71
+ }
72
+ static get styleUrls() {
73
+ return {
74
+ "$": ["cura-badge-pill.css"]
75
+ };
76
+ }
77
+ static get properties() {
78
+ return {
79
+ "type": {
80
+ "type": "string",
81
+ "mutable": false,
82
+ "complexType": {
83
+ "original": "'solid' | 'outline' | 'transparent'",
84
+ "resolved": "\"outline\" | \"solid\" | \"transparent\"",
85
+ "references": {}
86
+ },
87
+ "required": false,
88
+ "optional": false,
89
+ "docs": {
90
+ "tags": [],
91
+ "text": "Badge type: solid | outline | transparent"
92
+ },
93
+ "attribute": "type",
94
+ "reflect": true,
95
+ "defaultValue": "'solid'"
96
+ },
97
+ "color": {
98
+ "type": "string",
99
+ "mutable": false,
100
+ "complexType": {
101
+ "original": "'primary' | 'secondary' | 'accent' | 'neutral' | 'info' | 'success' | 'warning' | 'error'",
102
+ "resolved": "\"accent\" | \"error\" | \"info\" | \"neutral\" | \"primary\" | \"secondary\" | \"success\" | \"warning\"",
103
+ "references": {}
104
+ },
105
+ "required": false,
106
+ "optional": false,
107
+ "docs": {
108
+ "tags": [],
109
+ "text": "Color base from color scheme. Default: primary"
110
+ },
111
+ "attribute": "color",
112
+ "reflect": false,
113
+ "defaultValue": "'primary'"
114
+ },
115
+ "iconName": {
116
+ "type": "string",
117
+ "mutable": false,
118
+ "complexType": {
119
+ "original": "string",
120
+ "resolved": "string",
121
+ "references": {}
122
+ },
123
+ "required": false,
124
+ "optional": false,
125
+ "docs": {
126
+ "tags": [],
127
+ "text": "Name of the icon to be used from iconset"
128
+ },
129
+ "attribute": "icon-name",
130
+ "reflect": true
131
+ },
132
+ "iconset": {
133
+ "type": "string",
134
+ "mutable": false,
135
+ "complexType": {
136
+ "original": "string",
137
+ "resolved": "string",
138
+ "references": {}
139
+ },
140
+ "required": false,
141
+ "optional": false,
142
+ "docs": {
143
+ "tags": [],
144
+ "text": "Custom iconset if needed"
145
+ },
146
+ "attribute": "iconset",
147
+ "reflect": true,
148
+ "defaultValue": "'default'"
149
+ },
150
+ "disabled": {
151
+ "type": "boolean",
152
+ "mutable": false,
153
+ "complexType": {
154
+ "original": "boolean",
155
+ "resolved": "boolean",
156
+ "references": {}
157
+ },
158
+ "required": false,
159
+ "optional": false,
160
+ "docs": {
161
+ "tags": [],
162
+ "text": "Disabled state. Boolean"
163
+ },
164
+ "attribute": "disabled",
165
+ "reflect": true,
166
+ "defaultValue": "false"
167
+ },
168
+ "iconOnly": {
169
+ "type": "boolean",
170
+ "mutable": false,
171
+ "complexType": {
172
+ "original": "boolean",
173
+ "resolved": "boolean",
174
+ "references": {}
175
+ },
176
+ "required": false,
177
+ "optional": false,
178
+ "docs": {
179
+ "tags": [],
180
+ "text": "Set badge to icon only. Boolean"
181
+ },
182
+ "attribute": "icon-only",
183
+ "reflect": true,
184
+ "defaultValue": "false"
185
+ },
186
+ "borderRadius": {
187
+ "type": "string",
188
+ "mutable": false,
189
+ "complexType": {
190
+ "original": "string",
191
+ "resolved": "string",
192
+ "references": {}
193
+ },
194
+ "required": false,
195
+ "optional": false,
196
+ "docs": {
197
+ "tags": [],
198
+ "text": "Set border-radius."
199
+ },
200
+ "attribute": "border-radius",
201
+ "reflect": true,
202
+ "defaultValue": "\"2px\""
203
+ }
204
+ };
205
+ }
206
+ static get states() {
207
+ return {
208
+ "styles": {}
209
+ };
210
+ }
211
+ static get elementRef() { return "host"; }
212
+ static get watchers() {
213
+ return [{
214
+ "propName": "color",
215
+ "methodName": "handleColorChange"
216
+ }];
217
+ }
218
+ }
219
+ //# sourceMappingURL=cura-badge-pill.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cura-badge-pill.js","sourceRoot":"","sources":["../../../../src/components/badges/cura-badge-pill/cura-badge-pill.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,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K,EAAE,WAAW;oBAC7D,8DAAa,CACF,CACT,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, State, h, Watch, Element } from '@stencil/core';\n\n@Component({\n tag: 'cura-badge-pill',\n styleUrl: 'cura-badge-pill.scss',\n shadow: true,\n})\nexport class CuraBadgePill {\n @Element() host: HTMLElement;\n\n /**\n * Badge type: solid | outline | transparent\n */\n @Prop({ reflect: true }) type: 'solid' | 'outline' | 'transparent' = 'solid';\n\n /**\n * Color base from color scheme. Default: primary\n */\n @Prop() color: 'primary' | 'secondary' | 'accent' | 'neutral' | 'info' | 'success' | 'warning' | 'error' = 'primary';\n\n /**\n * Name of the icon to be used from iconset\n */\n @Prop({ reflect: true }) iconName: string;\n\n /**\n * Custom iconset if needed\n */\n @Prop({ reflect: true }) iconset = 'default';\n\n /**\n * Disabled state. Boolean\n */\n @Prop({ reflect: true }) disabled = false;\n\n /**\n * Set badge to icon only. Boolean\n */\n @Prop({ reflect: true }) iconOnly = false;\n\n /**\n * Set border-radius.\n */\n @Prop({ reflect: true }) borderRadius: string = \"2px\";\n\n @State() styles = {};\n\n theme = window.CuraAPI.theme;\n\n @Watch('color')\n handleColorChange() {\n this.setColors();\n }\n\n connectedCallback() {\n this.setBaseStyles();\n this.setColors();\n }\n\n private setBaseStyles() {\n this.styles['--base-spacing'] = this.theme.spacing.getSpacing();\n this.styles['--font-family'] = this.theme.fonts.getFamily();\n this.styles['--font-size'] = this.theme.fonts.getSize();\n this.styles = { ...this.styles };\n }\n\n private setColors() {\n const colors = [\n { name: '--color-background', theme: `${this.color}-lighter` },\n { name: '--color-base', theme: `${this.color}-dark` },\n { name: '--color-background-disabled', theme: 'neutral-pale' },\n { name: '--color-outline-disabled', theme: 'neutral-medium' },\n ];\n\n colors.forEach(color => {\n this.styles[color.name] = this.theme.colors.getColor(color.theme);\n });\n }\n\n hostCSSProperties() {\n return {\n '--border-radius': this.borderRadius || '2px',\n };\n }\n\n getClasses() {\n const classes = {};\n classes['badge-container'] = true;\n classes[`icon-only`] = this.iconOnly;\n classes['disabled'] = this.disabled;\n classes[`${this.type}`] = true;\n return classes;\n }\n\n getSymbolColor() {\n return this.disabled\n ? 'neutral-medium'\n : `${this.color}-dark`;\n }\n\n getIcon() {\n if (!this.iconName) return '';\n return <cura-icon\n name={this.iconName}\n iconset={this.iconset}\n size={'micro'}\n color={this.getSymbolColor()}\n />;\n }\n\n render() {\n const symbolColor = this.getSymbolColor();\n return (\n <Host style={this.hostCSSProperties()}>\n <div class={this.getClasses()} style={this.styles}>\n {this.getIcon()}\n <cura-label size='xsmall' line-height=\"117%\" color={symbolColor}>\n <slot></slot>\n </cura-label>\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -0,0 +1,126 @@
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
+ import iconNames from "../../../assets/icons/iconset-default-list";
14
+ export default {
15
+ title: 'Componentes/Badges/Badge Pill',
16
+ tags: ['autodocs'],
17
+ render: (_a) => {
18
+ var args = __rest(_a, []);
19
+ return `<cura-badge-pill
20
+ type="${args.type}"
21
+ color="${args.color}"${args.iconName ? `
22
+ icon-name="${args.iconName}"` : ''} ${args.iconset ? `
23
+ iconset="${args.iconset}"` : ''} ${args.disabled ? `
24
+ disabled` : ''} ${args.iconOnly ? `
25
+ icon-only` : ''} ${args.borderRadius ? `
26
+ border-radius="${args.borderRadius}"` : ''}
27
+ >
28
+ ${args.label}
29
+ </cura-badge-pill>
30
+ ${args.cssBorderRadius ? `<style>
31
+ cura-badge-pill {
32
+ --border-radius: ${args.cssBorderRadius} !important;
33
+ }
34
+ </style>` : ''}`;
35
+ },
36
+ argTypes: {
37
+ type: {
38
+ control: { type: 'select' },
39
+ options: ['solid', 'outline', 'transparent'],
40
+ description: 'Tipo do badge',
41
+ table: {
42
+ category: 'Properties',
43
+ defaultValue: { summary: 'solid' }
44
+ }
45
+ },
46
+ color: {
47
+ control: { type: 'select' },
48
+ options: ['primary', 'secondary', 'accent', 'neutral', 'info', 'success', 'warning', 'error'],
49
+ description: 'Cor base do badge',
50
+ table: {
51
+ category: 'Properties',
52
+ defaultValue: { summary: 'primary' }
53
+ }
54
+ },
55
+ iconName: {
56
+ control: { type: 'select' },
57
+ options: ['', ...iconNames],
58
+ description: 'Nome do ícone do iconset',
59
+ table: {
60
+ category: 'Icons'
61
+ }
62
+ },
63
+ iconset: {
64
+ control: { type: 'text' },
65
+ description: 'Conjunto de ícones personalizado',
66
+ table: {
67
+ category: 'Icons',
68
+ defaultValue: { summary: 'default' }
69
+ }
70
+ },
71
+ iconOnly: {
72
+ control: 'boolean',
73
+ description: 'Mostra apenas o ícone',
74
+ table: {
75
+ category: 'Icons',
76
+ defaultValue: { summary: false }
77
+ }
78
+ },
79
+ disabled: {
80
+ control: 'boolean',
81
+ description: 'Estado desabilitado',
82
+ table: {
83
+ category: 'State',
84
+ defaultValue: { summary: false }
85
+ }
86
+ },
87
+ label: {
88
+ control: 'text',
89
+ description: 'Label do badge',
90
+ table: {
91
+ category: 'Properties'
92
+ }
93
+ },
94
+ borderRadius: {
95
+ control: 'text',
96
+ description: 'Border radius do badge',
97
+ table: {
98
+ category: 'Properties',
99
+ defaultValue: { summary: '2px' }
100
+ }
101
+ },
102
+ cssBorderRadius: {
103
+ control: 'text',
104
+ name: '--border-radius',
105
+ description: 'É possível sobrescrever o border-radius do componente (Ex: 10px, 50%, etc.)',
106
+ table: {
107
+ category: 'CSS Properties',
108
+ defaultValue: { summary: '' }
109
+ }
110
+ },
111
+ },
112
+ };
113
+ export const BadgePill = {
114
+ args: {
115
+ type: 'solid',
116
+ color: 'primary',
117
+ iconName: '',
118
+ iconset: '',
119
+ disabled: false,
120
+ iconOnly: false,
121
+ label: 'Badge Pill',
122
+ borderRadius: '',
123
+ cssBorderRadius: '',
124
+ },
125
+ };
126
+ //# sourceMappingURL=cura-badge-pill.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cura-badge-pill.stories.js","sourceRoot":"","sources":["../../../../src/components/badges/cura-badge-pill/cura-badge-pill.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,SAAS,MAAM,4CAA4C,CAAC;AAEnE,eAAe;IACb,KAAK,EAAE,+BAA+B;IACtC,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,MAAM,EAAE,CAAC,EAAW,EAAE,EAAE;YAAV,IAAI,cAAT,EAAW,CAAF;QAChB,OAAO;UACD,IAAI,CAAC,IAAI;WACR,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;eAC1B,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;aAC1C,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;WAC1C,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YACxB,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;mBACtB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,EAAE;;IAExC,IAAI,CAAC,KAA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BACjB,YAAY,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;aACjC;SACF;QACD,QAAQ,EAAE;YACR,OAAO,EAAE,SAAS;YAClB,WAAW,EAAE,qBAAqB;YAClC,KAAK,EAAE;gBACL,QAAQ,EAAE,OAAO;gBACjB,YAAY,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;aACjC;SACF;QACD,KAAK,EAAE;YACL,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,gBAAgB;YAC7B,KAAK,EAAE;gBACL,QAAQ,EAAE,YAAY;aACvB;SACF;QACD,YAAY,EAAE;YACZ,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,wBAAwB;YACrC,KAAK,EAAE;gBACL,QAAQ,EAAE,YAAY;gBACtB,YAAY,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;aACjC;SACF;QACD,eAAe,EAAE;YACf,OAAO,EAAE,MAAM;YACf,IAAI,EAAE,iBAAiB;YACvB,WAAW,EAAE,6EAA6E;YAC1F,KAAK,EAAE;gBACL,QAAQ,EAAE,gBAAgB;gBAC1B,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;aAC9B;SACF;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE;QACJ,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,EAAE;QACZ,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,KAAK;QACf,KAAK,EAAE,YAAY;QACnB,YAAY,EAAE,EAAE;QAChB,eAAe,EAAE,EAAE;KACpB;CACF,CAAC","sourcesContent":["import iconNames from '../../../assets/icons/iconset-default-list';\n\nexport default {\n title: 'Componentes/Badges/Badge Pill',\n tags: ['autodocs'],\n render: ({ ...args }) => {\n return `<cura-badge-pill\n type=\"${args.type}\"\n color=\"${args.color}\"${args.iconName ? `\n icon-name=\"${args.iconName}\"` : ''} ${args.iconset ? `\n iconset=\"${args.iconset}\"` : ''} ${args.disabled ? `\n disabled` : ''} ${args.iconOnly ? `\n icon-only` : ''} ${args.borderRadius ? `\n border-radius=\"${args.borderRadius}\"` : ''}\n>\n ${args.label}\n</cura-badge-pill>\n${args.cssBorderRadius ? `<style>\n cura-badge-pill {\n --border-radius: ${args.cssBorderRadius} !important;\n }\n</style>` : ''}`;\n },\n argTypes: {\n type: {\n control: { type: 'select' },\n options: ['solid', 'outline', 'transparent'],\n description: 'Tipo do badge',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'solid' }\n }\n },\n color: {\n control: { type: 'select' },\n options: ['primary', 'secondary', 'accent', 'neutral', 'info', 'success', 'warning', 'error'],\n description: 'Cor base do badge',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'primary' }\n }\n },\n iconName: {\n control: { type: 'select' },\n options: ['', ...iconNames],\n description: 'Nome do ícone do iconset',\n table: {\n category: 'Icons'\n }\n },\n iconset: {\n control: { type: 'text' },\n description: 'Conjunto de ícones personalizado',\n table: {\n category: 'Icons',\n defaultValue: { summary: 'default' }\n }\n },\n iconOnly: {\n control: 'boolean',\n description: 'Mostra apenas o ícone',\n table: {\n category: 'Icons',\n defaultValue: { summary: false }\n }\n },\n disabled: {\n control: 'boolean',\n description: 'Estado desabilitado',\n table: {\n category: 'State',\n defaultValue: { summary: false }\n }\n },\n label: {\n control: 'text',\n description: 'Label do badge',\n table: {\n category: 'Properties'\n }\n },\n borderRadius: {\n control: 'text',\n description: 'Border radius do badge',\n table: {\n category: 'Properties',\n defaultValue: { summary: '2px' }\n }\n },\n cssBorderRadius: {\n control: 'text',\n name: '--border-radius',\n description: 'É possível sobrescrever o border-radius do componente (Ex: 10px, 50%, etc.)',\n table: {\n category: 'CSS Properties',\n defaultValue: { summary: '' }\n }\n },\n },\n};\n\nexport const BadgePill = {\n args: {\n type: 'solid',\n color: 'primary',\n iconName: '',\n iconset: '',\n disabled: false,\n iconOnly: false,\n label: 'Badge Pill',\n borderRadius: '',\n cssBorderRadius: '',\n },\n};\n\n"]}
@@ -88,7 +88,7 @@ export class CuraButton {
88
88
  render() {
89
89
  const symbolColor = this.getSymbolColor();
90
90
  const labelSize = labelSizes[this.size] || labelSizes["default"];
91
- return (h(Host, { key: '2831f74cc53bbadcaf1648c759090204cf3c20ea' }, this.href ? (h("a", { href: this.disabled ? '' : this.href, target: this.target, class: this.getClasses(), style: this.styles, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, h("span", { class: "button-container" }, this.getIcon(), h("cura-label", { class: "label", size: labelSize, lineHeight: '105%', color: symbolColor }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: symbolColor }))) : (h("button", { class: this.getClasses(), style: this.styles, disabled: this.disabled || null, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave(), type: this.type }, h("span", { class: "button-container" }, this.getIcon(), h("cura-label", { class: "label", size: labelSize, lineHeight: '105%', color: symbolColor }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: symbolColor })))));
91
+ return (h(Host, { key: '27ce2e8e003caac05d652a9a25054f689d9e3841' }, this.href ? (h("a", { href: this.disabled ? '' : this.href, target: this.target, class: this.getClasses(), style: this.styles, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, h("span", { class: "button-container" }, this.getIcon(), h("cura-label", { class: "label", size: labelSize, lineHeight: '105%', color: symbolColor }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: symbolColor }))) : (h("button", { class: this.getClasses(), style: this.styles, disabled: this.disabled || null, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave(), type: this.type }, h("span", { class: "button-container" }, this.getIcon(), h("cura-label", { class: "label", size: labelSize, lineHeight: '105%', color: symbolColor }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: symbolColor })))));
92
92
  }
93
93
  static get is() { return "cura-button"; }
94
94
  static get encapsulation() { return "shadow"; }
@@ -87,7 +87,7 @@ export class CuraButtonOutline {
87
87
  render() {
88
88
  const symbolColor = this.getSymbolColor();
89
89
  const labelSize = labelSizes[this.size] || labelSizes["default"];
90
- return (h(Host, { key: '5adde27bc83165040d4279e4835646e13b08a412' }, this.href ? (h("a", { href: this.disabled ? '' : this.href, target: this.target, class: this.getClasses(), style: this.styles, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, h("span", { class: "button-container" }, this.getIcon(), h("cura-label", { size: labelSize, lineHeight: '105%', color: symbolColor }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: symbolColor }))) : (h("button", { class: this.getClasses(), style: this.styles, disabled: this.disabled || null, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave(), type: this.type }, h("span", { class: "button-container" }, this.getIcon(), h("cura-label", { size: labelSize, lineHeight: '105%', color: symbolColor }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: symbolColor })))));
90
+ return (h(Host, { key: '8c7adeaec50deaf3829295d2231b390992064735' }, this.href ? (h("a", { href: this.disabled ? '' : this.href, target: this.target, class: this.getClasses(), style: this.styles, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, h("span", { class: "button-container" }, this.getIcon(), h("cura-label", { size: labelSize, lineHeight: '105%', color: symbolColor }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: symbolColor }))) : (h("button", { class: this.getClasses(), style: this.styles, disabled: this.disabled || null, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave(), type: this.type }, h("span", { class: "button-container" }, this.getIcon(), h("cura-label", { size: labelSize, lineHeight: '105%', color: symbolColor }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: symbolColor })))));
91
91
  }
92
92
  static get is() { return "cura-button-outline"; }
93
93
  static get encapsulation() { return "shadow"; }
@@ -57,15 +57,6 @@ export class CuraButtonSelect {
57
57
  return this.selected ? 'neutral-white' : 'neutral-black';
58
58
  }
59
59
  }
60
- getColorCounter() {
61
- if (this.background === 'dark' && this.disabled) {
62
- return !this.selected ? 'neutral-black' : 'neutral-dark';
63
- }
64
- if (this.background === 'light' && this.disabled) {
65
- return 'neutral-pale';
66
- }
67
- return `${this.color}-lighter`;
68
- }
69
60
  getColorBagdeNumber() {
70
61
  if (this.background === 'dark' && this.disabled) {
71
62
  return this.selected ? 'neutral-black' : 'neutral-dark';
@@ -83,7 +74,7 @@ export class CuraButtonSelect {
83
74
  return h("cura-icon", { name: this.iconName, size: iconSize, color: this.getLabelFontColor() });
84
75
  }
85
76
  getCounter() {
86
- return (h("cura-badge-number", { color: this.getColorCounter(), class: "badge-number" }, h("cura-label", { color: this.getColorBagdeNumber(), size: "small" }, this.counter)));
77
+ return (h("cura-badge-counter", { number: this.counter, color: this.color, disabled: this.disabled || null, class: "badge-number" }));
87
78
  }
88
79
  getCheckIconRight() {
89
80
  const iconSize = this.size === 'large' ? 20 : 16;
@@ -105,7 +96,7 @@ export class CuraButtonSelect {
105
96
  }
106
97
  render() {
107
98
  const labelSize = labelSizes[this.size] || labelSizes['default'];
108
- return (h(Host, { key: '8b766a3e23c2af13a47d113884047d19717702f2' }, h("button", { key: '90b57f260baa61de7c73e09965e190cd13eb62e1', class: this.getClasses(), style: this.styles, disabled: this.disabled, onClick: e => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, h("div", { key: 'f318438fa59f43846ce5043e4ee290faf3cf05d4', class: "button-container" }, this.iconName ? this.getIcon() : null, h("cura-label", { key: '2d069740c62b32dd3aa0fd74bdafb951d8deb73b', class: "label", size: labelSize, lineHeight: "0%", color: this.getLabelFontColor(), weight: "regular" }, h("slot", { key: 'e71e072d1dd91bbbafa939181cc22ba7b7c6189e' })), this.counter ? this.getCounter() : null, this.iconPosition === 'right' && this.selected ? this.getCheckIconRight() : null))));
99
+ return (h(Host, { key: '54bf5dc64b99128f839fdc22ff56dd709971fc8e' }, h("button", { key: '422e4d80d321fb9e4cddd165700220071012bea8', class: this.getClasses(), style: this.styles, disabled: this.disabled, onClick: e => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, h("div", { key: '6c40080d1b8746e394539cf717d658e4d834c500', class: "button-container" }, this.iconName ? this.getIcon() : null, h("cura-label", { key: 'f2f9b54cbcd2c7a571d966ba20f344384ecaadc0', class: "label", size: labelSize, lineHeight: "0%", color: this.getLabelFontColor(), weight: "regular" }, h("slot", { key: 'f5c471e0771c6c19685aa591461a73b1aaa83c47' })), this.counter ? this.getCounter() : null, this.iconPosition === 'right' && this.selected ? this.getCheckIconRight() : null))));
109
100
  }
110
101
  static get is() { return "cura-button-select"; }
111
102
  static get encapsulation() { return "shadow"; }
@@ -175,11 +166,11 @@ export class CuraButtonSelect {
175
166
  "defaultValue": "'medium'"
176
167
  },
177
168
  "counter": {
178
- "type": "any",
169
+ "type": "number",
179
170
  "mutable": true,
180
171
  "complexType": {
181
- "original": "string | number | null",
182
- "resolved": "number | string",
172
+ "original": "number | null",
173
+ "resolved": "number",
183
174
  "references": {}
184
175
  },
185
176
  "required": false,