@vvedantb/ui 0.67.0 → 0.69.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/app/src/auth/useStableAuth.ts +0 -2
- package/app/src/confirm/ConfirmSkipHint.tsx +0 -2
- package/app/src/confirm/useAltHeld.ts +0 -17
- package/app/src/convex/ConvexClerkProvider.tsx +0 -3
- package/app/src/convex/env.ts +0 -4
- package/app/src/convex/errorMessage.ts +0 -1
- package/app/src/convex/useHeldResult.ts +0 -3
- package/app/src/page-motion/PageMotionProvider.tsx +0 -6
- package/app/src/page-title/createPageTitleContext.tsx +0 -14
- package/app/src/settings/SettingsEmptyState.tsx +0 -4
- package/app/src/settings/SettingsField.tsx +0 -4
- package/app/src/settings/SettingsPage.tsx +0 -12
- package/app/src/settings/SettingsSection.tsx +0 -14
- package/app/src/settings/ThemeModePicker.tsx +0 -6
- package/app/src/theme/createThemeProvider.tsx +0 -33
- package/app/src/time/compactRelativeTime.ts +0 -16
- package/app/src/update/staleDeployReload.ts +0 -40
- package/app/src/update/updateWatcher.ts +0 -8
- package/dist/app/src/auth/useStableAuth.js +0 -1
- package/dist/app/src/confirm/ConfirmSkipHint.js +0 -3
- package/dist/app/src/confirm/useAltHeld.js +0 -17
- package/dist/app/src/convex/env.js +0 -3
- package/dist/app/src/convex/errorMessage.js +0 -2
- package/dist/app/src/settings/ThemeModePicker.js +0 -1
- package/dist/app/src/theme/createThemeProvider.js +1 -11
- package/dist/app/src/time/compactRelativeTime.js +0 -8
- package/dist/app/src/update/staleDeployReload.js +3 -38
- package/dist/app/src/update/updateWatcher.js +1 -3
- package/dist/shell/src/AppShell.js +0 -14
- package/dist/shell/src/PageHeaderBar.js +0 -3
- package/dist/shell/src/SessionsHoverCard.js +0 -9
- package/dist/shell/src/SidePanelTabs.js +0 -36
- package/dist/shell/src/Sidebar.js +0 -1
- package/dist/shell/src/SidebarChrome.js +0 -19
- package/dist/shell/src/SidebarIconTooltip.js +0 -1
- package/dist/shell/src/SidebarRail.js +0 -12
- package/dist/shell/src/SidebarResize.js +1 -4
- package/dist/shell/src/app-shell-classes.js +0 -10
- package/dist/shell/src/index.js +0 -1
- package/dist/shell/src/shell-panel-motion.js +0 -12
- package/dist/src/ai-elements/activity-shared.js +0 -6
- package/dist/src/ai-elements/activity-step-label.js +0 -6
- package/dist/src/ai-elements/activity-step-types.js +0 -4
- package/dist/src/ai-elements/activity-tasks-utils.js +0 -17
- package/dist/src/ai-elements/activity-tasks.js +0 -55
- package/dist/src/ai-elements/artifact.js +0 -4
- package/dist/src/ai-elements/attachments.js +0 -41
- package/dist/src/ai-elements/code-block.js +0 -18
- package/dist/src/ai-elements/collapsible-user-message-body.js +0 -2
- package/dist/src/ai-elements/context.js +0 -13
- package/dist/src/ai-elements/conversation.js +0 -4
- package/dist/src/ai-elements/jump-rail.js +0 -5
- package/dist/src/ai-elements/message.js +0 -7
- package/dist/src/ai-elements/model-picker-types.js +0 -1
- package/dist/src/ai-elements/model-picker.js +1 -6
- package/dist/src/ai-elements/model-selector.js +0 -4
- package/dist/src/ai-elements/prompt-input-speech.js +0 -13
- package/dist/src/ai-elements/prompt-input.js +0 -1
- package/dist/src/ai-elements/provider-icon.js +0 -4
- package/dist/src/ai-elements/queue.js +0 -15
- package/dist/src/ai-elements/shimmer.js +0 -14
- package/dist/src/ai-elements/speech-input.js +0 -7
- package/dist/src/artifacts/artifact-frame.js +0 -2
- package/dist/src/audio/playChime.js +0 -2
- package/dist/src/audio/playTone.js +1 -4
- package/dist/src/brand/AppWordmark.js +0 -5
- package/dist/src/brand/svg.js +0 -6
- package/dist/src/client.js +0 -43
- package/dist/src/composer/Composer.js +0 -27
- package/dist/src/composer/input-area/InputArea.js +0 -3
- package/dist/src/composer/input-area/InputAreaEditor.js +1 -50
- package/dist/src/composer/input-area/composerPrediction.js +0 -3
- package/dist/src/generative-ui/content.js +0 -2
- package/dist/src/generative-ui/index.js +0 -3
- package/dist/src/generative-ui/layout.js +0 -5
- package/dist/src/hooks/use-count-up-display.js +0 -2
- package/dist/src/hooks/use-idle-callback.js +0 -3
- package/dist/src/hooks/use-persisted-scroll-parent.js +1 -8
- package/dist/src/icons/animated/index.js +0 -4
- package/dist/src/icons/board-icon.js +74 -41
- package/dist/src/icons/bolt-icon.js +30 -20
- package/dist/src/icons/building-icon.js +125 -61
- package/dist/src/icons/files-icon.js +103 -43
- package/dist/src/icons/inbox-icon.js +101 -49
- package/dist/src/icons/index.js +2 -1
- package/dist/src/icons/memory-icon.js +135 -58
- package/dist/src/icons/search-icon.js +143 -46
- package/dist/src/icons/settings-icon.js +113 -53
- package/dist/src/icons/solid-icons.js +665 -0
- package/dist/src/icons/with-active.js +25 -0
- package/dist/src/index.js +0 -40
- package/dist/src/kibo/gantt-features.js +0 -10
- package/dist/src/kibo/gantt-provider.js +0 -34
- package/dist/src/kibo/kanban.js +0 -15
- package/dist/src/kibo/list.js +0 -3
- package/dist/src/kibo/video-player.js +0 -7
- package/dist/src/logos/index.js +0 -4
- package/dist/src/markdown/Markdown.js +0 -15
- package/dist/src/markdown/MarkdownCodeBlock.js +0 -16
- package/dist/src/markdown/MarkdownInlineCode.js +0 -6
- package/dist/src/markdown/MarkdownLink.js +0 -5
- package/dist/src/markdown/codeFence.js +0 -1
- package/dist/src/markdown/codeHighlight.js +0 -19
- package/dist/src/markdown/incrementalBlocks.js +0 -45
- package/dist/src/markdown/markdownClipboard.js +0 -13
- package/dist/src/markdown/mermaid.js +0 -25
- package/dist/src/markdown/rehypeGithubAlerts.js +0 -4
- package/dist/src/markdown/useSmoothText.js +0 -5
- package/dist/src/marketing/PricingModal.js +0 -2
- package/dist/src/marketing/ProductHero.js +0 -2
- package/dist/src/marketing/createLandingKit.js +0 -5
- package/dist/src/marketing/marketing-classes.js +0 -7
- package/dist/src/motion/dock-motion.js +0 -27
- package/dist/src/motion/panel-transition.js +0 -2
- package/dist/src/ui/_field-classes.js +0 -3
- package/dist/src/ui/_menu-classes.js +0 -6
- package/dist/src/ui/_picker-classes.js +0 -9
- package/dist/src/ui/accordion.alt.js +0 -12
- package/dist/src/ui/badge.js +0 -1
- package/dist/src/ui/border-beam.js +0 -2
- package/dist/src/ui/breadcrumb.js +0 -15
- package/dist/src/ui/bulk-action-bar.js +0 -11
- package/dist/src/ui/button.js +0 -20
- package/dist/src/ui/calendar.js +1 -20
- package/dist/src/ui/card.js +0 -3
- package/dist/src/ui/carousel.js +0 -1
- package/dist/src/ui/clear-input.alt.js +0 -9
- package/dist/src/ui/clearInputDissolve.js +0 -4
- package/dist/src/ui/command.js +0 -15
- package/dist/src/ui/confetti-burst.js +0 -3
- package/dist/src/ui/confirm-dialog-parts.js +0 -11
- package/dist/src/ui/confirm-dialog.js +0 -6
- package/dist/src/ui/crossfade-icon.js +0 -2
- package/dist/src/ui/date-picker.js +0 -22
- package/dist/src/ui/dialog.js +0 -5
- package/dist/src/ui/empty-state.js +0 -7
- package/dist/src/ui/field.js +0 -21
- package/dist/src/ui/image-lightbox.js +0 -5
- package/dist/src/ui/input-group.alt.js +0 -24
- package/dist/src/ui/input-group.js +0 -4
- package/dist/src/ui/kbd.js +0 -3
- package/dist/src/ui/loading-state.js +0 -17
- package/dist/src/ui/marquee-on-hover.js +0 -3
- package/dist/src/ui/media-preview.js +0 -2
- package/dist/src/ui/modalTransition.js +0 -33
- package/dist/src/ui/overlay-a11y.js +0 -1
- package/dist/src/ui/page-title.js +0 -3
- package/dist/src/ui/refresh-spin-icon.js +0 -12
- package/dist/src/ui/search-input.js +0 -1
- package/dist/src/ui/select-field.js +0 -1
- package/dist/src/ui/send-queue-icon.js +0 -3
- package/dist/src/ui/sheet.js +0 -33
- package/dist/src/ui/slider.js +103 -82
- package/dist/src/ui/sonner-icons.js +0 -5
- package/dist/src/ui/sonner.js +0 -60
- package/dist/src/ui/spinner.js +0 -35
- package/dist/src/ui/status-dot.js +0 -2
- package/dist/src/ui/surface.js +0 -14
- package/dist/src/ui/switch.js +213 -36
- package/dist/src/ui/table.js +0 -1
- package/dist/src/ui/tabs-transition.js +0 -1
- package/dist/src/ui/tabs.js +0 -17
- package/dist/src/ui/tabsSliding.js +0 -6
- package/dist/src/ui/time-picker.js +0 -15
- package/dist/src/ui/toggle-search.js +0 -3
- package/dist/src/ui/ui-config.js +0 -16
- package/dist/src/utils/cat-color.js +0 -17
- package/dist/src/utils/cn.js +0 -5
- package/dist/src/utils/gesture.js +0 -8
- package/dist/src/utils/ref.js +0 -1
- package/dist/src/utils/runtimeVisibility.js +1 -22
- package/dist/src/utils/surface-radius.js +0 -11
- package/dist/src/utils/useDragSensors.js +0 -4
- package/dist/tokens/src/tailwind-preset.mjs +0 -3
- package/package.json +1 -1
- package/scripts/build-brand-assets.mjs +0 -8
- package/shell/src/AppShell.tsx +0 -37
- package/shell/src/AppSidebar.tsx +0 -14
- package/shell/src/ButtonTrack.tsx +0 -1
- package/shell/src/PageHeaderBar.tsx +0 -61
- package/shell/src/PageWrapper.tsx +0 -26
- package/shell/src/PillTabs.tsx +0 -1
- package/shell/src/SessionsHoverCard.tsx +0 -40
- package/shell/src/SidePanelTabs.tsx +0 -61
- package/shell/src/Sidebar.tsx +0 -1
- package/shell/src/SidebarAccountMenu.tsx +0 -40
- package/shell/src/SidebarChrome.tsx +0 -32
- package/shell/src/SidebarIconTooltip.tsx +0 -3
- package/shell/src/SidebarPanel.tsx +0 -20
- package/shell/src/SidebarRail.tsx +0 -44
- package/shell/src/SidebarResize.tsx +0 -6
- package/shell/src/SidebarUpgradeCard.tsx +0 -2
- package/shell/src/SignOutDialog.tsx +0 -6
- package/shell/src/app-shell-classes.ts +0 -15
- package/shell/src/index.ts +0 -1
- package/shell/src/shell-panel-motion.ts +0 -11
- package/shell/src/shell-variant.ts +0 -6
- package/src/ai-elements/activity-question.tsx +0 -2
- package/src/ai-elements/activity-shared.tsx +0 -11
- package/src/ai-elements/activity-step-detail.tsx +0 -2
- package/src/ai-elements/activity-step-label.ts +0 -5
- package/src/ai-elements/activity-step-types.ts +0 -24
- package/src/ai-elements/activity-tasks-utils.ts +0 -13
- package/src/ai-elements/activity-tasks.tsx +0 -61
- package/src/ai-elements/artifact.tsx +0 -7
- package/src/ai-elements/attachments.tsx +0 -33
- package/src/ai-elements/chat-day-divider.tsx +0 -3
- package/src/ai-elements/chat-jump-rail.tsx +0 -9
- package/src/ai-elements/code-block.tsx +0 -28
- package/src/ai-elements/collapsible-user-message-body.tsx +0 -2
- package/src/ai-elements/context.tsx +0 -10
- package/src/ai-elements/conversation.tsx +0 -16
- package/src/ai-elements/jump-rail.tsx +0 -31
- package/src/ai-elements/message.tsx +0 -32
- package/src/ai-elements/model-picker-content.tsx +0 -17
- package/src/ai-elements/model-picker-types.ts +0 -5
- package/src/ai-elements/model-picker.tsx +0 -36
- package/src/ai-elements/model-selector.tsx +0 -5
- package/src/ai-elements/prompt-input-speech.tsx +0 -11
- package/src/ai-elements/prompt-input.tsx +0 -26
- package/src/ai-elements/provider-icon.tsx +0 -2
- package/src/ai-elements/queue.tsx +0 -19
- package/src/ai-elements/reasoning.tsx +0 -4
- package/src/ai-elements/shimmer.tsx +0 -16
- package/src/ai-elements/simple-model-ladder.tsx +0 -1
- package/src/ai-elements/speech-input.tsx +0 -6
- package/src/ai-elements/test-results.tsx +0 -5
- package/src/ai-elements/trace.tsx +0 -2
- package/src/ai-elements/web-preview.tsx +0 -7
- package/src/artifacts/artifact-card.tsx +0 -7
- package/src/artifacts/artifact-dialogs.tsx +0 -4
- package/src/artifacts/artifact-frame.tsx +0 -10
- package/src/artifacts/artifact-list-toolbar.tsx +0 -6
- package/src/artifacts/artifact-list.tsx +0 -4
- package/src/artifacts/artifact-type-icon.tsx +0 -1
- package/src/artifacts/artifact-versions-menu.tsx +0 -3
- package/src/artifacts/artifact-viewer.tsx +0 -5
- package/src/artifacts/types.ts +0 -1
- package/src/audio/playChime.ts +0 -1
- package/src/audio/playTone.ts +0 -7
- package/src/brand/AppIcons.tsx +0 -5
- package/src/brand/AppMark.tsx +0 -6
- package/src/brand/AppWordmark.tsx +0 -10
- package/src/brand/familyApps.ts +0 -2
- package/src/brand/svg.ts +0 -9
- package/src/client.ts +0 -34
- package/src/composer/Composer.tsx +0 -70
- package/src/composer/input-area/ComposerSlashMenu.tsx +0 -1
- package/src/composer/input-area/ConnectionStatusMenuItem.tsx +0 -2
- package/src/composer/input-area/FadePresence.tsx +0 -4
- package/src/composer/input-area/InputActions.tsx +0 -5
- package/src/composer/input-area/InputArea.tsx +1 -28
- package/src/composer/input-area/InputAreaEditor.tsx +0 -39
- package/src/composer/input-area/InputBanners.tsx +0 -1
- package/src/composer/input-area/PromoBanner.tsx +0 -1
- package/src/composer/input-area/composerPrediction.ts +0 -2
- package/src/composer/input-area/useComposerSlashMenu.ts +0 -1
- package/src/composer/input-area/useInputAreaPrediction.ts +0 -1
- package/src/composer/prediction.ts +0 -6
- package/src/composer/useComposerPrediction.ts +0 -2
- package/src/generative-ui/GenerativeUiPanel.tsx +0 -11
- package/src/generative-ui/content.tsx +0 -2
- package/src/generative-ui/index.ts +0 -3
- package/src/generative-ui/layout.tsx +0 -5
- package/src/hooks/use-count-up-display.ts +0 -1
- package/src/hooks/use-idle-callback.ts +0 -5
- package/src/hooks/use-persisted-scroll-parent.ts +0 -4
- package/src/hooks/use-single-flight.ts +0 -5
- package/src/icons/animated/animated-bell-icon.tsx +0 -6
- package/src/icons/animated/animated-counter.tsx +0 -5
- package/src/icons/animated/animated-key-icon.tsx +0 -4
- package/src/icons/animated/animated-notification-icon.tsx +0 -14
- package/src/icons/animated/animated-progress.tsx +0 -10
- package/src/icons/animated/animated-status-dot.tsx +0 -4
- package/src/icons/animated/index.ts +0 -4
- package/src/icons/animated/morphing-menu-icon.tsx +0 -5
- package/src/icons/animated/morphing-mic-icon.tsx +0 -2
- package/src/icons/animated/pulsing-rings.tsx +0 -4
- package/src/icons/automation-icon.tsx +0 -1
- package/src/icons/board-icon.tsx +13 -10
- package/src/icons/bolt-icon.tsx +5 -4
- package/src/icons/building-icon.tsx +11 -9
- package/src/icons/draft-icon.tsx +0 -1
- package/src/icons/files-icon.tsx +9 -5
- package/src/icons/inbox-arrow-icon.tsx +0 -1
- package/src/icons/inbox-icon.tsx +9 -5
- package/src/icons/index.ts +12 -1
- package/src/icons/memory-icon.tsx +9 -11
- package/src/icons/nav-icon-base.tsx +0 -10
- package/src/icons/search-icon.tsx +7 -6
- package/src/icons/settings-icon.tsx +11 -13
- package/src/icons/sidebar-toggle-icon.tsx +0 -1
- package/src/icons/solid-icons.tsx +138 -0
- package/src/icons/with-active.tsx +14 -0
- package/src/index.ts +0 -30
- package/src/kibo/gantt-features.tsx +0 -16
- package/src/kibo/gantt-header.tsx +0 -4
- package/src/kibo/gantt-provider.tsx +0 -36
- package/src/kibo/gantt-sidebar.tsx +0 -7
- package/src/kibo/gantt-timeline.tsx +0 -4
- package/src/kibo/kanban.tsx +0 -49
- package/src/kibo/list.tsx +0 -8
- package/src/kibo/theme-switcher.tsx +0 -5
- package/src/kibo/video-player.tsx +0 -9
- package/src/logos/index.ts +0 -3
- package/src/logos/logo-svg.tsx +0 -5
- package/src/markdown/Markdown.tsx +0 -20
- package/src/markdown/MarkdownCodeBlock.tsx +0 -14
- package/src/markdown/MarkdownInlineCode.tsx +0 -6
- package/src/markdown/MarkdownLink.tsx +0 -4
- package/src/markdown/codeFence.ts +0 -3
- package/src/markdown/codeHighlight.ts +0 -16
- package/src/markdown/incrementalBlocks.ts +0 -49
- package/src/markdown/markdownClipboard.ts +0 -12
- package/src/markdown/mermaid.ts +0 -22
- package/src/markdown/rehypeGithubAlerts.ts +0 -3
- package/src/markdown/useSmoothText.ts +0 -5
- package/src/marketing/FloatingBar.tsx +0 -3
- package/src/marketing/PricingModal.tsx +0 -45
- package/src/marketing/ProductHero.tsx +0 -23
- package/src/marketing/ProductHeroOrbit.tsx +0 -5
- package/src/marketing/SiteFooter.tsx +0 -23
- package/src/marketing/SiteHeader.tsx +0 -14
- package/src/marketing/VProPricingModal.tsx +0 -5
- package/src/marketing/createLandingKit.tsx +0 -12
- package/src/marketing/landing.tsx +0 -12
- package/src/marketing/marketing-classes.ts +0 -7
- package/src/motion/dock-motion.ts +0 -25
- package/src/motion/list-enter.tsx +0 -4
- package/src/motion/panel-transition.tsx +0 -5
- package/src/ui/_field-classes.ts +0 -2
- package/src/ui/_menu-classes.ts +0 -4
- package/src/ui/_menu-parts.tsx +0 -5
- package/src/ui/_picker-classes.ts +0 -6
- package/src/ui/accordion.alt.tsx +0 -8
- package/src/ui/accordion.tsx +0 -4
- package/src/ui/badge.tsx +0 -1
- package/src/ui/border-beam.tsx +0 -11
- package/src/ui/breadcrumb.tsx +0 -13
- package/src/ui/bulk-action-bar.tsx +0 -24
- package/src/ui/button.tsx +0 -27
- package/src/ui/calendar.tsx +0 -18
- package/src/ui/card.tsx +0 -3
- package/src/ui/carousel.tsx +0 -4
- package/src/ui/checkbox.tsx +0 -1
- package/src/ui/clear-input.alt.tsx +0 -8
- package/src/ui/clear-input.tsx +0 -16
- package/src/ui/clearInputDissolve.ts +0 -4
- package/src/ui/command.tsx +0 -22
- package/src/ui/confetti-burst.tsx +0 -4
- package/src/ui/confirm-dialog-parts.tsx +0 -45
- package/src/ui/confirm-dialog.tsx +0 -26
- package/src/ui/context-menu.tsx +0 -10
- package/src/ui/count-pop.tsx +0 -2
- package/src/ui/crossfade-icon.tsx +0 -3
- package/src/ui/date-picker.tsx +0 -40
- package/src/ui/dialog.tsx +0 -18
- package/src/ui/dropdown-menu.tsx +0 -11
- package/src/ui/empty-state.tsx +0 -15
- package/src/ui/error-boundary.tsx +0 -7
- package/src/ui/field.tsx +0 -18
- package/src/ui/hover-card.tsx +0 -6
- package/src/ui/image-lightbox.tsx +0 -7
- package/src/ui/input-group.alt.tsx +0 -16
- package/src/ui/input-group.tsx +0 -3
- package/src/ui/kbd.tsx +0 -3
- package/src/ui/label.tsx +0 -1
- package/src/ui/labeled-slider-row.tsx +0 -2
- package/src/ui/list-row.tsx +0 -46
- package/src/ui/loading-state.tsx +0 -23
- package/src/ui/marquee-on-hover.tsx +1 -6
- package/src/ui/media-preview.tsx +0 -5
- package/src/ui/modalTransition.ts +0 -25
- package/src/ui/overlay-a11y.ts +0 -1
- package/src/ui/page-title.tsx +0 -4
- package/src/ui/popover.tsx +0 -8
- package/src/ui/progress.tsx +0 -1
- package/src/ui/refresh-spin-icon.tsx +0 -11
- package/src/ui/relative-date-time.tsx +0 -3
- package/src/ui/rolling-number.tsx +0 -2
- package/src/ui/search-input.tsx +0 -9
- package/src/ui/select-field.tsx +0 -5
- package/src/ui/select.tsx +0 -8
- package/src/ui/send-queue-icon.tsx +0 -3
- package/src/ui/separator.tsx +0 -1
- package/src/ui/sheet.tsx +0 -42
- package/src/ui/slide-over-panel.tsx +0 -2
- package/src/ui/slider.tsx +21 -9
- package/src/ui/sonner-icons.tsx +0 -4
- package/src/ui/sonner.tsx +0 -78
- package/src/ui/spinner.tsx +0 -50
- package/src/ui/status-dot.tsx +0 -10
- package/src/ui/surface.tsx +0 -13
- package/src/ui/switch.tsx +72 -3
- package/src/ui/table.tsx +0 -3
- package/src/ui/tabs-transition.tsx +0 -12
- package/src/ui/tabs.tsx +0 -17
- package/src/ui/tabsSliding.ts +0 -5
- package/src/ui/time-picker.tsx +0 -17
- package/src/ui/toggle-search.tsx +0 -6
- package/src/ui/toolbar-search-input.tsx +0 -3
- package/src/ui/tooltip.tsx +0 -5
- package/src/ui/ui-config.tsx +0 -19
- package/src/utils/cat-color.ts +0 -20
- package/src/utils/cn.ts +0 -4
- package/src/utils/gesture.ts +0 -8
- package/src/utils/ref.ts +0 -1
- package/src/utils/runtimeVisibility.ts +0 -19
- package/src/utils/surface-radius.ts +0 -11
- package/src/utils/useDragSensors.ts +0 -2
- package/tokens/examples/compat-shadcn-rgb/vite.config.ts +0 -2
- package/tokens/examples/toaster/Fixture.tsx +0 -4
- package/tokens/examples/toaster/UpdateToastFixture.tsx +0 -4
- package/tokens/examples/toaster/vite.config.ts +0 -2
- package/tokens/examples/tokens-moved/Fixture.tsx +0 -4
- package/tokens/examples/tokens-moved/vite.config.ts +0 -2
- package/tokens/src/tailwind-preset.mjs +0 -3
package/shell/src/AppShell.tsx
CHANGED
|
@@ -9,40 +9,18 @@ import {
|
|
|
9
9
|
import { AppShellPanelDockContext, AppShellVariantContext, useAppShellVariant, type AppShellVariantProps } from "./shell-variant";
|
|
10
10
|
|
|
11
11
|
type AppShellBaseProps = {
|
|
12
|
-
/** Rendered between the skip link and `<main>`, usually an `AppSidebar`. */
|
|
13
12
|
sidebar?: ReactNode;
|
|
14
13
|
children?: ReactNode;
|
|
15
|
-
/**
|
|
16
|
-
* `true` when only the rail shows on desktop (sidebar collapsed, or the
|
|
17
|
-
* current section has no panel). Main then offsets by the rail width
|
|
18
|
-
* instead of the sidebar width.
|
|
19
|
-
*/
|
|
20
14
|
panelHidden?: boolean;
|
|
21
|
-
/** Sets `--app-shell-rail-width`. Default `"3.5rem"`. */
|
|
22
15
|
railWidth?: string;
|
|
23
|
-
/** Sets `--app-shell-sidebar-width` (rail plus panel). Default `"19.5rem"`. Ignored with `resizable`. */
|
|
24
16
|
sidebarWidth?: string;
|
|
25
|
-
/**
|
|
26
|
-
* Opt-in resizable panel. The shell owns the persisted panel width, sets
|
|
27
|
-
* `--app-shell-sidebar-width` to `calc(<railWidth> + <width>px)` and shares
|
|
28
|
-
* the state with `AppSidebar`, `SidebarResizeHandle` and `useAppShellResize`.
|
|
29
|
-
*/
|
|
30
17
|
resizable?: SidebarResizeOptions;
|
|
31
|
-
/**
|
|
32
|
-
* `"contained"` (default): the shell is one screen high and the content card
|
|
33
|
-
* scrolls. `"document"`: the page scrolls. The frame grows with the content,
|
|
34
|
-
* and there is no card, gutter or margin animation.
|
|
35
|
-
*/
|
|
36
18
|
scroll?: AppShellScroll;
|
|
37
|
-
/** Sets `--app-shell-mobile-header-height`. Default `"calc(3.5rem + env(safe-area-inset-top, 0px))"`. */
|
|
38
19
|
mobileHeaderHeight?: string;
|
|
39
|
-
/** Default `"Skip to main content"`. */
|
|
40
20
|
skipLinkLabel?: string;
|
|
41
|
-
/** `id` of `<main>` and the skip link target. Default `"main-content"`. */
|
|
42
21
|
mainId?: string;
|
|
43
22
|
className?: string;
|
|
44
23
|
mainClassName?: string;
|
|
45
|
-
/** Merged onto the content card inside `<main>`. */
|
|
46
24
|
contentClassName?: string;
|
|
47
25
|
};
|
|
48
26
|
|
|
@@ -69,7 +47,6 @@ export type AppShellRootProps = ComponentProps<"div"> &
|
|
|
69
47
|
Pick<AppShellBaseProps, "panelHidden" | "railWidth" | "sidebarWidth" | "resizable" | "scroll" | "mobileHeaderHeight" | "mainId"> &
|
|
70
48
|
AppShellVariantProps;
|
|
71
49
|
|
|
72
|
-
/** Frame `<div>`: sets the `--app-shell-*` variables and owns the resize state. `style` merges over the variables. */
|
|
73
50
|
function Root({
|
|
74
51
|
panelHidden = false,
|
|
75
52
|
railWidth = "3.5rem",
|
|
@@ -114,13 +91,10 @@ function Root({
|
|
|
114
91
|
}
|
|
115
92
|
|
|
116
93
|
export type AppShellSkipLinkProps = Omit<ComponentProps<"a">, "children" | "href"> & {
|
|
117
|
-
/** Default `"Skip to main content"`. */
|
|
118
94
|
label?: ReactNode;
|
|
119
|
-
/** Default the Root `mainId`. */
|
|
120
95
|
targetId?: string;
|
|
121
96
|
};
|
|
122
97
|
|
|
123
|
-
/** Visually hidden link to `<main>`, shown on focus. */
|
|
124
98
|
function SkipLink({ label = "Skip to main content", targetId, className, ...props }: AppShellSkipLinkProps) {
|
|
125
99
|
const { mainId } = useContext(AppShellContext);
|
|
126
100
|
return (
|
|
@@ -139,7 +113,6 @@ function SkipLink({ label = "Skip to main content", targetId, className, ...prop
|
|
|
139
113
|
|
|
140
114
|
export type AppShellMainProps = ComponentProps<"main">;
|
|
141
115
|
|
|
142
|
-
/** `<main>`, offset by the sidebar (or rail while the Root `panelHidden`). `id` defaults to the Root `mainId`. */
|
|
143
116
|
function Main({ id, className, ...props }: AppShellMainProps) {
|
|
144
117
|
const { mainId, panelHidden, scroll } = useContext(AppShellContext);
|
|
145
118
|
const pageScrolls = scroll === "document";
|
|
@@ -166,11 +139,6 @@ function Main({ id, className, ...props }: AppShellMainProps) {
|
|
|
166
139
|
|
|
167
140
|
export type AppShellContentProps = ComponentProps<"div">;
|
|
168
141
|
|
|
169
|
-
/**
|
|
170
|
-
* Content card inside `<main>`. A plain column, with no card, while the Root
|
|
171
|
-
* `scroll` is `"document"` or its `variant` is `"rail"`. Pads for the mobile
|
|
172
|
-
* header below `md`.
|
|
173
|
-
*/
|
|
174
142
|
function Content({ className, ...props }: AppShellContentProps) {
|
|
175
143
|
const { scroll } = useContext(AppShellContext);
|
|
176
144
|
const rail = useAppShellVariant() === "rail";
|
|
@@ -189,11 +157,6 @@ function Content({ className, ...props }: AppShellContentProps) {
|
|
|
189
157
|
);
|
|
190
158
|
}
|
|
191
159
|
|
|
192
|
-
/**
|
|
193
|
-
* Legacy (still supported): full-height app frame with a skip link, a sidebar
|
|
194
|
-
* slot and the main content card. Composed from `AppShell.Root`, `.SkipLink`,
|
|
195
|
-
* `.Main` and `.Content`.
|
|
196
|
-
*/
|
|
197
160
|
function LegacyAppShell({
|
|
198
161
|
sidebar,
|
|
199
162
|
children,
|
package/shell/src/AppSidebar.tsx
CHANGED
|
@@ -2,34 +2,20 @@ import type { ReactNode } from "react";
|
|
|
2
2
|
import { SidebarChromeParts as Parts } from "./SidebarChrome";
|
|
3
3
|
|
|
4
4
|
export type AppSidebarProps = {
|
|
5
|
-
/** Icon rail, usually a `SidebarRail`. */
|
|
6
5
|
rail: ReactNode;
|
|
7
|
-
/** Panel beside the rail, usually a `SidebarPanel`. Not rendered while `panelHidden`. */
|
|
8
6
|
panel?: ReactNode;
|
|
9
|
-
/** Desktop: show only the rail. The panel stays mounted (hide it with `SidebarPanel collapsed`). */
|
|
10
7
|
collapsed?: boolean;
|
|
11
|
-
/** The current section has no panel: the sidebar is rail-wide on every viewport. */
|
|
12
8
|
panelHidden?: boolean;
|
|
13
|
-
/** From the app's desktop media query (for example `(min-width: 768px)`). */
|
|
14
9
|
isDesktop: boolean;
|
|
15
|
-
/** Mobile drawer state. Owned by the app (which also closes it on route change). */
|
|
16
10
|
mobileOpen: boolean;
|
|
17
11
|
onMobileOpenChange: (open: boolean) => void;
|
|
18
|
-
/** `id` of the drawer, used by the menu button `aria-controls`. Default from `useId`. */
|
|
19
12
|
id?: string;
|
|
20
|
-
/** Extra `data-*` attributes for the `<aside>`, for example a view-transition target. */
|
|
21
13
|
asideProps?: Record<`data-${string}`, string | undefined>;
|
|
22
|
-
/** Merged onto the `<aside>`. */
|
|
23
14
|
className?: string;
|
|
24
|
-
/** Centred in the mobile header when truthy. */
|
|
25
15
|
mobileTitle?: ReactNode;
|
|
26
|
-
/** Trailing actions in the mobile header, for example icon buttons. Replaces the end spacer. */
|
|
27
16
|
mobileHeaderActions?: ReactNode;
|
|
28
|
-
/** Menu button icon. Default a 20px menu icon. */
|
|
29
17
|
mobileMenuIcon?: (open: boolean) => ReactNode;
|
|
30
|
-
/** Default `"Open navigation menu"`. */
|
|
31
18
|
mobileMenuLabel?: string;
|
|
32
|
-
/** Backdrop label. Default `"Close navigation"`. */
|
|
33
19
|
closeLabel?: string;
|
|
34
20
|
};
|
|
35
21
|
|
|
@@ -10,7 +10,6 @@ export const buttonTrackClass =
|
|
|
10
10
|
"flex shrink-0 items-center gap-0.5 rounded-xl bg-default p-0.5 empty:hidden dark:bg-surface [&_button]:bg-transparent [&_button:not([data-active]):not(:disabled):hover]:bg-segment/50";
|
|
11
11
|
|
|
12
12
|
export type ButtonTrackProps = ComponentPropsWithoutRef<"div"> & {
|
|
13
|
-
/** `"column"` stacks the buttons from `md` up (a side rail). Default `"row"`. */
|
|
14
13
|
direction?: "row" | "column";
|
|
15
14
|
};
|
|
16
15
|
|
|
@@ -13,15 +13,12 @@ const slotTransition = {
|
|
|
13
13
|
} as const;
|
|
14
14
|
|
|
15
15
|
type SlotProps = {
|
|
16
|
-
/** When `false` the slot renders as a plain element. */
|
|
17
16
|
enabled: boolean;
|
|
18
|
-
/** Seconds before the slot enters. */
|
|
19
17
|
delay?: number;
|
|
20
18
|
className?: string;
|
|
21
19
|
children: ReactNode;
|
|
22
20
|
};
|
|
23
21
|
|
|
24
|
-
/** A header slot that fades and lifts in. Needs an ancestor `LazyMotion`. */
|
|
25
22
|
function Slot({ enabled, delay = 0, className, children }: SlotProps) {
|
|
26
23
|
if (!enabled) return <div className={className}>{children}</div>;
|
|
27
24
|
return (
|
|
@@ -36,7 +33,6 @@ function Slot({ enabled, delay = 0, className, children }: SlotProps) {
|
|
|
36
33
|
);
|
|
37
34
|
}
|
|
38
35
|
|
|
39
|
-
/** The `h1` counterpart of `Slot`. */
|
|
40
36
|
function TitleSlot({ enabled, className, children }: SlotProps) {
|
|
41
37
|
if (!enabled) return <h1 className={className}>{children}</h1>;
|
|
42
38
|
return (
|
|
@@ -53,82 +49,27 @@ function TitleSlot({ enabled, className, children }: SlotProps) {
|
|
|
53
49
|
|
|
54
50
|
export type PageHeaderBarProps = {
|
|
55
51
|
title?: ReactNode;
|
|
56
|
-
/**
|
|
57
|
-
* Sits beside the title (inline layout only), before `headerRight` — for
|
|
58
|
-
* navigation that belongs with "where am I" rather than the action cluster.
|
|
59
|
-
* Centred over the title row at `sm`+; below that it takes its own row.
|
|
60
|
-
*/
|
|
61
52
|
titleAfter?: ReactNode;
|
|
62
|
-
/**
|
|
63
|
-
* Sits in the title row right after the title (or back button), without
|
|
64
|
-
* shrinking. Unlike `titleAfter` it is never centred over the row. Works in
|
|
65
|
-
* both layouts: in `"stacked"` the title and `leftSection` share one row above
|
|
66
|
-
* `description`.
|
|
67
|
-
*/
|
|
68
53
|
leftSection?: ReactNode;
|
|
69
|
-
/** Centred middle slot, shown with `headerColumns="three-at-md"`. */
|
|
70
54
|
headerCenter?: ReactNode;
|
|
71
|
-
/** Right-aligned action cluster. */
|
|
72
55
|
headerRight?: ReactNode;
|
|
73
|
-
/** Secondary refine row under the title (filters, search, segmented controls). */
|
|
74
56
|
toolbar?: ReactNode;
|
|
75
|
-
/** Route / view tabs under the title (and under the toolbar when both exist). */
|
|
76
57
|
tabs?: ReactNode;
|
|
77
|
-
/** Sub-text under the title (stacked layout only). */
|
|
78
58
|
description?: ReactNode;
|
|
79
|
-
/** Indent the title row by the card gutter (`px-4`). */
|
|
80
59
|
insetHeader?: boolean;
|
|
81
|
-
/** Centre the content in a `max-w-5xl` column with roomier padding. */
|
|
82
60
|
comfortable?: boolean;
|
|
83
|
-
/**
|
|
84
|
-
* Centre the header and toolbar in a `max-w-5xl` column. Unlike
|
|
85
|
-
* `comfortable` it keeps the default `p-3 sm:px-4` padding.
|
|
86
|
-
*/
|
|
87
61
|
contentMaxWidth?: boolean;
|
|
88
|
-
/**
|
|
89
|
-
* Title size. `"auto"` (default): the page title standard when stacked,
|
|
90
|
-
* responsive sizes when inline. `"page"`: the page title standard in either
|
|
91
|
-
* layout, with a string title shown from `md` up.
|
|
92
|
-
*/
|
|
93
62
|
titleScale?: "auto" | "page";
|
|
94
|
-
/** Back button at the start of the title row (inline layout only). */
|
|
95
63
|
showBack?: boolean;
|
|
96
64
|
onBack?: () => void;
|
|
97
|
-
/** Entry + `motion-base` animations. Opt-in so the package needs no animation plugin. */
|
|
98
65
|
animated?: boolean;
|
|
99
|
-
/**
|
|
100
|
-
* Fade and lift the title block, `leftSection`, `headerCenter` (delay 0.06 s)
|
|
101
|
-
* and `headerRight` (delay 0.1 s) in with `motion/react`. Default `false`.
|
|
102
|
-
* Needs the app's `MotionProvider`, which sets reduced motion. Replaces the
|
|
103
|
-
* CSS `animated` entry on those slots. The toolbar and tabs stay still.
|
|
104
|
-
*/
|
|
105
66
|
headerMotion?: boolean;
|
|
106
|
-
/**
|
|
107
|
-
* Give the title row grid a `min-h-10` (40 px), so the title, back button and
|
|
108
|
-
* actions centre in a row that is at least as tall as a `h-10` control, even
|
|
109
|
-
* when the row holds only a title. Default `false`.
|
|
110
|
-
*/
|
|
111
67
|
titleRowMinHeight?: boolean;
|
|
112
|
-
/**
|
|
113
|
-
* `"stacked"` (default): fixed `text-xl` title over an optional `description`;
|
|
114
|
-
* a string title is hidden below `md`. `"inline"`: responsive title in a row
|
|
115
|
-
* with `showBack` / `titleAfter`; a string title is hidden below `lg`.
|
|
116
|
-
*/
|
|
117
68
|
titleLayout?: "stacked" | "inline";
|
|
118
|
-
/** `"three-at-md"` reserves a centred middle column at `md` for `headerCenter`. */
|
|
119
69
|
headerColumns?: "two" | "three-at-md";
|
|
120
|
-
/**
|
|
121
|
-
* Portal `headerRight` into a mobile top bar for string titles. When set and
|
|
122
|
-
* the title is a string and `isDesktop` is `false`, `headerRight` is rendered
|
|
123
|
-
* through this instead of in the row, and a header that would otherwise be
|
|
124
|
-
* only a string title hides below `md`. Pair with `isDesktop`.
|
|
125
|
-
*/
|
|
126
70
|
renderMobileActions?: (node: ReactNode) => ReactNode;
|
|
127
|
-
/** Supply `useIsDesktop()`; pairs with `renderMobileActions`. */
|
|
128
71
|
isDesktop?: boolean;
|
|
129
|
-
/** Render nothing. For a page with no title, actions, toolbar or tabs. */
|
|
130
72
|
hideHeader?: boolean;
|
|
131
|
-
/** Hide the whole header block below `md` (it shows from `md` up). */
|
|
132
73
|
hideHeaderOnMobile?: boolean;
|
|
133
74
|
};
|
|
134
75
|
|
|
@@ -172,8 +113,6 @@ export function PageHeaderBar({
|
|
|
172
113
|
const responsiveTitle = inline && titleScale === "auto";
|
|
173
114
|
const threeCol = headerColumns === "three-at-md";
|
|
174
115
|
|
|
175
|
-
// Below `sm` the title row cannot hold a second control, so `titleAfter`
|
|
176
|
-
// drops to its own row.
|
|
177
116
|
const isPhone = useMediaQuery("(max-width: 639px)");
|
|
178
117
|
const titleAfterInline = titleAfter != null && !isPhone;
|
|
179
118
|
const titleAfterOwnRow = titleAfter != null && isPhone;
|
|
@@ -10,38 +10,12 @@ import {
|
|
|
10
10
|
|
|
11
11
|
export type PageWrapperProps = PageHeaderBarProps & {
|
|
12
12
|
children: ReactNode;
|
|
13
|
-
/**
|
|
14
|
-
* Hand the page body the full remaining height instead of letting it scroll.
|
|
15
|
-
* The body becomes a flex column that owns its own overflow (lists, split
|
|
16
|
-
* panes, editors). Default `false`: the body scrolls.
|
|
17
|
-
*/
|
|
18
13
|
fillHeight?: boolean;
|
|
19
|
-
/** Pad the body with the page gutter. Default `true`. */
|
|
20
14
|
childPadding?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Add the themed scrollbar chrome to the scrolling body (non-`fillHeight`).
|
|
23
|
-
* `true`: `scrollbar`. `"thin"`: `scrollbar-thin`.
|
|
24
|
-
*/
|
|
25
15
|
bodyScrollbar?: boolean | "thin";
|
|
26
|
-
/**
|
|
27
|
-
* `"owned"` (default): a full-height shell; the body scrolls or fills.
|
|
28
|
-
* `"unbounded"`: no height ownership. The page is the header over the padded
|
|
29
|
-
* children and the parent scrolls. `fillHeight`, `scrollRef`, `bodyMotion`
|
|
30
|
-
* and `bodyScrollbar` have no effect.
|
|
31
|
-
*/
|
|
32
16
|
scrollMode?: "owned" | "unbounded";
|
|
33
|
-
/** Ref callback for the scrolling body (virtualised lists). `"owned"` only. */
|
|
34
17
|
scrollRef?: (el: HTMLDivElement | null) => void;
|
|
35
|
-
/**
|
|
36
|
-
* Fade and lift the body in with `motion/react` (`motionDuration.base`,
|
|
37
|
-
* delayed 0.12 s). Default `false`. Separate from the CSS `animated` prop.
|
|
38
|
-
*/
|
|
39
18
|
bodyMotion?: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* Classes for the padded content box. Merged after the defaults, so a class
|
|
42
|
-
* such as `gap-8` replaces `gap-4`. Pair `childPadding={false}` with your own
|
|
43
|
-
* padding classes here.
|
|
44
|
-
*/
|
|
45
19
|
bodyClassName?: string;
|
|
46
20
|
};
|
|
47
21
|
|
package/shell/src/PillTabs.tsx
CHANGED
|
@@ -20,7 +20,6 @@ const tabIdle = "text-muted-foreground hover:bg-default/50 hover:text-foreground
|
|
|
20
20
|
const tabSelected = "bg-default text-foreground";
|
|
21
21
|
|
|
22
22
|
export function PillTabs({ tabs, value, onValueChange, className }: PillTabsProps) {
|
|
23
|
-
// Arrow keys, Home and End move focus and selection (WAI-ARIA tabs pattern).
|
|
24
23
|
function onKeyDown(event: KeyboardEvent<HTMLDivElement>) {
|
|
25
24
|
const count = tabs.length;
|
|
26
25
|
if (count === 0) return;
|
|
@@ -9,10 +9,6 @@ export type SessionsHoverCardContext = { open: boolean };
|
|
|
9
9
|
|
|
10
10
|
export type SessionsHoverCardSurface = "overlay" | "surface" | "glass";
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* Surface classes. Only `overlay` carries the shared floating surface, so the
|
|
14
|
-
* others need no `!` overrides, and `className` merges over all of them.
|
|
15
|
-
*/
|
|
16
12
|
const surfaceClasses: Record<SessionsHoverCardSurface, string> = {
|
|
17
13
|
overlay: floatingSurfaceClass,
|
|
18
14
|
surface: "rounded-surface bg-overlay text-overlay-foreground smooth-shadow-ring-lg",
|
|
@@ -23,54 +19,26 @@ export type SessionsHoverCardProps = Omit<
|
|
|
23
19
|
ComponentPropsWithoutRef<typeof HoverCardTrigger>,
|
|
24
20
|
"className" | "children"
|
|
25
21
|
> & {
|
|
26
|
-
/**
|
|
27
|
-
* The trigger. With `asChild` (default) it is the element that triggers the
|
|
28
|
-
* card, such as a list row. Trigger props and the ref go to that element,
|
|
29
|
-
* which keeps its own handlers. With `asChild={false}` the children render
|
|
30
|
-
* inside a default trigger element.
|
|
31
|
-
*/
|
|
32
22
|
children: ReactNode;
|
|
33
|
-
/** Default `true`. */
|
|
34
23
|
asChild?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Render the content in a portal on `document.body`, so `overflow:hidden`
|
|
37
|
-
* ancestors do not clip it. Default `true`. Use `false` to keep the content
|
|
38
|
-
* in place in the DOM.
|
|
39
|
-
*/
|
|
40
24
|
portal?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* `"overlay"` (default): floating overlay, `rounded-lg`. `"surface"`: same
|
|
43
|
-
* fill with `rounded-surface`. `"glass"`: `glass-panel-strong` with
|
|
44
|
-
* `rounded-surface`.
|
|
45
|
-
*/
|
|
46
25
|
surface?: SessionsHoverCardSurface;
|
|
47
26
|
header?: ReactNode;
|
|
48
|
-
/**
|
|
49
|
-
* Body slot. A function runs only while the card is open, so it can start
|
|
50
|
-
* fetches for preview data.
|
|
51
|
-
*/
|
|
52
27
|
body?: ReactNode | ((ctx: SessionsHoverCardContext) => ReactNode);
|
|
53
|
-
/** Runs each time the card opens. Its result replaces `body`. */
|
|
54
28
|
loadContent?: () => Promise<ReactNode> | ReactNode;
|
|
55
|
-
/** Shown while `loadContent` is pending. */
|
|
56
29
|
loadingFallback?: ReactNode;
|
|
57
30
|
footer?: ReactNode;
|
|
58
|
-
/** Controlled open state. */
|
|
59
31
|
open?: boolean;
|
|
60
32
|
defaultOpen?: boolean;
|
|
61
33
|
onOpenChange?: (open: boolean) => void;
|
|
62
|
-
/** Delay before opening, in milliseconds. */
|
|
63
34
|
openDelay?: number;
|
|
64
|
-
/** Delay before closing, in milliseconds. */
|
|
65
35
|
closeDelay?: number;
|
|
66
36
|
side?: "top" | "right" | "bottom" | "left";
|
|
67
37
|
align?: "start" | "center" | "end";
|
|
68
38
|
sideOffset?: number;
|
|
69
|
-
/** Merged over the default `w-64 p-3` and the surface classes. */
|
|
70
39
|
className?: string;
|
|
71
40
|
};
|
|
72
41
|
|
|
73
|
-
/** `:focus-visible` is true for keyboard focus only. Treat unsupported engines as keyboard. */
|
|
74
42
|
function isFocusVisible(el: Element): boolean {
|
|
75
43
|
try {
|
|
76
44
|
return el.matches(":focus-visible");
|
|
@@ -81,7 +49,6 @@ function isFocusVisible(el: Element): boolean {
|
|
|
81
49
|
|
|
82
50
|
type LoadState = { status: "loading" } | { status: "ready"; node: ReactNode };
|
|
83
51
|
|
|
84
|
-
/** Mounts only while the card is open, so `loadContent` never runs while closed. */
|
|
85
52
|
function LoadedBody({
|
|
86
53
|
loadContent,
|
|
87
54
|
fallback,
|
|
@@ -104,14 +71,12 @@ function LoadedBody({
|
|
|
104
71
|
return () => {
|
|
105
72
|
cancelled = true;
|
|
106
73
|
};
|
|
107
|
-
// Run once per open. A new `loadContent` identity must not refetch.
|
|
108
74
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
109
75
|
}, []);
|
|
110
76
|
|
|
111
77
|
return <>{state.status === "ready" ? state.node : fallback}</>;
|
|
112
78
|
}
|
|
113
79
|
|
|
114
|
-
/** Calls the render prop. Mounts only inside open content, never while closed. */
|
|
115
80
|
function RenderBody({
|
|
116
81
|
render,
|
|
117
82
|
open,
|
|
@@ -161,17 +126,12 @@ export const SessionsHoverCard = forwardRef<
|
|
|
161
126
|
onOpenChange?.(next);
|
|
162
127
|
};
|
|
163
128
|
|
|
164
|
-
// Open on keyboard focus only. Focus that returns after a context menu or a
|
|
165
|
-
// click is pointer-driven, so it must not open the card.
|
|
166
129
|
const handleFocus = (event: React.FocusEvent<HTMLElement>) => {
|
|
167
130
|
onFocus?.(event as never);
|
|
168
131
|
if (event.defaultPrevented) return;
|
|
169
132
|
if (!isFocusVisible(event.currentTarget)) event.preventDefault();
|
|
170
133
|
};
|
|
171
134
|
|
|
172
|
-
// Radix handles hover close, including closeDelay and moving onto the
|
|
173
|
-
// content. Force-close only when the card is stuck open by pointer-driven
|
|
174
|
-
// focus on the trigger (focused, but not `:focus-visible`).
|
|
175
135
|
const handlePointerLeave = (event: React.PointerEvent<HTMLElement>) => {
|
|
176
136
|
onPointerLeave?.(event as never);
|
|
177
137
|
if (event.pointerType === "touch" || !open) return;
|
|
@@ -17,11 +17,8 @@ export const SIDE_PANEL_RAIL_WIDTH_PX = 44;
|
|
|
17
17
|
/** Width of the rail with a label under each icon (`labelled`). */
|
|
18
18
|
export const SIDE_PANEL_RAIL_LABELLED_WIDTH_PX = 76;
|
|
19
19
|
|
|
20
|
-
/** Half the arrow's side (`size-4`), so its centre lands on the tab centre. */
|
|
21
20
|
const ARROW_HALF_PX = 8;
|
|
22
21
|
|
|
23
|
-
/* Relative to the frame, and scoped to its rail: content inside the card can
|
|
24
|
-
have tab lists of its own. */
|
|
25
22
|
const RAIL_TABLIST_SELECTOR = ':scope > [data-side-panel-rail] [role="tablist"]';
|
|
26
23
|
const ACTIVE_TAB_SELECTOR = `${RAIL_TABLIST_SELECTOR} [role="tab"][data-state="active"]`;
|
|
27
24
|
const CARD_SELECTOR = "[data-side-panel-card]";
|
|
@@ -45,14 +42,6 @@ export function popOutSidePanel(root: HTMLElement | null, collapse: () => void)
|
|
|
45
42
|
dockPopOut(card, card ? activeTabOf(card) : null, "right", collapse, card ? arrowOf(card) : null);
|
|
46
43
|
}
|
|
47
44
|
|
|
48
|
-
/**
|
|
49
|
-
* Keeps the card's arrow level with the active rail tab, and plays the card's
|
|
50
|
-
* dock motion: pop in when the card appears, a content slide when the active
|
|
51
|
-
* tab changes. It writes the transform straight to the node (no React state), as
|
|
52
|
-
* the tab pill does: the first placement snaps, later moves slide. The arrow
|
|
53
|
-
* hides when the active tab is scrolled out of the card's height. Measure
|
|
54
|
-
* before animating: a scaled card reports a scaled rect.
|
|
55
|
-
*/
|
|
56
45
|
function useActiveTabArrow(
|
|
57
46
|
frameRef: RefObject<HTMLDivElement | null>,
|
|
58
47
|
cardRef: RefObject<HTMLDivElement | null>,
|
|
@@ -64,7 +53,6 @@ function useActiveTabArrow(
|
|
|
64
53
|
const arrow = arrowRef.current;
|
|
65
54
|
if (!frame || !card || !arrow) return;
|
|
66
55
|
let placed = false;
|
|
67
|
-
// Start from what is on screen, so a mount does not pop.
|
|
68
56
|
let wasOpen = card.getBoundingClientRect().width > 0;
|
|
69
57
|
let lastTab = frame.querySelector(ACTIVE_TAB_SELECTOR);
|
|
70
58
|
const sync = () => {
|
|
@@ -105,14 +93,11 @@ function useActiveTabArrow(
|
|
|
105
93
|
if (typeof ResizeObserver === "undefined") return;
|
|
106
94
|
const resize = new ResizeObserver(sync);
|
|
107
95
|
resize.observe(frame);
|
|
108
|
-
// The card un-hides without the frame changing size.
|
|
109
96
|
resize.observe(card);
|
|
110
97
|
const mutation = new MutationObserver(sync);
|
|
111
98
|
mutation.observe(frame, { subtree: true, attributes: true, attributeFilter: ["data-state"] });
|
|
112
99
|
const list = frame.querySelector(RAIL_TABLIST_SELECTOR);
|
|
113
100
|
if (list) resize.observe(list);
|
|
114
|
-
// Tabs can enter with a short slide and the list re-centres as tabs come
|
|
115
|
-
// and go, so measure again once each motion settles.
|
|
116
101
|
const settle = ["scroll", "animationend", "transitionend"] as const;
|
|
117
102
|
for (const type of settle) frame.addEventListener(type, sync, true);
|
|
118
103
|
return () => {
|
|
@@ -124,28 +109,14 @@ function useActiveTabArrow(
|
|
|
124
109
|
}
|
|
125
110
|
|
|
126
111
|
export type SidePanelTabsFrameProps = {
|
|
127
|
-
/** From `md` up: hides the card and leaves the rail. */
|
|
128
112
|
collapsed?: boolean;
|
|
129
|
-
/** The tab rail: a `SidePanelTabs.Rail`. */
|
|
130
113
|
rail: ReactNode;
|
|
131
|
-
/** The content of the active tab. */
|
|
132
114
|
children?: ReactNode;
|
|
133
115
|
className?: string;
|
|
134
|
-
/** Merged onto the content card (tone, radius, margins). */
|
|
135
116
|
cardClassName?: string;
|
|
136
|
-
/** Merged onto the arrow. Give it the card's tone when `cardClassName` changes it. */
|
|
137
117
|
arrowClassName?: string;
|
|
138
118
|
};
|
|
139
119
|
|
|
140
|
-
/**
|
|
141
|
-
* A side panel with its tabs on a rail. From `md` up: the rail on the right
|
|
142
|
-
* edge, the content a rounded card beside it with an arrow that points at the
|
|
143
|
-
* active tab; `collapsed` hides the card and the rail stays. Below `md`: a
|
|
144
|
-
* column, the tab strip on top and the content edge to edge. The card pops
|
|
145
|
-
* out of the active tab when it opens; on a tab switch its content slides in
|
|
146
|
-
* from the side of the new tab; close it
|
|
147
|
-
* through `popOutSidePanel`.
|
|
148
|
-
*/
|
|
149
120
|
function Frame({ collapsed = false, rail, children, className, cardClassName, arrowClassName }: SidePanelTabsFrameProps) {
|
|
150
121
|
const frameRef = useRef<HTMLDivElement>(null);
|
|
151
122
|
const cardRef = useRef<HTMLDivElement>(null);
|
|
@@ -154,8 +125,6 @@ function Frame({ collapsed = false, rail, children, className, cardClassName, ar
|
|
|
154
125
|
return (
|
|
155
126
|
<div ref={frameRef} className={cn("relative flex h-full min-h-0 flex-col md:flex-row-reverse", className)}>
|
|
156
127
|
{rail}
|
|
157
|
-
{/* The arrow comes before the card, and the card is positioned, so the
|
|
158
|
-
card paints over the arrow's inner half: only the tip shows. */}
|
|
159
128
|
<div
|
|
160
129
|
ref={arrowRef}
|
|
161
130
|
aria-hidden
|
|
@@ -182,11 +151,9 @@ function Frame({ collapsed = false, rail, children, className, cardClassName, ar
|
|
|
182
151
|
}
|
|
183
152
|
|
|
184
153
|
export type SidePanelTabsRailProps = ComponentPropsWithoutRef<"div"> & {
|
|
185
|
-
/** The wider rail, for tabs with `layout="stacked"`. Default `false`. */
|
|
186
154
|
labelled?: boolean;
|
|
187
155
|
};
|
|
188
156
|
|
|
189
|
-
/** The rail column: holds a `SidePanelTabs.List`, and any `ButtonTrack` of tools after it. */
|
|
190
157
|
function Rail({ labelled = false, className, ...props }: SidePanelTabsRailProps) {
|
|
191
158
|
return (
|
|
192
159
|
<div
|
|
@@ -204,23 +171,13 @@ function Rail({ labelled = false, className, ...props }: SidePanelTabsRailProps)
|
|
|
204
171
|
export type SidePanelTabsListProps = {
|
|
205
172
|
value: string;
|
|
206
173
|
onValueChange: (value: string) => void;
|
|
207
|
-
/** Fills the wider rail, for tabs with `layout="stacked"`. Default `false`. */
|
|
208
174
|
labelled?: boolean;
|
|
209
|
-
/** Accessible name of the tab list. */
|
|
210
175
|
"aria-label"?: string;
|
|
211
|
-
/** Merged onto the tabs root. */
|
|
212
176
|
className?: string;
|
|
213
|
-
/** Merged onto the tab list (the trough). */
|
|
214
177
|
listClassName?: string;
|
|
215
|
-
/** `SidePanelTabs.Tab` items. */
|
|
216
178
|
children?: ReactNode;
|
|
217
179
|
};
|
|
218
180
|
|
|
219
|
-
/**
|
|
220
|
-
* The tabs of the rail on one trough with a sliding pill. Activation is
|
|
221
|
-
* manual: a tab selects on press, not on focus, so a press on the selected
|
|
222
|
-
* tab can mean something else (`onReselect`).
|
|
223
|
-
*/
|
|
224
181
|
function List({ value, onValueChange, labelled = false, className, listClassName, children, ...props }: SidePanelTabsListProps) {
|
|
225
182
|
return (
|
|
226
183
|
<Tabs
|
|
@@ -229,8 +186,6 @@ function List({ value, onValueChange, labelled = false, className, listClassName
|
|
|
229
186
|
onValueChange={onValueChange}
|
|
230
187
|
className={cn("min-w-0 flex-1 md:flex md:min-h-0 md:w-full md:flex-col md:items-center md:justify-center-safe", className)}
|
|
231
188
|
>
|
|
232
|
-
{/* Always segmented, whatever `UiConfig.Tabs` says: the rail needs the
|
|
233
|
-
sliding pill. `xy`: the rail is a row below `md`, a column above. */}
|
|
234
189
|
<TabsList
|
|
235
190
|
variant="segmented"
|
|
236
191
|
pillMotion="xy"
|
|
@@ -260,34 +215,22 @@ const TAB_LAYOUT_CLASS: Record<SidePanelTabLayout, string> = {
|
|
|
260
215
|
stacked: "md:h-auto md:w-full md:flex-col md:justify-center md:gap-0.5 md:px-1 md:py-1.5",
|
|
261
216
|
};
|
|
262
217
|
|
|
263
|
-
/* Selection is Radix's `data-state` on the trigger, so the idle and active
|
|
264
|
-
icons swap in CSS. */
|
|
265
218
|
const ICON_SLOT_CLASS = "contents [&_svg]:size-4 [&_svg]:shrink-0";
|
|
266
219
|
|
|
267
220
|
export type SidePanelTabsTabProps = {
|
|
268
221
|
value: string;
|
|
269
222
|
label: string;
|
|
270
|
-
/** The icon. Without `activeIcon` its stroke thickens while the tab is selected. */
|
|
271
223
|
icon: ReactNode;
|
|
272
|
-
/** Shown in place of `icon` while the tab is selected (a filled variant). */
|
|
273
224
|
activeIcon?: ReactNode;
|
|
274
|
-
/** Default `"icon"`. */
|
|
275
225
|
layout?: SidePanelTabLayout;
|
|
276
|
-
/** How many items the tab holds. Above 0 it shows as a badge, in place of the `indicator` dot. */
|
|
277
226
|
count?: number;
|
|
278
|
-
/** A dot on the tab. `"activity"` pulses (something is live); `"content"` is still (something waits for the reader). */
|
|
279
227
|
indicator?: "activity" | "content";
|
|
280
|
-
/** Accessible name of the count badge or the dot. */
|
|
281
228
|
indicatorLabel?: string;
|
|
282
|
-
/** A press on this tab while it is selected (for example to show or hide the card). Radix skips `onValueChange` then. */
|
|
283
229
|
onReselect?: () => void;
|
|
284
|
-
/** Second tooltip line: what a press on the selected tab does. */
|
|
285
230
|
reselectHint?: string;
|
|
286
231
|
className?: string;
|
|
287
232
|
};
|
|
288
233
|
|
|
289
|
-
/* Radix selects a tab on mouse down (or Enter / Space key down), so read the
|
|
290
|
-
state there: by `click` a newly picked tab is already active. */
|
|
291
234
|
function isReselectPress(event: MouseEvent<HTMLButtonElement> | KeyboardEvent<HTMLButtonElement>) {
|
|
292
235
|
const press =
|
|
293
236
|
"button" in event
|
|
@@ -296,7 +239,6 @@ function isReselectPress(event: MouseEvent<HTMLButtonElement> | KeyboardEvent<HT
|
|
|
296
239
|
return press && event.currentTarget.dataset.state === "active";
|
|
297
240
|
}
|
|
298
241
|
|
|
299
|
-
/** One tab of a `SidePanelTabs.List`. */
|
|
300
242
|
function Tab({
|
|
301
243
|
value,
|
|
302
244
|
label,
|
|
@@ -360,13 +302,10 @@ function Tab({
|
|
|
360
302
|
) : null}
|
|
361
303
|
</TabsTrigger>
|
|
362
304
|
);
|
|
363
|
-
// A visible label needs no tooltip that repeats it.
|
|
364
305
|
if (!labelHidden) return trigger;
|
|
365
306
|
return (
|
|
366
307
|
<Tooltip>
|
|
367
308
|
<TooltipTrigger asChild>
|
|
368
|
-
{/* The span keeps the Tooltip `data-state` off the trigger: Radix
|
|
369
|
-
Tabs uses `data-state` for active and inactive. */}
|
|
370
309
|
<span className="inline-flex">{trigger}</span>
|
|
371
310
|
</TooltipTrigger>
|
|
372
311
|
<TooltipContent side="left" className="text-xs">
|