@vvedantb/ui 0.67.0 → 0.69.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/src/auth/useStableAuth.ts +0 -2
- package/app/src/confirm/ConfirmSkipHint.tsx +0 -2
- package/app/src/confirm/useAltHeld.ts +0 -17
- package/app/src/convex/ConvexClerkProvider.tsx +0 -3
- package/app/src/convex/env.ts +0 -4
- package/app/src/convex/errorMessage.ts +0 -1
- package/app/src/convex/useHeldResult.ts +0 -3
- package/app/src/page-motion/PageMotionProvider.tsx +0 -6
- package/app/src/page-title/createPageTitleContext.tsx +0 -14
- package/app/src/settings/SettingsEmptyState.tsx +0 -4
- package/app/src/settings/SettingsField.tsx +0 -4
- package/app/src/settings/SettingsPage.tsx +0 -12
- package/app/src/settings/SettingsSection.tsx +0 -14
- package/app/src/settings/ThemeModePicker.tsx +0 -6
- package/app/src/theme/createThemeProvider.tsx +0 -33
- package/app/src/time/compactRelativeTime.ts +0 -16
- package/app/src/update/staleDeployReload.ts +0 -40
- package/app/src/update/updateWatcher.ts +0 -8
- package/dist/app/src/auth/useStableAuth.js +0 -1
- package/dist/app/src/confirm/ConfirmSkipHint.js +0 -3
- package/dist/app/src/confirm/useAltHeld.js +0 -17
- package/dist/app/src/convex/env.js +0 -3
- package/dist/app/src/convex/errorMessage.js +0 -2
- package/dist/app/src/settings/ThemeModePicker.js +0 -1
- package/dist/app/src/theme/createThemeProvider.js +1 -11
- package/dist/app/src/time/compactRelativeTime.js +0 -8
- package/dist/app/src/update/staleDeployReload.js +3 -38
- package/dist/app/src/update/updateWatcher.js +1 -3
- package/dist/shell/src/AppShell.js +0 -14
- package/dist/shell/src/PageHeaderBar.js +0 -3
- package/dist/shell/src/SessionsHoverCard.js +0 -9
- package/dist/shell/src/SidePanelTabs.js +0 -36
- package/dist/shell/src/Sidebar.js +0 -1
- package/dist/shell/src/SidebarChrome.js +0 -19
- package/dist/shell/src/SidebarIconTooltip.js +0 -1
- package/dist/shell/src/SidebarRail.js +0 -12
- package/dist/shell/src/SidebarResize.js +1 -4
- package/dist/shell/src/app-shell-classes.js +0 -10
- package/dist/shell/src/index.js +0 -1
- package/dist/shell/src/shell-panel-motion.js +0 -12
- package/dist/src/ai-elements/activity-shared.js +0 -6
- package/dist/src/ai-elements/activity-step-label.js +0 -6
- package/dist/src/ai-elements/activity-step-types.js +0 -4
- package/dist/src/ai-elements/activity-tasks-utils.js +0 -17
- package/dist/src/ai-elements/activity-tasks.js +0 -55
- package/dist/src/ai-elements/artifact.js +0 -4
- package/dist/src/ai-elements/attachments.js +0 -41
- package/dist/src/ai-elements/code-block.js +0 -18
- package/dist/src/ai-elements/collapsible-user-message-body.js +0 -2
- package/dist/src/ai-elements/context.js +0 -13
- package/dist/src/ai-elements/conversation.js +0 -4
- package/dist/src/ai-elements/jump-rail.js +0 -5
- package/dist/src/ai-elements/message.js +0 -7
- package/dist/src/ai-elements/model-picker-types.js +0 -1
- package/dist/src/ai-elements/model-picker.js +1 -6
- package/dist/src/ai-elements/model-selector.js +0 -4
- package/dist/src/ai-elements/prompt-input-speech.js +0 -13
- package/dist/src/ai-elements/prompt-input.js +0 -1
- package/dist/src/ai-elements/provider-icon.js +0 -4
- package/dist/src/ai-elements/queue.js +0 -15
- package/dist/src/ai-elements/shimmer.js +0 -14
- package/dist/src/ai-elements/speech-input.js +0 -7
- package/dist/src/artifacts/artifact-frame.js +0 -2
- package/dist/src/audio/playChime.js +0 -2
- package/dist/src/audio/playTone.js +1 -4
- package/dist/src/brand/AppWordmark.js +0 -5
- package/dist/src/brand/svg.js +0 -6
- package/dist/src/client.js +0 -43
- package/dist/src/composer/Composer.js +0 -27
- package/dist/src/composer/input-area/InputArea.js +0 -3
- package/dist/src/composer/input-area/InputAreaEditor.js +1 -50
- package/dist/src/composer/input-area/composerPrediction.js +0 -3
- package/dist/src/generative-ui/content.js +0 -2
- package/dist/src/generative-ui/index.js +0 -3
- package/dist/src/generative-ui/layout.js +0 -5
- package/dist/src/hooks/use-count-up-display.js +0 -2
- package/dist/src/hooks/use-idle-callback.js +0 -3
- package/dist/src/hooks/use-persisted-scroll-parent.js +1 -8
- package/dist/src/icons/animated/index.js +0 -4
- package/dist/src/icons/board-icon.js +74 -41
- package/dist/src/icons/bolt-icon.js +30 -20
- package/dist/src/icons/building-icon.js +125 -61
- package/dist/src/icons/files-icon.js +103 -43
- package/dist/src/icons/inbox-icon.js +101 -49
- package/dist/src/icons/index.js +2 -1
- package/dist/src/icons/memory-icon.js +135 -58
- package/dist/src/icons/search-icon.js +143 -46
- package/dist/src/icons/settings-icon.js +113 -53
- package/dist/src/icons/solid-icons.js +665 -0
- package/dist/src/icons/with-active.js +25 -0
- package/dist/src/index.js +0 -40
- package/dist/src/kibo/gantt-features.js +0 -10
- package/dist/src/kibo/gantt-provider.js +0 -34
- package/dist/src/kibo/kanban.js +0 -15
- package/dist/src/kibo/list.js +0 -3
- package/dist/src/kibo/video-player.js +0 -7
- package/dist/src/logos/index.js +0 -4
- package/dist/src/markdown/Markdown.js +0 -15
- package/dist/src/markdown/MarkdownCodeBlock.js +0 -16
- package/dist/src/markdown/MarkdownInlineCode.js +0 -6
- package/dist/src/markdown/MarkdownLink.js +0 -5
- package/dist/src/markdown/codeFence.js +0 -1
- package/dist/src/markdown/codeHighlight.js +0 -19
- package/dist/src/markdown/incrementalBlocks.js +0 -45
- package/dist/src/markdown/markdownClipboard.js +0 -13
- package/dist/src/markdown/mermaid.js +0 -25
- package/dist/src/markdown/rehypeGithubAlerts.js +0 -4
- package/dist/src/markdown/useSmoothText.js +0 -5
- package/dist/src/marketing/PricingModal.js +0 -2
- package/dist/src/marketing/ProductHero.js +0 -2
- package/dist/src/marketing/createLandingKit.js +0 -5
- package/dist/src/marketing/marketing-classes.js +0 -7
- package/dist/src/motion/dock-motion.js +0 -27
- package/dist/src/motion/panel-transition.js +0 -2
- package/dist/src/ui/_field-classes.js +0 -3
- package/dist/src/ui/_menu-classes.js +0 -6
- package/dist/src/ui/_picker-classes.js +0 -9
- package/dist/src/ui/accordion.alt.js +0 -12
- package/dist/src/ui/badge.js +0 -1
- package/dist/src/ui/border-beam.js +0 -2
- package/dist/src/ui/breadcrumb.js +0 -15
- package/dist/src/ui/bulk-action-bar.js +0 -11
- package/dist/src/ui/button.js +0 -20
- package/dist/src/ui/calendar.js +1 -20
- package/dist/src/ui/card.js +0 -3
- package/dist/src/ui/carousel.js +0 -1
- package/dist/src/ui/clear-input.alt.js +0 -9
- package/dist/src/ui/clearInputDissolve.js +0 -4
- package/dist/src/ui/command.js +0 -15
- package/dist/src/ui/confetti-burst.js +0 -3
- package/dist/src/ui/confirm-dialog-parts.js +0 -11
- package/dist/src/ui/confirm-dialog.js +0 -6
- package/dist/src/ui/crossfade-icon.js +0 -2
- package/dist/src/ui/date-picker.js +0 -22
- package/dist/src/ui/dialog.js +0 -5
- package/dist/src/ui/empty-state.js +0 -7
- package/dist/src/ui/field.js +0 -21
- package/dist/src/ui/image-lightbox.js +0 -5
- package/dist/src/ui/input-group.alt.js +0 -24
- package/dist/src/ui/input-group.js +0 -4
- package/dist/src/ui/kbd.js +0 -3
- package/dist/src/ui/loading-state.js +0 -17
- package/dist/src/ui/marquee-on-hover.js +0 -3
- package/dist/src/ui/media-preview.js +0 -2
- package/dist/src/ui/modalTransition.js +0 -33
- package/dist/src/ui/overlay-a11y.js +0 -1
- package/dist/src/ui/page-title.js +0 -3
- package/dist/src/ui/refresh-spin-icon.js +0 -12
- package/dist/src/ui/search-input.js +0 -1
- package/dist/src/ui/select-field.js +0 -1
- package/dist/src/ui/send-queue-icon.js +0 -3
- package/dist/src/ui/sheet.js +0 -33
- package/dist/src/ui/slider.js +103 -82
- package/dist/src/ui/sonner-icons.js +0 -5
- package/dist/src/ui/sonner.js +0 -60
- package/dist/src/ui/spinner.js +0 -35
- package/dist/src/ui/status-dot.js +0 -2
- package/dist/src/ui/surface.js +0 -14
- package/dist/src/ui/switch.js +213 -36
- package/dist/src/ui/table.js +0 -1
- package/dist/src/ui/tabs-transition.js +0 -1
- package/dist/src/ui/tabs.js +0 -17
- package/dist/src/ui/tabsSliding.js +0 -6
- package/dist/src/ui/time-picker.js +0 -15
- package/dist/src/ui/toggle-search.js +0 -3
- package/dist/src/ui/ui-config.js +0 -16
- package/dist/src/utils/cat-color.js +0 -17
- package/dist/src/utils/cn.js +0 -5
- package/dist/src/utils/gesture.js +0 -8
- package/dist/src/utils/ref.js +0 -1
- package/dist/src/utils/runtimeVisibility.js +1 -22
- package/dist/src/utils/surface-radius.js +0 -11
- package/dist/src/utils/useDragSensors.js +0 -4
- package/dist/tokens/src/tailwind-preset.mjs +0 -3
- package/package.json +1 -1
- package/scripts/build-brand-assets.mjs +0 -8
- package/shell/src/AppShell.tsx +0 -37
- package/shell/src/AppSidebar.tsx +0 -14
- package/shell/src/ButtonTrack.tsx +0 -1
- package/shell/src/PageHeaderBar.tsx +0 -61
- package/shell/src/PageWrapper.tsx +0 -26
- package/shell/src/PillTabs.tsx +0 -1
- package/shell/src/SessionsHoverCard.tsx +0 -40
- package/shell/src/SidePanelTabs.tsx +0 -61
- package/shell/src/Sidebar.tsx +0 -1
- package/shell/src/SidebarAccountMenu.tsx +0 -40
- package/shell/src/SidebarChrome.tsx +0 -32
- package/shell/src/SidebarIconTooltip.tsx +0 -3
- package/shell/src/SidebarPanel.tsx +0 -20
- package/shell/src/SidebarRail.tsx +0 -44
- package/shell/src/SidebarResize.tsx +0 -6
- package/shell/src/SidebarUpgradeCard.tsx +0 -2
- package/shell/src/SignOutDialog.tsx +0 -6
- package/shell/src/app-shell-classes.ts +0 -15
- package/shell/src/index.ts +0 -1
- package/shell/src/shell-panel-motion.ts +0 -11
- package/shell/src/shell-variant.ts +0 -6
- package/src/ai-elements/activity-question.tsx +0 -2
- package/src/ai-elements/activity-shared.tsx +0 -11
- package/src/ai-elements/activity-step-detail.tsx +0 -2
- package/src/ai-elements/activity-step-label.ts +0 -5
- package/src/ai-elements/activity-step-types.ts +0 -24
- package/src/ai-elements/activity-tasks-utils.ts +0 -13
- package/src/ai-elements/activity-tasks.tsx +0 -61
- package/src/ai-elements/artifact.tsx +0 -7
- package/src/ai-elements/attachments.tsx +0 -33
- package/src/ai-elements/chat-day-divider.tsx +0 -3
- package/src/ai-elements/chat-jump-rail.tsx +0 -9
- package/src/ai-elements/code-block.tsx +0 -28
- package/src/ai-elements/collapsible-user-message-body.tsx +0 -2
- package/src/ai-elements/context.tsx +0 -10
- package/src/ai-elements/conversation.tsx +0 -16
- package/src/ai-elements/jump-rail.tsx +0 -31
- package/src/ai-elements/message.tsx +0 -32
- package/src/ai-elements/model-picker-content.tsx +0 -17
- package/src/ai-elements/model-picker-types.ts +0 -5
- package/src/ai-elements/model-picker.tsx +0 -36
- package/src/ai-elements/model-selector.tsx +0 -5
- package/src/ai-elements/prompt-input-speech.tsx +0 -11
- package/src/ai-elements/prompt-input.tsx +0 -26
- package/src/ai-elements/provider-icon.tsx +0 -2
- package/src/ai-elements/queue.tsx +0 -19
- package/src/ai-elements/reasoning.tsx +0 -4
- package/src/ai-elements/shimmer.tsx +0 -16
- package/src/ai-elements/simple-model-ladder.tsx +0 -1
- package/src/ai-elements/speech-input.tsx +0 -6
- package/src/ai-elements/test-results.tsx +0 -5
- package/src/ai-elements/trace.tsx +0 -2
- package/src/ai-elements/web-preview.tsx +0 -7
- package/src/artifacts/artifact-card.tsx +0 -7
- package/src/artifacts/artifact-dialogs.tsx +0 -4
- package/src/artifacts/artifact-frame.tsx +0 -10
- package/src/artifacts/artifact-list-toolbar.tsx +0 -6
- package/src/artifacts/artifact-list.tsx +0 -4
- package/src/artifacts/artifact-type-icon.tsx +0 -1
- package/src/artifacts/artifact-versions-menu.tsx +0 -3
- package/src/artifacts/artifact-viewer.tsx +0 -5
- package/src/artifacts/types.ts +0 -1
- package/src/audio/playChime.ts +0 -1
- package/src/audio/playTone.ts +0 -7
- package/src/brand/AppIcons.tsx +0 -5
- package/src/brand/AppMark.tsx +0 -6
- package/src/brand/AppWordmark.tsx +0 -10
- package/src/brand/familyApps.ts +0 -2
- package/src/brand/svg.ts +0 -9
- package/src/client.ts +0 -34
- package/src/composer/Composer.tsx +0 -70
- package/src/composer/input-area/ComposerSlashMenu.tsx +0 -1
- package/src/composer/input-area/ConnectionStatusMenuItem.tsx +0 -2
- package/src/composer/input-area/FadePresence.tsx +0 -4
- package/src/composer/input-area/InputActions.tsx +0 -5
- package/src/composer/input-area/InputArea.tsx +1 -28
- package/src/composer/input-area/InputAreaEditor.tsx +0 -39
- package/src/composer/input-area/InputBanners.tsx +0 -1
- package/src/composer/input-area/PromoBanner.tsx +0 -1
- package/src/composer/input-area/composerPrediction.ts +0 -2
- package/src/composer/input-area/useComposerSlashMenu.ts +0 -1
- package/src/composer/input-area/useInputAreaPrediction.ts +0 -1
- package/src/composer/prediction.ts +0 -6
- package/src/composer/useComposerPrediction.ts +0 -2
- package/src/generative-ui/GenerativeUiPanel.tsx +0 -11
- package/src/generative-ui/content.tsx +0 -2
- package/src/generative-ui/index.ts +0 -3
- package/src/generative-ui/layout.tsx +0 -5
- package/src/hooks/use-count-up-display.ts +0 -1
- package/src/hooks/use-idle-callback.ts +0 -5
- package/src/hooks/use-persisted-scroll-parent.ts +0 -4
- package/src/hooks/use-single-flight.ts +0 -5
- package/src/icons/animated/animated-bell-icon.tsx +0 -6
- package/src/icons/animated/animated-counter.tsx +0 -5
- package/src/icons/animated/animated-key-icon.tsx +0 -4
- package/src/icons/animated/animated-notification-icon.tsx +0 -14
- package/src/icons/animated/animated-progress.tsx +0 -10
- package/src/icons/animated/animated-status-dot.tsx +0 -4
- package/src/icons/animated/index.ts +0 -4
- package/src/icons/animated/morphing-menu-icon.tsx +0 -5
- package/src/icons/animated/morphing-mic-icon.tsx +0 -2
- package/src/icons/animated/pulsing-rings.tsx +0 -4
- package/src/icons/automation-icon.tsx +0 -1
- package/src/icons/board-icon.tsx +13 -10
- package/src/icons/bolt-icon.tsx +5 -4
- package/src/icons/building-icon.tsx +11 -9
- package/src/icons/draft-icon.tsx +0 -1
- package/src/icons/files-icon.tsx +9 -5
- package/src/icons/inbox-arrow-icon.tsx +0 -1
- package/src/icons/inbox-icon.tsx +9 -5
- package/src/icons/index.ts +12 -1
- package/src/icons/memory-icon.tsx +9 -11
- package/src/icons/nav-icon-base.tsx +0 -10
- package/src/icons/search-icon.tsx +7 -6
- package/src/icons/settings-icon.tsx +11 -13
- package/src/icons/sidebar-toggle-icon.tsx +0 -1
- package/src/icons/solid-icons.tsx +138 -0
- package/src/icons/with-active.tsx +14 -0
- package/src/index.ts +0 -30
- package/src/kibo/gantt-features.tsx +0 -16
- package/src/kibo/gantt-header.tsx +0 -4
- package/src/kibo/gantt-provider.tsx +0 -36
- package/src/kibo/gantt-sidebar.tsx +0 -7
- package/src/kibo/gantt-timeline.tsx +0 -4
- package/src/kibo/kanban.tsx +0 -49
- package/src/kibo/list.tsx +0 -8
- package/src/kibo/theme-switcher.tsx +0 -5
- package/src/kibo/video-player.tsx +0 -9
- package/src/logos/index.ts +0 -3
- package/src/logos/logo-svg.tsx +0 -5
- package/src/markdown/Markdown.tsx +0 -20
- package/src/markdown/MarkdownCodeBlock.tsx +0 -14
- package/src/markdown/MarkdownInlineCode.tsx +0 -6
- package/src/markdown/MarkdownLink.tsx +0 -4
- package/src/markdown/codeFence.ts +0 -3
- package/src/markdown/codeHighlight.ts +0 -16
- package/src/markdown/incrementalBlocks.ts +0 -49
- package/src/markdown/markdownClipboard.ts +0 -12
- package/src/markdown/mermaid.ts +0 -22
- package/src/markdown/rehypeGithubAlerts.ts +0 -3
- package/src/markdown/useSmoothText.ts +0 -5
- package/src/marketing/FloatingBar.tsx +0 -3
- package/src/marketing/PricingModal.tsx +0 -45
- package/src/marketing/ProductHero.tsx +0 -23
- package/src/marketing/ProductHeroOrbit.tsx +0 -5
- package/src/marketing/SiteFooter.tsx +0 -23
- package/src/marketing/SiteHeader.tsx +0 -14
- package/src/marketing/VProPricingModal.tsx +0 -5
- package/src/marketing/createLandingKit.tsx +0 -12
- package/src/marketing/landing.tsx +0 -12
- package/src/marketing/marketing-classes.ts +0 -7
- package/src/motion/dock-motion.ts +0 -25
- package/src/motion/list-enter.tsx +0 -4
- package/src/motion/panel-transition.tsx +0 -5
- package/src/ui/_field-classes.ts +0 -2
- package/src/ui/_menu-classes.ts +0 -4
- package/src/ui/_menu-parts.tsx +0 -5
- package/src/ui/_picker-classes.ts +0 -6
- package/src/ui/accordion.alt.tsx +0 -8
- package/src/ui/accordion.tsx +0 -4
- package/src/ui/badge.tsx +0 -1
- package/src/ui/border-beam.tsx +0 -11
- package/src/ui/breadcrumb.tsx +0 -13
- package/src/ui/bulk-action-bar.tsx +0 -24
- package/src/ui/button.tsx +0 -27
- package/src/ui/calendar.tsx +0 -18
- package/src/ui/card.tsx +0 -3
- package/src/ui/carousel.tsx +0 -4
- package/src/ui/checkbox.tsx +0 -1
- package/src/ui/clear-input.alt.tsx +0 -8
- package/src/ui/clear-input.tsx +0 -16
- package/src/ui/clearInputDissolve.ts +0 -4
- package/src/ui/command.tsx +0 -22
- package/src/ui/confetti-burst.tsx +0 -4
- package/src/ui/confirm-dialog-parts.tsx +0 -45
- package/src/ui/confirm-dialog.tsx +0 -26
- package/src/ui/context-menu.tsx +0 -10
- package/src/ui/count-pop.tsx +0 -2
- package/src/ui/crossfade-icon.tsx +0 -3
- package/src/ui/date-picker.tsx +0 -40
- package/src/ui/dialog.tsx +0 -18
- package/src/ui/dropdown-menu.tsx +0 -11
- package/src/ui/empty-state.tsx +0 -15
- package/src/ui/error-boundary.tsx +0 -7
- package/src/ui/field.tsx +0 -18
- package/src/ui/hover-card.tsx +0 -6
- package/src/ui/image-lightbox.tsx +0 -7
- package/src/ui/input-group.alt.tsx +0 -16
- package/src/ui/input-group.tsx +0 -3
- package/src/ui/kbd.tsx +0 -3
- package/src/ui/label.tsx +0 -1
- package/src/ui/labeled-slider-row.tsx +0 -2
- package/src/ui/list-row.tsx +0 -46
- package/src/ui/loading-state.tsx +0 -23
- package/src/ui/marquee-on-hover.tsx +1 -6
- package/src/ui/media-preview.tsx +0 -5
- package/src/ui/modalTransition.ts +0 -25
- package/src/ui/overlay-a11y.ts +0 -1
- package/src/ui/page-title.tsx +0 -4
- package/src/ui/popover.tsx +0 -8
- package/src/ui/progress.tsx +0 -1
- package/src/ui/refresh-spin-icon.tsx +0 -11
- package/src/ui/relative-date-time.tsx +0 -3
- package/src/ui/rolling-number.tsx +0 -2
- package/src/ui/search-input.tsx +0 -9
- package/src/ui/select-field.tsx +0 -5
- package/src/ui/select.tsx +0 -8
- package/src/ui/send-queue-icon.tsx +0 -3
- package/src/ui/separator.tsx +0 -1
- package/src/ui/sheet.tsx +0 -42
- package/src/ui/slide-over-panel.tsx +0 -2
- package/src/ui/slider.tsx +21 -9
- package/src/ui/sonner-icons.tsx +0 -4
- package/src/ui/sonner.tsx +0 -78
- package/src/ui/spinner.tsx +0 -50
- package/src/ui/status-dot.tsx +0 -10
- package/src/ui/surface.tsx +0 -13
- package/src/ui/switch.tsx +72 -3
- package/src/ui/table.tsx +0 -3
- package/src/ui/tabs-transition.tsx +0 -12
- package/src/ui/tabs.tsx +0 -17
- package/src/ui/tabsSliding.ts +0 -5
- package/src/ui/time-picker.tsx +0 -17
- package/src/ui/toggle-search.tsx +0 -6
- package/src/ui/toolbar-search-input.tsx +0 -3
- package/src/ui/tooltip.tsx +0 -5
- package/src/ui/ui-config.tsx +0 -19
- package/src/utils/cat-color.ts +0 -20
- package/src/utils/cn.ts +0 -4
- package/src/utils/gesture.ts +0 -8
- package/src/utils/ref.ts +0 -1
- package/src/utils/runtimeVisibility.ts +0 -19
- package/src/utils/surface-radius.ts +0 -11
- package/src/utils/useDragSensors.ts +0 -2
- package/tokens/examples/compat-shadcn-rgb/vite.config.ts +0 -2
- package/tokens/examples/toaster/Fixture.tsx +0 -4
- package/tokens/examples/toaster/UpdateToastFixture.tsx +0 -4
- package/tokens/examples/toaster/vite.config.ts +0 -2
- package/tokens/examples/tokens-moved/Fixture.tsx +0 -4
- package/tokens/examples/tokens-moved/vite.config.ts +0 -2
- package/tokens/src/tailwind-preset.mjs +0 -3
package/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 };
|
package/src/ui/context-menu.tsx
CHANGED
|
@@ -25,7 +25,6 @@ import { useCn, useUiConfig } from "./ui-config";
|
|
|
25
25
|
|
|
26
26
|
/** App defaults for `ContextMenu*` (see `UiConfigProvider`). */
|
|
27
27
|
export interface ContextMenuConfig extends MenuConfig {
|
|
28
|
-
/** Default for `ContextMenuSubContent` `portal` (built-in: `true`). */
|
|
29
28
|
subContentPortal?: boolean;
|
|
30
29
|
}
|
|
31
30
|
|
|
@@ -36,8 +35,6 @@ const ContextMenuTrigger = React.forwardRef<
|
|
|
36
35
|
>((props, ref) => {
|
|
37
36
|
const trigger = useUiConfig("ContextMenu")?.classes?.trigger;
|
|
38
37
|
const merge = useCn();
|
|
39
|
-
// Without config, pass props untouched: Radix's Slot turns an explicit
|
|
40
|
-
// `className={undefined}` into `class=""`.
|
|
41
38
|
if (trigger === undefined) return <ContextMenuPrimitive.Trigger ref={ref} {...props} />;
|
|
42
39
|
const { className, ...rest } = props;
|
|
43
40
|
return <ContextMenuPrimitive.Trigger ref={ref} className={merge(trigger, className)} {...rest} />;
|
|
@@ -52,7 +49,6 @@ const ContextMenuSubTrigger = React.forwardRef<
|
|
|
52
49
|
React.ComponentRef<typeof ContextMenuPrimitive.SubTrigger>,
|
|
53
50
|
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {
|
|
54
51
|
inset?: boolean;
|
|
55
|
-
/** Leading icon or mark. The label then fills the row. */
|
|
56
52
|
startContent?: React.ReactNode;
|
|
57
53
|
}
|
|
58
54
|
>(({ className, inset, startContent, children, ...props }, ref) => {
|
|
@@ -76,7 +72,6 @@ ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
|
|
|
76
72
|
const ContextMenuSubContent = React.forwardRef<
|
|
77
73
|
React.ComponentRef<typeof ContextMenuPrimitive.SubContent>,
|
|
78
74
|
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent> & {
|
|
79
|
-
/** Render into `document.body` so a clipping parent cannot cut it off. */
|
|
80
75
|
portal?: boolean;
|
|
81
76
|
}
|
|
82
77
|
>(({ className, portal, ...props }, ref) => {
|
|
@@ -100,7 +95,6 @@ ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
|
|
|
100
95
|
const ContextMenuContent = React.forwardRef<
|
|
101
96
|
React.ComponentRef<typeof ContextMenuPrimitive.Content>,
|
|
102
97
|
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content> & {
|
|
103
|
-
/** Stop a bare Alt press from moving focus (e.g. into the browser menu bar). */
|
|
104
98
|
suppressAltKey?: boolean;
|
|
105
99
|
}
|
|
106
100
|
>(({ className, suppressAltKey, collisionPadding, onKeyDown, ...props }, ref) => {
|
|
@@ -124,13 +118,9 @@ const ContextMenuItem = React.forwardRef<
|
|
|
124
118
|
React.ComponentRef<typeof ContextMenuPrimitive.Item>,
|
|
125
119
|
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {
|
|
126
120
|
inset?: boolean;
|
|
127
|
-
/** `"destructive"` shows red text and a red highlight, for delete and similar. Default `"default"`. */
|
|
128
121
|
variant?: "default" | "destructive";
|
|
129
|
-
/** Leading icon or mark. Ignored with `asChild`. */
|
|
130
122
|
startContent?: React.ReactNode;
|
|
131
|
-
/** Second line under the label. Ignored with `asChild`. */
|
|
132
123
|
description?: React.ReactNode;
|
|
133
|
-
/** Trailing content. Ignored with `asChild`. */
|
|
134
124
|
endContent?: React.ReactNode;
|
|
135
125
|
}
|
|
136
126
|
>(
|
package/src/ui/count-pop.tsx
CHANGED
|
@@ -20,10 +20,8 @@ export function CountPop({
|
|
|
20
20
|
className,
|
|
21
21
|
children,
|
|
22
22
|
}: {
|
|
23
|
-
/** Rendered content, and the remount key. `null` renders nothing. */
|
|
24
23
|
label: string | null;
|
|
25
24
|
className?: string;
|
|
26
|
-
/** Defaults to `label`; pass children for a badge with more than a number. */
|
|
27
25
|
children?: ReactNode;
|
|
28
26
|
}) {
|
|
29
27
|
return (
|
|
@@ -20,7 +20,6 @@ const DEFAULT_ICON_MOTION = {
|
|
|
20
20
|
transition: DEFAULT_TRANSITION,
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
/** Near-imperceptible swap for high-frequency toggles (150ms, no blur). */
|
|
24
23
|
const SOFT_ICON_MOTION = {
|
|
25
24
|
initial: { scale: 0.96, opacity: 0 },
|
|
26
25
|
animate: { scale: 1, opacity: 1 },
|
|
@@ -35,7 +34,6 @@ interface CrossfadeIconProps {
|
|
|
35
34
|
trueKey?: string;
|
|
36
35
|
falseKey?: string;
|
|
37
36
|
className?: string;
|
|
38
|
-
/** `soft` = opacity + scale(0.96→1), no blur — for tens/day toggles. */
|
|
39
37
|
variant?: "default" | "soft";
|
|
40
38
|
}
|
|
41
39
|
|
|
@@ -96,7 +94,6 @@ export function CrossfadeIconSlot({
|
|
|
96
94
|
className = "relative flex size-4 items-center justify-center",
|
|
97
95
|
variant = "soft",
|
|
98
96
|
}: {
|
|
99
|
-
/** Identity of the icon currently shown; a change triggers the swap. */
|
|
100
97
|
iconKey: string;
|
|
101
98
|
children: ReactNode;
|
|
102
99
|
className?: string;
|
package/src/ui/date-picker.tsx
CHANGED
|
@@ -20,28 +20,18 @@ import { Calendar } from "./calendar";
|
|
|
20
20
|
import { Popover, PopoverContent, PopoverTrigger } from "./popover";
|
|
21
21
|
import { TimePicker } from "./time-picker";
|
|
22
22
|
|
|
23
|
-
// controlled replacements for `<input type="date">`, `"datetime-local"` and
|
|
24
|
-
// `"month">`: the values are the native strings ("YYYY-MM-DD",
|
|
25
|
-
// "YYYY-MM-DDTHH:mm", "YYYY-MM", "" when empty), read and written as local
|
|
26
|
-
// calendar dates. there is no timezone logic; like TimePicker, the consumer
|
|
27
|
-
// owns any local↔utc conversion
|
|
28
|
-
|
|
29
23
|
const DATE_RE = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
30
24
|
const MONTH_RE = /^(\d{4})-(\d{2})$/;
|
|
31
25
|
const DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2})$/;
|
|
32
26
|
|
|
33
27
|
const pad = (n: number, width = 2) => String(n).padStart(width, "0");
|
|
34
28
|
|
|
35
|
-
// "YYYY-MM-DD" -> local midnight, or undefined for "" and invalid dates
|
|
36
|
-
// (2025-02-30). never `new Date("YYYY-MM-DD")`, which parses as utc midnight
|
|
37
|
-
// and lands on the previous day west of greenwich
|
|
38
29
|
function parseDateValue(value: string): Date | undefined {
|
|
39
30
|
const match = DATE_RE.exec(value);
|
|
40
31
|
if (!match) return undefined;
|
|
41
32
|
const year = Number(match[1]);
|
|
42
33
|
const month = Number(match[2]) - 1;
|
|
43
34
|
const day = Number(match[3]);
|
|
44
|
-
// setFullYear keeps years 0-99 literal (the Date constructor maps them to 19xx)
|
|
45
35
|
const date = new Date(2000, 0, 1);
|
|
46
36
|
date.setFullYear(year, month, day);
|
|
47
37
|
if (
|
|
@@ -54,7 +44,6 @@ function parseDateValue(value: string): Date | undefined {
|
|
|
54
44
|
return date;
|
|
55
45
|
}
|
|
56
46
|
|
|
57
|
-
// local calendar date -> "YYYY-MM-DD" ("" for an invalid date)
|
|
58
47
|
function formatDateValue(date: Date): string {
|
|
59
48
|
if (Number.isNaN(date.getTime())) return "";
|
|
60
49
|
return `${pad(date.getFullYear(), 4)}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
|
|
@@ -80,11 +69,6 @@ function localDate(year: number, month: number): Date {
|
|
|
80
69
|
return date;
|
|
81
70
|
}
|
|
82
71
|
|
|
83
|
-
// wrapper, input-styled trigger, optional clear control and hidden input
|
|
84
|
-
// shared by DatePicker and MonthPicker. the clear control is a sibling of the
|
|
85
|
-
// trigger (buttons cannot nest), overlaid inside the field on the right, and
|
|
86
|
-
// hands focus back to the trigger. the trigger grows with the wrapper, so a
|
|
87
|
-
// width on either `className` or `triggerClassName` sizes the field
|
|
88
72
|
interface PickerFieldProps {
|
|
89
73
|
triggerRef: React.Ref<HTMLButtonElement>;
|
|
90
74
|
open: boolean;
|
|
@@ -182,27 +166,18 @@ function PickerField({
|
|
|
182
166
|
}
|
|
183
167
|
|
|
184
168
|
interface DatePickerProps {
|
|
185
|
-
// "YYYY-MM-DD" or "" (what `<input type="date">` uses)
|
|
186
169
|
value: string;
|
|
187
170
|
onChange: (value: string) => void;
|
|
188
|
-
// "YYYY-MM-DD"; days outside the range are disabled
|
|
189
171
|
min?: string;
|
|
190
172
|
max?: string;
|
|
191
173
|
placeholder?: string;
|
|
192
174
|
disabled?: boolean;
|
|
193
|
-
// names the trigger; the shown date or placeholder is appended
|
|
194
175
|
ariaLabel?: string;
|
|
195
|
-
// the wrapper (trigger plus clear control)
|
|
196
176
|
className?: string;
|
|
197
|
-
// merged onto the trigger (default width `w-40`); `w-full`, height, radius,
|
|
198
|
-
// padding and text size override cleanly
|
|
199
177
|
triggerClassName?: string;
|
|
200
|
-
// shows a clear control that calls `onChange("")`
|
|
201
178
|
clearable?: boolean;
|
|
202
|
-
// BCP 47 locale for the trigger text (default: the runtime's)
|
|
203
179
|
locale?: string;
|
|
204
180
|
id?: string;
|
|
205
|
-
// renders a hidden input with `value` so forms still submit it
|
|
206
181
|
name?: string;
|
|
207
182
|
}
|
|
208
183
|
|
|
@@ -280,25 +255,16 @@ const DatePicker = React.forwardRef<HTMLButtonElement, DatePickerProps>(
|
|
|
280
255
|
DatePicker.displayName = "DatePicker";
|
|
281
256
|
|
|
282
257
|
interface DateTimePickerProps {
|
|
283
|
-
// "YYYY-MM-DDTHH:mm" or "" (what `<input type="datetime-local">` uses)
|
|
284
258
|
value: string;
|
|
285
259
|
onChange: (value: string) => void;
|
|
286
|
-
// "YYYY-MM-DDTHH:mm"; only the date part limits the calendar
|
|
287
260
|
min?: string;
|
|
288
261
|
max?: string;
|
|
289
|
-
// time used when a date is picked before any time (default "00:00")
|
|
290
262
|
defaultTime?: string;
|
|
291
263
|
disabled?: boolean;
|
|
292
|
-
// names both triggers ("<label>, date" and "<label>, time")
|
|
293
264
|
ariaLabel?: string;
|
|
294
|
-
// the row; a width here (`w-full`) grows the date field, the time keeps 110px
|
|
295
265
|
className?: string;
|
|
296
|
-
// merged onto both triggers (height, radius, padding, text size); a width
|
|
297
|
-
// applies to the date trigger only, the time keeps 110px
|
|
298
266
|
triggerClassName?: string;
|
|
299
|
-
// on the date trigger
|
|
300
267
|
id?: string;
|
|
301
|
-
// renders a hidden input with the combined value
|
|
302
268
|
name?: string;
|
|
303
269
|
locale?: string;
|
|
304
270
|
}
|
|
@@ -362,17 +328,14 @@ const DateTimePicker = React.forwardRef<HTMLButtonElement, DateTimePickerProps>(
|
|
|
362
328
|
DateTimePicker.displayName = "DateTimePicker";
|
|
363
329
|
|
|
364
330
|
interface MonthPickerProps {
|
|
365
|
-
// "YYYY-MM" or "" (what `<input type="month">` uses)
|
|
366
331
|
value: string;
|
|
367
332
|
onChange: (value: string) => void;
|
|
368
|
-
// "YYYY-MM"; months outside the range are disabled
|
|
369
333
|
min?: string;
|
|
370
334
|
max?: string;
|
|
371
335
|
placeholder?: string;
|
|
372
336
|
disabled?: boolean;
|
|
373
337
|
ariaLabel?: string;
|
|
374
338
|
className?: string;
|
|
375
|
-
// merged onto the trigger, as on DatePicker
|
|
376
339
|
triggerClassName?: string;
|
|
377
340
|
clearable?: boolean;
|
|
378
341
|
locale?: string;
|
|
@@ -454,8 +417,6 @@ interface MonthGridProps {
|
|
|
454
417
|
onSelect: (value: string) => void;
|
|
455
418
|
}
|
|
456
419
|
|
|
457
|
-
// mounted only while the popover is open, so the shown year starts at the
|
|
458
|
-
// selected one (else the current year, kept inside min/max) on every open
|
|
459
420
|
function MonthGrid({ value, min, max, locale, onSelect }: MonthGridProps) {
|
|
460
421
|
const minYear = parseMonthValue(min ?? "")?.year;
|
|
461
422
|
const maxYear = parseMonthValue(max ?? "")?.year;
|
|
@@ -506,7 +467,6 @@ function MonthGrid({ value, min, max, locale, onSelect }: MonthGridProps) {
|
|
|
506
467
|
const monthValue = formatMonthValue(year, month);
|
|
507
468
|
const date = localDate(year, month);
|
|
508
469
|
const isSelected = monthValue === value;
|
|
509
|
-
// "YYYY-MM" strings compare in calendar order
|
|
510
470
|
const outOfRange =
|
|
511
471
|
(!!min && monthValue < min) || (!!max && monthValue > max);
|
|
512
472
|
return (
|
package/src/ui/dialog.tsx
CHANGED
|
@@ -15,15 +15,11 @@ import { useCn, useUiConfig } from "./ui-config";
|
|
|
15
15
|
|
|
16
16
|
/** App defaults for `Dialog*` (see `UiConfigProvider`). */
|
|
17
17
|
export interface DialogConfig {
|
|
18
|
-
/** Replaces the built-in classes of a part. */
|
|
19
18
|
classes?: {
|
|
20
19
|
trigger?: string;
|
|
21
20
|
overlay?: string;
|
|
22
|
-
/** Content classes shared by both layouts. */
|
|
23
21
|
content?: string;
|
|
24
|
-
/** Content layout classes for the centred dialog. */
|
|
25
22
|
centered?: string;
|
|
26
|
-
/** Content layout classes for the compact bottom sheet. */
|
|
27
23
|
compact?: string;
|
|
28
24
|
close?: string;
|
|
29
25
|
header?: string;
|
|
@@ -32,7 +28,6 @@ export interface DialogConfig {
|
|
|
32
28
|
title?: string;
|
|
33
29
|
description?: string;
|
|
34
30
|
};
|
|
35
|
-
/** Default for `DialogContent` `viewportAware`. */
|
|
36
31
|
viewportAware?: boolean;
|
|
37
32
|
}
|
|
38
33
|
|
|
@@ -46,8 +41,6 @@ const DialogTrigger = React.forwardRef<
|
|
|
46
41
|
>((props, ref) => {
|
|
47
42
|
const trigger = useUiConfig("Dialog")?.classes?.trigger;
|
|
48
43
|
const merge = useCn();
|
|
49
|
-
// Without config, pass props untouched: Radix's Slot turns an explicit
|
|
50
|
-
// `className={undefined}` into `class=""`.
|
|
51
44
|
if (trigger === undefined) return <DialogPrimitive.Trigger ref={ref} {...props} />;
|
|
52
45
|
const { className, ...rest } = props;
|
|
53
46
|
return <DialogPrimitive.Trigger ref={ref} className={merge(trigger, className)} {...rest} />;
|
|
@@ -82,13 +75,7 @@ const DialogContent = React.forwardRef<
|
|
|
82
75
|
React.ComponentRef<typeof DialogPrimitive.Content>,
|
|
83
76
|
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {
|
|
84
77
|
hideCloseButton?: boolean;
|
|
85
|
-
/**
|
|
86
|
-
* Bottom sheet on compact viewports, visual-viewport sizing, keyboard-aware
|
|
87
|
-
* scrolling and the body pointer-events fix. Default `true`. `false` keeps a
|
|
88
|
-
* centred dialog at every size and leaves the viewport and body alone.
|
|
89
|
-
*/
|
|
90
78
|
viewportAware?: boolean;
|
|
91
|
-
/** Merged onto the `DialogOverlay`, for example to drop its fade. */
|
|
92
79
|
overlayClassName?: string;
|
|
93
80
|
}
|
|
94
81
|
>(
|
|
@@ -283,10 +270,6 @@ const DialogBody = ({
|
|
|
283
270
|
};
|
|
284
271
|
DialogBody.displayName = "DialogBody";
|
|
285
272
|
|
|
286
|
-
// no fill of its own: the footer is not sticky, so it shows the content's
|
|
287
|
-
// surface. a token here (it was `bg-overlay`) showed as an inset block when
|
|
288
|
-
// that surface differs (an app's own `glass-panel-strong`, or `bg-*` on the
|
|
289
|
-
// content)
|
|
290
273
|
const DialogFooter = ({
|
|
291
274
|
className,
|
|
292
275
|
...props
|
|
@@ -340,7 +323,6 @@ const DialogDescription = React.forwardRef<
|
|
|
340
323
|
ref={ref}
|
|
341
324
|
className={merge(
|
|
342
325
|
description ??
|
|
343
|
-
// `--muted` is ~3.5:1 on overlay; mix toward overlay-foreground for 4.5:1.
|
|
344
326
|
"text-sm leading-relaxed text-[color-mix(in_oklch,var(--color-popover-foreground,var(--overlay-foreground))_72%,var(--color-popover,var(--overlay)))]",
|
|
345
327
|
className,
|
|
346
328
|
)}
|
package/src/ui/dropdown-menu.tsx
CHANGED
|
@@ -27,7 +27,6 @@ import { useCn, useUiConfig } from "./ui-config";
|
|
|
27
27
|
|
|
28
28
|
/** App defaults for `DropdownMenu*` (see `UiConfigProvider`). */
|
|
29
29
|
export interface DropdownMenuConfig extends MenuConfig {
|
|
30
|
-
/** Default for `DropdownMenuContent` `sideOffset`. */
|
|
31
30
|
sideOffset?: number;
|
|
32
31
|
}
|
|
33
32
|
|
|
@@ -39,8 +38,6 @@ const DropdownMenuTrigger = React.forwardRef<
|
|
|
39
38
|
>((props, ref) => {
|
|
40
39
|
const trigger = useUiConfig("DropdownMenu")?.classes?.trigger;
|
|
41
40
|
const merge = useCn();
|
|
42
|
-
// Without config, pass props untouched: Radix's Slot turns an explicit
|
|
43
|
-
// `className={undefined}` into `class=""`.
|
|
44
41
|
if (trigger === undefined) return <DropdownMenuPrimitive.Trigger ref={ref} {...props} />;
|
|
45
42
|
const { className, ...rest } = props;
|
|
46
43
|
return <DropdownMenuPrimitive.Trigger ref={ref} className={merge(trigger, className)} {...rest} />;
|
|
@@ -55,7 +52,6 @@ const DropdownMenuSubTrigger = React.forwardRef<
|
|
|
55
52
|
React.ComponentRef<typeof DropdownMenuPrimitive.SubTrigger>,
|
|
56
53
|
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
57
54
|
inset?: boolean;
|
|
58
|
-
/** Leading icon or mark. The label then fills the row. */
|
|
59
55
|
startContent?: React.ReactNode;
|
|
60
56
|
}
|
|
61
57
|
>(({ className, inset, startContent, children, ...props }, ref) => {
|
|
@@ -99,11 +95,8 @@ DropdownMenuSubContent.displayName =
|
|
|
99
95
|
const DropdownMenuContent = React.forwardRef<
|
|
100
96
|
React.ComponentRef<typeof DropdownMenuPrimitive.Content>,
|
|
101
97
|
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content> & {
|
|
102
|
-
/** On small screens, cap the height to the viewport and scroll. */
|
|
103
98
|
fitViewport?: boolean;
|
|
104
|
-
/** Stop a bare Alt press from moving focus (e.g. into the browser menu bar). */
|
|
105
99
|
suppressAltKey?: boolean;
|
|
106
|
-
/** On close, clear any body scroll lock left behind when no dialog is open. */
|
|
107
100
|
restoreScrollLockOnClose?: boolean;
|
|
108
101
|
}
|
|
109
102
|
>(
|
|
@@ -156,13 +149,9 @@ const DropdownMenuItem = React.forwardRef<
|
|
|
156
149
|
React.ComponentRef<typeof DropdownMenuPrimitive.Item>,
|
|
157
150
|
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
|
|
158
151
|
inset?: boolean;
|
|
159
|
-
/** `"destructive"` shows red text and a red highlight, for delete and similar. Default `"default"`. */
|
|
160
152
|
variant?: "default" | "destructive";
|
|
161
|
-
/** Leading icon or mark. Ignored with `asChild`. */
|
|
162
153
|
startContent?: React.ReactNode;
|
|
163
|
-
/** Second line under the label. Ignored with `asChild`. */
|
|
164
154
|
description?: React.ReactNode;
|
|
165
|
-
/** Trailing content. The label then fills the row. Ignored with `asChild`. */
|
|
166
155
|
endContent?: React.ReactNode;
|
|
167
156
|
}
|
|
168
157
|
>(
|
package/src/ui/empty-state.tsx
CHANGED
|
@@ -5,8 +5,6 @@ import { motionEase } from "../motion/presets";
|
|
|
5
5
|
import { useUiConfig } from "./ui-config";
|
|
6
6
|
import { cn } from "../utils/cn";
|
|
7
7
|
|
|
8
|
-
// `default`: open centred block, large bare icon, one muted line (a page or list body).
|
|
9
|
-
// `panel`: filled rounded block with the icon in a tile (a detail panel or modal section).
|
|
10
8
|
export type EmptyStateVariant = "default" | "panel";
|
|
11
9
|
|
|
12
10
|
/**
|
|
@@ -43,13 +41,7 @@ const ITEM_VARIANTS: Variants = {
|
|
|
43
41
|
};
|
|
44
42
|
|
|
45
43
|
export type EmptyStateRootProps = React.ComponentProps<"div"> & {
|
|
46
|
-
/** Layout for the other parts. Default `"default"`. */
|
|
47
44
|
variant?: EmptyStateVariant;
|
|
48
|
-
/**
|
|
49
|
-
* Parts rise and fade in one after another. Default `UiConfig.EmptyState.enter`,
|
|
50
|
-
* else `false`. Pass `false` for an empty state that flashes often (a filter
|
|
51
|
-
* with no results). Uses `m`, so it needs `LazyMotion`.
|
|
52
|
-
*/
|
|
53
45
|
enter?: boolean;
|
|
54
46
|
};
|
|
55
47
|
|
|
@@ -80,7 +72,6 @@ function Root({ variant = "default", enter: enterProp, className, ...props }: Em
|
|
|
80
72
|
}
|
|
81
73
|
Root.displayName = "EmptyState.Root";
|
|
82
74
|
|
|
83
|
-
// The DOM drag and animation handlers clash with Motion's own prop types.
|
|
84
75
|
function stripMotionConflicts(props: React.ComponentProps<"div">) {
|
|
85
76
|
const {
|
|
86
77
|
onDrag: _onDrag,
|
|
@@ -92,19 +83,14 @@ function stripMotionConflicts(props: React.ComponentProps<"div">) {
|
|
|
92
83
|
return rest;
|
|
93
84
|
}
|
|
94
85
|
|
|
95
|
-
/** A part's own element: `m.*` with the item variants while the Root enters. */
|
|
96
86
|
function useItemMotion() {
|
|
97
87
|
return React.use(EmptyStateContext).enter ? { variants: ITEM_VARIANTS } : null;
|
|
98
88
|
}
|
|
99
89
|
|
|
100
90
|
export type EmptyStateIconProps = {
|
|
101
|
-
/** Icon component, e.g. a Tabler icon. */
|
|
102
91
|
icon: React.ComponentType<{ size?: number | string; stroke?: number | string; className?: string }>;
|
|
103
|
-
/** Pixel size. Default 40 (`default`) or 22 (`panel`). */
|
|
104
92
|
size?: number;
|
|
105
|
-
/** Stroke width. Default the icon's own (`default`) or 1.5 (`panel`). */
|
|
106
93
|
stroke?: number;
|
|
107
|
-
/** Classes for the outer element: the icon (`default`) or its tile (`panel`). */
|
|
108
94
|
className?: string;
|
|
109
95
|
};
|
|
110
96
|
|
|
@@ -150,7 +136,6 @@ function Icon({ icon: IconComponent, size, stroke, className }: EmptyStateIconPr
|
|
|
150
136
|
Icon.displayName = "EmptyState.Icon";
|
|
151
137
|
|
|
152
138
|
export type EmptyStateTitleProps = React.ComponentProps<"p"> & {
|
|
153
|
-
/** Render the child element (e.g. an `h3`) with the title classes. */
|
|
154
139
|
asChild?: boolean;
|
|
155
140
|
};
|
|
156
141
|
|