@epilot/spark-ui 1.0.0-alpha.2 → 1.0.0-alpha.3
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.
- package/LICENSE +201 -0
- package/NOTICE +2 -0
- package/README.md +7 -1
- package/dist/chunk-aJGBMT86.cjs +29 -0
- package/dist/components/accordion.cjs +57 -0
- package/dist/components/accordion.cjs.map +1 -0
- package/dist/components/accordion.d.cts +45 -0
- package/dist/components/accordion.d.ts +45 -0
- package/dist/components/accordion.js +51 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/alert-dialog.cjs +137 -0
- package/dist/components/alert-dialog.cjs.map +1 -0
- package/dist/components/alert-dialog.d.cts +63 -0
- package/dist/components/alert-dialog.d.ts +63 -0
- package/dist/components/alert-dialog.js +123 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/attachment.cjs +119 -0
- package/dist/components/attachment.cjs.map +1 -0
- package/dist/components/attachment.d.cts +67 -0
- package/dist/components/attachment.d.ts +67 -0
- package/dist/components/attachment.js +108 -0
- package/dist/components/attachment.js.map +1 -0
- package/dist/components/badge.cjs +20 -0
- package/dist/components/badge.cjs.map +1 -0
- package/dist/components/badge.d.cts +12 -0
- package/dist/components/badge.d.ts +12 -0
- package/dist/components/badge.js +17 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/bar-chart.cjs +519 -0
- package/dist/components/bar-chart.cjs.map +1 -0
- package/dist/components/bar-chart.d.cts +83 -0
- package/dist/components/bar-chart.d.ts +83 -0
- package/dist/components/bar-chart.js +517 -0
- package/dist/components/bar-chart.js.map +1 -0
- package/dist/components/battery-progress-row.cjs +140 -0
- package/dist/components/battery-progress-row.cjs.map +1 -0
- package/dist/components/battery-progress-row.d.cts +78 -0
- package/dist/components/battery-progress-row.d.ts +78 -0
- package/dist/components/battery-progress-row.js +129 -0
- package/dist/components/battery-progress-row.js.map +1 -0
- package/dist/components/breadcrumbs.cjs +65 -0
- package/dist/components/breadcrumbs.cjs.map +1 -0
- package/dist/components/breadcrumbs.d.cts +44 -0
- package/dist/components/breadcrumbs.d.ts +44 -0
- package/dist/components/breadcrumbs.js +58 -0
- package/dist/components/breadcrumbs.js.map +1 -0
- package/dist/components/bubble.cjs +84 -0
- package/dist/components/bubble.cjs.map +1 -0
- package/dist/components/bubble.d.cts +41 -0
- package/dist/components/bubble.d.ts +41 -0
- package/dist/components/bubble.js +78 -0
- package/dist/components/bubble.js.map +1 -0
- package/dist/components/button.cjs +54 -0
- package/dist/components/button.cjs.map +1 -0
- package/dist/components/button.d.cts +34 -0
- package/dist/components/button.d.ts +34 -0
- package/dist/components/button.js +50 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar.cjs +58 -0
- package/dist/components/calendar.cjs.map +1 -0
- package/dist/components/calendar.d.cts +17 -0
- package/dist/components/calendar.d.ts +17 -0
- package/dist/components/calendar.js +55 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/callout.cjs +95 -0
- package/dist/components/callout.cjs.map +1 -0
- package/dist/components/callout.d.cts +39 -0
- package/dist/components/callout.d.ts +39 -0
- package/dist/components/callout.js +88 -0
- package/dist/components/callout.js.map +1 -0
- package/dist/components/card.cjs +86 -0
- package/dist/components/card.cjs.map +1 -0
- package/dist/components/card.d.cts +28 -0
- package/dist/components/card.d.ts +28 -0
- package/dist/components/card.js +76 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/chart.cjs +93 -0
- package/dist/components/chart.cjs.map +1 -0
- package/dist/components/chart.d.cts +83 -0
- package/dist/components/chart.d.ts +83 -0
- package/dist/components/chart.js +88 -0
- package/dist/components/chart.js.map +1 -0
- package/dist/components/checkbox.cjs +37 -0
- package/dist/components/checkbox.cjs.map +1 -0
- package/dist/components/checkbox.d.cts +22 -0
- package/dist/components/checkbox.d.ts +22 -0
- package/dist/components/checkbox.js +34 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/circular-gauge.cjs +74 -0
- package/dist/components/circular-gauge.cjs.map +1 -0
- package/dist/components/circular-gauge.d.cts +38 -0
- package/dist/components/circular-gauge.d.ts +38 -0
- package/dist/components/circular-gauge.js +71 -0
- package/dist/components/circular-gauge.js.map +1 -0
- package/dist/components/day-of-week-picker.cjs +123 -0
- package/dist/components/day-of-week-picker.cjs.map +1 -0
- package/dist/components/day-of-week-picker.d.cts +39 -0
- package/dist/components/day-of-week-picker.d.ts +39 -0
- package/dist/components/day-of-week-picker.js +119 -0
- package/dist/components/day-of-week-picker.js.map +1 -0
- package/dist/components/device-card.cjs +118 -0
- package/dist/components/device-card.cjs.map +1 -0
- package/dist/components/device-card.d.cts +71 -0
- package/dist/components/device-card.d.ts +71 -0
- package/dist/components/device-card.js +104 -0
- package/dist/components/device-card.js.map +1 -0
- package/dist/components/dialog.cjs +115 -0
- package/dist/components/dialog.cjs.map +1 -0
- package/dist/components/dialog.d.cts +45 -0
- package/dist/components/dialog.d.ts +45 -0
- package/dist/components/dialog.js +103 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/donut-chart.cjs +71 -0
- package/dist/components/donut-chart.cjs.map +1 -0
- package/dist/components/donut-chart.d.cts +22 -0
- package/dist/components/donut-chart.d.ts +22 -0
- package/dist/components/donut-chart.js +69 -0
- package/dist/components/donut-chart.js.map +1 -0
- package/dist/components/drawer.cjs +95 -0
- package/dist/components/drawer.cjs.map +1 -0
- package/dist/components/drawer.d.cts +46 -0
- package/dist/components/drawer.d.ts +46 -0
- package/dist/components/drawer.js +83 -0
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/dropdown-menu.cjs +165 -0
- package/dist/components/dropdown-menu.cjs.map +1 -0
- package/dist/components/dropdown-menu.d.cts +93 -0
- package/dist/components/dropdown-menu.d.ts +93 -0
- package/dist/components/dropdown-menu.js +148 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/empty-state.cjs +35 -0
- package/dist/components/empty-state.cjs.map +1 -0
- package/dist/components/empty-state.d.cts +22 -0
- package/dist/components/empty-state.d.ts +22 -0
- package/dist/components/empty-state.js +33 -0
- package/dist/components/empty-state.js.map +1 -0
- package/dist/components/energy-bar-chart.cjs +23 -0
- package/dist/components/energy-bar-chart.cjs.map +1 -0
- package/dist/components/energy-bar-chart.d.cts +43 -0
- package/dist/components/energy-bar-chart.d.ts +43 -0
- package/dist/components/energy-bar-chart.js +21 -0
- package/dist/components/energy-bar-chart.js.map +1 -0
- package/dist/components/energy-breakdown.cjs +81 -0
- package/dist/components/energy-breakdown.cjs.map +1 -0
- package/dist/components/energy-breakdown.d.cts +26 -0
- package/dist/components/energy-breakdown.d.ts +26 -0
- package/dist/components/energy-breakdown.js +79 -0
- package/dist/components/energy-breakdown.js.map +1 -0
- package/dist/components/energy-history-chart.cjs +56 -0
- package/dist/components/energy-history-chart.cjs.map +1 -0
- package/dist/components/energy-history-chart.d.cts +58 -0
- package/dist/components/energy-history-chart.d.ts +58 -0
- package/dist/components/energy-history-chart.js +54 -0
- package/dist/components/energy-history-chart.js.map +1 -0
- package/dist/components/feed-in-hero.cjs +56 -0
- package/dist/components/feed-in-hero.cjs.map +1 -0
- package/dist/components/feed-in-hero.d.cts +33 -0
- package/dist/components/feed-in-hero.d.ts +33 -0
- package/dist/components/feed-in-hero.js +51 -0
- package/dist/components/feed-in-hero.js.map +1 -0
- package/dist/components/field.cjs +257 -0
- package/dist/components/field.cjs.map +1 -0
- package/dist/components/field.d.cts +104 -0
- package/dist/components/field.d.ts +104 -0
- package/dist/components/field.js +243 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/icon.cjs +35 -0
- package/dist/components/icon.cjs.map +1 -0
- package/dist/components/icon.d.cts +27 -0
- package/dist/components/icon.d.ts +27 -0
- package/dist/components/icon.js +32 -0
- package/dist/components/icon.js.map +1 -0
- package/dist/components/info-block.cjs +75 -0
- package/dist/components/info-block.cjs.map +1 -0
- package/dist/components/info-block.d.cts +20 -0
- package/dist/components/info-block.d.ts +20 -0
- package/dist/components/info-block.js +65 -0
- package/dist/components/info-block.js.map +1 -0
- package/dist/components/input-group.cjs +164 -0
- package/dist/components/input-group.cjs.map +1 -0
- package/dist/components/input-group.d.cts +32 -0
- package/dist/components/input-group.d.ts +32 -0
- package/dist/components/input-group.js +158 -0
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input-otp.cjs +113 -0
- package/dist/components/input-otp.cjs.map +1 -0
- package/dist/components/input-otp.d.cts +22 -0
- package/dist/components/input-otp.d.ts +22 -0
- package/dist/components/input-otp.js +111 -0
- package/dist/components/input-otp.js.map +1 -0
- package/dist/components/input.cjs +112 -0
- package/dist/components/input.cjs.map +1 -0
- package/dist/components/input.d.cts +21 -0
- package/dist/components/input.d.ts +21 -0
- package/dist/components/input.js +109 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/label.cjs +18 -0
- package/dist/components/label.cjs.map +1 -0
- package/dist/components/label.d.cts +10 -0
- package/dist/components/label.d.ts +10 -0
- package/dist/components/label.js +15 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/layout.cjs +15 -0
- package/dist/components/layout.cjs.map +1 -0
- package/dist/components/layout.d.cts +12 -0
- package/dist/components/layout.d.ts +13 -0
- package/dist/components/layout.js +14 -0
- package/dist/components/layout.js.map +1 -0
- package/dist/components/line-chart.cjs +310 -0
- package/dist/components/line-chart.cjs.map +1 -0
- package/dist/components/line-chart.d.cts +71 -0
- package/dist/components/line-chart.d.ts +71 -0
- package/dist/components/line-chart.js +307 -0
- package/dist/components/line-chart.js.map +1 -0
- package/dist/components/list.cjs +132 -0
- package/dist/components/list.cjs.map +1 -0
- package/dist/components/list.d.cts +72 -0
- package/dist/components/list.d.ts +72 -0
- package/dist/components/list.js +122 -0
- package/dist/components/list.js.map +1 -0
- package/dist/components/marker.cjs +52 -0
- package/dist/components/marker.cjs.map +1 -0
- package/dist/components/marker.d.cts +29 -0
- package/dist/components/marker.d.ts +29 -0
- package/dist/components/marker.js +46 -0
- package/dist/components/marker.js.map +1 -0
- package/dist/components/message-scroller.cjs +73 -0
- package/dist/components/message-scroller.cjs.map +1 -0
- package/dist/components/message-scroller.d.cts +39 -0
- package/dist/components/message-scroller.d.ts +39 -0
- package/dist/components/message-scroller.js +62 -0
- package/dist/components/message-scroller.js.map +1 -0
- package/dist/components/message.cjs +60 -0
- package/dist/components/message.cjs.map +1 -0
- package/dist/components/message.d.cts +36 -0
- package/dist/components/message.d.ts +36 -0
- package/dist/components/message.js +52 -0
- package/dist/components/message.js.map +1 -0
- package/dist/components/metering-row.cjs +43 -0
- package/dist/components/metering-row.cjs.map +1 -0
- package/dist/components/metering-row.d.cts +32 -0
- package/dist/components/metering-row.d.ts +32 -0
- package/dist/components/metering-row.js +38 -0
- package/dist/components/metering-row.js.map +1 -0
- package/dist/components/money-saved-block.cjs +87 -0
- package/dist/components/money-saved-block.cjs.map +1 -0
- package/dist/components/money-saved-block.d.cts +57 -0
- package/dist/components/money-saved-block.d.ts +57 -0
- package/dist/components/money-saved-block.js +79 -0
- package/dist/components/money-saved-block.js.map +1 -0
- package/dist/components/number-flow.cjs +44 -0
- package/dist/components/number-flow.cjs.map +1 -0
- package/dist/components/number-flow.d.cts +4 -0
- package/dist/components/number-flow.d.ts +4 -0
- package/dist/components/number-flow.js +42 -0
- package/dist/components/number-flow.js.map +1 -0
- package/dist/components/on-off-button.cjs +36 -0
- package/dist/components/on-off-button.cjs.map +1 -0
- package/dist/components/on-off-button.d.cts +20 -0
- package/dist/components/on-off-button.d.ts +20 -0
- package/dist/components/on-off-button.js +34 -0
- package/dist/components/on-off-button.js.map +1 -0
- package/dist/components/onboarding-layout.cjs +68 -0
- package/dist/components/onboarding-layout.cjs.map +1 -0
- package/dist/components/onboarding-layout.d.cts +46 -0
- package/dist/components/onboarding-layout.d.ts +46 -0
- package/dist/components/onboarding-layout.js +60 -0
- package/dist/components/onboarding-layout.js.map +1 -0
- package/dist/components/page-header.cjs +50 -0
- package/dist/components/page-header.cjs.map +1 -0
- package/dist/components/page-header.d.cts +26 -0
- package/dist/components/page-header.d.ts +26 -0
- package/dist/components/page-header.js +44 -0
- package/dist/components/page-header.js.map +1 -0
- package/dist/components/page-spinner.cjs +19 -0
- package/dist/components/page-spinner.cjs.map +1 -0
- package/dist/components/page-spinner.d.cts +14 -0
- package/dist/components/page-spinner.d.ts +14 -0
- package/dist/components/page-spinner.js +17 -0
- package/dist/components/page-spinner.js.map +1 -0
- package/dist/components/period-tabs.cjs +79 -0
- package/dist/components/period-tabs.cjs.map +1 -0
- package/dist/components/period-tabs.d.cts +51 -0
- package/dist/components/period-tabs.d.ts +51 -0
- package/dist/components/period-tabs.js +73 -0
- package/dist/components/period-tabs.js.map +1 -0
- package/dist/components/popover.cjs +62 -0
- package/dist/components/popover.cjs.map +1 -0
- package/dist/components/popover.d.cts +29 -0
- package/dist/components/popover.d.ts +29 -0
- package/dist/components/popover.js +56 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/power-history-chart.cjs +358 -0
- package/dist/components/power-history-chart.cjs.map +1 -0
- package/dist/components/power-history-chart.d.cts +54 -0
- package/dist/components/power-history-chart.d.ts +54 -0
- package/dist/components/power-history-chart.js +355 -0
- package/dist/components/power-history-chart.js.map +1 -0
- package/dist/components/power-history.cjs +115 -0
- package/dist/components/power-history.cjs.map +1 -0
- package/dist/components/power-history.d.cts +42 -0
- package/dist/components/power-history.d.ts +43 -0
- package/dist/components/power-history.js +114 -0
- package/dist/components/power-history.js.map +1 -0
- package/dist/components/power-network.cjs +530 -0
- package/dist/components/power-network.cjs.map +1 -0
- package/dist/components/power-network.d.cts +77 -0
- package/dist/components/power-network.d.ts +77 -0
- package/dist/components/power-network.js +523 -0
- package/dist/components/power-network.js.map +1 -0
- package/dist/components/progress.cjs +34 -0
- package/dist/components/progress.cjs.map +1 -0
- package/dist/components/progress.d.cts +17 -0
- package/dist/components/progress.d.ts +17 -0
- package/dist/components/progress.js +31 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/radio-card-group.cjs +69 -0
- package/dist/components/radio-card-group.cjs.map +1 -0
- package/dist/components/radio-card-group.d.cts +21 -0
- package/dist/components/radio-card-group.d.ts +21 -0
- package/dist/components/radio-card-group.js +65 -0
- package/dist/components/radio-card-group.js.map +1 -0
- package/dist/components/radio.cjs +34 -0
- package/dist/components/radio.cjs.map +1 -0
- package/dist/components/radio.d.cts +21 -0
- package/dist/components/radio.d.ts +21 -0
- package/dist/components/radio.js +30 -0
- package/dist/components/radio.js.map +1 -0
- package/dist/components/reparent.cjs +55 -0
- package/dist/components/reparent.cjs.map +1 -0
- package/dist/components/reparent.d.cts +29 -0
- package/dist/components/reparent.d.ts +29 -0
- package/dist/components/reparent.js +49 -0
- package/dist/components/reparent.js.map +1 -0
- package/dist/components/sankey-chart.cjs +221 -0
- package/dist/components/sankey-chart.cjs.map +1 -0
- package/dist/components/sankey-chart.d.cts +58 -0
- package/dist/components/sankey-chart.d.ts +58 -0
- package/dist/components/sankey-chart.js +218 -0
- package/dist/components/sankey-chart.js.map +1 -0
- package/dist/components/schedule-editor.cjs +82 -0
- package/dist/components/schedule-editor.cjs.map +1 -0
- package/dist/components/schedule-editor.d.cts +25 -0
- package/dist/components/schedule-editor.d.ts +25 -0
- package/dist/components/schedule-editor.js +72 -0
- package/dist/components/schedule-editor.js.map +1 -0
- package/dist/components/schedule-list.cjs +110 -0
- package/dist/components/schedule-list.cjs.map +1 -0
- package/dist/components/schedule-list.d.cts +29 -0
- package/dist/components/schedule-list.d.ts +29 -0
- package/dist/components/schedule-list.js +99 -0
- package/dist/components/schedule-list.js.map +1 -0
- package/dist/components/scroll-area.cjs +53 -0
- package/dist/components/scroll-area.cjs.map +1 -0
- package/dist/components/scroll-area.d.cts +26 -0
- package/dist/components/scroll-area.d.ts +26 -0
- package/dist/components/scroll-area.js +44 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/select.cjs +136 -0
- package/dist/components/select.cjs.map +1 -0
- package/dist/components/select.d.cts +63 -0
- package/dist/components/select.d.ts +63 -0
- package/dist/components/select.js +124 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.cjs +38 -0
- package/dist/components/separator.cjs.map +1 -0
- package/dist/components/separator.d.cts +13 -0
- package/dist/components/separator.d.ts +13 -0
- package/dist/components/separator.js +35 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/series-legend.cjs +39 -0
- package/dist/components/series-legend.cjs.map +1 -0
- package/dist/components/series-legend.d.cts +31 -0
- package/dist/components/series-legend.d.ts +31 -0
- package/dist/components/series-legend.js +37 -0
- package/dist/components/series-legend.js.map +1 -0
- package/dist/components/sheet.cjs +102 -0
- package/dist/components/sheet.cjs.map +1 -0
- package/dist/components/sheet.d.cts +46 -0
- package/dist/components/sheet.d.ts +46 -0
- package/dist/components/sheet.js +90 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/skeleton.cjs +24 -0
- package/dist/components/skeleton.cjs.map +1 -0
- package/dist/components/skeleton.d.cts +24 -0
- package/dist/components/skeleton.d.ts +24 -0
- package/dist/components/skeleton.js +21 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/slider.cjs +276 -0
- package/dist/components/slider.cjs.map +1 -0
- package/dist/components/slider.d.cts +150 -0
- package/dist/components/slider.d.ts +150 -0
- package/dist/components/slider.js +266 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/smart-toggle-button.cjs +28 -0
- package/dist/components/smart-toggle-button.cjs.map +1 -0
- package/dist/components/smart-toggle-button.d.cts +18 -0
- package/dist/components/smart-toggle-button.d.ts +18 -0
- package/dist/components/smart-toggle-button.js +26 -0
- package/dist/components/smart-toggle-button.js.map +1 -0
- package/dist/components/solar-forecast-chart.cjs +105 -0
- package/dist/components/solar-forecast-chart.cjs.map +1 -0
- package/dist/components/solar-forecast-chart.d.cts +66 -0
- package/dist/components/solar-forecast-chart.d.ts +66 -0
- package/dist/components/solar-forecast-chart.js +99 -0
- package/dist/components/solar-forecast-chart.js.map +1 -0
- package/dist/components/sortable-list.cjs +69 -0
- package/dist/components/sortable-list.cjs.map +1 -0
- package/dist/components/sortable-list.d.cts +46 -0
- package/dist/components/sortable-list.d.ts +46 -0
- package/dist/components/sortable-list.js +67 -0
- package/dist/components/sortable-list.js.map +1 -0
- package/dist/components/spinner.cjs +42 -0
- package/dist/components/spinner.cjs.map +1 -0
- package/dist/components/spinner.d.cts +15 -0
- package/dist/components/spinner.d.ts +15 -0
- package/dist/components/spinner.js +39 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/stat-card.cjs +58 -0
- package/dist/components/stat-card.cjs.map +1 -0
- package/dist/components/stat-card.d.cts +36 -0
- package/dist/components/stat-card.d.ts +36 -0
- package/dist/components/stat-card.js +50 -0
- package/dist/components/stat-card.js.map +1 -0
- package/dist/components/stepper.cjs +79 -0
- package/dist/components/stepper.cjs.map +1 -0
- package/dist/components/stepper.d.cts +33 -0
- package/dist/components/stepper.d.ts +33 -0
- package/dist/components/stepper.js +76 -0
- package/dist/components/stepper.js.map +1 -0
- package/dist/components/switch.cjs +22 -0
- package/dist/components/switch.cjs.map +1 -0
- package/dist/components/switch.d.cts +28 -0
- package/dist/components/switch.d.ts +28 -0
- package/dist/components/switch.js +20 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/tabs.cjs +175 -0
- package/dist/components/tabs.cjs.map +1 -0
- package/dist/components/tabs.d.cts +45 -0
- package/dist/components/tabs.d.ts +45 -0
- package/dist/components/tabs.js +167 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/theme.cjs +6 -0
- package/dist/components/theme.d.cts +38 -0
- package/dist/components/theme.d.ts +38 -0
- package/dist/components/theme.js +4 -0
- package/dist/components/thumbnail.cjs +54 -0
- package/dist/components/thumbnail.cjs.map +1 -0
- package/dist/components/thumbnail.d.cts +34 -0
- package/dist/components/thumbnail.d.ts +34 -0
- package/dist/components/thumbnail.js +51 -0
- package/dist/components/thumbnail.js.map +1 -0
- package/dist/components/time-picker.cjs +55 -0
- package/dist/components/time-picker.cjs.map +1 -0
- package/dist/components/time-picker.d.cts +41 -0
- package/dist/components/time-picker.d.ts +41 -0
- package/dist/components/time-picker.js +51 -0
- package/dist/components/time-picker.js.map +1 -0
- package/dist/components/toast.cjs +99 -0
- package/dist/components/toast.cjs.map +1 -0
- package/dist/components/toast.d.cts +18 -0
- package/dist/components/toast.d.ts +18 -0
- package/dist/components/toast.js +95 -0
- package/dist/components/toast.js.map +1 -0
- package/dist/components/tooltip.cjs +75 -0
- package/dist/components/tooltip.cjs.map +1 -0
- package/dist/components/tooltip.d.cts +47 -0
- package/dist/components/tooltip.d.ts +47 -0
- package/dist/components/tooltip.js +67 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/components/typography.cjs +52 -0
- package/dist/components/typography.cjs.map +1 -0
- package/dist/components/typography.d.cts +32 -0
- package/dist/components/typography.d.ts +32 -0
- package/dist/components/typography.js +45 -0
- package/dist/components/typography.js.map +1 -0
- package/dist/hooks/use-container-width.cjs +22 -0
- package/dist/hooks/use-container-width.cjs.map +1 -0
- package/dist/hooks/use-container-width.d.cts +7 -0
- package/dist/hooks/use-container-width.d.ts +7 -0
- package/dist/hooks/use-container-width.js +20 -0
- package/dist/hooks/use-container-width.js.map +1 -0
- package/dist/icons/index.cjs +7 -0
- package/dist/icons/index.d.cts +4 -0
- package/dist/icons/index.d.ts +4 -0
- package/dist/icons/index.js +3 -0
- package/dist/icons/material-symbol.cjs +105 -0
- package/dist/icons/material-symbol.cjs.map +1 -0
- package/dist/icons/material-symbol.d.cts +23 -0
- package/dist/icons/material-symbol.d.ts +23 -0
- package/dist/icons/material-symbol.js +100 -0
- package/dist/icons/material-symbol.js.map +1 -0
- package/dist/input-box-variants-BMDdwvqg.cjs +40 -0
- package/dist/input-box-variants-BMDdwvqg.cjs.map +1 -0
- package/dist/input-box-variants-Dr1K7uYE.js +28 -0
- package/dist/input-box-variants-Dr1K7uYE.js.map +1 -0
- package/dist/number-flow-DMJouddg.d.cts +15 -0
- package/dist/number-flow-DSbucQ_K.d.ts +15 -0
- package/dist/styles/index.css +223 -0
- package/dist/styles/internal.css +5 -0
- package/dist/styles/material-symbol.css +22 -0
- package/dist/styles/spark-default.css +883 -0
- package/dist/styles/theme.css +542 -0
- package/dist/styles/utilities.css +557 -0
- package/dist/theme-B3WtiByA.js +574 -0
- package/dist/theme-B3WtiByA.js.map +1 -0
- package/dist/theme-C9_OSe0S.cjs +592 -0
- package/dist/theme-C9_OSe0S.cjs.map +1 -0
- package/dist/theme-types-DoROIXpi.d.ts +30 -0
- package/dist/theme-types-r20EJfEC.d.cts +30 -0
- package/dist/tones-DjgKOX3s.d.cts +8 -0
- package/dist/tones-DyCkL71h.d.ts +8 -0
- package/dist/utils/build-sankey-nodes.cjs +59 -0
- package/dist/utils/build-sankey-nodes.cjs.map +1 -0
- package/dist/utils/build-sankey-nodes.d.cts +27 -0
- package/dist/utils/build-sankey-nodes.d.ts +27 -0
- package/dist/utils/build-sankey-nodes.js +58 -0
- package/dist/utils/build-sankey-nodes.js.map +1 -0
- package/dist/utils/chars.cjs +18 -0
- package/dist/utils/chars.cjs.map +1 -0
- package/dist/utils/chars.d.cts +10 -0
- package/dist/utils/chars.d.ts +10 -0
- package/dist/utils/chars.js +14 -0
- package/dist/utils/chars.js.map +1 -0
- package/dist/utils/cn.cjs +10 -0
- package/dist/utils/cn.d.cts +4 -0
- package/dist/utils/cn.d.ts +4 -0
- package/dist/utils/cn.js +3 -0
- package/dist/utils/date-mask.cjs +45 -0
- package/dist/utils/date-mask.cjs.map +1 -0
- package/dist/utils/date-mask.d.cts +17 -0
- package/dist/utils/date-mask.d.ts +17 -0
- package/dist/utils/date-mask.js +41 -0
- package/dist/utils/date-mask.js.map +1 -0
- package/dist/utils/format.cjs +57 -0
- package/dist/utils/format.cjs.map +1 -0
- package/dist/utils/format.d.cts +23 -0
- package/dist/utils/format.d.ts +23 -0
- package/dist/utils/format.js +47 -0
- package/dist/utils/format.js.map +1 -0
- package/package.json +78 -63
- package/dist/index.cjs +0 -1631
- package/dist/index.cjs.map +0 -1
- package/dist/index.css +0 -1
- package/dist/index.d.cts +0 -299
- package/dist/index.d.ts +0 -299
- package/dist/index.js +0 -1518
- package/dist/index.js.map +0 -1
- 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,23 @@
|
|
|
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) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_number_flow, {
|
|
13
|
+
value,
|
|
14
|
+
...totalSuffix !== void 0 && { suffix: totalSuffix },
|
|
15
|
+
...totalFormat !== void 0 && { format: totalFormat },
|
|
16
|
+
className: "text-base font-bold text-gray tabular-nums"
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
exports.EnergyBarChart = EnergyBarChart;
|
|
22
|
+
|
|
23
|
+
//# 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) => (\n <NumberFlow\n value={value}\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,UACZ,iBAAA,GAAA,kBAAA,KAACC,gCAAD;GACS;GACP,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,21 @@
|
|
|
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) => /* @__PURE__ */ jsx(NumberFlow, {
|
|
11
|
+
value,
|
|
12
|
+
...totalSuffix !== void 0 && { suffix: totalSuffix },
|
|
13
|
+
...totalFormat !== void 0 && { format: totalFormat },
|
|
14
|
+
className: "text-base font-bold text-gray tabular-nums"
|
|
15
|
+
})
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { EnergyBarChart };
|
|
20
|
+
|
|
21
|
+
//# 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) => (\n <NumberFlow\n value={value}\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,UACZ,oBAAC,YAAD;GACS;GACP,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,56 @@
|
|
|
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. For cumulative energy (week/month/year views). Thin wrapper over the
|
|
13
|
+
* shared visx `BarChart`, so it inherits the card tooltip and both indicators.
|
|
14
|
+
*/
|
|
15
|
+
function EnergyHistoryChart({ data, unit, formatValue, formatBucketLabel, labels, highlightedBucket, showHighlightLine, title, className, height = 260, categoryTicks }) {
|
|
16
|
+
const fmtValue = (value) => formatValue ? formatValue(value) : `${require_utils_format.twoDecimalFormat.format(value)} ${unit}`;
|
|
17
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_energy_bar_chart.EnergyBarChart, {
|
|
18
|
+
data,
|
|
19
|
+
series: [
|
|
20
|
+
{
|
|
21
|
+
key: "solar",
|
|
22
|
+
label: labels.solar,
|
|
23
|
+
color: "var(--orange-a9)",
|
|
24
|
+
getValue: (d) => d.solar
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
key: "battery",
|
|
28
|
+
label: labels.battery,
|
|
29
|
+
color: "var(--green-a9)",
|
|
30
|
+
getValue: (d) => d.battery
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
key: "grid",
|
|
34
|
+
label: labels.grid,
|
|
35
|
+
color: "var(--blue-9)",
|
|
36
|
+
getValue: (d) => d.grid
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
getCategory: (d) => d.bucket,
|
|
40
|
+
title,
|
|
41
|
+
yAxisUnit: unit,
|
|
42
|
+
height,
|
|
43
|
+
className,
|
|
44
|
+
formatValue: fmtValue,
|
|
45
|
+
categoryTicks,
|
|
46
|
+
...formatBucketLabel && { formatTooltipCategory: (category) => formatBucketLabel(String(category)) },
|
|
47
|
+
totalSuffix: unit,
|
|
48
|
+
totalFormat: { maximumFractionDigits: 2 },
|
|
49
|
+
...highlightedBucket !== void 0 && { highlightedCategory: highlightedBucket },
|
|
50
|
+
...showHighlightLine !== void 0 && { showHighlightLine }
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
exports.EnergyHistoryChart = EnergyHistoryChart;
|
|
55
|
+
|
|
56
|
+
//# 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}\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 }\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\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. 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 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 series: BarChartSeries<EnergyHistoryDatum>[] = [\n {\n key: 'solar',\n label: labels.solar,\n color: 'var(--orange-a9)',\n getValue: (d) => d.solar,\n },\n {\n key: 'battery',\n label: labels.battery,\n color: 'var(--green-a9)',\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 ]\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":";;;;;;;;;;;;;;AA4CA,SAAgB,mBAAmB,EACjC,MACA,MACA,aACA,mBACA,QACA,mBACA,mBACA,OACA,WACA,SAAS,KACT,iBAC0B;CAC1B,MAAM,YAAY,UAChB,cACI,YAAY,MAAM,GAClB,GAAGA,qBAAAA,iBAAY,OAAO,MAAM,IAAiB;AAuBnD,QACE,iBAAA,GAAA,kBAAA,KAACC,oCAAAA,gBAAD;EACQ;EACN,QAAQ;GAvBV;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;GAMe;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,58 @@
|
|
|
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
|
+
}
|
|
16
|
+
interface EnergyHistoryChartProps {
|
|
17
|
+
data: EnergyHistoryDatum[];
|
|
18
|
+
/** Axis/tooltip unit, e.g. "kWh". */
|
|
19
|
+
unit: string;
|
|
20
|
+
formatValue?: (value: number) => string;
|
|
21
|
+
/** Formats the hovered bucket in the tooltip header. Defaults to the raw bucket. */
|
|
22
|
+
formatBucketLabel?: (bucket: string) => string;
|
|
23
|
+
labels: {
|
|
24
|
+
solar: string;
|
|
25
|
+
battery: string;
|
|
26
|
+
grid: string;
|
|
27
|
+
};
|
|
28
|
+
/** Bucket to mark with the current-period dashed line. */
|
|
29
|
+
highlightedBucket?: string;
|
|
30
|
+
showHighlightLine?: boolean;
|
|
31
|
+
title?: string;
|
|
32
|
+
className?: string;
|
|
33
|
+
height?: number;
|
|
34
|
+
/** Subset of bucket ids to label on the x-axis. Defaults to all buckets. */
|
|
35
|
+
categoryTicks?: string[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Energy-per-bucket stacked bar chart: solar (orange), battery (green) and grid
|
|
39
|
+
* (blue) energy sources stacked per bucket, the total height being the energy
|
|
40
|
+
* consumed. For cumulative energy (week/month/year views). Thin wrapper over the
|
|
41
|
+
* shared visx `BarChart`, so it inherits the card tooltip and both indicators.
|
|
42
|
+
*/
|
|
43
|
+
declare function EnergyHistoryChart({
|
|
44
|
+
data,
|
|
45
|
+
unit,
|
|
46
|
+
formatValue,
|
|
47
|
+
formatBucketLabel,
|
|
48
|
+
labels,
|
|
49
|
+
highlightedBucket,
|
|
50
|
+
showHighlightLine,
|
|
51
|
+
title,
|
|
52
|
+
className,
|
|
53
|
+
height,
|
|
54
|
+
categoryTicks
|
|
55
|
+
}: EnergyHistoryChartProps): _$react_jsx_runtime0.JSX.Element;
|
|
56
|
+
//#endregion
|
|
57
|
+
export { EnergyHistoryChart, EnergyHistoryChartProps, EnergyHistoryDatum };
|
|
58
|
+
//# sourceMappingURL=energy-history-chart.d.cts.map
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
}
|
|
16
|
+
interface EnergyHistoryChartProps {
|
|
17
|
+
data: EnergyHistoryDatum[];
|
|
18
|
+
/** Axis/tooltip unit, e.g. "kWh". */
|
|
19
|
+
unit: string;
|
|
20
|
+
formatValue?: (value: number) => string;
|
|
21
|
+
/** Formats the hovered bucket in the tooltip header. Defaults to the raw bucket. */
|
|
22
|
+
formatBucketLabel?: (bucket: string) => string;
|
|
23
|
+
labels: {
|
|
24
|
+
solar: string;
|
|
25
|
+
battery: string;
|
|
26
|
+
grid: string;
|
|
27
|
+
};
|
|
28
|
+
/** Bucket to mark with the current-period dashed line. */
|
|
29
|
+
highlightedBucket?: string;
|
|
30
|
+
showHighlightLine?: boolean;
|
|
31
|
+
title?: string;
|
|
32
|
+
className?: string;
|
|
33
|
+
height?: number;
|
|
34
|
+
/** Subset of bucket ids to label on the x-axis. Defaults to all buckets. */
|
|
35
|
+
categoryTicks?: string[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Energy-per-bucket stacked bar chart: solar (orange), battery (green) and grid
|
|
39
|
+
* (blue) energy sources stacked per bucket, the total height being the energy
|
|
40
|
+
* consumed. For cumulative energy (week/month/year views). Thin wrapper over the
|
|
41
|
+
* shared visx `BarChart`, so it inherits the card tooltip and both indicators.
|
|
42
|
+
*/
|
|
43
|
+
declare function EnergyHistoryChart({
|
|
44
|
+
data,
|
|
45
|
+
unit,
|
|
46
|
+
formatValue,
|
|
47
|
+
formatBucketLabel,
|
|
48
|
+
labels,
|
|
49
|
+
highlightedBucket,
|
|
50
|
+
showHighlightLine,
|
|
51
|
+
title,
|
|
52
|
+
className,
|
|
53
|
+
height,
|
|
54
|
+
categoryTicks
|
|
55
|
+
}: EnergyHistoryChartProps): _$react_jsx_runtime0.JSX.Element;
|
|
56
|
+
//#endregion
|
|
57
|
+
export { EnergyHistoryChart, EnergyHistoryChartProps, EnergyHistoryDatum };
|
|
58
|
+
//# sourceMappingURL=energy-history-chart.d.ts.map
|