@vllnt/ui 0.4.0-canary.sha1342d11 → 0.4.0-canary.sha36bfa21
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/CHANGELOG.md +96 -0
- package/README.md +64 -10
- package/dist/components/{accordion → atoms/accordion}/accordion.js +2 -1
- package/dist/components/{agent-activity → atoms/agent-activity}/agent-activity.js +9 -2
- package/dist/components/{ai-source-citation → atoms/ai-source-citation}/ai-source-citation.js +1 -1
- package/dist/components/{ai-streaming-text → atoms/ai-streaming-text}/ai-streaming-text.js +2 -2
- package/dist/components/{alert → atoms/alert}/alert.js +1 -1
- package/dist/components/{alert-pulse → atoms/alert-pulse}/alert-pulse.js +2 -2
- package/dist/components/{anchor-port → atoms/anchor-port}/anchor-port.js +1 -1
- package/dist/components/{animated-beam → atoms/animated-beam}/animated-beam.js +1 -1
- package/dist/components/{animated-grid-pattern → atoms/animated-grid-pattern}/animated-grid-pattern.js +1 -1
- package/dist/components/{animated-list → atoms/animated-list}/animated-list.js +1 -1
- package/dist/components/{animated-tabs → atoms/animated-tabs}/animated-tabs.js +16 -4
- package/dist/components/{animated-testimonials → atoms/animated-testimonials}/animated-testimonials.js +1 -1
- package/dist/components/{animated-text → atoms/animated-text}/animated-text.js +29 -8
- package/dist/components/{animated-tooltip → atoms/animated-tooltip}/animated-tooltip.js +11 -1
- package/dist/components/{avatar → atoms/avatar}/avatar.js +1 -1
- package/dist/components/{badge → atoms/badge}/badge.js +1 -1
- package/dist/components/{banner → atoms/banner}/banner.js +1 -1
- package/dist/components/{bento-grid → atoms/bento-grid}/bento-grid.js +1 -1
- package/dist/components/{blur-reveal → atoms/blur-reveal}/blur-reveal.js +1 -1
- package/dist/components/{border-beam → atoms/border-beam}/border-beam.js +2 -5
- package/dist/components/{bottom-activity-strip → atoms/bottom-activity-strip}/bottom-activity-strip.js +3 -2
- package/dist/components/{bottom-bar → atoms/bottom-bar}/bottom-bar.js +1 -1
- package/dist/components/{breadcrumb → atoms/breadcrumb}/breadcrumb.js +2 -2
- package/dist/components/{button → atoms/button}/button.js +1 -1
- package/dist/components/{button-group → atoms/button-group}/button-group.js +1 -1
- package/dist/components/{callout → atoms/callout}/callout.js +1 -1
- package/dist/components/{card → atoms/card}/card.js +1 -1
- package/dist/components/{card-flip → atoms/card-flip}/card-flip.js +1 -1
- package/dist/components/{chain-of-thought → atoms/chain-of-thought}/chain-of-thought.js +8 -2
- package/dist/components/{checkbox → atoms/checkbox}/checkbox.js +1 -1
- package/dist/components/{checklist → atoms/checklist}/checklist.js +5 -2
- package/dist/components/{comment-pin → atoms/comment-pin}/comment-pin.js +8 -5
- package/dist/components/{comparison → atoms/comparison}/comparison.js +41 -27
- package/dist/components/{context-lens → atoms/context-lens}/context-lens.js +1 -1
- package/dist/components/{context-menu → atoms/context-menu}/context-menu.js +1 -1
- package/dist/components/{curriculum → atoms/curriculum}/curriculum.js +8 -6
- package/dist/components/atoms/cursor/cursor.js +91 -0
- package/dist/components/{data-list → atoms/data-list}/data-list.js +1 -1
- package/dist/components/{date-field → atoms/date-field}/date-field.js +1 -1
- package/dist/components/{dialog → atoms/dialog}/dialog.js +1 -1
- package/dist/components/{display → atoms/display}/display.js +1 -1
- package/dist/components/atoms/dock/dock.js +167 -0
- package/dist/components/{document-sibling-nav → atoms/document-sibling-nav}/document-sibling-nav.js +1 -1
- package/dist/components/{dot-pattern → atoms/dot-pattern}/dot-pattern.js +1 -1
- package/dist/components/{drawer → atoms/drawer}/drawer.js +3 -1
- package/dist/components/{dropdown-menu → atoms/dropdown-menu}/dropdown-menu.js +1 -1
- package/dist/components/{edge-label → atoms/edge-label}/edge-label.js +1 -1
- package/dist/components/{empty-state → atoms/empty-state}/empty-state.js +1 -1
- package/dist/components/{era-comparison → atoms/era-comparison}/era-comparison.js +2 -2
- package/dist/components/{expandable-cards → atoms/expandable-cards}/expandable-cards.js +1 -1
- package/dist/components/{faq → atoms/faq}/faq.js +1 -1
- package/dist/components/{fieldset → atoms/fieldset}/fieldset.js +1 -1
- package/dist/components/{floating-action-button → atoms/floating-action-button}/floating-action-button.js +1 -1
- package/dist/components/{floating-navbar → atoms/floating-navbar}/floating-navbar.js +1 -1
- package/dist/components/{floating-toolbar → atoms/floating-toolbar}/floating-toolbar.js +1 -1
- package/dist/components/{follow-mode → atoms/follow-mode}/follow-mode.js +7 -7
- package/dist/components/{gauge-chart → atoms/gauge-chart}/gauge-chart.js +1 -1
- package/dist/components/{glass-card → atoms/glass-card}/glass-card.js +1 -1
- package/dist/components/{glass-panel → atoms/glass-panel}/glass-panel.js +1 -1
- package/dist/components/{glass-progress → atoms/glass-progress}/glass-progress.js +2 -1
- package/dist/components/{grid → atoms/grid}/grid.js +1 -1
- package/dist/components/{group-hull → atoms/group-hull}/group-hull.js +1 -1
- package/dist/components/{handoff-beacon → atoms/handoff-beacon}/handoff-beacon.js +2 -2
- package/dist/components/{heading → atoms/heading}/heading.js +1 -1
- package/dist/components/{heat-overlay → atoms/heat-overlay}/heat-overlay.js +1 -1
- package/dist/components/{hover-card → atoms/hover-card}/hover-card.js +1 -1
- package/dist/components/{infinite-plane → atoms/infinite-plane}/infinite-plane.js +1 -1
- package/dist/components/{input → atoms/input}/input.js +1 -1
- package/dist/components/{input-group → atoms/input-group}/input-group.js +1 -1
- package/dist/components/{input-otp → atoms/input-otp}/input-otp.js +2 -2
- package/dist/components/{item → atoms/item}/item.js +1 -1
- package/dist/components/{jarvis-dock → atoms/jarvis-dock}/jarvis-dock.js +1 -1
- package/dist/components/{kbd → atoms/kbd}/kbd.js +3 -3
- package/dist/components/{key-concept → atoms/key-concept}/key-concept.js +5 -3
- package/dist/components/{keyboard-shortcuts-help → atoms/keyboard-shortcuts-help}/keyboard-shortcuts-help.js +10 -5
- package/dist/components/{label → atoms/label}/label.js +1 -1
- package/dist/components/{learning-objectives → atoms/learning-objectives}/learning-objectives.js +24 -10
- package/dist/components/{left-rail → atoms/left-rail}/left-rail.js +1 -1
- package/dist/components/{link → atoms/link}/link.js +1 -1
- package/dist/components/{liquid-glass → atoms/liquid-glass}/liquid-glass.js +2 -3
- package/dist/components/{list-box → atoms/list-box}/list-box.js +56 -5
- package/dist/components/{live-cursor → atoms/live-cursor}/live-cursor.js +10 -5
- package/dist/components/atoms/magnetic/magnetic.js +110 -0
- package/dist/components/atoms/magnetic-button/magnetic-button.js +111 -0
- package/dist/components/atoms/marquee/marquee.js +156 -0
- package/dist/components/{menubar → atoms/menubar}/menubar.js +1 -1
- package/dist/components/{meteors → atoms/meteors}/meteors.js +3 -3
- package/dist/components/{meter → atoms/meter}/meter.js +1 -1
- package/dist/components/{metric-cluster → atoms/metric-cluster}/metric-cluster.js +1 -1
- package/dist/components/{mini-map-panel → atoms/mini-map-panel}/mini-map-panel.js +1 -1
- package/dist/components/{multi-select-lasso → atoms/multi-select-lasso}/multi-select-lasso.js +1 -1
- package/dist/components/{native-select → atoms/native-select}/native-select.js +1 -1
- package/dist/components/{navigation-menu → atoms/navigation-menu}/navigation-menu.js +1 -1
- package/dist/components/{number-ticker → atoms/number-ticker}/number-ticker.js +1 -1
- package/dist/components/{object-handle → atoms/object-handle}/object-handle.js +2 -2
- package/dist/components/{object-inspector → atoms/object-inspector}/object-inspector.js +2 -2
- package/dist/components/{order-book → atoms/order-book}/order-book.js +14 -8
- package/dist/components/{panel → atoms/panel}/panel.js +1 -1
- package/dist/components/{particles → atoms/particles}/particles.js +3 -3
- package/dist/components/{password-input → atoms/password-input}/password-input.js +1 -1
- package/dist/components/{phone-input → atoms/phone-input}/phone-input.js +1 -1
- package/dist/components/{playback-ghost → atoms/playback-ghost}/playback-ghost.js +13 -5
- package/dist/components/{policy-delivery-panel → atoms/policy-delivery-panel}/policy-delivery-panel.js +1 -1
- package/dist/components/{popover → atoms/popover}/popover.js +1 -1
- package/dist/components/{presence-stack → atoms/presence-stack}/presence-stack.js +8 -3
- package/dist/components/{presence-sync-indicator → atoms/presence-sync-indicator}/presence-sync-indicator.js +3 -3
- package/dist/components/{pro-tip → atoms/pro-tip}/pro-tip.js +4 -1
- package/dist/components/{progress-bar → atoms/progress-bar}/progress-bar.js +3 -3
- package/dist/components/{progressive-blur → atoms/progressive-blur}/progressive-blur.js +1 -1
- package/dist/components/{prompt-input → atoms/prompt-input}/prompt-input.js +9 -3
- package/dist/components/{property-section → atoms/property-section}/property-section.js +2 -2
- package/dist/components/{prose → atoms/prose}/prose.js +1 -1
- package/dist/components/{qr-code → atoms/qr-code}/qr-code.js +28 -4
- package/dist/components/{quiz → atoms/quiz}/quiz.js +3 -1
- package/dist/components/{radio-group → atoms/radio-group}/radio-group.js +1 -1
- package/dist/components/{rating → atoms/rating}/rating.js +14 -3
- package/dist/components/{reasoning → atoms/reasoning}/reasoning.js +17 -8
- package/dist/components/{relationship-inspector → atoms/relationship-inspector}/relationship-inspector.js +1 -1
- package/dist/components/{resizable → atoms/resizable}/resizable.js +1 -1
- package/dist/components/{reveal-text → atoms/reveal-text}/reveal-text.js +1 -1
- package/dist/components/{right-dock → atoms/right-dock}/right-dock.js +1 -1
- package/dist/components/{routing-assignment-panel → atoms/routing-assignment-panel}/routing-assignment-panel.js +1 -1
- package/dist/components/{runtime-overview-panel → atoms/runtime-overview-panel}/runtime-overview-panel.js +1 -1
- package/dist/components/{scramble-text → atoms/scramble-text}/scramble-text.js +6 -12
- package/dist/components/atoms/scroll-area/scroll-area.js +90 -0
- package/dist/components/{scroll-progress → atoms/scroll-progress}/scroll-progress.js +12 -3
- package/dist/components/{search-field → atoms/search-field}/search-field.js +3 -3
- package/dist/components/{segmented-control → atoms/segmented-control}/segmented-control.js +1 -1
- package/dist/components/{select → atoms/select}/select.js +1 -1
- package/dist/components/{selection-halo → atoms/selection-halo}/selection-halo.js +11 -3
- package/dist/components/{selection-presence → atoms/selection-presence}/selection-presence.js +4 -2
- package/dist/components/{separator → atoms/separator}/separator.js +1 -1
- package/dist/components/{severity-badge → atoms/severity-badge}/severity-badge.js +11 -11
- package/dist/components/{sheet → atoms/sheet}/sheet.js +1 -1
- package/dist/components/{shimmer-button → atoms/shimmer-button}/shimmer-button.js +1 -1
- package/dist/components/{shimmer-text → atoms/shimmer-text}/shimmer-text.js +1 -1
- package/dist/components/{shine-border → atoms/shine-border}/shine-border.js +2 -5
- package/dist/components/{shiny-button → atoms/shiny-button}/shiny-button.js +1 -1
- package/dist/components/{skeleton → atoms/skeleton}/skeleton.js +5 -2
- package/dist/components/{slider → atoms/slider}/slider.js +13 -2
- package/dist/components/{snap-guides → atoms/snap-guides}/snap-guides.js +2 -1
- package/dist/components/{social-fab → atoms/social-fab}/social-fab.js +1 -1
- package/dist/components/{sparkles → atoms/sparkles}/sparkles.js +3 -3
- package/dist/components/{sparkline-grid → atoms/sparkline-grid}/sparkline-grid.js +6 -6
- package/dist/components/{spinner → atoms/spinner}/spinner.js +3 -2
- package/dist/components/{spinner → atoms/spinner}/unicode-spinner.js +1 -1
- package/dist/components/{spinning-text → atoms/spinning-text}/spinning-text.js +15 -13
- package/dist/components/atoms/spotlight-card/spotlight-card.js +77 -0
- package/dist/components/{state-badge-overlay → atoms/state-badge-overlay}/state-badge-overlay.js +3 -3
- package/dist/components/{status-indicator → atoms/status-indicator}/status-indicator.js +2 -2
- package/dist/components/{step-by-step → atoms/step-by-step}/step-by-step.js +4 -2
- package/dist/components/{step-navigation → atoms/step-navigation}/step-navigation.js +1 -1
- package/dist/components/{stepper → atoms/stepper}/stepper.js +2 -1
- package/dist/components/{sticky-metric → atoms/sticky-metric}/sticky-metric.js +1 -1
- package/dist/components/{switch → atoms/switch}/switch.js +1 -1
- package/dist/components/{table → atoms/table}/table.js +1 -1
- package/dist/components/{table-of-contents → atoms/table-of-contents}/table-of-contents.js +1 -1
- package/dist/components/{table-of-contents-panel → atoms/table-of-contents-panel}/table-of-contents-panel.js +7 -3
- package/dist/components/atoms/tabs/tabs.js +227 -0
- package/dist/components/{tag-group → atoms/tag-group}/tag-group.js +1 -1
- package/dist/components/{tags-input → atoms/tags-input}/tags-input.js +1 -1
- package/dist/components/{text → atoms/text}/text.js +1 -1
- package/dist/components/{text-animate → atoms/text-animate}/text-animate.js +1 -1
- package/dist/components/{text-reveal → atoms/text-reveal}/text-reveal.js +33 -18
- package/dist/components/{text-shimmer → atoms/text-shimmer}/text-shimmer.js +1 -1
- package/dist/components/{textarea → atoms/textarea}/textarea.js +1 -1
- package/dist/components/{theme-preset-provider → atoms/theme-preset-provider}/theme-preset-provider.js +21 -7
- package/dist/components/{theme-switcher → atoms/theme-switcher}/theme-switcher.js +15 -4
- package/dist/components/{thinking-block → atoms/thinking-block}/thinking-block.js +10 -8
- package/dist/components/{thread-bubble → atoms/thread-bubble}/thread-bubble.js +4 -2
- package/dist/components/{threshold-ring → atoms/threshold-ring}/threshold-ring.js +1 -1
- package/dist/components/atoms/tilt-card/tilt-card.js +115 -0
- package/dist/components/{time-field → atoms/time-field}/time-field.js +1 -1
- package/dist/components/{timeline → atoms/timeline}/timeline.js +1 -1
- package/dist/components/{timeline-scrubber → atoms/timeline-scrubber}/timeline-scrubber.js +1 -1
- package/dist/components/{tldr-section → atoms/tldr-section}/tldr-section.js +11 -6
- package/dist/components/atoms/toast/sonner-toast.js +4 -0
- package/dist/components/{toast → atoms/toast}/toast.js +17 -18
- package/dist/components/{toast → atoms/toast}/toaster.js +7 -1
- package/dist/components/{toggle → atoms/toggle}/toggle.js +1 -1
- package/dist/components/{toolbar → atoms/toolbar}/toolbar.js +2 -1
- package/dist/components/{tooltip → atoms/tooltip}/tooltip.js +1 -1
- package/dist/components/{top-bar → atoms/top-bar}/top-bar.js +1 -1
- package/dist/components/{truncated-text → atoms/truncated-text}/truncated-text.js +1 -1
- package/dist/components/{tutorial-intro-content → atoms/tutorial-intro-content}/tutorial-intro-content.js +3 -6
- package/dist/components/{typewriter → atoms/typewriter}/typewriter.js +3 -2
- package/dist/components/{typography → atoms/typography}/typography.js +1 -1
- package/dist/components/{video-embed → atoms/video-embed}/video-embed.js +3 -1
- package/dist/components/{view-switcher → atoms/view-switcher}/view-switcher.js +55 -44
- package/dist/components/{viewport-bookmarks → atoms/viewport-bookmarks}/viewport-bookmarks.js +1 -1
- package/dist/components/{watchlist → atoms/watchlist}/watchlist.js +10 -9
- package/dist/components/{workspace-switcher → atoms/workspace-switcher}/workspace-switcher.js +40 -11
- package/dist/components/{world-breadcrumbs → atoms/world-breadcrumbs}/world-breadcrumbs.js +1 -1
- package/dist/components/index.js +379 -322
- package/dist/components/{activity-log → molecules/activity-log}/activity-log.js +7 -7
- package/dist/components/{ai-artifact → molecules/ai-artifact}/ai-artifact.js +18 -6
- package/dist/components/{ai-chat-input → molecules/ai-chat-input}/ai-chat-input.js +12 -5
- package/dist/components/{ai-message-bubble → molecules/ai-message-bubble}/ai-message-bubble.js +3 -3
- package/dist/components/{ai-sidebar → molecules/ai-sidebar}/ai-sidebar.js +3 -3
- package/dist/components/{ai-tool-call-display → molecules/ai-tool-call-display}/ai-tool-call-display.js +3 -3
- package/dist/components/{alert-dialog → molecules/alert-dialog}/alert-dialog.js +2 -2
- package/dist/components/{annotation → molecules/annotation}/annotation.js +6 -2
- package/dist/components/{auto-reload → molecules/auto-reload}/auto-reload.js +4 -4
- package/dist/components/{avatar-group → molecules/avatar-group}/avatar-group.js +3 -3
- package/dist/components/{blog-card → molecules/blog-card}/blog-card.js +2 -2
- package/dist/components/{calendar → molecules/calendar}/calendar.js +2 -2
- package/dist/components/{carousel → molecules/carousel}/carousel.js +2 -2
- package/dist/components/{category-filter → molecules/category-filter}/category-filter.js +1 -1
- package/dist/components/{chat-dock-section → molecules/chat-dock-section}/chat-dock-section.js +2 -2
- package/dist/components/{checkbox-group → molecules/checkbox-group}/checkbox-group.js +3 -3
- package/dist/components/{civilization-card → molecules/civilization-card}/civilization-card.js +2 -2
- package/dist/components/{color-picker → molecules/color-picker}/color-picker.js +55 -42
- package/dist/components/{command → molecules/command}/command.js +35 -16
- package/dist/components/molecules/completion-dialog/completion-dialog.js +163 -0
- package/dist/components/{connector-edge → molecules/connector-edge}/connector-edge.js +3 -2
- package/dist/components/{content-intro → molecules/content-intro}/content-intro.js +5 -3
- package/dist/components/{conversation-thread → molecules/conversation-thread}/conversation-thread.js +7 -6
- package/dist/components/{cookie-consent → molecules/cookie-consent}/cookie-consent.js +2 -2
- package/dist/components/{copy-button → molecules/copy-button}/copy-button.js +7 -47
- package/dist/components/molecules/copy-button/use-copy-to-clipboard.js +42 -0
- package/dist/components/{countdown-timer → molecules/countdown-timer}/countdown-timer.js +5 -5
- package/dist/components/{credit-badge → molecules/credit-badge}/credit-badge.js +2 -2
- package/dist/components/{exercise → molecules/exercise}/exercise.js +5 -5
- package/dist/components/{field → molecules/field}/field.js +2 -2
- package/dist/components/{file-upload → molecules/file-upload}/file-upload.js +45 -43
- package/dist/components/{filter-bar → molecules/filter-bar}/filter-bar.js +6 -6
- package/dist/components/{flashcard → molecules/flashcard}/flashcard.js +4 -4
- package/dist/components/{form → molecules/form}/form.js +2 -2
- package/dist/components/{historical-figure-card → molecules/historical-figure-card}/historical-figure-card.js +4 -4
- package/dist/components/{horizontal-scroll-row → molecules/horizontal-scroll-row}/horizontal-scroll-row.js +3 -3
- package/dist/components/{inline-input → molecules/inline-input}/inline-input.js +6 -2
- package/dist/components/{knowledge-check → molecules/knowledge-check}/knowledge-check.js +3 -3
- package/dist/components/{live-feed → molecules/live-feed}/live-feed.js +7 -7
- package/dist/components/{metric-gauge → molecules/metric-gauge}/metric-gauge.js +5 -5
- package/dist/components/{model-comparison → molecules/model-comparison}/model-comparison.js +3 -3
- package/dist/components/{newsletter-signup → molecules/newsletter-signup}/newsletter-signup.js +11 -4
- package/dist/components/{number-input → molecules/number-input}/number-input.js +8 -2
- package/dist/components/{object-card → molecules/object-card}/object-card.js +8 -7
- package/dist/components/{overview-board → molecules/overview-board}/overview-board.js +3 -2
- package/dist/components/molecules/pagination/pagination.js +76 -0
- package/dist/components/{plan-badge → molecules/plan-badge}/plan-badge.js +2 -2
- package/dist/components/{pricing-table → molecules/pricing-table}/pricing-table.js +2 -2
- package/dist/components/{profile-section → molecules/profile-section}/profile-section.js +1 -1
- package/dist/components/{progress-card → molecules/progress-card}/progress-card.js +21 -11
- package/dist/components/{progress-tracker → molecules/progress-tracker}/progress-tracker.js +45 -37
- package/dist/components/{prompt-templates → molecules/prompt-templates}/prompt-templates.js +4 -4
- package/dist/components/{role-badge → molecules/role-badge}/role-badge.js +2 -2
- package/dist/components/{scope-selector → molecules/scope-selector}/scope-selector.js +13 -9
- package/dist/components/{search-bar → molecules/search-bar}/search-bar.js +18 -12
- package/dist/components/{sidebar → molecules/sidebar}/sidebar.js +6 -6
- package/dist/components/{sidebar-toggle → molecules/sidebar-toggle}/sidebar-toggle.js +2 -2
- package/dist/components/{stat-card → molecules/stat-card}/stat-card.js +9 -4
- package/dist/components/{status-board → molecules/status-board}/status-board.js +10 -4
- package/dist/components/{text-field → molecules/text-field}/text-field.js +3 -3
- package/dist/components/{theme-toggle → molecules/theme-toggle}/theme-toggle.js +3 -3
- package/dist/components/{ticker-tape → molecules/ticker-tape}/ticker-tape.js +43 -15
- package/dist/components/{time-picker → molecules/time-picker}/time-picker.js +72 -29
- package/dist/components/{toggle-group → molecules/toggle-group}/toggle-group.js +2 -2
- package/dist/components/{tour → molecules/tour}/tour.js +18 -10
- package/dist/components/{transaction-list → molecules/transaction-list}/transaction-list.js +3 -3
- package/dist/components/{tutorial-card → molecules/tutorial-card}/tutorial-card.js +11 -9
- package/dist/components/{tutorial-filters → molecules/tutorial-filters}/tutorial-filters.js +5 -5
- package/dist/components/{usage-breakdown → molecules/usage-breakdown}/usage-breakdown.js +3 -3
- package/dist/components/{world-clock-bar → molecules/world-clock-bar}/world-clock-bar.js +3 -3
- package/dist/components/{zoom-hud → molecules/zoom-hud}/zoom-hud.js +3 -2
- package/dist/components/{activity-heatmap → organisms/activity-heatmap}/activity-heatmap.js +2 -2
- package/dist/components/{candlestick-chart → organisms/candlestick-chart}/candlestick-chart.js +5 -5
- package/dist/components/{canvas-view → organisms/canvas-view}/canvas-view.js +11 -15
- package/dist/components/{chart → organisms/chart}/area-chart.js +1 -1
- package/dist/components/{chart → organisms/chart}/bar-chart.js +2 -2
- package/dist/components/{chart → organisms/chart}/line-chart.js +1 -1
- package/dist/components/{choropleth-map → organisms/choropleth-map}/choropleth-map.js +10 -3
- package/dist/components/{chronological-timeline → organisms/chronological-timeline}/chronological-timeline.js +3 -5
- package/dist/components/{code-block → organisms/code-block}/code-block.js +45 -18
- package/dist/components/{code-playground → organisms/code-playground}/code-playground.js +11 -4
- package/dist/components/{combobox → organisms/combobox}/combobox.js +33 -11
- package/dist/components/{contribution-graph → organisms/contribution-graph}/contribution-graph.js +1 -1
- package/dist/components/{data-table → organisms/data-table}/data-table.js +45 -25
- package/dist/components/{date-picker → organisms/date-picker}/date-picker.js +30 -12
- package/dist/components/{date-range-picker → organisms/date-range-picker}/date-range-picker.js +28 -12
- package/dist/components/{flow-diagram → organisms/flow-diagram}/flow-canvas.js +4 -1
- package/dist/components/{flow-diagram → organisms/flow-diagram}/flow-controls.js +8 -2
- package/dist/components/{flow-diagram → organisms/flow-diagram}/flow-diagram.js +1 -1
- package/dist/components/{flow-diagram → organisms/flow-diagram}/flow-error-boundary.js +1 -1
- package/dist/components/{flow-diagram → organisms/flow-diagram}/flow-fullscreen.js +7 -3
- package/dist/components/{flow-diagram → organisms/flow-diagram}/index.js +2 -0
- package/dist/components/{flow-diagram → organisms/flow-diagram}/use-flow-diagram.js +27 -13
- package/dist/components/{gantt-chart → organisms/gantt-chart}/gantt-chart.js +7 -3
- package/dist/components/{geography-quiz-map → organisms/geography-quiz-map}/geography-quiz-map.js +44 -21
- package/dist/components/{globe-3d → organisms/globe-3d}/globe-3d.js +2 -2
- package/dist/components/{heat-map-overlay → organisms/heat-map-overlay}/heat-map-overlay.js +1 -1
- package/dist/components/{historic-timeline → organisms/historic-timeline}/historic-timeline.js +2 -2
- package/dist/components/{interactive-timeline → organisms/interactive-timeline}/interactive-timeline.js +7 -7
- package/dist/components/{map-2d → organisms/map-2d}/map-2d.js +4 -1
- package/dist/components/{map-timeline → organisms/map-timeline}/map-timeline.js +1 -1
- package/dist/components/{market-treemap → organisms/market-treemap}/market-treemap.js +11 -4
- package/dist/components/{model-selector → organisms/model-selector}/model-selector.js +69 -52
- package/dist/components/{multi-select → organisms/multi-select}/multi-select.js +23 -6
- package/dist/components/{navbar-saas → organisms/navbar-saas}/navbar-saas.js +4 -4
- package/dist/components/{parallel-timeline → organisms/parallel-timeline}/parallel-timeline.js +3 -2
- package/dist/components/{pie-chart → organisms/pie-chart}/pie-chart.js +1 -1
- package/dist/components/{primary-source-viewer → organisms/primary-source-viewer}/primary-source-viewer.js +2 -2
- package/dist/components/{radar-chart → organisms/radar-chart}/radar-chart.js +1 -1
- package/dist/components/{range-calendar → organisms/range-calendar}/range-calendar.js +1 -1
- package/dist/components/{route-map → organisms/route-map}/route-map.js +1 -1
- package/dist/components/{run-timeline → organisms/run-timeline}/run-timeline.js +3 -3
- package/dist/components/{sankey-chart → organisms/sankey-chart}/sankey-chart.js +1 -1
- package/dist/components/{search-dialog → organisms/search-dialog}/search-dialog.js +3 -3
- package/dist/components/{share-dialog → organisms/share-dialog}/share-dialog.js +41 -27
- package/dist/components/{slideshow → organisms/slideshow}/slideshow.js +30 -15
- package/dist/components/{static-code → organisms/static-code}/static-code-copy.js +2 -2
- package/dist/components/{static-code → organisms/static-code}/static-code.js +1 -1
- package/dist/components/{story-map → organisms/story-map}/story-map.js +1 -1
- package/dist/components/{subscription-card → organisms/subscription-card}/subscription-card.js +6 -4
- package/dist/components/{terminal → organisms/terminal}/terminal.js +6 -6
- package/dist/components/{tree-view → organisms/tree-view}/tree-view.js +42 -5
- package/dist/components/{tutorial-complete → organisms/tutorial-complete}/tutorial-complete.js +3 -3
- package/dist/components/{tutorial-mdx → organisms/tutorial-mdx}/tutorial-mdx.js +27 -21
- package/dist/components/{wallet-card → organisms/wallet-card}/wallet-card.js +4 -4
- package/dist/components/{canvas-shell → templates/canvas-shell}/canvas-shell.js +1 -1
- package/dist/index.d.ts +1353 -1047
- package/dist/index.js +14 -0
- package/dist/lib/focus-calendar-day.js +13 -0
- package/dist/lib/roving-focus.js +70 -0
- package/dist/lib/use-escape-key.js +6 -3
- package/dist/lib/use-event-callback.js +15 -0
- package/dist/lib/use-focus-containment.js +74 -0
- package/dist/lib/use-return-focus.js +23 -0
- package/dist/types/side-effect-imports.d.js +0 -0
- package/package.json +70 -69
- package/styles.css +35 -6
- package/themes/default.css +6 -6
- package/themes/presets.css +76 -76
- package/dist/components/completion-dialog/completion-dialog.js +0 -204
- package/dist/components/cursor/cursor.js +0 -52
- package/dist/components/dock/dock.js +0 -109
- package/dist/components/magnetic/magnetic.js +0 -63
- package/dist/components/magnetic-button/magnetic-button.js +0 -64
- package/dist/components/marquee/marquee.js +0 -97
- package/dist/components/pagination/pagination.js +0 -44
- package/dist/components/scroll-area/scroll-area.js +0 -48
- package/dist/components/spotlight-card/spotlight-card.js +0 -53
- package/dist/components/tabs/tabs.js +0 -132
- package/dist/components/tilt-card/tilt-card.js +0 -70
- /package/dist/components/{aspect-ratio → atoms/aspect-ratio}/aspect-ratio.js +0 -0
- /package/dist/components/{collapsible → atoms/collapsible}/collapsible.js +0 -0
- /package/dist/components/{lang-provider → atoms/lang-provider}/lang-provider.js +0 -0
- /package/dist/components/{share-section → atoms/share-section}/share-section.js +0 -0
- /package/dist/components/{sidebar-provider → atoms/sidebar-provider}/sidebar-provider.js +0 -0
- /package/dist/components/{social-fab → atoms/social-fab}/use-social-fab.js +0 -0
- /package/dist/components/{theme-provider → atoms/theme-provider}/theme-provider.js +0 -0
- /package/dist/components/{flow-diagram → organisms/flow-diagram}/types.js +0 -0
- /package/dist/components/{mdx-content → organisms/mdx-content}/mdx-content.js +0 -0
- /package/dist/components/{navbar-saas → organisms/navbar-saas}/use-mobile.js +0 -0
- /package/dist/components/{canvas-shell → templates/canvas-shell}/canvas-shell-route-config.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
|
-
import { cn } from "
|
|
4
|
+
import { cn } from "../../../lib/utils.js";
|
|
5
5
|
function handleClick(id) {
|
|
6
6
|
const element = document.querySelector(`#${id}`);
|
|
7
7
|
if (element) {
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { memo, useEffect, useRef } from "react";
|
|
4
|
-
import { useBodyScrollLock } from "
|
|
5
|
-
import { useEscapeKey } from "
|
|
6
|
-
import {
|
|
4
|
+
import { useBodyScrollLock } from "../../../lib/use-body-scroll-lock.js";
|
|
5
|
+
import { useEscapeKey } from "../../../lib/use-escape-key.js";
|
|
6
|
+
import { useFocusContainment } from "../../../lib/use-focus-containment.js";
|
|
7
|
+
import { cn } from "../../../lib/utils.js";
|
|
7
8
|
function useTocPanelBehavior(isOpen, onClose) {
|
|
8
9
|
const panelRef = useRef(null);
|
|
9
10
|
const closeButtonRef = useRef(null);
|
|
11
|
+
useFocusContainment(panelRef, isOpen);
|
|
10
12
|
useEffect(() => {
|
|
11
13
|
if (isOpen) {
|
|
12
14
|
closeButtonRef.current?.focus();
|
|
@@ -47,6 +49,7 @@ function TocHeader({
|
|
|
47
49
|
children: closeIcon ?? /* @__PURE__ */ jsx(
|
|
48
50
|
"svg",
|
|
49
51
|
{
|
|
52
|
+
"aria-hidden": "true",
|
|
50
53
|
className: "size-5",
|
|
51
54
|
fill: "none",
|
|
52
55
|
stroke: "currentColor",
|
|
@@ -137,6 +140,7 @@ function TocSectionList({
|
|
|
137
140
|
children: isCompleted ? /* @__PURE__ */ jsx(
|
|
138
141
|
"svg",
|
|
139
142
|
{
|
|
143
|
+
"aria-hidden": "true",
|
|
140
144
|
className: "size-3",
|
|
141
145
|
fill: "none",
|
|
142
146
|
stroke: "currentColor",
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
createContext,
|
|
5
|
+
use,
|
|
6
|
+
useCallback,
|
|
7
|
+
useEffect,
|
|
8
|
+
useId,
|
|
9
|
+
useLayoutEffect,
|
|
10
|
+
useMemo,
|
|
11
|
+
useRef,
|
|
12
|
+
useState
|
|
13
|
+
} from "react";
|
|
14
|
+
import { moveRovingFocus } from "../../../lib/roving-focus.js";
|
|
15
|
+
import { cn } from "../../../lib/utils.js";
|
|
16
|
+
function useIdRegistry() {
|
|
17
|
+
const [ids, setIds] = useState(/* @__PURE__ */ new Map());
|
|
18
|
+
const register = useCallback((value, id) => {
|
|
19
|
+
setIds(
|
|
20
|
+
(current) => current.get(value) === id ? current : new Map(current).set(value, id)
|
|
21
|
+
);
|
|
22
|
+
return () => {
|
|
23
|
+
setIds((current) => {
|
|
24
|
+
if (current.get(value) !== id) return current;
|
|
25
|
+
const next = new Map(current);
|
|
26
|
+
next.delete(value);
|
|
27
|
+
return next;
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
}, []);
|
|
31
|
+
return [ids, register];
|
|
32
|
+
}
|
|
33
|
+
function toIdPart(value) {
|
|
34
|
+
return encodeURIComponent(value);
|
|
35
|
+
}
|
|
36
|
+
const TabsContext = createContext(null);
|
|
37
|
+
function useTabsContext() {
|
|
38
|
+
const context = use(TabsContext);
|
|
39
|
+
if (!context) {
|
|
40
|
+
throw new Error("Tab components must be used within a Tabs component");
|
|
41
|
+
}
|
|
42
|
+
return context;
|
|
43
|
+
}
|
|
44
|
+
function Tabs({
|
|
45
|
+
children,
|
|
46
|
+
className,
|
|
47
|
+
defaultValue = "",
|
|
48
|
+
onValueChange,
|
|
49
|
+
value
|
|
50
|
+
}) {
|
|
51
|
+
const [internalTab, setInternalTab] = useState(defaultValue);
|
|
52
|
+
const isControlled = value !== void 0;
|
|
53
|
+
const activeTab = isControlled ? value : internalTab;
|
|
54
|
+
const onValueChangeRef = useRef(onValueChange);
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
onValueChangeRef.current = onValueChange;
|
|
57
|
+
}, [onValueChange]);
|
|
58
|
+
const handleSetActiveTab = useCallback(
|
|
59
|
+
(next) => {
|
|
60
|
+
if (!isControlled) {
|
|
61
|
+
setInternalTab(next);
|
|
62
|
+
}
|
|
63
|
+
onValueChangeRef.current?.(next);
|
|
64
|
+
},
|
|
65
|
+
[isControlled]
|
|
66
|
+
);
|
|
67
|
+
const baseId = useId();
|
|
68
|
+
const [tabIds, registerTab] = useIdRegistry();
|
|
69
|
+
const [panelIds, registerPanel] = useIdRegistry();
|
|
70
|
+
const [firstTab] = tabIds.keys();
|
|
71
|
+
const contextValue = useMemo(
|
|
72
|
+
() => ({
|
|
73
|
+
activeTab,
|
|
74
|
+
baseId,
|
|
75
|
+
firstTab,
|
|
76
|
+
panelIds,
|
|
77
|
+
registerPanel,
|
|
78
|
+
registerTab,
|
|
79
|
+
setActiveTab: handleSetActiveTab,
|
|
80
|
+
tabIds
|
|
81
|
+
}),
|
|
82
|
+
[
|
|
83
|
+
activeTab,
|
|
84
|
+
baseId,
|
|
85
|
+
firstTab,
|
|
86
|
+
handleSetActiveTab,
|
|
87
|
+
panelIds,
|
|
88
|
+
registerPanel,
|
|
89
|
+
registerTab,
|
|
90
|
+
tabIds
|
|
91
|
+
]
|
|
92
|
+
);
|
|
93
|
+
return /* @__PURE__ */ jsx(TabsContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx("div", { className: cn("my-6", className), children }) });
|
|
94
|
+
}
|
|
95
|
+
function TabsList({
|
|
96
|
+
"aria-label": ariaLabel,
|
|
97
|
+
children,
|
|
98
|
+
className,
|
|
99
|
+
onKeyDown
|
|
100
|
+
}) {
|
|
101
|
+
const handleKeyDown = (event) => {
|
|
102
|
+
onKeyDown?.(event);
|
|
103
|
+
moveRovingFocus(event, '[role="tab"]', { activate: true });
|
|
104
|
+
};
|
|
105
|
+
return /* @__PURE__ */ jsx(
|
|
106
|
+
"div",
|
|
107
|
+
{
|
|
108
|
+
"aria-label": ariaLabel,
|
|
109
|
+
className: cn("flex border-b border-border overflow-x-auto", className),
|
|
110
|
+
onKeyDown: handleKeyDown,
|
|
111
|
+
role: "tablist",
|
|
112
|
+
tabIndex: -1,
|
|
113
|
+
children
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
function TabsTrigger({
|
|
118
|
+
"aria-controls": ariaControls,
|
|
119
|
+
"aria-hidden": ariaHidden,
|
|
120
|
+
children,
|
|
121
|
+
className,
|
|
122
|
+
id,
|
|
123
|
+
tabIndex,
|
|
124
|
+
value
|
|
125
|
+
}) {
|
|
126
|
+
const {
|
|
127
|
+
activeTab,
|
|
128
|
+
baseId,
|
|
129
|
+
firstTab,
|
|
130
|
+
panelIds,
|
|
131
|
+
registerTab,
|
|
132
|
+
setActiveTab,
|
|
133
|
+
tabIds
|
|
134
|
+
} = useTabsContext();
|
|
135
|
+
const isActive = activeTab === value;
|
|
136
|
+
const tabId = id ?? `${baseId}-tab-${toIdPart(value)}`;
|
|
137
|
+
const hasActiveTab = tabIds.has(activeTab);
|
|
138
|
+
const isTabStop = isActive || !hasActiveTab && firstTab === value;
|
|
139
|
+
useEffect(() => registerTab(value, tabId), [registerTab, tabId, value]);
|
|
140
|
+
return /* @__PURE__ */ jsx(
|
|
141
|
+
"button",
|
|
142
|
+
{
|
|
143
|
+
"aria-controls": ariaControls ?? (isActive ? panelIds.get(value) : void 0),
|
|
144
|
+
"aria-hidden": ariaHidden,
|
|
145
|
+
"aria-selected": isActive,
|
|
146
|
+
className: cn(
|
|
147
|
+
"px-4 py-2 text-sm font-medium whitespace-nowrap transition-colors",
|
|
148
|
+
"border-b-2 -mb-px",
|
|
149
|
+
isActive ? "border-primary text-primary" : "border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground/50",
|
|
150
|
+
className
|
|
151
|
+
),
|
|
152
|
+
id: tabId,
|
|
153
|
+
onClick: () => {
|
|
154
|
+
setActiveTab(value);
|
|
155
|
+
},
|
|
156
|
+
role: "tab",
|
|
157
|
+
tabIndex: tabIndex ?? (isTabStop ? 0 : -1),
|
|
158
|
+
type: "button",
|
|
159
|
+
children
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
const FOCUSABLE = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [contenteditable="true"], [tabindex]:not([tabindex="-1"])';
|
|
164
|
+
function useHasFocusableContent(panelRef, isActive) {
|
|
165
|
+
const [hasFocusable, setHasFocusable] = useState(false);
|
|
166
|
+
useLayoutEffect(() => {
|
|
167
|
+
const panel = panelRef.current;
|
|
168
|
+
if (!isActive || !panel) return;
|
|
169
|
+
const measure = () => {
|
|
170
|
+
setHasFocusable(panel.querySelector(FOCUSABLE) !== null);
|
|
171
|
+
};
|
|
172
|
+
measure();
|
|
173
|
+
if (typeof MutationObserver === "undefined") return;
|
|
174
|
+
const observer = new MutationObserver(measure);
|
|
175
|
+
observer.observe(panel, {
|
|
176
|
+
attributes: true,
|
|
177
|
+
childList: true,
|
|
178
|
+
subtree: true
|
|
179
|
+
});
|
|
180
|
+
return () => {
|
|
181
|
+
observer.disconnect();
|
|
182
|
+
};
|
|
183
|
+
}, [isActive, panelRef]);
|
|
184
|
+
return hasFocusable;
|
|
185
|
+
}
|
|
186
|
+
function TabsContent({
|
|
187
|
+
"aria-hidden": ariaHidden,
|
|
188
|
+
"aria-labelledby": ariaLabelledBy,
|
|
189
|
+
children,
|
|
190
|
+
className,
|
|
191
|
+
id,
|
|
192
|
+
tabIndex,
|
|
193
|
+
value
|
|
194
|
+
}) {
|
|
195
|
+
const { activeTab, baseId, registerPanel, tabIds } = useTabsContext();
|
|
196
|
+
const isActive = activeTab === value;
|
|
197
|
+
const panelId = id ?? `${baseId}-panel-${toIdPart(value)}`;
|
|
198
|
+
const panelRef = useRef(null);
|
|
199
|
+
const hasFocusable = useHasFocusableContent(panelRef, isActive);
|
|
200
|
+
useEffect(() => {
|
|
201
|
+
if (!isActive) return;
|
|
202
|
+
return registerPanel(value, panelId);
|
|
203
|
+
}, [isActive, panelId, registerPanel, value]);
|
|
204
|
+
if (!isActive) return null;
|
|
205
|
+
return /* @__PURE__ */ jsx(
|
|
206
|
+
"div",
|
|
207
|
+
{
|
|
208
|
+
"aria-hidden": ariaHidden,
|
|
209
|
+
"aria-labelledby": ariaLabelledBy ?? tabIds.get(value),
|
|
210
|
+
className: cn("pt-4", className),
|
|
211
|
+
id: panelId,
|
|
212
|
+
ref: panelRef,
|
|
213
|
+
role: "tabpanel",
|
|
214
|
+
tabIndex: tabIndex ?? (hasFocusable ? void 0 : 0),
|
|
215
|
+
children
|
|
216
|
+
}
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
Tabs.List = TabsList;
|
|
220
|
+
Tabs.Trigger = TabsTrigger;
|
|
221
|
+
Tabs.Content = TabsContent;
|
|
222
|
+
export {
|
|
223
|
+
Tabs,
|
|
224
|
+
TabsContent,
|
|
225
|
+
TabsList,
|
|
226
|
+
TabsTrigger
|
|
227
|
+
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { X } from "lucide-react";
|
|
5
|
-
import { cn } from "
|
|
5
|
+
import { cn } from "../../../lib/utils.js";
|
|
6
6
|
const TagGroupContext = React.createContext(null);
|
|
7
7
|
function useTagGroupContext() {
|
|
8
8
|
const context = React.use(TagGroupContext);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { cn } from "
|
|
4
|
+
import { cn } from "../../../lib/utils.js";
|
|
5
5
|
function usePrefersReducedMotion() {
|
|
6
6
|
const [reduced, setReduced] = React.useState(false);
|
|
7
7
|
React.useEffect(() => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { cn } from "
|
|
4
|
+
import { cn } from "../../../lib/utils.js";
|
|
5
5
|
function usePrefersReducedMotion() {
|
|
6
6
|
const [reduced, setReduced] = React.useState(false);
|
|
7
7
|
React.useEffect(() => {
|
|
@@ -31,21 +31,32 @@ function useScrollProgress(nodeRef, enabled) {
|
|
|
31
31
|
setProgress(1);
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
let frame = null;
|
|
35
|
+
const update = () => {
|
|
36
|
+
frame = null;
|
|
35
37
|
const bounds = node.getBoundingClientRect();
|
|
36
38
|
const span = bounds.height + window.innerHeight;
|
|
37
39
|
setProgress(clamp((window.innerHeight - bounds.top) / span));
|
|
38
40
|
};
|
|
39
|
-
onScroll()
|
|
41
|
+
const onScroll = () => {
|
|
42
|
+
frame ?? (frame = requestAnimationFrame(update));
|
|
43
|
+
};
|
|
44
|
+
update();
|
|
40
45
|
window.addEventListener("scroll", onScroll, { passive: true });
|
|
41
46
|
return () => {
|
|
42
47
|
window.removeEventListener("scroll", onScroll);
|
|
48
|
+
if (frame !== null) {
|
|
49
|
+
cancelAnimationFrame(frame);
|
|
50
|
+
}
|
|
43
51
|
};
|
|
44
52
|
}, [enabled, nodeRef]);
|
|
45
53
|
return progress;
|
|
46
54
|
}
|
|
47
|
-
function
|
|
48
|
-
return Math.min(Math.max(progress * total - index, 0
|
|
55
|
+
function wordReveal(progress, total, index) {
|
|
56
|
+
return Math.min(Math.max(progress * total - index, 0), 1);
|
|
57
|
+
}
|
|
58
|
+
function wordColor(reveal) {
|
|
59
|
+
return `color-mix(in oklab, oklch(var(--foreground)) ${Math.round(reveal * 100).toString()}%, oklch(var(--muted-foreground)))`;
|
|
49
60
|
}
|
|
50
61
|
const TextReveal = ({
|
|
51
62
|
children,
|
|
@@ -57,10 +68,9 @@ const TextReveal = ({
|
|
|
57
68
|
const nodeRef = React.useRef(null);
|
|
58
69
|
const progress = useScrollProgress(nodeRef, !reduced);
|
|
59
70
|
const words = children.split(" ");
|
|
60
|
-
return /* @__PURE__ */
|
|
71
|
+
return /* @__PURE__ */ jsxs(
|
|
61
72
|
"div",
|
|
62
73
|
{
|
|
63
|
-
"aria-label": children,
|
|
64
74
|
className: cn("flex flex-wrap gap-x-[0.25em]", className),
|
|
65
75
|
ref: (node) => {
|
|
66
76
|
nodeRef.current = node;
|
|
@@ -71,16 +81,21 @@ const TextReveal = ({
|
|
|
71
81
|
}
|
|
72
82
|
},
|
|
73
83
|
...props,
|
|
74
|
-
children:
|
|
75
|
-
"span",
|
|
76
|
-
|
|
77
|
-
"
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
+
children: [
|
|
85
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children }),
|
|
86
|
+
words.map((word, index) => /* @__PURE__ */ jsx(
|
|
87
|
+
"span",
|
|
88
|
+
{
|
|
89
|
+
"aria-hidden": "true",
|
|
90
|
+
className: "transition-colors duration-300",
|
|
91
|
+
style: {
|
|
92
|
+
color: wordColor(wordReveal(progress, words.length, index))
|
|
93
|
+
},
|
|
94
|
+
children: word
|
|
95
|
+
},
|
|
96
|
+
`${word}-${index}`
|
|
97
|
+
))
|
|
98
|
+
]
|
|
84
99
|
}
|
|
85
100
|
);
|
|
86
101
|
};
|
|
@@ -8,17 +8,31 @@ import {
|
|
|
8
8
|
THEME_CUSTOM_CSS_STORAGE_KEY,
|
|
9
9
|
THEME_CUSTOM_STYLE_ID,
|
|
10
10
|
THEME_PRESET_STORAGE_KEY
|
|
11
|
-
} from "
|
|
12
|
-
import { setThemePreset } from "
|
|
13
|
-
const
|
|
11
|
+
} from "../../../lib/theme-presets.js";
|
|
12
|
+
import { setThemePreset } from "../../../lib/use-theme-preset.js";
|
|
13
|
+
const SCRIPT_UNSAFE_CHARACTERS = /[/<>\u2028\u2029]/g;
|
|
14
|
+
const SCRIPT_ESCAPES = {
|
|
15
|
+
"\u2028": String.raw`\u2028`,
|
|
16
|
+
"\u2029": String.raw`\u2029`,
|
|
17
|
+
"/": String.raw`\u002F`,
|
|
18
|
+
"<": String.raw`\u003C`,
|
|
19
|
+
">": String.raw`\u003E`
|
|
20
|
+
};
|
|
21
|
+
function scriptLiteral(value) {
|
|
22
|
+
return JSON.stringify(value).replaceAll(
|
|
23
|
+
SCRIPT_UNSAFE_CHARACTERS,
|
|
24
|
+
(character) => SCRIPT_ESCAPES[character] ?? character
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
const FOUC_SCRIPT = `(function(){try{var v=localStorage.getItem(${scriptLiteral(
|
|
14
28
|
THEME_PRESET_STORAGE_KEY
|
|
15
|
-
)});if(!v||v===${
|
|
29
|
+
)});if(!v||v===${scriptLiteral(
|
|
16
30
|
DEFAULT_THEME_PRESET
|
|
17
|
-
)})return;document.documentElement.setAttribute("data-theme",v);if(v===${
|
|
31
|
+
)})return;document.documentElement.setAttribute("data-theme",v);if(v===${scriptLiteral(
|
|
18
32
|
CUSTOM_THEME_NAME
|
|
19
|
-
)}){var c=localStorage.getItem(${
|
|
33
|
+
)}){var c=localStorage.getItem(${scriptLiteral(
|
|
20
34
|
THEME_CUSTOM_CSS_STORAGE_KEY
|
|
21
|
-
)});if(c){var s=document.createElement("style");s.id=${
|
|
35
|
+
)});if(c){var s=document.createElement("style");s.id=${scriptLiteral(
|
|
22
36
|
THEME_CUSTOM_STYLE_ID
|
|
23
37
|
)};s.textContent=c;document.head.appendChild(s);}}}catch(e){}})();`;
|
|
24
38
|
function ThemePresetProvider({
|
|
@@ -1,18 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { moveRovingFocus } from "../../../lib/roving-focus.js";
|
|
4
|
+
import { useMounted } from "../../../lib/use-mounted.js";
|
|
5
|
+
import { useThemePreset } from "../../../lib/use-theme-preset.js";
|
|
6
|
+
import { cn } from "../../../lib/utils.js";
|
|
7
|
+
function handleRadioKeyDown(event) {
|
|
8
|
+
moveRovingFocus(event, '[role="radio"]', {
|
|
9
|
+
activate: true,
|
|
10
|
+
orientation: "both"
|
|
11
|
+
});
|
|
12
|
+
}
|
|
6
13
|
function ThemeSwitcher({ className }) {
|
|
7
14
|
const mounted = useMounted();
|
|
8
15
|
const { preset, presets, setPreset } = useThemePreset();
|
|
16
|
+
const hasChecked = mounted && presets.some((item) => item.name === preset);
|
|
9
17
|
return /* @__PURE__ */ jsx(
|
|
10
18
|
"div",
|
|
11
19
|
{
|
|
12
20
|
"aria-label": "Theme preset",
|
|
13
21
|
className: cn("flex items-center gap-1.5", className),
|
|
22
|
+
onKeyDown: handleRadioKeyDown,
|
|
14
23
|
role: "radiogroup",
|
|
15
|
-
|
|
24
|
+
tabIndex: -1,
|
|
25
|
+
children: presets.map((item, index) => {
|
|
16
26
|
const active = mounted && preset === item.name;
|
|
17
27
|
return /* @__PURE__ */ jsx(
|
|
18
28
|
"button",
|
|
@@ -29,6 +39,7 @@ function ThemeSwitcher({ className }) {
|
|
|
29
39
|
},
|
|
30
40
|
role: "radio",
|
|
31
41
|
style: { backgroundColor: item.swatch },
|
|
42
|
+
tabIndex: active || !hasChecked && index === 0 ? 0 : -1,
|
|
32
43
|
title: item.label,
|
|
33
44
|
type: "button"
|
|
34
45
|
},
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback, useEffect, useId, useState } from "react";
|
|
4
4
|
import { ChevronDown, ChevronRight } from "lucide-react";
|
|
5
|
-
import { cn } from "
|
|
5
|
+
import { cn } from "../../../lib/utils.js";
|
|
6
6
|
function ThinkingBlock({
|
|
7
7
|
className,
|
|
8
8
|
isStreaming = false,
|
|
@@ -11,11 +11,13 @@ function ThinkingBlock({
|
|
|
11
11
|
const [isExpanded, setIsExpanded] = useState(() => isStreaming);
|
|
12
12
|
const contentId = useId();
|
|
13
13
|
useEffect(() => {
|
|
14
|
-
if (isStreaming)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
if (!isStreaming) return;
|
|
15
|
+
const frame = requestAnimationFrame(() => {
|
|
16
|
+
setIsExpanded(true);
|
|
17
|
+
});
|
|
18
|
+
return () => {
|
|
19
|
+
cancelAnimationFrame(frame);
|
|
20
|
+
};
|
|
19
21
|
}, [isStreaming]);
|
|
20
22
|
const toggleExpanded = useCallback(() => {
|
|
21
23
|
setIsExpanded((previous) => !previous);
|
|
@@ -33,7 +35,7 @@ function ThinkingBlock({
|
|
|
33
35
|
isExpanded ? /* @__PURE__ */ jsx(ChevronDown, { className: "size-3" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "size-3" }),
|
|
34
36
|
/* @__PURE__ */ jsxs("span", { children: [
|
|
35
37
|
"Thinking",
|
|
36
|
-
isStreaming ? /* @__PURE__ */ jsx("span", { className: "ml-1 animate-pulse", children: "\u2026" }) : null
|
|
38
|
+
isStreaming ? /* @__PURE__ */ jsx("span", { className: "ml-1 animate-pulse motion-reduce:animate-none", children: "\u2026" }) : null
|
|
37
39
|
] })
|
|
38
40
|
]
|
|
39
41
|
}
|
|
@@ -45,7 +47,7 @@ function ThinkingBlock({
|
|
|
45
47
|
id: contentId,
|
|
46
48
|
children: [
|
|
47
49
|
thinking,
|
|
48
|
-
isStreaming ? /* @__PURE__ */ jsx("span", { className: "animate-pulse", children: "|" }) : null
|
|
50
|
+
isStreaming ? /* @__PURE__ */ jsx("span", { className: "animate-pulse motion-reduce:animate-none", children: "|" }) : null
|
|
49
51
|
]
|
|
50
52
|
}
|
|
51
53
|
) : null
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { cn } from "
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
4
|
const DEFAULT_LABELS = {
|
|
5
5
|
empty: "No replies yet",
|
|
6
6
|
region: "Comment thread"
|
|
@@ -14,7 +14,9 @@ const Message = (props) => {
|
|
|
14
14
|
{
|
|
15
15
|
className: "font-semibold",
|
|
16
16
|
"data-thread-bubble-author": true,
|
|
17
|
-
style: message.authorColor ? {
|
|
17
|
+
style: message.authorColor ? {
|
|
18
|
+
color: `color-mix(in oklab, ${message.authorColor} 50%, oklch(var(--foreground)))`
|
|
19
|
+
} : void 0,
|
|
18
20
|
children: message.author
|
|
19
21
|
}
|
|
20
22
|
),
|