@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,68 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
import { PopoverContent } from "./popover.js";
|
|
3
|
+
/** A single entry rendered inside the {@link NotificationCenter} inbox. */
|
|
4
|
+
export interface NotificationItem {
|
|
5
|
+
/** Stable identity; echoed back to `onNotificationClick`. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Primary line — the headline of the notification. */
|
|
8
|
+
title: ReactNode;
|
|
9
|
+
/** Optional secondary line with extra context. */
|
|
10
|
+
description?: ReactNode;
|
|
11
|
+
/** Pre-formatted relative/absolute time label (e.g. "2m ago"). */
|
|
12
|
+
timestamp?: string;
|
|
13
|
+
/** When falsy the row is treated as unread (dot + wash + counted). */
|
|
14
|
+
read?: boolean;
|
|
15
|
+
/** Leading glyph; ignored when `avatar` is provided. */
|
|
16
|
+
icon?: ReactNode;
|
|
17
|
+
/** Leading avatar; takes precedence over `icon`. */
|
|
18
|
+
avatar?: {
|
|
19
|
+
src?: string;
|
|
20
|
+
fallback: ReactNode;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export interface NotificationRowProps extends Omit<HTMLAttributes<HTMLButtonElement>, "id" | "title" | "onClick" | "onSelect"> {
|
|
24
|
+
notification: NotificationItem;
|
|
25
|
+
/** Fired with the notification id when the row is activated. */
|
|
26
|
+
onSelect?: (id: string) => void;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A single, fully-interactive notification row. Rendered as a real `<button>`
|
|
30
|
+
* so it is keyboard-focusable and announced as a control.
|
|
31
|
+
*/
|
|
32
|
+
export declare const NotificationRow: import("react").ForwardRefExoticComponent<NotificationRowProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
33
|
+
export interface NotificationListProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSelect"> {
|
|
34
|
+
notifications: readonly NotificationItem[];
|
|
35
|
+
/** Fired with the notification id when a row is activated. */
|
|
36
|
+
onSelect?: (id: string) => void;
|
|
37
|
+
/** Replaces the built-in "You're all caught up" empty state. */
|
|
38
|
+
emptyState?: ReactNode;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The scrollable list body. Renders an accessible `list`/`listitem` structure,
|
|
42
|
+
* or the empty state when there are no notifications.
|
|
43
|
+
*/
|
|
44
|
+
export declare const NotificationList: import("react").ForwardRefExoticComponent<NotificationListProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
45
|
+
export interface NotificationCenterProps extends Omit<ComponentPropsWithoutRef<typeof PopoverContent>, "onSelect" | "title"> {
|
|
46
|
+
/** Items to display in the inbox. */
|
|
47
|
+
notifications: readonly NotificationItem[];
|
|
48
|
+
/** Fired when the "Mark all read" affordance is activated. */
|
|
49
|
+
onMarkAllRead?: () => void;
|
|
50
|
+
/** Fired with the notification id when a row is activated. */
|
|
51
|
+
onNotificationClick?: (id: string) => void;
|
|
52
|
+
/** Header heading text. */
|
|
53
|
+
title?: ReactNode;
|
|
54
|
+
/** Custom empty-state content (defaults to "You're all caught up"). */
|
|
55
|
+
emptyState?: ReactNode;
|
|
56
|
+
/** Optional footer rendered below the list (e.g. a "View all" link). */
|
|
57
|
+
footer?: ReactNode;
|
|
58
|
+
/** Class names for the popover panel. */
|
|
59
|
+
className?: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* A bell-trigger notifications inbox built on {@link Popover}. The trigger is a
|
|
63
|
+
* ghost icon button with an unread-count badge; the panel renders a header with
|
|
64
|
+
* a "Mark all read" action, a scrollable list of notifications, an empty state,
|
|
65
|
+
* and an optional footer slot.
|
|
66
|
+
*/
|
|
67
|
+
export declare const NotificationCenter: import("react").ForwardRefExoticComponent<NotificationCenterProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
68
|
+
//# sourceMappingURL=notification-center.d.ts.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { Bell, BellOff } from "lucide-react";
|
|
4
|
+
import { forwardRef, } from "react";
|
|
5
|
+
import { cn } from "../lib/cn.js";
|
|
6
|
+
import { Avatar, AvatarFallback, AvatarImage } from "./avatar.js";
|
|
7
|
+
import { Badge } from "./badge.js";
|
|
8
|
+
import { Button } from "./button.js";
|
|
9
|
+
import { Popover, PopoverContent, PopoverTrigger } from "./popover.js";
|
|
10
|
+
import { ScrollArea } from "./scroll-area.js";
|
|
11
|
+
/** Number of unread (`read !== true`) items in the list. */
|
|
12
|
+
function countUnread(notifications) {
|
|
13
|
+
let unread = 0;
|
|
14
|
+
for (const item of notifications) {
|
|
15
|
+
if (!item.read)
|
|
16
|
+
unread += 1;
|
|
17
|
+
}
|
|
18
|
+
return unread;
|
|
19
|
+
}
|
|
20
|
+
/** Clamp the unread count into the trigger badge's "9+" display label. */
|
|
21
|
+
function formatUnread(count) {
|
|
22
|
+
return count > 9 ? "9+" : String(count);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A single, fully-interactive notification row. Rendered as a real `<button>`
|
|
26
|
+
* so it is keyboard-focusable and announced as a control.
|
|
27
|
+
*/
|
|
28
|
+
export const NotificationRow = forwardRef(({ className, notification, onSelect, ...props }, ref) => {
|
|
29
|
+
const { id, title, description, timestamp, read, icon, avatar } = notification;
|
|
30
|
+
return (_jsxs("button", { ref: ref, type: "button", "data-slot": "notification-row", "data-unread": read ? undefined : "", onClick: () => onSelect?.(id), className: cn("flex w-full items-start gap-3 rounded-md px-2 py-2.5 text-left outline-none transition-colors hover:bg-surface-overlay focus-visible:bg-surface-overlay focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset", !read && "bg-surface-overlay/40", className), ...props, children: [avatar ? (_jsxs(Avatar, { className: "size-9", children: [avatar.src ? _jsx(AvatarImage, { src: avatar.src, alt: "" }) : null, _jsx(AvatarFallback, { children: avatar.fallback })] })) : icon ? (_jsx("span", { "data-slot": "notification-icon", "aria-hidden": "true", className: "flex size-9 shrink-0 items-center justify-center rounded-full bg-surface-overlay text-fg-secondary [&_svg]:size-4", children: icon })) : null, _jsxs("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [_jsxs("span", { className: "flex min-w-0 items-start gap-2", children: [_jsx("span", { className: "min-w-0 flex-1 break-words text-sm font-medium text-fg", children: title }), read ? null : (_jsx("span", { "data-slot": "notification-unread-dot", "aria-hidden": "true", className: "mt-1.5 size-2 shrink-0 rounded-full bg-primary" }))] }), description ? (_jsx("span", { className: "min-w-0 break-words text-sm text-fg-secondary", children: description })) : null, timestamp ? _jsx("span", { className: "text-xs text-fg-tertiary", children: timestamp }) : null] })] }));
|
|
31
|
+
});
|
|
32
|
+
NotificationRow.displayName = "NotificationRow";
|
|
33
|
+
/**
|
|
34
|
+
* The scrollable list body. Renders an accessible `list`/`listitem` structure,
|
|
35
|
+
* or the empty state when there are no notifications.
|
|
36
|
+
*/
|
|
37
|
+
export const NotificationList = forwardRef(({ className, notifications, onSelect, emptyState, ...props }, ref) => {
|
|
38
|
+
if (notifications.length === 0) {
|
|
39
|
+
return (_jsx("div", { ref: ref, "data-slot": "notification-empty", className: cn("flex flex-col items-center justify-center gap-2 px-4 py-10 text-center", className), ...props, children: emptyState ?? (_jsxs(_Fragment, { children: [_jsx(BellOff, { "aria-hidden": "true", className: "size-6 text-fg-muted" }), _jsx("p", { className: "text-sm text-fg-secondary", children: "You're all caught up" })] })) }));
|
|
40
|
+
}
|
|
41
|
+
return (_jsx("div", { ref: ref, "data-slot": "notification-list", className: cn(className), ...props, children: _jsx("ul", { className: "flex flex-col", children: notifications.map((notification) => (_jsx("li", { children: _jsx(NotificationRow, { notification: notification, onSelect: onSelect }) }, notification.id))) }) }));
|
|
42
|
+
});
|
|
43
|
+
NotificationList.displayName = "NotificationList";
|
|
44
|
+
/**
|
|
45
|
+
* A bell-trigger notifications inbox built on {@link Popover}. The trigger is a
|
|
46
|
+
* ghost icon button with an unread-count badge; the panel renders a header with
|
|
47
|
+
* a "Mark all read" action, a scrollable list of notifications, an empty state,
|
|
48
|
+
* and an optional footer slot.
|
|
49
|
+
*/
|
|
50
|
+
export const NotificationCenter = forwardRef(({ notifications, onMarkAllRead, onNotificationClick, title = "Notifications", emptyState, footer, align = "end", className, ...props }, ref) => {
|
|
51
|
+
const unreadCount = countUnread(notifications);
|
|
52
|
+
const hasUnread = unreadCount > 0;
|
|
53
|
+
const triggerLabel = unreadCount === 0 ? "Notifications" : `Notifications, ${unreadCount} unread`;
|
|
54
|
+
return (_jsxs(Popover, { children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs(Button, { type: "button", variant: "ghost", size: "icon", "aria-label": triggerLabel, "data-slot": "notification-trigger", className: "relative", children: [_jsx(Bell, { "aria-hidden": "true" }), hasUnread ? (_jsx(Badge, { "aria-hidden": "true", variant: "primary", "data-slot": "notification-badge", className: "-right-1 -top-1 pointer-events-none absolute flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[0.625rem] leading-none tabular-nums", children: formatUnread(unreadCount) })) : null] }) }), _jsxs(PopoverContent, { ref: ref, align: align, "aria-label": typeof title === "string" ? title : "Notifications", "data-slot": "notification-center", className: cn("w-80 p-0", className), ...props, children: [_jsxs("div", { className: "flex items-center justify-between gap-2 border-border border-b px-3 py-2.5", children: [_jsx("p", { className: "font-display font-semibold text-fg text-sm", children: title }), hasUnread && onMarkAllRead ? (_jsx(Button, { type: "button", variant: "link", size: "sm", onClick: onMarkAllRead, className: "h-auto px-0", children: "Mark all read" })) : null] }), _jsx(ScrollArea, { className: "max-h-80", children: _jsx("div", { className: "p-1", children: _jsx(NotificationList, { notifications: notifications, onSelect: onNotificationClick, emptyState: emptyState }) }) }), footer ? (_jsx("div", { "data-slot": "notification-footer", className: "border-border border-t px-3 py-2.5", children: footer })) : null] })] }));
|
|
55
|
+
});
|
|
56
|
+
NotificationCenter.displayName = "NotificationCenter";
|
|
57
|
+
//# sourceMappingURL=notification-center.js.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type FocusEvent } from "react";
|
|
2
|
+
export interface NumberInputProps {
|
|
3
|
+
/** Controlled value. Pair with `onValueChange`. Use `null` for empty. */
|
|
4
|
+
value?: number | null;
|
|
5
|
+
/** Initial value for uncontrolled usage. */
|
|
6
|
+
defaultValue?: number | null;
|
|
7
|
+
/** Called with the new value (or `null` when cleared) on every change. */
|
|
8
|
+
onValueChange?: (value: number | null) => void;
|
|
9
|
+
/** Minimum allowed value. The decrement stepper disables at this bound. */
|
|
10
|
+
min?: number;
|
|
11
|
+
/** Maximum allowed value. The increment stepper disables at this bound. */
|
|
12
|
+
max?: number;
|
|
13
|
+
/** Increment for steppers and Arrow keys. Defaults to `1`. */
|
|
14
|
+
step?: number;
|
|
15
|
+
/** Larger increment for PageUp / PageDown. Defaults to `step * 10`. */
|
|
16
|
+
largeStep?: number;
|
|
17
|
+
/** Number of decimal places to round and display the committed value to. */
|
|
18
|
+
precision?: number;
|
|
19
|
+
/** Custom formatter for the displayed value when not focused. */
|
|
20
|
+
format?: (value: number) => string;
|
|
21
|
+
/** Disables the input and both steppers. */
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/** Marks the field as invalid (forwarded to the underlying Input). */
|
|
24
|
+
invalid?: boolean;
|
|
25
|
+
/** Placeholder shown when the field is empty. */
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
/** Extra classes for the wrapper element. */
|
|
28
|
+
className?: string;
|
|
29
|
+
/** Extra classes for the underlying input. */
|
|
30
|
+
inputClassName?: string;
|
|
31
|
+
/** Accessible name for the spinbutton when there is no visible label. */
|
|
32
|
+
"aria-label"?: string;
|
|
33
|
+
/** ID of an element labelling the spinbutton. */
|
|
34
|
+
"aria-labelledby"?: string;
|
|
35
|
+
/** ID of an element describing the spinbutton. */
|
|
36
|
+
"aria-describedby"?: string;
|
|
37
|
+
/** Native id for the input. */
|
|
38
|
+
id?: string;
|
|
39
|
+
/** Native name for the input (form submission). */
|
|
40
|
+
name?: string;
|
|
41
|
+
/** Called when the input loses focus. */
|
|
42
|
+
onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
|
|
43
|
+
}
|
|
44
|
+
export declare const NumberInput: import("react").ForwardRefExoticComponent<NumberInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
45
|
+
//# sourceMappingURL=number-input.d.ts.map
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Minus, Plus } from "lucide-react";
|
|
4
|
+
import { forwardRef, useCallback, useEffect, useRef, useState, } from "react";
|
|
5
|
+
import { cn } from "../lib/cn.js";
|
|
6
|
+
import { Button } from "./button.js";
|
|
7
|
+
import { Input } from "./input.js";
|
|
8
|
+
/** Round to the configured precision, avoiding float drift (e.g. 0.1 + 0.2). */
|
|
9
|
+
function roundTo(value, precision) {
|
|
10
|
+
if (precision === undefined)
|
|
11
|
+
return value;
|
|
12
|
+
const factor = 10 ** precision;
|
|
13
|
+
return Math.round((value + Number.EPSILON) * factor) / factor;
|
|
14
|
+
}
|
|
15
|
+
function clamp(value, min, max) {
|
|
16
|
+
let next = value;
|
|
17
|
+
if (min !== undefined)
|
|
18
|
+
next = Math.max(next, min);
|
|
19
|
+
if (max !== undefined)
|
|
20
|
+
next = Math.min(next, max);
|
|
21
|
+
return next;
|
|
22
|
+
}
|
|
23
|
+
export const NumberInput = forwardRef(({ value: valueProp, defaultValue = null, onValueChange, min, max, step = 1, largeStep, precision, format, disabled = false, invalid = false, placeholder, className, inputClassName, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, id, name, onBlur, ...props }, ref) => {
|
|
24
|
+
const isControlled = valueProp !== undefined;
|
|
25
|
+
const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);
|
|
26
|
+
const value = isControlled ? valueProp : uncontrolledValue;
|
|
27
|
+
// Local text mirrors keystrokes so partial entries ("-", "1.") stay editable.
|
|
28
|
+
const [text, setText] = useState(() => value === null || value === undefined ? "" : String(value));
|
|
29
|
+
const [focused, setFocused] = useState(false);
|
|
30
|
+
// Re-sync the visible text when the value changes from outside (controlled
|
|
31
|
+
// updates, programmatic resets) without clobbering the user's in-progress
|
|
32
|
+
// typing while the field is focused. We track the last value we mirrored so
|
|
33
|
+
// our own commits don't trigger a redundant text rewrite.
|
|
34
|
+
const lastSyncedValue = useRef(value);
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (focused)
|
|
37
|
+
return;
|
|
38
|
+
if (value === lastSyncedValue.current)
|
|
39
|
+
return;
|
|
40
|
+
lastSyncedValue.current = value;
|
|
41
|
+
setText(value === null || value === undefined ? "" : String(value));
|
|
42
|
+
}, [value, focused]);
|
|
43
|
+
const pageStep = largeStep ?? step * 10;
|
|
44
|
+
const commit = useCallback((next) => {
|
|
45
|
+
if (!isControlled)
|
|
46
|
+
setUncontrolledValue(next);
|
|
47
|
+
onValueChange?.(next);
|
|
48
|
+
}, [isControlled, onValueChange]);
|
|
49
|
+
// Apply rounding + clamping, sync both the value and the visible text.
|
|
50
|
+
const commitNumber = useCallback((raw) => {
|
|
51
|
+
const next = clamp(roundTo(raw, precision), min, max);
|
|
52
|
+
setText(String(next));
|
|
53
|
+
commit(next);
|
|
54
|
+
return next;
|
|
55
|
+
}, [commit, precision, min, max]);
|
|
56
|
+
const applyStep = useCallback((delta) => {
|
|
57
|
+
const base = value ?? clamp(0, min, max);
|
|
58
|
+
commitNumber(base + delta);
|
|
59
|
+
}, [value, min, max, commitNumber]);
|
|
60
|
+
const handleChange = useCallback((event) => {
|
|
61
|
+
const raw = event.target.value;
|
|
62
|
+
setText(raw);
|
|
63
|
+
if (raw === "") {
|
|
64
|
+
// Clearing the field maps to null.
|
|
65
|
+
commit(null);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (raw === "-" || raw === "." || raw === "-.") {
|
|
69
|
+
// Partial input ("-", ".", "-.") isn't a number yet. Keep the visible
|
|
70
|
+
// text but don't re-commit the previous value on every keystroke — that
|
|
71
|
+
// would fight the user mid-type. We wait for a valid number (or blur).
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const parsed = Number(raw);
|
|
75
|
+
if (!Number.isNaN(parsed)) {
|
|
76
|
+
// Live updates use precision rounding but defer clamping to blur so the
|
|
77
|
+
// user can finish typing values that transiently exceed a bound.
|
|
78
|
+
commit(roundTo(parsed, precision));
|
|
79
|
+
}
|
|
80
|
+
}, [commit, precision]);
|
|
81
|
+
const handleBlur = useCallback((event) => {
|
|
82
|
+
setFocused(false);
|
|
83
|
+
if (text === "" || text === "-" || text === "." || text === "-.") {
|
|
84
|
+
setText("");
|
|
85
|
+
commit(null);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
const parsed = Number(text);
|
|
89
|
+
if (Number.isNaN(parsed)) {
|
|
90
|
+
// Reject unparseable residue, fall back to the last good value.
|
|
91
|
+
setText(value === null || value === undefined ? "" : String(value));
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
commitNumber(parsed);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
onBlur?.(event);
|
|
98
|
+
}, [text, value, commit, commitNumber, onBlur]);
|
|
99
|
+
const handleKeyDown = useCallback((event) => {
|
|
100
|
+
if (disabled)
|
|
101
|
+
return;
|
|
102
|
+
switch (event.key) {
|
|
103
|
+
case "ArrowUp":
|
|
104
|
+
event.preventDefault();
|
|
105
|
+
applyStep(step);
|
|
106
|
+
break;
|
|
107
|
+
case "ArrowDown":
|
|
108
|
+
event.preventDefault();
|
|
109
|
+
applyStep(-step);
|
|
110
|
+
break;
|
|
111
|
+
case "PageUp":
|
|
112
|
+
event.preventDefault();
|
|
113
|
+
applyStep(pageStep);
|
|
114
|
+
break;
|
|
115
|
+
case "PageDown":
|
|
116
|
+
event.preventDefault();
|
|
117
|
+
applyStep(-pageStep);
|
|
118
|
+
break;
|
|
119
|
+
case "Home":
|
|
120
|
+
if (min !== undefined) {
|
|
121
|
+
event.preventDefault();
|
|
122
|
+
commitNumber(min);
|
|
123
|
+
}
|
|
124
|
+
break;
|
|
125
|
+
case "End":
|
|
126
|
+
if (max !== undefined) {
|
|
127
|
+
event.preventDefault();
|
|
128
|
+
commitNumber(max);
|
|
129
|
+
}
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
}, [disabled, step, pageStep, min, max, applyStep, commitNumber]);
|
|
133
|
+
const atMin = value !== null && value !== undefined && min !== undefined && value <= min;
|
|
134
|
+
const atMax = value !== null && value !== undefined && max !== undefined && value >= max;
|
|
135
|
+
// While focused show raw keystrokes; otherwise show the formatted/committed value.
|
|
136
|
+
const displayValue = focused
|
|
137
|
+
? text
|
|
138
|
+
: value === null || value === undefined
|
|
139
|
+
? ""
|
|
140
|
+
: format
|
|
141
|
+
? format(value)
|
|
142
|
+
: precision !== undefined
|
|
143
|
+
? value.toFixed(precision)
|
|
144
|
+
: String(value);
|
|
145
|
+
return (_jsxs("div", { "data-slot": "number-input", "data-disabled": disabled ? "" : undefined, className: cn("flex items-center gap-1", className), children: [_jsx(Button, { type: "button", variant: "outline", size: "icon", tabIndex: -1, disabled: disabled || atMin, "aria-label": "Decrement", "data-slot": "number-input-decrement", className: "shrink-0", onClick: () => applyStep(-step), children: _jsx(Minus, { "aria-hidden": "true" }) }), _jsx(Input, { ref: ref, id: id, name: name, type: "text", inputMode: precision !== undefined ? "decimal" : "numeric", role: "spinbutton", autoComplete: "off", disabled: disabled, invalid: invalid, placeholder: placeholder, value: displayValue, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": value ?? undefined, "aria-valuetext": value !== null && value !== undefined ? displayValue : undefined, "data-slot": "number-input-field", className: cn("text-center", inputClassName), onChange: handleChange, onKeyDown: handleKeyDown, onFocus: () => setFocused(true), onBlur: handleBlur, ...props }), _jsx(Button, { type: "button", variant: "outline", size: "icon", tabIndex: -1, disabled: disabled || atMax, "aria-label": "Increment", "data-slot": "number-input-increment", className: "shrink-0", onClick: () => applyStep(step), children: _jsx(Plus, { "aria-hidden": "true" }) })] }));
|
|
146
|
+
});
|
|
147
|
+
NumberInput.displayName = "NumberInput";
|
|
148
|
+
//# sourceMappingURL=number-input.js.map
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type HTMLAttributes } from "react";
|
|
2
|
+
export interface OrbitProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
}
|
|
4
|
+
export interface OrbitRingProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/**
|
|
6
|
+
* Radius of the ring in pixels — the distance from the nucleus' centre to
|
|
7
|
+
* the centre of each orbiting item. The ring renders as a `2 × radius`
|
|
8
|
+
* circle absolutely centred on the stage.
|
|
9
|
+
*/
|
|
10
|
+
radius: number;
|
|
11
|
+
/**
|
|
12
|
+
* Seconds for one full revolution. Larger is calmer; concentric rings look
|
|
13
|
+
* best with distinct durations so their items never sync up. Defaults to
|
|
14
|
+
* `24`.
|
|
15
|
+
*/
|
|
16
|
+
duration?: number;
|
|
17
|
+
/** Revolve counter-clockwise instead of clockwise. Defaults to `false`. */
|
|
18
|
+
reverse?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Angle of the first item's slot in degrees, measured clockwise from
|
|
21
|
+
* 12 o'clock. Remaining items stay evenly distributed after the offset.
|
|
22
|
+
* Use it to de-align concentric rings' starting positions. Defaults to `0`.
|
|
23
|
+
*/
|
|
24
|
+
startAngle?: number;
|
|
25
|
+
/** Draw the faint circular guide (`border-border/40`). Defaults to `true`. */
|
|
26
|
+
guide?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface OrbitItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The stage for a decorative orbit system: a `relative` flex box that centres
|
|
32
|
+
* its children as the **nucleus** while `OrbitRing`s (absolutely positioned)
|
|
33
|
+
* centre themselves around it. Size the stage to contain the largest ring,
|
|
34
|
+
* e.g. `className="size-72"` for a 128 px ring.
|
|
35
|
+
*
|
|
36
|
+
* **Mechanism** — pure CSS, zero JS per frame. Each item hangs off a
|
|
37
|
+
* *positioner* that fills the ring's circle and spins via one shared keyframe
|
|
38
|
+
* (`cronus-orbit-spin`, injected here once). The positioner's slot angle lives
|
|
39
|
+
* in the CSS `rotate` property, which the browser **composes with** the
|
|
40
|
+
* animated `transform` instead of being overwritten by it — so one keyframe
|
|
41
|
+
* serves every slot. The item itself runs the same keyframe with
|
|
42
|
+
* `animation-direction` inverted plus a `rotate` of the negated slot angle, so
|
|
43
|
+
* the two rotations cancel exactly and content stays upright while it travels.
|
|
44
|
+
*
|
|
45
|
+
* **Pause on hover** — hovering anywhere on the stage pauses every ring via
|
|
46
|
+
* `animation-play-state` (the stage is a named `group/orbit`), so no frame is
|
|
47
|
+
* ever dropped and interactive items can be reached mid-flight.
|
|
48
|
+
*
|
|
49
|
+
* **Reduced motion** — under `prefers-reduced-motion: reduce` the animations
|
|
50
|
+
* are removed (`motion-reduce:[animation-name:none]`) and the static `rotate`
|
|
51
|
+
* bases take over: items keep their exact distributed placement on the ring,
|
|
52
|
+
* upright, with no spin.
|
|
53
|
+
*/
|
|
54
|
+
export declare const Orbit: import("react").ForwardRefExoticComponent<OrbitProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
55
|
+
/**
|
|
56
|
+
* One circular track of an `Orbit` stage: an absolutely-centred `2 × radius`
|
|
57
|
+
* circle with a faint guide border, whose children are distributed evenly
|
|
58
|
+
* around the circumference and revolve together. Each child is wrapped in a
|
|
59
|
+
* spinning positioner; wrap the child content in `OrbitItem` so it
|
|
60
|
+
* counter-rotates and stays upright (bare children simply spin with the ring).
|
|
61
|
+
*
|
|
62
|
+
* Slots are counted from the ring's **direct** children (`Children.toArray`),
|
|
63
|
+
* so render items inline — a wrapper component or fragment is opaque to React
|
|
64
|
+
* and would occupy a single slot.
|
|
65
|
+
*/
|
|
66
|
+
export declare const OrbitRing: import("react").ForwardRefExoticComponent<OrbitRingProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
67
|
+
/**
|
|
68
|
+
* The upright content of one ring slot. Runs the shared spin keyframe with the
|
|
69
|
+
* ring's inverted `animation-direction` (via the inherited
|
|
70
|
+
* `--orbit-counter-direction`) plus a static `rotate` of the negated slot
|
|
71
|
+
* angle, cancelling the positioner's rotation frame-for-frame — the content
|
|
72
|
+
* revolves around the nucleus but never tilts. Restores `pointer-events` so
|
|
73
|
+
* links/buttons inside remain clickable (hovering the stage pauses the orbit,
|
|
74
|
+
* making them easy to reach).
|
|
75
|
+
*/
|
|
76
|
+
export declare const OrbitItem: import("react").ForwardRefExoticComponent<OrbitItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
77
|
+
//# sourceMappingURL=orbit.d.ts.map
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Children, forwardRef, isValidElement, } from "react";
|
|
3
|
+
import { cn } from "../lib/cn.js";
|
|
4
|
+
/**
|
|
5
|
+
* The one shared keyframe the whole system runs on: a plain 0→1 turn rotation.
|
|
6
|
+
* Everything else (starting angle, speed, direction, counter-rotation) rides
|
|
7
|
+
* CSS custom properties and the `rotate` property, so a single fixed name
|
|
8
|
+
* covers every ring and every item. It is injected once per `<Orbit>` stage;
|
|
9
|
+
* repeated identical definitions are deduped by the browser (same pattern as
|
|
10
|
+
* `BorderBeam`'s `cronus-border-beam`).
|
|
11
|
+
*/
|
|
12
|
+
const ORBIT_KEYFRAMES = "@keyframes cronus-orbit-spin{from{transform:rotate(0turn)}to{transform:rotate(1turn)}}";
|
|
13
|
+
const DEFAULT_DURATION = 24;
|
|
14
|
+
const MIN_DURATION = 1;
|
|
15
|
+
function finiteOr(value, fallback) {
|
|
16
|
+
return Number.isFinite(value) ? value : fallback;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The stage for a decorative orbit system: a `relative` flex box that centres
|
|
20
|
+
* its children as the **nucleus** while `OrbitRing`s (absolutely positioned)
|
|
21
|
+
* centre themselves around it. Size the stage to contain the largest ring,
|
|
22
|
+
* e.g. `className="size-72"` for a 128 px ring.
|
|
23
|
+
*
|
|
24
|
+
* **Mechanism** — pure CSS, zero JS per frame. Each item hangs off a
|
|
25
|
+
* *positioner* that fills the ring's circle and spins via one shared keyframe
|
|
26
|
+
* (`cronus-orbit-spin`, injected here once). The positioner's slot angle lives
|
|
27
|
+
* in the CSS `rotate` property, which the browser **composes with** the
|
|
28
|
+
* animated `transform` instead of being overwritten by it — so one keyframe
|
|
29
|
+
* serves every slot. The item itself runs the same keyframe with
|
|
30
|
+
* `animation-direction` inverted plus a `rotate` of the negated slot angle, so
|
|
31
|
+
* the two rotations cancel exactly and content stays upright while it travels.
|
|
32
|
+
*
|
|
33
|
+
* **Pause on hover** — hovering anywhere on the stage pauses every ring via
|
|
34
|
+
* `animation-play-state` (the stage is a named `group/orbit`), so no frame is
|
|
35
|
+
* ever dropped and interactive items can be reached mid-flight.
|
|
36
|
+
*
|
|
37
|
+
* **Reduced motion** — under `prefers-reduced-motion: reduce` the animations
|
|
38
|
+
* are removed (`motion-reduce:[animation-name:none]`) and the static `rotate`
|
|
39
|
+
* bases take over: items keep their exact distributed placement on the ring,
|
|
40
|
+
* upright, with no spin.
|
|
41
|
+
*/
|
|
42
|
+
export const Orbit = forwardRef(({ className, children, ...props }, ref) => (_jsxs("div", { ref: ref, "data-slot": "orbit", className: cn("group/orbit relative flex items-center justify-center", className), ...props, children: [_jsx("style", { children: ORBIT_KEYFRAMES }), children] })));
|
|
43
|
+
Orbit.displayName = "Orbit";
|
|
44
|
+
/**
|
|
45
|
+
* One circular track of an `Orbit` stage: an absolutely-centred `2 × radius`
|
|
46
|
+
* circle with a faint guide border, whose children are distributed evenly
|
|
47
|
+
* around the circumference and revolve together. Each child is wrapped in a
|
|
48
|
+
* spinning positioner; wrap the child content in `OrbitItem` so it
|
|
49
|
+
* counter-rotates and stays upright (bare children simply spin with the ring).
|
|
50
|
+
*
|
|
51
|
+
* Slots are counted from the ring's **direct** children (`Children.toArray`),
|
|
52
|
+
* so render items inline — a wrapper component or fragment is opaque to React
|
|
53
|
+
* and would occupy a single slot.
|
|
54
|
+
*/
|
|
55
|
+
export const OrbitRing = forwardRef(({ className, children, radius, duration = DEFAULT_DURATION, reverse = false, startAngle = 0, guide = true, style, ...props }, ref) => {
|
|
56
|
+
const safeRadius = Math.max(finiteOr(radius, 0), 0);
|
|
57
|
+
const safeDuration = Math.max(finiteOr(duration, DEFAULT_DURATION), MIN_DURATION);
|
|
58
|
+
const safeStartAngle = finiteOr(startAngle, 0);
|
|
59
|
+
const items = Children.toArray(children);
|
|
60
|
+
const step = items.length > 0 ? 360 / items.length : 0;
|
|
61
|
+
const ringStyle = {
|
|
62
|
+
width: safeRadius * 2,
|
|
63
|
+
height: safeRadius * 2,
|
|
64
|
+
"--orbit-duration": `${safeDuration}s`,
|
|
65
|
+
// The item's counter-spin runs the SAME keyframe in the opposite
|
|
66
|
+
// direction, so the pair always sums to a full turn (≡ upright).
|
|
67
|
+
"--orbit-spin-direction": reverse ? "reverse" : "normal",
|
|
68
|
+
"--orbit-counter-direction": reverse ? "normal" : "reverse",
|
|
69
|
+
};
|
|
70
|
+
return (_jsx("div", { ref: ref, "data-slot": "orbit-ring", className: cn(
|
|
71
|
+
// pointer-events-none keeps the (potentially large) circle from
|
|
72
|
+
// blocking the nucleus; OrbitItem restores pointer-events for its
|
|
73
|
+
// own content.
|
|
74
|
+
"pointer-events-none absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full", guide && "border border-border/40", className), style: { ...ringStyle, ...style }, ...props, children: items.map((child, index) => {
|
|
75
|
+
const angle = safeStartAngle + index * step;
|
|
76
|
+
const key = isValidElement(child) && child.key != null ? child.key : `orbit-slot-${index}`;
|
|
77
|
+
const positionerStyle = {
|
|
78
|
+
"--orbit-angle": `${angle}deg`,
|
|
79
|
+
// Static slot placement. While the animation runs, the keyframe's
|
|
80
|
+
// `transform` composes ON TOP of this `rotate` (they are separate
|
|
81
|
+
// properties); under reduced motion the animation is removed and
|
|
82
|
+
// this alone places the item at its distributed angle.
|
|
83
|
+
rotate: "var(--orbit-angle)",
|
|
84
|
+
};
|
|
85
|
+
return (_jsx("div", { "data-slot": "orbit-positioner", className: cn("absolute inset-0 [animation-name:cronus-orbit-spin] [will-change:transform]", "[animation-duration:var(--orbit-duration)] [animation-timing-function:linear]", "[animation-iteration-count:infinite] [animation-direction:var(--orbit-spin-direction)]", "group-hover/orbit:[animation-play-state:paused] motion-reduce:[animation-name:none]"), style: positionerStyle, children: _jsx("div", { "data-slot": "orbit-holder", className: "absolute left-1/2 top-0 -translate-x-1/2 -translate-y-1/2", children: child }) }, key));
|
|
86
|
+
}) }));
|
|
87
|
+
});
|
|
88
|
+
OrbitRing.displayName = "OrbitRing";
|
|
89
|
+
/**
|
|
90
|
+
* The upright content of one ring slot. Runs the shared spin keyframe with the
|
|
91
|
+
* ring's inverted `animation-direction` (via the inherited
|
|
92
|
+
* `--orbit-counter-direction`) plus a static `rotate` of the negated slot
|
|
93
|
+
* angle, cancelling the positioner's rotation frame-for-frame — the content
|
|
94
|
+
* revolves around the nucleus but never tilts. Restores `pointer-events` so
|
|
95
|
+
* links/buttons inside remain clickable (hovering the stage pauses the orbit,
|
|
96
|
+
* making them easy to reach).
|
|
97
|
+
*/
|
|
98
|
+
export const OrbitItem = forwardRef(({ className, style, ...props }, ref) => (_jsx("div", { ref: ref, "data-slot": "orbit-item", className: cn("pointer-events-auto flex items-center justify-center [animation-name:cronus-orbit-spin]", "[animation-duration:var(--orbit-duration,24s)] [animation-timing-function:linear]", "[animation-iteration-count:infinite] [animation-direction:var(--orbit-counter-direction,reverse)]", "group-hover/orbit:[animation-play-state:paused] motion-reduce:[animation-name:none]", className), style: { rotate: "calc(var(--orbit-angle, 0deg) * -1)", ...style }, ...props })));
|
|
99
|
+
OrbitItem.displayName = "OrbitItem";
|
|
100
|
+
//# sourceMappingURL=orbit.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type AnchorHTMLAttributes, type HTMLAttributes } from "react";
|
|
2
|
+
import { buttonVariants } from "./button.js";
|
|
3
|
+
export declare const Pagination: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & import("react").RefAttributes<HTMLElement>>;
|
|
4
|
+
export declare const PaginationContent: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLUListElement> & import("react").RefAttributes<HTMLUListElement>>;
|
|
5
|
+
export declare const PaginationItem: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLLIElement> & import("react").RefAttributes<HTMLLIElement>>;
|
|
6
|
+
type PaginationLinkSize = NonNullable<Parameters<typeof buttonVariants>[0]>["size"];
|
|
7
|
+
export interface PaginationLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
8
|
+
isActive?: boolean;
|
|
9
|
+
size?: PaginationLinkSize;
|
|
10
|
+
}
|
|
11
|
+
export declare const PaginationLink: import("react").ForwardRefExoticComponent<PaginationLinkProps & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
12
|
+
export declare const PaginationPrevious: import("react").ForwardRefExoticComponent<Omit<PaginationLinkProps & import("react").RefAttributes<HTMLAnchorElement>, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
13
|
+
export declare const PaginationNext: import("react").ForwardRefExoticComponent<Omit<PaginationLinkProps & import("react").RefAttributes<HTMLAnchorElement>, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
14
|
+
export declare const PaginationEllipsis: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLSpanElement> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react";
|
|
3
|
+
import { forwardRef, } from "react";
|
|
4
|
+
import { cn } from "../lib/cn.js";
|
|
5
|
+
import { buttonVariants } from "./button.js";
|
|
6
|
+
export const Pagination = forwardRef(({ className, ...props }, ref) => {
|
|
7
|
+
return (_jsx("nav", { ref: ref, "aria-label": "pagination", "data-slot": "pagination", className: cn("mx-auto flex w-full justify-center", className), ...props }));
|
|
8
|
+
});
|
|
9
|
+
Pagination.displayName = "Pagination";
|
|
10
|
+
export const PaginationContent = forwardRef(({ className, ...props }, ref) => {
|
|
11
|
+
return (_jsx("ul", { ref: ref, "data-slot": "pagination-content", className: cn("flex items-center gap-1", className), ...props }));
|
|
12
|
+
});
|
|
13
|
+
PaginationContent.displayName = "PaginationContent";
|
|
14
|
+
export const PaginationItem = forwardRef(({ className, ...props }, ref) => {
|
|
15
|
+
return _jsx("li", { ref: ref, "data-slot": "pagination-item", className: className, ...props });
|
|
16
|
+
});
|
|
17
|
+
PaginationItem.displayName = "PaginationItem";
|
|
18
|
+
export const PaginationLink = forwardRef(({ className, isActive, size, ...props }, ref) => {
|
|
19
|
+
return (_jsx("a", { ref: ref, "aria-current": isActive ? "page" : undefined, "data-slot": "pagination-link", "data-active": isActive, className: cn(buttonVariants({ variant: isActive ? "outline" : "ghost", size: size ?? "icon" }), className), ...props }));
|
|
20
|
+
});
|
|
21
|
+
PaginationLink.displayName = "PaginationLink";
|
|
22
|
+
export const PaginationPrevious = forwardRef(({ className, ...props }, ref) => {
|
|
23
|
+
return (_jsxs(PaginationLink, { ref: ref, "aria-label": "Go to previous page", size: "md", "data-slot": "pagination-previous", className: cn("gap-1 px-2.5", className), ...props, children: [_jsx(ChevronLeft, {}), _jsx("span", { children: "Previous" })] }));
|
|
24
|
+
});
|
|
25
|
+
PaginationPrevious.displayName = "PaginationPrevious";
|
|
26
|
+
export const PaginationNext = forwardRef(({ className, ...props }, ref) => {
|
|
27
|
+
return (_jsxs(PaginationLink, { ref: ref, "aria-label": "Go to next page", size: "md", "data-slot": "pagination-next", className: cn("gap-1 px-2.5", className), ...props, children: [_jsx("span", { children: "Next" }), _jsx(ChevronRight, {})] }));
|
|
28
|
+
});
|
|
29
|
+
PaginationNext.displayName = "PaginationNext";
|
|
30
|
+
export const PaginationEllipsis = forwardRef(({ className, ...props }, ref) => {
|
|
31
|
+
return (_jsxs("span", { ref: ref, "aria-hidden": true, "data-slot": "pagination-ellipsis", className: cn("flex size-10 items-center justify-center", className), ...props, children: [_jsx(MoreHorizontal, { className: "size-4" }), _jsx("span", { className: "sr-only", children: "More pages" })] }));
|
|
32
|
+
});
|
|
33
|
+
PaginationEllipsis.displayName = "PaginationEllipsis";
|
|
34
|
+
//# sourceMappingURL=pagination.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type HTMLAttributes, type Ref } from "react";
|
|
2
|
+
export interface ParticlesProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
ref?: Ref<HTMLDivElement>;
|
|
4
|
+
/**
|
|
5
|
+
* Number of drifting specks.
|
|
6
|
+
* @default 40
|
|
7
|
+
*/
|
|
8
|
+
count?: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A calm 2D particle field that drifts behind content. Canvas-only, no WebGL.
|
|
12
|
+
* Paused (and undrawn) under reduced motion so the surface stays still.
|
|
13
|
+
*/
|
|
14
|
+
export declare function Particles({ ref, className, children, count, ...props }: ParticlesProps): import("react").JSX.Element;
|
|
15
|
+
export declare namespace Particles {
|
|
16
|
+
var displayName: string;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=particles.d.ts.map
|