@vvedantb/ui 0.67.0 → 0.69.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/src/auth/useStableAuth.ts +0 -2
- package/app/src/confirm/ConfirmSkipHint.tsx +0 -2
- package/app/src/confirm/useAltHeld.ts +0 -17
- package/app/src/convex/ConvexClerkProvider.tsx +0 -3
- package/app/src/convex/env.ts +0 -4
- package/app/src/convex/errorMessage.ts +0 -1
- package/app/src/convex/useHeldResult.ts +0 -3
- package/app/src/page-motion/PageMotionProvider.tsx +0 -6
- package/app/src/page-title/createPageTitleContext.tsx +0 -14
- package/app/src/settings/SettingsEmptyState.tsx +0 -4
- package/app/src/settings/SettingsField.tsx +0 -4
- package/app/src/settings/SettingsPage.tsx +0 -12
- package/app/src/settings/SettingsSection.tsx +0 -14
- package/app/src/settings/ThemeModePicker.tsx +0 -6
- package/app/src/theme/createThemeProvider.tsx +0 -33
- package/app/src/time/compactRelativeTime.ts +0 -16
- package/app/src/update/staleDeployReload.ts +0 -40
- package/app/src/update/updateWatcher.ts +0 -8
- package/dist/app/src/auth/useStableAuth.js +0 -1
- package/dist/app/src/confirm/ConfirmSkipHint.js +0 -3
- package/dist/app/src/confirm/useAltHeld.js +0 -17
- package/dist/app/src/convex/env.js +0 -3
- package/dist/app/src/convex/errorMessage.js +0 -2
- package/dist/app/src/settings/ThemeModePicker.js +0 -1
- package/dist/app/src/theme/createThemeProvider.js +1 -11
- package/dist/app/src/time/compactRelativeTime.js +0 -8
- package/dist/app/src/update/staleDeployReload.js +3 -38
- package/dist/app/src/update/updateWatcher.js +1 -3
- package/dist/shell/src/AppShell.js +0 -14
- package/dist/shell/src/PageHeaderBar.js +0 -3
- package/dist/shell/src/SessionsHoverCard.js +0 -9
- package/dist/shell/src/SidePanelTabs.js +0 -36
- package/dist/shell/src/Sidebar.js +0 -1
- package/dist/shell/src/SidebarChrome.js +0 -19
- package/dist/shell/src/SidebarIconTooltip.js +0 -1
- package/dist/shell/src/SidebarRail.js +0 -12
- package/dist/shell/src/SidebarResize.js +1 -4
- package/dist/shell/src/app-shell-classes.js +0 -10
- package/dist/shell/src/index.js +0 -1
- package/dist/shell/src/shell-panel-motion.js +0 -12
- package/dist/src/ai-elements/activity-shared.js +0 -6
- package/dist/src/ai-elements/activity-step-label.js +0 -6
- package/dist/src/ai-elements/activity-step-types.js +0 -4
- package/dist/src/ai-elements/activity-tasks-utils.js +0 -17
- package/dist/src/ai-elements/activity-tasks.js +0 -55
- package/dist/src/ai-elements/artifact.js +0 -4
- package/dist/src/ai-elements/attachments.js +0 -41
- package/dist/src/ai-elements/code-block.js +0 -18
- package/dist/src/ai-elements/collapsible-user-message-body.js +0 -2
- package/dist/src/ai-elements/context.js +0 -13
- package/dist/src/ai-elements/conversation.js +0 -4
- package/dist/src/ai-elements/jump-rail.js +0 -5
- package/dist/src/ai-elements/message.js +0 -7
- package/dist/src/ai-elements/model-picker-types.js +0 -1
- package/dist/src/ai-elements/model-picker.js +1 -6
- package/dist/src/ai-elements/model-selector.js +0 -4
- package/dist/src/ai-elements/prompt-input-speech.js +0 -13
- package/dist/src/ai-elements/prompt-input.js +0 -1
- package/dist/src/ai-elements/provider-icon.js +0 -4
- package/dist/src/ai-elements/queue.js +0 -15
- package/dist/src/ai-elements/shimmer.js +0 -14
- package/dist/src/ai-elements/speech-input.js +0 -7
- package/dist/src/artifacts/artifact-frame.js +0 -2
- package/dist/src/audio/playChime.js +0 -2
- package/dist/src/audio/playTone.js +1 -4
- package/dist/src/brand/AppWordmark.js +0 -5
- package/dist/src/brand/svg.js +0 -6
- package/dist/src/client.js +0 -43
- package/dist/src/composer/Composer.js +0 -27
- package/dist/src/composer/input-area/InputArea.js +0 -3
- package/dist/src/composer/input-area/InputAreaEditor.js +1 -50
- package/dist/src/composer/input-area/composerPrediction.js +0 -3
- package/dist/src/generative-ui/content.js +0 -2
- package/dist/src/generative-ui/index.js +0 -3
- package/dist/src/generative-ui/layout.js +0 -5
- package/dist/src/hooks/use-count-up-display.js +0 -2
- package/dist/src/hooks/use-idle-callback.js +0 -3
- package/dist/src/hooks/use-persisted-scroll-parent.js +1 -8
- package/dist/src/icons/animated/index.js +0 -4
- package/dist/src/icons/board-icon.js +74 -41
- package/dist/src/icons/bolt-icon.js +30 -20
- package/dist/src/icons/building-icon.js +125 -61
- package/dist/src/icons/files-icon.js +103 -43
- package/dist/src/icons/inbox-icon.js +101 -49
- package/dist/src/icons/index.js +2 -1
- package/dist/src/icons/memory-icon.js +135 -58
- package/dist/src/icons/search-icon.js +143 -46
- package/dist/src/icons/settings-icon.js +113 -53
- package/dist/src/icons/solid-icons.js +665 -0
- package/dist/src/icons/with-active.js +25 -0
- package/dist/src/index.js +0 -40
- package/dist/src/kibo/gantt-features.js +0 -10
- package/dist/src/kibo/gantt-provider.js +0 -34
- package/dist/src/kibo/kanban.js +0 -15
- package/dist/src/kibo/list.js +0 -3
- package/dist/src/kibo/video-player.js +0 -7
- package/dist/src/logos/index.js +0 -4
- package/dist/src/markdown/Markdown.js +0 -15
- package/dist/src/markdown/MarkdownCodeBlock.js +0 -16
- package/dist/src/markdown/MarkdownInlineCode.js +0 -6
- package/dist/src/markdown/MarkdownLink.js +0 -5
- package/dist/src/markdown/codeFence.js +0 -1
- package/dist/src/markdown/codeHighlight.js +0 -19
- package/dist/src/markdown/incrementalBlocks.js +0 -45
- package/dist/src/markdown/markdownClipboard.js +0 -13
- package/dist/src/markdown/mermaid.js +0 -25
- package/dist/src/markdown/rehypeGithubAlerts.js +0 -4
- package/dist/src/markdown/useSmoothText.js +0 -5
- package/dist/src/marketing/PricingModal.js +0 -2
- package/dist/src/marketing/ProductHero.js +0 -2
- package/dist/src/marketing/createLandingKit.js +0 -5
- package/dist/src/marketing/marketing-classes.js +0 -7
- package/dist/src/motion/dock-motion.js +0 -27
- package/dist/src/motion/panel-transition.js +0 -2
- package/dist/src/ui/_field-classes.js +0 -3
- package/dist/src/ui/_menu-classes.js +0 -6
- package/dist/src/ui/_picker-classes.js +0 -9
- package/dist/src/ui/accordion.alt.js +0 -12
- package/dist/src/ui/badge.js +0 -1
- package/dist/src/ui/border-beam.js +0 -2
- package/dist/src/ui/breadcrumb.js +0 -15
- package/dist/src/ui/bulk-action-bar.js +0 -11
- package/dist/src/ui/button.js +0 -20
- package/dist/src/ui/calendar.js +1 -20
- package/dist/src/ui/card.js +0 -3
- package/dist/src/ui/carousel.js +0 -1
- package/dist/src/ui/clear-input.alt.js +0 -9
- package/dist/src/ui/clearInputDissolve.js +0 -4
- package/dist/src/ui/command.js +0 -15
- package/dist/src/ui/confetti-burst.js +0 -3
- package/dist/src/ui/confirm-dialog-parts.js +0 -11
- package/dist/src/ui/confirm-dialog.js +0 -6
- package/dist/src/ui/crossfade-icon.js +0 -2
- package/dist/src/ui/date-picker.js +0 -22
- package/dist/src/ui/dialog.js +0 -5
- package/dist/src/ui/empty-state.js +0 -7
- package/dist/src/ui/field.js +0 -21
- package/dist/src/ui/image-lightbox.js +0 -5
- package/dist/src/ui/input-group.alt.js +0 -24
- package/dist/src/ui/input-group.js +0 -4
- package/dist/src/ui/kbd.js +0 -3
- package/dist/src/ui/loading-state.js +0 -17
- package/dist/src/ui/marquee-on-hover.js +0 -3
- package/dist/src/ui/media-preview.js +0 -2
- package/dist/src/ui/modalTransition.js +0 -33
- package/dist/src/ui/overlay-a11y.js +0 -1
- package/dist/src/ui/page-title.js +0 -3
- package/dist/src/ui/refresh-spin-icon.js +0 -12
- package/dist/src/ui/search-input.js +0 -1
- package/dist/src/ui/select-field.js +0 -1
- package/dist/src/ui/send-queue-icon.js +0 -3
- package/dist/src/ui/sheet.js +0 -33
- package/dist/src/ui/slider.js +103 -82
- package/dist/src/ui/sonner-icons.js +0 -5
- package/dist/src/ui/sonner.js +0 -60
- package/dist/src/ui/spinner.js +0 -35
- package/dist/src/ui/status-dot.js +0 -2
- package/dist/src/ui/surface.js +0 -14
- package/dist/src/ui/switch.js +213 -36
- package/dist/src/ui/table.js +0 -1
- package/dist/src/ui/tabs-transition.js +0 -1
- package/dist/src/ui/tabs.js +0 -17
- package/dist/src/ui/tabsSliding.js +0 -6
- package/dist/src/ui/time-picker.js +0 -15
- package/dist/src/ui/toggle-search.js +0 -3
- package/dist/src/ui/ui-config.js +0 -16
- package/dist/src/utils/cat-color.js +0 -17
- package/dist/src/utils/cn.js +0 -5
- package/dist/src/utils/gesture.js +0 -8
- package/dist/src/utils/ref.js +0 -1
- package/dist/src/utils/runtimeVisibility.js +1 -22
- package/dist/src/utils/surface-radius.js +0 -11
- package/dist/src/utils/useDragSensors.js +0 -4
- package/dist/tokens/src/tailwind-preset.mjs +0 -3
- package/package.json +1 -1
- package/scripts/build-brand-assets.mjs +0 -8
- package/shell/src/AppShell.tsx +0 -37
- package/shell/src/AppSidebar.tsx +0 -14
- package/shell/src/ButtonTrack.tsx +0 -1
- package/shell/src/PageHeaderBar.tsx +0 -61
- package/shell/src/PageWrapper.tsx +0 -26
- package/shell/src/PillTabs.tsx +0 -1
- package/shell/src/SessionsHoverCard.tsx +0 -40
- package/shell/src/SidePanelTabs.tsx +0 -61
- package/shell/src/Sidebar.tsx +0 -1
- package/shell/src/SidebarAccountMenu.tsx +0 -40
- package/shell/src/SidebarChrome.tsx +0 -32
- package/shell/src/SidebarIconTooltip.tsx +0 -3
- package/shell/src/SidebarPanel.tsx +0 -20
- package/shell/src/SidebarRail.tsx +0 -44
- package/shell/src/SidebarResize.tsx +0 -6
- package/shell/src/SidebarUpgradeCard.tsx +0 -2
- package/shell/src/SignOutDialog.tsx +0 -6
- package/shell/src/app-shell-classes.ts +0 -15
- package/shell/src/index.ts +0 -1
- package/shell/src/shell-panel-motion.ts +0 -11
- package/shell/src/shell-variant.ts +0 -6
- package/src/ai-elements/activity-question.tsx +0 -2
- package/src/ai-elements/activity-shared.tsx +0 -11
- package/src/ai-elements/activity-step-detail.tsx +0 -2
- package/src/ai-elements/activity-step-label.ts +0 -5
- package/src/ai-elements/activity-step-types.ts +0 -24
- package/src/ai-elements/activity-tasks-utils.ts +0 -13
- package/src/ai-elements/activity-tasks.tsx +0 -61
- package/src/ai-elements/artifact.tsx +0 -7
- package/src/ai-elements/attachments.tsx +0 -33
- package/src/ai-elements/chat-day-divider.tsx +0 -3
- package/src/ai-elements/chat-jump-rail.tsx +0 -9
- package/src/ai-elements/code-block.tsx +0 -28
- package/src/ai-elements/collapsible-user-message-body.tsx +0 -2
- package/src/ai-elements/context.tsx +0 -10
- package/src/ai-elements/conversation.tsx +0 -16
- package/src/ai-elements/jump-rail.tsx +0 -31
- package/src/ai-elements/message.tsx +0 -32
- package/src/ai-elements/model-picker-content.tsx +0 -17
- package/src/ai-elements/model-picker-types.ts +0 -5
- package/src/ai-elements/model-picker.tsx +0 -36
- package/src/ai-elements/model-selector.tsx +0 -5
- package/src/ai-elements/prompt-input-speech.tsx +0 -11
- package/src/ai-elements/prompt-input.tsx +0 -26
- package/src/ai-elements/provider-icon.tsx +0 -2
- package/src/ai-elements/queue.tsx +0 -19
- package/src/ai-elements/reasoning.tsx +0 -4
- package/src/ai-elements/shimmer.tsx +0 -16
- package/src/ai-elements/simple-model-ladder.tsx +0 -1
- package/src/ai-elements/speech-input.tsx +0 -6
- package/src/ai-elements/test-results.tsx +0 -5
- package/src/ai-elements/trace.tsx +0 -2
- package/src/ai-elements/web-preview.tsx +0 -7
- package/src/artifacts/artifact-card.tsx +0 -7
- package/src/artifacts/artifact-dialogs.tsx +0 -4
- package/src/artifacts/artifact-frame.tsx +0 -10
- package/src/artifacts/artifact-list-toolbar.tsx +0 -6
- package/src/artifacts/artifact-list.tsx +0 -4
- package/src/artifacts/artifact-type-icon.tsx +0 -1
- package/src/artifacts/artifact-versions-menu.tsx +0 -3
- package/src/artifacts/artifact-viewer.tsx +0 -5
- package/src/artifacts/types.ts +0 -1
- package/src/audio/playChime.ts +0 -1
- package/src/audio/playTone.ts +0 -7
- package/src/brand/AppIcons.tsx +0 -5
- package/src/brand/AppMark.tsx +0 -6
- package/src/brand/AppWordmark.tsx +0 -10
- package/src/brand/familyApps.ts +0 -2
- package/src/brand/svg.ts +0 -9
- package/src/client.ts +0 -34
- package/src/composer/Composer.tsx +0 -70
- package/src/composer/input-area/ComposerSlashMenu.tsx +0 -1
- package/src/composer/input-area/ConnectionStatusMenuItem.tsx +0 -2
- package/src/composer/input-area/FadePresence.tsx +0 -4
- package/src/composer/input-area/InputActions.tsx +0 -5
- package/src/composer/input-area/InputArea.tsx +1 -28
- package/src/composer/input-area/InputAreaEditor.tsx +0 -39
- package/src/composer/input-area/InputBanners.tsx +0 -1
- package/src/composer/input-area/PromoBanner.tsx +0 -1
- package/src/composer/input-area/composerPrediction.ts +0 -2
- package/src/composer/input-area/useComposerSlashMenu.ts +0 -1
- package/src/composer/input-area/useInputAreaPrediction.ts +0 -1
- package/src/composer/prediction.ts +0 -6
- package/src/composer/useComposerPrediction.ts +0 -2
- package/src/generative-ui/GenerativeUiPanel.tsx +0 -11
- package/src/generative-ui/content.tsx +0 -2
- package/src/generative-ui/index.ts +0 -3
- package/src/generative-ui/layout.tsx +0 -5
- package/src/hooks/use-count-up-display.ts +0 -1
- package/src/hooks/use-idle-callback.ts +0 -5
- package/src/hooks/use-persisted-scroll-parent.ts +0 -4
- package/src/hooks/use-single-flight.ts +0 -5
- package/src/icons/animated/animated-bell-icon.tsx +0 -6
- package/src/icons/animated/animated-counter.tsx +0 -5
- package/src/icons/animated/animated-key-icon.tsx +0 -4
- package/src/icons/animated/animated-notification-icon.tsx +0 -14
- package/src/icons/animated/animated-progress.tsx +0 -10
- package/src/icons/animated/animated-status-dot.tsx +0 -4
- package/src/icons/animated/index.ts +0 -4
- package/src/icons/animated/morphing-menu-icon.tsx +0 -5
- package/src/icons/animated/morphing-mic-icon.tsx +0 -2
- package/src/icons/animated/pulsing-rings.tsx +0 -4
- package/src/icons/automation-icon.tsx +0 -1
- package/src/icons/board-icon.tsx +13 -10
- package/src/icons/bolt-icon.tsx +5 -4
- package/src/icons/building-icon.tsx +11 -9
- package/src/icons/draft-icon.tsx +0 -1
- package/src/icons/files-icon.tsx +9 -5
- package/src/icons/inbox-arrow-icon.tsx +0 -1
- package/src/icons/inbox-icon.tsx +9 -5
- package/src/icons/index.ts +12 -1
- package/src/icons/memory-icon.tsx +9 -11
- package/src/icons/nav-icon-base.tsx +0 -10
- package/src/icons/search-icon.tsx +7 -6
- package/src/icons/settings-icon.tsx +11 -13
- package/src/icons/sidebar-toggle-icon.tsx +0 -1
- package/src/icons/solid-icons.tsx +138 -0
- package/src/icons/with-active.tsx +14 -0
- package/src/index.ts +0 -30
- package/src/kibo/gantt-features.tsx +0 -16
- package/src/kibo/gantt-header.tsx +0 -4
- package/src/kibo/gantt-provider.tsx +0 -36
- package/src/kibo/gantt-sidebar.tsx +0 -7
- package/src/kibo/gantt-timeline.tsx +0 -4
- package/src/kibo/kanban.tsx +0 -49
- package/src/kibo/list.tsx +0 -8
- package/src/kibo/theme-switcher.tsx +0 -5
- package/src/kibo/video-player.tsx +0 -9
- package/src/logos/index.ts +0 -3
- package/src/logos/logo-svg.tsx +0 -5
- package/src/markdown/Markdown.tsx +0 -20
- package/src/markdown/MarkdownCodeBlock.tsx +0 -14
- package/src/markdown/MarkdownInlineCode.tsx +0 -6
- package/src/markdown/MarkdownLink.tsx +0 -4
- package/src/markdown/codeFence.ts +0 -3
- package/src/markdown/codeHighlight.ts +0 -16
- package/src/markdown/incrementalBlocks.ts +0 -49
- package/src/markdown/markdownClipboard.ts +0 -12
- package/src/markdown/mermaid.ts +0 -22
- package/src/markdown/rehypeGithubAlerts.ts +0 -3
- package/src/markdown/useSmoothText.ts +0 -5
- package/src/marketing/FloatingBar.tsx +0 -3
- package/src/marketing/PricingModal.tsx +0 -45
- package/src/marketing/ProductHero.tsx +0 -23
- package/src/marketing/ProductHeroOrbit.tsx +0 -5
- package/src/marketing/SiteFooter.tsx +0 -23
- package/src/marketing/SiteHeader.tsx +0 -14
- package/src/marketing/VProPricingModal.tsx +0 -5
- package/src/marketing/createLandingKit.tsx +0 -12
- package/src/marketing/landing.tsx +0 -12
- package/src/marketing/marketing-classes.ts +0 -7
- package/src/motion/dock-motion.ts +0 -25
- package/src/motion/list-enter.tsx +0 -4
- package/src/motion/panel-transition.tsx +0 -5
- package/src/ui/_field-classes.ts +0 -2
- package/src/ui/_menu-classes.ts +0 -4
- package/src/ui/_menu-parts.tsx +0 -5
- package/src/ui/_picker-classes.ts +0 -6
- package/src/ui/accordion.alt.tsx +0 -8
- package/src/ui/accordion.tsx +0 -4
- package/src/ui/badge.tsx +0 -1
- package/src/ui/border-beam.tsx +0 -11
- package/src/ui/breadcrumb.tsx +0 -13
- package/src/ui/bulk-action-bar.tsx +0 -24
- package/src/ui/button.tsx +0 -27
- package/src/ui/calendar.tsx +0 -18
- package/src/ui/card.tsx +0 -3
- package/src/ui/carousel.tsx +0 -4
- package/src/ui/checkbox.tsx +0 -1
- package/src/ui/clear-input.alt.tsx +0 -8
- package/src/ui/clear-input.tsx +0 -16
- package/src/ui/clearInputDissolve.ts +0 -4
- package/src/ui/command.tsx +0 -22
- package/src/ui/confetti-burst.tsx +0 -4
- package/src/ui/confirm-dialog-parts.tsx +0 -45
- package/src/ui/confirm-dialog.tsx +0 -26
- package/src/ui/context-menu.tsx +0 -10
- package/src/ui/count-pop.tsx +0 -2
- package/src/ui/crossfade-icon.tsx +0 -3
- package/src/ui/date-picker.tsx +0 -40
- package/src/ui/dialog.tsx +0 -18
- package/src/ui/dropdown-menu.tsx +0 -11
- package/src/ui/empty-state.tsx +0 -15
- package/src/ui/error-boundary.tsx +0 -7
- package/src/ui/field.tsx +0 -18
- package/src/ui/hover-card.tsx +0 -6
- package/src/ui/image-lightbox.tsx +0 -7
- package/src/ui/input-group.alt.tsx +0 -16
- package/src/ui/input-group.tsx +0 -3
- package/src/ui/kbd.tsx +0 -3
- package/src/ui/label.tsx +0 -1
- package/src/ui/labeled-slider-row.tsx +0 -2
- package/src/ui/list-row.tsx +0 -46
- package/src/ui/loading-state.tsx +0 -23
- package/src/ui/marquee-on-hover.tsx +1 -6
- package/src/ui/media-preview.tsx +0 -5
- package/src/ui/modalTransition.ts +0 -25
- package/src/ui/overlay-a11y.ts +0 -1
- package/src/ui/page-title.tsx +0 -4
- package/src/ui/popover.tsx +0 -8
- package/src/ui/progress.tsx +0 -1
- package/src/ui/refresh-spin-icon.tsx +0 -11
- package/src/ui/relative-date-time.tsx +0 -3
- package/src/ui/rolling-number.tsx +0 -2
- package/src/ui/search-input.tsx +0 -9
- package/src/ui/select-field.tsx +0 -5
- package/src/ui/select.tsx +0 -8
- package/src/ui/send-queue-icon.tsx +0 -3
- package/src/ui/separator.tsx +0 -1
- package/src/ui/sheet.tsx +0 -42
- package/src/ui/slide-over-panel.tsx +0 -2
- package/src/ui/slider.tsx +21 -9
- package/src/ui/sonner-icons.tsx +0 -4
- package/src/ui/sonner.tsx +0 -78
- package/src/ui/spinner.tsx +0 -50
- package/src/ui/status-dot.tsx +0 -10
- package/src/ui/surface.tsx +0 -13
- package/src/ui/switch.tsx +72 -3
- package/src/ui/table.tsx +0 -3
- package/src/ui/tabs-transition.tsx +0 -12
- package/src/ui/tabs.tsx +0 -17
- package/src/ui/tabsSliding.ts +0 -5
- package/src/ui/time-picker.tsx +0 -17
- package/src/ui/toggle-search.tsx +0 -6
- package/src/ui/toolbar-search-input.tsx +0 -3
- package/src/ui/tooltip.tsx +0 -5
- package/src/ui/ui-config.tsx +0 -19
- package/src/utils/cat-color.ts +0 -20
- package/src/utils/cn.ts +0 -4
- package/src/utils/gesture.ts +0 -8
- package/src/utils/ref.ts +0 -1
- package/src/utils/runtimeVisibility.ts +0 -19
- package/src/utils/surface-radius.ts +0 -11
- package/src/utils/useDragSensors.ts +0 -2
- package/tokens/examples/compat-shadcn-rgb/vite.config.ts +0 -2
- package/tokens/examples/toaster/Fixture.tsx +0 -4
- package/tokens/examples/toaster/UpdateToastFixture.tsx +0 -4
- package/tokens/examples/toaster/vite.config.ts +0 -2
- package/tokens/examples/tokens-moved/Fixture.tsx +0 -4
- package/tokens/examples/tokens-moved/vite.config.ts +0 -2
- package/tokens/src/tailwind-preset.mjs +0 -3
|
@@ -2,14 +2,7 @@ import { Component, type ErrorInfo, type ReactNode } from "react";
|
|
|
2
2
|
|
|
3
3
|
export interface ErrorBoundaryProps {
|
|
4
4
|
children: ReactNode;
|
|
5
|
-
/**
|
|
6
|
-
* Rendered when a child throws (a failed query, a render bug). Pass a
|
|
7
|
-
* function to get a `retry` that clears the error and re-renders the
|
|
8
|
-
* children: a boundary with no way out stays broken until its parent
|
|
9
|
-
* remounts, which for a persistent pane means a full page reload.
|
|
10
|
-
*/
|
|
11
5
|
fallback?: ReactNode | ((retry: () => void) => ReactNode);
|
|
12
|
-
/** Called with the error. Default: `console.error` with the component stack. */
|
|
13
6
|
onError?: (error: Error, info: ErrorInfo) => void;
|
|
14
7
|
}
|
|
15
8
|
|
package/src/ui/field.tsx
CHANGED
|
@@ -22,18 +22,9 @@ function useField(part: string): FieldContextValue {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export interface FieldProps extends React.ComponentPropsWithoutRef<"div"> {
|
|
25
|
-
/** The `id` of the control, which `FieldLabel` points at with `htmlFor`. Default: a generated id. */
|
|
26
25
|
controlId?: string;
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
/**
|
|
30
|
-
* Stack for one labelled control. It generates the control `id` and the ids of
|
|
31
|
-
* the description and error, so `FieldLabel` (`htmlFor`) and `FieldControl`
|
|
32
|
-
* (`id`, `aria-describedby`) link up without any manual wiring.
|
|
33
|
-
*
|
|
34
|
-
* A plain `<Input />` does not need it. Use it when a field has a label, a
|
|
35
|
-
* hint or an error message.
|
|
36
|
-
*/
|
|
37
28
|
const Field = React.forwardRef<HTMLDivElement, FieldProps>(
|
|
38
29
|
({ className, controlId, ...props }, ref) => {
|
|
39
30
|
const merge = useCn();
|
|
@@ -62,7 +53,6 @@ const Field = React.forwardRef<HTMLDivElement, FieldProps>(
|
|
|
62
53
|
);
|
|
63
54
|
Field.displayName = "Field";
|
|
64
55
|
|
|
65
|
-
/** `Label` with `htmlFor` set to the control id of the nearest `Field`. */
|
|
66
56
|
const FieldLabel = React.forwardRef<
|
|
67
57
|
React.ComponentRef<typeof Label>,
|
|
68
58
|
React.ComponentPropsWithoutRef<typeof Label>
|
|
@@ -72,12 +62,6 @@ const FieldLabel = React.forwardRef<
|
|
|
72
62
|
});
|
|
73
63
|
FieldLabel.displayName = "FieldLabel";
|
|
74
64
|
|
|
75
|
-
/**
|
|
76
|
-
* `Input` with the `id` of the nearest `Field`. `aria-describedby` lists the
|
|
77
|
-
* description and error ids that are rendered, and nothing when there are none.
|
|
78
|
-
* `aria-invalid` is set while a `FieldError` is rendered. Both merge with props
|
|
79
|
-
* you pass.
|
|
80
|
-
*/
|
|
81
65
|
const FieldControl = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
|
|
82
66
|
({ "aria-describedby": describedBy, "aria-invalid": invalid, ...props }, ref) => {
|
|
83
67
|
const field = useField("FieldControl");
|
|
@@ -108,7 +92,6 @@ function useRegister(set: (present: boolean) => void) {
|
|
|
108
92
|
}, [set]);
|
|
109
93
|
}
|
|
110
94
|
|
|
111
|
-
/** Muted hint under the control. Its id joins the control's `aria-describedby`. */
|
|
112
95
|
const FieldDescription = React.forwardRef<HTMLParagraphElement, React.ComponentPropsWithoutRef<"p">>(
|
|
113
96
|
({ className, ...props }, ref) => {
|
|
114
97
|
const field = useField("FieldDescription");
|
|
@@ -126,7 +109,6 @@ const FieldDescription = React.forwardRef<HTMLParagraphElement, React.ComponentP
|
|
|
126
109
|
);
|
|
127
110
|
FieldDescription.displayName = "FieldDescription";
|
|
128
111
|
|
|
129
|
-
/** Error message under the control. Its id joins the control's `aria-describedby`, and the control becomes `aria-invalid`. */
|
|
130
112
|
const FieldError = React.forwardRef<HTMLParagraphElement, React.ComponentPropsWithoutRef<"p">>(
|
|
131
113
|
({ className, ...props }, ref) => {
|
|
132
114
|
const field = useField("FieldError");
|
package/src/ui/hover-card.tsx
CHANGED
|
@@ -8,15 +8,10 @@ import { useCn, useUiConfig } from "./ui-config";
|
|
|
8
8
|
|
|
9
9
|
/** App defaults for `HoverCard*` (see `UiConfigProvider`). */
|
|
10
10
|
export interface HoverCardConfig {
|
|
11
|
-
/** Replaces the built-in classes of a part. */
|
|
12
11
|
classes?: { content?: string };
|
|
13
|
-
/** Default for `HoverCard` `openDelay` (Radix: 700ms). */
|
|
14
12
|
openDelay?: number;
|
|
15
|
-
/** Default for `HoverCard` `closeDelay` (Radix: 300ms). */
|
|
16
13
|
closeDelay?: number;
|
|
17
|
-
/** Default for `HoverCardContent` `sideOffset`. */
|
|
18
14
|
sideOffset?: number;
|
|
19
|
-
/** Default for `HoverCardContent` `portal` (built-in: `true`). */
|
|
20
15
|
portal?: boolean;
|
|
21
16
|
}
|
|
22
17
|
|
|
@@ -40,7 +35,6 @@ const HoverCardTrigger = HoverCardPrimitive.Trigger;
|
|
|
40
35
|
const HoverCardContent = React.forwardRef<
|
|
41
36
|
React.ComponentRef<typeof HoverCardPrimitive.Content>,
|
|
42
37
|
React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Content> & {
|
|
43
|
-
/** Render into `document.body` so a clipping parent cannot cut it off (default `true`). */
|
|
44
38
|
portal?: boolean;
|
|
45
39
|
}
|
|
46
40
|
>(({ className, align = "center", sideOffset, portal, ...props }, ref) => {
|
|
@@ -10,11 +10,6 @@ import { Dialog, DialogContent, DialogTitle } from "./dialog";
|
|
|
10
10
|
|
|
11
11
|
export type GalleryImage = { url: string; alt?: string };
|
|
12
12
|
|
|
13
|
-
/**
|
|
14
|
-
* Controls (arrows, "open in new tab") opt out of the swipe surface: taking
|
|
15
|
-
* pointer capture on the container retargets the resulting `click` to the
|
|
16
|
-
* container, so a captured drag would swallow every button press.
|
|
17
|
-
*/
|
|
18
13
|
const CONTROL_SELECTOR = "[data-lightbox-control]";
|
|
19
14
|
|
|
20
15
|
/**
|
|
@@ -30,7 +25,6 @@ export function ImageLightbox({
|
|
|
30
25
|
onClose,
|
|
31
26
|
}: {
|
|
32
27
|
images: GalleryImage[];
|
|
33
|
-
/** `null` while closed. */
|
|
34
28
|
index: number | null;
|
|
35
29
|
onIndexChange: (next: number) => void;
|
|
36
30
|
onClose: () => void;
|
|
@@ -43,7 +37,6 @@ export function ImageLightbox({
|
|
|
43
37
|
const count = images.length;
|
|
44
38
|
const current = index === null ? null : images[index];
|
|
45
39
|
|
|
46
|
-
// Wrap-around so the user can circle through the set in either direction.
|
|
47
40
|
const step = (delta: number) => {
|
|
48
41
|
if (index === null || count === 0) return;
|
|
49
42
|
onIndexChange((index + delta + count) % count);
|
|
@@ -10,15 +10,6 @@ import {
|
|
|
10
10
|
InputGroupTextarea,
|
|
11
11
|
} from "./input-group";
|
|
12
12
|
|
|
13
|
-
// The `Alt` look on the main parts: per-instance `classes` replace the main
|
|
14
|
-
// classes (and any `UiConfig.InputGroup` entry), and `role` / `data-slot`
|
|
15
|
-
// set to `undefined` drop the main attributes, so the markup is the
|
|
16
|
-
// pre-wrapper one. Two parts cannot go through the main ones without changing
|
|
17
|
-
// their markup: the root puts `data-input-group` (the addon's focus hook)
|
|
18
|
-
// before `class`, and the button has no default `type`; they stay a plain
|
|
19
|
-
// `<div>` and a `Button`.
|
|
20
|
-
|
|
21
|
-
/** @deprecated Use `InputGroup`. Kept for existing consumers; removed in a later minor after they move. */
|
|
22
13
|
const InputGroupAlt = React.forwardRef<
|
|
23
14
|
HTMLDivElement,
|
|
24
15
|
React.HTMLAttributes<HTMLDivElement> & { error?: boolean }
|
|
@@ -53,17 +44,14 @@ const addonClasses = {
|
|
|
53
44
|
},
|
|
54
45
|
};
|
|
55
46
|
|
|
56
|
-
/** `align={null}` (allowed by the old variant props) adds no align classes. */
|
|
57
47
|
const addonClassesNoAlign = { addon: { base: "flex items-center", align: { "inline-start": "" } } };
|
|
58
48
|
|
|
59
|
-
/** Focuses the group's first textarea or input (the click target of an addon). */
|
|
60
49
|
function focusGroupField(event: React.MouseEvent<HTMLDivElement>) {
|
|
61
50
|
const group = event.currentTarget.closest("[data-input-group]");
|
|
62
51
|
const field = group?.querySelector("textarea, input");
|
|
63
52
|
if (field instanceof HTMLElement) field.focus();
|
|
64
53
|
}
|
|
65
54
|
|
|
66
|
-
/** @deprecated Use `InputGroupAddon`. Kept for existing consumers; removed in a later minor after they move. */
|
|
67
55
|
function InputGroupAddonAlt({
|
|
68
56
|
align,
|
|
69
57
|
onClick,
|
|
@@ -98,7 +86,6 @@ const inputGroupButtonVariants = cva("shrink-0 shadow-none", {
|
|
|
98
86
|
},
|
|
99
87
|
});
|
|
100
88
|
|
|
101
|
-
/** @deprecated Use `InputGroupButton`. Kept for existing consumers; removed in a later minor after they move. */
|
|
102
89
|
const InputGroupButtonAlt = React.forwardRef<
|
|
103
90
|
HTMLButtonElement,
|
|
104
91
|
Omit<ButtonProps, "shape"> & VariantProps<typeof inputGroupButtonVariants>
|
|
@@ -115,7 +102,6 @@ InputGroupButtonAlt.displayName = "InputGroupButtonAlt";
|
|
|
115
102
|
|
|
116
103
|
const textClasses = { text: "flex items-center text-sm text-muted-foreground/95" };
|
|
117
104
|
|
|
118
|
-
/** @deprecated Use `InputGroupText`. Kept for existing consumers; removed in a later minor after they move. */
|
|
119
105
|
function InputGroupTextAlt(props: React.HTMLAttributes<HTMLSpanElement>) {
|
|
120
106
|
return <InputGroupText classes={textClasses} {...props} />;
|
|
121
107
|
}
|
|
@@ -125,7 +111,6 @@ const inputClasses = {
|
|
|
125
111
|
"h-full flex-1 rounded-none border-0 bg-transparent px-3 py-2 shadow-none focus-visible:border-0 focus-visible:ring-0",
|
|
126
112
|
};
|
|
127
113
|
|
|
128
|
-
/** @deprecated Use `InputGroupInput`. Kept for existing consumers; removed in a later minor after they move. */
|
|
129
114
|
function InputGroupInputAlt(props: React.ComponentProps<"input">) {
|
|
130
115
|
return <InputGroupInput data-slot={undefined} classes={inputClasses} {...props} />;
|
|
131
116
|
}
|
|
@@ -135,7 +120,6 @@ const textareaClasses = {
|
|
|
135
120
|
"flex-1 resize-none rounded-none border-0 bg-transparent px-3 py-2.5 shadow-none focus-visible:border-0 focus-visible:ring-0 field-sizing-content",
|
|
136
121
|
};
|
|
137
122
|
|
|
138
|
-
/** @deprecated Use `InputGroupTextarea`. Kept for existing consumers; removed in a later minor after they move. */
|
|
139
123
|
function InputGroupTextareaAlt(props: React.ComponentProps<"textarea">) {
|
|
140
124
|
return <InputGroupTextarea data-slot={undefined} classes={textareaClasses} {...props} />;
|
|
141
125
|
}
|
package/src/ui/input-group.tsx
CHANGED
|
@@ -129,9 +129,6 @@ const inputGroupButtonVariants = cva(inputGroupButtonBaseClasses, {
|
|
|
129
129
|
},
|
|
130
130
|
});
|
|
131
131
|
|
|
132
|
-
// `shape="rounded"` keeps the field-addon radius under Button's pill default.
|
|
133
|
-
// `shape` is not a prop: the size classes set `rounded-lg`, so radius changes
|
|
134
|
-
// go through `className` (or `UiConfig.InputGroup.classes.button`).
|
|
135
132
|
function InputGroupButton({
|
|
136
133
|
className,
|
|
137
134
|
type = "button",
|
package/src/ui/kbd.tsx
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { cn } from "../utils/cn";
|
|
3
3
|
|
|
4
|
-
// `subtle`: plain filled key for inline hints; size and font come from the
|
|
5
|
-
// surrounding text.
|
|
6
4
|
const kbdVariantClasses = {
|
|
7
5
|
default:
|
|
8
6
|
"pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded-md bg-surface-secondary px-1.5 font-mono text-[10px] font-medium text-muted-foreground",
|
|
@@ -10,7 +8,6 @@ const kbdVariantClasses = {
|
|
|
10
8
|
};
|
|
11
9
|
|
|
12
10
|
export type KbdProps = React.HTMLAttributes<HTMLElement> & {
|
|
13
|
-
/** Default `"default"`. */
|
|
14
11
|
variant?: keyof typeof kbdVariantClasses;
|
|
15
12
|
};
|
|
16
13
|
|
package/src/ui/label.tsx
CHANGED
|
@@ -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
|
>
|