@plenustech/design-system 0.2.2 → 0.2.4

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 (508) hide show
  1. package/dist/components/actions/ButtonTile/ButtonTile.cjs +2 -0
  2. package/dist/components/actions/ButtonTile/ButtonTile.cjs.map +1 -0
  3. package/dist/components/actions/ButtonTile/ButtonTile.js +23 -0
  4. package/dist/components/actions/ButtonTile/ButtonTile.js.map +1 -0
  5. package/dist/components/actions/ButtonTile/ButtonTile.module.css.cjs +2 -0
  6. package/dist/components/actions/ButtonTile/ButtonTile.module.css.cjs.map +1 -0
  7. package/dist/components/actions/ButtonTile/ButtonTile.module.css.js +16 -0
  8. package/dist/components/actions/ButtonTile/ButtonTile.module.css.js.map +1 -0
  9. package/dist/components/actions/Toolbar/Toolbar.cjs +2 -0
  10. package/dist/components/actions/Toolbar/Toolbar.cjs.map +1 -0
  11. package/dist/components/actions/Toolbar/Toolbar.js +118 -0
  12. package/dist/components/actions/Toolbar/Toolbar.js.map +1 -0
  13. package/dist/components/actions/Toolbar/Toolbar.module.css.cjs +2 -0
  14. package/dist/components/actions/Toolbar/Toolbar.module.css.cjs.map +1 -0
  15. package/dist/components/actions/Toolbar/Toolbar.module.css.js +20 -0
  16. package/dist/components/actions/Toolbar/Toolbar.module.css.js.map +1 -0
  17. package/dist/components/charts/ChartArea/ChartArea.cjs +1 -1
  18. package/dist/components/charts/ChartArea/ChartArea.cjs.map +1 -1
  19. package/dist/components/charts/ChartArea/ChartArea.js +196 -148
  20. package/dist/components/charts/ChartArea/ChartArea.js.map +1 -1
  21. package/dist/components/charts/ChartArea/ChartArea.module.css.cjs +1 -1
  22. package/dist/components/charts/ChartArea/ChartArea.module.css.js +12 -10
  23. package/dist/components/charts/ChartArea/ChartArea.module.css.js.map +1 -1
  24. package/dist/components/charts/ChartBar/ChartBar.cjs +1 -1
  25. package/dist/components/charts/ChartBar/ChartBar.cjs.map +1 -1
  26. package/dist/components/charts/ChartBar/ChartBar.js +168 -145
  27. package/dist/components/charts/ChartBar/ChartBar.js.map +1 -1
  28. package/dist/components/charts/ChartBar/ChartBar.module.css.cjs +1 -1
  29. package/dist/components/charts/ChartBar/ChartBar.module.css.js +12 -10
  30. package/dist/components/charts/ChartBar/ChartBar.module.css.js.map +1 -1
  31. package/dist/components/charts/ChartCombo/ChartCombo.cjs +1 -1
  32. package/dist/components/charts/ChartCombo/ChartCombo.cjs.map +1 -1
  33. package/dist/components/charts/ChartCombo/ChartCombo.js +179 -154
  34. package/dist/components/charts/ChartCombo/ChartCombo.js.map +1 -1
  35. package/dist/components/charts/ChartCombo/ChartCombo.module.css.cjs +1 -1
  36. package/dist/components/charts/ChartCombo/ChartCombo.module.css.js +16 -14
  37. package/dist/components/charts/ChartCombo/ChartCombo.module.css.js.map +1 -1
  38. package/dist/components/charts/ChartDonut/ChartDonut.cjs +1 -1
  39. package/dist/components/charts/ChartDonut/ChartDonut.cjs.map +1 -1
  40. package/dist/components/charts/ChartDonut/ChartDonut.js +72 -61
  41. package/dist/components/charts/ChartDonut/ChartDonut.js.map +1 -1
  42. package/dist/components/charts/ChartGauge/ChartGauge.cjs +2 -0
  43. package/dist/components/charts/ChartGauge/ChartGauge.cjs.map +1 -0
  44. package/dist/components/charts/ChartGauge/ChartGauge.js +307 -0
  45. package/dist/components/charts/ChartGauge/ChartGauge.js.map +1 -0
  46. package/dist/components/charts/ChartGauge/ChartGauge.module.css.cjs +2 -0
  47. package/dist/components/charts/ChartGauge/ChartGauge.module.css.cjs.map +1 -0
  48. package/dist/components/charts/ChartGauge/ChartGauge.module.css.js +76 -0
  49. package/dist/components/charts/ChartGauge/ChartGauge.module.css.js.map +1 -0
  50. package/dist/components/charts/ChartGauge/gaugeLayout.cjs +2 -0
  51. package/dist/components/charts/ChartGauge/gaugeLayout.cjs.map +1 -0
  52. package/dist/components/charts/ChartGauge/gaugeLayout.js +107 -0
  53. package/dist/components/charts/ChartGauge/gaugeLayout.js.map +1 -0
  54. package/dist/components/charts/ChartGauge/gaugeReading.cjs +2 -0
  55. package/dist/components/charts/ChartGauge/gaugeReading.cjs.map +1 -0
  56. package/dist/components/charts/ChartGauge/gaugeReading.js +112 -0
  57. package/dist/components/charts/ChartGauge/gaugeReading.js.map +1 -0
  58. package/dist/components/charts/ChartGauge/gaugeScale.cjs +2 -0
  59. package/dist/components/charts/ChartGauge/gaugeScale.cjs.map +1 -0
  60. package/dist/components/charts/ChartGauge/gaugeScale.js +57 -0
  61. package/dist/components/charts/ChartGauge/gaugeScale.js.map +1 -0
  62. package/dist/components/charts/ChartLine/ChartLine.cjs +1 -1
  63. package/dist/components/charts/ChartLine/ChartLine.cjs.map +1 -1
  64. package/dist/components/charts/ChartLine/ChartLine.js +196 -143
  65. package/dist/components/charts/ChartLine/ChartLine.js.map +1 -1
  66. package/dist/components/charts/ChartLine/ChartLine.module.css.cjs +1 -1
  67. package/dist/components/charts/ChartLine/ChartLine.module.css.js +16 -14
  68. package/dist/components/charts/ChartLine/ChartLine.module.css.js.map +1 -1
  69. package/dist/components/charts/ChartMap/ChartMap.cjs +2 -0
  70. package/dist/components/charts/ChartMap/ChartMap.cjs.map +1 -0
  71. package/dist/components/charts/ChartMap/ChartMap.js +523 -0
  72. package/dist/components/charts/ChartMap/ChartMap.js.map +1 -0
  73. package/dist/components/charts/ChartMap/ChartMap.module.css.cjs +2 -0
  74. package/dist/components/charts/ChartMap/ChartMap.module.css.cjs.map +1 -0
  75. package/dist/components/charts/ChartMap/ChartMap.module.css.js +124 -0
  76. package/dist/components/charts/ChartMap/ChartMap.module.css.js.map +1 -0
  77. package/dist/components/charts/ChartMap/ChartMapLegend.cjs +2 -0
  78. package/dist/components/charts/ChartMap/ChartMapLegend.cjs.map +1 -0
  79. package/dist/components/charts/ChartMap/ChartMapLegend.js +102 -0
  80. package/dist/components/charts/ChartMap/ChartMapLegend.js.map +1 -0
  81. package/dist/components/charts/ChartMap/ChartMapTable.cjs +2 -0
  82. package/dist/components/charts/ChartMap/ChartMapTable.cjs.map +1 -0
  83. package/dist/components/charts/ChartMap/ChartMapTable.js +118 -0
  84. package/dist/components/charts/ChartMap/ChartMapTable.js.map +1 -0
  85. package/dist/components/charts/ChartMap/mapGeometry.cjs +2 -0
  86. package/dist/components/charts/ChartMap/mapGeometry.cjs.map +1 -0
  87. package/dist/components/charts/ChartMap/mapGeometry.js +113 -0
  88. package/dist/components/charts/ChartMap/mapGeometry.js.map +1 -0
  89. package/dist/components/charts/ChartMap/mapLabels.cjs +2 -0
  90. package/dist/components/charts/ChartMap/mapLabels.cjs.map +1 -0
  91. package/dist/components/charts/ChartMap/mapLabels.js +80 -0
  92. package/dist/components/charts/ChartMap/mapLabels.js.map +1 -0
  93. package/dist/components/charts/ChartMap/mapScales.cjs +2 -0
  94. package/dist/components/charts/ChartMap/mapScales.cjs.map +1 -0
  95. package/dist/components/charts/ChartMap/mapScales.js +131 -0
  96. package/dist/components/charts/ChartMap/mapScales.js.map +1 -0
  97. package/dist/components/charts/ChartMap/polylabel.cjs +2 -0
  98. package/dist/components/charts/ChartMap/polylabel.cjs.map +1 -0
  99. package/dist/components/charts/ChartMap/polylabel.js +50 -0
  100. package/dist/components/charts/ChartMap/polylabel.js.map +1 -0
  101. package/dist/components/charts/ChartPie/ChartPie.cjs +1 -1
  102. package/dist/components/charts/ChartPie/ChartPie.cjs.map +1 -1
  103. package/dist/components/charts/ChartPie/ChartPie.js +71 -60
  104. package/dist/components/charts/ChartPie/ChartPie.js.map +1 -1
  105. package/dist/components/charts/ChartRadial/ChartRadial.cjs +1 -1
  106. package/dist/components/charts/ChartRadial/ChartRadial.cjs.map +1 -1
  107. package/dist/components/charts/ChartRadial/ChartRadial.js +101 -84
  108. package/dist/components/charts/ChartRadial/ChartRadial.js.map +1 -1
  109. package/dist/components/charts/ChartSankey/ChartSankey.cjs +1 -1
  110. package/dist/components/charts/ChartSankey/ChartSankey.cjs.map +1 -1
  111. package/dist/components/charts/ChartSankey/ChartSankey.js +148 -125
  112. package/dist/components/charts/ChartSankey/ChartSankey.js.map +1 -1
  113. package/dist/components/charts/ChartScatter/ChartScatter.cjs +1 -1
  114. package/dist/components/charts/ChartScatter/ChartScatter.cjs.map +1 -1
  115. package/dist/components/charts/ChartScatter/ChartScatter.js +138 -106
  116. package/dist/components/charts/ChartScatter/ChartScatter.js.map +1 -1
  117. package/dist/components/charts/ChartScatter/ChartScatter.module.css.cjs +1 -1
  118. package/dist/components/charts/ChartScatter/ChartScatter.module.css.js +3 -3
  119. package/dist/components/charts/ChartSunburst/ChartSunburst.cjs +1 -1
  120. package/dist/components/charts/ChartSunburst/ChartSunburst.cjs.map +1 -1
  121. package/dist/components/charts/ChartSunburst/ChartSunburst.js +115 -100
  122. package/dist/components/charts/ChartSunburst/ChartSunburst.js.map +1 -1
  123. package/dist/components/charts/ChartTimeline/ChartTimeline.cjs +2 -0
  124. package/dist/components/charts/ChartTimeline/ChartTimeline.cjs.map +1 -0
  125. package/dist/components/charts/ChartTimeline/ChartTimeline.js +703 -0
  126. package/dist/components/charts/ChartTimeline/ChartTimeline.js.map +1 -0
  127. package/dist/components/charts/ChartTimeline/ChartTimeline.module.css.cjs +2 -0
  128. package/dist/components/charts/ChartTimeline/ChartTimeline.module.css.cjs.map +1 -0
  129. package/dist/components/charts/ChartTimeline/ChartTimeline.module.css.js +124 -0
  130. package/dist/components/charts/ChartTimeline/ChartTimeline.module.css.js.map +1 -0
  131. package/dist/components/charts/ChartTimeline/ChartTimelineTable.cjs +2 -0
  132. package/dist/components/charts/ChartTimeline/ChartTimelineTable.cjs.map +1 -0
  133. package/dist/components/charts/ChartTimeline/ChartTimelineTable.js +42 -0
  134. package/dist/components/charts/ChartTimeline/ChartTimelineTable.js.map +1 -0
  135. package/dist/components/charts/ChartTimeline/timelineLayout.cjs +2 -0
  136. package/dist/components/charts/ChartTimeline/timelineLayout.cjs.map +1 -0
  137. package/dist/components/charts/ChartTimeline/timelineLayout.js +109 -0
  138. package/dist/components/charts/ChartTimeline/timelineLayout.js.map +1 -0
  139. package/dist/components/charts/ChartTimeline/timelineTime.cjs +2 -0
  140. package/dist/components/charts/ChartTimeline/timelineTime.cjs.map +1 -0
  141. package/dist/components/charts/ChartTimeline/timelineTime.js +91 -0
  142. package/dist/components/charts/ChartTimeline/timelineTime.js.map +1 -0
  143. package/dist/components/charts/ChartTimeline/timelineTooltip.cjs +2 -0
  144. package/dist/components/charts/ChartTimeline/timelineTooltip.cjs.map +1 -0
  145. package/dist/components/charts/ChartTimeline/timelineTooltip.js +77 -0
  146. package/dist/components/charts/ChartTimeline/timelineTooltip.js.map +1 -0
  147. package/dist/components/charts/ChartTooltip/ChartTooltip.cjs +1 -1
  148. package/dist/components/charts/ChartTooltip/ChartTooltip.cjs.map +1 -1
  149. package/dist/components/charts/ChartTooltip/ChartTooltip.js +1 -1
  150. package/dist/components/charts/ChartTooltip/ChartTooltip.js.map +1 -1
  151. package/dist/components/charts/ChartTreemap/ChartTreemap.cjs +1 -1
  152. package/dist/components/charts/ChartTreemap/ChartTreemap.cjs.map +1 -1
  153. package/dist/components/charts/ChartTreemap/ChartTreemap.js +100 -89
  154. package/dist/components/charts/ChartTreemap/ChartTreemap.js.map +1 -1
  155. package/dist/components/charts/ChartWaterfall/ChartWaterfall.cjs +1 -1
  156. package/dist/components/charts/ChartWaterfall/ChartWaterfall.cjs.map +1 -1
  157. package/dist/components/charts/ChartWaterfall/ChartWaterfall.js +125 -105
  158. package/dist/components/charts/ChartWaterfall/ChartWaterfall.js.map +1 -1
  159. package/dist/components/charts/ChartWaterfall/ChartWaterfall.module.css.cjs +1 -1
  160. package/dist/components/charts/ChartWaterfall/ChartWaterfall.module.css.js +8 -6
  161. package/dist/components/charts/ChartWaterfall/ChartWaterfall.module.css.js.map +1 -1
  162. package/dist/components/charts/core/CartesianFrame.cjs +1 -1
  163. package/dist/components/charts/core/CartesianFrame.cjs.map +1 -1
  164. package/dist/components/charts/core/CartesianFrame.js +61 -96
  165. package/dist/components/charts/core/CartesianFrame.js.map +1 -1
  166. package/dist/components/charts/core/Chart.module.css.cjs +1 -1
  167. package/dist/components/charts/core/Chart.module.css.js +52 -54
  168. package/dist/components/charts/core/Chart.module.css.js.map +1 -1
  169. package/dist/components/charts/core/ChartFrame.cjs +1 -1
  170. package/dist/components/charts/core/ChartFrame.cjs.map +1 -1
  171. package/dist/components/charts/core/ChartFrame.js +53 -47
  172. package/dist/components/charts/core/ChartFrame.js.map +1 -1
  173. package/dist/components/charts/core/ChartLegend.cjs +1 -1
  174. package/dist/components/charts/core/ChartLegend.cjs.map +1 -1
  175. package/dist/components/charts/core/ChartLegend.js +37 -25
  176. package/dist/components/charts/core/ChartLegend.js.map +1 -1
  177. package/dist/components/charts/core/PointBands.cjs +2 -0
  178. package/dist/components/charts/core/PointBands.cjs.map +1 -0
  179. package/dist/components/charts/core/PointBands.js +41 -0
  180. package/dist/components/charts/core/PointBands.js.map +1 -0
  181. package/dist/components/charts/core/cartesianLayout.cjs +1 -1
  182. package/dist/components/charts/core/cartesianLayout.cjs.map +1 -1
  183. package/dist/components/charts/core/cartesianLayout.js +49 -41
  184. package/dist/components/charts/core/cartesianLayout.js.map +1 -1
  185. package/dist/components/charts/core/hoverPath.cjs +2 -0
  186. package/dist/components/charts/core/hoverPath.cjs.map +1 -0
  187. package/dist/components/charts/core/hoverPath.js +7 -0
  188. package/dist/components/charts/core/hoverPath.js.map +1 -0
  189. package/dist/components/charts/core/pointLabels.cjs +2 -0
  190. package/dist/components/charts/core/pointLabels.cjs.map +1 -0
  191. package/dist/components/charts/core/pointLabels.js +12 -0
  192. package/dist/components/charts/core/pointLabels.js.map +1 -0
  193. package/dist/components/charts/core/tooltips.cjs +2 -0
  194. package/dist/components/charts/core/tooltips.cjs.map +1 -0
  195. package/dist/components/charts/core/tooltips.js +48 -0
  196. package/dist/components/charts/core/tooltips.js.map +1 -0
  197. package/dist/components/charts/core/useCartesianLayout.cjs +2 -0
  198. package/dist/components/charts/core/useCartesianLayout.cjs.map +1 -0
  199. package/dist/components/charts/core/useCartesianLayout.js +38 -0
  200. package/dist/components/charts/core/useCartesianLayout.js.map +1 -0
  201. package/dist/components/charts/core/useChartMetrics.cjs +1 -1
  202. package/dist/components/charts/core/useChartMetrics.cjs.map +1 -1
  203. package/dist/components/charts/core/useChartMetrics.js +20 -25
  204. package/dist/components/charts/core/useChartMetrics.js.map +1 -1
  205. package/dist/components/charts/core/useSeriesToggle.cjs +1 -1
  206. package/dist/components/charts/core/useSeriesToggle.cjs.map +1 -1
  207. package/dist/components/charts/core/useSeriesToggle.js +19 -12
  208. package/dist/components/charts/core/useSeriesToggle.js.map +1 -1
  209. package/dist/components/data-display/Accordion/Accordion.cjs +1 -1
  210. package/dist/components/data-display/Accordion/Accordion.cjs.map +1 -1
  211. package/dist/components/data-display/Accordion/Accordion.js +56 -46
  212. package/dist/components/data-display/Accordion/Accordion.js.map +1 -1
  213. package/dist/components/data-display/Accordion/Accordion.module.css.cjs +1 -1
  214. package/dist/components/data-display/Accordion/Accordion.module.css.js +16 -16
  215. package/dist/components/data-display/List/List.cjs.map +1 -1
  216. package/dist/components/data-display/List/List.js.map +1 -1
  217. package/dist/components/data-display/List/List.module.css.cjs +1 -1
  218. package/dist/components/data-display/List/List.module.css.js +34 -24
  219. package/dist/components/data-display/List/List.module.css.js.map +1 -1
  220. package/dist/components/data-display/List/ListingOptions.cjs +1 -1
  221. package/dist/components/data-display/List/ListingOptions.cjs.map +1 -1
  222. package/dist/components/data-display/List/ListingOptions.js +98 -74
  223. package/dist/components/data-display/List/ListingOptions.js.map +1 -1
  224. package/dist/components/data-display/List/useListing.cjs.map +1 -1
  225. package/dist/components/data-display/List/useListing.js.map +1 -1
  226. package/dist/components/data-display/SortableList/SortableList.cjs +2 -0
  227. package/dist/components/data-display/SortableList/SortableList.cjs.map +1 -0
  228. package/dist/components/data-display/SortableList/SortableList.js +168 -0
  229. package/dist/components/data-display/SortableList/SortableList.js.map +1 -0
  230. package/dist/components/data-display/SortableList/SortableList.module.css.cjs +2 -0
  231. package/dist/components/data-display/SortableList/SortableList.module.css.cjs.map +1 -0
  232. package/dist/components/data-display/SortableList/SortableList.module.css.js +34 -0
  233. package/dist/components/data-display/SortableList/SortableList.module.css.js.map +1 -0
  234. package/dist/components/data-display/Table/Table.cjs +1 -1
  235. package/dist/components/data-display/Table/Table.cjs.map +1 -1
  236. package/dist/components/data-display/Table/Table.js +86 -85
  237. package/dist/components/data-display/Table/Table.js.map +1 -1
  238. package/dist/components/data-display/Table/Table.module.css.cjs +1 -1
  239. package/dist/components/data-display/Table/Table.module.css.js +50 -51
  240. package/dist/components/data-display/Table/Table.module.css.js.map +1 -1
  241. package/dist/components/data-display/Tag/Tag.cjs +2 -0
  242. package/dist/components/data-display/Tag/Tag.cjs.map +1 -0
  243. package/dist/components/data-display/Tag/Tag.js +50 -0
  244. package/dist/components/data-display/Tag/Tag.js.map +1 -0
  245. package/dist/components/data-display/Tag/Tag.module.css.cjs +2 -0
  246. package/dist/components/data-display/Tag/Tag.module.css.cjs.map +1 -0
  247. package/dist/components/data-display/Tag/Tag.module.css.js +22 -0
  248. package/dist/components/data-display/Tag/Tag.module.css.js.map +1 -0
  249. package/dist/components/data-display/Timeline/Timeline.cjs +2 -0
  250. package/dist/components/data-display/Timeline/Timeline.cjs.map +1 -0
  251. package/dist/components/data-display/Timeline/Timeline.js +31 -0
  252. package/dist/components/data-display/Timeline/Timeline.js.map +1 -0
  253. package/dist/components/data-display/Timeline/Timeline.module.css.cjs +2 -0
  254. package/dist/components/data-display/Timeline/Timeline.module.css.cjs.map +1 -0
  255. package/dist/components/data-display/Timeline/Timeline.module.css.js +30 -0
  256. package/dist/components/data-display/Timeline/Timeline.module.css.js.map +1 -0
  257. package/dist/components/feedback/Skeleton/Skeleton.cjs +2 -0
  258. package/dist/components/feedback/Skeleton/Skeleton.cjs.map +1 -0
  259. package/dist/components/feedback/Skeleton/Skeleton.js +17 -0
  260. package/dist/components/feedback/Skeleton/Skeleton.js.map +1 -0
  261. package/dist/components/feedback/Skeleton/Skeleton.module.css.cjs +2 -0
  262. package/dist/components/feedback/Skeleton/Skeleton.module.css.cjs.map +1 -0
  263. package/dist/components/feedback/Skeleton/Skeleton.module.css.js +15 -0
  264. package/dist/components/feedback/Skeleton/Skeleton.module.css.js.map +1 -0
  265. package/dist/components/feedback/Toast/Toast.module.css.cjs +2 -0
  266. package/dist/components/feedback/Toast/Toast.module.css.cjs.map +1 -0
  267. package/dist/components/feedback/Toast/Toast.module.css.js +31 -0
  268. package/dist/components/feedback/Toast/Toast.module.css.js.map +1 -0
  269. package/dist/components/feedback/Toast/ToastRegion.cjs +2 -0
  270. package/dist/components/feedback/Toast/ToastRegion.cjs.map +1 -0
  271. package/dist/components/feedback/Toast/ToastRegion.js +62 -0
  272. package/dist/components/feedback/Toast/ToastRegion.js.map +1 -0
  273. package/dist/components/feedback/Toast/toastStore.cjs +2 -0
  274. package/dist/components/feedback/Toast/toastStore.cjs.map +1 -0
  275. package/dist/components/feedback/Toast/toastStore.js +33 -0
  276. package/dist/components/feedback/Toast/toastStore.js.map +1 -0
  277. package/dist/components/forms/Checkbox/Checkbox.cjs +1 -1
  278. package/dist/components/forms/Checkbox/Checkbox.cjs.map +1 -1
  279. package/dist/components/forms/Checkbox/Checkbox.js +43 -31
  280. package/dist/components/forms/Checkbox/Checkbox.js.map +1 -1
  281. package/dist/components/forms/Checkbox/Checkbox.module.css.cjs +1 -1
  282. package/dist/components/forms/Checkbox/Checkbox.module.css.js +1 -1
  283. package/dist/components/forms/CheckboxGroup/CheckboxGroup.cjs +2 -0
  284. package/dist/components/forms/CheckboxGroup/CheckboxGroup.cjs.map +1 -0
  285. package/dist/components/forms/CheckboxGroup/CheckboxGroup.js +54 -0
  286. package/dist/components/forms/CheckboxGroup/CheckboxGroup.js.map +1 -0
  287. package/dist/components/forms/CheckboxGroup/CheckboxGroup.module.css.cjs +2 -0
  288. package/dist/components/forms/CheckboxGroup/CheckboxGroup.module.css.cjs.map +1 -0
  289. package/dist/components/forms/CheckboxGroup/CheckboxGroup.module.css.js +22 -0
  290. package/dist/components/forms/CheckboxGroup/CheckboxGroup.module.css.js.map +1 -0
  291. package/dist/components/forms/ColorPicker/ColorPicker.cjs +2 -0
  292. package/dist/components/forms/ColorPicker/ColorPicker.cjs.map +1 -0
  293. package/dist/components/forms/ColorPicker/ColorPicker.js +57 -0
  294. package/dist/components/forms/ColorPicker/ColorPicker.js.map +1 -0
  295. package/dist/components/forms/ColorPicker/ColorPicker.module.css.cjs +2 -0
  296. package/dist/components/forms/ColorPicker/ColorPicker.module.css.cjs.map +1 -0
  297. package/dist/components/forms/ColorPicker/ColorPicker.module.css.js +22 -0
  298. package/dist/components/forms/ColorPicker/ColorPicker.module.css.js.map +1 -0
  299. package/dist/components/forms/ComboBox/ComboBox.cjs.map +1 -1
  300. package/dist/components/forms/ComboBox/ComboBox.js.map +1 -1
  301. package/dist/components/forms/ComboBox/ComboBox.module.css.cjs +1 -1
  302. package/dist/components/forms/ComboBox/ComboBox.module.css.js +20 -20
  303. package/dist/components/forms/Field/Field.cjs +1 -1
  304. package/dist/components/forms/Field/Field.cjs.map +1 -1
  305. package/dist/components/forms/Field/Field.js +21 -20
  306. package/dist/components/forms/Field/Field.js.map +1 -1
  307. package/dist/components/forms/Field/Field.module.css.cjs +1 -1
  308. package/dist/components/forms/Field/Field.module.css.js +18 -12
  309. package/dist/components/forms/Field/Field.module.css.js.map +1 -1
  310. package/dist/components/forms/FileUpload/FileUpload.cjs +2 -0
  311. package/dist/components/forms/FileUpload/FileUpload.cjs.map +1 -0
  312. package/dist/components/forms/FileUpload/FileUpload.js +142 -0
  313. package/dist/components/forms/FileUpload/FileUpload.js.map +1 -0
  314. package/dist/components/forms/FileUpload/FileUpload.module.css.cjs +2 -0
  315. package/dist/components/forms/FileUpload/FileUpload.module.css.cjs.map +1 -0
  316. package/dist/components/forms/FileUpload/FileUpload.module.css.js +46 -0
  317. package/dist/components/forms/FileUpload/FileUpload.module.css.js.map +1 -0
  318. package/dist/components/forms/InputPassword/InputPassword.module.css.cjs +1 -1
  319. package/dist/components/forms/InputPassword/InputPassword.module.css.js +12 -12
  320. package/dist/components/forms/InputText/InputText.cjs +1 -1
  321. package/dist/components/forms/InputText/InputText.cjs.map +1 -1
  322. package/dist/components/forms/InputText/InputText.js +55 -47
  323. package/dist/components/forms/InputText/InputText.js.map +1 -1
  324. package/dist/components/forms/InputText/InputText.module.css.cjs +1 -1
  325. package/dist/components/forms/InputText/InputText.module.css.js +10 -10
  326. package/dist/components/forms/RadioGroup/RadioGroup.module.css.cjs +1 -1
  327. package/dist/components/forms/RadioGroup/RadioGroup.module.css.js +4 -4
  328. package/dist/components/forms/SegmentedControl/SegmentedControl.cjs +2 -0
  329. package/dist/components/forms/SegmentedControl/SegmentedControl.cjs.map +1 -0
  330. package/dist/components/forms/SegmentedControl/SegmentedControl.js +52 -0
  331. package/dist/components/forms/SegmentedControl/SegmentedControl.js.map +1 -0
  332. package/dist/components/forms/SegmentedControl/SegmentedControl.module.css.cjs +2 -0
  333. package/dist/components/forms/SegmentedControl/SegmentedControl.module.css.cjs.map +1 -0
  334. package/dist/components/forms/SegmentedControl/SegmentedControl.module.css.js +22 -0
  335. package/dist/components/forms/SegmentedControl/SegmentedControl.module.css.js.map +1 -0
  336. package/dist/components/forms/Select/Select.module.css.cjs +1 -1
  337. package/dist/components/forms/Select/Select.module.css.js +13 -13
  338. package/dist/components/forms/Switch/Switch.module.css.cjs +1 -1
  339. package/dist/components/forms/Switch/Switch.module.css.js +2 -2
  340. package/dist/components/icons/icons.cjs +1 -1
  341. package/dist/components/icons/icons.cjs.map +1 -1
  342. package/dist/components/icons/icons.js +198 -40
  343. package/dist/components/icons/icons.js.map +1 -1
  344. package/dist/components/navigation/SkipLink/SkipLink.cjs +2 -0
  345. package/dist/components/navigation/SkipLink/SkipLink.cjs.map +1 -0
  346. package/dist/components/navigation/SkipLink/SkipLink.js +9 -0
  347. package/dist/components/navigation/SkipLink/SkipLink.js.map +1 -0
  348. package/dist/components/navigation/SkipLink/SkipLink.module.css.cjs +2 -0
  349. package/dist/components/navigation/SkipLink/SkipLink.module.css.cjs.map +1 -0
  350. package/dist/components/navigation/SkipLink/SkipLink.module.css.js +8 -0
  351. package/dist/components/navigation/SkipLink/SkipLink.module.css.js.map +1 -0
  352. package/dist/components/navigation/Steps/Steps.cjs +2 -0
  353. package/dist/components/navigation/Steps/Steps.cjs.map +1 -0
  354. package/dist/components/navigation/Steps/Steps.js +30 -0
  355. package/dist/components/navigation/Steps/Steps.js.map +1 -0
  356. package/dist/components/navigation/Steps/Steps.module.css.cjs +2 -0
  357. package/dist/components/navigation/Steps/Steps.module.css.cjs.map +1 -0
  358. package/dist/components/navigation/Steps/Steps.module.css.js +26 -0
  359. package/dist/components/navigation/Steps/Steps.module.css.js.map +1 -0
  360. package/dist/components/navigation/Tabs/Tabs.cjs +1 -1
  361. package/dist/components/navigation/Tabs/Tabs.cjs.map +1 -1
  362. package/dist/components/navigation/Tabs/Tabs.js +88 -79
  363. package/dist/components/navigation/Tabs/Tabs.js.map +1 -1
  364. package/dist/components/navigation/Tabs/Tabs.module.css.cjs +1 -1
  365. package/dist/components/navigation/Tabs/Tabs.module.css.js +18 -14
  366. package/dist/components/navigation/Tabs/Tabs.module.css.js.map +1 -1
  367. package/dist/components/navigation/TabsNav/TabsNav.cjs +2 -0
  368. package/dist/components/navigation/TabsNav/TabsNav.cjs.map +1 -0
  369. package/dist/components/navigation/TabsNav/TabsNav.js +21 -0
  370. package/dist/components/navigation/TabsNav/TabsNav.js.map +1 -0
  371. package/dist/components/navigation/TabsNav/TabsNav.module.css.cjs +2 -0
  372. package/dist/components/navigation/TabsNav/TabsNav.module.css.cjs.map +1 -0
  373. package/dist/components/navigation/TabsNav/TabsNav.module.css.js +18 -0
  374. package/dist/components/navigation/TabsNav/TabsNav.module.css.js.map +1 -0
  375. package/dist/components/overlays/Dialog/Dialog.cjs +1 -1
  376. package/dist/components/overlays/Dialog/Dialog.cjs.map +1 -1
  377. package/dist/components/overlays/Dialog/Dialog.js +11 -58
  378. package/dist/components/overlays/Dialog/Dialog.js.map +1 -1
  379. package/dist/components/overlays/Dialog/DialogFrame.cjs +2 -0
  380. package/dist/components/overlays/Dialog/DialogFrame.cjs.map +1 -0
  381. package/dist/components/overlays/Dialog/DialogFrame.js +65 -0
  382. package/dist/components/overlays/Dialog/DialogFrame.js.map +1 -0
  383. package/dist/components/overlays/Drawer/Drawer.cjs +2 -0
  384. package/dist/components/overlays/Drawer/Drawer.cjs.map +1 -0
  385. package/dist/components/overlays/Drawer/Drawer.js +17 -0
  386. package/dist/components/overlays/Drawer/Drawer.js.map +1 -0
  387. package/dist/components/overlays/Drawer/Drawer.module.css.cjs +2 -0
  388. package/dist/components/overlays/Drawer/Drawer.module.css.cjs.map +1 -0
  389. package/dist/components/overlays/Drawer/Drawer.module.css.js +23 -0
  390. package/dist/components/overlays/Drawer/Drawer.module.css.js.map +1 -0
  391. package/dist/components/overlays/Menu/Menu.cjs +1 -1
  392. package/dist/components/overlays/Menu/Menu.cjs.map +1 -1
  393. package/dist/components/overlays/Menu/Menu.js +105 -86
  394. package/dist/components/overlays/Menu/Menu.js.map +1 -1
  395. package/dist/components/overlays/Menu/Menu.module.css.cjs +1 -1
  396. package/dist/components/overlays/Menu/Menu.module.css.js +24 -6
  397. package/dist/components/overlays/Menu/Menu.module.css.js.map +1 -1
  398. package/dist/design-system.css +1 -1
  399. package/dist/index.cjs +1 -1
  400. package/dist/index.js +190 -118
  401. package/dist/index.js.map +1 -1
  402. package/dist/types/components/actions/ButtonTile/ButtonTile.d.ts +14 -0
  403. package/dist/types/components/actions/ButtonTile/index.d.ts +2 -0
  404. package/dist/types/components/actions/Toolbar/Toolbar.d.ts +27 -0
  405. package/dist/types/components/actions/Toolbar/index.d.ts +2 -0
  406. package/dist/types/components/charts/ChartArea/ChartArea.d.ts +15 -4
  407. package/dist/types/components/charts/ChartBar/ChartBar.d.ts +11 -4
  408. package/dist/types/components/charts/ChartCombo/ChartCombo.d.ts +16 -4
  409. package/dist/types/components/charts/ChartDonut/ChartDonut.d.ts +5 -1
  410. package/dist/types/components/charts/ChartGauge/ChartGauge.d.ts +83 -0
  411. package/dist/types/components/charts/ChartGauge/gaugeLayout.d.ts +64 -0
  412. package/dist/types/components/charts/ChartGauge/gaugeReading.d.ts +97 -0
  413. package/dist/types/components/charts/ChartGauge/gaugeScale.d.ts +38 -0
  414. package/dist/types/components/charts/ChartGauge/index.d.ts +2 -0
  415. package/dist/types/components/charts/ChartLine/ChartLine.d.ts +15 -4
  416. package/dist/types/components/charts/ChartMap/ChartMap.d.ts +104 -0
  417. package/dist/types/components/charts/ChartMap/ChartMapLegend.d.ts +44 -0
  418. package/dist/types/components/charts/ChartMap/ChartMapTable.d.ts +38 -0
  419. package/dist/types/components/charts/ChartMap/index.d.ts +4 -0
  420. package/dist/types/components/charts/ChartMap/mapGeometry.d.ts +56 -0
  421. package/dist/types/components/charts/ChartMap/mapLabels.d.ts +51 -0
  422. package/dist/types/components/charts/ChartMap/mapScales.d.ts +76 -0
  423. package/dist/types/components/charts/ChartMap/polylabel.d.ts +9 -0
  424. package/dist/types/components/charts/ChartPie/ChartPie.d.ts +5 -1
  425. package/dist/types/components/charts/ChartRadial/ChartRadial.d.ts +5 -1
  426. package/dist/types/components/charts/ChartSankey/ChartSankey.d.ts +5 -1
  427. package/dist/types/components/charts/ChartScatter/ChartScatter.d.ts +7 -1
  428. package/dist/types/components/charts/ChartSunburst/ChartSunburst.d.ts +11 -2
  429. package/dist/types/components/charts/ChartTimeline/ChartTimeline.d.ts +137 -0
  430. package/dist/types/components/charts/ChartTimeline/ChartTimelineTable.d.ts +25 -0
  431. package/dist/types/components/charts/ChartTimeline/index.d.ts +2 -0
  432. package/dist/types/components/charts/ChartTimeline/timelineLayout.d.ts +70 -0
  433. package/dist/types/components/charts/ChartTimeline/timelineTime.d.ts +16 -0
  434. package/dist/types/components/charts/ChartTimeline/timelineTooltip.d.ts +45 -0
  435. package/dist/types/components/charts/ChartTooltip/ChartTooltip.d.ts +2 -0
  436. package/dist/types/components/charts/ChartTreemap/ChartTreemap.d.ts +11 -2
  437. package/dist/types/components/charts/ChartWaterfall/ChartWaterfall.d.ts +8 -3
  438. package/dist/types/components/charts/core/CartesianFrame.d.ts +6 -1
  439. package/dist/types/components/charts/core/ChartFrame.d.ts +7 -1
  440. package/dist/types/components/charts/core/ChartLegend.d.ts +3 -1
  441. package/dist/types/components/charts/core/PointBands.d.ts +22 -0
  442. package/dist/types/components/charts/core/cartesianLayout.d.ts +10 -4
  443. package/dist/types/components/charts/core/hoverPath.d.ts +10 -0
  444. package/dist/types/components/charts/core/index.d.ts +13 -3
  445. package/dist/types/components/charts/core/pointLabels.d.ts +13 -0
  446. package/dist/types/components/charts/core/tooltips.d.ts +49 -0
  447. package/dist/types/components/charts/core/useCartesianLayout.d.ts +20 -0
  448. package/dist/types/components/charts/core/useSeriesToggle.d.ts +15 -1
  449. package/dist/types/components/data-display/Accordion/Accordion.d.ts +6 -1
  450. package/dist/types/components/data-display/Accordion/index.d.ts +1 -1
  451. package/dist/types/components/data-display/List/List.d.ts +1 -1
  452. package/dist/types/components/data-display/List/useListing.d.ts +7 -1
  453. package/dist/types/components/data-display/SortableList/SortableList.d.ts +22 -0
  454. package/dist/types/components/data-display/SortableList/index.d.ts +2 -0
  455. package/dist/types/components/data-display/Tag/Tag.d.ts +13 -0
  456. package/dist/types/components/data-display/Tag/index.d.ts +2 -0
  457. package/dist/types/components/data-display/Timeline/Timeline.d.ts +15 -0
  458. package/dist/types/components/data-display/Timeline/index.d.ts +2 -0
  459. package/dist/types/components/feedback/Skeleton/Skeleton.d.ts +13 -0
  460. package/dist/types/components/feedback/Skeleton/index.d.ts +2 -0
  461. package/dist/types/components/feedback/Toast/ToastRegion.d.ts +2 -0
  462. package/dist/types/components/feedback/Toast/index.d.ts +3 -0
  463. package/dist/types/components/feedback/Toast/toastStore.d.ts +24 -0
  464. package/dist/types/components/forms/CheckboxGroup/CheckboxGroup.d.ts +28 -0
  465. package/dist/types/components/forms/CheckboxGroup/index.d.ts +2 -0
  466. package/dist/types/components/forms/ColorPicker/ColorPicker.d.ts +26 -0
  467. package/dist/types/components/forms/ColorPicker/index.d.ts +2 -0
  468. package/dist/types/components/forms/ComboBox/ComboBox.d.ts +7 -1
  469. package/dist/types/components/forms/Field/Field.d.ts +6 -2
  470. package/dist/types/components/forms/Field/index.d.ts +1 -1
  471. package/dist/types/components/forms/FileUpload/FileUpload.d.ts +37 -0
  472. package/dist/types/components/forms/FileUpload/index.d.ts +2 -0
  473. package/dist/types/components/forms/InputText/InputText.d.ts +4 -2
  474. package/dist/types/components/forms/SegmentedControl/SegmentedControl.d.ts +23 -0
  475. package/dist/types/components/forms/SegmentedControl/index.d.ts +2 -0
  476. package/dist/types/components/icons/icons.d.ts +29 -0
  477. package/dist/types/components/icons/index.d.ts +1 -1
  478. package/dist/types/components/navigation/SkipLink/SkipLink.d.ts +7 -0
  479. package/dist/types/components/navigation/SkipLink/index.d.ts +2 -0
  480. package/dist/types/components/navigation/Steps/Steps.d.ts +16 -0
  481. package/dist/types/components/navigation/Steps/index.d.ts +2 -0
  482. package/dist/types/components/navigation/Tabs/Tabs.d.ts +5 -1
  483. package/dist/types/components/navigation/TabsNav/TabsNav.d.ts +20 -0
  484. package/dist/types/components/navigation/TabsNav/index.d.ts +2 -0
  485. package/dist/types/components/overlays/Dialog/Dialog.d.ts +21 -9
  486. package/dist/types/components/overlays/Dialog/DialogFrame.d.ts +13 -0
  487. package/dist/types/components/overlays/Drawer/Drawer.d.ts +9 -0
  488. package/dist/types/components/overlays/Drawer/index.d.ts +2 -0
  489. package/dist/types/components/overlays/Menu/Menu.d.ts +16 -2
  490. package/dist/types/components/overlays/Menu/index.d.ts +1 -1
  491. package/dist/types/index.d.ts +43 -7
  492. package/dist/types/utils/formatters/formatarDuracao.d.ts +5 -0
  493. package/dist/types/utils/formatters/formatarNumero.d.ts +6 -1
  494. package/dist/types/utils/formatters/formatarTamanhoDeArquivo.d.ts +7 -0
  495. package/dist/types/utils/formatters/index.d.ts +4 -1
  496. package/dist/utils/formatters/formatarDuracao.cjs +2 -0
  497. package/dist/utils/formatters/formatarDuracao.cjs.map +1 -0
  498. package/dist/utils/formatters/formatarDuracao.js +10 -0
  499. package/dist/utils/formatters/formatarDuracao.js.map +1 -0
  500. package/dist/utils/formatters/formatarNumero.cjs +1 -1
  501. package/dist/utils/formatters/formatarNumero.cjs.map +1 -1
  502. package/dist/utils/formatters/formatarNumero.js +42 -17
  503. package/dist/utils/formatters/formatarNumero.js.map +1 -1
  504. package/dist/utils/formatters/formatarTamanhoDeArquivo.cjs +2 -0
  505. package/dist/utils/formatters/formatarTamanhoDeArquivo.cjs.map +1 -0
  506. package/dist/utils/formatters/formatarTamanhoDeArquivo.js +17 -0
  507. package/dist/utils/formatters/formatarTamanhoDeArquivo.js.map +1 -0
  508. package/package.json +3 -1
