@epilot/spark-ui 1.0.0-alpha.2 → 1.0.0-alpha.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 (561) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +2 -0
  3. package/README.md +7 -1
  4. package/dist/chunk-aJGBMT86.cjs +29 -0
  5. package/dist/components/accordion.cjs +57 -0
  6. package/dist/components/accordion.cjs.map +1 -0
  7. package/dist/components/accordion.d.cts +45 -0
  8. package/dist/components/accordion.d.ts +45 -0
  9. package/dist/components/accordion.js +51 -0
  10. package/dist/components/accordion.js.map +1 -0
  11. package/dist/components/alert-dialog.cjs +137 -0
  12. package/dist/components/alert-dialog.cjs.map +1 -0
  13. package/dist/components/alert-dialog.d.cts +63 -0
  14. package/dist/components/alert-dialog.d.ts +63 -0
  15. package/dist/components/alert-dialog.js +123 -0
  16. package/dist/components/alert-dialog.js.map +1 -0
  17. package/dist/components/attachment.cjs +119 -0
  18. package/dist/components/attachment.cjs.map +1 -0
  19. package/dist/components/attachment.d.cts +67 -0
  20. package/dist/components/attachment.d.ts +67 -0
  21. package/dist/components/attachment.js +108 -0
  22. package/dist/components/attachment.js.map +1 -0
  23. package/dist/components/badge.cjs +20 -0
  24. package/dist/components/badge.cjs.map +1 -0
  25. package/dist/components/badge.d.cts +12 -0
  26. package/dist/components/badge.d.ts +12 -0
  27. package/dist/components/badge.js +17 -0
  28. package/dist/components/badge.js.map +1 -0
  29. package/dist/components/bar-chart.cjs +520 -0
  30. package/dist/components/bar-chart.cjs.map +1 -0
  31. package/dist/components/bar-chart.d.cts +88 -0
  32. package/dist/components/bar-chart.d.ts +88 -0
  33. package/dist/components/bar-chart.js +518 -0
  34. package/dist/components/bar-chart.js.map +1 -0
  35. package/dist/components/battery-progress-row.cjs +140 -0
  36. package/dist/components/battery-progress-row.cjs.map +1 -0
  37. package/dist/components/battery-progress-row.d.cts +78 -0
  38. package/dist/components/battery-progress-row.d.ts +78 -0
  39. package/dist/components/battery-progress-row.js +129 -0
  40. package/dist/components/battery-progress-row.js.map +1 -0
  41. package/dist/components/breadcrumbs.cjs +65 -0
  42. package/dist/components/breadcrumbs.cjs.map +1 -0
  43. package/dist/components/breadcrumbs.d.cts +44 -0
  44. package/dist/components/breadcrumbs.d.ts +44 -0
  45. package/dist/components/breadcrumbs.js +58 -0
  46. package/dist/components/breadcrumbs.js.map +1 -0
  47. package/dist/components/bubble.cjs +84 -0
  48. package/dist/components/bubble.cjs.map +1 -0
  49. package/dist/components/bubble.d.cts +41 -0
  50. package/dist/components/bubble.d.ts +41 -0
  51. package/dist/components/bubble.js +78 -0
  52. package/dist/components/bubble.js.map +1 -0
  53. package/dist/components/button.cjs +54 -0
  54. package/dist/components/button.cjs.map +1 -0
  55. package/dist/components/button.d.cts +42 -0
  56. package/dist/components/button.d.ts +42 -0
  57. package/dist/components/button.js +50 -0
  58. package/dist/components/button.js.map +1 -0
  59. package/dist/components/calendar.cjs +58 -0
  60. package/dist/components/calendar.cjs.map +1 -0
  61. package/dist/components/calendar.d.cts +17 -0
  62. package/dist/components/calendar.d.ts +17 -0
  63. package/dist/components/calendar.js +55 -0
  64. package/dist/components/calendar.js.map +1 -0
  65. package/dist/components/callout.cjs +95 -0
  66. package/dist/components/callout.cjs.map +1 -0
  67. package/dist/components/callout.d.cts +39 -0
  68. package/dist/components/callout.d.ts +39 -0
  69. package/dist/components/callout.js +88 -0
  70. package/dist/components/callout.js.map +1 -0
  71. package/dist/components/card.cjs +86 -0
  72. package/dist/components/card.cjs.map +1 -0
  73. package/dist/components/card.d.cts +28 -0
  74. package/dist/components/card.d.ts +28 -0
  75. package/dist/components/card.js +76 -0
  76. package/dist/components/card.js.map +1 -0
  77. package/dist/components/chart.cjs +93 -0
  78. package/dist/components/chart.cjs.map +1 -0
  79. package/dist/components/chart.d.cts +83 -0
  80. package/dist/components/chart.d.ts +83 -0
  81. package/dist/components/chart.js +88 -0
  82. package/dist/components/chart.js.map +1 -0
  83. package/dist/components/checkbox.cjs +37 -0
  84. package/dist/components/checkbox.cjs.map +1 -0
  85. package/dist/components/checkbox.d.cts +22 -0
  86. package/dist/components/checkbox.d.ts +22 -0
  87. package/dist/components/checkbox.js +34 -0
  88. package/dist/components/checkbox.js.map +1 -0
  89. package/dist/components/circular-gauge.cjs +74 -0
  90. package/dist/components/circular-gauge.cjs.map +1 -0
  91. package/dist/components/circular-gauge.d.cts +38 -0
  92. package/dist/components/circular-gauge.d.ts +38 -0
  93. package/dist/components/circular-gauge.js +71 -0
  94. package/dist/components/circular-gauge.js.map +1 -0
  95. package/dist/components/day-of-week-picker.cjs +123 -0
  96. package/dist/components/day-of-week-picker.cjs.map +1 -0
  97. package/dist/components/day-of-week-picker.d.cts +39 -0
  98. package/dist/components/day-of-week-picker.d.ts +39 -0
  99. package/dist/components/day-of-week-picker.js +119 -0
  100. package/dist/components/day-of-week-picker.js.map +1 -0
  101. package/dist/components/device-card.cjs +118 -0
  102. package/dist/components/device-card.cjs.map +1 -0
  103. package/dist/components/device-card.d.cts +71 -0
  104. package/dist/components/device-card.d.ts +71 -0
  105. package/dist/components/device-card.js +104 -0
  106. package/dist/components/device-card.js.map +1 -0
  107. package/dist/components/dialog.cjs +115 -0
  108. package/dist/components/dialog.cjs.map +1 -0
  109. package/dist/components/dialog.d.cts +45 -0
  110. package/dist/components/dialog.d.ts +45 -0
  111. package/dist/components/dialog.js +103 -0
  112. package/dist/components/dialog.js.map +1 -0
  113. package/dist/components/donut-chart.cjs +71 -0
  114. package/dist/components/donut-chart.cjs.map +1 -0
  115. package/dist/components/donut-chart.d.cts +22 -0
  116. package/dist/components/donut-chart.d.ts +22 -0
  117. package/dist/components/donut-chart.js +69 -0
  118. package/dist/components/donut-chart.js.map +1 -0
  119. package/dist/components/drawer.cjs +95 -0
  120. package/dist/components/drawer.cjs.map +1 -0
  121. package/dist/components/drawer.d.cts +46 -0
  122. package/dist/components/drawer.d.ts +46 -0
  123. package/dist/components/drawer.js +83 -0
  124. package/dist/components/drawer.js.map +1 -0
  125. package/dist/components/dropdown-menu.cjs +165 -0
  126. package/dist/components/dropdown-menu.cjs.map +1 -0
  127. package/dist/components/dropdown-menu.d.cts +93 -0
  128. package/dist/components/dropdown-menu.d.ts +93 -0
  129. package/dist/components/dropdown-menu.js +148 -0
  130. package/dist/components/dropdown-menu.js.map +1 -0
  131. package/dist/components/empty-state.cjs +35 -0
  132. package/dist/components/empty-state.cjs.map +1 -0
  133. package/dist/components/empty-state.d.cts +22 -0
  134. package/dist/components/empty-state.d.ts +22 -0
  135. package/dist/components/empty-state.js +33 -0
  136. package/dist/components/empty-state.js.map +1 -0
  137. package/dist/components/energy-bar-chart.cjs +24 -0
  138. package/dist/components/energy-bar-chart.cjs.map +1 -0
  139. package/dist/components/energy-bar-chart.d.cts +43 -0
  140. package/dist/components/energy-bar-chart.d.ts +43 -0
  141. package/dist/components/energy-bar-chart.js +22 -0
  142. package/dist/components/energy-bar-chart.js.map +1 -0
  143. package/dist/components/energy-breakdown.cjs +81 -0
  144. package/dist/components/energy-breakdown.cjs.map +1 -0
  145. package/dist/components/energy-breakdown.d.cts +26 -0
  146. package/dist/components/energy-breakdown.d.ts +26 -0
  147. package/dist/components/energy-breakdown.js +79 -0
  148. package/dist/components/energy-breakdown.js.map +1 -0
  149. package/dist/components/energy-history-chart.cjs +64 -0
  150. package/dist/components/energy-history-chart.cjs.map +1 -0
  151. package/dist/components/energy-history-chart.d.cts +66 -0
  152. package/dist/components/energy-history-chart.d.ts +66 -0
  153. package/dist/components/energy-history-chart.js +62 -0
  154. package/dist/components/energy-history-chart.js.map +1 -0
  155. package/dist/components/feed-in-hero.cjs +56 -0
  156. package/dist/components/feed-in-hero.cjs.map +1 -0
  157. package/dist/components/feed-in-hero.d.cts +33 -0
  158. package/dist/components/feed-in-hero.d.ts +33 -0
  159. package/dist/components/feed-in-hero.js +51 -0
  160. package/dist/components/feed-in-hero.js.map +1 -0
  161. package/dist/components/field.cjs +257 -0
  162. package/dist/components/field.cjs.map +1 -0
  163. package/dist/components/field.d.cts +104 -0
  164. package/dist/components/field.d.ts +104 -0
  165. package/dist/components/field.js +243 -0
  166. package/dist/components/field.js.map +1 -0
  167. package/dist/components/icon.cjs +35 -0
  168. package/dist/components/icon.cjs.map +1 -0
  169. package/dist/components/icon.d.cts +27 -0
  170. package/dist/components/icon.d.ts +27 -0
  171. package/dist/components/icon.js +32 -0
  172. package/dist/components/icon.js.map +1 -0
  173. package/dist/components/info-block.cjs +75 -0
  174. package/dist/components/info-block.cjs.map +1 -0
  175. package/dist/components/info-block.d.cts +20 -0
  176. package/dist/components/info-block.d.ts +20 -0
  177. package/dist/components/info-block.js +65 -0
  178. package/dist/components/info-block.js.map +1 -0
  179. package/dist/components/input-group.cjs +164 -0
  180. package/dist/components/input-group.cjs.map +1 -0
  181. package/dist/components/input-group.d.cts +32 -0
  182. package/dist/components/input-group.d.ts +32 -0
  183. package/dist/components/input-group.js +158 -0
  184. package/dist/components/input-group.js.map +1 -0
  185. package/dist/components/input-otp.cjs +113 -0
  186. package/dist/components/input-otp.cjs.map +1 -0
  187. package/dist/components/input-otp.d.cts +22 -0
  188. package/dist/components/input-otp.d.ts +22 -0
  189. package/dist/components/input-otp.js +111 -0
  190. package/dist/components/input-otp.js.map +1 -0
  191. package/dist/components/input.cjs +112 -0
  192. package/dist/components/input.cjs.map +1 -0
  193. package/dist/components/input.d.cts +21 -0
  194. package/dist/components/input.d.ts +21 -0
  195. package/dist/components/input.js +109 -0
  196. package/dist/components/input.js.map +1 -0
  197. package/dist/components/label.cjs +18 -0
  198. package/dist/components/label.cjs.map +1 -0
  199. package/dist/components/label.d.cts +10 -0
  200. package/dist/components/label.d.ts +10 -0
  201. package/dist/components/label.js +15 -0
  202. package/dist/components/label.js.map +1 -0
  203. package/dist/components/layout.cjs +15 -0
  204. package/dist/components/layout.cjs.map +1 -0
  205. package/dist/components/layout.d.cts +12 -0
  206. package/dist/components/layout.d.ts +13 -0
  207. package/dist/components/layout.js +14 -0
  208. package/dist/components/layout.js.map +1 -0
  209. package/dist/components/line-chart.cjs +350 -0
  210. package/dist/components/line-chart.cjs.map +1 -0
  211. package/dist/components/line-chart.d.cts +78 -0
  212. package/dist/components/line-chart.d.ts +78 -0
  213. package/dist/components/line-chart.js +347 -0
  214. package/dist/components/line-chart.js.map +1 -0
  215. package/dist/components/list.cjs +132 -0
  216. package/dist/components/list.cjs.map +1 -0
  217. package/dist/components/list.d.cts +72 -0
  218. package/dist/components/list.d.ts +72 -0
  219. package/dist/components/list.js +122 -0
  220. package/dist/components/list.js.map +1 -0
  221. package/dist/components/marker.cjs +52 -0
  222. package/dist/components/marker.cjs.map +1 -0
  223. package/dist/components/marker.d.cts +29 -0
  224. package/dist/components/marker.d.ts +29 -0
  225. package/dist/components/marker.js +46 -0
  226. package/dist/components/marker.js.map +1 -0
  227. package/dist/components/message-scroller.cjs +73 -0
  228. package/dist/components/message-scroller.cjs.map +1 -0
  229. package/dist/components/message-scroller.d.cts +39 -0
  230. package/dist/components/message-scroller.d.ts +39 -0
  231. package/dist/components/message-scroller.js +62 -0
  232. package/dist/components/message-scroller.js.map +1 -0
  233. package/dist/components/message.cjs +60 -0
  234. package/dist/components/message.cjs.map +1 -0
  235. package/dist/components/message.d.cts +36 -0
  236. package/dist/components/message.d.ts +36 -0
  237. package/dist/components/message.js +52 -0
  238. package/dist/components/message.js.map +1 -0
  239. package/dist/components/metering-row.cjs +43 -0
  240. package/dist/components/metering-row.cjs.map +1 -0
  241. package/dist/components/metering-row.d.cts +32 -0
  242. package/dist/components/metering-row.d.ts +32 -0
  243. package/dist/components/metering-row.js +38 -0
  244. package/dist/components/metering-row.js.map +1 -0
  245. package/dist/components/money-saved-block.cjs +87 -0
  246. package/dist/components/money-saved-block.cjs.map +1 -0
  247. package/dist/components/money-saved-block.d.cts +57 -0
  248. package/dist/components/money-saved-block.d.ts +57 -0
  249. package/dist/components/money-saved-block.js +79 -0
  250. package/dist/components/money-saved-block.js.map +1 -0
  251. package/dist/components/number-flow.cjs +44 -0
  252. package/dist/components/number-flow.cjs.map +1 -0
  253. package/dist/components/number-flow.d.cts +4 -0
  254. package/dist/components/number-flow.d.ts +4 -0
  255. package/dist/components/number-flow.js +42 -0
  256. package/dist/components/number-flow.js.map +1 -0
  257. package/dist/components/on-off-button.cjs +36 -0
  258. package/dist/components/on-off-button.cjs.map +1 -0
  259. package/dist/components/on-off-button.d.cts +20 -0
  260. package/dist/components/on-off-button.d.ts +20 -0
  261. package/dist/components/on-off-button.js +34 -0
  262. package/dist/components/on-off-button.js.map +1 -0
  263. package/dist/components/onboarding-layout.cjs +68 -0
  264. package/dist/components/onboarding-layout.cjs.map +1 -0
  265. package/dist/components/onboarding-layout.d.cts +46 -0
  266. package/dist/components/onboarding-layout.d.ts +46 -0
  267. package/dist/components/onboarding-layout.js +60 -0
  268. package/dist/components/onboarding-layout.js.map +1 -0
  269. package/dist/components/page-header.cjs +50 -0
  270. package/dist/components/page-header.cjs.map +1 -0
  271. package/dist/components/page-header.d.cts +26 -0
  272. package/dist/components/page-header.d.ts +26 -0
  273. package/dist/components/page-header.js +44 -0
  274. package/dist/components/page-header.js.map +1 -0
  275. package/dist/components/page-spinner.cjs +19 -0
  276. package/dist/components/page-spinner.cjs.map +1 -0
  277. package/dist/components/page-spinner.d.cts +14 -0
  278. package/dist/components/page-spinner.d.ts +14 -0
  279. package/dist/components/page-spinner.js +17 -0
  280. package/dist/components/page-spinner.js.map +1 -0
  281. package/dist/components/period-tabs.cjs +79 -0
  282. package/dist/components/period-tabs.cjs.map +1 -0
  283. package/dist/components/period-tabs.d.cts +51 -0
  284. package/dist/components/period-tabs.d.ts +51 -0
  285. package/dist/components/period-tabs.js +73 -0
  286. package/dist/components/period-tabs.js.map +1 -0
  287. package/dist/components/popover.cjs +62 -0
  288. package/dist/components/popover.cjs.map +1 -0
  289. package/dist/components/popover.d.cts +29 -0
  290. package/dist/components/popover.d.ts +29 -0
  291. package/dist/components/popover.js +56 -0
  292. package/dist/components/popover.js.map +1 -0
  293. package/dist/components/power-history-chart.cjs +335 -0
  294. package/dist/components/power-history-chart.cjs.map +1 -0
  295. package/dist/components/power-history-chart.d.cts +63 -0
  296. package/dist/components/power-history-chart.d.ts +63 -0
  297. package/dist/components/power-history-chart.js +332 -0
  298. package/dist/components/power-history-chart.js.map +1 -0
  299. package/dist/components/power-history.cjs +115 -0
  300. package/dist/components/power-history.cjs.map +1 -0
  301. package/dist/components/power-history.d.cts +42 -0
  302. package/dist/components/power-history.d.ts +43 -0
  303. package/dist/components/power-history.js +114 -0
  304. package/dist/components/power-history.js.map +1 -0
  305. package/dist/components/power-network.cjs +530 -0
  306. package/dist/components/power-network.cjs.map +1 -0
  307. package/dist/components/power-network.d.cts +77 -0
  308. package/dist/components/power-network.d.ts +77 -0
  309. package/dist/components/power-network.js +523 -0
  310. package/dist/components/power-network.js.map +1 -0
  311. package/dist/components/progress.cjs +34 -0
  312. package/dist/components/progress.cjs.map +1 -0
  313. package/dist/components/progress.d.cts +17 -0
  314. package/dist/components/progress.d.ts +17 -0
  315. package/dist/components/progress.js +31 -0
  316. package/dist/components/progress.js.map +1 -0
  317. package/dist/components/radio-card-group.cjs +69 -0
  318. package/dist/components/radio-card-group.cjs.map +1 -0
  319. package/dist/components/radio-card-group.d.cts +21 -0
  320. package/dist/components/radio-card-group.d.ts +21 -0
  321. package/dist/components/radio-card-group.js +65 -0
  322. package/dist/components/radio-card-group.js.map +1 -0
  323. package/dist/components/radio.cjs +34 -0
  324. package/dist/components/radio.cjs.map +1 -0
  325. package/dist/components/radio.d.cts +21 -0
  326. package/dist/components/radio.d.ts +21 -0
  327. package/dist/components/radio.js +30 -0
  328. package/dist/components/radio.js.map +1 -0
  329. package/dist/components/reparent.cjs +55 -0
  330. package/dist/components/reparent.cjs.map +1 -0
  331. package/dist/components/reparent.d.cts +29 -0
  332. package/dist/components/reparent.d.ts +29 -0
  333. package/dist/components/reparent.js +49 -0
  334. package/dist/components/reparent.js.map +1 -0
  335. package/dist/components/sankey-chart.cjs +188 -0
  336. package/dist/components/sankey-chart.cjs.map +1 -0
  337. package/dist/components/sankey-chart.d.cts +66 -0
  338. package/dist/components/sankey-chart.d.ts +66 -0
  339. package/dist/components/sankey-chart.js +185 -0
  340. package/dist/components/sankey-chart.js.map +1 -0
  341. package/dist/components/schedule-editor.cjs +82 -0
  342. package/dist/components/schedule-editor.cjs.map +1 -0
  343. package/dist/components/schedule-editor.d.cts +25 -0
  344. package/dist/components/schedule-editor.d.ts +25 -0
  345. package/dist/components/schedule-editor.js +72 -0
  346. package/dist/components/schedule-editor.js.map +1 -0
  347. package/dist/components/schedule-list.cjs +110 -0
  348. package/dist/components/schedule-list.cjs.map +1 -0
  349. package/dist/components/schedule-list.d.cts +29 -0
  350. package/dist/components/schedule-list.d.ts +29 -0
  351. package/dist/components/schedule-list.js +99 -0
  352. package/dist/components/schedule-list.js.map +1 -0
  353. package/dist/components/scroll-area.cjs +53 -0
  354. package/dist/components/scroll-area.cjs.map +1 -0
  355. package/dist/components/scroll-area.d.cts +26 -0
  356. package/dist/components/scroll-area.d.ts +26 -0
  357. package/dist/components/scroll-area.js +44 -0
  358. package/dist/components/scroll-area.js.map +1 -0
  359. package/dist/components/segmented-control.cjs +44 -0
  360. package/dist/components/segmented-control.cjs.map +1 -0
  361. package/dist/components/segmented-control.d.cts +33 -0
  362. package/dist/components/segmented-control.d.ts +33 -0
  363. package/dist/components/segmented-control.js +40 -0
  364. package/dist/components/segmented-control.js.map +1 -0
  365. package/dist/components/select.cjs +136 -0
  366. package/dist/components/select.cjs.map +1 -0
  367. package/dist/components/select.d.cts +63 -0
  368. package/dist/components/select.d.ts +63 -0
  369. package/dist/components/select.js +124 -0
  370. package/dist/components/select.js.map +1 -0
  371. package/dist/components/separator.cjs +38 -0
  372. package/dist/components/separator.cjs.map +1 -0
  373. package/dist/components/separator.d.cts +13 -0
  374. package/dist/components/separator.d.ts +13 -0
  375. package/dist/components/separator.js +35 -0
  376. package/dist/components/separator.js.map +1 -0
  377. package/dist/components/series-legend.cjs +39 -0
  378. package/dist/components/series-legend.cjs.map +1 -0
  379. package/dist/components/series-legend.d.cts +31 -0
  380. package/dist/components/series-legend.d.ts +31 -0
  381. package/dist/components/series-legend.js +37 -0
  382. package/dist/components/series-legend.js.map +1 -0
  383. package/dist/components/sheet.cjs +102 -0
  384. package/dist/components/sheet.cjs.map +1 -0
  385. package/dist/components/sheet.d.cts +46 -0
  386. package/dist/components/sheet.d.ts +46 -0
  387. package/dist/components/sheet.js +90 -0
  388. package/dist/components/sheet.js.map +1 -0
  389. package/dist/components/skeleton.cjs +24 -0
  390. package/dist/components/skeleton.cjs.map +1 -0
  391. package/dist/components/skeleton.d.cts +24 -0
  392. package/dist/components/skeleton.d.ts +24 -0
  393. package/dist/components/skeleton.js +21 -0
  394. package/dist/components/skeleton.js.map +1 -0
  395. package/dist/components/slider.cjs +276 -0
  396. package/dist/components/slider.cjs.map +1 -0
  397. package/dist/components/slider.d.cts +150 -0
  398. package/dist/components/slider.d.ts +150 -0
  399. package/dist/components/slider.js +266 -0
  400. package/dist/components/slider.js.map +1 -0
  401. package/dist/components/smart-toggle-button.cjs +28 -0
  402. package/dist/components/smart-toggle-button.cjs.map +1 -0
  403. package/dist/components/smart-toggle-button.d.cts +18 -0
  404. package/dist/components/smart-toggle-button.d.ts +18 -0
  405. package/dist/components/smart-toggle-button.js +26 -0
  406. package/dist/components/smart-toggle-button.js.map +1 -0
  407. package/dist/components/solar-forecast-chart.cjs +106 -0
  408. package/dist/components/solar-forecast-chart.cjs.map +1 -0
  409. package/dist/components/solar-forecast-chart.d.cts +69 -0
  410. package/dist/components/solar-forecast-chart.d.ts +69 -0
  411. package/dist/components/solar-forecast-chart.js +100 -0
  412. package/dist/components/solar-forecast-chart.js.map +1 -0
  413. package/dist/components/sortable-list.cjs +69 -0
  414. package/dist/components/sortable-list.cjs.map +1 -0
  415. package/dist/components/sortable-list.d.cts +46 -0
  416. package/dist/components/sortable-list.d.ts +46 -0
  417. package/dist/components/sortable-list.js +67 -0
  418. package/dist/components/sortable-list.js.map +1 -0
  419. package/dist/components/spinner.cjs +42 -0
  420. package/dist/components/spinner.cjs.map +1 -0
  421. package/dist/components/spinner.d.cts +15 -0
  422. package/dist/components/spinner.d.ts +15 -0
  423. package/dist/components/spinner.js +39 -0
  424. package/dist/components/spinner.js.map +1 -0
  425. package/dist/components/stat-card.cjs +58 -0
  426. package/dist/components/stat-card.cjs.map +1 -0
  427. package/dist/components/stat-card.d.cts +36 -0
  428. package/dist/components/stat-card.d.ts +36 -0
  429. package/dist/components/stat-card.js +50 -0
  430. package/dist/components/stat-card.js.map +1 -0
  431. package/dist/components/stepper.cjs +79 -0
  432. package/dist/components/stepper.cjs.map +1 -0
  433. package/dist/components/stepper.d.cts +33 -0
  434. package/dist/components/stepper.d.ts +33 -0
  435. package/dist/components/stepper.js +76 -0
  436. package/dist/components/stepper.js.map +1 -0
  437. package/dist/components/switch.cjs +22 -0
  438. package/dist/components/switch.cjs.map +1 -0
  439. package/dist/components/switch.d.cts +28 -0
  440. package/dist/components/switch.d.ts +28 -0
  441. package/dist/components/switch.js +20 -0
  442. package/dist/components/switch.js.map +1 -0
  443. package/dist/components/tabs.cjs +175 -0
  444. package/dist/components/tabs.cjs.map +1 -0
  445. package/dist/components/tabs.d.cts +45 -0
  446. package/dist/components/tabs.d.ts +45 -0
  447. package/dist/components/tabs.js +167 -0
  448. package/dist/components/tabs.js.map +1 -0
  449. package/dist/components/theme.cjs +6 -0
  450. package/dist/components/theme.d.cts +38 -0
  451. package/dist/components/theme.d.ts +38 -0
  452. package/dist/components/theme.js +4 -0
  453. package/dist/components/thumbnail.cjs +54 -0
  454. package/dist/components/thumbnail.cjs.map +1 -0
  455. package/dist/components/thumbnail.d.cts +34 -0
  456. package/dist/components/thumbnail.d.ts +34 -0
  457. package/dist/components/thumbnail.js +51 -0
  458. package/dist/components/thumbnail.js.map +1 -0
  459. package/dist/components/time-picker.cjs +55 -0
  460. package/dist/components/time-picker.cjs.map +1 -0
  461. package/dist/components/time-picker.d.cts +41 -0
  462. package/dist/components/time-picker.d.ts +41 -0
  463. package/dist/components/time-picker.js +51 -0
  464. package/dist/components/time-picker.js.map +1 -0
  465. package/dist/components/toast.cjs +99 -0
  466. package/dist/components/toast.cjs.map +1 -0
  467. package/dist/components/toast.d.cts +18 -0
  468. package/dist/components/toast.d.ts +18 -0
  469. package/dist/components/toast.js +95 -0
  470. package/dist/components/toast.js.map +1 -0
  471. package/dist/components/tooltip.cjs +75 -0
  472. package/dist/components/tooltip.cjs.map +1 -0
  473. package/dist/components/tooltip.d.cts +47 -0
  474. package/dist/components/tooltip.d.ts +47 -0
  475. package/dist/components/tooltip.js +67 -0
  476. package/dist/components/tooltip.js.map +1 -0
  477. package/dist/components/typography.cjs +52 -0
  478. package/dist/components/typography.cjs.map +1 -0
  479. package/dist/components/typography.d.cts +32 -0
  480. package/dist/components/typography.d.ts +32 -0
  481. package/dist/components/typography.js +45 -0
  482. package/dist/components/typography.js.map +1 -0
  483. package/dist/hooks/use-container-width.cjs +22 -0
  484. package/dist/hooks/use-container-width.cjs.map +1 -0
  485. package/dist/hooks/use-container-width.d.cts +7 -0
  486. package/dist/hooks/use-container-width.d.ts +7 -0
  487. package/dist/hooks/use-container-width.js +20 -0
  488. package/dist/hooks/use-container-width.js.map +1 -0
  489. package/dist/icons/index.cjs +7 -0
  490. package/dist/icons/index.d.cts +4 -0
  491. package/dist/icons/index.d.ts +4 -0
  492. package/dist/icons/index.js +3 -0
  493. package/dist/icons/material-symbol.cjs +105 -0
  494. package/dist/icons/material-symbol.cjs.map +1 -0
  495. package/dist/icons/material-symbol.d.cts +23 -0
  496. package/dist/icons/material-symbol.d.ts +23 -0
  497. package/dist/icons/material-symbol.js +100 -0
  498. package/dist/icons/material-symbol.js.map +1 -0
  499. package/dist/input-box-variants-BMDdwvqg.cjs +40 -0
  500. package/dist/input-box-variants-BMDdwvqg.cjs.map +1 -0
  501. package/dist/input-box-variants-Dr1K7uYE.js +28 -0
  502. package/dist/input-box-variants-Dr1K7uYE.js.map +1 -0
  503. package/dist/number-flow-DMJouddg.d.cts +15 -0
  504. package/dist/number-flow-DSbucQ_K.d.ts +15 -0
  505. package/dist/styles/index.css +260 -0
  506. package/dist/styles/internal.css +5 -0
  507. package/dist/styles/material-symbol.css +22 -0
  508. package/dist/styles/spark-default.css +888 -0
  509. package/dist/styles/theme.css +620 -0
  510. package/dist/styles/utilities.css +557 -0
  511. package/dist/theme-C19BbKfO.js +574 -0
  512. package/dist/theme-C19BbKfO.js.map +1 -0
  513. package/dist/theme-CfFWrMEF.cjs +592 -0
  514. package/dist/theme-CfFWrMEF.cjs.map +1 -0
  515. package/dist/theme-types-DoROIXpi.d.ts +30 -0
  516. package/dist/theme-types-r20EJfEC.d.cts +30 -0
  517. package/dist/tones-DjgKOX3s.d.cts +8 -0
  518. package/dist/tones-DyCkL71h.d.ts +8 -0
  519. package/dist/utils/build-sankey-nodes.cjs +72 -0
  520. package/dist/utils/build-sankey-nodes.cjs.map +1 -0
  521. package/dist/utils/build-sankey-nodes.d.cts +27 -0
  522. package/dist/utils/build-sankey-nodes.d.ts +27 -0
  523. package/dist/utils/build-sankey-nodes.js +71 -0
  524. package/dist/utils/build-sankey-nodes.js.map +1 -0
  525. package/dist/utils/chars.cjs +18 -0
  526. package/dist/utils/chars.cjs.map +1 -0
  527. package/dist/utils/chars.d.cts +10 -0
  528. package/dist/utils/chars.d.ts +10 -0
  529. package/dist/utils/chars.js +14 -0
  530. package/dist/utils/chars.js.map +1 -0
  531. package/dist/utils/chart-scale.cjs +43 -0
  532. package/dist/utils/chart-scale.cjs.map +1 -0
  533. package/dist/utils/chart-scale.d.cts +22 -0
  534. package/dist/utils/chart-scale.d.ts +22 -0
  535. package/dist/utils/chart-scale.js +41 -0
  536. package/dist/utils/chart-scale.js.map +1 -0
  537. package/dist/utils/cn.cjs +10 -0
  538. package/dist/utils/cn.d.cts +4 -0
  539. package/dist/utils/cn.d.ts +4 -0
  540. package/dist/utils/cn.js +3 -0
  541. package/dist/utils/date-mask.cjs +45 -0
  542. package/dist/utils/date-mask.cjs.map +1 -0
  543. package/dist/utils/date-mask.d.cts +17 -0
  544. package/dist/utils/date-mask.d.ts +17 -0
  545. package/dist/utils/date-mask.js +41 -0
  546. package/dist/utils/date-mask.js.map +1 -0
  547. package/dist/utils/format.cjs +57 -0
  548. package/dist/utils/format.cjs.map +1 -0
  549. package/dist/utils/format.d.cts +23 -0
  550. package/dist/utils/format.d.ts +23 -0
  551. package/dist/utils/format.js +47 -0
  552. package/dist/utils/format.js.map +1 -0
  553. package/package.json +78 -63
  554. package/dist/index.cjs +0 -1631
  555. package/dist/index.cjs.map +0 -1
  556. package/dist/index.css +0 -1
  557. package/dist/index.d.cts +0 -299
  558. package/dist/index.d.ts +0 -299
  559. package/dist/index.js +0 -1518
  560. package/dist/index.js.map +0 -1
  561. package/dist/styles.js +0 -1
