@vvedantb/ui 0.66.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/SidebarAccountMenu.js +1 -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 +3 -9
- 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 +2 -16
- package/dist/src/ai-elements/shimmer.js +0 -14
- package/dist/src/ai-elements/speech-input.js +0 -7
- package/dist/src/artifacts/artifact-card.js +1 -1
- package/dist/src/artifacts/artifact-frame.js +0 -2
- package/dist/src/artifacts/artifact-viewer.js +2 -1
- 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 +6 -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/context-menu.js +40 -34
- 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/dropdown-menu.js +40 -34
- 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 +3 -3
- 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 +1 -41
- 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/__snapshots__/queue.test.tsx.snap +2 -2
- 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 +3 -34
- 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 +2 -20
- 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 +1 -8
- 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 +2 -6
- 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 +7 -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 +4 -11
- 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 +4 -12
- 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
|
@@ -15,7 +15,6 @@ interface LabeledSliderRowProps {
|
|
|
15
15
|
step?: number;
|
|
16
16
|
disabled?: boolean;
|
|
17
17
|
icon?: ReactNode;
|
|
18
|
-
/** Formats the right-aligned value display. Default joins the values with an en dash. */
|
|
19
18
|
formatValue?: (value: number[]) => ReactNode;
|
|
20
19
|
minLabel?: ReactNode;
|
|
21
20
|
maxLabel?: ReactNode;
|
|
@@ -62,7 +61,6 @@ export function LabeledSliderRow({
|
|
|
62
61
|
{formatValue(value)}
|
|
63
62
|
</output>
|
|
64
63
|
</div>
|
|
65
|
-
{/* The thumb is a span, which `htmlFor` cannot name, so aria-labelledby carries the name unless thumbLabels does. */}
|
|
66
64
|
<Slider
|
|
67
65
|
id={id}
|
|
68
66
|
aria-labelledby={thumbLabels ? undefined : labelId}
|
package/src/ui/list-row.tsx
CHANGED
|
@@ -54,64 +54,25 @@ export interface ListRowProps extends Omit<
|
|
|
54
54
|
"onClick" | "children"
|
|
55
55
|
> {
|
|
56
56
|
children: React.ReactNode;
|
|
57
|
-
/**
|
|
58
|
-
* Background class for the 4px stripe down the leading edge — the row's
|
|
59
|
-
* status colour. Omit for rows that carry no status.
|
|
60
|
-
*/
|
|
61
57
|
accentClassName?: string;
|
|
62
|
-
/** Current row. Fills the surface and recolours the hairline. */
|
|
63
58
|
selected?: boolean;
|
|
64
|
-
/**
|
|
65
|
-
* Router link (or any single element) used as the stretched overlay. Props
|
|
66
|
-
* are merged via Radix `Slot`. Prefer this over {@link href} for in-app
|
|
67
|
-
* navigation so rewrites apply to the rendered `href`.
|
|
68
|
-
*/
|
|
69
59
|
link?: React.ReactElement;
|
|
70
|
-
/**
|
|
71
|
-
* Renders the overlay as a raw `<a>`. Use for external URLs. In-app paths
|
|
72
|
-
* should use {@link link} instead.
|
|
73
|
-
*/
|
|
74
60
|
href?: string;
|
|
75
|
-
/**
|
|
76
|
-
* Fires on plain (non-modified) clicks. With {@link link}, call
|
|
77
|
-
* `event.preventDefault()` to cancel navigation (e.g. selection mode). With
|
|
78
|
-
* {@link href}, the row always prevents the browser navigation and expects
|
|
79
|
-
* this handler to navigate in-app if needed.
|
|
80
|
-
*/
|
|
81
61
|
onClick?: (event: React.MouseEvent<HTMLElement>) => void;
|
|
82
|
-
/**
|
|
83
|
-
* Names the row for screen readers, since the overlay has no text of its own.
|
|
84
|
-
* Lands on the overlay rather than the shell, so it labels the control that
|
|
85
|
-
* actually carries the role.
|
|
86
|
-
*/
|
|
87
62
|
"aria-label"?: string;
|
|
88
63
|
className?: string;
|
|
89
|
-
/** Padding for the row body. Defaults to the standard row inset. */
|
|
90
64
|
contentClassName?: string;
|
|
91
|
-
/** Content layered behind the row body, such as a hover glow. */
|
|
92
65
|
decoration?: React.ReactNode;
|
|
93
66
|
}
|
|
94
67
|
|
|
95
68
|
export interface ListRowConfig {
|
|
96
|
-
/**
|
|
97
|
-
* Replaces the built-in classes of a part. The row is `root`, plus
|
|
98
|
-
* `interactive` when it has a `link`, `href` or `onClick`, plus `selected`
|
|
99
|
-
* or `idle`.
|
|
100
|
-
*/
|
|
101
69
|
classes?: {
|
|
102
|
-
/** Shell: radius, clipping, transition and the overlay focus ring. */
|
|
103
70
|
root?: string;
|
|
104
|
-
/** Press feedback, added when the row is interactive. */
|
|
105
71
|
interactive?: string;
|
|
106
|
-
/** Fill and ring of the current row. */
|
|
107
72
|
selected?: string;
|
|
108
|
-
/** Fill and hover of every other row. */
|
|
109
73
|
idle?: string;
|
|
110
|
-
/** The 4px status stripe (its colour comes from `accentClassName`). */
|
|
111
74
|
accent?: string;
|
|
112
|
-
/** The stretched `<button>` / `<a>` / `link` overlay. */
|
|
113
75
|
overlay?: string;
|
|
114
|
-
/** Row body padding (a caller `contentClassName` merges after it). */
|
|
115
76
|
content?: string;
|
|
116
77
|
};
|
|
117
78
|
}
|
|
@@ -181,12 +142,9 @@ const ListRow = React.forwardRef<HTMLDivElement, ListRowProps>(function ListRow(
|
|
|
181
142
|
aria-label={ariaLabel}
|
|
182
143
|
className={overlayClasses}
|
|
183
144
|
onClick={(event: React.MouseEvent<HTMLElement>) => {
|
|
184
|
-
// Modified clicks are for new tab / window — leave navigation alone.
|
|
185
145
|
if (!isModifiedClick(event)) {
|
|
186
146
|
onClick?.(event);
|
|
187
147
|
}
|
|
188
|
-
// Own the click so a wrapping parent (e.g. KanbanCard) does not
|
|
189
|
-
// also treat it as a row activation.
|
|
190
148
|
event.stopPropagation();
|
|
191
149
|
}}
|
|
192
150
|
>
|
|
@@ -197,10 +155,6 @@ const ListRow = React.forwardRef<HTMLDivElement, ListRowProps>(function ListRow(
|
|
|
197
155
|
href={href}
|
|
198
156
|
onClick={(event) => {
|
|
199
157
|
if (onClick === undefined) return;
|
|
200
|
-
// A modified click is the entire reason this is an `<a>` — let the
|
|
201
|
-
// browser open the new tab or window itself. A plain click is
|
|
202
|
-
// handled in-app, so the navigation has to be cancelled or the
|
|
203
|
-
// row would also hard-reload the page out from under the router.
|
|
204
158
|
if (isModifiedClick(event)) return;
|
|
205
159
|
event.preventDefault();
|
|
206
160
|
onClick(event);
|
package/src/ui/loading-state.tsx
CHANGED
|
@@ -35,15 +35,10 @@ export type LoadingStateSize = "default" | "sm";
|
|
|
35
35
|
export type LoadingStateColors = readonly [string, string, string];
|
|
36
36
|
|
|
37
37
|
export interface LoadingStateConfig {
|
|
38
|
-
/** Default for the `label` prop. */
|
|
39
38
|
label?: string;
|
|
40
|
-
/** Default for the `colors` prop. */
|
|
41
39
|
colors?: LoadingStateColors;
|
|
42
|
-
/** Default for the `labelStyle` prop. */
|
|
43
40
|
labelStyle?: CSSProperties;
|
|
44
|
-
/** Replaces the built-in classes of a part. */
|
|
45
41
|
classes?: {
|
|
46
|
-
/** The label text. Default `text-sm font-medium text-muted-foreground`. */
|
|
47
42
|
label?: string;
|
|
48
43
|
};
|
|
49
44
|
}
|
|
@@ -52,7 +47,6 @@ const SIZE_TOKENS: Record<
|
|
|
52
47
|
LoadingStateSize,
|
|
53
48
|
{ cellPx: number; gapPx: number; radiusClass: string }
|
|
54
49
|
> = {
|
|
55
|
-
// 3×3px + 2×1px gaps = 11px.
|
|
56
50
|
sm: { cellPx: 3, gapPx: 1, radiusClass: "rounded-[0.5px]" },
|
|
57
51
|
default: { cellPx: 4, gapPx: 1.5, radiusClass: "rounded-[1px]" },
|
|
58
52
|
};
|
|
@@ -82,15 +76,8 @@ const DEFAULT_COLORS: LoadingStateColors = ["currentColor", "currentColor", "cur
|
|
|
82
76
|
|
|
83
77
|
const defaultLabelClass = "text-sm font-medium text-muted-foreground";
|
|
84
78
|
|
|
85
|
-
/** Started on attach, cancelled on detach. `undefined` for a gap cell. */
|
|
86
79
|
type PulseRef = ((cell: HTMLSpanElement) => () => void) | undefined;
|
|
87
80
|
|
|
88
|
-
/**
|
|
89
|
-
* One ref callback per cell. The easing sits on the keyframes, not in the
|
|
90
|
-
* options, because CSS applies `animation-timing-function` per segment —
|
|
91
|
-
* as an option it would ease the whole cycle instead. No `fill`, so during
|
|
92
|
-
* its delay a cell keeps the static inline opacity, as under CSS.
|
|
93
|
-
*/
|
|
94
81
|
function pulseRefs(delays: (number | null)[], dur: number): PulseRef[] {
|
|
95
82
|
return delays.map((d) =>
|
|
96
83
|
d === null
|
|
@@ -109,12 +96,6 @@ function pulseRefs(delays: (number | null)[], dur: number): PulseRef[] {
|
|
|
109
96
|
);
|
|
110
97
|
}
|
|
111
98
|
|
|
112
|
-
/**
|
|
113
|
-
* Built once per variant, because these identities have to be stable: a ref
|
|
114
|
-
* callback built during render would be a new function every render, and React
|
|
115
|
-
* detaches and reattaches on identity change — restarting the pulse each time
|
|
116
|
-
* (the labelled variant re-renders 10×/s off `useElapsed`).
|
|
117
|
-
*/
|
|
118
99
|
const PULSE_REFS: Record<LoadingStateVariant, PulseRef[]> = {
|
|
119
100
|
Drive: pulseRefs(PATTERNS.Drive.delays, PATTERNS.Drive.dur),
|
|
120
101
|
Dots: pulseRefs(PATTERNS.Dots.delays, PATTERNS.Dots.dur),
|
|
@@ -139,15 +120,11 @@ function useElapsed(enabled: boolean) {
|
|
|
139
120
|
}
|
|
140
121
|
|
|
141
122
|
export interface LoadingStateProps {
|
|
142
|
-
/** Label text, also the `aria-label` when `iconOnly`. Default `UiConfig.LoadingState.label`, else `"Working"`. */
|
|
143
123
|
label?: string;
|
|
144
124
|
variant?: LoadingStateVariant;
|
|
145
125
|
size?: LoadingStateSize;
|
|
146
|
-
/** Pixel grid only — no label or elapsed timer. */
|
|
147
126
|
iconOnly?: boolean;
|
|
148
|
-
/** Column colours. Default `UiConfig.LoadingState.colors`, else `currentColor`. */
|
|
149
127
|
colors?: LoadingStateColors;
|
|
150
|
-
/** Inline style for the label, e.g. a shimmer gradient. Default `UiConfig.LoadingState.labelStyle`. */
|
|
151
128
|
labelStyle?: CSSProperties;
|
|
152
129
|
}
|
|
153
130
|
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { useEffect, useRef, type ReactNode } from "react";
|
|
2
2
|
import { useCn } from "./ui-config";
|
|
3
3
|
|
|
4
|
-
/** Pixels per second the revealed text travels: constant speed, so long labels do not whip by. */
|
|
5
4
|
const MARQUEE_SPEED_PX_PER_S = 60;
|
|
6
|
-
/** Clamp the scroll duration so very short and very long overflows both stay readable. */
|
|
7
5
|
const MIN_DURATION_S = 0.5;
|
|
8
6
|
const MAX_DURATION_S = 5;
|
|
9
7
|
|
|
@@ -29,8 +27,6 @@ export function MarqueeOnHover({ children, className }: MarqueeOnHoverProps) {
|
|
|
29
27
|
const hostRef = useRef<HTMLSpanElement>(null);
|
|
30
28
|
const innerRef = useRef<HTMLSpanElement>(null);
|
|
31
29
|
|
|
32
|
-
// Re-measure after a content change, a host resize or the web font swap,
|
|
33
|
-
// since each changes how much (if at all) the text overflows.
|
|
34
30
|
useEffect(() => {
|
|
35
31
|
const host = hostRef.current;
|
|
36
32
|
const inner = innerRef.current;
|
|
@@ -43,9 +39,8 @@ export function MarqueeOnHover({ children, className }: MarqueeOnHoverProps) {
|
|
|
43
39
|
cancelAnimationFrame(raf);
|
|
44
40
|
raf = requestAnimationFrame(() => {
|
|
45
41
|
const shift = Math.max(0, inner.scrollWidth - host.clientWidth);
|
|
46
|
-
const overflows = shift > 1;
|
|
42
|
+
const overflows = shift > 1;
|
|
47
43
|
host.dataset.mqOverflow = overflows ? "true" : "false";
|
|
48
|
-
// Native tooltip is the touch / long-hover fallback, only when truncated.
|
|
49
44
|
host.title = overflows ? (inner.textContent ?? "") : "";
|
|
50
45
|
if (overflows) {
|
|
51
46
|
const duration = Math.min(
|
package/src/ui/media-preview.tsx
CHANGED
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
import { ImageLightbox, type GalleryImage } from "./image-lightbox";
|
|
17
17
|
import { useCn } from "./ui-config";
|
|
18
18
|
|
|
19
|
-
/** Hairline ring that separates media from any surface, in light and dark. */
|
|
20
19
|
const MEDIA_OUTLINE = "ring-1 ring-black/10 dark:ring-white/10";
|
|
21
20
|
|
|
22
21
|
/**
|
|
@@ -65,7 +64,6 @@ export function ImageGalleryPreview({ images }: { images: GalleryImage[] }) {
|
|
|
65
64
|
onClick={() => setLightboxIndex(index)}
|
|
66
65
|
className={cn(
|
|
67
66
|
"relative block cursor-pointer motion-press active:scale-[0.99]",
|
|
68
|
-
// Three images: first tile spans the left column, Twitter-style.
|
|
69
67
|
count === 3 && index === 0 ? "row-span-2 h-full" : undefined,
|
|
70
68
|
)}
|
|
71
69
|
>
|
|
@@ -115,9 +113,6 @@ export function VideoPreview({
|
|
|
115
113
|
preload="metadata"
|
|
116
114
|
slot="media"
|
|
117
115
|
/>
|
|
118
|
-
{/* Nine controls do not fit a phone-width bar. Playback rate and the
|
|
119
|
-
volume slider drop out below `sm` — a phone has hardware volume keys,
|
|
120
|
-
and everything essential (play, scrub, time, mute, fullscreen) stays. */}
|
|
121
116
|
<VideoPlayerControlBar>
|
|
122
117
|
<VideoPlayerPlayButton />
|
|
123
118
|
<VideoPlayerSeekBackwardButton />
|
|
@@ -2,19 +2,10 @@ import { prefersReducedMotion } from "./overlay-a11y";
|
|
|
2
2
|
|
|
3
3
|
const closeTimers = new WeakMap<HTMLElement, ReturnType<typeof setTimeout>>();
|
|
4
4
|
|
|
5
|
-
/*
|
|
6
|
-
* Grow from the trigger (macOS-style): a modal opened by a press grows out of
|
|
7
|
-
* the pressed point and shrinks back into it on close. Opened from the
|
|
8
|
-
* keyboard, it grows out of the focused control. With neither (a shortcut, an
|
|
9
|
-
* async open), it keeps the centred `--modal-scale` zoom.
|
|
10
|
-
*/
|
|
11
5
|
const TRIGGER_SCALE = 0.4;
|
|
12
|
-
/** A press older than this did not open the modal (it was an async open). */
|
|
13
6
|
const PRESS_WINDOW_MS = 500;
|
|
14
7
|
let lastPress: { x: number; y: number; at: number } | null = null;
|
|
15
8
|
|
|
16
|
-
// From module load, not the first modal: the press that opens the first
|
|
17
|
-
// modal comes before any modal connects.
|
|
18
9
|
if (typeof document !== "undefined") {
|
|
19
10
|
document.addEventListener(
|
|
20
11
|
"pointerdown",
|
|
@@ -41,23 +32,15 @@ function triggerPoint(el: HTMLElement): { x: number; y: number } | null {
|
|
|
41
32
|
return null;
|
|
42
33
|
}
|
|
43
34
|
|
|
44
|
-
/**
|
|
45
|
-
* Points the surface's transform origin at the trigger and widens its zoom.
|
|
46
|
-
* Skips instant surfaces (`--modal-scale: 1`, the command palette). Measured
|
|
47
|
-
* from the box centre, which a centred scale does not move.
|
|
48
|
-
*/
|
|
49
35
|
function aimAtTrigger(el: HTMLElement): void {
|
|
50
36
|
if (getComputedStyle(el).getPropertyValue("--modal-scale").trim() === "1") {
|
|
51
37
|
return;
|
|
52
38
|
}
|
|
53
39
|
const point = triggerPoint(el);
|
|
54
|
-
// No layout (jsdom, a hidden host): nothing to aim from.
|
|
55
40
|
if (point === null || el.offsetWidth === 0) return;
|
|
56
41
|
const r = el.getBoundingClientRect();
|
|
57
42
|
const left = r.left + r.width / 2 - el.offsetWidth / 2;
|
|
58
43
|
const top = r.top + r.height / 2 - el.offsetHeight / 2;
|
|
59
|
-
// Measuring fixed the 0.96 start as the before-change style, so jump to
|
|
60
|
-
// the trigger start without a transition, or it would tween there first.
|
|
61
44
|
el.style.transition = "none";
|
|
62
45
|
el.style.transformOrigin = `${point.x - left}px ${point.y - top}px`;
|
|
63
46
|
el.style.setProperty("--modal-scale", String(TRIGGER_SCALE));
|
|
@@ -82,14 +65,12 @@ function clearCloseTimer(el: HTMLElement): void {
|
|
|
82
65
|
}
|
|
83
66
|
}
|
|
84
67
|
|
|
85
|
-
// open: scales up from, modal, scale clears any in, flight close cleanup
|
|
86
68
|
function openModalSurface(el: HTMLElement): void {
|
|
87
69
|
clearCloseTimer(el);
|
|
88
70
|
el.classList.remove("is-closing");
|
|
89
71
|
el.classList.add("is-open");
|
|
90
72
|
}
|
|
91
73
|
|
|
92
|
-
// close: swap to is, closing, remove after, modal, close, dur
|
|
93
74
|
function closeModalSurface(el: HTMLElement): void {
|
|
94
75
|
clearCloseTimer(el);
|
|
95
76
|
el.classList.remove("is-open");
|
|
@@ -106,7 +87,6 @@ function closeModalSurface(el: HTMLElement): void {
|
|
|
106
87
|
closeTimers.set(el, timer);
|
|
107
88
|
}
|
|
108
89
|
|
|
109
|
-
// first paint entrance, start at resting scale, then open on next frame
|
|
110
90
|
function primeModalSurface(el: HTMLElement): void {
|
|
111
91
|
clearCloseTimer(el);
|
|
112
92
|
el.classList.remove("is-open", "is-closing");
|
|
@@ -120,7 +100,6 @@ function primeModalSurface(el: HTMLElement): void {
|
|
|
120
100
|
});
|
|
121
101
|
}
|
|
122
102
|
|
|
123
|
-
// sync is, open / is, closing with radix data, state on the same node
|
|
124
103
|
function syncModalSurfaceFromDataState(el: HTMLElement): void {
|
|
125
104
|
const state = el.getAttribute("data-state");
|
|
126
105
|
if (state === "open") {
|
|
@@ -141,11 +120,7 @@ function disconnectModalSurface(el: HTMLElement): void {
|
|
|
141
120
|
clearCloseTimer(el);
|
|
142
121
|
}
|
|
143
122
|
|
|
144
|
-
// wire radix data, state → is, open / is, closing on the dialog surface
|
|
145
|
-
// call from the content ref callback so portal, mounted nodes are never missed
|
|
146
123
|
export function connectModalSurface(el: HTMLElement): () => void {
|
|
147
|
-
// A content re-render can re-run the ref (a new `ref` prop): a surface
|
|
148
|
-
// that is already open stays put, or it replayed its entrance mid-view.
|
|
149
124
|
if (
|
|
150
125
|
el.getAttribute("data-state") === "open" &&
|
|
151
126
|
!el.classList.contains("is-open")
|
package/src/ui/overlay-a11y.ts
CHANGED
|
@@ -140,7 +140,6 @@ export function treeHasDialogDescription(
|
|
|
140
140
|
if (!React.isValidElement(child)) return false;
|
|
141
141
|
const type = child.type;
|
|
142
142
|
if (type === descriptionType) return true;
|
|
143
|
-
// Wrappers named like `ConfirmDialog.Description` count too.
|
|
144
143
|
const displayName =
|
|
145
144
|
(typeof type === "function" || (typeof type === "object" && type !== null)) &&
|
|
146
145
|
"displayName" in type
|
package/src/ui/page-title.tsx
CHANGED
|
@@ -4,20 +4,16 @@ import { cn } from "../utils/cn";
|
|
|
4
4
|
/** The page title class contract: Instrument Sans (the sans token), 20px, weight 600, never lighter. Same string as `Breadcrumb`. */
|
|
5
5
|
export const pageTitleClass = "text-xl font-semibold leading-tight tracking-tight";
|
|
6
6
|
|
|
7
|
-
/** Page title: `h1`, `text-xl font-semibold leading-tight tracking-tight`. */
|
|
8
7
|
const PageTitle = React.forwardRef<HTMLHeadingElement, React.HTMLAttributes<HTMLHeadingElement>>(
|
|
9
8
|
({ className, ...props }, ref) => <h1 ref={ref} className={cn(pageTitleClass, className)} {...props} />,
|
|
10
9
|
);
|
|
11
10
|
PageTitle.displayName = "PageTitle";
|
|
12
11
|
|
|
13
12
|
export type PageHeaderProps = Omit<React.HTMLAttributes<HTMLElement>, "title"> & {
|
|
14
|
-
/** Title text or node, rendered in `PageTitle`. */
|
|
15
13
|
title: React.ReactNode;
|
|
16
|
-
/** Right-aligned slot, for example a button. */
|
|
17
14
|
action?: React.ReactNode;
|
|
18
15
|
};
|
|
19
16
|
|
|
20
|
-
/** Title row: `PageTitle` with an optional `action` slot. No safe-area padding (web). */
|
|
21
17
|
const PageHeader = React.forwardRef<HTMLElement, PageHeaderProps>(({ title, action, className, ...props }, ref) => (
|
|
22
18
|
<header ref={ref} className={cn("flex min-w-0 items-center justify-between gap-3 px-4 py-4 sm:px-6", className)} {...props}>
|
|
23
19
|
<PageTitle className="min-w-0 truncate">{title}</PageTitle>
|
package/src/ui/popover.tsx
CHANGED
|
@@ -11,11 +11,8 @@ type PopoverContentProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitiv
|
|
|
11
11
|
|
|
12
12
|
/** App defaults for `Popover*` (see `UiConfigProvider`). */
|
|
13
13
|
export interface PopoverConfig {
|
|
14
|
-
/** Replaces the built-in classes of a part. */
|
|
15
14
|
classes?: { trigger?: string; content?: string };
|
|
16
|
-
/** Default for `PopoverContent` `sideOffset`. */
|
|
17
15
|
sideOffset?: number;
|
|
18
|
-
/** Default for `PopoverContent` `collisionPadding` (built-in: `8`). */
|
|
19
16
|
collisionPadding?: PopoverContentProps["collisionPadding"];
|
|
20
17
|
}
|
|
21
18
|
|
|
@@ -28,8 +25,6 @@ const PopoverTrigger = React.forwardRef<
|
|
|
28
25
|
>((props, ref) => {
|
|
29
26
|
const trigger = useUiConfig("Popover")?.classes?.trigger;
|
|
30
27
|
const merge = useCn();
|
|
31
|
-
// Without config, pass props untouched: Radix's Slot turns an explicit
|
|
32
|
-
// `className={undefined}` into `class=""`.
|
|
33
28
|
if (trigger === undefined) return <PopoverPrimitive.Trigger ref={ref} {...props} />;
|
|
34
29
|
const { className, ...rest } = props;
|
|
35
30
|
return <PopoverPrimitive.Trigger ref={ref} className={merge(trigger, className)} {...rest} />;
|
|
@@ -39,9 +34,6 @@ PopoverTrigger.displayName = PopoverPrimitive.Trigger.displayName;
|
|
|
39
34
|
const PopoverContent = React.forwardRef<
|
|
40
35
|
React.ComponentRef<typeof PopoverPrimitive.Content>,
|
|
41
36
|
PopoverContentProps & {
|
|
42
|
-
/**
|
|
43
|
-
* Grow from the trigger and, on small screens, cap width and height.
|
|
44
|
-
*/
|
|
45
37
|
fitViewport?: boolean;
|
|
46
38
|
}
|
|
47
39
|
>(({ className, align = "center", sideOffset, fitViewport, collisionPadding, ...props }, ref) => {
|
package/src/ui/progress.tsx
CHANGED
|
@@ -3,7 +3,6 @@ import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
|
3
3
|
import { useCn, useUiConfig } from "./ui-config";
|
|
4
4
|
|
|
5
5
|
export interface ProgressConfig {
|
|
6
|
-
/** Replaces the built-in classes of a part. A part left out keeps its default. */
|
|
7
6
|
classes?: { root?: string; indicator?: string };
|
|
8
7
|
}
|
|
9
8
|
|
|
@@ -3,17 +3,6 @@ import { CrossfadeIcon } from "./crossfade-icon";
|
|
|
3
3
|
import { Spinner } from "./spinner";
|
|
4
4
|
import { useCn } from "./ui-config";
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
* Refresh glyph for a control that reloads something: it crossfades to
|
|
8
|
-
* the `circle` {@link Spinner} while the action is in flight.
|
|
9
|
-
*
|
|
10
|
-
* One component so every toolbar swaps glyph and spinner the same way, with
|
|
11
|
-
* the `soft` crossfade.
|
|
12
|
-
*
|
|
13
|
-
* `className` sizes the slot and both glyphs. Inside a `Button`, the button's
|
|
14
|
-
* `[&_svg]:size-*` rule wins on specificity, so pass a matching size to keep
|
|
15
|
-
* the slot and the glyph the same box.
|
|
16
|
-
*/
|
|
17
6
|
function RefreshSpinIcon({
|
|
18
7
|
busy,
|
|
19
8
|
className = "size-4",
|
|
@@ -4,11 +4,8 @@ import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip";
|
|
|
4
4
|
import { useCn } from "./ui-config";
|
|
5
5
|
|
|
6
6
|
export interface RelativeDateTimeProps {
|
|
7
|
-
/** Unix ms. When omitted, renders `emptyLabel` with no tooltip. */
|
|
8
7
|
at?: number;
|
|
9
|
-
/** Shown when `at` is missing. Default `"—"`. */
|
|
10
8
|
emptyLabel?: string;
|
|
11
|
-
/** dayjs format for the tooltip. Default `"DD/MM/YYYY HH:mm"`. */
|
|
12
9
|
exactFormat?: string;
|
|
13
10
|
className?: string;
|
|
14
11
|
}
|
|
@@ -42,12 +42,10 @@ export function RollingNumber({ value, className }: { value: string; className?:
|
|
|
42
42
|
function DigitColumn({ digit }: { digit: number }) {
|
|
43
43
|
return (
|
|
44
44
|
<span aria-hidden className="relative inline-block h-[1lh] overflow-hidden">
|
|
45
|
-
{/* Holds the width of one digit; the moving column is absolute. */}
|
|
46
45
|
<span className="invisible">0</span>
|
|
47
46
|
<m.span
|
|
48
47
|
className="absolute inset-x-0 top-0 flex flex-col"
|
|
49
48
|
initial={false}
|
|
50
|
-
// The column is ten rows tall, so one row is 10% of its height.
|
|
51
49
|
animate={{ y: `${-digit * 10}%` }}
|
|
52
50
|
transition={springTransition}
|
|
53
51
|
>
|
package/src/ui/search-input.tsx
CHANGED
|
@@ -7,7 +7,6 @@ import { useCn, useUiConfig } from "./ui-config";
|
|
|
7
7
|
const sizeClasses = {
|
|
8
8
|
sm: { input: "h-8 pl-8 text-base sm:pointer-fine:text-sm", icon: "left-2" },
|
|
9
9
|
md: { input: "h-10 pl-9", icon: "left-3" },
|
|
10
|
-
// Alias of `md`.
|
|
11
10
|
default: { input: "h-10 pl-9", icon: "left-3" },
|
|
12
11
|
};
|
|
13
12
|
|
|
@@ -29,28 +28,20 @@ type EnterKeyHint = React.InputHTMLAttributes<HTMLInputElement>["enterKeyHint"];
|
|
|
29
28
|
*/
|
|
30
29
|
export interface SearchInputConfig {
|
|
31
30
|
classes?: { wrapper?: string; input?: string; icon?: string };
|
|
32
|
-
/** Search icon size in px. Default `16`. */
|
|
33
31
|
iconSize?: number;
|
|
34
32
|
label?: string | false;
|
|
35
33
|
placeholder?: string;
|
|
36
34
|
clearLabel?: string;
|
|
37
35
|
enterKeyHint?: EnterKeyHint | false;
|
|
38
|
-
/** Element that receives `className`: `"input"` (default) or `"wrapper"`. */
|
|
39
36
|
classNameTarget?: "input" | "wrapper";
|
|
40
37
|
}
|
|
41
38
|
|
|
42
39
|
export interface SearchInputProps extends Omit<ClearInputProps, "leading" | "size"> {
|
|
43
|
-
/** `aria-label`, and the placeholder when `placeholder` is not set. Default `"Search"`. */
|
|
44
40
|
label?: string;
|
|
45
|
-
/** Key hint shown on the right while the value is empty, such as `"/"` or `"⌘K"`. */
|
|
46
41
|
shortcut?: string;
|
|
47
|
-
/** `sm` is `h-8`; `md` and its alias `default` are `h-10`. Default `"sm"`. */
|
|
48
42
|
size?: keyof typeof sizeClasses;
|
|
49
|
-
/** `toolbar`: transparent until hover or focus, fixed width from `sm`. Default `"default"`. */
|
|
50
43
|
variant?: keyof typeof variantClasses;
|
|
51
|
-
/** Called after `onChange` whenever the value becomes empty (typed away or cleared). */
|
|
52
44
|
onClear?: () => void;
|
|
53
|
-
/** Classes for the input, merged after `className` when that also targets the input. */
|
|
54
45
|
inputClassName?: string;
|
|
55
46
|
}
|
|
56
47
|
|
package/src/ui/select-field.tsx
CHANGED
|
@@ -4,23 +4,18 @@ import { Label } from "./label";
|
|
|
4
4
|
import { Select, SelectContent, SelectTrigger, SelectValue } from "./select";
|
|
5
5
|
|
|
6
6
|
export interface SelectFieldProps {
|
|
7
|
-
/** Merged onto the trigger. */
|
|
8
7
|
className?: string;
|
|
9
|
-
/** `SelectItem` elements. */
|
|
10
8
|
children?: React.ReactNode;
|
|
11
9
|
label?: React.ReactNode;
|
|
12
10
|
placeholder?: string;
|
|
13
|
-
/** An empty string shows the placeholder. */
|
|
14
11
|
value?: string;
|
|
15
12
|
onValueChange?: (value: string) => void;
|
|
16
13
|
disabled?: boolean;
|
|
17
14
|
name?: string;
|
|
18
|
-
/** Set on the trigger; the label points at it. */
|
|
19
15
|
id?: string;
|
|
20
16
|
"aria-label"?: string;
|
|
21
17
|
}
|
|
22
18
|
|
|
23
|
-
/** Labelled single select built from the `Select` primitives. */
|
|
24
19
|
function SelectField({
|
|
25
20
|
className,
|
|
26
21
|
children,
|
package/src/ui/select.tsx
CHANGED
|
@@ -11,31 +11,23 @@ import { useCn, useUiConfig } from "./ui-config";
|
|
|
11
11
|
|
|
12
12
|
/** App defaults for `Select*` (see `UiConfigProvider`). */
|
|
13
13
|
export interface SelectConfig {
|
|
14
|
-
/** Replaces the built-in classes of a part. */
|
|
15
14
|
classes?: {
|
|
16
15
|
trigger?: string;
|
|
17
|
-
/** Both scroll buttons. */
|
|
18
16
|
scrollButton?: string;
|
|
19
17
|
content?: string;
|
|
20
|
-
/** Viewport classes for every `position`. */
|
|
21
18
|
viewport?: string;
|
|
22
|
-
/** Extra viewport classes for `position="popper"`. */
|
|
23
19
|
popperViewport?: string;
|
|
24
20
|
label?: string;
|
|
25
21
|
item?: string;
|
|
26
22
|
separator?: string;
|
|
27
23
|
};
|
|
28
|
-
/** Replace the built-in icons. */
|
|
29
24
|
icons?: {
|
|
30
25
|
trigger?: React.ReactNode;
|
|
31
26
|
scrollUp?: React.ReactNode;
|
|
32
27
|
scrollDown?: React.ReactNode;
|
|
33
|
-
/** `SelectItem` indicator. */
|
|
34
28
|
check?: React.ReactNode;
|
|
35
29
|
};
|
|
36
|
-
/** Adds `data-slot="select-trigger"` to the trigger, for parent selectors such as `ButtonGroup`'s (built-in: `true`). */
|
|
37
30
|
triggerSlot?: boolean;
|
|
38
|
-
/** Default for `SelectContent` `collisionPadding` (built-in: `8`). */
|
|
39
31
|
collisionPadding?: number | Partial<Record<"top" | "right" | "bottom" | "left", number>>;
|
|
40
32
|
}
|
|
41
33
|
|
|
@@ -10,9 +10,6 @@ interface Segment {
|
|
|
10
10
|
|
|
11
11
|
type Shape = readonly [Segment, Segment, Segment];
|
|
12
12
|
|
|
13
|
-
// Both shapes use the same three lines, so the arrow's own strokes move into
|
|
14
|
-
// the queue bars instead of one icon fading out and another fading in.
|
|
15
|
-
// Arrow points match Tabler's `IconArrowUp` on its 24px grid.
|
|
16
13
|
const ARROW: Shape = [
|
|
17
14
|
{ x1: 6, y1: 11, x2: 12, y2: 5 },
|
|
18
15
|
{ x1: 12, y1: 5, x2: 12, y2: 19 },
|
package/src/ui/separator.tsx
CHANGED
|
@@ -3,7 +3,6 @@ import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
|
3
3
|
import { useCn, useUiConfig } from "./ui-config";
|
|
4
4
|
|
|
5
5
|
export interface SeparatorConfig {
|
|
6
|
-
/** Replaces the built-in classes of a part. `root` excludes the orientation size classes. */
|
|
7
6
|
classes?: { root?: string };
|
|
8
7
|
}
|
|
9
8
|
|
package/src/ui/sheet.tsx
CHANGED
|
@@ -11,8 +11,6 @@ import {
|
|
|
11
11
|
|
|
12
12
|
type SheetSide = "top" | "bottom" | "left" | "right";
|
|
13
13
|
|
|
14
|
-
// vaul animates and drags from the Root's `direction`; SheetContent reads it
|
|
15
|
-
// so `<Sheet direction="right">` places the panel on the right by default.
|
|
16
14
|
const SheetDirectionContext = React.createContext<SheetSide>("bottom");
|
|
17
15
|
|
|
18
16
|
function Sheet({
|
|
@@ -57,7 +55,6 @@ const SheetOverlay = React.forwardRef<
|
|
|
57
55
|
));
|
|
58
56
|
SheetOverlay.displayName = "SheetOverlay";
|
|
59
57
|
|
|
60
|
-
// Position and size. Stays on the element vaul moves.
|
|
61
58
|
const sheetSideLayoutClass: Record<SheetSide, string> = {
|
|
62
59
|
bottom:
|
|
63
60
|
"inset-x-0 bottom-[var(--overlay-vv-bottom,0px)] mt-24 flex max-h-[min(96dvh,calc(var(--overlay-vv-height,100dvh)-1.5rem))] h-auto flex-col",
|
|
@@ -66,7 +63,6 @@ const sheetSideLayoutClass: Record<SheetSide, string> = {
|
|
|
66
63
|
right: "inset-y-2 left-auto right-2 flex h-auto w-80 max-w-[88vw] flex-col",
|
|
67
64
|
};
|
|
68
65
|
|
|
69
|
-
// Corners and safe-area padding. Go on the visible surface.
|
|
70
66
|
const sheetSideSurfaceClass: Record<SheetSide, string> = {
|
|
71
67
|
bottom: "rounded-t-2xl pb-[max(0.75rem,env(safe-area-inset-bottom,0px))]",
|
|
72
68
|
top: "rounded-b-2xl pt-[max(0.75rem,env(safe-area-inset-top,0px))]",
|
|
@@ -74,29 +70,15 @@ const sheetSideSurfaceClass: Record<SheetSide, string> = {
|
|
|
74
70
|
right: "rounded-2xl",
|
|
75
71
|
};
|
|
76
72
|
|
|
77
|
-
// Without `motionBlur`, one element is both the moving part and the surface.
|
|
78
73
|
const sheetContentClass =
|
|
79
74
|
"fixed z-50 overflow-y-auto bg-overlay/95 text-overlay-foreground smooth-shadow-ring-xl outline-hidden backdrop-blur-xl motion-reduce:transition-none";
|
|
80
75
|
|
|
81
|
-
// With `motionBlur`, the element vaul moves has to stay transparent, because the
|
|
82
|
-
// blur is drawn into its first child. It also stops clipping (no overflow), so
|
|
83
|
-
// the streak and the surface shadow can reach past its edges. `after:hidden`
|
|
84
|
-
// drops vaul's `::after` fill: it inherits the now transparent background, and
|
|
85
|
-
// the old `overflow-y-auto` clipped it anyway.
|
|
86
76
|
const sheetBlurHostClass =
|
|
87
77
|
"fixed z-50 outline-hidden motion-reduce:transition-none after:hidden";
|
|
88
78
|
|
|
89
|
-
// The visible surface inside it. It fills the host and is the scroll container.
|
|
90
79
|
const sheetBlurSurfaceClass =
|
|
91
80
|
"flex min-h-0 flex-auto flex-col overflow-y-auto bg-overlay/95 text-overlay-foreground smooth-shadow-ring-xl backdrop-blur-xl";
|
|
92
81
|
|
|
93
|
-
/**
|
|
94
|
-
* `@web-kits/motion-blur` reads transforms with `DOMMatrix` and the computed
|
|
95
|
-
* `translate`, polls `getAnimations()` and checks `matchMedia`, and throws
|
|
96
|
-
* without them. jsdom, happy-dom and browsers without the individual transform
|
|
97
|
-
* properties lack some of these, so the blur stays off there and the sheet
|
|
98
|
-
* still renders.
|
|
99
|
-
*/
|
|
100
82
|
function supportsMotionBlur(node: HTMLElement): boolean {
|
|
101
83
|
return (
|
|
102
84
|
typeof DOMMatrix === "function" &&
|
|
@@ -108,11 +90,6 @@ function supportsMotionBlur(node: HTMLElement): boolean {
|
|
|
108
90
|
|
|
109
91
|
const syncedEchoCopies = new WeakSet<Element>();
|
|
110
92
|
|
|
111
|
-
/**
|
|
112
|
-
* Echo draws copies of the surface next to it, and a fresh copy starts at
|
|
113
|
-
* scroll 0. Give each copy the surface's scroll once, so a scrolled sheet does
|
|
114
|
-
* not flash its top while it closes.
|
|
115
|
-
*/
|
|
116
93
|
function syncEchoScroll(host: HTMLElement): void {
|
|
117
94
|
const surface = host.firstElementChild;
|
|
118
95
|
if (!(surface instanceof HTMLElement)) return;
|
|
@@ -127,22 +104,8 @@ function syncEchoScroll(host: HTMLElement): void {
|
|
|
127
104
|
const SheetContent = React.forwardRef<
|
|
128
105
|
React.ComponentRef<typeof DrawerPrimitive.Content>,
|
|
129
106
|
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content> & {
|
|
130
|
-
/** Defaults to the parent Sheet's `direction`. */
|
|
131
107
|
side?: SheetSide;
|
|
132
|
-
/**
|
|
133
|
-
* Blur the sheet while it slides in, out or is dragged, with
|
|
134
|
-
* `@web-kits/motion-blur` (Echo, 180° shutter). Off under
|
|
135
|
-
* `prefers-reduced-motion`. When `true`, the content element moves and
|
|
136
|
-
* stays transparent, and an inner `data-slot="sheet-surface"` div holds the
|
|
137
|
-
* fill, shadow, corners and scroll. `className` then styles the moving
|
|
138
|
-
* element only (size, position); use `surfaceClassName` for the surface.
|
|
139
|
-
* Default `false`.
|
|
140
|
-
*/
|
|
141
108
|
motionBlur?: boolean;
|
|
142
|
-
/**
|
|
143
|
-
* Classes for the visible surface: the inner div when `motionBlur` is on,
|
|
144
|
-
* otherwise the content element itself (after `className`).
|
|
145
|
-
*/
|
|
146
109
|
surfaceClassName?: string;
|
|
147
110
|
}
|
|
148
111
|
>(({ className, children, side: sideProp, motionBlur = false, surfaceClassName, ...props }, ref) => {
|
|
@@ -155,7 +118,6 @@ const SheetContent = React.forwardRef<
|
|
|
155
118
|
const onBlurFrame = React.useCallback(() => {
|
|
156
119
|
if (hostRef.current) syncEchoScroll(hostRef.current);
|
|
157
120
|
}, []);
|
|
158
|
-
// Called on every render (hook rules); it does nothing until its ref is set.
|
|
159
121
|
const { ref: attachMotionBlur } = useMotionBlur({ onFrame: onBlurFrame });
|
|
160
122
|
|
|
161
123
|
const detachMotionBlur = React.useCallback(() => {
|
|
@@ -202,8 +164,6 @@ const SheetContent = React.forwardRef<
|
|
|
202
164
|
};
|
|
203
165
|
}, [detachMotionBlur]);
|
|
204
166
|
|
|
205
|
-
// vaul may keep the same content node when only `motionBlur` flips, so the
|
|
206
|
-
// callback ref above does not always re-run. Sync attach/detach here.
|
|
207
167
|
React.useLayoutEffect(() => {
|
|
208
168
|
const node = hostRef.current;
|
|
209
169
|
if (!node) return;
|
|
@@ -294,8 +254,6 @@ export {
|
|
|
294
254
|
SheetFooter,
|
|
295
255
|
};
|
|
296
256
|
|
|
297
|
-
// The same parts under vaul's name, for apps that call the sliding panel a
|
|
298
|
-
// drawer. One implementation, so `DrawerContent` takes `motionBlur` too.
|
|
299
257
|
export {
|
|
300
258
|
Sheet as Drawer,
|
|
301
259
|
SheetPortal as DrawerPortal,
|