@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
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
//#region src/hooks/use-keyboard-navigation.ts
|
|
3
|
+
function useKeyboardNavigation() {
|
|
4
|
+
const [keyboardNavigation, setKeyboardNavigation] = useState(false);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
function markKeyboardNavigation(event) {
|
|
7
|
+
if (event.key === "Tab") setKeyboardNavigation(true);
|
|
8
|
+
}
|
|
9
|
+
function clearKeyboardNavigation() {
|
|
10
|
+
setKeyboardNavigation(false);
|
|
11
|
+
}
|
|
12
|
+
document.addEventListener("keydown", markKeyboardNavigation, true);
|
|
13
|
+
document.addEventListener("pointerdown", clearKeyboardNavigation, true);
|
|
14
|
+
return () => {
|
|
15
|
+
document.removeEventListener("keydown", markKeyboardNavigation, true);
|
|
16
|
+
document.removeEventListener("pointerdown", clearKeyboardNavigation, true);
|
|
17
|
+
};
|
|
18
|
+
}, []);
|
|
19
|
+
return keyboardNavigation;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { useKeyboardNavigation };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
//#region src/hooks/use-mobile.d.ts
|
|
2
2
|
/** True below `breakpoint` px (Tailwind `md` by default); pass another breakpoint to match layout that switches elsewhere. */
|
|
3
|
-
declare function useIsMobile(breakpoint?: number): boolean;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { useIsMobile };
|
|
3
|
+
export declare function useIsMobile(breakpoint?: number): boolean;
|
|
4
|
+
//#endregion
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { TriggerConfig, TriggerMenuController, TriggerMenuItemData } from "./use-trigger-menu.js";
|
|
2
2
|
import { RefObject } from "react";
|
|
3
3
|
//#region src/hooks/use-textarea-trigger-menu.d.ts
|
|
4
|
-
declare function useTextareaTriggerMenu<Item extends TriggerMenuItemData>(ref: RefObject<HTMLTextAreaElement | null>, options: {
|
|
4
|
+
export declare function useTextareaTriggerMenu<Item extends TriggerMenuItemData>(ref: RefObject<HTMLTextAreaElement | null>, options: {
|
|
5
5
|
triggers: readonly TriggerConfig<Item>[];
|
|
6
6
|
}): TriggerMenuController<Item>;
|
|
7
|
-
//#endregion
|
|
8
|
-
export { useTextareaTriggerMenu };
|
|
7
|
+
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TriggerMatch } from "../lib/trigger-detect.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
//#region src/hooks/use-trigger-menu.d.ts
|
|
4
|
-
type TriggerMenuItemData = {
|
|
4
|
+
export type TriggerMenuItemData = {
|
|
5
5
|
id: string;
|
|
6
6
|
label: string;
|
|
7
7
|
description?: string;
|
|
@@ -11,11 +11,11 @@ type TriggerMenuItemData = {
|
|
|
11
11
|
kind?: string;
|
|
12
12
|
image?: string;
|
|
13
13
|
};
|
|
14
|
-
type TriggerSelectContext = {
|
|
14
|
+
export type TriggerSelectContext = {
|
|
15
15
|
char: string;
|
|
16
16
|
query: string;
|
|
17
17
|
};
|
|
18
|
-
type TriggerConfig<Item extends TriggerMenuItemData = TriggerMenuItemData> = {
|
|
18
|
+
export type TriggerConfig<Item extends TriggerMenuItemData = TriggerMenuItemData> = {
|
|
19
19
|
char: string;
|
|
20
20
|
items: readonly Item[] | ((query: string) => readonly Item[]);
|
|
21
21
|
filter?: (item: Item, query: string) => boolean;
|
|
@@ -23,11 +23,11 @@ type TriggerConfig<Item extends TriggerMenuItemData = TriggerMenuItemData> = {
|
|
|
23
23
|
insertText?: (item: Item) => string;
|
|
24
24
|
onSelect?: (item: Item, ctx: TriggerSelectContext) => void;
|
|
25
25
|
};
|
|
26
|
-
type UseTriggerMenuOptions<Item extends TriggerMenuItemData> = {
|
|
26
|
+
export type UseTriggerMenuOptions<Item extends TriggerMenuItemData> = {
|
|
27
27
|
triggers: readonly TriggerConfig<Item>[];
|
|
28
28
|
onCommit: (item: Item, trigger: TriggerConfig<Item>, match: TriggerMatch) => void;
|
|
29
29
|
};
|
|
30
|
-
type TriggerMenuController<Item extends TriggerMenuItemData> = {
|
|
30
|
+
export type TriggerMenuController<Item extends TriggerMenuItemData> = {
|
|
31
31
|
open: boolean;
|
|
32
32
|
items: readonly Item[];
|
|
33
33
|
activeIndex: number;
|
|
@@ -44,6 +44,5 @@ type TriggerMenuController<Item extends TriggerMenuItemData> = {
|
|
|
44
44
|
close: () => void;
|
|
45
45
|
setOpen: (open: boolean) => void;
|
|
46
46
|
};
|
|
47
|
-
declare function useTriggerMenu<Item extends TriggerMenuItemData>({ triggers, onCommit }: UseTriggerMenuOptions<Item>): TriggerMenuController<Item>;
|
|
48
|
-
//#endregion
|
|
49
|
-
export { TriggerConfig, TriggerMenuController, TriggerMenuItemData, TriggerSelectContext, UseTriggerMenuOptions, useTriggerMenu };
|
|
47
|
+
export declare function useTriggerMenu<Item extends TriggerMenuItemData>({ triggers, onCommit }: UseTriggerMenuOptions<Item>): TriggerMenuController<Item>;
|
|
48
|
+
//#endregion
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import { UserAskKnobStyle } from "../knob-contracts/user-ask-knobs.js";
|
|
2
2
|
import { CSSProperties, ComponentProps, KeyboardEvent, ReactNode } from "react";
|
|
3
3
|
//#region src/hooks/use-user-ask.d.ts
|
|
4
|
-
type UserAskAnswers = Record<string, string>;
|
|
5
|
-
type UserAskProps = Omit<ComponentProps<"section">, "style"> & {
|
|
4
|
+
export type UserAskAnswers = Record<string, string | string[]>;
|
|
5
|
+
export type UserAskProps = Omit<ComponentProps<"section">, "style"> & {
|
|
6
6
|
children?: ReactNode;
|
|
7
7
|
onComplete?: (answers: UserAskAnswers) => void;
|
|
8
8
|
onDismiss?: () => void;
|
|
9
9
|
style?: CSSProperties & UserAskKnobStyle;
|
|
10
10
|
};
|
|
11
|
-
type UserAskQuestionEntry = {
|
|
11
|
+
export type UserAskQuestionEntry = {
|
|
12
12
|
key: string;
|
|
13
13
|
id: string;
|
|
14
14
|
title: string;
|
|
15
|
-
|
|
15
|
+
multiple?: boolean;
|
|
16
|
+
defaultValues?: string[];
|
|
16
17
|
};
|
|
17
|
-
type UserAskOptionEntry = {
|
|
18
|
+
export type UserAskOptionEntry = {
|
|
18
19
|
key: string;
|
|
19
20
|
value: string;
|
|
20
21
|
disabled?: boolean;
|
|
21
22
|
/** Freeform options resolve to user's typed text instead of `value`. */
|
|
22
23
|
freeform?: boolean;
|
|
23
24
|
};
|
|
24
|
-
declare function useUserAsk({ onComplete, onDismiss }: Pick<UserAskProps, "onComplete" | "onDismiss">): {
|
|
25
|
+
export declare function useUserAsk({ onComplete, onDismiss }: Pick<UserAskProps, "onComplete" | "onDismiss">): {
|
|
25
26
|
questions: UserAskQuestionEntry[];
|
|
26
27
|
activeIndex: number;
|
|
27
28
|
activeQuestion: UserAskQuestionEntry;
|
|
@@ -32,17 +33,17 @@ declare function useUserAsk({ onComplete, onDismiss }: Pick<UserAskProps, "onCom
|
|
|
32
33
|
registerOption: (questionId: string, entry: UserAskOptionEntry) => void;
|
|
33
34
|
unregisterOption: (questionId: string, key: string) => void;
|
|
34
35
|
optionsFor: (questionId: string) => UserAskOptionEntry[];
|
|
35
|
-
|
|
36
|
+
allowsMultiple: (questionId: string) => boolean;
|
|
37
|
+
selectionFor: (questionId: string) => string;
|
|
36
38
|
isSelected: (questionId: string, optionKey: string) => boolean;
|
|
37
39
|
select: (questionId: string, optionKey: string) => void;
|
|
38
40
|
freeformTextFor: (questionId: string) => string;
|
|
39
41
|
setFreeformText: (questionId: string, text: string) => void;
|
|
40
|
-
answerFor: (questionId: string) => string | undefined;
|
|
42
|
+
answerFor: (questionId: string) => string | string[] | undefined;
|
|
41
43
|
resolveAnswers: () => UserAskAnswers;
|
|
42
44
|
goTo: (index: number) => void;
|
|
43
45
|
advance: () => void;
|
|
44
46
|
dismiss: () => void;
|
|
45
47
|
handleKeyDown: (event: KeyboardEvent<HTMLElement>) => void;
|
|
46
48
|
};
|
|
47
|
-
//#endregion
|
|
48
|
-
export { UserAskAnswers, UserAskOptionEntry, UserAskProps, UserAskQuestionEntry, useUserAsk };
|
|
49
|
+
//#endregion
|
|
@@ -3,6 +3,7 @@ import { useState } from "react";
|
|
|
3
3
|
function upsert(entries, entry) {
|
|
4
4
|
const index = entries.findIndex((existing) => existing.key === entry.key);
|
|
5
5
|
if (index === -1) return [...entries, entry];
|
|
6
|
+
if (JSON.stringify(entries[index]) === JSON.stringify(entry)) return entries;
|
|
6
7
|
const next = [...entries];
|
|
7
8
|
next[index] = entry;
|
|
8
9
|
return next;
|
|
@@ -36,21 +37,39 @@ function useUserAsk({ onComplete, onDismiss }) {
|
|
|
36
37
|
function optionsFor(questionId) {
|
|
37
38
|
return optionsByQuestion[questionId] ?? [];
|
|
38
39
|
}
|
|
39
|
-
function
|
|
40
|
+
function allowsMultiple(questionId) {
|
|
41
|
+
return questions.find((question) => question.id === questionId)?.multiple === true;
|
|
42
|
+
}
|
|
43
|
+
function selectedKeysFor(questionId) {
|
|
40
44
|
const explicit = selections[questionId];
|
|
41
45
|
if (explicit) return explicit;
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
return optionsFor(questionId).
|
|
46
|
+
const defaults = questions.find((question) => question.id === questionId)?.defaultValues;
|
|
47
|
+
if (defaults === void 0) return [];
|
|
48
|
+
return optionsFor(questionId).filter((option) => !option.freeform && defaults.includes(option.value)).map((option) => option.key);
|
|
49
|
+
}
|
|
50
|
+
function selectionFor(questionId) {
|
|
51
|
+
return selectedKeysFor(questionId)[0];
|
|
45
52
|
}
|
|
46
53
|
function isSelected(questionId, optionKey) {
|
|
47
|
-
return
|
|
54
|
+
return selectedKeysFor(questionId).includes(optionKey);
|
|
48
55
|
}
|
|
49
56
|
function select(questionId, optionKey) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
57
|
+
if (!allowsMultiple(questionId)) {
|
|
58
|
+
setSelections((previous) => ({
|
|
59
|
+
...previous,
|
|
60
|
+
[questionId]: [optionKey]
|
|
61
|
+
}));
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const derived = selectedKeysFor(questionId);
|
|
65
|
+
setSelections((previous) => {
|
|
66
|
+
const current = previous[questionId] ?? derived;
|
|
67
|
+
const next = current.includes(optionKey) ? current.filter((entry) => entry !== optionKey) : [...current, optionKey];
|
|
68
|
+
return {
|
|
69
|
+
...previous,
|
|
70
|
+
[questionId]: next
|
|
71
|
+
};
|
|
72
|
+
});
|
|
54
73
|
}
|
|
55
74
|
function freeformTextFor(questionId) {
|
|
56
75
|
return freeformTexts[questionId] ?? "";
|
|
@@ -62,12 +81,17 @@ function useUserAsk({ onComplete, onDismiss }) {
|
|
|
62
81
|
}));
|
|
63
82
|
}
|
|
64
83
|
function answerFor(questionId) {
|
|
65
|
-
const
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
84
|
+
const options = optionsFor(questionId);
|
|
85
|
+
const resolve = (optionKey) => {
|
|
86
|
+
const option = options.find((entry) => entry.key === optionKey);
|
|
87
|
+
if (!option) return void 0;
|
|
88
|
+
if (!option.freeform) return option.value;
|
|
89
|
+
const text = freeformTextFor(questionId).trim();
|
|
90
|
+
return text.length > 0 ? text : void 0;
|
|
91
|
+
};
|
|
92
|
+
const values = selectedKeysFor(questionId).map(resolve).filter((value) => value !== void 0);
|
|
93
|
+
if (!allowsMultiple(questionId)) return values[0];
|
|
94
|
+
return values.length > 0 ? values : void 0;
|
|
71
95
|
}
|
|
72
96
|
const canContinue = activeQuestion !== void 0 && answerFor(activeQuestion.id) !== void 0;
|
|
73
97
|
const isLastQuestion = activeIndex === questions.length - 1;
|
|
@@ -111,6 +135,20 @@ function useUserAsk({ onComplete, onDismiss }) {
|
|
|
111
135
|
const option = optionsFor(activeQuestion.id)[digit - 1];
|
|
112
136
|
if (option && !option.disabled) select(activeQuestion.id, option.key);
|
|
113
137
|
}
|
|
138
|
+
function moveActiveOption(event, delta) {
|
|
139
|
+
if (!activeQuestion) return;
|
|
140
|
+
if (!allowsMultiple(activeQuestion.id)) {
|
|
141
|
+
moveSelection(delta);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const rows = [...event.currentTarget.querySelector("[data-slot=\"question\"][data-active]")?.querySelectorAll("[data-slot=\"option\"]:not([disabled])") ?? []];
|
|
145
|
+
if (rows.length === 0) return;
|
|
146
|
+
const focused = rows.findIndex((candidate) => candidate.contains(document.activeElement));
|
|
147
|
+
let start = focused;
|
|
148
|
+
if (focused === -1) start = delta > 0 ? -1 : 0;
|
|
149
|
+
const row = rows[(start + delta + rows.length) % rows.length];
|
|
150
|
+
(row?.matches("button, input") ? row : row?.querySelector("input, button"))?.focus();
|
|
151
|
+
}
|
|
114
152
|
function handleKeyDown(event) {
|
|
115
153
|
if (event.defaultPrevented) return;
|
|
116
154
|
if (event.key === "Escape") {
|
|
@@ -126,12 +164,12 @@ function useUserAsk({ onComplete, onDismiss }) {
|
|
|
126
164
|
if (event.target instanceof HTMLElement && event.target.closest("input, textarea, [contenteditable]")) return;
|
|
127
165
|
if (event.key === "ArrowDown") {
|
|
128
166
|
event.preventDefault();
|
|
129
|
-
|
|
167
|
+
moveActiveOption(event, 1);
|
|
130
168
|
return;
|
|
131
169
|
}
|
|
132
170
|
if (event.key === "ArrowUp") {
|
|
133
171
|
event.preventDefault();
|
|
134
|
-
|
|
172
|
+
moveActiveOption(event, -1);
|
|
135
173
|
return;
|
|
136
174
|
}
|
|
137
175
|
if (/^[1-9]$/.test(event.key)) {
|
|
@@ -150,6 +188,7 @@ function useUserAsk({ onComplete, onDismiss }) {
|
|
|
150
188
|
registerOption,
|
|
151
189
|
unregisterOption,
|
|
152
190
|
optionsFor,
|
|
191
|
+
allowsMultiple,
|
|
153
192
|
selectionFor,
|
|
154
193
|
isSelected,
|
|
155
194
|
select,
|
|
@@ -1,37 +1,36 @@
|
|
|
1
1
|
import { InlineAttachmentKnobStyle } from "./knob-contracts/inline-attachment-knobs.js";
|
|
2
2
|
import { CSSProperties, ComponentProps } from "react";
|
|
3
3
|
//#region src/inline-attachment.d.ts
|
|
4
|
-
type InlineAttachmentState = "ready" | "pending" | "error";
|
|
4
|
+
export type InlineAttachmentState = "ready" | "pending" | "error";
|
|
5
5
|
type InlineAttachmentStyleProps<Props, Style> = Omit<Props, "style"> & {
|
|
6
6
|
style?: CSSProperties & Style;
|
|
7
7
|
};
|
|
8
|
-
type InlineAttachmentProps = InlineAttachmentStyleProps<ComponentProps<"button">, InlineAttachmentKnobStyle> & {
|
|
8
|
+
export type InlineAttachmentProps = InlineAttachmentStyleProps<ComponentProps<"button">, InlineAttachmentKnobStyle> & {
|
|
9
9
|
name: string;
|
|
10
10
|
state?: InlineAttachmentState;
|
|
11
11
|
/** Width-to-height ratio of the reserved box — generated media knows its ratio before its pixels, so arrival never reflows the turn. */
|
|
12
12
|
aspect?: number;
|
|
13
13
|
};
|
|
14
|
-
declare function InlineAttachment({ name, state, aspect, disabled, className, children, style, "aria-label": ariaLabel, ...props }: InlineAttachmentProps): import("react").JSX.Element;
|
|
15
|
-
type InlineAttachmentMediaProps = ComponentProps<"div"> & {
|
|
14
|
+
export declare function InlineAttachment({ name, state, aspect, disabled, className, children, style, "aria-label": ariaLabel, ...props }: InlineAttachmentProps): import("react").JSX.Element;
|
|
15
|
+
export type InlineAttachmentMediaProps = ComponentProps<"div"> & {
|
|
16
16
|
src?: string;
|
|
17
17
|
alt?: string;
|
|
18
18
|
} & {
|
|
19
19
|
style?: CSSProperties & InlineAttachmentKnobStyle;
|
|
20
20
|
};
|
|
21
|
-
declare function InlineAttachmentMedia({ src, alt, className, children, ...props }: InlineAttachmentMediaProps): import("react").JSX.Element;
|
|
22
|
-
type InlineAttachmentContentProps = InlineAttachmentStyleProps<ComponentProps<"div">, InlineAttachmentKnobStyle>;
|
|
23
|
-
declare function InlineAttachmentContent({ className, ...props }: InlineAttachmentContentProps): import("react").JSX.Element;
|
|
24
|
-
type InlineAttachmentTitleProps = ComponentProps<"div"> & {
|
|
21
|
+
export declare function InlineAttachmentMedia({ src, alt, className, children, ...props }: InlineAttachmentMediaProps): import("react").JSX.Element;
|
|
22
|
+
export type InlineAttachmentContentProps = InlineAttachmentStyleProps<ComponentProps<"div">, InlineAttachmentKnobStyle>;
|
|
23
|
+
export declare function InlineAttachmentContent({ className, ...props }: InlineAttachmentContentProps): import("react").JSX.Element;
|
|
24
|
+
export type InlineAttachmentTitleProps = ComponentProps<"div"> & {
|
|
25
25
|
style?: CSSProperties & InlineAttachmentKnobStyle;
|
|
26
26
|
};
|
|
27
|
-
declare function InlineAttachmentTitle({ children, className, ...props }: InlineAttachmentTitleProps): import("react").JSX.Element;
|
|
28
|
-
type InlineAttachmentDescriptionProps = InlineAttachmentStyleProps<ComponentProps<"div">, InlineAttachmentKnobStyle>;
|
|
29
|
-
declare function InlineAttachmentDescription({ className, ...props }: InlineAttachmentDescriptionProps): import("react").JSX.Element;
|
|
30
|
-
type InlineAttachmentActionsProps = ComponentProps<"div"> & {
|
|
27
|
+
export declare function InlineAttachmentTitle({ children, className, ...props }: InlineAttachmentTitleProps): import("react").JSX.Element;
|
|
28
|
+
export type InlineAttachmentDescriptionProps = InlineAttachmentStyleProps<ComponentProps<"div">, InlineAttachmentKnobStyle>;
|
|
29
|
+
export declare function InlineAttachmentDescription({ className, ...props }: InlineAttachmentDescriptionProps): import("react").JSX.Element;
|
|
30
|
+
export type InlineAttachmentActionsProps = ComponentProps<"div"> & {
|
|
31
31
|
style?: CSSProperties & InlineAttachmentKnobStyle;
|
|
32
32
|
};
|
|
33
|
-
declare function InlineAttachmentActions({ className, ...props }: InlineAttachmentActionsProps): import("react").JSX.Element;
|
|
34
|
-
type InlineAttachmentActionProps = InlineAttachmentStyleProps<ComponentProps<"span">, InlineAttachmentKnobStyle>;
|
|
35
|
-
declare function InlineAttachmentAction({ className, ...props }: InlineAttachmentActionProps): import("react").JSX.Element;
|
|
36
|
-
//#endregion
|
|
37
|
-
export { InlineAttachment, InlineAttachmentAction, InlineAttachmentActionProps, InlineAttachmentActions, InlineAttachmentActionsProps, InlineAttachmentContent, InlineAttachmentContentProps, InlineAttachmentDescription, InlineAttachmentDescriptionProps, InlineAttachmentMedia, InlineAttachmentMediaProps, InlineAttachmentProps, InlineAttachmentState, InlineAttachmentTitle, InlineAttachmentTitleProps };
|
|
33
|
+
export declare function InlineAttachmentActions({ className, ...props }: InlineAttachmentActionsProps): import("react").JSX.Element;
|
|
34
|
+
export type InlineAttachmentActionProps = InlineAttachmentStyleProps<ComponentProps<"span">, InlineAttachmentKnobStyle>;
|
|
35
|
+
export declare function InlineAttachmentAction({ className, ...props }: InlineAttachmentActionProps): import("react").JSX.Element;
|
|
36
|
+
//#endregion
|
|
@@ -146,7 +146,7 @@ function InlineAttachmentContent({ className, ...props }) {
|
|
|
146
146
|
"data-control-ui": "inline-attachment",
|
|
147
147
|
"data-control-family": "inline-attachment",
|
|
148
148
|
"data-slot": "content",
|
|
149
|
-
className: cn("absolute
|
|
149
|
+
className: cn("absolute", className),
|
|
150
150
|
...props
|
|
151
151
|
});
|
|
152
152
|
}
|
|
@@ -3,7 +3,7 @@ import { Popover, PopoverContent, PopoverTrigger } from "./ui/popover.js";
|
|
|
3
3
|
import { InlineCitationKnobStyle } from "./knob-contracts/inline-citation-knobs.js";
|
|
4
4
|
import { CSSProperties, ComponentProps, ReactNode } from "react";
|
|
5
5
|
//#region src/inline-citation.d.ts
|
|
6
|
-
type SourceReference = {
|
|
6
|
+
export type SourceReference = {
|
|
7
7
|
href: string;
|
|
8
8
|
title?: string;
|
|
9
9
|
description?: string;
|
|
@@ -14,7 +14,7 @@ type InlineCitationStyleProps<Props, Style> = Omit<Props, "style"> & {
|
|
|
14
14
|
style?: CSSProperties & Style;
|
|
15
15
|
};
|
|
16
16
|
type PopoverRootProps = ComponentProps<typeof Popover>;
|
|
17
|
-
type InlineCitationProps = ComponentProps<"span"> & {
|
|
17
|
+
export type InlineCitationProps = ComponentProps<"span"> & {
|
|
18
18
|
sources: readonly SourceReference[];
|
|
19
19
|
open?: PopoverRootProps["open"];
|
|
20
20
|
defaultOpen?: PopoverRootProps["defaultOpen"];
|
|
@@ -22,35 +22,34 @@ type InlineCitationProps = ComponentProps<"span"> & {
|
|
|
22
22
|
} & {
|
|
23
23
|
style?: CSSProperties & InlineCitationKnobStyle;
|
|
24
24
|
};
|
|
25
|
-
declare function InlineCitation({ sources, open, defaultOpen, onOpenChange, className, children, ...props }: InlineCitationProps): import("react").JSX.Element;
|
|
26
|
-
type InlineCitationTriggerProps = InlineCitationStyleProps<ComponentProps<typeof PopoverTrigger>, InlineCitationKnobStyle>;
|
|
27
|
-
declare function InlineCitationTrigger({ "aria-label": ariaLabel, className, children, disabled, render, ...props }: InlineCitationTriggerProps): import("react").JSX.Element;
|
|
28
|
-
type InlineCitationFaviconsProps = InlineCitationStyleProps<ComponentProps<"span">, InlineCitationKnobStyle> & {
|
|
25
|
+
export declare function InlineCitation({ sources, open, defaultOpen, onOpenChange, className, children, ...props }: InlineCitationProps): import("react").JSX.Element;
|
|
26
|
+
export type InlineCitationTriggerProps = InlineCitationStyleProps<ComponentProps<typeof PopoverTrigger>, InlineCitationKnobStyle>;
|
|
27
|
+
export declare function InlineCitationTrigger({ "aria-label": ariaLabel, className, children, disabled, render, ...props }: InlineCitationTriggerProps): import("react").JSX.Element;
|
|
28
|
+
export type InlineCitationFaviconsProps = InlineCitationStyleProps<ComponentProps<"span">, InlineCitationKnobStyle> & {
|
|
29
29
|
limit?: number;
|
|
30
30
|
};
|
|
31
|
-
declare function InlineCitationFavicons({ limit, className, ...props }: InlineCitationFaviconsProps): import("react").JSX.Element;
|
|
32
|
-
type InlineCitationLabelProps = ComponentProps<"span"> & {
|
|
31
|
+
export declare function InlineCitationFavicons({ limit, className, ...props }: InlineCitationFaviconsProps): import("react").JSX.Element;
|
|
32
|
+
export type InlineCitationLabelProps = ComponentProps<"span"> & {
|
|
33
33
|
style?: CSSProperties & InlineCitationKnobStyle;
|
|
34
34
|
};
|
|
35
|
-
declare function InlineCitationLabel({ className, children, ...props }: InlineCitationLabelProps): import("react").JSX.Element;
|
|
36
|
-
type InlineCitationContentProps = ComponentProps<typeof PopoverContent>;
|
|
37
|
-
declare function InlineCitationContent({ className, children, align, padding, ...props }: InlineCitationContentProps): import("react").JSX.Element;
|
|
38
|
-
type InlineCitationNavigationProps = InlineCitationStyleProps<ComponentProps<"div">, InlineCitationKnobStyle>;
|
|
39
|
-
declare function InlineCitationNavigation({ className, children, ...props }: InlineCitationNavigationProps): import("react").JSX.Element;
|
|
40
|
-
type InlineCitationPreviousProps = Omit<ComponentProps<typeof Button>, "children"> & {
|
|
35
|
+
export declare function InlineCitationLabel({ className, children, ...props }: InlineCitationLabelProps): import("react").JSX.Element;
|
|
36
|
+
export type InlineCitationContentProps = ComponentProps<typeof PopoverContent>;
|
|
37
|
+
export declare function InlineCitationContent({ className, children, align, padding, ...props }: InlineCitationContentProps): import("react").JSX.Element;
|
|
38
|
+
export type InlineCitationNavigationProps = InlineCitationStyleProps<ComponentProps<"div">, InlineCitationKnobStyle>;
|
|
39
|
+
export declare function InlineCitationNavigation({ className, children, ...props }: InlineCitationNavigationProps): import("react").JSX.Element;
|
|
40
|
+
export type InlineCitationPreviousProps = Omit<ComponentProps<typeof Button>, "children"> & {
|
|
41
41
|
children?: ReactNode;
|
|
42
42
|
};
|
|
43
|
-
declare function InlineCitationPrevious({ className, children, disabled, onClick, ...props }: InlineCitationPreviousProps): import("react").JSX.Element;
|
|
44
|
-
type InlineCitationNextProps = Omit<ComponentProps<typeof Button>, "children"> & {
|
|
43
|
+
export declare function InlineCitationPrevious({ className, children, disabled, onClick, ...props }: InlineCitationPreviousProps): import("react").JSX.Element;
|
|
44
|
+
export type InlineCitationNextProps = Omit<ComponentProps<typeof Button>, "children"> & {
|
|
45
45
|
children?: ReactNode;
|
|
46
46
|
};
|
|
47
|
-
declare function InlineCitationNext({ className, children, disabled, onClick, ...props }: InlineCitationNextProps): import("react").JSX.Element;
|
|
48
|
-
type InlineCitationPositionProps = InlineCitationStyleProps<ComponentProps<"span">, InlineCitationKnobStyle>;
|
|
49
|
-
declare function InlineCitationPosition({ className, children, ...props }: InlineCitationPositionProps): import("react").JSX.Element;
|
|
50
|
-
type InlineCitationSourceProps = Omit<ComponentProps<"article">, "style"> & {
|
|
47
|
+
export declare function InlineCitationNext({ className, children, disabled, onClick, ...props }: InlineCitationNextProps): import("react").JSX.Element;
|
|
48
|
+
export type InlineCitationPositionProps = InlineCitationStyleProps<ComponentProps<"span">, InlineCitationKnobStyle>;
|
|
49
|
+
export declare function InlineCitationPosition({ className, children, ...props }: InlineCitationPositionProps): import("react").JSX.Element;
|
|
50
|
+
export type InlineCitationSourceProps = Omit<ComponentProps<"article">, "style"> & {
|
|
51
51
|
source?: SourceReference;
|
|
52
52
|
style?: CSSProperties & InlineCitationKnobStyle;
|
|
53
53
|
};
|
|
54
|
-
declare function InlineCitationSource({ source: sourceProp, className, children, style, ref, ...props }: InlineCitationSourceProps): import("react").JSX.Element | null;
|
|
55
|
-
//#endregion
|
|
56
|
-
export { InlineCitation, InlineCitationContent, InlineCitationContentProps, InlineCitationFavicons, InlineCitationFaviconsProps, InlineCitationLabel, InlineCitationLabelProps, InlineCitationNavigation, InlineCitationNavigationProps, InlineCitationNext, InlineCitationNextProps, InlineCitationPosition, InlineCitationPositionProps, InlineCitationPrevious, InlineCitationPreviousProps, InlineCitationProps, InlineCitationSource, InlineCitationSourceProps, InlineCitationTrigger, InlineCitationTriggerProps, SourceReference };
|
|
54
|
+
export declare function InlineCitationSource({ source: sourceProp, className, children, style, ref, ...props }: InlineCitationSourceProps): import("react").JSX.Element | null;
|
|
55
|
+
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
//#region src/knob-contracts/accordion-knobs.d.ts
|
|
2
|
-
declare const accordionKnobs: readonly ["--cui-accordion-item-border-color", "--cui-accordion-trigger-foreground", "--cui-accordion-trigger-hover-foreground", "--cui-accordion-icon-foreground"];
|
|
3
|
-
type AccordionKnobStyle = Partial<Record<(typeof accordionKnobs)[number], string>>;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { AccordionKnobStyle, accordionKnobs };
|
|
2
|
+
export declare const accordionKnobs: readonly ["--cui-accordion-item-border-color", "--cui-accordion-item-border-width", "--cui-accordion-trigger-foreground", "--cui-accordion-trigger-hover-foreground", "--cui-accordion-icon-foreground"];
|
|
3
|
+
export type AccordionKnobStyle = Partial<Record<(typeof accordionKnobs)[number], string>>;
|
|
4
|
+
//#endregion
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
//#region src/knob-contracts/accordion-knobs.ts
|
|
2
2
|
const accordionKnobs = [
|
|
3
3
|
"--cui-accordion-item-border-color",
|
|
4
|
+
"--cui-accordion-item-border-width",
|
|
4
5
|
"--cui-accordion-trigger-foreground",
|
|
5
6
|
"--cui-accordion-trigger-hover-foreground",
|
|
6
7
|
"--cui-accordion-icon-foreground"
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
//#region src/knob-contracts/action-bar-knobs.d.ts
|
|
2
|
-
declare const actionBarKnobs: readonly [];
|
|
3
|
-
type ActionBarKnobStyle = Partial<Record<(typeof actionBarKnobs)[number], string>>;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { ActionBarKnobStyle, actionBarKnobs };
|
|
2
|
+
export declare const actionBarKnobs: readonly ["--cui-action-bar-hidden-opacity", "--cui-action-bar-visible-opacity"];
|
|
3
|
+
export type ActionBarKnobStyle = Partial<Record<(typeof actionBarKnobs)[number], string>>;
|
|
4
|
+
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
//#region src/knob-contracts/activity-knobs.d.ts
|
|
2
|
-
declare const activityKnobs: readonly ["--cui-activity-row-foreground", "--cui-activity-trigger-radius", "--cui-activity-trigger-hover-background", "--cui-activity-code-background"];
|
|
3
|
-
type ActivityKnobStyle = Partial<Record<(typeof activityKnobs)[number], string>>;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { ActivityKnobStyle, activityKnobs };
|
|
2
|
+
export declare const activityKnobs: readonly ["--cui-activity-row-foreground", "--cui-activity-trigger-radius", "--cui-activity-trigger-hover-background", "--cui-activity-code-background", "--cui-activity-code-radius"];
|
|
3
|
+
export type ActivityKnobStyle = Partial<Record<(typeof activityKnobs)[number], string>>;
|
|
4
|
+
//#endregion
|
|
@@ -3,7 +3,8 @@ const activityKnobs = [
|
|
|
3
3
|
"--cui-activity-row-foreground",
|
|
4
4
|
"--cui-activity-trigger-radius",
|
|
5
5
|
"--cui-activity-trigger-hover-background",
|
|
6
|
-
"--cui-activity-code-background"
|
|
6
|
+
"--cui-activity-code-background",
|
|
7
|
+
"--cui-activity-code-radius"
|
|
7
8
|
];
|
|
8
9
|
//#endregion
|
|
9
10
|
export { activityKnobs };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
//#region src/knob-contracts/alert-knobs.d.ts
|
|
2
|
-
declare const alertKnobs: readonly ["--cui-alert-radius", "--cui-alert-background", "--cui-alert-border-color", "--cui-alert-shadow"];
|
|
3
|
-
type AlertKnobStyle = Partial<Record<(typeof alertKnobs)[number], string>>;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { AlertKnobStyle, alertKnobs };
|
|
2
|
+
export declare const alertKnobs: readonly ["--cui-alert-radius", "--cui-alert-background", "--cui-alert-border-color", "--cui-alert-shadow", "--cui-alert-foreground", "--cui-alert-description-foreground", "--cui-alert-border-width", "--cui-alert-padding", "--cui-alert-padding-inline", "--cui-alert-gap", "--cui-alert-icon-gap", "--cui-alert-icon-size", "--cui-alert-font-size", "--cui-alert-description-gap", "--cui-alert-title-font-weight"];
|
|
3
|
+
export type AlertKnobStyle = Partial<Record<(typeof alertKnobs)[number], string>>;
|
|
4
|
+
//#endregion
|
|
@@ -3,7 +3,18 @@ const alertKnobs = [
|
|
|
3
3
|
"--cui-alert-radius",
|
|
4
4
|
"--cui-alert-background",
|
|
5
5
|
"--cui-alert-border-color",
|
|
6
|
-
"--cui-alert-shadow"
|
|
6
|
+
"--cui-alert-shadow",
|
|
7
|
+
"--cui-alert-foreground",
|
|
8
|
+
"--cui-alert-description-foreground",
|
|
9
|
+
"--cui-alert-border-width",
|
|
10
|
+
"--cui-alert-padding",
|
|
11
|
+
"--cui-alert-padding-inline",
|
|
12
|
+
"--cui-alert-gap",
|
|
13
|
+
"--cui-alert-icon-gap",
|
|
14
|
+
"--cui-alert-icon-size",
|
|
15
|
+
"--cui-alert-font-size",
|
|
16
|
+
"--cui-alert-description-gap",
|
|
17
|
+
"--cui-alert-title-font-weight"
|
|
7
18
|
];
|
|
8
19
|
//#endregion
|
|
9
20
|
export { alertKnobs };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
//#region src/knob-contracts/audio-recorder-knobs.d.ts
|
|
2
|
-
declare const audioRecorderKnobs: readonly ["--cui-audio-recorder-foreground", "--cui-audio-recorder-active-foreground", "--cui-audio-recorder-recording-ring-color", "--cui-audio-recorder-error-foreground"];
|
|
3
|
-
type AudioRecorderKnobStyle = Partial<Record<(typeof audioRecorderKnobs)[number], string>>;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { AudioRecorderKnobStyle, audioRecorderKnobs };
|
|
2
|
+
export declare const audioRecorderKnobs: readonly ["--cui-audio-recorder-foreground", "--cui-audio-recorder-active-foreground", "--cui-audio-recorder-recording-ring-color", "--cui-audio-recorder-error-foreground"];
|
|
3
|
+
export type AudioRecorderKnobStyle = Partial<Record<(typeof audioRecorderKnobs)[number], string>>;
|
|
4
|
+
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
//#region src/knob-contracts/audio-visualizer-knobs.d.ts
|
|
2
|
-
declare const audioVisualizerKnobs: readonly ["--cui-audio-visualizer-radius", "--cui-audio-visualizer-bar-background", "--cui-audio-visualizer-line-fill", "--cui-audio-visualizer-line-stroke"];
|
|
3
|
-
type AudioVisualizerKnobStyle = Partial<Record<(typeof audioVisualizerKnobs)[number], string>>;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { AudioVisualizerKnobStyle, audioVisualizerKnobs };
|
|
2
|
+
export declare const audioVisualizerKnobs: readonly ["--cui-audio-visualizer-radius", "--cui-audio-visualizer-bar-radius", "--cui-audio-visualizer-bar-background", "--cui-audio-visualizer-line-fill", "--cui-audio-visualizer-line-stroke"];
|
|
3
|
+
export type AudioVisualizerKnobStyle = Partial<Record<(typeof audioVisualizerKnobs)[number], string>>;
|
|
4
|
+
//#endregion
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
//#region src/knob-contracts/audio-visualizer-knobs.ts
|
|
2
2
|
const audioVisualizerKnobs = [
|
|
3
3
|
"--cui-audio-visualizer-radius",
|
|
4
|
+
"--cui-audio-visualizer-bar-radius",
|
|
4
5
|
"--cui-audio-visualizer-bar-background",
|
|
5
6
|
"--cui-audio-visualizer-line-fill",
|
|
6
7
|
"--cui-audio-visualizer-line-stroke"
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
//#region src/knob-contracts/avatar-knobs.d.ts
|
|
2
|
-
declare const avatarKnobs: readonly ["--cui-avatar-radius", "--cui-avatar-group-ring-color", "--cui-avatar-fallback-background", "--cui-avatar-fallback-foreground"];
|
|
3
|
-
type AvatarKnobStyle = Partial<Record<(typeof avatarKnobs)[number], string>>;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { AvatarKnobStyle, avatarKnobs };
|
|
2
|
+
export declare const avatarKnobs: readonly ["--cui-avatar-radius", "--cui-avatar-group-ring-color", "--cui-avatar-fallback-background", "--cui-avatar-fallback-foreground", "--cui-avatar-image-outline-color"];
|
|
3
|
+
export type AvatarKnobStyle = Partial<Record<(typeof avatarKnobs)[number], string>>;
|
|
4
|
+
//#endregion
|
|
@@ -3,7 +3,8 @@ const avatarKnobs = [
|
|
|
3
3
|
"--cui-avatar-radius",
|
|
4
4
|
"--cui-avatar-group-ring-color",
|
|
5
5
|
"--cui-avatar-fallback-background",
|
|
6
|
-
"--cui-avatar-fallback-foreground"
|
|
6
|
+
"--cui-avatar-fallback-foreground",
|
|
7
|
+
"--cui-avatar-image-outline-color"
|
|
7
8
|
];
|
|
8
9
|
//#endregion
|
|
9
10
|
export { avatarKnobs };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
//#region src/knob-contracts/badge-knobs.d.ts
|
|
2
|
-
declare const badgeKnobs: readonly ["--cui-badge-radius", "--cui-badge-background", "--cui-badge-foreground", "--cui-badge-border-color"];
|
|
3
|
-
type BadgeKnobStyle = Partial<Record<(typeof badgeKnobs)[number], string>>;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { BadgeKnobStyle, badgeKnobs };
|
|
2
|
+
export declare const badgeKnobs: readonly ["--cui-badge-radius", "--cui-badge-background", "--cui-badge-foreground", "--cui-badge-border-color"];
|
|
3
|
+
export type BadgeKnobStyle = Partial<Record<(typeof badgeKnobs)[number], string>>;
|
|
4
|
+
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
//#region src/knob-contracts/button-group-knobs.d.ts
|
|
2
|
-
declare const buttonGroupKnobs: readonly ["--cui-button-group-text-radius", "--cui-button-group-text-background", "--cui-button-group-text-foreground", "--cui-button-group-separator-background"];
|
|
3
|
-
type ButtonGroupKnobStyle = Partial<Record<(typeof buttonGroupKnobs)[number], string>>;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { ButtonGroupKnobStyle, buttonGroupKnobs };
|
|
2
|
+
export declare const buttonGroupKnobs: readonly ["--cui-button-group-text-radius", "--cui-button-group-text-background", "--cui-button-group-text-foreground", "--cui-button-group-separator-background"];
|
|
3
|
+
export type ButtonGroupKnobStyle = Partial<Record<(typeof buttonGroupKnobs)[number], string>>;
|
|
4
|
+
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
//#region src/knob-contracts/button-knobs.d.ts
|
|
2
|
-
declare const buttonKnobs: readonly ["--cui-button-radius", "--cui-button-gap", "--cui-button-icon", "--cui-button-height", "--cui-button-padding-inline", "--cui-button-font-size", "--cui-button-background", "--cui-button-background-image", "--cui-button-foreground", "--cui-button-hover-background", "--cui-button-hover-foreground", "--cui-button-press-background", "--cui-button-press-scale", "--cui-button-active-background", "--cui-button-active-foreground", "--cui-button-active-hover-background", "--cui-button-shadow", "--cui-button-hover-shadow", "--cui-button-press-shadow", "--cui-button-active-shadow", "--cui-button-open-background", "--cui-button-open-foreground", "--cui-button-open-shadow"];
|
|
3
|
-
type ButtonKnobStyle = Partial<Record<(typeof buttonKnobs)[number], string>>;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { ButtonKnobStyle, buttonKnobs };
|
|
2
|
+
export declare const buttonKnobs: readonly ["--cui-button-radius", "--cui-button-gap", "--cui-button-icon", "--cui-button-height", "--cui-button-padding-inline", "--cui-button-icon-padding-inline", "--cui-button-font-size", "--cui-button-background", "--cui-button-background-image", "--cui-button-foreground", "--cui-button-hover-background", "--cui-button-hover-foreground", "--cui-button-press-background", "--cui-button-press-scale", "--cui-button-active-background", "--cui-button-active-foreground", "--cui-button-active-hover-background", "--cui-button-shadow", "--cui-button-hover-shadow", "--cui-button-press-shadow", "--cui-button-active-shadow", "--cui-button-open-background", "--cui-button-open-foreground", "--cui-button-open-shadow"];
|
|
3
|
+
export type ButtonKnobStyle = Partial<Record<(typeof buttonKnobs)[number], string>>;
|
|
4
|
+
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
//#region src/knob-contracts/calendar-knobs.d.ts
|
|
2
|
-
declare const calendarKnobs: readonly ["--cui-calendar-day-radius", "--cui-calendar-today-background", "--cui-calendar-selected-background", "--cui-calendar-selected-foreground", "--cui-calendar-range-background"];
|
|
3
|
-
type CalendarKnobStyle = Partial<Record<(typeof calendarKnobs)[number], string>>;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { CalendarKnobStyle, calendarKnobs };
|
|
2
|
+
export declare const calendarKnobs: readonly ["--cui-calendar-day-radius", "--cui-calendar-today-background", "--cui-calendar-selected-background", "--cui-calendar-selected-foreground", "--cui-calendar-range-background"];
|
|
3
|
+
export type CalendarKnobStyle = Partial<Record<(typeof calendarKnobs)[number], string>>;
|
|
4
|
+
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
//#region src/knob-contracts/card-knobs.d.ts
|
|
2
|
-
declare const cardKnobs: readonly ["--cui-card-radius", "--cui-card-background", "--cui-card-border-color", "--cui-card-border-width", "--cui-card-shadow", "--cui-card-backdrop-filter"];
|
|
3
|
-
type CardKnobStyle = Partial<Record<(typeof cardKnobs)[number], string>>;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { CardKnobStyle, cardKnobs };
|
|
2
|
+
export declare const cardKnobs: readonly ["--cui-card-radius", "--cui-card-background", "--cui-card-border-color", "--cui-card-border-width", "--cui-card-shadow", "--cui-card-backdrop-filter"];
|
|
3
|
+
export type CardKnobStyle = Partial<Record<(typeof cardKnobs)[number], string>>;
|
|
4
|
+
//#endregion
|