@@ -0,0 +1,33 @@
1
+ "use client";
2
+ import { MaterialSymbol } from "../icons/material-symbol.js";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ //#region src/components/empty-state.tsx
5
+ function EmptyState({ action, description, icon, title }) {
6
+ return /* @__PURE__ */ jsxs("div", {
7
+ className: "flex flex-col items-center gap-4 rounded-2xl border border-dashed border-gray px-6 py-12 text-center",
8
+ children: [
9
+ icon && /* @__PURE__ */ jsx("div", {
10
+ className: "flex size-12 items-center justify-center rounded-xl bg-base-gray-soft",
11
+ children: /* @__PURE__ */ jsx(MaterialSymbol, {
12
+ className: "text-[20px] text-gray-light",
13
+ name: icon
14
+ })
15
+ }),
16
+ /* @__PURE__ */ jsxs("div", {
17
+ className: "flex flex-col gap-1",
18
+ children: [/* @__PURE__ */ jsx("h3", {
19
+ className: "text-base font-bold text-gray",
20
+ children: title
21
+ }), description && /* @__PURE__ */ jsx("p", {
22
+ className: "mx-auto max-w-md text-sm text-gray-light",
23
+ children: description
24
+ })]
25
+ }),
26
+ action
27
+ ]
28
+ });
29
+ }
30
+ //#endregion
31
+ export { EmptyState };
32
+
33
+ //# sourceMappingURL=empty-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"empty-state.js","names":[],"sources":["../../src/components/empty-state.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport {\n MaterialSymbol,\n type MaterialSymbolIconName,\n} from '../icons/material-symbol'\n\ninterface EmptyStateProps {\n title: string\n description?: string\n icon?: MaterialSymbolIconName\n action?: ReactNode\n}\n\nexport function EmptyState({\n action,\n description,\n icon,\n title,\n}: EmptyStateProps) {\n return (\n <div className=\"flex flex-col items-center gap-4 rounded-2xl border border-dashed border-gray px-6 py-12 text-center\">\n {icon && (\n <div className=\"flex size-12 items-center justify-center rounded-xl bg-base-gray-soft\">\n <MaterialSymbol className=\"text-[20px] text-gray-light\" name={icon} />\n </div>\n )}\n <div className=\"flex flex-col gap-1\">\n <h3 className=\"text-base font-bold text-gray\">{title}</h3>\n {description && (\n <p className=\"mx-auto max-w-md text-sm text-gray-light\">\n {description}\n </p>\n )}\n </div>\n {action}\n </div>\n )\n}\n\nexport type { EmptyStateProps }\n"],"mappings":";;;;AAaA,SAAgB,WAAW,EACzB,QACA,aACA,MACA,SACkB;AAClB,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf;GACG,QACC,oBAAC,OAAD;IAAK,WAAU;cACb,oBAAC,gBAAD;KAAgB,WAAU;KAA8B,MAAM;KAAQ,CAAA;IAClE,CAAA;GAER,qBAAC,OAAD;IAAK,WAAU;cAAf,CACE,oBAAC,MAAD;KAAI,WAAU;eAAiC;KAAW,CAAA,EACzD,eACC,oBAAC,KAAD;KAAG,WAAU;eACV;KACC,CAAA,CAEF;;GACL;GACG"}
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ require("../chunk-aJGBMT86.cjs");
4
+ const require_components_bar_chart = require("./bar-chart.cjs");
5
+ const require_components_number_flow = require("./number-flow.cjs");
6
+ let react_jsx_runtime = require("react/jsx-runtime");
7
+ //#region src/components/energy-bar-chart.tsx
8
+ function EnergyBarChart({ totalSuffix, totalFormat, className, ...rest }) {
9
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_bar_chart.BarChart, {
10
+ ...rest,
11
+ className,
12
+ renderTotal: (value, animated) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_number_flow, {
13
+ value,
14
+ animated,
15
+ ...totalSuffix !== void 0 && { suffix: totalSuffix },
16
+ ...totalFormat !== void 0 && { format: totalFormat },
17
+ className: "text-base font-bold text-gray tabular-nums"
18
+ })
19
+ });
20
+ }
21
+ //#endregion
22
+ exports.EnergyBarChart = EnergyBarChart;
23
+
24
+ //# sourceMappingURL=energy-bar-chart.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"energy-bar-chart.cjs","names":["BarChart","NumberFlow"],"sources":["../../src/components/energy-bar-chart.tsx"],"sourcesContent":["import {\n BarChart,\n type BarChartCategory,\n type BarChartLineSeries,\n type BarChartSeries,\n} from './bar-chart'\nimport NumberFlow, { type Format } from './number-flow'\n\nexport type Category = BarChartCategory\n\nexport interface HourBucket {\n hour: number\n solar: number\n battery: number\n grid: number\n}\n\nexport type EnergyBarSeries<TDatum = HourBucket> = BarChartSeries<TDatum>\nexport type EnergyBarLineSeries<TDatum = HourBucket> =\n BarChartLineSeries<TDatum>\n\ninterface EnergyBarChartProps<TDatum> {\n data: TDatum[]\n series: BarChartSeries<TDatum>[]\n lines?: BarChartLineSeries<TDatum>[]\n getCategory: (datum: TDatum) => Category\n categories?: Category[]\n categoryTicks?: Category[]\n formatCategory?: (category: Category) => string\n formatTooltipCategory?: (category: Category) => string\n highlightedCategory?: Category\n showHighlightLine?: boolean\n title?: string\n yAxisUnit?: string\n formatValue?: (value: number) => string\n totalSuffix?: string\n totalFormat?: Format\n height?: number\n className?: string\n}\n\nexport function EnergyBarChart<TDatum>({\n totalSuffix,\n totalFormat,\n className,\n ...rest\n}: EnergyBarChartProps<TDatum>): React.ReactElement {\n return (\n <BarChart<TDatum>\n {...rest}\n className={className}\n renderTotal={(value, animated) => (\n <NumberFlow\n value={value}\n animated={animated}\n {...(totalSuffix !== undefined && { suffix: totalSuffix })}\n {...(totalFormat !== undefined && { format: totalFormat })}\n className=\"text-base font-bold text-gray tabular-nums\"\n />\n )}\n />\n )\n}\n"],"mappings":";;;;;;;AAyCA,SAAgB,eAAuB,EACrC,aACA,aACA,WACA,GAAG,QAC+C;AAClD,QACE,iBAAA,GAAA,kBAAA,KAACA,6BAAAA,UAAD;EACE,GAAI;EACO;EACX,cAAc,OAAO,aACnB,iBAAA,GAAA,kBAAA,KAACC,gCAAD;GACS;GACG;GACV,GAAK,gBAAgB,KAAA,KAAa,EAAE,QAAQ,aAAa;GACzD,GAAK,gBAAgB,KAAA,KAAa,EAAE,QAAQ,aAAa;GACzD,WAAU;GACV,CAAA;EAEJ,CAAA"}
@@ -0,0 +1,43 @@
1
+ "use client";
2
+
3
+ import { BarChartCategory, BarChartLineSeries, BarChartSeries } from "./bar-chart.cjs";
4
+ import { t as Format } from "../number-flow-DMJouddg.cjs";
5
+
6
+ //#region src/components/energy-bar-chart.d.ts
7
+ type Category = BarChartCategory;
8
+ interface HourBucket {
9
+ hour: number;
10
+ solar: number;
11
+ battery: number;
12
+ grid: number;
13
+ }
14
+ type EnergyBarSeries<TDatum = HourBucket> = BarChartSeries<TDatum>;
15
+ type EnergyBarLineSeries<TDatum = HourBucket> = BarChartLineSeries<TDatum>;
16
+ interface EnergyBarChartProps<TDatum> {
17
+ data: TDatum[];
18
+ series: BarChartSeries<TDatum>[];
19
+ lines?: BarChartLineSeries<TDatum>[];
20
+ getCategory: (datum: TDatum) => Category;
21
+ categories?: Category[];
22
+ categoryTicks?: Category[];
23
+ formatCategory?: (category: Category) => string;
24
+ formatTooltipCategory?: (category: Category) => string;
25
+ highlightedCategory?: Category;
26
+ showHighlightLine?: boolean;
27
+ title?: string;
28
+ yAxisUnit?: string;
29
+ formatValue?: (value: number) => string;
30
+ totalSuffix?: string;
31
+ totalFormat?: Format;
32
+ height?: number;
33
+ className?: string;
34
+ }
35
+ declare function EnergyBarChart<TDatum>({
36
+ totalSuffix,
37
+ totalFormat,
38
+ className,
39
+ ...rest
40
+ }: EnergyBarChartProps<TDatum>): React.ReactElement;
41
+ //#endregion
42
+ export { Category, EnergyBarChart, EnergyBarLineSeries, EnergyBarSeries, HourBucket };
43
+ //# sourceMappingURL=energy-bar-chart.d.cts.map
@@ -0,0 +1,43 @@
1
+ "use client";
2
+
3
+ import { BarChartCategory, BarChartLineSeries, BarChartSeries } from "./bar-chart.js";
4
+ import { t as Format } from "../number-flow-DSbucQ_K.js";
5
+
6
+ //#region src/components/energy-bar-chart.d.ts
7
+ type Category = BarChartCategory;
8
+ interface HourBucket {
9
+ hour: number;
10
+ solar: number;
11
+ battery: number;
12
+ grid: number;
13
+ }
14
+ type EnergyBarSeries<TDatum = HourBucket> = BarChartSeries<TDatum>;
15
+ type EnergyBarLineSeries<TDatum = HourBucket> = BarChartLineSeries<TDatum>;
16
+ interface EnergyBarChartProps<TDatum> {
17
+ data: TDatum[];
18
+ series: BarChartSeries<TDatum>[];
19
+ lines?: BarChartLineSeries<TDatum>[];
20
+ getCategory: (datum: TDatum) => Category;
21
+ categories?: Category[];
22
+ categoryTicks?: Category[];
23
+ formatCategory?: (category: Category) => string;
24
+ formatTooltipCategory?: (category: Category) => string;
25
+ highlightedCategory?: Category;
26
+ showHighlightLine?: boolean;
27
+ title?: string;
28
+ yAxisUnit?: string;
29
+ formatValue?: (value: number) => string;
30
+ totalSuffix?: string;
31
+ totalFormat?: Format;
32
+ height?: number;
33
+ className?: string;
34
+ }
35
+ declare function EnergyBarChart<TDatum>({
36
+ totalSuffix,
37
+ totalFormat,
38
+ className,
39
+ ...rest
40
+ }: EnergyBarChartProps<TDatum>): React.ReactElement;
41
+ //#endregion
42
+ export { Category, EnergyBarChart, EnergyBarLineSeries, EnergyBarSeries, HourBucket };
43
+ //# sourceMappingURL=energy-bar-chart.d.ts.map
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ import { BarChart } from "./bar-chart.js";
3
+ import NumberFlow from "./number-flow.js";
4
+ import { jsx } from "react/jsx-runtime";
5
+ //#region src/components/energy-bar-chart.tsx
6
+ function EnergyBarChart({ totalSuffix, totalFormat, className, ...rest }) {
7
+ return /* @__PURE__ */ jsx(BarChart, {
8
+ ...rest,
9
+ className,
10
+ renderTotal: (value, animated) => /* @__PURE__ */ jsx(NumberFlow, {
11
+ value,
12
+ animated,
13
+ ...totalSuffix !== void 0 && { suffix: totalSuffix },
14
+ ...totalFormat !== void 0 && { format: totalFormat },
15
+ className: "text-base font-bold text-gray tabular-nums"
16
+ })
17
+ });
18
+ }
19
+ //#endregion
20
+ export { EnergyBarChart };
21
+
22
+ //# sourceMappingURL=energy-bar-chart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"energy-bar-chart.js","names":[],"sources":["../../src/components/energy-bar-chart.tsx"],"sourcesContent":["import {\n BarChart,\n type BarChartCategory,\n type BarChartLineSeries,\n type BarChartSeries,\n} from './bar-chart'\nimport NumberFlow, { type Format } from './number-flow'\n\nexport type Category = BarChartCategory\n\nexport interface HourBucket {\n hour: number\n solar: number\n battery: number\n grid: number\n}\n\nexport type EnergyBarSeries<TDatum = HourBucket> = BarChartSeries<TDatum>\nexport type EnergyBarLineSeries<TDatum = HourBucket> =\n BarChartLineSeries<TDatum>\n\ninterface EnergyBarChartProps<TDatum> {\n data: TDatum[]\n series: BarChartSeries<TDatum>[]\n lines?: BarChartLineSeries<TDatum>[]\n getCategory: (datum: TDatum) => Category\n categories?: Category[]\n categoryTicks?: Category[]\n formatCategory?: (category: Category) => string\n formatTooltipCategory?: (category: Category) => string\n highlightedCategory?: Category\n showHighlightLine?: boolean\n title?: string\n yAxisUnit?: string\n formatValue?: (value: number) => string\n totalSuffix?: string\n totalFormat?: Format\n height?: number\n className?: string\n}\n\nexport function EnergyBarChart<TDatum>({\n totalSuffix,\n totalFormat,\n className,\n ...rest\n}: EnergyBarChartProps<TDatum>): React.ReactElement {\n return (\n <BarChart<TDatum>\n {...rest}\n className={className}\n renderTotal={(value, animated) => (\n <NumberFlow\n value={value}\n animated={animated}\n {...(totalSuffix !== undefined && { suffix: totalSuffix })}\n {...(totalFormat !== undefined && { format: totalFormat })}\n className=\"text-base font-bold text-gray tabular-nums\"\n />\n )}\n />\n )\n}\n"],"mappings":";;;;;AAyCA,SAAgB,eAAuB,EACrC,aACA,aACA,WACA,GAAG,QAC+C;AAClD,QACE,oBAAC,UAAD;EACE,GAAI;EACO;EACX,cAAc,OAAO,aACnB,oBAAC,YAAD;GACS;GACG;GACV,GAAK,gBAAgB,KAAA,KAAa,EAAE,QAAQ,aAAa;GACzD,GAAK,gBAAgB,KAAA,KAAa,EAAE,QAAQ,aAAa;GACzD,WAAU;GACV,CAAA;EAEJ,CAAA"}
@@ -0,0 +1,81 @@
1
+ "use client";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ require("../chunk-aJGBMT86.cjs");
4
+ require("../utils/chars.cjs");
5
+ const require_utils_format = require("../utils/format.cjs");
6
+ const require_components_donut_chart = require("./donut-chart.cjs");
7
+ let react = require("react");
8
+ let react_jsx_runtime = require("react/jsx-runtime");
9
+ //#region src/components/energy-breakdown.tsx
10
+ function formatBreakdownCenter(v) {
11
+ if (v >= 1e3) return require_utils_format.formatThousands(v);
12
+ if (v >= 100) return require_utils_format.integerFormat.format(v);
13
+ if (v >= 10) return require_utils_format.oneDecimalFormat.format(v);
14
+ return require_utils_format.twoDecimalFormat.format(v);
15
+ }
16
+ function EnergyBreakdown({ title, subtitle, items, centerSub = "kWh" }) {
17
+ const sortedItems = (0, react.useMemo)(() => [...items].sort((a, b) => b.value - a.value), [items]);
18
+ const total = items.reduce((s, i) => s + i.value, 0);
19
+ const centerTotal = items.filter((i) => !i.excludeFromCenterTotal).reduce((s, i) => s + i.value, 0);
20
+ if (total === 0) return null;
21
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
22
+ className: "flex flex-col gap-4 pt-3 pb-5",
23
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
24
+ className: "flex flex-col gap-0.5",
25
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
26
+ className: "text-sm font-semibold text-gray",
27
+ children: title
28
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
29
+ className: "text-xs text-gray-light",
30
+ children: subtitle
31
+ })]
32
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
33
+ className: "flex items-center gap-6",
34
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_donut_chart.DonutChart, {
35
+ centerLabel: formatBreakdownCenter(centerTotal),
36
+ centerSub,
37
+ segments: sortedItems.map(({ value, color }) => ({
38
+ value,
39
+ color
40
+ }))
41
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
42
+ className: "flex flex-1 flex-col gap-3",
43
+ children: sortedItems.map(({ label, value, color }) => {
44
+ const pct = value / total * 100;
45
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
46
+ className: "flex flex-col gap-1.5",
47
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
48
+ className: "flex items-baseline justify-between gap-2",
49
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
50
+ className: "min-w-0 truncate text-sm font-medium text-gray",
51
+ children: label
52
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
53
+ className: "flex shrink-0 items-baseline gap-1.5 text-xs tabular-nums",
54
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
55
+ className: "text-gray-light",
56
+ children: require_utils_format.formatEnergy(value)
57
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
58
+ className: "font-semibold text-gray",
59
+ children: `${require_utils_format.integerFormat.format(pct)} %`
60
+ })]
61
+ })]
62
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
63
+ className: "h-1 w-full overflow-hidden rounded-full bg-slate-a4",
64
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
65
+ className: "h-full rounded-full",
66
+ style: {
67
+ width: `${pct}%`,
68
+ background: color
69
+ }
70
+ })
71
+ })]
72
+ }, label);
73
+ })
74
+ })]
75
+ })]
76
+ });
77
+ }
78
+ //#endregion
79
+ exports.EnergyBreakdown = EnergyBreakdown;
80
+
81
+ //# sourceMappingURL=energy-breakdown.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"energy-breakdown.cjs","names":["formatThousands","integerFormat","oneDecimalFormat","twoDecimalFormat","DonutChart","formatEnergy"],"sources":["../../src/components/energy-breakdown.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { NARROW_NBSP } from '../utils/chars'\nimport {\n formatEnergy,\n formatThousands,\n integerFormat,\n oneDecimalFormat,\n twoDecimalFormat,\n} from '../utils/format'\nimport { DonutChart } from './donut-chart'\n\nexport type BreakdownItem = {\n label: string\n value: number\n color: string\n excludeFromCenterTotal?: boolean\n}\n\nexport type EnergyBreakdownProps = {\n title: string\n subtitle: string\n items: BreakdownItem[]\n centerSub?: string\n}\n\nfunction formatBreakdownCenter(v: number) {\n if (v >= 1000) return formatThousands(v)\n if (v >= 100) return integerFormat.format(v)\n if (v >= 10) return oneDecimalFormat.format(v)\n return twoDecimalFormat.format(v)\n}\n\nexport function EnergyBreakdown({\n title,\n subtitle,\n items,\n centerSub = 'kWh',\n}: EnergyBreakdownProps) {\n const sortedItems = useMemo(\n () => [...items].sort((a, b) => b.value - a.value),\n [items],\n )\n\n const total = items.reduce((s, i) => s + i.value, 0)\n const centerTotal = items\n .filter((i) => !i.excludeFromCenterTotal)\n .reduce((s, i) => s + i.value, 0)\n\n const dataEmpty = total === 0\n\n if (dataEmpty) return null\n\n return (\n <div className=\"flex flex-col gap-4 pt-3 pb-5\">\n <div className=\"flex flex-col gap-0.5\">\n <span className=\"text-sm font-semibold text-gray\">{title}</span>\n <span className=\"text-xs text-gray-light\">{subtitle}</span>\n </div>\n\n <div className=\"flex items-center gap-6\">\n <DonutChart\n centerLabel={formatBreakdownCenter(centerTotal)}\n centerSub={centerSub}\n segments={sortedItems.map(({ value, color }) => ({ value, color }))}\n />\n\n <div className=\"flex flex-1 flex-col gap-3\">\n {sortedItems.map(({ label, value, color }) => {\n const pct = (value / total) * 100\n return (\n <div key={label} className=\"flex flex-col gap-1.5\">\n <div className=\"flex items-baseline justify-between gap-2\">\n <span className=\"min-w-0 truncate text-sm font-medium text-gray\">\n {label}\n </span>\n <span className=\"flex shrink-0 items-baseline gap-1.5 text-xs tabular-nums\">\n <span className=\"text-gray-light\">\n {formatEnergy(value)}\n </span>\n <span className=\"font-semibold text-gray\">\n {`${integerFormat.format(pct)}${NARROW_NBSP}%`}\n </span>\n </span>\n </div>\n <div className=\"h-1 w-full overflow-hidden rounded-full bg-slate-a4\">\n <div\n className=\"h-full rounded-full\"\n style={{ width: `${pct}%`, background: color }}\n />\n </div>\n </div>\n )\n })}\n </div>\n </div>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;AAyBA,SAAS,sBAAsB,GAAW;AACxC,KAAI,KAAK,IAAM,QAAOA,qBAAAA,gBAAgB,EAAE;AACxC,KAAI,KAAK,IAAK,QAAOC,qBAAAA,cAAc,OAAO,EAAE;AAC5C,KAAI,KAAK,GAAI,QAAOC,qBAAAA,iBAAiB,OAAO,EAAE;AAC9C,QAAOC,qBAAAA,iBAAiB,OAAO,EAAE;;AAGnC,SAAgB,gBAAgB,EAC9B,OACA,UACA,OACA,YAAY,SACW;CACvB,MAAM,eAAA,GAAA,MAAA,eACE,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM,EAClD,CAAC,MAAM,CACR;CAED,MAAM,QAAQ,MAAM,QAAQ,GAAG,MAAM,IAAI,EAAE,OAAO,EAAE;CACpD,MAAM,cAAc,MACjB,QAAQ,MAAM,CAAC,EAAE,uBAAuB,CACxC,QAAQ,GAAG,MAAM,IAAI,EAAE,OAAO,EAAE;AAInC,KAFkB,UAAU,EAEb,QAAO;AAEtB,QACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;EAAK,WAAU;YAAf,CACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;GAAK,WAAU;aAAf,CACE,iBAAA,GAAA,kBAAA,KAAC,QAAD;IAAM,WAAU;cAAmC;IAAa,CAAA,EAChE,iBAAA,GAAA,kBAAA,KAAC,QAAD;IAAM,WAAU;cAA2B;IAAgB,CAAA,CACvD;MAEN,iBAAA,GAAA,kBAAA,MAAC,OAAD;GAAK,WAAU;aAAf,CACE,iBAAA,GAAA,kBAAA,KAACC,+BAAAA,YAAD;IACE,aAAa,sBAAsB,YAAY;IACpC;IACX,UAAU,YAAY,KAAK,EAAE,OAAO,aAAa;KAAE;KAAO;KAAO,EAAE;IACnE,CAAA,EAEF,iBAAA,GAAA,kBAAA,KAAC,OAAD;IAAK,WAAU;cACZ,YAAY,KAAK,EAAE,OAAO,OAAO,YAAY;KAC5C,MAAM,MAAO,QAAQ,QAAS;AAC9B,YACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;MAAiB,WAAU;gBAA3B,CACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;OAAK,WAAU;iBAAf,CACE,iBAAA,GAAA,kBAAA,KAAC,QAAD;QAAM,WAAU;kBACb;QACI,CAAA,EACP,iBAAA,GAAA,kBAAA,MAAC,QAAD;QAAM,WAAU;kBAAhB,CACE,iBAAA,GAAA,kBAAA,KAAC,QAAD;SAAM,WAAU;mBACbC,qBAAAA,aAAa,MAAM;SACf,CAAA,EACP,iBAAA,GAAA,kBAAA,KAAC,QAAD;SAAM,WAAU;mBACb,GAAGJ,qBAAAA,cAAc,OAAO,IAAI;SACxB,CAAA,CACF;UACH;UACN,iBAAA,GAAA,kBAAA,KAAC,OAAD;OAAK,WAAU;iBACb,iBAAA,GAAA,kBAAA,KAAC,OAAD;QACE,WAAU;QACV,OAAO;SAAE,OAAO,GAAG,IAAI;SAAI,YAAY;SAAO;QAC9C,CAAA;OACE,CAAA,CACF;QApBI,MAoBJ;MAER;IACE,CAAA,CACF;KACF"}
@@ -0,0 +1,26 @@
1
+ "use client";
2
+
3
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
4
+
5
+ //#region src/components/energy-breakdown.d.ts
6
+ type BreakdownItem = {
7
+ label: string;
8
+ value: number;
9
+ color: string;
10
+ excludeFromCenterTotal?: boolean;
11
+ };
12
+ type EnergyBreakdownProps = {
13
+ title: string;
14
+ subtitle: string;
15
+ items: BreakdownItem[];
16
+ centerSub?: string;
17
+ };
18
+ declare function EnergyBreakdown({
19
+ title,
20
+ subtitle,
21
+ items,
22
+ centerSub
23
+ }: EnergyBreakdownProps): _$react_jsx_runtime0.JSX.Element | null;
24
+ //#endregion
25
+ export { BreakdownItem, EnergyBreakdown, EnergyBreakdownProps };
26
+ //# sourceMappingURL=energy-breakdown.d.cts.map
@@ -0,0 +1,26 @@
1
+ "use client";
2
+
3
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
4
+
5
+ //#region src/components/energy-breakdown.d.ts
6
+ type BreakdownItem = {
7
+ label: string;
8
+ value: number;
9
+ color: string;
10
+ excludeFromCenterTotal?: boolean;
11
+ };
12
+ type EnergyBreakdownProps = {
13
+ title: string;
14
+ subtitle: string;
15
+ items: BreakdownItem[];
16
+ centerSub?: string;
17
+ };
18
+ declare function EnergyBreakdown({
19
+ title,
20
+ subtitle,
21
+ items,
22
+ centerSub
23
+ }: EnergyBreakdownProps): _$react_jsx_runtime0.JSX.Element | null;
24
+ //#endregion
25
+ export { BreakdownItem, EnergyBreakdown, EnergyBreakdownProps };
26
+ //# sourceMappingURL=energy-breakdown.d.ts.map
@@ -0,0 +1,79 @@
1
+ "use client";
2
+ import "../utils/chars.js";
3
+ import { formatEnergy, formatThousands, integerFormat, oneDecimalFormat, twoDecimalFormat } from "../utils/format.js";
4
+ import { DonutChart } from "./donut-chart.js";
5
+ import { useMemo } from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/components/energy-breakdown.tsx
8
+ function formatBreakdownCenter(v) {
9
+ if (v >= 1e3) return formatThousands(v);
10
+ if (v >= 100) return integerFormat.format(v);
11
+ if (v >= 10) return oneDecimalFormat.format(v);
12
+ return twoDecimalFormat.format(v);
13
+ }
14
+ function EnergyBreakdown({ title, subtitle, items, centerSub = "kWh" }) {
15
+ const sortedItems = useMemo(() => [...items].sort((a, b) => b.value - a.value), [items]);
16
+ const total = items.reduce((s, i) => s + i.value, 0);
17
+ const centerTotal = items.filter((i) => !i.excludeFromCenterTotal).reduce((s, i) => s + i.value, 0);
18
+ if (total === 0) return null;
19
+ return /* @__PURE__ */ jsxs("div", {
20
+ className: "flex flex-col gap-4 pt-3 pb-5",
21
+ children: [/* @__PURE__ */ jsxs("div", {
22
+ className: "flex flex-col gap-0.5",
23
+ children: [/* @__PURE__ */ jsx("span", {
24
+ className: "text-sm font-semibold text-gray",
25
+ children: title
26
+ }), /* @__PURE__ */ jsx("span", {
27
+ className: "text-xs text-gray-light",
28
+ children: subtitle
29
+ })]
30
+ }), /* @__PURE__ */ jsxs("div", {
31
+ className: "flex items-center gap-6",
32
+ children: [/* @__PURE__ */ jsx(DonutChart, {
33
+ centerLabel: formatBreakdownCenter(centerTotal),
34
+ centerSub,
35
+ segments: sortedItems.map(({ value, color }) => ({
36
+ value,
37
+ color
38
+ }))
39
+ }), /* @__PURE__ */ jsx("div", {
40
+ className: "flex flex-1 flex-col gap-3",
41
+ children: sortedItems.map(({ label, value, color }) => {
42
+ const pct = value / total * 100;
43
+ return /* @__PURE__ */ jsxs("div", {
44
+ className: "flex flex-col gap-1.5",
45
+ children: [/* @__PURE__ */ jsxs("div", {
46
+ className: "flex items-baseline justify-between gap-2",
47
+ children: [/* @__PURE__ */ jsx("span", {
48
+ className: "min-w-0 truncate text-sm font-medium text-gray",
49
+ children: label
50
+ }), /* @__PURE__ */ jsxs("span", {
51
+ className: "flex shrink-0 items-baseline gap-1.5 text-xs tabular-nums",
52
+ children: [/* @__PURE__ */ jsx("span", {
53
+ className: "text-gray-light",
54
+ children: formatEnergy(value)
55
+ }), /* @__PURE__ */ jsx("span", {
56
+ className: "font-semibold text-gray",
57
+ children: `${integerFormat.format(pct)} %`
58
+ })]
59
+ })]
60
+ }), /* @__PURE__ */ jsx("div", {
61
+ className: "h-1 w-full overflow-hidden rounded-full bg-slate-a4",
62
+ children: /* @__PURE__ */ jsx("div", {
63
+ className: "h-full rounded-full",
64
+ style: {
65
+ width: `${pct}%`,
66
+ background: color
67
+ }
68
+ })
69
+ })]
70
+ }, label);
71
+ })
72
+ })]
73
+ })]
74
+ });
75
+ }
76
+ //#endregion
77
+ export { EnergyBreakdown };
78
+
79
+ //# sourceMappingURL=energy-breakdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"energy-breakdown.js","names":[],"sources":["../../src/components/energy-breakdown.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { NARROW_NBSP } from '../utils/chars'\nimport {\n formatEnergy,\n formatThousands,\n integerFormat,\n oneDecimalFormat,\n twoDecimalFormat,\n} from '../utils/format'\nimport { DonutChart } from './donut-chart'\n\nexport type BreakdownItem = {\n label: string\n value: number\n color: string\n excludeFromCenterTotal?: boolean\n}\n\nexport type EnergyBreakdownProps = {\n title: string\n subtitle: string\n items: BreakdownItem[]\n centerSub?: string\n}\n\nfunction formatBreakdownCenter(v: number) {\n if (v >= 1000) return formatThousands(v)\n if (v >= 100) return integerFormat.format(v)\n if (v >= 10) return oneDecimalFormat.format(v)\n return twoDecimalFormat.format(v)\n}\n\nexport function EnergyBreakdown({\n title,\n subtitle,\n items,\n centerSub = 'kWh',\n}: EnergyBreakdownProps) {\n const sortedItems = useMemo(\n () => [...items].sort((a, b) => b.value - a.value),\n [items],\n )\n\n const total = items.reduce((s, i) => s + i.value, 0)\n const centerTotal = items\n .filter((i) => !i.excludeFromCenterTotal)\n .reduce((s, i) => s + i.value, 0)\n\n const dataEmpty = total === 0\n\n if (dataEmpty) return null\n\n return (\n <div className=\"flex flex-col gap-4 pt-3 pb-5\">\n <div className=\"flex flex-col gap-0.5\">\n <span className=\"text-sm font-semibold text-gray\">{title}</span>\n <span className=\"text-xs text-gray-light\">{subtitle}</span>\n </div>\n\n <div className=\"flex items-center gap-6\">\n <DonutChart\n centerLabel={formatBreakdownCenter(centerTotal)}\n centerSub={centerSub}\n segments={sortedItems.map(({ value, color }) => ({ value, color }))}\n />\n\n <div className=\"flex flex-1 flex-col gap-3\">\n {sortedItems.map(({ label, value, color }) => {\n const pct = (value / total) * 100\n return (\n <div key={label} className=\"flex flex-col gap-1.5\">\n <div className=\"flex items-baseline justify-between gap-2\">\n <span className=\"min-w-0 truncate text-sm font-medium text-gray\">\n {label}\n </span>\n <span className=\"flex shrink-0 items-baseline gap-1.5 text-xs tabular-nums\">\n <span className=\"text-gray-light\">\n {formatEnergy(value)}\n </span>\n <span className=\"font-semibold text-gray\">\n {`${integerFormat.format(pct)}${NARROW_NBSP}%`}\n </span>\n </span>\n </div>\n <div className=\"h-1 w-full overflow-hidden rounded-full bg-slate-a4\">\n <div\n className=\"h-full rounded-full\"\n style={{ width: `${pct}%`, background: color }}\n />\n </div>\n </div>\n )\n })}\n </div>\n </div>\n </div>\n )\n}\n"],"mappings":";;;;;;;AAyBA,SAAS,sBAAsB,GAAW;AACxC,KAAI,KAAK,IAAM,QAAO,gBAAgB,EAAE;AACxC,KAAI,KAAK,IAAK,QAAO,cAAc,OAAO,EAAE;AAC5C,KAAI,KAAK,GAAI,QAAO,iBAAiB,OAAO,EAAE;AAC9C,QAAO,iBAAiB,OAAO,EAAE;;AAGnC,SAAgB,gBAAgB,EAC9B,OACA,UACA,OACA,YAAY,SACW;CACvB,MAAM,cAAc,cACZ,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM,EAClD,CAAC,MAAM,CACR;CAED,MAAM,QAAQ,MAAM,QAAQ,GAAG,MAAM,IAAI,EAAE,OAAO,EAAE;CACpD,MAAM,cAAc,MACjB,QAAQ,MAAM,CAAC,EAAE,uBAAuB,CACxC,QAAQ,GAAG,MAAM,IAAI,EAAE,OAAO,EAAE;AAInC,KAFkB,UAAU,EAEb,QAAO;AAEtB,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,qBAAC,OAAD;GAAK,WAAU;aAAf,CACE,oBAAC,QAAD;IAAM,WAAU;cAAmC;IAAa,CAAA,EAChE,oBAAC,QAAD;IAAM,WAAU;cAA2B;IAAgB,CAAA,CACvD;MAEN,qBAAC,OAAD;GAAK,WAAU;aAAf,CACE,oBAAC,YAAD;IACE,aAAa,sBAAsB,YAAY;IACpC;IACX,UAAU,YAAY,KAAK,EAAE,OAAO,aAAa;KAAE;KAAO;KAAO,EAAE;IACnE,CAAA,EAEF,oBAAC,OAAD;IAAK,WAAU;cACZ,YAAY,KAAK,EAAE,OAAO,OAAO,YAAY;KAC5C,MAAM,MAAO,QAAQ,QAAS;AAC9B,YACE,qBAAC,OAAD;MAAiB,WAAU;gBAA3B,CACE,qBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,oBAAC,QAAD;QAAM,WAAU;kBACb;QACI,CAAA,EACP,qBAAC,QAAD;QAAM,WAAU;kBAAhB,CACE,oBAAC,QAAD;SAAM,WAAU;mBACb,aAAa,MAAM;SACf,CAAA,EACP,oBAAC,QAAD;SAAM,WAAU;mBACb,GAAG,cAAc,OAAO,IAAI;SACxB,CAAA,CACF;UACH;UACN,oBAAC,OAAD;OAAK,WAAU;iBACb,oBAAC,OAAD;QACE,WAAU;QACV,OAAO;SAAE,OAAO,GAAG,IAAI;SAAI,YAAY;SAAO;QAC9C,CAAA;OACE,CAAA,CACF;QApBI,MAoBJ;MAER;IACE,CAAA,CACF;KACF"}
@@ -0,0 +1,64 @@
1
+ "use client";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ require("../chunk-aJGBMT86.cjs");
4
+ require("../utils/chars.cjs");
5
+ const require_utils_format = require("../utils/format.cjs");
6
+ const require_components_energy_bar_chart = require("./energy-bar-chart.cjs");
7
+ let react_jsx_runtime = require("react/jsx-runtime");
8
+ //#region src/components/energy-history-chart.tsx
9
+ /**
10
+ * Energy-per-bucket stacked bar chart: solar (orange), battery (green) and grid
11
+ * (blue) energy sources stacked per bucket, the total height being the energy
12
+ * consumed. Grid feed-in (translucent blue) dips below the baseline as an
13
+ * export. For cumulative energy (week/month/year views). Thin wrapper over the
14
+ * shared visx `BarChart`, so it inherits the card tooltip and both indicators.
15
+ */
16
+ function EnergyHistoryChart({ data, unit, formatValue, formatBucketLabel, labels, omitSeries, highlightedBucket, showHighlightLine, title, className, height = 260, categoryTicks }) {
17
+ const fmtValue = (value) => formatValue ? formatValue(value) : `${require_utils_format.twoDecimalFormat.format(value)} ${unit}`;
18
+ const omitted = new Set(omitSeries);
19
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_energy_bar_chart.EnergyBarChart, {
20
+ data,
21
+ series: [
22
+ {
23
+ key: "solar",
24
+ label: labels.solar,
25
+ color: "var(--orange-9)",
26
+ getValue: (d) => d.solar
27
+ },
28
+ {
29
+ key: "battery",
30
+ label: labels.battery,
31
+ color: "var(--green-9)",
32
+ getValue: (d) => d.battery
33
+ },
34
+ {
35
+ key: "grid",
36
+ label: labels.grid,
37
+ color: "var(--blue-9)",
38
+ getValue: (d) => d.grid
39
+ },
40
+ ...labels.gridFeedIn !== void 0 ? [{
41
+ key: "gridFeedIn",
42
+ label: labels.gridFeedIn,
43
+ color: "var(--blue-7)",
44
+ getValue: (d) => -Math.max(0, d.gridFeedIn ?? 0)
45
+ }] : []
46
+ ].filter((s) => !omitted.has(s.key)),
47
+ getCategory: (d) => d.bucket,
48
+ title,
49
+ yAxisUnit: unit,
50
+ height,
51
+ className,
52
+ formatValue: fmtValue,
53
+ categoryTicks,
54
+ ...formatBucketLabel && { formatTooltipCategory: (category) => formatBucketLabel(String(category)) },
55
+ totalSuffix: unit,
56
+ totalFormat: { maximumFractionDigits: 2 },
57
+ ...highlightedBucket !== void 0 && { highlightedCategory: highlightedBucket },
58
+ ...showHighlightLine !== void 0 && { showHighlightLine }
59
+ });
60
+ }
61
+ //#endregion
62
+ exports.EnergyHistoryChart = EnergyHistoryChart;
63
+
64
+ //# sourceMappingURL=energy-history-chart.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"energy-history-chart.cjs","names":["valueFormat","EnergyBarChart"],"sources":["../../src/components/energy-history-chart.tsx"],"sourcesContent":["import { NARROW_NBSP } from '../utils/chars'\nimport { twoDecimalFormat as valueFormat } from '../utils/format'\nimport type { BarChartSeries } from './bar-chart'\nimport { EnergyBarChart } from './energy-bar-chart'\n\nexport interface EnergyHistoryDatum {\n /** Bucket label/id (e.g. weekday, day-of-month, month). */\n bucket: string\n /** Solar used on-site (kWh, ≥ 0). */\n solar: number\n /** Battery discharged (kWh, ≥ 0). */\n battery: number\n /** Grid imported (kWh, ≥ 0). */\n grid: number\n /** Grid feed-in (kWh, ≥ 0); drawn below the baseline as an export. */\n gridFeedIn?: number\n}\n\nexport interface EnergyHistoryChartProps {\n data: EnergyHistoryDatum[]\n /** Axis/tooltip unit, e.g. \"kWh\". */\n unit: string\n formatValue?: (value: number) => string\n /** Formats the hovered bucket in the tooltip header. Defaults to the raw bucket. */\n formatBucketLabel?: (bucket: string) => string\n labels: {\n solar: string\n battery: string\n grid: string\n /** Optional; when set, grid feed-in is drawn below the baseline. */\n gridFeedIn?: string\n }\n /** Series to drop entirely (no legend entry, bar segment, or tooltip row). */\n omitSeries?: readonly EnergyHistorySeriesKey[]\n /** Bucket to mark with the current-period dashed line. */\n highlightedBucket?: string\n showHighlightLine?: boolean\n title?: string\n className?: string\n height?: number\n /** Subset of bucket ids to label on the x-axis. Defaults to all buckets. */\n categoryTicks?: string[]\n}\n\nexport type EnergyHistorySeriesKey = 'solar' | 'battery' | 'grid' | 'gridFeedIn'\n\n/**\n * Energy-per-bucket stacked bar chart: solar (orange), battery (green) and grid\n * (blue) energy sources stacked per bucket, the total height being the energy\n * consumed. Grid feed-in (translucent blue) dips below the baseline as an\n * export. For cumulative energy (week/month/year views). Thin wrapper over the\n * shared visx `BarChart`, so it inherits the card tooltip and both indicators.\n */\nexport function EnergyHistoryChart({\n data,\n unit,\n formatValue,\n formatBucketLabel,\n labels,\n omitSeries,\n highlightedBucket,\n showHighlightLine,\n title,\n className,\n height = 260,\n categoryTicks,\n}: EnergyHistoryChartProps) {\n const fmtValue = (value: number) =>\n formatValue\n ? formatValue(value)\n : `${valueFormat.format(value)}${NARROW_NBSP}${unit}`\n\n const omitted = new Set<EnergyHistorySeriesKey>(omitSeries)\n const allSeries: BarChartSeries<EnergyHistoryDatum>[] = [\n {\n key: 'solar',\n label: labels.solar,\n color: 'var(--orange-9)',\n getValue: (d) => d.solar,\n },\n {\n key: 'battery',\n label: labels.battery,\n color: 'var(--green-9)',\n getValue: (d) => d.battery,\n },\n {\n key: 'grid',\n label: labels.grid,\n color: 'var(--blue-9)',\n getValue: (d) => d.grid,\n },\n ...(labels.gridFeedIn !== undefined\n ? [\n {\n key: 'gridFeedIn',\n label: labels.gridFeedIn,\n color: 'var(--blue-7)',\n getValue: (d: EnergyHistoryDatum) =>\n -Math.max(0, d.gridFeedIn ?? 0),\n },\n ]\n : []),\n ]\n const series = allSeries.filter(\n (s) => !omitted.has(s.key as EnergyHistorySeriesKey),\n )\n\n return (\n <EnergyBarChart<EnergyHistoryDatum>\n data={data}\n series={series}\n getCategory={(d) => d.bucket}\n title={title}\n yAxisUnit={unit}\n height={height}\n className={className}\n formatValue={fmtValue}\n categoryTicks={categoryTicks}\n {...(formatBucketLabel && {\n formatTooltipCategory: (category: string | number) =>\n formatBucketLabel(String(category)),\n })}\n totalSuffix={unit}\n totalFormat={{ maximumFractionDigits: 2 }}\n {...(highlightedBucket !== undefined && {\n highlightedCategory: highlightedBucket,\n })}\n {...(showHighlightLine !== undefined && { showHighlightLine })}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;AAqDA,SAAgB,mBAAmB,EACjC,MACA,MACA,aACA,mBACA,QACA,YACA,mBACA,mBACA,OACA,WACA,SAAS,KACT,iBAC0B;CAC1B,MAAM,YAAY,UAChB,cACI,YAAY,MAAM,GAClB,GAAGA,qBAAAA,iBAAY,OAAO,MAAM,IAAiB;CAEnD,MAAM,UAAU,IAAI,IAA4B,WAAW;AAoC3D,QACE,iBAAA,GAAA,kBAAA,KAACC,oCAAAA,gBAAD;EACQ;EACN,QAPW;GA9Bb;IACE,KAAK;IACL,OAAO,OAAO;IACd,OAAO;IACP,WAAW,MAAM,EAAE;IACpB;GACD;IACE,KAAK;IACL,OAAO,OAAO;IACd,OAAO;IACP,WAAW,MAAM,EAAE;IACpB;GACD;IACE,KAAK;IACL,OAAO,OAAO;IACd,OAAO;IACP,WAAW,MAAM,EAAE;IACpB;GACD,GAAI,OAAO,eAAe,KAAA,IACtB,CACE;IACE,KAAK;IACL,OAAO,OAAO;IACd,OAAO;IACP,WAAW,MACT,CAAC,KAAK,IAAI,GAAG,EAAE,cAAc,EAAE;IAClC,CACF,GACD,EAAE;GAEgB,CAAC,QACtB,MAAM,CAAC,QAAQ,IAAI,EAAE,IAA8B,CAMpC;EACd,cAAc,MAAM,EAAE;EACf;EACP,WAAW;EACH;EACG;EACX,aAAa;EACE;EACf,GAAK,qBAAqB,EACxB,wBAAwB,aACtB,kBAAkB,OAAO,SAAS,CAAC,EACtC;EACD,aAAa;EACb,aAAa,EAAE,uBAAuB,GAAG;EACzC,GAAK,sBAAsB,KAAA,KAAa,EACtC,qBAAqB,mBACtB;EACD,GAAK,sBAAsB,KAAA,KAAa,EAAE,mBAAmB;EAC7D,CAAA"}
@@ -0,0 +1,66 @@
1
+ "use client";
2
+
3
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
4
+
5
+ //#region src/components/energy-history-chart.d.ts
6
+ interface EnergyHistoryDatum {
7
+ /** Bucket label/id (e.g. weekday, day-of-month, month). */
8
+ bucket: string;
9
+ /** Solar used on-site (kWh, ≥ 0). */
10
+ solar: number;
11
+ /** Battery discharged (kWh, ≥ 0). */
12
+ battery: number;
13
+ /** Grid imported (kWh, ≥ 0). */
14
+ grid: number;
15
+ /** Grid feed-in (kWh, ≥ 0); drawn below the baseline as an export. */
16
+ gridFeedIn?: number;
17
+ }
18
+ interface EnergyHistoryChartProps {
19
+ data: EnergyHistoryDatum[];
20
+ /** Axis/tooltip unit, e.g. "kWh". */
21
+ unit: string;
22
+ formatValue?: (value: number) => string;
23
+ /** Formats the hovered bucket in the tooltip header. Defaults to the raw bucket. */
24
+ formatBucketLabel?: (bucket: string) => string;
25
+ labels: {
26
+ solar: string;
27
+ battery: string;
28
+ grid: string; /** Optional; when set, grid feed-in is drawn below the baseline. */
29
+ gridFeedIn?: string;
30
+ };
31
+ /** Series to drop entirely (no legend entry, bar segment, or tooltip row). */
32
+ omitSeries?: readonly EnergyHistorySeriesKey[];
33
+ /** Bucket to mark with the current-period dashed line. */
34
+ highlightedBucket?: string;
35
+ showHighlightLine?: boolean;
36
+ title?: string;
37
+ className?: string;
38
+ height?: number;
39
+ /** Subset of bucket ids to label on the x-axis. Defaults to all buckets. */
40
+ categoryTicks?: string[];
41
+ }
42
+ type EnergyHistorySeriesKey = 'solar' | 'battery' | 'grid' | 'gridFeedIn';
43
+ /**
44
+ * Energy-per-bucket stacked bar chart: solar (orange), battery (green) and grid
45
+ * (blue) energy sources stacked per bucket, the total height being the energy
46
+ * consumed. Grid feed-in (translucent blue) dips below the baseline as an
47
+ * export. For cumulative energy (week/month/year views). Thin wrapper over the
48
+ * shared visx `BarChart`, so it inherits the card tooltip and both indicators.
49
+ */
50
+ declare function EnergyHistoryChart({
51
+ data,
52
+ unit,
53
+ formatValue,
54
+ formatBucketLabel,
55
+ labels,
56
+ omitSeries,
57
+ highlightedBucket,
58
+ showHighlightLine,
59
+ title,
60
+ className,
61
+ height,
62
+ categoryTicks
63
+ }: EnergyHistoryChartProps): _$react_jsx_runtime0.JSX.Element;
64
+ //#endregion
65
+ export { EnergyHistoryChart, EnergyHistoryChartProps, EnergyHistoryDatum, EnergyHistorySeriesKey };
66
+ //# sourceMappingURL=energy-history-chart.d.cts.map
@@ -0,0 +1,66 @@
1
+ "use client";
2
+
3
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
4
+
5
+ //#region src/components/energy-history-chart.d.ts
6
+ interface EnergyHistoryDatum {
7
+ /** Bucket label/id (e.g. weekday, day-of-month, month). */
8
+ bucket: string;
9
+ /** Solar used on-site (kWh, ≥ 0). */
10
+ solar: number;
11
+ /** Battery discharged (kWh, ≥ 0). */
12
+ battery: number;
13
+ /** Grid imported (kWh, ≥ 0). */
14
+ grid: number;
15
+ /** Grid feed-in (kWh, ≥ 0); drawn below the baseline as an export. */
16
+ gridFeedIn?: number;
17
+ }
18
+ interface EnergyHistoryChartProps {
19
+ data: EnergyHistoryDatum[];
20
+ /** Axis/tooltip unit, e.g. "kWh". */
21
+ unit: string;
22
+ formatValue?: (value: number) => string;
23
+ /** Formats the hovered bucket in the tooltip header. Defaults to the raw bucket. */
24
+ formatBucketLabel?: (bucket: string) => string;
25
+ labels: {
26
+ solar: string;
27
+ battery: string;
28
+ grid: string; /** Optional; when set, grid feed-in is drawn below the baseline. */
29
+ gridFeedIn?: string;
30
+ };
31
+ /** Series to drop entirely (no legend entry, bar segment, or tooltip row). */
32
+ omitSeries?: readonly EnergyHistorySeriesKey[];
33
+ /** Bucket to mark with the current-period dashed line. */
34
+ highlightedBucket?: string;
35
+ showHighlightLine?: boolean;
36
+ title?: string;
37
+ className?: string;
38
+ height?: number;
39
+ /** Subset of bucket ids to label on the x-axis. Defaults to all buckets. */
40
+ categoryTicks?: string[];
41
+ }
42
+ type EnergyHistorySeriesKey = 'solar' | 'battery' | 'grid' | 'gridFeedIn';
43
+ /**
44
+ * Energy-per-bucket stacked bar chart: solar (orange), battery (green) and grid
45
+ * (blue) energy sources stacked per bucket, the total height being the energy
46
+ * consumed. Grid feed-in (translucent blue) dips below the baseline as an
47
+ * export. For cumulative energy (week/month/year views). Thin wrapper over the
48
+ * shared visx `BarChart`, so it inherits the card tooltip and both indicators.
49
+ */
50
+ declare function EnergyHistoryChart({
51
+ data,
52
+ unit,
53
+ formatValue,
54
+ formatBucketLabel,
55
+ labels,
56
+ omitSeries,
57
+ highlightedBucket,
58
+ showHighlightLine,
59
+ title,
60
+ className,
61
+ height,
62
+ categoryTicks
63
+ }: EnergyHistoryChartProps): _$react_jsx_runtime0.JSX.Element;
64
+ //#endregion
65
+ export { EnergyHistoryChart, EnergyHistoryChartProps, EnergyHistoryDatum, EnergyHistorySeriesKey };
66
+ //# sourceMappingURL=energy-history-chart.d.ts.map