@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 @@
|
|
|
1
|
+
{"version":3,"file":"date-mask.js","names":[],"sources":["../../src/utils/date-mask.ts"],"sourcesContent":["// Helpers for a typeable date field: mask keystrokes into DD.MM.YYYY, parse the\n// masked value into a Date, and format a picked Date back into the masked value.\n\n// While typing, a completed group (2 or 4 digits) gets a trailing separator so\n// the next group flows. While deleting, the trailing separator is kept only if\n// the raw value still ends with one — so backspace lands on `DD.MM.` first, then\n// removes the separator on the next press, one character at a time.\nexport function maskDateInput(\n value: string,\n { separator = '.', deleting = false }: MaskOptions = {},\n): string {\n const digits = value.replace(/\\D/g, '').slice(0, 8)\n let out = digits.slice(0, 2)\n if (digits.length > 2) out += separator + digits.slice(2, 4)\n if (digits.length > 4) out += separator + digits.slice(4, 8)\n const groupComplete = digits.length === 2 || digits.length === 4\n const keepTrailing = deleting ? /[./-]$/.test(value) : true\n if (groupComplete && keepTrailing) out += separator\n return out\n}\n\n// Accepts any of `.` `/` `-` as separators; rejects impossible dates (32.01.2020).\nexport function parseTypedDate(value: string): Date | undefined {\n const parts = value.trim().split(/[./-]/).map(Number)\n if (parts.length !== 3 || parts.some(Number.isNaN)) return undefined\n const [day, month, year] = parts as [number, number, number]\n const parsed = new Date(year, month - 1, day)\n const valid =\n parsed.getFullYear() === year &&\n parsed.getMonth() === month - 1 &&\n parsed.getDate() === day\n return valid ? parsed : undefined\n}\n\n// Caret position after TYPING: after the typed digit, flowing past a\n// separator into the next group. (For deletions, keep the raw caret instead —\n// the mask's separator positions are fixed, so it maps directly and backspace\n// can cross separators without looping.)\nexport function maskedDateCaret(masked: string, digitsBefore: number): number {\n let digits = 0\n let index = 0\n while (index < masked.length && digits < digitsBefore) {\n if (/\\d/.test(masked[index]!)) digits++\n index++\n }\n while (index < masked.length && /\\D/.test(masked[index]!)) index++\n return index\n}\n\nexport function formatTypedDate(date: Date, separator = '.'): string {\n const pad = (n: number) => String(n).padStart(2, '0')\n return [\n pad(date.getDate()),\n pad(date.getMonth() + 1),\n date.getFullYear(),\n ].join(separator)\n}\n\ninterface MaskOptions {\n separator?: string\n deleting?: boolean\n}\n"],"mappings":";;AAOA,SAAgB,cACd,OACA,EAAE,YAAY,KAAK,WAAW,UAAuB,EAAE,EAC/C;CACR,MAAM,SAAS,MAAM,QAAQ,OAAO,GAAG,CAAC,MAAM,GAAG,EAAE;CACnD,IAAI,MAAM,OAAO,MAAM,GAAG,EAAE;AAC5B,KAAI,OAAO,SAAS,EAAG,QAAO,YAAY,OAAO,MAAM,GAAG,EAAE;AAC5D,KAAI,OAAO,SAAS,EAAG,QAAO,YAAY,OAAO,MAAM,GAAG,EAAE;CAC5D,MAAM,gBAAgB,OAAO,WAAW,KAAK,OAAO,WAAW;CAC/D,MAAM,eAAe,WAAW,SAAS,KAAK,MAAM,GAAG;AACvD,KAAI,iBAAiB,aAAc,QAAO;AAC1C,QAAO;;AAIT,SAAgB,eAAe,OAAiC;CAC9D,MAAM,QAAQ,MAAM,MAAM,CAAC,MAAM,QAAQ,CAAC,IAAI,OAAO;AACrD,KAAI,MAAM,WAAW,KAAK,MAAM,KAAK,OAAO,MAAM,CAAE,QAAO,KAAA;CAC3D,MAAM,CAAC,KAAK,OAAO,QAAQ;CAC3B,MAAM,SAAS,IAAI,KAAK,MAAM,QAAQ,GAAG,IAAI;AAK7C,QAHE,OAAO,aAAa,KAAK,QACzB,OAAO,UAAU,KAAK,QAAQ,KAC9B,OAAO,SAAS,KAAK,MACR,SAAS,KAAA;;AAO1B,SAAgB,gBAAgB,QAAgB,cAA8B;CAC5E,IAAI,SAAS;CACb,IAAI,QAAQ;AACZ,QAAO,QAAQ,OAAO,UAAU,SAAS,cAAc;AACrD,MAAI,KAAK,KAAK,OAAO,OAAQ,CAAE;AAC/B;;AAEF,QAAO,QAAQ,OAAO,UAAU,KAAK,KAAK,OAAO,OAAQ,CAAE;AAC3D,QAAO;;AAGT,SAAgB,gBAAgB,MAAY,YAAY,KAAa;CACnE,MAAM,OAAO,MAAc,OAAO,EAAE,CAAC,SAAS,GAAG,IAAI;AACrD,QAAO;EACL,IAAI,KAAK,SAAS,CAAC;EACnB,IAAI,KAAK,UAAU,GAAG,EAAE;EACxB,KAAK,aAAa;EACnB,CAAC,KAAK,UAAU"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
require("./chars.cjs");
|
|
4
|
+
//#region src/utils/format.ts
|
|
5
|
+
function getDocumentLang() {
|
|
6
|
+
return typeof document === "undefined" ? void 0 : document.documentElement.lang || void 0;
|
|
7
|
+
}
|
|
8
|
+
const localeNumberFormat = (options) => {
|
|
9
|
+
const cache = /* @__PURE__ */ new Map();
|
|
10
|
+
return { format: (value) => {
|
|
11
|
+
const locale = getDocumentLang();
|
|
12
|
+
const key = locale ?? "";
|
|
13
|
+
let formatter = cache.get(key);
|
|
14
|
+
if (!formatter) {
|
|
15
|
+
formatter = new Intl.NumberFormat(locale, options);
|
|
16
|
+
cache.set(key, formatter);
|
|
17
|
+
}
|
|
18
|
+
return formatter.format(value);
|
|
19
|
+
} };
|
|
20
|
+
};
|
|
21
|
+
const decimalsFormat = (decimals) => localeNumberFormat({ maximumFractionDigits: decimals });
|
|
22
|
+
const integerFormat = decimalsFormat(0);
|
|
23
|
+
const oneDecimalFormat = decimalsFormat(1);
|
|
24
|
+
const twoDecimalFormat = decimalsFormat(2);
|
|
25
|
+
const formatThousands = (n) => integerFormat.format(n);
|
|
26
|
+
const formatEnergy = (v) => {
|
|
27
|
+
if (v >= 1e6) return `${twoDecimalFormat.format(v / 1e3)} MWh`;
|
|
28
|
+
if (v >= 1e3) return `${integerFormat.format(v)} kWh`;
|
|
29
|
+
if (v >= 10) return `${oneDecimalFormat.format(v)} kWh`;
|
|
30
|
+
return `${twoDecimalFormat.format(v)} kWh`;
|
|
31
|
+
};
|
|
32
|
+
const formatPower = (value, { signed = false } = {}) => {
|
|
33
|
+
if (value == null) return "—";
|
|
34
|
+
const rounded = Math.round(value);
|
|
35
|
+
return `${signed && rounded > 0 ? "+" : ""}${integerFormat.format(rounded)} W`;
|
|
36
|
+
};
|
|
37
|
+
const formatPercent = (value) => {
|
|
38
|
+
if (value == null) return "—";
|
|
39
|
+
return `${integerFormat.format(value)} %`;
|
|
40
|
+
};
|
|
41
|
+
const formatRatio = (value) => {
|
|
42
|
+
if (value == null) return "—";
|
|
43
|
+
return `${integerFormat.format(value * 100)} %`;
|
|
44
|
+
};
|
|
45
|
+
//#endregion
|
|
46
|
+
exports.decimalsFormat = decimalsFormat;
|
|
47
|
+
exports.formatEnergy = formatEnergy;
|
|
48
|
+
exports.formatPercent = formatPercent;
|
|
49
|
+
exports.formatPower = formatPower;
|
|
50
|
+
exports.formatRatio = formatRatio;
|
|
51
|
+
exports.formatThousands = formatThousands;
|
|
52
|
+
exports.integerFormat = integerFormat;
|
|
53
|
+
exports.localeNumberFormat = localeNumberFormat;
|
|
54
|
+
exports.oneDecimalFormat = oneDecimalFormat;
|
|
55
|
+
exports.twoDecimalFormat = twoDecimalFormat;
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=format.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.cjs","names":[],"sources":["../../src/utils/format.ts"],"sourcesContent":["import { EM_DASH, NARROW_NBSP } from './chars'\n\ninterface LocaleNumberFormat {\n format: (value: number) => string\n}\n\nfunction getDocumentLang(): string | undefined {\n return typeof document === 'undefined'\n ? undefined\n : document.documentElement.lang || undefined\n}\n\nconst localeNumberFormat = (\n options?: Intl.NumberFormatOptions,\n): LocaleNumberFormat => {\n const cache = new Map<string, Intl.NumberFormat>()\n return {\n format: (value) => {\n const locale = getDocumentLang()\n const key = locale ?? ''\n let formatter = cache.get(key)\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, options)\n cache.set(key, formatter)\n }\n return formatter.format(value)\n },\n }\n}\n\nconst decimalsFormat = (decimals: number) =>\n localeNumberFormat({ maximumFractionDigits: decimals })\n\nconst integerFormat = decimalsFormat(0)\nconst oneDecimalFormat = decimalsFormat(1)\nconst twoDecimalFormat = decimalsFormat(2)\n\nconst formatThousands = (n: number) => integerFormat.format(n)\n\nconst formatEnergy = (v: number) => {\n if (v >= 1_000_000) {\n return `${twoDecimalFormat.format(v / 1000)}${NARROW_NBSP}MWh`\n }\n if (v >= 1_000) return `${integerFormat.format(v)}${NARROW_NBSP}kWh`\n if (v >= 10) return `${oneDecimalFormat.format(v)}${NARROW_NBSP}kWh`\n return `${twoDecimalFormat.format(v)}${NARROW_NBSP}kWh`\n}\n\nconst formatPower = (\n value: number | null,\n { signed = false }: { signed?: boolean } = {},\n): string => {\n if (value == null) return EM_DASH\n const rounded = Math.round(value)\n const sign = signed && rounded > 0 ? '+' : ''\n return `${sign}${integerFormat.format(rounded)}${NARROW_NBSP}W`\n}\n\nconst formatPercent = (value: number | null): string => {\n if (value == null) return EM_DASH\n return `${integerFormat.format(value)}${NARROW_NBSP}%`\n}\n\nconst formatRatio = (value: number | null): string => {\n if (value == null) return EM_DASH\n return `${integerFormat.format(value * 100)}${NARROW_NBSP}%`\n}\n\nexport {\n formatThousands,\n formatEnergy,\n formatPower,\n formatPercent,\n formatRatio,\n localeNumberFormat,\n decimalsFormat,\n integerFormat,\n oneDecimalFormat,\n twoDecimalFormat,\n}\n"],"mappings":";;;;AAMA,SAAS,kBAAsC;AAC7C,QAAO,OAAO,aAAa,cACvB,KAAA,IACA,SAAS,gBAAgB,QAAQ,KAAA;;AAGvC,MAAM,sBACJ,YACuB;CACvB,MAAM,wBAAQ,IAAI,KAAgC;AAClD,QAAO,EACL,SAAS,UAAU;EACjB,MAAM,SAAS,iBAAiB;EAChC,MAAM,MAAM,UAAU;EACtB,IAAI,YAAY,MAAM,IAAI,IAAI;AAC9B,MAAI,CAAC,WAAW;AACd,eAAY,IAAI,KAAK,aAAa,QAAQ,QAAQ;AAClD,SAAM,IAAI,KAAK,UAAU;;AAE3B,SAAO,UAAU,OAAO,MAAM;IAEjC;;AAGH,MAAM,kBAAkB,aACtB,mBAAmB,EAAE,uBAAuB,UAAU,CAAC;AAEzD,MAAM,gBAAgB,eAAe,EAAE;AACvC,MAAM,mBAAmB,eAAe,EAAE;AAC1C,MAAM,mBAAmB,eAAe,EAAE;AAE1C,MAAM,mBAAmB,MAAc,cAAc,OAAO,EAAE;AAE9D,MAAM,gBAAgB,MAAc;AAClC,KAAI,KAAK,IACP,QAAO,GAAG,iBAAiB,OAAO,IAAI,IAAK;AAE7C,KAAI,KAAK,IAAO,QAAO,GAAG,cAAc,OAAO,EAAE;AACjD,KAAI,KAAK,GAAI,QAAO,GAAG,iBAAiB,OAAO,EAAE;AACjD,QAAO,GAAG,iBAAiB,OAAO,EAAE;;AAGtC,MAAM,eACJ,OACA,EAAE,SAAS,UAAgC,EAAE,KAClC;AACX,KAAI,SAAS,KAAM,QAAA;CACnB,MAAM,UAAU,KAAK,MAAM,MAAM;AAEjC,QAAO,GADM,UAAU,UAAU,IAAI,MAAM,KAC1B,cAAc,OAAO,QAAQ;;AAGhD,MAAM,iBAAiB,UAAiC;AACtD,KAAI,SAAS,KAAM,QAAA;AACnB,QAAO,GAAG,cAAc,OAAO,MAAM;;AAGvC,MAAM,eAAe,UAAiC;AACpD,KAAI,SAAS,KAAM,QAAA;AACnB,QAAO,GAAG,cAAc,OAAO,QAAQ,IAAI"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/format.d.ts
|
|
4
|
+
interface LocaleNumberFormat {
|
|
5
|
+
format: (value: number) => string;
|
|
6
|
+
}
|
|
7
|
+
declare const localeNumberFormat: (options?: Intl.NumberFormatOptions) => LocaleNumberFormat;
|
|
8
|
+
declare const decimalsFormat: (decimals: number) => LocaleNumberFormat;
|
|
9
|
+
declare const integerFormat: LocaleNumberFormat;
|
|
10
|
+
declare const oneDecimalFormat: LocaleNumberFormat;
|
|
11
|
+
declare const twoDecimalFormat: LocaleNumberFormat;
|
|
12
|
+
declare const formatThousands: (n: number) => string;
|
|
13
|
+
declare const formatEnergy: (v: number) => string;
|
|
14
|
+
declare const formatPower: (value: number | null, {
|
|
15
|
+
signed
|
|
16
|
+
}?: {
|
|
17
|
+
signed?: boolean;
|
|
18
|
+
}) => string;
|
|
19
|
+
declare const formatPercent: (value: number | null) => string;
|
|
20
|
+
declare const formatRatio: (value: number | null) => string;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { decimalsFormat, formatEnergy, formatPercent, formatPower, formatRatio, formatThousands, integerFormat, localeNumberFormat, oneDecimalFormat, twoDecimalFormat };
|
|
23
|
+
//# sourceMappingURL=format.d.cts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/format.d.ts
|
|
4
|
+
interface LocaleNumberFormat {
|
|
5
|
+
format: (value: number) => string;
|
|
6
|
+
}
|
|
7
|
+
declare const localeNumberFormat: (options?: Intl.NumberFormatOptions) => LocaleNumberFormat;
|
|
8
|
+
declare const decimalsFormat: (decimals: number) => LocaleNumberFormat;
|
|
9
|
+
declare const integerFormat: LocaleNumberFormat;
|
|
10
|
+
declare const oneDecimalFormat: LocaleNumberFormat;
|
|
11
|
+
declare const twoDecimalFormat: LocaleNumberFormat;
|
|
12
|
+
declare const formatThousands: (n: number) => string;
|
|
13
|
+
declare const formatEnergy: (v: number) => string;
|
|
14
|
+
declare const formatPower: (value: number | null, {
|
|
15
|
+
signed
|
|
16
|
+
}?: {
|
|
17
|
+
signed?: boolean;
|
|
18
|
+
}) => string;
|
|
19
|
+
declare const formatPercent: (value: number | null) => string;
|
|
20
|
+
declare const formatRatio: (value: number | null) => string;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { decimalsFormat, formatEnergy, formatPercent, formatPower, formatRatio, formatThousands, integerFormat, localeNumberFormat, oneDecimalFormat, twoDecimalFormat };
|
|
23
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "./chars.js";
|
|
3
|
+
//#region src/utils/format.ts
|
|
4
|
+
function getDocumentLang() {
|
|
5
|
+
return typeof document === "undefined" ? void 0 : document.documentElement.lang || void 0;
|
|
6
|
+
}
|
|
7
|
+
const localeNumberFormat = (options) => {
|
|
8
|
+
const cache = /* @__PURE__ */ new Map();
|
|
9
|
+
return { format: (value) => {
|
|
10
|
+
const locale = getDocumentLang();
|
|
11
|
+
const key = locale ?? "";
|
|
12
|
+
let formatter = cache.get(key);
|
|
13
|
+
if (!formatter) {
|
|
14
|
+
formatter = new Intl.NumberFormat(locale, options);
|
|
15
|
+
cache.set(key, formatter);
|
|
16
|
+
}
|
|
17
|
+
return formatter.format(value);
|
|
18
|
+
} };
|
|
19
|
+
};
|
|
20
|
+
const decimalsFormat = (decimals) => localeNumberFormat({ maximumFractionDigits: decimals });
|
|
21
|
+
const integerFormat = decimalsFormat(0);
|
|
22
|
+
const oneDecimalFormat = decimalsFormat(1);
|
|
23
|
+
const twoDecimalFormat = decimalsFormat(2);
|
|
24
|
+
const formatThousands = (n) => integerFormat.format(n);
|
|
25
|
+
const formatEnergy = (v) => {
|
|
26
|
+
if (v >= 1e6) return `${twoDecimalFormat.format(v / 1e3)} MWh`;
|
|
27
|
+
if (v >= 1e3) return `${integerFormat.format(v)} kWh`;
|
|
28
|
+
if (v >= 10) return `${oneDecimalFormat.format(v)} kWh`;
|
|
29
|
+
return `${twoDecimalFormat.format(v)} kWh`;
|
|
30
|
+
};
|
|
31
|
+
const formatPower = (value, { signed = false } = {}) => {
|
|
32
|
+
if (value == null) return "—";
|
|
33
|
+
const rounded = Math.round(value);
|
|
34
|
+
return `${signed && rounded > 0 ? "+" : ""}${integerFormat.format(rounded)} W`;
|
|
35
|
+
};
|
|
36
|
+
const formatPercent = (value) => {
|
|
37
|
+
if (value == null) return "—";
|
|
38
|
+
return `${integerFormat.format(value)} %`;
|
|
39
|
+
};
|
|
40
|
+
const formatRatio = (value) => {
|
|
41
|
+
if (value == null) return "—";
|
|
42
|
+
return `${integerFormat.format(value * 100)} %`;
|
|
43
|
+
};
|
|
44
|
+
//#endregion
|
|
45
|
+
export { decimalsFormat, formatEnergy, formatPercent, formatPower, formatRatio, formatThousands, integerFormat, localeNumberFormat, oneDecimalFormat, twoDecimalFormat };
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","names":[],"sources":["../../src/utils/format.ts"],"sourcesContent":["import { EM_DASH, NARROW_NBSP } from './chars'\n\ninterface LocaleNumberFormat {\n format: (value: number) => string\n}\n\nfunction getDocumentLang(): string | undefined {\n return typeof document === 'undefined'\n ? undefined\n : document.documentElement.lang || undefined\n}\n\nconst localeNumberFormat = (\n options?: Intl.NumberFormatOptions,\n): LocaleNumberFormat => {\n const cache = new Map<string, Intl.NumberFormat>()\n return {\n format: (value) => {\n const locale = getDocumentLang()\n const key = locale ?? ''\n let formatter = cache.get(key)\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, options)\n cache.set(key, formatter)\n }\n return formatter.format(value)\n },\n }\n}\n\nconst decimalsFormat = (decimals: number) =>\n localeNumberFormat({ maximumFractionDigits: decimals })\n\nconst integerFormat = decimalsFormat(0)\nconst oneDecimalFormat = decimalsFormat(1)\nconst twoDecimalFormat = decimalsFormat(2)\n\nconst formatThousands = (n: number) => integerFormat.format(n)\n\nconst formatEnergy = (v: number) => {\n if (v >= 1_000_000) {\n return `${twoDecimalFormat.format(v / 1000)}${NARROW_NBSP}MWh`\n }\n if (v >= 1_000) return `${integerFormat.format(v)}${NARROW_NBSP}kWh`\n if (v >= 10) return `${oneDecimalFormat.format(v)}${NARROW_NBSP}kWh`\n return `${twoDecimalFormat.format(v)}${NARROW_NBSP}kWh`\n}\n\nconst formatPower = (\n value: number | null,\n { signed = false }: { signed?: boolean } = {},\n): string => {\n if (value == null) return EM_DASH\n const rounded = Math.round(value)\n const sign = signed && rounded > 0 ? '+' : ''\n return `${sign}${integerFormat.format(rounded)}${NARROW_NBSP}W`\n}\n\nconst formatPercent = (value: number | null): string => {\n if (value == null) return EM_DASH\n return `${integerFormat.format(value)}${NARROW_NBSP}%`\n}\n\nconst formatRatio = (value: number | null): string => {\n if (value == null) return EM_DASH\n return `${integerFormat.format(value * 100)}${NARROW_NBSP}%`\n}\n\nexport {\n formatThousands,\n formatEnergy,\n formatPower,\n formatPercent,\n formatRatio,\n localeNumberFormat,\n decimalsFormat,\n integerFormat,\n oneDecimalFormat,\n twoDecimalFormat,\n}\n"],"mappings":";;;AAMA,SAAS,kBAAsC;AAC7C,QAAO,OAAO,aAAa,cACvB,KAAA,IACA,SAAS,gBAAgB,QAAQ,KAAA;;AAGvC,MAAM,sBACJ,YACuB;CACvB,MAAM,wBAAQ,IAAI,KAAgC;AAClD,QAAO,EACL,SAAS,UAAU;EACjB,MAAM,SAAS,iBAAiB;EAChC,MAAM,MAAM,UAAU;EACtB,IAAI,YAAY,MAAM,IAAI,IAAI;AAC9B,MAAI,CAAC,WAAW;AACd,eAAY,IAAI,KAAK,aAAa,QAAQ,QAAQ;AAClD,SAAM,IAAI,KAAK,UAAU;;AAE3B,SAAO,UAAU,OAAO,MAAM;IAEjC;;AAGH,MAAM,kBAAkB,aACtB,mBAAmB,EAAE,uBAAuB,UAAU,CAAC;AAEzD,MAAM,gBAAgB,eAAe,EAAE;AACvC,MAAM,mBAAmB,eAAe,EAAE;AAC1C,MAAM,mBAAmB,eAAe,EAAE;AAE1C,MAAM,mBAAmB,MAAc,cAAc,OAAO,EAAE;AAE9D,MAAM,gBAAgB,MAAc;AAClC,KAAI,KAAK,IACP,QAAO,GAAG,iBAAiB,OAAO,IAAI,IAAK;AAE7C,KAAI,KAAK,IAAO,QAAO,GAAG,cAAc,OAAO,EAAE;AACjD,KAAI,KAAK,GAAI,QAAO,GAAG,iBAAiB,OAAO,EAAE;AACjD,QAAO,GAAG,iBAAiB,OAAO,EAAE;;AAGtC,MAAM,eACJ,OACA,EAAE,SAAS,UAAgC,EAAE,KAClC;AACX,KAAI,SAAS,KAAM,QAAA;CACnB,MAAM,UAAU,KAAK,MAAM,MAAM;AAEjC,QAAO,GADM,UAAU,UAAU,IAAI,MAAM,KAC1B,cAAc,OAAO,QAAQ;;AAGhD,MAAM,iBAAiB,UAAiC;AACtD,KAAI,SAAS,KAAM,QAAA;AACnB,QAAO,GAAG,cAAc,OAAO,MAAM;;AAGvC,MAAM,eAAe,UAAiC;AACpD,KAAI,SAAS,KAAM,QAAA;AACnB,QAAO,GAAG,cAAc,OAAO,QAAQ,IAAI"}
|
package/package.json
CHANGED
|
@@ -1,79 +1,94 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epilot/spark-ui",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.3",
|
|
4
4
|
"description": "React UI component library from Spark SDK",
|
|
5
|
-
"
|
|
6
|
-
"sideEffects": false,
|
|
7
|
-
"main": "./dist/index.cjs",
|
|
8
|
-
"module": "./dist/index.js",
|
|
9
|
-
"types": "./dist/index.d.ts",
|
|
10
|
-
"exports": {
|
|
11
|
-
".": {
|
|
12
|
-
"types": "./dist/index.d.ts",
|
|
13
|
-
"import": "./dist/index.js",
|
|
14
|
-
"require": "./dist/index.cjs"
|
|
15
|
-
},
|
|
16
|
-
"./styles": "./dist/index.css",
|
|
17
|
-
"./package.json": "./package.json"
|
|
18
|
-
},
|
|
19
|
-
"files": [
|
|
20
|
-
"dist",
|
|
21
|
-
"README.md"
|
|
22
|
-
],
|
|
23
|
-
"scripts": {
|
|
24
|
-
"build": "tsup && vite build",
|
|
25
|
-
"dev": "tsup --watch",
|
|
26
|
-
"typecheck": "tsc --noEmit",
|
|
27
|
-
"clean": "rm -rf dist"
|
|
28
|
-
},
|
|
5
|
+
"license": "Apache-2.0",
|
|
29
6
|
"author": "epilot",
|
|
30
|
-
"license": "MIT",
|
|
31
7
|
"repository": {
|
|
32
8
|
"type": "git",
|
|
33
9
|
"url": "https://github.com/epilot/spark-sdk.git",
|
|
34
10
|
"directory": "packages/ui"
|
|
35
11
|
},
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"LICENSE",
|
|
15
|
+
"NOTICE",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"type": "module",
|
|
19
|
+
"sideEffects": [
|
|
20
|
+
"**/*.css"
|
|
21
|
+
],
|
|
22
|
+
"exports": {
|
|
23
|
+
"./styles": "./dist/styles/index.css",
|
|
24
|
+
"./spark-default": "./dist/styles/spark-default.css",
|
|
25
|
+
"./utils/*": {
|
|
26
|
+
"types": "./dist/utils/*.d.ts",
|
|
27
|
+
"default": "./dist/utils/*.js"
|
|
28
|
+
},
|
|
29
|
+
"./icons/*": {
|
|
30
|
+
"types": "./dist/icons/*.d.ts",
|
|
31
|
+
"default": "./dist/icons/*.js"
|
|
32
|
+
},
|
|
33
|
+
"./*": {
|
|
34
|
+
"types": "./dist/components/*.d.ts",
|
|
35
|
+
"default": "./dist/components/*.js"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@base-ui/react": "^1.6.0",
|
|
40
|
+
"@daypicker/react": "^10.0.1",
|
|
41
|
+
"@dnd-kit/core": "^6.3.1",
|
|
42
|
+
"@dnd-kit/modifiers": "^9.0.0",
|
|
43
|
+
"@dnd-kit/sortable": "^10.0.0",
|
|
44
|
+
"@dnd-kit/utilities": "^3.2.2",
|
|
45
|
+
"@number-flow/react": "^0.6.0",
|
|
46
|
+
"@radix-ui/colors": "^3.0.0",
|
|
47
|
+
"@shadcn/react": "^0.2.1",
|
|
48
|
+
"@visx/curve": "^4.0.0-alpha.11",
|
|
49
|
+
"@visx/event": "^4.0.0-alpha.11",
|
|
50
|
+
"@visx/group": "^4.0.0-alpha.11",
|
|
51
|
+
"@visx/sankey": "^4.0.0-alpha.11",
|
|
52
|
+
"@visx/scale": "^4.0.0-alpha.11",
|
|
53
|
+
"@visx/shape": "^4.0.0-alpha.11",
|
|
54
|
+
"@visx/tooltip": "^4.0.0-alpha.11",
|
|
55
|
+
"@visx/vendor": "^4.0.0-alpha.11",
|
|
56
|
+
"bezier-easing": "^2.1.0",
|
|
57
|
+
"class-variance-authority": "^0.7.1",
|
|
58
|
+
"cnfast": "^0.0.8",
|
|
59
|
+
"colorjs.io": "^0.5.2",
|
|
60
|
+
"sonner": "^2.0.7",
|
|
61
|
+
"vaul": "^1.1.2"
|
|
41
62
|
},
|
|
42
63
|
"devDependencies": {
|
|
43
|
-
"@tailwindcss/postcss": "^4.2.
|
|
64
|
+
"@tailwindcss/postcss": "^4.2.4",
|
|
65
|
+
"@testing-library/dom": "^10.4.0",
|
|
66
|
+
"@testing-library/react": "^16.3.0",
|
|
44
67
|
"@types/react": "^19.2.14",
|
|
45
68
|
"@types/react-dom": "^19.2.3",
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"react
|
|
49
|
-
"
|
|
50
|
-
"
|
|
69
|
+
"jsdom": "^29.1.1",
|
|
70
|
+
"postcss": "^8.5.12",
|
|
71
|
+
"react": "^19.2.5",
|
|
72
|
+
"react-dom": "^19.2.5",
|
|
73
|
+
"tailwindcss": "^4.2.4",
|
|
51
74
|
"tw-animate-css": "^1.4.0",
|
|
52
|
-
"typescript": "^
|
|
53
|
-
"vite": "
|
|
75
|
+
"typescript": "^6.0.2",
|
|
76
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@latest",
|
|
77
|
+
"vite-plus": "^0.1.20",
|
|
78
|
+
"vitest": "npm:@voidzero-dev/vite-plus-test@latest",
|
|
79
|
+
"vitest-axe": "^0.1.0"
|
|
54
80
|
},
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"@visx/curve": "^3.12.0",
|
|
68
|
-
"@visx/event": "^3.12.0",
|
|
69
|
-
"@visx/group": "^3.12.0",
|
|
70
|
-
"@visx/scale": "^3.12.0",
|
|
71
|
-
"@visx/shape": "^3.12.0",
|
|
72
|
-
"@visx/tooltip": "^3.12.0",
|
|
73
|
-
"@visx/vendor": "^3.12.0",
|
|
74
|
-
"class-variance-authority": "^0.7.1",
|
|
75
|
-
"clsx": "^2.1.1",
|
|
76
|
-
"tailwind-merge": "^3.5.0",
|
|
77
|
-
"vaul": "^1.1.2"
|
|
81
|
+
"peerDependencies": {
|
|
82
|
+
"react": ">=18.0.0",
|
|
83
|
+
"react-dom": ">=18.0.0",
|
|
84
|
+
"tailwindcss": ">=4.1.0",
|
|
85
|
+
"tw-animate-css": ">=1.4.0"
|
|
86
|
+
},
|
|
87
|
+
"scripts": {
|
|
88
|
+
"build": "vp pack",
|
|
89
|
+
"clean": "rm -rf dist",
|
|
90
|
+
"dev": "vp pack --watch",
|
|
91
|
+
"test": "vp test run",
|
|
92
|
+
"typecheck": "tsc --noEmit"
|
|
78
93
|
}
|
|
79
|
-
}
|
|
94
|
+
}
|