@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
package/dist/ui/sidebar.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
|
-
import {
|
|
3
|
+
import { useSkin } from "../skin-provider.js";
|
|
4
4
|
import { Button } from "./button.js";
|
|
5
5
|
import { ScrollArea } from "./scroll-area.js";
|
|
6
6
|
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from "./sheet.js";
|
|
7
|
-
import { SidebarProvider, useSidebar } from "./sidebar-provider.js";
|
|
7
|
+
import { SidebarProvider, SidebarSurfaceContext, useSidebar, useSidebarElements, useSidebarSurface } from "./sidebar-provider.js";
|
|
8
|
+
import { SidebarResizeRail } from "./sidebar-resize-rail.js";
|
|
8
9
|
import { SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarMenu, SidebarMenuAction, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, sidebarMenuButtonSizes, sidebarMenuButtonVariants } from "./sidebar-menu.js";
|
|
9
|
-
import {
|
|
10
|
+
import { useState } from "react";
|
|
11
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
12
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
13
|
import { PanelLeftIcon } from "lucide-react";
|
|
14
|
+
import { createPortal } from "react-dom";
|
|
11
15
|
//#region src/ui/sidebar.tsx
|
|
12
16
|
const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
13
17
|
const sidebarTriggerWidth = {
|
|
@@ -16,19 +20,64 @@ const sidebarTriggerWidth = {
|
|
|
16
20
|
md: "w-[var(--control-h-md)]",
|
|
17
21
|
lg: "w-[var(--control-h-lg)]"
|
|
18
22
|
};
|
|
19
|
-
function Sidebar({ side = "left",
|
|
23
|
+
function Sidebar({ side = "left", collapsible = "offcanvas", ...props }) {
|
|
24
|
+
const [railContainer, setRailContainer] = useState(null);
|
|
25
|
+
return /* @__PURE__ */ jsx(SidebarSurfaceContext.Provider, {
|
|
26
|
+
value: {
|
|
27
|
+
side,
|
|
28
|
+
collapsible,
|
|
29
|
+
railContainer
|
|
30
|
+
},
|
|
31
|
+
children: /* @__PURE__ */ jsx(SidebarSurface, {
|
|
32
|
+
...props,
|
|
33
|
+
railContainerRef: setRailContainer
|
|
34
|
+
})
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function SidebarSurface({ variant, ref, className, children, style, railContainerRef, ...props }) {
|
|
38
|
+
const { side, collapsible } = useSidebarSurface();
|
|
39
|
+
const { offcanvasRef } = useSidebarElements();
|
|
40
|
+
const skin = useSkin();
|
|
20
41
|
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
21
|
-
const resolvedVariant = variant ??
|
|
22
|
-
|
|
42
|
+
const resolvedVariant = variant ?? skin.sidebarLayout ?? "sidebar";
|
|
43
|
+
const container = useRender({
|
|
44
|
+
defaultTagName: "div",
|
|
45
|
+
ref: collapsible === "offcanvas" ? [ref ?? null, offcanvasRef] : ref,
|
|
46
|
+
props: {
|
|
47
|
+
...props,
|
|
48
|
+
"data-control-ui": "sidebar",
|
|
49
|
+
"data-control-family": "sidebar",
|
|
50
|
+
"data-slot": "container",
|
|
51
|
+
tabIndex: -1,
|
|
52
|
+
className: cn("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) lg:flex", side === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]", resolvedVariant === "floating" || resolvedVariant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)", className),
|
|
53
|
+
children: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
|
|
54
|
+
"data-control-ui": "sidebar",
|
|
55
|
+
"data-control-family": "sidebar",
|
|
56
|
+
"data-slot": "inner",
|
|
57
|
+
className: "flex h-full w-full flex-col",
|
|
58
|
+
inert: state === "collapsed" && collapsible === "offcanvas",
|
|
59
|
+
children
|
|
60
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
61
|
+
ref: railContainerRef,
|
|
62
|
+
className: "contents"
|
|
63
|
+
})] })
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
if (collapsible === "none") return /* @__PURE__ */ jsxs("div", {
|
|
23
67
|
ref,
|
|
24
68
|
"data-control-ui": "sidebar",
|
|
25
69
|
"data-control-family": "sidebar",
|
|
26
70
|
"data-slot": "root",
|
|
27
71
|
"data-surface": "panel",
|
|
28
|
-
|
|
72
|
+
"data-variant": resolvedVariant,
|
|
73
|
+
"data-side": side,
|
|
74
|
+
className: cn("group relative flex h-full w-(--sidebar-width) flex-col", className),
|
|
29
75
|
style,
|
|
30
76
|
...props,
|
|
31
|
-
children
|
|
77
|
+
children: [children, /* @__PURE__ */ jsx("div", {
|
|
78
|
+
ref: railContainerRef,
|
|
79
|
+
className: "contents"
|
|
80
|
+
})]
|
|
32
81
|
});
|
|
33
82
|
if (isMobile) {
|
|
34
83
|
const mobileSheetStyle = {
|
|
@@ -51,6 +100,7 @@ function Sidebar({ side = "left", variant, collapsible = "offcanvas", ref, class
|
|
|
51
100
|
"data-control-family": "sidebar",
|
|
52
101
|
"data-slot": "root",
|
|
53
102
|
"data-surface": "panel",
|
|
103
|
+
"data-variant": resolvedVariant,
|
|
54
104
|
"data-mobile": "",
|
|
55
105
|
"data-side": side,
|
|
56
106
|
className: cn("flex min-h-0 flex-1 flex-col", className),
|
|
@@ -68,7 +118,7 @@ function Sidebar({ side = "left", variant, collapsible = "offcanvas", ref, class
|
|
|
68
118
|
});
|
|
69
119
|
}
|
|
70
120
|
return /* @__PURE__ */ jsxs("div", {
|
|
71
|
-
className: "group peer hidden lg:block",
|
|
121
|
+
className: cn("group peer hidden lg:block", side === "right" && "order-last"),
|
|
72
122
|
"data-control-ui": "sidebar",
|
|
73
123
|
"data-control-family": "sidebar",
|
|
74
124
|
"data-slot": "root",
|
|
@@ -83,57 +133,72 @@ function Sidebar({ side = "left", variant, collapsible = "offcanvas", ref, class
|
|
|
83
133
|
"data-control-family": "sidebar",
|
|
84
134
|
"data-slot": "gap",
|
|
85
135
|
className: cn("relative w-(--sidebar-width)", "group-data-[collapsible=offcanvas]:w-0", resolvedVariant === "floating" || resolvedVariant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)")
|
|
86
|
-
}),
|
|
87
|
-
ref,
|
|
88
|
-
"data-control-ui": "sidebar",
|
|
89
|
-
"data-control-family": "sidebar",
|
|
90
|
-
"data-slot": "container",
|
|
91
|
-
className: cn("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) lg:flex", side === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]", resolvedVariant === "floating" || resolvedVariant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)", className),
|
|
92
|
-
...props,
|
|
93
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
94
|
-
"data-control-ui": "sidebar",
|
|
95
|
-
"data-control-family": "sidebar",
|
|
96
|
-
"data-slot": "inner",
|
|
97
|
-
className: "flex h-full w-full flex-col",
|
|
98
|
-
children
|
|
99
|
-
})
|
|
100
|
-
})]
|
|
136
|
+
}), container]
|
|
101
137
|
});
|
|
102
138
|
}
|
|
103
|
-
function SidebarTrigger({ className, onClick, size = "sm", ...props }) {
|
|
139
|
+
function SidebarTrigger({ className, onClick, size = "sm", ref, ...props }) {
|
|
104
140
|
const { toggleSidebar, isMobile, openMobile, open } = useSidebar();
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
className: "
|
|
120
|
-
|
|
121
|
-
|
|
141
|
+
const { triggerRef, railRef } = useSidebarElements();
|
|
142
|
+
return useRender({
|
|
143
|
+
defaultTagName: "button",
|
|
144
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
145
|
+
variant: "ghost",
|
|
146
|
+
size
|
|
147
|
+
}),
|
|
148
|
+
ref: [ref ?? null, triggerRef],
|
|
149
|
+
props: {
|
|
150
|
+
...props,
|
|
151
|
+
"data-control-ui": "sidebar",
|
|
152
|
+
"data-slot": "trigger",
|
|
153
|
+
"data-sidebar-trigger": "",
|
|
154
|
+
"aria-expanded": isMobile ? openMobile : open,
|
|
155
|
+
className: cn(sidebarTriggerWidth[size], "px-0", className),
|
|
156
|
+
onClick: (event) => {
|
|
157
|
+
onClick?.(event);
|
|
158
|
+
if (event.defaultPrevented) return;
|
|
159
|
+
toggleSidebar();
|
|
160
|
+
if (!isMobile && !open) railRef.current?.focus({ preventScroll: true });
|
|
161
|
+
},
|
|
162
|
+
children: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(PanelLeftIcon, { className: "size-4" }), /* @__PURE__ */ jsx("span", {
|
|
163
|
+
className: "sr-only",
|
|
164
|
+
children: "Toggle Sidebar"
|
|
165
|
+
})] })
|
|
166
|
+
}
|
|
122
167
|
});
|
|
123
168
|
}
|
|
124
|
-
function SidebarRail(
|
|
125
|
-
const {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
169
|
+
function SidebarRail(props) {
|
|
170
|
+
const { isMobile } = useSidebar();
|
|
171
|
+
const { railContainer } = useSidebarSurface();
|
|
172
|
+
if (isMobile || !railContainer) return null;
|
|
173
|
+
if (props.resizable) {
|
|
174
|
+
const { resizable, ...resizeProps } = props;
|
|
175
|
+
return createPortal(/* @__PURE__ */ jsx(SidebarResizeRail, { ...resizeProps }), railContainer);
|
|
176
|
+
}
|
|
177
|
+
const { resizable, ...toggleProps } = props;
|
|
178
|
+
return createPortal(/* @__PURE__ */ jsx(SidebarToggleRail, { ...toggleProps }), railContainer);
|
|
179
|
+
}
|
|
180
|
+
function SidebarToggleRail({ className, ref, onClick, ...props }) {
|
|
181
|
+
const { toggleSidebar, open } = useSidebar();
|
|
182
|
+
const { railRef } = useSidebarElements();
|
|
183
|
+
return useRender({
|
|
184
|
+
defaultTagName: "button",
|
|
185
|
+
ref: [ref ?? null, railRef],
|
|
186
|
+
props: {
|
|
187
|
+
...props,
|
|
188
|
+
type: "button",
|
|
189
|
+
"data-control-ui": "sidebar",
|
|
190
|
+
"data-control-family": "sidebar",
|
|
191
|
+
"data-slot": "rail",
|
|
192
|
+
"aria-label": props["aria-label"] ?? "Toggle Sidebar",
|
|
193
|
+
"aria-expanded": open,
|
|
194
|
+
tabIndex: -1,
|
|
195
|
+
onClick: (event) => {
|
|
196
|
+
onClick?.(event);
|
|
197
|
+
if (!event.defaultPrevented) toggleSidebar();
|
|
198
|
+
},
|
|
199
|
+
title: "Toggle Sidebar",
|
|
200
|
+
className: cn("absolute inset-y-0 z-20 hidden -translate-x-1/2 group-data-[side=left]:-right-4 group-data-[side=right]:left-0 lg:flex", "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize", "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize", "group-data-[collapsible=offcanvas]:translate-x-0", className)
|
|
201
|
+
}
|
|
137
202
|
});
|
|
138
203
|
}
|
|
139
204
|
function SidebarInset({ className, ...props }) {
|
package/dist/ui/skeleton.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { SkeletonKnobStyle } from "../knob-contracts/skeleton-knobs.js";
|
|
2
2
|
import { CSSProperties, ComponentProps } from "react";
|
|
3
3
|
//#region src/ui/skeleton.d.ts
|
|
4
|
-
declare
|
|
4
|
+
export declare const skeletonVariants: readonly ["shimmer", "pulse", "none"];
|
|
5
|
+
export type SkeletonVariant = (typeof skeletonVariants)[number];
|
|
6
|
+
export type SkeletonProps = Omit<ComponentProps<"div">, "style"> & {
|
|
5
7
|
style?: CSSProperties & SkeletonKnobStyle;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
8
|
+
variant?: SkeletonVariant;
|
|
9
|
+
};
|
|
10
|
+
export declare function Skeleton({ variant, className, ...props }: SkeletonProps): import("react").JSX.Element;
|
|
11
|
+
//#endregion
|
package/dist/ui/skeleton.js
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
//#region src/ui/skeleton.tsx
|
|
3
|
-
|
|
3
|
+
const skeletonVariants = [
|
|
4
|
+
"shimmer",
|
|
5
|
+
"pulse",
|
|
6
|
+
"none"
|
|
7
|
+
];
|
|
8
|
+
function Skeleton({ variant = "shimmer", className, ...props }) {
|
|
4
9
|
return /* @__PURE__ */ jsx("div", {
|
|
10
|
+
"aria-hidden": "true",
|
|
5
11
|
"data-control-ui": "skeleton",
|
|
6
12
|
"data-control-family": "skeleton",
|
|
7
13
|
"data-slot": "root",
|
|
14
|
+
"data-variant": variant,
|
|
8
15
|
className,
|
|
9
16
|
...props
|
|
10
17
|
});
|
|
11
18
|
}
|
|
12
19
|
//#endregion
|
|
13
|
-
export { Skeleton };
|
|
20
|
+
export { Skeleton, skeletonVariants };
|
package/dist/ui/slider.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { RangeKnobStyle } from "../knob-contracts/range-knobs.js";
|
|
2
2
|
import { CSSProperties } from "react";
|
|
3
3
|
//#region src/ui/slider.d.ts
|
|
4
|
-
type SliderVariant = "default" | "plain";
|
|
5
|
-
type SliderProps = Omit<{
|
|
4
|
+
export type SliderVariant = "default" | "plain";
|
|
5
|
+
export type SliderProps = Omit<{
|
|
6
6
|
variant?: SliderVariant;
|
|
7
7
|
value?: number;
|
|
8
8
|
defaultValue?: number;
|
|
9
9
|
onValueChange?: (value: number) => void;
|
|
10
|
+
onValueCommitted?: (value: number) => void;
|
|
11
|
+
orientation?: "horizontal" | "vertical";
|
|
10
12
|
min?: number;
|
|
11
13
|
max?: number;
|
|
12
14
|
step?: number;
|
|
@@ -19,6 +21,5 @@ type SliderProps = Omit<{
|
|
|
19
21
|
}, "style"> & {
|
|
20
22
|
style?: CSSProperties & RangeKnobStyle;
|
|
21
23
|
};
|
|
22
|
-
declare function Slider({ className, variant, label, showValue, formatValue, value, defaultValue, onValueChange, min, max, step, disabled, style, ...props }: SliderProps): import("react").JSX.Element;
|
|
23
|
-
//#endregion
|
|
24
|
-
export { Slider, SliderProps, SliderVariant };
|
|
24
|
+
export declare function Slider({ className, variant, label, showValue, formatValue, value, defaultValue, onValueChange, onValueCommitted, orientation, min, max, step, disabled, style, "aria-label": ariaLabel, ...props }: SliderProps): import("react").JSX.Element;
|
|
25
|
+
//#endregion
|
package/dist/ui/slider.js
CHANGED
|
@@ -17,19 +17,17 @@ function displaySliderValue(values, formatValue) {
|
|
|
17
17
|
if (value === void 0) return "";
|
|
18
18
|
return formatValue ? formatValue(value) : Math.round(value);
|
|
19
19
|
}
|
|
20
|
-
function Slider({ className, variant = "default", label, showValue, formatValue, value, defaultValue, onValueChange, min = 0, max = 100, step, disabled, style, ...props }) {
|
|
20
|
+
function Slider({ className, variant = "default", label, showValue, formatValue, value, defaultValue, onValueChange, onValueCommitted, orientation = "horizontal", min = 0, max = 100, step, disabled, style, "aria-label": ariaLabel, ...props }) {
|
|
21
21
|
const showValueResolved = showValue ?? Boolean(label);
|
|
22
22
|
const labeled = variant === "plain" && (label !== void 0 || showValue === true);
|
|
23
23
|
const ticks = labeled ? tickPositions(min, max, step) : [];
|
|
24
|
-
const trackStyle = style;
|
|
25
|
-
const indicatorStyle = style;
|
|
26
|
-
const thumbStyle = style;
|
|
27
24
|
return /* @__PURE__ */ jsxs(Slider$1.Root, {
|
|
28
25
|
"data-control-ui": "slider",
|
|
29
26
|
"data-range-kind": "slider",
|
|
30
27
|
"data-slot": "root",
|
|
31
28
|
"data-control-family": "range",
|
|
32
29
|
"data-variant": variant,
|
|
30
|
+
orientation,
|
|
33
31
|
"data-labeled": labeled ? "true" : void 0,
|
|
34
32
|
value,
|
|
35
33
|
defaultValue,
|
|
@@ -37,8 +35,9 @@ function Slider({ className, variant = "default", label, showValue, formatValue,
|
|
|
37
35
|
max,
|
|
38
36
|
step,
|
|
39
37
|
disabled,
|
|
40
|
-
onValueChange
|
|
41
|
-
|
|
38
|
+
onValueChange,
|
|
39
|
+
onValueCommitted,
|
|
40
|
+
className: cn("group relative flex cursor-pointer select-none items-center data-[disabled]:cursor-not-allowed", orientation === "vertical" ? "min-h-20 w-fit touch-pan-x" : "w-full touch-pan-y", className),
|
|
42
41
|
style,
|
|
43
42
|
...props,
|
|
44
43
|
children: [/* @__PURE__ */ jsx(Slider$1.Control, {
|
|
@@ -47,7 +46,7 @@ function Slider({ className, variant = "default", label, showValue, formatValue,
|
|
|
47
46
|
"data-range-kind": "slider",
|
|
48
47
|
"data-slot": "control",
|
|
49
48
|
"data-labeled": labeled ? "true" : void 0,
|
|
50
|
-
className: "flex
|
|
49
|
+
className: cn("flex items-center", orientation === "vertical" ? "h-full" : "w-full"),
|
|
51
50
|
children: /* @__PURE__ */ jsxs(Slider$1.Track, {
|
|
52
51
|
"data-control-ui": "slider",
|
|
53
52
|
"data-control-family": "range",
|
|
@@ -55,8 +54,8 @@ function Slider({ className, variant = "default", label, showValue, formatValue,
|
|
|
55
54
|
"data-slot": "track",
|
|
56
55
|
"data-variant": variant,
|
|
57
56
|
"data-labeled": labeled ? "true" : void 0,
|
|
58
|
-
className: "relative
|
|
59
|
-
style
|
|
57
|
+
className: cn("relative grow", orientation === "vertical" ? "h-full" : "w-full"),
|
|
58
|
+
style,
|
|
60
59
|
children: [
|
|
61
60
|
/* @__PURE__ */ jsx(Slider$1.Indicator, {
|
|
62
61
|
"data-control-ui": "slider",
|
|
@@ -64,7 +63,7 @@ function Slider({ className, variant = "default", label, showValue, formatValue,
|
|
|
64
63
|
"data-range-kind": "slider",
|
|
65
64
|
"data-slot": "indicator",
|
|
66
65
|
"data-variant": variant,
|
|
67
|
-
style
|
|
66
|
+
style
|
|
68
67
|
}),
|
|
69
68
|
ticks.map((pct) => /* @__PURE__ */ jsx("span", {
|
|
70
69
|
"aria-hidden": true,
|
|
@@ -72,17 +71,21 @@ function Slider({ className, variant = "default", label, showValue, formatValue,
|
|
|
72
71
|
"data-control-family": "range",
|
|
73
72
|
"data-range-kind": "slider",
|
|
74
73
|
"data-slot": "tick",
|
|
75
|
-
className: "pointer-events-none absolute
|
|
76
|
-
style: {
|
|
74
|
+
className: "pointer-events-none absolute",
|
|
75
|
+
style: orientation === "vertical" ? { bottom: `${pct}%` } : {
|
|
76
|
+
left: `${pct}%`,
|
|
77
|
+
bottom: 0
|
|
78
|
+
}
|
|
77
79
|
}, pct)),
|
|
78
80
|
/* @__PURE__ */ jsx(Slider$1.Thumb, {
|
|
81
|
+
"aria-label": ariaLabel,
|
|
79
82
|
"data-control-ui": "slider",
|
|
80
83
|
"data-control-family": "range",
|
|
81
84
|
"data-range-kind": "slider",
|
|
82
85
|
"data-slot": "thumb",
|
|
83
86
|
"data-variant": variant,
|
|
84
87
|
className: cn("block", variant === "plain" && "after:absolute after:-inset-3 after:content-['']"),
|
|
85
|
-
style
|
|
88
|
+
style
|
|
86
89
|
})
|
|
87
90
|
]
|
|
88
91
|
})
|
package/dist/ui/spinner.d.ts
CHANGED
|
@@ -2,11 +2,10 @@ import { ControlSize } from "../control-variants.js";
|
|
|
2
2
|
import { SpinnerKnobStyle } from "../knob-contracts/spinner-knobs.js";
|
|
3
3
|
import { CSSProperties, ComponentProps } from "react";
|
|
4
4
|
//#region src/ui/spinner.d.ts
|
|
5
|
-
type SpinnerProps = Omit<ComponentProps<"span"> & {
|
|
5
|
+
export type SpinnerProps = Omit<ComponentProps<"span"> & {
|
|
6
6
|
size?: ControlSize;
|
|
7
7
|
}, "style"> & {
|
|
8
8
|
style?: CSSProperties & SpinnerKnobStyle;
|
|
9
9
|
};
|
|
10
|
-
declare function Spinner({ size, className, ...props }: SpinnerProps): import("react").JSX.Element;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { Spinner, SpinnerProps };
|
|
10
|
+
export declare function Spinner({ size, className, ...props }: SpinnerProps): import("react").JSX.Element;
|
|
11
|
+
//#endregion
|
package/dist/ui/stepper.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { StepperKnobStyle } from "../knob-contracts/stepper-knobs.js";
|
|
2
2
|
import { CSSProperties, ComponentProps } from "react";
|
|
3
3
|
//#region src/ui/stepper.d.ts
|
|
4
|
-
type StepperOrientation = "horizontal" | "vertical";
|
|
5
|
-
type StepperContentMode = "current" | "all";
|
|
6
|
-
type StepperState = "neutral" | "complete" | "current" | "upcoming";
|
|
7
|
-
type StepperProps = Omit<ComponentProps<"div">, "defaultValue" | "onChange"> & {
|
|
4
|
+
export type StepperOrientation = "horizontal" | "vertical";
|
|
5
|
+
export type StepperContentMode = "current" | "all";
|
|
6
|
+
export type StepperState = "neutral" | "complete" | "current" | "upcoming";
|
|
7
|
+
export type StepperProps = Omit<ComponentProps<"div">, "defaultValue" | "onChange"> & {
|
|
8
8
|
value?: number | null;
|
|
9
9
|
defaultValue?: number | null;
|
|
10
10
|
onValueChange?: (value: number) => void;
|
|
@@ -14,45 +14,44 @@ type StepperProps = Omit<ComponentProps<"div">, "defaultValue" | "onChange"> & {
|
|
|
14
14
|
} & {
|
|
15
15
|
style?: CSSProperties & StepperKnobStyle;
|
|
16
16
|
};
|
|
17
|
-
type StepperListProps = ComponentProps<"ol"> & {
|
|
17
|
+
export type StepperListProps = ComponentProps<"ol"> & {
|
|
18
18
|
style?: CSSProperties & StepperKnobStyle;
|
|
19
19
|
};
|
|
20
|
-
type StepperItemProps = Omit<ComponentProps<"li">, "value"> & {
|
|
20
|
+
export type StepperItemProps = Omit<ComponentProps<"li">, "value"> & {
|
|
21
21
|
step: number;
|
|
22
22
|
disabled?: boolean;
|
|
23
23
|
invalid?: boolean;
|
|
24
24
|
} & {
|
|
25
25
|
style?: CSSProperties & StepperKnobStyle;
|
|
26
26
|
};
|
|
27
|
-
type StepperTriggerProps = Omit<ComponentProps<"button">, "style"> & {
|
|
27
|
+
export type StepperTriggerProps = Omit<ComponentProps<"button">, "style"> & {
|
|
28
28
|
style?: CSSProperties & StepperKnobStyle;
|
|
29
29
|
};
|
|
30
|
-
type StepperIndicatorProps = Omit<ComponentProps<"span">, "style"> & {
|
|
30
|
+
export type StepperIndicatorProps = Omit<ComponentProps<"span">, "style"> & {
|
|
31
31
|
style?: CSSProperties & StepperKnobStyle;
|
|
32
32
|
};
|
|
33
|
-
type StepperSeparatorProps = Omit<ComponentProps<"span">, "style"> & {
|
|
33
|
+
export type StepperSeparatorProps = Omit<ComponentProps<"span">, "style"> & {
|
|
34
34
|
style?: CSSProperties & StepperKnobStyle;
|
|
35
35
|
};
|
|
36
|
-
type StepperTitleProps = Omit<ComponentProps<"span">, "style"> & {
|
|
36
|
+
export type StepperTitleProps = Omit<ComponentProps<"span">, "style"> & {
|
|
37
37
|
style?: CSSProperties & StepperKnobStyle;
|
|
38
38
|
};
|
|
39
|
-
type StepperDescriptionProps = Omit<ComponentProps<"span">, "style"> & {
|
|
39
|
+
export type StepperDescriptionProps = Omit<ComponentProps<"span">, "style"> & {
|
|
40
40
|
style?: CSSProperties & StepperKnobStyle;
|
|
41
41
|
};
|
|
42
|
-
type StepperContentProps = ComponentProps<"section"> & {
|
|
42
|
+
export type StepperContentProps = ComponentProps<"section"> & {
|
|
43
43
|
step: number;
|
|
44
44
|
keepMounted?: boolean;
|
|
45
45
|
} & {
|
|
46
46
|
style?: CSSProperties & StepperKnobStyle;
|
|
47
47
|
};
|
|
48
|
-
declare function Stepper({ value, defaultValue, onValueChange, orientation, contentMode, responsive, id, className, children, ...props }: StepperProps): import("react").JSX.Element;
|
|
49
|
-
declare function StepperList({ className, ...props }: StepperListProps): import("react").JSX.Element;
|
|
50
|
-
declare function StepperItem({ step, disabled, invalid, className, children, ...props }: StepperItemProps): import("react").JSX.Element;
|
|
51
|
-
declare function StepperTrigger({ disabled: disabledProp, className, onClick, type, ...props }: StepperTriggerProps): import("react").JSX.Element;
|
|
52
|
-
declare function StepperIndicator({ className, children, ...props }: StepperIndicatorProps): import("react").JSX.Element;
|
|
53
|
-
declare function StepperSeparator({ className, ...props }: StepperSeparatorProps): import("react").JSX.Element;
|
|
54
|
-
declare function StepperTitle({ className, ...props }: StepperTitleProps): import("react").JSX.Element;
|
|
55
|
-
declare function StepperDescription({ className, ...props }: StepperDescriptionProps): import("react").JSX.Element;
|
|
56
|
-
declare function StepperContent({ step, keepMounted, className, ...props }: StepperContentProps): import("react").JSX.Element | null;
|
|
57
|
-
//#endregion
|
|
58
|
-
export { Stepper, StepperContent, StepperContentMode, StepperContentProps, StepperDescription, StepperDescriptionProps, StepperIndicator, StepperIndicatorProps, StepperItem, StepperItemProps, StepperList, StepperListProps, StepperOrientation, StepperProps, StepperSeparator, StepperSeparatorProps, StepperState, StepperTitle, StepperTitleProps, StepperTrigger, StepperTriggerProps };
|
|
48
|
+
export declare function Stepper({ value, defaultValue, onValueChange, orientation, contentMode, responsive, id, className, children, ...props }: StepperProps): import("react").JSX.Element;
|
|
49
|
+
export declare function StepperList({ className, ...props }: StepperListProps): import("react").JSX.Element;
|
|
50
|
+
export declare function StepperItem({ step, disabled, invalid, className, children, ...props }: StepperItemProps): import("react").JSX.Element;
|
|
51
|
+
export declare function StepperTrigger({ disabled: disabledProp, className, onClick, type, ...props }: StepperTriggerProps): import("react").JSX.Element;
|
|
52
|
+
export declare function StepperIndicator({ className, children, ...props }: StepperIndicatorProps): import("react").JSX.Element;
|
|
53
|
+
export declare function StepperSeparator({ className, ...props }: StepperSeparatorProps): import("react").JSX.Element;
|
|
54
|
+
export declare function StepperTitle({ className, ...props }: StepperTitleProps): import("react").JSX.Element;
|
|
55
|
+
export declare function StepperDescription({ className, ...props }: StepperDescriptionProps): import("react").JSX.Element;
|
|
56
|
+
export declare function StepperContent({ step, keepMounted, className, ...props }: StepperContentProps): import("react").JSX.Element | null;
|
|
57
|
+
//#endregion
|
package/dist/ui/switch.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SwitchKnobStyle } from "../knob-contracts/switch-knobs.js";
|
|
2
2
|
import { CSSProperties, ReactNode } from "react";
|
|
3
3
|
//#region src/ui/switch.d.ts
|
|
4
|
-
type SwitchProps = Omit<{
|
|
4
|
+
export type SwitchProps = Omit<{
|
|
5
5
|
checked?: boolean;
|
|
6
6
|
defaultChecked?: boolean;
|
|
7
7
|
onCheckedChange?: (checked: boolean) => void;
|
|
@@ -21,6 +21,5 @@ type SwitchProps = Omit<{
|
|
|
21
21
|
}, "style"> & {
|
|
22
22
|
style?: CSSProperties & SwitchKnobStyle;
|
|
23
23
|
};
|
|
24
|
-
declare function Switch({ className, checked, defaultChecked, onCheckedChange, disabled, readOnly, required, name, value, id, icon, checkedIcon, uncheckedIcon, ...props }: SwitchProps): import("react").JSX.Element;
|
|
25
|
-
//#endregion
|
|
26
|
-
export { Switch, SwitchProps };
|
|
24
|
+
export declare function Switch({ className, checked, defaultChecked, onCheckedChange, disabled, readOnly, required, name, value, id, icon, checkedIcon, uncheckedIcon, style, ...props }: SwitchProps): import("react").JSX.Element;
|
|
25
|
+
//#endregion
|
package/dist/ui/switch.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { useSwitchDrag } from "./use-switch-drag.js";
|
|
3
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
import { Switch as Switch$1 } from "@base-ui/react/switch";
|
|
5
6
|
//#region src/ui/switch.tsx
|
|
6
|
-
function Switch({ className, checked, defaultChecked, onCheckedChange, disabled, readOnly, required, name, value, id, icon, checkedIcon, uncheckedIcon, ...props }) {
|
|
7
|
+
function Switch({ className, checked, defaultChecked, onCheckedChange, disabled, readOnly, required, name, value, id, icon, checkedIcon, uncheckedIcon, style, ...props }) {
|
|
8
|
+
const { thumbRef, dragProps, dragProgress } = useSwitchDrag();
|
|
9
|
+
const dragStyle = { "--_switch-drag-progress": dragProgress ?? 0 };
|
|
7
10
|
const hasStateIcons = checkedIcon !== void 0 || uncheckedIcon !== void 0;
|
|
8
11
|
const hasIcon = icon !== void 0 || hasStateIcons;
|
|
9
12
|
const singleIcon = hasStateIcons ? void 0 : icon;
|
|
@@ -13,6 +16,12 @@ function Switch({ className, checked, defaultChecked, onCheckedChange, disabled,
|
|
|
13
16
|
"data-control-ui": "switch",
|
|
14
17
|
"data-control-family": "switch",
|
|
15
18
|
"data-slot": "root",
|
|
19
|
+
"data-dragging": dragProgress !== null ? "" : void 0,
|
|
20
|
+
"data-drag-checked": dragProgress === null ? void 0 : dragProgress >= .5,
|
|
21
|
+
style: {
|
|
22
|
+
...style,
|
|
23
|
+
...dragStyle
|
|
24
|
+
},
|
|
16
25
|
checked,
|
|
17
26
|
defaultChecked,
|
|
18
27
|
onCheckedChange,
|
|
@@ -26,7 +35,9 @@ function Switch({ className, checked, defaultChecked, onCheckedChange, disabled,
|
|
|
26
35
|
render: /* @__PURE__ */ jsx("button", { type: "button" }),
|
|
27
36
|
className: cn("relative inline-flex shrink-0 cursor-pointer items-center", "data-[disabled]:cursor-not-allowed", className),
|
|
28
37
|
...props,
|
|
38
|
+
...dragProps,
|
|
29
39
|
children: /* @__PURE__ */ jsx(Switch$1.Thumb, {
|
|
40
|
+
ref: thumbRef,
|
|
30
41
|
"data-control-ui": "switch",
|
|
31
42
|
"data-control-family": "switch",
|
|
32
43
|
"data-slot": "thumb",
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import { TableOfContentsKnobStyle } from "../knob-contracts/table-of-contents-knobs.js";
|
|
2
2
|
import { CSSProperties, ComponentProps } from "react";
|
|
3
3
|
//#region src/ui/table-of-contents.d.ts
|
|
4
|
-
type TocItem = {
|
|
4
|
+
export type TocItem = {
|
|
5
5
|
href: string;
|
|
6
6
|
label: string;
|
|
7
7
|
level?: number;
|
|
8
8
|
children?: TocItem[];
|
|
9
9
|
};
|
|
10
|
-
declare const tableOfContentsVariants: readonly ["background", "trail", "both"];
|
|
11
|
-
type TableOfContentsVariant = (typeof tableOfContentsVariants)[number];
|
|
12
|
-
type TableOfContentsProps = Omit<Omit<ComponentProps<"nav">, "children">, "style"> & {
|
|
10
|
+
export declare const tableOfContentsVariants: readonly ["background", "trail", "both"];
|
|
11
|
+
export type TableOfContentsVariant = (typeof tableOfContentsVariants)[number];
|
|
12
|
+
export type TableOfContentsProps = Omit<Omit<ComponentProps<"nav">, "children">, "style"> & {
|
|
13
13
|
style?: CSSProperties & TableOfContentsKnobStyle;
|
|
14
14
|
} & {
|
|
15
15
|
items: TocItem[];
|
|
16
16
|
label?: string;
|
|
17
17
|
variant?: TableOfContentsVariant;
|
|
18
18
|
};
|
|
19
|
-
declare function useVisibleSections(ids: string[]): string[];
|
|
20
|
-
declare function TableOfContents({ items, label, variant, className, style, ...props }: TableOfContentsProps): import("react").JSX.Element | null;
|
|
21
|
-
//#endregion
|
|
22
|
-
export { TableOfContents, TableOfContentsProps, TableOfContentsVariant, TocItem, tableOfContentsVariants, useVisibleSections };
|
|
19
|
+
export declare function useVisibleSections(ids: string[]): string[];
|
|
20
|
+
export declare function TableOfContents({ items, label, variant, className, style, ...props }: TableOfContentsProps): import("react").JSX.Element | null;
|
|
21
|
+
//#endregion
|
|
@@ -114,7 +114,7 @@ function TableOfContents({ items, label = "On this page", variant = "both", clas
|
|
|
114
114
|
"data-control-ui": "table-of-contents",
|
|
115
115
|
"data-control-family": "table-of-contents",
|
|
116
116
|
"data-slot": "rail",
|
|
117
|
-
className: "pointer-events-none absolute inset-y-0
|
|
117
|
+
className: "pointer-events-none absolute inset-y-0 start-0 -z-20"
|
|
118
118
|
}),
|
|
119
119
|
/* @__PURE__ */ jsx(TrackHighlight, {
|
|
120
120
|
"data-variant": variant,
|
|
@@ -127,7 +127,7 @@ function TableOfContents({ items, label = "On this page", variant = "both", clas
|
|
|
127
127
|
"data-control-ui": "table-of-contents",
|
|
128
128
|
"data-control-family": "table-of-contents",
|
|
129
129
|
"data-slot": "trail",
|
|
130
|
-
className: "absolute inset-y-0
|
|
130
|
+
className: "absolute inset-y-0 start-0"
|
|
131
131
|
})
|
|
132
132
|
}),
|
|
133
133
|
/* @__PURE__ */ jsx(TocList, {
|
|
@@ -149,6 +149,7 @@ function TocList({ items, activeSet, variant, root = false }) {
|
|
|
149
149
|
children: items.map((item) => {
|
|
150
150
|
const targetId = item.href.replace(/^#/, "");
|
|
151
151
|
const isActive = activeSet.has(targetId);
|
|
152
|
+
const itemStyle = { "--_toc-depth": item.depth };
|
|
152
153
|
return /* @__PURE__ */ jsxs("li", { children: [/* @__PURE__ */ jsx("a", {
|
|
153
154
|
"data-control-ui": "table-of-contents",
|
|
154
155
|
"data-control-family": "table-of-contents",
|
|
@@ -160,6 +161,7 @@ function TocList({ items, activeSet, variant, root = false }) {
|
|
|
160
161
|
"aria-current": isActive ? "location" : void 0,
|
|
161
162
|
href: item.href,
|
|
162
163
|
className: "block",
|
|
164
|
+
style: itemStyle,
|
|
163
165
|
children: item.label
|
|
164
166
|
}), item.children && /* @__PURE__ */ jsx(TocList, {
|
|
165
167
|
items: item.children,
|