@cronus-ui/ui 0.6.0
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 +21 -0
- package/README.md +262 -0
- package/dist/charts/animation.d.ts +11 -0
- package/dist/charts/animation.js +29 -0
- package/dist/charts/area-chart-loading.d.ts +34 -0
- package/dist/charts/area-chart-loading.js +22 -0
- package/dist/charts/area-chart.d.ts +48 -0
- package/dist/charts/area-chart.js +57 -0
- package/dist/charts/area-gradient-defs.d.ts +20 -0
- package/dist/charts/area-gradient-defs.js +15 -0
- package/dist/charts/area.d.ts +76 -0
- package/dist/charts/area.js +104 -0
- package/dist/charts/background.d.ts +27 -0
- package/dist/charts/background.js +68 -0
- package/dist/charts/bar-chart-loading.d.ts +17 -0
- package/dist/charts/bar-chart-loading.js +14 -0
- package/dist/charts/bar-chart.d.ts +55 -0
- package/dist/charts/bar-chart.js +432 -0
- package/dist/charts/bar-depth-geometry.d.ts +33 -0
- package/dist/charts/bar-depth-geometry.js +38 -0
- package/dist/charts/bar-depth.d.ts +157 -0
- package/dist/charts/bar-depth.js +586 -0
- package/dist/charts/bar-squares-layout.d.ts +28 -0
- package/dist/charts/bar-squares-layout.js +47 -0
- package/dist/charts/bar-squares.d.ts +49 -0
- package/dist/charts/bar-squares.js +207 -0
- package/dist/charts/bar-x-axis.d.ts +14 -0
- package/dist/charts/bar-x-axis.js +73 -0
- package/dist/charts/bar-y-axis.d.ts +12 -0
- package/dist/charts/bar-y-axis.js +64 -0
- package/dist/charts/bar.d.ts +41 -0
- package/dist/charts/bar.js +208 -0
- package/dist/charts/candlestick-chart.d.ts +46 -0
- package/dist/charts/candlestick-chart.js +203 -0
- package/dist/charts/candlestick.d.ts +24 -0
- package/dist/charts/candlestick.js +139 -0
- package/dist/charts/chart-brush-handle.d.ts +15 -0
- package/dist/charts/chart-brush-handle.js +47 -0
- package/dist/charts/chart-brush-layout.d.ts +27 -0
- package/dist/charts/chart-brush-layout.js +42 -0
- package/dist/charts/chart-brush-selection-overlay.d.ts +19 -0
- package/dist/charts/chart-brush-selection-overlay.js +44 -0
- package/dist/charts/chart-brush-track-overlay.d.ts +23 -0
- package/dist/charts/chart-brush-track-overlay.js +65 -0
- package/dist/charts/chart-brush.d.ts +32 -0
- package/dist/charts/chart-brush.js +116 -0
- package/dist/charts/chart-center-typography.d.ts +12 -0
- package/dist/charts/chart-center-typography.js +12 -0
- package/dist/charts/chart-child-passthrough.d.ts +17 -0
- package/dist/charts/chart-child-passthrough.js +74 -0
- package/dist/charts/chart-config-context.d.ts +26 -0
- package/dist/charts/chart-config-context.js +47 -0
- package/dist/charts/chart-context.d.ts +199 -0
- package/dist/charts/chart-context.js +201 -0
- package/dist/charts/chart-defs.d.ts +13 -0
- package/dist/charts/chart-defs.js +49 -0
- package/dist/charts/chart-formatters.d.ts +10 -0
- package/dist/charts/chart-formatters.js +28 -0
- package/dist/charts/chart-legend-hover.d.ts +13 -0
- package/dist/charts/chart-legend-hover.js +18 -0
- package/dist/charts/chart-legend.d.ts +55 -0
- package/dist/charts/chart-legend.js +30 -0
- package/dist/charts/chart-loading-label.d.ts +10 -0
- package/dist/charts/chart-loading-label.js +21 -0
- package/dist/charts/chart-phase.d.ts +31 -0
- package/dist/charts/chart-phase.js +21 -0
- package/dist/charts/chart-reveal-clip.d.ts +24 -0
- package/dist/charts/chart-reveal-clip.js +24 -0
- package/dist/charts/chart-scale.d.ts +12 -0
- package/dist/charts/chart-scale.js +17 -0
- package/dist/charts/chart-stat-flow.d.ts +36 -0
- package/dist/charts/chart-stat-flow.js +23 -0
- package/dist/charts/choropleth/choropleth-chart.d.ts +43 -0
- package/dist/charts/choropleth/choropleth-chart.js +218 -0
- package/dist/charts/choropleth/choropleth-context.d.ts +86 -0
- package/dist/charts/choropleth/choropleth-context.js +106 -0
- package/dist/charts/choropleth/choropleth-feature.d.ts +13 -0
- package/dist/charts/choropleth/choropleth-feature.js +125 -0
- package/dist/charts/choropleth/choropleth-graticule.d.ts +11 -0
- package/dist/charts/choropleth/choropleth-graticule.js +12 -0
- package/dist/charts/choropleth/choropleth-tooltip.d.ts +31 -0
- package/dist/charts/choropleth/choropleth-tooltip.js +50 -0
- package/dist/charts/choropleth/index.d.ts +7 -0
- package/dist/charts/choropleth/index.js +6 -0
- package/dist/charts/composed-chart.d.ts +36 -0
- package/dist/charts/composed-chart.js +152 -0
- package/dist/charts/dash-tail-stroke.d.ts +18 -0
- package/dist/charts/dash-tail-stroke.js +13 -0
- package/dist/charts/decimate-time-series.d.ts +10 -0
- package/dist/charts/decimate-time-series.js +112 -0
- package/dist/charts/fade-edges.d.ts +34 -0
- package/dist/charts/fade-edges.js +35 -0
- package/dist/charts/filter-data-by-x-domain.d.ts +5 -0
- package/dist/charts/filter-data-by-x-domain.js +42 -0
- package/dist/charts/funnel-chart.d.ts +91 -0
- package/dist/charts/funnel-chart.js +302 -0
- package/dist/charts/gauge-label-layout.d.ts +22 -0
- package/dist/charts/gauge-label-layout.js +44 -0
- package/dist/charts/gauge.d.ts +56 -0
- package/dist/charts/gauge.js +307 -0
- package/dist/charts/generate-chart-skeleton-data.d.ts +16 -0
- package/dist/charts/generate-chart-skeleton-data.js +25 -0
- package/dist/charts/grid.d.ts +58 -0
- package/dist/charts/grid.js +80 -0
- package/dist/charts/heatmap/generate-heatmap-skeleton-data.d.ts +4 -0
- package/dist/charts/heatmap/generate-heatmap-skeleton-data.js +12 -0
- package/dist/charts/heatmap/heatmap-animation.d.ts +41 -0
- package/dist/charts/heatmap/heatmap-animation.js +85 -0
- package/dist/charts/heatmap/heatmap-cells.d.ts +21 -0
- package/dist/charts/heatmap/heatmap-cells.js +265 -0
- package/dist/charts/heatmap/heatmap-chart-loading.d.ts +21 -0
- package/dist/charts/heatmap/heatmap-chart-loading.js +14 -0
- package/dist/charts/heatmap/heatmap-chart.d.ts +80 -0
- package/dist/charts/heatmap/heatmap-chart.js +275 -0
- package/dist/charts/heatmap/heatmap-colors.d.ts +70 -0
- package/dist/charts/heatmap/heatmap-colors.js +113 -0
- package/dist/charts/heatmap/heatmap-context.d.ts +109 -0
- package/dist/charts/heatmap/heatmap-context.js +69 -0
- package/dist/charts/heatmap/heatmap-legend-gradient.d.ts +20 -0
- package/dist/charts/heatmap/heatmap-legend-gradient.js +44 -0
- package/dist/charts/heatmap/heatmap-legend-swatch.d.ts +8 -0
- package/dist/charts/heatmap/heatmap-legend-swatch.js +26 -0
- package/dist/charts/heatmap/heatmap-legend.d.ts +41 -0
- package/dist/charts/heatmap/heatmap-legend.js +68 -0
- package/dist/charts/heatmap/heatmap-pattern-defs.d.ts +5 -0
- package/dist/charts/heatmap/heatmap-pattern-defs.js +25 -0
- package/dist/charts/heatmap/heatmap-resolve-separator.d.ts +8 -0
- package/dist/charts/heatmap/heatmap-resolve-separator.js +82 -0
- package/dist/charts/heatmap/heatmap-separator.d.ts +63 -0
- package/dist/charts/heatmap/heatmap-separator.js +71 -0
- package/dist/charts/heatmap/heatmap-tooltip.d.ts +30 -0
- package/dist/charts/heatmap/heatmap-tooltip.js +20 -0
- package/dist/charts/heatmap/heatmap-utils.d.ts +175 -0
- package/dist/charts/heatmap/heatmap-utils.js +595 -0
- package/dist/charts/heatmap/heatmap-x-axis.d.ts +7 -0
- package/dist/charts/heatmap/heatmap-x-axis.js +54 -0
- package/dist/charts/heatmap/heatmap-y-axis.d.ts +14 -0
- package/dist/charts/heatmap/heatmap-y-axis.js +37 -0
- package/dist/charts/heatmap/index.d.ts +15 -0
- package/dist/charts/heatmap/index.js +15 -0
- package/dist/charts/heatmap/use-delayed-tooltip-data.d.ts +3 -0
- package/dist/charts/heatmap/use-delayed-tooltip-data.js +53 -0
- package/dist/charts/highlight-segment-bounds.d.ts +18 -0
- package/dist/charts/highlight-segment-bounds.js +36 -0
- package/dist/charts/highlight-segment.d.ts +22 -0
- package/dist/charts/highlight-segment.js +14 -0
- package/dist/charts/index.d.ts +106 -0
- package/dist/charts/index.js +133 -0
- package/dist/charts/indicator-fade.d.ts +15 -0
- package/dist/charts/indicator-fade.js +42 -0
- package/dist/charts/legend/index.d.ts +8 -0
- package/dist/charts/legend/index.js +10 -0
- package/dist/charts/legend/legend-context.d.ts +48 -0
- package/dist/charts/legend/legend-context.js +34 -0
- package/dist/charts/legend/legend-item.d.ts +12 -0
- package/dist/charts/legend/legend-item.js +11 -0
- package/dist/charts/legend/legend-label.d.ts +9 -0
- package/dist/charts/legend/legend-label.js +10 -0
- package/dist/charts/legend/legend-marker.d.ts +9 -0
- package/dist/charts/legend/legend-marker.js +11 -0
- package/dist/charts/legend/legend-progress.d.ts +13 -0
- package/dist/charts/legend/legend-progress.js +15 -0
- package/dist/charts/legend/legend-value.d.ts +17 -0
- package/dist/charts/legend/legend-value.js +11 -0
- package/dist/charts/legend/legend.d.ts +23 -0
- package/dist/charts/legend/legend.js +43 -0
- package/dist/charts/line-chart-loading.d.ts +34 -0
- package/dist/charts/line-chart-loading.js +22 -0
- package/dist/charts/line-chart.d.ts +46 -0
- package/dist/charts/line-chart.js +91 -0
- package/dist/charts/line-loading-pulse.d.ts +20 -0
- package/dist/charts/line-loading-pulse.js +124 -0
- package/dist/charts/line-loading-timing.d.ts +10 -0
- package/dist/charts/line-loading-timing.js +10 -0
- package/dist/charts/line-series-terminal-marker.d.ts +16 -0
- package/dist/charts/line-series-terminal-marker.js +46 -0
- package/dist/charts/line.d.ts +64 -0
- package/dist/charts/line.js +96 -0
- package/dist/charts/live-line-chart.d.ts +35 -0
- package/dist/charts/live-line-chart.js +374 -0
- package/dist/charts/live-line.d.ts +39 -0
- package/dist/charts/live-line.js +78 -0
- package/dist/charts/live-x-axis.d.ts +12 -0
- package/dist/charts/live-x-axis.js +85 -0
- package/dist/charts/live-y-axis.d.ts +16 -0
- package/dist/charts/live-y-axis.js +137 -0
- package/dist/charts/loading-sweep.d.ts +66 -0
- package/dist/charts/loading-sweep.js +174 -0
- package/dist/charts/markers/chart-markers.d.ts +25 -0
- package/dist/charts/markers/chart-markers.js +87 -0
- package/dist/charts/markers/index.d.ts +3 -0
- package/dist/charts/markers/index.js +3 -0
- package/dist/charts/markers/marker-group.d.ts +88 -0
- package/dist/charts/markers/marker-group.js +171 -0
- package/dist/charts/motion-utils.d.ts +9 -0
- package/dist/charts/motion-utils.js +28 -0
- package/dist/charts/notch-gauge-shared.d.ts +49 -0
- package/dist/charts/notch-gauge-shared.js +103 -0
- package/dist/charts/path-stroke-utils.d.ts +20 -0
- package/dist/charts/path-stroke-utils.js +55 -0
- package/dist/charts/pattern-area.d.ts +21 -0
- package/dist/charts/pattern-area.js +19 -0
- package/dist/charts/pattern-preset.d.ts +26 -0
- package/dist/charts/pattern-preset.js +83 -0
- package/dist/charts/pie-center-shell.d.ts +24 -0
- package/dist/charts/pie-center-shell.js +109 -0
- package/dist/charts/pie-center.d.ts +46 -0
- package/dist/charts/pie-center.js +46 -0
- package/dist/charts/pie-chart.d.ts +50 -0
- package/dist/charts/pie-chart.js +248 -0
- package/dist/charts/pie-context.d.ts +74 -0
- package/dist/charts/pie-context.js +95 -0
- package/dist/charts/pie-slice.d.ts +28 -0
- package/dist/charts/pie-slice.js +180 -0
- package/dist/charts/profit-loss-legend-hover.d.ts +11 -0
- package/dist/charts/profit-loss-legend-hover.js +12 -0
- package/dist/charts/profit-loss-legend.d.ts +17 -0
- package/dist/charts/profit-loss-legend.js +18 -0
- package/dist/charts/profit-loss-line.d.ts +27 -0
- package/dist/charts/profit-loss-line.js +77 -0
- package/dist/charts/profit-loss-segments.d.ts +12 -0
- package/dist/charts/profit-loss-segments.js +86 -0
- package/dist/charts/projection-config.d.ts +11 -0
- package/dist/charts/projection-config.js +80 -0
- package/dist/charts/projection-line-end-marker.d.ts +15 -0
- package/dist/charts/projection-line-end-marker.js +27 -0
- package/dist/charts/projection-line.d.ts +40 -0
- package/dist/charts/projection-line.js +79 -0
- package/dist/charts/projection-utils.d.ts +46 -0
- package/dist/charts/projection-utils.js +253 -0
- package/dist/charts/radar-area.d.ts +17 -0
- package/dist/charts/radar-area.js +84 -0
- package/dist/charts/radar-axis.d.ts +14 -0
- package/dist/charts/radar-axis.js +24 -0
- package/dist/charts/radar-chart.d.ts +36 -0
- package/dist/charts/radar-chart.js +89 -0
- package/dist/charts/radar-context.d.ts +68 -0
- package/dist/charts/radar-context.js +87 -0
- package/dist/charts/radar-grid.d.ts +16 -0
- package/dist/charts/radar-grid.js +40 -0
- package/dist/charts/radar-labels.d.ts +16 -0
- package/dist/charts/radar-labels.js +29 -0
- package/dist/charts/reference-area-config.d.ts +10 -0
- package/dist/charts/reference-area-config.js +39 -0
- package/dist/charts/reference-area-geometry.d.ts +23 -0
- package/dist/charts/reference-area-geometry.js +68 -0
- package/dist/charts/reference-area-registration-context.d.ts +8 -0
- package/dist/charts/reference-area-registration-context.js +7 -0
- package/dist/charts/reference-area.d.ts +52 -0
- package/dist/charts/reference-area.js +101 -0
- package/dist/charts/ring-center.d.ts +46 -0
- package/dist/charts/ring-center.js +41 -0
- package/dist/charts/ring-chart.d.ts +41 -0
- package/dist/charts/ring-chart.js +212 -0
- package/dist/charts/ring-context.d.ts +66 -0
- package/dist/charts/ring-context.js +92 -0
- package/dist/charts/ring.d.ts +11 -0
- package/dist/charts/ring.js +104 -0
- package/dist/charts/sankey/index.d.ts +6 -0
- package/dist/charts/sankey/index.js +6 -0
- package/dist/charts/sankey/sankey-chart.d.ts +39 -0
- package/dist/charts/sankey/sankey-chart.js +117 -0
- package/dist/charts/sankey/sankey-context.d.ts +69 -0
- package/dist/charts/sankey/sankey-context.js +23 -0
- package/dist/charts/sankey/sankey-link.d.ts +26 -0
- package/dist/charts/sankey/sankey-link.js +155 -0
- package/dist/charts/sankey/sankey-node.d.ts +29 -0
- package/dist/charts/sankey/sankey-node.js +200 -0
- package/dist/charts/sankey/sankey-tooltip.d.ts +24 -0
- package/dist/charts/sankey/sankey-tooltip.js +70 -0
- package/dist/charts/scatter-chart-shell.d.ts +21 -0
- package/dist/charts/scatter-chart-shell.js +152 -0
- package/dist/charts/scatter-chart.d.ts +32 -0
- package/dist/charts/scatter-chart.js +56 -0
- package/dist/charts/scatter-svg.d.ts +6 -0
- package/dist/charts/scatter-svg.js +16 -0
- package/dist/charts/scatter.d.ts +21 -0
- package/dist/charts/scatter.js +30 -0
- package/dist/charts/segment.d.ts +26 -0
- package/dist/charts/segment.js +42 -0
- package/dist/charts/series-bar-layout.d.ts +18 -0
- package/dist/charts/series-bar-layout.js +31 -0
- package/dist/charts/series-bar.d.ts +20 -0
- package/dist/charts/series-bar.js +120 -0
- package/dist/charts/series-dash-tail-overlay.d.ts +17 -0
- package/dist/charts/series-dash-tail-overlay.js +39 -0
- package/dist/charts/series-highlight-layer.d.ts +23 -0
- package/dist/charts/series-highlight-layer.js +21 -0
- package/dist/charts/series-hover-dim.d.ts +29 -0
- package/dist/charts/series-hover-dim.js +26 -0
- package/dist/charts/series-markers.d.ts +14 -0
- package/dist/charts/series-markers.js +98 -0
- package/dist/charts/series-path-utils.d.ts +19 -0
- package/dist/charts/series-path-utils.js +60 -0
- package/dist/charts/series-point-marker.d.ts +48 -0
- package/dist/charts/series-point-marker.js +48 -0
- package/dist/charts/shimmering-text.d.ts +23 -0
- package/dist/charts/shimmering-text.js +31 -0
- package/dist/charts/static-chart-preview-context.d.ts +7 -0
- package/dist/charts/static-chart-preview-context.js +12 -0
- package/dist/charts/sunburst-breadcrumb.d.ts +16 -0
- package/dist/charts/sunburst-breadcrumb.js +26 -0
- package/dist/charts/sunburst-center.d.ts +5 -0
- package/dist/charts/sunburst-center.js +17 -0
- package/dist/charts/sunburst-chart.d.ts +30 -0
- package/dist/charts/sunburst-chart.js +263 -0
- package/dist/charts/sunburst-context.d.ts +61 -0
- package/dist/charts/sunburst-context.js +112 -0
- package/dist/charts/sunburst-data.d.ts +9 -0
- package/dist/charts/sunburst-data.js +2 -0
- package/dist/charts/sunburst-hint.d.ts +13 -0
- package/dist/charts/sunburst-hint.js +31 -0
- package/dist/charts/sunburst-labels.d.ts +9 -0
- package/dist/charts/sunburst-labels.js +63 -0
- package/dist/charts/sunburst-segment.d.ts +11 -0
- package/dist/charts/sunburst-segment.js +78 -0
- package/dist/charts/sunburst.d.ts +101 -0
- package/dist/charts/sunburst.js +396 -0
- package/dist/charts/time-series-chart-shell.d.ts +47 -0
- package/dist/charts/time-series-chart-shell.js +390 -0
- package/dist/charts/tooltip/chart-tooltip.d.ts +76 -0
- package/dist/charts/tooltip/chart-tooltip.js +150 -0
- package/dist/charts/tooltip/date-ticker.d.ts +11 -0
- package/dist/charts/tooltip/date-ticker.js +77 -0
- package/dist/charts/tooltip/index.d.ts +7 -0
- package/dist/charts/tooltip/index.js +7 -0
- package/dist/charts/tooltip/tooltip-box.d.ts +48 -0
- package/dist/charts/tooltip/tooltip-box.js +114 -0
- package/dist/charts/tooltip/tooltip-content.d.ts +18 -0
- package/dist/charts/tooltip/tooltip-content.js +9 -0
- package/dist/charts/tooltip/tooltip-dot.d.ts +28 -0
- package/dist/charts/tooltip/tooltip-dot.js +54 -0
- package/dist/charts/tooltip/tooltip-indicator.d.ts +45 -0
- package/dist/charts/tooltip/tooltip-indicator.js +65 -0
- package/dist/charts/use-animated-series-path.d.ts +19 -0
- package/dist/charts/use-animated-series-path.js +93 -0
- package/dist/charts/use-animated-y-domains.d.ts +14 -0
- package/dist/charts/use-animated-y-domains.js +150 -0
- package/dist/charts/use-chart-interaction.d.ts +41 -0
- package/dist/charts/use-chart-interaction.js +244 -0
- package/dist/charts/use-chart-phase-orchestrator.d.ts +23 -0
- package/dist/charts/use-chart-phase-orchestrator.js +139 -0
- package/dist/charts/use-enter-complete.d.ts +8 -0
- package/dist/charts/use-enter-complete.js +23 -0
- package/dist/charts/use-grid-shimmer.d.ts +16 -0
- package/dist/charts/use-grid-shimmer.js +63 -0
- package/dist/charts/use-highlight-segment.d.ts +14 -0
- package/dist/charts/use-highlight-segment.js +34 -0
- package/dist/charts/use-mount-progress.d.ts +4 -0
- package/dist/charts/use-mount-progress.js +22 -0
- package/dist/charts/use-scatter-chart-interaction.d.ts +35 -0
- package/dist/charts/use-scatter-chart-interaction.js +228 -0
- package/dist/charts/use-scheduled-tooltip.d.ts +9 -0
- package/dist/charts/use-scheduled-tooltip.js +76 -0
- package/dist/charts/visx-pattern.d.ts +19 -0
- package/dist/charts/visx-pattern.js +20 -0
- package/dist/charts/x-axis.d.ts +27 -0
- package/dist/charts/x-axis.js +415 -0
- package/dist/charts/y-axis-scales.d.ts +26 -0
- package/dist/charts/y-axis-scales.js +72 -0
- package/dist/charts/y-axis-ticks.d.ts +12 -0
- package/dist/charts/y-axis-ticks.js +24 -0
- package/dist/charts/y-axis.d.ts +22 -0
- package/dist/charts/y-axis.js +80 -0
- package/dist/charts/y-domain-utils.d.ts +27 -0
- package/dist/charts/y-domain-utils.js +88 -0
- package/dist/components/accordion.d.ts +6 -0
- package/dist/components/accordion.js +20 -0
- package/dist/components/alert-dialog.d.ts +18 -0
- package/dist/components/alert-dialog.js +41 -0
- package/dist/components/alert.d.ts +24 -0
- package/dist/components/alert.js +46 -0
- package/dist/components/animated-button.d.ts +5 -0
- package/dist/components/animated-button.js +16 -0
- package/dist/components/animated-list.d.ts +26 -0
- package/dist/components/animated-list.js +25 -0
- package/dist/components/animated-number.d.ts +67 -0
- package/dist/components/animated-number.js +131 -0
- package/dist/components/app-shell.d.ts +27 -0
- package/dist/components/app-shell.js +18 -0
- package/dist/components/area-chart.d.ts +11 -0
- package/dist/components/area-chart.js +12 -0
- package/dist/components/aspect-ratio.d.ts +16 -0
- package/dist/components/aspect-ratio.js +14 -0
- package/dist/components/aurora-background.d.ts +3 -0
- package/dist/components/aurora-background.js +8 -0
- package/dist/components/autocomplete.d.ts +55 -0
- package/dist/components/autocomplete.js +279 -0
- package/dist/components/avatar-group.d.ts +39 -0
- package/dist/components/avatar-group.js +50 -0
- package/dist/components/avatar.d.ts +5 -0
- package/dist/components/avatar.js +17 -0
- package/dist/components/badge.d.ts +10 -0
- package/dist/components/badge.js +35 -0
- package/dist/components/banner.d.ts +45 -0
- package/dist/components/banner.js +80 -0
- package/dist/components/bar-chart.d.ts +11 -0
- package/dist/components/bar-chart.js +9 -0
- package/dist/components/border-beam.d.ts +45 -0
- package/dist/components/border-beam.js +48 -0
- package/dist/components/breadcrumb.d.ts +12 -0
- package/dist/components/breadcrumb.js +35 -0
- package/dist/components/button-group.d.ts +7 -0
- package/dist/components/button-group.js +10 -0
- package/dist/components/button.d.ts +12 -0
- package/dist/components/button.js +39 -0
- package/dist/components/calendar.d.ts +7 -0
- package/dist/components/calendar.js +71 -0
- package/dist/components/candlestick-chart.d.ts +13 -0
- package/dist/components/candlestick-chart.js +66 -0
- package/dist/components/card-stack.d.ts +28 -0
- package/dist/components/card-stack.js +47 -0
- package/dist/components/card.d.ts +9 -0
- package/dist/components/card.js +32 -0
- package/dist/components/carousel.d.ts +82 -0
- package/dist/components/carousel.js +310 -0
- package/dist/components/chart.d.ts +100 -0
- package/dist/components/chart.js +210 -0
- package/dist/components/checkbox.d.ts +3 -0
- package/dist/components/checkbox.js +11 -0
- package/dist/components/chip.d.ts +80 -0
- package/dist/components/chip.js +186 -0
- package/dist/components/choropleth-chart.d.ts +12 -0
- package/dist/components/choropleth-chart.js +31 -0
- package/dist/components/click-spark.d.ts +19 -0
- package/dist/components/click-spark.js +51 -0
- package/dist/components/code-block.d.ts +13 -0
- package/dist/components/code-block.js +20 -0
- package/dist/components/code-tabs.d.ts +51 -0
- package/dist/components/code-tabs.js +150 -0
- package/dist/components/collapsible.d.ts +5 -0
- package/dist/components/collapsible.js +12 -0
- package/dist/components/color-picker.d.ts +30 -0
- package/dist/components/color-picker.js +300 -0
- package/dist/components/combobox.d.ts +33 -0
- package/dist/components/combobox.js +32 -0
- package/dist/components/command.d.ts +87 -0
- package/dist/components/command.js +44 -0
- package/dist/components/comparison-slider.d.ts +17 -0
- package/dist/components/comparison-slider.js +81 -0
- package/dist/components/composed-chart.d.ts +13 -0
- package/dist/components/composed-chart.js +22 -0
- package/dist/components/confetti.d.ts +21 -0
- package/dist/components/confetti.js +111 -0
- package/dist/components/confirmation-dialog.d.ts +46 -0
- package/dist/components/confirmation-dialog.js +102 -0
- package/dist/components/context-menu.d.ts +28 -0
- package/dist/components/context-menu.js +52 -0
- package/dist/components/copy-button.d.ts +13 -0
- package/dist/components/copy-button.js +72 -0
- package/dist/components/countdown.d.ts +58 -0
- package/dist/components/countdown.js +106 -0
- package/dist/components/credit-card-input.d.ts +62 -0
- package/dist/components/credit-card-input.js +211 -0
- package/dist/components/currency-input.d.ts +86 -0
- package/dist/components/currency-input.js +215 -0
- package/dist/components/data-table.d.ts +232 -0
- package/dist/components/data-table.js +359 -0
- package/dist/components/date-picker.d.ts +66 -0
- package/dist/components/date-picker.js +55 -0
- package/dist/components/date-range-picker.d.ts +59 -0
- package/dist/components/date-range-picker.js +59 -0
- package/dist/components/description-list.d.ts +84 -0
- package/dist/components/description-list.js +138 -0
- package/dist/components/dialog.d.ts +26 -0
- package/dist/components/dialog.js +35 -0
- package/dist/components/dock.d.ts +34 -0
- package/dist/components/dock.js +61 -0
- package/dist/components/dot-pattern.d.ts +24 -0
- package/dist/components/dot-pattern.js +19 -0
- package/dist/components/drawer.d.ts +22 -0
- package/dist/components/drawer.js +37 -0
- package/dist/components/dropdown-menu.d.ts +32 -0
- package/dist/components/dropdown-menu.js +56 -0
- package/dist/components/dynamic-island.d.ts +26 -0
- package/dist/components/dynamic-island.js +31 -0
- package/dist/components/empty.d.ts +7 -0
- package/dist/components/empty.js +24 -0
- package/dist/components/expandable-tabs.d.ts +24 -0
- package/dist/components/expandable-tabs.js +30 -0
- package/dist/components/fab.d.ts +35 -0
- package/dist/components/fab.js +36 -0
- package/dist/components/field.d.ts +6 -0
- package/dist/components/field.js +22 -0
- package/dist/components/file-dropzone.d.ts +28 -0
- package/dist/components/file-dropzone.js +59 -0
- package/dist/components/flickering-grid.d.ts +25 -0
- package/dist/components/flickering-grid.js +30 -0
- package/dist/components/flip-card.d.ts +70 -0
- package/dist/components/flip-card.js +117 -0
- package/dist/components/floating-label-input.d.ts +34 -0
- package/dist/components/floating-label-input.js +25 -0
- package/dist/components/form.d.ts +25 -0
- package/dist/components/form.js +68 -0
- package/dist/components/frame.d.ts +12 -0
- package/dist/components/frame.js +10 -0
- package/dist/components/funnel-chart.d.ts +11 -0
- package/dist/components/funnel-chart.js +16 -0
- package/dist/components/gauge-chart.d.ts +8 -0
- package/dist/components/gauge-chart.js +10 -0
- package/dist/components/glare-hover.d.ts +15 -0
- package/dist/components/glare-hover.js +64 -0
- package/dist/components/glass-card.d.ts +3 -0
- package/dist/components/glass-card.js +8 -0
- package/dist/components/gradient-border.d.ts +7 -0
- package/dist/components/gradient-border.js +8 -0
- package/dist/components/gradient-text.d.ts +6 -0
- package/dist/components/gradient-text.js +10 -0
- package/dist/components/grid-pattern.d.ts +23 -0
- package/dist/components/grid-pattern.js +18 -0
- package/dist/components/heatmap-chart.d.ts +6 -0
- package/dist/components/heatmap-chart.js +8 -0
- package/dist/components/heatmap.d.ts +28 -0
- package/dist/components/heatmap.js +41 -0
- package/dist/components/highlighter.d.ts +20 -0
- package/dist/components/highlighter.js +19 -0
- package/dist/components/hover-card.d.ts +5 -0
- package/dist/components/hover-card.js +12 -0
- package/dist/components/image-zoom.d.ts +47 -0
- package/dist/components/image-zoom.js +125 -0
- package/dist/components/input-group.d.ts +10 -0
- package/dist/components/input-group.js +12 -0
- package/dist/components/input-otp.d.ts +18 -0
- package/dist/components/input-otp.js +38 -0
- package/dist/components/input.d.ts +6 -0
- package/dist/components/input.js +8 -0
- package/dist/components/json-viewer.d.ts +43 -0
- package/dist/components/json-viewer.js +313 -0
- package/dist/components/kanban.d.ts +31 -0
- package/dist/components/kanban.js +143 -0
- package/dist/components/kbd.d.ts +3 -0
- package/dist/components/kbd.js +8 -0
- package/dist/components/label.d.ts +3 -0
- package/dist/components/label.js +9 -0
- package/dist/components/light-rays.d.ts +19 -0
- package/dist/components/light-rays.js +20 -0
- package/dist/components/lightbox.d.ts +24 -0
- package/dist/components/lightbox.js +68 -0
- package/dist/components/line-chart.d.ts +10 -0
- package/dist/components/line-chart.js +9 -0
- package/dist/components/live-line-chart.d.ts +12 -0
- package/dist/components/live-line-chart.js +42 -0
- package/dist/components/logo-carousel.d.ts +27 -0
- package/dist/components/logo-carousel.js +101 -0
- package/dist/components/magnetic.d.ts +44 -0
- package/dist/components/magnetic.js +172 -0
- package/dist/components/marquee.d.ts +71 -0
- package/dist/components/marquee.js +141 -0
- package/dist/components/masonry.d.ts +16 -0
- package/dist/components/masonry.js +84 -0
- package/dist/components/menubar.d.ts +33 -0
- package/dist/components/menubar.js +56 -0
- package/dist/components/meteors.d.ts +20 -0
- package/dist/components/meteors.js +39 -0
- package/dist/components/metric.d.ts +9 -0
- package/dist/components/metric.js +35 -0
- package/dist/components/mode-toggle.d.ts +32 -0
- package/dist/components/mode-toggle.js +40 -0
- package/dist/components/morphing-popover.d.ts +91 -0
- package/dist/components/morphing-popover.js +194 -0
- package/dist/components/motion-presets.d.ts +9 -0
- package/dist/components/motion-presets.js +20 -0
- package/dist/components/multi-select.d.ts +54 -0
- package/dist/components/multi-select.js +0 -0
- package/dist/components/navigation-menu.d.ts +12 -0
- package/dist/components/navigation-menu.js +42 -0
- package/dist/components/noise.d.ts +19 -0
- package/dist/components/noise.js +18 -0
- package/dist/components/notification-center.d.ts +68 -0
- package/dist/components/notification-center.js +57 -0
- package/dist/components/number-input.d.ts +45 -0
- package/dist/components/number-input.js +148 -0
- package/dist/components/orbit.d.ts +77 -0
- package/dist/components/orbit.js +100 -0
- package/dist/components/pagination.d.ts +16 -0
- package/dist/components/pagination.js +34 -0
- package/dist/components/particles.d.ts +18 -0
- package/dist/components/particles.js +92 -0
- package/dist/components/password-input.d.ts +16 -0
- package/dist/components/password-input.js +49 -0
- package/dist/components/phone-input.d.ts +67 -0
- package/dist/components/phone-input.js +225 -0
- package/dist/components/pie-chart.d.ts +12 -0
- package/dist/components/pie-chart.js +13 -0
- package/dist/components/pill-nav.d.ts +25 -0
- package/dist/components/pill-nav.js +66 -0
- package/dist/components/popover.d.ts +7 -0
- package/dist/components/popover.js +15 -0
- package/dist/components/profit-loss-chart.d.ts +10 -0
- package/dist/components/profit-loss-chart.js +8 -0
- package/dist/components/progress.d.ts +10 -0
- package/dist/components/progress.js +17 -0
- package/dist/components/progressive-blur.d.ts +24 -0
- package/dist/components/progressive-blur.js +43 -0
- package/dist/components/radar-chart.d.ts +9 -0
- package/dist/components/radar-chart.js +9 -0
- package/dist/components/radio-group.d.ts +4 -0
- package/dist/components/radio-group.js +15 -0
- package/dist/components/rating.d.ts +29 -0
- package/dist/components/rating.js +94 -0
- package/dist/components/resizable.d.ts +57 -0
- package/dist/components/resizable.js +73 -0
- package/dist/components/retro-grid.d.ts +25 -0
- package/dist/components/retro-grid.js +26 -0
- package/dist/components/reveal.d.ts +9 -0
- package/dist/components/reveal.js +14 -0
- package/dist/components/rich-text-editor.d.ts +28 -0
- package/dist/components/rich-text-editor.js +83 -0
- package/dist/components/ring-chart.d.ts +13 -0
- package/dist/components/ring-chart.js +16 -0
- package/dist/components/ripple.d.ts +25 -0
- package/dist/components/ripple.js +26 -0
- package/dist/components/sankey-chart.d.ts +16 -0
- package/dist/components/sankey-chart.js +8 -0
- package/dist/components/scatter-chart.d.ts +12 -0
- package/dist/components/scatter-chart.js +9 -0
- package/dist/components/scheduler.d.ts +50 -0
- package/dist/components/scheduler.js +93 -0
- package/dist/components/scramble-text.d.ts +39 -0
- package/dist/components/scramble-text.js +78 -0
- package/dist/components/scroll-area.d.ts +13 -0
- package/dist/components/scroll-area.js +14 -0
- package/dist/components/scroll-progress.d.ts +19 -0
- package/dist/components/scroll-progress.js +67 -0
- package/dist/components/segmented-control.d.ts +48 -0
- package/dist/components/segmented-control.js +222 -0
- package/dist/components/select.d.ts +12 -0
- package/dist/components/select.js +43 -0
- package/dist/components/separator.d.ts +3 -0
- package/dist/components/separator.js +9 -0
- package/dist/components/sheet.d.ts +25 -0
- package/dist/components/sheet.js +47 -0
- package/dist/components/shimmer.d.ts +3 -0
- package/dist/components/shimmer.js +8 -0
- package/dist/components/shiny-text.d.ts +20 -0
- package/dist/components/shiny-text.js +24 -0
- package/dist/components/sidebar.d.ts +92 -0
- package/dist/components/sidebar.js +290 -0
- package/dist/components/signature-pad.d.ts +44 -0
- package/dist/components/signature-pad.js +317 -0
- package/dist/components/skeleton.d.ts +3 -0
- package/dist/components/skeleton.js +8 -0
- package/dist/components/slider.d.ts +10 -0
- package/dist/components/slider.js +27 -0
- package/dist/components/sonner.d.ts +9 -0
- package/dist/components/sonner.js +17 -0
- package/dist/components/sparkles-text.d.ts +19 -0
- package/dist/components/sparkles-text.js +36 -0
- package/dist/components/sparkline.d.ts +22 -0
- package/dist/components/sparkline.js +100 -0
- package/dist/components/spinner.d.ts +10 -0
- package/dist/components/spinner.js +20 -0
- package/dist/components/spinning-text.d.ts +29 -0
- package/dist/components/spinning-text.js +40 -0
- package/dist/components/split-button.d.ts +71 -0
- package/dist/components/split-button.js +30 -0
- package/dist/components/spotlight-card.d.ts +11 -0
- package/dist/components/spotlight-card.js +63 -0
- package/dist/components/star-border.d.ts +19 -0
- package/dist/components/star-border.js +18 -0
- package/dist/components/status-dot.d.ts +60 -0
- package/dist/components/status-dot.js +76 -0
- package/dist/components/stepper.d.ts +98 -0
- package/dist/components/stepper.js +164 -0
- package/dist/components/sunburst-chart.d.ts +11 -0
- package/dist/components/sunburst-chart.js +45 -0
- package/dist/components/switch.d.ts +3 -0
- package/dist/components/switch.js +10 -0
- package/dist/components/table-of-contents.d.ts +64 -0
- package/dist/components/table-of-contents.js +0 -0
- package/dist/components/table.d.ts +10 -0
- package/dist/components/table.js +38 -0
- package/dist/components/tabs.d.ts +6 -0
- package/dist/components/tabs.js +22 -0
- package/dist/components/tags-input.d.ts +39 -0
- package/dist/components/tags-input.js +86 -0
- package/dist/components/terminal.d.ts +86 -0
- package/dist/components/terminal.js +182 -0
- package/dist/components/text-effect.d.ts +71 -0
- package/dist/components/text-effect.js +166 -0
- package/dist/components/textarea.d.ts +6 -0
- package/dist/components/textarea.js +8 -0
- package/dist/components/tilt-card.d.ts +30 -0
- package/dist/components/tilt-card.js +84 -0
- package/dist/components/time-picker.d.ts +58 -0
- package/dist/components/time-picker.js +245 -0
- package/dist/components/timeline.d.ts +81 -0
- package/dist/components/timeline.js +165 -0
- package/dist/components/toggle-group.d.ts +12 -0
- package/dist/components/toggle-group.js +23 -0
- package/dist/components/toggle.d.ts +12 -0
- package/dist/components/toggle.js +25 -0
- package/dist/components/toolbar.d.ts +14 -0
- package/dist/components/toolbar.js +89 -0
- package/dist/components/tooltip.d.ts +29 -0
- package/dist/components/tooltip.js +48 -0
- package/dist/components/tree-view.d.ts +45 -0
- package/dist/components/tree-view.js +197 -0
- package/dist/components/typing-text.d.ts +49 -0
- package/dist/components/typing-text.js +90 -0
- package/dist/components/usage-meter.d.ts +30 -0
- package/dist/components/usage-meter.js +90 -0
- package/dist/components/video-player.d.ts +48 -0
- package/dist/components/video-player.js +216 -0
- package/dist/components/word-rotate.d.ts +40 -0
- package/dist/components/word-rotate.js +34 -0
- package/dist/index.d.ts +306 -0
- package/dist/index.js +179 -0
- package/dist/lib/cn.d.ts +7 -0
- package/dist/lib/cn.js +10 -0
- package/dist/lib/demo-saas.d.ts +171 -0
- package/dist/lib/demo-saas.js +210 -0
- package/dist/lib/demo-store.d.ts +157 -0
- package/dist/lib/demo-store.js +353 -0
- package/dist/testing/index.d.ts +76 -0
- package/dist/testing/index.js +116 -0
- package/package.json +941 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { scaleLinear } from "@visx/scale";
|
|
2
|
+
import { Y_DOMAIN_TWEEN_SKIP_THRESHOLD } from "./chart-phase.js";
|
|
3
|
+
import { groupLinesByYAxisId, normalizeYAxisId } from "./y-axis-scales.js";
|
|
4
|
+
/** Apply visx `nice()` to raw domain endpoints for stable grid ticks. */
|
|
5
|
+
export function niceYDomain(domain) {
|
|
6
|
+
const scale = scaleLinear({ domain, range: [0, 1], nice: true });
|
|
7
|
+
const niceDomain = scale.domain();
|
|
8
|
+
return [niceDomain[0] ?? domain[0], niceDomain[1] ?? domain[1]];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Skip Y tween when both endpoints move less than the threshold relative to span.
|
|
12
|
+
* When in doubt callers should tween — beauty wins over micro-optimization.
|
|
13
|
+
*/
|
|
14
|
+
export function shouldTweenYDomain(from, to) {
|
|
15
|
+
const span = Math.max(Math.abs(to[1] - to[0]), Math.abs(from[1] - from[0]), 1);
|
|
16
|
+
const deltaMin = Math.abs(to[0] - from[0]) / span;
|
|
17
|
+
const deltaMax = Math.abs(to[1] - from[1]) / span;
|
|
18
|
+
return deltaMin >= Y_DOMAIN_TWEEN_SKIP_THRESHOLD || deltaMax >= Y_DOMAIN_TWEEN_SKIP_THRESHOLD;
|
|
19
|
+
}
|
|
20
|
+
/** Phases where the chart shows loading chrome (shimmer, pulse, label). */
|
|
21
|
+
export function isLoadingChromePhase(phase) {
|
|
22
|
+
return phase === "loading" || phase === "revealingLoading";
|
|
23
|
+
}
|
|
24
|
+
/** Phases where grid lines use loading stroke styling (muted / dashed chrome). */
|
|
25
|
+
export function isLoadingGridChromePhase(phase) {
|
|
26
|
+
return phase === "loading" || phase === "exiting" || phase === "gridTweenLoading";
|
|
27
|
+
}
|
|
28
|
+
/** Phases where Y-domain tween runs after the series has exited. */
|
|
29
|
+
export function isYDomainTweenPhase(phase) {
|
|
30
|
+
return phase === "gridTweenLoading" || phase === "gridTweenReady";
|
|
31
|
+
}
|
|
32
|
+
/** Phases where {@link ReferenceArea} bands are shown (fade in/out on transitions). */
|
|
33
|
+
export function isReferenceAreaVisiblePhase(phase) {
|
|
34
|
+
return phase === "ready" || phase === "revealing" || phase === "gridTweenReady";
|
|
35
|
+
}
|
|
36
|
+
export function resolveAnimatedYDestinationDomains(chartPhase, skeletonByAxis, targetByAxis) {
|
|
37
|
+
switch (chartPhase) {
|
|
38
|
+
case "loading":
|
|
39
|
+
case "exiting":
|
|
40
|
+
case "gridTweenLoading":
|
|
41
|
+
return skeletonByAxis;
|
|
42
|
+
case "exitingReady":
|
|
43
|
+
case "gridTweenReady":
|
|
44
|
+
case "revealing":
|
|
45
|
+
case "ready":
|
|
46
|
+
return targetByAxis;
|
|
47
|
+
default:
|
|
48
|
+
return targetByAxis;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export function computeYDomainsByAxis({ lines, resolveDomain, }) {
|
|
52
|
+
const groups = groupLinesByYAxisId(lines);
|
|
53
|
+
const domains = {};
|
|
54
|
+
for (const [axisId, axisLines] of groups) {
|
|
55
|
+
const dataKeys = axisLines.map((line) => line.dataKey);
|
|
56
|
+
domains[normalizeYAxisId(axisId)] = niceYDomain(resolveDomain(dataKeys));
|
|
57
|
+
}
|
|
58
|
+
if (!domains.left) {
|
|
59
|
+
domains.left = niceYDomain([0, 100]);
|
|
60
|
+
}
|
|
61
|
+
return domains;
|
|
62
|
+
}
|
|
63
|
+
/** Merge domain maps, normalizing axis ids to strings. */
|
|
64
|
+
export function mergeYDomainRecords(...records) {
|
|
65
|
+
const merged = {};
|
|
66
|
+
for (const record of records) {
|
|
67
|
+
for (const [axisId, domain] of Object.entries(record)) {
|
|
68
|
+
merged[normalizeYAxisId(axisId)] = domain;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return merged;
|
|
72
|
+
}
|
|
73
|
+
export function domainsEqual(left, right) {
|
|
74
|
+
const leftKeys = Object.keys(left);
|
|
75
|
+
const rightKeys = Object.keys(right);
|
|
76
|
+
if (leftKeys.length !== rightKeys.length) {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
for (const axisId of leftKeys) {
|
|
80
|
+
const from = left[axisId];
|
|
81
|
+
const to = right[axisId];
|
|
82
|
+
if (!(from && to) || from[0] !== to[0] || from[1] !== to[1]) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=y-domain-utils.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
2
|
+
export declare const Accordion: import("react").ForwardRefExoticComponent<(AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps) & import("react").RefAttributes<HTMLDivElement>>;
|
|
3
|
+
export declare const AccordionItem: import("react").ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export declare const AccordionTrigger: import("react").ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
export declare const AccordionContent: import("react").ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
+
//# sourceMappingURL=accordion.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
4
|
+
import { ChevronDown } from "lucide-react";
|
|
5
|
+
import { forwardRef } from "react";
|
|
6
|
+
import { cn } from "../lib/cn.js";
|
|
7
|
+
export const Accordion = AccordionPrimitive.Root;
|
|
8
|
+
export const AccordionItem = forwardRef(({ className, ...props }, ref) => {
|
|
9
|
+
return (_jsx(AccordionPrimitive.Item, { ref: ref, "data-slot": "accordion-item", className: cn("border-b border-border", className), ...props }));
|
|
10
|
+
});
|
|
11
|
+
AccordionItem.displayName = "AccordionItem";
|
|
12
|
+
export const AccordionTrigger = forwardRef(({ className, children, ...props }, ref) => {
|
|
13
|
+
return (_jsx(AccordionPrimitive.Header, { className: "flex", children: _jsxs(AccordionPrimitive.Trigger, { ref: ref, "data-slot": "accordion-trigger", className: cn("flex flex-1 items-center justify-between gap-4 py-4 text-sm font-medium text-fg outline-none transition-all hover:underline focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset rounded-md disabled:opacity-50 [&[data-state=open]>svg]:rotate-180", className), ...props, children: [children, _jsx(ChevronDown, { className: "size-4 shrink-0 text-fg-tertiary transition-transform duration-200" })] }) }));
|
|
14
|
+
});
|
|
15
|
+
AccordionTrigger.displayName = "AccordionTrigger";
|
|
16
|
+
export const AccordionContent = forwardRef(({ className, children, ...props }, ref) => {
|
|
17
|
+
return (_jsx(AccordionPrimitive.Content, { ref: ref, "data-slot": "accordion-content", className: cn("overflow-hidden text-sm text-fg-secondary data-[state=open]:animate-[cronus-accordion-down_220ms_var(--ease-out-quart)] data-[state=closed]:animate-[cronus-accordion-up_180ms_var(--ease-out-quart)]", className), ...props, children: _jsx("div", { className: "pb-4 pt-0", children: children }) }));
|
|
18
|
+
});
|
|
19
|
+
AccordionContent.displayName = "AccordionContent";
|
|
20
|
+
//# sourceMappingURL=accordion.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
2
|
+
import { type HTMLAttributes } from "react";
|
|
3
|
+
export declare const AlertDialog: import("react").FC<AlertDialogPrimitive.AlertDialogProps>;
|
|
4
|
+
export declare const AlertDialogTrigger: import("react").ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
export declare const AlertDialogContent: import("react").ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export declare const AlertDialogHeader: {
|
|
7
|
+
({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const AlertDialogFooter: {
|
|
11
|
+
({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const AlertDialogTitle: import("react").ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogTitleProps & import("react").RefAttributes<HTMLHeadingElement>, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
15
|
+
export declare const AlertDialogDescription: import("react").ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogDescriptionProps & import("react").RefAttributes<HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
16
|
+
export declare const AlertDialogAction: import("react").ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogActionProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
17
|
+
export declare const AlertDialogCancel: import("react").ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogCancelProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
18
|
+
//# sourceMappingURL=alert-dialog.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
4
|
+
import { forwardRef, } from "react";
|
|
5
|
+
import { cn } from "../lib/cn.js";
|
|
6
|
+
import { buttonVariants } from "./button.js";
|
|
7
|
+
export const AlertDialog = AlertDialogPrimitive.Root;
|
|
8
|
+
export const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
9
|
+
const AlertDialogOverlay = forwardRef(({ className, ...props }, ref) => {
|
|
10
|
+
return (_jsx(AlertDialogPrimitive.Overlay, { ref: ref, "data-slot": "alert-dialog-overlay", className: cn("fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-[cronus-overlay-in_200ms_var(--ease-out-quart)] data-[state=closed]:animate-[cronus-overlay-out_160ms_var(--ease-out-quart)]", className), ...props }));
|
|
11
|
+
});
|
|
12
|
+
AlertDialogOverlay.displayName = "AlertDialogOverlay";
|
|
13
|
+
export const AlertDialogContent = forwardRef(({ className, ...props }, ref) => {
|
|
14
|
+
return (_jsxs(AlertDialogPrimitive.Portal, { children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Content, { ref: ref, "data-slot": "alert-dialog-content", className: cn("fixed inset-0 z-50 m-auto grid h-fit w-full max-w-lg gap-4 rounded-xl border border-border bg-surface-floating p-6 text-fg shadow-lg data-[state=open]:animate-[cronus-pop-in_200ms_var(--ease-out-quart)_both] data-[state=closed]:animate-[cronus-pop-out_160ms_var(--ease-out-quart)_both]", className), ...props })] }));
|
|
15
|
+
});
|
|
16
|
+
AlertDialogContent.displayName = "AlertDialogContent";
|
|
17
|
+
export const AlertDialogHeader = ({ className, ...props }) => {
|
|
18
|
+
return (_jsx("div", { "data-slot": "alert-dialog-header", className: cn("flex flex-col gap-1.5 text-center sm:text-left", className), ...props }));
|
|
19
|
+
};
|
|
20
|
+
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
21
|
+
export const AlertDialogFooter = ({ className, ...props }) => {
|
|
22
|
+
return (_jsx("div", { "data-slot": "alert-dialog-footer", className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className), ...props }));
|
|
23
|
+
};
|
|
24
|
+
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
25
|
+
export const AlertDialogTitle = forwardRef(({ className, ...props }, ref) => {
|
|
26
|
+
return (_jsx(AlertDialogPrimitive.Title, { ref: ref, "data-slot": "alert-dialog-title", className: cn("font-display text-lg font-semibold text-fg", className), ...props }));
|
|
27
|
+
});
|
|
28
|
+
AlertDialogTitle.displayName = "AlertDialogTitle";
|
|
29
|
+
export const AlertDialogDescription = forwardRef(({ className, ...props }, ref) => {
|
|
30
|
+
return (_jsx(AlertDialogPrimitive.Description, { ref: ref, "data-slot": "alert-dialog-description", className: cn("text-sm text-fg-secondary", className), ...props }));
|
|
31
|
+
});
|
|
32
|
+
AlertDialogDescription.displayName = "AlertDialogDescription";
|
|
33
|
+
export const AlertDialogAction = forwardRef(({ className, ...props }, ref) => {
|
|
34
|
+
return (_jsx(AlertDialogPrimitive.Action, { ref: ref, "data-slot": "alert-dialog-action", className: cn(buttonVariants({ variant: "primary" }), className), ...props }));
|
|
35
|
+
});
|
|
36
|
+
AlertDialogAction.displayName = "AlertDialogAction";
|
|
37
|
+
export const AlertDialogCancel = forwardRef(({ className, ...props }, ref) => {
|
|
38
|
+
return (_jsx(AlertDialogPrimitive.Cancel, { ref: ref, "data-slot": "alert-dialog-cancel", className: cn(buttonVariants({ variant: "outline" }), className), ...props }));
|
|
39
|
+
});
|
|
40
|
+
AlertDialogCancel.displayName = "AlertDialogCancel";
|
|
41
|
+
//# sourceMappingURL=alert-dialog.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import { type HTMLAttributes } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Inline callout / banner. NOT the modal alert-dialog.
|
|
5
|
+
*
|
|
6
|
+
* Layout follows the shadcn pattern: a CSS grid where an optional leading
|
|
7
|
+
* icon occupies the first column and the title/description stack in the
|
|
8
|
+
* second. When no icon is rendered the content spans the full width.
|
|
9
|
+
*
|
|
10
|
+
* Colour strategy: the body text stays on `fg`/`fg-secondary` (which already
|
|
11
|
+
* meet AA against every surface) while the semantic token only tints the
|
|
12
|
+
* surface wash, the border and the icon. This keeps contrast safe across
|
|
13
|
+
* themes/modes without relying on low-chroma coloured body text.
|
|
14
|
+
*/
|
|
15
|
+
declare const alertVariants: (props?: ({
|
|
16
|
+
variant?: "default" | "info" | "success" | "warning" | "destructive" | null | undefined;
|
|
17
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
18
|
+
export interface AlertProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof alertVariants> {
|
|
19
|
+
}
|
|
20
|
+
export declare const Alert: import("react").ForwardRefExoticComponent<AlertProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
21
|
+
export declare const AlertTitle: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
22
|
+
export declare const AlertDescription: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
23
|
+
export { alertVariants };
|
|
24
|
+
//# sourceMappingURL=alert.d.ts.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { cn } from "../lib/cn.js";
|
|
5
|
+
/**
|
|
6
|
+
* Inline callout / banner. NOT the modal alert-dialog.
|
|
7
|
+
*
|
|
8
|
+
* Layout follows the shadcn pattern: a CSS grid where an optional leading
|
|
9
|
+
* icon occupies the first column and the title/description stack in the
|
|
10
|
+
* second. When no icon is rendered the content spans the full width.
|
|
11
|
+
*
|
|
12
|
+
* Colour strategy: the body text stays on `fg`/`fg-secondary` (which already
|
|
13
|
+
* meet AA against every surface) while the semantic token only tints the
|
|
14
|
+
* surface wash, the border and the icon. This keeps contrast safe across
|
|
15
|
+
* themes/modes without relying on low-chroma coloured body text.
|
|
16
|
+
*/
|
|
17
|
+
const alertVariants = cva("relative grid w-full grid-cols-[0_1fr] items-start gap-y-1 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[--spacing(6)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-5 [&>svg]:shrink-0 [&>svg]:translate-y-0.5 [&>svg]:text-current", {
|
|
18
|
+
variants: {
|
|
19
|
+
variant: {
|
|
20
|
+
default: "bg-surface-overlay text-fg border-border [&>svg]:text-fg-secondary",
|
|
21
|
+
info: "bg-info/10 text-fg border-info/30 [&>svg]:text-info",
|
|
22
|
+
success: "bg-success/10 text-fg border-success/30 [&>svg]:text-success",
|
|
23
|
+
warning: "bg-warning/10 text-fg border-warning/30 [&>svg]:text-warning",
|
|
24
|
+
// `destructive` keeps the conventional shadcn name but maps to the
|
|
25
|
+
// Cronus `error` token (mirrors button.tsx's destructive variant).
|
|
26
|
+
destructive: "bg-error/10 text-fg border-error/30 [&>svg]:text-error",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: { variant: "default" },
|
|
30
|
+
});
|
|
31
|
+
export const Alert = forwardRef(({ className, variant, role, ...props }, ref) => {
|
|
32
|
+
// Urgent variants announce assertively; informational ones are polite.
|
|
33
|
+
const resolvedRole = role ?? (variant === "destructive" ? "alert" : "status");
|
|
34
|
+
return (_jsx("div", { ref: ref, "data-slot": "alert", role: resolvedRole, className: cn(alertVariants({ variant }), className), ...props }));
|
|
35
|
+
});
|
|
36
|
+
Alert.displayName = "Alert";
|
|
37
|
+
export const AlertTitle = forwardRef(({ className, ...props }, ref) => {
|
|
38
|
+
return (_jsx("div", { ref: ref, "data-slot": "alert-title", className: cn("col-start-2 line-clamp-1 min-h-4 font-medium text-fg", className), ...props }));
|
|
39
|
+
});
|
|
40
|
+
AlertTitle.displayName = "AlertTitle";
|
|
41
|
+
export const AlertDescription = forwardRef(({ className, ...props }, ref) => {
|
|
42
|
+
return (_jsx("div", { ref: ref, "data-slot": "alert-description", className: cn("col-start-2 grid justify-items-start gap-1 text-sm text-fg-secondary [&_p]:leading-relaxed", className), ...props }));
|
|
43
|
+
});
|
|
44
|
+
AlertDescription.displayName = "AlertDescription";
|
|
45
|
+
export { alertVariants };
|
|
46
|
+
//# sourceMappingURL=alert.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ButtonProps } from "./button.js";
|
|
2
|
+
export interface AnimatedButtonProps extends ButtonProps {
|
|
3
|
+
}
|
|
4
|
+
export declare const AnimatedButton: import("react").ForwardRefExoticComponent<AnimatedButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
//# sourceMappingURL=animated-button.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { motion } from "motion/react";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
import { cn } from "../lib/cn.js";
|
|
6
|
+
import { buttonVariants } from "./button.js";
|
|
7
|
+
import { springSnappy } from "./motion-presets.js";
|
|
8
|
+
export const AnimatedButton = forwardRef(({ className, variant, size, type,
|
|
9
|
+
// drop asChild — not supported here
|
|
10
|
+
asChild: _asChild,
|
|
11
|
+
// omit handlers that clash with motion's prop signatures
|
|
12
|
+
onDrag, onDragStart, onDragEnd, onAnimationStart, ...props }, ref) => {
|
|
13
|
+
return (_jsx(motion.button, { ref: ref, "data-slot": "animated-button", type: type ?? "button", whileHover: { y: -1 }, whileTap: { scale: 0.97 }, transition: springSnappy, className: cn(buttonVariants({ variant, size }), className), ...props }));
|
|
14
|
+
});
|
|
15
|
+
AnimatedButton.displayName = "AnimatedButton";
|
|
16
|
+
//# sourceMappingURL=animated-button.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type HTMLAttributes, type Ref } from "react";
|
|
2
|
+
export interface AnimatedListProps extends HTMLAttributes<HTMLUListElement> {
|
|
3
|
+
ref?: Ref<HTMLUListElement>;
|
|
4
|
+
/**
|
|
5
|
+
* Seconds between consecutive item reveals.
|
|
6
|
+
* @default 0.08
|
|
7
|
+
*/
|
|
8
|
+
stagger?: number;
|
|
9
|
+
/**
|
|
10
|
+
* How `prefers-reduced-motion` is honoured. Defaults to `"user"` (items
|
|
11
|
+
* appear without the stagger). `"never"` always animates.
|
|
12
|
+
* @default "user"
|
|
13
|
+
*/
|
|
14
|
+
reducedMotion?: "user" | "always" | "never";
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Staggers its children in with a short rise + fade. Renders a `<ul>` and
|
|
18
|
+
* wraps each child in an `<li>` — pass the item body (not an `<li>`), with a
|
|
19
|
+
* stable `key`. Reduced-motion visitors get the items fully visible on first
|
|
20
|
+
* paint.
|
|
21
|
+
*/
|
|
22
|
+
export declare function AnimatedList({ ref, className, children, stagger, reducedMotion, ...props }: AnimatedListProps): import("react").JSX.Element;
|
|
23
|
+
export declare namespace AnimatedList {
|
|
24
|
+
var displayName: string;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=animated-list.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
4
|
+
import { Children, isValidElement } from "react";
|
|
5
|
+
import { cn } from "../lib/cn.js";
|
|
6
|
+
function finiteOr(value, fallback) {
|
|
7
|
+
return Number.isFinite(value) ? value : fallback;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Staggers its children in with a short rise + fade. Renders a `<ul>` and
|
|
11
|
+
* wraps each child in an `<li>` — pass the item body (not an `<li>`), with a
|
|
12
|
+
* stable `key`. Reduced-motion visitors get the items fully visible on first
|
|
13
|
+
* paint.
|
|
14
|
+
*/
|
|
15
|
+
export function AnimatedList({ ref, className, children, stagger = 0.08, reducedMotion = "user", ...props }) {
|
|
16
|
+
const systemReduced = useReducedMotion();
|
|
17
|
+
const reduce = reducedMotion === "never" ? false : reducedMotion === "always" ? true : !!systemReduced;
|
|
18
|
+
const delay = Math.max(0, finiteOr(stagger, 0.08));
|
|
19
|
+
const items = Children.toArray(children).filter(isValidElement);
|
|
20
|
+
return (_jsx("ul", { ref: ref, "data-slot": "animated-list", className: cn("flex flex-col gap-2", className), ...props, children: _jsx(AnimatePresence, { initial: !reduce, children: items.map((child, index) => (_jsx(motion.li, { "data-slot": "animated-list-item", initial: reduce ? false : { opacity: 0, y: 8 }, animate: { opacity: 1, y: 0 }, exit: reduce ? undefined : { opacity: 0, y: -8 }, transition: reduce
|
|
21
|
+
? { duration: 0 }
|
|
22
|
+
: { delay: index * delay, duration: 0.35, ease: [0.22, 1, 0.36, 1] }, children: child }, child.key ?? index))) }) }));
|
|
23
|
+
}
|
|
24
|
+
AnimatedList.displayName = "AnimatedList";
|
|
25
|
+
//# sourceMappingURL=animated-list.js.map
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { motion } from "motion/react";
|
|
2
|
+
/** Subset of motion's spring transition we expose; `duration` is in seconds. */
|
|
3
|
+
export interface AnimatedNumberSpring {
|
|
4
|
+
bounce?: number;
|
|
5
|
+
stiffness?: number;
|
|
6
|
+
damping?: number;
|
|
7
|
+
mass?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface AnimatedNumberProps extends Omit<React.ComponentPropsWithoutRef<typeof motion.span>, "children"> {
|
|
10
|
+
/** Target value. Whenever it changes, the number tweens from its current displayed value to here. */
|
|
11
|
+
value: number;
|
|
12
|
+
/**
|
|
13
|
+
* Custom formatter for the displayed string. When omitted, the value is
|
|
14
|
+
* formatted with `Intl.NumberFormat(locale, formatOptions)`.
|
|
15
|
+
*/
|
|
16
|
+
format?: (n: number) => string;
|
|
17
|
+
/** Locale passed to the default `Intl.NumberFormat` formatter (ignored if `format` is set). */
|
|
18
|
+
locale?: string;
|
|
19
|
+
/** Options passed to the default `Intl.NumberFormat` formatter (ignored if `format` is set). */
|
|
20
|
+
formatOptions?: Intl.NumberFormatOptions;
|
|
21
|
+
/** Tween length in seconds. Defaults to ~0.8s; overrides the spring's natural duration. */
|
|
22
|
+
duration?: number;
|
|
23
|
+
/** Override the settle spring (advanced — defaults to the Cronus count spring). */
|
|
24
|
+
spring?: AnimatedNumberSpring;
|
|
25
|
+
/**
|
|
26
|
+
* How `prefers-reduced-motion` is honoured. Defaults to `"user"` (snap for
|
|
27
|
+
* users who opt out). Pass `"never"` to always animate the count — e.g. a
|
|
28
|
+
* showcase that must demonstrate it — or `"always"` to force the snap.
|
|
29
|
+
*/
|
|
30
|
+
reducedMotion?: "user" | "always" | "never";
|
|
31
|
+
/**
|
|
32
|
+
* Announce the **settled** value to screen readers via a visually-hidden
|
|
33
|
+
* `aria-live="polite"` sibling. Defaults to `false`. Only the final value
|
|
34
|
+
* (once the tween completes / snaps) is announced — never the ~97
|
|
35
|
+
* interpolated frames — so opting in stays quiet.
|
|
36
|
+
*/
|
|
37
|
+
announce?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Smoothly tweens (counts up/down) from its previously displayed value to the
|
|
41
|
+
* new `value` whenever `value` changes — ideal for dashboards, balances,
|
|
42
|
+
* pricing and KPIs. It pairs naturally with `Metric` / `MetricValue`.
|
|
43
|
+
*
|
|
44
|
+
* How it works: an internal motion value is `animate`d toward each new target
|
|
45
|
+
* with a spring (or a fixed `duration`). On every frame the latest number is
|
|
46
|
+
* formatted (custom `format`, else `Intl.NumberFormat`) and written straight to
|
|
47
|
+
* the span's `textContent`, so updates never trigger React re-renders. The span
|
|
48
|
+
* uses `tabular-nums` so digit width stays fixed and the value does not jitter
|
|
49
|
+
* as it climbs.
|
|
50
|
+
*
|
|
51
|
+
* Color is inherited — the component never hardcodes one, so consumers control
|
|
52
|
+
* it via `className` (e.g. `text-fg`, `text-success`) or a parent.
|
|
53
|
+
*
|
|
54
|
+
* SSR-safe & no flash: the first render already shows the formatted initial
|
|
55
|
+
* value (never `0` or `NaN`), and the component starts *at* that value — it only
|
|
56
|
+
* animates on subsequent `value` changes, not on mount.
|
|
57
|
+
*
|
|
58
|
+
* Reduced motion: when `prefers-reduced-motion` is set, the number snaps
|
|
59
|
+
* directly to each new `value` (still fully formatted) with no tween.
|
|
60
|
+
*
|
|
61
|
+
* Accessibility: the high-frequency live text is not announced by default to
|
|
62
|
+
* avoid noisy screen-reader chatter (it would read ~97 interpolated frames).
|
|
63
|
+
* Pass `announce` to opt into a single, polite announcement of the *settled*
|
|
64
|
+
* value via a dedicated visually-hidden `aria-live` sibling.
|
|
65
|
+
*/
|
|
66
|
+
export declare const AnimatedNumber: import("react").ForwardRefExoticComponent<AnimatedNumberProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
67
|
+
//# sourceMappingURL=animated-number.d.ts.map
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { animate, motion, useMotionValue, useReducedMotion, } from "motion/react";
|
|
4
|
+
import { forwardRef, useEffect, useLayoutEffect, useMemo, useRef } from "react";
|
|
5
|
+
import { cn } from "../lib/cn.js";
|
|
6
|
+
/**
|
|
7
|
+
* Spring used to tween between values. A gentle bounce makes the count read as
|
|
8
|
+
* a physical settle rather than a linear ramp. Overridable via the `spring`
|
|
9
|
+
* prop; when a `duration` is given it takes precedence (spring stiffness/damping
|
|
10
|
+
* are ignored and motion derives them to hit the target duration).
|
|
11
|
+
*/
|
|
12
|
+
const ANIMATED_NUMBER_SPRING = {
|
|
13
|
+
type: "spring",
|
|
14
|
+
bounce: 0.18,
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Smoothly tweens (counts up/down) from its previously displayed value to the
|
|
18
|
+
* new `value` whenever `value` changes — ideal for dashboards, balances,
|
|
19
|
+
* pricing and KPIs. It pairs naturally with `Metric` / `MetricValue`.
|
|
20
|
+
*
|
|
21
|
+
* How it works: an internal motion value is `animate`d toward each new target
|
|
22
|
+
* with a spring (or a fixed `duration`). On every frame the latest number is
|
|
23
|
+
* formatted (custom `format`, else `Intl.NumberFormat`) and written straight to
|
|
24
|
+
* the span's `textContent`, so updates never trigger React re-renders. The span
|
|
25
|
+
* uses `tabular-nums` so digit width stays fixed and the value does not jitter
|
|
26
|
+
* as it climbs.
|
|
27
|
+
*
|
|
28
|
+
* Color is inherited — the component never hardcodes one, so consumers control
|
|
29
|
+
* it via `className` (e.g. `text-fg`, `text-success`) or a parent.
|
|
30
|
+
*
|
|
31
|
+
* SSR-safe & no flash: the first render already shows the formatted initial
|
|
32
|
+
* value (never `0` or `NaN`), and the component starts *at* that value — it only
|
|
33
|
+
* animates on subsequent `value` changes, not on mount.
|
|
34
|
+
*
|
|
35
|
+
* Reduced motion: when `prefers-reduced-motion` is set, the number snaps
|
|
36
|
+
* directly to each new `value` (still fully formatted) with no tween.
|
|
37
|
+
*
|
|
38
|
+
* Accessibility: the high-frequency live text is not announced by default to
|
|
39
|
+
* avoid noisy screen-reader chatter (it would read ~97 interpolated frames).
|
|
40
|
+
* Pass `announce` to opt into a single, polite announcement of the *settled*
|
|
41
|
+
* value via a dedicated visually-hidden `aria-live` sibling.
|
|
42
|
+
*/
|
|
43
|
+
export const AnimatedNumber = forwardRef(({ value, format, locale, formatOptions, duration = 0.8, spring, reducedMotion = "user", announce = false, className, style, ...props }, forwardedRef) => {
|
|
44
|
+
// Sanitize once: a non-finite/undefined `value` would (a) make
|
|
45
|
+
// `motionValue.get() !== value` forever true (NaN !== NaN) — an
|
|
46
|
+
// unsettleable spring that re-fires every frame — and (b) render literal
|
|
47
|
+
// "NaN"/"∞", breaking the "never 0 or NaN" promise above.
|
|
48
|
+
const safe = Number.isFinite(value) ? value : 0;
|
|
49
|
+
const systemReducedMotion = useReducedMotion();
|
|
50
|
+
const shouldReduceMotion = reducedMotion === "never" ? false : reducedMotion === "always" ? true : systemReducedMotion;
|
|
51
|
+
const motionValue = useMotionValue(safe);
|
|
52
|
+
const spanRef = useRef(null);
|
|
53
|
+
// The animated digits live in their own node so the per-frame textContent
|
|
54
|
+
// writes never wipe the sibling `announce` region.
|
|
55
|
+
const valueRef = useRef(null);
|
|
56
|
+
const announceRef = useRef(null);
|
|
57
|
+
// Format helper. The default Intl formatter is created lazily per call so
|
|
58
|
+
// that prop changes (locale/options) are always reflected without effects.
|
|
59
|
+
const formatRef = useRef(() => "");
|
|
60
|
+
formatRef.current = (n) => {
|
|
61
|
+
if (format)
|
|
62
|
+
return format(n);
|
|
63
|
+
return new Intl.NumberFormat(locale, formatOptions).format(n);
|
|
64
|
+
};
|
|
65
|
+
const setRefs = (node) => {
|
|
66
|
+
spanRef.current = node;
|
|
67
|
+
if (typeof forwardedRef === "function") {
|
|
68
|
+
forwardedRef(node);
|
|
69
|
+
}
|
|
70
|
+
else if (forwardedRef) {
|
|
71
|
+
forwardedRef.current = node;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
// Memoize the transition on PRIMITIVE fields so an inline `spring={{...}}`
|
|
75
|
+
// (a fresh object every parent render) does not re-run the animate effect,
|
|
76
|
+
// stop()+restart the tween and reset its clock so it never settles. Keying
|
|
77
|
+
// on the `spring` object identity is the exact churn this memo exists to
|
|
78
|
+
// avoid, hence the suppression below.
|
|
79
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: intentional — keyed on spring's primitive fields, not its (unstable) object identity.
|
|
80
|
+
const transition = useMemo(() => ({ ...ANIMATED_NUMBER_SPRING, ...spring, duration }), [spring?.bounce, spring?.stiffness, spring?.damping, spring?.mass, duration]);
|
|
81
|
+
// Re-sync the React-committed text child to the LIVE motion value before
|
|
82
|
+
// paint. The JSX child renders the *target* every commit; when a formatting
|
|
83
|
+
// prop (locale/options) changes mid-tween React would win for one painted
|
|
84
|
+
// frame and flash the final value. Overwrite it with the in-flight value.
|
|
85
|
+
// No dependency array on purpose: it must run after every commit.
|
|
86
|
+
useLayoutEffect(() => {
|
|
87
|
+
if (valueRef.current) {
|
|
88
|
+
valueRef.current.textContent = formatRef.current(motionValue.get());
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
// Write the formatted current value straight to the DOM on every frame —
|
|
92
|
+
// no React re-render per tick.
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
const write = (n) => {
|
|
95
|
+
if (valueRef.current) {
|
|
96
|
+
valueRef.current.textContent = formatRef.current(n);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
write(motionValue.get());
|
|
100
|
+
const unsubscribe = motionValue.on("change", write);
|
|
101
|
+
return unsubscribe;
|
|
102
|
+
}, [motionValue]);
|
|
103
|
+
// Animate toward each new target. On mount this is a no-op (motionValue
|
|
104
|
+
// already equals the initial value). Reduced motion snaps with no tween.
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
if (shouldReduceMotion) {
|
|
107
|
+
motionValue.set(safe);
|
|
108
|
+
if (announceRef.current) {
|
|
109
|
+
announceRef.current.textContent = formatRef.current(safe);
|
|
110
|
+
}
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
let controls;
|
|
114
|
+
if (motionValue.get() !== safe) {
|
|
115
|
+
controls = animate(motionValue, safe, transition);
|
|
116
|
+
// Announce only the settled value once the tween completes. Guard so a
|
|
117
|
+
// stop()/unmount rejection does not write a stale value.
|
|
118
|
+
controls
|
|
119
|
+
.then(() => {
|
|
120
|
+
if (announceRef.current) {
|
|
121
|
+
announceRef.current.textContent = formatRef.current(safe);
|
|
122
|
+
}
|
|
123
|
+
})
|
|
124
|
+
.catch(() => { });
|
|
125
|
+
}
|
|
126
|
+
return () => controls?.stop();
|
|
127
|
+
}, [safe, transition, shouldReduceMotion, motionValue]);
|
|
128
|
+
return (_jsxs(motion.span, { ref: setRefs, "data-slot": "animated-number", className: cn("tabular-nums", className), style: style, ...props, children: [_jsx("span", { ref: valueRef, children: formatRef.current(safe) }), announce ? (_jsx("span", { ref: announceRef, className: "sr-only", "aria-live": "polite", role: "status" })) : null] }));
|
|
129
|
+
});
|
|
130
|
+
AnimatedNumber.displayName = "AnimatedNumber";
|
|
131
|
+
//# sourceMappingURL=animated-number.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
import { type SidebarProviderProps } from "./sidebar.js";
|
|
3
|
+
export interface AppShellProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/**
|
|
5
|
+
* The sidebar element. Pass a `<Sidebar>` (and its trigger/menus). Rendered
|
|
6
|
+
* as the first child of the provider so it sits beside the content region.
|
|
7
|
+
*/
|
|
8
|
+
sidebar: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Optional topbar content rendered inside a sticky `<header role="banner">`
|
|
11
|
+
* at the top of the content region. Omit for a header-less shell.
|
|
12
|
+
*/
|
|
13
|
+
header?: ReactNode;
|
|
14
|
+
/** Props forwarded to the underlying `SidebarProvider`. */
|
|
15
|
+
providerProps?: Omit<SidebarProviderProps, "children">;
|
|
16
|
+
/**
|
|
17
|
+
* When `true`, wraps the content region in `SidebarInset` for the rounded,
|
|
18
|
+
* inset surface that pairs with `variant="inset" | "floating"` sidebars.
|
|
19
|
+
*/
|
|
20
|
+
inset?: boolean;
|
|
21
|
+
/** Extra classes for the content region wrapper. */
|
|
22
|
+
contentClassName?: string;
|
|
23
|
+
/** Extra classes for the sticky header. */
|
|
24
|
+
headerClassName?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const AppShell: import("react").ForwardRefExoticComponent<AppShellProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
27
|
+
//# sourceMappingURL=app-shell.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { cn } from "../lib/cn.js";
|
|
4
|
+
import { SidebarInset, SidebarProvider } from "./sidebar.js";
|
|
5
|
+
export const AppShell = forwardRef(({ sidebar, header, providerProps, inset = false, className, contentClassName, headerClassName, children, ...props }, ref) => {
|
|
6
|
+
const body = (_jsxs(_Fragment, { children: [header != null && (_jsx("header", { "data-slot": "app-shell-header",
|
|
7
|
+
// role="banner" is implicit for a top-level <header>; set explicitly
|
|
8
|
+
// because this header is nested inside layout wrappers.
|
|
9
|
+
className: cn("sticky top-0 z-30 flex h-14 shrink-0 items-center gap-2 border-b border-border bg-surface-base/80 px-4 backdrop-blur-sm", headerClassName), children: header })), _jsx("div", { "data-slot": "app-shell-body", className: cn("flex min-h-0 flex-1 flex-col", contentClassName), children: children })] }));
|
|
10
|
+
// Pull className out of both prop sources and merge them explicitly so the
|
|
11
|
+
// provider's className spread can't clobber the AppShell's className (the
|
|
12
|
+
// original `{...props} {...providerProps}` order dropped it). providerProps
|
|
13
|
+
// keeps precedence over the rest props for any other overlapping keys.
|
|
14
|
+
const { className: providerClassName, ...restProviderProps } = providerProps ?? {};
|
|
15
|
+
return (_jsxs(SidebarProvider, { ref: ref, ...props, ...restProviderProps, className: cn(className, providerClassName), children: [sidebar, inset ? (_jsx(SidebarInset, { "data-slot": "app-shell-content", children: body })) : (_jsx("div", { "data-slot": "app-shell-content", className: "relative flex min-h-svh min-w-0 flex-1 flex-col bg-surface-base", children: body }))] }));
|
|
16
|
+
});
|
|
17
|
+
AppShell.displayName = "AppShell";
|
|
18
|
+
//# sourceMappingURL=app-shell.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type HTMLAttributes } from "react";
|
|
2
|
+
import { type ChartSeries } from "./chart.js";
|
|
3
|
+
export interface AreaChartProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
data: Record<string, unknown>[];
|
|
5
|
+
/** Category / time field. @default "date" */
|
|
6
|
+
xKey?: string;
|
|
7
|
+
series: ChartSeries[];
|
|
8
|
+
formatValue?: (value: number, name: string) => string;
|
|
9
|
+
}
|
|
10
|
+
export declare function AreaChart({ data, xKey, series, formatValue, className, ...props }: AreaChartProps): import("react").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=area-chart.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useId } from "react";
|
|
4
|
+
import { Area, CartesianGrid, AreaChart as RechartsAreaChart, XAxis } from "recharts";
|
|
5
|
+
import { cn } from "../lib/cn.js";
|
|
6
|
+
import { ChartContainer, ChartCursor, ChartTooltip, ChartTooltipContent, chartSeriesConfig, } from "./chart.js";
|
|
7
|
+
export function AreaChart({ data, xKey = "date", series, formatValue, className, ...props }) {
|
|
8
|
+
const uid = useId().replace(/:/g, "");
|
|
9
|
+
const config = chartSeriesConfig(series);
|
|
10
|
+
return (_jsx("div", { "data-slot": "area-chart", className: cn("h-64 w-full", className), ...props, children: _jsx(ChartContainer, { config: config, className: "h-full w-full", children: _jsxs(RechartsAreaChart, { accessibilityLayer: true, data: data, margin: { left: 8, right: 8, top: 8 }, children: [_jsx("defs", { children: series.map((item) => (_jsxs("linearGradient", { id: `${uid}-${item.key}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [_jsx("stop", { offset: "0%", stopColor: `var(--color-${item.key})`, stopOpacity: 0.4 }), _jsx("stop", { offset: "100%", stopColor: `var(--color-${item.key})`, stopOpacity: 0 })] }, item.key))) }), _jsx(CartesianGrid, { vertical: false, strokeDasharray: "4 4" }), _jsx(XAxis, { dataKey: xKey, tickLine: false, axisLine: false, tickMargin: 12, minTickGap: 24 }), _jsx(ChartTooltip, { cursor: _jsx(ChartCursor, { labelKey: xKey }), content: _jsx(ChartTooltipContent, { formatValue: formatValue }) }), series.map((item) => (_jsx(Area, { type: "monotone", dataKey: item.key, stroke: `var(--color-${item.key})`, fill: `url(#${uid}-${item.key})`, strokeWidth: 2, dot: false, activeDot: { r: 4, strokeWidth: 0 }, animationDuration: 1100, animationEasing: "ease-out" }, item.key)))] }) }) }));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=area-chart.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type HTMLAttributes } from "react";
|
|
2
|
+
export interface AspectRatioProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* The desired width-to-height ratio, expressed as a number
|
|
5
|
+
* (e.g. `16 / 9`, `1`, `4 / 3`). Defaults to `16 / 9`.
|
|
6
|
+
*/
|
|
7
|
+
ratio?: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Constrains its content to a fixed width-to-height ratio using the native
|
|
11
|
+
* CSS `aspect-ratio` property (no JavaScript measurement, no dependency).
|
|
12
|
+
* The wrapper fills the available width; children should stretch to fill it
|
|
13
|
+
* (e.g. an `<img className="h-full w-full object-cover" />`).
|
|
14
|
+
*/
|
|
15
|
+
export declare const AspectRatio: import("react").ForwardRefExoticComponent<AspectRatioProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
16
|
+
//# sourceMappingURL=aspect-ratio.d.ts.map
|