@moldable-ai/ui 0.2.21 → 0.2.24
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/dist/catalog/catalog-coverage.d.ts +1 -1
- package/dist/catalog/catalog-manifest.d.ts +1 -1
- package/dist/catalog/catalog-manifest.js +1 -1
- package/dist/catalog/catalog-types.d.ts +7 -0
- package/dist/catalog/catalog-types.d.ts.map +1 -1
- package/dist/catalog/catalog-types.js +1 -0
- package/dist/catalog/component-catalog.d.ts +1 -1
- package/dist/catalog/component-catalog.js +2 -2
- package/dist/catalog/core-catalog-exclusions.d.ts +1 -1
- package/dist/catalog/core-catalog-exclusions.d.ts.map +1 -1
- package/dist/catalog/core-catalog-exclusions.js +1 -146
- package/dist/catalog/core-catalog.d.ts +1 -1
- package/dist/catalog/core-catalog.d.ts.map +1 -1
- package/dist/catalog/core-catalog.js +11 -7
- package/dist/catalog/core-collection-stories.d.ts +1 -1
- package/dist/catalog/core-collection-stories.d.ts.map +1 -1
- package/dist/catalog/core-collection-stories.js +41 -9
- package/dist/catalog/core-control-stories.d.ts +1 -1
- package/dist/catalog/core-control-stories.d.ts.map +1 -1
- package/dist/catalog/core-control-stories.js +53 -22
- package/dist/catalog/core-feedback-stories.d.ts +1 -1
- package/dist/catalog/core-feedback-stories.d.ts.map +1 -1
- package/dist/catalog/core-feedback-stories.js +89 -10
- package/dist/catalog/core-form-stories.d.ts +3 -0
- package/dist/catalog/core-form-stories.d.ts.map +1 -0
- package/dist/catalog/core-form-stories.js +56 -0
- package/dist/catalog/core-foundation-stories.d.ts +1 -1
- package/dist/catalog/core-foundation-stories.js +7 -7
- package/dist/catalog/core-layout-stories.d.ts +3 -0
- package/dist/catalog/core-layout-stories.d.ts.map +1 -0
- package/dist/catalog/core-layout-stories.js +78 -0
- package/dist/catalog/core-navigation-stories.d.ts +1 -1
- package/dist/catalog/core-navigation-stories.d.ts.map +1 -1
- package/dist/catalog/core-navigation-stories.js +25 -3
- package/dist/catalog/core-overlay-stories.d.ts +1 -1
- package/dist/catalog/core-overlay-stories.d.ts.map +1 -1
- package/dist/catalog/core-overlay-stories.js +113 -8
- package/dist/catalog/index.d.ts +6 -6
- package/dist/catalog/index.js +6 -6
- package/dist/components/app-error-boundary.d.ts.map +1 -1
- package/dist/components/app-error-boundary.js +4 -3
- package/dist/components/chat/chat-image-lightbox.js +3 -3
- package/dist/components/chat/chat-input.js +5 -5
- package/dist/components/chat/chat-message.js +17 -17
- package/dist/components/chat/chat-messages.d.ts +1 -1
- package/dist/components/chat/chat-messages.js +3 -3
- package/dist/components/chat/chat-panel.d.ts +6 -6
- package/dist/components/chat/chat-panel.d.ts.map +1 -1
- package/dist/components/chat/chat-panel.js +33 -33
- package/dist/components/chat/checkpoint-badge.js +3 -3
- package/dist/components/chat/conversation-history.d.ts.map +1 -1
- package/dist/components/chat/conversation-history.js +13 -13
- package/dist/components/chat/index.d.ts +20 -15
- package/dist/components/chat/index.d.ts.map +1 -1
- package/dist/components/chat/index.js +20 -15
- package/dist/components/chat/markdown.js +1 -1
- package/dist/components/chat/model-effort-selector.js +10 -10
- package/dist/components/chat/model-selector.js +4 -4
- package/dist/components/chat/reasoning-effort-selector.js +4 -4
- package/dist/components/chat/restore-dialog.js +3 -3
- package/dist/components/chat/thinking-timeline.js +2 -2
- package/dist/components/chat/tool-approval.d.ts +1 -1
- package/dist/components/chat/tool-approval.d.ts.map +1 -1
- package/dist/components/chat/tool-approval.js +9 -9
- package/dist/components/chat/tool-handlers.d.ts +2 -2
- package/dist/components/chat/tool-handlers.js +90 -90
- package/dist/components/chat/voice-orb-audio.d.ts +16 -0
- package/dist/components/chat/voice-orb-audio.d.ts.map +1 -0
- package/dist/components/chat/voice-orb-audio.js +110 -0
- package/dist/components/chat/voice-orb-renderer.d.ts +51 -0
- package/dist/components/chat/voice-orb-renderer.d.ts.map +1 -0
- package/dist/components/chat/voice-orb-renderer.js +410 -0
- package/dist/components/chat/voice-orb-shaders.d.ts +3 -0
- package/dist/components/chat/voice-orb-shaders.d.ts.map +1 -0
- package/dist/components/chat/voice-orb-shaders.js +355 -0
- package/dist/components/chat/voice-orb-types.d.ts +24 -0
- package/dist/components/chat/voice-orb-types.d.ts.map +1 -0
- package/dist/components/chat/voice-orb-types.js +73 -0
- package/dist/components/chat/voice-orb.d.ts +20 -0
- package/dist/components/chat/voice-orb.d.ts.map +1 -0
- package/dist/components/chat/voice-orb.js +67 -0
- package/dist/components/code-block.js +1 -1
- package/dist/components/hardware/bluetooth-panel.d.ts +2 -2
- package/dist/components/hardware/bluetooth-panel.js +10 -10
- package/dist/components/hardware/camera-preview.js +6 -6
- package/dist/components/hardware/capability-badge.d.ts +2 -2
- package/dist/components/hardware/capability-badge.js +2 -2
- package/dist/components/hardware/capability-matrix.d.ts +1 -1
- package/dist/components/hardware/capability-matrix.js +5 -5
- package/dist/components/hardware/clipboard-button.d.ts +1 -1
- package/dist/components/hardware/clipboard-button.js +2 -2
- package/dist/components/hardware/device-list.js +1 -1
- package/dist/components/hardware/display-map.d.ts +1 -1
- package/dist/components/hardware/display-map.js +7 -7
- package/dist/components/hardware/haptic-button.d.ts +2 -2
- package/dist/components/hardware/haptic-button.js +3 -3
- package/dist/components/hardware/hardware-panel.js +1 -1
- package/dist/components/hardware/hid-panel.d.ts +2 -2
- package/dist/components/hardware/hid-panel.js +10 -10
- package/dist/components/hardware/index.d.ts +26 -26
- package/dist/components/hardware/index.js +26 -26
- package/dist/components/hardware/live-indicator.js +1 -1
- package/dist/components/hardware/local-auth-button.d.ts +2 -2
- package/dist/components/hardware/local-auth-button.js +4 -4
- package/dist/components/hardware/location-panel.d.ts +1 -1
- package/dist/components/hardware/location-panel.js +6 -6
- package/dist/components/hardware/microphone-meter.js +7 -7
- package/dist/components/hardware/midi-monitor.d.ts +2 -2
- package/dist/components/hardware/midi-monitor.js +9 -9
- package/dist/components/hardware/notification-panel.d.ts +1 -1
- package/dist/components/hardware/notification-panel.js +8 -8
- package/dist/components/hardware/power-blocker-controller.d.ts +1 -1
- package/dist/components/hardware/power-blocker-controller.js +1 -1
- package/dist/components/hardware/power-panel.d.ts +1 -1
- package/dist/components/hardware/power-panel.js +9 -9
- package/dist/components/hardware/readout.js +1 -1
- package/dist/components/hardware/screen-share-preview.js +5 -5
- package/dist/components/hardware/secure-storage-panel.d.ts +1 -1
- package/dist/components/hardware/secure-storage-panel.js +9 -9
- package/dist/components/hardware/serial-console.d.ts +2 -2
- package/dist/components/hardware/serial-console.js +10 -10
- package/dist/components/hardware/shortcut-recorder.d.ts +1 -1
- package/dist/components/hardware/shortcut-recorder.js +4 -4
- package/dist/components/hardware/stream-log.js +1 -1
- package/dist/components/hardware/system-audio-monitor.d.ts +1 -1
- package/dist/components/hardware/system-audio-monitor.js +9 -9
- package/dist/components/hardware/usb-panel.d.ts +5 -5
- package/dist/components/hardware/usb-panel.js +10 -10
- package/dist/components/hardware/use-capability.d.ts +1 -1
- package/dist/components/hardware/use-capability.js +1 -1
- package/dist/components/markdown.js +5 -5
- package/dist/components/native-capabilities/bluetooth-panel.d.ts +2 -2
- package/dist/components/native-capabilities/bluetooth-panel.d.ts.map +1 -1
- package/dist/components/native-capabilities/bluetooth-panel.js +17 -17
- package/dist/components/native-capabilities/camera-preview.d.ts.map +1 -1
- package/dist/components/native-capabilities/camera-preview.js +7 -7
- package/dist/components/native-capabilities/capability-badge.d.ts +2 -2
- package/dist/components/native-capabilities/capability-badge.js +4 -4
- package/dist/components/native-capabilities/capability-matrix.d.ts +1 -1
- package/dist/components/native-capabilities/capability-matrix.js +7 -7
- package/dist/components/native-capabilities/clipboard-button.d.ts +1 -1
- package/dist/components/native-capabilities/clipboard-button.js +2 -2
- package/dist/components/native-capabilities/device-list.js +4 -4
- package/dist/components/native-capabilities/display-map.d.ts +1 -1
- package/dist/components/native-capabilities/display-map.d.ts.map +1 -1
- package/dist/components/native-capabilities/display-map.js +11 -11
- package/dist/components/native-capabilities/haptic-button.d.ts +2 -2
- package/dist/components/native-capabilities/haptic-button.js +3 -3
- package/dist/components/native-capabilities/hid-panel.d.ts +2 -2
- package/dist/components/native-capabilities/hid-panel.d.ts.map +1 -1
- package/dist/components/native-capabilities/hid-panel.js +14 -14
- package/dist/components/native-capabilities/index.d.ts +26 -26
- package/dist/components/native-capabilities/index.js +26 -26
- package/dist/components/native-capabilities/live-indicator.js +3 -3
- package/dist/components/native-capabilities/local-auth-button.d.ts +2 -2
- package/dist/components/native-capabilities/local-auth-button.js +4 -4
- package/dist/components/native-capabilities/location-panel.d.ts +1 -1
- package/dist/components/native-capabilities/location-panel.d.ts.map +1 -1
- package/dist/components/native-capabilities/location-panel.js +8 -8
- package/dist/components/native-capabilities/microphone-meter.js +9 -9
- package/dist/components/native-capabilities/midi-monitor.d.ts +2 -2
- package/dist/components/native-capabilities/midi-monitor.d.ts.map +1 -1
- package/dist/components/native-capabilities/midi-monitor.js +11 -11
- package/dist/components/native-capabilities/native-capability-panel.js +6 -6
- package/dist/components/native-capabilities/notification-panel.d.ts +1 -1
- package/dist/components/native-capabilities/notification-panel.js +9 -9
- package/dist/components/native-capabilities/power-blocker-controller.d.ts +1 -1
- package/dist/components/native-capabilities/power-blocker-controller.js +1 -1
- package/dist/components/native-capabilities/power-panel.d.ts +1 -1
- package/dist/components/native-capabilities/power-panel.d.ts.map +1 -1
- package/dist/components/native-capabilities/power-panel.js +12 -12
- package/dist/components/native-capabilities/readout.d.ts.map +1 -1
- package/dist/components/native-capabilities/readout.js +2 -2
- package/dist/components/native-capabilities/screen-share-preview.js +6 -6
- package/dist/components/native-capabilities/secure-storage-panel.d.ts +1 -1
- package/dist/components/native-capabilities/secure-storage-panel.d.ts.map +1 -1
- package/dist/components/native-capabilities/secure-storage-panel.js +11 -11
- package/dist/components/native-capabilities/serial-console.d.ts +2 -2
- package/dist/components/native-capabilities/serial-console.d.ts.map +1 -1
- package/dist/components/native-capabilities/serial-console.js +11 -11
- package/dist/components/native-capabilities/shortcut-recorder.d.ts +1 -1
- package/dist/components/native-capabilities/shortcut-recorder.js +5 -5
- package/dist/components/native-capabilities/stream-log.js +3 -3
- package/dist/components/native-capabilities/system-audio-monitor.d.ts +1 -1
- package/dist/components/native-capabilities/system-audio-monitor.js +12 -12
- package/dist/components/native-capabilities/usb-panel.d.ts +5 -5
- package/dist/components/native-capabilities/usb-panel.js +15 -15
- package/dist/components/native-capabilities/use-capability.d.ts +1 -1
- package/dist/components/native-capabilities/use-capability.js +1 -1
- package/dist/components/rich-media-player.js +3 -3
- package/dist/components/ui/accordion.js +3 -3
- package/dist/components/ui/alert-dialog.d.ts +5 -3
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.js +20 -10
- package/dist/components/ui/alert.d.ts +2 -2
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/alert.js +11 -11
- package/dist/components/ui/app-frame.d.ts +7 -1
- package/dist/components/ui/app-frame.d.ts.map +1 -1
- package/dist/components/ui/app-frame.js +52 -16
- package/dist/components/ui/avatar.js +5 -5
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/badge.js +4 -4
- package/dist/components/ui/breadcrumb.js +2 -2
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button-group.js +4 -4
- package/dist/components/ui/button.d.ts +6 -4
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +50 -18
- package/dist/components/ui/calendar.d.ts +1 -1
- package/dist/components/ui/calendar.d.ts.map +1 -1
- package/dist/components/ui/calendar.js +15 -15
- package/dist/components/ui/card.js +3 -3
- package/dist/components/ui/carousel.d.ts +1 -1
- package/dist/components/ui/carousel.js +4 -4
- package/dist/components/ui/chart.js +5 -5
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox.js +2 -2
- package/dist/components/ui/collapsible.js +3 -3
- package/dist/components/ui/color-well.js +2 -2
- package/dist/components/ui/combobox.js +9 -9
- package/dist/components/ui/command.d.ts +1 -1
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/command.js +9 -9
- package/dist/components/ui/confirm-dialog.d.ts +1 -1
- package/dist/components/ui/confirm-dialog.d.ts.map +1 -1
- package/dist/components/ui/confirm-dialog.js +2 -2
- package/dist/components/ui/context-menu.d.ts +16 -5
- package/dist/components/ui/context-menu.d.ts.map +1 -1
- package/dist/components/ui/context-menu.js +92 -16
- package/dist/components/ui/date-field.d.ts.map +1 -1
- package/dist/components/ui/date-field.js +8 -8
- package/dist/components/ui/date-picker.d.ts +2 -2
- package/dist/components/ui/date-picker.js +7 -7
- package/dist/components/ui/dialog-primary-action.d.ts +4 -0
- package/dist/components/ui/dialog-primary-action.d.ts.map +1 -0
- package/dist/components/ui/dialog-primary-action.js +37 -0
- package/dist/components/ui/dialog.d.ts +6 -2
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +20 -7
- package/dist/components/ui/drawer.js +4 -4
- package/dist/components/ui/dropdown-menu.d.ts +15 -5
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +98 -16
- package/dist/components/ui/edge-fade.js +1 -1
- package/dist/components/ui/empty.d.ts +1 -1
- package/dist/components/ui/empty.js +5 -5
- package/dist/components/ui/error-boundary-view.d.ts +12 -0
- package/dist/components/ui/error-boundary-view.d.ts.map +1 -0
- package/dist/components/ui/error-boundary-view.js +8 -0
- package/dist/components/ui/field.d.ts +1 -1
- package/dist/components/ui/field.d.ts.map +1 -1
- package/dist/components/ui/field.js +9 -9
- package/dist/components/ui/form.js +4 -4
- package/dist/components/ui/grid.d.ts.map +1 -1
- package/dist/components/ui/grid.js +5 -5
- package/dist/components/ui/hover-card.js +2 -2
- package/dist/components/ui/icon-button.d.ts +1 -1
- package/dist/components/ui/icon-button.d.ts.map +1 -1
- package/dist/components/ui/icon-button.js +3 -4
- package/dist/components/ui/index.d.ts +77 -76
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +77 -76
- package/dist/components/ui/input-group.d.ts +3 -3
- package/dist/components/ui/input-group.js +14 -14
- package/dist/components/ui/input-otp.js +3 -3
- package/dist/components/ui/input.js +2 -2
- package/dist/components/ui/inspector.d.ts +1 -1
- package/dist/components/ui/inspector.js +6 -6
- package/dist/components/ui/item.d.ts +1 -1
- package/dist/components/ui/item.js +7 -7
- package/dist/components/ui/kbd.js +2 -2
- package/dist/components/ui/label.js +2 -2
- package/dist/components/ui/list.d.ts.map +1 -1
- package/dist/components/ui/list.js +5 -5
- package/dist/components/ui/material.js +3 -3
- package/dist/components/ui/menu-items.d.ts +28 -0
- package/dist/components/ui/menu-items.d.ts.map +1 -0
- package/dist/components/ui/menu-items.js +111 -0
- package/dist/components/ui/menubar.js +11 -11
- package/dist/components/ui/message-scroller-controller.d.ts +1 -1
- package/dist/components/ui/message-scroller-controller.js +1 -1
- package/dist/components/ui/message-scroller-primitive.d.ts +1 -1
- package/dist/components/ui/message-scroller-primitive.js +1 -1
- package/dist/components/ui/message-scroller.d.ts +2 -2
- package/dist/components/ui/message-scroller.js +3 -3
- package/dist/components/ui/navigation-button-group.d.ts +2 -2
- package/dist/components/ui/navigation-button-group.js +2 -2
- package/dist/components/ui/navigation-menu.js +6 -6
- package/dist/components/ui/notification-dot.js +2 -2
- package/dist/components/ui/number-input.js +8 -8
- package/dist/components/ui/pagination.d.ts +1 -1
- package/dist/components/ui/pagination.js +2 -2
- package/dist/components/ui/panel.d.ts +1 -1
- package/dist/components/ui/panel.js +3 -3
- package/dist/components/ui/popover.d.ts +1 -1
- package/dist/components/ui/popover.js +3 -3
- package/dist/components/ui/progress.js +2 -2
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group.js +2 -2
- package/dist/components/ui/resizable.d.ts +1 -1
- package/dist/components/ui/resizable.d.ts.map +1 -1
- package/dist/components/ui/resizable.js +15 -4
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.js +3 -3
- package/dist/components/ui/search-field.js +7 -7
- package/dist/components/ui/segmented-control.js +9 -9
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +6 -6
- package/dist/components/ui/separator.js +1 -1
- package/dist/components/ui/sheet.js +4 -4
- package/dist/components/ui/sidebar.d.ts +5 -5
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/sidebar.js +111 -24
- package/dist/components/ui/skeleton.js +2 -2
- package/dist/components/ui/slider.d.ts +3 -1
- package/dist/components/ui/slider.d.ts.map +1 -1
- package/dist/components/ui/slider.js +3 -3
- package/dist/components/ui/sonner.js +1 -1
- package/dist/components/ui/spinner.d.ts.map +1 -1
- package/dist/components/ui/spinner.js +2 -2
- package/dist/components/ui/split-view.js +1 -1
- package/dist/components/ui/status.d.ts +1 -1
- package/dist/components/ui/status.d.ts.map +1 -1
- package/dist/components/ui/status.js +10 -9
- package/dist/components/ui/switch.js +2 -2
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js +7 -7
- package/dist/components/ui/tabs.js +3 -3
- package/dist/components/ui/text.d.ts +2 -2
- package/dist/components/ui/text.js +19 -19
- package/dist/components/ui/textarea.js +2 -2
- package/dist/components/ui/toggle-group.d.ts +1 -1
- package/dist/components/ui/toggle-group.js +4 -4
- package/dist/components/ui/toggle.d.ts +1 -1
- package/dist/components/ui/toggle.js +10 -10
- package/dist/components/ui/toolbar.d.ts +7 -7
- package/dist/components/ui/toolbar.js +7 -7
- package/dist/components/ui/tooltip.d.ts +2 -2
- package/dist/components/ui/tooltip.js +5 -5
- package/dist/index.d.ts +21 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -15
- package/dist/lib/frame-lifecycle.d.ts +49 -0
- package/dist/lib/frame-lifecycle.d.ts.map +1 -1
- package/dist/lib/frame-lifecycle.js +163 -1
- package/dist/lib/host-date-time-picker.d.ts +36 -0
- package/dist/lib/host-date-time-picker.d.ts.map +1 -0
- package/dist/lib/host-date-time-picker.js +162 -0
- package/dist/lib/host-file-dialog.d.ts +66 -0
- package/dist/lib/host-file-dialog.d.ts.map +1 -0
- package/dist/lib/host-file-dialog.js +221 -0
- package/dist/lib/host-native-menu.d.ts +116 -0
- package/dist/lib/host-native-menu.d.ts.map +1 -0
- package/dist/lib/host-native-menu.js +242 -0
- package/dist/lib/host-services.d.ts +13 -0
- package/dist/lib/host-services.d.ts.map +1 -0
- package/dist/lib/host-services.js +161 -0
- package/dist/lib/host-share.d.ts +39 -0
- package/dist/lib/host-share.d.ts.map +1 -0
- package/dist/lib/host-share.js +161 -0
- package/dist/lib/host-web-surface.d.ts +31 -0
- package/dist/lib/host-web-surface.d.ts.map +1 -0
- package/dist/lib/host-web-surface.js +116 -0
- package/dist/lib/native-capabilities/access.d.ts +2 -2
- package/dist/lib/native-capabilities/access.js +2 -2
- package/dist/lib/native-capabilities/bluetooth-access.d.ts +1 -1
- package/dist/lib/native-capabilities/bluetooth-access.js +2 -2
- package/dist/lib/native-capabilities/bluetooth-connection.d.ts +1 -1
- package/dist/lib/native-capabilities/bluetooth-connection.js +1 -1
- package/dist/lib/native-capabilities/bluetooth-gatt.d.ts +1 -1
- package/dist/lib/native-capabilities/bluetooth-gatt.js +1 -1
- package/dist/lib/native-capabilities/bluetooth-internal.d.ts +2 -2
- package/dist/lib/native-capabilities/bluetooth-internal.js +1 -1
- package/dist/lib/native-capabilities/bluetooth-native-fallback.d.ts +2 -2
- package/dist/lib/native-capabilities/bluetooth-native-fallback.js +2 -2
- package/dist/lib/native-capabilities/bluetooth.d.ts +6 -6
- package/dist/lib/native-capabilities/bluetooth.js +4 -4
- package/dist/lib/native-capabilities/bridge.d.ts +1 -1
- package/dist/lib/native-capabilities/bridge.js +2 -2
- package/dist/lib/native-capabilities/capabilities.d.ts +1 -1
- package/dist/lib/native-capabilities/capabilities.js +1 -1
- package/dist/lib/native-capabilities/clipboard.js +2 -2
- package/dist/lib/native-capabilities/device-io-errors.d.ts +1 -1
- package/dist/lib/native-capabilities/device-io-errors.js +1 -1
- package/dist/lib/native-capabilities/displays.d.ts +1 -1
- package/dist/lib/native-capabilities/displays.js +1 -1
- package/dist/lib/native-capabilities/global-shortcuts.d.ts +2 -2
- package/dist/lib/native-capabilities/global-shortcuts.js +1 -1
- package/dist/lib/native-capabilities/haptics.d.ts +1 -1
- package/dist/lib/native-capabilities/haptics.js +1 -1
- package/dist/lib/native-capabilities/hid-native.d.ts +2 -2
- package/dist/lib/native-capabilities/hid-native.js +3 -3
- package/dist/lib/native-capabilities/hid.js +5 -5
- package/dist/lib/native-capabilities/index.d.ts +39 -39
- package/dist/lib/native-capabilities/index.js +21 -21
- package/dist/lib/native-capabilities/local-authentication.d.ts +1 -1
- package/dist/lib/native-capabilities/local-authentication.js +1 -1
- package/dist/lib/native-capabilities/location.js +1 -1
- package/dist/lib/native-capabilities/media-permissions.d.ts +1 -1
- package/dist/lib/native-capabilities/media-permissions.js +1 -1
- package/dist/lib/native-capabilities/media.d.ts +1 -1
- package/dist/lib/native-capabilities/media.js +2 -2
- package/dist/lib/native-capabilities/midi-access.d.ts +1 -1
- package/dist/lib/native-capabilities/midi-access.js +3 -3
- package/dist/lib/native-capabilities/midi-internal.d.ts +1 -1
- package/dist/lib/native-capabilities/midi-internal.js +1 -1
- package/dist/lib/native-capabilities/midi-native-fallback.d.ts +1 -1
- package/dist/lib/native-capabilities/midi-native-fallback.js +2 -2
- package/dist/lib/native-capabilities/midi-ports.d.ts +1 -1
- package/dist/lib/native-capabilities/midi-ports.js +1 -1
- package/dist/lib/native-capabilities/midi.d.ts +5 -5
- package/dist/lib/native-capabilities/midi.js +3 -3
- package/dist/lib/native-capabilities/native-device-io.d.ts +1 -1
- package/dist/lib/native-capabilities/native-device-io.js +1 -1
- package/dist/lib/native-capabilities/native-device-lifecycle.js +1 -1
- package/dist/lib/native-capabilities/notifications.d.ts +2 -2
- package/dist/lib/native-capabilities/notifications.js +1 -1
- package/dist/lib/native-capabilities/power-session.d.ts +2 -2
- package/dist/lib/native-capabilities/power-session.js +1 -1
- package/dist/lib/native-capabilities/secure-storage.d.ts +1 -1
- package/dist/lib/native-capabilities/secure-storage.js +1 -1
- package/dist/lib/native-capabilities/serial-native.d.ts +2 -2
- package/dist/lib/native-capabilities/serial-native.js +3 -3
- package/dist/lib/native-capabilities/serial.js +5 -5
- package/dist/lib/native-capabilities/system-audio.d.ts +1 -1
- package/dist/lib/native-capabilities/system-audio.js +1 -1
- package/dist/lib/native-capabilities/usb-native.d.ts +2 -2
- package/dist/lib/native-capabilities/usb-native.js +3 -3
- package/dist/lib/native-capabilities/usb.js +5 -5
- package/dist/lib/native-hardware/bluetooth-access.d.ts +1 -1
- package/dist/lib/native-hardware/bluetooth-access.js +1 -1
- package/dist/lib/native-hardware/bluetooth-connection.d.ts +1 -1
- package/dist/lib/native-hardware/bluetooth-connection.js +1 -1
- package/dist/lib/native-hardware/bluetooth-gatt.d.ts +1 -1
- package/dist/lib/native-hardware/bluetooth-gatt.js +1 -1
- package/dist/lib/native-hardware/bluetooth-internal.d.ts +2 -2
- package/dist/lib/native-hardware/bluetooth-internal.js +1 -1
- package/dist/lib/native-hardware/bluetooth-native-fallback.d.ts +2 -2
- package/dist/lib/native-hardware/bluetooth-native-fallback.js +2 -2
- package/dist/lib/native-hardware/bluetooth.d.ts +6 -6
- package/dist/lib/native-hardware/bluetooth.js +4 -4
- package/dist/lib/native-hardware/bridge.d.ts +1 -1
- package/dist/lib/native-hardware/bridge.js +2 -2
- package/dist/lib/native-hardware/capabilities.d.ts +1 -1
- package/dist/lib/native-hardware/capabilities.js +1 -1
- package/dist/lib/native-hardware/clipboard.js +1 -1
- package/dist/lib/native-hardware/device-io-errors.d.ts +1 -1
- package/dist/lib/native-hardware/device-io-errors.js +1 -1
- package/dist/lib/native-hardware/displays.d.ts +1 -1
- package/dist/lib/native-hardware/displays.js +1 -1
- package/dist/lib/native-hardware/global-shortcuts.d.ts +2 -2
- package/dist/lib/native-hardware/global-shortcuts.js +1 -1
- package/dist/lib/native-hardware/haptics.d.ts +1 -1
- package/dist/lib/native-hardware/haptics.js +1 -1
- package/dist/lib/native-hardware/hid-native.d.ts +2 -2
- package/dist/lib/native-hardware/hid-native.js +3 -3
- package/dist/lib/native-hardware/hid.js +4 -4
- package/dist/lib/native-hardware/index.d.ts +37 -37
- package/dist/lib/native-hardware/index.js +20 -20
- package/dist/lib/native-hardware/local-authentication.d.ts +1 -1
- package/dist/lib/native-hardware/local-authentication.js +1 -1
- package/dist/lib/native-hardware/location.js +1 -1
- package/dist/lib/native-hardware/media-permissions.d.ts +1 -1
- package/dist/lib/native-hardware/media-permissions.js +1 -1
- package/dist/lib/native-hardware/media.d.ts +1 -1
- package/dist/lib/native-hardware/media.js +1 -1
- package/dist/lib/native-hardware/midi-access.d.ts +1 -1
- package/dist/lib/native-hardware/midi-access.js +2 -2
- package/dist/lib/native-hardware/midi-internal.d.ts +1 -1
- package/dist/lib/native-hardware/midi-internal.js +1 -1
- package/dist/lib/native-hardware/midi-native-fallback.d.ts +1 -1
- package/dist/lib/native-hardware/midi-native-fallback.js +2 -2
- package/dist/lib/native-hardware/midi-ports.d.ts +1 -1
- package/dist/lib/native-hardware/midi-ports.js +1 -1
- package/dist/lib/native-hardware/midi.d.ts +5 -5
- package/dist/lib/native-hardware/midi.js +3 -3
- package/dist/lib/native-hardware/native-device-io.d.ts +1 -1
- package/dist/lib/native-hardware/native-device-io.js +1 -1
- package/dist/lib/native-hardware/native-device-lifecycle.js +1 -1
- package/dist/lib/native-hardware/notifications.d.ts +2 -2
- package/dist/lib/native-hardware/notifications.js +1 -1
- package/dist/lib/native-hardware/power-session.d.ts +2 -2
- package/dist/lib/native-hardware/power-session.js +1 -1
- package/dist/lib/native-hardware/secure-storage.d.ts +1 -1
- package/dist/lib/native-hardware/secure-storage.js +1 -1
- package/dist/lib/native-hardware/serial-native.d.ts +2 -2
- package/dist/lib/native-hardware/serial-native.js +3 -3
- package/dist/lib/native-hardware/serial.js +4 -4
- package/dist/lib/native-hardware/system-audio.d.ts +1 -1
- package/dist/lib/native-hardware/system-audio.js +1 -1
- package/dist/lib/native-hardware/usb-native.d.ts +2 -2
- package/dist/lib/native-hardware/usb-native.js +3 -3
- package/dist/lib/native-hardware/usb.js +4 -4
- package/dist/lib/theme.js +1 -1
- package/docs/README.md +1 -0
- package/docs/design-tokens.md +28 -6
- package/docs/foundations.md +4 -2
- package/docs/visual-regression.md +78 -0
- package/package.json +15 -4
- package/src/components/ui/alert-dialog.md +27 -0
- package/src/components/ui/button.md +10 -3
- package/src/components/ui/confirm-dialog.md +97 -0
- package/src/components/ui/context-menu.md +158 -0
- package/src/components/ui/dialog.md +23 -4
- package/src/components/ui/dropdown-menu.md +165 -0
- package/src/components/ui/error-boundary-view.md +98 -0
- package/src/components/ui/hover-card.md +90 -0
- package/src/components/ui/select.md +111 -0
- package/src/lib/host-date-time-picker.md +29 -0
- package/src/lib/host-file-dialog.md +76 -0
- package/src/lib/host-native-menu.md +67 -0
- package/src/lib/host-share.md +36 -0
- package/src/lib/host-web-surface.md +66 -0
- package/src/styles/index.css +141 -68
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# Context menu
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
`ContextMenu` presents commands for the object or region under the pointer. Its
|
|
6
|
+
declarative item API automatically adopts the host-native menu when available
|
|
7
|
+
and renders the same commands portably everywhere else.
|
|
8
|
+
|
|
9
|
+
Context menus are shortcuts, not the only route to essential actions. Use
|
|
10
|
+
`DropdownMenu` when a visible button should advertise the command list.
|
|
11
|
+
|
|
12
|
+
## Usage patterns
|
|
13
|
+
|
|
14
|
+
Use `items` for standard command menus that should automatically adopt the
|
|
15
|
+
native host menu:
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { FolderOpen } from 'lucide-react'
|
|
19
|
+
import {
|
|
20
|
+
ContextMenu,
|
|
21
|
+
ContextMenuTrigger,
|
|
22
|
+
type MenuItems,
|
|
23
|
+
} from '@moldable-ai/ui'
|
|
24
|
+
|
|
25
|
+
const items: MenuItems[] = [
|
|
26
|
+
{
|
|
27
|
+
id: 'open',
|
|
28
|
+
label: 'Open',
|
|
29
|
+
icon: FolderOpen,
|
|
30
|
+
sfSymbol: 'folder',
|
|
31
|
+
shortcut: { key: 'o', modifiers: ['cmd'] },
|
|
32
|
+
},
|
|
33
|
+
{ id: 'divider', kind: 'separator' },
|
|
34
|
+
{ id: 'trash', label: 'Move to trash', destructive: true },
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
function ProjectContextMenu() {
|
|
38
|
+
return (
|
|
39
|
+
<ContextMenu items={items} onSelectItem={runCommand}>
|
|
40
|
+
<ContextMenuTrigger asChild>
|
|
41
|
+
<article>{project.name}</article>
|
|
42
|
+
</ContextMenuTrigger>
|
|
43
|
+
</ContextMenu>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Use children for custom portable-only content or per-row handlers:
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
import {
|
|
52
|
+
ContextMenu,
|
|
53
|
+
ContextMenuContent,
|
|
54
|
+
ContextMenuItem,
|
|
55
|
+
ContextMenuSeparator,
|
|
56
|
+
ContextMenuShortcut,
|
|
57
|
+
ContextMenuTrigger,
|
|
58
|
+
} from '@moldable-ai/ui'
|
|
59
|
+
|
|
60
|
+
function ProjectContextMenu() {
|
|
61
|
+
return (
|
|
62
|
+
<ContextMenu onOpenChange={setMenuOpen}>
|
|
63
|
+
<ContextMenuTrigger asChild>
|
|
64
|
+
<article>{project.name}</article>
|
|
65
|
+
</ContextMenuTrigger>
|
|
66
|
+
<ContextMenuContent>
|
|
67
|
+
<ContextMenuItem onSelect={openProject}>
|
|
68
|
+
Open
|
|
69
|
+
<ContextMenuShortcut>⌘O</ContextMenuShortcut>
|
|
70
|
+
</ContextMenuItem>
|
|
71
|
+
<ContextMenuSeparator />
|
|
72
|
+
<ContextMenuItem variant="destructive" onSelect={moveToTrash}>
|
|
73
|
+
Move to trash
|
|
74
|
+
</ContextMenuItem>
|
|
75
|
+
</ContextMenuContent>
|
|
76
|
+
</ContextMenu>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Anatomy
|
|
82
|
+
|
|
83
|
+
Use `ContextMenuTrigger` around the target and place commands in
|
|
84
|
+
`ContextMenuContent`. Groups, labels, separators, checkbox items, radio groups,
|
|
85
|
+
shortcuts, and submenus are available for structured command sets.
|
|
86
|
+
|
|
87
|
+
## API summary
|
|
88
|
+
|
|
89
|
+
- `ContextMenu` supports `items?: MenuItems[]`,
|
|
90
|
+
`onSelectItem?: (id: string) => void`, `onOpenChange`, `dir`, and `modal`.
|
|
91
|
+
- A `MenuItems` value supports `id`, `kind`, `label`, portable `icon`, reserved
|
|
92
|
+
`sfSymbol`, `enabled`, `checked`, `shortcut`, `destructive`, and `submenu`.
|
|
93
|
+
- Do not provide `ContextMenuContent` together with `items`. In development this
|
|
94
|
+
reports an error, and `items` wins.
|
|
95
|
+
- `ContextMenuTrigger` supports `asChild` and `disabled`.
|
|
96
|
+
- `ContextMenuItem` supports menu item props such as `onSelect` and `disabled`,
|
|
97
|
+
plus `inset` and `variant="default" | "destructive"`.
|
|
98
|
+
- `ContextMenuCheckboxItem` supports `checked`; radio items belong inside
|
|
99
|
+
`ContextMenuRadioGroup`, whose `value` and `onValueChange` manage the group.
|
|
100
|
+
- `ContextMenuSub` supports `open`, `defaultOpen`, and `onOpenChange`.
|
|
101
|
+
- `ContextMenuLabel` and `ContextMenuSubTrigger` support `inset`.
|
|
102
|
+
|
|
103
|
+
## States and interaction
|
|
104
|
+
|
|
105
|
+
Keep command order and wording stable across openings. Disable temporarily
|
|
106
|
+
unavailable commands, but omit commands the target can never support. Check and
|
|
107
|
+
radio state represent durable settings; focus highlighting is transient.
|
|
108
|
+
|
|
109
|
+
Menu surfaces use `bg-popover`, `text-popover-foreground`,
|
|
110
|
+
`rounded-overlay`, and `shadow-overlay`. Focused rows use the accent roles;
|
|
111
|
+
destructive rows use `text-destructive` and the destructive focus layer.
|
|
112
|
+
|
|
113
|
+
## Keyboard and accessibility
|
|
114
|
+
|
|
115
|
+
Radix supplies menu roles, roving focus, typeahead, Escape dismissal, and
|
|
116
|
+
submenu keyboard behavior. Do not put arbitrary controls inside an item. Make
|
|
117
|
+
every essential command available from a visible button, menu, toolbar, or
|
|
118
|
+
command palette as well as the context menu.
|
|
119
|
+
|
|
120
|
+
## Platform behavior
|
|
121
|
+
|
|
122
|
+
With `items`, a user-initiated context-menu gesture automatically opens the
|
|
123
|
+
host-native menu when `nativeMenu` is advertised. The pointer position is its
|
|
124
|
+
anchor, `selectedId` is delivered to `onSelectItem`, and dismissal is a no-op.
|
|
125
|
+
No portable menu is rendered while that native request is open.
|
|
126
|
+
|
|
127
|
+
When the service is not advertised, including web and iOS, the same items
|
|
128
|
+
automatically render through the existing Radix anatomy. If advertised
|
|
129
|
+
availability becomes stale and the host returns fallback, the original gesture
|
|
130
|
+
is replayed into that portable implementation. Icons and destructive styling
|
|
131
|
+
are portable in v1; `sfSymbol` is reserved and is not posted to or rendered by
|
|
132
|
+
the native service.
|
|
133
|
+
|
|
134
|
+
Shortcuts are display metadata only. They do not register keyboard handlers;
|
|
135
|
+
keep command execution keyed by `onSelectItem`. See
|
|
136
|
+
[`host-native-menu.md`](../../lib/host-native-menu.md) for host limits and
|
|
137
|
+
cancellation behavior.
|
|
138
|
+
|
|
139
|
+
## Do
|
|
140
|
+
|
|
141
|
+
- Name items with short, verb-led labels.
|
|
142
|
+
- Put JSX shortcuts at the end with `ContextMenuShortcut`, or declare shortcut
|
|
143
|
+
display metadata in `items`.
|
|
144
|
+
- Separate destructive commands from routine commands.
|
|
145
|
+
- Keep submenu depth shallow.
|
|
146
|
+
|
|
147
|
+
## Don't
|
|
148
|
+
|
|
149
|
+
- Do not make a context menu the only way to complete a task.
|
|
150
|
+
- Do not mix `items` with `ContextMenuContent` children.
|
|
151
|
+
- Do not treat shortcut metadata as a registered keyboard command.
|
|
152
|
+
- Do not use raw colors, shadows, or radii for menu states.
|
|
153
|
+
|
|
154
|
+
## Testing
|
|
155
|
+
|
|
156
|
+
Exercise secondary click, long press where supported, keyboard navigation,
|
|
157
|
+
Escape, disabled items, checkbox/radio state, submenus, native selection and
|
|
158
|
+
dismissal, service availability changes, and portable fallback.
|
|
@@ -18,7 +18,15 @@ spatial context.
|
|
|
18
18
|
<DialogDescription>Update the selected record.</DialogDescription>
|
|
19
19
|
</DialogHeader>
|
|
20
20
|
<DialogBody>{/* the only scrolling region */}</DialogBody>
|
|
21
|
-
<DialogFooter>
|
|
21
|
+
<DialogFooter>
|
|
22
|
+
<span className="text-muted-foreground mr-auto inline-flex items-center gap-1 text-xs">
|
|
23
|
+
Save <Kbd>⌘</Kbd>
|
|
24
|
+
<Kbd>Enter</Kbd>
|
|
25
|
+
</span>
|
|
26
|
+
<DialogAction primary loading={isSaving} onClick={saveChanges}>
|
|
27
|
+
Save changes
|
|
28
|
+
</DialogAction>
|
|
29
|
+
</DialogFooter>
|
|
22
30
|
</DialogContent>
|
|
23
31
|
</Dialog>
|
|
24
32
|
```
|
|
@@ -30,9 +38,20 @@ scrolling; do not put overflow on both the content and body.
|
|
|
30
38
|
Keep dialogs opaque and visually stable. Translucent material belongs on small
|
|
31
39
|
temporary control overlays where seeing the underlying context is useful.
|
|
32
40
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
Use `DialogAction` for footer commands that need the standard async and keyboard
|
|
42
|
+
contracts. Its `loading` prop forwards to `Button`, preventing duplicate
|
|
43
|
+
activation while retaining the label width and accessible name. Keep the dialog
|
|
44
|
+
controlled, show inline field errors, and close only after success. Disable the
|
|
45
|
+
whole form only when edits during submission would be unsafe. Use
|
|
46
|
+
`ConfirmDialog` when confirmation is the entire workflow.
|
|
47
|
+
|
|
48
|
+
Set `primary` on at most one `DialogAction` to opt into the default-action
|
|
49
|
+
shortcut. Command+Enter activates it on macOS; Control+Enter does so on other
|
|
50
|
+
platforms. The shortcut works from anywhere in the dialog unless a focused
|
|
51
|
+
control consumes the key event with `preventDefault()`, or the primary action is
|
|
52
|
+
loading or disabled. Plain Enter keeps the focused control's native behavior.
|
|
53
|
+
Use `Kbd` to show the shortcut when it improves discovery; render the
|
|
54
|
+
platform-appropriate modifier in app code.
|
|
36
55
|
|
|
37
56
|
Every dialog needs a `DialogTitle`. Add `DialogDescription` when the outcome or
|
|
38
57
|
scope is not obvious. Escape, outside dismissal, initial focus, and focus return
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# Dropdown menu
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
`DropdownMenu` presents a compact list of commands from a visible trigger. Use
|
|
6
|
+
it for overflow actions, view commands, and small command groups. Its
|
|
7
|
+
declarative item API automatically adopts the host-native menu when available.
|
|
8
|
+
|
|
9
|
+
Use `Select` for a form value, `Combobox` for searchable selection,
|
|
10
|
+
`ContextMenu` for commands attached to the pointer target, and `Popover` when
|
|
11
|
+
the surface needs arbitrary interactive content rather than menu items.
|
|
12
|
+
|
|
13
|
+
## Usage patterns
|
|
14
|
+
|
|
15
|
+
Use `items` for standard command menus:
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { Copy } from 'lucide-react'
|
|
19
|
+
import {
|
|
20
|
+
Button,
|
|
21
|
+
DropdownMenu,
|
|
22
|
+
DropdownMenuTrigger,
|
|
23
|
+
type MenuItems,
|
|
24
|
+
} from '@moldable-ai/ui'
|
|
25
|
+
|
|
26
|
+
const items: MenuItems[] = [
|
|
27
|
+
{
|
|
28
|
+
id: 'duplicate',
|
|
29
|
+
label: 'Duplicate',
|
|
30
|
+
icon: Copy,
|
|
31
|
+
shortcut: { key: 'd', modifiers: ['cmd'] },
|
|
32
|
+
},
|
|
33
|
+
{ id: 'divider', kind: 'separator' },
|
|
34
|
+
{ id: 'trash', label: 'Move to trash', destructive: true },
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
function ProjectActionsMenu() {
|
|
38
|
+
return (
|
|
39
|
+
<DropdownMenu items={items} onSelectItem={runCommand}>
|
|
40
|
+
<DropdownMenuTrigger asChild>
|
|
41
|
+
<Button type="button" variant="outline" size="sm">
|
|
42
|
+
Actions
|
|
43
|
+
</Button>
|
|
44
|
+
</DropdownMenuTrigger>
|
|
45
|
+
</DropdownMenu>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Use children for custom portable-only content or per-row handlers:
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
import {
|
|
54
|
+
Button,
|
|
55
|
+
DropdownMenu,
|
|
56
|
+
DropdownMenuContent,
|
|
57
|
+
DropdownMenuItem,
|
|
58
|
+
DropdownMenuSeparator,
|
|
59
|
+
DropdownMenuShortcut,
|
|
60
|
+
DropdownMenuTrigger,
|
|
61
|
+
} from '@moldable-ai/ui'
|
|
62
|
+
|
|
63
|
+
function ProjectActionsMenu() {
|
|
64
|
+
return (
|
|
65
|
+
<DropdownMenu open={open} onOpenChange={setOpen}>
|
|
66
|
+
<DropdownMenuTrigger asChild>
|
|
67
|
+
<Button type="button" variant="outline" size="sm">
|
|
68
|
+
Actions
|
|
69
|
+
</Button>
|
|
70
|
+
</DropdownMenuTrigger>
|
|
71
|
+
<DropdownMenuContent sideOffset={4} align="end">
|
|
72
|
+
<DropdownMenuItem onSelect={duplicate}>
|
|
73
|
+
Duplicate
|
|
74
|
+
<DropdownMenuShortcut>⌘D</DropdownMenuShortcut>
|
|
75
|
+
</DropdownMenuItem>
|
|
76
|
+
<DropdownMenuSeparator />
|
|
77
|
+
<DropdownMenuItem variant="destructive" onSelect={moveToTrash}>
|
|
78
|
+
Move to trash
|
|
79
|
+
</DropdownMenuItem>
|
|
80
|
+
</DropdownMenuContent>
|
|
81
|
+
</DropdownMenu>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Anatomy
|
|
87
|
+
|
|
88
|
+
`DropdownMenuTrigger` advertises the menu and `DropdownMenuContent` contains
|
|
89
|
+
the commands. Groups, labels, separators, checkbox items, radio groups,
|
|
90
|
+
shortcuts, and submenus are available when the command set needs structure.
|
|
91
|
+
|
|
92
|
+
## API summary
|
|
93
|
+
|
|
94
|
+
- `DropdownMenu` supports `items?: MenuItems[]`,
|
|
95
|
+
`onSelectItem?: (id: string) => void`, `open`, `defaultOpen`,
|
|
96
|
+
`onOpenChange`, `dir`, and `modal`.
|
|
97
|
+
- A `MenuItems` value supports `id`, `kind`, `label`, portable `icon`, reserved
|
|
98
|
+
`sfSymbol`, `enabled`, `checked`, `shortcut`, `destructive`, and `submenu`.
|
|
99
|
+
- Do not provide `DropdownMenuContent` together with `items`. In development
|
|
100
|
+
this reports an error, and `items` wins.
|
|
101
|
+
- `DropdownMenuTrigger` accepts button props and `asChild`.
|
|
102
|
+
- `DropdownMenuContent` accepts positioning props including `side`, `align`,
|
|
103
|
+
and `sideOffset`; this wrapper defaults `sideOffset` to `4`.
|
|
104
|
+
- `DropdownMenuItem` supports menu item props such as `onSelect` and
|
|
105
|
+
`disabled`, plus `inset` and `variant="default" | "destructive"`.
|
|
106
|
+
- `DropdownMenuCheckboxItem` supports `checked`; radio items belong inside
|
|
107
|
+
`DropdownMenuRadioGroup`, whose `value` and `onValueChange` manage the group.
|
|
108
|
+
- `DropdownMenuSub` supports `open`, `defaultOpen`, and `onOpenChange`.
|
|
109
|
+
- `DropdownMenuLabel` and `DropdownMenuSubTrigger` support `inset`.
|
|
110
|
+
|
|
111
|
+
## States and interaction
|
|
112
|
+
|
|
113
|
+
Use controlled `open` when another surface, including a native-menu fallback,
|
|
114
|
+
must open the portable menu. Checkbox and radio items retain menu semantics and
|
|
115
|
+
should represent durable state. Keep command order stable and place destructive
|
|
116
|
+
commands last or in a separated group.
|
|
117
|
+
|
|
118
|
+
Menu surfaces use `bg-popover`, `text-popover-foreground`,
|
|
119
|
+
`rounded-overlay`, and `shadow-overlay`. Focused and open submenu rows use the
|
|
120
|
+
accent roles; destructive rows use the semantic destructive roles.
|
|
121
|
+
|
|
122
|
+
## Keyboard and accessibility
|
|
123
|
+
|
|
124
|
+
Radix supplies menu roles, trigger semantics, roving focus, typeahead, Escape
|
|
125
|
+
dismissal, and submenu navigation. Give icon-only triggers an accessible name
|
|
126
|
+
and a tooltip. Do not place form fields or arbitrary focusable content inside a
|
|
127
|
+
menu item; use `Popover` or `Dialog`.
|
|
128
|
+
|
|
129
|
+
## Platform behavior
|
|
130
|
+
|
|
131
|
+
With `items`, pointer and keyboard trigger activation automatically opens the
|
|
132
|
+
host-native menu when `nativeMenu` is advertised. The trigger rectangle is its
|
|
133
|
+
anchor, `selectedId` is delivered to `onSelectItem`, and dismissal is a no-op.
|
|
134
|
+
No portable menu is rendered while that native request is open.
|
|
135
|
+
|
|
136
|
+
Without the advertisement, including web and iOS, the same items automatically
|
|
137
|
+
render through the existing Radix anatomy. A stale advertisement that returns
|
|
138
|
+
fallback opens the portable menu as well. Icons and destructive styling are
|
|
139
|
+
portable in v1; `sfSymbol` is reserved and is not posted to or rendered by the
|
|
140
|
+
native service.
|
|
141
|
+
|
|
142
|
+
Shortcuts are display metadata only. They do not register keyboard handlers;
|
|
143
|
+
keep command execution keyed by `onSelectItem`. See
|
|
144
|
+
[`host-native-menu.md`](../../lib/host-native-menu.md) for host limits and
|
|
145
|
+
cancellation behavior.
|
|
146
|
+
|
|
147
|
+
## Do
|
|
148
|
+
|
|
149
|
+
- Use a visible trigger that communicates the menu's scope.
|
|
150
|
+
- Keep labels concise and verb-led.
|
|
151
|
+
- Use checkbox and radio items for menu-owned state.
|
|
152
|
+
- Keep submenus shallow and provide shortcuts only for real commands.
|
|
153
|
+
|
|
154
|
+
## Don't
|
|
155
|
+
|
|
156
|
+
- Do not use a command menu as a form-value selector.
|
|
157
|
+
- Do not hide a single primary action behind an overflow trigger.
|
|
158
|
+
- Do not mix `items` with `DropdownMenuContent` children.
|
|
159
|
+
- Do not treat shortcut metadata as a registered keyboard command.
|
|
160
|
+
|
|
161
|
+
## Testing
|
|
162
|
+
|
|
163
|
+
Exercise pointer and keyboard opening, focus movement, typeahead, Escape,
|
|
164
|
+
disabled items, checkbox/radio state, submenus, native selection and dismissal,
|
|
165
|
+
service availability changes, and portable fallback.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# ErrorBoundaryView
|
|
2
|
+
|
|
3
|
+
`ErrorBoundaryView` presents a compact recovery state without owning error
|
|
4
|
+
catching, reporting, or host policy.
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
Use it as the renderer for a React error boundary, route-level failure, or
|
|
9
|
+
host-provided pane error. Supply `actions` when the host owns reporting,
|
|
10
|
+
navigation, or chat recovery.
|
|
11
|
+
|
|
12
|
+
## When not to use
|
|
13
|
+
|
|
14
|
+
Do not use it for inline field validation, routine empty states, or transient
|
|
15
|
+
request failures that can stay beside the initiating control. It does not catch
|
|
16
|
+
errors itself; use `AppErrorBoundary` when the package should own catching and
|
|
17
|
+
Moldable reporting.
|
|
18
|
+
|
|
19
|
+
## Anatomy
|
|
20
|
+
|
|
21
|
+
The view contains one compact surface with a title, optional message, optional
|
|
22
|
+
error-details disclosure, and one action row. It does not add illustrations or
|
|
23
|
+
nested cards.
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
import { ErrorBoundaryView } from '@moldable-ai/ui'
|
|
29
|
+
|
|
30
|
+
function PaneError() {
|
|
31
|
+
return (
|
|
32
|
+
<ErrorBoundaryView
|
|
33
|
+
title="Could not load this pane"
|
|
34
|
+
message="Retry the request or report the captured error."
|
|
35
|
+
details={error.stack}
|
|
36
|
+
onRetry={retry}
|
|
37
|
+
actions={
|
|
38
|
+
<Button type="button" variant="secondary" onClick={reportError}>
|
|
39
|
+
Report error
|
|
40
|
+
</Button>
|
|
41
|
+
}
|
|
42
|
+
/>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Variants and sizes
|
|
48
|
+
|
|
49
|
+
The renderer has one responsive layout. It uses the available height in a pane
|
|
50
|
+
and can fill a window when its parent gives it full height. The content remains
|
|
51
|
+
bounded to a readable width.
|
|
52
|
+
|
|
53
|
+
## API
|
|
54
|
+
|
|
55
|
+
- `title`: heading content. Defaults to `"Something went wrong"`.
|
|
56
|
+
- `message`: optional supporting copy.
|
|
57
|
+
- `details`: optional string shown in a collapsed disclosure with a bounded,
|
|
58
|
+
scrollable monospace region.
|
|
59
|
+
- `onRetry`: when supplied, renders a `Retry` button and calls the handler once
|
|
60
|
+
per activation.
|
|
61
|
+
- `actions`: optional host-provided action content rendered after Retry.
|
|
62
|
+
- `className`: optional classes merged onto the outer renderer.
|
|
63
|
+
|
|
64
|
+
## States and interaction
|
|
65
|
+
|
|
66
|
+
Omit `details` when there is no safe diagnostic text to show. Omit both
|
|
67
|
+
`onRetry` and `actions` for a read-only failure. Keep retry state in the caller
|
|
68
|
+
and pass `loading` to a custom action when retrying is asynchronous.
|
|
69
|
+
|
|
70
|
+
## Keyboard and accessibility
|
|
71
|
+
|
|
72
|
+
The details use native `details` and `summary` semantics. The title is the
|
|
73
|
+
surface heading, the Retry control keeps native button behavior, and diagnostic
|
|
74
|
+
text remains selectable.
|
|
75
|
+
|
|
76
|
+
## Platform behavior
|
|
77
|
+
|
|
78
|
+
The component has no host calls or platform branches. `AppErrorBoundary`
|
|
79
|
+
supplies Moldable-specific reload and chat-prefill actions.
|
|
80
|
+
|
|
81
|
+
## Do
|
|
82
|
+
|
|
83
|
+
- Keep the title calm and literal.
|
|
84
|
+
- Give the message a concrete recovery path.
|
|
85
|
+
- Redact secrets before passing diagnostic details.
|
|
86
|
+
- Use semantic theme tokens in custom actions.
|
|
87
|
+
|
|
88
|
+
## Don't
|
|
89
|
+
|
|
90
|
+
- Do not add decorative error art or nested cards.
|
|
91
|
+
- Do not put binary data or unbounded logs in `details`.
|
|
92
|
+
- Do not make this presentational component report or reload implicitly.
|
|
93
|
+
|
|
94
|
+
## Testing
|
|
95
|
+
|
|
96
|
+
Contract tests should verify copy, disclosure behavior, Retry activation, and
|
|
97
|
+
host action rendering. Error-catching and reporting tests belong to the owning
|
|
98
|
+
boundary.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Hover card
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
`HoverCard` reveals a richer, non-essential preview for a referenced object,
|
|
6
|
+
usually a link. It helps users decide whether to open a person, file, project,
|
|
7
|
+
or other destination without leaving the current view.
|
|
8
|
+
|
|
9
|
+
Use `Tooltip` for a terse, non-interactive clarification of an already named
|
|
10
|
+
control. Use `HoverCard` for preview content with several lines or pieces of
|
|
11
|
+
metadata. Use `Popover` when the surface contains actions, fields, settings, or
|
|
12
|
+
other interactive content.
|
|
13
|
+
|
|
14
|
+
## Usage patterns
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import { HoverCard, HoverCardContent, HoverCardTrigger } from '@moldable-ai/ui'
|
|
18
|
+
|
|
19
|
+
function ProjectPreview() {
|
|
20
|
+
return (
|
|
21
|
+
<HoverCard openDelay={400} closeDelay={150}>
|
|
22
|
+
<HoverCardTrigger href="/projects/atlas">
|
|
23
|
+
Atlas migration
|
|
24
|
+
</HoverCardTrigger>
|
|
25
|
+
<HoverCardContent side="right" align="start">
|
|
26
|
+
<p className="text-ui-label font-medium">Atlas migration</p>
|
|
27
|
+
<p className="text-text-secondary text-ui-body">
|
|
28
|
+
Infrastructure move · updated 12 minutes ago
|
|
29
|
+
</p>
|
|
30
|
+
</HoverCardContent>
|
|
31
|
+
</HoverCard>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The trigger is link-based by default and accepts anchor props. Keep the
|
|
37
|
+
destination usable without opening the preview.
|
|
38
|
+
|
|
39
|
+
## Anatomy
|
|
40
|
+
|
|
41
|
+
`HoverCard` owns timing and open state. `HoverCardTrigger` references the
|
|
42
|
+
previewed object. `HoverCardContent` is portalled and collision-aware; this
|
|
43
|
+
wrapper defaults to `align="center"`, `sideOffset={4}`, and a `w-64` preview.
|
|
44
|
+
|
|
45
|
+
## API summary
|
|
46
|
+
|
|
47
|
+
- `HoverCard` supports `open`, `defaultOpen`, `onOpenChange`, `openDelay`, and
|
|
48
|
+
`closeDelay`.
|
|
49
|
+
- `HoverCardTrigger` accepts anchor props, including `href`.
|
|
50
|
+
- `HoverCardContent` accepts positioning props including `side`, `align`, and
|
|
51
|
+
`sideOffset`, plus `forceMount` and outside-interaction handlers.
|
|
52
|
+
|
|
53
|
+
## States and interaction
|
|
54
|
+
|
|
55
|
+
The preview must remain supplementary. Touch users and users who never hover
|
|
56
|
+
must still be able to understand and activate the trigger. Keep delay changes
|
|
57
|
+
local and deliberate so neighboring previews do not flicker while the pointer
|
|
58
|
+
moves through a collection.
|
|
59
|
+
|
|
60
|
+
Content uses `bg-popover`, `text-popover-foreground`, `rounded-overlay`, and
|
|
61
|
+
`shadow-overlay`. Use `text-text-secondary` for supporting preview metadata;
|
|
62
|
+
do not invent a preview-only palette or elevation.
|
|
63
|
+
|
|
64
|
+
## Keyboard and accessibility
|
|
65
|
+
|
|
66
|
+
The trigger must retain its own accessible name and destination. Do not put
|
|
67
|
+
required instructions only in the card. If content must receive focus or
|
|
68
|
+
contain controls, switch to `Popover`, whose explicit trigger and dismissal
|
|
69
|
+
model fit interactive content.
|
|
70
|
+
|
|
71
|
+
## Do
|
|
72
|
+
|
|
73
|
+
- Preview the same object the trigger names.
|
|
74
|
+
- Keep content concise enough to scan without scrolling.
|
|
75
|
+
- Include metadata that helps a navigation decision.
|
|
76
|
+
- Preserve a working link or other primary path on the trigger.
|
|
77
|
+
|
|
78
|
+
## Don't
|
|
79
|
+
|
|
80
|
+
- Do not repeat a one-line label that belongs in `Tooltip`.
|
|
81
|
+
- Do not place buttons, links, form fields, or required actions in the card;
|
|
82
|
+
use `Popover`.
|
|
83
|
+
- Do not make hover the only way to discover important information.
|
|
84
|
+
- Do not use a hover card as a delayed dialog.
|
|
85
|
+
|
|
86
|
+
## Moldable considerations
|
|
87
|
+
|
|
88
|
+
Hover cards are portable webview overlays. Keep them within collision-aware
|
|
89
|
+
viewport bounds and avoid previews that cover the fixed desktop chat or a
|
|
90
|
+
primary action for prolonged periods.
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Select
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
`Select` chooses one value from a short, fixed set. Use it when every option is
|
|
6
|
+
known before the menu opens and scanning the list is faster than typing.
|
|
7
|
+
|
|
8
|
+
Use `Combobox` when users need to filter a longer list, create a value, fetch
|
|
9
|
+
remote results, or select multiple values. Use `RadioGroup` when a small set of
|
|
10
|
+
important choices should remain visible, and `DropdownMenu` for commands rather
|
|
11
|
+
than form values.
|
|
12
|
+
|
|
13
|
+
## Usage patterns
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import {
|
|
17
|
+
Select,
|
|
18
|
+
SelectContent,
|
|
19
|
+
SelectGroup,
|
|
20
|
+
SelectItem,
|
|
21
|
+
SelectLabel,
|
|
22
|
+
SelectTrigger,
|
|
23
|
+
SelectValue,
|
|
24
|
+
} from '@moldable-ai/ui'
|
|
25
|
+
|
|
26
|
+
function SortSelect() {
|
|
27
|
+
return (
|
|
28
|
+
<>
|
|
29
|
+
<label htmlFor="sort-order">Sort</label>
|
|
30
|
+
<Select defaultValue="updated">
|
|
31
|
+
<SelectTrigger id="sort-order" size="sm">
|
|
32
|
+
<SelectValue placeholder="Choose an order" />
|
|
33
|
+
</SelectTrigger>
|
|
34
|
+
<SelectContent position="popper" align="start">
|
|
35
|
+
<SelectGroup>
|
|
36
|
+
<SelectLabel>Sort by</SelectLabel>
|
|
37
|
+
<SelectItem value="updated">Recently updated</SelectItem>
|
|
38
|
+
<SelectItem value="created">Date created</SelectItem>
|
|
39
|
+
<SelectItem value="name">Name</SelectItem>
|
|
40
|
+
</SelectGroup>
|
|
41
|
+
</SelectContent>
|
|
42
|
+
</Select>
|
|
43
|
+
</>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Give the trigger a visible external label or an accessible name. Placeholder
|
|
49
|
+
text describes the missing value; it does not replace a label.
|
|
50
|
+
|
|
51
|
+
## Anatomy
|
|
52
|
+
|
|
53
|
+
Compose `Select` with `SelectTrigger`, `SelectValue`, `SelectContent`, and one
|
|
54
|
+
or more `SelectItem` children. `SelectGroup`, `SelectLabel`, and
|
|
55
|
+
`SelectSeparator` organize a longer fixed list. Scroll buttons are included by
|
|
56
|
+
`SelectContent`.
|
|
57
|
+
|
|
58
|
+
## API summary
|
|
59
|
+
|
|
60
|
+
- `Select` supports `value`, `defaultValue`, `onValueChange`, `open`,
|
|
61
|
+
`defaultOpen`, `onOpenChange`, `disabled`, `required`, `name`,
|
|
62
|
+
`autoComplete`, `form`, and `dir`.
|
|
63
|
+
- `SelectTrigger` accepts button props and `size="sm" | "default"`.
|
|
64
|
+
- `SelectValue` accepts `placeholder`.
|
|
65
|
+
- `SelectContent` accepts `position="item-aligned" | "popper"` and Radix
|
|
66
|
+
positioning props such as `align`. This wrapper defaults `align` to `center`.
|
|
67
|
+
- `SelectItem` requires a string `value` and supports `disabled` and
|
|
68
|
+
`textValue`.
|
|
69
|
+
|
|
70
|
+
## States and interaction
|
|
71
|
+
|
|
72
|
+
Use controlled `value` when selection affects other state immediately; use
|
|
73
|
+
`defaultValue` for an isolated uncontrolled field. Disable only unavailable
|
|
74
|
+
items rather than the entire select when some choices remain valid. Keep item
|
|
75
|
+
labels stable while the menu is open.
|
|
76
|
+
|
|
77
|
+
The trigger uses the control shape and body-text roles. The menu uses
|
|
78
|
+
`bg-popover`, `text-popover-foreground`, `rounded-overlay`, and
|
|
79
|
+
`shadow-overlay`; focused options use the semantic accent roles. Preserve those
|
|
80
|
+
roles instead of adding raw fills, radii, or shadows.
|
|
81
|
+
|
|
82
|
+
## Keyboard and accessibility
|
|
83
|
+
|
|
84
|
+
Radix supplies listbox keyboard navigation, typeahead, focus management, and
|
|
85
|
+
selection semantics. Do not replace `SelectItem` with buttons or add nested
|
|
86
|
+
interactive controls. Associate a visible label with the trigger, and make
|
|
87
|
+
disabled state apparent without relying on color alone.
|
|
88
|
+
|
|
89
|
+
## Do
|
|
90
|
+
|
|
91
|
+
- Use concise, mutually exclusive option labels.
|
|
92
|
+
- Put the current value in `value` or `defaultValue`, not in placeholder text.
|
|
93
|
+
- Use `position="popper"` when the menu should align to the trigger rather than
|
|
94
|
+
the selected item.
|
|
95
|
+
- Use `SelectLabel` when groups need names.
|
|
96
|
+
|
|
97
|
+
## Don't
|
|
98
|
+
|
|
99
|
+
- Do not use `Select` for searchable, creatable, remote, or multi-value data;
|
|
100
|
+
use `Combobox`.
|
|
101
|
+
- Do not put actions, links, checkboxes, or explanatory paragraphs in the
|
|
102
|
+
option list.
|
|
103
|
+
- Do not use it for two or three choices that users must compare at a glance;
|
|
104
|
+
use `RadioGroup`.
|
|
105
|
+
- Do not deep-import the implementation; import from `@moldable-ai/ui`.
|
|
106
|
+
|
|
107
|
+
## Moldable considerations
|
|
108
|
+
|
|
109
|
+
`Select` is the portable renderer-owned control in app webviews. Keep required
|
|
110
|
+
choices available through keyboard and pointer input, and do not replace it
|
|
111
|
+
with a host-native command menu.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Host date/time picker
|
|
2
|
+
|
|
3
|
+
`useHostDateTimePicker()` and `pickDateTimeWithHost()` opt a call site into the
|
|
4
|
+
host-owned system picker when the Moldable host advertises it.
|
|
5
|
+
|
|
6
|
+
```tsx
|
|
7
|
+
const picker = useHostDateTimePicker()
|
|
8
|
+
const buttonRef = useRef<HTMLButtonElement>(null)
|
|
9
|
+
|
|
10
|
+
const result = await picker.pick('datetime', {
|
|
11
|
+
value: '2026-07-26T14:30:00',
|
|
12
|
+
min: '2026-01-01T00:00:00',
|
|
13
|
+
anchor: buttonRef.current ?? undefined,
|
|
14
|
+
})
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
`mode` is `"date"`, `"time"`, or `"datetime"`. `value`, `min`, and `max` use
|
|
18
|
+
the matching timezone-free ISO form: `YYYY-MM-DD`, `HH:mm[:ss]`, or
|
|
19
|
+
`YYYY-MM-DDTHH:mm[:ss]`. This matches portable form controls and avoids
|
|
20
|
+
converting a calendar date through UTC. Native confirmation returns the same
|
|
21
|
+
mode-specific form. Click-away or close resolves with `status: "cancelled"`.
|
|
22
|
+
|
|
23
|
+
Native presentation is per-call-site opt-in. When the service is unavailable,
|
|
24
|
+
the helper returns `status: "fallback"` together with the mode and range. It
|
|
25
|
+
does not open renderer UI: the caller should keep using the portable
|
|
26
|
+
`DatePicker`, `DateField`, or calendar popover as its default experience.
|
|
27
|
+
|
|
28
|
+
An explicit `AbortSignal` abort rejects with `AbortError` and asks the host to
|
|
29
|
+
dismiss an open native popover. `timeoutMs` can lower the host default timeout.
|