@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,143 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { closestCorners, DndContext, DragOverlay, KeyboardSensor, PointerSensor, pointerWithin, useDroppable, useSensor, useSensors, } from "@dnd-kit/core";
|
|
4
|
+
import { SortableContext, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy, } from "@dnd-kit/sortable";
|
|
5
|
+
import { CSS } from "@dnd-kit/utilities";
|
|
6
|
+
import { GripVertical } from "lucide-react";
|
|
7
|
+
import { forwardRef, useCallback, useMemo, useState, } from "react";
|
|
8
|
+
import { cn } from "../lib/cn.js";
|
|
9
|
+
import { Badge } from "./badge.js";
|
|
10
|
+
/** Locate which column an id belongs to. The id may be an item or a column. */
|
|
11
|
+
function findColumnId(columns, id) {
|
|
12
|
+
const idStr = String(id);
|
|
13
|
+
if (columns.some((column) => column.id === idStr))
|
|
14
|
+
return idStr;
|
|
15
|
+
return columns.find((column) => column.items.some((item) => item.id === idStr))?.id;
|
|
16
|
+
}
|
|
17
|
+
function getItem(columns, id) {
|
|
18
|
+
const idStr = String(id);
|
|
19
|
+
for (const column of columns) {
|
|
20
|
+
const found = column.items.find((item) => item.id === idStr);
|
|
21
|
+
if (found)
|
|
22
|
+
return found;
|
|
23
|
+
}
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Move/reorder an item into a target column at the index implied by `overId`.
|
|
28
|
+
* Returns a new columns array (never mutates the input) or the same reference
|
|
29
|
+
* when nothing would change.
|
|
30
|
+
*/
|
|
31
|
+
function moveItem(columns, activeId, overId) {
|
|
32
|
+
const fromColumnId = findColumnId(columns, activeId);
|
|
33
|
+
const toColumnId = findColumnId(columns, overId);
|
|
34
|
+
if (!fromColumnId || !toColumnId)
|
|
35
|
+
return columns;
|
|
36
|
+
const fromColumn = columns.find((column) => column.id === fromColumnId);
|
|
37
|
+
const toColumn = columns.find((column) => column.id === toColumnId);
|
|
38
|
+
if (!fromColumn || !toColumn)
|
|
39
|
+
return columns;
|
|
40
|
+
const fromIndex = fromColumn.items.findIndex((item) => item.id === String(activeId));
|
|
41
|
+
if (fromIndex < 0)
|
|
42
|
+
return columns;
|
|
43
|
+
const moved = fromColumn.items[fromIndex];
|
|
44
|
+
if (!moved)
|
|
45
|
+
return columns;
|
|
46
|
+
// Index of the card being hovered, or append to the end when hovering the
|
|
47
|
+
// column itself (e.g. an empty column or the gap below the last card).
|
|
48
|
+
const overIsColumn = toColumn.id === String(overId);
|
|
49
|
+
const overIndex = overIsColumn
|
|
50
|
+
? toColumn.items.length
|
|
51
|
+
: toColumn.items.findIndex((item) => item.id === String(overId));
|
|
52
|
+
if (fromColumnId === toColumnId) {
|
|
53
|
+
if (overIndex < 0 || overIndex === fromIndex)
|
|
54
|
+
return columns;
|
|
55
|
+
const nextItems = [...fromColumn.items];
|
|
56
|
+
nextItems.splice(fromIndex, 1);
|
|
57
|
+
// `overIndex` is computed against the original array; after removing the
|
|
58
|
+
// moved card the same target index lands the card where it was hovered.
|
|
59
|
+
nextItems.splice(overIndex, 0, moved);
|
|
60
|
+
return columns.map((column) => column.id === fromColumnId ? { ...column, items: nextItems } : column);
|
|
61
|
+
}
|
|
62
|
+
const nextFrom = [...fromColumn.items];
|
|
63
|
+
nextFrom.splice(fromIndex, 1);
|
|
64
|
+
const insertAt = overIndex < 0 ? toColumn.items.length : overIndex;
|
|
65
|
+
const nextTo = [...toColumn.items];
|
|
66
|
+
nextTo.splice(insertAt, 0, moved);
|
|
67
|
+
return columns.map((column) => {
|
|
68
|
+
if (column.id === fromColumnId)
|
|
69
|
+
return { ...column, items: nextFrom };
|
|
70
|
+
if (column.id === toColumnId)
|
|
71
|
+
return { ...column, items: nextTo };
|
|
72
|
+
return column;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function defaultRenderItem(item) {
|
|
76
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { "data-slot": "kanban-card-title", className: "block font-medium leading-snug text-fg", children: item.title }), item.description != null ? (_jsx("span", { "data-slot": "kanban-card-description", className: "mt-1 block text-sm leading-snug text-fg-secondary", children: item.description })) : null] }));
|
|
77
|
+
}
|
|
78
|
+
function KanbanCard({ item, render }) {
|
|
79
|
+
const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({
|
|
80
|
+
id: item.id,
|
|
81
|
+
});
|
|
82
|
+
const style = {
|
|
83
|
+
transform: CSS.Transform.toString(transform),
|
|
84
|
+
transition,
|
|
85
|
+
};
|
|
86
|
+
return (_jsxs("li", { ref: setNodeRef, "data-slot": "kanban-card", "data-dragging": isDragging || undefined, style: style, className: cn("group flex items-start gap-2 rounded-lg border border-border bg-surface-raised p-3 text-fg shadow-sm", "transition-[border-color,box-shadow] focus-within:border-border-strong", isDragging && "opacity-40"), children: [_jsx("button", { type: "button", "data-slot": "kanban-drag-handle", className: cn("mt-0.5 shrink-0 cursor-grab touch-none rounded-md p-0.5 text-fg-muted", "outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-raised active:cursor-grabbing hover:text-fg [&_svg]:size-4"), "aria-label": "Reordenar cart\u00E3o", ...attributes, ...listeners, children: _jsx(GripVertical, { "aria-hidden": "true" }) }), _jsx("div", { "data-slot": "kanban-card-body", className: "min-w-0 flex-1", children: render(item) })] }));
|
|
87
|
+
}
|
|
88
|
+
function KanbanColumnView({ column, render }) {
|
|
89
|
+
// Make the whole column a droppable target so cards can be dropped into an
|
|
90
|
+
// empty column (where there is no card to hover over).
|
|
91
|
+
const { setNodeRef, isOver } = useDroppable({ id: column.id });
|
|
92
|
+
const itemIds = useMemo(() => column.items.map((item) => item.id), [column.items]);
|
|
93
|
+
return (_jsxs("section", { "data-slot": "kanban-column", "aria-label": typeof column.title === "string" ? column.title : undefined, className: "flex w-72 shrink-0 flex-col rounded-xl border border-border bg-surface-inset", children: [_jsxs("header", { "data-slot": "kanban-column-header", className: "flex items-center justify-between gap-2 px-3 py-2.5", children: [_jsx("h3", { "data-slot": "kanban-column-title", className: "min-w-0 truncate font-display text-sm font-semibold text-fg", children: column.title }), _jsx(Badge, { variant: "secondary", "data-slot": "kanban-column-count", children: column.items.length })] }), _jsx(SortableContext, { items: itemIds, strategy: verticalListSortingStrategy, children: _jsx("ul", { ref: setNodeRef, "data-slot": "kanban-column-list", "data-over": isOver || undefined, className: cn("flex min-h-24 flex-1 flex-col gap-2 overflow-y-auto rounded-b-xl p-2", "transition-colors data-[over]:bg-surface-overlay/60"), children: column.items.map((item) => (_jsx(KanbanCard, { item: item, render: render }, item.id))) }) })] }));
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* A drag-and-drop board: columns of cards that reorder within a column and
|
|
97
|
+
* move across columns. Controlled via `columns` / `onColumnsChange` — the
|
|
98
|
+
* consumer owns state. SSR-safe (no effects run on the server).
|
|
99
|
+
*/
|
|
100
|
+
export const Kanban = forwardRef(({ columns, onColumnsChange, renderItem, className, ...props }, ref) => {
|
|
101
|
+
const [activeId, setActiveId] = useState(null);
|
|
102
|
+
const render = renderItem ?? defaultRenderItem;
|
|
103
|
+
const sensors = useSensors(useSensor(PointerSensor, { activationConstraint: { distance: 4 } }), useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }));
|
|
104
|
+
// Prefer pointer-within (precise over empty columns), falling back to the
|
|
105
|
+
// closest corners so dropping near a card still resolves a target.
|
|
106
|
+
const collisionDetection = useCallback((args) => {
|
|
107
|
+
const pointerCollisions = pointerWithin(args);
|
|
108
|
+
return pointerCollisions.length > 0 ? pointerCollisions : closestCorners(args);
|
|
109
|
+
}, []);
|
|
110
|
+
const activeItem = activeId != null ? getItem(columns, activeId) : undefined;
|
|
111
|
+
const handleDragStart = useCallback((event) => {
|
|
112
|
+
setActiveId(event.active.id);
|
|
113
|
+
}, []);
|
|
114
|
+
const handleDragOver = useCallback((event) => {
|
|
115
|
+
const { active, over } = event;
|
|
116
|
+
if (!over)
|
|
117
|
+
return;
|
|
118
|
+
const fromColumnId = findColumnId(columns, active.id);
|
|
119
|
+
const toColumnId = findColumnId(columns, over.id);
|
|
120
|
+
// Only handle cross-column transfers live; same-column ordering is
|
|
121
|
+
// committed on drop to avoid thrashing while hovering.
|
|
122
|
+
if (!fromColumnId || !toColumnId || fromColumnId === toColumnId)
|
|
123
|
+
return;
|
|
124
|
+
const next = moveItem(columns, active.id, over.id);
|
|
125
|
+
if (next !== columns)
|
|
126
|
+
onColumnsChange(next);
|
|
127
|
+
}, [columns, onColumnsChange]);
|
|
128
|
+
const handleDragEnd = useCallback((event) => {
|
|
129
|
+
setActiveId(null);
|
|
130
|
+
const { active, over } = event;
|
|
131
|
+
if (!over)
|
|
132
|
+
return;
|
|
133
|
+
const next = moveItem(columns, active.id, over.id);
|
|
134
|
+
if (next !== columns)
|
|
135
|
+
onColumnsChange(next);
|
|
136
|
+
}, [columns, onColumnsChange]);
|
|
137
|
+
const handleDragCancel = useCallback(() => {
|
|
138
|
+
setActiveId(null);
|
|
139
|
+
}, []);
|
|
140
|
+
return (_jsxs(DndContext, { sensors: sensors, collisionDetection: collisionDetection, onDragStart: handleDragStart, onDragOver: handleDragOver, onDragEnd: handleDragEnd, onDragCancel: handleDragCancel, children: [_jsx("div", { ref: ref, "data-slot": "kanban", className: cn("flex w-full gap-4 overflow-x-auto pb-2", className), ...props, children: columns.map((column) => (_jsx(KanbanColumnView, { column: column, render: render }, column.id))) }), _jsx(DragOverlay, { children: activeItem ? (_jsxs("div", { "data-slot": "kanban-card-overlay", className: cn("flex w-72 items-start gap-2 rounded-lg border border-border-strong", "bg-surface-overlay p-3 text-fg shadow-lg ring-1 ring-ring/40"), children: [_jsx("span", { className: "mt-0.5 shrink-0 text-fg-muted [&_svg]:size-4", children: _jsx(GripVertical, { "aria-hidden": "true" }) }), _jsx("div", { className: "min-w-0 flex-1", children: render(activeItem) })] })) : null })] }));
|
|
141
|
+
});
|
|
142
|
+
Kanban.displayName = "Kanban";
|
|
143
|
+
//# sourceMappingURL=kanban.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { cn } from "../lib/cn.js";
|
|
4
|
+
export const Kbd = forwardRef(({ className, ...props }, ref) => {
|
|
5
|
+
return (_jsx("kbd", { ref: ref, "data-slot": "kbd", className: cn("inline-flex h-5 min-w-5 items-center justify-center gap-1 rounded-md border border-border bg-surface-overlay px-1.5 font-mono text-[0.7rem] font-medium text-fg-secondary", className), ...props }));
|
|
6
|
+
});
|
|
7
|
+
Kbd.displayName = "Kbd";
|
|
8
|
+
//# sourceMappingURL=kbd.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
2
|
+
export declare const Label: import("react").ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & import("react").RefAttributes<HTMLLabelElement>, "ref"> & import("react").RefAttributes<HTMLLabelElement>>;
|
|
3
|
+
//# sourceMappingURL=label.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { cn } from "../lib/cn.js";
|
|
5
|
+
export const Label = forwardRef(({ className, ...props }, ref) => {
|
|
6
|
+
return (_jsx(LabelPrimitive.Root, { ref: ref, "data-slot": "label", className: cn("text-sm font-medium text-fg leading-none select-none", "peer-disabled:opacity-50 peer-disabled:cursor-not-allowed", className), ...props }));
|
|
7
|
+
});
|
|
8
|
+
Label.displayName = "Label";
|
|
9
|
+
//# sourceMappingURL=label.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { HTMLAttributes, Ref } from "react";
|
|
2
|
+
export interface LightRaysProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
ref?: Ref<HTMLDivElement>;
|
|
4
|
+
/**
|
|
5
|
+
* Seconds for one full rotation of the ray fan.
|
|
6
|
+
* @default 18
|
|
7
|
+
*/
|
|
8
|
+
duration?: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Volumetric light rays fanning from the top of a surface. A rotating conic
|
|
12
|
+
* gradient is masked into a radial falloff so the beams read as shafts of
|
|
13
|
+
* light, not a spinning disc. Decorative and paused under reduced motion.
|
|
14
|
+
*/
|
|
15
|
+
export declare function LightRays({ ref, className, children, duration, style, ...props }: LightRaysProps): import("react").JSX.Element;
|
|
16
|
+
export declare namespace LightRays {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=light-rays.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
const RAYS_KEYFRAMES = "@keyframes cronus-light-rays{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}";
|
|
4
|
+
function finiteOr(value, fallback) {
|
|
5
|
+
return Number.isFinite(value) ? value : fallback;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Volumetric light rays fanning from the top of a surface. A rotating conic
|
|
9
|
+
* gradient is masked into a radial falloff so the beams read as shafts of
|
|
10
|
+
* light, not a spinning disc. Decorative and paused under reduced motion.
|
|
11
|
+
*/
|
|
12
|
+
export function LightRays({ ref, className, children, duration = 18, style, ...props }) {
|
|
13
|
+
const cycle = Math.max(4, finiteOr(duration, 18));
|
|
14
|
+
const raysStyle = { "--rays-duration": `${cycle}s` };
|
|
15
|
+
return (_jsxs("div", { ref: ref, "data-slot": "light-rays", className: cn("relative overflow-hidden", className), style: { ...raysStyle, ...style }, ...props, children: [_jsxs("div", { "aria-hidden": "true", className: "pointer-events-none absolute inset-0 overflow-hidden motion-reduce:hidden", children: [_jsx("style", { children: RAYS_KEYFRAMES }), _jsx("div", { className: "absolute -inset-1/2 [animation-duration:var(--rays-duration)] [animation-iteration-count:infinite] [animation-name:cronus-light-rays] [animation-timing-function:linear] [mask-image:radial-gradient(ellipse_at_center,black_20%,transparent_70%)]", style: {
|
|
16
|
+
background: "repeating-conic-gradient(from 0deg, color-mix(in oklch, var(--cronus-primary) 22%, transparent) 0deg 6deg, transparent 6deg 28deg)",
|
|
17
|
+
} })] }), _jsx("div", { className: "relative", children: children })] }));
|
|
18
|
+
}
|
|
19
|
+
LightRays.displayName = "LightRays";
|
|
20
|
+
//# sourceMappingURL=light-rays.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type HTMLAttributes } from "react";
|
|
2
|
+
export interface LightboxImage {
|
|
3
|
+
src: string;
|
|
4
|
+
alt: string;
|
|
5
|
+
caption?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface LightboxProps extends HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
/** The images to display in the gallery. */
|
|
9
|
+
images: LightboxImage[];
|
|
10
|
+
/** Controlled open state. */
|
|
11
|
+
open?: boolean;
|
|
12
|
+
/** Called when the open state should change. */
|
|
13
|
+
onOpenChange?: (open: boolean) => void;
|
|
14
|
+
/** Uncontrolled initial open state. */
|
|
15
|
+
defaultOpen?: boolean;
|
|
16
|
+
/** Controlled active image index. */
|
|
17
|
+
index?: number;
|
|
18
|
+
/** Called when the active index should change. */
|
|
19
|
+
onIndexChange?: (index: number) => void;
|
|
20
|
+
/** Uncontrolled initial index. */
|
|
21
|
+
defaultIndex?: number;
|
|
22
|
+
}
|
|
23
|
+
export declare const Lightbox: import("react").ForwardRefExoticComponent<LightboxProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
24
|
+
//# sourceMappingURL=lightbox.d.ts.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ChevronLeft, ChevronRight, X } from "lucide-react";
|
|
4
|
+
import { forwardRef, useCallback, useEffect, useState } from "react";
|
|
5
|
+
import { cn } from "../lib/cn.js";
|
|
6
|
+
import { Dialog, DialogClose, DialogContent } from "./dialog.js";
|
|
7
|
+
export const Lightbox = forwardRef(({ className, images, open, onOpenChange, defaultOpen = false, index, onIndexChange, defaultIndex = 0, ...props }, ref) => {
|
|
8
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
|
|
9
|
+
const isOpenControlled = open !== undefined;
|
|
10
|
+
const isOpen = isOpenControlled ? open : uncontrolledOpen;
|
|
11
|
+
const [uncontrolledIndex, setUncontrolledIndex] = useState(defaultIndex);
|
|
12
|
+
const isIndexControlled = index !== undefined;
|
|
13
|
+
const currentIndex = isIndexControlled ? index : uncontrolledIndex;
|
|
14
|
+
const count = images.length;
|
|
15
|
+
const clampedIndex = count > 0 ? Math.min(Math.max(currentIndex, 0), count - 1) : 0;
|
|
16
|
+
const setOpen = useCallback((next) => {
|
|
17
|
+
if (!isOpenControlled)
|
|
18
|
+
setUncontrolledOpen(next);
|
|
19
|
+
onOpenChange?.(next);
|
|
20
|
+
}, [isOpenControlled, onOpenChange]);
|
|
21
|
+
const setIndex = useCallback((next) => {
|
|
22
|
+
if (count === 0)
|
|
23
|
+
return;
|
|
24
|
+
const clamped = Math.min(Math.max(next, 0), count - 1);
|
|
25
|
+
if (!isIndexControlled)
|
|
26
|
+
setUncontrolledIndex(clamped);
|
|
27
|
+
onIndexChange?.(clamped);
|
|
28
|
+
}, [count, isIndexControlled, onIndexChange]);
|
|
29
|
+
const current = images[clampedIndex];
|
|
30
|
+
const goPrev = useCallback(() => setIndex(clampedIndex - 1), [setIndex, clampedIndex]);
|
|
31
|
+
const goNext = useCallback(() => setIndex(clampedIndex + 1), [setIndex, clampedIndex]);
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (!isOpen)
|
|
34
|
+
return;
|
|
35
|
+
const handler = (event) => {
|
|
36
|
+
if (event.key === "ArrowLeft") {
|
|
37
|
+
event.preventDefault();
|
|
38
|
+
goPrev();
|
|
39
|
+
}
|
|
40
|
+
else if (event.key === "ArrowRight") {
|
|
41
|
+
event.preventDefault();
|
|
42
|
+
goNext();
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
document.addEventListener("keydown", handler);
|
|
46
|
+
return () => document.removeEventListener("keydown", handler);
|
|
47
|
+
}, [isOpen, goPrev, goNext]);
|
|
48
|
+
const atStart = clampedIndex <= 0;
|
|
49
|
+
const atEnd = clampedIndex >= count - 1;
|
|
50
|
+
return (_jsx(Dialog, { open: isOpen, onOpenChange: setOpen, children: _jsx(DialogContent
|
|
51
|
+
// The header renders its own dark-themed close, so suppress the
|
|
52
|
+
// dialog's default light-theme one.
|
|
53
|
+
, {
|
|
54
|
+
// The header renders its own dark-themed close, so suppress the
|
|
55
|
+
// dialog's default light-theme one.
|
|
56
|
+
showCloseButton: false, className: "inset-0 h-full max-w-full rounded-none border-none bg-black/95 p-0 text-white", "aria-label": "Image gallery", children: _jsxs("div", { ref: ref, "data-slot": "lightbox", className: cn("flex h-full w-full flex-col", className), ...props, children: [_jsxs("div", { className: "flex items-center justify-between gap-2 p-4", children: [_jsx("span", { "data-slot": "lightbox-counter", className: "text-sm text-white/70", children: count > 0 ? `${clampedIndex + 1} / ${count}` : "0 / 0" }), _jsx(DialogClose, { "data-slot": "lightbox-close", "aria-label": "Close", className: "rounded-md p-1.5 text-white/70 outline-none transition-colors hover:bg-white/10 hover:text-white focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset", children: _jsx(X, { className: "size-5" }) })] }), _jsxs("div", { className: "relative flex min-h-0 flex-1 items-center justify-center px-2", children: [_jsx("button", { type: "button", "aria-label": "Previous image", onClick: goPrev, disabled: atStart, className: "absolute left-2 z-10 rounded-full bg-black/40 p-2 text-white/80 outline-none transition-colors hover:bg-black/60 hover:text-white focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset disabled:pointer-events-none disabled:opacity-40", children: _jsx(ChevronLeft, { className: "size-6" }) }), current ? (_jsx("img", { "data-slot": "lightbox-image", src: current.src, alt: current.alt, className: "max-h-full max-w-full object-contain" })) : null, _jsx("button", { type: "button", "aria-label": "Next image", onClick: goNext, disabled: atEnd, className: "absolute right-2 z-10 rounded-full bg-black/40 p-2 text-white/80 outline-none transition-colors hover:bg-black/60 hover:text-white focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset disabled:pointer-events-none disabled:opacity-40", children: _jsx(ChevronRight, { className: "size-6" }) })] }), current?.caption ? (_jsx("p", { "data-slot": "lightbox-caption", className: "px-4 pt-3 text-center text-sm text-white/80", children: current.caption })) : null, count > 1 ? (_jsx("div", { "data-slot": "lightbox-thumbnails", className: "flex items-center justify-center gap-2 overflow-x-auto p-4", children: images.map((image, i) => (_jsx("button", { type: "button", "aria-label": `View image ${i + 1}`, "aria-current": i === clampedIndex, onClick: () => setIndex(i), className: cn(
|
|
57
|
+
// contract-ok: anel externo com literal, não ring-inset nem
|
|
58
|
+
// ring-offset-surface-*. O inset é um box-shadow interno e
|
|
59
|
+
// a <img> abaixo o cobre por inteiro — o foco sumiria. E o
|
|
60
|
+
// fundo aqui é o scrim bg-black/95 que este componente
|
|
61
|
+
// define, não um token de superfície, então branco sobre
|
|
62
|
+
// preto é o par correto (ver docs/adr/0001). O offset
|
|
63
|
+
// separa o anel da miniatura; a seleção usa anel rente,
|
|
64
|
+
// então os dois estados continuam distinguíveis.
|
|
65
|
+
"size-14 shrink-0 overflow-hidden rounded-md outline-none transition-opacity focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-offset-2 focus-visible:ring-offset-black", i === clampedIndex ? "ring-2 ring-white" : "opacity-60 hover:opacity-100"), children: _jsx("img", { src: image.src, alt: "", className: "size-full object-cover" }) }, `${image.src}-${i}`))) })) : null] }) }) }));
|
|
66
|
+
});
|
|
67
|
+
Lightbox.displayName = "Lightbox";
|
|
68
|
+
//# sourceMappingURL=lightbox.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
|
+
import { type ChartSeries } from "./chart.js";
|
|
3
|
+
export interface LineChartProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
data: Record<string, unknown>[];
|
|
5
|
+
xKey?: string;
|
|
6
|
+
series: ChartSeries[];
|
|
7
|
+
formatValue?: (value: number, name: string) => string;
|
|
8
|
+
}
|
|
9
|
+
export declare function LineChart({ data, xKey, series, formatValue, className, ...props }: LineChartProps): import("react").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=line-chart.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CartesianGrid, Line, LineChart as RechartsLineChart, XAxis } from "recharts";
|
|
3
|
+
import { cn } from "../lib/cn.js";
|
|
4
|
+
import { ChartContainer, ChartCursor, ChartTooltip, ChartTooltipContent, chartSeriesConfig, } from "./chart.js";
|
|
5
|
+
export function LineChart({ data, xKey = "date", series, formatValue, className, ...props }) {
|
|
6
|
+
const config = chartSeriesConfig(series);
|
|
7
|
+
return (_jsx("div", { "data-slot": "line-chart", className: cn("h-64 w-full", className), ...props, children: _jsx(ChartContainer, { config: config, className: "h-full w-full", children: _jsxs(RechartsLineChart, { accessibilityLayer: true, data: data, margin: { left: 8, right: 8, top: 8 }, children: [_jsx(CartesianGrid, { vertical: false, strokeDasharray: "4 4" }), _jsx(XAxis, { dataKey: xKey, tickLine: false, axisLine: false, tickMargin: 12, minTickGap: 24 }), _jsx(ChartTooltip, { cursor: _jsx(ChartCursor, { labelKey: xKey }), content: _jsx(ChartTooltipContent, { formatValue: formatValue }) }), series.map((item) => (_jsx(Line, { type: "monotone", dataKey: item.key, stroke: `var(--color-${item.key})`, strokeWidth: 2, dot: false, activeDot: { r: 4, strokeWidth: 0 }, animationDuration: 1100, animationEasing: "ease-out" }, item.key)))] }) }) }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=line-chart.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type HTMLAttributes } from "react";
|
|
2
|
+
export interface LiveLinePoint {
|
|
3
|
+
tick: number;
|
|
4
|
+
value: number;
|
|
5
|
+
}
|
|
6
|
+
export interface LiveLineChartProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
data: LiveLinePoint[];
|
|
8
|
+
interval?: number;
|
|
9
|
+
maxPoints?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function LiveLineChart({ data, interval, maxPoints, className, ...props }: LiveLineChartProps): import("react").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=live-line-chart.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
import { CartesianGrid, Line, LineChart, XAxis } from "recharts";
|
|
5
|
+
import { cn } from "../lib/cn.js";
|
|
6
|
+
import { ChartContainer, ChartCursor, ChartTooltip, ChartTooltipContent } from "./chart.js";
|
|
7
|
+
export function LiveLineChart({ data, interval = 1000, maxPoints = 24, className, ...props }) {
|
|
8
|
+
const [points, setPoints] = useState(data);
|
|
9
|
+
const visible = useRef(true);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
const reduced = window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches;
|
|
12
|
+
if (reduced)
|
|
13
|
+
return;
|
|
14
|
+
const id = window.setInterval(() => {
|
|
15
|
+
if (!visible.current)
|
|
16
|
+
return;
|
|
17
|
+
setPoints((prev) => {
|
|
18
|
+
const last = prev.at(-1);
|
|
19
|
+
const next = {
|
|
20
|
+
tick: (last?.tick ?? 0) + 1,
|
|
21
|
+
value: Math.max(0, (last?.value ?? 50) + (Math.random() - 0.48) * 8),
|
|
22
|
+
};
|
|
23
|
+
return [...prev.slice(-(maxPoints - 1)), next];
|
|
24
|
+
});
|
|
25
|
+
}, interval);
|
|
26
|
+
return () => window.clearInterval(id);
|
|
27
|
+
}, [interval, maxPoints]);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (typeof IntersectionObserver === "undefined")
|
|
30
|
+
return;
|
|
31
|
+
const root = document.querySelector("[data-slot='live-line-chart']");
|
|
32
|
+
if (!root)
|
|
33
|
+
return;
|
|
34
|
+
const io = new IntersectionObserver((entries) => {
|
|
35
|
+
visible.current = entries.some((entry) => entry.isIntersecting);
|
|
36
|
+
});
|
|
37
|
+
io.observe(root);
|
|
38
|
+
return () => io.disconnect();
|
|
39
|
+
}, []);
|
|
40
|
+
return (_jsx("div", { "data-slot": "live-line-chart", className: cn("h-64 w-full", className), ...props, children: _jsx(ChartContainer, { config: { value: { label: "Value", color: "var(--cronus-chart-1)" } }, className: "h-full w-full", children: _jsxs(LineChart, { accessibilityLayer: true, data: points, margin: { left: 8, right: 8, top: 8 }, children: [_jsx(CartesianGrid, { vertical: false, strokeDasharray: "4 4" }), _jsx(XAxis, { dataKey: "tick", tickLine: false, axisLine: false, tickMargin: 12 }), _jsx(ChartTooltip, { cursor: _jsx(ChartCursor, { labelKey: "tick" }), content: _jsx(ChartTooltipContent, {}) }), _jsx(Line, { type: "monotone", dataKey: "value", stroke: "var(--color-value)", strokeWidth: 2, dot: false, isAnimationActive: false })] }) }) }));
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=live-line-chart.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ComponentType, type HTMLAttributes, type ReactNode, type SVGProps } from "react";
|
|
2
|
+
export interface LogoCarouselItem {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
6
|
+
node?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export type LogoCarouselVariant = "ghost" | "surface";
|
|
9
|
+
export type LogoCarouselSize = "sm" | "md" | "lg";
|
|
10
|
+
export type LogoCarouselMotionPreference = "user" | "always" | "never";
|
|
11
|
+
export interface LogoCarouselProps extends HTMLAttributes<HTMLUListElement> {
|
|
12
|
+
items: LogoCarouselItem[];
|
|
13
|
+
columns?: number;
|
|
14
|
+
/** Alias kept for snippets that call this pattern `columnCount`. */
|
|
15
|
+
columnCount?: number;
|
|
16
|
+
interval?: number;
|
|
17
|
+
staggerDelay?: number;
|
|
18
|
+
pauseOnHover?: boolean;
|
|
19
|
+
ariaLabel?: string;
|
|
20
|
+
variant?: LogoCarouselVariant;
|
|
21
|
+
size?: LogoCarouselSize;
|
|
22
|
+
motionPreference?: LogoCarouselMotionPreference;
|
|
23
|
+
itemClassName?: string;
|
|
24
|
+
logoClassName?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const LogoCarousel: import("react").ForwardRefExoticComponent<LogoCarouselProps & import("react").RefAttributes<HTMLUListElement>>;
|
|
27
|
+
//# sourceMappingURL=logo-carousel.d.ts.map
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
4
|
+
import { forwardRef, useEffect, useState, } from "react";
|
|
5
|
+
import { cn } from "../lib/cn.js";
|
|
6
|
+
import { easeOutQuart } from "./motion-presets.js";
|
|
7
|
+
const MIN_INTERVAL = 800;
|
|
8
|
+
const MAX_COLUMNS = 8;
|
|
9
|
+
const COLUMN_KEYS = ["first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eighth"];
|
|
10
|
+
const itemVariantClasses = {
|
|
11
|
+
ghost: "border border-transparent bg-transparent px-3 text-fg-secondary/70 shadow-none hover:text-fg",
|
|
12
|
+
surface: "border border-border bg-surface-raised/80 px-4 text-fg-secondary shadow-sm backdrop-blur hover:text-fg",
|
|
13
|
+
};
|
|
14
|
+
const itemSizeClasses = {
|
|
15
|
+
sm: "h-12 sm:h-14",
|
|
16
|
+
md: "h-16 sm:h-20",
|
|
17
|
+
lg: "h-20 sm:h-24",
|
|
18
|
+
};
|
|
19
|
+
const logoSizeClasses = {
|
|
20
|
+
sm: "text-base sm:text-lg",
|
|
21
|
+
md: "text-xl sm:text-2xl",
|
|
22
|
+
lg: "text-4xl sm:text-6xl",
|
|
23
|
+
};
|
|
24
|
+
function finiteOr(value, fallback) {
|
|
25
|
+
return Number.isFinite(value) ? value : fallback;
|
|
26
|
+
}
|
|
27
|
+
function clamp(value, min, max) {
|
|
28
|
+
return Math.min(Math.max(value, min), max);
|
|
29
|
+
}
|
|
30
|
+
function getInitials(label) {
|
|
31
|
+
const words = label.trim().split(/\s+/).filter(Boolean);
|
|
32
|
+
if (words.length === 0)
|
|
33
|
+
return "";
|
|
34
|
+
return words
|
|
35
|
+
.slice(0, 2)
|
|
36
|
+
.map((word) => word.at(0) ?? "")
|
|
37
|
+
.join("")
|
|
38
|
+
.toUpperCase();
|
|
39
|
+
}
|
|
40
|
+
function LogoMark({ item, className, size, }) {
|
|
41
|
+
const Icon = item.icon;
|
|
42
|
+
return (_jsx("span", { "aria-hidden": "true", className: cn("inline-flex max-w-full items-center justify-center gap-2 font-display font-semibold leading-none text-current [&>svg]:shrink-0", item.node ? "whitespace-normal" : "truncate", logoSizeClasses[size], className), children: item.node ? (item.node) : Icon ? (_jsx(Icon, { className: "size-[1em] shrink-0", focusable: "false" })) : (_jsx("span", { className: "tracking-normal", children: getInitials(item.label) })) }));
|
|
43
|
+
}
|
|
44
|
+
export const LogoCarousel = forwardRef(({ className, itemClassName, logoClassName, items, columns, columnCount, interval = 2200, staggerDelay = 0.07, pauseOnHover = true, ariaLabel = "Logo carousel", variant = "ghost", size = "lg", motionPreference = "user", style, onMouseEnter, onMouseLeave, onFocus, onBlur, ...props }, ref) => {
|
|
45
|
+
const shouldReduceMotion = useReducedMotion();
|
|
46
|
+
const [activePage, setActivePage] = useState(0);
|
|
47
|
+
const [isPaused, setIsPaused] = useState(false);
|
|
48
|
+
const logos = items.filter((item) => item.id && item.label);
|
|
49
|
+
const requestedColumns = finiteOr(columnCount ?? columns ?? 3, 3);
|
|
50
|
+
const resolvedColumns = logos.length > 0
|
|
51
|
+
? clamp(Math.round(requestedColumns), 1, Math.min(MAX_COLUMNS, logos.length))
|
|
52
|
+
: 1;
|
|
53
|
+
const safeInterval = Math.max(finiteOr(interval, 2200), MIN_INTERVAL);
|
|
54
|
+
const safeStaggerDelay = Math.max(finiteOr(staggerDelay, 0.07), 0);
|
|
55
|
+
const canCycle = logos.length > resolvedColumns;
|
|
56
|
+
const motionEnabled = motionPreference === "always" || (motionPreference === "user" && !shouldReduceMotion);
|
|
57
|
+
const shouldAnimate = motionEnabled && canCycle;
|
|
58
|
+
const visibleItems = logos.length > 0
|
|
59
|
+
? Array.from({ length: resolvedColumns }, (_, columnIndex) => {
|
|
60
|
+
const item = logos[(activePage * resolvedColumns + columnIndex) % logos.length];
|
|
61
|
+
if (!item)
|
|
62
|
+
return null;
|
|
63
|
+
return {
|
|
64
|
+
item,
|
|
65
|
+
slotKey: COLUMN_KEYS[columnIndex] ?? `column-${columnIndex + 1}`,
|
|
66
|
+
columnIndex,
|
|
67
|
+
};
|
|
68
|
+
}).filter((entry) => entry !== null)
|
|
69
|
+
: [];
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
if (!shouldAnimate || isPaused)
|
|
72
|
+
return;
|
|
73
|
+
const timer = window.setInterval(() => {
|
|
74
|
+
setActivePage((current) => current + 1);
|
|
75
|
+
}, safeInterval);
|
|
76
|
+
return () => window.clearInterval(timer);
|
|
77
|
+
}, [isPaused, safeInterval, shouldAnimate]);
|
|
78
|
+
return (_jsx("ul", { ref: ref, "aria-label": ariaLabel, "aria-live": "off", "data-slot": "logo-carousel", style: { ...style, "--logo-carousel-columns": resolvedColumns }, className: cn("m-0 grid w-full list-none grid-cols-2 gap-3 p-0 sm:[grid-template-columns:repeat(var(--logo-carousel-columns),minmax(0,1fr))]", className), onMouseEnter: (event) => {
|
|
79
|
+
onMouseEnter?.(event);
|
|
80
|
+
if (pauseOnHover)
|
|
81
|
+
setIsPaused(true);
|
|
82
|
+
}, onMouseLeave: (event) => {
|
|
83
|
+
onMouseLeave?.(event);
|
|
84
|
+
if (pauseOnHover)
|
|
85
|
+
setIsPaused(false);
|
|
86
|
+
}, onFocus: (event) => {
|
|
87
|
+
onFocus?.(event);
|
|
88
|
+
if (pauseOnHover)
|
|
89
|
+
setIsPaused(true);
|
|
90
|
+
}, onBlur: (event) => {
|
|
91
|
+
onBlur?.(event);
|
|
92
|
+
if (pauseOnHover)
|
|
93
|
+
setIsPaused(false);
|
|
94
|
+
}, ...props, children: visibleItems.map(({ item, slotKey, columnIndex }) => (_jsx("li", { "aria-label": item.label, "data-slot": "logo-carousel-item", className: cn("relative flex min-w-0 items-center justify-center overflow-hidden rounded-xl transition-colors", itemVariantClasses[variant], itemSizeClasses[size], itemClassName), children: _jsx(AnimatePresence, { initial: false, mode: "popLayout", children: _jsx(motion.div, { className: "absolute inset-0 flex items-center justify-center px-4", initial: shouldAnimate ? { opacity: 0, y: 22, scale: 0.96, filter: "blur(10px)" } : false, animate: { opacity: 1, y: 0, scale: 1, filter: "blur(0px)" }, exit: shouldAnimate
|
|
95
|
+
? { opacity: 0, y: -22, scale: 0.96, filter: "blur(10px)" }
|
|
96
|
+
: undefined, transition: shouldAnimate
|
|
97
|
+
? { ...easeOutQuart, delay: columnIndex * safeStaggerDelay }
|
|
98
|
+
: { duration: 0 }, children: _jsx(LogoMark, { item: item, size: size, className: logoClassName }) }, item.id) }) }, slotKey))) }));
|
|
99
|
+
});
|
|
100
|
+
LogoCarousel.displayName = "LogoCarousel";
|
|
101
|
+
//# sourceMappingURL=logo-carousel.js.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type HTMLAttributes } from "react";
|
|
2
|
+
export interface MagneticProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* How strongly the content is pulled toward the pointer, as a fraction of
|
|
5
|
+
* the pointer's offset from the wrapper's center. `0` is inert, `1` glues
|
|
6
|
+
* the content to the cursor. Values outside `0–1` are clamped.
|
|
7
|
+
* @default 0.3
|
|
8
|
+
*/
|
|
9
|
+
strength?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Radius of the magnetic field in pixels, measured from the wrapper's
|
|
12
|
+
* center. The pull is strongest near the center and eases back to zero at
|
|
13
|
+
* this distance, so crossing the field's edge never pops. Pad the wrapper
|
|
14
|
+
* (e.g. `className="p-10"`) to give the field room beyond the content's own
|
|
15
|
+
* box — the attraction can only be felt where the wrapper is hovered.
|
|
16
|
+
* @default 120
|
|
17
|
+
*/
|
|
18
|
+
radius?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A magnetic-hover wrapper: its children are gently attracted toward the
|
|
22
|
+
* cursor while it is inside a proximity field around the wrapper's center.
|
|
23
|
+
* Classic use is a hero call-to-action or an icon row that leans into the
|
|
24
|
+
* pointer before it even lands.
|
|
25
|
+
*
|
|
26
|
+
* Mechanism: `pointermove` on the wrapper records the cursor, and a
|
|
27
|
+
* `requestAnimationFrame` loop lerps a `translate` that is written **straight
|
|
28
|
+
* to the child's `style.transform`** — pointer tracking never touches React
|
|
29
|
+
* state, so there are zero re-renders during the interaction. The pull is the
|
|
30
|
+
* pointer's offset from center scaled by {@link MagneticProps.strength} and by
|
|
31
|
+
* a linear falloff that reaches zero at {@link MagneticProps.radius}, so the
|
|
32
|
+
* attraction dissolves smoothly at the field's edge. On leave the transform is
|
|
33
|
+
* reset to zero and a short springy CSS transition (suppressed while tracking
|
|
34
|
+
* via a `data-magnetic-active` attribute) eases the content back to rest.
|
|
35
|
+
*
|
|
36
|
+
* The effect is disabled entirely under `prefers-reduced-motion: reduce` and
|
|
37
|
+
* on coarse pointers (`(pointer: coarse)` — touch has no hover to attract
|
|
38
|
+
* toward), with a `motion-reduce` CSS backstop on the transform itself.
|
|
39
|
+
* Accessibility: purely decorative — the wrapper is not a control, children
|
|
40
|
+
* keep their natural focus order and focus-visible styling, and keyboard users
|
|
41
|
+
* simply see the content at rest.
|
|
42
|
+
*/
|
|
43
|
+
export declare const Magnetic: import("react").ForwardRefExoticComponent<MagneticProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
44
|
+
//# sourceMappingURL=magnetic.d.ts.map
|