@@ -8,10 +8,14 @@ export interface TabItem {
8
8
  export type TabsOrientation = 'horizontal' | 'vertical';
9
9
  export interface TabsProps extends ComponentPropsWithRef<'div'> {
10
10
  defaultSelectedKey?: string;
11
+ /** O painel ocupa a altura que sobra nas abas e rola por dentro. As abas precisam de altura, dada por quem as usa. */
12
+ fillHeight?: boolean;
13
+ /** As abas dividem a largura em partes iguais, em vez de ficar do tamanho do rotulo. */
14
+ fitted?: boolean;
11
15
  items: readonly TabItem[];
12
16
  label: string;
13
17
  onSelectionChange?: (key: string) => void;
14
18
  orientation?: TabsOrientation;
15
19
  selectedKey?: string;
16
20
  }
17
- export declare function Tabs({ className, defaultSelectedKey, items, label, onSelectionChange, orientation, selectedKey, ...props }: TabsProps): import("react").JSX.Element;
21
+ export declare function Tabs({ className, defaultSelectedKey, fillHeight, fitted, items, label, onSelectionChange, orientation, selectedKey, ...props }: TabsProps): import("react").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import type { ComponentPropsWithRef, ElementType } from 'react';
2
+ export interface TabsNavItem {
3
+ href?: string;
4
+ key: string;
5
+ label: string;
6
+ /** Propriedades entregues inteiras ao componente de link, para o roteador que não usa `href`. */
7
+ linkProps?: Record<string, unknown>;
8
+ }
9
+ export interface TabsNavProps extends Omit<ComponentPropsWithRef<'nav'>, 'aria-label'> {
10
+ /** Componente de link da aplicação, para não acoplar o sistema a um roteador. */
11
+ as?: ElementType;
12
+ /** Chave da aba do endereço atual. */
13
+ current: string;
14
+ /** As abas dividem a largura em partes iguais, em vez de ficar do tamanho do rótulo. */
15
+ fitted?: boolean;
16
+ items: readonly TabsNavItem[];
17
+ label: string;
18
+ }
19
+ /** Abas que são endereços: cada uma é um link, e a da página atual leva `aria-current="page"`. */
20
+ export declare function TabsNav({ as: Link, className, current, fitted, items, label, ...props }: TabsNavProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { TabsNav } from './TabsNav.js';
2
+ export type { TabsNavItem, TabsNavProps } from './TabsNav.js';
@@ -1,19 +1,31 @@
1
- import { type ComponentPropsWithRef, type ReactNode } from 'react';
1
+ import type { ComponentPropsWithRef, ReactNode } from 'react';
2
2
  export type DialogSize = 'sm' | 'md' | 'lg';
3
3
  export type DialogRole = 'dialog' | 'alertdialog';
4
- /** As propriedades nativas vao ao elemento do dialogo; o `className` soma ao do sistema. */
5
- export interface DialogProps extends Omit<ComponentPropsWithRef<'div'>, 'children' | 'role' | 'title'> {
4
+ /** O que o `Dialog` e o `Drawer` compartilham. As propriedades nativas vao ao elemento do dialogo. */
5
+ export interface DialogBaseProps extends Omit<ComponentPropsWithRef<'div'>, 'aria-label' | 'children' | 'role' | 'title'> {
6
6
  children?: ReactNode;
7
- description?: string;
8
7
  dismissable?: boolean;
9
8
  footer?: ReactNode;
10
- /** Opcional. Desenhado ao lado do titulo, fora da leitura: quem fala e o titulo. */
11
- icon?: ReactNode;
12
9
  onClose: () => void;
13
10
  open: boolean;
11
+ }
12
+ export interface DialogTitledProps {
13
+ 'aria-label'?: never;
14
+ description?: string;
15
+ /** Opcional. Desenhado ao lado do titulo, fora da leitura: quem fala e o titulo. */
16
+ icon?: ReactNode;
17
+ title: string;
18
+ }
19
+ /** Sem titulo, sem cabecalho: o nome vem do `aria-label`, como na paleta de busca. Esc continua fechando. */
20
+ export interface DialogUntitledProps {
21
+ 'aria-label': string;
22
+ description?: never;
23
+ icon?: never;
24
+ title?: never;
25
+ }
26
+ export type DialogProps = DialogBaseProps & (DialogTitledProps | DialogUntitledProps) & {
14
27
  /** `alertdialog` para a confirmacao que interrompe e exige resposta, como a de uma acao destrutiva. */
15
28
  role?: DialogRole;
16
29
  size?: DialogSize;
17
- title: string;
18
- }
19
- export declare function Dialog({ open, ...props }: DialogProps): import("react").ReactPortal | null;
30
+ };
31
+ export declare function Dialog({ size, ...props }: DialogProps): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { DialogBaseProps, DialogRole } from './Dialog.js';
3
+ export interface DialogFrameProps extends DialogBaseProps {
4
+ 'aria-label'?: string;
5
+ description?: string;
6
+ icon?: ReactNode;
7
+ role?: DialogRole;
8
+ surfaceClassName: string;
9
+ title?: string;
10
+ underlayClassName: string;
11
+ }
12
+ /** Mecanica modal do `Dialog` e do `Drawer`: portal, foco preso, rolagem travada, cabecalho, corpo e rodape. Interna. */
13
+ export declare function DialogFrame({ open, ...props }: DialogFrameProps): import("react").ReactPortal | null;
@@ -0,0 +1,9 @@
1
+ import type { DialogBaseProps, DialogTitledProps } from '../Dialog/Dialog.js';
2
+ export type DrawerSide = 'left' | 'right';
3
+ export type DrawerSize = 'sm' | 'md' | 'lg';
4
+ export interface DrawerProps extends DialogBaseProps, Omit<DialogTitledProps, 'icon'> {
5
+ side?: DrawerSide;
6
+ size?: DrawerSize;
7
+ }
8
+ /** Painel modal preso a lateral da tela, com a mesma mecanica do `Dialog`: foco preso, Esc fecha, a pagina nao rola. */
9
+ export declare function Drawer({ side, size, ...props }: DrawerProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Drawer } from './Drawer.js';
2
+ export type { DrawerProps, DrawerSide, DrawerSize } from './Drawer.js';
@@ -1,15 +1,29 @@
1
- import { type ReactElement } from 'react';
1
+ import { type ReactElement, type ReactNode } from 'react';
2
2
  export interface MenuItem {
3
+ /** Com ele, o item e de marcar e mostra o visto quando marcado, como o tipo atual de um bloco. */
4
+ checked?: boolean;
3
5
  disabled?: boolean;
6
+ /** Icone decorativo antes do texto. */
7
+ icon?: ReactNode;
4
8
  key: string;
5
9
  label: string;
6
10
  onSelect?: () => void;
11
+ /** Atalho escrito a direita, como `Ctrl+D`, e anunciado em `aria-keyshortcuts`. */
12
+ shortcut?: string;
13
+ /** `danger` para a acao que destroi, como remover. */
14
+ tone?: 'danger';
15
+ }
16
+ /** Grupo de itens, com titulo opcional; entre dois grupos, o menu desenha o divisor. */
17
+ export interface MenuSection {
18
+ items: readonly MenuItem[];
19
+ key: string;
20
+ title?: string;
7
21
  }
8
22
  export interface MenuProps {
9
23
  children: ReactElement<Record<string, unknown>>;
10
24
  /** Abertura inicial no modo nao controlado. */
11
25
  defaultOpen?: boolean;
12
- items: readonly MenuItem[];
26
+ items: readonly (MenuItem | MenuSection)[];
13
27
  label: string;
14
28
  /** Avisa cada abertura e fechamento pedidos pelo gatilho, pelo teclado, pela opcao ou pelo clique fora. */
15
29
  onOpenChange?: (open: boolean) => void;
@@ -1,2 +1,2 @@
1
1
  export { Menu } from './Menu.js';
2
- export type { MenuProps, MenuItem } from './Menu.js';
2
+ export type { MenuItem, MenuProps, MenuSection } from './Menu.js';
@@ -1,11 +1,15 @@
1
- export { IconArrowDown, IconArrowUp, IconCalendar, IconChartBar, IconChevronDown, IconChevronExpand, IconChevronLeft, IconChevronRight, IconChevronUp, IconClock, IconClose, IconMinusCircle, IconPlusCircle, IconQuestionCircle, IconSearch, } from './components/icons/index.js';
1
+ export { IconAlignCenter, IconAlignLeft, IconAlignRight, IconArrowDown, IconArrowUp, IconBold, IconCalendar, IconChartBar, IconCheck, IconCheckCircle, IconChevronDown, IconChevronExpand, IconChevronLeft, IconChevronRight, IconChevronUp, IconClock, IconClose, IconDesktop, IconDragHandle, IconExclamationCircle, IconExclamationTriangle, IconExternalLink, IconEye, IconFile, IconFilter, IconInfoCircle, IconItalic, IconLightning, IconLink, IconMinusCircle, IconMobile, IconMore, IconPencil, IconPlus, IconPlusCircle, IconQuestionCircle, IconRedo, IconSearch, IconSidebar, IconStructure, IconTablet, IconTrash, IconUndo, IconUpload, } from './components/icons/index.js';
2
2
  export type { IconProps } from './components/icons/index.js';
3
3
  export { Button } from './components/actions/Button/index.js';
4
4
  export type { ButtonProps, ButtonSize, ButtonVariant } from './components/actions/Button/index.js';
5
5
  export { ButtonIcon } from './components/actions/ButtonIcon/index.js';
6
+ export { ButtonTile } from './components/actions/ButtonTile/index.js';
7
+ export type { ButtonTileProps, ButtonTileSize } from './components/actions/ButtonTile/index.js';
8
+ export { Toolbar } from './components/actions/Toolbar/index.js';
9
+ export type { ToolbarAppearance, ToolbarGroupProps, ToolbarOrientation, ToolbarPlacement, ToolbarProps, } from './components/actions/Toolbar/index.js';
6
10
  export type { ButtonIconProps } from './components/actions/ButtonIcon/index.js';
7
11
  export { Field } from './components/forms/Field/index.js';
8
- export type { FieldProps, FieldWiring } from './components/forms/Field/index.js';
12
+ export type { FieldProps, FieldSize, FieldWiring } from './components/forms/Field/index.js';
9
13
  export { Label } from './components/forms/Label/index.js';
10
14
  export type { LabelProps } from './components/forms/Label/index.js';
11
15
  export { InputText } from './components/forms/InputText/index.js';
@@ -19,9 +23,17 @@ export type { InputCurrencyProps } from './components/forms/InputCurrency/index.
19
23
  export { Textarea } from './components/forms/Textarea/index.js';
20
24
  export type { TextareaProps, TextareaSize } from './components/forms/Textarea/index.js';
21
25
  export { Checkbox } from './components/forms/Checkbox/index.js';
26
+ export { CheckboxGroup } from './components/forms/CheckboxGroup/index.js';
27
+ export type { CheckboxGroupOrientation, CheckboxGroupProps } from './components/forms/CheckboxGroup/index.js';
28
+ export { ColorPicker } from './components/forms/ColorPicker/index.js';
29
+ export type { ColorPickerOption, ColorPickerProps, ColorPickerSize } from './components/forms/ColorPicker/index.js';
30
+ export { FileUpload } from './components/forms/FileUpload/index.js';
31
+ export type { FileRejection, FileRejectionReason, FileUploadItem, FileUploadProps, FileUploadStatus, } from './components/forms/FileUpload/index.js';
22
32
  export type { CheckboxProps } from './components/forms/Checkbox/index.js';
23
33
  export { RadioGroup, Radio } from './components/forms/RadioGroup/index.js';
24
34
  export type { RadioGroupProps, RadioProps } from './components/forms/RadioGroup/index.js';
35
+ export { SegmentedControl } from './components/forms/SegmentedControl/index.js';
36
+ export type { SegmentedControlItem, SegmentedControlProps, SegmentedControlSize, } from './components/forms/SegmentedControl/index.js';
25
37
  export { Switch } from './components/forms/Switch/index.js';
26
38
  export type { SwitchProps } from './components/forms/Switch/index.js';
27
39
  export { Alert } from './components/feedback/Alert/index.js';
@@ -32,28 +44,42 @@ export { Spinner } from './components/feedback/Spinner/index.js';
32
44
  export type { SpinnerProps, SpinnerSize } from './components/feedback/Spinner/index.js';
33
45
  export { EmptyState } from './components/feedback/EmptyState/index.js';
34
46
  export type { EmptyStateProps, EmptyStateSize, EmptyStateTone } from './components/feedback/EmptyState/index.js';
47
+ export { Skeleton } from './components/feedback/Skeleton/index.js';
48
+ export type { SkeletonProps, SkeletonShape } from './components/feedback/Skeleton/index.js';
49
+ export { ToastRegion, dismissToast, showToast } from './components/feedback/Toast/index.js';
50
+ export type { ToastAction, ToastOptions, ToastTone } from './components/feedback/Toast/index.js';
35
51
  export { Popover } from './components/overlays/Popover/index.js';
36
52
  export type { PopoverProps, PopoverPlacement } from './components/overlays/Popover/index.js';
37
53
  export { Tabs } from './components/navigation/Tabs/index.js';
38
54
  export type { TabsProps, TabItem, TabsOrientation } from './components/navigation/Tabs/index.js';
55
+ export { TabsNav } from './components/navigation/TabsNav/index.js';
56
+ export type { TabsNavItem, TabsNavProps } from './components/navigation/TabsNav/index.js';
39
57
  export { Breadcrumb } from './components/navigation/Breadcrumb/index.js';
40
58
  export type { BreadcrumbProps, BreadcrumbItem } from './components/navigation/Breadcrumb/index.js';
41
59
  export { Pagination } from './components/navigation/Pagination/index.js';
42
60
  export type { PaginationProps } from './components/navigation/Pagination/index.js';
61
+ export { SkipLink } from './components/navigation/SkipLink/index.js';
62
+ export type { SkipLinkProps } from './components/navigation/SkipLink/index.js';
63
+ export { Steps } from './components/navigation/Steps/index.js';
64
+ export type { StepItem, StepsProps } from './components/navigation/Steps/index.js';
43
65
  export { Accordion } from './components/data-display/Accordion/index.js';
44
- export type { AccordionProps, AccordionItem, AccordionIconPosition } from './components/data-display/Accordion/index.js';
66
+ export type { AccordionHeadingLevel, AccordionProps, AccordionItem, AccordionIconPosition } from './components/data-display/Accordion/index.js';
45
67
  export { Select } from './components/forms/Select/index.js';
46
68
  export type { SelectProps, SelectOption, SelectSize } from './components/forms/Select/index.js';
47
69
  export { ComboBox } from './components/forms/ComboBox/index.js';
48
70
  export type { ComboBoxMultipleProps, ComboBoxOption, ComboBoxProps, ComboBoxSingleProps, ComboBoxSize, } from './components/forms/ComboBox/index.js';
49
71
  export { Menu } from './components/overlays/Menu/index.js';
50
- export type { MenuProps, MenuItem } from './components/overlays/Menu/index.js';
72
+ export type { MenuItem, MenuProps, MenuSection } from './components/overlays/Menu/index.js';
51
73
  export { Tooltip } from './components/overlays/Tooltip/index.js';
52
74
  export type { TooltipProps, TooltipPlacement } from './components/overlays/Tooltip/index.js';
53
75
  export { Dialog } from './components/overlays/Dialog/index.js';
54
76
  export type { DialogProps, DialogRole, DialogSize } from './components/overlays/Dialog/index.js';
77
+ export { Drawer } from './components/overlays/Drawer/index.js';
78
+ export type { DrawerProps, DrawerSide, DrawerSize } from './components/overlays/Drawer/index.js';
55
79
  export { Badge } from './components/data-display/Badge/index.js';
56
80
  export type { BadgeProps, BadgeTone } from './components/data-display/Badge/index.js';
81
+ export { Tag } from './components/data-display/Tag/index.js';
82
+ export type { TagProps, TagSize } from './components/data-display/Tag/index.js';
57
83
  export { Avatar } from './components/data-display/Avatar/index.js';
58
84
  export type { AvatarProps, AvatarSize } from './components/data-display/Avatar/index.js';
59
85
  export { List } from './components/data-display/List/index.js';
@@ -61,6 +87,10 @@ export type { ListEmptyProps, ListItem, ListOptionsProps, ListProps, ListSearchP
61
87
  export { Card } from './components/data-display/Card/index.js';
62
88
  export type { CardBodyProps, CardFooterProps, CardHeaderProps, CardHeadingLevel, CardProps, } from './components/data-display/Card/index.js';
63
89
  export { CodeBlock } from './components/data-display/CodeBlock/index.js';
90
+ export { SortableList } from './components/data-display/SortableList/index.js';
91
+ export type { SortableListItem, SortableListProps } from './components/data-display/SortableList/index.js';
92
+ export { Timeline } from './components/data-display/Timeline/index.js';
93
+ export type { TimelineItem, TimelineProps } from './components/data-display/Timeline/index.js';
64
94
  export type { CodeBlockProps, CodeSyntax } from './components/data-display/CodeBlock/index.js';
65
95
  export { Table } from './components/data-display/Table/index.js';
66
96
  export type { SortDirection, TableAlign, TableBodyProps, TableBreakpoint, TableCellProps, TableColumnProps, TableHeaderProps, TableProps, TableRowItem, TableRowProps, TableSelectionControl, TableSelectionMode, TableSize, TableSort, } from './components/data-display/Table/index.js';
@@ -70,12 +100,18 @@ export { TimePicker } from './components/forms/TimePicker/index.js';
70
100
  export type { TimePickerProps, TimePickerSize } from './components/forms/TimePicker/index.js';
71
101
  export { DateTimePicker } from './components/forms/DateTimePicker/index.js';
72
102
  export type { DateTimePickerProps, DateTimePickerSize } from './components/forms/DateTimePicker/index.js';
73
- export { formatarData, formatarHora, formatarMoeda, formatarNumero, formatarPercentual, } from './utils/formatters/index.js';
74
- export type { OpcoesDeData, OpcoesDeHora, OpcoesDeMoeda, OpcoesDeNumero, OpcoesDePercentual, } from './utils/formatters/index.js';
103
+ export { formatarData, formatarDuracao, formatarHora, formatarMoeda, formatarNumero, formatarPercentual, formatarTamanhoDeArquivo, } from './utils/formatters/index.js';
104
+ export type { Compacto, OpcoesDeData, OpcoesDeHora, OpcoesDeMoeda, OpcoesDeNumero, OpcoesDePercentual, OpcoesDeTamanhoDeArquivo, } from './utils/formatters/index.js';
75
105
  export { ChartBar } from './components/charts/ChartBar/index.js';
76
106
  export type { ChartBarOrientation, ChartBarProps, ChartBarSeries } from './components/charts/ChartBar/index.js';
77
107
  export { ChartLine } from './components/charts/ChartLine/index.js';
78
108
  export type { ChartLineProps, ChartLineSeries } from './components/charts/ChartLine/index.js';
109
+ export { ChartGauge } from './components/charts/ChartGauge/index.js';
110
+ export type { ChartGaugeDelta, ChartGaugeIndicator, ChartGaugeProps, ChartGaugeScaleLabels, ChartGaugeSegment, ChartGaugeSegmentStyle, ChartGaugeSegmentUnit, ChartGaugeSize, ChartGaugeTarget, ChartGaugeTicks, ChartGaugeValueDisplay, } from './components/charts/ChartGauge/index.js';
111
+ export { ChartMap } from './components/charts/ChartMap/index.js';
112
+ export type { ChartMapCategory, ChartMapColorScale, ChartMapFeature, ChartMapFeatureCollection, ChartMapLegendPosition, ChartMapMarker, ChartMapMarkerEvent, ChartMapMarkerSeries, ChartMapProps, ChartMapRegion, ChartMapRegionDatum, } from './components/charts/ChartMap/index.js';
113
+ export { ChartTimeline } from './components/charts/ChartTimeline/index.js';
114
+ export type { ChartTimelineBand, ChartTimelineDensity, ChartTimelineGroup, ChartTimelineLabelAlign, ChartTimelineMarker, ChartTimelineMarkerShape, ChartTimelineOverlap, ChartTimelineProps, ChartTimelineReferenceLine, ChartTimelineRow, ChartTimelineRowBand, ChartTimelineScale, ChartTimelineSegment, ChartTimelineSegmentLabelContent, ChartTimelineSegmentLabels, ChartTimelineSeries, ChartTimelineState, ChartTimelineSummary, ChartTimelineTime, } from './components/charts/ChartTimeline/index.js';
79
115
  export { ChartTooltip } from './components/charts/ChartTooltip/index.js';
80
116
  export type { ChartTooltipColumn, ChartTooltipComputed, ChartTooltipProps, ChartTooltipRow, ChartTooltipTotal, } from './components/charts/ChartTooltip/index.js';
81
117
  export { ChartCombo } from './components/charts/ChartCombo/index.js';
@@ -98,6 +134,6 @@ export { ChartSunburst } from './components/charts/ChartSunburst/index.js';
98
134
  export type { ChartSunburstNode, ChartSunburstProps } from './components/charts/ChartSunburst/index.js';
99
135
  export { ChartSankey } from './components/charts/ChartSankey/index.js';
100
136
  export type { ChartSankeyAlign, ChartSankeyFlow, ChartSankeyFlowColor, ChartSankeyFlowValuePosition, ChartSankeyNode, ChartSankeyProps, } from './components/charts/ChartSankey/index.js';
101
- export type { AxisLabelAngle, AxisLabelRotation, AxisVisibility, ChartCurve, ChartHeight, ChartLegendAlign, ChartLegendPosition, } from './components/charts/core/index.js';
137
+ export type { AxisLabelAngle, AxisLabelRotation, AxisVisibility, ChartCurve, ChartHeight, ChartHoveredNode, ChartLegendAlign, ChartLegendPosition, MarkVisibility, } from './components/charts/core/index.js';
102
138
  export { paletteWithAccent, resolveSeriesColors, seriesColors } from './components/charts/palette/index.js';
103
139
  export type { SeriesAppearance, SeriesIntent } from './components/charts/palette/index.js';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Duracao em horas e minutos, arredondada ao minuto: `10h16m`, `1h05m`, `48m`, `12h`. Recebe milissegundos.
3
+ * Duracao em dias fica com quem a exibe: um prazo de projeto e lido em dias, uma jornada nao.
4
+ */
5
+ export declare function formatarDuracao(milissegundos: number): string;
@@ -1,7 +1,12 @@
1
+ /**
2
+ * `true` compacta na forma da localidade: em pt-BR, `500 mil` e `1,5 mi`. `'sigla'` usa as siglas
3
+ * `k`, `M`, `B` e `T` — `500 k`, `1,5 M` —, com a virgula e o milhar da localidade.
4
+ */
5
+ export type Compacto = boolean | 'sigla';
1
6
  export interface OpcoesDeNumero {
2
7
  /** Sem declarar, quem decide e a localidade — e, na moeda, a propria moeda. */
3
8
  casasDecimais?: number;
4
- compacto?: boolean;
9
+ compacto?: Compacto;
5
10
  localidade?: string;
6
11
  }
7
12
  export interface OpcoesDeMoeda extends OpcoesDeNumero {
@@ -0,0 +1,7 @@
1
+ export interface OpcoesDeTamanhoDeArquivo {
2
+ /** Sem declarar, ate uma casa: `24,6 MB` e `512 KB`. Bytes saem sempre inteiros. */
3
+ casasDecimais?: number;
4
+ localidade?: string;
5
+ }
6
+ /** Tamanho de arquivo em base 1024, com os separadores da localidade: `950 B`, `512 KB`, `1,2 GB`. */
7
+ export declare function formatarTamanhoDeArquivo(bytes: number, { casasDecimais, localidade }?: OpcoesDeTamanhoDeArquivo): string;
@@ -1,8 +1,11 @@
1
1
  export { formatarEdicaoDecimal, formatarEntradaDecimal } from './formatarEntradaDecimal.js';
2
2
  export { formatarEntradaMonetaria } from './formatarEntradaMonetaria.js';
3
3
  export { formatarData, formatarHora } from './formatarData.js';
4
+ export { formatarDuracao } from './formatarDuracao.js';
4
5
  export type { OpcoesDeData, OpcoesDeHora } from './formatarData.js';
5
6
  export { formatarMoeda, formatarNumero, formatarPercentual } from './formatarNumero.js';
6
- export type { OpcoesDeMoeda, OpcoesDeNumero, OpcoesDePercentual } from './formatarNumero.js';
7
+ export type { Compacto, OpcoesDeMoeda, OpcoesDeNumero, OpcoesDePercentual } from './formatarNumero.js';
8
+ export { formatarTamanhoDeArquivo } from './formatarTamanhoDeArquivo.js';
9
+ export type { OpcoesDeTamanhoDeArquivo } from './formatarTamanhoDeArquivo.js';
7
10
  export { formatarEntradaData, lerEntradaData } from './formatarEntradaData.js';
8
11
  export { formatarEntradaDataHora, formatarEntradaHora, lerEntradaDataHora, lerEntradaHora } from './formatarEntradaHora.js';
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=6e4;function e(t){if(!Number.isFinite(t)||t<0)return"";const a=Math.round(t/n),r=Math.floor(a/60),o=a%60;return r===0?`${o}m`:o===0?`${r}h`:`${r}h${String(o).padStart(2,"0")}m`}exports.formatarDuracao=e;
2
+ //# sourceMappingURL=formatarDuracao.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatarDuracao.cjs","sources":["../../../src/utils/formatters/formatarDuracao.ts"],"sourcesContent":["const MINUTO = 60_000;\n\n/**\n * Duracao em horas e minutos, arredondada ao minuto: `10h16m`, `1h05m`, `48m`, `12h`. Recebe milissegundos.\n * Duracao em dias fica com quem a exibe: um prazo de projeto e lido em dias, uma jornada nao.\n */\nexport function formatarDuracao(milissegundos: number) {\n if (!Number.isFinite(milissegundos) || milissegundos < 0) {\n return '';\n }\n\n const minutos = Math.round(milissegundos / MINUTO);\n const horas = Math.floor(minutos / 60);\n const resto = minutos % 60;\n\n if (horas === 0) {\n return `${resto}m`;\n }\n\n return resto === 0 ? `${horas}h` : `${horas}h${String(resto).padStart(2, '0')}m`;\n}\n"],"names":["MINUTO","formatarDuracao","milissegundos","minutos","horas","resto"],"mappings":"gFAAA,MAAMA,EAAS,IAMR,SAASC,EAAgBC,EAAuB,CACrD,GAAI,CAAC,OAAO,SAASA,CAAa,GAAKA,EAAgB,EACrD,MAAO,GAGT,MAAMC,EAAU,KAAK,MAAMD,EAAgBF,CAAM,EAC3CI,EAAQ,KAAK,MAAMD,EAAU,EAAE,EAC/BE,EAAQF,EAAU,GAExB,OAAIC,IAAU,EACL,GAAGC,CAAK,IAGVA,IAAU,EAAI,GAAGD,CAAK,IAAM,GAAGA,CAAK,IAAI,OAAOC,CAAK,EAAE,SAAS,EAAG,GAAG,CAAC,GAC/E"}
@@ -0,0 +1,10 @@
1
+ function a(t) {
2
+ if (!Number.isFinite(t) || t < 0)
3
+ return "";
4
+ const n = Math.round(t / 6e4), r = Math.floor(n / 60), o = n % 60;
5
+ return r === 0 ? `${o}m` : o === 0 ? `${r}h` : `${r}h${String(o).padStart(2, "0")}m`;
6
+ }
7
+ export {
8
+ a as formatarDuracao
9
+ };
10
+ //# sourceMappingURL=formatarDuracao.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatarDuracao.js","sources":["../../../src/utils/formatters/formatarDuracao.ts"],"sourcesContent":["const MINUTO = 60_000;\n\n/**\n * Duracao em horas e minutos, arredondada ao minuto: `10h16m`, `1h05m`, `48m`, `12h`. Recebe milissegundos.\n * Duracao em dias fica com quem a exibe: um prazo de projeto e lido em dias, uma jornada nao.\n */\nexport function formatarDuracao(milissegundos: number) {\n if (!Number.isFinite(milissegundos) || milissegundos < 0) {\n return '';\n }\n\n const minutos = Math.round(milissegundos / MINUTO);\n const horas = Math.floor(minutos / 60);\n const resto = minutos % 60;\n\n if (horas === 0) {\n return `${resto}m`;\n }\n\n return resto === 0 ? `${horas}h` : `${horas}h${String(resto).padStart(2, '0')}m`;\n}\n"],"names":["formatarDuracao","milissegundos","minutos","horas","resto"],"mappings":"AAMO,SAASA,EAAgBC,GAAuB;AACrD,MAAI,CAAC,OAAO,SAASA,CAAa,KAAKA,IAAgB;AACrD,WAAO;AAGT,QAAMC,IAAU,KAAK,MAAMD,IAAgB,GAAM,GAC3CE,IAAQ,KAAK,MAAMD,IAAU,EAAE,GAC/BE,IAAQF,IAAU;AAExB,SAAIC,MAAU,IACL,GAAGC,CAAK,MAGVA,MAAU,IAAI,GAAGD,CAAK,MAAM,GAAGA,CAAK,IAAI,OAAOC,CAAK,EAAE,SAAS,GAAG,GAAG,CAAC;AAC/E;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function o(t){return t===void 0?{}:{maximumFractionDigits:t,minimumFractionDigits:t}}function u(t){return t?{compactDisplay:"short",notation:"compact"}:{}}const i={signDisplay:"negative"};function m(t,{casasDecimais:r,compacto:n,localidade:e="pt-BR"}={}){return Number.isFinite(t)?new Intl.NumberFormat(e,{...i,...u(n),...o(r)}).format(t):""}function c(t,{casasDecimais:r,compacto:n,localidade:e="pt-BR",moeda:a="BRL"}={}){return Number.isFinite(t)?new Intl.NumberFormat(e,{...i,currency:a,style:"currency",...u(n),...o(r)}).format(t):""}function f(t,{casasDecimais:r=0,localidade:n="pt-BR"}={}){return Number.isFinite(t)?new Intl.NumberFormat(n,{...i,style:"percent",...o(r)}).format(t):""}exports.formatarMoeda=c;exports.formatarNumero=m;exports.formatarPercentual=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function c(t){return t===void 0?{}:{maximumFractionDigits:t,minimumFractionDigits:t}}function g(t){return t===!0?{compactDisplay:"short",notation:"compact"}:{}}const f=[[1e12,"T"],[1e9,"B"],[1e6,"M"],[1e3,"k"]];function F(t,n,e){let r=f.findIndex(([i])=>Math.abs(t)>=i);for(;;){const[i,o]=r>=0?f[r]:[1,""],u=t/i,a=n??(Math.abs(u)<10?1:0),l=Math.round(Math.abs(u)*10**a)/10**a,s=r===-1?f.length-1:r-1;if(l<1e3||s<0){const b=e(u,{maximumFractionDigits:a,minimumFractionDigits:n??0});return o?`${b} ${o}`:b}r=s}}const m={signDisplay:"negative"};function y(t,{casasDecimais:n,compacto:e,localidade:r="pt-BR"}={}){return Number.isFinite(t)?e==="sigla"?F(t,n,(i,o)=>new Intl.NumberFormat(r,{...m,...o}).format(i)):new Intl.NumberFormat(r,{...m,...g(e),...c(n)}).format(t):""}function N(t,{casasDecimais:n,compacto:e,localidade:r="pt-BR",moeda:i="BRL"}={}){return Number.isFinite(t)?e==="sigla"?F(t,n,(o,u)=>new Intl.NumberFormat(r,{...m,currency:i,style:"currency",...u}).format(o)):new Intl.NumberFormat(r,{...m,currency:i,style:"currency",...g(e),...c(n)}).format(t):""}function d(t,{casasDecimais:n=0,localidade:e="pt-BR"}={}){return Number.isFinite(t)?new Intl.NumberFormat(e,{...m,style:"percent",...c(n)}).format(t):""}exports.formatarMoeda=N;exports.formatarNumero=y;exports.formatarPercentual=d;
2
2
  //# sourceMappingURL=formatarNumero.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatarNumero.cjs","sources":["../../../src/utils/formatters/formatarNumero.ts"],"sourcesContent":["export interface OpcoesDeNumero {\n /** Sem declarar, quem decide e a localidade — e, na moeda, a propria moeda. */\n casasDecimais?: number;\n compacto?: boolean;\n localidade?: string;\n}\n\nexport interface OpcoesDeMoeda extends OpcoesDeNumero {\n moeda?: string;\n}\n\nexport interface OpcoesDePercentual {\n casasDecimais?: number;\n localidade?: string;\n}\n\nfunction casas(casasDecimais?: number) {\n return casasDecimais === undefined\n ? {}\n : { maximumFractionDigits: casasDecimais, minimumFractionDigits: casasDecimais };\n}\n\n/**\n * A forma compacta sai da localidade, e nao de um sufixo proprio: em pt-BR um\n * milhao e `1 mi`, nao `1M`. Inventar o sufixo quebraria em qualquer outra.\n */\nfunction notacao(compacto?: boolean) {\n return compacto ? ({ compactDisplay: 'short', notation: 'compact' } as const) : {};\n}\n\n/** Sinal so no negativo de fato: `-0`, e o que arredonda para zero, saiam como `-0`. */\nconst SINAL = { signDisplay: 'negative' } as const;\n\nexport function formatarNumero(\n valor: number,\n { casasDecimais, compacto, localidade = 'pt-BR' }: OpcoesDeNumero = {},\n) {\n if (!Number.isFinite(valor)) {\n return '';\n }\n\n return new Intl.NumberFormat(localidade, { ...SINAL, ...notacao(compacto), ...casas(casasDecimais) }).format(valor);\n}\n\n/**\n * Valor monetario. O separador entre simbolo e numero e um espaco nao\n * separavel, escolha do `Intl`: ele impede que a quebra de linha afaste o\n * simbolo do valor. As mascaras de entrada usam espaco comum, e a convergencia\n * das duas ainda esta em aberto.\n */\nexport function formatarMoeda(\n valor: number,\n { casasDecimais, compacto, localidade = 'pt-BR', moeda = 'BRL' }: OpcoesDeMoeda = {},\n) {\n if (!Number.isFinite(valor)) {\n return '';\n }\n\n return new Intl.NumberFormat(localidade, {\n ...SINAL,\n currency: moeda,\n style: 'currency',\n ...notacao(compacto),\n ...casas(casasDecimais),\n }).format(valor);\n}\n\n/**\n * Percentual a partir da **fracao**: `0.42` vira `42%`. Receber o numero ja\n * multiplicado obrigaria cada consumidor a dividir antes de exibir, e e a\n * fracao que sai de uma divisao de duas medidas.\n */\nexport function formatarPercentual(\n valor: number,\n { casasDecimais = 0, localidade = 'pt-BR' }: OpcoesDePercentual = {},\n) {\n if (!Number.isFinite(valor)) {\n return '';\n }\n\n return new Intl.NumberFormat(localidade, { ...SINAL, style: 'percent', ...casas(casasDecimais) }).format(valor);\n}\n"],"names":["casas","casasDecimais","notacao","compacto","SINAL","formatarNumero","valor","localidade","formatarMoeda","moeda","formatarPercentual"],"mappings":"gFAgBA,SAASA,EAAMC,EAAwB,CACrC,OAAOA,IAAkB,OACrB,CAAA,EACA,CAAE,sBAAuBA,EAAe,sBAAuBA,CAAA,CACrE,CAMA,SAASC,EAAQC,EAAoB,CACnC,OAAOA,EAAY,CAAE,eAAgB,QAAS,SAAU,SAAA,EAAwB,CAAA,CAClF,CAGA,MAAMC,EAAQ,CAAE,YAAa,UAAA,EAEtB,SAASC,EACdC,EACA,CAAE,cAAAL,EAAe,SAAAE,EAAU,WAAAI,EAAa,OAAA,EAA4B,GACpE,CACA,OAAK,OAAO,SAASD,CAAK,EAInB,IAAI,KAAK,aAAaC,EAAY,CAAE,GAAGH,EAAO,GAAGF,EAAQC,CAAQ,EAAG,GAAGH,EAAMC,CAAa,EAAG,EAAE,OAAOK,CAAK,EAHzG,EAIX,CAQO,SAASE,EACdF,EACA,CAAE,cAAAL,EAAe,SAAAE,EAAU,WAAAI,EAAa,QAAS,MAAAE,EAAQ,KAAA,EAAyB,GAClF,CACA,OAAK,OAAO,SAASH,CAAK,EAInB,IAAI,KAAK,aAAaC,EAAY,CACvC,GAAGH,EACH,SAAUK,EACV,MAAO,WACP,GAAGP,EAAQC,CAAQ,EACnB,GAAGH,EAAMC,CAAa,CAAA,CACvB,EAAE,OAAOK,CAAK,EATN,EAUX,CAOO,SAASI,EACdJ,EACA,CAAE,cAAAL,EAAgB,EAAG,WAAAM,EAAa,OAAA,EAAgC,GAClE,CACA,OAAK,OAAO,SAASD,CAAK,EAInB,IAAI,KAAK,aAAaC,EAAY,CAAE,GAAGH,EAAO,MAAO,UAAW,GAAGJ,EAAMC,CAAa,CAAA,CAAG,EAAE,OAAOK,CAAK,EAHrG,EAIX"}
1
+ {"version":3,"file":"formatarNumero.cjs","sources":["../../../src/utils/formatters/formatarNumero.ts"],"sourcesContent":["/**\n * `true` compacta na forma da localidade: em pt-BR, `500 mil` e `1,5 mi`. `'sigla'` usa as siglas\n * `k`, `M`, `B` e `T` — `500 k`, `1,5 M` —, com a virgula e o milhar da localidade.\n */\nexport type Compacto = boolean | 'sigla';\n\nexport interface OpcoesDeNumero {\n /** Sem declarar, quem decide e a localidade — e, na moeda, a propria moeda. */\n casasDecimais?: number;\n compacto?: Compacto;\n localidade?: string;\n}\n\nexport interface OpcoesDeMoeda extends OpcoesDeNumero {\n moeda?: string;\n}\n\nexport interface OpcoesDePercentual {\n casasDecimais?: number;\n localidade?: string;\n}\n\nfunction casas(casasDecimais?: number) {\n return casasDecimais === undefined\n ? {}\n : { maximumFractionDigits: casasDecimais, minimumFractionDigits: casasDecimais };\n}\n\n/**\n * A forma compacta padrao sai da localidade, e nao de um sufixo proprio: em pt-BR um\n * milhao e `1 mi`, nao `1M`. A sigla e outra escolha, pedida por nome.\n */\nfunction notacao(compacto?: Compacto) {\n return compacto === true ? ({ compactDisplay: 'short', notation: 'compact' } as const) : {};\n}\n\n/** Da maior para a menor; abaixo de mil, o valor sai sem sigla. */\nconst SIGLAS = [\n [1e12, 'T'],\n [1e9, 'B'],\n [1e6, 'M'],\n [1e3, 'k'],\n] as const;\n\ntype FormatarReduzido = (reduzido: number, digitos: Intl.NumberFormatOptions) => string;\n\n/**\n * Valor reduzido a sigla. Sem casas declaradas, uma casa abaixo de 10 e nenhuma acima, como a forma\n * compacta da localidade; o que arredonda para mil da sigla sobe para a seguinte: `999.950` e `1 M`.\n */\nfunction comSigla(valor: number, casasDecimais: number | undefined, formatarReduzido: FormatarReduzido) {\n let indice = SIGLAS.findIndex(([base]) => Math.abs(valor) >= base);\n\n for (;;) {\n const [base, sigla] = indice >= 0 ? SIGLAS[indice] : [1, ''];\n const reduzido = valor / base;\n const digitos = casasDecimais ?? (Math.abs(reduzido) < 10 ? 1 : 0);\n const arredondado = Math.round(Math.abs(reduzido) * 10 ** digitos) / 10 ** digitos;\n const maior = indice === -1 ? SIGLAS.length - 1 : indice - 1;\n\n if (arredondado < 1000 || maior < 0) {\n const texto = formatarReduzido(reduzido, { maximumFractionDigits: digitos, minimumFractionDigits: casasDecimais ?? 0 });\n return sigla ? `${texto} ${sigla}` : texto;\n }\n\n indice = maior;\n }\n}\n\n/** Sinal so no negativo de fato: `-0`, e o que arredonda para zero, saiam como `-0`. */\nconst SINAL = { signDisplay: 'negative' } as const;\n\nexport function formatarNumero(\n valor: number,\n { casasDecimais, compacto, localidade = 'pt-BR' }: OpcoesDeNumero = {},\n) {\n if (!Number.isFinite(valor)) {\n return '';\n }\n\n if (compacto === 'sigla') {\n return comSigla(valor, casasDecimais, (reduzido, digitos) =>\n new Intl.NumberFormat(localidade, { ...SINAL, ...digitos }).format(reduzido),\n );\n }\n\n return new Intl.NumberFormat(localidade, { ...SINAL, ...notacao(compacto), ...casas(casasDecimais) }).format(valor);\n}\n\n/**\n * Valor monetario. O separador entre simbolo e numero e um espaco nao\n * separavel, escolha do `Intl`: ele impede que a quebra de linha afaste o\n * simbolo do valor. As mascaras de entrada usam espaco comum, e a convergencia\n * das duas ainda esta em aberto.\n */\nexport function formatarMoeda(\n valor: number,\n { casasDecimais, compacto, localidade = 'pt-BR', moeda = 'BRL' }: OpcoesDeMoeda = {},\n) {\n if (!Number.isFinite(valor)) {\n return '';\n }\n\n if (compacto === 'sigla') {\n return comSigla(valor, casasDecimais, (reduzido, digitos) =>\n new Intl.NumberFormat(localidade, { ...SINAL, currency: moeda, style: 'currency', ...digitos }).format(reduzido),\n );\n }\n\n return new Intl.NumberFormat(localidade, {\n ...SINAL,\n currency: moeda,\n style: 'currency',\n ...notacao(compacto),\n ...casas(casasDecimais),\n }).format(valor);\n}\n\n/**\n * Percentual a partir da **fracao**: `0.42` vira `42%`. Receber o numero ja\n * multiplicado obrigaria cada consumidor a dividir antes de exibir, e e a\n * fracao que sai de uma divisao de duas medidas.\n */\nexport function formatarPercentual(\n valor: number,\n { casasDecimais = 0, localidade = 'pt-BR' }: OpcoesDePercentual = {},\n) {\n if (!Number.isFinite(valor)) {\n return '';\n }\n\n return new Intl.NumberFormat(localidade, { ...SINAL, style: 'percent', ...casas(casasDecimais) }).format(valor);\n}\n"],"names":["casas","casasDecimais","notacao","compacto","SIGLAS","comSigla","valor","formatarReduzido","indice","base","sigla","reduzido","digitos","arredondado","maior","texto","SINAL","formatarNumero","localidade","formatarMoeda","moeda","formatarPercentual"],"mappings":"gFAsBA,SAASA,EAAMC,EAAwB,CACrC,OAAOA,IAAkB,OACrB,CAAA,EACA,CAAE,sBAAuBA,EAAe,sBAAuBA,CAAA,CACrE,CAMA,SAASC,EAAQC,EAAqB,CACpC,OAAOA,IAAa,GAAQ,CAAE,eAAgB,QAAS,SAAU,SAAA,EAAwB,CAAA,CAC3F,CAGA,MAAMC,EAAS,CACb,CAAC,KAAM,GAAG,EACV,CAAC,IAAK,GAAG,EACT,CAAC,IAAK,GAAG,EACT,CAAC,IAAK,GAAG,CACX,EAQA,SAASC,EAASC,EAAeL,EAAmCM,EAAoC,CACtG,IAAIC,EAASJ,EAAO,UAAU,CAAC,CAACK,CAAI,IAAM,KAAK,IAAIH,CAAK,GAAKG,CAAI,EAEjE,OAAS,CACP,KAAM,CAACA,EAAMC,CAAK,EAAIF,GAAU,EAAIJ,EAAOI,CAAM,EAAI,CAAC,EAAG,EAAE,EACrDG,EAAWL,EAAQG,EACnBG,EAAUX,IAAkB,KAAK,IAAIU,CAAQ,EAAI,GAAK,EAAI,GAC1DE,EAAc,KAAK,MAAM,KAAK,IAAIF,CAAQ,EAAI,IAAMC,CAAO,EAAI,IAAMA,EACrEE,EAAQN,IAAW,GAAKJ,EAAO,OAAS,EAAII,EAAS,EAE3D,GAAIK,EAAc,KAAQC,EAAQ,EAAG,CACnC,MAAMC,EAAQR,EAAiBI,EAAU,CAAE,sBAAuBC,EAAS,sBAAuBX,GAAiB,EAAG,EACtH,OAAOS,EAAQ,GAAGK,CAAK,IAAIL,CAAK,GAAKK,CACvC,CAEAP,EAASM,CACX,CACF,CAGA,MAAME,EAAQ,CAAE,YAAa,UAAA,EAEtB,SAASC,EACdX,EACA,CAAE,cAAAL,EAAe,SAAAE,EAAU,WAAAe,EAAa,OAAA,EAA4B,GACpE,CACA,OAAK,OAAO,SAASZ,CAAK,EAItBH,IAAa,QACRE,EAASC,EAAOL,EAAe,CAACU,EAAUC,IAC/C,IAAI,KAAK,aAAaM,EAAY,CAAE,GAAGF,EAAO,GAAGJ,EAAS,EAAE,OAAOD,CAAQ,CAAA,EAIxE,IAAI,KAAK,aAAaO,EAAY,CAAE,GAAGF,EAAO,GAAGd,EAAQC,CAAQ,EAAG,GAAGH,EAAMC,CAAa,EAAG,EAAE,OAAOK,CAAK,EATzG,EAUX,CAQO,SAASa,EACdb,EACA,CAAE,cAAAL,EAAe,SAAAE,EAAU,WAAAe,EAAa,QAAS,MAAAE,EAAQ,KAAA,EAAyB,GAClF,CACA,OAAK,OAAO,SAASd,CAAK,EAItBH,IAAa,QACRE,EAASC,EAAOL,EAAe,CAACU,EAAUC,IAC/C,IAAI,KAAK,aAAaM,EAAY,CAAE,GAAGF,EAAO,SAAUI,EAAO,MAAO,WAAY,GAAGR,EAAS,EAAE,OAAOD,CAAQ,CAAA,EAI5G,IAAI,KAAK,aAAaO,EAAY,CACvC,GAAGF,EACH,SAAUI,EACV,MAAO,WACP,GAAGlB,EAAQC,CAAQ,EACnB,GAAGH,EAAMC,CAAa,CAAA,CACvB,EAAE,OAAOK,CAAK,EAfN,EAgBX,CAOO,SAASe,EACdf,EACA,CAAE,cAAAL,EAAgB,EAAG,WAAAiB,EAAa,OAAA,EAAgC,GAClE,CACA,OAAK,OAAO,SAASZ,CAAK,EAInB,IAAI,KAAK,aAAaY,EAAY,CAAE,GAAGF,EAAO,MAAO,UAAW,GAAGhB,EAAMC,CAAa,CAAA,CAAG,EAAE,OAAOK,CAAK,EAHrG,EAIX"}
@@ -1,28 +1,53 @@
1
- function i(t) {
1
+ function c(t) {
2
2
  return t === void 0 ? {} : { maximumFractionDigits: t, minimumFractionDigits: t };
3
3
  }
4
- function u(t) {
5
- return t ? { compactDisplay: "short", notation: "compact" } : {};
4
+ function g(t) {
5
+ return t === !0 ? { compactDisplay: "short", notation: "compact" } : {};
6
6
  }
7
- const o = { signDisplay: "negative" };
8
- function a(t, { casasDecimais: r, compacto: n, localidade: e = "pt-BR" } = {}) {
9
- return Number.isFinite(t) ? new Intl.NumberFormat(e, { ...o, ...u(n), ...i(r) }).format(t) : "";
7
+ const a = [
8
+ [1e12, "T"],
9
+ [1e9, "B"],
10
+ [1e6, "M"],
11
+ [1e3, "k"]
12
+ ];
13
+ function F(t, r, e) {
14
+ let n = a.findIndex(([i]) => Math.abs(t) >= i);
15
+ for (; ; ) {
16
+ const [i, o] = n >= 0 ? a[n] : [1, ""], u = t / i, f = r ?? (Math.abs(u) < 10 ? 1 : 0), N = Math.round(Math.abs(u) * 10 ** f) / 10 ** f, s = n === -1 ? a.length - 1 : n - 1;
17
+ if (N < 1e3 || s < 0) {
18
+ const b = e(u, { maximumFractionDigits: f, minimumFractionDigits: r ?? 0 });
19
+ return o ? `${b} ${o}` : b;
20
+ }
21
+ n = s;
22
+ }
10
23
  }
11
- function c(t, { casasDecimais: r, compacto: n, localidade: e = "pt-BR", moeda: m = "BRL" } = {}) {
12
- return Number.isFinite(t) ? new Intl.NumberFormat(e, {
13
- ...o,
14
- currency: m,
24
+ const m = { signDisplay: "negative" };
25
+ function y(t, { casasDecimais: r, compacto: e, localidade: n = "pt-BR" } = {}) {
26
+ return Number.isFinite(t) ? e === "sigla" ? F(
27
+ t,
28
+ r,
29
+ (i, o) => new Intl.NumberFormat(n, { ...m, ...o }).format(i)
30
+ ) : new Intl.NumberFormat(n, { ...m, ...g(e), ...c(r) }).format(t) : "";
31
+ }
32
+ function I(t, { casasDecimais: r, compacto: e, localidade: n = "pt-BR", moeda: i = "BRL" } = {}) {
33
+ return Number.isFinite(t) ? e === "sigla" ? F(
34
+ t,
35
+ r,
36
+ (o, u) => new Intl.NumberFormat(n, { ...m, currency: i, style: "currency", ...u }).format(o)
37
+ ) : new Intl.NumberFormat(n, {
38
+ ...m,
39
+ currency: i,
15
40
  style: "currency",
16
- ...u(n),
17
- ...i(r)
41
+ ...g(e),
42
+ ...c(r)
18
43
  }).format(t) : "";
19
44
  }
20
- function f(t, { casasDecimais: r = 0, localidade: n = "pt-BR" } = {}) {
21
- return Number.isFinite(t) ? new Intl.NumberFormat(n, { ...o, style: "percent", ...i(r) }).format(t) : "";
45
+ function d(t, { casasDecimais: r = 0, localidade: e = "pt-BR" } = {}) {
46
+ return Number.isFinite(t) ? new Intl.NumberFormat(e, { ...m, style: "percent", ...c(r) }).format(t) : "";
22
47
  }
23
48
  export {
24
- c as formatarMoeda,
25
- a as formatarNumero,
26
- f as formatarPercentual
49
+ I as formatarMoeda,
50
+ y as formatarNumero,
51
+ d as formatarPercentual
27
52
  };
28
53
  //# sourceMappingURL=formatarNumero.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatarNumero.js","sources":["../../../src/utils/formatters/formatarNumero.ts"],"sourcesContent":["export interface OpcoesDeNumero {\n /** Sem declarar, quem decide e a localidade — e, na moeda, a propria moeda. */\n casasDecimais?: number;\n compacto?: boolean;\n localidade?: string;\n}\n\nexport interface OpcoesDeMoeda extends OpcoesDeNumero {\n moeda?: string;\n}\n\nexport interface OpcoesDePercentual {\n casasDecimais?: number;\n localidade?: string;\n}\n\nfunction casas(casasDecimais?: number) {\n return casasDecimais === undefined\n ? {}\n : { maximumFractionDigits: casasDecimais, minimumFractionDigits: casasDecimais };\n}\n\n/**\n * A forma compacta sai da localidade, e nao de um sufixo proprio: em pt-BR um\n * milhao e `1 mi`, nao `1M`. Inventar o sufixo quebraria em qualquer outra.\n */\nfunction notacao(compacto?: boolean) {\n return compacto ? ({ compactDisplay: 'short', notation: 'compact' } as const) : {};\n}\n\n/** Sinal so no negativo de fato: `-0`, e o que arredonda para zero, saiam como `-0`. */\nconst SINAL = { signDisplay: 'negative' } as const;\n\nexport function formatarNumero(\n valor: number,\n { casasDecimais, compacto, localidade = 'pt-BR' }: OpcoesDeNumero = {},\n) {\n if (!Number.isFinite(valor)) {\n return '';\n }\n\n return new Intl.NumberFormat(localidade, { ...SINAL, ...notacao(compacto), ...casas(casasDecimais) }).format(valor);\n}\n\n/**\n * Valor monetario. O separador entre simbolo e numero e um espaco nao\n * separavel, escolha do `Intl`: ele impede que a quebra de linha afaste o\n * simbolo do valor. As mascaras de entrada usam espaco comum, e a convergencia\n * das duas ainda esta em aberto.\n */\nexport function formatarMoeda(\n valor: number,\n { casasDecimais, compacto, localidade = 'pt-BR', moeda = 'BRL' }: OpcoesDeMoeda = {},\n) {\n if (!Number.isFinite(valor)) {\n return '';\n }\n\n return new Intl.NumberFormat(localidade, {\n ...SINAL,\n currency: moeda,\n style: 'currency',\n ...notacao(compacto),\n ...casas(casasDecimais),\n }).format(valor);\n}\n\n/**\n * Percentual a partir da **fracao**: `0.42` vira `42%`. Receber o numero ja\n * multiplicado obrigaria cada consumidor a dividir antes de exibir, e e a\n * fracao que sai de uma divisao de duas medidas.\n */\nexport function formatarPercentual(\n valor: number,\n { casasDecimais = 0, localidade = 'pt-BR' }: OpcoesDePercentual = {},\n) {\n if (!Number.isFinite(valor)) {\n return '';\n }\n\n return new Intl.NumberFormat(localidade, { ...SINAL, style: 'percent', ...casas(casasDecimais) }).format(valor);\n}\n"],"names":["casas","casasDecimais","notacao","compacto","SINAL","formatarNumero","valor","localidade","formatarMoeda","moeda","formatarPercentual"],"mappings":"AAgBA,SAASA,EAAMC,GAAwB;AACrC,SAAOA,MAAkB,SACrB,CAAA,IACA,EAAE,uBAAuBA,GAAe,uBAAuBA,EAAA;AACrE;AAMA,SAASC,EAAQC,GAAoB;AACnC,SAAOA,IAAY,EAAE,gBAAgB,SAAS,UAAU,UAAA,IAAwB,CAAA;AAClF;AAGA,MAAMC,IAAQ,EAAE,aAAa,WAAA;AAEtB,SAASC,EACdC,GACA,EAAE,eAAAL,GAAe,UAAAE,GAAU,YAAAI,IAAa,QAAA,IAA4B,IACpE;AACA,SAAK,OAAO,SAASD,CAAK,IAInB,IAAI,KAAK,aAAaC,GAAY,EAAE,GAAGH,GAAO,GAAGF,EAAQC,CAAQ,GAAG,GAAGH,EAAMC,CAAa,GAAG,EAAE,OAAOK,CAAK,IAHzG;AAIX;AAQO,SAASE,EACdF,GACA,EAAE,eAAAL,GAAe,UAAAE,GAAU,YAAAI,IAAa,SAAS,OAAAE,IAAQ,MAAA,IAAyB,IAClF;AACA,SAAK,OAAO,SAASH,CAAK,IAInB,IAAI,KAAK,aAAaC,GAAY;AAAA,IACvC,GAAGH;AAAA,IACH,UAAUK;AAAA,IACV,OAAO;AAAA,IACP,GAAGP,EAAQC,CAAQ;AAAA,IACnB,GAAGH,EAAMC,CAAa;AAAA,EAAA,CACvB,EAAE,OAAOK,CAAK,IATN;AAUX;AAOO,SAASI,EACdJ,GACA,EAAE,eAAAL,IAAgB,GAAG,YAAAM,IAAa,QAAA,IAAgC,IAClE;AACA,SAAK,OAAO,SAASD,CAAK,IAInB,IAAI,KAAK,aAAaC,GAAY,EAAE,GAAGH,GAAO,OAAO,WAAW,GAAGJ,EAAMC,CAAa,EAAA,CAAG,EAAE,OAAOK,CAAK,IAHrG;AAIX;"}
1
+ {"version":3,"file":"formatarNumero.js","sources":["../../../src/utils/formatters/formatarNumero.ts"],"sourcesContent":["/**\n * `true` compacta na forma da localidade: em pt-BR, `500 mil` e `1,5 mi`. `'sigla'` usa as siglas\n * `k`, `M`, `B` e `T` — `500 k`, `1,5 M` —, com a virgula e o milhar da localidade.\n */\nexport type Compacto = boolean | 'sigla';\n\nexport interface OpcoesDeNumero {\n /** Sem declarar, quem decide e a localidade — e, na moeda, a propria moeda. */\n casasDecimais?: number;\n compacto?: Compacto;\n localidade?: string;\n}\n\nexport interface OpcoesDeMoeda extends OpcoesDeNumero {\n moeda?: string;\n}\n\nexport interface OpcoesDePercentual {\n casasDecimais?: number;\n localidade?: string;\n}\n\nfunction casas(casasDecimais?: number) {\n return casasDecimais === undefined\n ? {}\n : { maximumFractionDigits: casasDecimais, minimumFractionDigits: casasDecimais };\n}\n\n/**\n * A forma compacta padrao sai da localidade, e nao de um sufixo proprio: em pt-BR um\n * milhao e `1 mi`, nao `1M`. A sigla e outra escolha, pedida por nome.\n */\nfunction notacao(compacto?: Compacto) {\n return compacto === true ? ({ compactDisplay: 'short', notation: 'compact' } as const) : {};\n}\n\n/** Da maior para a menor; abaixo de mil, o valor sai sem sigla. */\nconst SIGLAS = [\n [1e12, 'T'],\n [1e9, 'B'],\n [1e6, 'M'],\n [1e3, 'k'],\n] as const;\n\ntype FormatarReduzido = (reduzido: number, digitos: Intl.NumberFormatOptions) => string;\n\n/**\n * Valor reduzido a sigla. Sem casas declaradas, uma casa abaixo de 10 e nenhuma acima, como a forma\n * compacta da localidade; o que arredonda para mil da sigla sobe para a seguinte: `999.950` e `1 M`.\n */\nfunction comSigla(valor: number, casasDecimais: number | undefined, formatarReduzido: FormatarReduzido) {\n let indice = SIGLAS.findIndex(([base]) => Math.abs(valor) >= base);\n\n for (;;) {\n const [base, sigla] = indice >= 0 ? SIGLAS[indice] : [1, ''];\n const reduzido = valor / base;\n const digitos = casasDecimais ?? (Math.abs(reduzido) < 10 ? 1 : 0);\n const arredondado = Math.round(Math.abs(reduzido) * 10 ** digitos) / 10 ** digitos;\n const maior = indice === -1 ? SIGLAS.length - 1 : indice - 1;\n\n if (arredondado < 1000 || maior < 0) {\n const texto = formatarReduzido(reduzido, { maximumFractionDigits: digitos, minimumFractionDigits: casasDecimais ?? 0 });\n return sigla ? `${texto} ${sigla}` : texto;\n }\n\n indice = maior;\n }\n}\n\n/** Sinal so no negativo de fato: `-0`, e o que arredonda para zero, saiam como `-0`. */\nconst SINAL = { signDisplay: 'negative' } as const;\n\nexport function formatarNumero(\n valor: number,\n { casasDecimais, compacto, localidade = 'pt-BR' }: OpcoesDeNumero = {},\n) {\n if (!Number.isFinite(valor)) {\n return '';\n }\n\n if (compacto === 'sigla') {\n return comSigla(valor, casasDecimais, (reduzido, digitos) =>\n new Intl.NumberFormat(localidade, { ...SINAL, ...digitos }).format(reduzido),\n );\n }\n\n return new Intl.NumberFormat(localidade, { ...SINAL, ...notacao(compacto), ...casas(casasDecimais) }).format(valor);\n}\n\n/**\n * Valor monetario. O separador entre simbolo e numero e um espaco nao\n * separavel, escolha do `Intl`: ele impede que a quebra de linha afaste o\n * simbolo do valor. As mascaras de entrada usam espaco comum, e a convergencia\n * das duas ainda esta em aberto.\n */\nexport function formatarMoeda(\n valor: number,\n { casasDecimais, compacto, localidade = 'pt-BR', moeda = 'BRL' }: OpcoesDeMoeda = {},\n) {\n if (!Number.isFinite(valor)) {\n return '';\n }\n\n if (compacto === 'sigla') {\n return comSigla(valor, casasDecimais, (reduzido, digitos) =>\n new Intl.NumberFormat(localidade, { ...SINAL, currency: moeda, style: 'currency', ...digitos }).format(reduzido),\n );\n }\n\n return new Intl.NumberFormat(localidade, {\n ...SINAL,\n currency: moeda,\n style: 'currency',\n ...notacao(compacto),\n ...casas(casasDecimais),\n }).format(valor);\n}\n\n/**\n * Percentual a partir da **fracao**: `0.42` vira `42%`. Receber o numero ja\n * multiplicado obrigaria cada consumidor a dividir antes de exibir, e e a\n * fracao que sai de uma divisao de duas medidas.\n */\nexport function formatarPercentual(\n valor: number,\n { casasDecimais = 0, localidade = 'pt-BR' }: OpcoesDePercentual = {},\n) {\n if (!Number.isFinite(valor)) {\n return '';\n }\n\n return new Intl.NumberFormat(localidade, { ...SINAL, style: 'percent', ...casas(casasDecimais) }).format(valor);\n}\n"],"names":["casas","casasDecimais","notacao","compacto","SIGLAS","comSigla","valor","formatarReduzido","indice","base","sigla","reduzido","digitos","arredondado","maior","texto","SINAL","formatarNumero","localidade","formatarMoeda","moeda","formatarPercentual"],"mappings":"AAsBA,SAASA,EAAMC,GAAwB;AACrC,SAAOA,MAAkB,SACrB,CAAA,IACA,EAAE,uBAAuBA,GAAe,uBAAuBA,EAAA;AACrE;AAMA,SAASC,EAAQC,GAAqB;AACpC,SAAOA,MAAa,KAAQ,EAAE,gBAAgB,SAAS,UAAU,UAAA,IAAwB,CAAA;AAC3F;AAGA,MAAMC,IAAS;AAAA,EACb,CAAC,MAAM,GAAG;AAAA,EACV,CAAC,KAAK,GAAG;AAAA,EACT,CAAC,KAAK,GAAG;AAAA,EACT,CAAC,KAAK,GAAG;AACX;AAQA,SAASC,EAASC,GAAeL,GAAmCM,GAAoC;AACtG,MAAIC,IAASJ,EAAO,UAAU,CAAC,CAACK,CAAI,MAAM,KAAK,IAAIH,CAAK,KAAKG,CAAI;AAEjE,aAAS;AACP,UAAM,CAACA,GAAMC,CAAK,IAAIF,KAAU,IAAIJ,EAAOI,CAAM,IAAI,CAAC,GAAG,EAAE,GACrDG,IAAWL,IAAQG,GACnBG,IAAUX,MAAkB,KAAK,IAAIU,CAAQ,IAAI,KAAK,IAAI,IAC1DE,IAAc,KAAK,MAAM,KAAK,IAAIF,CAAQ,IAAI,MAAMC,CAAO,IAAI,MAAMA,GACrEE,IAAQN,MAAW,KAAKJ,EAAO,SAAS,IAAII,IAAS;AAE3D,QAAIK,IAAc,OAAQC,IAAQ,GAAG;AACnC,YAAMC,IAAQR,EAAiBI,GAAU,EAAE,uBAAuBC,GAAS,uBAAuBX,KAAiB,GAAG;AACtH,aAAOS,IAAQ,GAAGK,CAAK,IAAIL,CAAK,KAAKK;AAAA,IACvC;AAEA,IAAAP,IAASM;AAAA,EACX;AACF;AAGA,MAAME,IAAQ,EAAE,aAAa,WAAA;AAEtB,SAASC,EACdX,GACA,EAAE,eAAAL,GAAe,UAAAE,GAAU,YAAAe,IAAa,QAAA,IAA4B,IACpE;AACA,SAAK,OAAO,SAASZ,CAAK,IAItBH,MAAa,UACRE;AAAA,IAASC;AAAA,IAAOL;AAAA,IAAe,CAACU,GAAUC,MAC/C,IAAI,KAAK,aAAaM,GAAY,EAAE,GAAGF,GAAO,GAAGJ,GAAS,EAAE,OAAOD,CAAQ;AAAA,EAAA,IAIxE,IAAI,KAAK,aAAaO,GAAY,EAAE,GAAGF,GAAO,GAAGd,EAAQC,CAAQ,GAAG,GAAGH,EAAMC,CAAa,GAAG,EAAE,OAAOK,CAAK,IATzG;AAUX;AAQO,SAASa,EACdb,GACA,EAAE,eAAAL,GAAe,UAAAE,GAAU,YAAAe,IAAa,SAAS,OAAAE,IAAQ,MAAA,IAAyB,IAClF;AACA,SAAK,OAAO,SAASd,CAAK,IAItBH,MAAa,UACRE;AAAA,IAASC;AAAA,IAAOL;AAAA,IAAe,CAACU,GAAUC,MAC/C,IAAI,KAAK,aAAaM,GAAY,EAAE,GAAGF,GAAO,UAAUI,GAAO,OAAO,YAAY,GAAGR,GAAS,EAAE,OAAOD,CAAQ;AAAA,EAAA,IAI5G,IAAI,KAAK,aAAaO,GAAY;AAAA,IACvC,GAAGF;AAAA,IACH,UAAUI;AAAA,IACV,OAAO;AAAA,IACP,GAAGlB,EAAQC,CAAQ;AAAA,IACnB,GAAGH,EAAMC,CAAa;AAAA,EAAA,CACvB,EAAE,OAAOK,CAAK,IAfN;AAgBX;AAOO,SAASe,EACdf,GACA,EAAE,eAAAL,IAAgB,GAAG,YAAAiB,IAAa,QAAA,IAAgC,IAClE;AACA,SAAK,OAAO,SAASZ,CAAK,IAInB,IAAI,KAAK,aAAaY,GAAY,EAAE,GAAGF,GAAO,OAAO,WAAW,GAAGhB,EAAMC,CAAa,EAAA,CAAG,EAAE,OAAOK,CAAK,IAHrG;AAIX;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=["B","KB","MB","GB","TB"],n=1024;function g(t,{casasDecimais:a,localidade:c="pt-BR"}={}){if(!Number.isFinite(t)||t<0)return"";let o=t<n?0:Math.min(Math.floor(Math.log(t)/Math.log(n)),i.length-1);const m=r=>r===0?0:a??1,l=(r,u)=>Math.round(r*10**u)/10**u;o<i.length-1&&l(t/n**o,m(o))>=n&&(o+=1);const e=m(o);return`${new Intl.NumberFormat(c,{maximumFractionDigits:e,minimumFractionDigits:a===void 0?0:e}).format(t/n**o)} ${i[o]}`}exports.formatarTamanhoDeArquivo=g;
2
+ //# sourceMappingURL=formatarTamanhoDeArquivo.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatarTamanhoDeArquivo.cjs","sources":["../../../src/utils/formatters/formatarTamanhoDeArquivo.ts"],"sourcesContent":["export interface OpcoesDeTamanhoDeArquivo {\n /** Sem declarar, ate uma casa: `24,6 MB` e `512 KB`. Bytes saem sempre inteiros. */\n casasDecimais?: number;\n localidade?: string;\n}\n\nconst UNIDADES = ['B', 'KB', 'MB', 'GB', 'TB'] as const;\nconst BASE = 1024;\n\n/** Tamanho de arquivo em base 1024, com os separadores da localidade: `950 B`, `512 KB`, `1,2 GB`. */\nexport function formatarTamanhoDeArquivo(\n bytes: number,\n { casasDecimais, localidade = 'pt-BR' }: OpcoesDeTamanhoDeArquivo = {},\n) {\n if (!Number.isFinite(bytes) || bytes < 0) {\n return '';\n }\n\n let indice = bytes < BASE ? 0 : Math.min(Math.floor(Math.log(bytes) / Math.log(BASE)), UNIDADES.length - 1);\n const digitos = (unidade: number) => (unidade === 0 ? 0 : (casasDecimais ?? 1));\n const arredondar = (valor: number, casas: number) => Math.round(valor * 10 ** casas) / 10 ** casas;\n\n // O que arredonda para 1024 da unidade sobe para a seguinte: `1.048.575` bytes e `1 MB`, nao `1.024 KB`.\n if (indice < UNIDADES.length - 1 && arredondar(bytes / BASE ** indice, digitos(indice)) >= BASE) {\n indice += 1;\n }\n\n const casas = digitos(indice);\n const numero = new Intl.NumberFormat(localidade, {\n maximumFractionDigits: casas,\n minimumFractionDigits: casasDecimais === undefined ? 0 : casas,\n }).format(bytes / BASE ** indice);\n\n return `${numero} ${UNIDADES[indice]}`;\n}\n"],"names":["UNIDADES","BASE","formatarTamanhoDeArquivo","bytes","casasDecimais","localidade","indice","digitos","unidade","arredondar","valor","casas"],"mappings":"gFAMA,MAAMA,EAAW,CAAC,IAAK,KAAM,KAAM,KAAM,IAAI,EACvCC,EAAO,KAGN,SAASC,EACdC,EACA,CAAE,cAAAC,EAAe,WAAAC,EAAa,OAAA,EAAsC,GACpE,CACA,GAAI,CAAC,OAAO,SAASF,CAAK,GAAKA,EAAQ,EACrC,MAAO,GAGT,IAAIG,EAASH,EAAQF,EAAO,EAAI,KAAK,IAAI,KAAK,MAAM,KAAK,IAAIE,CAAK,EAAI,KAAK,IAAIF,CAAI,CAAC,EAAGD,EAAS,OAAS,CAAC,EAC1G,MAAMO,EAAWC,GAAqBA,IAAY,EAAI,EAAKJ,GAAiB,EACtEK,EAAa,CAACC,EAAeC,IAAkB,KAAK,MAAMD,EAAQ,IAAMC,CAAK,EAAI,IAAMA,EAGzFL,EAASN,EAAS,OAAS,GAAKS,EAAWN,EAAQF,GAAQK,EAAQC,EAAQD,CAAM,CAAC,GAAKL,IACzFK,GAAU,GAGZ,MAAMK,EAAQJ,EAAQD,CAAM,EAM5B,MAAO,GALQ,IAAI,KAAK,aAAaD,EAAY,CAC/C,sBAAuBM,EACvB,sBAAuBP,IAAkB,OAAY,EAAIO,CAAA,CAC1D,EAAE,OAAOR,EAAQF,GAAQK,CAAM,CAEhB,IAAIN,EAASM,CAAM,CAAC,EACtC"}
@@ -0,0 +1,17 @@
1
+ const r = ["B", "KB", "MB", "GB", "TB"];
2
+ function h(o, { casasDecimais: i, localidade: u = "pt-BR" } = {}) {
3
+ if (!Number.isFinite(o) || o < 0)
4
+ return "";
5
+ let n = o < 1024 ? 0 : Math.min(Math.floor(Math.log(o) / Math.log(1024)), r.length - 1);
6
+ const m = (t) => t === 0 ? 0 : i ?? 1, e = (t, B) => Math.round(t * 10 ** B) / 10 ** B;
7
+ n < r.length - 1 && e(o / 1024 ** n, m(n)) >= 1024 && (n += 1);
8
+ const a = m(n);
9
+ return `${new Intl.NumberFormat(u, {
10
+ maximumFractionDigits: a,
11
+ minimumFractionDigits: i === void 0 ? 0 : a
12
+ }).format(o / 1024 ** n)} ${r[n]}`;
13
+ }
14
+ export {
15
+ h as formatarTamanhoDeArquivo
16
+ };
17
+ //# sourceMappingURL=formatarTamanhoDeArquivo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatarTamanhoDeArquivo.js","sources":["../../../src/utils/formatters/formatarTamanhoDeArquivo.ts"],"sourcesContent":["export interface OpcoesDeTamanhoDeArquivo {\n /** Sem declarar, ate uma casa: `24,6 MB` e `512 KB`. Bytes saem sempre inteiros. */\n casasDecimais?: number;\n localidade?: string;\n}\n\nconst UNIDADES = ['B', 'KB', 'MB', 'GB', 'TB'] as const;\nconst BASE = 1024;\n\n/** Tamanho de arquivo em base 1024, com os separadores da localidade: `950 B`, `512 KB`, `1,2 GB`. */\nexport function formatarTamanhoDeArquivo(\n bytes: number,\n { casasDecimais, localidade = 'pt-BR' }: OpcoesDeTamanhoDeArquivo = {},\n) {\n if (!Number.isFinite(bytes) || bytes < 0) {\n return '';\n }\n\n let indice = bytes < BASE ? 0 : Math.min(Math.floor(Math.log(bytes) / Math.log(BASE)), UNIDADES.length - 1);\n const digitos = (unidade: number) => (unidade === 0 ? 0 : (casasDecimais ?? 1));\n const arredondar = (valor: number, casas: number) => Math.round(valor * 10 ** casas) / 10 ** casas;\n\n // O que arredonda para 1024 da unidade sobe para a seguinte: `1.048.575` bytes e `1 MB`, nao `1.024 KB`.\n if (indice < UNIDADES.length - 1 && arredondar(bytes / BASE ** indice, digitos(indice)) >= BASE) {\n indice += 1;\n }\n\n const casas = digitos(indice);\n const numero = new Intl.NumberFormat(localidade, {\n maximumFractionDigits: casas,\n minimumFractionDigits: casasDecimais === undefined ? 0 : casas,\n }).format(bytes / BASE ** indice);\n\n return `${numero} ${UNIDADES[indice]}`;\n}\n"],"names":["UNIDADES","formatarTamanhoDeArquivo","bytes","casasDecimais","localidade","indice","digitos","unidade","arredondar","valor","casas"],"mappings":"AAMA,MAAMA,IAAW,CAAC,KAAK,MAAM,MAAM,MAAM,IAAI;AAItC,SAASC,EACdC,GACA,EAAE,eAAAC,GAAe,YAAAC,IAAa,QAAA,IAAsC,IACpE;AACA,MAAI,CAAC,OAAO,SAASF,CAAK,KAAKA,IAAQ;AACrC,WAAO;AAGT,MAAIG,IAASH,IAAQ,OAAO,IAAI,KAAK,IAAI,KAAK,MAAM,KAAK,IAAIA,CAAK,IAAI,KAAK,IAAI,IAAI,CAAC,GAAGF,EAAS,SAAS,CAAC;AAC1G,QAAMM,IAAU,CAACC,MAAqBA,MAAY,IAAI,IAAKJ,KAAiB,GACtEK,IAAa,CAACC,GAAeC,MAAkB,KAAK,MAAMD,IAAQ,MAAMC,CAAK,IAAI,MAAMA;AAG7F,EAAIL,IAASL,EAAS,SAAS,KAAKQ,EAAWN,IAAQ,QAAQG,GAAQC,EAAQD,CAAM,CAAC,KAAK,SACzFA,KAAU;AAGZ,QAAMK,IAAQJ,EAAQD,CAAM;AAM5B,SAAO,GALQ,IAAI,KAAK,aAAaD,GAAY;AAAA,IAC/C,uBAAuBM;AAAA,IACvB,uBAAuBP,MAAkB,SAAY,IAAIO;AAAA,EAAA,CAC1D,EAAE,OAAOR,IAAQ,QAAQG,CAAM,CAEhB,IAAIL,EAASK,CAAM,CAAC;AACtC;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plenustech/design-system",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Design System centralizado para os produtos web da Plenustech.",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": {
@@ -57,6 +57,7 @@
57
57
  "@react-aria/overlays": "^3.32.1",
58
58
  "@types/d3-scale": "^4.0.9",
59
59
  "d3-array": "^3.2.4",
60
+ "d3-geo": "^3.1.1",
60
61
  "d3-hierarchy": "^3.1.2",
61
62
  "d3-sankey": "^0.12.3",
62
63
  "d3-scale": "^4.0.2",
@@ -70,6 +71,7 @@
70
71
  "@testing-library/jest-dom": "^6.6.3",
71
72
  "@testing-library/react": "^16.3.0",
72
73
  "@types/d3-array": "^3.2.2",
74
+ "@types/d3-geo": "^3.1.0",
73
75
  "@types/d3-hierarchy": "^3.1.7",
74
76
  "@types/d3-sankey": "^0.12.5",
75
77
  "@types/d3-shape": "^3.2.0",