@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
package/src/ui/breadcrumb.tsx
CHANGED
|
@@ -2,16 +2,10 @@ import * as React from "react";
|
|
|
2
2
|
import { Slot } from "@radix-ui/react-slot";
|
|
3
3
|
import { cn } from "../utils/cn";
|
|
4
4
|
|
|
5
|
-
// breadcrumb, navigation trail for the current page location renders its children as a horizontal list with `/` separators automatically
|
|
6
|
-
// inserted between them designed to replace the page title + back button on
|
|
7
|
-
// detail pages: the parent route(s) act as the "up" affordance and the final
|
|
8
|
-
// segment identifies the current page example: <breadcrumb> <breadcrumblink aschild> <link to="/wiki">wiki</link> </breadcrumblink> <breadcrumbpage>overview</breadcrumbpage> </breadcrumb>
|
|
9
5
|
const Breadcrumb = React.forwardRef<
|
|
10
6
|
HTMLElement,
|
|
11
7
|
React.HTMLAttributes<HTMLElement>
|
|
12
8
|
>(({ className, children, ...props }, ref) => {
|
|
13
|
-
// Filter out falsy children (e.g. conditionally rendered segments) so the
|
|
14
|
-
// separator interleaving stays aligned with actual rendered items.
|
|
15
9
|
const items = React.Children.toArray(children).filter(Boolean);
|
|
16
10
|
|
|
17
11
|
return (
|
|
@@ -35,10 +29,6 @@ const Breadcrumb = React.forwardRef<
|
|
|
35
29
|
});
|
|
36
30
|
Breadcrumb.displayName = "Breadcrumb";
|
|
37
31
|
|
|
38
|
-
// clickable breadcrumb segment (parent routes) muted + medium weight, one
|
|
39
|
-
// step quieter than the current page, shifts to foreground on hover pass
|
|
40
|
-
// `aschild` to render as your router's link component while keeping the
|
|
41
|
-
// styling, preserves type, safe routing
|
|
42
32
|
const BreadcrumbLink = React.forwardRef<
|
|
43
33
|
HTMLAnchorElement,
|
|
44
34
|
React.AnchorHTMLAttributes<HTMLAnchorElement> & { asChild?: boolean }
|
|
@@ -57,8 +47,6 @@ const BreadcrumbLink = React.forwardRef<
|
|
|
57
47
|
});
|
|
58
48
|
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
59
49
|
|
|
60
|
-
// current page segment (last in the trail) inherits the page-title weight
|
|
61
|
-
// (semibold) at foreground colour, and not clickable, signals "you are here"
|
|
62
50
|
const BreadcrumbPage = React.forwardRef<
|
|
63
51
|
HTMLSpanElement,
|
|
64
52
|
React.HTMLAttributes<HTMLSpanElement>
|
|
@@ -72,7 +60,6 @@ const BreadcrumbPage = React.forwardRef<
|
|
|
72
60
|
));
|
|
73
61
|
BreadcrumbPage.displayName = "BreadcrumbPage";
|
|
74
62
|
|
|
75
|
-
// separator rendered automatically between breadcrumb children
|
|
76
63
|
const BreadcrumbSeparator = () => (
|
|
77
64
|
<span aria-hidden className="flex-shrink-0 text-muted-foreground/40">
|
|
78
65
|
/
|
|
@@ -21,13 +21,10 @@ import type { ComponentType } from "react";
|
|
|
21
21
|
*/
|
|
22
22
|
export interface BulkBarAction {
|
|
23
23
|
key: string;
|
|
24
|
-
/** Full label used in the More menu and for accessibility. */
|
|
25
24
|
label: string;
|
|
26
|
-
/** Shorter label shown inline in the bar (defaults to `label`). Unused with `labels="tooltip"`. */
|
|
27
25
|
shortLabel?: string;
|
|
28
26
|
icon: ComponentType<{ size: number; className?: string }>;
|
|
29
27
|
destructive?: boolean;
|
|
30
|
-
/** Shows the Alt-to-skip hint; the caller still owns the skip itself. */
|
|
31
28
|
showSkipHint?: boolean;
|
|
32
29
|
onClick: () => void;
|
|
33
30
|
}
|
|
@@ -41,7 +38,6 @@ export interface BulkBarAction {
|
|
|
41
38
|
export type BulkBarLabels = "inline" | "tooltip";
|
|
42
39
|
|
|
43
40
|
export interface BulkActionBarConfig {
|
|
44
|
-
/** Default `labels` for every bar in the app. A `labels` prop wins. */
|
|
45
41
|
labels?: BulkBarLabels;
|
|
46
42
|
}
|
|
47
43
|
|
|
@@ -55,9 +51,7 @@ export interface BulkActionBarProps {
|
|
|
55
51
|
primaryActions: ReadonlyArray<BulkBarAction>;
|
|
56
52
|
moreActions?: ReadonlyArray<BulkBarAction>;
|
|
57
53
|
destructiveAction?: BulkBarAction;
|
|
58
|
-
/** Motion key for the presence animation, e.g. "quick-tasks-bulk-bar". */
|
|
59
54
|
barKey: string;
|
|
60
|
-
/** Label style for the action buttons (see `BulkBarLabels`). */
|
|
61
55
|
labels?: BulkBarLabels;
|
|
62
56
|
}
|
|
63
57
|
|
|
@@ -66,11 +60,6 @@ const barButtonToneClass = (action: BulkBarAction) =>
|
|
|
66
60
|
? "text-destructive hover:bg-destructive/10 hover:text-destructive"
|
|
67
61
|
: "text-muted-foreground hover:bg-surface-secondary hover:text-foreground";
|
|
68
62
|
|
|
69
|
-
/**
|
|
70
|
-
* An icon-only button with its label in a tooltip. The tooltip trigger is a
|
|
71
|
-
* wrapper span, so the tooltip still shows while the button is disabled (a
|
|
72
|
-
* disabled button gets no pointer events).
|
|
73
|
-
*/
|
|
74
63
|
function TooltipBarButton({
|
|
75
64
|
action,
|
|
76
65
|
disabled,
|
|
@@ -104,10 +93,6 @@ function TooltipBarButton({
|
|
|
104
93
|
);
|
|
105
94
|
}
|
|
106
95
|
|
|
107
|
-
/**
|
|
108
|
-
* A single labelled button inside the action bar. The label collapses to
|
|
109
|
-
* icon-only below the `sm` breakpoint (HeroUI "responsive labels" pattern).
|
|
110
|
-
*/
|
|
111
96
|
function BarButton({
|
|
112
97
|
action,
|
|
113
98
|
disabled,
|
|
@@ -130,9 +115,6 @@ function BarButton({
|
|
|
130
115
|
}
|
|
131
116
|
onClick={action.onClick}
|
|
132
117
|
disabled={disabled}
|
|
133
|
-
// `motion-press`, not `transition-colors`: the destructive Delete takes
|
|
134
|
-
// this same branch, so the highest-consequence control in the bar was the
|
|
135
|
-
// one with no acknowledgement at all before its confirm dialog appeared.
|
|
136
118
|
className={`motion-press inline-flex h-9 shrink-0 items-center gap-1.5 rounded-lg px-2.5 text-sm font-medium active:scale-[0.96] disabled:pointer-events-none disabled:opacity-30 ${barButtonToneClass(action)}`}
|
|
137
119
|
>
|
|
138
120
|
<Icon size={17} />
|
|
@@ -181,7 +163,6 @@ export function BulkActionBar({
|
|
|
181
163
|
>
|
|
182
164
|
<TooltipProvider>
|
|
183
165
|
<div className="flex max-w-[calc(100vw-2rem)] items-center gap-1 overflow-x-auto rounded-surface bg-popover/95 px-2.5 py-2 backdrop-blur-md smooth-shadow-ring-lg scrollbar-none">
|
|
184
|
-
{/* Prefix: selection count */}
|
|
185
166
|
<div className="flex shrink-0 items-center gap-2 pl-1 pr-0.5">
|
|
186
167
|
<CountPop
|
|
187
168
|
label={String(selectedCount)}
|
|
@@ -192,9 +173,6 @@ export function BulkActionBar({
|
|
|
192
173
|
</span>
|
|
193
174
|
</div>
|
|
194
175
|
|
|
195
|
-
{/* Reaching the whole list is the one action a selection bar can
|
|
196
|
-
offer that the rows cannot: shift-clicking to the end of a
|
|
197
|
-
long list is the alternative. */}
|
|
198
176
|
{totalCount > 0 && (
|
|
199
177
|
<button
|
|
200
178
|
type="button"
|
|
@@ -210,7 +188,6 @@ export function BulkActionBar({
|
|
|
210
188
|
className="mx-1.5 h-5 shrink-0 bg-border"
|
|
211
189
|
/>
|
|
212
190
|
|
|
213
|
-
{/* Content: primary actions + More dropdown */}
|
|
214
191
|
{primaryActions.map((action) => (
|
|
215
192
|
<BarButton
|
|
216
193
|
labels={labels}
|
|
@@ -269,7 +246,6 @@ export function BulkActionBar({
|
|
|
269
246
|
className="mx-1.5 h-5 shrink-0 bg-border"
|
|
270
247
|
/>
|
|
271
248
|
|
|
272
|
-
{/* Suffix: dismiss selection */}
|
|
273
249
|
<Tooltip>
|
|
274
250
|
<TooltipTrigger asChild>
|
|
275
251
|
<button
|
package/src/ui/button.tsx
CHANGED
|
@@ -15,15 +15,6 @@ const defaultVariantClass =
|
|
|
15
15
|
const destructiveVariantClass =
|
|
16
16
|
"bg-[oklch(47.2%_0.195_25.7)] text-white hover:bg-[oklch(42.5%_0.185_25.7)]";
|
|
17
17
|
|
|
18
|
-
/**
|
|
19
|
-
* Variant hierarchy:
|
|
20
|
-
* - `primary` (alias of `default`): the one main action.
|
|
21
|
-
* - `secondary`: an alternative action.
|
|
22
|
-
* - `tertiary` (alias of `ghost`): a dismissive action.
|
|
23
|
-
* - `destructive` (alias `danger`): a destructive action.
|
|
24
|
-
* - `success`, `warning`: status.
|
|
25
|
-
* - `outline`, `link`, `flat`: visual treatments with no fixed role.
|
|
26
|
-
*/
|
|
27
18
|
const buttonVariantClasses = {
|
|
28
19
|
default: defaultVariantClass,
|
|
29
20
|
primary: defaultVariantClass,
|
|
@@ -35,16 +26,13 @@ const buttonVariantClasses = {
|
|
|
35
26
|
ghost: ghostClass,
|
|
36
27
|
tertiary: ghostClass,
|
|
37
28
|
link: "text-primary underline-offset-4 hover:underline active:scale-100",
|
|
38
|
-
// Ghost plus an override; tailwind-merge drops the clashing ghost classes.
|
|
39
29
|
flat: `${ghostClass} bg-transparent text-muted hover:bg-surface-tertiary hover:text-foreground`, // check-tokens-allow: text-muted
|
|
40
30
|
success: `${ghostClass} bg-success text-success-foreground hover:bg-success/90`,
|
|
41
31
|
warning: `${ghostClass} bg-warning text-warning-foreground hover:bg-warning/90`,
|
|
42
32
|
};
|
|
43
33
|
|
|
44
|
-
// No radius here: `shape` sets it.
|
|
45
34
|
const buttonSizeClasses = {
|
|
46
35
|
default: "h-10 px-4 py-2",
|
|
47
|
-
// Alias of `default`, for the canonical sm / md / lg scale.
|
|
48
36
|
md: "h-10 px-4 py-2",
|
|
49
37
|
xs: "h-7 px-2 text-xs hit-target [&_svg:not([class*='size-'])]:size-3.5",
|
|
50
38
|
sm: "h-8 px-3 text-xs max-sm:hit-target",
|
|
@@ -54,8 +42,6 @@ const buttonSizeClasses = {
|
|
|
54
42
|
"icon-xs": "h-7 w-7 hit-target",
|
|
55
43
|
};
|
|
56
44
|
|
|
57
|
-
// `pill` (default) is fully round, so icon sizes are circles. `rounded` is
|
|
58
|
-
// the radius from before 0.31.0, for joined edges and field addons.
|
|
59
45
|
const buttonShapeClasses = {
|
|
60
46
|
pill: "rounded-full",
|
|
61
47
|
rounded: "rounded-lg",
|
|
@@ -67,7 +53,6 @@ export type ButtonVariant = keyof typeof buttonVariantClasses;
|
|
|
67
53
|
export type ButtonSize = keyof typeof buttonSizeClasses;
|
|
68
54
|
export type ButtonShape = keyof typeof buttonShapeClasses;
|
|
69
55
|
|
|
70
|
-
// `rounded` keeps the smaller radius the two 28px sizes had.
|
|
71
56
|
const roundedSmallSizes: ButtonSize[] = ["xs", "icon-xs"];
|
|
72
57
|
const roundedSmallClass = "rounded-md";
|
|
73
58
|
|
|
@@ -90,7 +75,6 @@ export const buttonVariants = cva(buttonBaseClasses, {
|
|
|
90
75
|
},
|
|
91
76
|
});
|
|
92
77
|
|
|
93
|
-
/** Built-in radius for the config path. Matches the cva variant and compound variant. */
|
|
94
78
|
function buttonShapeClass(shape: ButtonShape, size: ButtonSize): string {
|
|
95
79
|
return shape === "rounded" && roundedSmallSizes.includes(size)
|
|
96
80
|
? roundedSmallClass
|
|
@@ -103,7 +87,6 @@ export interface ButtonConfig {
|
|
|
103
87
|
base?: string;
|
|
104
88
|
variant?: Partial<Record<ButtonVariant, string>>;
|
|
105
89
|
size?: Partial<Record<ButtonSize, string>>;
|
|
106
|
-
/** Radius per shape. Replaces it for every size, `xs` and `icon-xs` included. */
|
|
107
90
|
shape?: Partial<Record<ButtonShape, string>>;
|
|
108
91
|
};
|
|
109
92
|
}
|
|
@@ -113,21 +96,11 @@ export interface ButtonProps
|
|
|
113
96
|
extends
|
|
114
97
|
React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
115
98
|
VariantProps<typeof buttonVariants> {
|
|
116
|
-
/**
|
|
117
|
-
* `primary` (alias of `default`) is the one main action; `secondary` an
|
|
118
|
-
* alternative; `tertiary` (alias of `ghost`) a dismissive one; `destructive`
|
|
119
|
-
* (alias `danger`) a destructive one; `success` and `warning` show status;
|
|
120
|
-
* `outline`, `link` and `flat` are visual. Default `"default"`.
|
|
121
|
-
*/
|
|
122
99
|
variant?: ButtonVariant | null;
|
|
123
|
-
/** `md` is an alias of `default`. Default `"default"`. */
|
|
124
100
|
size?: ButtonSize | null;
|
|
125
101
|
asChild?: boolean;
|
|
126
|
-
/** Rendered before the children. Ignored with `asChild`. */
|
|
127
102
|
startContent?: React.ReactNode;
|
|
128
|
-
/** Rendered after the children. Ignored with `asChild`. */
|
|
129
103
|
endContent?: React.ReactNode;
|
|
130
|
-
/** Disables the button, sets `data-loading`, and shows a spinner in place of `startContent`. */
|
|
131
104
|
loading?: boolean;
|
|
132
105
|
}
|
|
133
106
|
|
package/src/ui/calendar.tsx
CHANGED
|
@@ -30,11 +30,6 @@ export interface CalendarConfig {
|
|
|
30
30
|
components?: Partial<CustomComponents>;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
// shadcn's v9 calendar on package tokens: no background of its own (it takes
|
|
34
|
-
// the popover or card surface it sits on), selected days use the picker
|
|
35
|
-
// active treatment, today gets a dot, outside days are muted and disabled
|
|
36
|
-
// days dimmed. day state lives on the cell (`data-selected`, `data-today`,
|
|
37
|
-
// ...), so the day button reads it through `group/day`
|
|
38
33
|
const navButtonClass = cn(
|
|
39
34
|
"inline-flex size-(--cell-size) select-none items-center justify-center rounded-lg p-0 text-muted-foreground transition-colors hover:bg-surface-tertiary hover:text-foreground aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
40
35
|
pickerFocusClass,
|
|
@@ -150,15 +145,9 @@ function Calendar({
|
|
|
150
145
|
day_button: cn(
|
|
151
146
|
"relative inline-flex size-(--cell-size) items-center justify-center rounded-lg text-xs tabular-nums text-foreground/80 transition-colors disabled:cursor-not-allowed disabled:opacity-40",
|
|
152
147
|
pickerFocusClass,
|
|
153
|
-
// today, outside and hover rules exclude selected days, so the
|
|
154
|
-
// selected tone never depends on the order Tailwind emits rules in.
|
|
155
|
-
// the today dot is `bg-current`: foreground, or primary-foreground
|
|
156
|
-
// when selected
|
|
157
148
|
"not-group-data-selected/day:enabled:hover:bg-surface-tertiary/50",
|
|
158
149
|
"group-data-today/day:font-medium group-data-today/day:not-group-data-selected/day:text-foreground group-data-today/day:after:absolute group-data-today/day:after:bottom-1 group-data-today/day:after:left-1/2 group-data-today/day:after:size-1 group-data-today/day:after:-translate-x-1/2 group-data-today/day:after:rounded-full group-data-today/day:after:bg-current",
|
|
159
150
|
"group-data-outside/day:not-group-data-selected/day:text-muted-foreground",
|
|
160
|
-
// spelled out (not built from pickerSelectedClass) so Tailwind's
|
|
161
|
-
// scanner sees it
|
|
162
151
|
"group-data-selected/day:bg-primary group-data-selected/day:text-primary-foreground",
|
|
163
152
|
defaultClassNames.day_button,
|
|
164
153
|
),
|
|
@@ -180,11 +169,6 @@ function Calendar({
|
|
|
180
169
|
);
|
|
181
170
|
}
|
|
182
171
|
|
|
183
|
-
/**
|
|
184
|
-
* DayPicker's day button plus `data-selected`, so its classes can style the
|
|
185
|
-
* selected day on the button itself (`data-[selected=true]:bg-primary`).
|
|
186
|
-
* Pass it as `components.DayButton` (or through `UiConfig.Calendar.components`).
|
|
187
|
-
*/
|
|
188
172
|
function CalendarDayButton({
|
|
189
173
|
day: _day,
|
|
190
174
|
modifiers,
|
|
@@ -192,8 +176,6 @@ function CalendarDayButton({
|
|
|
192
176
|
}: React.ComponentProps<typeof DayButton>) {
|
|
193
177
|
const ref = React.useRef<HTMLButtonElement>(null);
|
|
194
178
|
|
|
195
|
-
// DayPicker decides which day has focus; moving DOM focus to match is what
|
|
196
|
-
// its own DayButton does.
|
|
197
179
|
React.useEffect(() => {
|
|
198
180
|
if (modifiers.focused) ref.current?.focus();
|
|
199
181
|
}, [modifiers.focused]);
|
package/src/ui/card.tsx
CHANGED
|
@@ -2,7 +2,6 @@ import * as React from "react";
|
|
|
2
2
|
import { useCn, useUiConfig } from "./ui-config";
|
|
3
3
|
|
|
4
4
|
export interface CardConfig {
|
|
5
|
-
/** Replaces the built-in classes of a part. A part left out keeps its default. */
|
|
6
5
|
classes?: {
|
|
7
6
|
root?: string;
|
|
8
7
|
header?: string;
|
|
@@ -14,7 +13,6 @@ export interface CardConfig {
|
|
|
14
13
|
};
|
|
15
14
|
}
|
|
16
15
|
|
|
17
|
-
/** The app's class string for `part` (else `fallback`), merged with the caller `className`. */
|
|
18
16
|
function useCardClass(
|
|
19
17
|
part: keyof NonNullable<CardConfig["classes"]>,
|
|
20
18
|
fallback: string,
|
|
@@ -92,7 +90,6 @@ const CardFooter = React.forwardRef<
|
|
|
92
90
|
));
|
|
93
91
|
CardFooter.displayName = "CardFooter";
|
|
94
92
|
|
|
95
|
-
/** Top-right slot of a grid header (`grid-cols-[1fr_auto]`): spans the title and description rows. */
|
|
96
93
|
const CardAction = React.forwardRef<
|
|
97
94
|
HTMLDivElement,
|
|
98
95
|
React.HTMLAttributes<HTMLDivElement>
|
package/src/ui/carousel.tsx
CHANGED
|
@@ -28,9 +28,7 @@ type CarouselContextProps = {
|
|
|
28
28
|
scrollNext: () => void;
|
|
29
29
|
canScrollPrev: boolean;
|
|
30
30
|
canScrollNext: boolean;
|
|
31
|
-
/** Index of the selected snap. */
|
|
32
31
|
selectedIndex: number;
|
|
33
|
-
/** Embla's snap positions, one per page. */
|
|
34
32
|
scrollSnaps: number[];
|
|
35
33
|
scrollTo: (index: number) => void;
|
|
36
34
|
} & CarouselProps;
|
|
@@ -67,7 +65,6 @@ function Carousel({
|
|
|
67
65
|
setCanScrollPrev(api.canScrollPrev());
|
|
68
66
|
setCanScrollNext(api.canScrollNext());
|
|
69
67
|
setSelectedIndex(api.selectedScrollSnap());
|
|
70
|
-
// keep the old array when nothing moved, so this can run on every render
|
|
71
68
|
const next = api.scrollSnapList();
|
|
72
69
|
setScrollSnaps((prev) =>
|
|
73
70
|
prev.length === next.length && prev.every((snap, i) => snap === next[i]) ? prev : next,
|
|
@@ -225,7 +222,6 @@ function CarouselNext({
|
|
|
225
222
|
</Button>
|
|
226
223
|
);
|
|
227
224
|
}
|
|
228
|
-
/** One dot per snap; the selected one is wider. Renders nothing for a single page. */
|
|
229
225
|
function CarouselDots({ className }: { className?: string }) {
|
|
230
226
|
const { scrollSnaps, selectedIndex, scrollTo } = useCarousel();
|
|
231
227
|
const classes = useUiConfig("Carousel")?.classes;
|
package/src/ui/checkbox.tsx
CHANGED
|
@@ -9,14 +9,6 @@ const altClasses = {
|
|
|
9
9
|
"absolute right-2 top-1/2 inline-flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded-md text-muted-foreground transition-[opacity,background-color,color,transform] duration-150 ease-out active:duration-100 active:ease-out active:scale-[0.97] hover:bg-surface-tertiary hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-focus-ring before:absolute before:inset-[-8px] before:content-['']",
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* The `Alt` look on `ClearInput`'s `animation="none"` path: the clear button
|
|
14
|
-
* stays mounted (`clearButton="always"`), per-instance `classes` replace the
|
|
15
|
-
* main classes (and any `UiConfig.ClearInput` entry), and an explicit
|
|
16
|
-
* `placeholder={undefined}` keeps the input free of the main `placeholder=""`.
|
|
17
|
-
*
|
|
18
|
-
* @deprecated Use `ClearInput`. Kept for existing consumers; removed in a later minor after they move.
|
|
19
|
-
*/
|
|
20
12
|
const ClearInputAlt = React.forwardRef<
|
|
21
13
|
HTMLInputElement,
|
|
22
14
|
Omit<ClearInputProps, "animation" | "clearButton" | "classes">
|
package/src/ui/clear-input.tsx
CHANGED
|
@@ -25,24 +25,10 @@ export interface ClearInputProps extends Omit<
|
|
|
25
25
|
value: string;
|
|
26
26
|
onChange: (value: string) => void;
|
|
27
27
|
wrapperClassName?: string;
|
|
28
|
-
/** Icon or adornment positioned in the field's left gutter. */
|
|
29
28
|
leading?: React.ReactNode;
|
|
30
29
|
clearLabel?: string;
|
|
31
|
-
/**
|
|
32
|
-
* `dissolve` (default): the text dissolves before the value clears (needs
|
|
33
|
-
* `clear-input.css`). `none`: clear at once, focus the input, and render
|
|
34
|
-
* only the wrapper, input and clear button.
|
|
35
|
-
*/
|
|
36
30
|
animation?: ClearInputAnimation;
|
|
37
|
-
/**
|
|
38
|
-
* With `animation="none"` only. `"filled"` (default): the clear button
|
|
39
|
-
* mounts while there is a value. `"always"`: it stays mounted so the field
|
|
40
|
-
* never reflows; while empty it is hidden (`pointer-events-none opacity-0`,
|
|
41
|
-
* `tabIndex=-1`, `aria-hidden`), while filled it shows (`opacity-100`,
|
|
42
|
-
* `tabIndex=0`), and the input always reserves `pr-9`.
|
|
43
|
-
*/
|
|
44
31
|
clearButton?: "filled" | "always";
|
|
45
|
-
/** Replaces the wrapper, input and button classes for this instance (each key wins over `UiConfig.ClearInput.classes`). */
|
|
46
32
|
classes?: ClearInputConfig["classes"];
|
|
47
33
|
}
|
|
48
34
|
|
|
@@ -108,8 +94,6 @@ const PlainClearInput = React.forwardRef<
|
|
|
108
94
|
onChange={(event) => {
|
|
109
95
|
onChange(event.target.value);
|
|
110
96
|
}}
|
|
111
|
-
// A caller `placeholder` in `props` replaces this default in place;
|
|
112
|
-
// an explicit `undefined` drops the attribute.
|
|
113
97
|
placeholder=""
|
|
114
98
|
className={merge(
|
|
115
99
|
classes?.input ?? [inputClasses, fieldFocusClass],
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/** transitions.dev input clear with dissolve — see 13-input-clear-dissolve.md */
|
|
2
|
-
|
|
3
|
-
// Times come back in ms. CSS minifiers rewrite `1000ms` as `1s`, so a value
|
|
4
|
-
// in seconds is converted rather than read as 1.
|
|
5
1
|
export function readCssNumber(
|
|
6
2
|
root: HTMLElement,
|
|
7
3
|
name: string,
|
package/src/ui/command.tsx
CHANGED
|
@@ -12,12 +12,9 @@ import { useCn, useUiConfig } from "./ui-config";
|
|
|
12
12
|
|
|
13
13
|
/** App defaults for `Command*` (see `UiConfigProvider`). */
|
|
14
14
|
export interface CommandConfig {
|
|
15
|
-
/** Replaces the built-in classes of a part. */
|
|
16
15
|
classes?: {
|
|
17
16
|
root?: string;
|
|
18
|
-
/** `CommandDialog` content. */
|
|
19
17
|
dialogContent?: string;
|
|
20
|
-
/** The `Command` inside `CommandDialog`, for every `listLayout`. */
|
|
21
18
|
dialogCommand?: string;
|
|
22
19
|
inputWrapper?: string;
|
|
23
20
|
input?: string;
|
|
@@ -28,12 +25,9 @@ export interface CommandConfig {
|
|
|
28
25
|
item?: string;
|
|
29
26
|
shortcut?: string;
|
|
30
27
|
};
|
|
31
|
-
/** Replace the built-in icons. */
|
|
32
28
|
icons?: {
|
|
33
|
-
/** `CommandInput` search icon. */
|
|
34
29
|
search?: React.ReactNode;
|
|
35
30
|
};
|
|
36
|
-
/** A `className` on `CommandEmpty` replaces its classes instead of merging with them. */
|
|
37
31
|
emptyClassNameReplaces?: boolean;
|
|
38
32
|
}
|
|
39
33
|
|
|
@@ -57,38 +51,22 @@ const Command = React.forwardRef<
|
|
|
57
51
|
});
|
|
58
52
|
Command.displayName = CommandPrimitive.displayName;
|
|
59
53
|
|
|
60
|
-
// The list is pinned rather than `max-h`: a palette that resizes on every
|
|
61
|
-
// keystroke shifts the whole dialog under the cursor.
|
|
62
54
|
const commandDialogPinnedClass =
|
|
63
55
|
"[&_[cmdk-list]]:h-80 [&_[cmdk-list]]:max-h-[60dvh] [&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-widest [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-1.5 [&_[cmdk-input-wrapper]_svg]:h-4 [&_[cmdk-input-wrapper]_svg]:w-4 [&_[cmdk-input]]:h-11 [&_[cmdk-item]]:rounded-menu-item [&_[cmdk-item]]:px-2.5 [&_[cmdk-item]]:py-2 [&_[cmdk-item]_svg]:h-4 [&_[cmdk-item]_svg]:w-4";
|
|
64
56
|
|
|
65
|
-
// Keyboard surface: the palette opens and closes in the same frame. Override
|
|
66
|
-
// the `t-modal` timing variables on the content element (do not fork the CSS).
|
|
67
|
-
// `--modal-close-dur` is 1ms, not 0ms, so the `t-modal-presence-wait` animation
|
|
68
|
-
// still fires `animationend` and Radix Presence unmounts the palette; a 0ms
|
|
69
|
-
// animation is not guaranteed to fire that event in every browser.
|
|
70
57
|
const commandDialogInstantClass =
|
|
71
58
|
"[--modal-open-dur:0ms] [--modal-close-dur:1ms] [--modal-scale:1] [--modal-scale-close:1]";
|
|
72
59
|
|
|
73
|
-
// Drop the overlay fade so no backdrop is left behind on close. `animation:none`
|
|
74
|
-
// means Radix Presence sees no animation and unmounts the overlay at once;
|
|
75
|
-
// `!important` wins over the data-state motion classes without a specificity war.
|
|
76
60
|
const commandOverlayInstantClass = "[animation:none!important]";
|
|
77
61
|
|
|
78
|
-
// The list sizes itself and items keep the caller's styling.
|
|
79
62
|
const commandDialogAutoClass =
|
|
80
63
|
"[&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-widest [&_[cmdk-group-heading]]:text-muted [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-1.5 [&_[cmdk-input-wrapper]_svg]:h-4 [&_[cmdk-input-wrapper]_svg]:w-4 [&_[cmdk-input]]:h-11 [&_[cmdk-item]_svg]:h-4 [&_[cmdk-item]_svg]:w-4"; // check-tokens-allow: text-muted
|
|
81
64
|
|
|
82
65
|
interface CommandDialogProps extends React.ComponentProps<typeof Dialog> {
|
|
83
|
-
/** Screen-reader title. With `description`, adds a visually hidden header. */
|
|
84
66
|
title?: string;
|
|
85
|
-
/** Screen-reader description. With `title`, adds a visually hidden header. */
|
|
86
67
|
description?: string;
|
|
87
|
-
/** Merged onto the dialog content. */
|
|
88
68
|
className?: string;
|
|
89
|
-
/** Passed to `Command`. Set `false` to filter items yourself. */
|
|
90
69
|
shouldFilter?: boolean;
|
|
91
|
-
/** `"pinned"` (default) fixes the list height; `"auto"` lets it size itself. */
|
|
92
70
|
listLayout?: "pinned" | "auto";
|
|
93
71
|
}
|
|
94
72
|
|
|
@@ -3,11 +3,9 @@ import { createPortal } from "react-dom";
|
|
|
3
3
|
|
|
4
4
|
const PIECE_COUNT = 90;
|
|
5
5
|
const DURATION_MS = 1800;
|
|
6
|
-
/** The last share of the burst fades out instead of cutting. */
|
|
7
6
|
const FADE_FROM = 0.65;
|
|
8
7
|
const GRAVITY = 0.32;
|
|
9
8
|
const DRAG = 0.985;
|
|
10
|
-
/** Theme chart colours (RGB triplets), so the burst follows the accent. */
|
|
11
9
|
const DEFAULT_COLOR_VARS = ["--chart-1", "--chart-2", "--chart-3", "--chart-4", "--chart-5"];
|
|
12
10
|
const FALLBACK_COLOR = "rgb(120 120 120)";
|
|
13
11
|
|
|
@@ -35,7 +33,6 @@ function resolveColors(colors: readonly string[] | undefined): string[] {
|
|
|
35
33
|
|
|
36
34
|
function spawnPieces(originX: number, originY: number, colors: string[]): Piece[] {
|
|
37
35
|
return Array.from({ length: PIECE_COUNT }, (_, index) => {
|
|
38
|
-
// A fan pointing down and out of the anchor, wider than it is deep.
|
|
39
36
|
const angle = Math.PI / 2 + (Math.random() - 0.5) * Math.PI * 0.9;
|
|
40
37
|
const speed = 6 + Math.random() * 9;
|
|
41
38
|
return {
|
|
@@ -106,7 +103,6 @@ export function ConfettiBurst({
|
|
|
106
103
|
context.save();
|
|
107
104
|
context.translate(piece.x, piece.y);
|
|
108
105
|
context.rotate(piece.angle);
|
|
109
|
-
// Squash on one axis so each piece seems to turn over as it falls.
|
|
110
106
|
context.scale(1, Math.cos(piece.flutter));
|
|
111
107
|
context.fillStyle = piece.color;
|
|
112
108
|
context.fillRect(-piece.width / 2, -piece.height / 2, piece.width, piece.height);
|
|
@@ -50,7 +50,6 @@ type ConfirmDialogContextValue = {
|
|
|
50
50
|
typed: string;
|
|
51
51
|
setTyped: (value: string) => void;
|
|
52
52
|
phraseMatches: boolean;
|
|
53
|
-
/** Calls the Root's `onOpenChange(false)` unless `pending` (and not `dismissibleWhilePending`). */
|
|
54
53
|
requestClose: () => void;
|
|
55
54
|
};
|
|
56
55
|
|
|
@@ -72,29 +71,11 @@ export function useConfirmDialog(): ConfirmDialogContextValue {
|
|
|
72
71
|
}
|
|
73
72
|
|
|
74
73
|
export type ConfirmDialogRootProps = React.ComponentProps<typeof Dialog> & {
|
|
75
|
-
/** Layout slot for the other parts. A width cap (`"sm"` and `"md"`: `sm:max-w-96`), not a size scale. Default `"default"`. */
|
|
76
74
|
size?: ConfirmDialogSize;
|
|
77
|
-
/** Blocking alert dialog: no outside dismiss, no close button, Cancel focused. Default `size === "default"`. */
|
|
78
75
|
alert?: boolean;
|
|
79
|
-
/**
|
|
80
|
-
* While `true`, close requests (Escape, outside click, close button, Cancel)
|
|
81
|
-
* are swallowed, Cancel is disabled and Action shows its pending state.
|
|
82
|
-
* Needs a controlled `open`.
|
|
83
|
-
*/
|
|
84
76
|
pending?: boolean;
|
|
85
|
-
/**
|
|
86
|
-
* While `pending`, Escape, outside click and the close button still close
|
|
87
|
-
* (Root `onOpenChange(false)` runs). Cancel stays disabled and Action stays
|
|
88
|
-
* pending. Default `false`.
|
|
89
|
-
*/
|
|
90
77
|
dismissibleWhilePending?: boolean;
|
|
91
|
-
/**
|
|
92
|
-
* Non-alert only: Cancel renders `data-alert-cancel=""`, so a Content with
|
|
93
|
-
* `role="alertdialog"` focuses it on open. An explicit `data-alert-cancel`
|
|
94
|
-
* on Cancel wins. No-op with `alert` (its Cancel already has it). Default `false`.
|
|
95
|
-
*/
|
|
96
78
|
focusCancel?: boolean;
|
|
97
|
-
/** Type-to-confirm phrase for `ConfirmDialog.Field`. Action stays disabled until it matches (trimmed, case-insensitive). */
|
|
98
79
|
confirmPhrase?: string;
|
|
99
80
|
};
|
|
100
81
|
|
|
@@ -151,7 +132,6 @@ Root.displayName = "ConfirmDialog.Root";
|
|
|
151
132
|
|
|
152
133
|
export type ConfirmDialogContentProps = React.ComponentProps<typeof DialogContent>;
|
|
153
134
|
|
|
154
|
-
/** Alert or plain dialog content (from Root `alert`); `sm` and `md` cap the width. */
|
|
155
135
|
function Content({ className, ...props }: ConfirmDialogContentProps) {
|
|
156
136
|
const { size, alert } = useConfirmDialog();
|
|
157
137
|
const extra = useUiConfig("ConfirmDialog")?.classes?.content;
|
|
@@ -195,12 +175,10 @@ function Description({ className, ...props }: ConfirmDialogDescriptionProps) {
|
|
|
195
175
|
/>
|
|
196
176
|
);
|
|
197
177
|
}
|
|
198
|
-
// Matched by `DialogContent` when it checks an alert dialog for a description.
|
|
199
178
|
Description.displayName = "ConfirmDialog.Description";
|
|
200
179
|
|
|
201
180
|
export type ConfirmDialogBodyProps = React.ComponentProps<"div">;
|
|
202
181
|
|
|
203
|
-
/** Plain `<div>` for extra content. No default classes (`UiConfig.ConfirmDialog.classes.body` if set). */
|
|
204
182
|
function Body({ className, ...props }: ConfirmDialogBodyProps) {
|
|
205
183
|
const extra = useUiConfig("ConfirmDialog")?.classes?.body;
|
|
206
184
|
return <div {...props} className={cn(extra, className) || undefined} />;
|
|
@@ -208,14 +186,6 @@ function Body({ className, ...props }: ConfirmDialogBodyProps) {
|
|
|
208
186
|
Body.displayName = "ConfirmDialog.Body";
|
|
209
187
|
|
|
210
188
|
export type ConfirmDialogFooterProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
211
|
-
/**
|
|
212
|
-
* Right-aligned row of buttons at every width, laid out like a
|
|
213
|
-
* `flex justify-end gap-2` div inside the footer. Adds `justify-end flex-row!`:
|
|
214
|
-
* the `!important` beats both the footer's own `flex-col-reverse` below `sm`
|
|
215
|
-
* and the compact sheet's descendant `flex-col-reverse` rule, which has higher
|
|
216
|
-
* specificity than a plain class. Keeps `data-slot` and every other footer
|
|
217
|
-
* class. No-op for `size="sm"` (already a row). Default `false`.
|
|
218
|
-
*/
|
|
219
189
|
row?: boolean;
|
|
220
190
|
};
|
|
221
191
|
|
|
@@ -234,12 +204,6 @@ Footer.displayName = "ConfirmDialog.Footer";
|
|
|
234
204
|
|
|
235
205
|
export type ConfirmDialogCancelProps = ButtonProps;
|
|
236
206
|
|
|
237
|
-
/**
|
|
238
|
-
* Alert: a `DialogClose` outline button. Otherwise a ghost button that runs
|
|
239
|
-
* `onClick` and then, unless it called `preventDefault()`, the Root's
|
|
240
|
-
* `onOpenChange(false)`. Disabled while pending. With Root `focusCancel`
|
|
241
|
-
* it also gets `data-alert-cancel`.
|
|
242
|
-
*/
|
|
243
207
|
function Cancel({ children = "Cancel", variant, size, disabled, onClick, ...props }: ConfirmDialogCancelProps) {
|
|
244
208
|
const dialog = useConfirmDialog();
|
|
245
209
|
if (dialog.alert) {
|
|
@@ -274,17 +238,12 @@ function Cancel({ children = "Cancel", variant, size, disabled, onClick, ...prop
|
|
|
274
238
|
Cancel.displayName = "ConfirmDialog.Cancel";
|
|
275
239
|
|
|
276
240
|
export type ConfirmDialogActionProps = ButtonProps & {
|
|
277
|
-
/** Default from Root `pending`. Disables the button. */
|
|
278
241
|
pending?: boolean;
|
|
279
|
-
/** Shown with a spinner while pending. Without it the children stay. */
|
|
280
242
|
pendingLabel?: React.ReactNode;
|
|
281
|
-
/** Spinner size in px. Default `14`. */
|
|
282
243
|
spinnerSize?: number;
|
|
283
|
-
/** Merged into the spinner className after `animate-spin`, e.g. `"mr-2"`. */
|
|
284
244
|
spinnerClassName?: string;
|
|
285
245
|
};
|
|
286
246
|
|
|
287
|
-
/** Confirm button. Does not close the dialog. Disabled while pending or until the confirm phrase matches. */
|
|
288
247
|
function Action({
|
|
289
248
|
pending: pendingProp,
|
|
290
249
|
pendingLabel,
|
|
@@ -323,16 +282,12 @@ function Action({
|
|
|
323
282
|
Action.displayName = "ConfirmDialog.Action";
|
|
324
283
|
|
|
325
284
|
export type ConfirmDialogFieldProps = {
|
|
326
|
-
/** Replaces the whole label content. Default "Type <phrase> to confirm". */
|
|
327
285
|
label?: React.ReactNode;
|
|
328
|
-
/** Enter in the input, only while the phrase matches and not pending. */
|
|
329
286
|
onEnter?: () => void;
|
|
330
287
|
className?: string;
|
|
331
|
-
/** Spread onto the `Input`; `id` also sets the label `htmlFor`. */
|
|
332
288
|
inputProps?: Omit<React.ComponentProps<typeof Input>, "value" | "defaultValue" | "onChange">;
|
|
333
289
|
};
|
|
334
290
|
|
|
335
|
-
/** Type-to-confirm input bound to the Root `confirmPhrase`. */
|
|
336
291
|
function Field({ label, onEnter, className, inputProps }: ConfirmDialogFieldProps) {
|
|
337
292
|
const { confirmPhrase = "", typed, setTyped, phraseMatches, pending } = useConfirmDialog();
|
|
338
293
|
const autoId = React.useId();
|
|
@@ -21,36 +21,16 @@ export type ConfirmDialogProps = Omit<
|
|
|
21
21
|
ConfirmDialogRootProps,
|
|
22
22
|
"size" | "alert" | "pending" | "confirmPhrase"
|
|
23
23
|
> & {
|
|
24
|
-
/**
|
|
25
|
-
* While `true`, the confirm button shows a spinner beside `confirmLabel`,
|
|
26
|
-
* Cancel is disabled and close requests wait (see `ConfirmDialog.Root`).
|
|
27
|
-
*/
|
|
28
24
|
pending?: boolean;
|
|
29
|
-
/** Extra content after the description, inside the dialog. `children` stays outside (for a trigger). */
|
|
30
25
|
body?: React.ReactNode;
|
|
31
26
|
title: React.ReactNode;
|
|
32
27
|
description?: React.ReactNode;
|
|
33
|
-
/** Legacy (still supported): compose `ConfirmDialog.Cancel` instead. */
|
|
34
28
|
cancelLabel?: React.ReactNode;
|
|
35
|
-
/** Legacy (still supported): compose `ConfirmDialog.Action` instead. */
|
|
36
29
|
confirmLabel?: React.ReactNode;
|
|
37
30
|
onCancel?: () => void;
|
|
38
31
|
onConfirm?: () => void;
|
|
39
|
-
/** Legacy (still supported): pass `variant` to `ConfirmDialog.Action` instead. */
|
|
40
32
|
variant?: "default" | "destructive";
|
|
41
33
|
confirmDisabled?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Legacy (still supported): use `ConfirmDialog.Root size` with the parts.
|
|
44
|
-
*
|
|
45
|
-
* `"default"`: blocking alert dialog that closes on either button.
|
|
46
|
-
* `"sm"`: compact dismissible dialog (outside click, Escape and the close
|
|
47
|
-
* button close it). Confirm does not close it; the caller controls `open`.
|
|
48
|
-
* `"md"`: dismissible dialog like `"sm"`, with a header, description and
|
|
49
|
-
* footer in separate sections and default-size buttons.
|
|
50
|
-
*
|
|
51
|
-
* The sizes are width caps: `"sm"` and `"md"` cap the content at
|
|
52
|
-
* `sm:max-w-96`; `"default"` keeps the dialog width.
|
|
53
|
-
*/
|
|
54
34
|
size?: "default" | "sm" | "md";
|
|
55
35
|
};
|
|
56
36
|
|
|
@@ -94,7 +74,6 @@ function LegacyConfirmDialog({
|
|
|
94
74
|
)}
|
|
95
75
|
{body != null ? <Parts.Body>{body}</Parts.Body> : null}
|
|
96
76
|
<Parts.Footer>
|
|
97
|
-
{/* The alert cancel passes the click event on; sm and md call onCancel bare. */}
|
|
98
77
|
<Parts.Cancel onClick={size === "default" ? onCancel : () => onCancel?.()}>
|
|
99
78
|
{cancelLabel}
|
|
100
79
|
</Parts.Cancel>
|
|
@@ -113,11 +92,6 @@ function LegacyConfirmDialog({
|
|
|
113
92
|
}
|
|
114
93
|
LegacyConfirmDialog.displayName = "ConfirmDialog";
|
|
115
94
|
|
|
116
|
-
/**
|
|
117
|
-
* Confirm dialog. Call it with props (the legacy prop-driven API), or compose
|
|
118
|
-
* the parts: `ConfirmDialog.Root`, `.Content`, `.Header`, `.Title`,
|
|
119
|
-
* `.Description`, `.Body`, `.Footer`, `.Cancel`, `.Action` and `.Field`.
|
|
120
|
-
*/
|
|
121
95
|
const ConfirmDialog = Object.assign(LegacyConfirmDialog, Parts);
|
|
122
96
|
|
|
123
97
|
export { ConfirmDialog };
|