@ctrl-ui/react 0.8.2 → 0.8.5
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 +32 -23
- package/dist/action-bar.d.ts +11 -12
- package/dist/activity.d.ts +24 -25
- package/dist/audio-recorder.d.ts +16 -16
- package/dist/audio-visualizer.d.ts +3 -4
- package/dist/audio-visualizer.js +1 -1
- package/dist/blocks/chat.d.ts +3 -4
- package/dist/blocks/chat.js +6 -3
- package/dist/blocks/coding-agent.d.ts +11 -12
- package/dist/blocks/coding-agent.js +10 -9
- package/dist/blocks/file-explorer-data.d.ts +11 -12
- package/dist/blocks/file-explorer.d.ts +3 -3
- package/dist/blocks/settings-data.d.ts +8 -9
- package/dist/blocks/settings.d.ts +4 -4
- package/dist/blocks/theme-toggle.d.ts +11 -12
- package/dist/blocks/theme-toggle.js +14 -4
- package/dist/chat-composer-attachment.d.ts +20 -21
- package/dist/chat-composer-attachment.js +24 -20
- package/dist/chat-composer-editor/extensions/mention.d.ts +5 -6
- package/dist/chat-composer-editor/extensions/mention.js +4 -0
- package/dist/chat-composer-editor/ghost.d.ts +3 -4
- package/dist/chat-composer-editor/schema.d.ts +2 -3
- package/dist/chat-composer-editor/serialize.d.ts +3 -4
- package/dist/chat-composer-editor/types.d.ts +5 -6
- package/dist/chat-composer-editor.d.ts +2 -3
- package/dist/chat-composer-editor.js +18 -4
- package/dist/chat-composer.d.ts +17 -18
- package/dist/chat-composer.js +14 -8
- package/dist/chat-layout.d.ts +17 -21
- package/dist/chat-layout.js +72 -86
- package/dist/chat-message.d.ts +19 -15
- package/dist/chat-message.js +19 -2
- package/dist/context-model.d.ts +7 -8
- package/dist/context.d.ts +21 -22
- package/dist/context.js +0 -2
- package/dist/control-props.d.ts +10 -11
- package/dist/control-variants.d.ts +6 -7
- package/dist/dynamic-notification-glass.d.ts +3 -4
- package/dist/dynamic-notification-liquid.d.ts +3 -4
- package/dist/dynamic-notification-siri-wave.d.ts +2 -3
- package/dist/dynamic-notification.d.ts +28 -29
- package/dist/email/email-brand.d.ts +60 -0
- package/dist/email/email-brand.js +101 -0
- package/dist/email/email-code.d.ts +18 -0
- package/dist/email/email-code.js +172 -0
- package/dist/email/email-footer.d.ts +63 -0
- package/dist/email/email-footer.js +98 -0
- package/dist/email/email.d.ts +62 -14
- package/dist/email/email.js +155 -24
- package/dist/email/length.d.ts +2 -3
- package/dist/email/templates.d.ts +56 -12
- package/dist/email/templates.js +314 -116
- package/dist/email/theme.d.ts +15 -8
- package/dist/email/theme.js +30 -8
- package/dist/environment-variables.d.ts +35 -36
- package/dist/extensions/create-track-highlight.d.ts +3 -4
- package/dist/extensions/supports-anchor-transitions.d.ts +2 -3
- package/dist/extensions/track-highlight.d.ts +3 -4
- package/dist/hooks/use-audio-recorder.d.ts +14 -15
- package/dist/hooks/use-chat-composer.d.ts +5 -6
- package/dist/hooks/use-chat-message.d.ts +8 -8
- package/dist/hooks/use-chat-message.js +1 -0
- package/dist/hooks/use-chat-thread-scroll.d.ts +8 -0
- package/dist/hooks/use-chat-thread-scroll.js +66 -0
- package/dist/hooks/use-color-area.d.ts +5 -6
- package/dist/hooks/use-copy-to-clipboard.d.ts +7 -8
- package/dist/hooks/use-dropzone.d.ts +11 -12
- package/dist/hooks/use-dynamic-notification.d.ts +6 -7
- package/dist/hooks/use-environment-variables.d.ts +9 -10
- package/dist/hooks/use-keyboard-navigation.d.ts +3 -0
- package/dist/hooks/use-keyboard-navigation.js +22 -0
- package/dist/hooks/use-mobile.d.ts +2 -3
- package/dist/hooks/use-textarea-trigger-menu.d.ts +2 -3
- package/dist/hooks/use-trigger-menu.d.ts +7 -8
- package/dist/hooks/use-user-ask.d.ts +11 -10
- package/dist/hooks/use-user-ask.js +56 -17
- package/dist/inline-attachment.d.ts +16 -17
- package/dist/inline-attachment.js +1 -1
- package/dist/inline-citation.d.ts +22 -23
- package/dist/knob-contracts/accordion-knobs.d.ts +3 -4
- package/dist/knob-contracts/accordion-knobs.js +1 -0
- package/dist/knob-contracts/action-bar-knobs.d.ts +3 -4
- package/dist/knob-contracts/action-bar-knobs.js +1 -1
- package/dist/knob-contracts/activity-knobs.d.ts +3 -4
- package/dist/knob-contracts/activity-knobs.js +2 -1
- package/dist/knob-contracts/alert-knobs.d.ts +3 -4
- package/dist/knob-contracts/alert-knobs.js +12 -1
- package/dist/knob-contracts/audio-recorder-knobs.d.ts +3 -4
- package/dist/knob-contracts/audio-visualizer-knobs.d.ts +3 -4
- package/dist/knob-contracts/audio-visualizer-knobs.js +1 -0
- package/dist/knob-contracts/avatar-knobs.d.ts +3 -4
- package/dist/knob-contracts/avatar-knobs.js +2 -1
- package/dist/knob-contracts/badge-knobs.d.ts +3 -4
- package/dist/knob-contracts/button-group-knobs.d.ts +3 -4
- package/dist/knob-contracts/button-knobs.d.ts +3 -4
- package/dist/knob-contracts/button-knobs.js +1 -0
- package/dist/knob-contracts/calendar-knobs.d.ts +3 -4
- package/dist/knob-contracts/card-knobs.d.ts +3 -4
- package/dist/knob-contracts/chat-composer-attachment-knobs.d.ts +3 -4
- package/dist/knob-contracts/chat-composer-attachment-knobs.js +5 -1
- package/dist/knob-contracts/chat-composer-knobs.d.ts +3 -4
- package/dist/knob-contracts/chat-composer-knobs.js +2 -0
- package/dist/knob-contracts/chat-layout-knobs.d.ts +3 -4
- package/dist/knob-contracts/chat-layout-knobs.js +2 -2
- package/dist/knob-contracts/chat-message-knobs.d.ts +3 -4
- package/dist/knob-contracts/chat-message-knobs.js +3 -1
- package/dist/knob-contracts/choice-knobs.d.ts +3 -4
- package/dist/knob-contracts/choice-knobs.js +2 -1
- package/dist/knob-contracts/code-diff-knobs.d.ts +3 -4
- package/dist/knob-contracts/code-diff-knobs.js +1 -0
- package/dist/knob-contracts/code-knobs.d.ts +3 -4
- package/dist/knob-contracts/code-knobs.js +3 -1
- package/dist/knob-contracts/collapsible-knobs.d.ts +3 -4
- package/dist/knob-contracts/color-picker-knobs.d.ts +3 -4
- package/dist/knob-contracts/context-knobs.d.ts +3 -4
- package/dist/knob-contracts/context-knobs.js +3 -0
- package/dist/knob-contracts/dockable-panel-knobs.d.ts +3 -4
- package/dist/knob-contracts/dockable-panel-knobs.js +1 -0
- package/dist/knob-contracts/dropzone-knobs.d.ts +3 -4
- package/dist/knob-contracts/dropzone-knobs.js +1 -0
- package/dist/knob-contracts/dynamic-notification-knobs.d.ts +3 -4
- package/dist/knob-contracts/empty-knobs.d.ts +3 -4
- package/dist/knob-contracts/empty-knobs.js +14 -1
- package/dist/knob-contracts/environment-variables-knobs.d.ts +3 -4
- package/dist/knob-contracts/environment-variables-knobs.js +2 -1
- package/dist/knob-contracts/field-knobs.d.ts +3 -4
- package/dist/knob-contracts/gradient-editor-knobs.d.ts +3 -4
- package/dist/knob-contracts/gradient-editor-knobs.js +3 -1
- package/dist/knob-contracts/infinite-canvas-knobs.d.ts +3 -4
- package/dist/knob-contracts/inline-attachment-knobs.d.ts +3 -4
- package/dist/knob-contracts/inline-attachment-knobs.js +6 -1
- package/dist/knob-contracts/inline-citation-knobs.d.ts +3 -4
- package/dist/knob-contracts/inline-citation-knobs.js +4 -1
- package/dist/knob-contracts/item-knobs.d.ts +3 -4
- package/dist/knob-contracts/kbd-knobs.d.ts +3 -4
- package/dist/knob-contracts/markdown-block-knobs.d.ts +3 -4
- package/dist/knob-contracts/markdown-block-knobs.js +2 -0
- package/dist/knob-contracts/markdown-knobs.d.ts +3 -4
- package/dist/knob-contracts/markdown-knobs.js +1 -0
- package/dist/knob-contracts/morphing-panel-knobs.d.ts +3 -4
- package/dist/knob-contracts/page-layout-knobs.d.ts +4 -0
- package/dist/knob-contracts/page-layout-knobs.js +15 -0
- package/dist/knob-contracts/pagination-knobs.d.ts +3 -4
- package/dist/knob-contracts/phone-input-knobs.d.ts +3 -4
- package/dist/knob-contracts/phone-input-knobs.js +1 -0
- package/dist/knob-contracts/popup-knobs.d.ts +3 -4
- package/dist/knob-contracts/progressive-blur-knobs.d.ts +3 -4
- package/dist/knob-contracts/progressive-blur-knobs.js +1 -0
- package/dist/knob-contracts/range-knobs.d.ts +3 -4
- package/dist/knob-contracts/resizable-knobs.d.ts +3 -4
- package/dist/knob-contracts/resizable-knobs.js +1 -0
- package/dist/knob-contracts/rich-tooltip-knobs.d.ts +3 -4
- package/dist/knob-contracts/scroll-area-knobs.d.ts +3 -4
- package/dist/knob-contracts/separator-knobs.d.ts +3 -4
- package/dist/knob-contracts/sidebar-knobs.d.ts +3 -4
- package/dist/knob-contracts/sidebar-knobs.js +1 -0
- package/dist/knob-contracts/skeleton-knobs.d.ts +3 -4
- package/dist/knob-contracts/skeleton-knobs.js +9 -1
- package/dist/knob-contracts/source-badge-knobs.d.ts +3 -4
- package/dist/knob-contracts/spinner-knobs.d.ts +3 -4
- package/dist/knob-contracts/stepper-knobs.d.ts +3 -4
- package/dist/knob-contracts/stepper-knobs.js +1 -0
- package/dist/knob-contracts/switch-knobs.d.ts +3 -4
- package/dist/knob-contracts/switch-knobs.js +7 -1
- package/dist/knob-contracts/table-knobs.d.ts +3 -4
- package/dist/knob-contracts/table-of-contents-knobs.d.ts +3 -4
- package/dist/knob-contracts/table-of-contents-knobs.js +25 -0
- package/dist/knob-contracts/tabs-knobs.d.ts +3 -4
- package/dist/knob-contracts/tabs-knobs.js +2 -1
- package/dist/knob-contracts/task-list-knobs.d.ts +3 -4
- package/dist/knob-contracts/task-list-knobs.js +5 -0
- package/dist/knob-contracts/thread-rail-knobs.d.ts +3 -4
- package/dist/knob-contracts/timeline-knobs.d.ts +3 -4
- package/dist/knob-contracts/toolbar-knobs.d.ts +3 -4
- package/dist/knob-contracts/toolbar-knobs.js +1 -0
- package/dist/knob-contracts/track-highlight-knobs.d.ts +3 -4
- package/dist/knob-contracts/transcript-divider-knobs.d.ts +3 -4
- package/dist/knob-contracts/tree-knobs.d.ts +3 -4
- package/dist/knob-contracts/user-ask-knobs.d.ts +3 -4
- package/dist/knob-contracts/user-ask-knobs.js +5 -0
- package/dist/lib/cn.d.ts +2 -3
- package/dist/lib/code-tokens.d.ts +12 -13
- package/dist/lib/color.d.ts +26 -27
- package/dist/lib/contrast.d.ts +12 -13
- package/dist/lib/diff.d.ts +14 -15
- package/dist/lib/dropzone-validation.d.ts +25 -26
- package/dist/lib/env-file.d.ts +12 -13
- package/dist/lib/format-audio-recorder-duration.d.ts +2 -3
- package/dist/lib/liquid-glass-optics.d.ts +2 -3
- package/dist/lib/phone-input-format.d.ts +3 -4
- package/dist/lib/phone-number.d.ts +8 -9
- package/dist/lib/trigger-detect.d.ts +4 -5
- package/dist/markdown-block.d.ts +11 -12
- package/dist/markdown-block.js +1 -1
- package/dist/scripts/contrast-eval.d.ts +16 -17
- package/dist/scripts/contrast-eval.js +13 -7
- package/dist/skin-provider.d.ts +14 -0
- package/dist/skin-provider.js +21 -0
- package/dist/skin.d.ts +14 -33
- package/dist/skin.js +3 -46
- package/dist/source-badge.d.ts +7 -8
- package/dist/styles/index.css +3 -5
- package/dist/styles/recipes/accordion.css +8 -2
- package/dist/styles/recipes/action-bar.css +40 -5
- package/dist/styles/recipes/activity.css +36 -3
- package/dist/styles/recipes/alert.css +97 -16
- package/dist/styles/recipes/audio-visualizer.css +8 -1
- package/dist/styles/recipes/avatar.css +17 -1
- package/dist/styles/recipes/badge.css +0 -1
- package/dist/styles/recipes/button-group.css +8 -0
- package/dist/styles/recipes/button.css +49 -8
- package/dist/styles/recipes/calendar.css +21 -6
- package/dist/styles/recipes/card.css +2 -0
- package/dist/styles/recipes/chat-composer-attachment.css +83 -54
- package/dist/styles/recipes/chat-composer.css +41 -22
- package/dist/styles/recipes/chat-layout.css +37 -54
- package/dist/styles/recipes/chat-message.css +78 -5
- package/dist/styles/recipes/choice.css +21 -2
- package/dist/styles/recipes/code-diff.css +9 -1
- package/dist/styles/recipes/code.css +64 -17
- package/dist/styles/recipes/collapsible.css +0 -3
- package/dist/styles/recipes/color-picker-details.css +1 -2
- package/dist/styles/recipes/color-picker-values.css +0 -4
- package/dist/styles/recipes/context.css +30 -18
- package/dist/styles/recipes/dockable-panel.css +8 -1
- package/dist/styles/recipes/dropzone.css +9 -2
- package/dist/styles/recipes/dynamic-notification-input.css +6 -0
- package/dist/styles/recipes/dynamic-notification.css +1 -0
- package/dist/styles/recipes/empty.css +118 -17
- package/dist/styles/recipes/environment-variables.css +9 -1
- package/dist/styles/recipes/field-parts.css +3 -6
- package/dist/styles/recipes/field.css +15 -5
- package/dist/styles/recipes/gradient-editor.css +33 -5
- package/dist/styles/recipes/inline-attachment.css +68 -20
- package/dist/styles/recipes/inline-citation.css +52 -10
- package/dist/styles/recipes/item.css +4 -2
- package/dist/styles/recipes/kbd.css +8 -0
- package/dist/styles/recipes/markdown-block.css +17 -2
- package/dist/styles/recipes/markdown.css +19 -0
- package/dist/styles/recipes/morphing-panel.css +1 -1
- package/dist/styles/recipes/page-layout.css +203 -0
- package/dist/styles/recipes/pagination.css +16 -4
- package/dist/styles/recipes/phone-input.css +8 -4
- package/dist/styles/recipes/popup-drawer.css +3 -1
- package/dist/styles/recipes/popup-lists.css +11 -0
- package/dist/styles/recipes/popup-toast.css +3 -29
- package/dist/styles/recipes/popup.css +10 -14
- package/dist/styles/recipes/progressive-blur.css +28 -7
- package/dist/styles/recipes/range.css +74 -3
- package/dist/styles/recipes/resizable.css +8 -10
- package/dist/styles/recipes/rich-tooltip.css +1 -4
- package/dist/styles/recipes/scroll-area.css +8 -2
- package/dist/styles/recipes/sidebar-menu.css +0 -6
- package/dist/styles/recipes/sidebar.css +56 -17
- package/dist/styles/recipes/skeleton.css +85 -3
- package/dist/styles/recipes/source-badge.css +20 -3
- package/dist/styles/recipes/stepper.css +8 -1
- package/dist/styles/recipes/switch.css +89 -17
- package/dist/styles/recipes/table-of-contents.css +211 -45
- package/dist/styles/recipes/table.css +0 -1
- package/dist/styles/recipes/tabs.css +35 -2
- package/dist/styles/recipes/task-list.css +68 -9
- package/dist/styles/recipes/thread-rail.css +19 -17
- package/dist/styles/recipes/toolbar.css +39 -4
- package/dist/styles/recipes/track-highlight.css +63 -5
- package/dist/styles/recipes/transcript-divider.css +1 -0
- package/dist/styles/recipes/tree.css +2 -0
- package/dist/styles/recipes/user-ask.css +65 -18
- package/dist/styles/theme.css +164 -138
- package/dist/surface-variants.d.ts +4 -5
- package/dist/task-list.d.ts +16 -17
- package/dist/thread-rail.d.ts +21 -22
- package/dist/thread-rail.js +1 -1
- package/dist/transcript-divider.d.ts +6 -7
- package/dist/ui/accordion.d.ts +10 -11
- package/dist/ui/alert-dialog.d.ts +11 -12
- package/dist/ui/alert-dialog.js +9 -7
- package/dist/ui/alert.d.ts +9 -10
- package/dist/ui/alert.js +3 -3
- package/dist/ui/aspect-ratio.d.ts +3 -4
- package/dist/ui/autocomplete.d.ts +19 -20
- package/dist/ui/autocomplete.js +6 -4
- package/dist/ui/avatar.d.ts +9 -10
- package/dist/ui/badge.d.ts +9 -10
- package/dist/ui/button-group.d.ts +7 -8
- package/dist/ui/button-group.js +3 -2
- package/dist/ui/button.d.ts +17 -18
- package/dist/ui/button.js +20 -5
- package/dist/ui/calendar.d.ts +3 -4
- package/dist/ui/card.d.ts +16 -17
- package/dist/ui/checkbox-group.d.ts +4 -5
- package/dist/ui/checkbox-group.js +3 -2
- package/dist/ui/checkbox.d.ts +3 -4
- package/dist/ui/code-diff.d.ts +8 -9
- package/dist/ui/code.d.ts +32 -23
- package/dist/ui/code.js +41 -20
- package/dist/ui/collapsible.d.ts +7 -8
- package/dist/ui/color-picker.d.ts +40 -41
- package/dist/ui/color-picker.js +8 -6
- package/dist/ui/combobox-disabled-selection.d.ts +3 -4
- package/dist/ui/combobox.d.ts +19 -20
- package/dist/ui/combobox.js +6 -4
- package/dist/ui/command.d.ts +22 -19
- package/dist/ui/command.js +63 -13
- package/dist/ui/context-menu.d.ts +30 -31
- package/dist/ui/context-menu.js +10 -7
- package/dist/ui/dialog.d.ts +13 -13
- package/dist/ui/dialog.js +11 -9
- package/dist/ui/dockable-panel-geometry.d.ts +7 -8
- package/dist/ui/dockable-panel.d.ts +21 -22
- package/dist/ui/drawer.d.ts +17 -18
- package/dist/ui/drawer.js +9 -8
- package/dist/ui/dropdown-menu.d.ts +32 -33
- package/dist/ui/dropdown-menu.js +6 -4
- package/dist/ui/dropzone.d.ts +24 -24
- package/dist/ui/dropzone.js +4 -1
- package/dist/ui/empty.d.ts +14 -14
- package/dist/ui/empty.js +3 -3
- package/dist/ui/field.d.ts +26 -27
- package/dist/ui/form.d.ts +4 -5
- package/dist/ui/gradient-editor.d.ts +16 -17
- package/dist/ui/gradient-editor.js +2 -2
- package/dist/ui/hover-card.d.ts +6 -7
- package/dist/ui/hover-card.js +6 -4
- package/dist/ui/infinite-canvas.d.ts +11 -12
- package/dist/ui/infinite-canvas.js +1 -0
- package/dist/ui/input-group.d.ts +6 -7
- package/dist/ui/input-otp.d.ts +7 -8
- package/dist/ui/input.d.ts +3 -4
- package/dist/ui/item.d.ts +20 -21
- package/dist/ui/kbd.d.ts +7 -5
- package/dist/ui/kbd.js +4 -2
- package/dist/ui/markdown-elements.d.ts +20 -21
- package/dist/ui/markdown.d.ts +5 -6
- package/dist/ui/menubar.d.ts +25 -26
- package/dist/ui/menubar.js +10 -7
- package/dist/ui/meter.d.ts +11 -12
- package/dist/ui/morphing-panel.d.ts +8 -9
- package/dist/ui/native-select.d.ts +3 -4
- package/dist/ui/native-select.js +1 -1
- package/dist/ui/navigation-menu.d.ts +17 -18
- package/dist/ui/navigation-menu.js +6 -4
- package/dist/ui/number-field.d.ts +15 -16
- package/dist/ui/number-field.js +1 -1
- package/dist/ui/page-layout.d.ts +44 -0
- package/dist/ui/page-layout.js +108 -0
- package/dist/ui/pagination.d.ts +10 -11
- package/dist/ui/phone-input.d.ts +5 -6
- package/dist/ui/phone-input.js +39 -36
- package/dist/ui/popover.d.ts +11 -12
- package/dist/ui/popover.js +6 -4
- package/dist/ui/progress.d.ts +11 -12
- package/dist/ui/progressive-blur.d.ts +4 -5
- package/dist/ui/radio-group.d.ts +5 -6
- package/dist/ui/resizable.d.ts +12 -13
- package/dist/ui/resizable.js +1 -1
- package/dist/ui/responsive-dialog.d.ts +11 -12
- package/dist/ui/rich-tooltip-tour.d.ts +5 -6
- package/dist/ui/rich-tooltip.d.ts +21 -23
- package/dist/ui/rich-tooltip.js +6 -6
- package/dist/ui/scroll-area.d.ts +7 -8
- package/dist/ui/scroll-area.js +9 -6
- package/dist/ui/select.d.ts +21 -14
- package/dist/ui/select.js +8 -5
- package/dist/ui/separator.d.ts +2 -3
- package/dist/ui/sheet.d.ts +8 -9
- package/dist/ui/sheet.js +9 -7
- package/dist/ui/sidebar-menu.d.ts +18 -19
- package/dist/ui/sidebar-menu.js +4 -3
- package/dist/ui/sidebar-provider.d.ts +32 -7
- package/dist/ui/sidebar-provider.js +82 -22
- package/dist/ui/sidebar-resize-rail.d.ts +8 -0
- package/dist/ui/sidebar-resize-rail.js +192 -0
- package/dist/ui/sidebar.d.ts +19 -13
- package/dist/ui/sidebar.js +120 -55
- package/dist/ui/skeleton.d.ts +7 -4
- package/dist/ui/skeleton.js +9 -2
- package/dist/ui/slider.d.ts +6 -5
- package/dist/ui/slider.js +16 -13
- package/dist/ui/spinner.d.ts +3 -4
- package/dist/ui/stepper.d.ts +22 -23
- package/dist/ui/switch.d.ts +3 -4
- package/dist/ui/switch.js +12 -1
- package/dist/ui/table-of-contents.d.ts +7 -8
- package/dist/ui/table-of-contents.js +4 -2
- package/dist/ui/table.d.ts +17 -18
- package/dist/ui/tabs.d.ts +14 -11
- package/dist/ui/textarea.d.ts +3 -4
- package/dist/ui/timeline.d.ts +18 -19
- package/dist/ui/toast.d.ts +9 -9
- package/dist/ui/toast.js +23 -16
- package/dist/ui/toggle.d.ts +5 -6
- package/dist/ui/toggle.js +3 -2
- package/dist/ui/toolbar.d.ts +15 -16
- package/dist/ui/toolbar.js +15 -4
- package/dist/ui/tooltip.d.ts +6 -13
- package/dist/ui/tooltip.js +8 -9
- package/dist/ui/tree.d.ts +18 -19
- package/dist/ui/tree.js +3 -2
- package/dist/ui/trigger-menu.d.ts +15 -16
- package/dist/ui/trigger-menu.js +6 -4
- package/dist/ui/use-switch-drag.d.ts +7 -0
- package/dist/ui/use-switch-drag.js +104 -0
- package/dist/user-ask.d.ts +28 -27
- package/dist/user-ask.js +38 -13
- package/package.json +17 -16
- package/dist/code-block-editor.d.ts +0 -59
- package/dist/code-block-editor.js +0 -250
- package/dist/knob-contracts/code-block-editor-knobs.d.ts +0 -5
- package/dist/knob-contracts/code-block-editor-knobs.js +0 -11
- package/dist/lib/code-block-shiki.d.ts +0 -9
- package/dist/lib/code-block-shiki.js +0 -6
- package/dist/skin.config.d.ts +0 -5
- package/dist/skin.config.js +0 -12
- package/dist/styles/recipes/code-block-editor.css +0 -136
- package/dist/styles/skin-theme.css +0 -137
- package/dist/styles/skin.css +0 -143
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { ControlledMultiChoice, HoverIndicator } from "../control-props.js";
|
|
2
2
|
import { ComponentProps } from "react";
|
|
3
3
|
//#region src/ui/checkbox-group.d.ts
|
|
4
|
-
type CheckboxGroupProps = Omit<ComponentProps<"div">, "defaultValue" | "onChange"> & ControlledMultiChoice & {
|
|
4
|
+
export type CheckboxGroupProps = Omit<ComponentProps<"div">, "defaultValue" | "onChange"> & ControlledMultiChoice & {
|
|
5
5
|
allValues?: string[];
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
orientation?: "horizontal" | "vertical";
|
|
8
8
|
indicator?: HoverIndicator;
|
|
9
9
|
};
|
|
10
|
-
declare function CheckboxGroup({ className, orientation, indicator, children, ...props }: CheckboxGroupProps): import("react").JSX.Element;
|
|
11
|
-
declare function CheckboxGroupItem({ className, htmlFor, children, ...props }: ComponentProps<"label">): import("react").JSX.Element;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { CheckboxGroup, CheckboxGroupItem, CheckboxGroupProps };
|
|
10
|
+
export declare function CheckboxGroup({ className, orientation, indicator, children, ...props }: CheckboxGroupProps): import("react").JSX.Element;
|
|
11
|
+
export declare function CheckboxGroupItem({ className, htmlFor, children, ...props }: ComponentProps<"label">): import("react").JSX.Element;
|
|
12
|
+
//#endregion
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
|
-
import {
|
|
3
|
+
import { useSkin } from "../skin-provider.js";
|
|
4
4
|
import { TrackHighlight } from "../extensions/track-highlight.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { CheckboxGroup as CheckboxGroup$1 } from "@base-ui/react/checkbox-group";
|
|
7
7
|
//#region src/ui/checkbox-group.tsx
|
|
8
8
|
function CheckboxGroup({ className, orientation = "vertical", indicator, children, ...props }) {
|
|
9
|
-
const
|
|
9
|
+
const skin = useSkin();
|
|
10
|
+
const resolvedIndicator = indicator ?? skin.indicators?.["checkbox-group"] ?? "none";
|
|
10
11
|
return /* @__PURE__ */ jsxs(CheckboxGroup$1, {
|
|
11
12
|
"data-control-ui": "checkbox-group",
|
|
12
13
|
"data-control-family": "checkbox-group",
|
package/dist/ui/checkbox.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChoiceKnobStyle } from "../knob-contracts/choice-knobs.js";
|
|
2
2
|
import { CSSProperties } from "react";
|
|
3
3
|
//#region src/ui/checkbox.d.ts
|
|
4
|
-
type CheckboxProps = Omit<{
|
|
4
|
+
export type CheckboxProps = Omit<{
|
|
5
5
|
checked?: boolean;
|
|
6
6
|
defaultChecked?: boolean;
|
|
7
7
|
onCheckedChange?: (checked: boolean) => void;
|
|
@@ -18,6 +18,5 @@ type CheckboxProps = Omit<{
|
|
|
18
18
|
}, "style"> & {
|
|
19
19
|
style?: CSSProperties & ChoiceKnobStyle;
|
|
20
20
|
};
|
|
21
|
-
declare function Checkbox({ className, checked, defaultChecked, onCheckedChange, indeterminate, disabled, readOnly, required, name, value, id, ...props }: CheckboxProps): import("react").JSX.Element;
|
|
22
|
-
//#endregion
|
|
23
|
-
export { Checkbox, CheckboxProps };
|
|
21
|
+
export declare function Checkbox({ className, checked, defaultChecked, onCheckedChange, indeterminate, disabled, readOnly, required, name, value, id, ...props }: CheckboxProps): import("react").JSX.Element;
|
|
22
|
+
//#endregion
|
package/dist/ui/code-diff.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ import { CodeDiffKnobStyle } from "../knob-contracts/code-diff-knobs.js";
|
|
|
2
2
|
import { CodeCopyProps, CodeOverflow } from "./code.js";
|
|
3
3
|
import { CSSProperties, ComponentProps, ReactNode } from "react";
|
|
4
4
|
//#region src/ui/code-diff.d.ts
|
|
5
|
-
type DiffStyle = "unified" | "split";
|
|
6
|
-
type DiffIndicators = "classic" | "bars" | "none";
|
|
7
|
-
type DiffLineKind = "word" | "char" | "none";
|
|
8
|
-
type CodeDiffProps = Omit<ComponentProps<"figure">, "children" | "style"> & {
|
|
5
|
+
export type DiffStyle = "unified" | "split";
|
|
6
|
+
export type DiffIndicators = "classic" | "bars" | "none";
|
|
7
|
+
export type DiffLineKind = "word" | "char" | "none";
|
|
8
|
+
export type CodeDiffProps = Omit<ComponentProps<"figure">, "children" | "style"> & {
|
|
9
9
|
patch?: string;
|
|
10
10
|
oldText?: string;
|
|
11
11
|
newText?: string;
|
|
@@ -21,8 +21,7 @@ type CodeDiffProps = Omit<ComponentProps<"figure">, "children" | "style"> & {
|
|
|
21
21
|
children?: ReactNode;
|
|
22
22
|
style?: CSSProperties & CodeDiffKnobStyle;
|
|
23
23
|
};
|
|
24
|
-
declare function CodeDiff({ patch, oldText, newText, lang, name, diffStyle, diffIndicators, lineDiffType, overflow, maxLineDiffLength, maxHeight, header, className, style, ...props }: CodeDiffProps): import("react").JSX.Element;
|
|
25
|
-
type CodeDiffCopyProps = CodeCopyProps;
|
|
26
|
-
declare function CodeDiffCopy(props: CodeDiffCopyProps): import("react").JSX.Element;
|
|
27
|
-
//#endregion
|
|
28
|
-
export { CodeDiff, CodeDiffCopy, CodeDiffCopyProps, CodeDiffProps, DiffIndicators, DiffLineKind, DiffStyle };
|
|
24
|
+
export declare function CodeDiff({ patch, oldText, newText, lang, name, diffStyle, diffIndicators, lineDiffType, overflow, maxLineDiffLength, maxHeight, header, className, style, ...props }: CodeDiffProps): import("react").JSX.Element;
|
|
25
|
+
export type CodeDiffCopyProps = CodeCopyProps;
|
|
26
|
+
export declare function CodeDiffCopy(props: CodeDiffCopyProps): import("react").JSX.Element;
|
|
27
|
+
//#endregion
|
package/dist/ui/code.d.ts
CHANGED
|
@@ -3,60 +3,69 @@ import { CodeKnobStyle } from "../knob-contracts/code-knobs.js";
|
|
|
3
3
|
import { CodeTokenLines } from "../lib/code-tokens.js";
|
|
4
4
|
import { CSSProperties, ComponentProps, ReactNode } from "react";
|
|
5
5
|
//#region src/ui/code.d.ts
|
|
6
|
-
type CodeOverflow = "wrap" | "scroll";
|
|
7
|
-
type CodeHighlight = "auto" | "none";
|
|
8
|
-
type CodeDensity = "default" | "compact";
|
|
9
|
-
type CodeChrome = "standalone" | "embedded";
|
|
10
|
-
type CodeProps = Omit<ComponentProps<"figure">, "style"> & {
|
|
6
|
+
export type CodeOverflow = "wrap" | "scroll";
|
|
7
|
+
export type CodeHighlight = "auto" | "none";
|
|
8
|
+
export type CodeDensity = "default" | "compact";
|
|
9
|
+
export type CodeChrome = "standalone" | "embedded";
|
|
10
|
+
export type CodeProps = Omit<ComponentProps<"figure">, "style"> & {
|
|
11
11
|
overflow?: CodeOverflow;
|
|
12
12
|
chrome?: CodeChrome;
|
|
13
13
|
density?: CodeDensity;
|
|
14
|
+
/** A headerless surface overlays its own copy button; turn it off to place one yourself. */
|
|
15
|
+
copy?: boolean;
|
|
14
16
|
style?: CSSProperties & CodeKnobStyle;
|
|
15
17
|
};
|
|
16
|
-
declare function Code({ overflow, chrome, density, className, children, ...props }: CodeProps): import("react").JSX.Element;
|
|
17
|
-
type CodeHeaderProps = Omit<ComponentProps<"figcaption">, "style"> & {
|
|
18
|
+
export declare function Code({ overflow, chrome, density, copy, className, children, ...props }: CodeProps): import("react").JSX.Element;
|
|
19
|
+
export type CodeHeaderProps = Omit<ComponentProps<"figcaption">, "style"> & {
|
|
18
20
|
style?: CSSProperties & CodeKnobStyle;
|
|
19
21
|
};
|
|
20
|
-
declare function CodeHeader({ className, ...props }: CodeHeaderProps): import("react").JSX.Element;
|
|
21
|
-
type CodeTitleProps = Omit<ComponentProps<"span">, "style"> & {
|
|
22
|
+
export declare function CodeHeader({ className, ...props }: CodeHeaderProps): import("react").JSX.Element;
|
|
23
|
+
export type CodeTitleProps = Omit<ComponentProps<"span">, "style"> & {
|
|
22
24
|
style?: CSSProperties & CodeKnobStyle;
|
|
23
25
|
};
|
|
24
|
-
declare function CodeTitle({ className, ...props }: CodeTitleProps): import("react").JSX.Element;
|
|
25
|
-
type CodeActionsProps = ComponentProps<"div"> & {
|
|
26
|
+
export declare function CodeTitle({ className, ...props }: CodeTitleProps): import("react").JSX.Element;
|
|
27
|
+
export type CodeActionsProps = ComponentProps<"div"> & {
|
|
26
28
|
style?: CSSProperties & CodeKnobStyle;
|
|
27
29
|
};
|
|
28
|
-
declare function CodeActions({ className, ...props }: CodeActionsProps): import("react").JSX.Element;
|
|
29
|
-
type CodeCopyProps = Omit<ComponentProps<typeof Button>, "children" | "onClick"> & {
|
|
30
|
+
export declare function CodeActions({ className, ...props }: CodeActionsProps): import("react").JSX.Element;
|
|
31
|
+
export type CodeCopyProps = Omit<ComponentProps<typeof Button>, "children" | "onClick"> & {
|
|
30
32
|
value: string;
|
|
31
33
|
children?: ReactNode;
|
|
32
34
|
copiedLabel?: ReactNode;
|
|
33
35
|
copiedAriaLabel?: string;
|
|
34
36
|
};
|
|
35
|
-
declare function CodeCopy({ value, copiedLabel, copiedAriaLabel, children, className, "aria-label": ariaLabel, ...props }: CodeCopyProps): import("react").JSX.Element;
|
|
36
|
-
type CodeFloatingCopyProps = Omit<CodeCopyProps, "children" | "copiedLabel">;
|
|
37
|
-
declare function CodeFloatingCopy({ className, ...props }: CodeFloatingCopyProps): import("react").JSX.Element;
|
|
38
|
-
|
|
39
|
-
declare function useCodeTokens({ code, lang, tokens, highlight }: {
|
|
37
|
+
export declare function CodeCopy({ value, copiedLabel, copiedAriaLabel, children, className, "aria-label": ariaLabel, ...props }: CodeCopyProps): import("react").JSX.Element;
|
|
38
|
+
export type CodeFloatingCopyProps = Omit<CodeCopyProps, "children" | "copiedLabel">;
|
|
39
|
+
export declare function CodeFloatingCopy({ className, ...props }: CodeFloatingCopyProps): import("react").JSX.Element;
|
|
40
|
+
export declare function useCodeTokens({ code, lang, tokens, highlight }: {
|
|
40
41
|
code: string;
|
|
41
42
|
lang?: string;
|
|
42
43
|
tokens?: CodeTokenLines | null;
|
|
43
44
|
highlight: CodeHighlight;
|
|
44
45
|
}): CodeTokenLines | null;
|
|
45
|
-
declare function CodeTokenLine({ tokens, plain }: {
|
|
46
|
+
export declare function CodeTokenLine({ tokens, plain }: {
|
|
46
47
|
tokens: CodeTokenLines[number] | null;
|
|
47
48
|
plain: string;
|
|
48
49
|
}): ReactNode;
|
|
49
|
-
type CodeContentProps = Omit<ComponentProps<"div">, "children" | "style"> & {
|
|
50
|
+
export type CodeContentProps = Omit<ComponentProps<"div">, "children" | "style"> & {
|
|
50
51
|
code: string;
|
|
51
52
|
lang?: string;
|
|
52
53
|
tokens?: CodeTokenLines | null;
|
|
53
54
|
highlight?: CodeHighlight;
|
|
54
55
|
showLineNumbers?: boolean;
|
|
55
56
|
startLine?: number;
|
|
57
|
+
highlightLines?: readonly number[];
|
|
56
58
|
maxHeight?: string;
|
|
57
59
|
virtualize?: boolean;
|
|
58
60
|
style?: CSSProperties & CodeKnobStyle;
|
|
59
61
|
};
|
|
60
|
-
declare function CodeContent({ code, lang, tokens, highlight, showLineNumbers, startLine, maxHeight, virtualize, className, ref, style, ...props }: CodeContentProps): import("react").JSX.Element;
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
export declare function CodeContent({ code, lang, tokens, highlight, showLineNumbers, startLine, highlightLines, maxHeight, virtualize, className, ref, style, ...props }: CodeContentProps): import("react").JSX.Element;
|
|
63
|
+
export type CodeEditableProps = Omit<ComponentProps<"textarea">, "defaultValue" | "value" | "style"> & {
|
|
64
|
+
value?: string;
|
|
65
|
+
defaultValue?: string;
|
|
66
|
+
onValueChange?: (value: string) => void;
|
|
67
|
+
fileName?: string;
|
|
68
|
+
style?: CSSProperties & CodeKnobStyle;
|
|
69
|
+
};
|
|
70
|
+
export declare function CodeEditable({ value, defaultValue, onValueChange, onChange, fileName, className, "aria-label": ariaLabel, ...props }: CodeEditableProps): import("react").JSX.Element;
|
|
71
|
+
//#endregion
|
package/dist/ui/code.js
CHANGED
|
@@ -4,13 +4,13 @@ import { cn } from "../lib/cn.js";
|
|
|
4
4
|
import { Button } from "./button.js";
|
|
5
5
|
import { ScrollArea } from "./scroll-area.js";
|
|
6
6
|
import { highlightToTokens } from "../lib/code-tokens.js";
|
|
7
|
-
import { Tooltip, TooltipContent,
|
|
7
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip.js";
|
|
8
8
|
import { Children, createContext, isValidElement, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
9
9
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { CheckIcon, CopyIcon } from "lucide-react";
|
|
11
11
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
12
12
|
//#region src/ui/code.tsx
|
|
13
|
-
const
|
|
13
|
+
const MAX_STATIC_CODE_LINES = 1e3;
|
|
14
14
|
const ESTIMATED_LINE_HEIGHT = 20;
|
|
15
15
|
const CodeContext = createContext(null);
|
|
16
16
|
function useCodeContext() {
|
|
@@ -21,14 +21,15 @@ function useCodeContext() {
|
|
|
21
21
|
function hasCodeHeader(children) {
|
|
22
22
|
return Children.toArray(children).some((child) => isValidElement(child) && child.type === CodeHeader);
|
|
23
23
|
}
|
|
24
|
-
function Code({ overflow = "scroll", chrome = "standalone", density = "default", className, children, ...props }) {
|
|
24
|
+
function Code({ overflow = "scroll", chrome = "standalone", density = "default", copy = true, className, children, ...props }) {
|
|
25
25
|
const hasHeader = hasCodeHeader(children);
|
|
26
26
|
return /* @__PURE__ */ jsx(CodeContext.Provider, {
|
|
27
27
|
value: {
|
|
28
28
|
chrome,
|
|
29
29
|
density,
|
|
30
30
|
overflow,
|
|
31
|
-
hasHeader
|
|
31
|
+
hasHeader,
|
|
32
|
+
copy
|
|
32
33
|
},
|
|
33
34
|
children: /* @__PURE__ */ jsx("figure", {
|
|
34
35
|
"data-control-ui": "code",
|
|
@@ -95,13 +96,10 @@ function CodeCopy({ value, copiedLabel, copiedAriaLabel = "Copied", children, cl
|
|
|
95
96
|
})
|
|
96
97
|
});
|
|
97
98
|
if (!isIconOnly) return button;
|
|
98
|
-
return /* @__PURE__ */ jsx(
|
|
99
|
-
|
|
100
|
-
children:
|
|
101
|
-
|
|
102
|
-
children: label
|
|
103
|
-
})] })
|
|
104
|
-
});
|
|
99
|
+
return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: button }), /* @__PURE__ */ jsx(TooltipContent, {
|
|
100
|
+
side: "left",
|
|
101
|
+
children: label
|
|
102
|
+
})] });
|
|
105
103
|
}
|
|
106
104
|
function CodeFloatingCopy({ className, ...props }) {
|
|
107
105
|
return /* @__PURE__ */ jsx(CodeCopy, {
|
|
@@ -110,7 +108,6 @@ function CodeFloatingCopy({ className, ...props }) {
|
|
|
110
108
|
...props
|
|
111
109
|
});
|
|
112
110
|
}
|
|
113
|
-
/** Null until resolved, and whenever highlighting is off or language is unknown — callers fall back to plain text. */
|
|
114
111
|
function useCodeTokens({ code, lang, tokens, highlight }) {
|
|
115
112
|
const requestKey = `${lang ?? ""}\n${code}`;
|
|
116
113
|
const [clientTokens, setClientTokens] = useState(null);
|
|
@@ -152,13 +149,14 @@ function CodeTokenLine({ tokens, plain }) {
|
|
|
152
149
|
}, index);
|
|
153
150
|
});
|
|
154
151
|
}
|
|
155
|
-
function CodeRow({ index, number, tokens, plain, overflow, showLineNumbers, measureRef, style }) {
|
|
152
|
+
function CodeRow({ index, number, tokens, plain, overflow, showLineNumbers, highlighted, measureRef, style }) {
|
|
156
153
|
return /* @__PURE__ */ jsxs("div", {
|
|
157
154
|
ref: measureRef,
|
|
158
155
|
"data-index": index,
|
|
159
156
|
"data-control-ui": "code",
|
|
160
157
|
"data-control-family": "code",
|
|
161
158
|
"data-slot": "line",
|
|
159
|
+
"data-highlighted": highlighted ? "true" : void 0,
|
|
162
160
|
className: "flex w-full",
|
|
163
161
|
style,
|
|
164
162
|
children: [showLineNumbers ? /* @__PURE__ */ jsx("span", {
|
|
@@ -177,8 +175,8 @@ function CodeRow({ index, number, tokens, plain, overflow, showLineNumbers, meas
|
|
|
177
175
|
})]
|
|
178
176
|
});
|
|
179
177
|
}
|
|
180
|
-
function CodeContent({ code, lang, tokens, highlight = "auto", showLineNumbers = false, startLine = 1, maxHeight = "32rem", virtualize, className, ref, style, ...props }) {
|
|
181
|
-
const {
|
|
178
|
+
function CodeContent({ code, lang, tokens, highlight = "auto", showLineNumbers = false, startLine = 1, highlightLines, maxHeight = "32rem", virtualize, className, ref, style, ...props }) {
|
|
179
|
+
const { density, overflow, hasHeader, copy } = useCodeContext();
|
|
182
180
|
const resolvedTokens = useCodeTokens({
|
|
183
181
|
code,
|
|
184
182
|
lang,
|
|
@@ -186,6 +184,7 @@ function CodeContent({ code, lang, tokens, highlight = "auto", showLineNumbers =
|
|
|
186
184
|
highlight
|
|
187
185
|
});
|
|
188
186
|
const plainLines = useMemo(() => code.split("\n"), [code]);
|
|
187
|
+
const highlightedLineNumbers = new Set(highlightLines);
|
|
189
188
|
const isCompact = density === "compact";
|
|
190
189
|
const scrollRef = useRef(null);
|
|
191
190
|
function setScrollElement(node) {
|
|
@@ -193,7 +192,7 @@ function CodeContent({ code, lang, tokens, highlight = "auto", showLineNumbers =
|
|
|
193
192
|
if (typeof ref === "function") ref(node);
|
|
194
193
|
else if (ref) ref.current = node;
|
|
195
194
|
}
|
|
196
|
-
const shouldVirtualize = virtualize ?? plainLines.length >
|
|
195
|
+
const shouldVirtualize = virtualize ?? plainLines.length > MAX_STATIC_CODE_LINES;
|
|
197
196
|
const useScrollArea = density !== "compact" || overflow !== "wrap";
|
|
198
197
|
const virtualizer = useVirtualizer({
|
|
199
198
|
count: plainLines.length,
|
|
@@ -229,6 +228,7 @@ function CodeContent({ code, lang, tokens, highlight = "auto", showLineNumbers =
|
|
|
229
228
|
plain: plainLines[item.index] ?? "",
|
|
230
229
|
overflow,
|
|
231
230
|
showLineNumbers,
|
|
231
|
+
highlighted: highlightedLineNumbers.has(startLine + item.index),
|
|
232
232
|
measureRef: virtualizer.measureElement,
|
|
233
233
|
style: {
|
|
234
234
|
position: "absolute",
|
|
@@ -250,7 +250,8 @@ function CodeContent({ code, lang, tokens, highlight = "auto", showLineNumbers =
|
|
|
250
250
|
tokens: resolvedTokens?.[index] ?? null,
|
|
251
251
|
plain,
|
|
252
252
|
overflow,
|
|
253
|
-
showLineNumbers
|
|
253
|
+
showLineNumbers,
|
|
254
|
+
highlighted: highlightedLineNumbers.has(startLine + index)
|
|
254
255
|
}, index))
|
|
255
256
|
});
|
|
256
257
|
const content = useScrollArea ? /* @__PURE__ */ jsx(ScrollArea, {
|
|
@@ -278,15 +279,35 @@ function CodeContent({ code, lang, tokens, highlight = "auto", showLineNumbers =
|
|
|
278
279
|
...props,
|
|
279
280
|
children: grid
|
|
280
281
|
});
|
|
281
|
-
if (hasHeader ||
|
|
282
|
+
if (hasHeader || !copy) return content;
|
|
282
283
|
return /* @__PURE__ */ jsxs("div", {
|
|
283
284
|
"data-control-ui": "code",
|
|
284
285
|
"data-control-family": "code",
|
|
285
286
|
"data-slot": "floating-frame",
|
|
286
|
-
"data-density": isCompact ? "compact" : "default",
|
|
287
287
|
className: "relative",
|
|
288
288
|
children: [/* @__PURE__ */ jsx(CodeFloatingCopy, { value: code }), content]
|
|
289
289
|
});
|
|
290
290
|
}
|
|
291
|
+
function CodeEditable({ value, defaultValue = "", onValueChange, onChange, fileName, className, "aria-label": ariaLabel, ...props }) {
|
|
292
|
+
const { overflow } = useCodeContext();
|
|
293
|
+
const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);
|
|
294
|
+
const currentValue = value ?? uncontrolledValue;
|
|
295
|
+
function handleChange(event) {
|
|
296
|
+
if (value === void 0) setUncontrolledValue(event.target.value);
|
|
297
|
+
onValueChange?.(event.target.value);
|
|
298
|
+
onChange?.(event);
|
|
299
|
+
}
|
|
300
|
+
return /* @__PURE__ */ jsx("textarea", {
|
|
301
|
+
"data-control-ui": "code",
|
|
302
|
+
"data-control-family": "code",
|
|
303
|
+
"data-slot": "editor",
|
|
304
|
+
value: currentValue,
|
|
305
|
+
onChange: handleChange,
|
|
306
|
+
"aria-label": ariaLabel ?? (fileName ? `${fileName} code` : "Code editor"),
|
|
307
|
+
spellCheck: false,
|
|
308
|
+
className: cn("block w-full max-w-full resize-y overflow-auto", overflow === "scroll" ? "whitespace-pre" : "whitespace-pre-wrap break-words", className),
|
|
309
|
+
...props
|
|
310
|
+
});
|
|
311
|
+
}
|
|
291
312
|
//#endregion
|
|
292
|
-
export { Code, CodeActions, CodeContent, CodeCopy, CodeFloatingCopy, CodeHeader, CodeTitle, CodeTokenLine, useCodeTokens };
|
|
313
|
+
export { Code, CodeActions, CodeContent, CodeCopy, CodeEditable, CodeFloatingCopy, CodeHeader, CodeTitle, CodeTokenLine, useCodeTokens };
|
package/dist/ui/collapsible.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { OpenChangeEventDetails, RenderProp } from "../control-props.js";
|
|
|
2
2
|
import { CollapsibleKnobStyle } from "../knob-contracts/collapsible-knobs.js";
|
|
3
3
|
import { CSSProperties, ComponentProps, ReactNode } from "react";
|
|
4
4
|
//#region src/ui/collapsible.d.ts
|
|
5
|
-
type CollapsibleProps = Omit<ComponentProps<"div">, "onChange"> & {
|
|
5
|
+
export type CollapsibleProps = Omit<ComponentProps<"div">, "onChange"> & {
|
|
6
6
|
open?: boolean;
|
|
7
7
|
defaultOpen?: boolean;
|
|
8
8
|
onOpenChange?: (open: boolean, eventDetails: OpenChangeEventDetails) => void;
|
|
@@ -10,7 +10,7 @@ type CollapsibleProps = Omit<ComponentProps<"div">, "onChange"> & {
|
|
|
10
10
|
} & {
|
|
11
11
|
style?: CSSProperties & CollapsibleKnobStyle;
|
|
12
12
|
};
|
|
13
|
-
type CollapsibleTriggerProps = Omit<ComponentProps<"button">, "style"> & {
|
|
13
|
+
export type CollapsibleTriggerProps = Omit<ComponentProps<"button">, "style"> & {
|
|
14
14
|
"data-slot"?: string;
|
|
15
15
|
render?: RenderProp<ComponentProps<"button">, {
|
|
16
16
|
open: boolean;
|
|
@@ -18,14 +18,13 @@ type CollapsibleTriggerProps = Omit<ComponentProps<"button">, "style"> & {
|
|
|
18
18
|
nativeButton?: boolean;
|
|
19
19
|
style?: CSSProperties & CollapsibleKnobStyle;
|
|
20
20
|
};
|
|
21
|
-
type CollapsibleContentProps = ComponentProps<"div"> & {
|
|
21
|
+
export type CollapsibleContentProps = ComponentProps<"div"> & {
|
|
22
22
|
"data-slot"?: string;
|
|
23
23
|
keepMounted?: boolean;
|
|
24
24
|
} & {
|
|
25
25
|
style?: CSSProperties & CollapsibleKnobStyle;
|
|
26
26
|
};
|
|
27
|
-
declare function Collapsible({ className, ...props }: CollapsibleProps): import("react").JSX.Element;
|
|
28
|
-
declare function CollapsibleTrigger({ render, className, children, ...props }: CollapsibleTriggerProps): import("react").JSX.Element;
|
|
29
|
-
declare function CollapsibleContent({ className, children, ...props }: CollapsibleContentProps): import("react").JSX.Element;
|
|
30
|
-
//#endregion
|
|
31
|
-
export { Collapsible, CollapsibleContent, CollapsibleContentProps, CollapsibleProps, CollapsibleTrigger, CollapsibleTriggerProps };
|
|
27
|
+
export declare function Collapsible({ className, ...props }: CollapsibleProps): import("react").JSX.Element;
|
|
28
|
+
export declare function CollapsibleTrigger({ render, className, children, ...props }: CollapsibleTriggerProps): import("react").JSX.Element;
|
|
29
|
+
export declare function CollapsibleContent({ className, children, ...props }: CollapsibleContentProps): import("react").JSX.Element;
|
|
30
|
+
//#endregion
|
|
@@ -5,8 +5,8 @@ import { PopupKnobStyle } from "../knob-contracts/popup-knobs.js";
|
|
|
5
5
|
import { ColorPickerKnobStyle } from "../knob-contracts/color-picker-knobs.js";
|
|
6
6
|
import { CSSProperties, ComponentProps, ReactNode } from "react";
|
|
7
7
|
//#region src/ui/color-picker.d.ts
|
|
8
|
-
type ColorFormat = "hex" | "rgb" | "hsl" | "oklch";
|
|
9
|
-
type ColorPickerProps = {
|
|
8
|
+
export type ColorFormat = "hex" | "rgb" | "hsl" | "oklch";
|
|
9
|
+
export type ColorPickerProps = {
|
|
10
10
|
value?: string;
|
|
11
11
|
defaultValue?: string;
|
|
12
12
|
onValueChange?: (value: string) => void;
|
|
@@ -20,43 +20,43 @@ type ColorPickerProps = {
|
|
|
20
20
|
onOpenChange?: (open: boolean, eventDetails: OpenChangeEventDetails) => void;
|
|
21
21
|
children?: ReactNode;
|
|
22
22
|
};
|
|
23
|
-
type ColorPickerTriggerProps = Omit<ComponentProps<"button">, "style"> & {
|
|
23
|
+
export type ColorPickerTriggerProps = Omit<ComponentProps<"button">, "style"> & {
|
|
24
24
|
style?: CSSProperties & ColorPickerKnobStyle;
|
|
25
25
|
};
|
|
26
|
-
type ColorPickerContentProps = Omit<ComponentProps<"div">, "style"> & {
|
|
26
|
+
export type ColorPickerContentProps = Omit<ComponentProps<"div">, "style"> & {
|
|
27
27
|
style?: CSSProperties & PopupKnobStyle;
|
|
28
28
|
} & {
|
|
29
29
|
side?: "top" | "right" | "bottom" | "left";
|
|
30
30
|
align?: "start" | "center" | "end";
|
|
31
31
|
sideOffset?: number;
|
|
32
32
|
};
|
|
33
|
-
type ColorPickerPanelProps = Omit<ComponentProps<"div">, "style"> & {
|
|
33
|
+
export type ColorPickerPanelProps = Omit<ComponentProps<"div">, "style"> & {
|
|
34
34
|
style?: CSSProperties & PopupKnobStyle;
|
|
35
35
|
};
|
|
36
|
-
type ColorPickerAreaProps = Omit<ComponentProps<"div">, "style"> & {
|
|
36
|
+
export type ColorPickerAreaProps = Omit<ComponentProps<"div">, "style"> & {
|
|
37
37
|
style?: CSSProperties & ColorPickerKnobStyle;
|
|
38
38
|
};
|
|
39
|
-
type ColorPickerAreaThumbProps = Omit<ComponentProps<"div">, "style"> & {
|
|
39
|
+
export type ColorPickerAreaThumbProps = Omit<ComponentProps<"div">, "style"> & {
|
|
40
40
|
style?: CSSProperties & ColorPickerKnobStyle;
|
|
41
41
|
};
|
|
42
|
-
type ColorPickerHueProps = Omit<Pick<ComponentProps<"div">, "className" | "aria-label" | "aria-labelledby" | "style">, "style"> & {
|
|
42
|
+
export type ColorPickerHueProps = Omit<Pick<ComponentProps<"div">, "className" | "aria-label" | "aria-labelledby" | "style">, "style"> & {
|
|
43
43
|
style?: CSSProperties & ColorPickerKnobStyle;
|
|
44
44
|
};
|
|
45
|
-
type ColorPickerAlphaProps = Omit<Pick<ComponentProps<"div">, "className" | "aria-label" | "aria-labelledby" | "style">, "style"> & {
|
|
45
|
+
export type ColorPickerAlphaProps = Omit<Pick<ComponentProps<"div">, "className" | "aria-label" | "aria-labelledby" | "style">, "style"> & {
|
|
46
46
|
style?: CSSProperties & ColorPickerKnobStyle;
|
|
47
47
|
};
|
|
48
|
-
type ColorPickerWheelProps = Omit<ComponentProps<"div">, "style"> & {
|
|
48
|
+
export type ColorPickerWheelProps = Omit<ComponentProps<"div">, "style"> & {
|
|
49
49
|
style?: CSSProperties & ColorPickerKnobStyle;
|
|
50
50
|
};
|
|
51
|
-
type ColorPickerEyeDropperProps = Omit<Omit<ComponentProps<"button">, "onError">, "style"> & {
|
|
51
|
+
export type ColorPickerEyeDropperProps = Omit<Omit<ComponentProps<"button">, "onError">, "style"> & {
|
|
52
52
|
style?: CSSProperties & ButtonKnobStyle;
|
|
53
53
|
};
|
|
54
|
-
type ColorPickerInputProps = Omit<Omit<ComponentProps<"input">, "value" | "defaultValue" | "onChange" | "size">, "style"> & {
|
|
54
|
+
export type ColorPickerInputProps = Omit<Omit<ComponentProps<"input">, "value" | "defaultValue" | "onChange" | "size">, "style"> & {
|
|
55
55
|
style?: CSSProperties & ColorPickerKnobStyle;
|
|
56
56
|
} & {
|
|
57
57
|
size?: ControlSize;
|
|
58
58
|
};
|
|
59
|
-
type ColorPickerFormatSelectProps = {
|
|
59
|
+
export type ColorPickerFormatSelectProps = {
|
|
60
60
|
formats?: ColorFormat[];
|
|
61
61
|
size?: ControlSize;
|
|
62
62
|
className?: string;
|
|
@@ -64,38 +64,38 @@ type ColorPickerFormatSelectProps = {
|
|
|
64
64
|
"aria-labelledby"?: string;
|
|
65
65
|
style?: CSSProperties & ButtonKnobStyle;
|
|
66
66
|
};
|
|
67
|
-
type ColorPickerChannelsProps = ComponentProps<"div"> & {
|
|
67
|
+
export type ColorPickerChannelsProps = ComponentProps<"div"> & {
|
|
68
68
|
style?: CSSProperties & ColorPickerKnobStyle;
|
|
69
69
|
};
|
|
70
|
-
type ColorPickerChannelProps = Omit<Omit<ComponentProps<"div">, "children" | "aria-label">, "style"> & {
|
|
70
|
+
export type ColorPickerChannelProps = Omit<Omit<ComponentProps<"div">, "children" | "aria-label">, "style"> & {
|
|
71
71
|
style?: CSSProperties & ColorPickerKnobStyle;
|
|
72
72
|
} & {
|
|
73
73
|
channel: "r" | "g" | "b" | "h" | "s" | "l" | "okl" | "okc" | "okh" | "a";
|
|
74
74
|
label?: ReactNode;
|
|
75
75
|
"aria-label"?: string;
|
|
76
76
|
};
|
|
77
|
-
type ColorPickerSwatchesProps = ComponentProps<"div"> & {
|
|
77
|
+
export type ColorPickerSwatchesProps = ComponentProps<"div"> & {
|
|
78
78
|
colors?: string[];
|
|
79
79
|
label?: ReactNode;
|
|
80
80
|
} & {
|
|
81
81
|
style?: CSSProperties & ColorPickerKnobStyle;
|
|
82
82
|
};
|
|
83
|
-
type ColorPickerSwatchProps = Omit<Omit<ComponentProps<"button">, "color">, "style"> & {
|
|
83
|
+
export type ColorPickerSwatchProps = Omit<Omit<ComponentProps<"button">, "color">, "style"> & {
|
|
84
84
|
style?: CSSProperties & ColorPickerKnobStyle;
|
|
85
85
|
} & {
|
|
86
86
|
color: string;
|
|
87
87
|
};
|
|
88
|
-
type ColorPickerSwatchAddProps = Omit<Omit<ComponentProps<"button">, "onClick">, "style"> & {
|
|
88
|
+
export type ColorPickerSwatchAddProps = Omit<Omit<ComponentProps<"button">, "onClick">, "style"> & {
|
|
89
89
|
style?: CSSProperties & ColorPickerKnobStyle;
|
|
90
90
|
} & {
|
|
91
91
|
onAdd?: (value: string) => void;
|
|
92
92
|
};
|
|
93
|
-
type ColorPickerContrastProps = Omit<Omit<ComponentProps<"div">, "children">, "style"> & {
|
|
93
|
+
export type ColorPickerContrastProps = Omit<Omit<ComponentProps<"div">, "children">, "style"> & {
|
|
94
94
|
style?: CSSProperties & ColorPickerKnobStyle;
|
|
95
95
|
} & {
|
|
96
96
|
background?: string;
|
|
97
97
|
};
|
|
98
|
-
type ColorPickerOutputProps = Omit<Omit<ComponentProps<"div">, "children">, "style"> & {
|
|
98
|
+
export type ColorPickerOutputProps = Omit<Omit<ComponentProps<"div">, "children">, "style"> & {
|
|
99
99
|
style?: CSSProperties & ColorPickerKnobStyle;
|
|
100
100
|
} & {
|
|
101
101
|
children?: ReactNode;
|
|
@@ -103,19 +103,19 @@ type ColorPickerOutputProps = Omit<Omit<ComponentProps<"div">, "children">, "sty
|
|
|
103
103
|
value: string;
|
|
104
104
|
}) => ReactNode;
|
|
105
105
|
};
|
|
106
|
-
declare function ColorPicker({ open, defaultOpen, onOpenChange, children, ...state }: ColorPickerProps): import("react").JSX.Element;
|
|
107
|
-
declare function ColorPickerTrigger({ className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: ColorPickerTriggerProps): import("react").JSX.Element;
|
|
108
|
-
declare function ColorPickerContent({ className, children, side, align, sideOffset, ...props }: ColorPickerContentProps): import("react").JSX.Element;
|
|
109
|
-
declare function ColorPickerPanel({ className, children, ...props }: ColorPickerPanelProps): import("react").JSX.Element;
|
|
110
|
-
declare function ColorPickerArea({ className, style, ...props }: ColorPickerAreaProps): import("react").JSX.Element;
|
|
111
|
-
declare function ColorPickerAreaThumb({ className, ...props }: ColorPickerAreaThumbProps): import("react").JSX.Element;
|
|
112
|
-
declare function ColorPickerHue({ className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: ColorPickerHueProps): import("react").JSX.Element;
|
|
113
|
-
declare function ColorPickerAlpha({ className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: ColorPickerAlphaProps): import("react").JSX.Element | null;
|
|
114
|
-
declare function ColorPickerWheel({ className, style, ...props }: ColorPickerWheelProps): import("react").JSX.Element;
|
|
115
|
-
declare function ColorPickerInput({ size, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: ColorPickerInputProps): import("react").JSX.Element;
|
|
116
|
-
declare function ColorPickerFormatSelect({ formats, size, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, style }: ColorPickerFormatSelectProps): import("react").JSX.Element;
|
|
117
|
-
declare function ColorPickerChannels({ className, children, ...props }: ColorPickerChannelsProps): import("react").JSX.Element;
|
|
118
|
-
declare function ColorPickerChannel({ channel, label, className, "aria-label": ariaLabel, ...props }: ColorPickerChannelProps): import("react").JSX.Element | null;
|
|
106
|
+
export declare function ColorPicker({ open, defaultOpen, onOpenChange, children, ...state }: ColorPickerProps): import("react").JSX.Element;
|
|
107
|
+
export declare function ColorPickerTrigger({ className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: ColorPickerTriggerProps): import("react").JSX.Element;
|
|
108
|
+
export declare function ColorPickerContent({ className, children, side, align, sideOffset, ...props }: ColorPickerContentProps): import("react").JSX.Element;
|
|
109
|
+
export declare function ColorPickerPanel({ className, children, ...props }: ColorPickerPanelProps): import("react").JSX.Element;
|
|
110
|
+
export declare function ColorPickerArea({ className, style, ...props }: ColorPickerAreaProps): import("react").JSX.Element;
|
|
111
|
+
export declare function ColorPickerAreaThumb({ className, ...props }: ColorPickerAreaThumbProps): import("react").JSX.Element;
|
|
112
|
+
export declare function ColorPickerHue({ className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: ColorPickerHueProps): import("react").JSX.Element;
|
|
113
|
+
export declare function ColorPickerAlpha({ className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: ColorPickerAlphaProps): import("react").JSX.Element | null;
|
|
114
|
+
export declare function ColorPickerWheel({ className, style, ...props }: ColorPickerWheelProps): import("react").JSX.Element;
|
|
115
|
+
export declare function ColorPickerInput({ size, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: ColorPickerInputProps): import("react").JSX.Element;
|
|
116
|
+
export declare function ColorPickerFormatSelect({ formats, size, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, style }: ColorPickerFormatSelectProps): import("react").JSX.Element;
|
|
117
|
+
export declare function ColorPickerChannels({ className, children, ...props }: ColorPickerChannelsProps): import("react").JSX.Element;
|
|
118
|
+
export declare function ColorPickerChannel({ channel, label, className, "aria-label": ariaLabel, ...props }: ColorPickerChannelProps): import("react").JSX.Element | null;
|
|
119
119
|
declare global {
|
|
120
120
|
interface Window {
|
|
121
121
|
EyeDropper?: {
|
|
@@ -127,11 +127,10 @@ declare global {
|
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
declare function ColorPickerEyeDropper({ className, children, ...props }: ColorPickerEyeDropperProps): import("react").JSX.Element | null;
|
|
131
|
-
declare function ColorPickerSwatches({ colors, label, className, children, ...props }: ColorPickerSwatchesProps): import("react").JSX.Element;
|
|
132
|
-
declare function ColorPickerSwatch({ color, className, "aria-label": ariaLabel, ...props }: ColorPickerSwatchProps): import("react").JSX.Element;
|
|
133
|
-
declare function ColorPickerSwatchAdd({ onAdd, className, children, ...props }: ColorPickerSwatchAddProps): import("react").JSX.Element;
|
|
134
|
-
declare function ColorPickerContrast({ background, className, ...props }: ColorPickerContrastProps): import("react").JSX.Element | null;
|
|
135
|
-
declare function ColorPickerOutput({ className, children, renderValue, ...props }: ColorPickerOutputProps): import("react").JSX.Element;
|
|
136
|
-
//#endregion
|
|
137
|
-
export { ColorFormat, ColorPicker, ColorPickerAlpha, ColorPickerAlphaProps, ColorPickerArea, ColorPickerAreaProps, ColorPickerAreaThumb, ColorPickerAreaThumbProps, ColorPickerChannel, ColorPickerChannelProps, ColorPickerChannels, ColorPickerChannelsProps, ColorPickerContent, ColorPickerContentProps, ColorPickerContrast, ColorPickerContrastProps, ColorPickerEyeDropper, ColorPickerEyeDropperProps, ColorPickerFormatSelect, ColorPickerFormatSelectProps, ColorPickerHue, ColorPickerHueProps, ColorPickerInput, ColorPickerInputProps, ColorPickerOutput, ColorPickerOutputProps, ColorPickerPanel, ColorPickerPanelProps, ColorPickerProps, ColorPickerSwatch, ColorPickerSwatchAdd, ColorPickerSwatchAddProps, ColorPickerSwatchProps, ColorPickerSwatches, ColorPickerSwatchesProps, ColorPickerTrigger, ColorPickerTriggerProps, ColorPickerWheel, ColorPickerWheelProps };
|
|
130
|
+
export declare function ColorPickerEyeDropper({ className, children, ...props }: ColorPickerEyeDropperProps): import("react").JSX.Element | null;
|
|
131
|
+
export declare function ColorPickerSwatches({ colors, label, className, children, ...props }: ColorPickerSwatchesProps): import("react").JSX.Element;
|
|
132
|
+
export declare function ColorPickerSwatch({ color, className, "aria-label": ariaLabel, ...props }: ColorPickerSwatchProps): import("react").JSX.Element;
|
|
133
|
+
export declare function ColorPickerSwatchAdd({ onAdd, className, children, ...props }: ColorPickerSwatchAddProps): import("react").JSX.Element;
|
|
134
|
+
export declare function ColorPickerContrast({ background, className, ...props }: ColorPickerContrastProps): import("react").JSX.Element | null;
|
|
135
|
+
export declare function ColorPickerOutput({ className, children, renderValue, ...props }: ColorPickerOutputProps): import("react").JSX.Element;
|
|
136
|
+
//#endregion
|
package/dist/ui/color-picker.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
|
-
import {
|
|
3
|
+
import { controlEffectsAttribute } from "../skin.js";
|
|
4
|
+
import { useSkin } from "../skin-provider.js";
|
|
4
5
|
import { Button } from "./button.js";
|
|
5
6
|
import { Input } from "./input.js";
|
|
6
7
|
import { formatColor, getChannels, hsvaToRgba, parseColor, pointToHueSat, pointToSaturationValue, setChannel } from "../lib/color.js";
|
|
@@ -179,17 +180,18 @@ function ColorPickerTrigger({ className, "aria-label": ariaLabel, "aria-labelled
|
|
|
179
180
|
});
|
|
180
181
|
}
|
|
181
182
|
function ColorPickerContent({ className, children, side = "bottom", align = "center", sideOffset = 6, ...props }) {
|
|
183
|
+
const skin = useSkin();
|
|
182
184
|
return /* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsx(Popover.Positioner, {
|
|
183
185
|
"data-control-ui": "color-picker",
|
|
184
186
|
"data-popup-kind": "color-picker",
|
|
185
187
|
"data-control-family": "popup",
|
|
186
188
|
"data-slot": "positioner",
|
|
187
|
-
"data-skin":
|
|
188
|
-
"data-effects":
|
|
189
|
+
"data-skin": skin.id,
|
|
190
|
+
"data-effects": controlEffectsAttribute(skin.effects),
|
|
189
191
|
side,
|
|
190
192
|
align,
|
|
191
193
|
sideOffset,
|
|
192
|
-
className: "z-
|
|
194
|
+
className: "z-(--z-popup)",
|
|
193
195
|
children: /* @__PURE__ */ jsx(Popover.Popup, {
|
|
194
196
|
"data-control-ui": "color-picker",
|
|
195
197
|
"data-popup-kind": "color-picker",
|
|
@@ -324,7 +326,7 @@ function ColorPickerHue({ className, "aria-label": ariaLabel, "aria-labelledby":
|
|
|
324
326
|
step: 1,
|
|
325
327
|
disabled,
|
|
326
328
|
onValueChange: (next) => setHsva({ h: Array.isArray(next) ? next[0] : next }),
|
|
327
|
-
className: cn("relative flex w-full touch-
|
|
329
|
+
className: cn("relative flex w-full touch-pan-y select-none items-center", className),
|
|
328
330
|
...props,
|
|
329
331
|
children: /* @__PURE__ */ jsx(Slider.Control, {
|
|
330
332
|
className: "flex h-full w-full items-center",
|
|
@@ -363,7 +365,7 @@ function ColorPickerAlpha({ className, "aria-label": ariaLabel, "aria-labelledby
|
|
|
363
365
|
step: .01,
|
|
364
366
|
disabled,
|
|
365
367
|
onValueChange: (next) => setHsva({ a: Array.isArray(next) ? next[0] : next }),
|
|
366
|
-
className: cn("relative flex w-full touch-
|
|
368
|
+
className: cn("relative flex w-full touch-pan-y select-none items-center", className),
|
|
367
369
|
...props,
|
|
368
370
|
children: /* @__PURE__ */ jsx(Slider.Control, {
|
|
369
371
|
className: "flex h-full w-full items-center",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
//#region src/ui/combobox-disabled-selection.d.ts
|
|
2
|
-
declare function shouldAcceptComboboxValueChange<Value>(value: Value | null, disabledValues: ReadonlySet<unknown>): boolean;
|
|
3
|
-
declare function emitComboboxValueChange<Value>(value: Value | null, disabledValues: ReadonlySet<unknown>, onValueChange: (value: Value | null) => void): boolean;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { emitComboboxValueChange, shouldAcceptComboboxValueChange };
|
|
2
|
+
export declare function shouldAcceptComboboxValueChange<Value>(value: Value | null, disabledValues: ReadonlySet<unknown>): boolean;
|
|
3
|
+
export declare function emitComboboxValueChange<Value>(value: Value | null, disabledValues: ReadonlySet<unknown>, onValueChange: (value: Value | null) => void): boolean;
|
|
4
|
+
//#endregion
|