@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,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/progress.d.ts
|
|
6
|
+
interface ProgressProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
/** Current value */
|
|
8
|
+
value: number;
|
|
9
|
+
/** Maximum value. Default: 100 */
|
|
10
|
+
max?: number;
|
|
11
|
+
/** Height variant */
|
|
12
|
+
size?: 'sm' | 'default' | 'lg';
|
|
13
|
+
}
|
|
14
|
+
declare const Progress: React$1.ForwardRefExoticComponent<ProgressProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Progress, ProgressProps };
|
|
17
|
+
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../utils/cn.js";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/progress.tsx
|
|
6
|
+
const sizeClasses = {
|
|
7
|
+
sm: "h-1",
|
|
8
|
+
default: "h-2",
|
|
9
|
+
lg: "h-3"
|
|
10
|
+
};
|
|
11
|
+
const Progress = React$1.forwardRef(({ className, value, max = 100, size = "default", ...props }, ref) => {
|
|
12
|
+
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
13
|
+
return /* @__PURE__ */ jsx("div", {
|
|
14
|
+
"aria-valuemax": max,
|
|
15
|
+
"aria-valuemin": 0,
|
|
16
|
+
"aria-valuenow": value,
|
|
17
|
+
className: cn("w-full overflow-hidden rounded-full bg-slate-a4", sizeClasses[size], className),
|
|
18
|
+
ref,
|
|
19
|
+
role: "progressbar",
|
|
20
|
+
...props,
|
|
21
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
22
|
+
className: "h-full rounded-full bg-spark-9 transition-all duration-300",
|
|
23
|
+
style: { width: `${percentage}%` }
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
Progress.displayName = "Progress";
|
|
28
|
+
//#endregion
|
|
29
|
+
export { Progress };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.js","names":["React"],"sources":["../../src/components/progress.tsx"],"sourcesContent":["import * as React from 'react'\nimport { cn } from '../utils/cn'\n\nexport interface ProgressProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Current value */\n value: number\n /** Maximum value. Default: 100 */\n max?: number\n /** Height variant */\n size?: 'sm' | 'default' | 'lg'\n}\n\nconst sizeClasses = {\n sm: 'h-1',\n default: 'h-2',\n lg: 'h-3',\n} as const\n\nconst Progress = React.forwardRef<HTMLDivElement, ProgressProps>(\n ({ className, value, max = 100, size = 'default', ...props }, ref) => {\n const percentage = Math.min(100, Math.max(0, (value / max) * 100))\n\n return (\n <div\n aria-valuemax={max}\n aria-valuemin={0}\n aria-valuenow={value}\n className={cn(\n 'w-full overflow-hidden rounded-full bg-slate-a4',\n sizeClasses[size],\n className,\n )}\n ref={ref}\n role=\"progressbar\"\n {...props}\n >\n <div\n className=\"h-full rounded-full bg-spark-9 transition-all duration-300\"\n style={{ width: `${percentage}%` }}\n />\n </div>\n )\n },\n)\n\nProgress.displayName = 'Progress'\n\nexport { Progress }\n"],"mappings":";;;;;AAYA,MAAM,cAAc;CAClB,IAAI;CACJ,SAAS;CACT,IAAI;CACL;AAED,MAAM,WAAWA,QAAM,YACpB,EAAE,WAAW,OAAO,MAAM,KAAK,OAAO,WAAW,GAAG,SAAS,QAAQ;CACpE,MAAM,aAAa,KAAK,IAAI,KAAK,KAAK,IAAI,GAAI,QAAQ,MAAO,IAAI,CAAC;AAElE,QACE,oBAAC,OAAD;EACE,iBAAe;EACf,iBAAe;EACf,iBAAe;EACf,WAAW,GACT,mDACA,YAAY,OACZ,UACD;EACI;EACL,MAAK;EACL,GAAI;YAEJ,oBAAC,OAAD;GACE,WAAU;GACV,OAAO,EAAE,OAAO,GAAG,WAAW,IAAI;GAClC,CAAA;EACE,CAAA;EAGX;AAED,SAAS,cAAc"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const require_chunk = require("../chunk-aJGBMT86.cjs");
|
|
4
|
+
let react = require("react");
|
|
5
|
+
react = require_chunk.__toESM(react);
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
let cnfast = require("cnfast");
|
|
8
|
+
//#region src/components/radio-card-group.tsx
|
|
9
|
+
const RadioCardGroupContext = react.createContext(void 0);
|
|
10
|
+
const RadioCardGroup = react.forwardRef(({ value: valueProp, defaultValue, onValueChange, disabled, name, className, children, ...props }, ref) => {
|
|
11
|
+
const generatedName = react.useId();
|
|
12
|
+
const [internalValue, setInternalValue] = react.useState(defaultValue);
|
|
13
|
+
const isControlled = valueProp !== void 0;
|
|
14
|
+
const value = isControlled ? valueProp : internalValue;
|
|
15
|
+
const handleValueChange = react.useCallback((next) => {
|
|
16
|
+
if (!isControlled) setInternalValue(next);
|
|
17
|
+
onValueChange?.(next);
|
|
18
|
+
}, [isControlled, onValueChange]);
|
|
19
|
+
const ctx = react.useMemo(() => ({
|
|
20
|
+
value,
|
|
21
|
+
onValueChange: handleValueChange,
|
|
22
|
+
disabled,
|
|
23
|
+
name: name ?? generatedName
|
|
24
|
+
}), [
|
|
25
|
+
value,
|
|
26
|
+
handleValueChange,
|
|
27
|
+
disabled,
|
|
28
|
+
name,
|
|
29
|
+
generatedName
|
|
30
|
+
]);
|
|
31
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RadioCardGroupContext.Provider, {
|
|
32
|
+
value: ctx,
|
|
33
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
34
|
+
ref,
|
|
35
|
+
role: "radiogroup",
|
|
36
|
+
className: (0, cnfast.cn)("flex flex-col gap-2", className),
|
|
37
|
+
...props,
|
|
38
|
+
children
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
RadioCardGroup.displayName = "RadioCardGroup";
|
|
43
|
+
const RadioCardGroupItem = react.forwardRef(({ value, className, children, disabled, onClick, ...props }, ref) => {
|
|
44
|
+
const ctx = react.useContext(RadioCardGroupContext);
|
|
45
|
+
if (!ctx) throw new Error("RadioCardGroupItem must be used within a RadioCardGroup");
|
|
46
|
+
const checked = ctx.value === value;
|
|
47
|
+
const isDisabled = disabled ?? ctx.disabled;
|
|
48
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
49
|
+
ref,
|
|
50
|
+
type: "button",
|
|
51
|
+
role: "radio",
|
|
52
|
+
"aria-checked": checked,
|
|
53
|
+
"data-state": checked ? "checked" : "unchecked",
|
|
54
|
+
disabled: isDisabled,
|
|
55
|
+
onClick: (event) => {
|
|
56
|
+
onClick?.(event);
|
|
57
|
+
if (!event.defaultPrevented && !isDisabled) ctx.onValueChange(value);
|
|
58
|
+
},
|
|
59
|
+
className: (0, cnfast.cn)("h-12 w-full rounded-xl px-4 text-base font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50", checked ? "border border-accent bg-base-accent-soft text-accent" : "border border-transparent bg-base-gray-soft text-gray hover:bg-slate-a3", className),
|
|
60
|
+
...props,
|
|
61
|
+
children
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
RadioCardGroupItem.displayName = "RadioCardGroupItem";
|
|
65
|
+
//#endregion
|
|
66
|
+
exports.RadioCardGroup = RadioCardGroup;
|
|
67
|
+
exports.RadioCardGroupItem = RadioCardGroupItem;
|
|
68
|
+
|
|
69
|
+
//# sourceMappingURL=radio-card-group.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-card-group.cjs","names":["React"],"sources":["../../src/components/radio-card-group.tsx"],"sourcesContent":["import * as React from 'react'\nimport { cn } from '../utils/cn'\n\ninterface RadioCardGroupContextValue {\n value: string | undefined\n onValueChange: (value: string) => void\n disabled?: boolean\n name: string\n}\n\nconst RadioCardGroupContext = React.createContext<\n RadioCardGroupContextValue | undefined\n>(undefined)\n\ninterface RadioCardGroupProps extends React.HTMLAttributes<HTMLDivElement> {\n value?: string\n defaultValue?: string\n onValueChange?: (value: string) => void\n disabled?: boolean\n /** Optional name used for ARIA grouping. Defaults to a generated id. */\n name?: string\n}\n\nconst RadioCardGroup = React.forwardRef<HTMLDivElement, RadioCardGroupProps>(\n (\n {\n value: valueProp,\n defaultValue,\n onValueChange,\n disabled,\n name,\n className,\n children,\n ...props\n },\n ref,\n ) => {\n const generatedName = React.useId()\n const [internalValue, setInternalValue] = React.useState<\n string | undefined\n >(defaultValue)\n const isControlled = valueProp !== undefined\n const value = isControlled ? valueProp : internalValue\n\n const handleValueChange = React.useCallback(\n (next: string) => {\n if (!isControlled) setInternalValue(next)\n onValueChange?.(next)\n },\n [isControlled, onValueChange],\n )\n\n const ctx = React.useMemo<RadioCardGroupContextValue>(\n () => ({\n value,\n onValueChange: handleValueChange,\n disabled,\n name: name ?? generatedName,\n }),\n [value, handleValueChange, disabled, name, generatedName],\n )\n\n return (\n <RadioCardGroupContext.Provider value={ctx}>\n <div\n ref={ref}\n role=\"radiogroup\"\n className={cn('flex flex-col gap-2', className)}\n {...props}\n >\n {children}\n </div>\n </RadioCardGroupContext.Provider>\n )\n },\n)\n\nRadioCardGroup.displayName = 'RadioCardGroup'\n\ninterface RadioCardGroupItemProps extends Omit<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n 'value'\n> {\n value: string\n}\n\nconst RadioCardGroupItem = React.forwardRef<\n HTMLButtonElement,\n RadioCardGroupItemProps\n>(({ value, className, children, disabled, onClick, ...props }, ref) => {\n const ctx = React.useContext(RadioCardGroupContext)\n if (!ctx) {\n throw new Error('RadioCardGroupItem must be used within a RadioCardGroup')\n }\n\n const checked = ctx.value === value\n const isDisabled = disabled ?? ctx.disabled\n\n return (\n <button\n ref={ref}\n type=\"button\"\n role=\"radio\"\n aria-checked={checked}\n data-state={checked ? 'checked' : 'unchecked'}\n disabled={isDisabled}\n onClick={(event) => {\n onClick?.(event)\n if (!event.defaultPrevented && !isDisabled) {\n ctx.onValueChange(value)\n }\n }}\n className={cn(\n 'h-12 w-full rounded-xl px-4 text-base font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50',\n checked\n ? 'border border-accent bg-base-accent-soft text-accent'\n : 'border border-transparent bg-base-gray-soft text-gray hover:bg-slate-a3',\n className,\n )}\n {...props}\n >\n {children}\n </button>\n )\n})\n\nRadioCardGroupItem.displayName = 'RadioCardGroupItem'\n\nexport { RadioCardGroup, RadioCardGroupItem }\nexport type { RadioCardGroupProps, RadioCardGroupItemProps }\n"],"mappings":";;;;;;;;AAUA,MAAM,wBAAwBA,MAAM,cAElC,KAAA,EAAU;AAWZ,MAAM,iBAAiBA,MAAM,YAEzB,EACE,OAAO,WACP,cACA,eACA,UACA,MACA,WACA,UACA,GAAG,SAEL,QACG;CACH,MAAM,gBAAgBA,MAAM,OAAO;CACnC,MAAM,CAAC,eAAe,oBAAoBA,MAAM,SAE9C,aAAa;CACf,MAAM,eAAe,cAAc,KAAA;CACnC,MAAM,QAAQ,eAAe,YAAY;CAEzC,MAAM,oBAAoBA,MAAM,aAC7B,SAAiB;AAChB,MAAI,CAAC,aAAc,kBAAiB,KAAK;AACzC,kBAAgB,KAAK;IAEvB,CAAC,cAAc,cAAc,CAC9B;CAED,MAAM,MAAMA,MAAM,eACT;EACL;EACA,eAAe;EACf;EACA,MAAM,QAAQ;EACf,GACD;EAAC;EAAO;EAAmB;EAAU;EAAM;EAAc,CAC1D;AAED,QACE,iBAAA,GAAA,kBAAA,KAAC,sBAAsB,UAAvB;EAAgC,OAAO;YACrC,iBAAA,GAAA,kBAAA,KAAC,OAAD;GACO;GACL,MAAK;GACL,YAAA,GAAA,OAAA,IAAc,uBAAuB,UAAU;GAC/C,GAAI;GAEH;GACG,CAAA;EACyB,CAAA;EAGtC;AAED,eAAe,cAAc;AAS7B,MAAM,qBAAqBA,MAAM,YAG9B,EAAE,OAAO,WAAW,UAAU,UAAU,SAAS,GAAG,SAAS,QAAQ;CACtE,MAAM,MAAMA,MAAM,WAAW,sBAAsB;AACnD,KAAI,CAAC,IACH,OAAM,IAAI,MAAM,0DAA0D;CAG5E,MAAM,UAAU,IAAI,UAAU;CAC9B,MAAM,aAAa,YAAY,IAAI;AAEnC,QACE,iBAAA,GAAA,kBAAA,KAAC,UAAD;EACO;EACL,MAAK;EACL,MAAK;EACL,gBAAc;EACd,cAAY,UAAU,YAAY;EAClC,UAAU;EACV,UAAU,UAAU;AAClB,aAAU,MAAM;AAChB,OAAI,CAAC,MAAM,oBAAoB,CAAC,WAC9B,KAAI,cAAc,MAAM;;EAG5B,YAAA,GAAA,OAAA,IACE,qMACA,UACI,yDACA,2EACJ,UACD;EACD,GAAI;EAEH;EACM,CAAA;EAEX;AAEF,mBAAmB,cAAc"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/radio-card-group.d.ts
|
|
6
|
+
interface RadioCardGroupProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
value?: string;
|
|
8
|
+
defaultValue?: string;
|
|
9
|
+
onValueChange?: (value: string) => void;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** Optional name used for ARIA grouping. Defaults to a generated id. */
|
|
12
|
+
name?: string;
|
|
13
|
+
}
|
|
14
|
+
declare const RadioCardGroup: React$1.ForwardRefExoticComponent<RadioCardGroupProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
interface RadioCardGroupItemProps extends Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, 'value'> {
|
|
16
|
+
value: string;
|
|
17
|
+
}
|
|
18
|
+
declare const RadioCardGroupItem: React$1.ForwardRefExoticComponent<RadioCardGroupItemProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { RadioCardGroup, RadioCardGroupItem, type RadioCardGroupItemProps, type RadioCardGroupProps };
|
|
21
|
+
//# sourceMappingURL=radio-card-group.d.cts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/radio-card-group.d.ts
|
|
6
|
+
interface RadioCardGroupProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
value?: string;
|
|
8
|
+
defaultValue?: string;
|
|
9
|
+
onValueChange?: (value: string) => void;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** Optional name used for ARIA grouping. Defaults to a generated id. */
|
|
12
|
+
name?: string;
|
|
13
|
+
}
|
|
14
|
+
declare const RadioCardGroup: React$1.ForwardRefExoticComponent<RadioCardGroupProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
interface RadioCardGroupItemProps extends Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, 'value'> {
|
|
16
|
+
value: string;
|
|
17
|
+
}
|
|
18
|
+
declare const RadioCardGroupItem: React$1.ForwardRefExoticComponent<RadioCardGroupItemProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { RadioCardGroup, RadioCardGroupItem, type RadioCardGroupItemProps, type RadioCardGroupProps };
|
|
21
|
+
//# sourceMappingURL=radio-card-group.d.ts.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../utils/cn.js";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/radio-card-group.tsx
|
|
6
|
+
const RadioCardGroupContext = React$1.createContext(void 0);
|
|
7
|
+
const RadioCardGroup = React$1.forwardRef(({ value: valueProp, defaultValue, onValueChange, disabled, name, className, children, ...props }, ref) => {
|
|
8
|
+
const generatedName = React$1.useId();
|
|
9
|
+
const [internalValue, setInternalValue] = React$1.useState(defaultValue);
|
|
10
|
+
const isControlled = valueProp !== void 0;
|
|
11
|
+
const value = isControlled ? valueProp : internalValue;
|
|
12
|
+
const handleValueChange = React$1.useCallback((next) => {
|
|
13
|
+
if (!isControlled) setInternalValue(next);
|
|
14
|
+
onValueChange?.(next);
|
|
15
|
+
}, [isControlled, onValueChange]);
|
|
16
|
+
const ctx = React$1.useMemo(() => ({
|
|
17
|
+
value,
|
|
18
|
+
onValueChange: handleValueChange,
|
|
19
|
+
disabled,
|
|
20
|
+
name: name ?? generatedName
|
|
21
|
+
}), [
|
|
22
|
+
value,
|
|
23
|
+
handleValueChange,
|
|
24
|
+
disabled,
|
|
25
|
+
name,
|
|
26
|
+
generatedName
|
|
27
|
+
]);
|
|
28
|
+
return /* @__PURE__ */ jsx(RadioCardGroupContext.Provider, {
|
|
29
|
+
value: ctx,
|
|
30
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
31
|
+
ref,
|
|
32
|
+
role: "radiogroup",
|
|
33
|
+
className: cn("flex flex-col gap-2", className),
|
|
34
|
+
...props,
|
|
35
|
+
children
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
RadioCardGroup.displayName = "RadioCardGroup";
|
|
40
|
+
const RadioCardGroupItem = React$1.forwardRef(({ value, className, children, disabled, onClick, ...props }, ref) => {
|
|
41
|
+
const ctx = React$1.useContext(RadioCardGroupContext);
|
|
42
|
+
if (!ctx) throw new Error("RadioCardGroupItem must be used within a RadioCardGroup");
|
|
43
|
+
const checked = ctx.value === value;
|
|
44
|
+
const isDisabled = disabled ?? ctx.disabled;
|
|
45
|
+
return /* @__PURE__ */ jsx("button", {
|
|
46
|
+
ref,
|
|
47
|
+
type: "button",
|
|
48
|
+
role: "radio",
|
|
49
|
+
"aria-checked": checked,
|
|
50
|
+
"data-state": checked ? "checked" : "unchecked",
|
|
51
|
+
disabled: isDisabled,
|
|
52
|
+
onClick: (event) => {
|
|
53
|
+
onClick?.(event);
|
|
54
|
+
if (!event.defaultPrevented && !isDisabled) ctx.onValueChange(value);
|
|
55
|
+
},
|
|
56
|
+
className: cn("h-12 w-full rounded-xl px-4 text-base font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50", checked ? "border border-accent bg-base-accent-soft text-accent" : "border border-transparent bg-base-gray-soft text-gray hover:bg-slate-a3", className),
|
|
57
|
+
...props,
|
|
58
|
+
children
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
RadioCardGroupItem.displayName = "RadioCardGroupItem";
|
|
62
|
+
//#endregion
|
|
63
|
+
export { RadioCardGroup, RadioCardGroupItem };
|
|
64
|
+
|
|
65
|
+
//# sourceMappingURL=radio-card-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-card-group.js","names":["React"],"sources":["../../src/components/radio-card-group.tsx"],"sourcesContent":["import * as React from 'react'\nimport { cn } from '../utils/cn'\n\ninterface RadioCardGroupContextValue {\n value: string | undefined\n onValueChange: (value: string) => void\n disabled?: boolean\n name: string\n}\n\nconst RadioCardGroupContext = React.createContext<\n RadioCardGroupContextValue | undefined\n>(undefined)\n\ninterface RadioCardGroupProps extends React.HTMLAttributes<HTMLDivElement> {\n value?: string\n defaultValue?: string\n onValueChange?: (value: string) => void\n disabled?: boolean\n /** Optional name used for ARIA grouping. Defaults to a generated id. */\n name?: string\n}\n\nconst RadioCardGroup = React.forwardRef<HTMLDivElement, RadioCardGroupProps>(\n (\n {\n value: valueProp,\n defaultValue,\n onValueChange,\n disabled,\n name,\n className,\n children,\n ...props\n },\n ref,\n ) => {\n const generatedName = React.useId()\n const [internalValue, setInternalValue] = React.useState<\n string | undefined\n >(defaultValue)\n const isControlled = valueProp !== undefined\n const value = isControlled ? valueProp : internalValue\n\n const handleValueChange = React.useCallback(\n (next: string) => {\n if (!isControlled) setInternalValue(next)\n onValueChange?.(next)\n },\n [isControlled, onValueChange],\n )\n\n const ctx = React.useMemo<RadioCardGroupContextValue>(\n () => ({\n value,\n onValueChange: handleValueChange,\n disabled,\n name: name ?? generatedName,\n }),\n [value, handleValueChange, disabled, name, generatedName],\n )\n\n return (\n <RadioCardGroupContext.Provider value={ctx}>\n <div\n ref={ref}\n role=\"radiogroup\"\n className={cn('flex flex-col gap-2', className)}\n {...props}\n >\n {children}\n </div>\n </RadioCardGroupContext.Provider>\n )\n },\n)\n\nRadioCardGroup.displayName = 'RadioCardGroup'\n\ninterface RadioCardGroupItemProps extends Omit<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n 'value'\n> {\n value: string\n}\n\nconst RadioCardGroupItem = React.forwardRef<\n HTMLButtonElement,\n RadioCardGroupItemProps\n>(({ value, className, children, disabled, onClick, ...props }, ref) => {\n const ctx = React.useContext(RadioCardGroupContext)\n if (!ctx) {\n throw new Error('RadioCardGroupItem must be used within a RadioCardGroup')\n }\n\n const checked = ctx.value === value\n const isDisabled = disabled ?? ctx.disabled\n\n return (\n <button\n ref={ref}\n type=\"button\"\n role=\"radio\"\n aria-checked={checked}\n data-state={checked ? 'checked' : 'unchecked'}\n disabled={isDisabled}\n onClick={(event) => {\n onClick?.(event)\n if (!event.defaultPrevented && !isDisabled) {\n ctx.onValueChange(value)\n }\n }}\n className={cn(\n 'h-12 w-full rounded-xl px-4 text-base font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50',\n checked\n ? 'border border-accent bg-base-accent-soft text-accent'\n : 'border border-transparent bg-base-gray-soft text-gray hover:bg-slate-a3',\n className,\n )}\n {...props}\n >\n {children}\n </button>\n )\n})\n\nRadioCardGroupItem.displayName = 'RadioCardGroupItem'\n\nexport { RadioCardGroup, RadioCardGroupItem }\nexport type { RadioCardGroupProps, RadioCardGroupItemProps }\n"],"mappings":";;;;;AAUA,MAAM,wBAAwBA,QAAM,cAElC,KAAA,EAAU;AAWZ,MAAM,iBAAiBA,QAAM,YAEzB,EACE,OAAO,WACP,cACA,eACA,UACA,MACA,WACA,UACA,GAAG,SAEL,QACG;CACH,MAAM,gBAAgBA,QAAM,OAAO;CACnC,MAAM,CAAC,eAAe,oBAAoBA,QAAM,SAE9C,aAAa;CACf,MAAM,eAAe,cAAc,KAAA;CACnC,MAAM,QAAQ,eAAe,YAAY;CAEzC,MAAM,oBAAoBA,QAAM,aAC7B,SAAiB;AAChB,MAAI,CAAC,aAAc,kBAAiB,KAAK;AACzC,kBAAgB,KAAK;IAEvB,CAAC,cAAc,cAAc,CAC9B;CAED,MAAM,MAAMA,QAAM,eACT;EACL;EACA,eAAe;EACf;EACA,MAAM,QAAQ;EACf,GACD;EAAC;EAAO;EAAmB;EAAU;EAAM;EAAc,CAC1D;AAED,QACE,oBAAC,sBAAsB,UAAvB;EAAgC,OAAO;YACrC,oBAAC,OAAD;GACO;GACL,MAAK;GACL,WAAW,GAAG,uBAAuB,UAAU;GAC/C,GAAI;GAEH;GACG,CAAA;EACyB,CAAA;EAGtC;AAED,eAAe,cAAc;AAS7B,MAAM,qBAAqBA,QAAM,YAG9B,EAAE,OAAO,WAAW,UAAU,UAAU,SAAS,GAAG,SAAS,QAAQ;CACtE,MAAM,MAAMA,QAAM,WAAW,sBAAsB;AACnD,KAAI,CAAC,IACH,OAAM,IAAI,MAAM,0DAA0D;CAG5E,MAAM,UAAU,IAAI,UAAU;CAC9B,MAAM,aAAa,YAAY,IAAI;AAEnC,QACE,oBAAC,UAAD;EACO;EACL,MAAK;EACL,MAAK;EACL,gBAAc;EACd,cAAY,UAAU,YAAY;EAClC,UAAU;EACV,UAAU,UAAU;AAClB,aAAU,MAAM;AAChB,OAAI,CAAC,MAAM,oBAAoB,CAAC,WAC9B,KAAI,cAAc,MAAM;;EAG5B,WAAW,GACT,qMACA,UACI,yDACA,2EACJ,UACD;EACD,GAAI;EAEH;EACM,CAAA;EAEX;AAEF,mBAAmB,cAAc"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const require_chunk = require("../chunk-aJGBMT86.cjs");
|
|
4
|
+
let react = require("react");
|
|
5
|
+
react = require_chunk.__toESM(react);
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
let _base_ui_react_radio = require("@base-ui/react/radio");
|
|
8
|
+
let _base_ui_react_radio_group = require("@base-ui/react/radio-group");
|
|
9
|
+
let cnfast = require("cnfast");
|
|
10
|
+
//#region src/components/radio.tsx
|
|
11
|
+
function RadioGroup({ className, ...props }) {
|
|
12
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_radio_group.RadioGroup, {
|
|
13
|
+
"data-slot": "radio-group",
|
|
14
|
+
className: (0, cnfast.cn)("grid gap-3", className),
|
|
15
|
+
...props
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function Radio({ className, ...props }) {
|
|
19
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_radio.Radio.Root, {
|
|
20
|
+
"data-slot": "radio",
|
|
21
|
+
className: (0, cnfast.cn)("peer relative inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-full border-2 transition-colors", "before:absolute before:top-1/2 before:left-1/2 before:size-10 before:-translate-x-1/2 before:-translate-y-1/2 before:content-['']", "focus-visible:ring focus-visible:ring-offset-2 focus-visible:outline-hidden", "data-disabled:cursor-not-allowed data-disabled:opacity-50", "border-[color:var(--spark-style-idle-border,var(--spark-a7))] bg-base-accent-soft data-unchecked:border-[length:var(--spark-style-border-width,2px)]", "data-checked:border-[color:var(--spark-radio-ring,var(--spark-9))]", className),
|
|
22
|
+
...props,
|
|
23
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_radio.Radio.Indicator, {
|
|
24
|
+
"data-slot": "radio-indicator",
|
|
25
|
+
className: "flex items-center justify-center",
|
|
26
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "size-4 rounded-full bg-[var(--spark-radio-dot,var(--spark-9))] motion-safe:animate-dot-pop" })
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
exports.Radio = Radio;
|
|
32
|
+
exports.RadioGroup = RadioGroup;
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=radio.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio.cjs","names":["RadioGroupPrimitive","RadioPrimitive"],"sources":["../../src/components/radio.tsx"],"sourcesContent":["import { Radio as RadioPrimitive } from '@base-ui/react/radio'\nimport { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group'\nimport * as React from 'react'\nimport { cn } from '../utils/cn'\n\ntype RadioGroupProps = React.ComponentProps<typeof RadioGroupPrimitive>\n\nfunction RadioGroup({ className, ...props }: RadioGroupProps) {\n return (\n <RadioGroupPrimitive\n data-slot=\"radio-group\"\n className={cn('grid gap-3', className)}\n {...props}\n />\n )\n}\n\ntype RadioProps = React.ComponentProps<typeof RadioPrimitive.Root>\n\nfunction Radio({ className, ...props }: RadioProps) {\n return (\n <RadioPrimitive.Root\n data-slot=\"radio\"\n className={cn(\n // 24px visible circle with a 40px hit area (::before overlay, WCAG 2.5.5).\n // Always fully round — a radio is never squared, so it ignores the radius knob.\n 'peer relative inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-full border-2 transition-colors',\n \"before:absolute before:top-1/2 before:left-1/2 before:size-10 before:-translate-x-1/2 before:-translate-y-1/2 before:content-['']\",\n 'focus-visible:ring focus-visible:ring-offset-2 focus-visible:outline-hidden',\n // Base UI renders a <span>, so disabled state comes via data-disabled\n 'data-disabled:cursor-not-allowed data-disabled:opacity-50',\n // Unchecked: subtle fill + a style-aware idle border (soft/HC-soft set it to\n // transparent; surface makes it a neutral ring). The a7 fallback is the default.\n // Width follows the style knob for the resting edge — surface thins to 1px (its\n // recessed-edge pattern, matching the checkbox/switch); others stay 2px. The\n // checked ring below keeps the base 2px.\n 'border-[color:var(--spark-style-idle-border,var(--spark-a7))] bg-base-accent-soft data-unchecked:border-[length:var(--spark-style-border-width,2px)]',\n // Checked: a visible accent ring. Unlike the checkbox (which fills its box and\n // hides its border), the radio keeps a ring + dot — so it reads a radio-specific\n // --spark-radio-ring (accent by default; soft drops it; HC deepens it).\n 'data-checked:border-[color:var(--spark-radio-ring,var(--spark-9))]',\n className,\n )}\n {...props}\n >\n <RadioPrimitive.Indicator\n data-slot=\"radio-indicator\"\n className=\"flex items-center justify-center\"\n >\n {/* the dot sits on the (unfilled) box, so it's a background-legible accent\n (--spark-radio-dot, 9→12 in HC) — NOT --spark-on-solid (white) or\n --spark-style-fg (step-1 in HC-solid), which would vanish here. */}\n <span className=\"size-4 rounded-full bg-[var(--spark-radio-dot,var(--spark-9))] motion-safe:animate-dot-pop\" />\n </RadioPrimitive.Indicator>\n </RadioPrimitive.Root>\n )\n}\n\nexport { Radio, RadioGroup }\nexport type { RadioGroupProps, RadioProps }\n"],"mappings":";;;;;;;;;;AAOA,SAAS,WAAW,EAAE,WAAW,GAAG,SAA0B;AAC5D,QACE,iBAAA,GAAA,kBAAA,KAACA,2BAAAA,YAAD;EACE,aAAU;EACV,YAAA,GAAA,OAAA,IAAc,cAAc,UAAU;EACtC,GAAI;EACJ,CAAA;;AAMN,SAAS,MAAM,EAAE,WAAW,GAAG,SAAqB;AAClD,QACE,iBAAA,GAAA,kBAAA,KAACC,qBAAAA,MAAe,MAAhB;EACE,aAAU;EACV,YAAA,GAAA,OAAA,IAGE,gIACA,qIACA,+EAEA,6DAMA,wJAIA,sEACA,UACD;EACD,GAAI;YAEJ,iBAAA,GAAA,kBAAA,KAACA,qBAAAA,MAAe,WAAhB;GACE,aAAU;GACV,WAAU;aAKV,iBAAA,GAAA,kBAAA,KAAC,QAAD,EAAM,WAAU,8FAA+F,CAAA;GACtF,CAAA;EACP,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
import * as React$1 from "react";
|
|
5
|
+
import { Radio as Radio$1 } from "@base-ui/react/radio";
|
|
6
|
+
import { RadioGroup as RadioGroup$1 } from "@base-ui/react/radio-group";
|
|
7
|
+
|
|
8
|
+
//#region src/components/radio.d.ts
|
|
9
|
+
type RadioGroupProps = React$1.ComponentProps<typeof RadioGroup$1>;
|
|
10
|
+
declare function RadioGroup({
|
|
11
|
+
className,
|
|
12
|
+
...props
|
|
13
|
+
}: RadioGroupProps): _$react_jsx_runtime0.JSX.Element;
|
|
14
|
+
type RadioProps = React$1.ComponentProps<typeof Radio$1.Root>;
|
|
15
|
+
declare function Radio({
|
|
16
|
+
className,
|
|
17
|
+
...props
|
|
18
|
+
}: RadioProps): _$react_jsx_runtime0.JSX.Element;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { Radio, RadioGroup, type RadioGroupProps, type RadioProps };
|
|
21
|
+
//# sourceMappingURL=radio.d.cts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
+
import { Radio as Radio$1 } from "@base-ui/react/radio";
|
|
6
|
+
import { RadioGroup as RadioGroup$1 } from "@base-ui/react/radio-group";
|
|
7
|
+
|
|
8
|
+
//#region src/components/radio.d.ts
|
|
9
|
+
type RadioGroupProps = React$1.ComponentProps<typeof RadioGroup$1>;
|
|
10
|
+
declare function RadioGroup({
|
|
11
|
+
className,
|
|
12
|
+
...props
|
|
13
|
+
}: RadioGroupProps): _$react_jsx_runtime0.JSX.Element;
|
|
14
|
+
type RadioProps = React$1.ComponentProps<typeof Radio$1.Root>;
|
|
15
|
+
declare function Radio({
|
|
16
|
+
className,
|
|
17
|
+
...props
|
|
18
|
+
}: RadioProps): _$react_jsx_runtime0.JSX.Element;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { Radio, RadioGroup, type RadioGroupProps, type RadioProps };
|
|
21
|
+
//# sourceMappingURL=radio.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../utils/cn.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { Radio as Radio$1 } from "@base-ui/react/radio";
|
|
6
|
+
import { RadioGroup as RadioGroup$1 } from "@base-ui/react/radio-group";
|
|
7
|
+
//#region src/components/radio.tsx
|
|
8
|
+
function RadioGroup({ className, ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(RadioGroup$1, {
|
|
10
|
+
"data-slot": "radio-group",
|
|
11
|
+
className: cn("grid gap-3", className),
|
|
12
|
+
...props
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function Radio({ className, ...props }) {
|
|
16
|
+
return /* @__PURE__ */ jsx(Radio$1.Root, {
|
|
17
|
+
"data-slot": "radio",
|
|
18
|
+
className: cn("peer relative inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-full border-2 transition-colors", "before:absolute before:top-1/2 before:left-1/2 before:size-10 before:-translate-x-1/2 before:-translate-y-1/2 before:content-['']", "focus-visible:ring focus-visible:ring-offset-2 focus-visible:outline-hidden", "data-disabled:cursor-not-allowed data-disabled:opacity-50", "border-[color:var(--spark-style-idle-border,var(--spark-a7))] bg-base-accent-soft data-unchecked:border-[length:var(--spark-style-border-width,2px)]", "data-checked:border-[color:var(--spark-radio-ring,var(--spark-9))]", className),
|
|
19
|
+
...props,
|
|
20
|
+
children: /* @__PURE__ */ jsx(Radio$1.Indicator, {
|
|
21
|
+
"data-slot": "radio-indicator",
|
|
22
|
+
className: "flex items-center justify-center",
|
|
23
|
+
children: /* @__PURE__ */ jsx("span", { className: "size-4 rounded-full bg-[var(--spark-radio-dot,var(--spark-9))] motion-safe:animate-dot-pop" })
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { Radio, RadioGroup };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=radio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio.js","names":["RadioGroupPrimitive","RadioPrimitive"],"sources":["../../src/components/radio.tsx"],"sourcesContent":["import { Radio as RadioPrimitive } from '@base-ui/react/radio'\nimport { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group'\nimport * as React from 'react'\nimport { cn } from '../utils/cn'\n\ntype RadioGroupProps = React.ComponentProps<typeof RadioGroupPrimitive>\n\nfunction RadioGroup({ className, ...props }: RadioGroupProps) {\n return (\n <RadioGroupPrimitive\n data-slot=\"radio-group\"\n className={cn('grid gap-3', className)}\n {...props}\n />\n )\n}\n\ntype RadioProps = React.ComponentProps<typeof RadioPrimitive.Root>\n\nfunction Radio({ className, ...props }: RadioProps) {\n return (\n <RadioPrimitive.Root\n data-slot=\"radio\"\n className={cn(\n // 24px visible circle with a 40px hit area (::before overlay, WCAG 2.5.5).\n // Always fully round — a radio is never squared, so it ignores the radius knob.\n 'peer relative inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-full border-2 transition-colors',\n \"before:absolute before:top-1/2 before:left-1/2 before:size-10 before:-translate-x-1/2 before:-translate-y-1/2 before:content-['']\",\n 'focus-visible:ring focus-visible:ring-offset-2 focus-visible:outline-hidden',\n // Base UI renders a <span>, so disabled state comes via data-disabled\n 'data-disabled:cursor-not-allowed data-disabled:opacity-50',\n // Unchecked: subtle fill + a style-aware idle border (soft/HC-soft set it to\n // transparent; surface makes it a neutral ring). The a7 fallback is the default.\n // Width follows the style knob for the resting edge — surface thins to 1px (its\n // recessed-edge pattern, matching the checkbox/switch); others stay 2px. The\n // checked ring below keeps the base 2px.\n 'border-[color:var(--spark-style-idle-border,var(--spark-a7))] bg-base-accent-soft data-unchecked:border-[length:var(--spark-style-border-width,2px)]',\n // Checked: a visible accent ring. Unlike the checkbox (which fills its box and\n // hides its border), the radio keeps a ring + dot — so it reads a radio-specific\n // --spark-radio-ring (accent by default; soft drops it; HC deepens it).\n 'data-checked:border-[color:var(--spark-radio-ring,var(--spark-9))]',\n className,\n )}\n {...props}\n >\n <RadioPrimitive.Indicator\n data-slot=\"radio-indicator\"\n className=\"flex items-center justify-center\"\n >\n {/* the dot sits on the (unfilled) box, so it's a background-legible accent\n (--spark-radio-dot, 9→12 in HC) — NOT --spark-on-solid (white) or\n --spark-style-fg (step-1 in HC-solid), which would vanish here. */}\n <span className=\"size-4 rounded-full bg-[var(--spark-radio-dot,var(--spark-9))] motion-safe:animate-dot-pop\" />\n </RadioPrimitive.Indicator>\n </RadioPrimitive.Root>\n )\n}\n\nexport { Radio, RadioGroup }\nexport type { RadioGroupProps, RadioProps }\n"],"mappings":";;;;;;;AAOA,SAAS,WAAW,EAAE,WAAW,GAAG,SAA0B;AAC5D,QACE,oBAACA,cAAD;EACE,aAAU;EACV,WAAW,GAAG,cAAc,UAAU;EACtC,GAAI;EACJ,CAAA;;AAMN,SAAS,MAAM,EAAE,WAAW,GAAG,SAAqB;AAClD,QACE,oBAACC,QAAe,MAAhB;EACE,aAAU;EACV,WAAW,GAGT,gIACA,qIACA,+EAEA,6DAMA,wJAIA,sEACA,UACD;EACD,GAAI;YAEJ,oBAACA,QAAe,WAAhB;GACE,aAAU;GACV,WAAU;aAKV,oBAAC,QAAD,EAAM,WAAU,8FAA+F,CAAA;GACtF,CAAA;EACP,CAAA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const require_chunk = require("../chunk-aJGBMT86.cjs");
|
|
4
|
+
let react = require("react");
|
|
5
|
+
react = require_chunk.__toESM(react);
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
let react_dom = require("react-dom");
|
|
8
|
+
//#region src/components/reparent.tsx
|
|
9
|
+
const supportsMoveBefore = typeof Element !== "undefined" && "moveBefore" in Element.prototype;
|
|
10
|
+
function useReparent() {
|
|
11
|
+
const [host, setHost] = react.useState(null);
|
|
12
|
+
react.useEffect(() => {
|
|
13
|
+
const el = document.createElement("div");
|
|
14
|
+
el.style.display = "contents";
|
|
15
|
+
setHost(el);
|
|
16
|
+
return () => el.remove();
|
|
17
|
+
}, []);
|
|
18
|
+
const park = react.useCallback(() => {
|
|
19
|
+
if (supportsMoveBefore && host?.isConnected) {
|
|
20
|
+
host.style.display = "none";
|
|
21
|
+
document.body.moveBefore(host, null);
|
|
22
|
+
}
|
|
23
|
+
}, [host]);
|
|
24
|
+
return react.useMemo(() => ({
|
|
25
|
+
host,
|
|
26
|
+
park
|
|
27
|
+
}), [host, park]);
|
|
28
|
+
}
|
|
29
|
+
function ReparentContent({ handle, children }) {
|
|
30
|
+
if (!handle.host) return null;
|
|
31
|
+
return (0, react_dom.createPortal)(children, handle.host);
|
|
32
|
+
}
|
|
33
|
+
function ReparentSlot({ handle, ...props }) {
|
|
34
|
+
const ref = react.useRef(null);
|
|
35
|
+
const host = handle.host;
|
|
36
|
+
react.useLayoutEffect(() => {
|
|
37
|
+
const slot = ref.current;
|
|
38
|
+
if (!slot || !host) return;
|
|
39
|
+
host.style.display = "contents";
|
|
40
|
+
if (supportsMoveBefore && host.isConnected) slot.moveBefore(host, null);
|
|
41
|
+
else slot.appendChild(host);
|
|
42
|
+
}, [host]);
|
|
43
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
44
|
+
"data-slot": "reparent-slot",
|
|
45
|
+
ref,
|
|
46
|
+
...props
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
exports.ReparentContent = ReparentContent;
|
|
51
|
+
exports.ReparentSlot = ReparentSlot;
|
|
52
|
+
exports.supportsMoveBefore = supportsMoveBefore;
|
|
53
|
+
exports.useReparent = useReparent;
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=reparent.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reparent.cjs","names":["React"],"sources":["../../src/components/reparent.tsx"],"sourcesContent":["import * as React from 'react'\nimport { createPortal } from 'react-dom'\n\n// moveBefore ships in Chrome/Edge 133+, Firefox 144+; Safari has no state-preserving move\nconst supportsMoveBefore =\n typeof Element !== 'undefined' && 'moveBefore' in Element.prototype\n\ntype MovableElement = Element & {\n moveBefore: (node: Node, child: Node | null) => void\n}\n\ninterface ReparentHandle {\n host: HTMLElement | null\n park: () => void\n}\n\n// host created after mount so server and client hydrate the same (empty) markup\nfunction useReparent(): ReparentHandle {\n const [host, setHost] = React.useState<HTMLElement | null>(null)\n React.useEffect(() => {\n const el = document.createElement('div')\n el.style.display = 'contents'\n setHost(el)\n return () => el.remove()\n }, [])\n const park = React.useCallback(() => {\n if (supportsMoveBefore && host?.isConnected) {\n host.style.display = 'none'\n ;(document.body as unknown as MovableElement).moveBefore(host, null)\n }\n }, [host])\n return React.useMemo(() => ({ host, park }), [host, park])\n}\n\nfunction ReparentContent({\n handle,\n children,\n}: {\n handle: ReparentHandle\n children: React.ReactNode\n}) {\n if (!handle.host) return null\n return createPortal(children, handle.host)\n}\n\ninterface ReparentSlotProps extends React.ComponentProps<'div'> {\n handle: ReparentHandle\n}\n\nfunction ReparentSlot({ handle, ...props }: ReparentSlotProps) {\n const ref = React.useRef<HTMLDivElement>(null)\n const host = handle.host\n React.useLayoutEffect(() => {\n const slot = ref.current\n if (!slot || !host) return\n host.style.display = 'contents'\n if (supportsMoveBefore && host.isConnected) {\n ;(slot as unknown as MovableElement).moveBefore(host, null)\n } else {\n slot.appendChild(host)\n }\n }, [host])\n return <div data-slot=\"reparent-slot\" ref={ref} {...props} />\n}\n\nexport { ReparentContent, ReparentSlot, supportsMoveBefore, useReparent }\nexport type { ReparentHandle, ReparentSlotProps }\n"],"mappings":";;;;;;;;AAIA,MAAM,qBACJ,OAAO,YAAY,eAAe,gBAAgB,QAAQ;AAY5D,SAAS,cAA8B;CACrC,MAAM,CAAC,MAAM,WAAWA,MAAM,SAA6B,KAAK;AAChE,OAAM,gBAAgB;EACpB,MAAM,KAAK,SAAS,cAAc,MAAM;AACxC,KAAG,MAAM,UAAU;AACnB,UAAQ,GAAG;AACX,eAAa,GAAG,QAAQ;IACvB,EAAE,CAAC;CACN,MAAM,OAAOA,MAAM,kBAAkB;AACnC,MAAI,sBAAsB,MAAM,aAAa;AAC3C,QAAK,MAAM,UAAU;AACnB,YAAS,KAAmC,WAAW,MAAM,KAAK;;IAErE,CAAC,KAAK,CAAC;AACV,QAAOA,MAAM,eAAe;EAAE;EAAM;EAAM,GAAG,CAAC,MAAM,KAAK,CAAC;;AAG5D,SAAS,gBAAgB,EACvB,QACA,YAIC;AACD,KAAI,CAAC,OAAO,KAAM,QAAO;AACzB,SAAA,GAAA,UAAA,cAAoB,UAAU,OAAO,KAAK;;AAO5C,SAAS,aAAa,EAAE,QAAQ,GAAG,SAA4B;CAC7D,MAAM,MAAMA,MAAM,OAAuB,KAAK;CAC9C,MAAM,OAAO,OAAO;AACpB,OAAM,sBAAsB;EAC1B,MAAM,OAAO,IAAI;AACjB,MAAI,CAAC,QAAQ,CAAC,KAAM;AACpB,OAAK,MAAM,UAAU;AACrB,MAAI,sBAAsB,KAAK,YAC3B,MAAmC,WAAW,MAAM,KAAK;MAE3D,MAAK,YAAY,KAAK;IAEvB,CAAC,KAAK,CAAC;AACV,QAAO,iBAAA,GAAA,kBAAA,KAAC,OAAD;EAAK,aAAU;EAAqB;EAAK,GAAI;EAAS,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
import * as React$1 from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/components/reparent.d.ts
|
|
7
|
+
declare const supportsMoveBefore: boolean;
|
|
8
|
+
interface ReparentHandle {
|
|
9
|
+
host: HTMLElement | null;
|
|
10
|
+
park: () => void;
|
|
11
|
+
}
|
|
12
|
+
declare function useReparent(): ReparentHandle;
|
|
13
|
+
declare function ReparentContent({
|
|
14
|
+
handle,
|
|
15
|
+
children
|
|
16
|
+
}: {
|
|
17
|
+
handle: ReparentHandle;
|
|
18
|
+
children: React$1.ReactNode;
|
|
19
|
+
}): React$1.ReactPortal | null;
|
|
20
|
+
interface ReparentSlotProps extends React$1.ComponentProps<'div'> {
|
|
21
|
+
handle: ReparentHandle;
|
|
22
|
+
}
|
|
23
|
+
declare function ReparentSlot({
|
|
24
|
+
handle,
|
|
25
|
+
...props
|
|
26
|
+
}: ReparentSlotProps): _$react_jsx_runtime0.JSX.Element;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { ReparentContent, type ReparentHandle, ReparentSlot, type ReparentSlotProps, supportsMoveBefore, useReparent };
|
|
29
|
+
//# sourceMappingURL=reparent.d.cts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/reparent.d.ts
|
|
7
|
+
declare const supportsMoveBefore: boolean;
|
|
8
|
+
interface ReparentHandle {
|
|
9
|
+
host: HTMLElement | null;
|
|
10
|
+
park: () => void;
|
|
11
|
+
}
|
|
12
|
+
declare function useReparent(): ReparentHandle;
|
|
13
|
+
declare function ReparentContent({
|
|
14
|
+
handle,
|
|
15
|
+
children
|
|
16
|
+
}: {
|
|
17
|
+
handle: ReparentHandle;
|
|
18
|
+
children: React$1.ReactNode;
|
|
19
|
+
}): React$1.ReactPortal | null;
|
|
20
|
+
interface ReparentSlotProps extends React$1.ComponentProps<'div'> {
|
|
21
|
+
handle: ReparentHandle;
|
|
22
|
+
}
|
|
23
|
+
declare function ReparentSlot({
|
|
24
|
+
handle,
|
|
25
|
+
...props
|
|
26
|
+
}: ReparentSlotProps): _$react_jsx_runtime0.JSX.Element;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { ReparentContent, type ReparentHandle, ReparentSlot, type ReparentSlotProps, supportsMoveBefore, useReparent };
|
|
29
|
+
//# sourceMappingURL=reparent.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
5
|
+
//#region src/components/reparent.tsx
|
|
6
|
+
const supportsMoveBefore = typeof Element !== "undefined" && "moveBefore" in Element.prototype;
|
|
7
|
+
function useReparent() {
|
|
8
|
+
const [host, setHost] = React$1.useState(null);
|
|
9
|
+
React$1.useEffect(() => {
|
|
10
|
+
const el = document.createElement("div");
|
|
11
|
+
el.style.display = "contents";
|
|
12
|
+
setHost(el);
|
|
13
|
+
return () => el.remove();
|
|
14
|
+
}, []);
|
|
15
|
+
const park = React$1.useCallback(() => {
|
|
16
|
+
if (supportsMoveBefore && host?.isConnected) {
|
|
17
|
+
host.style.display = "none";
|
|
18
|
+
document.body.moveBefore(host, null);
|
|
19
|
+
}
|
|
20
|
+
}, [host]);
|
|
21
|
+
return React$1.useMemo(() => ({
|
|
22
|
+
host,
|
|
23
|
+
park
|
|
24
|
+
}), [host, park]);
|
|
25
|
+
}
|
|
26
|
+
function ReparentContent({ handle, children }) {
|
|
27
|
+
if (!handle.host) return null;
|
|
28
|
+
return createPortal(children, handle.host);
|
|
29
|
+
}
|
|
30
|
+
function ReparentSlot({ handle, ...props }) {
|
|
31
|
+
const ref = React$1.useRef(null);
|
|
32
|
+
const host = handle.host;
|
|
33
|
+
React$1.useLayoutEffect(() => {
|
|
34
|
+
const slot = ref.current;
|
|
35
|
+
if (!slot || !host) return;
|
|
36
|
+
host.style.display = "contents";
|
|
37
|
+
if (supportsMoveBefore && host.isConnected) slot.moveBefore(host, null);
|
|
38
|
+
else slot.appendChild(host);
|
|
39
|
+
}, [host]);
|
|
40
|
+
return /* @__PURE__ */ jsx("div", {
|
|
41
|
+
"data-slot": "reparent-slot",
|
|
42
|
+
ref,
|
|
43
|
+
...props
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { ReparentContent, ReparentSlot, supportsMoveBefore, useReparent };
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=reparent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reparent.js","names":["React"],"sources":["../../src/components/reparent.tsx"],"sourcesContent":["import * as React from 'react'\nimport { createPortal } from 'react-dom'\n\n// moveBefore ships in Chrome/Edge 133+, Firefox 144+; Safari has no state-preserving move\nconst supportsMoveBefore =\n typeof Element !== 'undefined' && 'moveBefore' in Element.prototype\n\ntype MovableElement = Element & {\n moveBefore: (node: Node, child: Node | null) => void\n}\n\ninterface ReparentHandle {\n host: HTMLElement | null\n park: () => void\n}\n\n// host created after mount so server and client hydrate the same (empty) markup\nfunction useReparent(): ReparentHandle {\n const [host, setHost] = React.useState<HTMLElement | null>(null)\n React.useEffect(() => {\n const el = document.createElement('div')\n el.style.display = 'contents'\n setHost(el)\n return () => el.remove()\n }, [])\n const park = React.useCallback(() => {\n if (supportsMoveBefore && host?.isConnected) {\n host.style.display = 'none'\n ;(document.body as unknown as MovableElement).moveBefore(host, null)\n }\n }, [host])\n return React.useMemo(() => ({ host, park }), [host, park])\n}\n\nfunction ReparentContent({\n handle,\n children,\n}: {\n handle: ReparentHandle\n children: React.ReactNode\n}) {\n if (!handle.host) return null\n return createPortal(children, handle.host)\n}\n\ninterface ReparentSlotProps extends React.ComponentProps<'div'> {\n handle: ReparentHandle\n}\n\nfunction ReparentSlot({ handle, ...props }: ReparentSlotProps) {\n const ref = React.useRef<HTMLDivElement>(null)\n const host = handle.host\n React.useLayoutEffect(() => {\n const slot = ref.current\n if (!slot || !host) return\n host.style.display = 'contents'\n if (supportsMoveBefore && host.isConnected) {\n ;(slot as unknown as MovableElement).moveBefore(host, null)\n } else {\n slot.appendChild(host)\n }\n }, [host])\n return <div data-slot=\"reparent-slot\" ref={ref} {...props} />\n}\n\nexport { ReparentContent, ReparentSlot, supportsMoveBefore, useReparent }\nexport type { ReparentHandle, ReparentSlotProps }\n"],"mappings":";;;;;AAIA,MAAM,qBACJ,OAAO,YAAY,eAAe,gBAAgB,QAAQ;AAY5D,SAAS,cAA8B;CACrC,MAAM,CAAC,MAAM,WAAWA,QAAM,SAA6B,KAAK;AAChE,SAAM,gBAAgB;EACpB,MAAM,KAAK,SAAS,cAAc,MAAM;AACxC,KAAG,MAAM,UAAU;AACnB,UAAQ,GAAG;AACX,eAAa,GAAG,QAAQ;IACvB,EAAE,CAAC;CACN,MAAM,OAAOA,QAAM,kBAAkB;AACnC,MAAI,sBAAsB,MAAM,aAAa;AAC3C,QAAK,MAAM,UAAU;AACnB,YAAS,KAAmC,WAAW,MAAM,KAAK;;IAErE,CAAC,KAAK,CAAC;AACV,QAAOA,QAAM,eAAe;EAAE;EAAM;EAAM,GAAG,CAAC,MAAM,KAAK,CAAC;;AAG5D,SAAS,gBAAgB,EACvB,QACA,YAIC;AACD,KAAI,CAAC,OAAO,KAAM,QAAO;AACzB,QAAO,aAAa,UAAU,OAAO,KAAK;;AAO5C,SAAS,aAAa,EAAE,QAAQ,GAAG,SAA4B;CAC7D,MAAM,MAAMA,QAAM,OAAuB,KAAK;CAC9C,MAAM,OAAO,OAAO;AACpB,SAAM,sBAAsB;EAC1B,MAAM,OAAO,IAAI;AACjB,MAAI,CAAC,QAAQ,CAAC,KAAM;AACpB,OAAK,MAAM,UAAU;AACrB,MAAI,sBAAsB,KAAK,YAC3B,MAAmC,WAAW,MAAM,KAAK;MAE3D,MAAK,YAAY,KAAK;IAEvB,CAAC,KAAK,CAAC;AACV,QAAO,oBAAC,OAAD;EAAK,aAAU;EAAqB;EAAK,GAAI;EAAS,CAAA"}
|