@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,172 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef, useCallback, useEffect, useRef, } from "react";
|
|
4
|
+
import { cn } from "../lib/cn.js";
|
|
5
|
+
const DEFAULT_STRENGTH = 0.3;
|
|
6
|
+
const DEFAULT_RADIUS = 120;
|
|
7
|
+
/** Fraction of the remaining distance covered per frame — the lerp smoothing. */
|
|
8
|
+
const FOLLOW = 0.35;
|
|
9
|
+
/** Distance (px) below which the lerp is considered settled and the loop stops. */
|
|
10
|
+
const SETTLE = 0.05;
|
|
11
|
+
/**
|
|
12
|
+
* The effect is decorative, so it steps aside for visitors who ask for less
|
|
13
|
+
* motion and on touch/coarse-pointer devices, where there is no hover to
|
|
14
|
+
* attract toward. Evaluated on every pointer-enter (not once at mount) so a
|
|
15
|
+
* live OS-setting change is honoured on the very next interaction.
|
|
16
|
+
*/
|
|
17
|
+
const canAttract = () => typeof window !== "undefined" &&
|
|
18
|
+
typeof window.matchMedia === "function" &&
|
|
19
|
+
!window.matchMedia("(prefers-reduced-motion: reduce)").matches &&
|
|
20
|
+
!window.matchMedia("(pointer: coarse)").matches;
|
|
21
|
+
/**
|
|
22
|
+
* Re-entering mid-spring-back: seed the lerp from the element's live computed
|
|
23
|
+
* transform so the new pull continues from wherever the ease-back had reached,
|
|
24
|
+
* instead of jumping to the stale resting position.
|
|
25
|
+
*/
|
|
26
|
+
function seedFromComputedTransform(target, state) {
|
|
27
|
+
state.x = 0;
|
|
28
|
+
state.y = 0;
|
|
29
|
+
const transform = window.getComputedStyle(target).transform;
|
|
30
|
+
const match = /matrix(3d)?\(([^)]+)\)/.exec(transform ?? "");
|
|
31
|
+
if (!match) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const parts = (match[2] ?? "").split(",");
|
|
35
|
+
const [tx, ty] = match[1]
|
|
36
|
+
? [Number.parseFloat(parts[12] ?? "0"), Number.parseFloat(parts[13] ?? "0")]
|
|
37
|
+
: [Number.parseFloat(parts[4] ?? "0"), Number.parseFloat(parts[5] ?? "0")];
|
|
38
|
+
if (Number.isFinite(tx) && Number.isFinite(ty)) {
|
|
39
|
+
state.x = tx;
|
|
40
|
+
state.y = ty;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A magnetic-hover wrapper: its children are gently attracted toward the
|
|
45
|
+
* cursor while it is inside a proximity field around the wrapper's center.
|
|
46
|
+
* Classic use is a hero call-to-action or an icon row that leans into the
|
|
47
|
+
* pointer before it even lands.
|
|
48
|
+
*
|
|
49
|
+
* Mechanism: `pointermove` on the wrapper records the cursor, and a
|
|
50
|
+
* `requestAnimationFrame` loop lerps a `translate` that is written **straight
|
|
51
|
+
* to the child's `style.transform`** — pointer tracking never touches React
|
|
52
|
+
* state, so there are zero re-renders during the interaction. The pull is the
|
|
53
|
+
* pointer's offset from center scaled by {@link MagneticProps.strength} and by
|
|
54
|
+
* a linear falloff that reaches zero at {@link MagneticProps.radius}, so the
|
|
55
|
+
* attraction dissolves smoothly at the field's edge. On leave the transform is
|
|
56
|
+
* reset to zero and a short springy CSS transition (suppressed while tracking
|
|
57
|
+
* via a `data-magnetic-active` attribute) eases the content back to rest.
|
|
58
|
+
*
|
|
59
|
+
* The effect is disabled entirely under `prefers-reduced-motion: reduce` and
|
|
60
|
+
* on coarse pointers (`(pointer: coarse)` — touch has no hover to attract
|
|
61
|
+
* toward), with a `motion-reduce` CSS backstop on the transform itself.
|
|
62
|
+
* Accessibility: purely decorative — the wrapper is not a control, children
|
|
63
|
+
* keep their natural focus order and focus-visible styling, and keyboard users
|
|
64
|
+
* simply see the content at rest.
|
|
65
|
+
*/
|
|
66
|
+
export const Magnetic = forwardRef(({ strength = DEFAULT_STRENGTH, radius = DEFAULT_RADIUS, className, children, onPointerEnter, onPointerMove, onPointerLeave, ...props }, ref) => {
|
|
67
|
+
const wrapperRef = useRef(null);
|
|
68
|
+
const targetRef = useRef(null);
|
|
69
|
+
const frameRef = useRef(null);
|
|
70
|
+
const stateRef = useRef({
|
|
71
|
+
active: false,
|
|
72
|
+
pointerX: 0,
|
|
73
|
+
pointerY: 0,
|
|
74
|
+
x: 0,
|
|
75
|
+
y: 0,
|
|
76
|
+
});
|
|
77
|
+
const setRef = useCallback((node) => {
|
|
78
|
+
wrapperRef.current = node;
|
|
79
|
+
if (typeof ref === "function") {
|
|
80
|
+
ref(node);
|
|
81
|
+
}
|
|
82
|
+
else if (ref) {
|
|
83
|
+
ref.current = node;
|
|
84
|
+
}
|
|
85
|
+
}, [ref]);
|
|
86
|
+
const step = useCallback(() => {
|
|
87
|
+
frameRef.current = null;
|
|
88
|
+
const wrapper = wrapperRef.current;
|
|
89
|
+
const target = targetRef.current;
|
|
90
|
+
const state = stateRef.current;
|
|
91
|
+
if (!wrapper || !target || !state.active) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const rect = wrapper.getBoundingClientRect();
|
|
95
|
+
const offsetX = state.pointerX - (rect.left + rect.width / 2);
|
|
96
|
+
const offsetY = state.pointerY - (rect.top + rect.height / 2);
|
|
97
|
+
const field = Math.max(radius, 1);
|
|
98
|
+
const distance = Math.hypot(offsetX, offsetY);
|
|
99
|
+
// Pull grows with the offset near the center but eases back to zero at
|
|
100
|
+
// the field's edge, so entering/leaving the radius never jumps.
|
|
101
|
+
const falloff = distance >= field ? 0 : 1 - distance / field;
|
|
102
|
+
const pull = Math.min(Math.max(strength, 0), 1) * falloff;
|
|
103
|
+
const targetX = offsetX * pull;
|
|
104
|
+
const targetY = offsetY * pull;
|
|
105
|
+
state.x += (targetX - state.x) * FOLLOW;
|
|
106
|
+
state.y += (targetY - state.y) * FOLLOW;
|
|
107
|
+
target.style.transform = `translate(${state.x.toFixed(2)}px, ${state.y.toFixed(2)}px)`;
|
|
108
|
+
// Keep lerping until the follow has settled; a new pointermove restarts it.
|
|
109
|
+
if (Math.abs(targetX - state.x) > SETTLE || Math.abs(targetY - state.y) > SETTLE) {
|
|
110
|
+
frameRef.current = requestAnimationFrame(step);
|
|
111
|
+
}
|
|
112
|
+
}, [strength, radius]);
|
|
113
|
+
const handlePointerEnter = useCallback((event) => {
|
|
114
|
+
const target = targetRef.current;
|
|
115
|
+
if (target && canAttract()) {
|
|
116
|
+
const state = stateRef.current;
|
|
117
|
+
state.active = true;
|
|
118
|
+
state.pointerX = event.clientX;
|
|
119
|
+
state.pointerY = event.clientY;
|
|
120
|
+
seedFromComputedTransform(target, state);
|
|
121
|
+
// While tracking, the rAF lerp is the smoothing — the CSS transition
|
|
122
|
+
// (which would only add lag on top) is suppressed via this attribute.
|
|
123
|
+
target.setAttribute("data-magnetic-active", "true");
|
|
124
|
+
}
|
|
125
|
+
onPointerEnter?.(event);
|
|
126
|
+
}, [onPointerEnter]);
|
|
127
|
+
const handlePointerMove = useCallback((event) => {
|
|
128
|
+
const state = stateRef.current;
|
|
129
|
+
if (state.active) {
|
|
130
|
+
state.pointerX = event.clientX;
|
|
131
|
+
state.pointerY = event.clientY;
|
|
132
|
+
if (frameRef.current !== null) {
|
|
133
|
+
cancelAnimationFrame(frameRef.current);
|
|
134
|
+
}
|
|
135
|
+
frameRef.current = requestAnimationFrame(step);
|
|
136
|
+
}
|
|
137
|
+
onPointerMove?.(event);
|
|
138
|
+
}, [step, onPointerMove]);
|
|
139
|
+
const handlePointerLeave = useCallback((event) => {
|
|
140
|
+
const state = stateRef.current;
|
|
141
|
+
if (state.active) {
|
|
142
|
+
state.active = false;
|
|
143
|
+
state.x = 0;
|
|
144
|
+
state.y = 0;
|
|
145
|
+
if (frameRef.current !== null) {
|
|
146
|
+
cancelAnimationFrame(frameRef.current);
|
|
147
|
+
frameRef.current = null;
|
|
148
|
+
}
|
|
149
|
+
const target = targetRef.current;
|
|
150
|
+
if (target) {
|
|
151
|
+
// Drop the tracking attribute first so the class transition is
|
|
152
|
+
// live when the zero transform lands — that transition IS the
|
|
153
|
+
// spring-back.
|
|
154
|
+
target.removeAttribute("data-magnetic-active");
|
|
155
|
+
target.style.transform = "translate(0px, 0px)";
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
onPointerLeave?.(event);
|
|
159
|
+
}, [onPointerLeave]);
|
|
160
|
+
// Cancel any in-flight frame if the wrapper unmounts mid-attraction.
|
|
161
|
+
useEffect(() => () => {
|
|
162
|
+
if (frameRef.current !== null) {
|
|
163
|
+
cancelAnimationFrame(frameRef.current);
|
|
164
|
+
}
|
|
165
|
+
}, []);
|
|
166
|
+
return (_jsx("div", { ref: setRef, "data-slot": "magnetic", className: cn("inline-block", className), onPointerEnter: handlePointerEnter, onPointerMove: handlePointerMove, onPointerLeave: handlePointerLeave, ...props, children: _jsx("div", { ref: targetRef, "data-slot": "magnetic-target", className: cn("will-change-transform",
|
|
167
|
+
// Springy ease-back on leave; suppressed while actively tracking
|
|
168
|
+
// (the rAF lerp smooths the follow) and under reduced motion.
|
|
169
|
+
"transition-transform duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)]", "data-[magnetic-active]:transition-none", "motion-reduce:transition-none motion-reduce:!transform-none"), children: children }) }));
|
|
170
|
+
});
|
|
171
|
+
Magnetic.displayName = "Magnetic";
|
|
172
|
+
//# sourceMappingURL=magnetic.js.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Whether the marquee scrolls. `"respect"` (default) honours the visitor's
|
|
4
|
+
* `prefers-reduced-motion` setting — it scrolls for everyone except those who
|
|
5
|
+
* opt out, who get a static, fully-legible row. `"always"` always scrolls,
|
|
6
|
+
* ignoring the OS setting (e.g. a showcase that must demonstrate the motion);
|
|
7
|
+
* `"never"` is always static.
|
|
8
|
+
*/
|
|
9
|
+
export type MarqueeMotionPreference = "respect" | "always" | "never";
|
|
10
|
+
export interface MarqueeProps extends HTMLAttributes<HTMLDivElement> {
|
|
11
|
+
/** The items to scroll — logos, cards, testimonials, or a text ticker. */
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Scroll direction. Horizontal: `"left"` (default) | `"right"`. When
|
|
15
|
+
* {@link MarqueeProps.vertical} is set, the same prop reads as `"up"`
|
|
16
|
+
* (default) | `"down"` — i.e. `"left"`/`"up"` share the forward sense and
|
|
17
|
+
* `"right"`/`"down"` the reverse, so one prop covers both axes.
|
|
18
|
+
*/
|
|
19
|
+
direction?: "left" | "right";
|
|
20
|
+
/** Scroll the marquee on the vertical axis instead of the horizontal one. */
|
|
21
|
+
vertical?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Travel speed in **pixels per second** — resolution-independent and stable
|
|
24
|
+
* across content widths (the loop duration is derived from the measured track
|
|
25
|
+
* size). Defaults to `40` (a tasteful, slow drift).
|
|
26
|
+
*/
|
|
27
|
+
speed?: number;
|
|
28
|
+
/** Pause the scroll while the pointer is over the marquee. Defaults to `true`. */
|
|
29
|
+
pauseOnHover?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Fade the leading and trailing edges into the background with a gradient
|
|
32
|
+
* `mask-image`, so items dissolve rather than clip. Defaults to `true`.
|
|
33
|
+
*/
|
|
34
|
+
fade?: boolean;
|
|
35
|
+
/** Spacing between repeated items. Accepts any CSS length. Defaults to `"1rem"`. */
|
|
36
|
+
gap?: string;
|
|
37
|
+
/**
|
|
38
|
+
* How many copies of {@link MarqueeProps.children} are rendered back-to-back.
|
|
39
|
+
* The track translates by exactly one copy, so any count ≥ 2 loops
|
|
40
|
+
* seamlessly. Defaults to `2`; raise it when a single copy cannot fill wide
|
|
41
|
+
* viewports (leaving a visible gap before the loop point).
|
|
42
|
+
*/
|
|
43
|
+
repeat?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Whether the marquee scrolls vs. honours `prefers-reduced-motion`:
|
|
46
|
+
* `"respect"` (default), `"always"` (force motion), or `"never"` (force
|
|
47
|
+
* static). Defaults to `"respect"`.
|
|
48
|
+
*/
|
|
49
|
+
motionPreference?: MarqueeMotionPreference;
|
|
50
|
+
/** Class applied to each repeated copy (the flex row/column of items). */
|
|
51
|
+
groupClassName?: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* A seamless, constant-velocity infinite scroller for logos, testimonials, or a
|
|
55
|
+
* text ticker. The track is rendered as N (`repeat`, default 2) identical copies
|
|
56
|
+
* laid back-to-back; a CSS keyframe translates the whole track by exactly **one
|
|
57
|
+
* copy's length** and loops, so the moment it resets is pixel-identical to the
|
|
58
|
+
* start — there is no visible jump. The animation runs on a single composited
|
|
59
|
+
* `transform`, so it stays buttery regardless of how many items it carries.
|
|
60
|
+
*
|
|
61
|
+
* The keyframe travels by percentage (robust to resize), while the loop
|
|
62
|
+
* *duration* is computed from the live track measurement so the apparent
|
|
63
|
+
* {@link MarqueeProps.speed} (px/sec) holds whatever the content width is.
|
|
64
|
+
*
|
|
65
|
+
* **Pause on hover** is pure CSS (`animation-play-state`), so hovering never
|
|
66
|
+
* drops a frame. **Reduced motion** is honoured: when the visitor prefers
|
|
67
|
+
* reduced motion (or {@link MarqueeProps.motionPreference} forces it), a single
|
|
68
|
+
* static copy is rendered with no animation — the content stays fully legible.
|
|
69
|
+
*/
|
|
70
|
+
export declare const Marquee: import("react").ForwardRefExoticComponent<MarqueeProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
71
|
+
//# sourceMappingURL=marquee.d.ts.map
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useReducedMotion } from "motion/react";
|
|
4
|
+
import { forwardRef, useId, useLayoutEffect, useMemo, useRef, useState, } from "react";
|
|
5
|
+
import { cn } from "../lib/cn.js";
|
|
6
|
+
const DEFAULT_SPEED = 40;
|
|
7
|
+
const DEFAULT_GAP = "1rem";
|
|
8
|
+
const DEFAULT_REPEAT = 2;
|
|
9
|
+
const MIN_REPEAT = 2;
|
|
10
|
+
const MIN_DURATION = 1;
|
|
11
|
+
function finiteOr(value, fallback) {
|
|
12
|
+
return Number.isFinite(value) ? value : fallback;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A seamless, constant-velocity infinite scroller for logos, testimonials, or a
|
|
16
|
+
* text ticker. The track is rendered as N (`repeat`, default 2) identical copies
|
|
17
|
+
* laid back-to-back; a CSS keyframe translates the whole track by exactly **one
|
|
18
|
+
* copy's length** and loops, so the moment it resets is pixel-identical to the
|
|
19
|
+
* start — there is no visible jump. The animation runs on a single composited
|
|
20
|
+
* `transform`, so it stays buttery regardless of how many items it carries.
|
|
21
|
+
*
|
|
22
|
+
* The keyframe travels by percentage (robust to resize), while the loop
|
|
23
|
+
* *duration* is computed from the live track measurement so the apparent
|
|
24
|
+
* {@link MarqueeProps.speed} (px/sec) holds whatever the content width is.
|
|
25
|
+
*
|
|
26
|
+
* **Pause on hover** is pure CSS (`animation-play-state`), so hovering never
|
|
27
|
+
* drops a frame. **Reduced motion** is honoured: when the visitor prefers
|
|
28
|
+
* reduced motion (or {@link MarqueeProps.motionPreference} forces it), a single
|
|
29
|
+
* static copy is rendered with no animation — the content stays fully legible.
|
|
30
|
+
*/
|
|
31
|
+
export const Marquee = forwardRef(({ children, className, groupClassName, direction = "left", vertical = false, speed = DEFAULT_SPEED, pauseOnHover = true, fade = true, gap = DEFAULT_GAP, repeat = DEFAULT_REPEAT, motionPreference = "respect", style, ...props }, ref) => {
|
|
32
|
+
const systemReducedMotion = useReducedMotion();
|
|
33
|
+
const prefersReducedMotion = motionPreference === "always"
|
|
34
|
+
? false
|
|
35
|
+
: motionPreference === "never"
|
|
36
|
+
? true
|
|
37
|
+
: systemReducedMotion;
|
|
38
|
+
// Per-instance keyframe name so multiple marquees (different axes/durations)
|
|
39
|
+
// never collide on a shared `@keyframes`. `useId` is SSR-stable; sanitise it
|
|
40
|
+
// since CSS identifiers cannot contain the `:` React emits.
|
|
41
|
+
const rawId = useId();
|
|
42
|
+
const animationName = `cronus-marquee-${rawId.replace(/[^a-zA-Z0-9_-]/g, "")}`;
|
|
43
|
+
const safeSpeed = Math.max(finiteOr(speed, DEFAULT_SPEED), 1);
|
|
44
|
+
const copies = Math.max(Math.round(finiteOr(repeat, DEFAULT_REPEAT)), MIN_REPEAT);
|
|
45
|
+
// Measure one copy along the scroll axis so the loop duration tracks the real
|
|
46
|
+
// content size — the keyframe itself moves by percentage, so we only need the
|
|
47
|
+
// distance to keep px/sec speed constant. Falls back to a sane duration until
|
|
48
|
+
// the measurement lands (and stays correct under resize via ResizeObserver).
|
|
49
|
+
const measureRef = useRef(null);
|
|
50
|
+
const [copySize, setCopySize] = useState(0);
|
|
51
|
+
useLayoutEffect(() => {
|
|
52
|
+
const node = measureRef.current;
|
|
53
|
+
if (!node || prefersReducedMotion)
|
|
54
|
+
return;
|
|
55
|
+
const read = () => {
|
|
56
|
+
const rect = node.getBoundingClientRect();
|
|
57
|
+
setCopySize(vertical ? rect.height : rect.width);
|
|
58
|
+
};
|
|
59
|
+
read();
|
|
60
|
+
if (typeof ResizeObserver === "undefined")
|
|
61
|
+
return;
|
|
62
|
+
const observer = new ResizeObserver(read);
|
|
63
|
+
observer.observe(node);
|
|
64
|
+
return () => observer.disconnect();
|
|
65
|
+
}, [vertical, prefersReducedMotion]);
|
|
66
|
+
// distance = one copy + the gap that follows it before the next copy starts,
|
|
67
|
+
// so the reset lands exactly on the seam (no half-gap stutter).
|
|
68
|
+
const gapPx = useMemo(() => parseGap(gap), [gap]);
|
|
69
|
+
const distance = copySize + gapPx;
|
|
70
|
+
const duration = Math.max(distance / safeSpeed, MIN_DURATION);
|
|
71
|
+
// The keyframe always animates 0 → -(100/copies)% of the TRACK (one copy).
|
|
72
|
+
// For "forward" (left / up) the row slides toward its start; "right"/"down"
|
|
73
|
+
// reverse it by swapping the from/to endpoints, so velocity stays linear and
|
|
74
|
+
// the seam is identical in both directions.
|
|
75
|
+
const axisSign = vertical ? "Y" : "X";
|
|
76
|
+
const forward = direction === "left";
|
|
77
|
+
// Each copy is one full repeat of the children; sliding it by exactly its
|
|
78
|
+
// own length PLUS the inter-copy gap lands the *next* copy precisely where
|
|
79
|
+
// this one began, so the reset is pixel-identical — a seamless loop. The
|
|
80
|
+
// travel is one copy + gap regardless of `copies` (which only needs to be
|
|
81
|
+
// ≥ 2 to keep the viewport filled), and it matches the `distance` the
|
|
82
|
+
// duration is derived from, so the apparent px/sec speed is exact. Both
|
|
83
|
+
// endpoints use the SAME translate function on the scroll axis so the
|
|
84
|
+
// browser interpolates them linearly (mismatched function lists fall back
|
|
85
|
+
// to matrix decomposition, which can stutter); `[will-change:transform]`
|
|
86
|
+
// already composites the track, so the 3d hint is unnecessary.
|
|
87
|
+
const zero = `translate${axisSign}(0)`;
|
|
88
|
+
const shifted = `translate${axisSign}(calc(-100% - var(--marquee-gap)))`;
|
|
89
|
+
const fromTransform = forward ? zero : shifted;
|
|
90
|
+
const toTransform = forward ? shifted : zero;
|
|
91
|
+
const fadeMask = vertical
|
|
92
|
+
? "linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent)"
|
|
93
|
+
: "linear-gradient(to right, transparent, #000 12%, #000 88%, transparent)";
|
|
94
|
+
const trackStyle = {
|
|
95
|
+
"--marquee-duration": `${duration}s`,
|
|
96
|
+
"--marquee-gap": gap,
|
|
97
|
+
"--marquee-from": fromTransform,
|
|
98
|
+
"--marquee-to": toTransform,
|
|
99
|
+
};
|
|
100
|
+
if (prefersReducedMotion) {
|
|
101
|
+
// Static, fully-legible fallback: one copy, no track animation, no clones.
|
|
102
|
+
return (_jsx("div", { ref: ref, "data-slot": "marquee", "data-vertical": vertical || undefined, "data-reduced-motion": "true", className: cn("relative overflow-hidden", fade && "[mask-image:var(--marquee-mask)] [-webkit-mask-image:var(--marquee-mask)]", className), style: {
|
|
103
|
+
...style,
|
|
104
|
+
...(fade ? { "--marquee-mask": fadeMask } : {}),
|
|
105
|
+
}, ...props, children: _jsx("div", { "data-slot": "marquee-group", className: cn("flex w-max items-center", vertical ? "flex-col" : "flex-row", groupClassName), style: { gap }, children: children }) }));
|
|
106
|
+
}
|
|
107
|
+
return (_jsxs("div", { ref: ref, "data-slot": "marquee", "data-vertical": vertical || undefined, className: cn("group relative flex overflow-hidden", vertical ? "flex-col" : "flex-row", fade && "[mask-image:var(--marquee-mask)] [-webkit-mask-image:var(--marquee-mask)]", className), style: {
|
|
108
|
+
...style,
|
|
109
|
+
...trackStyle,
|
|
110
|
+
// Space the back-to-back copies by the SAME gap used between items,
|
|
111
|
+
// so the gap straddling the loop seam matches every other gap (the
|
|
112
|
+
// `<style>` child is display:none, so it never gets a flex gap).
|
|
113
|
+
gap,
|
|
114
|
+
...(fade ? { "--marquee-mask": fadeMask } : {}),
|
|
115
|
+
}, ...props, children: [_jsx("style", { children: `@keyframes ${animationName}{from{transform:var(--marquee-from)}to{transform:var(--marquee-to)}}` }), Array.from({ length: copies }, (_, copyIndex) => (_jsx("div", { ref: copyIndex === 0 ? measureRef : undefined, "aria-hidden": copyIndex === 0 ? undefined : "true", "data-slot": "marquee-group", className: cn("flex w-max shrink-0 items-center [animation:var(--marquee-animation)] [will-change:transform]",
|
|
116
|
+
// SSR backstop: until hydration swaps in the static fallback, this
|
|
117
|
+
// stops motion for reduced-motion visitors. `"always"` opts out —
|
|
118
|
+
// it must scroll regardless of the OS setting.
|
|
119
|
+
motionPreference !== "always" && "motion-reduce:[animation:none]", vertical ? "min-h-max flex-col" : "min-w-max flex-row", pauseOnHover && "group-hover:[animation-play-state:paused]", groupClassName), style: {
|
|
120
|
+
gap,
|
|
121
|
+
"--marquee-animation": `${animationName} var(--marquee-duration) linear infinite`,
|
|
122
|
+
}, children: children }, `copy-${copyIndex}`)))] }));
|
|
123
|
+
});
|
|
124
|
+
Marquee.displayName = "Marquee";
|
|
125
|
+
/**
|
|
126
|
+
* Resolve a CSS gap length to pixels for the duration maths. Handles the common
|
|
127
|
+
* `px`/`rem`/`em` units (rem/em assume the 16px root default — exact enough for
|
|
128
|
+
* timing, which only needs to be perceptually constant, not sub-pixel precise);
|
|
129
|
+
* anything else contributes 0 so the loop still runs at the copy width.
|
|
130
|
+
*/
|
|
131
|
+
function parseGap(gap) {
|
|
132
|
+
const match = /^(-?[\d.]+)(px|rem|em)?$/.exec(gap.trim());
|
|
133
|
+
if (!match)
|
|
134
|
+
return 0;
|
|
135
|
+
const value = Number.parseFloat(match[1] ?? "0");
|
|
136
|
+
if (!Number.isFinite(value))
|
|
137
|
+
return 0;
|
|
138
|
+
const unit = match[2] ?? "px";
|
|
139
|
+
return unit === "px" ? value : value * 16;
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=marquee.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type HTMLAttributes } from "react";
|
|
2
|
+
export interface MasonryColumns {
|
|
3
|
+
base?: number;
|
|
4
|
+
sm?: number;
|
|
5
|
+
md?: number;
|
|
6
|
+
lg?: number;
|
|
7
|
+
xl?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface MasonryProps extends HTMLAttributes<HTMLDivElement> {
|
|
10
|
+
/** Number of columns, either a fixed count or a responsive map keyed by breakpoint. */
|
|
11
|
+
columns?: number | MasonryColumns;
|
|
12
|
+
/** CSS length used for both the column gap and the vertical gap between items. */
|
|
13
|
+
gap?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const Masonry: import("react").ForwardRefExoticComponent<MasonryProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
16
|
+
//# sourceMappingURL=masonry.d.ts.map
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { cn } from "../lib/cn.js";
|
|
4
|
+
const BASE_COLUMNS = {
|
|
5
|
+
1: "columns-1",
|
|
6
|
+
2: "columns-2",
|
|
7
|
+
3: "columns-3",
|
|
8
|
+
4: "columns-4",
|
|
9
|
+
5: "columns-5",
|
|
10
|
+
6: "columns-6",
|
|
11
|
+
};
|
|
12
|
+
const SM_COLUMNS = {
|
|
13
|
+
1: "sm:columns-1",
|
|
14
|
+
2: "sm:columns-2",
|
|
15
|
+
3: "sm:columns-3",
|
|
16
|
+
4: "sm:columns-4",
|
|
17
|
+
5: "sm:columns-5",
|
|
18
|
+
6: "sm:columns-6",
|
|
19
|
+
};
|
|
20
|
+
const MD_COLUMNS = {
|
|
21
|
+
1: "md:columns-1",
|
|
22
|
+
2: "md:columns-2",
|
|
23
|
+
3: "md:columns-3",
|
|
24
|
+
4: "md:columns-4",
|
|
25
|
+
5: "md:columns-5",
|
|
26
|
+
6: "md:columns-6",
|
|
27
|
+
};
|
|
28
|
+
const LG_COLUMNS = {
|
|
29
|
+
1: "lg:columns-1",
|
|
30
|
+
2: "lg:columns-2",
|
|
31
|
+
3: "lg:columns-3",
|
|
32
|
+
4: "lg:columns-4",
|
|
33
|
+
5: "lg:columns-5",
|
|
34
|
+
6: "lg:columns-6",
|
|
35
|
+
};
|
|
36
|
+
const XL_COLUMNS = {
|
|
37
|
+
1: "xl:columns-1",
|
|
38
|
+
2: "xl:columns-2",
|
|
39
|
+
3: "xl:columns-3",
|
|
40
|
+
4: "xl:columns-4",
|
|
41
|
+
5: "xl:columns-5",
|
|
42
|
+
6: "xl:columns-6",
|
|
43
|
+
};
|
|
44
|
+
function clampCount(value) {
|
|
45
|
+
if (value === undefined)
|
|
46
|
+
return undefined;
|
|
47
|
+
const rounded = Math.round(value);
|
|
48
|
+
if (rounded < 1)
|
|
49
|
+
return 1;
|
|
50
|
+
if (rounded > 6)
|
|
51
|
+
return 6;
|
|
52
|
+
return rounded;
|
|
53
|
+
}
|
|
54
|
+
const DEFAULT_COLUMNS = { base: 1, sm: 2, lg: 3 };
|
|
55
|
+
function resolveColumnClasses(columns) {
|
|
56
|
+
const config = typeof columns === "number" ? { base: columns } : columns;
|
|
57
|
+
const classes = [];
|
|
58
|
+
const base = clampCount(config.base);
|
|
59
|
+
if (base)
|
|
60
|
+
classes.push(BASE_COLUMNS[base]);
|
|
61
|
+
const sm = clampCount(config.sm);
|
|
62
|
+
if (sm)
|
|
63
|
+
classes.push(SM_COLUMNS[sm]);
|
|
64
|
+
const md = clampCount(config.md);
|
|
65
|
+
if (md)
|
|
66
|
+
classes.push(MD_COLUMNS[md]);
|
|
67
|
+
const lg = clampCount(config.lg);
|
|
68
|
+
if (lg)
|
|
69
|
+
classes.push(LG_COLUMNS[lg]);
|
|
70
|
+
const xl = clampCount(config.xl);
|
|
71
|
+
if (xl)
|
|
72
|
+
classes.push(XL_COLUMNS[xl]);
|
|
73
|
+
return classes;
|
|
74
|
+
}
|
|
75
|
+
export const Masonry = forwardRef(({ className, columns = DEFAULT_COLUMNS, gap = "1rem", style, ...props }, ref) => {
|
|
76
|
+
const columnClasses = resolveColumnClasses(columns);
|
|
77
|
+
return (_jsx("div", { ref: ref, "data-slot": "masonry", className: cn(...columnClasses, "[&>*]:mb-[var(--masonry-gap)] [&>*]:break-inside-avoid", className), style: {
|
|
78
|
+
columnGap: gap,
|
|
79
|
+
"--masonry-gap": gap,
|
|
80
|
+
...style,
|
|
81
|
+
}, ...props }));
|
|
82
|
+
});
|
|
83
|
+
Masonry.displayName = "Masonry";
|
|
84
|
+
//# sourceMappingURL=masonry.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as MenubarPrimitive from "@radix-ui/react-menubar";
|
|
2
|
+
import { type HTMLAttributes } from "react";
|
|
3
|
+
export declare const MenubarMenu: {
|
|
4
|
+
(props: MenubarPrimitive.MenubarMenuProps & {
|
|
5
|
+
__scopeMenubar?: import("@radix-ui/react-context").Scope;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const MenubarGroup: import("react").ForwardRefExoticComponent<MenubarPrimitive.MenubarGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export declare const MenubarPortal: import("react").FC<MenubarPrimitive.MenubarPortalProps>;
|
|
11
|
+
export declare const MenubarSub: import("react").FC<MenubarPrimitive.MenubarSubProps>;
|
|
12
|
+
export declare const MenubarRadioGroup: import("react").ForwardRefExoticComponent<MenubarPrimitive.MenubarRadioGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export declare const Menubar: import("react").ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export declare const MenubarTrigger: import("react").ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarTriggerProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
15
|
+
export declare const MenubarSubTrigger: import("react").ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSubTriggerProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
16
|
+
inset?: boolean;
|
|
17
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
18
|
+
export declare const MenubarSubContent: import("react").ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSubContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
19
|
+
export declare const MenubarContent: import("react").ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
20
|
+
export declare const MenubarItem: import("react").ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
21
|
+
inset?: boolean;
|
|
22
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
23
|
+
export declare const MenubarCheckboxItem: import("react").ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarCheckboxItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
24
|
+
export declare const MenubarRadioItem: import("react").ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarRadioItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
25
|
+
export declare const MenubarLabel: import("react").ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarLabelProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
26
|
+
inset?: boolean;
|
|
27
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
28
|
+
export declare const MenubarSeparator: import("react").ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSeparatorProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
29
|
+
export declare const MenubarShortcut: {
|
|
30
|
+
({ className, ...props }: HTMLAttributes<HTMLSpanElement>): import("react").JSX.Element;
|
|
31
|
+
displayName: string;
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=menubar.d.ts.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as MenubarPrimitive from "@radix-ui/react-menubar";
|
|
4
|
+
import { Check, ChevronRight, Circle } from "lucide-react";
|
|
5
|
+
import { forwardRef, } from "react";
|
|
6
|
+
import { cn } from "../lib/cn.js";
|
|
7
|
+
export const MenubarMenu = MenubarPrimitive.Menu;
|
|
8
|
+
export const MenubarGroup = MenubarPrimitive.Group;
|
|
9
|
+
export const MenubarPortal = MenubarPrimitive.Portal;
|
|
10
|
+
export const MenubarSub = MenubarPrimitive.Sub;
|
|
11
|
+
export const MenubarRadioGroup = MenubarPrimitive.RadioGroup;
|
|
12
|
+
export const Menubar = forwardRef(({ className, ...props }, ref) => {
|
|
13
|
+
return (_jsx(MenubarPrimitive.Root, { ref: ref, "data-slot": "menubar", className: cn("flex items-center gap-1 rounded-md border border-border bg-surface-floating p-1 shadow-xs", className), ...props }));
|
|
14
|
+
});
|
|
15
|
+
Menubar.displayName = "Menubar";
|
|
16
|
+
export const MenubarTrigger = forwardRef(({ className, ...props }, ref) => {
|
|
17
|
+
return (_jsx(MenubarPrimitive.Trigger, { ref: ref, "data-slot": "menubar-trigger", className: cn("flex cursor-default select-none items-center rounded-md px-3 py-1 text-sm font-medium outline-none transition-colors focus:bg-surface-overlay focus:text-fg data-[state=open]:bg-surface-overlay data-[state=open]:text-fg", className), ...props }));
|
|
18
|
+
});
|
|
19
|
+
MenubarTrigger.displayName = "MenubarTrigger";
|
|
20
|
+
export const MenubarSubTrigger = forwardRef(({ className, inset, children, ...props }, ref) => {
|
|
21
|
+
return (_jsxs(MenubarPrimitive.SubTrigger, { ref: ref, "data-slot": "menubar-sub-trigger", className: cn("relative flex cursor-default select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none transition-colors focus:bg-surface-overlay focus:text-fg data-[state=open]:bg-surface-overlay data-[disabled]:opacity-50 data-[disabled]:pointer-events-none [&_svg]:size-4", inset && "ps-8", className), ...props, children: [children, _jsx(ChevronRight, { className: "ms-auto" })] }));
|
|
22
|
+
});
|
|
23
|
+
MenubarSubTrigger.displayName = "MenubarSubTrigger";
|
|
24
|
+
export const MenubarSubContent = forwardRef(({ className, ...props }, ref) => {
|
|
25
|
+
return (_jsx(MenubarPrimitive.SubContent, { ref: ref, "data-slot": "menubar-sub-content", className: cn("z-50 min-w-[8rem] overflow-hidden rounded-lg border border-border bg-surface-floating p-1 text-fg shadow-lg data-[state=open]:animate-[cronus-pop-in_180ms_var(--ease-out-quart)_both] data-[state=closed]:animate-[cronus-pop-out_140ms_var(--ease-out-quart)_both]", className), ...props }));
|
|
26
|
+
});
|
|
27
|
+
MenubarSubContent.displayName = "MenubarSubContent";
|
|
28
|
+
export const MenubarContent = forwardRef(({ className, align = "start", alignOffset = -4, sideOffset = 8, ...props }, ref) => {
|
|
29
|
+
return (_jsx(MenubarPrimitive.Portal, { children: _jsx(MenubarPrimitive.Content, { ref: ref, "data-slot": "menubar-content", align: align, alignOffset: alignOffset, sideOffset: sideOffset, className: cn("z-50 min-w-[12rem] overflow-hidden rounded-lg border border-border bg-surface-floating p-1 text-fg shadow-lg data-[state=open]:animate-[cronus-pop-in_180ms_var(--ease-out-quart)_both] data-[state=closed]:animate-[cronus-pop-out_140ms_var(--ease-out-quart)_both]", className), ...props }) }));
|
|
30
|
+
});
|
|
31
|
+
MenubarContent.displayName = "MenubarContent";
|
|
32
|
+
export const MenubarItem = forwardRef(({ className, inset, ...props }, ref) => {
|
|
33
|
+
return (_jsx(MenubarPrimitive.Item, { ref: ref, "data-slot": "menubar-item", className: cn("relative flex cursor-default select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none transition-colors focus:bg-surface-overlay focus:text-fg data-[disabled]:opacity-50 data-[disabled]:pointer-events-none [&_svg]:size-4", inset && "ps-8", className), ...props }));
|
|
34
|
+
});
|
|
35
|
+
MenubarItem.displayName = "MenubarItem";
|
|
36
|
+
export const MenubarCheckboxItem = forwardRef(({ className, children, checked, ...props }, ref) => {
|
|
37
|
+
return (_jsxs(MenubarPrimitive.CheckboxItem, { ref: ref, "data-slot": "menubar-checkbox-item", checked: checked, className: cn("relative flex cursor-default select-none items-center gap-2 rounded-md py-1.5 pe-2 ps-8 text-sm outline-none transition-colors focus:bg-surface-overlay focus:text-fg data-[disabled]:opacity-50 data-[disabled]:pointer-events-none [&_svg]:size-4", className), ...props, children: [_jsx("span", { className: "absolute start-2 flex size-4 items-center justify-center", children: _jsx(MenubarPrimitive.ItemIndicator, { children: _jsx(Check, { className: "size-4" }) }) }), children] }));
|
|
38
|
+
});
|
|
39
|
+
MenubarCheckboxItem.displayName = "MenubarCheckboxItem";
|
|
40
|
+
export const MenubarRadioItem = forwardRef(({ className, children, ...props }, ref) => {
|
|
41
|
+
return (_jsxs(MenubarPrimitive.RadioItem, { ref: ref, "data-slot": "menubar-radio-item", className: cn("relative flex cursor-default select-none items-center gap-2 rounded-md py-1.5 pe-2 ps-8 text-sm outline-none transition-colors focus:bg-surface-overlay focus:text-fg data-[disabled]:opacity-50 data-[disabled]:pointer-events-none [&_svg]:size-4", className), ...props, children: [_jsx("span", { className: "absolute start-2 flex size-4 items-center justify-center", children: _jsx(MenubarPrimitive.ItemIndicator, { children: _jsx(Circle, { className: "size-2 fill-current" }) }) }), children] }));
|
|
42
|
+
});
|
|
43
|
+
MenubarRadioItem.displayName = "MenubarRadioItem";
|
|
44
|
+
export const MenubarLabel = forwardRef(({ className, inset, ...props }, ref) => {
|
|
45
|
+
return (_jsx(MenubarPrimitive.Label, { ref: ref, "data-slot": "menubar-label", className: cn("px-2 py-1.5 text-xs text-fg-tertiary", inset && "ps-8", className), ...props }));
|
|
46
|
+
});
|
|
47
|
+
MenubarLabel.displayName = "MenubarLabel";
|
|
48
|
+
export const MenubarSeparator = forwardRef(({ className, ...props }, ref) => {
|
|
49
|
+
return (_jsx(MenubarPrimitive.Separator, { ref: ref, "data-slot": "menubar-separator", className: cn("-mx-1 my-1 h-px bg-border", className), ...props }));
|
|
50
|
+
});
|
|
51
|
+
MenubarSeparator.displayName = "MenubarSeparator";
|
|
52
|
+
export const MenubarShortcut = ({ className, ...props }) => {
|
|
53
|
+
return (_jsx("span", { "data-slot": "menubar-shortcut", className: cn("ms-auto text-xs tracking-widest text-fg-tertiary", className), ...props }));
|
|
54
|
+
};
|
|
55
|
+
MenubarShortcut.displayName = "MenubarShortcut";
|
|
56
|
+
//# sourceMappingURL=menubar.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { HTMLAttributes, Ref } from "react";
|
|
2
|
+
export interface MeteorsProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
ref?: Ref<HTMLDivElement>;
|
|
4
|
+
/**
|
|
5
|
+
* Number of shooting stars. Clamped to `1–60`.
|
|
6
|
+
* @default 20
|
|
7
|
+
*/
|
|
8
|
+
count?: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A field of thin shooting-star trails that drift diagonally across a surface.
|
|
12
|
+
* Positions and timings are derived from the meteor index (no `Math.random`),
|
|
13
|
+
* so server and client paint the same field. Decorative and fully suppressed
|
|
14
|
+
* under `prefers-reduced-motion: reduce`.
|
|
15
|
+
*/
|
|
16
|
+
export declare function Meteors({ ref, className, children, count, style, ...props }: MeteorsProps): import("react").JSX.Element;
|
|
17
|
+
export declare namespace Meteors {
|
|
18
|
+
var displayName: string;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=meteors.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
/**
|
|
4
|
+
* Travel is along the meteor's local X after `--meteor-angle`. The animation
|
|
5
|
+
* must set `rotate(...)` itself — a class `-rotate-45` is overwritten by
|
|
6
|
+
* `@keyframes { transform }` and the streak then slides sideways as a
|
|
7
|
+
* horizontal dash.
|
|
8
|
+
*/
|
|
9
|
+
const METEOR_KEYFRAMES = "@keyframes cronus-meteor{0%{transform:rotate(var(--meteor-angle)) translate3d(0,0,0);opacity:0}7%{opacity:1}78%{opacity:1;transform:rotate(var(--meteor-angle)) translate3d(calc(var(--meteor-travel)*0.86),0,0)}88%{opacity:0.55;transform:rotate(var(--meteor-angle)) translate3d(var(--meteor-travel),0,0) scale(1.85)}100%{transform:rotate(var(--meteor-angle)) translate3d(var(--meteor-travel),0,0) scale(0.12);opacity:0}}";
|
|
10
|
+
function finiteOr(value, fallback) {
|
|
11
|
+
return Number.isFinite(value) ? value : fallback;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A field of thin shooting-star trails that drift diagonally across a surface.
|
|
15
|
+
* Positions and timings are derived from the meteor index (no `Math.random`),
|
|
16
|
+
* so server and client paint the same field. Decorative and fully suppressed
|
|
17
|
+
* under `prefers-reduced-motion: reduce`.
|
|
18
|
+
*/
|
|
19
|
+
export function Meteors({ ref, className, children, count = 20, style, ...props }) {
|
|
20
|
+
const meteorCount = Math.min(60, Math.max(1, Math.round(finiteOr(count, 20))));
|
|
21
|
+
return (_jsxs("div", { ref: ref, "data-slot": "meteors", className: cn("relative overflow-hidden", className), style: style, ...props, children: [_jsxs("div", { "aria-hidden": "true", className: "pointer-events-none absolute inset-0 motion-reduce:hidden", children: [_jsx("style", { children: METEOR_KEYFRAMES }), Array.from({ length: meteorCount }, (_, index) => {
|
|
22
|
+
// Spawn along the top / upper-right so travel at ~125° (down-left)
|
|
23
|
+
// crosses the field and exits through the bottom.
|
|
24
|
+
const meteorStyle = {
|
|
25
|
+
insetBlockStart: `${-14 + ((index * 17) % 32)}%`,
|
|
26
|
+
insetInlineStart: `${8 + ((index * 43) % 92)}%`,
|
|
27
|
+
"--meteor-delay": `${((index * 13) % 80) / 10}s`,
|
|
28
|
+
"--meteor-duration": `${1.8 + ((index * 7) % 22) / 10}s`,
|
|
29
|
+
"--meteor-travel": `${340 + ((index * 29) % 220)}px`,
|
|
30
|
+
"--meteor-angle": `${122 + ((index * 11) % 16)}deg`,
|
|
31
|
+
};
|
|
32
|
+
return (_jsx("span", { className: "absolute h-px w-16 origin-left [animation-delay:var(--meteor-delay)] [animation-duration:var(--meteor-duration)] [animation-iteration-count:infinite] [animation-name:cronus-meteor] [animation-timing-function:linear]", style: {
|
|
33
|
+
...meteorStyle,
|
|
34
|
+
background: "linear-gradient(to right, transparent, color-mix(in oklch, var(--cronus-fg) 85%, transparent))",
|
|
35
|
+
} }, index));
|
|
36
|
+
})] }), _jsx("div", { className: "relative", children: children })] }));
|
|
37
|
+
}
|
|
38
|
+
Meteors.displayName = "Meteors";
|
|
39
|
+
//# sourceMappingURL=meteors.js.map
|