@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,6 @@
|
|
|
1
|
+
//#region src/surface-variants.d.ts
|
|
2
|
+
declare const popupItemStructureClasses = "flex select-none items-center";
|
|
3
|
+
declare const popupParts: readonly ["backdrop", "surface", "list-surface", "list-content", "bar", "item", "navigation-link", "label", "separator", "shortcut"];
|
|
4
|
+
type PopupPart = (typeof popupParts)[number];
|
|
5
|
+
//#endregion
|
|
6
|
+
export { PopupPart, popupItemStructureClasses, popupParts };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/surface-variants.ts
|
|
2
|
+
const popupItemStructureClasses = "flex select-none items-center";
|
|
3
|
+
const popupParts = [
|
|
4
|
+
"backdrop",
|
|
5
|
+
"surface",
|
|
6
|
+
"list-surface",
|
|
7
|
+
"list-content",
|
|
8
|
+
"bar",
|
|
9
|
+
"item",
|
|
10
|
+
"navigation-link",
|
|
11
|
+
"label",
|
|
12
|
+
"separator",
|
|
13
|
+
"shortcut"
|
|
14
|
+
];
|
|
15
|
+
//#endregion
|
|
16
|
+
export { popupItemStructureClasses, popupParts };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CollapsibleProps } from "./ui/collapsible.js";
|
|
2
|
+
import { TaskListKnobStyle } from "./knob-contracts/task-list-knobs.js";
|
|
3
|
+
import { CSSProperties, ComponentProps, ReactNode } from "react";
|
|
4
|
+
//#region src/task-list.d.ts
|
|
5
|
+
type TaskStatus = "pending" | "active" | "completed";
|
|
6
|
+
type TaskListProps = Omit<CollapsibleProps, "style"> & {
|
|
7
|
+
style?: CSSProperties & TaskListKnobStyle;
|
|
8
|
+
};
|
|
9
|
+
type TaskListStyleProps<Props, Style> = Omit<Props, "style"> & {
|
|
10
|
+
style?: CSSProperties & Style;
|
|
11
|
+
};
|
|
12
|
+
declare function TaskList({ className, children, ...props }: TaskListProps): import("react").JSX.Element;
|
|
13
|
+
type TaskListTriggerProps = TaskListStyleProps<ComponentProps<"button">, TaskListKnobStyle>;
|
|
14
|
+
declare function TaskListTrigger({ className, children, ...props }: TaskListTriggerProps): import("react").JSX.Element;
|
|
15
|
+
type TaskListProgressProps = TaskListStyleProps<ComponentProps<"span">, TaskListKnobStyle>;
|
|
16
|
+
declare function TaskListProgress({ className, children, ...props }: TaskListProgressProps): import("react").JSX.Element;
|
|
17
|
+
type TaskListLabelProps = TaskListStyleProps<ComponentProps<"span">, TaskListKnobStyle>;
|
|
18
|
+
declare function TaskListLabel({ className, children, ...props }: TaskListLabelProps): import("react").JSX.Element;
|
|
19
|
+
type TaskListContentProps = ComponentProps<"ol"> & {
|
|
20
|
+
style?: CSSProperties & TaskListKnobStyle;
|
|
21
|
+
};
|
|
22
|
+
declare function TaskListContent({ className, children, ...props }: TaskListContentProps): import("react").JSX.Element;
|
|
23
|
+
type TaskListItemProps = TaskListStyleProps<Omit<ComponentProps<"li">, "children">, TaskListKnobStyle> & {
|
|
24
|
+
label: string;
|
|
25
|
+
status?: TaskStatus;
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
};
|
|
28
|
+
declare function TaskListItem({ label, status, className, children, ...props }: TaskListItemProps): import("react").JSX.Element;
|
|
29
|
+
type TaskListIndicatorProps = TaskListStyleProps<ComponentProps<"span">, TaskListKnobStyle> & {
|
|
30
|
+
status?: TaskStatus;
|
|
31
|
+
};
|
|
32
|
+
declare function TaskListIndicator({ status, className, ...props }: TaskListIndicatorProps): import("react").JSX.Element;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { TaskList, TaskListContent, TaskListContentProps, TaskListIndicator, TaskListIndicatorProps, TaskListItem, TaskListItemProps, TaskListLabel, TaskListLabelProps, TaskListProgress, TaskListProgressProps, TaskListProps, TaskListTrigger, TaskListTriggerProps, TaskStatus };
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "./lib/cn.js";
|
|
3
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./ui/collapsible.js";
|
|
4
|
+
import { createContext, useContext, useEffect, useId, useState } from "react";
|
|
5
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { ChevronRight, CircleCheck, CircleDashed, Loader2 } from "lucide-react";
|
|
7
|
+
//#region src/task-list.tsx
|
|
8
|
+
const TaskListContext = createContext(null);
|
|
9
|
+
const TaskListRegistrationContext = createContext(null);
|
|
10
|
+
function useTaskListContext() {
|
|
11
|
+
const context = useContext(TaskListContext);
|
|
12
|
+
if (!context) throw new Error("TaskList compound components must be rendered inside <TaskList>.");
|
|
13
|
+
return context;
|
|
14
|
+
}
|
|
15
|
+
function useTaskListRegistrationContext() {
|
|
16
|
+
const context = useContext(TaskListRegistrationContext);
|
|
17
|
+
if (!context) throw new Error("TaskList items must be rendered inside <TaskList>.");
|
|
18
|
+
return context;
|
|
19
|
+
}
|
|
20
|
+
function upsert(entries, entry) {
|
|
21
|
+
const index = entries.findIndex((existing) => existing.key === entry.key);
|
|
22
|
+
if (index === -1) return [...entries, entry];
|
|
23
|
+
const next = [...entries];
|
|
24
|
+
next[index] = entry;
|
|
25
|
+
return next;
|
|
26
|
+
}
|
|
27
|
+
function currentTaskIndex(tasks) {
|
|
28
|
+
const active = tasks.findIndex((task) => task.status === "active");
|
|
29
|
+
if (active !== -1) return active;
|
|
30
|
+
const pending = tasks.findIndex((task) => task.status === "pending");
|
|
31
|
+
if (pending !== -1) return pending;
|
|
32
|
+
return tasks.length - 1;
|
|
33
|
+
}
|
|
34
|
+
function TaskList({ className, children, ...props }) {
|
|
35
|
+
const [tasks, setTasks] = useState([]);
|
|
36
|
+
const [registration] = useState(() => ({
|
|
37
|
+
registerTask(entry) {
|
|
38
|
+
setTasks((previous) => upsert(previous, entry));
|
|
39
|
+
},
|
|
40
|
+
unregisterTask(key) {
|
|
41
|
+
setTasks((previous) => previous.filter((task) => task.key !== key));
|
|
42
|
+
}
|
|
43
|
+
}));
|
|
44
|
+
const total = tasks.length;
|
|
45
|
+
const currentIndex = currentTaskIndex(tasks);
|
|
46
|
+
const current = tasks[currentIndex];
|
|
47
|
+
const allCompleted = total > 0 && tasks.every((task) => task.status === "completed");
|
|
48
|
+
return /* @__PURE__ */ jsx(TaskListRegistrationContext.Provider, {
|
|
49
|
+
value: registration,
|
|
50
|
+
children: /* @__PURE__ */ jsx(TaskListContext.Provider, {
|
|
51
|
+
value: {
|
|
52
|
+
total,
|
|
53
|
+
current,
|
|
54
|
+
currentNumber: total === 0 ? 0 : currentIndex + 1,
|
|
55
|
+
allCompleted
|
|
56
|
+
},
|
|
57
|
+
children: /* @__PURE__ */ jsx(Collapsible, {
|
|
58
|
+
"data-control-ui": "task-list",
|
|
59
|
+
"data-control-family": "task-list",
|
|
60
|
+
"data-slot": "root",
|
|
61
|
+
"data-surface": "panel",
|
|
62
|
+
className: cn("w-full overflow-hidden", className),
|
|
63
|
+
...props,
|
|
64
|
+
children
|
|
65
|
+
})
|
|
66
|
+
})
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function TaskListTrigger({ className, children, ...props }) {
|
|
70
|
+
const { allCompleted } = useTaskListContext();
|
|
71
|
+
return /* @__PURE__ */ jsx(CollapsibleTrigger, {
|
|
72
|
+
"data-control-ui": "task-list",
|
|
73
|
+
"data-control-family": "task-list",
|
|
74
|
+
"data-slot": "trigger",
|
|
75
|
+
className: cn("flex w-full items-center", className),
|
|
76
|
+
...props,
|
|
77
|
+
children: children ?? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
78
|
+
/* @__PURE__ */ jsx(TaskListIndicator, { status: allCompleted ? "completed" : "active" }),
|
|
79
|
+
/* @__PURE__ */ jsx(TaskListProgress, {}),
|
|
80
|
+
/* @__PURE__ */ jsx(ChevronRight, {
|
|
81
|
+
"aria-hidden": "true",
|
|
82
|
+
"data-control-ui": "task-list",
|
|
83
|
+
"data-control-family": "task-list",
|
|
84
|
+
"data-slot": "chevron",
|
|
85
|
+
className: "shrink-0"
|
|
86
|
+
}),
|
|
87
|
+
/* @__PURE__ */ jsx(TaskListLabel, { className: "in-data-[state=open]:hidden" })
|
|
88
|
+
] })
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function TaskListProgress({ className, children, ...props }) {
|
|
92
|
+
const { currentNumber, total } = useTaskListContext();
|
|
93
|
+
return /* @__PURE__ */ jsx("span", {
|
|
94
|
+
"data-control-ui": "task-list",
|
|
95
|
+
"data-control-family": "task-list",
|
|
96
|
+
"data-slot": "progress",
|
|
97
|
+
className: cn("shrink-0", className),
|
|
98
|
+
...props,
|
|
99
|
+
children: children ?? `Task ${currentNumber} of ${total}`
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
function TaskListLabel({ className, children, ...props }) {
|
|
103
|
+
const { current } = useTaskListContext();
|
|
104
|
+
return /* @__PURE__ */ jsx("span", {
|
|
105
|
+
"data-control-ui": "task-list",
|
|
106
|
+
"data-control-family": "task-list",
|
|
107
|
+
"data-slot": "label",
|
|
108
|
+
className: cn("min-w-0 flex-1 truncate", className),
|
|
109
|
+
...props,
|
|
110
|
+
children: children ?? current?.label
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
function TaskListContent({ className, children, ...props }) {
|
|
114
|
+
return /* @__PURE__ */ jsx(CollapsibleContent, {
|
|
115
|
+
keepMounted: true,
|
|
116
|
+
children: /* @__PURE__ */ jsx("ol", {
|
|
117
|
+
"data-control-ui": "task-list",
|
|
118
|
+
"data-control-family": "task-list",
|
|
119
|
+
"data-slot": "items",
|
|
120
|
+
className: cn("flex flex-col", className),
|
|
121
|
+
...props,
|
|
122
|
+
children
|
|
123
|
+
})
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function TaskListItem({ label, status = "pending", className, children, ...props }) {
|
|
127
|
+
const { registerTask, unregisterTask } = useTaskListRegistrationContext();
|
|
128
|
+
const key = useId();
|
|
129
|
+
useEffect(() => registerTask({
|
|
130
|
+
key,
|
|
131
|
+
status,
|
|
132
|
+
label
|
|
133
|
+
}), [
|
|
134
|
+
registerTask,
|
|
135
|
+
key,
|
|
136
|
+
status,
|
|
137
|
+
label
|
|
138
|
+
]);
|
|
139
|
+
useEffect(() => () => unregisterTask(key), [unregisterTask, key]);
|
|
140
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
141
|
+
"data-control-ui": "task-list",
|
|
142
|
+
"data-control-family": "task-list",
|
|
143
|
+
"data-slot": "item",
|
|
144
|
+
"data-status": status,
|
|
145
|
+
className: cn("flex items-center", className),
|
|
146
|
+
...props,
|
|
147
|
+
children: [/* @__PURE__ */ jsx(TaskListIndicator, { status }), /* @__PURE__ */ jsx("span", {
|
|
148
|
+
className: "min-w-0 flex-1 truncate",
|
|
149
|
+
children: children ?? label
|
|
150
|
+
})]
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
const indicatorIcons = {
|
|
154
|
+
pending: CircleDashed,
|
|
155
|
+
active: Loader2,
|
|
156
|
+
completed: CircleCheck
|
|
157
|
+
};
|
|
158
|
+
function TaskListIndicator({ status = "pending", className, ...props }) {
|
|
159
|
+
const Icon = indicatorIcons[status];
|
|
160
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
161
|
+
"data-control-ui": "task-list",
|
|
162
|
+
"data-control-family": "task-list",
|
|
163
|
+
"data-slot": "item-indicator",
|
|
164
|
+
"data-status": status,
|
|
165
|
+
className: cn("inline-flex shrink-0 items-center justify-center", className),
|
|
166
|
+
...props,
|
|
167
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
168
|
+
"aria-hidden": "true",
|
|
169
|
+
className: "size-3.5"
|
|
170
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
171
|
+
className: "sr-only",
|
|
172
|
+
children: status
|
|
173
|
+
})]
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
//#endregion
|
|
177
|
+
export { TaskList, TaskListContent, TaskListIndicator, TaskListItem, TaskListLabel, TaskListProgress, TaskListTrigger };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ChatRole } from "./hooks/use-chat-message.js";
|
|
2
|
+
import { ThreadRailKnobStyle } from "./knob-contracts/thread-rail-knobs.js";
|
|
3
|
+
import { CSSProperties, ComponentProps, ReactNode } from "react";
|
|
4
|
+
//#region src/thread-rail.d.ts
|
|
5
|
+
type ThreadRailProps = ComponentProps<"nav"> & {
|
|
6
|
+
style?: CSSProperties & ThreadRailKnobStyle;
|
|
7
|
+
};
|
|
8
|
+
type ThreadRailItemProps = Omit<ComponentProps<"div">, "style"> & {
|
|
9
|
+
from?: ChatRole;
|
|
10
|
+
inView?: boolean;
|
|
11
|
+
active?: boolean;
|
|
12
|
+
style?: CSSProperties & ThreadRailKnobStyle;
|
|
13
|
+
};
|
|
14
|
+
declare function ThreadRail({ className, children, style, ...props }: ThreadRailProps): import("react").JSX.Element;
|
|
15
|
+
declare function ThreadRailItem({ from, inView, active, index, className, children, ...props }: ThreadRailItemProps & {
|
|
16
|
+
index?: number;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
type ThreadRailLineProps = Omit<ComponentProps<"button">, "style"> & {
|
|
19
|
+
style?: CSSProperties & ThreadRailKnobStyle;
|
|
20
|
+
};
|
|
21
|
+
declare function ThreadRailLine({ className, ...props }: ThreadRailLineProps): import("react").JSX.Element;
|
|
22
|
+
type ThreadRailPopoverProps = Omit<ComponentProps<"div">, "style"> & {
|
|
23
|
+
children?: ReactNode;
|
|
24
|
+
style?: CSSProperties & ThreadRailKnobStyle;
|
|
25
|
+
};
|
|
26
|
+
declare function ThreadRailPopover(_props: ThreadRailPopoverProps): null;
|
|
27
|
+
type ThreadRailTitleProps = Omit<ComponentProps<"div">, "style"> & {
|
|
28
|
+
style?: CSSProperties & ThreadRailKnobStyle;
|
|
29
|
+
};
|
|
30
|
+
declare function ThreadRailTitle({ className, ...props }: ThreadRailTitleProps): import("react").JSX.Element;
|
|
31
|
+
type ThreadRailSummaryProps = Omit<ComponentProps<"p">, "style"> & {
|
|
32
|
+
style?: CSSProperties & ThreadRailKnobStyle;
|
|
33
|
+
};
|
|
34
|
+
declare function ThreadRailSummary({ className, ...props }: ThreadRailSummaryProps): import("react").JSX.Element;
|
|
35
|
+
type ThreadRailFooterProps = Omit<ComponentProps<"div">, "style"> & {
|
|
36
|
+
style?: CSSProperties & ThreadRailKnobStyle;
|
|
37
|
+
};
|
|
38
|
+
declare function ThreadRailFooter({ className, ...props }: ThreadRailFooterProps): import("react").JSX.Element;
|
|
39
|
+
type ThreadRailFileProps = Omit<ComponentProps<"span">, "style"> & {
|
|
40
|
+
style?: CSSProperties & ThreadRailKnobStyle;
|
|
41
|
+
};
|
|
42
|
+
declare function ThreadRailFile({ className, ...props }: ThreadRailFileProps): import("react").JSX.Element;
|
|
43
|
+
type ThreadRailFileIconProps = Omit<ComponentProps<"span">, "style"> & {
|
|
44
|
+
style?: CSSProperties & ThreadRailKnobStyle;
|
|
45
|
+
};
|
|
46
|
+
declare function ThreadRailFileIcon({ className, children, ...props }: ThreadRailFileIconProps): import("react").JSX.Element;
|
|
47
|
+
type ThreadRailMoreProps = Omit<ComponentProps<"span">, "style"> & {
|
|
48
|
+
style?: CSSProperties & ThreadRailKnobStyle;
|
|
49
|
+
};
|
|
50
|
+
declare function ThreadRailMore({ className, ...props }: ThreadRailMoreProps): import("react").JSX.Element;
|
|
51
|
+
//#endregion
|
|
52
|
+
export { ThreadRail, ThreadRailFile, ThreadRailFileIcon, ThreadRailFileIconProps, ThreadRailFileProps, ThreadRailFooter, ThreadRailFooterProps, ThreadRailItem, ThreadRailItemProps, ThreadRailLine, ThreadRailLineProps, ThreadRailMore, ThreadRailMoreProps, ThreadRailPopover, ThreadRailPopoverProps, ThreadRailProps, ThreadRailSummary, ThreadRailSummaryProps, ThreadRailTitle, ThreadRailTitleProps };
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "./lib/cn.js";
|
|
3
|
+
import { Children, cloneElement, createContext, isValidElement, useContext, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/thread-rail.tsx
|
|
6
|
+
const useIsomorphicLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
|
|
7
|
+
const RailContext = createContext(null);
|
|
8
|
+
function useRail() {
|
|
9
|
+
const context = useContext(RailContext);
|
|
10
|
+
if (!context) throw new Error("ThreadRailItem must be rendered inside <ThreadRail>.");
|
|
11
|
+
return context;
|
|
12
|
+
}
|
|
13
|
+
const ItemContext = createContext(null);
|
|
14
|
+
function useItem() {
|
|
15
|
+
const context = useContext(ItemContext);
|
|
16
|
+
if (!context) throw new Error("ThreadRail compound parts must be rendered inside <ThreadRailItem>.");
|
|
17
|
+
return context;
|
|
18
|
+
}
|
|
19
|
+
function ThreadRail({ className, children, style, ...props }) {
|
|
20
|
+
const [hovered, setHovered] = useState(0);
|
|
21
|
+
const cardRef = useRef(null);
|
|
22
|
+
const activeLayerRef = useRef(null);
|
|
23
|
+
const [cardHeight, setCardHeight] = useState();
|
|
24
|
+
const items = Children.toArray(children).filter((child) => isValidElement(child));
|
|
25
|
+
const popovers = items.map((item) => {
|
|
26
|
+
const popover = Children.toArray(item.props.children).find((child) => isValidElement(child) && child.type === ThreadRailPopover);
|
|
27
|
+
return isValidElement(popover) ? popover.props : void 0;
|
|
28
|
+
});
|
|
29
|
+
const activePopover = popovers[hovered];
|
|
30
|
+
useIsomorphicLayoutEffect(() => {
|
|
31
|
+
const card = cardRef.current;
|
|
32
|
+
const activeLayer = activeLayerRef.current;
|
|
33
|
+
if (!card || !activeLayer) return;
|
|
34
|
+
setCardHeight(activeLayer.offsetHeight + card.offsetHeight - card.clientHeight);
|
|
35
|
+
}, [hovered]);
|
|
36
|
+
const railStyle = {
|
|
37
|
+
...style,
|
|
38
|
+
"--aui-rail-active-index": hovered
|
|
39
|
+
};
|
|
40
|
+
return /* @__PURE__ */ jsx(RailContext.Provider, {
|
|
41
|
+
value: {
|
|
42
|
+
current: hovered,
|
|
43
|
+
activate: setHovered
|
|
44
|
+
},
|
|
45
|
+
children: /* @__PURE__ */ jsxs("nav", {
|
|
46
|
+
"data-control-ui": "thread-rail",
|
|
47
|
+
"data-control-family": "thread-rail",
|
|
48
|
+
"data-slot": "root",
|
|
49
|
+
"aria-label": "Conversation timeline",
|
|
50
|
+
style: railStyle,
|
|
51
|
+
className: cn("flex flex-col", className),
|
|
52
|
+
...props,
|
|
53
|
+
children: [items.map((item, index) => cloneElement(item, { index })), /* @__PURE__ */ jsx("div", {
|
|
54
|
+
ref: cardRef,
|
|
55
|
+
"data-control-ui": "thread-rail",
|
|
56
|
+
"data-control-family": "thread-rail",
|
|
57
|
+
"data-slot": "popover",
|
|
58
|
+
"data-surface": "floating",
|
|
59
|
+
style: {
|
|
60
|
+
...activePopover?.style,
|
|
61
|
+
height: cardHeight
|
|
62
|
+
},
|
|
63
|
+
className: cn("pointer-events-none z-20 w-72 overflow-hidden", activePopover?.className),
|
|
64
|
+
children: items.map((item, index) => /* @__PURE__ */ jsx("div", {
|
|
65
|
+
"data-control-ui": "thread-rail",
|
|
66
|
+
"data-control-family": "thread-rail",
|
|
67
|
+
"data-slot": "popover-layer",
|
|
68
|
+
ref: index === hovered ? activeLayerRef : void 0,
|
|
69
|
+
"data-active": index === hovered ? "true" : void 0,
|
|
70
|
+
className: "",
|
|
71
|
+
children: popovers[index]?.children ?? null
|
|
72
|
+
}, item.key ?? index))
|
|
73
|
+
})]
|
|
74
|
+
})
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function ThreadRailItem({ from = "user", inView = false, active = false, index = -1, className, children, ...props }) {
|
|
78
|
+
const rail = useRail();
|
|
79
|
+
const isInView = inView || active;
|
|
80
|
+
return /* @__PURE__ */ jsx(ItemContext.Provider, {
|
|
81
|
+
value: {
|
|
82
|
+
index,
|
|
83
|
+
inView: isInView,
|
|
84
|
+
activate: rail.activate
|
|
85
|
+
},
|
|
86
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
87
|
+
"data-control-ui": "thread-rail",
|
|
88
|
+
"data-control-family": "thread-rail",
|
|
89
|
+
"data-slot": "item",
|
|
90
|
+
"data-from": from,
|
|
91
|
+
"data-in-view": isInView ? "true" : void 0,
|
|
92
|
+
"data-active": isInView ? "true" : void 0,
|
|
93
|
+
"data-rail-current": index === rail.current ? "true" : void 0,
|
|
94
|
+
className: cn("relative flex items-center", className),
|
|
95
|
+
...props,
|
|
96
|
+
children
|
|
97
|
+
})
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function ThreadRailLine({ className, ...props }) {
|
|
101
|
+
const { index, inView, activate } = useItem();
|
|
102
|
+
return /* @__PURE__ */ jsx("button", {
|
|
103
|
+
"data-control-ui": "thread-rail",
|
|
104
|
+
"data-control-family": "thread-rail",
|
|
105
|
+
"data-slot": "line",
|
|
106
|
+
type: "button",
|
|
107
|
+
"aria-current": inView ? "location" : void 0,
|
|
108
|
+
onMouseEnter: () => activate(index),
|
|
109
|
+
onFocus: () => activate(index),
|
|
110
|
+
className: cn("relative block cursor-pointer before:absolute before:-inset-y-1 before:inset-x-0 before:content-['']", className),
|
|
111
|
+
...props
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function ThreadRailPopover(_props) {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
function ThreadRailTitle({ className, ...props }) {
|
|
118
|
+
return /* @__PURE__ */ jsx("div", {
|
|
119
|
+
"data-control-ui": "thread-rail",
|
|
120
|
+
"data-control-family": "thread-rail",
|
|
121
|
+
"data-slot": "title",
|
|
122
|
+
className: cn("truncate", className),
|
|
123
|
+
...props
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function ThreadRailSummary({ className, ...props }) {
|
|
127
|
+
return /* @__PURE__ */ jsx("p", {
|
|
128
|
+
"data-control-ui": "thread-rail",
|
|
129
|
+
"data-control-family": "thread-rail",
|
|
130
|
+
"data-slot": "summary",
|
|
131
|
+
className: cn("line-clamp-3", className),
|
|
132
|
+
...props
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
function ThreadRailFooter({ className, ...props }) {
|
|
136
|
+
return /* @__PURE__ */ jsx("div", {
|
|
137
|
+
"data-control-ui": "thread-rail",
|
|
138
|
+
"data-control-family": "thread-rail",
|
|
139
|
+
"data-slot": "footer",
|
|
140
|
+
className: cn("flex flex-wrap items-center", className),
|
|
141
|
+
...props
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
function ThreadRailFile({ className, ...props }) {
|
|
145
|
+
return /* @__PURE__ */ jsx("span", {
|
|
146
|
+
"data-control-ui": "thread-rail",
|
|
147
|
+
"data-control-family": "thread-rail",
|
|
148
|
+
"data-slot": "file",
|
|
149
|
+
className: cn("inline-flex max-w-[180px] items-center truncate", className),
|
|
150
|
+
...props
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
function ThreadRailFileIcon({ className, children, ...props }) {
|
|
154
|
+
return /* @__PURE__ */ jsx("span", {
|
|
155
|
+
"data-control-ui": "thread-rail",
|
|
156
|
+
"data-control-family": "thread-rail",
|
|
157
|
+
"data-slot": "file-icon",
|
|
158
|
+
className: cn("inline-flex shrink-0 items-center justify-center", className),
|
|
159
|
+
"aria-hidden": true,
|
|
160
|
+
...props,
|
|
161
|
+
children: children ?? /* @__PURE__ */ jsxs("svg", {
|
|
162
|
+
viewBox: "0 0 16 16",
|
|
163
|
+
fill: "none",
|
|
164
|
+
className: "size-3",
|
|
165
|
+
role: "presentation",
|
|
166
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
167
|
+
d: "M4 1.5h5L13 5.5V14a.5.5 0 0 1-.5.5h-8A.5.5 0 0 1 4 14V2a.5.5 0 0 1 .5-.5Z",
|
|
168
|
+
stroke: "currentColor",
|
|
169
|
+
strokeWidth: "1.1",
|
|
170
|
+
strokeLinejoin: "round"
|
|
171
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
172
|
+
d: "M9 1.5V5.5h4",
|
|
173
|
+
stroke: "currentColor",
|
|
174
|
+
strokeWidth: "1.1",
|
|
175
|
+
strokeLinejoin: "round"
|
|
176
|
+
})]
|
|
177
|
+
})
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
function ThreadRailMore({ className, ...props }) {
|
|
181
|
+
return /* @__PURE__ */ jsx("span", {
|
|
182
|
+
"data-control-ui": "thread-rail",
|
|
183
|
+
"data-control-family": "thread-rail",
|
|
184
|
+
"data-slot": "more",
|
|
185
|
+
className,
|
|
186
|
+
...props
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
//#endregion
|
|
190
|
+
export { ThreadRail, ThreadRailFile, ThreadRailFileIcon, ThreadRailFooter, ThreadRailItem, ThreadRailLine, ThreadRailMore, ThreadRailPopover, ThreadRailSummary, ThreadRailTitle };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TranscriptDividerKnobStyle } from "./knob-contracts/transcript-divider-knobs.js";
|
|
2
|
+
import { CSSProperties, ComponentProps } from "react";
|
|
3
|
+
//#region src/transcript-divider.d.ts
|
|
4
|
+
type ChatTone = "neutral" | "success" | "warning" | "danger";
|
|
5
|
+
type TranscriptDividerProps = Omit<ComponentProps<"div">, "style"> & {
|
|
6
|
+
tone?: ChatTone;
|
|
7
|
+
style?: CSSProperties & TranscriptDividerKnobStyle;
|
|
8
|
+
};
|
|
9
|
+
declare function TranscriptDivider({ tone, className, children, ...props }: TranscriptDividerProps): import("react").JSX.Element;
|
|
10
|
+
type TranscriptDividerLabelProps = ComponentProps<"span"> & {
|
|
11
|
+
style?: CSSProperties & TranscriptDividerKnobStyle;
|
|
12
|
+
};
|
|
13
|
+
declare function TranscriptDividerLabel({ className, ...props }: TranscriptDividerLabelProps): import("react").JSX.Element;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { ChatTone, TranscriptDivider, TranscriptDividerLabel, TranscriptDividerLabelProps, TranscriptDividerProps };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { cn } from "./lib/cn.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/transcript-divider.tsx
|
|
4
|
+
function TranscriptDivider({ tone = "neutral", className, children, ...props }) {
|
|
5
|
+
return /* @__PURE__ */ jsx("div", {
|
|
6
|
+
"data-control-ui": "transcript-divider",
|
|
7
|
+
"data-control-family": "transcript-divider",
|
|
8
|
+
"data-slot": "root",
|
|
9
|
+
"data-tone": tone,
|
|
10
|
+
className: cn("flex min-w-0 items-center before:flex-1 after:flex-1", className),
|
|
11
|
+
...props,
|
|
12
|
+
children: children != null ? /* @__PURE__ */ jsx(TranscriptDividerLabel, { children }) : null
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function TranscriptDividerLabel({ className, ...props }) {
|
|
16
|
+
return /* @__PURE__ */ jsx("span", {
|
|
17
|
+
"data-control-ui": "transcript-divider",
|
|
18
|
+
"data-control-family": "transcript-divider",
|
|
19
|
+
"data-slot": "label",
|
|
20
|
+
className: cn("min-w-0 truncate", className),
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { TranscriptDivider, TranscriptDividerLabel };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AccordionKnobStyle } from "../knob-contracts/accordion-knobs.js";
|
|
2
|
+
import { CSSProperties, ComponentProps } from "react";
|
|
3
|
+
//#region src/ui/accordion.d.ts
|
|
4
|
+
type AccordionValue = (string | number)[];
|
|
5
|
+
type AccordionProps = Omit<ComponentProps<"div">, "defaultValue" | "onChange"> & {
|
|
6
|
+
value?: AccordionValue;
|
|
7
|
+
defaultValue?: AccordionValue;
|
|
8
|
+
onValueChange?: (value: AccordionValue) => void;
|
|
9
|
+
multiple?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
} & {
|
|
12
|
+
style?: CSSProperties & AccordionKnobStyle;
|
|
13
|
+
};
|
|
14
|
+
type AccordionItemProps = Omit<ComponentProps<"div"> & {
|
|
15
|
+
value?: string | number;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
}, "style"> & {
|
|
18
|
+
style?: CSSProperties & AccordionKnobStyle;
|
|
19
|
+
};
|
|
20
|
+
type AccordionTriggerProps = Omit<ComponentProps<"button">, "style"> & {
|
|
21
|
+
style?: CSSProperties & AccordionKnobStyle;
|
|
22
|
+
};
|
|
23
|
+
type AccordionPanelProps = Omit<ComponentProps<"div">, "style"> & {
|
|
24
|
+
style?: CSSProperties & AccordionKnobStyle;
|
|
25
|
+
};
|
|
26
|
+
declare function Accordion({ className, ...props }: AccordionProps): import("react").JSX.Element;
|
|
27
|
+
declare function AccordionItem({ className, ...props }: AccordionItemProps): import("react").JSX.Element;
|
|
28
|
+
declare function AccordionTrigger({ className, children, ...props }: AccordionTriggerProps): import("react").JSX.Element;
|
|
29
|
+
declare function AccordionPanel({ className, children, ...props }: AccordionPanelProps): import("react").JSX.Element;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { Accordion, AccordionItem, AccordionItemProps, AccordionPanel, AccordionPanelProps, AccordionProps, AccordionTrigger, AccordionTriggerProps, AccordionValue };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { ChevronDown } from "lucide-react";
|
|
5
|
+
import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
|
|
6
|
+
//#region src/ui/accordion.tsx
|
|
7
|
+
function Accordion({ className, ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Accordion$1.Root, {
|
|
9
|
+
"data-control-ui": "accordion",
|
|
10
|
+
"data-control-family": "accordion",
|
|
11
|
+
"data-slot": "root",
|
|
12
|
+
className,
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function AccordionItem({ className, ...props }) {
|
|
17
|
+
return /* @__PURE__ */ jsx(Accordion$1.Item, {
|
|
18
|
+
"data-control-ui": "accordion",
|
|
19
|
+
"data-control-family": "accordion",
|
|
20
|
+
"data-slot": "item",
|
|
21
|
+
className,
|
|
22
|
+
...props
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function AccordionTrigger({ className, children, ...props }) {
|
|
26
|
+
return /* @__PURE__ */ jsx(Accordion$1.Header, {
|
|
27
|
+
className: "flex",
|
|
28
|
+
children: /* @__PURE__ */ jsxs(Accordion$1.Trigger, {
|
|
29
|
+
"data-control-ui": "accordion",
|
|
30
|
+
"data-control-family": "accordion",
|
|
31
|
+
"data-slot": "trigger",
|
|
32
|
+
className: cn("group flex flex-1 cursor-pointer select-none items-center justify-between", className),
|
|
33
|
+
...props,
|
|
34
|
+
children: [children, /* @__PURE__ */ jsx(ChevronDown, {
|
|
35
|
+
"aria-hidden": "true",
|
|
36
|
+
"data-control-ui": "accordion",
|
|
37
|
+
"data-control-family": "accordion",
|
|
38
|
+
"data-slot": "icon",
|
|
39
|
+
className: "shrink-0"
|
|
40
|
+
})]
|
|
41
|
+
})
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function AccordionPanel({ className, children, ...props }) {
|
|
45
|
+
return /* @__PURE__ */ jsx(Accordion$1.Panel, {
|
|
46
|
+
"data-control-ui": "accordion",
|
|
47
|
+
"data-control-family": "accordion",
|
|
48
|
+
"data-slot": "panel",
|
|
49
|
+
...props,
|
|
50
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
51
|
+
"data-control-ui": "accordion",
|
|
52
|
+
"data-control-family": "accordion",
|
|
53
|
+
"data-slot": "panel-content",
|
|
54
|
+
className,
|
|
55
|
+
children
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { Accordion, AccordionItem, AccordionPanel, AccordionTrigger };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { OpenChangeEventDetails } from "../control-props.js";
|
|
2
|
+
import { ButtonProps } from "./button.js";
|
|
3
|
+
import { PopupKnobStyle } from "../knob-contracts/popup-knobs.js";
|
|
4
|
+
import { CSSProperties, ComponentProps, ReactNode } from "react";
|
|
5
|
+
import { AlertDialog as AlertDialog$1 } from "@base-ui/react/alert-dialog";
|
|
6
|
+
//#region src/ui/alert-dialog.d.ts
|
|
7
|
+
type AlertDialogProps = {
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
open?: boolean;
|
|
10
|
+
defaultOpen?: boolean;
|
|
11
|
+
onOpenChange?: (open: boolean, eventDetails: OpenChangeEventDetails) => void;
|
|
12
|
+
};
|
|
13
|
+
type AlertDialogContentProps = Omit<ComponentProps<"div">, "style"> & {
|
|
14
|
+
style?: CSSProperties & PopupKnobStyle;
|
|
15
|
+
};
|
|
16
|
+
declare function AlertDialog(props: AlertDialogProps): import("react").JSX.Element;
|
|
17
|
+
declare function AlertDialogTrigger({ className, ...props }: ComponentProps<typeof AlertDialog$1.Trigger> & {
|
|
18
|
+
style?: CSSProperties & PopupKnobStyle;
|
|
19
|
+
}): import("react").JSX.Element;
|
|
20
|
+
type AlertDialogCloseProps = Omit<ComponentProps<typeof AlertDialog$1.Close>, "render"> & Pick<ButtonProps, "variant" | "size" | "tone" | "iconOnly">;
|
|
21
|
+
declare function AlertDialogClose({ className, children, variant, size, tone, iconOnly, ...props }: AlertDialogCloseProps): import("react").JSX.Element;
|
|
22
|
+
declare function AlertDialogContent({ className, children, ...props }: AlertDialogContentProps): import("react").JSX.Element;
|
|
23
|
+
declare function AlertDialogHeader({ className, ...props }: ComponentProps<"div"> & {
|
|
24
|
+
style?: CSSProperties & PopupKnobStyle;
|
|
25
|
+
}): import("react").JSX.Element;
|
|
26
|
+
declare function AlertDialogFooter({ className, ...props }: ComponentProps<"div"> & {
|
|
27
|
+
style?: CSSProperties & PopupKnobStyle;
|
|
28
|
+
}): import("react").JSX.Element;
|
|
29
|
+
declare function AlertDialogTitle({ className, ...props }: ComponentProps<"h2"> & {
|
|
30
|
+
style?: CSSProperties & PopupKnobStyle;
|
|
31
|
+
}): import("react").JSX.Element;
|
|
32
|
+
declare function AlertDialogDescription({ className, ...props }: ComponentProps<"p"> & {
|
|
33
|
+
style?: CSSProperties & PopupKnobStyle;
|
|
34
|
+
}): import("react").JSX.Element;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { AlertDialog, AlertDialogClose, AlertDialogContent, AlertDialogContentProps, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogProps, AlertDialogTitle, AlertDialogTrigger };
|