@ctrl-ui/react 0.8.1 → 0.8.4
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/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/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 +12 -21
- package/dist/chat-layout.js +28 -83
- package/dist/chat-message.d.ts +14 -15
- package/dist/context-model.d.ts +7 -8
- package/dist/context.d.ts +21 -22
- 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.d.ts +6 -7
- package/dist/email/email.js +12 -3
- package/dist/email/length.d.ts +3 -0
- package/dist/email/length.js +34 -0
- package/dist/email/templates.d.ts +7 -8
- package/dist/email/templates.js +5 -5
- package/dist/email/theme.d.ts +16 -5
- package/dist/email/theme.js +21 -6
- 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 +7 -8
- 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 +6 -7
- package/dist/inline-attachment.d.ts +16 -17
- 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/activity-knobs.d.ts +3 -4
- 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/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 +3 -1
- package/dist/knob-contracts/chat-composer-knobs.d.ts +3 -4
- package/dist/knob-contracts/chat-composer-knobs.js +1 -0
- package/dist/knob-contracts/chat-layout-knobs.d.ts +3 -4
- package/dist/knob-contracts/chat-layout-knobs.js +2 -3
- package/dist/knob-contracts/chat-message-knobs.d.ts +3 -4
- 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/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 +2 -1
- package/dist/knob-contracts/inline-citation-knobs.d.ts +3 -4
- package/dist/knob-contracts/inline-citation-knobs.js +1 -0
- 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/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 +1 -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 +1 -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-input-format.js +1 -1
- 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/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 +2 -4
- package/dist/styles/recipes/accordion.css +8 -2
- package/dist/styles/recipes/action-bar.css +5 -2
- package/dist/styles/recipes/alert.css +95 -16
- package/dist/styles/recipes/avatar.css +17 -1
- package/dist/styles/recipes/badge.css +0 -1
- package/dist/styles/recipes/button.css +34 -8
- package/dist/styles/recipes/calendar.css +0 -6
- package/dist/styles/recipes/chat-composer-attachment.css +51 -53
- package/dist/styles/recipes/chat-composer.css +26 -21
- package/dist/styles/recipes/chat-layout.css +21 -62
- package/dist/styles/recipes/chat-message.css +11 -5
- package/dist/styles/recipes/choice.css +9 -2
- package/dist/styles/recipes/code-diff.css +8 -1
- package/dist/styles/recipes/code.css +39 -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/dockable-panel.css +8 -1
- package/dist/styles/recipes/dropzone.css +9 -2
- package/dist/styles/recipes/empty.css +118 -17
- package/dist/styles/recipes/environment-variables.css +8 -1
- package/dist/styles/recipes/field-parts.css +1 -6
- package/dist/styles/recipes/field.css +9 -5
- package/dist/styles/recipes/gradient-editor.css +16 -5
- package/dist/styles/recipes/inline-attachment.css +13 -8
- package/dist/styles/recipes/inline-citation.css +8 -4
- package/dist/styles/recipes/item.css +1 -1
- package/dist/styles/recipes/kbd.css +8 -0
- package/dist/styles/recipes/markdown-block.css +16 -2
- package/dist/styles/recipes/markdown.css +12 -0
- package/dist/styles/recipes/morphing-panel.css +1 -1
- package/dist/styles/recipes/pagination.css +0 -4
- package/dist/styles/recipes/phone-input.css +8 -4
- package/dist/styles/recipes/popup-lists.css +11 -0
- package/dist/styles/recipes/popup-toast.css +1 -29
- package/dist/styles/recipes/popup.css +2 -2
- package/dist/styles/recipes/progressive-blur.css +28 -7
- package/dist/styles/recipes/range.css +50 -1
- package/dist/styles/recipes/resizable.css +8 -10
- package/dist/styles/recipes/rich-tooltip.css +0 -4
- package/dist/styles/recipes/scroll-area.css +8 -2
- package/dist/styles/recipes/sidebar-menu.css +150 -0
- package/dist/styles/recipes/sidebar.css +56 -110
- package/dist/styles/recipes/skeleton.css +85 -3
- package/dist/styles/recipes/source-badge.css +0 -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 +19 -2
- package/dist/styles/recipes/task-list.css +8 -2
- package/dist/styles/recipes/thread-rail.css +0 -4
- package/dist/styles/recipes/toolbar.css +18 -4
- package/dist/styles/recipes/track-highlight.css +63 -5
- package/dist/styles/recipes/tree.css +2 -0
- package/dist/styles/recipes/user-ask.css +8 -4
- package/dist/styles/theme.css +130 -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/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 +8 -6
- 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 +5 -3
- 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 +5 -3
- package/dist/ui/combobox-disabled-selection.d.ts +3 -4
- package/dist/ui/combobox.d.ts +21 -20
- package/dist/ui/combobox.js +5 -3
- package/dist/ui/command.d.ts +19 -18
- package/dist/ui/command.js +38 -12
- package/dist/ui/context-menu.d.ts +30 -31
- package/dist/ui/context-menu.js +8 -5
- package/dist/ui/dialog.d.ts +13 -13
- package/dist/ui/dialog.js +10 -8
- 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 +7 -6
- package/dist/ui/dropdown-menu.d.ts +36 -29
- package/dist/ui/dropdown-menu.js +116 -9
- package/dist/ui/dropzone.d.ts +24 -24
- 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/hover-card.d.ts +6 -7
- package/dist/ui/hover-card.js +5 -3
- package/dist/ui/infinite-canvas.d.ts +11 -12
- 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 +8 -5
- 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 +5 -3
- package/dist/ui/number-field.d.ts +15 -16
- package/dist/ui/pagination.d.ts +10 -11
- package/dist/ui/phone-input.d.ts +5 -6
- package/dist/ui/phone-input.js +40 -37
- package/dist/ui/popover.d.ts +11 -12
- package/dist/ui/popover.js +5 -3
- 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/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 +5 -5
- 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 +7 -4
- package/dist/ui/separator.d.ts +2 -3
- package/dist/ui/sheet.d.ts +8 -9
- package/dist/ui/sheet.js +7 -5
- package/dist/ui/sidebar-menu.d.ts +24 -15
- package/dist/ui/sidebar-menu.js +30 -4
- 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 +20 -14
- package/dist/ui/sidebar.js +122 -57
- 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 +21 -14
- 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 +7 -8
- 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 +5 -3
- 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 +24 -25
- package/package.json +15 -15
- 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/combobox.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
|
-
import {
|
|
3
|
+
import { controlEffectsAttribute } from "../skin.js";
|
|
4
|
+
import { useSkin } from "../skin-provider.js";
|
|
4
5
|
import { popupItemStructureClasses } from "../surface-variants.js";
|
|
5
6
|
import { emitComboboxValueChange } from "./combobox-disabled-selection.js";
|
|
6
7
|
import { createContext, use, useEffect, useState } from "react";
|
|
@@ -76,13 +77,14 @@ function ComboboxInput({ size = "md", className, ...props }) {
|
|
|
76
77
|
});
|
|
77
78
|
}
|
|
78
79
|
function ComboboxContent({ className, children, sideOffset = 6, ...props }) {
|
|
80
|
+
const skin = useSkin();
|
|
79
81
|
return /* @__PURE__ */ jsx(Combobox$1.Portal, { children: /* @__PURE__ */ jsx(Combobox$1.Positioner, {
|
|
80
82
|
"data-control-ui": "combobox",
|
|
81
83
|
"data-popup-kind": "combobox",
|
|
82
84
|
"data-control-family": "popup",
|
|
83
85
|
"data-slot": "positioner",
|
|
84
|
-
"data-skin":
|
|
85
|
-
"data-effects":
|
|
86
|
+
"data-skin": skin.id,
|
|
87
|
+
"data-effects": controlEffectsAttribute(skin.effects),
|
|
86
88
|
side: "bottom",
|
|
87
89
|
align: "start",
|
|
88
90
|
sideOffset,
|
package/dist/ui/command.d.ts
CHANGED
|
@@ -3,42 +3,43 @@ import { Dialog } from "./dialog.js";
|
|
|
3
3
|
import { CSSProperties, ComponentProps } from "react";
|
|
4
4
|
import { Command as Command$1 } from "cmdk";
|
|
5
5
|
//#region src/ui/command.d.ts
|
|
6
|
-
type
|
|
6
|
+
export type CommandChrome = "standalone" | "embedded";
|
|
7
|
+
export type CommandProps = Omit<ComponentProps<typeof Command$1>, "style"> & {
|
|
8
|
+
chrome?: CommandChrome;
|
|
7
9
|
style?: CSSProperties & PopupKnobStyle;
|
|
8
10
|
};
|
|
9
|
-
declare function Command({ className, ...props }: CommandProps): import("react").JSX.Element;
|
|
10
|
-
declare function CommandDialog({ title, description, children, className, commandProps, ...props }: ComponentProps<typeof Dialog> & {
|
|
11
|
+
export declare function Command({ chrome, className, ...props }: CommandProps): import("react").JSX.Element;
|
|
12
|
+
export declare function CommandDialog({ title, description, children, className, commandProps, ...props }: ComponentProps<typeof Dialog> & {
|
|
11
13
|
title?: string;
|
|
12
14
|
description?: string;
|
|
13
15
|
className?: string;
|
|
14
16
|
commandProps?: ComponentProps<typeof Command>;
|
|
15
17
|
}): import("react").JSX.Element;
|
|
16
|
-
type CommandInputProps = Omit<ComponentProps<typeof Command$1.Input>, "style"> & {
|
|
18
|
+
export type CommandInputProps = Omit<ComponentProps<typeof Command$1.Input>, "style"> & {
|
|
17
19
|
style?: CSSProperties & PopupKnobStyle;
|
|
18
20
|
};
|
|
19
|
-
declare function CommandInput({ className, ...props }: CommandInputProps): import("react").JSX.Element;
|
|
20
|
-
declare function CommandList({ className, ...props }: ComponentProps<typeof Command$1.List> & {
|
|
21
|
+
export declare function CommandInput({ className, ...props }: CommandInputProps): import("react").JSX.Element;
|
|
22
|
+
export declare function CommandList({ className, children, ...props }: ComponentProps<typeof Command$1.List> & {
|
|
21
23
|
style?: CSSProperties & PopupKnobStyle;
|
|
22
24
|
}): import("react").JSX.Element;
|
|
23
|
-
type CommandEmptyProps = Omit<ComponentProps<typeof Command$1.Empty>, "style"> & {
|
|
25
|
+
export type CommandEmptyProps = Omit<ComponentProps<typeof Command$1.Empty>, "style"> & {
|
|
24
26
|
style?: CSSProperties & PopupKnobStyle;
|
|
25
27
|
};
|
|
26
|
-
declare function CommandEmpty({ className, ...props }: CommandEmptyProps): import("react").JSX.Element;
|
|
27
|
-
type CommandGroupProps = Omit<ComponentProps<typeof Command$1.Group>, "style"> & {
|
|
28
|
+
export declare function CommandEmpty({ className, children, ...props }: CommandEmptyProps): import("react").JSX.Element;
|
|
29
|
+
export type CommandGroupProps = Omit<ComponentProps<typeof Command$1.Group>, "style"> & {
|
|
28
30
|
style?: CSSProperties & PopupKnobStyle;
|
|
29
31
|
};
|
|
30
|
-
declare function CommandGroup({ className, ...props }: CommandGroupProps): import("react").JSX.Element;
|
|
31
|
-
type CommandSeparatorProps = Omit<ComponentProps<typeof Command$1.Separator>, "style"> & {
|
|
32
|
+
export declare function CommandGroup({ className, ...props }: CommandGroupProps): import("react").JSX.Element;
|
|
33
|
+
export type CommandSeparatorProps = Omit<ComponentProps<typeof Command$1.Separator>, "style"> & {
|
|
32
34
|
style?: CSSProperties & PopupKnobStyle;
|
|
33
35
|
};
|
|
34
|
-
declare function CommandSeparator({ className, ...props }: CommandSeparatorProps): import("react").JSX.Element;
|
|
35
|
-
type CommandItemProps = Omit<ComponentProps<typeof Command$1.Item>, "style"> & {
|
|
36
|
+
export declare function CommandSeparator({ className, ...props }: CommandSeparatorProps): import("react").JSX.Element;
|
|
37
|
+
export type CommandItemProps = Omit<ComponentProps<typeof Command$1.Item>, "style"> & {
|
|
36
38
|
style?: CSSProperties & PopupKnobStyle;
|
|
37
39
|
};
|
|
38
|
-
declare function CommandItem({ className, disabled, onSelect, ...props }: CommandItemProps): import("react").JSX.Element;
|
|
39
|
-
type CommandShortcutProps = Omit<ComponentProps<"span">, "style"> & {
|
|
40
|
+
export declare function CommandItem({ className, disabled, onSelect, ...props }: CommandItemProps): import("react").JSX.Element;
|
|
41
|
+
export type CommandShortcutProps = Omit<ComponentProps<"span">, "style"> & {
|
|
40
42
|
style?: CSSProperties & PopupKnobStyle;
|
|
41
43
|
};
|
|
42
|
-
declare function CommandShortcut({ className, ...props }: CommandShortcutProps): import("react").JSX.Element;
|
|
43
|
-
//#endregion
|
|
44
|
-
export { Command, CommandDialog, CommandEmpty, CommandEmptyProps, CommandGroup, CommandGroupProps, CommandInput, CommandInputProps, CommandItem, CommandItemProps, CommandList, CommandProps, CommandSeparator, CommandSeparatorProps, CommandShortcut, CommandShortcutProps };
|
|
44
|
+
export declare function CommandShortcut({ className, ...props }: CommandShortcutProps): import("react").JSX.Element;
|
|
45
|
+
//#endregion
|
package/dist/ui/command.js
CHANGED
|
@@ -4,18 +4,19 @@ import { ScrollArea } from "./scroll-area.js";
|
|
|
4
4
|
import { popupItemStructureClasses } from "../surface-variants.js";
|
|
5
5
|
import { Dialog, DialogContent, DialogDescription, DialogTitle } from "./dialog.js";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import { Command as Command$1 } from "cmdk";
|
|
7
|
+
import { Command as Command$1, useCommandState } from "cmdk";
|
|
8
8
|
//#region src/ui/command.tsx
|
|
9
|
-
function Command({ className, ...props }) {
|
|
9
|
+
function Command({ chrome = "standalone", className, ...props }) {
|
|
10
10
|
return /* @__PURE__ */ jsx(Command$1, {
|
|
11
11
|
"data-control-ui": "command",
|
|
12
12
|
"data-popup-kind": "command",
|
|
13
13
|
"data-slot": "root",
|
|
14
14
|
"data-control-family": "popup",
|
|
15
|
-
"data-popup-part": "surface",
|
|
15
|
+
"data-popup-part": chrome === "standalone" ? "surface" : void 0,
|
|
16
16
|
"data-popup-static": "",
|
|
17
|
-
"data-
|
|
18
|
-
|
|
17
|
+
"data-chrome": chrome,
|
|
18
|
+
"data-surface": chrome === "standalone" ? "panel" : void 0,
|
|
19
|
+
className: cn("flex h-full w-full flex-col", className),
|
|
19
20
|
...props
|
|
20
21
|
});
|
|
21
22
|
}
|
|
@@ -23,7 +24,7 @@ function CommandDialog({ title = "Command palette", description = "Search for a
|
|
|
23
24
|
return /* @__PURE__ */ jsx(Dialog, {
|
|
24
25
|
...props,
|
|
25
26
|
children: /* @__PURE__ */ jsxs(DialogContent, {
|
|
26
|
-
className: cn("
|
|
27
|
+
className: cn("p-0", className),
|
|
27
28
|
showCloseButton: false,
|
|
28
29
|
children: [
|
|
29
30
|
/* @__PURE__ */ jsx(DialogTitle, {
|
|
@@ -35,6 +36,7 @@ function CommandDialog({ title = "Command palette", description = "Search for a
|
|
|
35
36
|
children: description
|
|
36
37
|
}),
|
|
37
38
|
/* @__PURE__ */ jsx(Command, {
|
|
39
|
+
chrome: "embedded",
|
|
38
40
|
...commandProps,
|
|
39
41
|
"data-control-ui": "command",
|
|
40
42
|
"data-popup-kind": "command",
|
|
@@ -48,6 +50,7 @@ function CommandDialog({ title = "Command palette", description = "Search for a
|
|
|
48
50
|
});
|
|
49
51
|
}
|
|
50
52
|
function CommandInput({ className, ...props }) {
|
|
53
|
+
const hasResults = useCommandState((state) => state.filtered.count > 0);
|
|
51
54
|
return /* @__PURE__ */ jsxs("div", {
|
|
52
55
|
"data-control-ui": "command",
|
|
53
56
|
"data-popup-kind": "command",
|
|
@@ -78,37 +81,59 @@ function CommandInput({ className, ...props }) {
|
|
|
78
81
|
strokeLinecap: "round"
|
|
79
82
|
})]
|
|
80
83
|
}), /* @__PURE__ */ jsx(Command$1.Input, {
|
|
84
|
+
asChild: true,
|
|
81
85
|
"data-control-ui": "command",
|
|
82
86
|
"data-popup-kind": "command",
|
|
83
87
|
"data-control-family": "popup",
|
|
84
88
|
"data-slot": "input",
|
|
85
89
|
className: cn("h-full w-full disabled:cursor-not-allowed", className),
|
|
86
|
-
...props
|
|
90
|
+
...props,
|
|
91
|
+
children: /* @__PURE__ */ jsx("input", {
|
|
92
|
+
role: "combobox",
|
|
93
|
+
"aria-expanded": hasResults
|
|
94
|
+
})
|
|
87
95
|
})]
|
|
88
96
|
});
|
|
89
97
|
}
|
|
90
|
-
function
|
|
98
|
+
function CommandListSurface({ hasResults, ...props }) {
|
|
99
|
+
return /* @__PURE__ */ jsx("div", {
|
|
100
|
+
...props,
|
|
101
|
+
role: hasResults ? "listbox" : "group"
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function CommandList({ className, children, ...props }) {
|
|
105
|
+
const hasResults = useCommandState((state) => state.filtered.count > 0);
|
|
91
106
|
return /* @__PURE__ */ jsx(ScrollArea, {
|
|
92
107
|
maxHeight: "min(360px, var(--available-height, 360px))",
|
|
93
108
|
className: "min-h-0 w-full",
|
|
94
109
|
children: /* @__PURE__ */ jsx(Command$1.List, {
|
|
110
|
+
asChild: true,
|
|
95
111
|
"data-control-ui": "command",
|
|
96
112
|
"data-control-family": "popup",
|
|
97
113
|
"data-popup-kind": "command",
|
|
98
114
|
"data-slot": "list",
|
|
99
115
|
className: cn("p-[var(--popover-padding)]", className),
|
|
100
|
-
...props
|
|
116
|
+
...props,
|
|
117
|
+
children: /* @__PURE__ */ jsx(CommandListSurface, {
|
|
118
|
+
hasResults,
|
|
119
|
+
children
|
|
120
|
+
})
|
|
101
121
|
})
|
|
102
122
|
});
|
|
103
123
|
}
|
|
104
|
-
function CommandEmpty({ className, ...props }) {
|
|
124
|
+
function CommandEmpty({ className, children, ...props }) {
|
|
105
125
|
return /* @__PURE__ */ jsx(Command$1.Empty, {
|
|
126
|
+
asChild: true,
|
|
106
127
|
"data-control-ui": "command",
|
|
107
128
|
"data-control-family": "popup",
|
|
108
129
|
"data-popup-kind": "command",
|
|
109
130
|
"data-slot": "empty",
|
|
110
131
|
className,
|
|
111
|
-
...props
|
|
132
|
+
...props,
|
|
133
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
134
|
+
role: "status",
|
|
135
|
+
children
|
|
136
|
+
})
|
|
112
137
|
});
|
|
113
138
|
}
|
|
114
139
|
function CommandGroup({ className, ...props }) {
|
|
@@ -117,12 +142,13 @@ function CommandGroup({ className, ...props }) {
|
|
|
117
142
|
"data-control-family": "popup",
|
|
118
143
|
"data-popup-kind": "command",
|
|
119
144
|
"data-slot": "group",
|
|
120
|
-
className: cn("
|
|
145
|
+
className: cn("p-[var(--popover-padding)]", className),
|
|
121
146
|
...props
|
|
122
147
|
});
|
|
123
148
|
}
|
|
124
149
|
function CommandSeparator({ className, ...props }) {
|
|
125
150
|
return /* @__PURE__ */ jsx(Command$1.Separator, {
|
|
151
|
+
"aria-hidden": "true",
|
|
126
152
|
"data-control-ui": "command",
|
|
127
153
|
"data-popup-kind": "command",
|
|
128
154
|
"data-control-family": "popup",
|
|
@@ -3,84 +3,83 @@ import { PopupKnobStyle } from "../knob-contracts/popup-knobs.js";
|
|
|
3
3
|
import { CSSProperties, ComponentProps, MouseEvent, ReactNode } from "react";
|
|
4
4
|
import { ContextMenu as ContextMenu$1 } from "@base-ui/react/context-menu";
|
|
5
5
|
//#region src/ui/context-menu.d.ts
|
|
6
|
-
type ContextMenuProps = {
|
|
6
|
+
export type ContextMenuProps = {
|
|
7
7
|
children?: ReactNode;
|
|
8
8
|
open?: boolean;
|
|
9
9
|
defaultOpen?: boolean;
|
|
10
10
|
onOpenChange?: (open: boolean, eventDetails: OpenChangeEventDetails) => void;
|
|
11
11
|
};
|
|
12
|
-
type ContextMenuTriggerProps = ComponentProps<"div"> & {
|
|
12
|
+
export type ContextMenuTriggerProps = ComponentProps<"div"> & {
|
|
13
13
|
style?: CSSProperties & PopupKnobStyle;
|
|
14
14
|
};
|
|
15
|
-
type ContextMenuGroupProps = ComponentProps<"div"> & {
|
|
15
|
+
export type ContextMenuGroupProps = ComponentProps<"div"> & {
|
|
16
16
|
style?: CSSProperties & PopupKnobStyle;
|
|
17
17
|
};
|
|
18
|
-
type ContextMenuContentProps = Omit<ComponentProps<"div">, "style"> & {
|
|
18
|
+
export type ContextMenuContentProps = Omit<ComponentProps<"div">, "style"> & {
|
|
19
19
|
style?: CSSProperties & PopupKnobStyle;
|
|
20
20
|
};
|
|
21
|
-
type ContextMenuItemProps = Omit<Omit<ComponentProps<"div">, "onClick">, "style"> & {
|
|
21
|
+
export type ContextMenuItemProps = Omit<Omit<ComponentProps<"div">, "onClick">, "style"> & {
|
|
22
22
|
style?: CSSProperties & PopupKnobStyle;
|
|
23
23
|
} & {
|
|
24
24
|
disabled?: boolean;
|
|
25
25
|
inset?: boolean;
|
|
26
26
|
onClick?: (event: MouseEvent) => void;
|
|
27
27
|
};
|
|
28
|
-
type ContextMenuCheckboxItemProps = Omit<Omit<ComponentProps<"div">, "onClick">, "style"> & {
|
|
28
|
+
export type ContextMenuCheckboxItemProps = Omit<Omit<ComponentProps<"div">, "onClick">, "style"> & {
|
|
29
29
|
style?: CSSProperties & PopupKnobStyle;
|
|
30
30
|
} & {
|
|
31
31
|
checked?: boolean;
|
|
32
32
|
onCheckedChange?: (checked: boolean) => void;
|
|
33
33
|
disabled?: boolean;
|
|
34
34
|
};
|
|
35
|
-
type ContextMenuRadioGroupProps<TValue extends string = string> = ComponentProps<"div"> & Omit<ControlledChoice<TValue>, "defaultValue"> & {
|
|
35
|
+
export type ContextMenuRadioGroupProps<TValue extends string = string> = ComponentProps<"div"> & Omit<ControlledChoice<TValue>, "defaultValue"> & {
|
|
36
36
|
style?: CSSProperties & PopupKnobStyle;
|
|
37
37
|
};
|
|
38
|
-
type ContextMenuRadioItemProps = Omit<Omit<ComponentProps<"div">, "onClick">, "style"> & {
|
|
38
|
+
export type ContextMenuRadioItemProps = Omit<Omit<ComponentProps<"div">, "onClick">, "style"> & {
|
|
39
39
|
style?: CSSProperties & PopupKnobStyle;
|
|
40
40
|
} & {
|
|
41
41
|
value: string;
|
|
42
42
|
disabled?: boolean;
|
|
43
43
|
};
|
|
44
|
-
type ContextMenuLabelProps = Omit<ComponentProps<"div">, "style"> & {
|
|
44
|
+
export type ContextMenuLabelProps = Omit<ComponentProps<"div">, "style"> & {
|
|
45
45
|
style?: CSSProperties & PopupKnobStyle;
|
|
46
46
|
} & {
|
|
47
47
|
inset?: boolean;
|
|
48
48
|
};
|
|
49
|
-
type ContextMenuSeparatorProps = Omit<ComponentProps<"div">, "style"> & {
|
|
49
|
+
export type ContextMenuSeparatorProps = Omit<ComponentProps<"div">, "style"> & {
|
|
50
50
|
style?: CSSProperties & PopupKnobStyle;
|
|
51
51
|
};
|
|
52
|
-
type ContextMenuShortcutProps = Omit<ComponentProps<"span">, "style"> & {
|
|
52
|
+
export type ContextMenuShortcutProps = Omit<ComponentProps<"span">, "style"> & {
|
|
53
53
|
style?: CSSProperties & PopupKnobStyle;
|
|
54
54
|
};
|
|
55
|
-
type ContextMenuSubProps = {
|
|
55
|
+
export type ContextMenuSubProps = {
|
|
56
56
|
children?: ReactNode;
|
|
57
57
|
open?: boolean;
|
|
58
58
|
defaultOpen?: boolean;
|
|
59
59
|
onOpenChange?: (open: boolean, eventDetails: OpenChangeEventDetails) => void;
|
|
60
60
|
};
|
|
61
|
-
type ContextMenuSubTriggerProps = Omit<Omit<ComponentProps<"div">, "onClick">, "style"> & {
|
|
61
|
+
export type ContextMenuSubTriggerProps = Omit<Omit<ComponentProps<"div">, "onClick">, "style"> & {
|
|
62
62
|
style?: CSSProperties & PopupKnobStyle;
|
|
63
63
|
} & {
|
|
64
64
|
disabled?: boolean;
|
|
65
65
|
inset?: boolean;
|
|
66
66
|
};
|
|
67
|
-
type ContextMenuSubContentProps = Omit<ComponentProps<"div">, "style"> & {
|
|
67
|
+
export type ContextMenuSubContentProps = Omit<ComponentProps<"div">, "style"> & {
|
|
68
68
|
style?: CSSProperties & PopupKnobStyle;
|
|
69
69
|
};
|
|
70
|
-
declare function ContextMenu(props: ContextMenuProps): import("react").JSX.Element;
|
|
71
|
-
declare function ContextMenuTrigger({ className, ...props }: ContextMenuTriggerProps): import("react").JSX.Element;
|
|
72
|
-
declare function ContextMenuPortal(props: ComponentProps<typeof ContextMenu$1.Portal>): import("react").JSX.Element;
|
|
73
|
-
declare function ContextMenuGroup({ className, ...props }: ContextMenuGroupProps): import("react").JSX.Element;
|
|
74
|
-
declare function ContextMenuContent({ className, children, ...props }: ContextMenuContentProps): import("react").JSX.Element;
|
|
75
|
-
declare function ContextMenuItem({ className, inset, ...props }: ContextMenuItemProps): import("react").JSX.Element;
|
|
76
|
-
declare function ContextMenuCheckboxItem({ className, children, ...props }: ContextMenuCheckboxItemProps): import("react").JSX.Element;
|
|
77
|
-
declare function ContextMenuRadioGroup<TValue extends string = string>({ className, ...props }: ContextMenuRadioGroupProps<TValue>): import("react").JSX.Element;
|
|
78
|
-
declare function ContextMenuRadioItem({ className, children, ...props }: ContextMenuRadioItemProps): import("react").JSX.Element;
|
|
79
|
-
declare function ContextMenuLabel({ className, inset, ...props }: ContextMenuLabelProps): import("react").JSX.Element;
|
|
80
|
-
declare function ContextMenuSeparator({ className, ...props }: ContextMenuSeparatorProps): import("react").JSX.Element;
|
|
81
|
-
declare function ContextMenuShortcut({ className, ...props }: ContextMenuShortcutProps): import("react").JSX.Element;
|
|
82
|
-
declare function ContextMenuSub(props: ContextMenuSubProps): import("react").JSX.Element;
|
|
83
|
-
declare function ContextMenuSubTrigger({ className, inset, children, ...props }: ContextMenuSubTriggerProps): import("react").JSX.Element;
|
|
84
|
-
declare function ContextMenuSubContent({ className, children, ...props }: ContextMenuSubContentProps): import("react").JSX.Element;
|
|
85
|
-
//#endregion
|
|
86
|
-
export { ContextMenu, ContextMenuCheckboxItem, ContextMenuCheckboxItemProps, ContextMenuContent, ContextMenuContentProps, ContextMenuGroup, ContextMenuGroupProps, ContextMenuItem, ContextMenuItemProps, ContextMenuLabel, ContextMenuLabelProps, ContextMenuPortal, ContextMenuProps, ContextMenuRadioGroup, ContextMenuRadioGroupProps, ContextMenuRadioItem, ContextMenuRadioItemProps, ContextMenuSeparator, ContextMenuSeparatorProps, ContextMenuShortcut, ContextMenuShortcutProps, ContextMenuSub, ContextMenuSubContent, ContextMenuSubContentProps, ContextMenuSubProps, ContextMenuSubTrigger, ContextMenuSubTriggerProps, ContextMenuTrigger, ContextMenuTriggerProps };
|
|
70
|
+
export declare function ContextMenu(props: ContextMenuProps): import("react").JSX.Element;
|
|
71
|
+
export declare function ContextMenuTrigger({ className, ...props }: ContextMenuTriggerProps): import("react").JSX.Element;
|
|
72
|
+
export declare function ContextMenuPortal(props: ComponentProps<typeof ContextMenu$1.Portal>): import("react").JSX.Element;
|
|
73
|
+
export declare function ContextMenuGroup({ className, ...props }: ContextMenuGroupProps): import("react").JSX.Element;
|
|
74
|
+
export declare function ContextMenuContent({ className, children, ...props }: ContextMenuContentProps): import("react").JSX.Element;
|
|
75
|
+
export declare function ContextMenuItem({ className, inset, ...props }: ContextMenuItemProps): import("react").JSX.Element;
|
|
76
|
+
export declare function ContextMenuCheckboxItem({ className, children, ...props }: ContextMenuCheckboxItemProps): import("react").JSX.Element;
|
|
77
|
+
export declare function ContextMenuRadioGroup<TValue extends string = string>({ className, ...props }: ContextMenuRadioGroupProps<TValue>): import("react").JSX.Element;
|
|
78
|
+
export declare function ContextMenuRadioItem({ className, children, ...props }: ContextMenuRadioItemProps): import("react").JSX.Element;
|
|
79
|
+
export declare function ContextMenuLabel({ className, inset, ...props }: ContextMenuLabelProps): import("react").JSX.Element;
|
|
80
|
+
export declare function ContextMenuSeparator({ className, ...props }: ContextMenuSeparatorProps): import("react").JSX.Element;
|
|
81
|
+
export declare function ContextMenuShortcut({ className, ...props }: ContextMenuShortcutProps): import("react").JSX.Element;
|
|
82
|
+
export declare function ContextMenuSub(props: ContextMenuSubProps): import("react").JSX.Element;
|
|
83
|
+
export declare function ContextMenuSubTrigger({ className, inset, children, ...props }: ContextMenuSubTriggerProps): import("react").JSX.Element;
|
|
84
|
+
export declare function ContextMenuSubContent({ className, children, ...props }: ContextMenuSubContentProps): import("react").JSX.Element;
|
|
85
|
+
//#endregion
|
package/dist/ui/context-menu.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
|
-
import {
|
|
3
|
+
import { controlEffectsAttribute } from "../skin.js";
|
|
4
|
+
import { useSkin } from "../skin-provider.js";
|
|
4
5
|
import { popupItemStructureClasses } from "../surface-variants.js";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
import { ContextMenu as ContextMenu$1 } from "@base-ui/react/context-menu";
|
|
@@ -34,9 +35,10 @@ function ContextMenuGroup({ className, ...props }) {
|
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
37
|
function ContextMenuContent({ className, children, ...props }) {
|
|
38
|
+
const skin = useSkin();
|
|
37
39
|
return /* @__PURE__ */ jsx(ContextMenu$1.Portal, { children: /* @__PURE__ */ jsx(ContextMenu$1.Positioner, {
|
|
38
|
-
"data-skin":
|
|
39
|
-
"data-effects":
|
|
40
|
+
"data-skin": skin.id,
|
|
41
|
+
"data-effects": controlEffectsAttribute(skin.effects),
|
|
40
42
|
className: "z-[80]",
|
|
41
43
|
children: /* @__PURE__ */ jsx(ContextMenu$1.Popup, {
|
|
42
44
|
"data-control-ui": "context-menu",
|
|
@@ -179,9 +181,10 @@ function ContextMenuSubTrigger({ className, inset = false, children, ...props })
|
|
|
179
181
|
});
|
|
180
182
|
}
|
|
181
183
|
function ContextMenuSubContent({ className, children, ...props }) {
|
|
184
|
+
const skin = useSkin();
|
|
182
185
|
return /* @__PURE__ */ jsx(ContextMenu$1.Portal, { children: /* @__PURE__ */ jsx(ContextMenu$1.Positioner, {
|
|
183
|
-
"data-skin":
|
|
184
|
-
"data-effects":
|
|
186
|
+
"data-skin": skin.id,
|
|
187
|
+
"data-effects": controlEffectsAttribute(skin.effects),
|
|
185
188
|
className: "z-[80]",
|
|
186
189
|
sideOffset: -4,
|
|
187
190
|
alignOffset: -5,
|
package/dist/ui/dialog.d.ts
CHANGED
|
@@ -4,35 +4,35 @@ import { PopupKnobStyle } from "../knob-contracts/popup-knobs.js";
|
|
|
4
4
|
import { CSSProperties, ComponentProps, ReactNode } from "react";
|
|
5
5
|
import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
|
|
6
6
|
//#region src/ui/dialog.d.ts
|
|
7
|
-
type DialogProps = {
|
|
7
|
+
export type DialogProps = {
|
|
8
|
+
modal?: boolean | "trap-focus";
|
|
8
9
|
children?: ReactNode;
|
|
9
10
|
open?: boolean;
|
|
10
11
|
defaultOpen?: boolean;
|
|
11
12
|
onOpenChange?: (open: boolean, eventDetails: OpenChangeEventDetails) => void;
|
|
12
13
|
};
|
|
13
|
-
type DialogContentProps = Omit<ComponentProps<"div">, "style"> & {
|
|
14
|
+
export type DialogContentProps = Omit<ComponentProps<"div">, "style"> & {
|
|
14
15
|
style?: CSSProperties & PopupKnobStyle;
|
|
15
16
|
} & {
|
|
16
17
|
showCloseButton?: boolean;
|
|
17
18
|
};
|
|
18
|
-
declare function Dialog(props: DialogProps): import("react").JSX.Element;
|
|
19
|
-
declare function DialogTrigger({ className, ...props }: ComponentProps<typeof Dialog$1.Trigger> & {
|
|
19
|
+
export declare function Dialog(props: DialogProps): import("react").JSX.Element;
|
|
20
|
+
export declare function DialogTrigger({ className, ...props }: ComponentProps<typeof Dialog$1.Trigger> & {
|
|
20
21
|
style?: CSSProperties & PopupKnobStyle;
|
|
21
22
|
}): import("react").JSX.Element;
|
|
22
|
-
type DialogCloseProps = Omit<ComponentProps<typeof Dialog$1.Close>, "render"> & Pick<ButtonProps, "variant" | "size" | "tone" | "iconOnly">;
|
|
23
|
-
declare function DialogClose({ className, children, variant, size, tone, iconOnly, ...props }: DialogCloseProps): import("react").JSX.Element;
|
|
24
|
-
declare function DialogContent({ className, children, showCloseButton, ...props }: DialogContentProps): import("react").JSX.Element;
|
|
25
|
-
declare function DialogHeader({ className, ...props }: ComponentProps<"div"> & {
|
|
23
|
+
export type DialogCloseProps = Omit<ComponentProps<typeof Dialog$1.Close>, "render"> & Pick<ButtonProps, "variant" | "size" | "tone" | "iconOnly">;
|
|
24
|
+
export declare function DialogClose({ className, children, variant, size, tone, iconOnly, ...props }: DialogCloseProps): import("react").JSX.Element;
|
|
25
|
+
export declare function DialogContent({ className, children, showCloseButton, ...props }: DialogContentProps): import("react").JSX.Element;
|
|
26
|
+
export declare function DialogHeader({ className, ...props }: ComponentProps<"div"> & {
|
|
26
27
|
style?: CSSProperties & PopupKnobStyle;
|
|
27
28
|
}): import("react").JSX.Element;
|
|
28
|
-
declare function DialogFooter({ className, ...props }: ComponentProps<"div"> & {
|
|
29
|
+
export declare function DialogFooter({ className, ...props }: ComponentProps<"div"> & {
|
|
29
30
|
style?: CSSProperties & PopupKnobStyle;
|
|
30
31
|
}): import("react").JSX.Element;
|
|
31
|
-
declare function DialogTitle({ className, ...props }: ComponentProps<"h2"> & {
|
|
32
|
+
export declare function DialogTitle({ className, ...props }: ComponentProps<"h2"> & {
|
|
32
33
|
style?: CSSProperties & PopupKnobStyle;
|
|
33
34
|
}): import("react").JSX.Element;
|
|
34
|
-
declare function DialogDescription({ className, ...props }: ComponentProps<"p"> & {
|
|
35
|
+
export declare function DialogDescription({ className, ...props }: ComponentProps<"p"> & {
|
|
35
36
|
style?: CSSProperties & PopupKnobStyle;
|
|
36
37
|
}): import("react").JSX.Element;
|
|
37
|
-
//#endregion
|
|
38
|
-
export { Dialog, DialogClose, DialogCloseProps, DialogContent, DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogProps, DialogTitle, DialogTrigger };
|
|
38
|
+
//#endregion
|
package/dist/ui/dialog.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
|
-
import {
|
|
3
|
+
import { controlEffectsAttribute, skinAdornment } from "../skin.js";
|
|
4
|
+
import { useSkin } from "../skin-provider.js";
|
|
4
5
|
import { Button } from "./button.js";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
|
|
@@ -33,34 +34,35 @@ function DialogClose({ className, children, variant = "surface", size = "sm", to
|
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
36
|
function DialogContent({ className, children, showCloseButton = true, ...props }) {
|
|
37
|
+
const skin = useSkin();
|
|
36
38
|
return /* @__PURE__ */ jsxs(Dialog$1.Portal, { children: [/* @__PURE__ */ jsx(Dialog$1.Backdrop, {
|
|
37
39
|
"data-control-ui": "dialog",
|
|
38
40
|
"data-popup-kind": "dialog",
|
|
39
41
|
"data-slot": "backdrop",
|
|
40
42
|
"data-control-family": "popup",
|
|
41
43
|
"data-popup-part": "backdrop",
|
|
42
|
-
"data-skin":
|
|
43
|
-
"data-effects":
|
|
44
|
+
"data-skin": skin.id,
|
|
45
|
+
"data-effects": controlEffectsAttribute(skin.effects),
|
|
44
46
|
className: "fixed inset-0 z-[70]"
|
|
45
47
|
}), /* @__PURE__ */ jsxs(Dialog$1.Popup, {
|
|
46
|
-
"data-skin":
|
|
47
|
-
"data-effects":
|
|
48
|
+
"data-skin": skin.id,
|
|
49
|
+
"data-effects": controlEffectsAttribute(skin.effects),
|
|
48
50
|
"data-control-ui": "dialog",
|
|
49
51
|
"data-popup-kind": "dialog",
|
|
50
52
|
"data-slot": "content",
|
|
51
53
|
"data-control-family": "popup",
|
|
52
54
|
"data-popup-part": "surface",
|
|
53
55
|
"data-surface": "modal",
|
|
54
|
-
className: cn("fixed left-1/2 top-[12vh] z-[71] grid w-[calc(100%-2rem)] max-w-lg -translate-x-1/2
|
|
56
|
+
className: cn("fixed left-1/2 top-[12vh] z-[71] grid w-[calc(100%-2rem)] max-w-lg -translate-x-1/2", className),
|
|
55
57
|
...props,
|
|
56
58
|
children: [
|
|
57
|
-
skinAdornment("dialog", "titlebar", {}),
|
|
59
|
+
skinAdornment(skin, "dialog", "titlebar", {}),
|
|
58
60
|
children,
|
|
59
61
|
showCloseButton ? /* @__PURE__ */ jsxs(DialogClose, {
|
|
60
62
|
variant: "ghost",
|
|
61
63
|
size: "xs",
|
|
62
64
|
iconOnly: true,
|
|
63
|
-
className: "absolute
|
|
65
|
+
className: "absolute",
|
|
64
66
|
children: [/* @__PURE__ */ jsx("svg", {
|
|
65
67
|
viewBox: "0 0 16 16",
|
|
66
68
|
className: "size-4",
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
//#region src/ui/dockable-panel-geometry.d.ts
|
|
2
|
-
type DockablePanelBounds = {
|
|
2
|
+
export type DockablePanelBounds = {
|
|
3
3
|
width: number;
|
|
4
4
|
height: number;
|
|
5
5
|
};
|
|
6
|
-
type DockablePanelSize = {
|
|
6
|
+
export type DockablePanelSize = {
|
|
7
7
|
width: number;
|
|
8
8
|
height: number;
|
|
9
9
|
};
|
|
10
|
-
type DockablePanelPosition = {
|
|
10
|
+
export type DockablePanelPosition = {
|
|
11
11
|
x: number;
|
|
12
12
|
y: number;
|
|
13
13
|
};
|
|
14
|
-
declare function clampDockablePanelPosition(position: DockablePanelPosition, bounds: DockablePanelBounds, panel: DockablePanelSize, inset?: number): DockablePanelPosition;
|
|
15
|
-
declare function dockablePanelSideAt(pointerX: number, width: number): "left" | "right";
|
|
16
|
-
declare function oppositeDockablePanelSide(placement: "left" | "right"): "left" | "right";
|
|
17
|
-
//#endregion
|
|
18
|
-
export { DockablePanelBounds, DockablePanelPosition, DockablePanelSize, clampDockablePanelPosition, dockablePanelSideAt, oppositeDockablePanelSide };
|
|
14
|
+
export declare function clampDockablePanelPosition(position: DockablePanelPosition, bounds: DockablePanelBounds, panel: DockablePanelSize, inset?: number): DockablePanelPosition;
|
|
15
|
+
export declare function dockablePanelSideAt(pointerX: number, width: number): "left" | "right";
|
|
16
|
+
export declare function oppositeDockablePanelSide(placement: "left" | "right"): "left" | "right";
|
|
17
|
+
//#endregion
|
|
@@ -2,8 +2,8 @@ import { ButtonKnobStyle } from "../knob-contracts/button-knobs.js";
|
|
|
2
2
|
import { DockablePanelKnobStyle } from "../knob-contracts/dockable-panel-knobs.js";
|
|
3
3
|
import { CSSProperties, ComponentProps, ReactNode } from "react";
|
|
4
4
|
//#region src/ui/dockable-panel.d.ts
|
|
5
|
-
type DockablePanelPlacement = "left" | "right";
|
|
6
|
-
type DockablePanelProps = Omit<ComponentProps<"aside">, "onChange" | "ref" | "style"> & {
|
|
5
|
+
export type DockablePanelPlacement = "left" | "right";
|
|
6
|
+
export type DockablePanelProps = Omit<ComponentProps<"aside">, "onChange" | "ref" | "style"> & {
|
|
7
7
|
open?: boolean;
|
|
8
8
|
defaultOpen?: boolean;
|
|
9
9
|
onOpenChange?: (open: boolean) => void;
|
|
@@ -12,47 +12,46 @@ type DockablePanelProps = Omit<ComponentProps<"aside">, "onChange" | "ref" | "st
|
|
|
12
12
|
onPlacementChange?: (placement: DockablePanelPlacement) => void;
|
|
13
13
|
style?: CSSProperties & DockablePanelKnobStyle;
|
|
14
14
|
};
|
|
15
|
-
type DockablePanelHeaderProps = Omit<ComponentProps<"div">, "style"> & {
|
|
15
|
+
export type DockablePanelHeaderProps = Omit<ComponentProps<"div">, "style"> & {
|
|
16
16
|
style?: CSSProperties & DockablePanelKnobStyle;
|
|
17
17
|
};
|
|
18
|
-
type DockablePanelDragHandleProps = Omit<ComponentProps<"button">, "style"> & {
|
|
18
|
+
export type DockablePanelDragHandleProps = Omit<ComponentProps<"button">, "style"> & {
|
|
19
19
|
style?: CSSProperties & DockablePanelKnobStyle;
|
|
20
20
|
};
|
|
21
|
-
type DockablePanelTitleProps = Omit<ComponentProps<"h2">, "style"> & {
|
|
21
|
+
export type DockablePanelTitleProps = Omit<ComponentProps<"h2">, "style"> & {
|
|
22
22
|
style?: CSSProperties & DockablePanelKnobStyle;
|
|
23
23
|
};
|
|
24
|
-
type DockablePanelActionsProps = ComponentProps<"div"> & {
|
|
24
|
+
export type DockablePanelActionsProps = ComponentProps<"div"> & {
|
|
25
25
|
style?: CSSProperties & DockablePanelKnobStyle;
|
|
26
26
|
};
|
|
27
|
-
type DockablePanelToggleProps = Omit<Omit<ComponentProps<"button">, "children"> & {
|
|
27
|
+
export type DockablePanelToggleProps = Omit<Omit<ComponentProps<"button">, "children"> & {
|
|
28
28
|
children?: ReactNode;
|
|
29
29
|
}, "style"> & {
|
|
30
30
|
style?: CSSProperties & ButtonKnobStyle;
|
|
31
31
|
};
|
|
32
|
-
type DockablePanelDockProps = Omit<Omit<ComponentProps<"button">, "children"> & {
|
|
32
|
+
export type DockablePanelDockProps = Omit<Omit<ComponentProps<"button">, "children"> & {
|
|
33
33
|
placement: DockablePanelPlacement;
|
|
34
34
|
children?: ReactNode;
|
|
35
35
|
}, "style"> & {
|
|
36
36
|
style?: CSSProperties & ButtonKnobStyle;
|
|
37
37
|
};
|
|
38
|
-
type DockablePanelCloseProps = Omit<Omit<ComponentProps<"button">, "children"> & {
|
|
38
|
+
export type DockablePanelCloseProps = Omit<Omit<ComponentProps<"button">, "children"> & {
|
|
39
39
|
children?: ReactNode;
|
|
40
40
|
}, "style"> & {
|
|
41
41
|
style?: CSSProperties & ButtonKnobStyle;
|
|
42
42
|
};
|
|
43
|
-
type DockablePanelContentPadding = "default" | "none";
|
|
44
|
-
type DockablePanelContentProps = ComponentProps<"div"> & {
|
|
43
|
+
export type DockablePanelContentPadding = "default" | "none";
|
|
44
|
+
export type DockablePanelContentProps = ComponentProps<"div"> & {
|
|
45
45
|
padding?: DockablePanelContentPadding;
|
|
46
46
|
style?: CSSProperties & DockablePanelKnobStyle;
|
|
47
47
|
};
|
|
48
|
-
declare function DockablePanel({ open: openProp, defaultOpen, onOpenChange, placement: placementProp, defaultPlacement, onPlacementChange, className, style, children, "aria-label": ariaLabel, ...props }: DockablePanelProps): import("react").JSX.Element | null;
|
|
49
|
-
declare function DockablePanelHeader({ className, ...props }: DockablePanelHeaderProps): import("react").JSX.Element;
|
|
50
|
-
declare function DockablePanelDragHandle({ className, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, children, ...props }: DockablePanelDragHandleProps): import("react").JSX.Element;
|
|
51
|
-
declare function DockablePanelTitle({ className, ...props }: DockablePanelTitleProps): import("react").JSX.Element;
|
|
52
|
-
declare function DockablePanelActions({ className, ...props }: DockablePanelActionsProps): import("react").JSX.Element;
|
|
53
|
-
declare function DockablePanelToggle({ className, children, "aria-label": ariaLabel, onClick, ...props }: DockablePanelToggleProps): import("react").JSX.Element | null;
|
|
54
|
-
declare function DockablePanelDock({ placement: nextPlacement, className, children, "aria-label": ariaLabel, onClick, ...props }: DockablePanelDockProps): import("react").JSX.Element | null;
|
|
55
|
-
declare function DockablePanelClose({ className, children, "aria-label": ariaLabel, onClick, ...props }: DockablePanelCloseProps): import("react").JSX.Element;
|
|
56
|
-
declare function DockablePanelContent({ padding, className, ...props }: DockablePanelContentProps): import("react").JSX.Element;
|
|
57
|
-
//#endregion
|
|
58
|
-
export { DockablePanel, DockablePanelActions, DockablePanelActionsProps, DockablePanelClose, DockablePanelCloseProps, DockablePanelContent, DockablePanelContentPadding, DockablePanelContentProps, DockablePanelDock, DockablePanelDockProps, DockablePanelDragHandle, DockablePanelDragHandleProps, DockablePanelHeader, DockablePanelHeaderProps, DockablePanelPlacement, DockablePanelProps, DockablePanelTitle, DockablePanelTitleProps, DockablePanelToggle, DockablePanelToggleProps };
|
|
48
|
+
export declare function DockablePanel({ open: openProp, defaultOpen, onOpenChange, placement: placementProp, defaultPlacement, onPlacementChange, className, style, children, "aria-label": ariaLabel, ...props }: DockablePanelProps): import("react").JSX.Element | null;
|
|
49
|
+
export declare function DockablePanelHeader({ className, ...props }: DockablePanelHeaderProps): import("react").JSX.Element;
|
|
50
|
+
export declare function DockablePanelDragHandle({ className, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, children, ...props }: DockablePanelDragHandleProps): import("react").JSX.Element;
|
|
51
|
+
export declare function DockablePanelTitle({ className, ...props }: DockablePanelTitleProps): import("react").JSX.Element;
|
|
52
|
+
export declare function DockablePanelActions({ className, ...props }: DockablePanelActionsProps): import("react").JSX.Element;
|
|
53
|
+
export declare function DockablePanelToggle({ className, children, "aria-label": ariaLabel, onClick, ...props }: DockablePanelToggleProps): import("react").JSX.Element | null;
|
|
54
|
+
export declare function DockablePanelDock({ placement: nextPlacement, className, children, "aria-label": ariaLabel, onClick, ...props }: DockablePanelDockProps): import("react").JSX.Element | null;
|
|
55
|
+
export declare function DockablePanelClose({ className, children, "aria-label": ariaLabel, onClick, ...props }: DockablePanelCloseProps): import("react").JSX.Element;
|
|
56
|
+
export declare function DockablePanelContent({ padding, className, ...props }: DockablePanelContentProps): import("react").JSX.Element;
|
|
57
|
+
//#endregion
|