motion-ui-skill 2.0.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/LICENSE +22 -0
- package/README.md +637 -0
- package/SKILL.md +529 -0
- package/agents/openai.yaml +8 -0
- package/bin/index.mjs +242 -0
- package/bin/installer.mjs +457 -0
- package/bin/updater.mjs +207 -0
- package/catalog.json +8120 -0
- package/components/agents/agent-activity/activity-row.tsx +242 -0
- package/components/agents/agent-activity/index.tsx +287 -0
- package/components/agents/agent-activity/types.ts +106 -0
- package/components/agents/agent-code.tsx +171 -0
- package/components/agents/agent-disclosure.tsx +55 -0
- package/components/agents/ai-sidebar.tsx +981 -0
- package/components/agents/approval-card/index.tsx +467 -0
- package/components/agents/approval-card/types.ts +56 -0
- package/components/agents/chat-app.tsx +97 -0
- package/components/agents/citations.tsx +288 -0
- package/components/agents/code-block.tsx +202 -0
- package/components/agents/file-diff.tsx +288 -0
- package/components/agents/image-generation.tsx +388 -0
- package/components/agents/loading-states/agent-progress.tsx +105 -0
- package/components/agents/loading-states/index.ts +13 -0
- package/components/agents/loading-states/reasoning-text.tsx +224 -0
- package/components/agents/loading-states/thinking-shimmer.tsx +27 -0
- package/components/agents/message-bubble.tsx +369 -0
- package/components/agents/message-context.tsx +9 -0
- package/components/agents/message-scroller.tsx +487 -0
- package/components/agents/message.tsx +272 -0
- package/components/agents/prompt-input.tsx +327 -0
- package/components/agents/streaming-response.tsx +263 -0
- package/components/agents/todo-list.tsx +387 -0
- package/components/agents/tool-approval.tsx +276 -0
- package/components/agents/tool-result.tsx +352 -0
- package/components/app/icons.tsx +19 -0
- package/components/audio/music-player-card.tsx +146 -0
- package/components/audio/music-playlist-card.tsx +172 -0
- package/components/audio/now-playing-bar.tsx +116 -0
- package/components/background-gradient/arc-bands-background.tsx +54 -0
- package/components/background-gradient/aurora-background.tsx +49 -0
- package/components/background-gradient/cherry-petal-background.tsx +50 -0
- package/components/background-gradient/coral-glow-background.tsx +47 -0
- package/components/background-gradient/dark-arc-bands-background.tsx +52 -0
- package/components/background-gradient/dark-aurora-background.tsx +52 -0
- package/components/background-gradient/dark-carbon-spotlight-background.tsx +47 -0
- package/components/background-gradient/dark-ember-background.tsx +47 -0
- package/components/background-gradient/dark-ink-field-background.tsx +46 -0
- package/components/background-gradient/dark-midnight-mesh-background.tsx +61 -0
- package/components/background-gradient/dark-rose-noir-background.tsx +52 -0
- package/components/background-gradient/dark-teal-depth-background.tsx +52 -0
- package/components/background-gradient/frost-mesh-background.tsx +56 -0
- package/components/background-gradient/halftone-pop-background.tsx +52 -0
- package/components/background-gradient/honey-ember-background.tsx +47 -0
- package/components/background-gradient/ink-wash-background.tsx +49 -0
- package/components/background-gradient/linen-weave-background.tsx +47 -0
- package/components/background-gradient/mint-lagoon-background.tsx +47 -0
- package/components/background-gradient/paper-fold-background.tsx +52 -0
- package/components/background-gradient/rain-prism-background.tsx +52 -0
- package/components/background-gradient/sand-drift-background.tsx +47 -0
- package/components/background-gradient/soft-spotlight-background.tsx +47 -0
- package/components/background-gradient/sunrise-horizon-background.tsx +51 -0
- package/components/background-gradient/sunset-bloom-background.tsx +47 -0
- package/components/background-gradient/terrazzo-fragment-background.tsx +53 -0
- package/components/background-gradient/tropical-tide-background.tsx +47 -0
- package/components/background-pattern/diagonal-box-pattern.tsx +29 -0
- package/components/background-pattern/dot-grid-pattern.tsx +29 -0
- package/components/background-pattern/fine-grain-pattern.tsx +39 -0
- package/components/background-pattern/graph-paper-pattern.tsx +29 -0
- package/components/background-pattern/line-grid-pattern.tsx +39 -0
- package/components/background-pattern/reverse-diagonal-box-pattern.tsx +30 -0
- package/components/buttons/add-to-cart-button.tsx +190 -0
- package/components/buttons/bookmark-save-button.tsx +105 -0
- package/components/buttons/cinder-latch-button.tsx +80 -0
- package/components/buttons/copy-button.tsx +155 -0
- package/components/buttons/depth-outline-button.tsx +72 -0
- package/components/buttons/dimple-switch.tsx +114 -0
- package/components/buttons/download-button.tsx +186 -0
- package/components/buttons/follow-button.tsx +98 -0
- package/components/buttons/hold-to-delete-button.tsx +205 -0
- package/components/buttons/inset-button.tsx +82 -0
- package/components/buttons/like-button.tsx +135 -0
- package/components/buttons/linen-tab-button.tsx +92 -0
- package/components/buttons/prism-depth-button.tsx +90 -0
- package/components/buttons/quantity-stepper-button.tsx +104 -0
- package/components/buttons/segmented-toggle-button.tsx +134 -0
- package/components/buttons/sheen-pill-button.tsx +127 -0
- package/components/buttons/slate-chip-switch.tsx +94 -0
- package/components/buttons/slide-to-confirm-button.tsx +163 -0
- package/components/buttons/soft-pill-button.tsx +86 -0
- package/components/buttons/soft-ui-button.tsx +59 -0
- package/components/buttons/three-d-button.tsx +99 -0
- package/components/buttons/three-d-icon-button.tsx +88 -0
- package/components/calendar/booking-slot-calendar.tsx +315 -0
- package/components/calendar/date-range-picker-card.tsx +216 -0
- package/components/calendar/event-countdown-card.tsx +105 -0
- package/components/calendar/month-picker-calendar.tsx +183 -0
- package/components/calendar/week-strip-calendar.tsx +182 -0
- package/components/contact/copy-email.tsx +94 -0
- package/components/docks/Icons.tsx +222 -0
- package/components/docks/app-dock.tsx +111 -0
- package/components/docks/editor-tool-dock.tsx +113 -0
- package/components/docks/mac-dock.tsx +144 -0
- package/components/docks/presence-dock.tsx +178 -0
- package/components/docks/spotlight-bar.tsx +188 -0
- package/components/dropdowns/file-menu-dropdown.tsx +192 -0
- package/components/dropdowns/filter-sort-dropdown.tsx +189 -0
- package/components/dropdowns/kebab-actions-dropdown.tsx +195 -0
- package/components/dropdowns/notification-dropdown.tsx +235 -0
- package/components/dropdowns/share-menu-dropdown.tsx +197 -0
- package/components/dropdowns/user-menu-dropdown.tsx +251 -0
- package/components/dropdowns/workspace-switcher-dropdown.tsx +248 -0
- package/components/event/event-ticket-card.tsx +116 -0
- package/components/files/ink-stamp-document-card.tsx +88 -0
- package/components/files/stacked-folder-card.tsx +176 -0
- package/components/folder/folder-tab-card.tsx +123 -0
- package/components/forms/contact-form.tsx +417 -0
- package/components/forms/forgot-password-form.tsx +264 -0
- package/components/forms/login-form.tsx +342 -0
- package/components/forms/newsletter-form.tsx +212 -0
- package/components/forms/signup-form.tsx +487 -0
- package/components/frames/circle-cut-frame.tsx +198 -0
- package/components/frames/hard-shadow-polaroid-frame.tsx +158 -0
- package/components/frames/sticky-note-polaroid-frame.tsx +230 -0
- package/components/frames/transform-box-frame.tsx +287 -0
- package/components/frames/transform-plus-frame.tsx +308 -0
- package/components/gallery/film-strip-card.tsx +103 -0
- package/components/gallery/gallery-grid-card.tsx +106 -0
- package/components/gallery/gallery-wall-card.tsx +71 -0
- package/components/gallery/glass-overlay-image-card.tsx +156 -0
- package/components/gallery/museum-placard-card.tsx +105 -0
- package/components/gallery/photo-album-card.tsx +114 -0
- package/components/gallery/photo-contact-sheet-card.tsx +71 -0
- package/components/gallery/polaroid-image-card.tsx +81 -0
- package/components/gallery/slow-living-polaroid-card.tsx +88 -0
- package/components/gallery/stamp-postcard-card.tsx +78 -0
- package/components/inputs/checkbox-field-input.tsx +148 -0
- package/components/inputs/combobox-field-input.tsx +466 -0
- package/components/inputs/date-field-input.tsx +472 -0
- package/components/inputs/file-upload-field-input.tsx +578 -0
- package/components/inputs/floating-label-field-input.tsx +206 -0
- package/components/inputs/input-group-field.tsx +132 -0
- package/components/inputs/password-field-input.tsx +125 -0
- package/components/inputs/phone-field-input.tsx +157 -0
- package/components/inputs/radio-group-field-input.tsx +220 -0
- package/components/inputs/search-input.tsx +163 -0
- package/components/inputs/select-field-input.tsx +416 -0
- package/components/inputs/switch-field-input.tsx +179 -0
- package/components/inputs/text-field-input.tsx +89 -0
- package/components/inputs/textarea-field-input.tsx +152 -0
- package/components/loaders/apple-hello-loader.tsx +86 -0
- package/components/loaders/spin-loader.tsx +51 -0
- package/components/loaders/text-loader.tsx +148 -0
- package/components/mockups/apple-ipod-mockup-card.tsx +155 -0
- package/components/mockups/apple-watch-mockup-card.tsx +278 -0
- package/components/mockups/browser-mockup-card.tsx +109 -0
- package/components/mockups/laptop-mockup-card.tsx +118 -0
- package/components/mockups/phone-mockup-card.tsx +210 -0
- package/components/mockups/tablet-mockup-card.tsx +212 -0
- package/components/motion/action-sheet.tsx +218 -0
- package/components/motion/action-swap-roll.tsx +32 -0
- package/components/motion/action-swap.tsx +340 -0
- package/components/motion/adaptive-stepper.tsx +442 -0
- package/components/motion/animated-badge.tsx +213 -0
- package/components/motion/animated-number.tsx +50 -0
- package/components/motion/animated-sidebar.tsx +1174 -0
- package/components/motion/animated-toast-stack.tsx +503 -0
- package/components/motion/aspect-ratio.tsx +55 -0
- package/components/motion/attachment-upload.tsx +1080 -0
- package/components/motion/audio-player.tsx +266 -0
- package/components/motion/autocomplete.tsx +183 -0
- package/components/motion/availability-scheduler/copy-menu.tsx +119 -0
- package/components/motion/availability-scheduler/day-row.tsx +231 -0
- package/components/motion/availability-scheduler/icon-button.tsx +46 -0
- package/components/motion/availability-scheduler/index.tsx +154 -0
- package/components/motion/availability-scheduler/time-select.tsx +49 -0
- package/components/motion/availability-scheduler/types.ts +189 -0
- package/components/motion/avatar-group.tsx +154 -0
- package/components/motion/bloom-menu.tsx +216 -0
- package/components/motion/bottom-sheet.tsx +249 -0
- package/components/motion/bounce-sidebar.tsx +266 -0
- package/components/motion/bouncy-accordion.tsx +325 -0
- package/components/motion/breadcrumb.tsx +122 -0
- package/components/motion/button/base.tsx +189 -0
- package/components/motion/button/index.tsx +13 -0
- package/components/motion/button/magnetic.tsx +25 -0
- package/components/motion/button/metallic.tsx +100 -0
- package/components/motion/button/stateful.tsx +237 -0
- package/components/motion/card-folder.tsx +345 -0
- package/components/motion/card-resize.tsx +229 -0
- package/components/motion/cascader.tsx +279 -0
- package/components/motion/center-morph-modal.tsx +366 -0
- package/components/motion/checkbox.tsx +123 -0
- package/components/motion/chip.tsx +121 -0
- package/components/motion/chromatic-text-reveal.tsx +203 -0
- package/components/motion/collapsible.tsx +108 -0
- package/components/motion/color-picker.tsx +206 -0
- package/components/motion/combobox/content.tsx +163 -0
- package/components/motion/combobox/context.tsx +359 -0
- package/components/motion/combobox/list.tsx +222 -0
- package/components/motion/combobox/trigger.tsx +191 -0
- package/components/motion/combobox/use-active-option.ts +130 -0
- package/components/motion/combobox.tsx +33 -0
- package/components/motion/command-palette.tsx +381 -0
- package/components/motion/confetti.tsx +128 -0
- package/components/motion/context-menu.tsx +790 -0
- package/components/motion/copy-button.tsx +103 -0
- package/components/motion/cylinder-carousel.tsx +459 -0
- package/components/motion/date-range-picker.tsx +218 -0
- package/components/motion/digit-swap.tsx +125 -0
- package/components/motion/dock.tsx +113 -0
- package/components/motion/drawer.tsx +108 -0
- package/components/motion/dynamic-island.tsx +221 -0
- package/components/motion/error-shake.tsx +66 -0
- package/components/motion/event-calendar.tsx +224 -0
- package/components/motion/expandable-action-bar.tsx +412 -0
- package/components/motion/expandable-control.tsx +254 -0
- package/components/motion/expandable-tabs.tsx +444 -0
- package/components/motion/expanding-arrow-button.tsx +171 -0
- package/components/motion/feedback-widget.tsx +473 -0
- package/components/motion/file-tree.tsx +429 -0
- package/components/motion/file-upload.tsx +606 -0
- package/components/motion/filter-builder.tsx +283 -0
- package/components/motion/frame.tsx +116 -0
- package/components/motion/gantt.tsx +156 -0
- package/components/motion/glow-button.tsx +101 -0
- package/components/motion/haptic-pressable.tsx +107 -0
- package/components/motion/hold-action-button.tsx +279 -0
- package/components/motion/hover-card.tsx +118 -0
- package/components/motion/icon-stack.tsx +138 -0
- package/components/motion/infinite-masonry.tsx +349 -0
- package/components/motion/input.tsx +242 -0
- package/components/motion/kanban.tsx +255 -0
- package/components/motion/kbd.tsx +127 -0
- package/components/motion/knockout-bracket.tsx +909 -0
- package/components/motion/knockout-wheel.tsx +1112 -0
- package/components/motion/liquid.tsx +351 -0
- package/components/motion/loader.tsx +616 -0
- package/components/motion/magnet-dock.tsx +117 -0
- package/components/motion/magnetic.tsx +50 -0
- package/components/motion/marquee.tsx +66 -0
- package/components/motion/metric-card.tsx +116 -0
- package/components/motion/morphing-modal.tsx +160 -0
- package/components/motion/morphing-search.tsx +643 -0
- package/components/motion/morphing-tabs.tsx +940 -0
- package/components/motion/multi-select/content.tsx +164 -0
- package/components/motion/multi-select/context.tsx +381 -0
- package/components/motion/multi-select/index.tsx +33 -0
- package/components/motion/multi-select/list.tsx +239 -0
- package/components/motion/multi-select/trigger.tsx +262 -0
- package/components/motion/not-found/glitch.tsx +107 -0
- package/components/motion/not-found/index.tsx +11 -0
- package/components/motion/not-found/magnetic.tsx +57 -0
- package/components/motion/not-found/shared.tsx +96 -0
- package/components/motion/not-found/spotlight.tsx +86 -0
- package/components/motion/not-found/stacked.tsx +77 -0
- package/components/motion/not-found/terminal.tsx +83 -0
- package/components/motion/notification-stack.tsx +380 -0
- package/components/motion/number-field.tsx +178 -0
- package/components/motion/number-ticker.tsx +185 -0
- package/components/motion/otp-input.tsx +392 -0
- package/components/motion/overflow-actions.tsx +375 -0
- package/components/motion/page-transition.tsx +92 -0
- package/components/motion/pagination.tsx +163 -0
- package/components/motion/parallax.tsx +64 -0
- package/components/motion/password-input.tsx +165 -0
- package/components/motion/phone-input.tsx +181 -0
- package/components/motion/popover-morph.tsx +317 -0
- package/components/motion/popover-position.ts +86 -0
- package/components/motion/popover.tsx +694 -0
- package/components/motion/prediction-market.tsx +682 -0
- package/components/motion/preview-rail.tsx +390 -0
- package/components/motion/progress-ring.tsx +115 -0
- package/components/motion/project-folder.tsx +418 -0
- package/components/motion/pull-to-refresh.tsx +522 -0
- package/components/motion/radio.tsx +148 -0
- package/components/motion/range-slider.tsx +93 -0
- package/components/motion/rating.tsx +171 -0
- package/components/motion/reorder-grid.tsx +123 -0
- package/components/motion/resizable-panel.tsx +160 -0
- package/components/motion/scroll-progress.tsx +127 -0
- package/components/motion/scroll-reveal.tsx +60 -0
- package/components/motion/scroll-to.tsx +48 -0
- package/components/motion/segmented-control.tsx +130 -0
- package/components/motion/segmented-progress.tsx +128 -0
- package/components/motion/select.tsx +440 -0
- package/components/motion/shader-background.tsx +134 -0
- package/components/motion/shared-layout-bg.tsx +151 -0
- package/components/motion/signup-form.tsx +467 -0
- package/components/motion/slide-action-button.tsx +203 -0
- package/components/motion/smooth-scroll.tsx +264 -0
- package/components/motion/sortable-list.tsx +98 -0
- package/components/motion/speed-dial.tsx +144 -0
- package/components/motion/split-text.tsx +115 -0
- package/components/motion/spotlight-card.tsx +89 -0
- package/components/motion/stepper.tsx +127 -0
- package/components/motion/success-check.tsx +142 -0
- package/components/motion/swap/constants.ts +2 -0
- package/components/motion/swap/controls.tsx +201 -0
- package/components/motion/swap/data.ts +186 -0
- package/components/motion/swap/field.tsx +115 -0
- package/components/motion/swap/quote-row.tsx +46 -0
- package/components/motion/swap/token-badges.tsx +83 -0
- package/components/motion/swap/token-picker.tsx +219 -0
- package/components/motion/swap/types.ts +20 -0
- package/components/motion/swap/utils.ts +28 -0
- package/components/motion/swap.tsx +182 -0
- package/components/motion/swipeable-list.tsx +507 -0
- package/components/motion/switch.tsx +96 -0
- package/components/motion/table/editable-cell.tsx +22 -0
- package/components/motion/table/index.tsx +431 -0
- package/components/motion/table/row-handle.tsx +81 -0
- package/components/motion/table/skeleton-rows.tsx +39 -0
- package/components/motion/table/table-header.tsx +344 -0
- package/components/motion/table/table-menu.tsx +129 -0
- package/components/motion/table/types.ts +86 -0
- package/components/motion/table/use-column-reorder.ts +105 -0
- package/components/motion/table/use-column-resize.ts +81 -0
- package/components/motion/table/use-column-sort.ts +64 -0
- package/components/motion/table/use-row-selection.ts +59 -0
- package/components/motion/table/utils.ts +33 -0
- package/components/motion/tabs.tsx +207 -0
- package/components/motion/text-cascade.tsx +22 -0
- package/components/motion/text-reveal.tsx +143 -0
- package/components/motion/text-scramble.tsx +84 -0
- package/components/motion/text-shimmer.tsx +34 -0
- package/components/motion/text-swap.tsx +56 -0
- package/components/motion/theme-toggle.tsx +210 -0
- package/components/motion/tilt-card.tsx +68 -0
- package/components/motion/timeline.tsx +236 -0
- package/components/motion/toggle-group.tsx +128 -0
- package/components/motion/tooltip.tsx +297 -0
- package/components/motion/tree-view.tsx +200 -0
- package/components/motion/wallet-card/account-avatar.tsx +21 -0
- package/components/motion/wallet-card/account-switcher.tsx +199 -0
- package/components/motion/wallet-card/actions.tsx +59 -0
- package/components/motion/wallet-card/balance-delta.tsx +69 -0
- package/components/motion/wallet-card/constants.ts +18 -0
- package/components/motion/wallet-card/copy-button.tsx +58 -0
- package/components/motion/wallet-card/index.tsx +151 -0
- package/components/motion/wallet-card/search-bar.tsx +198 -0
- package/components/motion/wallet-card/types.ts +34 -0
- package/components/motion/wallet-card/utils.ts +9 -0
- package/components/motion/wheel-picker.tsx +610 -0
- package/components/notifications/apple-notification-banner.tsx +155 -0
- package/components/notifications/calendar-reminder-notification-banner.tsx +138 -0
- package/components/notifications/chat-bubble-notification-banner.tsx +136 -0
- package/components/notifications/delivery-notification-banner.tsx +126 -0
- package/components/notifications/deploy-notification-banner.tsx +140 -0
- package/components/notifications/email-notification-banner.tsx +148 -0
- package/components/notifications/incoming-call-notification-banner.tsx +144 -0
- package/components/notifications/payment-notification-banner.tsx +137 -0
- package/components/notifications/system-alert-banner.tsx +137 -0
- package/components/notifications/toast-notification-banner.tsx +130 -0
- package/components/others/progress-ring-card.tsx +217 -0
- package/components/others/stacked-cards-effect.tsx +62 -0
- package/components/others/terminal-log-card.tsx +107 -0
- package/components/others/thermal-receipt-card.tsx +132 -0
- package/components/others/weather-snapshot-card.tsx +124 -0
- package/components/otp/otp-boxed-input.tsx +482 -0
- package/components/otp/otp-underline-input.tsx +356 -0
- package/components/previews/agents/agent-activity.preview.tsx +136 -0
- package/components/previews/agents/ai-sidebar.preview.tsx +236 -0
- package/components/previews/agents/chat-app-usage.tsx +689 -0
- package/components/previews/agents/chat-app.preview.tsx +130 -0
- package/components/previews/agents/chat-preview.tsx +285 -0
- package/components/previews/agents/citations.preview.tsx +78 -0
- package/components/previews/agents/code-block.preview.tsx +67 -0
- package/components/previews/agents/file-diff.preview.tsx +64 -0
- package/components/previews/agents/image-generation.preview.tsx +117 -0
- package/components/previews/agents/message-bubble.preview.tsx +12 -0
- package/components/previews/agents/message-scroller.preview.tsx +70 -0
- package/components/previews/agents/message.preview.tsx +14 -0
- package/components/previews/agents/prompt-input.preview.tsx +145 -0
- package/components/previews/agents/streaming-response.preview.tsx +156 -0
- package/components/previews/agents/todo-list.preview.tsx +73 -0
- package/components/previews/agents/tool-approval.preview.tsx +80 -0
- package/components/previews/agents/use-tool-result-demo.ts +28 -0
- package/components/previews/blocks/availability-scheduler.preview.tsx +11 -0
- package/components/previews/blocks/bloom-menu.preview.tsx +11 -0
- package/components/previews/blocks/card-folder.preview.tsx +105 -0
- package/components/previews/blocks/command-palette.preview.tsx +40 -0
- package/components/previews/blocks/dynamic-island.preview.tsx +150 -0
- package/components/previews/blocks/expandable-action-bar.preview.tsx +136 -0
- package/components/previews/blocks/expandable-tabs.preview.tsx +136 -0
- package/components/previews/blocks/feedback-widget.preview.tsx +34 -0
- package/components/previews/blocks/file-upload.preview.tsx +175 -0
- package/components/previews/blocks/infinite-masonry.preview.tsx +145 -0
- package/components/previews/blocks/knockout-bracket.preview.tsx +43 -0
- package/components/previews/blocks/morphing-search.preview.tsx +59 -0
- package/components/previews/blocks/morphing-tabs.preview.tsx +91 -0
- package/components/previews/blocks/notification-stack.preview.tsx +39 -0
- package/components/previews/blocks/otp-input.preview.tsx +29 -0
- package/components/previews/blocks/overflow-actions.preview.tsx +51 -0
- package/components/previews/blocks/prediction-market.preview.tsx +41 -0
- package/components/previews/blocks/project-folder.preview.tsx +41 -0
- package/components/previews/blocks/signup-form.preview.tsx +36 -0
- package/components/previews/blocks/swap.preview.tsx +11 -0
- package/components/previews/blocks/swipeable-list.preview.tsx +149 -0
- package/components/previews/blocks/wallet-card.preview.tsx +36 -0
- package/components/previews/motion/action-swap.preview.tsx +82 -0
- package/components/previews/motion/adaptive-stepper.preview.tsx +20 -0
- package/components/previews/motion/animated-badge.preview.tsx +43 -0
- package/components/previews/motion/animated-sidebar.preview.tsx +269 -0
- package/components/previews/motion/animated-toast-stack.preview.tsx +151 -0
- package/components/previews/motion/bottom-sheet.preview.tsx +35 -0
- package/components/previews/motion/bounce-sidebar.preview.tsx +30 -0
- package/components/previews/motion/bouncy-accordion.preview.tsx +66 -0
- package/components/previews/motion/center-morph-modal.preview.tsx +75 -0
- package/components/previews/motion/checkbox.preview.tsx +26 -0
- package/components/previews/motion/combobox.preview.tsx +119 -0
- package/components/previews/motion/context-menu.preview.tsx +144 -0
- package/components/previews/motion/cylinder-carousel.preview.tsx +96 -0
- package/components/previews/motion/dock.preview.tsx +46 -0
- package/components/previews/motion/drawer.preview.tsx +46 -0
- package/components/previews/motion/expandable-control.preview.tsx +27 -0
- package/components/previews/motion/expanding-arrow-button.preview.tsx +11 -0
- package/components/previews/motion/file-tree.preview.tsx +67 -0
- package/components/previews/motion/input.preview.tsx +55 -0
- package/components/previews/motion/loader.preview.tsx +36 -0
- package/components/previews/motion/marquee.preview.tsx +22 -0
- package/components/previews/motion/morphing-modal.preview.tsx +184 -0
- package/components/previews/motion/multi-select.preview.tsx +73 -0
- package/components/previews/motion/number.preview.tsx +61 -0
- package/components/previews/motion/popover.preview.tsx +53 -0
- package/components/previews/motion/preview-rail.preview.tsx +108 -0
- package/components/previews/motion/pull-to-refresh.preview.tsx +117 -0
- package/components/previews/motion/radio.preview.tsx +17 -0
- package/components/previews/motion/range-slider.preview.tsx +19 -0
- package/components/previews/motion/select.preview.tsx +29 -0
- package/components/previews/motion/shader-background.preview.tsx +308 -0
- package/components/previews/motion/shared-layout-bg.preview.tsx +33 -0
- package/components/previews/motion/switch.preview.tsx +15 -0
- package/components/previews/motion/table.preview.tsx +140 -0
- package/components/previews/motion/tabs.preview.tsx +49 -0
- package/components/previews/motion/text-animation.preview.tsx +63 -0
- package/components/previews/motion/theme-toggle.preview.tsx +28 -0
- package/components/previews/motion/tilt-card.preview.tsx +15 -0
- package/components/previews/motion/tooltip.preview.tsx +34 -0
- package/components/previews/motion/wheel-picker.preview.tsx +91 -0
- package/components/pricing/retail-price-tag-card.tsx +104 -0
- package/components/pricing/toggle-pricing-cards.tsx +209 -0
- package/components/profile/contact-profile-card.tsx +100 -0
- package/components/profile/editorial-staff-profile-card.tsx +79 -0
- package/components/profile/team-member-profile-grid.tsx +159 -0
- package/components/profile/user-profile-card.tsx +125 -0
- package/components/resources/resource-links-panel.tsx +176 -0
- package/components/socials/discord-chat-card.tsx +157 -0
- package/components/socials/facebook-post-card.tsx +198 -0
- package/components/socials/github-contribution.tsx +716 -0
- package/components/socials/github-repo-card.tsx +111 -0
- package/components/socials/instagram-post-card.tsx +204 -0
- package/components/socials/linked-in-post-card.tsx +213 -0
- package/components/socials/linked-in-profile-card.tsx +173 -0
- package/components/socials/threads-post-card.tsx +162 -0
- package/components/socials/twitter-post-card.tsx +184 -0
- package/components/socials/twitter-profile-card.tsx +180 -0
- package/components/system/loaders/index.ts +1 -0
- package/components/system/loaders/page-loader-overlay.tsx +16 -0
- package/components/table/customers-table.tsx +146 -0
- package/components/table/orders-table.tsx +195 -0
- package/components/table/recent-transactions-table.tsx +125 -0
- package/components/table/tasks-table.tsx +163 -0
- package/components/table/team-members-table.tsx +155 -0
- package/components/table/users-select-table.tsx +184 -0
- package/components/text/cafe-menu-board-card.tsx +101 -0
- package/components/text/cinema-ticket-card.tsx +99 -0
- package/components/text/daily-motivation-card.tsx +80 -0
- package/components/text/denim-product-editorial-card.tsx +101 -0
- package/components/text/drop-cap-editorial-card.tsx +54 -0
- package/components/text/editorial-quote-card.tsx +98 -0
- package/components/text/journal-writing-card.tsx +131 -0
- package/components/text/keyboard-shortcuts-card.tsx +92 -0
- package/components/text/magazine-cover-card.tsx +109 -0
- package/components/text/notepad-card.tsx +95 -0
- package/components/travel/flight-boarding-card.tsx +177 -0
- package/components/travel/travel-postcard-card.tsx +96 -0
- package/components/underlines/annotated-text-showcase.tsx +37 -0
- package/components/underlines/annotated-text.tsx +471 -0
- package/components/users/credit-card-glass.tsx +113 -0
- package/components/users/team-member-card.tsx +50 -0
- package/components/users/testimonial-card.tsx +239 -0
- package/components/wallet/wallet-pass-card.tsx +220 -0
- package/components/widgets/analog-clock-widget.tsx +203 -0
- package/components/widgets/audio-recorder-widget.tsx +87 -0
- package/components/widgets/battery-face-widget.tsx +152 -0
- package/components/widgets/blob-profile.tsx +64 -0
- package/components/widgets/bluetooth-face-widget.tsx +125 -0
- package/components/widgets/compass-widget.tsx +296 -0
- package/components/widgets/daily-activity-calendar-widget.tsx +133 -0
- package/components/widgets/dnd-face-widget.tsx +129 -0
- package/components/widgets/electric-scooter-widget.tsx +88 -0
- package/components/widgets/flight-arrival-widget.tsx +76 -0
- package/components/widgets/focus-breath-widget.tsx +71 -0
- package/components/widgets/heart-rate-widget.tsx +93 -0
- package/components/widgets/hydration-widget.tsx +109 -0
- package/components/widgets/ios-calendar-widget.tsx +87 -0
- package/components/widgets/ios-digital-clock-widget.tsx +192 -0
- package/components/widgets/ios-earbuds-widget.tsx +120 -0
- package/components/widgets/ios-map-location-widget.tsx +133 -0
- package/components/widgets/minimal-agenda-widget.tsx +123 -0
- package/components/widgets/pomodoro-widget.tsx +155 -0
- package/components/widgets/recorder-face-widget.tsx +146 -0
- package/components/widgets/ride-pickup-widget.tsx +72 -0
- package/components/widgets/sleep-score-widget.tsx +107 -0
- package/components/widgets/step-count-widget.tsx +53 -0
- package/components/widgets/stopwatch-widget.tsx +176 -0
- package/components/widgets/torch-face-widget.tsx +128 -0
- package/components/widgets/voice-assistant-widget.tsx +103 -0
- package/components/widgets/wifi-toggle-widget.tsx +108 -0
- package/lib/cn.ts +1 -0
- package/lib/ease.ts +108 -0
- package/lib/favicon.ts +8 -0
- package/lib/hooks/use-dismiss.ts +120 -0
- package/lib/hooks/use-favicon.ts +39 -0
- package/lib/hooks/use-haptic.ts +44 -0
- package/lib/hooks/use-hover-capable.ts +23 -0
- package/lib/hooks/use-hover-gesture.ts +61 -0
- package/lib/hooks/use-in-view-animation.ts +35 -0
- package/lib/hooks/use-measure.ts +39 -0
- package/lib/hooks/use-on-open.ts +24 -0
- package/lib/hooks/use-row-cursor.ts +86 -0
- package/lib/hooks/use-slider.ts +176 -0
- package/lib/hooks/use-tap-gesture.ts +66 -0
- package/lib/hooks/use-touch-capable.ts +31 -0
- package/lib/presence-gate.tsx +52 -0
- package/lib/styles.ts +124 -0
- package/lib/text-shimmer.ts +21 -0
- package/lib/tick-sound.ts +151 -0
- package/lib/touch.ts +117 -0
- package/lib/utils.ts +6 -0
- package/package.json +49 -0
- package/references/agents/agent-activity.md +747 -0
- package/references/agents/ai-sidebar.md +293 -0
- package/references/agents/approval-card.md +233 -0
- package/references/agents/chat-app.md +184 -0
- package/references/agents/citations.md +159 -0
- package/references/agents/code-block.md +122 -0
- package/references/agents/file-diff.md +119 -0
- package/references/agents/image-generation.md +173 -0
- package/references/agents/loading-states.md +186 -0
- package/references/agents/message-bubble.md +274 -0
- package/references/agents/message-scroller.md +128 -0
- package/references/agents/message.md +162 -0
- package/references/agents/prompt-input.md +204 -0
- package/references/agents/streaming-response.md +216 -0
- package/references/agents/todo-list.md +123 -0
- package/references/agents/tool-approval.md +143 -0
- package/references/agents/tool-result.md +199 -0
- package/references/blocks/availability-scheduler.md +59 -0
- package/references/blocks/bloom-menu.md +56 -0
- package/references/blocks/card-folder.md +165 -0
- package/references/blocks/command-palette.md +89 -0
- package/references/blocks/dynamic-island.md +203 -0
- package/references/blocks/expandable-action-bar.md +191 -0
- package/references/blocks/expandable-tabs.md +184 -0
- package/references/blocks/feedback-widget.md +82 -0
- package/references/blocks/file-upload.md +406 -0
- package/references/blocks/infinite-masonry.md +211 -0
- package/references/blocks/knockout-bracket.md +161 -0
- package/references/blocks/morphing-search.md +113 -0
- package/references/blocks/morphing-tabs.md +143 -0
- package/references/blocks/not-found.md +228 -0
- package/references/blocks/notification-stack.md +92 -0
- package/references/blocks/otp-input.md +85 -0
- package/references/blocks/overflow-actions.md +105 -0
- package/references/blocks/prediction-market.md +97 -0
- package/references/blocks/project-folder.md +99 -0
- package/references/blocks/signup-form.md +92 -0
- package/references/blocks/swap.md +58 -0
- package/references/blocks/swipeable-list.md +202 -0
- package/references/blocks/wallet-card.md +97 -0
- package/references/codex-install.md +59 -0
- package/references/craft/3d-button.md +51 -0
- package/references/craft/3d-icon-button.md +51 -0
- package/references/craft/add-to-cart-button.md +52 -0
- package/references/craft/analog-clock-minimal.md +51 -0
- package/references/craft/analog-clock-numeric.md +51 -0
- package/references/craft/analog-clock-roman.md +51 -0
- package/references/craft/annotated-text.md +51 -0
- package/references/craft/app-dock.md +52 -0
- package/references/craft/apple-hello-loader.md +51 -0
- package/references/craft/apple-notification.md +53 -0
- package/references/craft/apple-watch.md +51 -0
- package/references/craft/arc-bands-background.md +51 -0
- package/references/craft/audio-recorder.md +52 -0
- package/references/craft/aurora-background.md +51 -0
- package/references/craft/battery-face.md +52 -0
- package/references/craft/blob-profile.md +53 -0
- package/references/craft/bluetooth-face.md +52 -0
- package/references/craft/booking-slot-calendar.md +52 -0
- package/references/craft/bookmark-save-button.md +52 -0
- package/references/craft/browser.md +51 -0
- package/references/craft/cafe-menu-board.md +52 -0
- package/references/craft/calendar-reminder-notification.md +52 -0
- package/references/craft/chat-bubble-notification.md +53 -0
- package/references/craft/checkbox-field-input.md +52 -0
- package/references/craft/cherry-petal-background.md +51 -0
- package/references/craft/cinder-latch-button.md +51 -0
- package/references/craft/cinema-ticket.md +52 -0
- package/references/craft/circle-cut-frame.md +51 -0
- package/references/craft/combobox-field-input.md +52 -0
- package/references/craft/compass.md +51 -0
- package/references/craft/contact-form.md +52 -0
- package/references/craft/contact-profile.md +52 -0
- package/references/craft/copy-email.md +53 -0
- package/references/craft/coral-glow-background.md +51 -0
- package/references/craft/craft-copy-button.md +52 -0
- package/references/craft/craft-signup-form.md +53 -0
- package/references/craft/credit-card-glass.md +51 -0
- package/references/craft/customers-table.md +52 -0
- package/references/craft/daily-activity-calendar.md +52 -0
- package/references/craft/daily-motivation.md +53 -0
- package/references/craft/dark-arc-bands-background.md +51 -0
- package/references/craft/dark-aurora-background.md +51 -0
- package/references/craft/dark-carbon-spotlight-background.md +51 -0
- package/references/craft/dark-ember-background.md +51 -0
- package/references/craft/dark-ink-field-background.md +51 -0
- package/references/craft/dark-midnight-mesh-background.md +51 -0
- package/references/craft/dark-rose-noir-background.md +51 -0
- package/references/craft/dark-teal-depth-background.md +51 -0
- package/references/craft/date-field-input.md +52 -0
- package/references/craft/date-range-picker-card.md +52 -0
- package/references/craft/delivery-notification.md +52 -0
- package/references/craft/denim-product-editorial.md +52 -0
- package/references/craft/deploy-notification.md +52 -0
- package/references/craft/depth-outline-button.md +51 -0
- package/references/craft/diagonal-box-pattern.md +51 -0
- package/references/craft/dimple-switch.md +51 -0
- package/references/craft/discord-chat.md +53 -0
- package/references/craft/dnd-face.md +52 -0
- package/references/craft/dot-grid-pattern.md +51 -0
- package/references/craft/download-button.md +52 -0
- package/references/craft/drop-cap-editorial.md +52 -0
- package/references/craft/editor-tool-dock.md +52 -0
- package/references/craft/editorial-quote.md +52 -0
- package/references/craft/editorial-staff-profile.md +51 -0
- package/references/craft/electric-scooter.md +53 -0
- package/references/craft/email-notification.md +53 -0
- package/references/craft/event-countdown-card.md +51 -0
- package/references/craft/event-ticket.md +53 -0
- package/references/craft/facebook-post.md +53 -0
- package/references/craft/file-menu.md +52 -0
- package/references/craft/file-upload-field-input.md +52 -0
- package/references/craft/film-strip.md +52 -0
- package/references/craft/filter-sort.md +52 -0
- package/references/craft/fine-grain-pattern.md +51 -0
- package/references/craft/flight-arrival.md +52 -0
- package/references/craft/flight-boarding.md +52 -0
- package/references/craft/floating-label-field-input.md +51 -0
- package/references/craft/focus-breath.md +51 -0
- package/references/craft/folder-tab-card.md +52 -0
- package/references/craft/follow-button.md +52 -0
- package/references/craft/forgot-password-form.md +53 -0
- package/references/craft/frost-mesh-background.md +51 -0
- package/references/craft/gallery-grid.md +53 -0
- package/references/craft/gallery-wall.md +52 -0
- package/references/craft/github-contribution.md +52 -0
- package/references/craft/github-repo.md +52 -0
- package/references/craft/glass-overlay-image.md +53 -0
- package/references/craft/graph-paper-pattern.md +51 -0
- package/references/craft/halftone-pop-background.md +51 -0
- package/references/craft/hard-shadow-polaroid-frame.md +51 -0
- package/references/craft/heart-rate.md +52 -0
- package/references/craft/hold-to-delete-button.md +52 -0
- package/references/craft/honey-ember-background.md +51 -0
- package/references/craft/hydration.md +51 -0
- package/references/craft/incoming-call-notification.md +53 -0
- package/references/craft/ink-stamp-document.md +52 -0
- package/references/craft/ink-wash-background.md +51 -0
- package/references/craft/input-group-field.md +51 -0
- package/references/craft/inset-button.md +51 -0
- package/references/craft/instagram-post.md +53 -0
- package/references/craft/ios-calendar-widget.md +51 -0
- package/references/craft/ios-digital-clock.md +51 -0
- package/references/craft/ios-earbuds.md +51 -0
- package/references/craft/ios-map-location.md +51 -0
- package/references/craft/ipad.md +51 -0
- package/references/craft/ipod.md +51 -0
- package/references/craft/journal-writing.md +52 -0
- package/references/craft/kebab-actions.md +52 -0
- package/references/craft/keyboard-shortcuts.md +52 -0
- package/references/craft/laptop.md +51 -0
- package/references/craft/like-button.md +52 -0
- package/references/craft/line-grid-pattern.md +51 -0
- package/references/craft/linen-tab-button.md +51 -0
- package/references/craft/linen-weave-background.md +51 -0
- package/references/craft/linked-in-post.md +53 -0
- package/references/craft/linked-in-profile.md +52 -0
- package/references/craft/login-form.md +53 -0
- package/references/craft/mac-dock.md +52 -0
- package/references/craft/magazine-cover.md +53 -0
- package/references/craft/minimal-agenda.md +52 -0
- package/references/craft/mint-lagoon-background.md +51 -0
- package/references/craft/month-picker-calendar.md +52 -0
- package/references/craft/museum-placard.md +51 -0
- package/references/craft/music-player.md +53 -0
- package/references/craft/music-playlist.md +53 -0
- package/references/craft/newsletter-form.md +52 -0
- package/references/craft/notepad.md +52 -0
- package/references/craft/notification.md +52 -0
- package/references/craft/now-playing-bar.md +53 -0
- package/references/craft/orders-table.md +52 -0
- package/references/craft/otp-boxed-input.md +52 -0
- package/references/craft/otp-underline-input.md +51 -0
- package/references/craft/page-loader-overlay.md +46 -0
- package/references/craft/paper-fold-background.md +51 -0
- package/references/craft/password-field-input.md +52 -0
- package/references/craft/payment-notification.md +52 -0
- package/references/craft/phone-field-input.md +51 -0
- package/references/craft/phone.md +51 -0
- package/references/craft/photo-album.md +52 -0
- package/references/craft/photo-contact-sheet.md +52 -0
- package/references/craft/polaroid-image.md +52 -0
- package/references/craft/pomodoro.md +52 -0
- package/references/craft/presence-dock.md +51 -0
- package/references/craft/prism-depth-button.md +51 -0
- package/references/craft/progress-ring-card.md +51 -0
- package/references/craft/quantity-stepper-button.md +52 -0
- package/references/craft/radio-group-field-input.md +51 -0
- package/references/craft/rain-prism-background.md +51 -0
- package/references/craft/recent-transactions-table.md +52 -0
- package/references/craft/recorder-face.md +52 -0
- package/references/craft/resource-links-panel.md +52 -0
- package/references/craft/retail-price-tag.md +51 -0
- package/references/craft/reverse-diagonal-box-pattern.md +51 -0
- package/references/craft/ride-pickup.md +53 -0
- package/references/craft/sand-drift-background.md +51 -0
- package/references/craft/search-input.md +52 -0
- package/references/craft/segmented-toggle-button.md +51 -0
- package/references/craft/select-field-input.md +52 -0
- package/references/craft/share-menu.md +52 -0
- package/references/craft/sheen-pill-button.md +51 -0
- package/references/craft/slate-chip-switch.md +51 -0
- package/references/craft/sleep-score.md +52 -0
- package/references/craft/slide-to-confirm-button.md +52 -0
- package/references/craft/slow-living-polaroid.md +52 -0
- package/references/craft/soft-pill-button.md +51 -0
- package/references/craft/soft-spotlight-background.md +51 -0
- package/references/craft/soft-ui-button.md +51 -0
- package/references/craft/spin-loader.md +52 -0
- package/references/craft/spotlight-bar.md +52 -0
- package/references/craft/stacked-cards-effect.md +52 -0
- package/references/craft/stacked-folder-card.md +52 -0
- package/references/craft/stamp-postcard.md +52 -0
- package/references/craft/step-count.md +51 -0
- package/references/craft/sticky-note-polaroid-frame.md +51 -0
- package/references/craft/stopwatch.md +52 -0
- package/references/craft/sunrise-horizon-background.md +51 -0
- package/references/craft/sunset-bloom-background.md +51 -0
- package/references/craft/switch-field-input.md +51 -0
- package/references/craft/system-alert.md +52 -0
- package/references/craft/tasks-table.md +53 -0
- package/references/craft/team-member-profile-grid.md +52 -0
- package/references/craft/team-member.md +53 -0
- package/references/craft/team-members-table.md +53 -0
- package/references/craft/terminal-log.md +52 -0
- package/references/craft/terrazzo-fragment-background.md +51 -0
- package/references/craft/testimonial.md +53 -0
- package/references/craft/text-field-input.md +51 -0
- package/references/craft/text-loader.md +51 -0
- package/references/craft/textarea-field-input.md +51 -0
- package/references/craft/thermal-receipt.md +52 -0
- package/references/craft/threads-post.md +53 -0
- package/references/craft/toast-notification.md +52 -0
- package/references/craft/toggle-pricing-cards.md +52 -0
- package/references/craft/torch-face.md +52 -0
- package/references/craft/transform-box-frame.md +51 -0
- package/references/craft/transform-plus-frame.md +51 -0
- package/references/craft/travel-postcard.md +53 -0
- package/references/craft/tropical-tide-background.md +51 -0
- package/references/craft/twitter-post.md +53 -0
- package/references/craft/twitter-profile.md +53 -0
- package/references/craft/user-menu.md +53 -0
- package/references/craft/user-profile.md +53 -0
- package/references/craft/users-select-table.md +53 -0
- package/references/craft/voice-assistant.md +52 -0
- package/references/craft/wallet-pass.md +52 -0
- package/references/craft/weather-snapshot.md +52 -0
- package/references/craft/week-strip-calendar.md +52 -0
- package/references/craft/wifi-toggle.md +52 -0
- package/references/craft/workspace-switcher.md +52 -0
- package/references/guides/baseline-ui-craft.md +61 -0
- package/references/guides/craft-surface-design-system.md +120 -0
- package/references/guides/design-system-checklist.md +98 -0
- package/references/guides/enterprise-dashboard-patterns.md +53 -0
- package/references/guides/interaction-transitions.md +71 -0
- package/references/guides/motion-engineering.md +137 -0
- package/references/guides/motion-patterns.md +106 -0
- package/references/guides/motion-performance.md +66 -0
- package/references/guides/style-presets.md +115 -0
- package/references/guides/universal-mobile-patterns.md +72 -0
- package/references/motion/action-sheet.md +98 -0
- package/references/motion/action-swap.md +339 -0
- package/references/motion/adaptive-stepper.md +95 -0
- package/references/motion/animated-badge.md +92 -0
- package/references/motion/animated-sidebar.md +446 -0
- package/references/motion/animated-toast-stack.md +214 -0
- package/references/motion/aspect-ratio.md +59 -0
- package/references/motion/audio-player.md +59 -0
- package/references/motion/autocomplete.md +69 -0
- package/references/motion/avatar-group.md +93 -0
- package/references/motion/bottom-sheet.md +85 -0
- package/references/motion/bounce-sidebar.md +80 -0
- package/references/motion/bouncy-accordion.md +115 -0
- package/references/motion/breadcrumb.md +62 -0
- package/references/motion/button.md +271 -0
- package/references/motion/card-resize.md +60 -0
- package/references/motion/cascader.md +99 -0
- package/references/motion/center-morph-modal.md +133 -0
- package/references/motion/checkbox.md +76 -0
- package/references/motion/chip.md +81 -0
- package/references/motion/collapsible.md +73 -0
- package/references/motion/color-picker.md +57 -0
- package/references/motion/combobox.md +247 -0
- package/references/motion/confetti.md +65 -0
- package/references/motion/context-menu.md +269 -0
- package/references/motion/copy-button.md +59 -0
- package/references/motion/cylinder-carousel.md +151 -0
- package/references/motion/date-range-picker.md +68 -0
- package/references/motion/dock.md +105 -0
- package/references/motion/drawer.md +94 -0
- package/references/motion/error-shake.md +85 -0
- package/references/motion/event-calendar.md +81 -0
- package/references/motion/expandable-control.md +89 -0
- package/references/motion/expanding-arrow-button.md +178 -0
- package/references/motion/file-tree.md +139 -0
- package/references/motion/filter-builder.md +106 -0
- package/references/motion/frame.md +61 -0
- package/references/motion/gantt.md +61 -0
- package/references/motion/glow-button.md +59 -0
- package/references/motion/haptic-pressable.md +64 -0
- package/references/motion/hover-card.md +86 -0
- package/references/motion/icon-stack.md +64 -0
- package/references/motion/input.md +108 -0
- package/references/motion/kanban.md +111 -0
- package/references/motion/kbd.md +66 -0
- package/references/motion/loader.md +82 -0
- package/references/motion/magnet-dock.md +64 -0
- package/references/motion/marquee.md +68 -0
- package/references/motion/metric-card.md +81 -0
- package/references/motion/morphing-modal.md +230 -0
- package/references/motion/multi-select.md +202 -0
- package/references/motion/number-field.md +70 -0
- package/references/motion/number.md +198 -0
- package/references/motion/page-transition.md +78 -0
- package/references/motion/pagination.md +64 -0
- package/references/motion/password-input.md +77 -0
- package/references/motion/phone-input.md +63 -0
- package/references/motion/popover.md +209 -0
- package/references/motion/preview-rail.md +165 -0
- package/references/motion/progress-ring.md +73 -0
- package/references/motion/pull-to-refresh.md +172 -0
- package/references/motion/radio.md +73 -0
- package/references/motion/range-slider.md +290 -0
- package/references/motion/rating.md +69 -0
- package/references/motion/reorder-grid.md +69 -0
- package/references/motion/resizable-panel.md +75 -0
- package/references/motion/scroll-animation.md +397 -0
- package/references/motion/segmented-control.md +68 -0
- package/references/motion/segmented-progress.md +70 -0
- package/references/motion/select.md +196 -0
- package/references/motion/shader-background.md +351 -0
- package/references/motion/shared-layout-bg.md +80 -0
- package/references/motion/sortable-list.md +62 -0
- package/references/motion/speed-dial.md +63 -0
- package/references/motion/split-text.md +62 -0
- package/references/motion/spotlight-card.md +67 -0
- package/references/motion/stepper.md +83 -0
- package/references/motion/success-check.md +67 -0
- package/references/motion/switch.md +62 -0
- package/references/motion/table.md +519 -0
- package/references/motion/tabs.md +116 -0
- package/references/motion/text-animation.md +285 -0
- package/references/motion/text-swap.md +64 -0
- package/references/motion/theme-toggle.md +82 -0
- package/references/motion/tilt-card.md +59 -0
- package/references/motion/timeline.md +85 -0
- package/references/motion/toggle-group.md +70 -0
- package/references/motion/tooltip.md +82 -0
- package/references/motion/tree-view.md +87 -0
- package/references/motion/wheel-picker.md +142 -0
- package/scripts/build_docs.py +557 -0
- package/scripts/install-component.py +232 -0
- package/scripts/test_release.py +119 -0
- package/scripts/updater.mjs +9 -0
- package/scripts/verify_skill.py +84 -0
|
@@ -0,0 +1,940 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { X } from "lucide-react";
|
|
4
|
+
import {
|
|
5
|
+
AnimatePresence,
|
|
6
|
+
animate as animateValue,
|
|
7
|
+
motion,
|
|
8
|
+
useMotionValue,
|
|
9
|
+
useReducedMotion,
|
|
10
|
+
useSpring,
|
|
11
|
+
useTransform,
|
|
12
|
+
type MotionValue,
|
|
13
|
+
} from "motion/react";
|
|
14
|
+
import {
|
|
15
|
+
useCallback,
|
|
16
|
+
useEffect,
|
|
17
|
+
useId,
|
|
18
|
+
useLayoutEffect,
|
|
19
|
+
useMemo,
|
|
20
|
+
useRef,
|
|
21
|
+
useState,
|
|
22
|
+
type PointerEvent as ReactPointerEvent,
|
|
23
|
+
type ReactNode,
|
|
24
|
+
} from "react";
|
|
25
|
+
import { createPortal } from "react-dom";
|
|
26
|
+
import { EASE_OUT, SPRING_GLIDE, SPRING_PRESS } from "@/lib/ease";
|
|
27
|
+
import { TOUCH_GESTURE_CLASS, capturePointer } from "@/lib/touch";
|
|
28
|
+
import { cn } from "@/lib/utils";
|
|
29
|
+
|
|
30
|
+
export type MorphingTabsItem = {
|
|
31
|
+
id: string;
|
|
32
|
+
label: string;
|
|
33
|
+
icon?: ReactNode;
|
|
34
|
+
content: ReactNode;
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type MorphingTabsClassNames = {
|
|
39
|
+
root?: string;
|
|
40
|
+
rail?: string;
|
|
41
|
+
tab?: string;
|
|
42
|
+
activeTab?: string;
|
|
43
|
+
icon?: string;
|
|
44
|
+
label?: string;
|
|
45
|
+
close?: string;
|
|
46
|
+
content?: string;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export interface MorphingTabsProps {
|
|
50
|
+
items: MorphingTabsItem[];
|
|
51
|
+
value?: string | null;
|
|
52
|
+
defaultValue?: string | null;
|
|
53
|
+
onValueChange?: (id: string | null) => void;
|
|
54
|
+
/** Called once after a pointer drag or keyboard reorder completes. */
|
|
55
|
+
onOrderChange?: (ids: string[]) => void;
|
|
56
|
+
/** Enables the close affordance on every tab when provided. */
|
|
57
|
+
onClose?: (id: string) => void;
|
|
58
|
+
ariaLabel?: string;
|
|
59
|
+
className?: string;
|
|
60
|
+
classNames?: MorphingTabsClassNames;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
type DragSession = {
|
|
64
|
+
id: string;
|
|
65
|
+
pointerId: number;
|
|
66
|
+
originX: number;
|
|
67
|
+
startLeft: number;
|
|
68
|
+
startIndex: number;
|
|
69
|
+
targetIndex: number;
|
|
70
|
+
moved: boolean;
|
|
71
|
+
finishing: boolean;
|
|
72
|
+
startOrder: string[];
|
|
73
|
+
slotLefts: number[];
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
type SpringTabProps = {
|
|
77
|
+
id: string;
|
|
78
|
+
targetLeft: number;
|
|
79
|
+
dragging: boolean;
|
|
80
|
+
dragLeft: MotionValue<number>;
|
|
81
|
+
surfaceLeft: MotionValue<number>;
|
|
82
|
+
reduce: boolean;
|
|
83
|
+
active: boolean;
|
|
84
|
+
anyDragging: boolean;
|
|
85
|
+
surfaceHost: HTMLDivElement | null;
|
|
86
|
+
surfaceWidth: number;
|
|
87
|
+
tabWidth: number;
|
|
88
|
+
surfaceClassName?: string;
|
|
89
|
+
zIndex: number;
|
|
90
|
+
className: string;
|
|
91
|
+
children: ReactNode;
|
|
92
|
+
registerPosition: (id: string, position: MotionValue<number> | null) => void;
|
|
93
|
+
onPointerDown: (event: ReactPointerEvent<HTMLDivElement>) => void;
|
|
94
|
+
onPointerMove: (event: ReactPointerEvent<HTMLDivElement>) => void;
|
|
95
|
+
onPointerUp: (event: ReactPointerEvent<HTMLDivElement>) => void;
|
|
96
|
+
onPointerCancel: (event: ReactPointerEvent<HTMLDivElement>) => void;
|
|
97
|
+
onLostPointerCapture: (event: ReactPointerEvent<HTMLDivElement>) => void;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const DRAG_THRESHOLD = 5;
|
|
101
|
+
// The design width of a tab, and the narrowest it may shrink to before the
|
|
102
|
+
// label stops reading. See `tabWidth` in MorphingTabs.
|
|
103
|
+
const MAX_TAB_WIDTH = 176;
|
|
104
|
+
const MIN_TAB_WIDTH = 96;
|
|
105
|
+
const TAB_HEIGHT = 56;
|
|
106
|
+
const TAB_TOP = 24;
|
|
107
|
+
const TAB_RADIUS = 24;
|
|
108
|
+
const RAIL_HEIGHT = 80;
|
|
109
|
+
const SURFACE_INSET = 16;
|
|
110
|
+
const LIQUID_JOIN = 24;
|
|
111
|
+
const PANEL_RADIUS = 28;
|
|
112
|
+
|
|
113
|
+
function sameOrder(a: string[], b: string[]) {
|
|
114
|
+
return a.length === b.length && a.every((id, index) => id === b[index]);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function safeId(value: string) {
|
|
118
|
+
return value.replace(/[^a-zA-Z0-9_-]/g, "-");
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function moveItem(order: string[], from: number, to: number) {
|
|
122
|
+
if (from === to) return order.slice();
|
|
123
|
+
const next = order.slice();
|
|
124
|
+
const [item] = next.splice(from, 1);
|
|
125
|
+
next.splice(to, 0, item);
|
|
126
|
+
return next;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function liquidTabPath(
|
|
130
|
+
tabLeft: number,
|
|
131
|
+
surfaceWidth: number,
|
|
132
|
+
tabWidth: number,
|
|
133
|
+
) {
|
|
134
|
+
const panelLeft = SURFACE_INSET;
|
|
135
|
+
const panelRight = surfaceWidth - SURFACE_INSET;
|
|
136
|
+
const left = Math.max(
|
|
137
|
+
panelLeft,
|
|
138
|
+
Math.min(panelRight - tabWidth, tabLeft),
|
|
139
|
+
);
|
|
140
|
+
const right = left + tabWidth;
|
|
141
|
+
const top = RAIL_HEIGHT - TAB_HEIGHT;
|
|
142
|
+
const bottom = RAIL_HEIGHT;
|
|
143
|
+
const leftJoin = Math.max(panelLeft, left - LIQUID_JOIN);
|
|
144
|
+
const rightJoin = Math.min(panelRight, right + LIQUID_JOIN);
|
|
145
|
+
const leftDepth = Math.min(LIQUID_JOIN, left - leftJoin);
|
|
146
|
+
const rightDepth = Math.min(LIQUID_JOIN, rightJoin - right);
|
|
147
|
+
const leftControl = leftDepth * 0.55;
|
|
148
|
+
const rightControl = rightDepth * 0.55;
|
|
149
|
+
const leftPanelRadius = Math.min(PANEL_RADIUS, leftJoin - panelLeft);
|
|
150
|
+
const rightPanelRadius = Math.min(PANEL_RADIUS, panelRight - rightJoin);
|
|
151
|
+
|
|
152
|
+
return [
|
|
153
|
+
`M${panelLeft} ${bottom + PANEL_RADIUS}`,
|
|
154
|
+
`V${bottom + leftPanelRadius}`,
|
|
155
|
+
`Q${panelLeft} ${bottom} ${panelLeft + leftPanelRadius} ${bottom}`,
|
|
156
|
+
`H${leftJoin}`,
|
|
157
|
+
`C${leftJoin + leftControl} ${bottom} ${left} ${bottom - leftDepth + leftControl} ${left} ${bottom - leftDepth}`,
|
|
158
|
+
`V${top + TAB_RADIUS}`,
|
|
159
|
+
`Q${left} ${top} ${left + TAB_RADIUS} ${top}`,
|
|
160
|
+
`H${right - TAB_RADIUS}`,
|
|
161
|
+
`Q${right} ${top} ${right} ${top + TAB_RADIUS}`,
|
|
162
|
+
`V${bottom - rightDepth}`,
|
|
163
|
+
`C${right} ${bottom - rightDepth + rightControl} ${rightJoin - rightControl} ${bottom} ${rightJoin} ${bottom}`,
|
|
164
|
+
`H${panelRight - rightPanelRadius}`,
|
|
165
|
+
`Q${panelRight} ${bottom} ${panelRight} ${bottom + rightPanelRadius}`,
|
|
166
|
+
`V${bottom + PANEL_RADIUS}`,
|
|
167
|
+
"Z",
|
|
168
|
+
].join(" ");
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function SpringTab({
|
|
172
|
+
id,
|
|
173
|
+
targetLeft,
|
|
174
|
+
dragging,
|
|
175
|
+
dragLeft,
|
|
176
|
+
surfaceLeft,
|
|
177
|
+
reduce,
|
|
178
|
+
active,
|
|
179
|
+
anyDragging,
|
|
180
|
+
surfaceHost,
|
|
181
|
+
surfaceWidth,
|
|
182
|
+
tabWidth,
|
|
183
|
+
surfaceClassName,
|
|
184
|
+
zIndex,
|
|
185
|
+
className,
|
|
186
|
+
children,
|
|
187
|
+
registerPosition,
|
|
188
|
+
onPointerDown,
|
|
189
|
+
onPointerMove,
|
|
190
|
+
onPointerUp,
|
|
191
|
+
onPointerCancel,
|
|
192
|
+
onLostPointerCapture,
|
|
193
|
+
}: SpringTabProps) {
|
|
194
|
+
const target = useMotionValue(targetLeft);
|
|
195
|
+
const position = useSpring(target, SPRING_GLIDE);
|
|
196
|
+
const settledTransform = useTransform(
|
|
197
|
+
reduce ? target : position,
|
|
198
|
+
(left) => `translate3d(${left}px, 0, 0)`,
|
|
199
|
+
);
|
|
200
|
+
const draggedTransform = useTransform(
|
|
201
|
+
dragLeft,
|
|
202
|
+
(left) => `translate3d(${left}px, 0, 0)`,
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
useLayoutEffect(() => {
|
|
206
|
+
target.set(targetLeft);
|
|
207
|
+
if (reduce) position.jump(targetLeft);
|
|
208
|
+
}, [position, reduce, target, targetLeft]);
|
|
209
|
+
|
|
210
|
+
useLayoutEffect(() => {
|
|
211
|
+
registerPosition(id, position);
|
|
212
|
+
return () => registerPosition(id, null);
|
|
213
|
+
}, [id, position, registerPosition]);
|
|
214
|
+
|
|
215
|
+
const liquidDriver = anyDragging
|
|
216
|
+
? dragging
|
|
217
|
+
? dragLeft
|
|
218
|
+
: position
|
|
219
|
+
: surfaceLeft;
|
|
220
|
+
|
|
221
|
+
return (
|
|
222
|
+
<>
|
|
223
|
+
{active && surfaceHost && surfaceWidth > SURFACE_INSET * 2
|
|
224
|
+
? createPortal(
|
|
225
|
+
<svg
|
|
226
|
+
aria-hidden="true"
|
|
227
|
+
focusable="false"
|
|
228
|
+
viewBox={`0 0 ${surfaceWidth} ${RAIL_HEIGHT + PANEL_RADIUS}`}
|
|
229
|
+
preserveAspectRatio="none"
|
|
230
|
+
className={cn(
|
|
231
|
+
"pointer-events-none absolute inset-x-0 top-0 h-[108px] w-full text-[#fafaf8]",
|
|
232
|
+
dragging ? "z-20" : "z-0",
|
|
233
|
+
surfaceClassName,
|
|
234
|
+
)}
|
|
235
|
+
>
|
|
236
|
+
<LiquidSurfacePath
|
|
237
|
+
key={
|
|
238
|
+
anyDragging
|
|
239
|
+
? dragging
|
|
240
|
+
? "dragged"
|
|
241
|
+
: "displaced"
|
|
242
|
+
: "idle"
|
|
243
|
+
}
|
|
244
|
+
left={liquidDriver}
|
|
245
|
+
surfaceWidth={surfaceWidth}
|
|
246
|
+
tabWidth={tabWidth}
|
|
247
|
+
/>
|
|
248
|
+
</svg>,
|
|
249
|
+
surfaceHost,
|
|
250
|
+
)
|
|
251
|
+
: null}
|
|
252
|
+
<motion.div
|
|
253
|
+
style={{
|
|
254
|
+
zIndex,
|
|
255
|
+
transform: dragging ? draggedTransform : settledTransform,
|
|
256
|
+
}}
|
|
257
|
+
className={className}
|
|
258
|
+
onPointerDown={onPointerDown}
|
|
259
|
+
onPointerMove={onPointerMove}
|
|
260
|
+
onPointerUp={onPointerUp}
|
|
261
|
+
onPointerCancel={onPointerCancel}
|
|
262
|
+
onLostPointerCapture={onLostPointerCapture}
|
|
263
|
+
>
|
|
264
|
+
{children}
|
|
265
|
+
</motion.div>
|
|
266
|
+
</>
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
function LiquidSurfacePath({
|
|
271
|
+
left,
|
|
272
|
+
surfaceWidth,
|
|
273
|
+
tabWidth,
|
|
274
|
+
}: {
|
|
275
|
+
left: MotionValue<number>;
|
|
276
|
+
surfaceWidth: number;
|
|
277
|
+
tabWidth: number;
|
|
278
|
+
}) {
|
|
279
|
+
const path = useTransform(left, (value) =>
|
|
280
|
+
liquidTabPath(value, surfaceWidth, tabWidth),
|
|
281
|
+
);
|
|
282
|
+
return <motion.path d={path} fill="currentColor" />;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export function MorphingTabs({
|
|
286
|
+
items,
|
|
287
|
+
value,
|
|
288
|
+
defaultValue,
|
|
289
|
+
onValueChange,
|
|
290
|
+
onOrderChange,
|
|
291
|
+
onClose,
|
|
292
|
+
ariaLabel = "Tabs",
|
|
293
|
+
className,
|
|
294
|
+
classNames,
|
|
295
|
+
}: MorphingTabsProps) {
|
|
296
|
+
const reduce = Boolean(useReducedMotion());
|
|
297
|
+
const uid = useId();
|
|
298
|
+
const itemIds = useMemo(() => items.map((item) => item.id), [items]);
|
|
299
|
+
const itemMap = useMemo(
|
|
300
|
+
() => new Map(items.map((item) => [item.id, item])),
|
|
301
|
+
[items],
|
|
302
|
+
);
|
|
303
|
+
const [order, setOrder] = useState(itemIds);
|
|
304
|
+
const orderRef = useRef(order);
|
|
305
|
+
orderRef.current = order;
|
|
306
|
+
|
|
307
|
+
const [internalValue, setInternalValue] = useState<string | null>(
|
|
308
|
+
defaultValue ?? itemIds[0] ?? null,
|
|
309
|
+
);
|
|
310
|
+
const controlled = value !== undefined;
|
|
311
|
+
const currentValue = controlled ? (value ?? null) : internalValue;
|
|
312
|
+
|
|
313
|
+
const rootRef = useRef<HTMLDivElement | null>(null);
|
|
314
|
+
const railRef = useRef<HTMLDivElement | null>(null);
|
|
315
|
+
const tabButtonRefs = useRef<Record<string, HTMLButtonElement | null>>({});
|
|
316
|
+
const tabPositionRefs = useRef<Record<string, MotionValue<number> | null>>(
|
|
317
|
+
{},
|
|
318
|
+
);
|
|
319
|
+
const dragRef = useRef<DragSession | null>(null);
|
|
320
|
+
const dragAnimationRef = useRef<ReturnType<typeof animateValue> | null>(null);
|
|
321
|
+
const surfaceAnimationRef = useRef<ReturnType<typeof animateValue> | null>(
|
|
322
|
+
null,
|
|
323
|
+
);
|
|
324
|
+
const [surfaceWidth, setSurfaceWidth] = useState(0);
|
|
325
|
+
const [tabGap, setTabGap] = useState(12);
|
|
326
|
+
const [draggingId, setDraggingId] = useState<string | null>(null);
|
|
327
|
+
const [dragTargetIndex, setDragTargetIndex] = useState(-1);
|
|
328
|
+
const dragLeft = useMotionValue(SURFACE_INSET);
|
|
329
|
+
const surfaceLeft = useMotionValue(SURFACE_INSET);
|
|
330
|
+
|
|
331
|
+
useEffect(() => {
|
|
332
|
+
setOrder((current) => {
|
|
333
|
+
const available = new Set(itemIds);
|
|
334
|
+
const retained = current.filter((id) => available.has(id));
|
|
335
|
+
const retainedSet = new Set(retained);
|
|
336
|
+
const added = itemIds.filter((id) => !retainedSet.has(id));
|
|
337
|
+
const next = [...retained, ...added];
|
|
338
|
+
return sameOrder(current, next) ? current : next;
|
|
339
|
+
});
|
|
340
|
+
}, [itemIds]);
|
|
341
|
+
|
|
342
|
+
const orderedItems = useMemo(
|
|
343
|
+
() =>
|
|
344
|
+
order.flatMap((id) => {
|
|
345
|
+
const item = itemMap.get(id);
|
|
346
|
+
return item ? [item] : [];
|
|
347
|
+
}),
|
|
348
|
+
[itemMap, order],
|
|
349
|
+
);
|
|
350
|
+
|
|
351
|
+
const firstEnabledItem =
|
|
352
|
+
orderedItems.find((item) => !item.disabled) ?? orderedItems[0] ?? null;
|
|
353
|
+
const activeItem =
|
|
354
|
+
currentValue && itemMap.has(currentValue)
|
|
355
|
+
? itemMap.get(currentValue) ?? null
|
|
356
|
+
: firstEnabledItem;
|
|
357
|
+
const activeId = activeItem?.id ?? null;
|
|
358
|
+
|
|
359
|
+
// The rail cannot scroll: the liquid surface is one continuous shape spanning
|
|
360
|
+
// the panel, so its notch has to stay over the tab that cut it. Slots narrow
|
|
361
|
+
// to fit the panel instead, in that order of sacrifice:
|
|
362
|
+
// 1. the design width, down to a floor where a truncated label still reads;
|
|
363
|
+
// 2. the gap between slots, so the floor survives one panel narrower;
|
|
364
|
+
// 3. the floor itself — a cramped tab is still tappable, a clipped one is
|
|
365
|
+
// not reachable at all.
|
|
366
|
+
// Every tier fits inside the panel by construction, so no tab is ever cut off
|
|
367
|
+
// and the notch never has to be clamped away from the tab that cut it.
|
|
368
|
+
const { tabWidth, slotGap } = useMemo(() => {
|
|
369
|
+
const count = order.length;
|
|
370
|
+
if (!surfaceWidth || count === 0) {
|
|
371
|
+
return { tabWidth: MAX_TAB_WIDTH, slotGap: tabGap };
|
|
372
|
+
}
|
|
373
|
+
const inner = surfaceWidth - SURFACE_INSET * 2;
|
|
374
|
+
const widthAt = (gap: number) =>
|
|
375
|
+
Math.floor((inner - gap * (count - 1)) / count);
|
|
376
|
+
|
|
377
|
+
if (widthAt(tabGap) >= MIN_TAB_WIDTH) {
|
|
378
|
+
return {
|
|
379
|
+
tabWidth: Math.min(MAX_TAB_WIDTH, widthAt(tabGap)),
|
|
380
|
+
slotGap: tabGap,
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
if (count > 1 && widthAt(0) >= MIN_TAB_WIDTH) {
|
|
384
|
+
const gap = Math.floor((inner - MIN_TAB_WIDTH * count) / (count - 1));
|
|
385
|
+
return { tabWidth: MIN_TAB_WIDTH, slotGap: Math.max(0, gap) };
|
|
386
|
+
}
|
|
387
|
+
return { tabWidth: Math.max(0, widthAt(0)), slotGap: 0 };
|
|
388
|
+
}, [order.length, surfaceWidth, tabGap]);
|
|
389
|
+
|
|
390
|
+
const slotLefts = useMemo(
|
|
391
|
+
() =>
|
|
392
|
+
order.map(
|
|
393
|
+
(_, index) => SURFACE_INSET + index * (tabWidth + slotGap),
|
|
394
|
+
),
|
|
395
|
+
[order, slotGap, tabWidth],
|
|
396
|
+
);
|
|
397
|
+
|
|
398
|
+
const dragStartIndex = draggingId ? order.indexOf(draggingId) : -1;
|
|
399
|
+
|
|
400
|
+
const visualIndexFor = useCallback(
|
|
401
|
+
(index: number) => {
|
|
402
|
+
if (dragStartIndex < 0 || dragTargetIndex < 0) return index;
|
|
403
|
+
if (index === dragStartIndex) return dragTargetIndex;
|
|
404
|
+
|
|
405
|
+
if (
|
|
406
|
+
dragTargetIndex > dragStartIndex &&
|
|
407
|
+
index > dragStartIndex &&
|
|
408
|
+
index <= dragTargetIndex
|
|
409
|
+
) {
|
|
410
|
+
return index - 1;
|
|
411
|
+
}
|
|
412
|
+
if (
|
|
413
|
+
dragTargetIndex < dragStartIndex &&
|
|
414
|
+
index >= dragTargetIndex &&
|
|
415
|
+
index < dragStartIndex
|
|
416
|
+
) {
|
|
417
|
+
return index + 1;
|
|
418
|
+
}
|
|
419
|
+
return index;
|
|
420
|
+
},
|
|
421
|
+
[dragStartIndex, dragTargetIndex],
|
|
422
|
+
);
|
|
423
|
+
|
|
424
|
+
useLayoutEffect(() => {
|
|
425
|
+
const root = rootRef.current;
|
|
426
|
+
const rail = railRef.current;
|
|
427
|
+
if (!root || !rail) return;
|
|
428
|
+
|
|
429
|
+
const measure = () => {
|
|
430
|
+
setSurfaceWidth(root.clientWidth);
|
|
431
|
+
const nextGap = Number.parseFloat(getComputedStyle(rail).columnGap);
|
|
432
|
+
if (Number.isFinite(nextGap)) setTabGap(nextGap);
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
measure();
|
|
436
|
+
const observer = new ResizeObserver(measure);
|
|
437
|
+
observer.observe(root);
|
|
438
|
+
return () => observer.disconnect();
|
|
439
|
+
}, []);
|
|
440
|
+
|
|
441
|
+
const setActive = useCallback(
|
|
442
|
+
(id: string | null) => {
|
|
443
|
+
if (id && itemMap.get(id)?.disabled) return;
|
|
444
|
+
if (!controlled) setInternalValue(id);
|
|
445
|
+
onValueChange?.(id);
|
|
446
|
+
},
|
|
447
|
+
[controlled, itemMap, onValueChange],
|
|
448
|
+
);
|
|
449
|
+
|
|
450
|
+
useEffect(() => {
|
|
451
|
+
if (currentValue && itemMap.has(currentValue)) return;
|
|
452
|
+
if (firstEnabledItem && firstEnabledItem.id !== currentValue) {
|
|
453
|
+
setActive(firstEnabledItem.id);
|
|
454
|
+
}
|
|
455
|
+
}, [currentValue, firstEnabledItem, itemMap, setActive]);
|
|
456
|
+
|
|
457
|
+
const activeOrderIndex = activeId ? order.indexOf(activeId) : -1;
|
|
458
|
+
const activeVisualIndex =
|
|
459
|
+
activeOrderIndex < 0 ? -1 : visualIndexFor(activeOrderIndex);
|
|
460
|
+
|
|
461
|
+
useLayoutEffect(() => {
|
|
462
|
+
if (
|
|
463
|
+
!activeId ||
|
|
464
|
+
activeVisualIndex < 0 ||
|
|
465
|
+
activeId === draggingId ||
|
|
466
|
+
!slotLefts[activeVisualIndex]
|
|
467
|
+
) {
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
surfaceAnimationRef.current?.stop();
|
|
472
|
+
|
|
473
|
+
if (draggingId) return;
|
|
474
|
+
|
|
475
|
+
surfaceAnimationRef.current = animateValue(
|
|
476
|
+
surfaceLeft,
|
|
477
|
+
slotLefts[activeVisualIndex],
|
|
478
|
+
reduce ? { duration: 0 } : SPRING_GLIDE,
|
|
479
|
+
);
|
|
480
|
+
}, [
|
|
481
|
+
activeId,
|
|
482
|
+
activeVisualIndex,
|
|
483
|
+
draggingId,
|
|
484
|
+
reduce,
|
|
485
|
+
slotLefts,
|
|
486
|
+
surfaceLeft,
|
|
487
|
+
]);
|
|
488
|
+
|
|
489
|
+
const commitOrder = useCallback(
|
|
490
|
+
(next: string[], notify: boolean) => {
|
|
491
|
+
orderRef.current = next;
|
|
492
|
+
setOrder((current) => (sameOrder(current, next) ? current : next));
|
|
493
|
+
if (notify) onOrderChange?.(next);
|
|
494
|
+
},
|
|
495
|
+
[onOrderChange],
|
|
496
|
+
);
|
|
497
|
+
|
|
498
|
+
const registerPosition = useCallback(
|
|
499
|
+
(id: string, position: MotionValue<number> | null) => {
|
|
500
|
+
tabPositionRefs.current[id] = position;
|
|
501
|
+
},
|
|
502
|
+
[],
|
|
503
|
+
);
|
|
504
|
+
|
|
505
|
+
const startDrag = useCallback(
|
|
506
|
+
(id: string, event: ReactPointerEvent<HTMLDivElement>) => {
|
|
507
|
+
if (
|
|
508
|
+
event.button !== 0 ||
|
|
509
|
+
itemMap.get(id)?.disabled ||
|
|
510
|
+
dragRef.current
|
|
511
|
+
) {
|
|
512
|
+
return;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
const startIndex = orderRef.current.indexOf(id);
|
|
516
|
+
if (startIndex < 0) return;
|
|
517
|
+
const capturedSlots = orderRef.current.map(
|
|
518
|
+
(_, index) => SURFACE_INSET + index * (tabWidth + slotGap),
|
|
519
|
+
);
|
|
520
|
+
const startLeft = capturedSlots[startIndex];
|
|
521
|
+
|
|
522
|
+
dragAnimationRef.current?.stop();
|
|
523
|
+
dragAnimationRef.current = null;
|
|
524
|
+
dragLeft.set(startLeft);
|
|
525
|
+
dragRef.current = {
|
|
526
|
+
id,
|
|
527
|
+
pointerId: event.pointerId,
|
|
528
|
+
originX: event.clientX,
|
|
529
|
+
startLeft,
|
|
530
|
+
startIndex,
|
|
531
|
+
targetIndex: startIndex,
|
|
532
|
+
moved: false,
|
|
533
|
+
finishing: false,
|
|
534
|
+
startOrder: orderRef.current.slice(),
|
|
535
|
+
slotLefts: capturedSlots,
|
|
536
|
+
};
|
|
537
|
+
},
|
|
538
|
+
[dragLeft, itemMap, slotGap, tabWidth],
|
|
539
|
+
);
|
|
540
|
+
|
|
541
|
+
const moveDrag = useCallback(
|
|
542
|
+
(event: ReactPointerEvent<HTMLDivElement>) => {
|
|
543
|
+
const drag = dragRef.current;
|
|
544
|
+
if (!drag || drag.finishing || drag.pointerId !== event.pointerId) return;
|
|
545
|
+
|
|
546
|
+
const delta = event.clientX - drag.originX;
|
|
547
|
+
if (!drag.moved && Math.abs(delta) < DRAG_THRESHOLD) return;
|
|
548
|
+
event.preventDefault();
|
|
549
|
+
|
|
550
|
+
if (!drag.moved) {
|
|
551
|
+
drag.moved = true;
|
|
552
|
+
capturePointer(event.currentTarget, event.pointerId);
|
|
553
|
+
if (drag.id === activeId) {
|
|
554
|
+
surfaceAnimationRef.current?.stop();
|
|
555
|
+
surfaceLeft.set(drag.startLeft);
|
|
556
|
+
}
|
|
557
|
+
setDraggingId(drag.id);
|
|
558
|
+
setDragTargetIndex(drag.startIndex);
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
const minLeft = drag.slotLefts[0];
|
|
562
|
+
const maxLeft = drag.slotLefts[drag.slotLefts.length - 1];
|
|
563
|
+
const visualLeft = Math.max(
|
|
564
|
+
minLeft,
|
|
565
|
+
Math.min(maxLeft, drag.startLeft + delta),
|
|
566
|
+
);
|
|
567
|
+
let targetIndex = drag.startIndex;
|
|
568
|
+
|
|
569
|
+
if (visualLeft >= drag.startLeft) {
|
|
570
|
+
for (
|
|
571
|
+
let index = drag.startIndex + 1;
|
|
572
|
+
index < drag.slotLefts.length;
|
|
573
|
+
index += 1
|
|
574
|
+
) {
|
|
575
|
+
if (visualLeft + tabWidth / 2 >= drag.slotLefts[index]) {
|
|
576
|
+
targetIndex = index;
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
} else {
|
|
580
|
+
for (let index = drag.startIndex - 1; index >= 0; index -= 1) {
|
|
581
|
+
if (visualLeft <= drag.slotLefts[index] + tabWidth / 2) {
|
|
582
|
+
targetIndex = index;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
dragLeft.set(visualLeft);
|
|
588
|
+
if (targetIndex !== drag.targetIndex) {
|
|
589
|
+
drag.targetIndex = targetIndex;
|
|
590
|
+
setDragTargetIndex(targetIndex);
|
|
591
|
+
}
|
|
592
|
+
},
|
|
593
|
+
[activeId, dragLeft, surfaceLeft, tabWidth],
|
|
594
|
+
);
|
|
595
|
+
|
|
596
|
+
const finishDrag = useCallback(
|
|
597
|
+
(pointerId: number) => {
|
|
598
|
+
const drag = dragRef.current;
|
|
599
|
+
if (!drag || drag.pointerId !== pointerId || drag.finishing) return;
|
|
600
|
+
|
|
601
|
+
if (!drag.moved) {
|
|
602
|
+
dragRef.current = null;
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
drag.finishing = true;
|
|
607
|
+
const targetLeft = drag.slotLefts[drag.targetIndex];
|
|
608
|
+
const controls = animateValue(
|
|
609
|
+
dragLeft,
|
|
610
|
+
targetLeft,
|
|
611
|
+
reduce ? { duration: 0 } : SPRING_GLIDE,
|
|
612
|
+
);
|
|
613
|
+
dragAnimationRef.current = controls;
|
|
614
|
+
|
|
615
|
+
controls.then(async () => {
|
|
616
|
+
if (dragAnimationRef.current !== controls) return;
|
|
617
|
+
const next = moveItem(
|
|
618
|
+
drag.startOrder,
|
|
619
|
+
drag.startIndex,
|
|
620
|
+
drag.targetIndex,
|
|
621
|
+
);
|
|
622
|
+
|
|
623
|
+
if (!reduce) {
|
|
624
|
+
await new Promise<void>((resolve) => {
|
|
625
|
+
const startedAt = performance.now();
|
|
626
|
+
const check = () => {
|
|
627
|
+
const settled = next.every((id, index) => {
|
|
628
|
+
if (id === drag.id) return true;
|
|
629
|
+
const position = tabPositionRefs.current[id];
|
|
630
|
+
if (!position) return true;
|
|
631
|
+
return (
|
|
632
|
+
Math.abs(position.get() - drag.slotLefts[index]) < 0.5 &&
|
|
633
|
+
Math.abs(position.getVelocity()) < 10
|
|
634
|
+
);
|
|
635
|
+
});
|
|
636
|
+
|
|
637
|
+
if (settled || performance.now() - startedAt > 500) {
|
|
638
|
+
resolve();
|
|
639
|
+
return;
|
|
640
|
+
}
|
|
641
|
+
requestAnimationFrame(check);
|
|
642
|
+
};
|
|
643
|
+
check();
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
if (dragAnimationRef.current !== controls) return;
|
|
648
|
+
if (drag.id === activeId) {
|
|
649
|
+
surfaceLeft.set(targetLeft);
|
|
650
|
+
} else if (activeId) {
|
|
651
|
+
const activePosition = tabPositionRefs.current[activeId];
|
|
652
|
+
if (activePosition) surfaceLeft.set(activePosition.get());
|
|
653
|
+
}
|
|
654
|
+
tabPositionRefs.current[drag.id]?.jump(targetLeft);
|
|
655
|
+
dragAnimationRef.current = null;
|
|
656
|
+
dragRef.current = null;
|
|
657
|
+
commitOrder(next, !sameOrder(drag.startOrder, next));
|
|
658
|
+
setDraggingId(null);
|
|
659
|
+
setDragTargetIndex(-1);
|
|
660
|
+
});
|
|
661
|
+
},
|
|
662
|
+
[activeId, commitOrder, dragLeft, reduce, surfaceLeft],
|
|
663
|
+
);
|
|
664
|
+
|
|
665
|
+
useEffect(() => {
|
|
666
|
+
const finishFromWindow = (event: PointerEvent) => {
|
|
667
|
+
finishDrag(event.pointerId);
|
|
668
|
+
};
|
|
669
|
+
window.addEventListener("pointerup", finishFromWindow, true);
|
|
670
|
+
window.addEventListener("pointercancel", finishFromWindow, true);
|
|
671
|
+
return () => {
|
|
672
|
+
window.removeEventListener("pointerup", finishFromWindow, true);
|
|
673
|
+
window.removeEventListener("pointercancel", finishFromWindow, true);
|
|
674
|
+
};
|
|
675
|
+
}, [finishDrag]);
|
|
676
|
+
|
|
677
|
+
const moveBy = useCallback(
|
|
678
|
+
(id: string, direction: -1 | 1) => {
|
|
679
|
+
const current = orderRef.current;
|
|
680
|
+
const index = current.indexOf(id);
|
|
681
|
+
const nextIndex = index + direction;
|
|
682
|
+
if (
|
|
683
|
+
index < 0 ||
|
|
684
|
+
nextIndex < 0 ||
|
|
685
|
+
nextIndex >= current.length ||
|
|
686
|
+
itemMap.get(id)?.disabled
|
|
687
|
+
) {
|
|
688
|
+
return;
|
|
689
|
+
}
|
|
690
|
+
commitOrder(moveItem(current, index, nextIndex), true);
|
|
691
|
+
},
|
|
692
|
+
[commitOrder, itemMap],
|
|
693
|
+
);
|
|
694
|
+
|
|
695
|
+
const handleTabKeyDown = useCallback(
|
|
696
|
+
(id: string, event: React.KeyboardEvent<HTMLButtonElement>) => {
|
|
697
|
+
const index = orderRef.current.indexOf(id);
|
|
698
|
+
if (index < 0) return;
|
|
699
|
+
|
|
700
|
+
if (
|
|
701
|
+
event.altKey &&
|
|
702
|
+
(event.key === "ArrowLeft" || event.key === "ArrowRight")
|
|
703
|
+
) {
|
|
704
|
+
event.preventDefault();
|
|
705
|
+
moveBy(id, event.key === "ArrowLeft" ? -1 : 1);
|
|
706
|
+
return;
|
|
707
|
+
}
|
|
708
|
+
if (event.key !== "ArrowLeft" && event.key !== "ArrowRight") return;
|
|
709
|
+
|
|
710
|
+
event.preventDefault();
|
|
711
|
+
const direction = event.key === "ArrowLeft" ? -1 : 1;
|
|
712
|
+
const nextIndex =
|
|
713
|
+
(index + direction + orderRef.current.length) % orderRef.current.length;
|
|
714
|
+
const nextId = orderRef.current[nextIndex];
|
|
715
|
+
setActive(nextId);
|
|
716
|
+
requestAnimationFrame(() => tabButtonRefs.current[nextId]?.focus());
|
|
717
|
+
},
|
|
718
|
+
[moveBy, setActive],
|
|
719
|
+
);
|
|
720
|
+
|
|
721
|
+
if (!orderedItems.length) return null;
|
|
722
|
+
|
|
723
|
+
return (
|
|
724
|
+
<div
|
|
725
|
+
ref={rootRef}
|
|
726
|
+
className={cn(
|
|
727
|
+
"relative isolate min-w-0 overflow-hidden rounded-[2rem] bg-[#292929] text-white",
|
|
728
|
+
classNames?.root,
|
|
729
|
+
className,
|
|
730
|
+
)}
|
|
731
|
+
>
|
|
732
|
+
<div className="relative h-20">
|
|
733
|
+
<div
|
|
734
|
+
ref={railRef}
|
|
735
|
+
role="tablist"
|
|
736
|
+
aria-label={ariaLabel}
|
|
737
|
+
aria-orientation="horizontal"
|
|
738
|
+
className={cn(
|
|
739
|
+
"relative z-30 flex h-full gap-3 md:gap-4",
|
|
740
|
+
classNames?.rail,
|
|
741
|
+
)}
|
|
742
|
+
>
|
|
743
|
+
{orderedItems.map((item, index) => {
|
|
744
|
+
const isActive = item.id === activeId;
|
|
745
|
+
const isDragging = item.id === draggingId;
|
|
746
|
+
const visualIndex = visualIndexFor(index);
|
|
747
|
+
const targetLeft = slotLefts[visualIndex] ?? SURFACE_INSET;
|
|
748
|
+
const tabId = `${uid}-tab-${safeId(item.id)}`;
|
|
749
|
+
|
|
750
|
+
return (
|
|
751
|
+
<SpringTab
|
|
752
|
+
key={item.id}
|
|
753
|
+
id={item.id}
|
|
754
|
+
targetLeft={targetLeft}
|
|
755
|
+
dragging={isDragging}
|
|
756
|
+
dragLeft={dragLeft}
|
|
757
|
+
surfaceLeft={surfaceLeft}
|
|
758
|
+
reduce={reduce}
|
|
759
|
+
active={isActive}
|
|
760
|
+
anyDragging={Boolean(draggingId)}
|
|
761
|
+
surfaceHost={rootRef.current}
|
|
762
|
+
surfaceWidth={surfaceWidth}
|
|
763
|
+
tabWidth={tabWidth}
|
|
764
|
+
surfaceClassName={classNames?.activeTab}
|
|
765
|
+
zIndex={isDragging ? 30 : isActive ? 20 : 1}
|
|
766
|
+
className={cn(
|
|
767
|
+
// The drag is ours end to end, so iPadOS must not answer the
|
|
768
|
+
// press with its callout or a native drag of the label.
|
|
769
|
+
"group absolute left-0 top-0 flex touch-pan-y items-stretch",
|
|
770
|
+
TOUCH_GESTURE_CLASS,
|
|
771
|
+
item.disabled && "cursor-not-allowed",
|
|
772
|
+
isDragging ? "cursor-grabbing" : "cursor-grab",
|
|
773
|
+
)}
|
|
774
|
+
registerPosition={registerPosition}
|
|
775
|
+
onPointerDown={(event) => startDrag(item.id, event)}
|
|
776
|
+
onPointerMove={moveDrag}
|
|
777
|
+
onPointerUp={(event) => finishDrag(event.pointerId)}
|
|
778
|
+
onPointerCancel={(event) => finishDrag(event.pointerId)}
|
|
779
|
+
// A touch is implicitly captured by whatever it landed on —
|
|
780
|
+
// here the label inside the tab — so the moment the drag takes
|
|
781
|
+
// the capture for the tab itself, that child *loses* it, and
|
|
782
|
+
// the notification bubbles straight back up to this handler.
|
|
783
|
+
// Ending the drag on it kills the gesture on the frame it
|
|
784
|
+
// starts. Only the tab losing its own capture means the
|
|
785
|
+
// platform took the pointer away. A mouse has no implicit
|
|
786
|
+
// capture, which is why this only ever bit on a real finger.
|
|
787
|
+
onLostPointerCapture={(event) => {
|
|
788
|
+
if (event.target !== event.currentTarget) return;
|
|
789
|
+
finishDrag(event.pointerId);
|
|
790
|
+
}}
|
|
791
|
+
>
|
|
792
|
+
<div
|
|
793
|
+
style={{
|
|
794
|
+
width: tabWidth,
|
|
795
|
+
height: TAB_HEIGHT,
|
|
796
|
+
marginTop: TAB_TOP,
|
|
797
|
+
}}
|
|
798
|
+
className="relative flex items-stretch"
|
|
799
|
+
>
|
|
800
|
+
{!isActive ? (
|
|
801
|
+
<span
|
|
802
|
+
aria-hidden
|
|
803
|
+
className={cn(
|
|
804
|
+
"absolute inset-x-0 bottom-2 top-0 rounded-[1.25rem] transition-colors duration-200",
|
|
805
|
+
isDragging
|
|
806
|
+
? "bg-[#3a3a3a]"
|
|
807
|
+
: "bg-transparent group-hover:bg-white/[0.06]",
|
|
808
|
+
)}
|
|
809
|
+
/>
|
|
810
|
+
) : null}
|
|
811
|
+
|
|
812
|
+
<button
|
|
813
|
+
ref={(node) => {
|
|
814
|
+
tabButtonRefs.current[item.id] = node;
|
|
815
|
+
}}
|
|
816
|
+
id={tabId}
|
|
817
|
+
type="button"
|
|
818
|
+
role="tab"
|
|
819
|
+
aria-selected={isActive}
|
|
820
|
+
aria-controls={`${uid}-panel`}
|
|
821
|
+
aria-disabled={item.disabled || undefined}
|
|
822
|
+
tabIndex={isActive ? 0 : -1}
|
|
823
|
+
disabled={item.disabled}
|
|
824
|
+
onClick={() => {
|
|
825
|
+
const drag = dragRef.current;
|
|
826
|
+
if (drag?.id === item.id && drag.moved) return;
|
|
827
|
+
setActive(item.id);
|
|
828
|
+
}}
|
|
829
|
+
onKeyDown={(event) => handleTabKeyDown(item.id, event)}
|
|
830
|
+
className={cn(
|
|
831
|
+
"group relative z-10 flex h-full w-full min-w-0 items-center gap-2 overflow-hidden rounded-t-[1.5rem] px-3 text-left outline-none transition-colors",
|
|
832
|
+
isActive
|
|
833
|
+
? "text-[#181818]"
|
|
834
|
+
: "pb-2 text-white/70 hover:text-white",
|
|
835
|
+
classNames?.tab,
|
|
836
|
+
)}
|
|
837
|
+
>
|
|
838
|
+
<span
|
|
839
|
+
aria-hidden
|
|
840
|
+
className={cn(
|
|
841
|
+
"pointer-events-none absolute inset-x-1 top-1 opacity-0 transition-opacity group-focus-visible:opacity-100",
|
|
842
|
+
isActive
|
|
843
|
+
? "bottom-0 rounded-t-[1.25rem] border-x-2 border-t-2 border-black/20"
|
|
844
|
+
: "bottom-2 rounded-[1rem] border-2 border-white/60",
|
|
845
|
+
)}
|
|
846
|
+
/>
|
|
847
|
+
{item.icon ? (
|
|
848
|
+
<span
|
|
849
|
+
aria-hidden
|
|
850
|
+
className={cn(
|
|
851
|
+
"grid size-8 shrink-0 place-items-center",
|
|
852
|
+
classNames?.icon,
|
|
853
|
+
)}
|
|
854
|
+
>
|
|
855
|
+
{item.icon}
|
|
856
|
+
</span>
|
|
857
|
+
) : null}
|
|
858
|
+
<span
|
|
859
|
+
className={cn(
|
|
860
|
+
"min-w-0 truncate whitespace-nowrap text-base font-medium leading-none tracking-[-0.025em]",
|
|
861
|
+
classNames?.label,
|
|
862
|
+
)}
|
|
863
|
+
>
|
|
864
|
+
{item.label}
|
|
865
|
+
</span>
|
|
866
|
+
</button>
|
|
867
|
+
|
|
868
|
+
{onClose ? (
|
|
869
|
+
<button
|
|
870
|
+
type="button"
|
|
871
|
+
aria-label={`Close ${item.label}`}
|
|
872
|
+
onPointerDown={(event) => event.stopPropagation()}
|
|
873
|
+
onClick={(event) => {
|
|
874
|
+
event.stopPropagation();
|
|
875
|
+
onClose(item.id);
|
|
876
|
+
}}
|
|
877
|
+
className={cn(
|
|
878
|
+
"absolute right-2 top-1/2 z-20 grid size-6 -translate-y-1/2 place-items-center rounded-full text-[#9aa0a8] transition-colors hover:bg-black/[0.06] hover:text-[#4b5563] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-current",
|
|
879
|
+
!isActive &&
|
|
880
|
+
"top-[calc(50%-4px)] text-white/45 hover:bg-white/[0.08] hover:text-white/80",
|
|
881
|
+
classNames?.close,
|
|
882
|
+
)}
|
|
883
|
+
>
|
|
884
|
+
<X aria-hidden className="size-3.5 stroke-[1.5]" />
|
|
885
|
+
</button>
|
|
886
|
+
) : null}
|
|
887
|
+
</div>
|
|
888
|
+
</SpringTab>
|
|
889
|
+
);
|
|
890
|
+
})}
|
|
891
|
+
</div>
|
|
892
|
+
</div>
|
|
893
|
+
|
|
894
|
+
<div
|
|
895
|
+
id={`${uid}-panel`}
|
|
896
|
+
role="tabpanel"
|
|
897
|
+
aria-labelledby={`${uid}-tab-${safeId(activeId ?? "empty")}`}
|
|
898
|
+
className={cn(
|
|
899
|
+
"relative z-20 mx-4 min-h-64 overflow-hidden rounded-[1.75rem] bg-[#fafaf8] text-[#181818]",
|
|
900
|
+
classNames?.content,
|
|
901
|
+
)}
|
|
902
|
+
>
|
|
903
|
+
<AnimatePresence mode="popLayout" initial={false}>
|
|
904
|
+
{activeItem ? (
|
|
905
|
+
<motion.div
|
|
906
|
+
key={activeItem.id}
|
|
907
|
+
initial={
|
|
908
|
+
reduce
|
|
909
|
+
? { opacity: 0 }
|
|
910
|
+
: { opacity: 0, y: 8, filter: "blur(6px)" }
|
|
911
|
+
}
|
|
912
|
+
animate={{ opacity: 1, y: 0, filter: "blur(0px)" }}
|
|
913
|
+
exit={
|
|
914
|
+
reduce
|
|
915
|
+
? {
|
|
916
|
+
opacity: 0,
|
|
917
|
+
transition: { duration: 0.08, ease: EASE_OUT },
|
|
918
|
+
}
|
|
919
|
+
: {
|
|
920
|
+
opacity: 0,
|
|
921
|
+
y: -5,
|
|
922
|
+
filter: "blur(5px)",
|
|
923
|
+
transition: { duration: 0.12, ease: EASE_OUT },
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
transition={
|
|
927
|
+
reduce
|
|
928
|
+
? { duration: 0.12, ease: EASE_OUT }
|
|
929
|
+
: SPRING_PRESS
|
|
930
|
+
}
|
|
931
|
+
className="min-h-64"
|
|
932
|
+
>
|
|
933
|
+
{activeItem.content}
|
|
934
|
+
</motion.div>
|
|
935
|
+
) : null}
|
|
936
|
+
</AnimatePresence>
|
|
937
|
+
</div>
|
|
938
|
+
</div>
|
|
939
|
+
);
|
|
940
|
+
}
|