@vvedantb/ui 0.67.0 → 0.70.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/src/ui/surface.tsx
CHANGED
|
@@ -4,27 +4,14 @@ import { cva, type VariantProps } from "class-variance-authority";
|
|
|
4
4
|
import { useCn } from "./ui-config";
|
|
5
5
|
import { SURFACE_RADIUS_CLASS } from "../utils/surface-radius";
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* A panel with the card fill and one of four paddings.
|
|
9
|
-
*
|
|
10
|
-
* `Card` splits padding across Header / Content / Footer, which is right for a
|
|
11
|
-
* titled card and wrong for a box that just needs one padding. Density is a
|
|
12
|
-
* prop rather than a `className` so the paddings stay a closed set;
|
|
13
|
-
* `className` still overrides when a layout needs it.
|
|
14
|
-
*/
|
|
15
7
|
const surfaceVariants = cva(
|
|
16
8
|
`${SURFACE_RADIUS_CLASS} bg-card text-card-foreground`,
|
|
17
9
|
{
|
|
18
10
|
variants: {
|
|
19
11
|
density: {
|
|
20
|
-
// Dense list items and inline panels.
|
|
21
12
|
tight: "p-3",
|
|
22
|
-
// The default box: settings sections, stat cards, banners.
|
|
23
13
|
default: "p-4",
|
|
24
|
-
// Standalone cards that carry a heading of their own.
|
|
25
14
|
comfortable: "p-6",
|
|
26
|
-
// The caller owns padding entirely — for surfaces with their own
|
|
27
|
-
// internal regions, such as a table that must reach the edge.
|
|
28
15
|
none: "",
|
|
29
16
|
},
|
|
30
17
|
},
|
package/src/ui/switch.tsx
CHANGED
|
@@ -8,27 +8,96 @@ export interface SwitchConfig {
|
|
|
8
8
|
classes?: { root?: string; thumb?: string };
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
const PRESSED_THUMB_PX = 34;
|
|
12
|
+
const DRAG_THRESHOLD_PX = 3;
|
|
13
|
+
|
|
11
14
|
const Switch = React.forwardRef<
|
|
12
15
|
React.ComponentRef<typeof SwitchPrimitive.Root>,
|
|
13
16
|
React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>
|
|
14
|
-
>(({ className, ...props }, ref) => {
|
|
17
|
+
>(({ className, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, onClick, ...props }, ref) => {
|
|
15
18
|
const classes = useUiConfig("Switch")?.classes;
|
|
16
19
|
const merge = useCn();
|
|
20
|
+
const [dragX, setDragX] = React.useState<number | null>(null);
|
|
21
|
+
const drag = React.useRef({ startClientX: 0, startX: 0, active: false, moved: false });
|
|
22
|
+
const swallowClick = React.useRef(false);
|
|
23
|
+
const programmatic = React.useRef(false);
|
|
24
|
+
|
|
25
|
+
const range = (el: HTMLElement) => Math.max(0, el.clientWidth - PRESSED_THUMB_PX);
|
|
26
|
+
const wantsChecked = (el: HTMLElement, x: number) => x + PRESSED_THUMB_PX / 2 > el.clientWidth / 2;
|
|
27
|
+
|
|
28
|
+
const finish = (event: React.PointerEvent<HTMLButtonElement>) => {
|
|
29
|
+
const state = drag.current;
|
|
30
|
+
if (!state.active) return;
|
|
31
|
+
state.active = false;
|
|
32
|
+
const el = event.currentTarget;
|
|
33
|
+
if (state.moved) {
|
|
34
|
+
swallowClick.current = true;
|
|
35
|
+
const x = Math.min(Math.max(state.startX + event.clientX - state.startClientX, 0), range(el));
|
|
36
|
+
if (wantsChecked(el, x) !== (el.dataset.state === "checked")) {
|
|
37
|
+
programmatic.current = true;
|
|
38
|
+
el.click();
|
|
39
|
+
programmatic.current = false;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
setDragX(null);
|
|
43
|
+
};
|
|
44
|
+
|
|
17
45
|
return (
|
|
18
46
|
<SwitchPrimitive.Root
|
|
19
47
|
className={merge(
|
|
20
48
|
classes?.root ??
|
|
21
|
-
"peer relative inline-flex h-5 w-
|
|
49
|
+
"peer group relative inline-flex h-5 w-12 shrink-0 cursor-pointer touch-pan-y select-none items-center rounded-full border border-border bg-default transition-[background-color,border-color] duration-200 ease-smooth focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=unchecked]:bg-default dark:data-[state=unchecked]:border-muted/60 dark:data-[state=unchecked]:bg-muted/40 before:absolute before:inset-[-8px] before:content-['']", // check-tokens-allow: muted
|
|
22
50
|
className,
|
|
23
51
|
)}
|
|
24
52
|
{...props}
|
|
25
53
|
ref={ref}
|
|
54
|
+
onClick={(event) => {
|
|
55
|
+
onClick?.(event);
|
|
56
|
+
if (swallowClick.current && !programmatic.current) {
|
|
57
|
+
swallowClick.current = false;
|
|
58
|
+
event.preventDefault();
|
|
59
|
+
}
|
|
60
|
+
}}
|
|
61
|
+
onPointerDown={(event) => {
|
|
62
|
+
onPointerDown?.(event);
|
|
63
|
+
if (props.disabled || event.button !== 0) return;
|
|
64
|
+
swallowClick.current = false;
|
|
65
|
+
const el = event.currentTarget;
|
|
66
|
+
drag.current = {
|
|
67
|
+
startClientX: event.clientX,
|
|
68
|
+
startX: el.dataset.state === "checked" ? range(el) : 0,
|
|
69
|
+
active: true,
|
|
70
|
+
moved: false,
|
|
71
|
+
};
|
|
72
|
+
el.setPointerCapture(event.pointerId);
|
|
73
|
+
}}
|
|
74
|
+
onPointerMove={(event) => {
|
|
75
|
+
onPointerMove?.(event);
|
|
76
|
+
const state = drag.current;
|
|
77
|
+
if (!state.active) return;
|
|
78
|
+
const dx = event.clientX - state.startClientX;
|
|
79
|
+
if (!state.moved && Math.abs(dx) < DRAG_THRESHOLD_PX) return;
|
|
80
|
+
state.moved = true;
|
|
81
|
+
setDragX(Math.min(Math.max(state.startX + dx, 0), range(event.currentTarget)));
|
|
82
|
+
}}
|
|
83
|
+
onPointerUp={(event) => {
|
|
84
|
+
onPointerUp?.(event);
|
|
85
|
+
finish(event);
|
|
86
|
+
}}
|
|
87
|
+
onPointerCancel={(event) => {
|
|
88
|
+
onPointerCancel?.(event);
|
|
89
|
+
drag.current.active = false;
|
|
90
|
+
drag.current.moved = false;
|
|
91
|
+
setDragX(null);
|
|
92
|
+
}}
|
|
26
93
|
>
|
|
27
94
|
<SwitchPrimitive.Thumb
|
|
95
|
+
data-dragging={dragX === null ? undefined : ""}
|
|
96
|
+
style={dragX === null ? undefined : ({ "--switch-x": `${dragX}px` } as React.CSSProperties)}
|
|
28
97
|
className={
|
|
29
98
|
classes?.thumb ??
|
|
30
99
|
cn(
|
|
31
|
-
"pointer-events-none block
|
|
100
|
+
"pointer-events-none block h-4 w-4 rounded-full bg-background shadow-sm ring-0 [transition-property:transform,translate,width,height,background-color,box-shadow,backdrop-filter] duration-200 ease-smooth motion-reduce:transition-none data-[state=checked]:translate-x-[30px] data-[state=checked]:bg-primary-foreground data-[state=unchecked]:translate-x-0 dark:data-[state=unchecked]:bg-foreground group-active:h-7 group-active:w-[34px] group-active:data-[state=checked]:translate-x-3 group-active:bg-background/10 group-active:backdrop-blur-[1px] group-active:backdrop-saturate-200 group-active:shadow-[inset_0_0_0_1px_rgb(255_255_255/0.55),inset_0_3px_4px_rgb(255_255_255/0.85),inset_0_-3px_4px_rgb(255_255_255/0.5),0_8px_20px_rgb(0_0_0/0.16)] group-disabled:group-active:h-4 group-disabled:group-active:w-4 group-disabled:group-active:data-[state=checked]:translate-x-[30px] data-[dragging]:translate-x-(--switch-x)! data-[dragging]:[transition-property:width,height,background-color,box-shadow,backdrop-filter]",
|
|
32
101
|
)
|
|
33
102
|
}
|
|
34
103
|
/>
|
package/src/ui/table.tsx
CHANGED
|
@@ -2,9 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { useCn, useUiConfig } from "./ui-config";
|
|
3
3
|
|
|
4
4
|
export interface TableConfig {
|
|
5
|
-
/** Replaces the built-in classes of a part. A part left out keeps its default. */
|
|
6
5
|
classes?: {
|
|
7
|
-
/** The scroll wrapper `<div>` around the `<table>`. */
|
|
8
6
|
wrapper?: string;
|
|
9
7
|
table?: string;
|
|
10
8
|
header?: string;
|
|
@@ -17,7 +15,6 @@ export interface TableConfig {
|
|
|
17
15
|
};
|
|
18
16
|
}
|
|
19
17
|
|
|
20
|
-
/** The app's class string for `part` (else `fallback`), merged with the caller `className`. */
|
|
21
18
|
function useTableClass(
|
|
22
19
|
part: keyof NonNullable<TableConfig["classes"]>,
|
|
23
20
|
fallback: string,
|
|
@@ -26,7 +26,6 @@ const variants: Record<Exclude<TabsTransitionVariant, "none">, Variants> = {
|
|
|
26
26
|
slide: {
|
|
27
27
|
enter: (dir: Direction) => ({ x: dir * SLIDE_PX, opacity: 0 }),
|
|
28
28
|
center: { x: 0, opacity: 1, transition: { duration: 0.24, ease: motionEase } },
|
|
29
|
-
// Leaves faster than it enters, so the old panel never lingers.
|
|
30
29
|
exit: (dir: Direction) => ({
|
|
31
30
|
x: -dir * SLIDE_PX,
|
|
32
31
|
opacity: 0,
|
|
@@ -44,20 +43,11 @@ const variants: Record<Exclude<TabsTransitionVariant, "none">, Variants> = {
|
|
|
44
43
|
};
|
|
45
44
|
|
|
46
45
|
export interface TabsTransitionProps {
|
|
47
|
-
/** The selected tab. A new value plays the transition. */
|
|
48
46
|
value: string;
|
|
49
|
-
/** Tab values in their on-screen order, left to right; gives the direction. */
|
|
50
47
|
order: ReadonlyArray<string>;
|
|
51
|
-
/** Defaults to the app's `UiConfig.Tabs.transition`, then `"none"`. */
|
|
52
48
|
variant?: TabsTransitionVariant;
|
|
53
49
|
className?: string;
|
|
54
|
-
/**
|
|
55
|
-
* Classes on the moving panel. Full-height layouts pass the same flex
|
|
56
|
-
* classes as their container (`flex min-h-0 flex-1 flex-col`) so the panel
|
|
57
|
-
* still fills it.
|
|
58
|
-
*/
|
|
59
50
|
panelClassName?: string;
|
|
60
|
-
/** The selected tab's content. */
|
|
61
51
|
children: ReactNode;
|
|
62
52
|
}
|
|
63
53
|
|
|
@@ -78,8 +68,6 @@ export function TabsTransition({
|
|
|
78
68
|
}: TabsTransitionProps) {
|
|
79
69
|
const configVariant = useUiConfig("Tabs")?.transition;
|
|
80
70
|
const variant = variantProp ?? configVariant ?? "none";
|
|
81
|
-
// Direction follows the move from the previous tab to this one. Derived in
|
|
82
|
-
// render (adjust-state-on-change), so the first frame already knows it.
|
|
83
71
|
const [previous, setPrevious] = useState(value);
|
|
84
72
|
const [direction, setDirection] = useState<Direction>(1);
|
|
85
73
|
if (value !== previous) {
|
package/src/ui/tabs.tsx
CHANGED
|
@@ -8,10 +8,6 @@ import { useCn, useUiConfig } from "./ui-config";
|
|
|
8
8
|
|
|
9
9
|
const Tabs = TabsPrimitive.Root;
|
|
10
10
|
|
|
11
|
-
// `pills` (default): isolated rounded pills with a gap, no shared track.
|
|
12
|
-
// `segmented`: connected bar with a sliding pill, kept for marketing surfaces.
|
|
13
|
-
// `soft`: borderless wrapping pills, the active one filled. Uses no `t-tabs`
|
|
14
|
-
// CSS, so triggers can hold an absolutely placed child (e.g. a progress bar).
|
|
15
11
|
type TabsListVariant = "pills" | "segmented" | "soft";
|
|
16
12
|
type TabsListSize = "default" | "sm";
|
|
17
13
|
|
|
@@ -25,7 +21,6 @@ type TabsListSize = "default" | "sm";
|
|
|
25
21
|
export interface TabsConfig {
|
|
26
22
|
variant?: TabsListVariant;
|
|
27
23
|
pillMotion?: TabsPillMotion;
|
|
28
|
-
/** Default `TabsTransition` variant for every tab set in the app. */
|
|
29
24
|
transition?: TabsTransitionVariant;
|
|
30
25
|
classes?: {
|
|
31
26
|
list?: string;
|
|
@@ -36,7 +31,6 @@ export interface TabsConfig {
|
|
|
36
31
|
};
|
|
37
32
|
}
|
|
38
33
|
|
|
39
|
-
// `sm` shrinks the triggers from the list, so callers do not size each one.
|
|
40
34
|
const tabsListSizeClasses: Record<TabsListSize, string> = {
|
|
41
35
|
default: "",
|
|
42
36
|
sm: "[&_.t-tab]:px-2.5 [&_.t-tab]:py-1 [&_.t-tab]:text-xs",
|
|
@@ -48,9 +42,7 @@ const TabsList = React.forwardRef<
|
|
|
48
42
|
React.ComponentRef<typeof TabsPrimitive.List>,
|
|
49
43
|
React.ComponentPropsWithoutRef<typeof TabsPrimitive.List> & {
|
|
50
44
|
variant?: TabsListVariant;
|
|
51
|
-
/** `sm` makes the triggers smaller. No classes for `default`. */
|
|
52
45
|
size?: TabsListSize;
|
|
53
|
-
/** How the segmented pill moves. Overrides `UiConfig.Tabs.pillMotion`. */
|
|
54
46
|
pillMotion?: TabsPillMotion;
|
|
55
47
|
}
|
|
56
48
|
>(({ className, children, variant: variantProp, size, pillMotion: pillMotionProp, ...props }, ref) => {
|
|
@@ -214,11 +206,6 @@ export const tabsBarVariants = cva(
|
|
|
214
206
|
},
|
|
215
207
|
);
|
|
216
208
|
|
|
217
|
-
/**
|
|
218
|
-
* Page- or panel-level tab strip: a `TabsList` on the hairline that divides it
|
|
219
|
-
* from the content below, with an optional trailing `actions` slot for toolbar
|
|
220
|
-
* controls. `size="sm"` for nested panels; `className` overrides the padding.
|
|
221
|
-
*/
|
|
222
209
|
const TabsBar = React.forwardRef<
|
|
223
210
|
HTMLDivElement,
|
|
224
211
|
React.ComponentPropsWithoutRef<"div"> &
|
|
@@ -236,10 +223,6 @@ const TabsBar = React.forwardRef<
|
|
|
236
223
|
});
|
|
237
224
|
TabsBar.displayName = "TabsBar";
|
|
238
225
|
|
|
239
|
-
// raw radix primitives, use these when you need a tabs layout that the
|
|
240
|
-
// styled `tabs`/`tabslist`/`tabstrigger`/`tabscontent` defaults don't fit
|
|
241
|
-
// (e.g a vertical sidebar of tabs inside a popover) the styled exports
|
|
242
|
-
// above are tuned for horizontal pill, style tab bars
|
|
243
226
|
export { TabsPrimitive };
|
|
244
227
|
|
|
245
228
|
export { Tabs, TabsBar, TabsList, TabsTrigger, TabsContent };
|
package/src/ui/tabsSliding.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// transitions.dev tabs sliding, see 16, tabs, sliding.md
|
|
2
|
-
|
|
3
1
|
function findActiveTab(list: HTMLElement): HTMLElement | null {
|
|
4
2
|
const tabs = list.querySelectorAll<HTMLElement>(".t-tab");
|
|
5
3
|
for (const tab of tabs) {
|
|
@@ -16,9 +14,6 @@ function findActiveTab(list: HTMLElement): HTMLElement | null {
|
|
|
16
14
|
return tabs[0] ?? null;
|
|
17
15
|
}
|
|
18
16
|
|
|
19
|
-
// `xy`: both axes on transform (top pinned to 0), so a column list slides the
|
|
20
|
-
// same way a row does; `top` is a layout property and does not tween.
|
|
21
|
-
// Exported for other sliding pills (`Sidebar.RailGroup`).
|
|
22
17
|
export function moveTabsPillXY(
|
|
23
18
|
pill: HTMLElement,
|
|
24
19
|
tab: HTMLElement,
|
package/src/ui/time-picker.tsx
CHANGED
|
@@ -8,23 +8,13 @@ import {
|
|
|
8
8
|
pickerTriggerClass,
|
|
9
9
|
} from "./_picker-classes";
|
|
10
10
|
|
|
11
|
-
// custom 24, hour "hh:mm" time picker replaces `<input type="time">` because the native picker varies wildly
|
|
12
|
-
// across browsers and platforms (chrome/firefox/safari each render a
|
|
13
|
-
// different control, and the spinner buttons feel laggy on windows) ux:, the trigger is styled like an input, same height/border/radius, so it slots into forms without bespoke alignment work, clicking the trigger (or its clock icon) opens a popover with two scrollable columns: hours 00, 23 on the left, minutes 00, 59 on the right click an item to select, the popover stays open so users can set both halves in one trip, selected items use the same `bg, surface, tertiary` treatment used elsewhere for active states, no rings or borders, matching the design system the component is fully controlled, `value` is always "hh:mm" 24h and
|
|
14
|
-
// the consumer is responsible for any local↔utc conversion that keeps
|
|
15
|
-
// the picker free of timezone logic and matches how the rest of the
|
|
16
|
-
// codebase (e.g dream mode) shapes scheduling values
|
|
17
11
|
interface TimePickerProps {
|
|
18
12
|
value: string;
|
|
19
13
|
onChange: (value: string) => void;
|
|
20
14
|
className?: string;
|
|
21
15
|
disabled?: boolean;
|
|
22
16
|
ariaLabel?: string;
|
|
23
|
-
// merged onto the trigger (width defaults to a compact 110px; height,
|
|
24
|
-
// radius, padding and text size override cleanly)
|
|
25
17
|
triggerClassName?: string;
|
|
26
|
-
// `12` shows "02:30 PM" with an AM/PM column; `value` stays "HH:mm" 24h.
|
|
27
|
-
// Default `24`.
|
|
28
18
|
hourCycle?: 12 | 24;
|
|
29
19
|
}
|
|
30
20
|
|
|
@@ -39,7 +29,6 @@ const PERIODS = ["AM", "PM"];
|
|
|
39
29
|
|
|
40
30
|
type Period = "AM" | "PM";
|
|
41
31
|
|
|
42
|
-
/** "14" → { hour: "02", period: "PM" }; "00" → { hour: "12", period: "AM" }. */
|
|
43
32
|
function toTwelveHour(hour: string): { hour: string; period: Period } {
|
|
44
33
|
const h = Number(hour);
|
|
45
34
|
return {
|
|
@@ -48,7 +37,6 @@ function toTwelveHour(hour: string): { hour: string; period: Period } {
|
|
|
48
37
|
};
|
|
49
38
|
}
|
|
50
39
|
|
|
51
|
-
/** "02" + "PM" → "14"; "12" + "AM" → "00". */
|
|
52
40
|
function toTwentyFourHour(hour: string, period: Period): string {
|
|
53
41
|
return String((Number(hour) % 12) + (period === "PM" ? 12 : 0)).padStart(
|
|
54
42
|
2,
|
|
@@ -160,10 +148,6 @@ interface TimeColumnProps {
|
|
|
160
148
|
onSelect: (value: string) => void;
|
|
161
149
|
}
|
|
162
150
|
|
|
163
|
-
// Centres the selected item when the column mounts. The column lives inside
|
|
164
|
-
// the popover content, which mounts after the trigger's open state changes,
|
|
165
|
-
// so the scroll has to run here rather than in the picker. It sets the
|
|
166
|
-
// column's own `scrollTop`, so the page never scrolls.
|
|
167
151
|
function TimeColumn({ label, values, selected, onSelect }: TimeColumnProps) {
|
|
168
152
|
const listRef = React.useRef<HTMLDivElement | null>(null);
|
|
169
153
|
React.useLayoutEffect(() => {
|
|
@@ -172,7 +156,6 @@ function TimeColumn({ label, values, selected, onSelect }: TimeColumnProps) {
|
|
|
172
156
|
if (!list || !(item instanceof HTMLElement)) return;
|
|
173
157
|
list.scrollTop =
|
|
174
158
|
item.offsetTop - list.clientHeight / 2 + item.offsetHeight / 2;
|
|
175
|
-
// Mount only: re-centring on every pick would jump the list under the pointer.
|
|
176
159
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
177
160
|
}, []);
|
|
178
161
|
return (
|
package/src/ui/toggle-search.tsx
CHANGED
|
@@ -5,8 +5,6 @@ import { Popover, PopoverContent, PopoverTrigger } from "./popover";
|
|
|
5
5
|
import { SearchInput } from "./search-input";
|
|
6
6
|
import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip";
|
|
7
7
|
|
|
8
|
-
// "compact" is the always-visible logs/toolbar field. "large" is the icon
|
|
9
|
-
// button + popover, which keeps a crowded toolbar short.
|
|
10
8
|
export type ToggleSearchVariant = "compact" | "large";
|
|
11
9
|
|
|
12
10
|
export interface ToggleSearchProps {
|
|
@@ -69,8 +67,6 @@ export function ToggleSearch({
|
|
|
69
67
|
value={value}
|
|
70
68
|
onChange={onChange}
|
|
71
69
|
placeholder={placeholder}
|
|
72
|
-
// `max-sm:min-w-0` + `sm:shrink-0`: on a phone the field yields to its
|
|
73
|
-
// toolbar siblings instead of forcing the row (and the page) to overflow.
|
|
74
70
|
className="w-36 max-w-none max-sm:min-w-0 sm:w-44 sm:shrink-0"
|
|
75
71
|
onKeyDown={(event) => {
|
|
76
72
|
if (event.key === "Escape") {
|
|
@@ -109,8 +105,6 @@ export function ToggleSearch({
|
|
|
109
105
|
align="end"
|
|
110
106
|
className="w-72 p-2"
|
|
111
107
|
onOpenAutoFocus={(event) => {
|
|
112
|
-
// Radix types this as a plain `Event`, so the content element has to
|
|
113
|
-
// be narrowed before it can be searched for the field.
|
|
114
108
|
const content = event.currentTarget;
|
|
115
109
|
if (!(content instanceof HTMLElement)) return;
|
|
116
110
|
const input = content.querySelector("input");
|
|
@@ -4,11 +4,8 @@ import { SearchInput } from "./search-input";
|
|
|
4
4
|
export interface ToolbarSearchInputProps {
|
|
5
5
|
value: string;
|
|
6
6
|
onChange: (value: string) => void;
|
|
7
|
-
/** Default `"Search..."`. */
|
|
8
7
|
placeholder?: string;
|
|
9
|
-
/** `aria-label` of the input. Default `"Search"`. */
|
|
10
8
|
label?: string;
|
|
11
|
-
/** `aria-label` of the clear button. Default `"Clear search"`. */
|
|
12
9
|
clearLabel?: string;
|
|
13
10
|
className?: string;
|
|
14
11
|
inputClassName?: string;
|
package/src/ui/tooltip.tsx
CHANGED
|
@@ -4,13 +4,9 @@ import { useCn, useUiConfig } from "./ui-config";
|
|
|
4
4
|
|
|
5
5
|
/** App defaults for `Tooltip*` (see `UiConfigProvider`). */
|
|
6
6
|
export interface TooltipConfig {
|
|
7
|
-
/** Replaces the built-in classes of a part. */
|
|
8
7
|
classes?: { content?: string };
|
|
9
|
-
/** Default for `TooltipProvider` `delayDuration` (Radix: 700ms). */
|
|
10
8
|
delayDuration?: number;
|
|
11
|
-
/** Default for `TooltipContent` `sideOffset`. */
|
|
12
9
|
sideOffset?: number;
|
|
13
|
-
/** Default for `TooltipContent` `portal` (built-in: `true`). */
|
|
14
10
|
portal?: boolean;
|
|
15
11
|
}
|
|
16
12
|
|
|
@@ -32,7 +28,6 @@ const TooltipTrigger = TooltipPrimitive.Trigger;
|
|
|
32
28
|
const TooltipContent = React.forwardRef<
|
|
33
29
|
React.ComponentRef<typeof TooltipPrimitive.Content>,
|
|
34
30
|
React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {
|
|
35
|
-
/** Render into `document.body` so a clipping parent cannot cut it off (default `true`). */
|
|
36
31
|
portal?: boolean;
|
|
37
32
|
}
|
|
38
33
|
>(({ className, sideOffset, portal, ...props }, ref) => {
|
package/src/ui/ui-config.tsx
CHANGED
|
@@ -58,24 +58,7 @@ import type { TooltipConfig } from "./tooltip";
|
|
|
58
58
|
import type { TraitsPanelConfig } from "../ai-elements/prompt-input-traits";
|
|
59
59
|
import type { VideoPlayerConfig } from "../kibo/video-player";
|
|
60
60
|
|
|
61
|
-
// App-level component defaults. An app wraps its tree in `UiConfigProvider`
|
|
62
|
-
// to give components its own classes and behaviour without passing props at
|
|
63
|
-
// every call site. Without a provider (or with an empty entry) every component
|
|
64
|
-
// renders its built-in default, so apps that do not opt in see no change.
|
|
65
|
-
//
|
|
66
|
-
// Conventions for an entry:
|
|
67
|
-
// - `classes` replaces built-in classes part by part. A part left out keeps
|
|
68
|
-
// its default. A caller `className` still merges after it with `cn`.
|
|
69
|
-
// - Other keys are default prop values. An explicit prop always wins.
|
|
70
|
-
//
|
|
71
|
-
// Each component declares its entry type next to its code and adds it here.
|
|
72
61
|
export interface UiConfig {
|
|
73
|
-
/**
|
|
74
|
-
* Class merger used in place of the built-in `cn` by components that read
|
|
75
|
-
* it. Set it when the app's own tailwind-merge setup differs (for example
|
|
76
|
-
* when it does not treat `rounded-surface` as a radius class), so a caller
|
|
77
|
-
* `className` merges with the app's classes the way it always has.
|
|
78
|
-
*/
|
|
79
62
|
cn?: (...inputs: ClassValue[]) => string;
|
|
80
63
|
Accordion?: AccordionConfig;
|
|
81
64
|
ActivityQuestionCard?: ActivityQuestionCardConfig;
|
|
@@ -146,12 +129,10 @@ function UiConfigProvider({ config, children }: UiConfigProviderProps) {
|
|
|
146
129
|
return <UiConfigContext.Provider value={config}>{children}</UiConfigContext.Provider>;
|
|
147
130
|
}
|
|
148
131
|
|
|
149
|
-
/** The app's entry for one component, or `undefined` when the app sets none. */
|
|
150
132
|
function useUiConfig<K extends keyof UiConfig>(name: K): UiConfig[K] | undefined {
|
|
151
133
|
return React.useContext(UiConfigContext)[name];
|
|
152
134
|
}
|
|
153
135
|
|
|
154
|
-
/** The app's class merger (`UiConfig.cn`), or the built-in `cn`. */
|
|
155
136
|
function useCn(): (...inputs: ClassValue[]) => string {
|
|
156
137
|
return React.useContext(UiConfigContext).cn ?? cn;
|
|
157
138
|
}
|
package/src/utils/cat-color.ts
CHANGED
|
@@ -1,32 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Muted categorical ramp for hash-assigned identity colour — session tab
|
|
3
|
-
* groups, repo tiles, avatars. Not for status; status uses `status-*`.
|
|
4
|
-
*
|
|
5
|
-
* The ramp is eight CSS vars (`--cat-1` … `--cat-8`, see globals.css),
|
|
6
|
-
* exposed as the Tailwind `cat` colour family. This module owns the
|
|
7
|
-
* id → slot hashing once, so every consumer picks the same slot for the
|
|
8
|
-
* same id and the class names stay literal (Tailwind's extractor cannot
|
|
9
|
-
* see `` `bg-cat-${n}` ``, only the strings written out below).
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
1
|
/** Number of slots in the muted categorical ramp (--cat-1 … --cat-8). */
|
|
13
2
|
export const CAT_SLOT_COUNT = 8;
|
|
14
3
|
|
|
15
4
|
export type CatSlot = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
|
|
16
5
|
|
|
17
6
|
export interface CatColorClasses {
|
|
18
|
-
/** Solid foreground colour — text, icons, and `currentColor` accents. */
|
|
19
7
|
text: string;
|
|
20
|
-
/** Solid fill — underline strips, dots, anything with no text on top. */
|
|
21
8
|
bg: string;
|
|
22
|
-
/** Tinted fill, sized to sit behind `text` at readable contrast in both themes. */
|
|
23
9
|
bgTint: string;
|
|
24
|
-
/** Solid border stroke. */
|
|
25
10
|
border: string;
|
|
26
11
|
}
|
|
27
12
|
|
|
28
|
-
// One literal record per slot so Tailwind's class extractor sees every
|
|
29
|
-
// `cat-N` utility it needs to generate — a template string would hide them.
|
|
30
13
|
const CAT_COLOR_CLASSES: Record<CatSlot, CatColorClasses> = {
|
|
31
14
|
1: {
|
|
32
15
|
text: "text-cat-1",
|
|
@@ -78,9 +61,6 @@ const CAT_COLOR_CLASSES: Record<CatSlot, CatColorClasses> = {
|
|
|
78
61
|
},
|
|
79
62
|
};
|
|
80
63
|
|
|
81
|
-
// Maps the hash's 0–7 bucket onto the 1–8 slot type without a cast — indexing
|
|
82
|
-
// a `Record<number, CatSlot>` by the modulo result stays inside the type
|
|
83
|
-
// system, unlike `(index + 1) as CatSlot`.
|
|
84
64
|
const SLOT_BY_INDEX: Record<number, CatSlot> = {
|
|
85
65
|
0: 1,
|
|
86
66
|
1: 2,
|
package/src/utils/cn.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { type ClassValue, clsx } from "clsx";
|
|
2
2
|
import { extendTailwindMerge } from "tailwind-merge";
|
|
3
3
|
|
|
4
|
-
// `rounded-field` and the tokens.css radii (`rounded-surface`,
|
|
5
|
-
// `rounded-menu`, `rounded-menu-item`, `rounded-control`) are custom radius tokens — teach
|
|
6
|
-
// twMerge they conflict with `rounded-none` / `rounded-md` / etc. so the last
|
|
7
|
-
// radius class wins.
|
|
8
4
|
const twMerge = extendTailwindMerge({
|
|
9
5
|
extend: {
|
|
10
6
|
theme: {
|
package/src/utils/gesture.ts
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gesture physics from Apple's *Designing Fluid Interfaces* (WWDC 2018).
|
|
3
|
-
*
|
|
4
|
-
* These two functions are the whole of it, and both were previously copied
|
|
5
|
-
* verbatim into each surface that needed them. They are pure maths with no
|
|
6
|
-
* React or DOM dependency — import them, do not re-derive them.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
1
|
/**
|
|
10
2
|
* Progressive resistance past a boundary. A hard stop reads as frozen; damping
|
|
11
3
|
* that grows with the overshoot reads as "responsive, but there is nothing more
|
package/src/utils/ref.ts
CHANGED
|
@@ -1,23 +1,5 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef } from "react";
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* Page-visibility and on-screen budget for infinite animations.
|
|
5
|
-
*
|
|
6
|
-
* CSS animations pause via `html[data-page-hidden]` / `[data-anim-offscreen]`
|
|
7
|
-
* / parked `[aria-hidden="true"]` hosts in the host stylesheet. WAAPI
|
|
8
|
-
* (Spinner, LoadingState) has no CSS play-state hook, so
|
|
9
|
-
* {@link bindRuntimeAnimation} pauses those directly.
|
|
10
|
-
*
|
|
11
|
-
* Decorative animation chrome (`data-anim-chrome` on BorderBeam's overlay,
|
|
12
|
-
* Shimmer's copy, LoadingState's grid) is itself `aria-hidden` so AT skips
|
|
13
|
-
* it. That must not count as "the user cannot see this" — #764 paused every
|
|
14
|
-
* composer beam and session-row Drive grid by matching those hosts.
|
|
15
|
-
*
|
|
16
|
-
* Pausing is visually identical while the user is looking: playback resumes
|
|
17
|
-
* from the same offset when the tab or element is shown again.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/** Parked subtree (cached session shell, minimized Ave). Skips decorative chrome. */
|
|
21
3
|
const ARIA_HIDDEN_SUBTREE = '[aria-hidden="true"]:not([data-anim-chrome])';
|
|
22
4
|
|
|
23
5
|
type IntersectionListener = (intersecting: boolean) => void;
|
|
@@ -70,7 +52,6 @@ function getSharedObserver(): IntersectionObserver | null {
|
|
|
70
52
|
for (const listener of listeners) listener(entry.isIntersecting);
|
|
71
53
|
}
|
|
72
54
|
},
|
|
73
|
-
// Keep a small lead so a scroll into view does not show a frozen frame.
|
|
74
55
|
{ rootMargin: "64px", threshold: 0 },
|
|
75
56
|
);
|
|
76
57
|
return sharedObserver;
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Radius classes for theme-aware corners (`tokens.css` or the compat file).
|
|
3
|
-
*
|
|
4
|
-
* - Compact single-line rows that should stay pills on a "full" radius theme:
|
|
5
|
-
* `rounded-lg` (maps to `var(--radius)`).
|
|
6
|
-
* - Menu and nav rows: `rounded-menu-item` (capped).
|
|
7
|
-
* - Controls: `rounded-control` (capped).
|
|
8
|
-
* - Wide or multi-line surfaces (modals, dropdown panels, cards):
|
|
9
|
-
* `rounded-surface` (clamped) so they do not become ovals.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
1
|
/** Cards, dialogs, dropdown panels, kanban columns, alerts, calendars. */
|
|
13
2
|
export const SURFACE_RADIUS_CLASS = "rounded-surface";
|
|
14
3
|
|
|
@@ -10,10 +10,8 @@ import {
|
|
|
10
10
|
import { sortableKeyboardCoordinates } from "@dnd-kit/sortable";
|
|
11
11
|
import { DRAG_ACTIVATION_DISTANCE_PX } from "./gesture";
|
|
12
12
|
|
|
13
|
-
/** How long a finger must rest before a drag arms, in ms. */
|
|
14
13
|
const TOUCH_HOLD_MS = 200;
|
|
15
14
|
|
|
16
|
-
/** How far a finger may stray during the hold without cancelling it, in px. */
|
|
17
15
|
const TOUCH_HOLD_TOLERANCE_PX = 10;
|
|
18
16
|
|
|
19
17
|
/**
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import tailwindcss from "@tailwindcss/vite";
|
|
2
2
|
import { defineConfig } from "vite";
|
|
3
3
|
|
|
4
|
-
// React, react-dom and the @vvedantb/ui peers resolve from packages/ui/node_modules
|
|
5
|
-
// (this folder sits inside that package), so the fixture installs only the build tools.
|
|
6
4
|
export default defineConfig({
|
|
7
5
|
plugins: [tailwindcss()],
|
|
8
6
|
esbuild: { jsx: "automatic" },
|
|
@@ -21,8 +21,6 @@ function fire() {
|
|
|
21
21
|
export function Fixture() {
|
|
22
22
|
const [dark, setDark] = useState(initialDark);
|
|
23
23
|
|
|
24
|
-
// Sonner portals toasts onto `document.body`, so `.dark` must live on `<html>`
|
|
25
|
-
// (not an inner wrapper) for token / Tailwind dark styles to reach them.
|
|
26
24
|
useEffect(() => {
|
|
27
25
|
document.documentElement.classList.toggle("dark", dark);
|
|
28
26
|
return () => {
|
|
@@ -30,7 +28,6 @@ export function Fixture() {
|
|
|
30
28
|
};
|
|
31
29
|
}, [dark]);
|
|
32
30
|
|
|
33
|
-
// Fire one sample toast on load so a screenshot captures it.
|
|
34
31
|
useEffect(() => {
|
|
35
32
|
const id = window.setTimeout(fire, 150);
|
|
36
33
|
return () => window.clearTimeout(id);
|
|
@@ -44,7 +41,6 @@ export function Fixture() {
|
|
|
44
41
|
<Button onClick={fire}>Show toast</Button>
|
|
45
42
|
</div>
|
|
46
43
|
</main>
|
|
47
|
-
{/* No `position`: the package default, top-right. */}
|
|
48
44
|
<SonnerToaster
|
|
49
45
|
theme={dark ? "dark" : "light"}
|
|
50
46
|
toastRadius={compact ? "control" : "surface"}
|
|
@@ -8,8 +8,6 @@ function initialDark(): boolean {
|
|
|
8
8
|
return new URLSearchParams(window.location.search).get("theme") === "dark";
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
// The toast `startUpdateAvailableWatcher` shows. Refresh reloads this page,
|
|
12
|
-
// which fires the toast again.
|
|
13
11
|
function fireUpdateToast() {
|
|
14
12
|
showUpdateAvailableToast({ toast });
|
|
15
13
|
}
|
|
@@ -18,7 +16,6 @@ function fireUpdateToast() {
|
|
|
18
16
|
export function UpdateToastFixture() {
|
|
19
17
|
const [dark, setDark] = useState(initialDark);
|
|
20
18
|
|
|
21
|
-
// Sonner portals toasts onto `document.body`, so `.dark` must live on `<html>`.
|
|
22
19
|
useEffect(() => {
|
|
23
20
|
document.documentElement.classList.toggle("dark", dark);
|
|
24
21
|
return () => {
|
|
@@ -39,7 +36,6 @@ export function UpdateToastFixture() {
|
|
|
39
36
|
<Button onClick={fireUpdateToast}>Show update toast</Button>
|
|
40
37
|
</div>
|
|
41
38
|
</main>
|
|
42
|
-
{/* No `position`: the package default, top-right, as Eva mounts it. */}
|
|
43
39
|
<SonnerToaster
|
|
44
40
|
theme={dark ? "dark" : "light"}
|
|
45
41
|
toastRadius="surface"
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import tailwindcss from "@tailwindcss/vite";
|
|
2
2
|
import { defineConfig } from "vite";
|
|
3
3
|
|
|
4
|
-
// React, react-dom and the @vvedantb/ui peers resolve from packages/ui/node_modules
|
|
5
|
-
// (this folder sits inside that package), so the fixture installs only the build tools.
|
|
6
4
|
export default defineConfig({
|
|
7
5
|
plugins: [tailwindcss()],
|
|
8
6
|
esbuild: { jsx: "automatic" },
|
|
@@ -51,10 +51,6 @@ import {
|
|
|
51
51
|
AgentTraceTitle,
|
|
52
52
|
} from "../../../src";
|
|
53
53
|
|
|
54
|
-
// The components moved in from eva, rendered on plain tokens.css
|
|
55
|
-
// (no app variables, no compat layer) in a light and a dark pane. `?theme=light`
|
|
56
|
-
// or `?theme=dark` shows one pane at full width for a screenshot.
|
|
57
|
-
|
|
58
54
|
const tones: StatusTone[] = ["progress", "business-review", "code-review", "done", "cancelled", "active", "critical", "neutral"];
|
|
59
55
|
|
|
60
56
|
const steps: ActivityStep[] = [
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import tailwindcss from "@tailwindcss/vite";
|
|
2
2
|
import { defineConfig } from "vite";
|
|
3
3
|
|
|
4
|
-
// React, react-dom and the @vvedantb/ui peers resolve from packages/ui/node_modules
|
|
5
|
-
// (this folder sits inside that package), so the fixture installs only the build tools.
|
|
6
4
|
export default defineConfig({
|
|
7
5
|
plugins: [tailwindcss()],
|
|
8
6
|
esbuild: { jsx: "automatic" },
|