@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,278 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { Button } from "./button.js";
|
|
4
|
+
import { createContext, use, useEffect, useEffectEvent, useRef, useState } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { MinusIcon, PlusIcon } from "lucide-react";
|
|
7
|
+
//#region src/ui/infinite-canvas.tsx
|
|
8
|
+
const DEFAULT_TRANSFORM = {
|
|
9
|
+
x: 0,
|
|
10
|
+
y: 0,
|
|
11
|
+
scale: 1
|
|
12
|
+
};
|
|
13
|
+
const DEFAULT_MIN_SCALE = .35;
|
|
14
|
+
const DEFAULT_MAX_SCALE = 2.5;
|
|
15
|
+
const KEYBOARD_PAN_STEP = 32;
|
|
16
|
+
const GRID_SIZE = 24;
|
|
17
|
+
const KEYBOARD_PAN_DIRECTIONS = {
|
|
18
|
+
ArrowLeft: {
|
|
19
|
+
x: -1,
|
|
20
|
+
y: 0
|
|
21
|
+
},
|
|
22
|
+
ArrowRight: {
|
|
23
|
+
x: 1,
|
|
24
|
+
y: 0
|
|
25
|
+
},
|
|
26
|
+
ArrowUp: {
|
|
27
|
+
x: 0,
|
|
28
|
+
y: -1
|
|
29
|
+
},
|
|
30
|
+
ArrowDown: {
|
|
31
|
+
x: 0,
|
|
32
|
+
y: 1
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const InfiniteCanvasContext = createContext(null);
|
|
36
|
+
function clampScale(scale, minScale, maxScale) {
|
|
37
|
+
return Math.min(Math.max(scale, minScale), maxScale);
|
|
38
|
+
}
|
|
39
|
+
function zoomAroundPoint(transform, nextScale, point) {
|
|
40
|
+
const worldX = (point.x - transform.x) / transform.scale;
|
|
41
|
+
const worldY = (point.y - transform.y) / transform.scale;
|
|
42
|
+
return {
|
|
43
|
+
x: point.x - worldX * nextScale,
|
|
44
|
+
y: point.y - worldY * nextScale,
|
|
45
|
+
scale: nextScale
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function panFromWheel(transform, event, viewportHeight) {
|
|
49
|
+
let deltaMultiplier = 1;
|
|
50
|
+
if (event.deltaMode === WheelEvent.DOM_DELTA_LINE) deltaMultiplier = 16;
|
|
51
|
+
else if (event.deltaMode === WheelEvent.DOM_DELTA_PAGE) deltaMultiplier = viewportHeight;
|
|
52
|
+
const horizontalDelta = event.shiftKey && event.deltaX === 0 ? event.deltaY : event.deltaX;
|
|
53
|
+
const verticalDelta = event.shiftKey && event.deltaX === 0 ? 0 : event.deltaY;
|
|
54
|
+
return {
|
|
55
|
+
x: transform.x - horizontalDelta * deltaMultiplier,
|
|
56
|
+
y: transform.y - verticalDelta * deltaMultiplier,
|
|
57
|
+
scale: transform.scale
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function useInfiniteCanvas() {
|
|
61
|
+
const context = use(InfiniteCanvasContext);
|
|
62
|
+
if (!context) throw new Error("useInfiniteCanvas must be used within InfiniteCanvas");
|
|
63
|
+
return context;
|
|
64
|
+
}
|
|
65
|
+
function InfiniteCanvas({ transform: controlledTransform, defaultTransform = DEFAULT_TRANSFORM, onTransformChange, minScale: minScaleProp = DEFAULT_MIN_SCALE, maxScale: maxScaleProp = DEFAULT_MAX_SCALE, className, children, style, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, onWheel, onKeyDown, "aria-label": ariaLabel = "Infinite canvas", ...props }) {
|
|
66
|
+
const minScale = Math.max(.1, minScaleProp);
|
|
67
|
+
const maxScale = Math.max(minScale, maxScaleProp);
|
|
68
|
+
const [uncontrolledTransform, setUncontrolledTransform] = useState(defaultTransform);
|
|
69
|
+
const [panning, setPanning] = useState(false);
|
|
70
|
+
const panRef = useRef(null);
|
|
71
|
+
const rootRef = useRef(null);
|
|
72
|
+
const transform = controlledTransform ?? uncontrolledTransform;
|
|
73
|
+
const transformRef = useRef(transform);
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
transformRef.current = transform;
|
|
76
|
+
}, [transform]);
|
|
77
|
+
function commitTransform(next, reason) {
|
|
78
|
+
const bounded = {
|
|
79
|
+
...next,
|
|
80
|
+
scale: clampScale(next.scale, minScale, maxScale)
|
|
81
|
+
};
|
|
82
|
+
transformRef.current = bounded;
|
|
83
|
+
if (controlledTransform === void 0) setUncontrolledTransform(bounded);
|
|
84
|
+
onTransformChange?.(bounded, { reason });
|
|
85
|
+
}
|
|
86
|
+
function zoomBy(factor, reason) {
|
|
87
|
+
const currentTransform = transformRef.current;
|
|
88
|
+
const nextScale = clampScale(currentTransform.scale * factor, minScale, maxScale);
|
|
89
|
+
const root = rootRef.current;
|
|
90
|
+
commitTransform(zoomAroundPoint(currentTransform, nextScale, root ? {
|
|
91
|
+
x: root.clientWidth / 2,
|
|
92
|
+
y: root.clientHeight / 2
|
|
93
|
+
} : {
|
|
94
|
+
x: 0,
|
|
95
|
+
y: 0
|
|
96
|
+
}), reason);
|
|
97
|
+
}
|
|
98
|
+
function reset(reason) {
|
|
99
|
+
commitTransform(defaultTransform, reason);
|
|
100
|
+
}
|
|
101
|
+
function beginPan(event) {
|
|
102
|
+
onPointerDown?.(event);
|
|
103
|
+
if (event.defaultPrevented || event.target !== event.currentTarget || !event.isPrimary || event.button !== 0) return;
|
|
104
|
+
event.preventDefault();
|
|
105
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
106
|
+
panRef.current = {
|
|
107
|
+
pointerId: event.pointerId,
|
|
108
|
+
startPointer: {
|
|
109
|
+
x: event.clientX,
|
|
110
|
+
y: event.clientY
|
|
111
|
+
},
|
|
112
|
+
startTransform: transformRef.current
|
|
113
|
+
};
|
|
114
|
+
setPanning(true);
|
|
115
|
+
}
|
|
116
|
+
function updatePan(event) {
|
|
117
|
+
onPointerMove?.(event);
|
|
118
|
+
if (event.defaultPrevented) return;
|
|
119
|
+
const pan = panRef.current;
|
|
120
|
+
if (!pan || pan.pointerId !== event.pointerId) return;
|
|
121
|
+
commitTransform({
|
|
122
|
+
x: pan.startTransform.x + event.clientX - pan.startPointer.x,
|
|
123
|
+
y: pan.startTransform.y + event.clientY - pan.startPointer.y,
|
|
124
|
+
scale: pan.startTransform.scale
|
|
125
|
+
}, "pointer");
|
|
126
|
+
}
|
|
127
|
+
function finishPan(event) {
|
|
128
|
+
const pan = panRef.current;
|
|
129
|
+
if (!pan || pan.pointerId !== event.pointerId) return;
|
|
130
|
+
if (event.currentTarget.hasPointerCapture(event.pointerId)) event.currentTarget.releasePointerCapture(event.pointerId);
|
|
131
|
+
panRef.current = null;
|
|
132
|
+
setPanning(false);
|
|
133
|
+
}
|
|
134
|
+
function endPan(event) {
|
|
135
|
+
onPointerUp?.(event);
|
|
136
|
+
if (!event.defaultPrevented) finishPan(event);
|
|
137
|
+
}
|
|
138
|
+
function cancelPan(event) {
|
|
139
|
+
onPointerCancel?.(event);
|
|
140
|
+
if (!event.defaultPrevented) finishPan(event);
|
|
141
|
+
}
|
|
142
|
+
const handleWheel = useEffectEvent((event) => {
|
|
143
|
+
onWheel?.(event);
|
|
144
|
+
if (event.defaultPrevented) return;
|
|
145
|
+
const root = rootRef.current;
|
|
146
|
+
if (!root) return;
|
|
147
|
+
event.preventDefault();
|
|
148
|
+
const currentTransform = transformRef.current;
|
|
149
|
+
if (event.ctrlKey || event.metaKey) {
|
|
150
|
+
const bounds = root.getBoundingClientRect();
|
|
151
|
+
const point = {
|
|
152
|
+
x: event.clientX - bounds.left,
|
|
153
|
+
y: event.clientY - bounds.top
|
|
154
|
+
};
|
|
155
|
+
commitTransform(zoomAroundPoint(currentTransform, clampScale(currentTransform.scale * Math.exp(-event.deltaY * .004), minScale, maxScale), point), "wheel");
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
commitTransform(panFromWheel(currentTransform, event, root.clientHeight), "wheel");
|
|
159
|
+
});
|
|
160
|
+
useEffect(() => {
|
|
161
|
+
const root = rootRef.current;
|
|
162
|
+
if (!root) return;
|
|
163
|
+
const listener = (event) => handleWheel(event);
|
|
164
|
+
root.addEventListener("wheel", listener, { passive: false });
|
|
165
|
+
return () => root.removeEventListener("wheel", listener);
|
|
166
|
+
}, []);
|
|
167
|
+
function moveWithKeyboard(event) {
|
|
168
|
+
onKeyDown?.(event);
|
|
169
|
+
if (event.defaultPrevented) return;
|
|
170
|
+
const currentTransform = transformRef.current;
|
|
171
|
+
const direction = KEYBOARD_PAN_DIRECTIONS[event.key];
|
|
172
|
+
if (direction) {
|
|
173
|
+
const panStep = event.shiftKey ? 96 : KEYBOARD_PAN_STEP;
|
|
174
|
+
commitTransform({
|
|
175
|
+
...currentTransform,
|
|
176
|
+
x: currentTransform.x + direction.x * panStep,
|
|
177
|
+
y: currentTransform.y + direction.y * panStep
|
|
178
|
+
}, "keyboard");
|
|
179
|
+
} else if (event.key === "+" || event.key === "=") zoomBy(1.15, "keyboard");
|
|
180
|
+
else if (event.key === "-") zoomBy(1 / 1.15, "keyboard");
|
|
181
|
+
else if (event.key === "0") reset("keyboard");
|
|
182
|
+
else return;
|
|
183
|
+
event.preventDefault();
|
|
184
|
+
}
|
|
185
|
+
const context = {
|
|
186
|
+
transform,
|
|
187
|
+
minScale,
|
|
188
|
+
maxScale,
|
|
189
|
+
reset,
|
|
190
|
+
zoomBy
|
|
191
|
+
};
|
|
192
|
+
const canvasStyle = {
|
|
193
|
+
...style,
|
|
194
|
+
backgroundPosition: `${transform.x}px ${transform.y}px`,
|
|
195
|
+
backgroundSize: `${GRID_SIZE * transform.scale}px ${GRID_SIZE * transform.scale}px`
|
|
196
|
+
};
|
|
197
|
+
return /* @__PURE__ */ jsx(InfiniteCanvasContext.Provider, {
|
|
198
|
+
value: context,
|
|
199
|
+
children: /* @__PURE__ */ jsx("section", {
|
|
200
|
+
ref: rootRef,
|
|
201
|
+
...props,
|
|
202
|
+
"data-control-ui": "infinite-canvas",
|
|
203
|
+
"data-control-family": "infinite-canvas",
|
|
204
|
+
"data-slot": "root",
|
|
205
|
+
"data-panning": panning || void 0,
|
|
206
|
+
"aria-label": ariaLabel,
|
|
207
|
+
role: "application",
|
|
208
|
+
"aria-keyshortcuts": "ArrowLeft ArrowRight ArrowUp ArrowDown + - 0",
|
|
209
|
+
tabIndex: 0,
|
|
210
|
+
className: cn("relative isolate overflow-hidden overscroll-contain touch-none select-none data-panning:cursor-grabbing", className),
|
|
211
|
+
style: canvasStyle,
|
|
212
|
+
onPointerDown: beginPan,
|
|
213
|
+
onPointerMove: updatePan,
|
|
214
|
+
onPointerUp: endPan,
|
|
215
|
+
onPointerCancel: cancelPan,
|
|
216
|
+
onKeyDown: moveWithKeyboard,
|
|
217
|
+
children
|
|
218
|
+
})
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
function InfiniteCanvasContent({ className, style, ...props }) {
|
|
222
|
+
const { transform } = useInfiniteCanvas();
|
|
223
|
+
return /* @__PURE__ */ jsx("div", {
|
|
224
|
+
...props,
|
|
225
|
+
"data-control-ui": "infinite-canvas",
|
|
226
|
+
"data-control-family": "infinite-canvas",
|
|
227
|
+
"data-slot": "content",
|
|
228
|
+
"data-scale": transform.scale,
|
|
229
|
+
className: cn("pointer-events-none absolute top-0 left-0 h-0 w-0 transform-gpu will-change-transform [&>*]:pointer-events-auto", className),
|
|
230
|
+
style: {
|
|
231
|
+
...style,
|
|
232
|
+
transform: `translate3d(${transform.x}px, ${transform.y}px, 0) scale(${transform.scale})`
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
function InfiniteCanvasControls({ className, ...props }) {
|
|
237
|
+
const canvas = useInfiniteCanvas();
|
|
238
|
+
const percentage = Math.round(canvas.transform.scale * 100);
|
|
239
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
240
|
+
"data-control-ui": "infinite-canvas",
|
|
241
|
+
"data-control-family": "infinite-canvas",
|
|
242
|
+
"data-slot": "controls",
|
|
243
|
+
className: cn("absolute right-3 bottom-3 z-40 flex items-center", className),
|
|
244
|
+
...props,
|
|
245
|
+
children: [
|
|
246
|
+
/* @__PURE__ */ jsx(Button, {
|
|
247
|
+
type: "button",
|
|
248
|
+
size: "sm",
|
|
249
|
+
variant: "ghost",
|
|
250
|
+
iconOnly: true,
|
|
251
|
+
disabled: canvas.transform.scale <= canvas.minScale,
|
|
252
|
+
"aria-label": "Zoom out",
|
|
253
|
+
onClick: () => canvas.zoomBy(1 / 1.2, "control"),
|
|
254
|
+
children: /* @__PURE__ */ jsx(MinusIcon, {})
|
|
255
|
+
}),
|
|
256
|
+
/* @__PURE__ */ jsxs(Button, {
|
|
257
|
+
type: "button",
|
|
258
|
+
size: "sm",
|
|
259
|
+
variant: "ghost",
|
|
260
|
+
"aria-label": `Reset canvas zoom, currently ${percentage}%`,
|
|
261
|
+
onClick: () => canvas.reset("control"),
|
|
262
|
+
children: [percentage, "%"]
|
|
263
|
+
}),
|
|
264
|
+
/* @__PURE__ */ jsx(Button, {
|
|
265
|
+
type: "button",
|
|
266
|
+
size: "sm",
|
|
267
|
+
variant: "ghost",
|
|
268
|
+
iconOnly: true,
|
|
269
|
+
disabled: canvas.transform.scale >= canvas.maxScale,
|
|
270
|
+
"aria-label": "Zoom in",
|
|
271
|
+
onClick: () => canvas.zoomBy(1.2, "control"),
|
|
272
|
+
children: /* @__PURE__ */ jsx(PlusIcon, {})
|
|
273
|
+
})
|
|
274
|
+
]
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
//#endregion
|
|
278
|
+
export { InfiniteCanvas, InfiniteCanvasContent, InfiniteCanvasControls, useInfiniteCanvas };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RenderProp } from "../control-props.js";
|
|
2
|
+
import { ControlSize } from "../control-variants.js";
|
|
3
|
+
import { FieldKnobStyle } from "../knob-contracts/field-knobs.js";
|
|
4
|
+
import { CSSProperties, ComponentProps } from "react";
|
|
5
|
+
//#region src/ui/input-group.d.ts
|
|
6
|
+
type InputGroupProps = Omit<ComponentProps<"div">, "style"> & {
|
|
7
|
+
style?: CSSProperties & FieldKnobStyle;
|
|
8
|
+
} & {
|
|
9
|
+
render?: RenderProp<ComponentProps<"div">>;
|
|
10
|
+
size?: ControlSize;
|
|
11
|
+
};
|
|
12
|
+
type InputGroupAddonProps = ComponentProps<"span"> & {
|
|
13
|
+
style?: CSSProperties & FieldKnobStyle;
|
|
14
|
+
};
|
|
15
|
+
declare function InputGroup({ size, className, render, children, ...props }: InputGroupProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
16
|
+
declare function InputGroupAddon({ className, ...props }: InputGroupAddonProps): import("react").JSX.Element;
|
|
17
|
+
declare function InputGroupInput({ className, ...props }: ComponentProps<"input"> & {
|
|
18
|
+
style?: CSSProperties & FieldKnobStyle;
|
|
19
|
+
}): import("react").JSX.Element;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { InputGroup, InputGroupAddon, InputGroupAddonProps, InputGroupInput, InputGroupProps };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/ui/input-group.tsx
|
|
6
|
+
function InputGroup({ size = "md", className, render, children, ...props }) {
|
|
7
|
+
const classes = cn("flex min-w-0 w-full items-center overflow-hidden", className);
|
|
8
|
+
return useRender({
|
|
9
|
+
defaultTagName: "div",
|
|
10
|
+
render,
|
|
11
|
+
props: {
|
|
12
|
+
...props,
|
|
13
|
+
"data-control-ui": "input-group",
|
|
14
|
+
"data-slot": "root",
|
|
15
|
+
"data-control-family": "field",
|
|
16
|
+
"data-control": "true",
|
|
17
|
+
"data-size": size,
|
|
18
|
+
className: classes,
|
|
19
|
+
children
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function InputGroupAddon({ className, ...props }) {
|
|
24
|
+
return /* @__PURE__ */ jsx("span", {
|
|
25
|
+
"data-control-ui": "input-group",
|
|
26
|
+
"data-control-family": "field",
|
|
27
|
+
"data-field-kind": "input-group",
|
|
28
|
+
"data-slot": "addon",
|
|
29
|
+
className: cn("inline-flex shrink-0 items-center", className),
|
|
30
|
+
...props
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function InputGroupInput({ className, ...props }) {
|
|
34
|
+
return /* @__PURE__ */ jsx("input", {
|
|
35
|
+
"data-control-ui": "input-group",
|
|
36
|
+
"data-control-family": "field",
|
|
37
|
+
"data-field-kind": "input-group",
|
|
38
|
+
"data-slot": "input",
|
|
39
|
+
className: cn("h-full min-w-0 flex-1", className),
|
|
40
|
+
...props
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { InputGroup, InputGroupAddon, InputGroupInput };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { FieldKnobStyle } from "../knob-contracts/field-knobs.js";
|
|
2
|
+
import { CSSProperties, ComponentProps, ReactNode } from "react";
|
|
3
|
+
//#region src/ui/input-otp.d.ts
|
|
4
|
+
type InputOTPProps = {
|
|
5
|
+
length?: number;
|
|
6
|
+
separator?: boolean;
|
|
7
|
+
value?: string;
|
|
8
|
+
defaultValue?: string;
|
|
9
|
+
onValueChange?: (value: string) => void;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
readOnly?: boolean;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
name?: string;
|
|
14
|
+
mask?: boolean;
|
|
15
|
+
id?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
"aria-label"?: string;
|
|
19
|
+
"aria-describedby"?: string;
|
|
20
|
+
} & {
|
|
21
|
+
style?: CSSProperties & FieldKnobStyle;
|
|
22
|
+
};
|
|
23
|
+
type InputOTPSlotProps = {
|
|
24
|
+
index: number;
|
|
25
|
+
length?: number;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
placeholder?: string;
|
|
28
|
+
className?: string;
|
|
29
|
+
style?: CSSProperties & FieldKnobStyle;
|
|
30
|
+
};
|
|
31
|
+
type InputOTPSeparatorProps = ComponentProps<"div"> & {
|
|
32
|
+
style?: CSSProperties & FieldKnobStyle;
|
|
33
|
+
};
|
|
34
|
+
declare function InputOTPSlot({ index, length, className, ...props }: InputOTPSlotProps): import("react").JSX.Element;
|
|
35
|
+
declare function InputOTPSeparator({ className, ...props }: InputOTPSeparatorProps): import("react").JSX.Element;
|
|
36
|
+
declare function InputOTP({ length, separator, className, children, ...props }: InputOTPProps): import("react").JSX.Element;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { InputOTP, InputOTPProps, InputOTPSeparator, InputOTPSeparatorProps, InputOTPSlot, InputOTPSlotProps };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { Fragment } from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { OTPField } from "@base-ui/react/otp-field";
|
|
6
|
+
//#region src/ui/input-otp.tsx
|
|
7
|
+
function InputOTPSlot({ index, length, className, ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(OTPField.Input, {
|
|
9
|
+
"data-control-ui": "input-otp",
|
|
10
|
+
"data-field-kind": "input-otp",
|
|
11
|
+
"data-slot": "slot",
|
|
12
|
+
"data-control-family": "field",
|
|
13
|
+
"data-control": "true",
|
|
14
|
+
"aria-label": length ? `Character ${index + 1} of ${length}` : `Character ${index + 1}`,
|
|
15
|
+
className: cn("relative flex size-[var(--control-h-md)] items-center justify-center", className),
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function InputOTPSeparator({ className, ...props }) {
|
|
20
|
+
return /* @__PURE__ */ jsx(OTPField.Separator, {
|
|
21
|
+
"data-control-ui": "input-otp",
|
|
22
|
+
"data-control-family": "field",
|
|
23
|
+
"data-field-kind": "input-otp",
|
|
24
|
+
"data-slot": "separator",
|
|
25
|
+
className: cn("shrink-0", className),
|
|
26
|
+
...props
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function InputOTP({ length = 6, separator = false, className, children, ...props }) {
|
|
30
|
+
return /* @__PURE__ */ jsx(OTPField.Root, {
|
|
31
|
+
"data-control-ui": "input-otp",
|
|
32
|
+
"data-control-family": "field",
|
|
33
|
+
"data-field-kind": "input-otp",
|
|
34
|
+
"data-slot": "root",
|
|
35
|
+
length,
|
|
36
|
+
className: cn("flex items-center", className),
|
|
37
|
+
...props,
|
|
38
|
+
children: children ?? Array.from({ length }, (_, index) => `input-otp-slot-${index}`).map((slotKey, index) => /* @__PURE__ */ jsxs(Fragment, { children: [separator && index === Math.ceil(length / 2) ? /* @__PURE__ */ jsx(InputOTPSeparator, {}) : null, /* @__PURE__ */ jsx(InputOTPSlot, {
|
|
39
|
+
index,
|
|
40
|
+
length
|
|
41
|
+
})] }, slotKey))
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { InputOTP, InputOTPSeparator, InputOTPSlot };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ControlSize } from "../control-variants.js";
|
|
2
|
+
import { FieldKnobStyle } from "../knob-contracts/field-knobs.js";
|
|
3
|
+
import { CSSProperties, ComponentProps } from "react";
|
|
4
|
+
//#region src/ui/input.d.ts
|
|
5
|
+
type InputProps = Omit<Omit<ComponentProps<"input">, "size">, "style"> & {
|
|
6
|
+
style?: CSSProperties & FieldKnobStyle;
|
|
7
|
+
} & {
|
|
8
|
+
size?: ControlSize;
|
|
9
|
+
};
|
|
10
|
+
declare function Input({ size, className, ...props }: InputProps): import("react").JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Input, InputProps };
|
package/dist/ui/input.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Input as Input$1 } from "@base-ui/react/input";
|
|
5
|
+
//#region src/ui/input.tsx
|
|
6
|
+
function Input({ size = "md", className, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(Input$1, {
|
|
8
|
+
"data-control-ui": "input",
|
|
9
|
+
"data-slot": "root",
|
|
10
|
+
"data-control-family": "field",
|
|
11
|
+
"data-control": "true",
|
|
12
|
+
"data-size": size,
|
|
13
|
+
className: cn("w-full min-w-0", className),
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Input };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { RenderProp } from "../control-props.js";
|
|
2
|
+
import { ItemKnobStyle } from "../knob-contracts/item-knobs.js";
|
|
3
|
+
import { CSSProperties, ComponentProps } from "react";
|
|
4
|
+
//#region src/ui/item.d.ts
|
|
5
|
+
declare const itemVariants: readonly ["default", "outline", "muted"];
|
|
6
|
+
type ItemVariant = (typeof itemVariants)[number];
|
|
7
|
+
type ItemProps = Omit<ComponentProps<"div"> & {
|
|
8
|
+
variant?: ItemVariant;
|
|
9
|
+
render?: RenderProp<ComponentProps<"div">>;
|
|
10
|
+
}, "style"> & {
|
|
11
|
+
style?: CSSProperties & ItemKnobStyle;
|
|
12
|
+
};
|
|
13
|
+
type ItemDescriptionProps = Omit<ComponentProps<"p">, "style"> & {
|
|
14
|
+
style?: CSSProperties & ItemKnobStyle;
|
|
15
|
+
};
|
|
16
|
+
type ItemFooterProps = Omit<ComponentProps<"div">, "style"> & {
|
|
17
|
+
style?: CSSProperties & ItemKnobStyle;
|
|
18
|
+
};
|
|
19
|
+
type ItemMediaProps = Omit<ComponentProps<"div">, "style"> & {
|
|
20
|
+
style?: CSSProperties & ItemKnobStyle;
|
|
21
|
+
};
|
|
22
|
+
type ItemTitleProps = Omit<ComponentProps<"div">, "style"> & {
|
|
23
|
+
style?: CSSProperties & ItemKnobStyle;
|
|
24
|
+
};
|
|
25
|
+
type ItemGroupProps = ComponentProps<"div"> & {
|
|
26
|
+
style?: CSSProperties & ItemKnobStyle;
|
|
27
|
+
};
|
|
28
|
+
type ItemSeparatorProps = ComponentProps<"div">;
|
|
29
|
+
declare function ItemGroup({ className, ...props }: ItemGroupProps): import("react").JSX.Element;
|
|
30
|
+
declare function ItemSeparator({ className, ...props }: ItemSeparatorProps): import("react").JSX.Element;
|
|
31
|
+
declare function Item({ variant, render, className, children, ...props }: ItemProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
32
|
+
declare function ItemMedia({ className, ...props }: ItemMediaProps): import("react").JSX.Element;
|
|
33
|
+
declare function ItemContent({ className, ...props }: ComponentProps<"div"> & {
|
|
34
|
+
style?: CSSProperties & ItemKnobStyle;
|
|
35
|
+
}): import("react").JSX.Element;
|
|
36
|
+
declare function ItemTitle({ className, ...props }: ItemTitleProps): import("react").JSX.Element;
|
|
37
|
+
declare function ItemDescription({ className, ...props }: ItemDescriptionProps): import("react").JSX.Element;
|
|
38
|
+
declare function ItemActions({ className, ...props }: ComponentProps<"div"> & {
|
|
39
|
+
style?: CSSProperties & ItemKnobStyle;
|
|
40
|
+
}): import("react").JSX.Element;
|
|
41
|
+
declare function ItemHeader({ className, ...props }: ComponentProps<"div"> & {
|
|
42
|
+
style?: CSSProperties & ItemKnobStyle;
|
|
43
|
+
}): import("react").JSX.Element;
|
|
44
|
+
declare function ItemFooter({ className, ...props }: ItemFooterProps): import("react").JSX.Element;
|
|
45
|
+
//#endregion
|
|
46
|
+
export { Item, ItemActions, ItemContent, ItemDescription, ItemDescriptionProps, ItemFooter, ItemFooterProps, ItemGroup, ItemGroupProps, ItemHeader, ItemMedia, ItemMediaProps, ItemProps, ItemSeparator, ItemSeparatorProps, ItemTitle, ItemTitleProps, ItemVariant, itemVariants };
|
package/dist/ui/item.js
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { Separator } from "./separator.js";
|
|
4
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region src/ui/item.tsx
|
|
7
|
+
const itemVariants = [
|
|
8
|
+
"default",
|
|
9
|
+
"outline",
|
|
10
|
+
"muted"
|
|
11
|
+
];
|
|
12
|
+
function ItemGroup({ className, ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsx("div", {
|
|
14
|
+
role: "list",
|
|
15
|
+
"data-control-ui": "item",
|
|
16
|
+
"data-control-family": "item",
|
|
17
|
+
"data-slot": "group",
|
|
18
|
+
className: cn("group/item-group flex flex-col", className),
|
|
19
|
+
...props
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function ItemSeparator({ className, ...props }) {
|
|
23
|
+
return /* @__PURE__ */ jsx(Separator, {
|
|
24
|
+
"data-control-ui": "item",
|
|
25
|
+
"data-slot": "separator",
|
|
26
|
+
orientation: "horizontal",
|
|
27
|
+
className: cn("my-0", className),
|
|
28
|
+
...props
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function Item({ variant = "default", render, className, children, ...props }) {
|
|
32
|
+
return useRender({
|
|
33
|
+
defaultTagName: "div",
|
|
34
|
+
render,
|
|
35
|
+
props: {
|
|
36
|
+
...props,
|
|
37
|
+
"data-control-ui": "item",
|
|
38
|
+
"data-control-family": "item",
|
|
39
|
+
"data-slot": "root",
|
|
40
|
+
"data-variant": variant,
|
|
41
|
+
className: cn("flex items-center [&[href]]:cursor-pointer", className),
|
|
42
|
+
children
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function ItemMedia({ className, ...props }) {
|
|
47
|
+
return /* @__PURE__ */ jsx("div", {
|
|
48
|
+
"data-control-ui": "item",
|
|
49
|
+
"data-control-family": "item",
|
|
50
|
+
"data-slot": "media",
|
|
51
|
+
className: cn("flex shrink-0 items-center justify-center self-start [&>svg]:size-5 [&>svg]:shrink-0", className),
|
|
52
|
+
...props
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function ItemContent({ className, ...props }) {
|
|
56
|
+
return /* @__PURE__ */ jsx("div", {
|
|
57
|
+
"data-control-ui": "item",
|
|
58
|
+
"data-control-family": "item",
|
|
59
|
+
"data-slot": "content",
|
|
60
|
+
className: cn("flex min-w-0 flex-1 flex-col", className),
|
|
61
|
+
...props
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function ItemTitle({ className, ...props }) {
|
|
65
|
+
return /* @__PURE__ */ jsx("div", {
|
|
66
|
+
"data-control-ui": "item",
|
|
67
|
+
"data-control-family": "item",
|
|
68
|
+
"data-slot": "title",
|
|
69
|
+
className: cn("flex w-fit items-center", className),
|
|
70
|
+
...props
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
function ItemDescription({ className, ...props }) {
|
|
74
|
+
return /* @__PURE__ */ jsx("p", {
|
|
75
|
+
"data-control-ui": "item",
|
|
76
|
+
"data-control-family": "item",
|
|
77
|
+
"data-slot": "description",
|
|
78
|
+
className: cn("line-clamp-2", className),
|
|
79
|
+
...props
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function ItemActions({ className, ...props }) {
|
|
83
|
+
return /* @__PURE__ */ jsx("div", {
|
|
84
|
+
"data-control-ui": "item",
|
|
85
|
+
"data-control-family": "item",
|
|
86
|
+
"data-slot": "actions",
|
|
87
|
+
className: cn("flex shrink-0 items-center", className),
|
|
88
|
+
...props
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function ItemHeader({ className, ...props }) {
|
|
92
|
+
return /* @__PURE__ */ jsx("div", {
|
|
93
|
+
"data-control-ui": "item",
|
|
94
|
+
"data-control-family": "item",
|
|
95
|
+
"data-slot": "header",
|
|
96
|
+
className: cn("flex basis-full items-center justify-between", className),
|
|
97
|
+
...props
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function ItemFooter({ className, ...props }) {
|
|
101
|
+
return /* @__PURE__ */ jsx("div", {
|
|
102
|
+
"data-control-ui": "item",
|
|
103
|
+
"data-control-family": "item",
|
|
104
|
+
"data-slot": "footer",
|
|
105
|
+
className: cn("flex basis-full items-center justify-between", className),
|
|
106
|
+
...props
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
export { Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, itemVariants };
|
package/dist/ui/kbd.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { KbdKnobStyle } from "../knob-contracts/kbd-knobs.js";
|
|
2
|
+
import { CSSProperties, ComponentProps } from "react";
|
|
3
|
+
//#region src/ui/kbd.d.ts
|
|
4
|
+
type KbdProps = Omit<ComponentProps<"kbd">, "style"> & {
|
|
5
|
+
style?: CSSProperties & KbdKnobStyle;
|
|
6
|
+
};
|
|
7
|
+
declare function Kbd({ className, ...props }: KbdProps): import("react").JSX.Element;
|
|
8
|
+
declare function KbdGroup({ className, ...props }: ComponentProps<"span"> & {
|
|
9
|
+
style?: CSSProperties & KbdKnobStyle;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Kbd, KbdGroup, KbdProps };
|
package/dist/ui/kbd.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { cn } from "../lib/cn.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/ui/kbd.tsx
|
|
4
|
+
function Kbd({ className, ...props }) {
|
|
5
|
+
return /* @__PURE__ */ jsx("kbd", {
|
|
6
|
+
"data-control-ui": "kbd",
|
|
7
|
+
"data-control-family": "kbd",
|
|
8
|
+
"data-slot": "root",
|
|
9
|
+
className: cn("inline-flex select-none items-center justify-center", className),
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function KbdGroup({ className, ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx("span", {
|
|
15
|
+
"data-control-ui": "kbd",
|
|
16
|
+
"data-control-family": "kbd",
|
|
17
|
+
"data-slot": "group",
|
|
18
|
+
className: cn("inline-flex items-center", className),
|
|
19
|
+
...props
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { Kbd, KbdGroup };
|