@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,9 @@
|
|
|
1
|
+
import { type HTMLAttributes } from "react";
|
|
2
|
+
export declare const Metric: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
3
|
+
export declare const MetricLabel: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export declare const MetricValue: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export interface MetricDeltaProps extends HTMLAttributes<HTMLSpanElement> {
|
|
6
|
+
trend?: "up" | "down" | "neutral";
|
|
7
|
+
}
|
|
8
|
+
export declare const MetricDelta: import("react").ForwardRefExoticComponent<MetricDeltaProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
9
|
+
//# sourceMappingURL=metric.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Minus, TrendingDown, TrendingUp } from "lucide-react";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { cn } from "../lib/cn.js";
|
|
5
|
+
export const Metric = forwardRef(({ className, ...props }, ref) => {
|
|
6
|
+
return (_jsx("div", { ref: ref, "data-slot": "metric", className: cn("flex flex-col gap-1", className), ...props }));
|
|
7
|
+
});
|
|
8
|
+
Metric.displayName = "Metric";
|
|
9
|
+
export const MetricLabel = forwardRef(({ className, ...props }, ref) => {
|
|
10
|
+
return (_jsx("div", { ref: ref, "data-slot": "metric-label", className: cn("text-xs font-medium uppercase tracking-wider text-fg-tertiary", className), ...props }));
|
|
11
|
+
});
|
|
12
|
+
MetricLabel.displayName = "MetricLabel";
|
|
13
|
+
export const MetricValue = forwardRef(({ className, ...props }, ref) => {
|
|
14
|
+
return (_jsx("div", { ref: ref, "data-slot": "metric-value", className: cn("font-display text-2xl font-semibold text-fg tabular-nums", className), ...props }));
|
|
15
|
+
});
|
|
16
|
+
MetricValue.displayName = "MetricValue";
|
|
17
|
+
// Small (`text-xs`) delta text: use the AA-tuned `*-strong` variants so the
|
|
18
|
+
// success/error trend labels clear WCAG AA on the light-theme card surfaces
|
|
19
|
+
// (plain `text-success`/`text-error` read <4.5:1 as small text there).
|
|
20
|
+
const trendStyles = {
|
|
21
|
+
up: "text-success-strong",
|
|
22
|
+
down: "text-error-strong",
|
|
23
|
+
neutral: "text-fg-tertiary",
|
|
24
|
+
};
|
|
25
|
+
const trendIcons = {
|
|
26
|
+
up: TrendingUp,
|
|
27
|
+
down: TrendingDown,
|
|
28
|
+
neutral: Minus,
|
|
29
|
+
};
|
|
30
|
+
export const MetricDelta = forwardRef(({ className, trend = "neutral", children, ...props }, ref) => {
|
|
31
|
+
const Icon = trendIcons[trend];
|
|
32
|
+
return (_jsxs("span", { ref: ref, "data-slot": "metric-delta", className: cn("inline-flex items-center gap-1 text-xs font-medium", trendStyles[trend], className), ...props, children: [_jsx(Icon, { className: "size-3.5" }), children] }));
|
|
33
|
+
});
|
|
34
|
+
MetricDelta.displayName = "MetricDelta";
|
|
35
|
+
//# sourceMappingURL=metric.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes } from "react";
|
|
2
|
+
export type ModeToggleMode = "light" | "dark";
|
|
3
|
+
export type ModeToggleSize = "sm" | "md";
|
|
4
|
+
export interface ModeToggleProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
|
|
5
|
+
/** The current color mode. The component is fully controlled — it never stores mode itself. */
|
|
6
|
+
mode: ModeToggleMode;
|
|
7
|
+
/** Called with the opposite mode when the button is activated (click, Enter or Space). */
|
|
8
|
+
onModeChange: (next: ModeToggleMode) => void;
|
|
9
|
+
/** Button footprint: `sm` (32px, 16px glyph) or `md` (36px, 20px glyph). Defaults to `md`. */
|
|
10
|
+
size?: ModeToggleSize;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* An animated light/dark mode icon-button where a single SVG sun morphs into a
|
|
14
|
+
* moon. Three CSS transitions (~300ms, house ease-out) drive the morph, all
|
|
15
|
+
* keyed off the button's `data-mode` attribute so React only swaps one string:
|
|
16
|
+
*
|
|
17
|
+
* - the core `<circle>` scales up 1.75× to become the moon disc,
|
|
18
|
+
* - the 8 sun rays scale down and fade out as a group,
|
|
19
|
+
* - a black circle inside an SVG `<mask>` slides in from the corner to carve
|
|
20
|
+
* the crescent bite out of the enlarged disc.
|
|
21
|
+
*
|
|
22
|
+
* Because the states are plain CSS classes (no JS animation loop), the morph
|
|
23
|
+
* is compositor-driven and `motion-reduce` collapses it to an instant swap.
|
|
24
|
+
* The `<mask>` id comes from `useId`, so multiple toggles can coexist on one
|
|
25
|
+
* page and SSR/client markup stay in sync.
|
|
26
|
+
*
|
|
27
|
+
* The component is deliberately theme-agnostic: it renders whatever `mode` it
|
|
28
|
+
* is given and reports the opposite via `onModeChange`. Wire it to your theme
|
|
29
|
+
* provider (e.g. `useTheme().setMode`) — it never touches the DOM root itself.
|
|
30
|
+
*/
|
|
31
|
+
export declare const ModeToggle: import("react").ForwardRefExoticComponent<ModeToggleProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
32
|
+
//# sourceMappingURL=mode-toggle.d.ts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef, useCallback, useId } from "react";
|
|
4
|
+
import { cn } from "../lib/cn.js";
|
|
5
|
+
const sizeStyles = {
|
|
6
|
+
sm: { button: "size-8", icon: "size-4" },
|
|
7
|
+
md: { button: "size-9", icon: "size-5" },
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* An animated light/dark mode icon-button where a single SVG sun morphs into a
|
|
11
|
+
* moon. Three CSS transitions (~300ms, house ease-out) drive the morph, all
|
|
12
|
+
* keyed off the button's `data-mode` attribute so React only swaps one string:
|
|
13
|
+
*
|
|
14
|
+
* - the core `<circle>` scales up 1.75× to become the moon disc,
|
|
15
|
+
* - the 8 sun rays scale down and fade out as a group,
|
|
16
|
+
* - a black circle inside an SVG `<mask>` slides in from the corner to carve
|
|
17
|
+
* the crescent bite out of the enlarged disc.
|
|
18
|
+
*
|
|
19
|
+
* Because the states are plain CSS classes (no JS animation loop), the morph
|
|
20
|
+
* is compositor-driven and `motion-reduce` collapses it to an instant swap.
|
|
21
|
+
* The `<mask>` id comes from `useId`, so multiple toggles can coexist on one
|
|
22
|
+
* page and SSR/client markup stay in sync.
|
|
23
|
+
*
|
|
24
|
+
* The component is deliberately theme-agnostic: it renders whatever `mode` it
|
|
25
|
+
* is given and reports the opposite via `onModeChange`. Wire it to your theme
|
|
26
|
+
* provider (e.g. `useTheme().setMode`) — it never touches the DOM root itself.
|
|
27
|
+
*/
|
|
28
|
+
export const ModeToggle = forwardRef(({ mode, onModeChange, size = "md", className, onClick, "aria-label": ariaLabel, ...props }, ref) => {
|
|
29
|
+
const maskId = useId();
|
|
30
|
+
const next = mode === "light" ? "dark" : "light";
|
|
31
|
+
const handleClick = useCallback((event) => {
|
|
32
|
+
onClick?.(event);
|
|
33
|
+
if (event.defaultPrevented)
|
|
34
|
+
return;
|
|
35
|
+
onModeChange(next);
|
|
36
|
+
}, [onClick, onModeChange, next]);
|
|
37
|
+
return (_jsx("button", { ref: ref, type: "button", "data-slot": "mode-toggle", "data-mode": mode, "aria-label": ariaLabel ?? `Switch to ${next} mode`, className: cn("group/mode-toggle inline-flex shrink-0 items-center justify-center rounded-lg text-fg-secondary outline-none", "transition-[background,color,box-shadow] duration-150 ease-[var(--ease-out-quart)] hover:bg-surface-overlay hover:text-fg motion-reduce:transition-none", "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-base", "disabled:pointer-events-none disabled:opacity-50", sizeStyles[size].button, className), onClick: handleClick, ...props, children: _jsxs("svg", { viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", focusable: "false", className: cn("shrink-0", sizeStyles[size].icon), children: [_jsxs("mask", { id: maskId, children: [_jsx("rect", { width: "24", height: "24", fill: "white" }), _jsx("circle", { cx: "24", cy: "10", r: "6", fill: "black", className: "translate-x-0 transition-transform duration-300 ease-[var(--ease-out-quart)] group-data-[mode=dark]/mode-toggle:-translate-x-[7px] motion-reduce:transition-none" })] }), _jsx("circle", { "data-slot": "mode-toggle-core", cx: "12", cy: "12", r: "6", fill: "currentColor", mask: `url(#${maskId})`, className: "origin-center scale-100 transition-transform duration-300 ease-[var(--ease-out-quart)] group-data-[mode=dark]/mode-toggle:scale-[1.75] motion-reduce:transition-none" }), _jsxs("g", { "data-slot": "mode-toggle-rays", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", className: "origin-center scale-100 opacity-100 transition-[scale,opacity] duration-300 ease-[var(--ease-out-quart)] group-data-[mode=dark]/mode-toggle:scale-50 group-data-[mode=dark]/mode-toggle:opacity-0 motion-reduce:transition-none", children: [_jsx("line", { x1: "12", y1: "1", x2: "12", y2: "3" }), _jsx("line", { x1: "12", y1: "21", x2: "12", y2: "23" }), _jsx("line", { x1: "1", y1: "12", x2: "3", y2: "12" }), _jsx("line", { x1: "21", y1: "12", x2: "23", y2: "12" }), _jsx("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }), _jsx("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }), _jsx("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }), _jsx("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })] })] }) }));
|
|
38
|
+
});
|
|
39
|
+
ModeToggle.displayName = "ModeToggle";
|
|
40
|
+
//# sourceMappingURL=mode-toggle.js.map
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { motion, type Transition } from "motion/react";
|
|
2
|
+
import { type ButtonHTMLAttributes, type HTMLAttributes, type ReactNode } from "react";
|
|
3
|
+
export interface MorphingPopoverProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** Controlled open state. When provided, the component is fully controlled. */
|
|
5
|
+
open?: boolean;
|
|
6
|
+
/** Initial open state for the uncontrolled case. */
|
|
7
|
+
defaultOpen?: boolean;
|
|
8
|
+
/** Called whenever the open state should change (controlled or not). */
|
|
9
|
+
onOpenChange?: (open: boolean) => void;
|
|
10
|
+
/** Override the morph spring (advanced — defaults to the Cronus morph spring). */
|
|
11
|
+
transition?: Transition;
|
|
12
|
+
/**
|
|
13
|
+
* How `prefers-reduced-motion` is honoured. Defaults to `"user"`: users who
|
|
14
|
+
* opt out get a fade instead of the layout morph. Pass `"never"` to always
|
|
15
|
+
* play the morph (e.g. a showcase that must demonstrate the animation), or
|
|
16
|
+
* `"always"` to force the reduced variant for everyone.
|
|
17
|
+
*/
|
|
18
|
+
reducedMotion?: "user" | "always" | "never";
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Root of the morphing popover. Owns open state (controlled or uncontrolled),
|
|
23
|
+
* provides the shared `layoutId` + a11y wiring through context, and installs a
|
|
24
|
+
* {@link MotionConfig} so the trigger and content morph with the same spring.
|
|
25
|
+
*
|
|
26
|
+
* `reducedMotion="user"` makes motion automatically honour
|
|
27
|
+
* `prefers-reduced-motion`: the morph collapses to a cut/cross-fade for users
|
|
28
|
+
* who opt out, while the open/close behaviour and focus management are
|
|
29
|
+
* unchanged.
|
|
30
|
+
*/
|
|
31
|
+
export declare const MorphingPopover: import("react").ForwardRefExoticComponent<MorphingPopoverProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
32
|
+
export interface MorphingPopoverTriggerProps extends Omit<React.ComponentPropsWithoutRef<typeof motion.button>, "ref" | "children" | "onClick"> {
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
/** Extra click handler; runs alongside the open toggle. */
|
|
35
|
+
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Trigger button. Carries the shared `layoutId` so it is the *same* element
|
|
39
|
+
* (to the layout engine) as the content — that is what makes the surface morph
|
|
40
|
+
* out of the button rather than appear beside it.
|
|
41
|
+
*
|
|
42
|
+
* While open, the trigger is hidden from the a11y tree and pointer events
|
|
43
|
+
* (`aria-hidden` + `pointer-events-none`) but kept mounted so the morph-back
|
|
44
|
+
* animation has a target; focus return targets it directly via ref, so this
|
|
45
|
+
* does not break keyboard flow.
|
|
46
|
+
*/
|
|
47
|
+
export declare const MorphingPopoverTrigger: import("react").ForwardRefExoticComponent<MorphingPopoverTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
48
|
+
export interface MorphingPopoverContentProps extends Omit<React.ComponentPropsWithoutRef<typeof motion.div>, "ref" | "children"> {
|
|
49
|
+
children?: ReactNode;
|
|
50
|
+
/** Accessible name when the content has no visible heading to point at. */
|
|
51
|
+
"aria-label"?: string;
|
|
52
|
+
/** Id of a visible heading element (e.g. a {@link MorphingPopoverHeader}). */
|
|
53
|
+
"aria-labelledby"?: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Floating surface. Shares the trigger's `layoutId`, so it morphs out of the
|
|
57
|
+
* button. Rendered through {@link AnimatePresence} for enter/exit and
|
|
58
|
+
* positioned absolutely relative to the {@link MorphingPopover} container — the
|
|
59
|
+
* default size is small and meant to be overridden via `className`.
|
|
60
|
+
*
|
|
61
|
+
* A11y: `role="dialog"`, non-modal (`aria-modal={false}`), focus moves to the
|
|
62
|
+
* first focusable descendant (or the dialog itself) on open and returns to the
|
|
63
|
+
* trigger on close. Escape and outside `mousedown` both close it; all listeners
|
|
64
|
+
* are torn down on unmount.
|
|
65
|
+
*/
|
|
66
|
+
export declare const MorphingPopoverContent: import("react").ForwardRefExoticComponent<MorphingPopoverContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
67
|
+
export interface MorphingPopoverCloseProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
68
|
+
}
|
|
69
|
+
/** Dismiss button (X). Wired to the context `close`; labelled for screen readers. */
|
|
70
|
+
export declare const MorphingPopoverClose: import("react").ForwardRefExoticComponent<MorphingPopoverCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
71
|
+
export interface MorphingPopoverHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
72
|
+
}
|
|
73
|
+
/** Optional header row — pairs naturally with {@link MorphingPopoverClose}. */
|
|
74
|
+
export declare const MorphingPopoverHeader: import("react").ForwardRefExoticComponent<MorphingPopoverHeaderProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
75
|
+
export interface MorphingPopoverBodyProps extends HTMLAttributes<HTMLDivElement> {
|
|
76
|
+
}
|
|
77
|
+
/** Scrollable/content region of the surface. */
|
|
78
|
+
export declare const MorphingPopoverBody: import("react").ForwardRefExoticComponent<MorphingPopoverBodyProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
79
|
+
export interface MorphingPopoverFooterProps extends HTMLAttributes<HTMLDivElement> {
|
|
80
|
+
}
|
|
81
|
+
/** Optional footer row, typically for actions. */
|
|
82
|
+
export declare const MorphingPopoverFooter: import("react").ForwardRefExoticComponent<MorphingPopoverFooterProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
83
|
+
export interface MorphingPopoverButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Full-width menu item for surfaces used as poppy menus. Hover/focus tint via
|
|
87
|
+
* `surface-overlay`. Does not auto-close — wrap `onClick` with the context
|
|
88
|
+
* `close` from a consumer if needed.
|
|
89
|
+
*/
|
|
90
|
+
export declare const MorphingPopoverButton: import("react").ForwardRefExoticComponent<MorphingPopoverButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
91
|
+
//# sourceMappingURL=morphing-popover.d.ts.map
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { X } from "lucide-react";
|
|
4
|
+
import { AnimatePresence, MotionConfig, motion } from "motion/react";
|
|
5
|
+
import { createContext, forwardRef, useCallback, useContext, useEffect, useId, useRef, useState, } from "react";
|
|
6
|
+
import { cn } from "../lib/cn.js";
|
|
7
|
+
/**
|
|
8
|
+
* Shared spring used for the layout-morph: the trigger physically grows into
|
|
9
|
+
* the floating surface (and shrinks back) instead of fading. A longer duration
|
|
10
|
+
* with a touch of `bounce` makes the expansion clearly perceptible — you watch
|
|
11
|
+
* the surface grow and settle rather than snap open.
|
|
12
|
+
*/
|
|
13
|
+
const MORPHING_POPOVER_TRANSITION = {
|
|
14
|
+
type: "spring",
|
|
15
|
+
bounce: 0.18,
|
|
16
|
+
duration: 0.45,
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Content reveal: the children fade (and rise a hair) in *after* the surface
|
|
20
|
+
* has started growing, so the morph reads as "expand, then reveal" instead of
|
|
21
|
+
* the panel popping in fully-formed. Tween — not the layout spring — so the
|
|
22
|
+
* fade stays crisp. Honours reduced-motion via the ambient {@link MotionConfig}.
|
|
23
|
+
*/
|
|
24
|
+
const MORPHING_POPOVER_CONTENT_REVEAL = {
|
|
25
|
+
initial: { opacity: 0, y: 6 },
|
|
26
|
+
animate: { opacity: 1, y: 0, transition: { delay: 0.12, duration: 0.2, ease: "easeOut" } },
|
|
27
|
+
exit: { opacity: 0, transition: { duration: 0.08 } },
|
|
28
|
+
};
|
|
29
|
+
const MorphingPopoverContext = createContext(null);
|
|
30
|
+
function useMorphingPopover(component) {
|
|
31
|
+
const context = useContext(MorphingPopoverContext);
|
|
32
|
+
if (context === null) {
|
|
33
|
+
throw new Error(`<${component}> must be used within <MorphingPopover>.`);
|
|
34
|
+
}
|
|
35
|
+
return context;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Root of the morphing popover. Owns open state (controlled or uncontrolled),
|
|
39
|
+
* provides the shared `layoutId` + a11y wiring through context, and installs a
|
|
40
|
+
* {@link MotionConfig} so the trigger and content morph with the same spring.
|
|
41
|
+
*
|
|
42
|
+
* `reducedMotion="user"` makes motion automatically honour
|
|
43
|
+
* `prefers-reduced-motion`: the morph collapses to a cut/cross-fade for users
|
|
44
|
+
* who opt out, while the open/close behaviour and focus management are
|
|
45
|
+
* unchanged.
|
|
46
|
+
*/
|
|
47
|
+
export const MorphingPopover = forwardRef(({ open: openProp, defaultOpen = false, onOpenChange, transition = MORPHING_POPOVER_TRANSITION, reducedMotion = "user", className, children, ...props }, ref) => {
|
|
48
|
+
const uniqueId = useId();
|
|
49
|
+
const contentId = `morphing-popover-content-${uniqueId}`;
|
|
50
|
+
const triggerRef = useRef(null);
|
|
51
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
|
|
52
|
+
const isControlled = openProp !== undefined;
|
|
53
|
+
const isOpen = isControlled ? openProp : uncontrolledOpen;
|
|
54
|
+
const setOpen = useCallback((next) => {
|
|
55
|
+
if (!isControlled) {
|
|
56
|
+
setUncontrolledOpen(next);
|
|
57
|
+
}
|
|
58
|
+
onOpenChange?.(next);
|
|
59
|
+
}, [isControlled, onOpenChange]);
|
|
60
|
+
const open = useCallback(() => setOpen(true), [setOpen]);
|
|
61
|
+
const close = useCallback(() => setOpen(false), [setOpen]);
|
|
62
|
+
const toggle = useCallback(() => setOpen(!isOpen), [setOpen, isOpen]);
|
|
63
|
+
return (_jsx(MorphingPopoverContext.Provider, { value: { isOpen, open, close, toggle, uniqueId, contentId, triggerRef }, children: _jsx(MotionConfig, { transition: transition, reducedMotion: reducedMotion, children: _jsx("div", { ref: ref, "data-slot": "morphing-popover", "data-state": isOpen ? "open" : "closed", className: cn("relative isolate inline-flex items-center justify-center", className), ...props, children: children }) }) }));
|
|
64
|
+
});
|
|
65
|
+
MorphingPopover.displayName = "MorphingPopover";
|
|
66
|
+
/**
|
|
67
|
+
* Trigger button. Carries the shared `layoutId` so it is the *same* element
|
|
68
|
+
* (to the layout engine) as the content — that is what makes the surface morph
|
|
69
|
+
* out of the button rather than appear beside it.
|
|
70
|
+
*
|
|
71
|
+
* While open, the trigger is hidden from the a11y tree and pointer events
|
|
72
|
+
* (`aria-hidden` + `pointer-events-none`) but kept mounted so the morph-back
|
|
73
|
+
* animation has a target; focus return targets it directly via ref, so this
|
|
74
|
+
* does not break keyboard flow.
|
|
75
|
+
*/
|
|
76
|
+
export const MorphingPopoverTrigger = forwardRef(({ className, children, onClick, ...props }, forwardedRef) => {
|
|
77
|
+
const { isOpen, open, uniqueId, contentId, triggerRef } = useMorphingPopover("MorphingPopoverTrigger");
|
|
78
|
+
return (_jsx(motion.button, { ref: (node) => {
|
|
79
|
+
triggerRef.current = node;
|
|
80
|
+
if (typeof forwardedRef === "function") {
|
|
81
|
+
forwardedRef(node);
|
|
82
|
+
}
|
|
83
|
+
else if (forwardedRef) {
|
|
84
|
+
forwardedRef.current = node;
|
|
85
|
+
}
|
|
86
|
+
}, type: "button", "data-slot": "morphing-popover-trigger", "data-state": isOpen ? "open" : "closed", layoutId: `morphing-popover-${uniqueId}`, style: { borderRadius: 10 }, "aria-haspopup": "dialog", "aria-expanded": isOpen, "aria-controls": contentId, "aria-hidden": isOpen || undefined, tabIndex: isOpen ? -1 : undefined, onClick: (event) => {
|
|
87
|
+
onClick?.(event);
|
|
88
|
+
open();
|
|
89
|
+
}, className: cn("inline-flex h-9 items-center justify-center gap-2 rounded-lg border border-border bg-surface-floating px-3 text-sm font-medium text-fg shadow-sm transition-colors", "hover:bg-surface-overlay outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-base", isOpen && "pointer-events-none", className), ...props, children: _jsx(motion.span, { layoutId: `morphing-popover-label-${uniqueId}`, className: "inline-flex", children: children }) }));
|
|
90
|
+
});
|
|
91
|
+
MorphingPopoverTrigger.displayName = "MorphingPopoverTrigger";
|
|
92
|
+
/**
|
|
93
|
+
* Floating surface. Shares the trigger's `layoutId`, so it morphs out of the
|
|
94
|
+
* button. Rendered through {@link AnimatePresence} for enter/exit and
|
|
95
|
+
* positioned absolutely relative to the {@link MorphingPopover} container — the
|
|
96
|
+
* default size is small and meant to be overridden via `className`.
|
|
97
|
+
*
|
|
98
|
+
* A11y: `role="dialog"`, non-modal (`aria-modal={false}`), focus moves to the
|
|
99
|
+
* first focusable descendant (or the dialog itself) on open and returns to the
|
|
100
|
+
* trigger on close. Escape and outside `mousedown` both close it; all listeners
|
|
101
|
+
* are torn down on unmount.
|
|
102
|
+
*/
|
|
103
|
+
export const MorphingPopoverContent = forwardRef(({ className, children, onAnimationComplete, ...props }, forwardedRef) => {
|
|
104
|
+
const { isOpen, close, uniqueId, contentId, triggerRef } = useMorphingPopover("MorphingPopoverContent");
|
|
105
|
+
const contentRef = useRef(null);
|
|
106
|
+
const hadFocusInsideRef = useRef(false);
|
|
107
|
+
const setRefs = useCallback((node) => {
|
|
108
|
+
contentRef.current = node;
|
|
109
|
+
if (typeof forwardedRef === "function") {
|
|
110
|
+
forwardedRef(node);
|
|
111
|
+
}
|
|
112
|
+
else if (forwardedRef) {
|
|
113
|
+
forwardedRef.current = node;
|
|
114
|
+
}
|
|
115
|
+
}, [forwardedRef]);
|
|
116
|
+
// Outside-click (mousedown) + Escape to close, scoped to the open lifetime.
|
|
117
|
+
useEffect(() => {
|
|
118
|
+
if (!isOpen)
|
|
119
|
+
return;
|
|
120
|
+
const handlePointerDown = (event) => {
|
|
121
|
+
const target = event.target;
|
|
122
|
+
if (!contentRef.current?.contains(target) && !triggerRef.current?.contains(target)) {
|
|
123
|
+
close();
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
const handleKeyDown = (event) => {
|
|
127
|
+
if (event.key === "Escape") {
|
|
128
|
+
event.stopPropagation();
|
|
129
|
+
close();
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
document.addEventListener("mousedown", handlePointerDown);
|
|
133
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
134
|
+
return () => {
|
|
135
|
+
document.removeEventListener("mousedown", handlePointerDown);
|
|
136
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
137
|
+
};
|
|
138
|
+
}, [isOpen, close, triggerRef]);
|
|
139
|
+
// Move focus into the surface on open; return it to the trigger on close.
|
|
140
|
+
useEffect(() => {
|
|
141
|
+
if (isOpen) {
|
|
142
|
+
const node = contentRef.current;
|
|
143
|
+
if (!node)
|
|
144
|
+
return;
|
|
145
|
+
const focusable = node.querySelector('a[href],button:not([disabled]),textarea,input,select,[tabindex]:not([tabindex="-1"])');
|
|
146
|
+
// rAF lets the morph mount the surface before we grab focus.
|
|
147
|
+
const raf = requestAnimationFrame(() => {
|
|
148
|
+
(focusable ?? node).focus();
|
|
149
|
+
hadFocusInsideRef.current = true;
|
|
150
|
+
});
|
|
151
|
+
return () => cancelAnimationFrame(raf);
|
|
152
|
+
}
|
|
153
|
+
// Closed: hand focus back to the trigger if focus had entered the surface
|
|
154
|
+
// and is now lost (to body/null/<html>, e.g. a focused child unmounted
|
|
155
|
+
// right before close) or still inside the closing content.
|
|
156
|
+
const active = document.activeElement;
|
|
157
|
+
const focusLost = active === null || active === document.body || active === document.documentElement;
|
|
158
|
+
if (hadFocusInsideRef.current && (focusLost || contentRef.current?.contains(active))) {
|
|
159
|
+
triggerRef.current?.focus();
|
|
160
|
+
}
|
|
161
|
+
hadFocusInsideRef.current = false;
|
|
162
|
+
return undefined;
|
|
163
|
+
}, [isOpen, triggerRef]);
|
|
164
|
+
return (_jsx(AnimatePresence, { children: isOpen ? (_jsx(motion.div, { ref: setRefs, "data-slot": "morphing-popover-content", "data-state": "open", id: contentId, role: "dialog", "aria-modal": false, layoutId: `morphing-popover-${uniqueId}`, style: { borderRadius: 16 },
|
|
165
|
+
// dialog must be focusable so it can receive focus when empty.
|
|
166
|
+
tabIndex: -1, onAnimationComplete: onAnimationComplete, className: cn("absolute z-50 flex w-72 flex-col overflow-hidden border border-border bg-surface-floating text-fg shadow-lg outline-none", className), ...props, children: _jsx(motion.div, { className: "flex w-full flex-1 flex-col", initial: MORPHING_POPOVER_CONTENT_REVEAL.initial, animate: MORPHING_POPOVER_CONTENT_REVEAL.animate, exit: MORPHING_POPOVER_CONTENT_REVEAL.exit, children: children }) })) : null }));
|
|
167
|
+
});
|
|
168
|
+
MorphingPopoverContent.displayName = "MorphingPopoverContent";
|
|
169
|
+
/** Dismiss button (X). Wired to the context `close`; labelled for screen readers. */
|
|
170
|
+
export const MorphingPopoverClose = forwardRef(({ className, onClick, children, ...props }, ref) => {
|
|
171
|
+
const { close } = useMorphingPopover("MorphingPopoverClose");
|
|
172
|
+
return (_jsx("button", { ref: ref, type: "button", "data-slot": "morphing-popover-close", "aria-label": "Close", onClick: (event) => {
|
|
173
|
+
onClick?.(event);
|
|
174
|
+
close();
|
|
175
|
+
}, className: cn("inline-flex size-7 items-center justify-center rounded-md text-fg-tertiary transition-colors", "hover:bg-surface-overlay hover:text-fg outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-floating", className), ...props, children: children ?? _jsx(X, { className: "size-4" }) }));
|
|
176
|
+
});
|
|
177
|
+
MorphingPopoverClose.displayName = "MorphingPopoverClose";
|
|
178
|
+
/** Optional header row — pairs naturally with {@link MorphingPopoverClose}. */
|
|
179
|
+
export const MorphingPopoverHeader = forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, "data-slot": "morphing-popover-header", className: cn("flex items-center justify-between gap-2 border-b border-border px-4 py-3 text-sm font-medium text-fg", className), ...props })));
|
|
180
|
+
MorphingPopoverHeader.displayName = "MorphingPopoverHeader";
|
|
181
|
+
/** Scrollable/content region of the surface. */
|
|
182
|
+
export const MorphingPopoverBody = forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, "data-slot": "morphing-popover-body", className: cn("flex flex-1 flex-col gap-2 p-4 text-sm text-fg-secondary", className), ...props })));
|
|
183
|
+
MorphingPopoverBody.displayName = "MorphingPopoverBody";
|
|
184
|
+
/** Optional footer row, typically for actions. */
|
|
185
|
+
export const MorphingPopoverFooter = forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, "data-slot": "morphing-popover-footer", className: cn("flex items-center justify-end gap-2 border-t border-border px-4 py-3", className), ...props })));
|
|
186
|
+
MorphingPopoverFooter.displayName = "MorphingPopoverFooter";
|
|
187
|
+
/**
|
|
188
|
+
* Full-width menu item for surfaces used as poppy menus. Hover/focus tint via
|
|
189
|
+
* `surface-overlay`. Does not auto-close — wrap `onClick` with the context
|
|
190
|
+
* `close` from a consumer if needed.
|
|
191
|
+
*/
|
|
192
|
+
export const MorphingPopoverButton = forwardRef(({ className, type, ...props }, ref) => (_jsx("button", { ref: ref, type: type ?? "button", "data-slot": "morphing-popover-button", className: cn("flex w-full items-center gap-2 rounded-md px-3 py-2 text-left text-sm text-fg transition-colors", "hover:bg-surface-overlay outline-none focus-visible:bg-surface-overlay focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-floating disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4", className), ...props })));
|
|
193
|
+
MorphingPopoverButton.displayName = "MorphingPopoverButton";
|
|
194
|
+
//# sourceMappingURL=morphing-popover.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Transition, Variants } from "motion/react";
|
|
2
|
+
export declare const springSoft: Transition;
|
|
3
|
+
export declare const springSnappy: Transition;
|
|
4
|
+
export declare const easeOutQuart: Transition;
|
|
5
|
+
export declare const fadeInUp: Variants;
|
|
6
|
+
export declare const fadeIn: Variants;
|
|
7
|
+
export declare const scaleIn: Variants;
|
|
8
|
+
export declare const staggerContainer: Variants;
|
|
9
|
+
//# sourceMappingURL=motion-presets.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const springSoft = { type: "spring", stiffness: 260, damping: 26 };
|
|
2
|
+
export const springSnappy = { type: "spring", stiffness: 400, damping: 30 };
|
|
3
|
+
export const easeOutQuart = { duration: 0.5, ease: [0.16, 1, 0.3, 1] };
|
|
4
|
+
export const fadeInUp = {
|
|
5
|
+
hidden: { opacity: 0, y: 16 },
|
|
6
|
+
visible: { opacity: 1, y: 0, transition: easeOutQuart },
|
|
7
|
+
};
|
|
8
|
+
export const fadeIn = {
|
|
9
|
+
hidden: { opacity: 0 },
|
|
10
|
+
visible: { opacity: 1, transition: easeOutQuart },
|
|
11
|
+
};
|
|
12
|
+
export const scaleIn = {
|
|
13
|
+
hidden: { opacity: 0, scale: 0.96 },
|
|
14
|
+
visible: { opacity: 1, scale: 1, transition: springSoft },
|
|
15
|
+
};
|
|
16
|
+
export const staggerContainer = {
|
|
17
|
+
hidden: {},
|
|
18
|
+
visible: { transition: { staggerChildren: 0.08, delayChildren: 0.05 } },
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=motion-presets.js.map
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export interface MultiSelectOption {
|
|
2
|
+
/** Stable value persisted in the selection array. */
|
|
3
|
+
value: string;
|
|
4
|
+
/** Human-readable label rendered in the list and chips. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Disable selecting/deselecting this single option. */
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface MultiSelectProps {
|
|
10
|
+
/** Options shown in the searchable list. */
|
|
11
|
+
options: MultiSelectOption[];
|
|
12
|
+
/** Controlled selection. Provide together with `onValueChange`. */
|
|
13
|
+
value?: string[];
|
|
14
|
+
/** Uncontrolled initial selection. */
|
|
15
|
+
defaultValue?: string[];
|
|
16
|
+
/** Called with the next selection whenever it changes. */
|
|
17
|
+
onValueChange?: (value: string[]) => void;
|
|
18
|
+
/** Text shown in the trigger when nothing is selected. */
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
/** Placeholder for the search input inside the popover. */
|
|
21
|
+
searchPlaceholder?: string;
|
|
22
|
+
/** Text shown when the search yields no results. */
|
|
23
|
+
emptyText?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Maximum number of chips to render before collapsing the rest into a
|
|
26
|
+
* "+N" badge. When omitted, every selected chip is rendered.
|
|
27
|
+
*/
|
|
28
|
+
maxDisplay?: number;
|
|
29
|
+
/** Disable the whole control. */
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* When true (default), pressing Backspace with an empty search removes the
|
|
33
|
+
* last selected item.
|
|
34
|
+
*/
|
|
35
|
+
removeLastOnBackspace?: boolean;
|
|
36
|
+
/** Extra classes for the trigger button. */
|
|
37
|
+
className?: string;
|
|
38
|
+
/** Extra classes for the popover content. */
|
|
39
|
+
contentClassName?: string;
|
|
40
|
+
/** Accessible label for the trigger when no visible label is associated. */
|
|
41
|
+
"aria-label"?: string;
|
|
42
|
+
/** id of an element that labels the trigger. */
|
|
43
|
+
"aria-labelledby"?: string;
|
|
44
|
+
/** Marks the trigger as invalid (e.g. from a Form layer), applying error styling. */
|
|
45
|
+
"aria-invalid"?: boolean | "true" | "false";
|
|
46
|
+
/** Controls the popover open state (controlled). */
|
|
47
|
+
open?: boolean;
|
|
48
|
+
/** Initial popover open state (uncontrolled). */
|
|
49
|
+
defaultOpen?: boolean;
|
|
50
|
+
/** Called when the popover open state changes. */
|
|
51
|
+
onOpenChange?: (open: boolean) => void;
|
|
52
|
+
}
|
|
53
|
+
export declare const MultiSelect: import("react").ForwardRefExoticComponent<MultiSelectProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
54
|
+
//# sourceMappingURL=multi-select.d.ts.map
|
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
|
|
2
|
+
export declare const NavigationMenu: import("react").ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuProps & import("react").RefAttributes<HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
3
|
+
export declare const NavigationMenuList: import("react").ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuListProps & import("react").RefAttributes<HTMLUListElement>, "ref"> & import("react").RefAttributes<HTMLUListElement>>;
|
|
4
|
+
export declare const NavigationMenuItem: import("react").ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuItemProps & import("react").RefAttributes<HTMLLIElement>, "ref"> & import("react").RefAttributes<HTMLLIElement>>;
|
|
5
|
+
declare const navigationMenuTriggerStyle: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
6
|
+
export declare const NavigationMenuTrigger: import("react").ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
export declare const NavigationMenuContent: import("react").ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export declare const NavigationMenuLink: import("react").ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuLinkProps & import("react").RefAttributes<HTMLAnchorElement>, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
9
|
+
export declare const NavigationMenuIndicator: import("react").ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuIndicatorProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export declare const NavigationMenuViewport: import("react").ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuViewportProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export { navigationMenuTriggerStyle };
|
|
12
|
+
//# sourceMappingURL=navigation-menu.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { ChevronDown } from "lucide-react";
|
|
6
|
+
import { forwardRef } from "react";
|
|
7
|
+
import { cn } from "../lib/cn.js";
|
|
8
|
+
export const NavigationMenu = forwardRef(({ className, children, ...props }, ref) => {
|
|
9
|
+
return (_jsxs(NavigationMenuPrimitive.Root, { ref: ref, "data-slot": "navigation-menu", className: cn("relative z-10 flex max-w-max flex-1 items-center justify-center", className), ...props, children: [children, _jsx(NavigationMenuViewport, {})] }));
|
|
10
|
+
});
|
|
11
|
+
NavigationMenu.displayName = "NavigationMenu";
|
|
12
|
+
export const NavigationMenuList = forwardRef(({ className, ...props }, ref) => {
|
|
13
|
+
return (_jsx(NavigationMenuPrimitive.List, { ref: ref, "data-slot": "navigation-menu-list", className: cn("group flex flex-1 list-none items-center justify-center gap-1", className), ...props }));
|
|
14
|
+
});
|
|
15
|
+
NavigationMenuList.displayName = "NavigationMenuList";
|
|
16
|
+
export const NavigationMenuItem = forwardRef(({ className, ...props }, ref) => {
|
|
17
|
+
return (_jsx(NavigationMenuPrimitive.Item, { ref: ref, "data-slot": "navigation-menu-item", className: cn("relative", className), ...props }));
|
|
18
|
+
});
|
|
19
|
+
NavigationMenuItem.displayName = "NavigationMenuItem";
|
|
20
|
+
const navigationMenuTriggerStyle = cva("group inline-flex h-9 w-max items-center justify-center gap-1 rounded-lg bg-transparent px-4 py-2 text-sm font-medium text-fg-secondary transition-[background,color,box-shadow] duration-150 ease-[var(--ease-out-quart)] outline-none hover:bg-surface-overlay hover:text-fg focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-base disabled:opacity-50 disabled:pointer-events-none data-[state=open]:bg-surface-overlay data-[state=open]:text-fg data-[active]:bg-surface-overlay data-[active]:text-fg");
|
|
21
|
+
export const NavigationMenuTrigger = forwardRef(({ className, children, ...props }, ref) => {
|
|
22
|
+
return (_jsxs(NavigationMenuPrimitive.Trigger, { ref: ref, "data-slot": "navigation-menu-trigger", className: cn(navigationMenuTriggerStyle(), "group", className), ...props, children: [children, _jsx(ChevronDown, { "aria-hidden": "true", className: "relative top-px size-3.5 text-fg-tertiary transition-transform duration-200 ease-[var(--ease-out-quart)] group-data-[state=open]:rotate-180" })] }));
|
|
23
|
+
});
|
|
24
|
+
NavigationMenuTrigger.displayName = "NavigationMenuTrigger";
|
|
25
|
+
export const NavigationMenuContent = forwardRef(({ className, ...props }, ref) => {
|
|
26
|
+
return (_jsx(NavigationMenuPrimitive.Content, { ref: ref, "data-slot": "navigation-menu-content", className: cn("left-0 top-0 w-full p-1 transition-[transform,opacity] duration-200 ease-[var(--ease-out-quart)] md:absolute md:w-auto", "data-[motion=from-start]:-translate-x-12 data-[motion=from-start]:opacity-0", "data-[motion=from-end]:translate-x-12 data-[motion=from-end]:opacity-0", "data-[motion=to-start]:-translate-x-12 data-[motion=to-start]:opacity-0", "data-[motion=to-end]:translate-x-12 data-[motion=to-end]:opacity-0", className), ...props }));
|
|
27
|
+
});
|
|
28
|
+
NavigationMenuContent.displayName = "NavigationMenuContent";
|
|
29
|
+
export const NavigationMenuLink = forwardRef(({ className, ...props }, ref) => {
|
|
30
|
+
return (_jsx(NavigationMenuPrimitive.Link, { ref: ref, "data-slot": "navigation-menu-link", className: cn("flex select-none flex-col gap-0.5 rounded-md px-3 py-2 text-sm leading-snug no-underline outline-none transition-colors duration-150 ease-[var(--ease-out-quart)] hover:bg-surface-overlay hover:text-fg focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-base data-[active]:bg-surface-overlay data-[active]:text-fg", className), ...props }));
|
|
31
|
+
});
|
|
32
|
+
NavigationMenuLink.displayName = "NavigationMenuLink";
|
|
33
|
+
export const NavigationMenuIndicator = forwardRef(({ className, ...props }, ref) => {
|
|
34
|
+
return (_jsx(NavigationMenuPrimitive.Indicator, { ref: ref, "data-slot": "navigation-menu-indicator", className: cn("top-full z-10 flex h-2 items-end justify-center overflow-hidden transition-opacity duration-200 ease-[var(--ease-out-quart)] data-[state=hidden]:opacity-0 data-[state=visible]:opacity-100", className), ...props, children: _jsx("div", { className: "relative top-[60%] size-2 rotate-45 rounded-tl-sm border-l border-t border-border bg-surface-floating shadow-md" }) }));
|
|
35
|
+
});
|
|
36
|
+
NavigationMenuIndicator.displayName = "NavigationMenuIndicator";
|
|
37
|
+
export const NavigationMenuViewport = forwardRef(({ className, ...props }, ref) => {
|
|
38
|
+
return (_jsx("div", { className: "absolute left-0 top-full flex w-max justify-center", children: _jsx(NavigationMenuPrimitive.Viewport, { ref: ref, "data-slot": "navigation-menu-viewport", className: cn("relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full shrink-0 origin-top-center overflow-hidden rounded-lg border border-border bg-surface-floating text-fg shadow-lg transition-[width,height] duration-200 ease-[var(--ease-out-quart)] data-[state=closed]:opacity-0 md:w-[var(--radix-navigation-menu-viewport-width)]", className), ...props }) }));
|
|
39
|
+
});
|
|
40
|
+
NavigationMenuViewport.displayName = "NavigationMenuViewport";
|
|
41
|
+
export { navigationMenuTriggerStyle };
|
|
42
|
+
//# sourceMappingURL=navigation-menu.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type HTMLAttributes, type Ref } from "react";
|
|
2
|
+
export interface NoiseProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
ref?: Ref<HTMLDivElement>;
|
|
4
|
+
/**
|
|
5
|
+
* Overlay opacity of the grain, `0–1`.
|
|
6
|
+
* @default 0.08
|
|
7
|
+
*/
|
|
8
|
+
opacity?: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A film-grain overlay generated with SVG `feTurbulence`. Sits above the
|
|
12
|
+
* background and below content, purely decorative, with no animation of its
|
|
13
|
+
* own — the grain is a still texture that reads as analog depth.
|
|
14
|
+
*/
|
|
15
|
+
export declare function Noise({ ref, className, children, opacity, ...props }: NoiseProps): import("react").JSX.Element;
|
|
16
|
+
export declare namespace Noise {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=noise.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
import { cn } from "../lib/cn.js";
|
|
4
|
+
function finiteOr(value, fallback) {
|
|
5
|
+
return Number.isFinite(value) ? value : fallback;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A film-grain overlay generated with SVG `feTurbulence`. Sits above the
|
|
9
|
+
* background and below content, purely decorative, with no animation of its
|
|
10
|
+
* own — the grain is a still texture that reads as analog depth.
|
|
11
|
+
*/
|
|
12
|
+
export function Noise({ ref, className, children, opacity = 0.08, ...props }) {
|
|
13
|
+
const filterId = useId();
|
|
14
|
+
const overlayOpacity = Math.min(1, Math.max(0, finiteOr(opacity, 0.08)));
|
|
15
|
+
return (_jsxs("div", { ref: ref, "data-slot": "noise", className: cn("relative overflow-hidden", className), ...props, children: [_jsxs("svg", { "aria-hidden": "true", className: "pointer-events-none absolute inset-0 size-full", style: { opacity: overlayOpacity }, children: [_jsx("filter", { id: filterId, children: _jsx("feTurbulence", { type: "fractalNoise", baseFrequency: "0.8", numOctaves: 4, stitchTiles: "stitch" }) }), _jsx("rect", { width: "100%", height: "100%", filter: `url(#${filterId})` })] }), _jsx("div", { className: "relative", children: children })] }));
|
|
16
|
+
}
|
|
17
|
+
Noise.displayName = "Noise";
|
|
18
|
+
//# sourceMappingURL=noise.js.map
|