@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,36 @@
|
|
|
1
|
+
import { ControlledChoice, RenderProp } from "../control-props.js";
|
|
2
|
+
import { ControlSize } from "../control-variants.js";
|
|
3
|
+
import { TabsKnobStyle } from "../knob-contracts/tabs-knobs.js";
|
|
4
|
+
import { CSSProperties, ComponentProps } from "react";
|
|
5
|
+
//#region src/ui/tabs.d.ts
|
|
6
|
+
type TabsProps<TValue extends string = string> = Omit<ComponentProps<"div">, "defaultValue" | "onChange"> & ControlledChoice<TValue> & {
|
|
7
|
+
style?: CSSProperties & TabsKnobStyle;
|
|
8
|
+
};
|
|
9
|
+
type TabsListVariant = "default" | "browser";
|
|
10
|
+
type TabsListProps = Omit<ComponentProps<"div">, "style"> & {
|
|
11
|
+
style?: CSSProperties & TabsKnobStyle;
|
|
12
|
+
} & {
|
|
13
|
+
size?: ControlSize;
|
|
14
|
+
variant?: TabsListVariant;
|
|
15
|
+
};
|
|
16
|
+
type TabsTabProps = Omit<Omit<ComponentProps<"button">, "value">, "style"> & {
|
|
17
|
+
style?: CSSProperties & TabsKnobStyle;
|
|
18
|
+
} & {
|
|
19
|
+
value: string;
|
|
20
|
+
render?: RenderProp<ComponentProps<"button">, {
|
|
21
|
+
active: boolean;
|
|
22
|
+
disabled: boolean;
|
|
23
|
+
}>;
|
|
24
|
+
nativeButton?: boolean;
|
|
25
|
+
};
|
|
26
|
+
type TabsPanelProps = Omit<ComponentProps<"div">, "style"> & {
|
|
27
|
+
style?: CSSProperties & TabsKnobStyle;
|
|
28
|
+
} & {
|
|
29
|
+
value: string;
|
|
30
|
+
};
|
|
31
|
+
declare function Tabs<TValue extends string = string>({ className, onValueChange, children, ...props }: TabsProps<TValue>): import("react").JSX.Element;
|
|
32
|
+
declare function TabsList({ size, variant, className, children, style, ...props }: TabsListProps): import("react").JSX.Element;
|
|
33
|
+
declare function TabsTab({ className, ...props }: TabsTabProps): import("react").JSX.Element;
|
|
34
|
+
declare function TabsPanel({ className, value, ref, ...props }: TabsPanelProps): import("react").JSX.Element;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { Tabs, TabsList, TabsListProps, TabsListVariant, TabsPanel, TabsPanelProps, TabsProps, TabsTab, TabsTabProps };
|
package/dist/ui/tabs.js
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { Children, Fragment, createContext, isValidElement, useContext, useRef, useState } from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { Tabs as Tabs$1 } from "@base-ui/react/tabs";
|
|
6
|
+
//#region src/ui/tabs.tsx
|
|
7
|
+
const TabsPanelsContext = createContext(null);
|
|
8
|
+
function useRegisterTabsPanel() {
|
|
9
|
+
const registerPanel = useContext(TabsPanelsContext);
|
|
10
|
+
if (!registerPanel) throw new Error("TabsPanel must be rendered inside <Tabs>.");
|
|
11
|
+
return registerPanel;
|
|
12
|
+
}
|
|
13
|
+
function setRef(ref, value) {
|
|
14
|
+
if (typeof ref === "function") return ref(value);
|
|
15
|
+
if (ref) ref.current = value;
|
|
16
|
+
}
|
|
17
|
+
function Tabs({ className, onValueChange, children, ...props }) {
|
|
18
|
+
const rootRef = useRef(null);
|
|
19
|
+
const panelsRef = useRef(/* @__PURE__ */ new Map());
|
|
20
|
+
const clearPrevHeight = useRef(0);
|
|
21
|
+
const [registerPanel] = useState(() => (value, node) => {
|
|
22
|
+
if (!node) return;
|
|
23
|
+
panelsRef.current.set(value, node);
|
|
24
|
+
return () => {
|
|
25
|
+
if (panelsRef.current.get(value) === node) panelsRef.current.delete(value);
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
const handleValueChange = (value) => {
|
|
29
|
+
const root = rootRef.current;
|
|
30
|
+
if (root) for (const panel of panelsRef.current.values()) {
|
|
31
|
+
if (panel.inert || panel.hidden) continue;
|
|
32
|
+
root.style.setProperty("--aui-slide-prev-height", `${panel.getBoundingClientRect().height}px`);
|
|
33
|
+
cancelAnimationFrame(clearPrevHeight.current);
|
|
34
|
+
clearPrevHeight.current = requestAnimationFrame(() => {
|
|
35
|
+
clearPrevHeight.current = requestAnimationFrame(() => root.style.removeProperty("--aui-slide-prev-height"));
|
|
36
|
+
});
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
onValueChange?.(value);
|
|
40
|
+
};
|
|
41
|
+
return /* @__PURE__ */ jsx(TabsPanelsContext.Provider, {
|
|
42
|
+
value: registerPanel,
|
|
43
|
+
children: /* @__PURE__ */ jsx(Tabs$1.Root, {
|
|
44
|
+
"data-control-ui": "tabs",
|
|
45
|
+
"data-control-family": "tabs",
|
|
46
|
+
"data-slot": "root",
|
|
47
|
+
"data-slide": "scope",
|
|
48
|
+
className,
|
|
49
|
+
onValueChange: handleValueChange,
|
|
50
|
+
...props,
|
|
51
|
+
ref: rootRef,
|
|
52
|
+
children
|
|
53
|
+
})
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
const controlHeights = {
|
|
57
|
+
xs: "var(--control-h-xs)",
|
|
58
|
+
sm: "var(--control-h-sm)",
|
|
59
|
+
md: "var(--control-h-md)",
|
|
60
|
+
lg: "var(--control-h-lg)"
|
|
61
|
+
};
|
|
62
|
+
function countTabs(children) {
|
|
63
|
+
return Children.toArray(children).reduce((count, child) => {
|
|
64
|
+
if (!isValidElement(child)) return count;
|
|
65
|
+
if (child.type === TabsTab) return count + 1;
|
|
66
|
+
if (child.type === Fragment) return count + countTabs(child.props.children);
|
|
67
|
+
return count;
|
|
68
|
+
}, 0);
|
|
69
|
+
}
|
|
70
|
+
function TabsList({ size = "sm", variant = "default", className, children, style, ...props }) {
|
|
71
|
+
const isSingle = countTabs(children) === 1;
|
|
72
|
+
const controlStyle = {
|
|
73
|
+
"--_tabs-trigger-h": controlHeights[size],
|
|
74
|
+
...style
|
|
75
|
+
};
|
|
76
|
+
return /* @__PURE__ */ jsxs(Tabs$1.List, {
|
|
77
|
+
"data-control-ui": "tabs",
|
|
78
|
+
"data-control-family": "tabs",
|
|
79
|
+
"data-slot": "list",
|
|
80
|
+
"data-size": size,
|
|
81
|
+
"data-variant": variant,
|
|
82
|
+
"data-single": isSingle ? "true" : void 0,
|
|
83
|
+
className: cn(variant === "browser" && "gap-0 p-0 px-(--_tabs-browser-inset) pt-(--cui-tabs-list-padding)", className),
|
|
84
|
+
style: controlStyle,
|
|
85
|
+
...props,
|
|
86
|
+
children: [children, isSingle ? null : /* @__PURE__ */ jsx(Tabs$1.Indicator, {
|
|
87
|
+
"data-control-ui": "tabs",
|
|
88
|
+
"data-control-family": "tabs",
|
|
89
|
+
"data-slot": "indicator",
|
|
90
|
+
className: variant === "browser" ? "top-auto bottom-0 left-(--_tabs-browser-indicator-x) z-0 h-(--_tabs-trigger-h) w-(--_tabs-browser-indicator-width) transform-none" : void 0
|
|
91
|
+
})]
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function TabsTab({ className, ...props }) {
|
|
95
|
+
return /* @__PURE__ */ jsx(Tabs$1.Tab, {
|
|
96
|
+
"data-control-ui": "tabs",
|
|
97
|
+
"data-control-family": "tabs",
|
|
98
|
+
"data-slot": "tab",
|
|
99
|
+
className,
|
|
100
|
+
...props
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
function TabsPanel({ className, value, ref, ...props }) {
|
|
104
|
+
const registerPanel = useRegisterTabsPanel();
|
|
105
|
+
const panelRef = (node) => {
|
|
106
|
+
const unregister = registerPanel(value, node);
|
|
107
|
+
const cleanup = setRef(ref, node);
|
|
108
|
+
if (!node) return;
|
|
109
|
+
return () => {
|
|
110
|
+
unregister?.();
|
|
111
|
+
if (typeof cleanup === "function") cleanup();
|
|
112
|
+
else setRef(ref, null);
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
return /* @__PURE__ */ jsx(Tabs$1.Panel, {
|
|
116
|
+
ref: panelRef,
|
|
117
|
+
value,
|
|
118
|
+
"data-control-ui": "tabs",
|
|
119
|
+
"data-control-family": "tabs",
|
|
120
|
+
"data-slot": "panel",
|
|
121
|
+
"data-slide": "panel",
|
|
122
|
+
className: cn("data-[hidden]:hidden [&[hidden]]:hidden", className),
|
|
123
|
+
...props
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
export { Tabs, TabsList, TabsPanel, TabsTab };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FieldKnobStyle } from "../knob-contracts/field-knobs.js";
|
|
2
|
+
import { CSSProperties, ComponentProps } from "react";
|
|
3
|
+
//#region src/ui/textarea.d.ts
|
|
4
|
+
type TextareaProps = Omit<ComponentProps<"textarea">, "style"> & {
|
|
5
|
+
style?: CSSProperties & FieldKnobStyle;
|
|
6
|
+
};
|
|
7
|
+
declare function Textarea({ className, ...props }: TextareaProps): import("react").JSX.Element;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { Textarea, TextareaProps };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { cn } from "../lib/cn.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/ui/textarea.tsx
|
|
4
|
+
function Textarea({ className, ...props }) {
|
|
5
|
+
return /* @__PURE__ */ jsx("textarea", {
|
|
6
|
+
"data-control-ui": "textarea",
|
|
7
|
+
"data-field-kind": "textarea",
|
|
8
|
+
"data-slot": "root",
|
|
9
|
+
"data-control-family": "field",
|
|
10
|
+
"data-control": "true",
|
|
11
|
+
className: cn("field-sizing-content w-full min-w-0 resize-none", className),
|
|
12
|
+
...props
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Textarea };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { TimelineKnobStyle } from "../knob-contracts/timeline-knobs.js";
|
|
2
|
+
import { CSSProperties, ComponentProps } from "react";
|
|
3
|
+
//#region src/ui/timeline.d.ts
|
|
4
|
+
type TimelineState = "neutral" | "pending" | "running" | "success" | "error";
|
|
5
|
+
type TimelineProps = ComponentProps<"ol"> & {
|
|
6
|
+
style?: CSSProperties & TimelineKnobStyle;
|
|
7
|
+
};
|
|
8
|
+
type TimelineItemProps = ComponentProps<"li"> & {
|
|
9
|
+
state?: TimelineState;
|
|
10
|
+
} & {
|
|
11
|
+
style?: CSSProperties & TimelineKnobStyle;
|
|
12
|
+
};
|
|
13
|
+
type TimelineIndicatorProps = Omit<ComponentProps<"span">, "style"> & {
|
|
14
|
+
style?: CSSProperties & TimelineKnobStyle;
|
|
15
|
+
};
|
|
16
|
+
type TimelineSeparatorProps = Omit<ComponentProps<"span">, "style"> & {
|
|
17
|
+
style?: CSSProperties & TimelineKnobStyle;
|
|
18
|
+
};
|
|
19
|
+
type TimelineContentProps = ComponentProps<"div"> & {
|
|
20
|
+
style?: CSSProperties & TimelineKnobStyle;
|
|
21
|
+
};
|
|
22
|
+
type TimelineTitleProps = Omit<ComponentProps<"div">, "style"> & {
|
|
23
|
+
style?: CSSProperties & TimelineKnobStyle;
|
|
24
|
+
};
|
|
25
|
+
type TimelineDescriptionProps = Omit<ComponentProps<"div">, "style"> & {
|
|
26
|
+
style?: CSSProperties & TimelineKnobStyle;
|
|
27
|
+
};
|
|
28
|
+
type TimelineMetaProps = ComponentProps<"div"> & {
|
|
29
|
+
style?: CSSProperties & TimelineKnobStyle;
|
|
30
|
+
};
|
|
31
|
+
declare function Timeline({ className, ...props }: TimelineProps): import("react").JSX.Element;
|
|
32
|
+
declare function TimelineItem({ state, className, ...props }: TimelineItemProps): import("react").JSX.Element;
|
|
33
|
+
declare function TimelineIndicator({ className, ...props }: TimelineIndicatorProps): import("react").JSX.Element;
|
|
34
|
+
declare function TimelineSeparator({ className, ...props }: TimelineSeparatorProps): import("react").JSX.Element;
|
|
35
|
+
declare function TimelineContent({ className, ...props }: TimelineContentProps): import("react").JSX.Element;
|
|
36
|
+
declare function TimelineTitle({ className, ...props }: TimelineTitleProps): import("react").JSX.Element;
|
|
37
|
+
declare function TimelineDescription({ className, ...props }: TimelineDescriptionProps): import("react").JSX.Element;
|
|
38
|
+
declare function TimelineMeta({ className, ...props }: TimelineMetaProps): import("react").JSX.Element;
|
|
39
|
+
//#endregion
|
|
40
|
+
export { Timeline, TimelineContent, TimelineContentProps, TimelineDescription, TimelineDescriptionProps, TimelineIndicator, TimelineIndicatorProps, TimelineItem, TimelineItemProps, TimelineMeta, TimelineMetaProps, TimelineProps, TimelineSeparator, TimelineSeparatorProps, TimelineState, TimelineTitle, TimelineTitleProps };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { cn } from "../lib/cn.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/ui/timeline.tsx
|
|
4
|
+
function Timeline({ className, ...props }) {
|
|
5
|
+
return /* @__PURE__ */ jsx("ol", {
|
|
6
|
+
"data-control-ui": "timeline",
|
|
7
|
+
"data-control-family": "timeline",
|
|
8
|
+
"data-slot": "root",
|
|
9
|
+
...props,
|
|
10
|
+
className: cn("grid min-w-0", className)
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function TimelineItem({ state = "neutral", className, ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx("li", {
|
|
15
|
+
"data-control-ui": "timeline",
|
|
16
|
+
"data-control-family": "timeline",
|
|
17
|
+
"data-slot": "item",
|
|
18
|
+
"data-state": state,
|
|
19
|
+
...props,
|
|
20
|
+
className: cn("group/timeline-item relative grid min-w-0 grid-cols-[1rem_minmax(0,1fr)]", className)
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function TimelineIndicator({ className, ...props }) {
|
|
24
|
+
return /* @__PURE__ */ jsx("span", {
|
|
25
|
+
"aria-hidden": "true",
|
|
26
|
+
"data-control-ui": "timeline",
|
|
27
|
+
"data-control-family": "timeline",
|
|
28
|
+
"data-slot": "indicator",
|
|
29
|
+
...props,
|
|
30
|
+
className: cn("relative z-10 col-start-1 row-start-1 flex shrink-0 items-center justify-center", className)
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function TimelineSeparator({ className, ...props }) {
|
|
34
|
+
return /* @__PURE__ */ jsx("span", {
|
|
35
|
+
"aria-hidden": "true",
|
|
36
|
+
"data-control-ui": "timeline",
|
|
37
|
+
"data-control-family": "timeline",
|
|
38
|
+
"data-slot": "separator",
|
|
39
|
+
...props,
|
|
40
|
+
className: cn("absolute top-5 bottom-0 left-[calc(0.5rem-0.5px)] col-start-1 w-px group-last/timeline-item:hidden", className)
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function TimelineContent({ className, ...props }) {
|
|
44
|
+
return /* @__PURE__ */ jsx("div", {
|
|
45
|
+
"data-control-ui": "timeline",
|
|
46
|
+
"data-control-family": "timeline",
|
|
47
|
+
"data-slot": "content",
|
|
48
|
+
...props,
|
|
49
|
+
className: cn("col-start-2 row-start-1 grid min-w-0", className)
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function TimelineTitle({ className, ...props }) {
|
|
53
|
+
return /* @__PURE__ */ jsx("div", {
|
|
54
|
+
"data-control-ui": "timeline",
|
|
55
|
+
"data-control-family": "timeline",
|
|
56
|
+
"data-slot": "title",
|
|
57
|
+
...props,
|
|
58
|
+
className: cn("min-w-0", className)
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function TimelineDescription({ className, ...props }) {
|
|
62
|
+
return /* @__PURE__ */ jsx("div", {
|
|
63
|
+
"data-control-ui": "timeline",
|
|
64
|
+
"data-control-family": "timeline",
|
|
65
|
+
"data-slot": "description",
|
|
66
|
+
...props,
|
|
67
|
+
className: cn("min-w-0 wrap-anywhere", className)
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function TimelineMeta({ className, ...props }) {
|
|
71
|
+
return /* @__PURE__ */ jsx("div", {
|
|
72
|
+
"data-control-ui": "timeline",
|
|
73
|
+
"data-control-family": "timeline",
|
|
74
|
+
"data-slot": "meta",
|
|
75
|
+
...props,
|
|
76
|
+
className: cn("flex min-w-0 flex-wrap items-center", className)
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
export { Timeline, TimelineContent, TimelineDescription, TimelineIndicator, TimelineItem, TimelineMeta, TimelineSeparator, TimelineTitle };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { PopupKnobStyle } from "../knob-contracts/popup-knobs.js";
|
|
2
|
+
import { CSSProperties, ReactNode } from "react";
|
|
3
|
+
import { Toast } from "@base-ui/react/toast";
|
|
4
|
+
//#region src/ui/toast.d.ts
|
|
5
|
+
type ToasterProps = {
|
|
6
|
+
className?: string;
|
|
7
|
+
timeout?: number;
|
|
8
|
+
limit?: number;
|
|
9
|
+
rootStyle?: CSSProperties & PopupKnobStyle;
|
|
10
|
+
indicatorStyle?: CSSProperties & PopupKnobStyle;
|
|
11
|
+
actionStyle?: CSSProperties & PopupKnobStyle;
|
|
12
|
+
closeStyle?: CSSProperties & PopupKnobStyle;
|
|
13
|
+
};
|
|
14
|
+
declare const toastManager: import("@base-ui/react").ToastManager<any>;
|
|
15
|
+
type ToastOptions = Omit<Parameters<typeof toastManager.add>[0], "title">;
|
|
16
|
+
declare const toast: ((title: ReactNode, options?: ToastOptions) => string) & {
|
|
17
|
+
success: (title: ReactNode, options?: ToastOptions) => string;
|
|
18
|
+
error: (title: ReactNode, options?: ToastOptions) => string;
|
|
19
|
+
warning: (title: ReactNode, options?: ToastOptions) => string;
|
|
20
|
+
info: (title: ReactNode, options?: ToastOptions) => string;
|
|
21
|
+
message: (title: ReactNode, options?: ToastOptions) => string;
|
|
22
|
+
promise: (...args: Parameters<typeof toastManager.promise>) => Promise<unknown>;
|
|
23
|
+
dismiss: (id?: string) => void;
|
|
24
|
+
};
|
|
25
|
+
declare const useToast: typeof Toast.useToastManager;
|
|
26
|
+
declare function Toaster({ className, timeout, limit, rootStyle, indicatorStyle, actionStyle, closeStyle }: ToasterProps): import("react").JSX.Element;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { Toaster, ToasterProps, toast, toastManager, useToast };
|
package/dist/ui/toast.js
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { skinEffects, skinId } from "../skin.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { Toast } from "@base-ui/react/toast";
|
|
6
|
+
//#region src/ui/toast.tsx
|
|
7
|
+
const toastManager = Toast.createToastManager();
|
|
8
|
+
function withType(type) {
|
|
9
|
+
return (title, options) => toastManager.add({
|
|
10
|
+
title,
|
|
11
|
+
type,
|
|
12
|
+
...options
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
const toast = Object.assign((title, options) => toastManager.add({
|
|
16
|
+
title,
|
|
17
|
+
...options
|
|
18
|
+
}), {
|
|
19
|
+
success: withType("success"),
|
|
20
|
+
error: withType("error"),
|
|
21
|
+
warning: withType("warning"),
|
|
22
|
+
info: withType("info"),
|
|
23
|
+
message: (title, options) => toastManager.add({
|
|
24
|
+
title,
|
|
25
|
+
...options
|
|
26
|
+
}),
|
|
27
|
+
promise: (...args) => toastManager.promise(...args),
|
|
28
|
+
dismiss: (id) => toastManager.close(id)
|
|
29
|
+
});
|
|
30
|
+
const useToast = Toast.useToastManager;
|
|
31
|
+
function ToastList({ rootStyle, indicatorStyle, actionStyle, closeStyle }) {
|
|
32
|
+
const { toasts } = Toast.useToastManager();
|
|
33
|
+
return toasts.map((entry) => {
|
|
34
|
+
return /* @__PURE__ */ jsx(Toast.Root, {
|
|
35
|
+
toast: entry,
|
|
36
|
+
"data-control-ui": "toast",
|
|
37
|
+
"data-control-family": "popup",
|
|
38
|
+
"data-popup-kind": "toast",
|
|
39
|
+
"data-popup-part": "surface",
|
|
40
|
+
"data-type": entry.type ?? "message",
|
|
41
|
+
style: rootStyle,
|
|
42
|
+
"data-slot": "root",
|
|
43
|
+
"data-surface": "floating",
|
|
44
|
+
className: cn("[--gap:0.75rem] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))]", "absolute right-0 bottom-0 left-auto z-[calc(1000-var(--toast-index))] h-[var(--height)] w-full select-none data-[expanded]:h-[var(--toast-height)]", "after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']"),
|
|
45
|
+
children: /* @__PURE__ */ jsxs(Toast.Content, {
|
|
46
|
+
"data-control-ui": "toast",
|
|
47
|
+
"data-control-family": "popup",
|
|
48
|
+
"data-popup-kind": "toast",
|
|
49
|
+
"data-slot": "content",
|
|
50
|
+
className: "flex items-start",
|
|
51
|
+
children: [
|
|
52
|
+
entry.type && entry.type !== "message" ? /* @__PURE__ */ jsx("span", {
|
|
53
|
+
"aria-hidden": "true",
|
|
54
|
+
"data-control-ui": "toast",
|
|
55
|
+
"data-control-family": "popup",
|
|
56
|
+
"data-popup-kind": "toast",
|
|
57
|
+
"data-slot": "indicator",
|
|
58
|
+
style: indicatorStyle,
|
|
59
|
+
className: "shrink-0"
|
|
60
|
+
}) : null,
|
|
61
|
+
/* @__PURE__ */ jsxs("div", {
|
|
62
|
+
className: "flex min-w-0 flex-1 flex-col",
|
|
63
|
+
children: [entry.title ? /* @__PURE__ */ jsx(Toast.Title, {
|
|
64
|
+
"data-control-ui": "toast",
|
|
65
|
+
"data-control-family": "popup",
|
|
66
|
+
"data-popup-kind": "toast",
|
|
67
|
+
"data-slot": "title"
|
|
68
|
+
}) : null, entry.description ? /* @__PURE__ */ jsx(Toast.Description, {
|
|
69
|
+
"data-control-ui": "toast",
|
|
70
|
+
"data-control-family": "popup",
|
|
71
|
+
"data-popup-kind": "toast",
|
|
72
|
+
"data-slot": "description"
|
|
73
|
+
}) : null]
|
|
74
|
+
}),
|
|
75
|
+
entry.actionProps ? /* @__PURE__ */ jsx(Toast.Action, {
|
|
76
|
+
"data-control-ui": "toast",
|
|
77
|
+
"data-control-family": "popup",
|
|
78
|
+
"data-popup-kind": "toast",
|
|
79
|
+
"data-slot": "action",
|
|
80
|
+
style: actionStyle,
|
|
81
|
+
className: "shrink-0 cursor-pointer"
|
|
82
|
+
}) : null,
|
|
83
|
+
/* @__PURE__ */ jsx(Toast.Close, {
|
|
84
|
+
"data-control-ui": "toast",
|
|
85
|
+
"data-control-family": "popup",
|
|
86
|
+
"data-popup-kind": "toast",
|
|
87
|
+
"data-slot": "close",
|
|
88
|
+
style: closeStyle,
|
|
89
|
+
"aria-label": "Close",
|
|
90
|
+
className: "shrink-0 cursor-pointer",
|
|
91
|
+
children: /* @__PURE__ */ jsx("svg", {
|
|
92
|
+
viewBox: "0 0 16 16",
|
|
93
|
+
className: "size-4",
|
|
94
|
+
"aria-hidden": "true",
|
|
95
|
+
fill: "none",
|
|
96
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
97
|
+
d: "M4 4 12 12M12 4 4 12",
|
|
98
|
+
stroke: "currentColor",
|
|
99
|
+
strokeWidth: "1.4",
|
|
100
|
+
strokeLinecap: "round"
|
|
101
|
+
})
|
|
102
|
+
})
|
|
103
|
+
})
|
|
104
|
+
]
|
|
105
|
+
})
|
|
106
|
+
}, entry.id);
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
function Toaster({ className, timeout, limit, rootStyle, indicatorStyle, actionStyle, closeStyle }) {
|
|
110
|
+
return /* @__PURE__ */ jsx(Toast.Provider, {
|
|
111
|
+
toastManager,
|
|
112
|
+
timeout,
|
|
113
|
+
limit,
|
|
114
|
+
children: /* @__PURE__ */ jsx(Toast.Portal, { children: /* @__PURE__ */ jsx(Toast.Viewport, {
|
|
115
|
+
"data-control-ui": "toast",
|
|
116
|
+
"data-control-family": "popup",
|
|
117
|
+
"data-popup-kind": "toast",
|
|
118
|
+
"data-slot": "viewport",
|
|
119
|
+
"data-skin": skinId(),
|
|
120
|
+
"data-effects": skinEffects(),
|
|
121
|
+
className: cn("fixed right-4 bottom-4 z-[95] mx-auto w-[calc(100vw-2rem)] sm:right-6 sm:bottom-6 sm:w-[22.5rem]", className),
|
|
122
|
+
children: /* @__PURE__ */ jsx(ToastList, {
|
|
123
|
+
rootStyle,
|
|
124
|
+
indicatorStyle,
|
|
125
|
+
actionStyle,
|
|
126
|
+
closeStyle
|
|
127
|
+
})
|
|
128
|
+
}) })
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
//#endregion
|
|
132
|
+
export { Toaster, toast, toastManager, useToast };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ControlledMultiChoice } from "../control-props.js";
|
|
2
|
+
import { ButtonProps } from "./button.js";
|
|
3
|
+
import { ComponentProps } from "react";
|
|
4
|
+
//#region src/ui/toggle.d.ts
|
|
5
|
+
type ToggleProps = Omit<ButtonProps, "render" | "nativeButton" | "value"> & {
|
|
6
|
+
pressed?: boolean;
|
|
7
|
+
defaultPressed?: boolean;
|
|
8
|
+
onPressedChange?: (pressed: boolean) => void;
|
|
9
|
+
value?: string;
|
|
10
|
+
showCheck?: boolean;
|
|
11
|
+
};
|
|
12
|
+
type ToggleGroupProps<TValue extends string = string> = Omit<ComponentProps<"div">, "defaultValue" | "onChange"> & ControlledMultiChoice<TValue> & {
|
|
13
|
+
multiple?: boolean;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
orientation?: "horizontal" | "vertical";
|
|
16
|
+
};
|
|
17
|
+
declare function Toggle({ variant, size, tone, active, showCheck, className, pressed, defaultPressed, onPressedChange, value, disabled, children, ...props }: ToggleProps): import("react").JSX.Element;
|
|
18
|
+
declare function ToggleGroup<TValue extends string = string>({ className, orientation, ...props }: ToggleGroupProps<TValue>): import("react").JSX.Element;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { Toggle, ToggleGroup, ToggleGroupProps, ToggleProps };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { buttonContentClasses, buttonStructureClasses } from "./button.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { Toggle as Toggle$1 } from "@base-ui/react/toggle";
|
|
6
|
+
import { ToggleGroup as ToggleGroup$1 } from "@base-ui/react/toggle-group";
|
|
7
|
+
//#region src/ui/toggle.tsx
|
|
8
|
+
function Toggle({ variant = "surface", size = "sm", tone = "neutral", active, showCheck = false, className, pressed, defaultPressed, onPressedChange, value, disabled, children, ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(Toggle$1, {
|
|
10
|
+
pressed,
|
|
11
|
+
defaultPressed,
|
|
12
|
+
onPressedChange,
|
|
13
|
+
value,
|
|
14
|
+
disabled,
|
|
15
|
+
render: (renderProps, state) => {
|
|
16
|
+
const isActive = active ?? state.pressed;
|
|
17
|
+
return /* @__PURE__ */ jsx("button", {
|
|
18
|
+
type: "button",
|
|
19
|
+
...renderProps,
|
|
20
|
+
"data-control-ui": "toggle",
|
|
21
|
+
"data-control-family": "button",
|
|
22
|
+
"data-slot": "root",
|
|
23
|
+
"data-control": "true",
|
|
24
|
+
"data-active": isActive ? "true" : void 0,
|
|
25
|
+
"data-variant": variant,
|
|
26
|
+
"data-tone": tone,
|
|
27
|
+
"data-size": size,
|
|
28
|
+
className: cn(buttonStructureClasses, renderProps.className, className),
|
|
29
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
30
|
+
"data-control-ui": "toggle",
|
|
31
|
+
"data-control-family": "button",
|
|
32
|
+
"data-slot": "content",
|
|
33
|
+
className: buttonContentClasses,
|
|
34
|
+
children: [showCheck ? /* @__PURE__ */ jsx("span", {
|
|
35
|
+
"data-control-ui": "toggle",
|
|
36
|
+
"data-slot": "check",
|
|
37
|
+
className: "flex size-3.5 shrink-0 items-center justify-center",
|
|
38
|
+
children: isActive ? /* @__PURE__ */ jsx("svg", {
|
|
39
|
+
viewBox: "0 0 12 12",
|
|
40
|
+
className: "size-3",
|
|
41
|
+
"aria-hidden": "true",
|
|
42
|
+
fill: "none",
|
|
43
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
44
|
+
d: "M2.5 6.5 5 9l4.5-5",
|
|
45
|
+
stroke: "currentColor",
|
|
46
|
+
strokeWidth: "1.4",
|
|
47
|
+
strokeLinecap: "round",
|
|
48
|
+
strokeLinejoin: "round"
|
|
49
|
+
})
|
|
50
|
+
}) : null
|
|
51
|
+
}) : null, renderProps.children]
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
...props,
|
|
56
|
+
children
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function ToggleGroup({ className, orientation = "horizontal", ...props }) {
|
|
60
|
+
return /* @__PURE__ */ jsx(ToggleGroup$1, {
|
|
61
|
+
"data-control-ui": "toggle",
|
|
62
|
+
"data-control-family": "button",
|
|
63
|
+
"data-slot": "group",
|
|
64
|
+
"data-orientation": orientation,
|
|
65
|
+
orientation,
|
|
66
|
+
className: cn("inline-flex items-center", orientation === "vertical" && "flex-col", className),
|
|
67
|
+
...props
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
export { Toggle, ToggleGroup };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ToolbarKnobStyle } from "../knob-contracts/toolbar-knobs.js";
|
|
2
|
+
import { CSSProperties, ComponentProps } from "react";
|
|
3
|
+
import { Toolbar as Toolbar$1 } from "@base-ui/react/toolbar";
|
|
4
|
+
//#region src/ui/toolbar.d.ts
|
|
5
|
+
type ToolbarVariant = "default" | "inverse";
|
|
6
|
+
type ToolbarLinkVariant = "default" | "track";
|
|
7
|
+
type ToolbarProps = Omit<ComponentProps<"div">, "style"> & {
|
|
8
|
+
orientation?: "horizontal" | "vertical";
|
|
9
|
+
variant?: ToolbarVariant;
|
|
10
|
+
style?: CSSProperties & ToolbarKnobStyle;
|
|
11
|
+
};
|
|
12
|
+
type ToolbarButtonProps = Omit<ComponentProps<"button">, "style"> & {
|
|
13
|
+
iconOnly?: boolean;
|
|
14
|
+
style?: CSSProperties & ToolbarKnobStyle;
|
|
15
|
+
};
|
|
16
|
+
type ToolbarLinkProps = Omit<ComponentProps<"a">, "style"> & {
|
|
17
|
+
variant?: ToolbarLinkVariant;
|
|
18
|
+
style?: CSSProperties & ToolbarKnobStyle;
|
|
19
|
+
};
|
|
20
|
+
type ToolbarGroupProps = ComponentProps<"div"> & {
|
|
21
|
+
style?: CSSProperties & ToolbarKnobStyle;
|
|
22
|
+
};
|
|
23
|
+
type ToolbarSeparatorProps = Omit<ComponentProps<"div">, "style"> & {
|
|
24
|
+
orientation?: "horizontal" | "vertical";
|
|
25
|
+
style?: CSSProperties & ToolbarKnobStyle;
|
|
26
|
+
};
|
|
27
|
+
type ToolbarInputProps = Omit<ComponentProps<"input">, "style"> & {
|
|
28
|
+
style?: CSSProperties & ToolbarKnobStyle;
|
|
29
|
+
};
|
|
30
|
+
declare function Toolbar({ orientation, variant, className, ...props }: ToolbarProps): import("react").JSX.Element;
|
|
31
|
+
type RefinedToolbarButtonProps = ToolbarButtonProps & Pick<ComponentProps<typeof Toolbar$1.Button>, "render">;
|
|
32
|
+
declare function ToolbarButton({ iconOnly, className, ...props }: RefinedToolbarButtonProps): import("react").JSX.Element;
|
|
33
|
+
type RefinedToolbarLinkProps = ToolbarLinkProps & Pick<ComponentProps<typeof Toolbar$1.Link>, "render">;
|
|
34
|
+
declare function ToolbarLink({ variant, className, ...props }: RefinedToolbarLinkProps): import("react").JSX.Element;
|
|
35
|
+
declare function ToolbarGroup({ className, ...props }: ToolbarGroupProps): import("react").JSX.Element;
|
|
36
|
+
declare function ToolbarSeparator({ orientation, className, ...props }: ToolbarSeparatorProps): import("react").JSX.Element;
|
|
37
|
+
type RefinedToolbarInputProps = ToolbarInputProps & Pick<ComponentProps<typeof Toolbar$1.Input>, "render">;
|
|
38
|
+
declare function ToolbarInput({ className, ...props }: RefinedToolbarInputProps): import("react").JSX.Element;
|
|
39
|
+
//#endregion
|
|
40
|
+
export { Toolbar, ToolbarButton, ToolbarButtonProps, ToolbarGroup, ToolbarGroupProps, ToolbarInput, ToolbarInputProps, ToolbarLink, ToolbarLinkProps, ToolbarLinkVariant, ToolbarProps, ToolbarSeparator, ToolbarSeparatorProps, ToolbarVariant };
|