@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,592 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const require_chunk = require("./chunk-aJGBMT86.cjs");
|
|
3
|
+
let react = require("react");
|
|
4
|
+
react = require_chunk.__toESM(react);
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
+
let _base_ui_react_merge_props = require("@base-ui/react/merge-props");
|
|
7
|
+
let _base_ui_react_use_render = require("@base-ui/react/use-render");
|
|
8
|
+
let _radix_ui_colors = require("@radix-ui/colors");
|
|
9
|
+
let _radix_ui_colors$1 = require_chunk.__toESM(_radix_ui_colors, 1);
|
|
10
|
+
_radix_ui_colors = require_chunk.__toESM(_radix_ui_colors);
|
|
11
|
+
let colorjs_io = require("colorjs.io");
|
|
12
|
+
let colorjs_io$1 = require_chunk.__toESM(colorjs_io, 1);
|
|
13
|
+
colorjs_io = require_chunk.__toESM(colorjs_io);
|
|
14
|
+
let bezier_easing = require("bezier-easing");
|
|
15
|
+
bezier_easing = require_chunk.__toESM(bezier_easing);
|
|
16
|
+
let cnfast = require("cnfast");
|
|
17
|
+
//#region src/lib/generate-radix-colors.tsx
|
|
18
|
+
/**
|
|
19
|
+
* Vendored from Radix UI's website — components/generate-radix-colors.tsx
|
|
20
|
+
* https://github.com/radix-ui/website
|
|
21
|
+
*
|
|
22
|
+
* MIT License — Copyright (c) 2024 WorkOS
|
|
23
|
+
*
|
|
24
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
25
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
26
|
+
* in the Software without restriction, including without limitation the rights
|
|
27
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
28
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
29
|
+
* furnished to do so, subject to the following conditions:
|
|
30
|
+
*
|
|
31
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
32
|
+
* copies or substantial portions of the Software.
|
|
33
|
+
*
|
|
34
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. (Full text:
|
|
35
|
+
* https://github.com/radix-ui/website/blob/main/LICENSE)
|
|
36
|
+
*
|
|
37
|
+
* Kept VERBATIM so it can be re-synced upstream (this file is excluded from the
|
|
38
|
+
* formatter in vite.config.ts). Strict type-checking is skipped (upstream targets
|
|
39
|
+
* a looser tsconfig with unchecked array indexing over fixed 12-step scales).
|
|
40
|
+
*/
|
|
41
|
+
const arrayOf12 = [
|
|
42
|
+
0,
|
|
43
|
+
1,
|
|
44
|
+
2,
|
|
45
|
+
3,
|
|
46
|
+
4,
|
|
47
|
+
5,
|
|
48
|
+
6,
|
|
49
|
+
7,
|
|
50
|
+
8,
|
|
51
|
+
9,
|
|
52
|
+
10,
|
|
53
|
+
11
|
|
54
|
+
];
|
|
55
|
+
const grayScaleNames = [
|
|
56
|
+
"gray",
|
|
57
|
+
"mauve",
|
|
58
|
+
"slate",
|
|
59
|
+
"sage",
|
|
60
|
+
"olive",
|
|
61
|
+
"sand"
|
|
62
|
+
];
|
|
63
|
+
const scaleNames = [
|
|
64
|
+
...grayScaleNames,
|
|
65
|
+
"tomato",
|
|
66
|
+
"red",
|
|
67
|
+
"ruby",
|
|
68
|
+
"crimson",
|
|
69
|
+
"pink",
|
|
70
|
+
"plum",
|
|
71
|
+
"purple",
|
|
72
|
+
"violet",
|
|
73
|
+
"iris",
|
|
74
|
+
"indigo",
|
|
75
|
+
"blue",
|
|
76
|
+
"cyan",
|
|
77
|
+
"teal",
|
|
78
|
+
"jade",
|
|
79
|
+
"green",
|
|
80
|
+
"grass",
|
|
81
|
+
"brown",
|
|
82
|
+
"orange",
|
|
83
|
+
"sky",
|
|
84
|
+
"mint",
|
|
85
|
+
"lime",
|
|
86
|
+
"yellow",
|
|
87
|
+
"amber"
|
|
88
|
+
];
|
|
89
|
+
const lightColors = Object.fromEntries(scaleNames.map((scaleName) => [scaleName, Object.values(_radix_ui_colors[`${scaleName}P3`]).map((str) => new colorjs_io.default(str).to("oklch"))]));
|
|
90
|
+
const darkColors = Object.fromEntries(scaleNames.map((scaleName) => [scaleName, Object.values(_radix_ui_colors[`${scaleName}DarkP3`]).map((str) => new colorjs_io.default(str).to("oklch"))]));
|
|
91
|
+
const lightGrayColors = Object.fromEntries(grayScaleNames.map((scaleName) => [scaleName, Object.values(_radix_ui_colors[`${scaleName}P3`]).map((str) => new colorjs_io.default(str).to("oklch"))]));
|
|
92
|
+
const darkGrayColors = Object.fromEntries(grayScaleNames.map((scaleName) => [scaleName, Object.values(_radix_ui_colors[`${scaleName}DarkP3`]).map((str) => new colorjs_io.default(str).to("oklch"))]));
|
|
93
|
+
const generateRadixColors = ({ appearance, ...args }) => {
|
|
94
|
+
const allScales = appearance === "light" ? lightColors : darkColors;
|
|
95
|
+
const grayScales = appearance === "light" ? lightGrayColors : darkGrayColors;
|
|
96
|
+
const backgroundColor = new colorjs_io.default(args.background).to("oklch");
|
|
97
|
+
const grayScaleColors = getScaleFromColor(new colorjs_io.default(args.gray).to("oklch"), grayScales, backgroundColor);
|
|
98
|
+
const accentBaseColor = new colorjs_io.default(args.accent).to("oklch");
|
|
99
|
+
let accentScaleColors = getScaleFromColor(accentBaseColor, allScales, backgroundColor);
|
|
100
|
+
const backgroundHex = backgroundColor.to("srgb").toString({ format: "hex" });
|
|
101
|
+
const accentBaseHex = accentBaseColor.to("srgb").toString({ format: "hex" });
|
|
102
|
+
if (accentBaseHex === "#000" || accentBaseHex === "#fff") accentScaleColors = grayScaleColors.map((color) => color.clone());
|
|
103
|
+
const [accent9Color, accentContrastColor] = getStep9Colors(accentScaleColors, accentBaseColor);
|
|
104
|
+
accentScaleColors[8] = accent9Color;
|
|
105
|
+
accentScaleColors[9] = getButtonHoverColor(accent9Color, [accentScaleColors]);
|
|
106
|
+
accentScaleColors[10].coords[1] = Math.min(Math.max(accentScaleColors[8].coords[1], accentScaleColors[7].coords[1]), accentScaleColors[10].coords[1]);
|
|
107
|
+
accentScaleColors[11].coords[1] = Math.min(Math.max(accentScaleColors[8].coords[1], accentScaleColors[7].coords[1]), accentScaleColors[11].coords[1]);
|
|
108
|
+
const accentScaleHex = accentScaleColors.map((color) => color.to("srgb").toString({ format: "hex" }));
|
|
109
|
+
const accentScaleWideGamut = accentScaleColors.map(toOklchString);
|
|
110
|
+
const accentScaleAlphaHex = accentScaleHex.map((color) => getAlphaColorSrgb(color, backgroundHex));
|
|
111
|
+
const accentScaleAlphaWideGamutString = accentScaleHex.map((color) => getAlphaColorP3(color, backgroundHex));
|
|
112
|
+
const accentContrastColorHex = accentContrastColor.to("srgb").toString({ format: "hex" });
|
|
113
|
+
const grayScaleHex = grayScaleColors.map((color) => color.to("srgb").toString({ format: "hex" }));
|
|
114
|
+
const grayScaleWideGamut = grayScaleColors.map(toOklchString);
|
|
115
|
+
const grayScaleAlphaHex = grayScaleHex.map((color) => getAlphaColorSrgb(color, backgroundHex));
|
|
116
|
+
const grayScaleAlphaWideGamutString = grayScaleHex.map((color) => getAlphaColorP3(color, backgroundHex));
|
|
117
|
+
const accentSurfaceHex = appearance === "light" ? getAlphaColorSrgb(accentScaleHex[1], backgroundHex, .8) : getAlphaColorSrgb(accentScaleHex[1], backgroundHex, .5);
|
|
118
|
+
const accentSurfaceWideGamutString = appearance === "light" ? getAlphaColorP3(accentScaleWideGamut[1], backgroundHex, .8) : getAlphaColorP3(accentScaleWideGamut[1], backgroundHex, .5);
|
|
119
|
+
return {
|
|
120
|
+
accentScale: accentScaleHex,
|
|
121
|
+
accentScaleAlpha: accentScaleAlphaHex,
|
|
122
|
+
accentScaleWideGamut,
|
|
123
|
+
accentScaleAlphaWideGamut: accentScaleAlphaWideGamutString,
|
|
124
|
+
accentContrast: accentContrastColorHex,
|
|
125
|
+
grayScale: grayScaleHex,
|
|
126
|
+
grayScaleAlpha: grayScaleAlphaHex,
|
|
127
|
+
grayScaleWideGamut,
|
|
128
|
+
grayScaleAlphaWideGamut: grayScaleAlphaWideGamutString,
|
|
129
|
+
graySurface: appearance === "light" ? "#ffffffcc" : "rgba(0, 0, 0, 0.05)",
|
|
130
|
+
graySurfaceWideGamut: appearance === "light" ? "color(display-p3 1 1 1 / 80%)" : "color(display-p3 0 0 0 / 5%)",
|
|
131
|
+
accentSurface: accentSurfaceHex,
|
|
132
|
+
accentSurfaceWideGamut: accentSurfaceWideGamutString,
|
|
133
|
+
background: backgroundHex
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
function getStep9Colors(scale, accentBaseColor) {
|
|
137
|
+
const referenceBackgroundColor = scale[0];
|
|
138
|
+
if (accentBaseColor.deltaEOK(referenceBackgroundColor) * 100 < 25) return [scale[8], getTextColor(scale[8])];
|
|
139
|
+
return [accentBaseColor, getTextColor(accentBaseColor)];
|
|
140
|
+
}
|
|
141
|
+
function getButtonHoverColor(source, scales) {
|
|
142
|
+
const [L, C, H] = source.coords;
|
|
143
|
+
const buttonHoverColor = new colorjs_io.default("oklch", [
|
|
144
|
+
L > .4 ? L - .03 / (L + .1) : L + .03 / (L + .1),
|
|
145
|
+
L > .4 && !isNaN(H) ? C * .93 + 0 : C,
|
|
146
|
+
H
|
|
147
|
+
]);
|
|
148
|
+
let closestColor = buttonHoverColor;
|
|
149
|
+
let minDistance = Infinity;
|
|
150
|
+
scales.forEach((scale) => {
|
|
151
|
+
for (const color of scale) {
|
|
152
|
+
const distance = buttonHoverColor.deltaEOK(color);
|
|
153
|
+
if (distance < minDistance) {
|
|
154
|
+
minDistance = distance;
|
|
155
|
+
closestColor = color;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
buttonHoverColor.coords[1] = closestColor.coords[1];
|
|
160
|
+
buttonHoverColor.coords[2] = closestColor.coords[2];
|
|
161
|
+
return buttonHoverColor;
|
|
162
|
+
}
|
|
163
|
+
function getScaleFromColor(source, scales, backgroundColor) {
|
|
164
|
+
let allColors = [];
|
|
165
|
+
Object.entries(scales).forEach(([name, scale]) => {
|
|
166
|
+
for (const color of scale) {
|
|
167
|
+
const distance = source.deltaEOK(color);
|
|
168
|
+
allColors.push({
|
|
169
|
+
scale: name,
|
|
170
|
+
distance,
|
|
171
|
+
color
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
allColors.sort((a, b) => a.distance - b.distance);
|
|
176
|
+
let closestColors = allColors.filter((color, i, arr) => i === arr.findIndex((value) => value.scale === color.scale));
|
|
177
|
+
const grayScaleNamesStr = grayScaleNames;
|
|
178
|
+
if (!closestColors.every((color) => grayScaleNamesStr.includes(color.scale)) && grayScaleNamesStr.includes(closestColors[0].scale)) while (grayScaleNamesStr.includes(closestColors[1].scale)) closestColors.splice(1, 1);
|
|
179
|
+
let colorA = closestColors[0];
|
|
180
|
+
let colorB = closestColors[1];
|
|
181
|
+
const a = colorB.distance;
|
|
182
|
+
const b = colorA.distance;
|
|
183
|
+
const c = colorA.color.deltaEOK(colorB.color);
|
|
184
|
+
const cosA = (b ** 2 + c ** 2 - a ** 2) / (2 * b * c);
|
|
185
|
+
const sinA = Math.sin(Math.acos(cosA));
|
|
186
|
+
const cosB = (a ** 2 + c ** 2 - b ** 2) / (2 * a * c);
|
|
187
|
+
const sinB = Math.sin(Math.acos(cosB));
|
|
188
|
+
const tanC1 = cosA / sinA;
|
|
189
|
+
const tanC2 = cosB / sinB;
|
|
190
|
+
const ratio = Math.max(0, tanC1 / tanC2) * .5;
|
|
191
|
+
const scaleA = scales[colorA.scale];
|
|
192
|
+
const scaleB = scales[colorB.scale];
|
|
193
|
+
const scale = arrayOf12.map((i) => new colorjs_io.default(colorjs_io.default.mix(scaleA[i], scaleB[i], ratio)).to("oklch"));
|
|
194
|
+
const baseColor = scale.slice().sort((a, b) => source.deltaEOK(a) - source.deltaEOK(b))[0];
|
|
195
|
+
const ratioC = source.coords[1] / baseColor.coords[1];
|
|
196
|
+
scale.forEach((color) => {
|
|
197
|
+
color.coords[1] = Math.min(source.coords[1] * 1.5, color.coords[1] * ratioC);
|
|
198
|
+
color.coords[2] = source.coords[2];
|
|
199
|
+
});
|
|
200
|
+
if (scale[0].coords[0] > .5) {
|
|
201
|
+
const lightnessScale = scale.map(({ coords }) => coords[0]);
|
|
202
|
+
const newLightnessScale = transposeProgressionStart(Math.max(0, Math.min(1, backgroundColor.coords[0])), [1, ...lightnessScale], lightModeEasing);
|
|
203
|
+
newLightnessScale.shift();
|
|
204
|
+
newLightnessScale.forEach((lightness, i) => {
|
|
205
|
+
scale[i].coords[0] = lightness;
|
|
206
|
+
});
|
|
207
|
+
return scale;
|
|
208
|
+
}
|
|
209
|
+
let ease = [...darkModeEasing];
|
|
210
|
+
const referenceBackgroundColorL = scale[0].coords[0];
|
|
211
|
+
const ratioL = Math.max(0, Math.min(1, backgroundColor.coords[0])) / referenceBackgroundColorL;
|
|
212
|
+
if (ratioL > 1) {
|
|
213
|
+
const maxRatio = 1.5;
|
|
214
|
+
for (let i = 0; i < ease.length; i++) {
|
|
215
|
+
const metaRatio = (ratioL - 1) * (maxRatio / (maxRatio - 1));
|
|
216
|
+
ease[i] = ratioL > maxRatio ? 0 : Math.max(0, ease[i] * (1 - metaRatio));
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
const lightnessScale = scale.map(({ coords }) => coords[0]);
|
|
220
|
+
const backgroundL = backgroundColor.coords[0];
|
|
221
|
+
transposeProgressionStart(backgroundL, lightnessScale, ease).forEach((lightness, i) => {
|
|
222
|
+
scale[i].coords[0] = lightness;
|
|
223
|
+
});
|
|
224
|
+
return scale;
|
|
225
|
+
}
|
|
226
|
+
function getTextColor(background) {
|
|
227
|
+
const white = new colorjs_io.default("oklch", [
|
|
228
|
+
1,
|
|
229
|
+
0,
|
|
230
|
+
0
|
|
231
|
+
]);
|
|
232
|
+
if (Math.abs(white.contrastAPCA(background)) < 40) {
|
|
233
|
+
const [, C, H] = background.coords;
|
|
234
|
+
return new colorjs_io.default("oklch", [
|
|
235
|
+
.25,
|
|
236
|
+
Math.max(.08 * C, .04),
|
|
237
|
+
H
|
|
238
|
+
]);
|
|
239
|
+
}
|
|
240
|
+
return white;
|
|
241
|
+
}
|
|
242
|
+
function getAlphaColor(targetRgb, backgroundRgb, rgbPrecision, alphaPrecision, targetAlpha) {
|
|
243
|
+
const [tr, tg, tb] = targetRgb.map((c) => Math.round(c * rgbPrecision));
|
|
244
|
+
const [br, bg, bb] = backgroundRgb.map((c) => Math.round(c * rgbPrecision));
|
|
245
|
+
if (tr === void 0 || tg === void 0 || tb === void 0 || br === void 0 || bg === void 0 || bb === void 0) throw Error("Color is undefined");
|
|
246
|
+
let desiredRgb = 0;
|
|
247
|
+
if (tr > br) desiredRgb = rgbPrecision;
|
|
248
|
+
else if (tg > bg) desiredRgb = rgbPrecision;
|
|
249
|
+
else if (tb > bb) desiredRgb = rgbPrecision;
|
|
250
|
+
const alphaR = (tr - br) / (desiredRgb - br);
|
|
251
|
+
const alphaG = (tg - bg) / (desiredRgb - bg);
|
|
252
|
+
const alphaB = (tb - bb) / (desiredRgb - bb);
|
|
253
|
+
const isPureGray = [
|
|
254
|
+
alphaR,
|
|
255
|
+
alphaG,
|
|
256
|
+
alphaB
|
|
257
|
+
].every((alpha) => alpha === alphaR);
|
|
258
|
+
if (!targetAlpha && isPureGray) {
|
|
259
|
+
const V = desiredRgb / rgbPrecision;
|
|
260
|
+
return [
|
|
261
|
+
V,
|
|
262
|
+
V,
|
|
263
|
+
V,
|
|
264
|
+
alphaR
|
|
265
|
+
];
|
|
266
|
+
}
|
|
267
|
+
const clampRgb = (n) => isNaN(n) ? 0 : Math.min(rgbPrecision, Math.max(0, n));
|
|
268
|
+
const clampA = (n) => isNaN(n) ? 0 : Math.min(alphaPrecision, Math.max(0, n));
|
|
269
|
+
const A = clampA(Math.ceil((targetAlpha ?? Math.max(alphaR, alphaG, alphaB)) * alphaPrecision)) / alphaPrecision;
|
|
270
|
+
let R = clampRgb((br * (1 - A) - tr) / A * -1);
|
|
271
|
+
let G = clampRgb((bg * (1 - A) - tg) / A * -1);
|
|
272
|
+
let B = clampRgb((bb * (1 - A) - tb) / A * -1);
|
|
273
|
+
R = Math.ceil(R);
|
|
274
|
+
G = Math.ceil(G);
|
|
275
|
+
B = Math.ceil(B);
|
|
276
|
+
const blendedR = blendAlpha(R, A, br);
|
|
277
|
+
const blendedG = blendAlpha(G, A, bg);
|
|
278
|
+
const blendedB = blendAlpha(B, A, bb);
|
|
279
|
+
if (desiredRgb === 0) {
|
|
280
|
+
if (tr <= br && tr !== blendedR) R = tr > blendedR ? R + 1 : R - 1;
|
|
281
|
+
if (tg <= bg && tg !== blendedG) G = tg > blendedG ? G + 1 : G - 1;
|
|
282
|
+
if (tb <= bb && tb !== blendedB) B = tb > blendedB ? B + 1 : B - 1;
|
|
283
|
+
}
|
|
284
|
+
if (desiredRgb === rgbPrecision) {
|
|
285
|
+
if (tr >= br && tr !== blendedR) R = tr > blendedR ? R + 1 : R - 1;
|
|
286
|
+
if (tg >= bg && tg !== blendedG) G = tg > blendedG ? G + 1 : G - 1;
|
|
287
|
+
if (tb >= bb && tb !== blendedB) B = tb > blendedB ? B + 1 : B - 1;
|
|
288
|
+
}
|
|
289
|
+
R = R / rgbPrecision;
|
|
290
|
+
G = G / rgbPrecision;
|
|
291
|
+
B = B / rgbPrecision;
|
|
292
|
+
return [
|
|
293
|
+
R,
|
|
294
|
+
G,
|
|
295
|
+
B,
|
|
296
|
+
A
|
|
297
|
+
];
|
|
298
|
+
}
|
|
299
|
+
function blendAlpha(foreground, alpha, background, round = true) {
|
|
300
|
+
if (round) return Math.round(background * (1 - alpha)) + Math.round(foreground * alpha);
|
|
301
|
+
return background * (1 - alpha) + foreground * alpha;
|
|
302
|
+
}
|
|
303
|
+
function getAlphaColorSrgb(targetColor, backgroundColor, targetAlpha) {
|
|
304
|
+
const [r, g, b, a] = getAlphaColor(new colorjs_io.default(targetColor).to("srgb").coords, new colorjs_io.default(backgroundColor).to("srgb").coords, 255, 255, targetAlpha);
|
|
305
|
+
return formatHex(new colorjs_io.default("srgb", [
|
|
306
|
+
r,
|
|
307
|
+
g,
|
|
308
|
+
b
|
|
309
|
+
], a).toString({ format: "hex" }));
|
|
310
|
+
}
|
|
311
|
+
function getAlphaColorP3(targetColor, backgroundColor, targetAlpha) {
|
|
312
|
+
const [r, g, b, a] = getAlphaColor(new colorjs_io.default(targetColor).to("p3").coords, new colorjs_io.default(backgroundColor).to("p3").coords, 255, 1e3, targetAlpha);
|
|
313
|
+
return new colorjs_io.default("p3", [
|
|
314
|
+
r,
|
|
315
|
+
g,
|
|
316
|
+
b
|
|
317
|
+
], a).toString({ precision: 4 }).replace("color(p3 ", "color(display-p3 ");
|
|
318
|
+
}
|
|
319
|
+
function formatHex(str) {
|
|
320
|
+
if (!str.startsWith("#")) return str;
|
|
321
|
+
if (str.length === 4) {
|
|
322
|
+
const hash = str.charAt(0);
|
|
323
|
+
const r = str.charAt(1);
|
|
324
|
+
const g = str.charAt(2);
|
|
325
|
+
const b = str.charAt(3);
|
|
326
|
+
return hash + r + r + g + g + b + b;
|
|
327
|
+
}
|
|
328
|
+
if (str.length === 5) {
|
|
329
|
+
const hash = str.charAt(0);
|
|
330
|
+
const r = str.charAt(1);
|
|
331
|
+
const g = str.charAt(2);
|
|
332
|
+
const b = str.charAt(3);
|
|
333
|
+
const a = str.charAt(4);
|
|
334
|
+
return hash + r + r + g + g + b + b + a + a;
|
|
335
|
+
}
|
|
336
|
+
return str;
|
|
337
|
+
}
|
|
338
|
+
const darkModeEasing = [
|
|
339
|
+
1,
|
|
340
|
+
0,
|
|
341
|
+
1,
|
|
342
|
+
0
|
|
343
|
+
];
|
|
344
|
+
const lightModeEasing = [
|
|
345
|
+
0,
|
|
346
|
+
2,
|
|
347
|
+
0,
|
|
348
|
+
2
|
|
349
|
+
];
|
|
350
|
+
function transposeProgressionStart(to, arr, curve) {
|
|
351
|
+
return arr.map((n, i, arr) => {
|
|
352
|
+
const lastIndex = arr.length - 1;
|
|
353
|
+
return n - (arr[0] - to) * (0, bezier_easing.default)(...curve)(1 - i / lastIndex);
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
function toOklchString(color) {
|
|
357
|
+
const L = +(color.coords[0] * 100).toFixed(1);
|
|
358
|
+
return color.to("oklch").toString({ precision: 4 }).replace(/(\S+)(.+)/, `oklch(${L}%$2`);
|
|
359
|
+
}
|
|
360
|
+
//#endregion
|
|
361
|
+
//#region src/lib/accent-theme.ts
|
|
362
|
+
/** Curated name → source color. `blue` = Radix blue; the no-attribute default `--spark-*` stays the epilot brand. */
|
|
363
|
+
const CURATED_ACCENTS = {
|
|
364
|
+
blue: _radix_ui_colors$1.blue.blue9,
|
|
365
|
+
indigo: _radix_ui_colors$1.indigo.indigo9,
|
|
366
|
+
violet: _radix_ui_colors$1.violet.violet9,
|
|
367
|
+
purple: _radix_ui_colors$1.purple.purple9,
|
|
368
|
+
cyan: _radix_ui_colors$1.cyan.cyan9,
|
|
369
|
+
teal: _radix_ui_colors$1.teal.teal9,
|
|
370
|
+
green: _radix_ui_colors$1.green.green9,
|
|
371
|
+
grass: _radix_ui_colors$1.grass.grass9,
|
|
372
|
+
orange: _radix_ui_colors$1.orange.orange9,
|
|
373
|
+
red: _radix_ui_colors$1.red.red9,
|
|
374
|
+
pink: _radix_ui_colors$1.pink.pink9,
|
|
375
|
+
gray: _radix_ui_colors$1.gray.gray9
|
|
376
|
+
};
|
|
377
|
+
/** ECP `DesignUtils` generator inputs, so a generated scale matches live portals. */
|
|
378
|
+
const DEFAULTS = {
|
|
379
|
+
light: {
|
|
380
|
+
gray: "#333333",
|
|
381
|
+
background: "#ffffff"
|
|
382
|
+
},
|
|
383
|
+
dark: {
|
|
384
|
+
gray: "#8b8d98",
|
|
385
|
+
background: "#111113"
|
|
386
|
+
}
|
|
387
|
+
};
|
|
388
|
+
/** Generate the Radix-style accent scale for one appearance from a single accent color. */
|
|
389
|
+
function generateAccentScale(accent, appearance) {
|
|
390
|
+
const scale = generateRadixColors({
|
|
391
|
+
appearance,
|
|
392
|
+
accent,
|
|
393
|
+
gray: DEFAULTS[appearance].gray,
|
|
394
|
+
background: DEFAULTS[appearance].background
|
|
395
|
+
});
|
|
396
|
+
return {
|
|
397
|
+
...scale,
|
|
398
|
+
accentContrast: readableContrast(scale, MIN_TEXT_CONTRAST),
|
|
399
|
+
accentOnSolid: readableContrast(scale, MIN_GRAPHIC_CONTRAST)
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
const MIN_TEXT_CONTRAST = 4.5;
|
|
403
|
+
const MIN_GRAPHIC_CONTRAST = 3;
|
|
404
|
+
function readableContrast(scale, min) {
|
|
405
|
+
const step9 = new colorjs_io$1.default(scale.accentScale[8]);
|
|
406
|
+
const [, chroma, hue] = step9.to("oklch").coords;
|
|
407
|
+
const tinted = (lightness) => new colorjs_io$1.default("oklch", [
|
|
408
|
+
lightness,
|
|
409
|
+
Math.max(.08 * (chroma ?? 0), .04),
|
|
410
|
+
hue ?? 0
|
|
411
|
+
]).to("srgb").toString({ format: "hex" });
|
|
412
|
+
const candidates = [
|
|
413
|
+
scale.accentContrast,
|
|
414
|
+
tinted(.25),
|
|
415
|
+
tinted(.15)
|
|
416
|
+
];
|
|
417
|
+
const ratios = candidates.map((c) => new colorjs_io$1.default(c).contrast(step9, "WCAG21"));
|
|
418
|
+
const passing = ratios.findIndex((r) => r >= min);
|
|
419
|
+
if (passing !== -1) return candidates[passing];
|
|
420
|
+
return candidates[ratios.indexOf(Math.max(...ratios))];
|
|
421
|
+
}
|
|
422
|
+
/** sRGB `--spark-*` declarations for a generated accent scale. */
|
|
423
|
+
function accentSparkVars(scale) {
|
|
424
|
+
return sparkVars(scale.accentScale, scale.accentScaleAlpha, scale.accentContrast, scale.accentOnSolid, scale.accentSurface, scale.background);
|
|
425
|
+
}
|
|
426
|
+
/** Radix's `grayColor="auto"` pairing (accent family → gray), mapped to our 6 neutrals. */
|
|
427
|
+
const NEUTRAL_BY_ACCENT = {
|
|
428
|
+
blue: "slate",
|
|
429
|
+
indigo: "slate",
|
|
430
|
+
cyan: "slate",
|
|
431
|
+
violet: "mauve",
|
|
432
|
+
purple: "mauve",
|
|
433
|
+
pink: "mauve",
|
|
434
|
+
red: "mauve",
|
|
435
|
+
teal: "sage",
|
|
436
|
+
green: "sage",
|
|
437
|
+
grass: "olive",
|
|
438
|
+
orange: "sand",
|
|
439
|
+
gray: "gray"
|
|
440
|
+
};
|
|
441
|
+
/** Radix's "auto" gray: curated names use Radix's table; a custom hex is classified by OKLCH hue. */
|
|
442
|
+
function getMatchingNeutral(accent) {
|
|
443
|
+
const byName = NEUTRAL_BY_ACCENT[accent];
|
|
444
|
+
if (byName) return byName;
|
|
445
|
+
try {
|
|
446
|
+
const [, chroma, hueRaw] = new colorjs_io$1.default(accent).to("oklch").coords;
|
|
447
|
+
if (!chroma || chroma < .04) return "gray";
|
|
448
|
+
const hue = ((hueRaw ?? 0) % 360 + 360) % 360;
|
|
449
|
+
if (hue >= 300 || hue < 35) return "mauve";
|
|
450
|
+
if (hue < 115) return "sand";
|
|
451
|
+
if (hue < 145) return "olive";
|
|
452
|
+
if (hue < 200) return "sage";
|
|
453
|
+
return "slate";
|
|
454
|
+
} catch {
|
|
455
|
+
return "slate";
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
function sparkVars(steps, alpha, contrast, onSolid, surface, background) {
|
|
459
|
+
const indicator = steps[8];
|
|
460
|
+
return [
|
|
461
|
+
...steps.map((c, i) => `--spark-${i + 1}: ${c};`),
|
|
462
|
+
...alpha.map((c, i) => `--spark-a${i + 1}: ${c};`),
|
|
463
|
+
`--spark-contrast: ${contrast};`,
|
|
464
|
+
`--spark-on-solid: ${onSolid};`,
|
|
465
|
+
`--spark-surface: ${surface};`,
|
|
466
|
+
`--spark-background: ${background};`,
|
|
467
|
+
`--spark-indicator: ${indicator};`,
|
|
468
|
+
`--spark-track: ${indicator};`
|
|
469
|
+
];
|
|
470
|
+
}
|
|
471
|
+
//#endregion
|
|
472
|
+
//#region src/components/theme.tsx
|
|
473
|
+
const ThemeContext = react.createContext({});
|
|
474
|
+
/** Merged theme values from enclosing `<Theme>` providers. */
|
|
475
|
+
function useTheme() {
|
|
476
|
+
return react.useContext(ThemeContext);
|
|
477
|
+
}
|
|
478
|
+
/** Optional sugar: writes the theming `data-*` attrs + accent `--spark-*` vars onto a wrapper. */
|
|
479
|
+
const Theme = react.forwardRef(function Theme({ accentColor, neutralColor, radius, scaling, spacing, styleVariant, highContrast, labelPosition, inputStyle, inputColor, cardVariant, cardColor, appearance, render, className, style, children, ...rest }, ref) {
|
|
480
|
+
const parent = useTheme();
|
|
481
|
+
const value = react.useMemo(() => ({
|
|
482
|
+
accentColor: accentColor ?? parent.accentColor,
|
|
483
|
+
neutralColor: neutralColor ?? parent.neutralColor,
|
|
484
|
+
radius: radius ?? parent.radius,
|
|
485
|
+
scaling: scaling ?? parent.scaling,
|
|
486
|
+
spacing: spacing ?? parent.spacing,
|
|
487
|
+
styleVariant: styleVariant ?? parent.styleVariant,
|
|
488
|
+
highContrast: highContrast ?? parent.highContrast,
|
|
489
|
+
labelPosition: labelPosition ?? parent.labelPosition,
|
|
490
|
+
inputStyle: inputStyle ?? parent.inputStyle,
|
|
491
|
+
inputColor: inputColor ?? parent.inputColor,
|
|
492
|
+
cardVariant: cardVariant ?? parent.cardVariant,
|
|
493
|
+
cardColor: cardColor ?? parent.cardColor,
|
|
494
|
+
appearance: appearance ?? parent.appearance
|
|
495
|
+
}), [
|
|
496
|
+
accentColor,
|
|
497
|
+
neutralColor,
|
|
498
|
+
radius,
|
|
499
|
+
scaling,
|
|
500
|
+
spacing,
|
|
501
|
+
styleVariant,
|
|
502
|
+
highContrast,
|
|
503
|
+
labelPosition,
|
|
504
|
+
inputStyle,
|
|
505
|
+
inputColor,
|
|
506
|
+
cardVariant,
|
|
507
|
+
cardColor,
|
|
508
|
+
appearance,
|
|
509
|
+
parent
|
|
510
|
+
]);
|
|
511
|
+
const scopeId = react.useId();
|
|
512
|
+
const accent = react.useMemo(() => {
|
|
513
|
+
const empty = {
|
|
514
|
+
inlineVars: {},
|
|
515
|
+
css: "",
|
|
516
|
+
scoped: false
|
|
517
|
+
};
|
|
518
|
+
if (!accentColor) return empty;
|
|
519
|
+
const toVars = (decls) => Object.fromEntries(decls.filter((decl) => decl.includes(":")).map((decl) => {
|
|
520
|
+
const i = decl.indexOf(":");
|
|
521
|
+
return [decl.slice(0, i).trim(), decl.slice(i + 1).replace(/;$/, "").trim()];
|
|
522
|
+
}));
|
|
523
|
+
try {
|
|
524
|
+
const hex = CURATED_ACCENTS[accentColor] ?? accentColor;
|
|
525
|
+
if (value.appearance) return {
|
|
526
|
+
inlineVars: toVars(accentSparkVars(generateAccentScale(hex, value.appearance))),
|
|
527
|
+
css: "",
|
|
528
|
+
scoped: false
|
|
529
|
+
};
|
|
530
|
+
const light = accentSparkVars(generateAccentScale(hex, "light"));
|
|
531
|
+
const dark = accentSparkVars(generateAccentScale(hex, "dark"));
|
|
532
|
+
const sel = `[data-spark-scope="${scopeId}"]`;
|
|
533
|
+
return {
|
|
534
|
+
inlineVars: {},
|
|
535
|
+
css: `${sel}{${light.join("")}}:is(.dark,.dark-theme) ${sel}{${dark.join("")}}`,
|
|
536
|
+
scoped: true
|
|
537
|
+
};
|
|
538
|
+
} catch (error) {
|
|
539
|
+
console.warn(`[Theme] Ignoring invalid accentColor "${accentColor}".`, error);
|
|
540
|
+
return empty;
|
|
541
|
+
}
|
|
542
|
+
}, [
|
|
543
|
+
accentColor,
|
|
544
|
+
value.appearance,
|
|
545
|
+
scopeId
|
|
546
|
+
]);
|
|
547
|
+
const resolvedNeutralColor = neutralColor === "auto" ? getMatchingNeutral(value.accentColor ?? "#005EB4") : neutralColor;
|
|
548
|
+
const element = (0, _base_ui_react_use_render.useRender)({
|
|
549
|
+
defaultTagName: "div",
|
|
550
|
+
render,
|
|
551
|
+
ref,
|
|
552
|
+
props: (0, _base_ui_react_merge_props.mergeProps)({
|
|
553
|
+
className: (0, cnfast.cn)("spark-theme", appearance, className),
|
|
554
|
+
"data-neutral-color": resolvedNeutralColor,
|
|
555
|
+
"data-radius": radius,
|
|
556
|
+
"data-scaling": scaling,
|
|
557
|
+
"data-spacing": spacing,
|
|
558
|
+
"data-style": styleVariant,
|
|
559
|
+
"data-high-contrast": highContrast ? "" : void 0,
|
|
560
|
+
"data-label-position": labelPosition,
|
|
561
|
+
"data-input-style": inputStyle,
|
|
562
|
+
"data-input-color": inputColor,
|
|
563
|
+
"data-card-variant": cardVariant,
|
|
564
|
+
"data-card-color": cardColor === "accent" ? "accent" : void 0,
|
|
565
|
+
"data-spark-scope": accent.scoped ? scopeId : void 0,
|
|
566
|
+
style: {
|
|
567
|
+
...accent.inlineVars,
|
|
568
|
+
...style
|
|
569
|
+
},
|
|
570
|
+
children
|
|
571
|
+
}, rest)
|
|
572
|
+
});
|
|
573
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ThemeContext.Provider, {
|
|
574
|
+
value,
|
|
575
|
+
children: [accent.css ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("style", { children: accent.css }) : null, element]
|
|
576
|
+
});
|
|
577
|
+
});
|
|
578
|
+
//#endregion
|
|
579
|
+
Object.defineProperty(exports, "Theme", {
|
|
580
|
+
enumerable: true,
|
|
581
|
+
get: function() {
|
|
582
|
+
return Theme;
|
|
583
|
+
}
|
|
584
|
+
});
|
|
585
|
+
Object.defineProperty(exports, "useTheme", {
|
|
586
|
+
enumerable: true,
|
|
587
|
+
get: function() {
|
|
588
|
+
return useTheme;
|
|
589
|
+
}
|
|
590
|
+
});
|
|
591
|
+
|
|
592
|
+
//# sourceMappingURL=theme-C9_OSe0S.cjs.map
|