@ctrl-ui/react 0.8.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/README.md +70 -0
- package/dist/action-bar.d.ts +44 -0
- package/dist/action-bar.js +89 -0
- package/dist/activity.d.ts +53 -0
- package/dist/activity.js +188 -0
- package/dist/audio-recorder.d.ts +32 -0
- package/dist/audio-recorder.js +235 -0
- package/dist/audio-visualizer.d.ts +12 -0
- package/dist/audio-visualizer.js +58 -0
- package/dist/blocks/chat.d.ts +10 -0
- package/dist/blocks/chat.js +12 -0
- package/dist/blocks/coding-agent.d.ts +61 -0
- package/dist/blocks/coding-agent.js +255 -0
- package/dist/blocks/file-explorer-data.d.ts +57 -0
- package/dist/blocks/file-explorer-data.js +74 -0
- package/dist/blocks/file-explorer.d.ts +24 -0
- package/dist/blocks/file-explorer.js +427 -0
- package/dist/blocks/settings-data.d.ts +36 -0
- package/dist/blocks/settings-data.js +66 -0
- package/dist/blocks/settings.d.ts +19 -0
- package/dist/blocks/settings.js +282 -0
- package/dist/blocks/theme-toggle.d.ts +43 -0
- package/dist/blocks/theme-toggle.js +180 -0
- package/dist/chat-composer-attachment.d.ts +55 -0
- package/dist/chat-composer-attachment.js +267 -0
- package/dist/chat-composer-editor/extensions/mention.d.ts +14 -0
- package/dist/chat-composer-editor/extensions/mention.js +278 -0
- package/dist/chat-composer-editor/ghost.d.ts +5 -0
- package/dist/chat-composer-editor/ghost.js +55 -0
- package/dist/chat-composer-editor/schema.d.ts +6 -0
- package/dist/chat-composer-editor/schema.js +25 -0
- package/dist/chat-composer-editor/serialize.d.ts +6 -0
- package/dist/chat-composer-editor/serialize.js +16 -0
- package/dist/chat-composer-editor/types.d.ts +29 -0
- package/dist/chat-composer-editor/types.js +0 -0
- package/dist/chat-composer-editor.d.ts +9 -0
- package/dist/chat-composer-editor.js +154 -0
- package/dist/chat-composer.d.ts +60 -0
- package/dist/chat-composer.js +134 -0
- package/dist/chat-layout.d.ts +27 -0
- package/dist/chat-layout.js +114 -0
- package/dist/chat-message.d.ts +31 -0
- package/dist/chat-message.js +95 -0
- package/dist/code-block-editor.d.ts +59 -0
- package/dist/code-block-editor.js +250 -0
- package/dist/context-model.d.ts +33 -0
- package/dist/context-model.js +52 -0
- package/dist/context.d.ts +47 -0
- package/dist/context.js +335 -0
- package/dist/control-props.d.ts +28 -0
- package/dist/control-props.js +4 -0
- package/dist/control-variants.d.ts +8 -0
- package/dist/control-variants.js +14 -0
- package/dist/dynamic-notification-glass.d.ts +10 -0
- package/dist/dynamic-notification-glass.js +311 -0
- package/dist/dynamic-notification-liquid.d.ts +24 -0
- package/dist/dynamic-notification-liquid.js +682 -0
- package/dist/dynamic-notification-siri-wave.d.ts +4 -0
- package/dist/dynamic-notification-siri-wave.js +82 -0
- package/dist/dynamic-notification.d.ts +74 -0
- package/dist/dynamic-notification.js +342 -0
- package/dist/environment-variables.d.ts +124 -0
- package/dist/environment-variables.js +492 -0
- package/dist/extensions/create-track-highlight.d.ts +12 -0
- package/dist/extensions/create-track-highlight.js +147 -0
- package/dist/extensions/track-highlight.d.ts +22 -0
- package/dist/extensions/track-highlight.js +52 -0
- package/dist/hooks/use-audio-recorder.d.ts +107 -0
- package/dist/hooks/use-audio-recorder.js +577 -0
- package/dist/hooks/use-chat-composer.d.ts +56 -0
- package/dist/hooks/use-chat-composer.js +63 -0
- package/dist/hooks/use-chat-message.d.ts +28 -0
- package/dist/hooks/use-chat-message.js +24 -0
- package/dist/hooks/use-color-area.d.ts +18 -0
- package/dist/hooks/use-color-area.js +60 -0
- package/dist/hooks/use-copy-to-clipboard.d.ts +22 -0
- package/dist/hooks/use-copy-to-clipboard.js +90 -0
- package/dist/hooks/use-dropzone.d.ts +59 -0
- package/dist/hooks/use-dropzone.js +372 -0
- package/dist/hooks/use-dynamic-notification.d.ts +37 -0
- package/dist/hooks/use-dynamic-notification.js +87 -0
- package/dist/hooks/use-environment-variables.d.ts +51 -0
- package/dist/hooks/use-environment-variables.js +188 -0
- package/dist/hooks/use-mobile.d.ts +5 -0
- package/dist/hooks/use-mobile.js +29 -0
- package/dist/hooks/use-textarea-trigger-menu.d.ts +8 -0
- package/dist/hooks/use-textarea-trigger-menu.js +69 -0
- package/dist/hooks/use-trigger-menu.d.ts +49 -0
- package/dist/hooks/use-trigger-menu.js +102 -0
- package/dist/hooks/use-user-ask.d.ts +48 -0
- package/dist/hooks/use-user-ask.js +167 -0
- package/dist/inline-attachment.d.ts +37 -0
- package/dist/inline-attachment.js +192 -0
- package/dist/inline-citation.d.ts +56 -0
- package/dist/inline-citation.js +319 -0
- package/dist/knob-contracts/accordion-knobs.d.ts +5 -0
- package/dist/knob-contracts/accordion-knobs.js +9 -0
- package/dist/knob-contracts/action-bar-knobs.d.ts +5 -0
- package/dist/knob-contracts/action-bar-knobs.js +4 -0
- package/dist/knob-contracts/activity-knobs.d.ts +5 -0
- package/dist/knob-contracts/activity-knobs.js +9 -0
- package/dist/knob-contracts/alert-knobs.d.ts +5 -0
- package/dist/knob-contracts/alert-knobs.js +9 -0
- package/dist/knob-contracts/audio-recorder-knobs.d.ts +5 -0
- package/dist/knob-contracts/audio-recorder-knobs.js +9 -0
- package/dist/knob-contracts/audio-visualizer-knobs.d.ts +5 -0
- package/dist/knob-contracts/audio-visualizer-knobs.js +9 -0
- package/dist/knob-contracts/avatar-knobs.d.ts +5 -0
- package/dist/knob-contracts/avatar-knobs.js +9 -0
- package/dist/knob-contracts/badge-knobs.d.ts +5 -0
- package/dist/knob-contracts/badge-knobs.js +9 -0
- package/dist/knob-contracts/button-group-knobs.d.ts +5 -0
- package/dist/knob-contracts/button-group-knobs.js +9 -0
- package/dist/knob-contracts/button-knobs.d.ts +5 -0
- package/dist/knob-contracts/button-knobs.js +25 -0
- package/dist/knob-contracts/calendar-knobs.d.ts +5 -0
- package/dist/knob-contracts/calendar-knobs.js +10 -0
- package/dist/knob-contracts/card-knobs.d.ts +5 -0
- package/dist/knob-contracts/card-knobs.js +11 -0
- package/dist/knob-contracts/chat-composer-attachment-knobs.d.ts +5 -0
- package/dist/knob-contracts/chat-composer-attachment-knobs.js +11 -0
- package/dist/knob-contracts/chat-composer-knobs.d.ts +5 -0
- package/dist/knob-contracts/chat-composer-knobs.js +18 -0
- package/dist/knob-contracts/chat-layout-knobs.d.ts +5 -0
- package/dist/knob-contracts/chat-layout-knobs.js +11 -0
- package/dist/knob-contracts/chat-message-knobs.d.ts +5 -0
- package/dist/knob-contracts/chat-message-knobs.js +17 -0
- package/dist/knob-contracts/choice-knobs.d.ts +5 -0
- package/dist/knob-contracts/choice-knobs.js +9 -0
- package/dist/knob-contracts/code-block-editor-knobs.d.ts +5 -0
- package/dist/knob-contracts/code-block-editor-knobs.js +11 -0
- package/dist/knob-contracts/code-diff-knobs.d.ts +5 -0
- package/dist/knob-contracts/code-diff-knobs.js +18 -0
- package/dist/knob-contracts/code-knobs.d.ts +5 -0
- package/dist/knob-contracts/code-knobs.js +11 -0
- package/dist/knob-contracts/collapsible-knobs.d.ts +5 -0
- package/dist/knob-contracts/collapsible-knobs.js +4 -0
- package/dist/knob-contracts/color-picker-knobs.d.ts +5 -0
- package/dist/knob-contracts/color-picker-knobs.js +12 -0
- package/dist/knob-contracts/context-knobs.d.ts +5 -0
- package/dist/knob-contracts/context-knobs.js +13 -0
- package/dist/knob-contracts/dockable-panel-knobs.d.ts +5 -0
- package/dist/knob-contracts/dockable-panel-knobs.js +12 -0
- package/dist/knob-contracts/dropzone-knobs.d.ts +5 -0
- package/dist/knob-contracts/dropzone-knobs.js +11 -0
- package/dist/knob-contracts/dynamic-notification-knobs.d.ts +5 -0
- package/dist/knob-contracts/dynamic-notification-knobs.js +18 -0
- package/dist/knob-contracts/empty-knobs.d.ts +5 -0
- package/dist/knob-contracts/empty-knobs.js +12 -0
- package/dist/knob-contracts/environment-variables-knobs.d.ts +5 -0
- package/dist/knob-contracts/environment-variables-knobs.js +11 -0
- package/dist/knob-contracts/field-knobs.d.ts +5 -0
- package/dist/knob-contracts/field-knobs.js +16 -0
- package/dist/knob-contracts/gradient-editor-knobs.d.ts +5 -0
- package/dist/knob-contracts/gradient-editor-knobs.js +13 -0
- package/dist/knob-contracts/infinite-canvas-knobs.d.ts +5 -0
- package/dist/knob-contracts/infinite-canvas-knobs.js +13 -0
- package/dist/knob-contracts/inline-attachment-knobs.d.ts +5 -0
- package/dist/knob-contracts/inline-attachment-knobs.js +14 -0
- package/dist/knob-contracts/inline-citation-knobs.d.ts +5 -0
- package/dist/knob-contracts/inline-citation-knobs.js +14 -0
- package/dist/knob-contracts/item-knobs.d.ts +5 -0
- package/dist/knob-contracts/item-knobs.js +10 -0
- package/dist/knob-contracts/kbd-knobs.d.ts +5 -0
- package/dist/knob-contracts/kbd-knobs.js +10 -0
- package/dist/knob-contracts/markdown-block-knobs.d.ts +5 -0
- package/dist/knob-contracts/markdown-block-knobs.js +11 -0
- package/dist/knob-contracts/markdown-knobs.d.ts +5 -0
- package/dist/knob-contracts/markdown-knobs.js +14 -0
- package/dist/knob-contracts/morphing-panel-knobs.d.ts +5 -0
- package/dist/knob-contracts/morphing-panel-knobs.js +11 -0
- package/dist/knob-contracts/pagination-knobs.d.ts +5 -0
- package/dist/knob-contracts/pagination-knobs.js +10 -0
- package/dist/knob-contracts/phone-input-knobs.d.ts +5 -0
- package/dist/knob-contracts/phone-input-knobs.js +10 -0
- package/dist/knob-contracts/popup-knobs.d.ts +5 -0
- package/dist/knob-contracts/popup-knobs.js +21 -0
- package/dist/knob-contracts/range-knobs.d.ts +5 -0
- package/dist/knob-contracts/range-knobs.js +13 -0
- package/dist/knob-contracts/resizable-knobs.d.ts +5 -0
- package/dist/knob-contracts/resizable-knobs.js +14 -0
- package/dist/knob-contracts/rich-tooltip-knobs.d.ts +5 -0
- package/dist/knob-contracts/rich-tooltip-knobs.js +13 -0
- package/dist/knob-contracts/scroll-area-knobs.d.ts +5 -0
- package/dist/knob-contracts/scroll-area-knobs.js +8 -0
- package/dist/knob-contracts/separator-knobs.d.ts +5 -0
- package/dist/knob-contracts/separator-knobs.js +4 -0
- package/dist/knob-contracts/sidebar-knobs.d.ts +5 -0
- package/dist/knob-contracts/sidebar-knobs.js +26 -0
- package/dist/knob-contracts/skeleton-knobs.d.ts +5 -0
- package/dist/knob-contracts/skeleton-knobs.js +4 -0
- package/dist/knob-contracts/source-badge-knobs.d.ts +5 -0
- package/dist/knob-contracts/source-badge-knobs.js +11 -0
- package/dist/knob-contracts/spinner-knobs.d.ts +5 -0
- package/dist/knob-contracts/spinner-knobs.js +4 -0
- package/dist/knob-contracts/stepper-knobs.d.ts +5 -0
- package/dist/knob-contracts/stepper-knobs.js +11 -0
- package/dist/knob-contracts/switch-knobs.d.ts +5 -0
- package/dist/knob-contracts/switch-knobs.js +12 -0
- package/dist/knob-contracts/table-knobs.d.ts +5 -0
- package/dist/knob-contracts/table-knobs.js +12 -0
- package/dist/knob-contracts/table-of-contents-knobs.d.ts +5 -0
- package/dist/knob-contracts/table-of-contents-knobs.js +8 -0
- package/dist/knob-contracts/tabs-knobs.d.ts +5 -0
- package/dist/knob-contracts/tabs-knobs.js +16 -0
- package/dist/knob-contracts/task-list-knobs.d.ts +5 -0
- package/dist/knob-contracts/task-list-knobs.js +14 -0
- package/dist/knob-contracts/thread-rail-knobs.d.ts +5 -0
- package/dist/knob-contracts/thread-rail-knobs.js +14 -0
- package/dist/knob-contracts/timeline-knobs.d.ts +5 -0
- package/dist/knob-contracts/timeline-knobs.js +12 -0
- package/dist/knob-contracts/toolbar-knobs.d.ts +5 -0
- package/dist/knob-contracts/toolbar-knobs.js +20 -0
- package/dist/knob-contracts/track-highlight-knobs.d.ts +5 -0
- package/dist/knob-contracts/track-highlight-knobs.js +11 -0
- package/dist/knob-contracts/transcript-divider-knobs.d.ts +5 -0
- package/dist/knob-contracts/transcript-divider-knobs.js +10 -0
- package/dist/knob-contracts/tree-knobs.d.ts +5 -0
- package/dist/knob-contracts/tree-knobs.js +13 -0
- package/dist/knob-contracts/user-ask-knobs.d.ts +5 -0
- package/dist/knob-contracts/user-ask-knobs.js +17 -0
- package/dist/lib/cn.d.ts +5 -0
- package/dist/lib/cn.js +34 -0
- package/dist/lib/code-block-shiki.d.ts +9 -0
- package/dist/lib/code-block-shiki.js +6 -0
- package/dist/lib/code-tokens.d.ts +28 -0
- package/dist/lib/code-tokens.js +160 -0
- package/dist/lib/color.d.ts +72 -0
- package/dist/lib/color.js +490 -0
- package/dist/lib/contrast.d.ts +30 -0
- package/dist/lib/contrast.js +64 -0
- package/dist/lib/diff.d.ts +50 -0
- package/dist/lib/diff.js +315 -0
- package/dist/lib/dropzone-validation.d.ts +66 -0
- package/dist/lib/dropzone-validation.js +228 -0
- package/dist/lib/env-file.d.ts +28 -0
- package/dist/lib/env-file.js +218 -0
- package/dist/lib/format-audio-recorder-duration.d.ts +4 -0
- package/dist/lib/format-audio-recorder-duration.js +7 -0
- package/dist/lib/liquid-glass-optics.d.ts +4 -0
- package/dist/lib/liquid-glass-optics.js +96 -0
- package/dist/lib/phone-input-format.d.ts +6 -0
- package/dist/lib/phone-input-format.js +26 -0
- package/dist/lib/phone-number.d.ts +18 -0
- package/dist/lib/phone-number.js +28 -0
- package/dist/lib/trigger-detect.d.ts +15 -0
- package/dist/lib/trigger-detect.js +77 -0
- package/dist/markdown-block.d.ts +25 -0
- package/dist/markdown-block.js +77 -0
- package/dist/skin.config.d.ts +5 -0
- package/dist/skin.config.js +4 -0
- package/dist/skin.d.ts +69 -0
- package/dist/skin.js +62 -0
- package/dist/source-badge.d.ts +23 -0
- package/dist/source-badge.js +72 -0
- package/dist/styles/chat-composer-editor.css +44 -0
- package/dist/styles/code.css +57 -0
- package/dist/styles/effects.css +126 -0
- package/dist/styles/index.css +81 -0
- package/dist/styles/recipes/accordion.css +87 -0
- package/dist/styles/recipes/action-bar.css +19 -0
- package/dist/styles/recipes/activity.css +129 -0
- package/dist/styles/recipes/alert.css +75 -0
- package/dist/styles/recipes/audio-recorder.css +102 -0
- package/dist/styles/recipes/audio-visualizer.css +90 -0
- package/dist/styles/recipes/avatar.css +52 -0
- package/dist/styles/recipes/badge.css +110 -0
- package/dist/styles/recipes/button-group.css +64 -0
- package/dist/styles/recipes/button.css +305 -0
- package/dist/styles/recipes/calendar.css +152 -0
- package/dist/styles/recipes/card.css +93 -0
- package/dist/styles/recipes/chat-composer-attachment.css +177 -0
- package/dist/styles/recipes/chat-composer.css +195 -0
- package/dist/styles/recipes/chat-layout.css +108 -0
- package/dist/styles/recipes/chat-message.css +160 -0
- package/dist/styles/recipes/choice.css +108 -0
- package/dist/styles/recipes/code-block-editor.css +136 -0
- package/dist/styles/recipes/code-diff.css +256 -0
- package/dist/styles/recipes/code.css +136 -0
- package/dist/styles/recipes/collapsible.css +27 -0
- package/dist/styles/recipes/color-picker-details.css +61 -0
- package/dist/styles/recipes/color-picker-values.css +117 -0
- package/dist/styles/recipes/color-picker.css +158 -0
- package/dist/styles/recipes/context.css +237 -0
- package/dist/styles/recipes/dockable-panel.css +106 -0
- package/dist/styles/recipes/dropzone.css +149 -0
- package/dist/styles/recipes/dynamic-notification-input.css +29 -0
- package/dist/styles/recipes/dynamic-notification-motion.css +298 -0
- package/dist/styles/recipes/dynamic-notification.css +241 -0
- package/dist/styles/recipes/empty.css +96 -0
- package/dist/styles/recipes/environment-variables.css +173 -0
- package/dist/styles/recipes/field-parts.css +148 -0
- package/dist/styles/recipes/field.css +234 -0
- package/dist/styles/recipes/gradient-editor.css +109 -0
- package/dist/styles/recipes/infinite-canvas.css +78 -0
- package/dist/styles/recipes/inline-attachment.css +182 -0
- package/dist/styles/recipes/inline-citation.css +174 -0
- package/dist/styles/recipes/item.css +107 -0
- package/dist/styles/recipes/kbd.css +55 -0
- package/dist/styles/recipes/markdown-block.css +75 -0
- package/dist/styles/recipes/markdown.css +204 -0
- package/dist/styles/recipes/morphing-panel.css +123 -0
- package/dist/styles/recipes/pagination.css +86 -0
- package/dist/styles/recipes/phone-input.css +105 -0
- package/dist/styles/recipes/popup-controls.css +59 -0
- package/dist/styles/recipes/popup-drawer.css +162 -0
- package/dist/styles/recipes/popup-lists.css +198 -0
- package/dist/styles/recipes/popup-motion.css +94 -0
- package/dist/styles/recipes/popup-toast.css +126 -0
- package/dist/styles/recipes/popup.css +396 -0
- package/dist/styles/recipes/range.css +259 -0
- package/dist/styles/recipes/resizable.css +170 -0
- package/dist/styles/recipes/rich-tooltip.css +272 -0
- package/dist/styles/recipes/scroll-area.css +59 -0
- package/dist/styles/recipes/separator.css +12 -0
- package/dist/styles/recipes/sidebar.css +345 -0
- package/dist/styles/recipes/skeleton.css +23 -0
- package/dist/styles/recipes/source-badge.css +77 -0
- package/dist/styles/recipes/spinner.css +33 -0
- package/dist/styles/recipes/stepper.css +178 -0
- package/dist/styles/recipes/switch.css +149 -0
- package/dist/styles/recipes/table-of-contents.css +107 -0
- package/dist/styles/recipes/table.css +124 -0
- package/dist/styles/recipes/tabs.css +235 -0
- package/dist/styles/recipes/task-list.css +146 -0
- package/dist/styles/recipes/thread-rail.css +247 -0
- package/dist/styles/recipes/timeline.css +107 -0
- package/dist/styles/recipes/toolbar.css +260 -0
- package/dist/styles/recipes/track-highlight.css +73 -0
- package/dist/styles/recipes/transcript-divider.css +64 -0
- package/dist/styles/recipes/tree.css +137 -0
- package/dist/styles/recipes/user-ask-details.css +45 -0
- package/dist/styles/recipes/user-ask.css +204 -0
- package/dist/styles/skin-theme.css +137 -0
- package/dist/styles/skin.css +143 -0
- package/dist/styles/theme.css +628 -0
- package/dist/styles/type-scale.css +45 -0
- package/dist/surface-variants.d.ts +6 -0
- package/dist/surface-variants.js +16 -0
- package/dist/task-list.d.ts +34 -0
- package/dist/task-list.js +177 -0
- package/dist/thread-rail.d.ts +52 -0
- package/dist/thread-rail.js +190 -0
- package/dist/transcript-divider.d.ts +15 -0
- package/dist/transcript-divider.js +25 -0
- package/dist/ui/accordion.d.ts +31 -0
- package/dist/ui/accordion.js +60 -0
- package/dist/ui/alert-dialog.d.ts +36 -0
- package/dist/ui/alert-dialog.js +100 -0
- package/dist/ui/alert.d.ts +21 -0
- package/dist/ui/alert.js +36 -0
- package/dist/ui/aspect-ratio.d.ts +8 -0
- package/dist/ui/aspect-ratio.js +17 -0
- package/dist/ui/autocomplete.d.ts +70 -0
- package/dist/ui/autocomplete.js +150 -0
- package/dist/ui/avatar.d.ts +24 -0
- package/dist/ui/avatar.js +44 -0
- package/dist/ui/badge.d.ts +20 -0
- package/dist/ui/badge.js +36 -0
- package/dist/ui/button-group.d.ts +24 -0
- package/dist/ui/button-group.js +45 -0
- package/dist/ui/button.d.ts +36 -0
- package/dist/ui/button.js +104 -0
- package/dist/ui/calendar.d.ts +11 -0
- package/dist/ui/calendar.js +160 -0
- package/dist/ui/card.d.ts +36 -0
- package/dist/ui/card.js +70 -0
- package/dist/ui/checkbox-group.d.ts +11 -0
- package/dist/ui/checkbox-group.js +16 -0
- package/dist/ui/checkbox.d.ts +23 -0
- package/dist/ui/checkbox.js +58 -0
- package/dist/ui/code-diff.d.ts +28 -0
- package/dist/ui/code-diff.js +561 -0
- package/dist/ui/code.d.ts +62 -0
- package/dist/ui/code.js +292 -0
- package/dist/ui/collapsible.d.ts +31 -0
- package/dist/ui/collapsible.js +72 -0
- package/dist/ui/color-picker.d.ts +137 -0
- package/dist/ui/color-picker.js +797 -0
- package/dist/ui/combobox-disabled-selection.d.ts +5 -0
- package/dist/ui/combobox-disabled-selection.js +11 -0
- package/dist/ui/combobox.d.ts +70 -0
- package/dist/ui/combobox.js +194 -0
- package/dist/ui/command.d.ts +44 -0
- package/dist/ui/command.js +166 -0
- package/dist/ui/context-menu.d.ts +86 -0
- package/dist/ui/context-menu.js +202 -0
- package/dist/ui/dialog.d.ts +38 -0
- package/dist/ui/dialog.js +124 -0
- package/dist/ui/dockable-panel-geometry.d.ts +18 -0
- package/dist/ui/dockable-panel-geometry.js +17 -0
- package/dist/ui/dockable-panel.d.ts +58 -0
- package/dist/ui/dockable-panel.js +366 -0
- package/dist/ui/drawer.d.ts +42 -0
- package/dist/ui/drawer.js +182 -0
- package/dist/ui/dropdown-menu.d.ts +46 -0
- package/dist/ui/dropdown-menu.js +89 -0
- package/dist/ui/dropzone.d.ts +66 -0
- package/dist/ui/dropzone.js +311 -0
- package/dist/ui/empty.d.ts +28 -0
- package/dist/ui/empty.js +59 -0
- package/dist/ui/field.d.ts +64 -0
- package/dist/ui/field.js +166 -0
- package/dist/ui/form.d.ts +10 -0
- package/dist/ui/form.js +17 -0
- package/dist/ui/gradient-editor.d.ts +47 -0
- package/dist/ui/gradient-editor.js +301 -0
- package/dist/ui/hover-card.d.ts +25 -0
- package/dist/ui/hover-card.js +46 -0
- package/dist/ui/infinite-canvas.d.ts +40 -0
- package/dist/ui/infinite-canvas.js +278 -0
- package/dist/ui/input-group.d.ts +21 -0
- package/dist/ui/input-group.js +44 -0
- package/dist/ui/input-otp.d.ts +38 -0
- package/dist/ui/input-otp.js +45 -0
- package/dist/ui/input.d.ts +12 -0
- package/dist/ui/input.js +18 -0
- package/dist/ui/item.d.ts +46 -0
- package/dist/ui/item.js +110 -0
- package/dist/ui/kbd.d.ts +12 -0
- package/dist/ui/kbd.js +23 -0
- package/dist/ui/markdown-elements.d.ts +52 -0
- package/dist/ui/markdown-elements.js +211 -0
- package/dist/ui/markdown.d.ts +14 -0
- package/dist/ui/markdown.js +31 -0
- package/dist/ui/menubar.d.ts +74 -0
- package/dist/ui/menubar.js +162 -0
- package/dist/ui/meter.d.ts +34 -0
- package/dist/ui/meter.js +57 -0
- package/dist/ui/morphing-panel.d.ts +24 -0
- package/dist/ui/morphing-panel.js +87 -0
- package/dist/ui/native-select.d.ts +12 -0
- package/dist/ui/native-select.js +41 -0
- package/dist/ui/navigation-menu.d.ts +51 -0
- package/dist/ui/navigation-menu.js +135 -0
- package/dist/ui/number-field.d.ts +72 -0
- package/dist/ui/number-field.js +124 -0
- package/dist/ui/pagination.d.ts +26 -0
- package/dist/ui/pagination.js +77 -0
- package/dist/ui/phone-input.d.ts +30 -0
- package/dist/ui/phone-input.js +263 -0
- package/dist/ui/popover.d.ts +34 -0
- package/dist/ui/popover.js +87 -0
- package/dist/ui/progress.d.ts +34 -0
- package/dist/ui/progress.js +57 -0
- package/dist/ui/radio-group.d.ts +29 -0
- package/dist/ui/radio-group.js +37 -0
- package/dist/ui/resizable.d.ts +56 -0
- package/dist/ui/resizable.js +82 -0
- package/dist/ui/responsive-dialog.d.ts +18 -0
- package/dist/ui/responsive-dialog.js +121 -0
- package/dist/ui/rich-tooltip-tour.d.ts +12 -0
- package/dist/ui/rich-tooltip-tour.js +20 -0
- package/dist/ui/rich-tooltip.d.ts +83 -0
- package/dist/ui/rich-tooltip.js +331 -0
- package/dist/ui/scroll-area.d.ts +25 -0
- package/dist/ui/scroll-area.js +93 -0
- package/dist/ui/select.d.ts +44 -0
- package/dist/ui/select.js +124 -0
- package/dist/ui/separator.d.ts +9 -0
- package/dist/ui/separator.js +16 -0
- package/dist/ui/sheet.d.ts +25 -0
- package/dist/ui/sheet.js +76 -0
- package/dist/ui/sidebar.d.ts +88 -0
- package/dist/ui/sidebar.js +362 -0
- package/dist/ui/skeleton.d.ts +8 -0
- package/dist/ui/skeleton.js +13 -0
- package/dist/ui/slider.d.ts +24 -0
- package/dist/ui/slider.js +114 -0
- package/dist/ui/spinner.d.ts +12 -0
- package/dist/ui/spinner.js +26 -0
- package/dist/ui/stepper.d.ts +58 -0
- package/dist/ui/stepper.js +232 -0
- package/dist/ui/switch.d.ts +26 -0
- package/dist/ui/switch.js +71 -0
- package/dist/ui/table-of-contents.d.ts +22 -0
- package/dist/ui/table-of-contents.js +181 -0
- package/dist/ui/table.d.ts +37 -0
- package/dist/ui/table.js +83 -0
- package/dist/ui/tabs.d.ts +36 -0
- package/dist/ui/tabs.js +127 -0
- package/dist/ui/textarea.d.ts +9 -0
- package/dist/ui/textarea.js +16 -0
- package/dist/ui/timeline.d.ts +40 -0
- package/dist/ui/timeline.js +80 -0
- package/dist/ui/toast.d.ts +28 -0
- package/dist/ui/toast.js +132 -0
- package/dist/ui/toggle.d.ts +20 -0
- package/dist/ui/toggle.js +71 -0
- package/dist/ui/toolbar.d.ts +40 -0
- package/dist/ui/toolbar.js +72 -0
- package/dist/ui/tooltip.d.ts +27 -0
- package/dist/ui/tooltip.js +93 -0
- package/dist/ui/tree.d.ts +56 -0
- package/dist/ui/tree.js +438 -0
- package/dist/ui/trigger-menu.d.ts +46 -0
- package/dist/ui/trigger-menu.js +116 -0
- package/dist/user-ask.d.ts +50 -0
- package/dist/user-ask.js +398 -0
- package/package.json +115 -0
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { Button } from "./button.js";
|
|
4
|
+
import { useIsMobile } from "../hooks/use-mobile.js";
|
|
5
|
+
import { clampDockablePanelPosition, dockablePanelSideAt, oppositeDockablePanelSide } from "./dockable-panel-geometry.js";
|
|
6
|
+
import { Drawer, DrawerContent } from "./drawer.js";
|
|
7
|
+
import { createContext, use, useRef, useState } from "react";
|
|
8
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
//#region src/ui/dockable-panel.tsx
|
|
10
|
+
const DockablePanelContext = createContext(null);
|
|
11
|
+
function useDockablePanelContext() {
|
|
12
|
+
const context = use(DockablePanelContext);
|
|
13
|
+
if (!context) throw new Error("DockablePanel parts must be used inside DockablePanel.");
|
|
14
|
+
return context;
|
|
15
|
+
}
|
|
16
|
+
function useControllableState(controlled, defaultValue, onChange) {
|
|
17
|
+
const [uncontrolled, setUncontrolled] = useState(defaultValue);
|
|
18
|
+
const value = controlled ?? uncontrolled;
|
|
19
|
+
function setValue(next) {
|
|
20
|
+
if (controlled === void 0) setUncontrolled(next);
|
|
21
|
+
onChange?.(next);
|
|
22
|
+
}
|
|
23
|
+
return [value, setValue];
|
|
24
|
+
}
|
|
25
|
+
function DockablePanel({ open: openProp, defaultOpen = true, onOpenChange, placement: placementProp, defaultPlacement = "right", onPlacementChange, className, style, children, "aria-label": ariaLabel = "Dockable panel", ...props }) {
|
|
26
|
+
const [open, setOpen] = useControllableState(openProp, defaultOpen, onOpenChange);
|
|
27
|
+
const [placement, setPlacementState] = useControllableState(placementProp, defaultPlacement, onPlacementChange);
|
|
28
|
+
const [dragging, setDragging] = useState(false);
|
|
29
|
+
const [potentialDock, setPotentialDock] = useState(placement);
|
|
30
|
+
const [dragPosition, setDragPosition] = useState(null);
|
|
31
|
+
const [dragHeight, setDragHeight] = useState(0);
|
|
32
|
+
const isMobile = useIsMobile();
|
|
33
|
+
const panelRef = useRef(null);
|
|
34
|
+
const potentialDockRef = useRef(placement);
|
|
35
|
+
const dragRef = useRef(null);
|
|
36
|
+
function setPlacement(next) {
|
|
37
|
+
setPlacementState(next);
|
|
38
|
+
}
|
|
39
|
+
function togglePlacement() {
|
|
40
|
+
setPlacement(oppositeDockablePanelSide(placement));
|
|
41
|
+
}
|
|
42
|
+
function close() {
|
|
43
|
+
setOpen(false);
|
|
44
|
+
}
|
|
45
|
+
function finishDrag(event, shouldDock) {
|
|
46
|
+
if (dragRef.current?.pointerId !== event.pointerId) return;
|
|
47
|
+
if (event.currentTarget.hasPointerCapture(event.pointerId)) event.currentTarget.releasePointerCapture(event.pointerId);
|
|
48
|
+
if (shouldDock) setPlacement(potentialDockRef.current);
|
|
49
|
+
dragRef.current = null;
|
|
50
|
+
setDragPosition(null);
|
|
51
|
+
setDragHeight(0);
|
|
52
|
+
setDragging(false);
|
|
53
|
+
}
|
|
54
|
+
function onPointerDown(event) {
|
|
55
|
+
if (event.button !== 0 || isMobile) return;
|
|
56
|
+
const panel = panelRef.current;
|
|
57
|
+
const container = panel?.offsetParent;
|
|
58
|
+
if (!(container instanceof HTMLElement) || !panel) return;
|
|
59
|
+
event.preventDefault();
|
|
60
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
61
|
+
const panelRect = panel.getBoundingClientRect();
|
|
62
|
+
const containerRect = container.getBoundingClientRect();
|
|
63
|
+
dragRef.current = {
|
|
64
|
+
pointerId: event.pointerId,
|
|
65
|
+
offsetX: event.clientX - panelRect.left,
|
|
66
|
+
offsetY: event.clientY - panelRect.top
|
|
67
|
+
};
|
|
68
|
+
potentialDockRef.current = placement;
|
|
69
|
+
setPotentialDock(placement);
|
|
70
|
+
setDragPosition({
|
|
71
|
+
x: panelRect.left - containerRect.left,
|
|
72
|
+
y: panelRect.top - containerRect.top
|
|
73
|
+
});
|
|
74
|
+
setDragHeight(panelRect.height);
|
|
75
|
+
setDragging(true);
|
|
76
|
+
}
|
|
77
|
+
function onPointerMove(event) {
|
|
78
|
+
const drag = dragRef.current;
|
|
79
|
+
const panel = panelRef.current;
|
|
80
|
+
const container = panel?.offsetParent;
|
|
81
|
+
if (!drag || drag.pointerId !== event.pointerId || !(container instanceof HTMLElement) || !panel) return;
|
|
82
|
+
const bounds = container.getBoundingClientRect();
|
|
83
|
+
const nextDock = dockablePanelSideAt(event.clientX - bounds.left, bounds.width);
|
|
84
|
+
potentialDockRef.current = nextDock;
|
|
85
|
+
setPotentialDock(nextDock);
|
|
86
|
+
setDragPosition(clampDockablePanelPosition({
|
|
87
|
+
x: event.clientX - bounds.left - drag.offsetX,
|
|
88
|
+
y: event.clientY - bounds.top - drag.offsetY
|
|
89
|
+
}, {
|
|
90
|
+
width: bounds.width,
|
|
91
|
+
height: bounds.height
|
|
92
|
+
}, {
|
|
93
|
+
width: panel.offsetWidth,
|
|
94
|
+
height: panel.offsetHeight
|
|
95
|
+
}));
|
|
96
|
+
}
|
|
97
|
+
function onPointerUp(event) {
|
|
98
|
+
finishDrag(event, true);
|
|
99
|
+
}
|
|
100
|
+
function onPointerCancel(event) {
|
|
101
|
+
finishDrag(event, false);
|
|
102
|
+
}
|
|
103
|
+
const context = {
|
|
104
|
+
close,
|
|
105
|
+
dragging,
|
|
106
|
+
isMobile,
|
|
107
|
+
placement,
|
|
108
|
+
setPlacement,
|
|
109
|
+
togglePlacement,
|
|
110
|
+
dragHandleProps: {
|
|
111
|
+
onPointerDown,
|
|
112
|
+
onPointerMove,
|
|
113
|
+
onPointerUp,
|
|
114
|
+
onPointerCancel
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
const dropZoneStyle = dragging ? {
|
|
118
|
+
height: dragHeight,
|
|
119
|
+
"--cui-dockable-panel-drop-zone-active-background": style?.["--cui-dockable-panel-drop-zone-active-background"],
|
|
120
|
+
"--cui-dockable-panel-drop-zone-active-border-color": style?.["--cui-dockable-panel-drop-zone-active-border-color"]
|
|
121
|
+
} : void 0;
|
|
122
|
+
if (isMobile) return /* @__PURE__ */ jsx(DockablePanelContext.Provider, {
|
|
123
|
+
value: context,
|
|
124
|
+
children: /* @__PURE__ */ jsx(Drawer, {
|
|
125
|
+
open,
|
|
126
|
+
onOpenChange: setOpen,
|
|
127
|
+
side: "bottom",
|
|
128
|
+
children: /* @__PURE__ */ jsx(DrawerContent, {
|
|
129
|
+
"data-dockable-panel-root": "",
|
|
130
|
+
"data-placement": placement,
|
|
131
|
+
padding: "none",
|
|
132
|
+
variant: "floating",
|
|
133
|
+
surface: "card",
|
|
134
|
+
"aria-label": ariaLabel,
|
|
135
|
+
className: cn("max-h-[min(82vh,42rem)] gap-0 overflow-hidden", className),
|
|
136
|
+
style,
|
|
137
|
+
...props,
|
|
138
|
+
children
|
|
139
|
+
})
|
|
140
|
+
})
|
|
141
|
+
});
|
|
142
|
+
if (!open) return null;
|
|
143
|
+
return /* @__PURE__ */ jsxs(DockablePanelContext.Provider, {
|
|
144
|
+
value: context,
|
|
145
|
+
children: [dragging ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(DockablePanelDropZone, {
|
|
146
|
+
side: "left",
|
|
147
|
+
active: potentialDock === "left",
|
|
148
|
+
style: dropZoneStyle
|
|
149
|
+
}), /* @__PURE__ */ jsx(DockablePanelDropZone, {
|
|
150
|
+
side: "right",
|
|
151
|
+
active: potentialDock === "right",
|
|
152
|
+
style: dropZoneStyle
|
|
153
|
+
})] }) : null, /* @__PURE__ */ jsxs("aside", {
|
|
154
|
+
ref: panelRef,
|
|
155
|
+
"data-control-ui": "dockable-panel",
|
|
156
|
+
"data-control-family": "dockable-panel",
|
|
157
|
+
"data-slot": "root",
|
|
158
|
+
"data-surface": "panel",
|
|
159
|
+
"data-placement": placement,
|
|
160
|
+
"data-dragging": dragging ? "true" : void 0,
|
|
161
|
+
"aria-label": ariaLabel,
|
|
162
|
+
className: cn("absolute z-30 flex w-[min(22rem,calc(50%_-_1.125rem))] flex-col overflow-hidden", !dragging && placement === "left" && "top-3 left-3 max-h-[calc(100%_-_1.5rem)]", !dragging && placement === "right" && "top-3 right-3 max-h-[calc(100%_-_1.5rem)]", dragging && "top-0 left-0 max-h-[calc(100%_-_1.5rem)]", dragging && "select-none", className),
|
|
163
|
+
style: dragging && dragPosition ? {
|
|
164
|
+
...style,
|
|
165
|
+
transform: `translate3d(${dragPosition.x}px, ${dragPosition.y}px, 0)`
|
|
166
|
+
} : style,
|
|
167
|
+
...props,
|
|
168
|
+
children: [children, /* @__PURE__ */ jsxs("span", {
|
|
169
|
+
className: "sr-only",
|
|
170
|
+
"aria-live": "polite",
|
|
171
|
+
children: [
|
|
172
|
+
"Panel docked ",
|
|
173
|
+
placement,
|
|
174
|
+
"."
|
|
175
|
+
]
|
|
176
|
+
})]
|
|
177
|
+
})]
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
function DockablePanelHeader({ className, ...props }) {
|
|
181
|
+
return /* @__PURE__ */ jsx("div", {
|
|
182
|
+
"data-control-ui": "dockable-panel",
|
|
183
|
+
"data-control-family": "dockable-panel",
|
|
184
|
+
"data-slot": "header",
|
|
185
|
+
className: cn("flex shrink-0 items-center", className),
|
|
186
|
+
...props
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
function DockablePanelDragHandle({ className, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, children, ...props }) {
|
|
190
|
+
const context = useDockablePanelContext();
|
|
191
|
+
if (context.isMobile) return /* @__PURE__ */ jsx("div", {
|
|
192
|
+
"data-control-ui": "dockable-panel",
|
|
193
|
+
"data-control-family": "dockable-panel",
|
|
194
|
+
"data-slot": "drag-handle",
|
|
195
|
+
className: cn("flex min-w-0 flex-1 items-center self-stretch", className),
|
|
196
|
+
children
|
|
197
|
+
});
|
|
198
|
+
return /* @__PURE__ */ jsx("button", {
|
|
199
|
+
type: "button",
|
|
200
|
+
"data-control-ui": "dockable-panel",
|
|
201
|
+
"data-control-family": "dockable-panel",
|
|
202
|
+
"data-slot": "drag-handle",
|
|
203
|
+
"aria-label": "Drag panel",
|
|
204
|
+
"aria-pressed": context.dragging,
|
|
205
|
+
className: cn("flex min-w-0 flex-1 cursor-grab touch-none items-center self-stretch active:cursor-grabbing", className),
|
|
206
|
+
onPointerDown: (event) => {
|
|
207
|
+
onPointerDown?.(event);
|
|
208
|
+
if (!event.defaultPrevented) context.dragHandleProps.onPointerDown(event);
|
|
209
|
+
},
|
|
210
|
+
onPointerMove: (event) => {
|
|
211
|
+
onPointerMove?.(event);
|
|
212
|
+
if (!event.defaultPrevented) context.dragHandleProps.onPointerMove(event);
|
|
213
|
+
},
|
|
214
|
+
onPointerUp: (event) => {
|
|
215
|
+
onPointerUp?.(event);
|
|
216
|
+
if (!event.defaultPrevented) context.dragHandleProps.onPointerUp(event);
|
|
217
|
+
},
|
|
218
|
+
onPointerCancel: (event) => {
|
|
219
|
+
onPointerCancel?.(event);
|
|
220
|
+
if (!event.defaultPrevented) context.dragHandleProps.onPointerCancel(event);
|
|
221
|
+
},
|
|
222
|
+
...props,
|
|
223
|
+
children
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
function DockablePanelTitle({ className, ...props }) {
|
|
227
|
+
return /* @__PURE__ */ jsx("h2", {
|
|
228
|
+
"data-control-ui": "dockable-panel",
|
|
229
|
+
"data-control-family": "dockable-panel",
|
|
230
|
+
"data-slot": "title",
|
|
231
|
+
className: cn("truncate", className),
|
|
232
|
+
...props
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
function DockablePanelActions({ className, ...props }) {
|
|
236
|
+
return /* @__PURE__ */ jsx("div", {
|
|
237
|
+
"data-control-ui": "dockable-panel",
|
|
238
|
+
"data-control-family": "dockable-panel",
|
|
239
|
+
"data-slot": "actions",
|
|
240
|
+
className: cn("ml-auto flex shrink-0 items-center", className),
|
|
241
|
+
...props
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
function DockablePanelToggle({ className, children, "aria-label": ariaLabel, onClick, ...props }) {
|
|
245
|
+
const { isMobile, placement, togglePlacement } = useDockablePanelContext();
|
|
246
|
+
if (isMobile) return null;
|
|
247
|
+
const target = oppositeDockablePanelSide(placement);
|
|
248
|
+
const label = `Move panel to ${target}`;
|
|
249
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
250
|
+
type: "button",
|
|
251
|
+
variant: "ghost",
|
|
252
|
+
size: "sm",
|
|
253
|
+
iconOnly: true,
|
|
254
|
+
"aria-label": ariaLabel ?? label,
|
|
255
|
+
title: label,
|
|
256
|
+
className,
|
|
257
|
+
onClick: (event) => {
|
|
258
|
+
onClick?.(event);
|
|
259
|
+
if (!event.defaultPrevented) togglePlacement();
|
|
260
|
+
},
|
|
261
|
+
...props,
|
|
262
|
+
children: children ?? /* @__PURE__ */ jsx(DockPanelIcon, { side: target })
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
function DockablePanelDock({ placement: nextPlacement, className, children, "aria-label": ariaLabel, onClick, ...props }) {
|
|
266
|
+
const { isMobile, placement, setPlacement } = useDockablePanelContext();
|
|
267
|
+
if (isMobile) return null;
|
|
268
|
+
const label = `Dock panel ${nextPlacement}`;
|
|
269
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
270
|
+
type: "button",
|
|
271
|
+
variant: "ghost",
|
|
272
|
+
size: "sm",
|
|
273
|
+
iconOnly: true,
|
|
274
|
+
active: placement === nextPlacement,
|
|
275
|
+
"aria-pressed": placement === nextPlacement,
|
|
276
|
+
"aria-label": ariaLabel ?? label,
|
|
277
|
+
title: label,
|
|
278
|
+
className,
|
|
279
|
+
onClick: (event) => {
|
|
280
|
+
onClick?.(event);
|
|
281
|
+
if (!event.defaultPrevented) setPlacement(nextPlacement);
|
|
282
|
+
},
|
|
283
|
+
...props,
|
|
284
|
+
children: children ?? /* @__PURE__ */ jsx(PlacementIcon, { placement: nextPlacement })
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
function DockablePanelClose({ className, children, "aria-label": ariaLabel = "Close panel", onClick, ...props }) {
|
|
288
|
+
const { close } = useDockablePanelContext();
|
|
289
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
290
|
+
type: "button",
|
|
291
|
+
variant: "ghost",
|
|
292
|
+
size: "sm",
|
|
293
|
+
iconOnly: true,
|
|
294
|
+
"aria-label": ariaLabel,
|
|
295
|
+
title: ariaLabel,
|
|
296
|
+
className,
|
|
297
|
+
onClick: (event) => {
|
|
298
|
+
onClick?.(event);
|
|
299
|
+
if (!event.defaultPrevented) close();
|
|
300
|
+
},
|
|
301
|
+
...props,
|
|
302
|
+
children: children ?? /* @__PURE__ */ jsx(CloseIcon, {})
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
function DockablePanelContent({ padding = "default", className, ...props }) {
|
|
306
|
+
return /* @__PURE__ */ jsx("div", {
|
|
307
|
+
"data-control-ui": "dockable-panel",
|
|
308
|
+
"data-control-family": "dockable-panel",
|
|
309
|
+
"data-slot": "content",
|
|
310
|
+
"data-padding": padding,
|
|
311
|
+
className: cn("min-h-0 flex-1 overflow-y-auto", className),
|
|
312
|
+
...props
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
function DockablePanelDropZone({ side, active, style }) {
|
|
316
|
+
return /* @__PURE__ */ jsx("div", {
|
|
317
|
+
"data-control-ui": "dockable-panel",
|
|
318
|
+
"data-control-family": "dockable-panel",
|
|
319
|
+
"data-slot": "drop-zone",
|
|
320
|
+
"data-surface": "panel",
|
|
321
|
+
"data-side": side,
|
|
322
|
+
"data-active": active ? "true" : void 0,
|
|
323
|
+
className: cn("pointer-events-none absolute top-3 z-20 w-[min(22rem,calc(50%_-_1.125rem))]", side === "left" ? "left-3" : "right-3"),
|
|
324
|
+
style
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
function PlacementIcon({ placement }) {
|
|
328
|
+
return /* @__PURE__ */ jsx(DockPanelIcon, { side: placement });
|
|
329
|
+
}
|
|
330
|
+
function DockPanelIcon({ side = "right" }) {
|
|
331
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
332
|
+
viewBox: "0 0 16 16",
|
|
333
|
+
className: "size-4",
|
|
334
|
+
fill: "none",
|
|
335
|
+
"aria-hidden": "true",
|
|
336
|
+
children: [/* @__PURE__ */ jsx("rect", {
|
|
337
|
+
x: "2.25",
|
|
338
|
+
y: "2.25",
|
|
339
|
+
width: "11.5",
|
|
340
|
+
height: "11.5",
|
|
341
|
+
rx: "2",
|
|
342
|
+
stroke: "currentColor",
|
|
343
|
+
strokeWidth: "1.25"
|
|
344
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
345
|
+
d: side === "left" ? "M6 2.75v10.5" : "M10 2.75v10.5",
|
|
346
|
+
stroke: "currentColor",
|
|
347
|
+
strokeWidth: "1.25"
|
|
348
|
+
})]
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
function CloseIcon() {
|
|
352
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
353
|
+
viewBox: "0 0 16 16",
|
|
354
|
+
className: "size-4",
|
|
355
|
+
fill: "none",
|
|
356
|
+
"aria-hidden": "true",
|
|
357
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
358
|
+
d: "m4.5 4.5 7 7m0-7-7 7",
|
|
359
|
+
stroke: "currentColor",
|
|
360
|
+
strokeWidth: "1.4",
|
|
361
|
+
strokeLinecap: "round"
|
|
362
|
+
})
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
//#endregion
|
|
366
|
+
export { DockablePanel, DockablePanelActions, DockablePanelClose, DockablePanelContent, DockablePanelDock, DockablePanelDragHandle, DockablePanelHeader, DockablePanelTitle, DockablePanelToggle };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { PopupKnobStyle } from "../knob-contracts/popup-knobs.js";
|
|
2
|
+
import { CSSProperties, ComponentProps } from "react";
|
|
3
|
+
import { Drawer as Drawer$1 } from "@base-ui/react/drawer";
|
|
4
|
+
//#region src/ui/drawer.d.ts
|
|
5
|
+
declare const drawerSides: readonly ["bottom", "top", "right", "left"];
|
|
6
|
+
type DrawerSide = (typeof drawerSides)[number];
|
|
7
|
+
declare const drawerContentPaddings: readonly ["default", "none"];
|
|
8
|
+
type DrawerContentPadding = (typeof drawerContentPaddings)[number];
|
|
9
|
+
declare const drawerContentSurfaces: readonly ["background", "card"];
|
|
10
|
+
type DrawerContentSurface = (typeof drawerContentSurfaces)[number];
|
|
11
|
+
declare const drawerContentVariants: readonly ["edge", "floating"];
|
|
12
|
+
type DrawerContentVariant = (typeof drawerContentVariants)[number];
|
|
13
|
+
declare function Drawer(props: ComponentProps<typeof Drawer$1.Root> & {
|
|
14
|
+
side?: DrawerSide;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
declare function DrawerTrigger({ className, ...props }: ComponentProps<typeof Drawer$1.Trigger> & {
|
|
17
|
+
style?: CSSProperties & PopupKnobStyle;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
19
|
+
declare function DrawerClose({ className, ...props }: ComponentProps<typeof Drawer$1.Close> & {
|
|
20
|
+
style?: CSSProperties & PopupKnobStyle;
|
|
21
|
+
}): import("react").JSX.Element;
|
|
22
|
+
declare function DrawerContent({ className, children, side, padding, surface, variant, style, ...props }: Omit<ComponentProps<typeof Drawer$1.Popup>, "style"> & {
|
|
23
|
+
side?: DrawerSide;
|
|
24
|
+
padding?: DrawerContentPadding;
|
|
25
|
+
surface?: DrawerContentSurface;
|
|
26
|
+
variant?: DrawerContentVariant;
|
|
27
|
+
style?: CSSProperties & PopupKnobStyle;
|
|
28
|
+
}): import("react").JSX.Element;
|
|
29
|
+
declare function DrawerHeader({ className, ...props }: ComponentProps<"div"> & {
|
|
30
|
+
style?: CSSProperties & PopupKnobStyle;
|
|
31
|
+
}): import("react").JSX.Element;
|
|
32
|
+
declare function DrawerFooter({ className, ...props }: ComponentProps<"div"> & {
|
|
33
|
+
style?: CSSProperties & PopupKnobStyle;
|
|
34
|
+
}): import("react").JSX.Element;
|
|
35
|
+
declare function DrawerTitle({ className, ...props }: Omit<ComponentProps<typeof Drawer$1.Title>, "style"> & {
|
|
36
|
+
style?: CSSProperties & PopupKnobStyle;
|
|
37
|
+
}): import("react").JSX.Element;
|
|
38
|
+
declare function DrawerDescription({ className, ...props }: Omit<ComponentProps<typeof Drawer$1.Description>, "style"> & {
|
|
39
|
+
style?: CSSProperties & PopupKnobStyle;
|
|
40
|
+
}): import("react").JSX.Element;
|
|
41
|
+
//#endregion
|
|
42
|
+
export { Drawer, DrawerClose, DrawerContent, DrawerContentPadding, DrawerContentSurface, DrawerContentVariant, DrawerDescription, DrawerFooter, DrawerHeader, DrawerSide, DrawerTitle, DrawerTrigger, drawerContentPaddings, drawerContentSurfaces, drawerContentVariants, drawerSides };
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { skinEffects, skinId } from "../skin.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { Drawer as Drawer$1 } from "@base-ui/react/drawer";
|
|
6
|
+
//#region src/ui/drawer.tsx
|
|
7
|
+
const drawerSides = [
|
|
8
|
+
"bottom",
|
|
9
|
+
"top",
|
|
10
|
+
"right",
|
|
11
|
+
"left"
|
|
12
|
+
];
|
|
13
|
+
const drawerContentPaddings = ["default", "none"];
|
|
14
|
+
const drawerContentSurfaces = ["background", "card"];
|
|
15
|
+
const drawerContentVariants = ["edge", "floating"];
|
|
16
|
+
const swipeFor = {
|
|
17
|
+
bottom: "down",
|
|
18
|
+
top: "up",
|
|
19
|
+
right: "right",
|
|
20
|
+
left: "left"
|
|
21
|
+
};
|
|
22
|
+
const placement = {
|
|
23
|
+
edge: {
|
|
24
|
+
bottom: {
|
|
25
|
+
viewport: "items-end justify-center",
|
|
26
|
+
popup: "w-full max-h-[85vh]"
|
|
27
|
+
},
|
|
28
|
+
top: {
|
|
29
|
+
viewport: "items-start justify-center",
|
|
30
|
+
popup: "w-full max-h-[85vh]"
|
|
31
|
+
},
|
|
32
|
+
right: {
|
|
33
|
+
viewport: "items-stretch justify-end",
|
|
34
|
+
popup: "h-full w-3/4 max-w-sm"
|
|
35
|
+
},
|
|
36
|
+
left: {
|
|
37
|
+
viewport: "items-stretch justify-start",
|
|
38
|
+
popup: "h-full w-3/4 max-w-sm"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
floating: {
|
|
42
|
+
bottom: {
|
|
43
|
+
viewport: "items-end justify-center pb-[var(--_drawer-float-gap)] [--_drawer-float-gap:max(--spacing(2),env(safe-area-inset-bottom))]",
|
|
44
|
+
popup: "w-full max-h-[85vh]"
|
|
45
|
+
},
|
|
46
|
+
top: {
|
|
47
|
+
viewport: "items-start justify-center pt-[var(--_drawer-float-gap)] [--_drawer-float-gap:max(--spacing(2),env(safe-area-inset-top))]",
|
|
48
|
+
popup: "w-full max-h-[85vh]"
|
|
49
|
+
},
|
|
50
|
+
right: {
|
|
51
|
+
viewport: "items-stretch justify-end pr-[var(--_drawer-float-gap)] [--_drawer-float-gap:max(--spacing(2),env(safe-area-inset-right))]",
|
|
52
|
+
popup: "w-3/4 max-w-sm"
|
|
53
|
+
},
|
|
54
|
+
left: {
|
|
55
|
+
viewport: "items-stretch justify-start pl-[var(--_drawer-float-gap)] [--_drawer-float-gap:max(--spacing(2),env(safe-area-inset-left))]",
|
|
56
|
+
popup: "w-3/4 max-w-sm"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
function Drawer(props) {
|
|
61
|
+
const { side = "bottom", swipeDirection, ...rest } = props;
|
|
62
|
+
return /* @__PURE__ */ jsx(Drawer$1.Root, {
|
|
63
|
+
swipeDirection: swipeDirection ?? swipeFor[side],
|
|
64
|
+
...rest
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function DrawerTrigger({ className, ...props }) {
|
|
68
|
+
return /* @__PURE__ */ jsx(Drawer$1.Trigger, {
|
|
69
|
+
"data-control-ui": "drawer",
|
|
70
|
+
"data-popup-kind": "drawer",
|
|
71
|
+
"data-slot": "trigger",
|
|
72
|
+
className,
|
|
73
|
+
...props
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function DrawerClose({ className, ...props }) {
|
|
77
|
+
return /* @__PURE__ */ jsx(Drawer$1.Close, {
|
|
78
|
+
"data-control-ui": "drawer",
|
|
79
|
+
"data-control-family": "popup",
|
|
80
|
+
"data-popup-kind": "drawer",
|
|
81
|
+
"data-slot": "close",
|
|
82
|
+
className,
|
|
83
|
+
...props
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function DrawerContent({ className, children, side = "bottom", padding = "default", surface = "background", variant = "edge", style, ...props }) {
|
|
87
|
+
const place = placement[variant][side];
|
|
88
|
+
const grabbable = side === "bottom" || side === "top";
|
|
89
|
+
const backdropStyle = style ? { "--cui-popup-backdrop-background": style["--cui-popup-backdrop-background"] } : void 0;
|
|
90
|
+
return /* @__PURE__ */ jsxs(Drawer$1.Portal, { children: [/* @__PURE__ */ jsx(Drawer$1.Backdrop, {
|
|
91
|
+
"data-control-ui": "drawer",
|
|
92
|
+
"data-control-family": "popup",
|
|
93
|
+
"data-popup-kind": "drawer",
|
|
94
|
+
"data-popup-part": "backdrop",
|
|
95
|
+
"data-slot": "backdrop",
|
|
96
|
+
"data-skin": skinId(),
|
|
97
|
+
"data-effects": skinEffects(),
|
|
98
|
+
className: "fixed inset-0 z-[70]",
|
|
99
|
+
style: backdropStyle
|
|
100
|
+
}), /* @__PURE__ */ jsx(Drawer$1.Viewport, {
|
|
101
|
+
"data-control-ui": "drawer",
|
|
102
|
+
"data-control-family": "popup",
|
|
103
|
+
"data-popup-kind": "drawer",
|
|
104
|
+
"data-slot": "viewport",
|
|
105
|
+
"data-side": side,
|
|
106
|
+
"data-variant": variant,
|
|
107
|
+
"data-skin": skinId(),
|
|
108
|
+
"data-effects": skinEffects(),
|
|
109
|
+
className: cn("fixed inset-0 z-[71] flex", place.viewport),
|
|
110
|
+
children: /* @__PURE__ */ jsxs(Drawer$1.Popup, {
|
|
111
|
+
"data-control-ui": "drawer",
|
|
112
|
+
"data-control-family": "popup",
|
|
113
|
+
"data-popup-kind": "drawer",
|
|
114
|
+
"data-popup-part": "surface",
|
|
115
|
+
"data-slot": "content",
|
|
116
|
+
"data-side": side,
|
|
117
|
+
"data-surface": "modal",
|
|
118
|
+
"data-padding": padding,
|
|
119
|
+
"data-surface-variant": surface,
|
|
120
|
+
"data-variant": variant,
|
|
121
|
+
className: cn("flex flex-col", place.popup, className),
|
|
122
|
+
style,
|
|
123
|
+
...props,
|
|
124
|
+
children: [grabbable ? /* @__PURE__ */ jsx("div", {
|
|
125
|
+
"data-control-ui": "drawer",
|
|
126
|
+
"data-control-family": "popup",
|
|
127
|
+
"data-popup-kind": "drawer",
|
|
128
|
+
"data-slot": "handle",
|
|
129
|
+
className: "shrink-0"
|
|
130
|
+
}) : null, /* @__PURE__ */ jsx(Drawer$1.Content, {
|
|
131
|
+
"data-control-ui": "drawer",
|
|
132
|
+
"data-control-family": "popup",
|
|
133
|
+
"data-popup-kind": "drawer",
|
|
134
|
+
"data-slot": "scroll",
|
|
135
|
+
className: "flex min-h-0 flex-1 flex-col overflow-y-auto",
|
|
136
|
+
children
|
|
137
|
+
})]
|
|
138
|
+
})
|
|
139
|
+
})] });
|
|
140
|
+
}
|
|
141
|
+
function DrawerHeader({ className, ...props }) {
|
|
142
|
+
return /* @__PURE__ */ jsx("div", {
|
|
143
|
+
"data-control-ui": "drawer",
|
|
144
|
+
"data-control-family": "popup",
|
|
145
|
+
"data-popup-kind": "drawer",
|
|
146
|
+
"data-slot": "header",
|
|
147
|
+
className: cn("flex flex-col", className),
|
|
148
|
+
...props
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
function DrawerFooter({ className, ...props }) {
|
|
152
|
+
return /* @__PURE__ */ jsx("div", {
|
|
153
|
+
"data-control-ui": "drawer",
|
|
154
|
+
"data-control-family": "popup",
|
|
155
|
+
"data-popup-kind": "drawer",
|
|
156
|
+
"data-slot": "footer",
|
|
157
|
+
className: cn("mt-auto flex flex-col", className),
|
|
158
|
+
...props
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
function DrawerTitle({ className, ...props }) {
|
|
162
|
+
return /* @__PURE__ */ jsx(Drawer$1.Title, {
|
|
163
|
+
"data-control-ui": "drawer",
|
|
164
|
+
"data-control-family": "popup",
|
|
165
|
+
"data-popup-kind": "drawer",
|
|
166
|
+
"data-slot": "title",
|
|
167
|
+
className,
|
|
168
|
+
...props
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
function DrawerDescription({ className, ...props }) {
|
|
172
|
+
return /* @__PURE__ */ jsx(Drawer$1.Description, {
|
|
173
|
+
"data-control-ui": "drawer",
|
|
174
|
+
"data-control-family": "popup",
|
|
175
|
+
"data-popup-kind": "drawer",
|
|
176
|
+
"data-slot": "description",
|
|
177
|
+
className,
|
|
178
|
+
...props
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
//#endregion
|
|
182
|
+
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, drawerContentPaddings, drawerContentSurfaces, drawerContentVariants, drawerSides };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { OpenChangeEventDetails } from "../control-props.js";
|
|
2
|
+
import { ControlSize } from "../control-variants.js";
|
|
3
|
+
import { ButtonKnobStyle } from "../knob-contracts/button-knobs.js";
|
|
4
|
+
import { PopupKnobStyle } from "../knob-contracts/popup-knobs.js";
|
|
5
|
+
import { CSSProperties, ComponentProps, MouseEvent, ReactNode } from "react";
|
|
6
|
+
import { Menu } from "@base-ui/react/menu";
|
|
7
|
+
//#region src/ui/dropdown-menu.d.ts
|
|
8
|
+
type DropdownMenuProps = {
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
open?: boolean;
|
|
11
|
+
defaultOpen?: boolean;
|
|
12
|
+
onOpenChange?: (open: boolean, eventDetails: OpenChangeEventDetails) => void;
|
|
13
|
+
};
|
|
14
|
+
declare const dropdownMenuTriggerVariants: readonly ["surface", "ghost"];
|
|
15
|
+
type DropdownMenuTriggerVariant = (typeof dropdownMenuTriggerVariants)[number];
|
|
16
|
+
type DropdownMenuTriggerProps = Omit<ComponentProps<"button">, "style"> & {
|
|
17
|
+
style?: CSSProperties & ButtonKnobStyle;
|
|
18
|
+
} & {
|
|
19
|
+
size?: ControlSize;
|
|
20
|
+
iconOnly?: boolean;
|
|
21
|
+
variant?: DropdownMenuTriggerVariant;
|
|
22
|
+
};
|
|
23
|
+
type DropdownMenuContentProps = Omit<ComponentProps<"div">, "style"> & {
|
|
24
|
+
style?: CSSProperties & PopupKnobStyle;
|
|
25
|
+
};
|
|
26
|
+
type DropdownMenuItemProps = Omit<Omit<ComponentProps<"div">, "onClick">, "style"> & {
|
|
27
|
+
style?: CSSProperties & PopupKnobStyle;
|
|
28
|
+
} & {
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
onClick?: (event: MouseEvent) => void;
|
|
31
|
+
};
|
|
32
|
+
type DropdownMenuSeparatorProps = Omit<ComponentProps<"div">, "style"> & {
|
|
33
|
+
style?: CSSProperties & PopupKnobStyle;
|
|
34
|
+
};
|
|
35
|
+
type DropdownMenuLabelProps = Omit<ComponentProps<"div">, "style"> & {
|
|
36
|
+
style?: CSSProperties & PopupKnobStyle;
|
|
37
|
+
};
|
|
38
|
+
type RefinedDropdownMenuTriggerProps = DropdownMenuTriggerProps & Pick<ComponentProps<typeof Menu.Trigger>, "nativeButton" | "render">;
|
|
39
|
+
declare function DropdownMenu({ children, ...props }: DropdownMenuProps): import("react").JSX.Element;
|
|
40
|
+
declare function DropdownMenuTrigger({ size, iconOnly, variant, className, children, disabled, ...props }: RefinedDropdownMenuTriggerProps): import("react").JSX.Element;
|
|
41
|
+
declare function DropdownMenuContent({ className, children, ...props }: DropdownMenuContentProps): import("react").JSX.Element;
|
|
42
|
+
declare function DropdownMenuItem({ className, ...props }: DropdownMenuItemProps): import("react").JSX.Element;
|
|
43
|
+
declare function DropdownMenuSeparator({ className, ...props }: DropdownMenuSeparatorProps): import("react").JSX.Element;
|
|
44
|
+
declare function DropdownMenuLabel({ className, ...props }: DropdownMenuLabelProps): import("react").JSX.Element;
|
|
45
|
+
//#endregion
|
|
46
|
+
export { DropdownMenu, DropdownMenuContent, DropdownMenuContentProps, DropdownMenuItem, DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuLabelProps, DropdownMenuProps, DropdownMenuSeparator, DropdownMenuSeparatorProps, DropdownMenuTrigger, DropdownMenuTriggerProps, DropdownMenuTriggerVariant, dropdownMenuTriggerVariants };
|