@moldable-ai/ui 0.2.19 → 0.2.21
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 +15 -0
- package/dist/catalog/catalog-coverage.d.ts.map +1 -0
- package/dist/catalog/catalog-coverage.js +44 -0
- package/dist/catalog/catalog-manifest.d.ts +6 -0
- package/dist/catalog/catalog-manifest.d.ts.map +1 -0
- package/dist/catalog/catalog-manifest.js +117 -0
- package/dist/catalog/catalog-types.d.ts +64 -0
- package/dist/catalog/catalog-types.d.ts.map +1 -0
- package/dist/catalog/catalog-types.js +20 -0
- package/dist/catalog/component-catalog.d.ts +14 -0
- package/dist/catalog/component-catalog.d.ts.map +1 -0
- package/dist/catalog/component-catalog.js +49 -0
- package/dist/catalog/core-catalog-exclusions.d.ts +8 -0
- package/dist/catalog/core-catalog-exclusions.d.ts.map +1 -0
- package/dist/catalog/core-catalog-exclusions.js +151 -0
- package/dist/catalog/core-catalog.d.ts +2 -0
- package/dist/catalog/core-catalog.d.ts.map +1 -0
- package/dist/catalog/core-catalog.js +19 -0
- package/dist/catalog/core-collection-stories.d.ts +3 -0
- package/dist/catalog/core-collection-stories.d.ts.map +1 -0
- package/dist/catalog/core-collection-stories.js +42 -0
- package/dist/catalog/core-control-stories.d.ts +3 -0
- package/dist/catalog/core-control-stories.d.ts.map +1 -0
- package/dist/catalog/core-control-stories.js +94 -0
- package/dist/catalog/core-feedback-stories.d.ts +3 -0
- package/dist/catalog/core-feedback-stories.d.ts.map +1 -0
- package/dist/catalog/core-feedback-stories.js +50 -0
- package/dist/catalog/core-foundation-stories.d.ts +3 -0
- package/dist/catalog/core-foundation-stories.d.ts.map +1 -0
- package/dist/catalog/core-foundation-stories.js +53 -0
- package/dist/catalog/core-navigation-stories.d.ts +3 -0
- package/dist/catalog/core-navigation-stories.d.ts.map +1 -0
- package/dist/catalog/core-navigation-stories.js +25 -0
- package/dist/catalog/core-overlay-stories.d.ts +3 -0
- package/dist/catalog/core-overlay-stories.d.ts.map +1 -0
- package/dist/catalog/core-overlay-stories.js +20 -0
- package/dist/catalog/index.d.ts +7 -0
- package/dist/catalog/index.d.ts.map +1 -0
- package/dist/catalog/index.js +6 -0
- package/dist/components/app-error-boundary.d.ts +1 -0
- package/dist/components/app-error-boundary.d.ts.map +1 -1
- package/dist/components/app-error-boundary.js +13 -0
- package/dist/components/chat/chat-image-lightbox.d.ts +9 -0
- package/dist/components/chat/chat-image-lightbox.d.ts.map +1 -0
- package/dist/components/chat/chat-image-lightbox.js +9 -0
- package/dist/components/chat/chat-message.d.ts +19 -1
- package/dist/components/chat/chat-message.d.ts.map +1 -1
- package/dist/components/chat/chat-message.js +66 -16
- package/dist/components/chat/chat-messages.d.ts +5 -2
- package/dist/components/chat/chat-messages.d.ts.map +1 -1
- package/dist/components/chat/chat-messages.js +61 -6
- package/dist/components/chat/chat-panel.d.ts +49 -6
- package/dist/components/chat/chat-panel.d.ts.map +1 -1
- package/dist/components/chat/chat-panel.js +196 -163
- package/dist/components/chat/conversation-history.d.ts +39 -5
- package/dist/components/chat/conversation-history.d.ts.map +1 -1
- package/dist/components/chat/conversation-history.js +192 -26
- package/dist/components/chat/index.d.ts +2 -2
- package/dist/components/chat/index.d.ts.map +1 -1
- package/dist/components/chat/index.js +1 -1
- package/dist/components/chat/tool-handlers.d.ts.map +1 -1
- package/dist/components/chat/tool-handlers.js +40 -2
- package/dist/components/chat/vertical-scroll-fade.d.ts +6 -0
- package/dist/components/chat/vertical-scroll-fade.d.ts.map +1 -0
- package/dist/components/chat/vertical-scroll-fade.js +12 -0
- package/dist/components/native-capabilities/bluetooth-panel-helpers.d.ts +9 -0
- package/dist/components/native-capabilities/bluetooth-panel-helpers.d.ts.map +1 -0
- package/dist/components/native-capabilities/bluetooth-panel-helpers.js +37 -0
- package/dist/components/native-capabilities/bluetooth-panel.d.ts +56 -0
- package/dist/components/native-capabilities/bluetooth-panel.d.ts.map +1 -0
- package/dist/components/native-capabilities/bluetooth-panel.js +470 -0
- package/dist/components/native-capabilities/camera-preview.d.ts +39 -0
- package/dist/components/native-capabilities/camera-preview.d.ts.map +1 -0
- package/dist/components/native-capabilities/camera-preview.js +228 -0
- package/dist/components/native-capabilities/capability-badge.d.ts +23 -0
- package/dist/components/native-capabilities/capability-badge.d.ts.map +1 -0
- package/dist/components/native-capabilities/capability-badge.js +39 -0
- package/dist/components/native-capabilities/capability-matrix.d.ts +14 -0
- package/dist/components/native-capabilities/capability-matrix.d.ts.map +1 -0
- package/dist/components/native-capabilities/capability-matrix.js +97 -0
- package/dist/components/native-capabilities/clipboard-button.d.ts +26 -0
- package/dist/components/native-capabilities/clipboard-button.d.ts.map +1 -0
- package/dist/components/native-capabilities/clipboard-button.js +99 -0
- package/dist/components/native-capabilities/device-io-controls.d.ts +4 -0
- package/dist/components/native-capabilities/device-io-controls.d.ts.map +1 -0
- package/dist/components/native-capabilities/device-io-controls.js +28 -0
- package/dist/components/native-capabilities/device-list.d.ts +20 -0
- package/dist/components/native-capabilities/device-list.d.ts.map +1 -0
- package/dist/components/native-capabilities/device-list.js +14 -0
- package/dist/components/native-capabilities/display-map.d.ts +23 -0
- package/dist/components/native-capabilities/display-map.d.ts.map +1 -0
- package/dist/components/native-capabilities/display-map.js +114 -0
- package/dist/components/native-capabilities/haptic-button.d.ts +26 -0
- package/dist/components/native-capabilities/haptic-button.d.ts.map +1 -0
- package/dist/components/native-capabilities/haptic-button.js +94 -0
- package/dist/components/native-capabilities/hid-panel.d.ts +40 -0
- package/dist/components/native-capabilities/hid-panel.d.ts.map +1 -0
- package/dist/components/native-capabilities/hid-panel.js +373 -0
- package/dist/components/native-capabilities/index.d.ts +27 -0
- package/dist/components/native-capabilities/index.d.ts.map +1 -0
- package/dist/components/native-capabilities/index.js +26 -0
- package/dist/components/native-capabilities/live-indicator.d.ts +15 -0
- package/dist/components/native-capabilities/live-indicator.d.ts.map +1 -0
- package/dist/components/native-capabilities/live-indicator.js +26 -0
- package/dist/components/native-capabilities/local-auth-button.d.ts +33 -0
- package/dist/components/native-capabilities/local-auth-button.d.ts.map +1 -0
- package/dist/components/native-capabilities/local-auth-button.js +115 -0
- package/dist/components/native-capabilities/location-panel.d.ts +29 -0
- package/dist/components/native-capabilities/location-panel.d.ts.map +1 -0
- package/dist/components/native-capabilities/location-panel.js +146 -0
- package/dist/components/native-capabilities/microphone-meter.d.ts +35 -0
- package/dist/components/native-capabilities/microphone-meter.d.ts.map +1 -0
- package/dist/components/native-capabilities/microphone-meter.js +244 -0
- package/dist/components/native-capabilities/midi-monitor.d.ts +54 -0
- package/dist/components/native-capabilities/midi-monitor.d.ts.map +1 -0
- package/dist/components/native-capabilities/midi-monitor.js +534 -0
- package/dist/components/native-capabilities/native-capability-panel.d.ts +11 -0
- package/dist/components/native-capabilities/native-capability-panel.d.ts.map +1 -0
- package/dist/components/native-capabilities/native-capability-panel.js +28 -0
- package/dist/components/native-capabilities/notification-panel.d.ts +24 -0
- package/dist/components/native-capabilities/notification-panel.d.ts.map +1 -0
- package/dist/components/native-capabilities/notification-panel.js +124 -0
- package/dist/components/native-capabilities/power-blocker-controller.d.ts +19 -0
- package/dist/components/native-capabilities/power-blocker-controller.d.ts.map +1 -0
- package/dist/components/native-capabilities/power-blocker-controller.js +83 -0
- package/dist/components/native-capabilities/power-panel.d.ts +67 -0
- package/dist/components/native-capabilities/power-panel.d.ts.map +1 -0
- package/dist/components/native-capabilities/power-panel.js +309 -0
- package/dist/components/native-capabilities/readout.d.ts +10 -0
- package/dist/components/native-capabilities/readout.d.ts.map +1 -0
- package/dist/components/native-capabilities/readout.js +11 -0
- package/dist/components/native-capabilities/screen-share-preview.d.ts +36 -0
- package/dist/components/native-capabilities/screen-share-preview.d.ts.map +1 -0
- package/dist/components/native-capabilities/screen-share-preview.js +191 -0
- package/dist/components/native-capabilities/secure-storage-panel.d.ts +36 -0
- package/dist/components/native-capabilities/secure-storage-panel.d.ts.map +1 -0
- package/dist/components/native-capabilities/secure-storage-panel.js +193 -0
- package/dist/components/native-capabilities/serial-console.d.ts +64 -0
- package/dist/components/native-capabilities/serial-console.d.ts.map +1 -0
- package/dist/components/native-capabilities/serial-console.js +399 -0
- package/dist/components/native-capabilities/shortcut-recorder.d.ts +35 -0
- package/dist/components/native-capabilities/shortcut-recorder.d.ts.map +1 -0
- package/dist/components/native-capabilities/shortcut-recorder.js +217 -0
- package/dist/components/native-capabilities/stream-log.d.ts +35 -0
- package/dist/components/native-capabilities/stream-log.d.ts.map +1 -0
- package/dist/components/native-capabilities/stream-log.js +65 -0
- package/dist/components/native-capabilities/system-audio-monitor.d.ts +34 -0
- package/dist/components/native-capabilities/system-audio-monitor.d.ts.map +1 -0
- package/dist/components/native-capabilities/system-audio-monitor.js +275 -0
- package/dist/components/native-capabilities/usb-panel.d.ts +54 -0
- package/dist/components/native-capabilities/usb-panel.d.ts.map +1 -0
- package/dist/components/native-capabilities/usb-panel.js +363 -0
- package/dist/components/native-capabilities/use-capability.d.ts +20 -0
- package/dist/components/native-capabilities/use-capability.d.ts.map +1 -0
- package/dist/components/native-capabilities/use-capability.js +61 -0
- package/dist/components/ui/alert-dialog.d.ts +7 -3
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.js +9 -5
- package/dist/components/ui/alert.d.ts +19 -3
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/alert.js +25 -8
- package/dist/components/ui/app-frame.d.ts +28 -0
- package/dist/components/ui/app-frame.d.ts.map +1 -0
- package/dist/components/ui/app-frame.js +95 -0
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/collapsible.d.ts +9 -1
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/collapsible.js +13 -2
- package/dist/components/ui/collection-navigation.d.ts +8 -0
- package/dist/components/ui/collection-navigation.d.ts.map +1 -0
- package/dist/components/ui/collection-navigation.js +19 -0
- package/dist/components/ui/color-well.d.ts +13 -0
- package/dist/components/ui/color-well.d.ts.map +1 -0
- package/dist/components/ui/color-well.js +30 -0
- package/dist/components/ui/command.d.ts +5 -1
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/command.js +13 -1
- package/dist/components/ui/confirm-dialog.d.ts +19 -0
- package/dist/components/ui/confirm-dialog.d.ts.map +1 -0
- package/dist/components/ui/confirm-dialog.js +45 -0
- package/dist/components/ui/date-field.d.ts +19 -0
- package/dist/components/ui/date-field.d.ts.map +1 -0
- package/dist/components/ui/date-field.js +54 -0
- package/dist/components/ui/date-picker.d.ts +24 -0
- package/dist/components/ui/date-picker.d.ts.map +1 -0
- package/dist/components/ui/date-picker.js +92 -0
- package/dist/components/ui/dialog.d.ts +4 -2
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +8 -5
- package/dist/components/ui/edge-fade.d.ts +11 -0
- package/dist/components/ui/edge-fade.d.ts.map +1 -0
- package/dist/components/ui/edge-fade.js +41 -0
- package/dist/components/ui/empty.d.ts +7 -2
- package/dist/components/ui/empty.d.ts.map +1 -1
- package/dist/components/ui/empty.js +20 -7
- package/dist/components/ui/field.d.ts +1 -1
- package/dist/components/ui/grid.d.ts +24 -0
- package/dist/components/ui/grid.d.ts.map +1 -0
- package/dist/components/ui/grid.js +258 -0
- package/dist/components/ui/icon-button.d.ts +15 -0
- package/dist/components/ui/icon-button.d.ts.map +1 -0
- package/dist/components/ui/icon-button.js +15 -0
- package/dist/components/ui/index.d.ts +23 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +23 -0
- package/dist/components/ui/input-group.d.ts +1 -1
- package/dist/components/ui/inspector.d.ts +15 -0
- package/dist/components/ui/inspector.d.ts.map +1 -0
- package/dist/components/ui/inspector.js +26 -0
- package/dist/components/ui/kbd.d.ts +1 -1
- package/dist/components/ui/list.d.ts +28 -0
- package/dist/components/ui/list.d.ts.map +1 -0
- package/dist/components/ui/list.js +235 -0
- package/dist/components/ui/material.d.ts +34 -0
- package/dist/components/ui/material.d.ts.map +1 -0
- package/dist/components/ui/material.js +34 -0
- package/dist/components/ui/message-scroller-controller.d.ts +162 -0
- package/dist/components/ui/message-scroller-controller.d.ts.map +1 -0
- package/dist/components/ui/message-scroller-controller.js +888 -0
- package/dist/components/ui/message-scroller-layout-stability.d.ts +33 -0
- package/dist/components/ui/message-scroller-layout-stability.d.ts.map +1 -0
- package/dist/components/ui/message-scroller-layout-stability.js +153 -0
- package/dist/components/ui/message-scroller-policy.d.ts +74 -0
- package/dist/components/ui/message-scroller-policy.d.ts.map +1 -0
- package/dist/components/ui/message-scroller-policy.js +129 -0
- package/dist/components/ui/message-scroller-primitive.d.ts +55 -0
- package/dist/components/ui/message-scroller-primitive.d.ts.map +1 -0
- package/dist/components/ui/message-scroller-primitive.js +226 -0
- package/dist/components/ui/message-scroller.d.ts +11 -0
- package/dist/components/ui/message-scroller.d.ts.map +1 -0
- package/dist/components/ui/message-scroller.js +25 -0
- package/dist/components/ui/navigation-button-group.d.ts +16 -0
- package/dist/components/ui/navigation-button-group.d.ts.map +1 -0
- package/dist/components/ui/navigation-button-group.js +9 -0
- package/dist/components/ui/notification-dot.d.ts +4 -0
- package/dist/components/ui/notification-dot.d.ts.map +1 -0
- package/dist/components/ui/notification-dot.js +7 -0
- package/dist/components/ui/number-input.d.ts +16 -0
- package/dist/components/ui/number-input.d.ts.map +1 -0
- package/dist/components/ui/number-input.js +56 -0
- package/dist/components/ui/panel.d.ts +18 -0
- package/dist/components/ui/panel.d.ts.map +1 -0
- package/dist/components/ui/panel.js +40 -0
- package/dist/components/ui/popover.d.ts +9 -2
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +14 -4
- package/dist/components/ui/scroll-area.d.ts +8 -2
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.js +6 -3
- package/dist/components/ui/search-field.d.ts +19 -0
- package/dist/components/ui/search-field.d.ts.map +1 -0
- package/dist/components/ui/search-field.js +64 -0
- package/dist/components/ui/segmented-control.d.ts +21 -0
- package/dist/components/ui/segmented-control.d.ts.map +1 -0
- package/dist/components/ui/segmented-control.js +62 -0
- package/dist/components/ui/sheet.d.ts +4 -2
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet.js +12 -9
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/sonner.d.ts +4 -3
- package/dist/components/ui/sonner.d.ts.map +1 -1
- package/dist/components/ui/sonner.js +7 -6
- package/dist/components/ui/split-view.d.ts +11 -0
- package/dist/components/ui/split-view.d.ts.map +1 -0
- package/dist/components/ui/split-view.js +13 -0
- package/dist/components/ui/status.d.ts +13 -0
- package/dist/components/ui/status.d.ts.map +1 -0
- package/dist/components/ui/status.js +36 -0
- package/dist/components/ui/table.d.ts +11 -2
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js +33 -6
- package/dist/components/ui/text.d.ts +17 -0
- package/dist/components/ui/text.d.ts.map +1 -0
- package/dist/components/ui/text.js +55 -0
- package/dist/components/ui/toggle.d.ts +12 -4
- package/dist/components/ui/toggle.d.ts.map +1 -1
- package/dist/components/ui/toggle.js +13 -2
- package/dist/components/ui/toolbar.d.ts +27 -0
- package/dist/components/ui/toolbar.d.ts.map +1 -0
- package/dist/components/ui/toolbar.js +71 -0
- package/dist/components/ui/tooltip.d.ts +8 -3
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip.js +11 -6
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/lib/frame-lifecycle.d.ts +29 -0
- package/dist/lib/frame-lifecycle.d.ts.map +1 -1
- package/dist/lib/frame-lifecycle.js +85 -0
- package/dist/lib/native-capabilities/access.d.ts +13 -0
- package/dist/lib/native-capabilities/access.d.ts.map +1 -0
- package/dist/lib/native-capabilities/access.js +53 -0
- package/dist/lib/native-capabilities/bluetooth-access.d.ts +14 -0
- package/dist/lib/native-capabilities/bluetooth-access.d.ts.map +1 -0
- package/dist/lib/native-capabilities/bluetooth-access.js +43 -0
- package/dist/lib/native-capabilities/bluetooth-connection.d.ts +19 -0
- package/dist/lib/native-capabilities/bluetooth-connection.d.ts.map +1 -0
- package/dist/lib/native-capabilities/bluetooth-connection.js +88 -0
- package/dist/lib/native-capabilities/bluetooth-gatt.d.ts +7 -0
- package/dist/lib/native-capabilities/bluetooth-gatt.d.ts.map +1 -0
- package/dist/lib/native-capabilities/bluetooth-gatt.js +77 -0
- package/dist/lib/native-capabilities/bluetooth-internal.d.ts +10 -0
- package/dist/lib/native-capabilities/bluetooth-internal.d.ts.map +1 -0
- package/dist/lib/native-capabilities/bluetooth-internal.js +105 -0
- package/dist/lib/native-capabilities/bluetooth-native-fallback.d.ts +33 -0
- package/dist/lib/native-capabilities/bluetooth-native-fallback.d.ts.map +1 -0
- package/dist/lib/native-capabilities/bluetooth-native-fallback.js +214 -0
- package/dist/lib/native-capabilities/bluetooth-types.d.ts +85 -0
- package/dist/lib/native-capabilities/bluetooth-types.d.ts.map +1 -0
- package/dist/lib/native-capabilities/bluetooth-types.js +2 -0
- package/dist/lib/native-capabilities/bluetooth.d.ts +7 -0
- package/dist/lib/native-capabilities/bluetooth.d.ts.map +1 -0
- package/dist/lib/native-capabilities/bluetooth.js +4 -0
- package/dist/lib/native-capabilities/bridge.d.ts +23 -0
- package/dist/lib/native-capabilities/bridge.d.ts.map +1 -0
- package/dist/lib/native-capabilities/bridge.js +266 -0
- package/dist/lib/native-capabilities/capabilities.d.ts +7 -0
- package/dist/lib/native-capabilities/capabilities.d.ts.map +1 -0
- package/dist/lib/native-capabilities/capabilities.js +95 -0
- package/dist/lib/native-capabilities/clipboard.d.ts +11 -0
- package/dist/lib/native-capabilities/clipboard.d.ts.map +1 -0
- package/dist/lib/native-capabilities/clipboard.js +58 -0
- package/dist/lib/native-capabilities/device-io-errors.d.ts +11 -0
- package/dist/lib/native-capabilities/device-io-errors.d.ts.map +1 -0
- package/dist/lib/native-capabilities/device-io-errors.js +82 -0
- package/dist/lib/native-capabilities/displays.d.ts +38 -0
- package/dist/lib/native-capabilities/displays.d.ts.map +1 -0
- package/dist/lib/native-capabilities/displays.js +12 -0
- package/dist/lib/native-capabilities/global-shortcuts.d.ts +86 -0
- package/dist/lib/native-capabilities/global-shortcuts.d.ts.map +1 -0
- package/dist/lib/native-capabilities/global-shortcuts.js +351 -0
- package/dist/lib/native-capabilities/haptics.d.ts +25 -0
- package/dist/lib/native-capabilities/haptics.d.ts.map +1 -0
- package/dist/lib/native-capabilities/haptics.js +18 -0
- package/dist/lib/native-capabilities/hid-native.d.ts +26 -0
- package/dist/lib/native-capabilities/hid-native.d.ts.map +1 -0
- package/dist/lib/native-capabilities/hid-native.js +229 -0
- package/dist/lib/native-capabilities/hid.d.ts +52 -0
- package/dist/lib/native-capabilities/hid.d.ts.map +1 -0
- package/dist/lib/native-capabilities/hid.js +163 -0
- package/dist/lib/native-capabilities/index.d.ts +40 -0
- package/dist/lib/native-capabilities/index.d.ts.map +1 -0
- package/dist/lib/native-capabilities/index.js +21 -0
- package/dist/lib/native-capabilities/local-authentication.d.ts +32 -0
- package/dist/lib/native-capabilities/local-authentication.d.ts.map +1 -0
- package/dist/lib/native-capabilities/local-authentication.js +46 -0
- package/dist/lib/native-capabilities/location.d.ts +49 -0
- package/dist/lib/native-capabilities/location.d.ts.map +1 -0
- package/dist/lib/native-capabilities/location.js +114 -0
- package/dist/lib/native-capabilities/media-permissions.d.ts +28 -0
- package/dist/lib/native-capabilities/media-permissions.d.ts.map +1 -0
- package/dist/lib/native-capabilities/media-permissions.js +37 -0
- package/dist/lib/native-capabilities/media.d.ts +17 -0
- package/dist/lib/native-capabilities/media.d.ts.map +1 -0
- package/dist/lib/native-capabilities/media.js +104 -0
- package/dist/lib/native-capabilities/midi-access.d.ts +13 -0
- package/dist/lib/native-capabilities/midi-access.d.ts.map +1 -0
- package/dist/lib/native-capabilities/midi-access.js +68 -0
- package/dist/lib/native-capabilities/midi-internal.d.ts +12 -0
- package/dist/lib/native-capabilities/midi-internal.d.ts.map +1 -0
- package/dist/lib/native-capabilities/midi-internal.js +88 -0
- package/dist/lib/native-capabilities/midi-native-fallback.d.ts +27 -0
- package/dist/lib/native-capabilities/midi-native-fallback.d.ts.map +1 -0
- package/dist/lib/native-capabilities/midi-native-fallback.js +127 -0
- package/dist/lib/native-capabilities/midi-ports.d.ts +6 -0
- package/dist/lib/native-capabilities/midi-ports.d.ts.map +1 -0
- package/dist/lib/native-capabilities/midi-ports.js +115 -0
- package/dist/lib/native-capabilities/midi-types.d.ts +25 -0
- package/dist/lib/native-capabilities/midi-types.d.ts.map +1 -0
- package/dist/lib/native-capabilities/midi-types.js +1 -0
- package/dist/lib/native-capabilities/midi.d.ts +6 -0
- package/dist/lib/native-capabilities/midi.d.ts.map +1 -0
- package/dist/lib/native-capabilities/midi.js +3 -0
- package/dist/lib/native-capabilities/native-device-io.d.ts +28 -0
- package/dist/lib/native-capabilities/native-device-io.d.ts.map +1 -0
- package/dist/lib/native-capabilities/native-device-io.js +91 -0
- package/dist/lib/native-capabilities/native-device-lifecycle.d.ts +13 -0
- package/dist/lib/native-capabilities/native-device-lifecycle.d.ts.map +1 -0
- package/dist/lib/native-capabilities/native-device-lifecycle.js +40 -0
- package/dist/lib/native-capabilities/notifications.d.ts +38 -0
- package/dist/lib/native-capabilities/notifications.d.ts.map +1 -0
- package/dist/lib/native-capabilities/notifications.js +50 -0
- package/dist/lib/native-capabilities/power-session.d.ts +113 -0
- package/dist/lib/native-capabilities/power-session.d.ts.map +1 -0
- package/dist/lib/native-capabilities/power-session.js +264 -0
- package/dist/lib/native-capabilities/secure-storage.d.ts +36 -0
- package/dist/lib/native-capabilities/secure-storage.d.ts.map +1 -0
- package/dist/lib/native-capabilities/secure-storage.js +64 -0
- package/dist/lib/native-capabilities/serial-native.d.ts +23 -0
- package/dist/lib/native-capabilities/serial-native.d.ts.map +1 -0
- package/dist/lib/native-capabilities/serial-native.js +181 -0
- package/dist/lib/native-capabilities/serial.d.ts +76 -0
- package/dist/lib/native-capabilities/serial.d.ts.map +1 -0
- package/dist/lib/native-capabilities/serial.js +215 -0
- package/dist/lib/native-capabilities/system-audio.d.ts +127 -0
- package/dist/lib/native-capabilities/system-audio.d.ts.map +1 -0
- package/dist/lib/native-capabilities/system-audio.js +330 -0
- package/dist/lib/native-capabilities/types.d.ts +62 -0
- package/dist/lib/native-capabilities/types.d.ts.map +1 -0
- package/dist/lib/native-capabilities/types.js +27 -0
- package/dist/lib/native-capabilities/usb-native.d.ts +39 -0
- package/dist/lib/native-capabilities/usb-native.d.ts.map +1 -0
- package/dist/lib/native-capabilities/usb-native.js +217 -0
- package/dist/lib/native-capabilities/usb.d.ts +85 -0
- package/dist/lib/native-capabilities/usb.d.ts.map +1 -0
- package/dist/lib/native-capabilities/usb.js +225 -0
- package/dist/lib/theme.d.ts.map +1 -1
- package/dist/lib/theme.js +2 -1
- package/docs/README.md +39 -0
- package/docs/accessibility.md +32 -0
- package/docs/adaptive-materials.md +79 -0
- package/docs/app-anatomy.md +74 -0
- package/docs/component-catalog.md +82 -0
- package/docs/component-guide-template.md +37 -0
- package/docs/design-tokens.md +185 -0
- package/docs/foundations.md +58 -0
- package/docs/native-integration.md +33 -0
- package/docs/standalone-app-windows.md +136 -0
- package/package.json +8 -3
- package/src/components/ui/alert-dialog.md +31 -0
- package/src/components/ui/alert.md +77 -0
- package/src/components/ui/app-frame.md +38 -0
- package/src/components/ui/badge.md +57 -0
- package/src/components/ui/button.md +76 -0
- package/src/components/ui/collapsible.md +52 -0
- package/src/components/ui/color-well.md +11 -0
- package/src/components/ui/combobox.md +42 -0
- package/src/components/ui/command.md +54 -0
- package/src/components/ui/date-field.md +32 -0
- package/src/components/ui/date-picker.md +55 -0
- package/src/components/ui/dialog.md +40 -0
- package/src/components/ui/edge-fade.md +7 -0
- package/src/components/ui/empty.md +87 -0
- package/src/components/ui/field.md +77 -0
- package/src/components/ui/grid.md +109 -0
- package/src/components/ui/icon-button.md +36 -0
- package/src/components/ui/inspector.md +11 -0
- package/src/components/ui/item.md +87 -0
- package/src/components/ui/list.md +140 -0
- package/src/components/ui/material.md +51 -0
- package/src/components/ui/navigation-button-group.md +46 -0
- package/src/components/ui/notification-dot.md +7 -0
- package/src/components/ui/number-input.md +19 -0
- package/src/components/ui/panel.md +11 -0
- package/src/components/ui/popover.md +31 -0
- package/src/components/ui/resizable.md +66 -0
- package/src/components/ui/scroll-area.md +72 -0
- package/src/components/ui/search-field.md +33 -0
- package/src/components/ui/segmented-control.md +36 -0
- package/src/components/ui/sheet.md +30 -0
- package/src/components/ui/sidebar.md +113 -0
- package/src/components/ui/sonner.md +37 -0
- package/src/components/ui/split-view.md +15 -0
- package/src/components/ui/status.md +12 -0
- package/src/components/ui/table.md +37 -0
- package/src/components/ui/tabs.md +66 -0
- package/src/components/ui/text.md +17 -0
- package/src/components/ui/toggle-button.md +48 -0
- package/src/components/ui/toggle-group.md +80 -0
- package/src/components/ui/toggle.md +73 -0
- package/src/components/ui/toolbar.md +26 -0
- package/src/components/ui/tooltip.md +31 -0
- package/src/styles/index.css +704 -3
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './accordion';
|
|
2
2
|
export * from './alert';
|
|
3
3
|
export * from './alert-dialog';
|
|
4
|
+
export * from './app-frame';
|
|
4
5
|
export * from './aspect-ratio';
|
|
5
6
|
export * from './avatar';
|
|
6
7
|
export * from './badge';
|
|
@@ -13,41 +14,63 @@ export * from './carousel';
|
|
|
13
14
|
export * from './chart';
|
|
14
15
|
export * from './checkbox';
|
|
15
16
|
export * from './collapsible';
|
|
17
|
+
export * from './color-well';
|
|
18
|
+
export * from './combobox';
|
|
16
19
|
export * from './command';
|
|
20
|
+
export * from './confirm-dialog';
|
|
17
21
|
export * from './context-menu';
|
|
18
22
|
export * from './dialog';
|
|
19
23
|
export * from './drawer';
|
|
20
24
|
export * from './dropdown-menu';
|
|
25
|
+
export * from './date-field';
|
|
26
|
+
export * from './date-picker';
|
|
21
27
|
export * from './empty';
|
|
28
|
+
export * from './edge-fade';
|
|
22
29
|
export * from './field';
|
|
23
30
|
export * from './form';
|
|
31
|
+
export * from './grid';
|
|
24
32
|
export * from './hover-card';
|
|
33
|
+
export * from './icon-button';
|
|
25
34
|
export * from './input';
|
|
26
35
|
export * from './input-group';
|
|
27
36
|
export * from './input-otp';
|
|
37
|
+
export * from './inspector';
|
|
28
38
|
export * from './item';
|
|
29
39
|
export * from './kbd';
|
|
30
40
|
export * from './label';
|
|
41
|
+
export * from './list';
|
|
31
42
|
export * from './menubar';
|
|
43
|
+
export * from './material';
|
|
44
|
+
export * from './message-scroller';
|
|
32
45
|
export * from './navigation-menu';
|
|
46
|
+
export * from './navigation-button-group';
|
|
47
|
+
export * from './notification-dot';
|
|
48
|
+
export * from './number-input';
|
|
33
49
|
export * from './pagination';
|
|
50
|
+
export * from './panel';
|
|
34
51
|
export * from './popover';
|
|
35
52
|
export * from './progress';
|
|
36
53
|
export * from './radio-group';
|
|
37
54
|
export * from './resizable';
|
|
38
55
|
export * from './scroll-area';
|
|
56
|
+
export * from './search-field';
|
|
39
57
|
export * from './select';
|
|
58
|
+
export * from './segmented-control';
|
|
40
59
|
export * from './separator';
|
|
41
60
|
export * from './sheet';
|
|
42
61
|
export * from './sidebar';
|
|
43
62
|
export * from './skeleton';
|
|
44
63
|
export * from './slider';
|
|
45
64
|
export * from './sonner';
|
|
65
|
+
export * from './split-view';
|
|
46
66
|
export * from './spinner';
|
|
67
|
+
export * from './status';
|
|
47
68
|
export * from './switch';
|
|
48
69
|
export * from './table';
|
|
49
70
|
export * from './tabs';
|
|
50
71
|
export * from './textarea';
|
|
72
|
+
export * from './text';
|
|
51
73
|
export * from './toggle';
|
|
52
74
|
export * from './toggle-group';
|
|
75
|
+
export * from './toolbar';
|
|
53
76
|
export * from './tooltip';
|
|
@@ -3,7 +3,7 @@ import { Button } from './button';
|
|
|
3
3
|
import { type VariantProps } from 'class-variance-authority';
|
|
4
4
|
declare function InputGroup({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
declare const inputGroupAddonVariants: (props?: ({
|
|
6
|
-
align?: "inline-end" | "inline-start" | "block-
|
|
6
|
+
align?: "inline-end" | "inline-start" | "block-start" | "block-end" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<'div'> & VariantProps<typeof inputGroupAddonVariants>): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
declare const inputGroupButtonVariants: (props?: ({
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Text } from './text';
|
|
3
|
+
declare function Inspector({ className, ...props }: React.ComponentProps<'aside'>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function InspectorHeader({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function InspectorContent({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export interface InspectorSectionProps extends Omit<React.ComponentProps<'section'>, 'title'> {
|
|
7
|
+
title?: React.ReactNode;
|
|
8
|
+
actions?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare function InspectorSection({ title, actions, className, children, ...props }: InspectorSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function InspectorRow({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function InspectorLabel({ className, ...props }: React.ComponentProps<typeof Text>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function InspectorValue({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export { Inspector, InspectorContent, InspectorHeader, InspectorLabel, InspectorRow, InspectorSection, InspectorValue, };
|
|
15
|
+
//# sourceMappingURL=inspector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspector.d.ts","sourceRoot":"","sources":["../../../src/components/ui/inspector.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,2CAWxE;AAED,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAW5E;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAW7B;AAED,MAAM,WAAW,qBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IACtD,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAED,iBAAS,gBAAgB,CAAC,EACxB,KAAK,EACL,OAAO,EACP,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,qBAAqB,2CAqCvB;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWzE;AAED,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,2CAWnC;AAED,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQ3E;AAED,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,cAAc,GACf,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from '../../lib/utils';
|
|
4
|
+
import { Text } from './text';
|
|
5
|
+
function Inspector({ className, ...props }) {
|
|
6
|
+
return (_jsx("aside", { "data-slot": "inspector", className: cn('bg-background flex h-full min-h-0 w-full min-w-0 flex-col overflow-hidden', className), ...props }));
|
|
7
|
+
}
|
|
8
|
+
function InspectorHeader({ className, ...props }) {
|
|
9
|
+
return (_jsx("div", { "data-slot": "inspector-header", className: cn('border-border/70 flex min-h-9 shrink-0 items-center gap-2 border-b px-3 py-1.5', className), ...props }));
|
|
10
|
+
}
|
|
11
|
+
function InspectorContent({ className, ...props }) {
|
|
12
|
+
return (_jsx("div", { "data-slot": "inspector-content", className: cn('min-h-0 flex-1 overflow-y-auto pb-[calc(var(--chat-safe-padding,0px)+0.75rem)]', className), ...props }));
|
|
13
|
+
}
|
|
14
|
+
function InspectorSection({ title, actions, className, children, ...props }) {
|
|
15
|
+
return (_jsxs("section", { "data-slot": "inspector-section", className: cn('border-border/60 border-b px-3 py-3 last:border-b-0', className), ...props, children: [title || actions ? (_jsxs("div", { "data-slot": "inspector-section-header", className: "mb-2 flex min-w-0 items-center gap-2", children: [title ? (_jsx(Text, { variant: "small-strong", color: "secondary", truncate: true, className: "uppercase tracking-wide", children: title })) : null, actions ? (_jsx("div", { className: "ml-auto flex shrink-0 items-center gap-1", children: actions })) : null] })) : null, _jsx("div", { "data-slot": "inspector-section-content", className: "space-y-2", children: children })] }));
|
|
16
|
+
}
|
|
17
|
+
function InspectorRow({ className, ...props }) {
|
|
18
|
+
return (_jsx("div", { "data-slot": "inspector-row", className: cn('grid min-h-7 grid-cols-[minmax(5rem,0.8fr)_minmax(0,1.2fr)] items-center gap-3', className), ...props }));
|
|
19
|
+
}
|
|
20
|
+
function InspectorLabel({ className, ...props }) {
|
|
21
|
+
return (_jsx(Text, { as: "label", variant: "small", color: "secondary", "data-slot": "inspector-label", className: cn('truncate', className), ...props }));
|
|
22
|
+
}
|
|
23
|
+
function InspectorValue({ className, ...props }) {
|
|
24
|
+
return (_jsx("div", { "data-slot": "inspector-value", className: cn('min-w-0 justify-self-stretch', className), ...props }));
|
|
25
|
+
}
|
|
26
|
+
export { Inspector, InspectorContent, InspectorHeader, InspectorLabel, InspectorRow, InspectorSection, InspectorValue, };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
declare function Kbd({ className, ...props }: React.ComponentProps<'kbd'>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
-
declare function KbdGroup({ className, ...props }: React.ComponentProps<'
|
|
2
|
+
declare function KbdGroup({ className, ...props }: React.ComponentProps<'kbd'>): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export { Kbd, KbdGroup };
|
|
4
4
|
//# sourceMappingURL=kbd.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type ListSelectionMode = 'none' | 'single' | 'multiple';
|
|
3
|
+
type ListProps = Omit<React.ComponentProps<'div'>, 'defaultValue' | 'onChange'> & {
|
|
4
|
+
selectionMode?: ListSelectionMode;
|
|
5
|
+
selectedValues?: Iterable<string>;
|
|
6
|
+
defaultSelectedValues?: Iterable<string>;
|
|
7
|
+
onSelectionChange?: (values: ReadonlySet<string>) => void;
|
|
8
|
+
onAction?: (value: string) => void;
|
|
9
|
+
orientation?: 'horizontal' | 'vertical';
|
|
10
|
+
loop?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare function List({ className, children, selectionMode, selectedValues, defaultSelectedValues, onSelectionChange, onAction, orientation, loop, disabled, role, onKeyDown, ref, ...props }: ListProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
type ListSectionProps = Omit<React.ComponentProps<'div'>, 'role'>;
|
|
15
|
+
declare function ListSection({ className, children, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, ...props }: ListSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
type ListSectionHeaderProps = Omit<React.ComponentProps<'div'>, 'id'>;
|
|
17
|
+
declare function ListSectionHeader({ className, ...props }: ListSectionHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
type ListItemProps = Omit<React.ComponentProps<'div'>, 'value'> & {
|
|
19
|
+
value: string;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
};
|
|
22
|
+
declare function ListItem({ className, children, value, disabled, onClick, onDoubleClick, onFocus, ref, role, ...props }: ListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare function ListItemContent({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare function ListItemTitle({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
declare function ListItemDescription({ className, ...props }: React.ComponentProps<'p'>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
declare function ListItemActions({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export { List, ListItem, ListItemActions, ListItemContent, ListItemDescription, ListItemTitle, ListSection, ListSectionHeader, type ListProps, type ListSectionHeaderProps, type ListSectionProps, type ListSelectionMode, };
|
|
28
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/components/ui/list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B,KAAK,iBAAiB,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAA;AA+CvD,KAAK,SAAS,GAAG,IAAI,CACnB,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAC3B,cAAc,GAAG,UAAU,CAC5B,GAAG;IACF,aAAa,CAAC,EAAE,iBAAiB,CAAA;IACjC,cAAc,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;IACjC,qBAAqB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;IACxC,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,KAAK,IAAI,CAAA;IACzD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;IACvC,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,iBAAS,IAAI,CAAC,EACZ,SAAS,EACT,QAAQ,EACR,aAAsB,EACtB,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,QAAQ,EACR,WAAwB,EACxB,IAAY,EACZ,QAAgB,EAChB,IAAI,EACJ,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,SAAS,2CAoMX;AAED,KAAK,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAA;AAEjE,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,EACjC,GAAG,KAAK,EACT,EAAE,gBAAgB,2CAiBlB;AAED,KAAK,sBAAsB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAA;AAErE,iBAAS,iBAAiB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,sBAAsB,2CAiBzE;AAED,KAAK,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,GAAG;IAChE,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,QAAQ,EACR,KAAK,EACL,QAAgB,EAChB,OAAO,EACP,aAAa,EACb,OAAO,EACP,GAAG,EACH,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,aAAa,2CA+Ef;AAED,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQ5E;AAED,iBAAS,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQ1E;AAED,iBAAS,mBAAmB,CAAC,EAC3B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,2CAQ3B;AAED,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQ5E;AAED,OAAO,EACL,IAAI,EACJ,QAAQ,EACR,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,KAAK,SAAS,EACd,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,GACvB,CAAA"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
import { getCollectionItemsInDomOrder, isInteractiveDescendant, } from './collection-navigation';
|
|
6
|
+
const ListContext = React.createContext(null);
|
|
7
|
+
const ListSectionContext = React.createContext(null);
|
|
8
|
+
function useListContext(component) {
|
|
9
|
+
const context = React.useContext(ListContext);
|
|
10
|
+
if (!context) {
|
|
11
|
+
throw new Error(`${component} must be used inside List`);
|
|
12
|
+
}
|
|
13
|
+
return context;
|
|
14
|
+
}
|
|
15
|
+
function toSelection(values) {
|
|
16
|
+
return new Set(values ?? []);
|
|
17
|
+
}
|
|
18
|
+
function sameSelection(a, b) {
|
|
19
|
+
if (a.size !== b.size)
|
|
20
|
+
return false;
|
|
21
|
+
for (const value of a) {
|
|
22
|
+
if (!b.has(value))
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
function List({ className, children, selectionMode = 'none', selectedValues, defaultSelectedValues, onSelectionChange, onAction, orientation = 'vertical', loop = false, disabled = false, role, onKeyDown, ref, ...props }) {
|
|
28
|
+
const rootRef = React.useRef(null);
|
|
29
|
+
const itemsRef = React.useRef(new Map());
|
|
30
|
+
const [activeValue, setActiveValueState] = React.useState(null);
|
|
31
|
+
const [uncontrolledSelection, setUncontrolledSelection] = React.useState(() => toSelection(defaultSelectedValues));
|
|
32
|
+
const controlledSelection = React.useMemo(() => selectedValues === undefined ? undefined : toSelection(selectedValues), [selectedValues]);
|
|
33
|
+
const selection = controlledSelection ?? uncontrolledSelection;
|
|
34
|
+
const setRef = React.useCallback((node) => {
|
|
35
|
+
rootRef.current = node;
|
|
36
|
+
if (typeof ref === 'function')
|
|
37
|
+
ref(node);
|
|
38
|
+
else if (ref)
|
|
39
|
+
ref.current = node;
|
|
40
|
+
}, [ref]);
|
|
41
|
+
const registerItem = React.useCallback((value, node, itemDisabled) => {
|
|
42
|
+
if (!node)
|
|
43
|
+
return () => undefined;
|
|
44
|
+
itemsRef.current.set(value, { node, disabled: itemDisabled });
|
|
45
|
+
return () => {
|
|
46
|
+
itemsRef.current.delete(value);
|
|
47
|
+
setActiveValueState((current) => (current === value ? null : current));
|
|
48
|
+
};
|
|
49
|
+
}, []);
|
|
50
|
+
React.useLayoutEffect(() => {
|
|
51
|
+
const items = getCollectionItemsInDomOrder(itemsRef.current).filter(([, item]) => !disabled && !item.disabled);
|
|
52
|
+
setActiveValueState((current) => {
|
|
53
|
+
if (current && items.some(([value]) => value === current))
|
|
54
|
+
return current;
|
|
55
|
+
return (items.find(([value]) => selection.has(value))?.[0] ??
|
|
56
|
+
items[0]?.[0] ??
|
|
57
|
+
null);
|
|
58
|
+
});
|
|
59
|
+
}, [children, disabled, selection]);
|
|
60
|
+
const setActiveValue = React.useCallback((value) => {
|
|
61
|
+
const item = itemsRef.current.get(value);
|
|
62
|
+
if (item && !item.disabled)
|
|
63
|
+
setActiveValueState(value);
|
|
64
|
+
}, []);
|
|
65
|
+
const commitSelection = React.useCallback((next) => {
|
|
66
|
+
if (sameSelection(selection, next))
|
|
67
|
+
return;
|
|
68
|
+
if (controlledSelection === undefined)
|
|
69
|
+
setUncontrolledSelection(next);
|
|
70
|
+
onSelectionChange?.(next);
|
|
71
|
+
}, [controlledSelection, onSelectionChange, selection]);
|
|
72
|
+
const select = React.useCallback((value) => {
|
|
73
|
+
if (disabled || selectionMode === 'none')
|
|
74
|
+
return;
|
|
75
|
+
const item = itemsRef.current.get(value);
|
|
76
|
+
if (!item || item.disabled)
|
|
77
|
+
return;
|
|
78
|
+
if (selectionMode === 'single') {
|
|
79
|
+
commitSelection(new Set([value]));
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const next = new Set(selection);
|
|
83
|
+
if (next.has(value))
|
|
84
|
+
next.delete(value);
|
|
85
|
+
else
|
|
86
|
+
next.add(value);
|
|
87
|
+
commitSelection(next);
|
|
88
|
+
}, [commitSelection, disabled, selection, selectionMode]);
|
|
89
|
+
const activate = React.useCallback((value) => {
|
|
90
|
+
if (disabled || itemsRef.current.get(value)?.disabled)
|
|
91
|
+
return;
|
|
92
|
+
onAction?.(value);
|
|
93
|
+
}, [disabled, onAction]);
|
|
94
|
+
const moveFocus = React.useCallback((direction) => {
|
|
95
|
+
const items = getCollectionItemsInDomOrder(itemsRef.current).filter(([, item]) => !disabled && !item.disabled);
|
|
96
|
+
if (items.length === 0)
|
|
97
|
+
return;
|
|
98
|
+
const currentIndex = items.findIndex(([value]) => value === activeValue);
|
|
99
|
+
let nextIndex = currentIndex;
|
|
100
|
+
if (direction === 'first')
|
|
101
|
+
nextIndex = 0;
|
|
102
|
+
if (direction === 'last')
|
|
103
|
+
nextIndex = items.length - 1;
|
|
104
|
+
if (direction === 'next') {
|
|
105
|
+
nextIndex = currentIndex < 0 ? 0 : currentIndex + 1;
|
|
106
|
+
if (nextIndex >= items.length)
|
|
107
|
+
nextIndex = loop ? 0 : items.length - 1;
|
|
108
|
+
}
|
|
109
|
+
if (direction === 'previous') {
|
|
110
|
+
nextIndex = currentIndex < 0 ? items.length - 1 : currentIndex - 1;
|
|
111
|
+
if (nextIndex < 0)
|
|
112
|
+
nextIndex = loop ? items.length - 1 : 0;
|
|
113
|
+
}
|
|
114
|
+
const [value, item] = items[nextIndex];
|
|
115
|
+
setActiveValueState(value);
|
|
116
|
+
item.node.focus();
|
|
117
|
+
}, [activeValue, disabled, loop]);
|
|
118
|
+
const handleKeyDown = (event) => {
|
|
119
|
+
onKeyDown?.(event);
|
|
120
|
+
if (event.defaultPrevented || disabled)
|
|
121
|
+
return;
|
|
122
|
+
const target = event.target;
|
|
123
|
+
if (target.dataset.slot !== 'list-item')
|
|
124
|
+
return;
|
|
125
|
+
const previousKey = orientation === 'vertical' ? 'ArrowUp' : 'ArrowLeft';
|
|
126
|
+
const nextKey = orientation === 'vertical' ? 'ArrowDown' : 'ArrowRight';
|
|
127
|
+
if (event.key === previousKey || event.key === nextKey) {
|
|
128
|
+
event.preventDefault();
|
|
129
|
+
moveFocus(event.key === previousKey ? 'previous' : 'next');
|
|
130
|
+
}
|
|
131
|
+
else if (event.key === 'Home' || event.key === 'End') {
|
|
132
|
+
event.preventDefault();
|
|
133
|
+
moveFocus(event.key === 'Home' ? 'first' : 'last');
|
|
134
|
+
}
|
|
135
|
+
else if (event.key === ' ') {
|
|
136
|
+
event.preventDefault();
|
|
137
|
+
if (activeValue)
|
|
138
|
+
select(activeValue);
|
|
139
|
+
}
|
|
140
|
+
else if (event.key === 'Enter' && activeValue) {
|
|
141
|
+
event.preventDefault();
|
|
142
|
+
if (selectionMode !== 'none')
|
|
143
|
+
select(activeValue);
|
|
144
|
+
activate(activeValue);
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
const context = React.useMemo(() => ({
|
|
148
|
+
activeValue,
|
|
149
|
+
disabled,
|
|
150
|
+
isSelected: (value) => selection.has(value),
|
|
151
|
+
registerItem,
|
|
152
|
+
select,
|
|
153
|
+
selectionMode,
|
|
154
|
+
setActiveValue,
|
|
155
|
+
activate,
|
|
156
|
+
}), [
|
|
157
|
+
activeValue,
|
|
158
|
+
activate,
|
|
159
|
+
disabled,
|
|
160
|
+
registerItem,
|
|
161
|
+
select,
|
|
162
|
+
selection,
|
|
163
|
+
selectionMode,
|
|
164
|
+
setActiveValue,
|
|
165
|
+
]);
|
|
166
|
+
const resolvedRole = role ?? (selectionMode === 'none' ? 'list' : 'listbox');
|
|
167
|
+
return (_jsx(ListContext.Provider, { value: context, children: _jsx("div", { ref: setRef, role: resolvedRole, "aria-disabled": disabled || undefined, "aria-multiselectable": selectionMode === 'multiple' ? true : undefined, "aria-orientation": resolvedRole === 'listbox' ? orientation : undefined, "data-slot": "list", "data-disabled": disabled || undefined, "data-orientation": orientation, "data-selection-mode": selectionMode, className: cn('flex min-w-0 outline-none', orientation === 'vertical'
|
|
168
|
+
? 'flex-col gap-0.5'
|
|
169
|
+
: 'flex-row items-center gap-1', className), onKeyDown: handleKeyDown, ...props, children: children }) }));
|
|
170
|
+
}
|
|
171
|
+
function ListSection({ className, children, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, ...props }) {
|
|
172
|
+
const headerId = React.useId();
|
|
173
|
+
return (_jsx(ListSectionContext.Provider, { value: { headerId }, children: _jsx("div", { role: "group", "aria-label": ariaLabel, "aria-labelledby": ariaLabel ? undefined : (ariaLabelledBy ?? headerId), "data-slot": "list-section", className: cn('flex min-w-0 flex-col gap-0.5', className), ...props, children: children }) }));
|
|
174
|
+
}
|
|
175
|
+
function ListSectionHeader({ className, ...props }) {
|
|
176
|
+
const context = React.useContext(ListSectionContext);
|
|
177
|
+
if (!context) {
|
|
178
|
+
throw new Error('ListSectionHeader must be used inside ListSection');
|
|
179
|
+
}
|
|
180
|
+
return (_jsx("div", { id: context.headerId, "data-slot": "list-section-header", className: cn('text-muted-foreground px-2.5 py-1 text-xs font-medium', className), ...props }));
|
|
181
|
+
}
|
|
182
|
+
function ListItem({ className, children, value, disabled = false, onClick, onDoubleClick, onFocus, ref, role, ...props }) {
|
|
183
|
+
const context = useListContext('ListItem');
|
|
184
|
+
const { registerItem } = context;
|
|
185
|
+
const itemRef = React.useRef(null);
|
|
186
|
+
const isDisabled = context.disabled || disabled;
|
|
187
|
+
const isSelected = context.isSelected(value);
|
|
188
|
+
const isActive = context.activeValue === value;
|
|
189
|
+
const setRef = React.useCallback((node) => {
|
|
190
|
+
itemRef.current = node;
|
|
191
|
+
if (typeof ref === 'function')
|
|
192
|
+
ref(node);
|
|
193
|
+
else if (ref)
|
|
194
|
+
ref.current = node;
|
|
195
|
+
}, [ref]);
|
|
196
|
+
React.useLayoutEffect(() => registerItem(value, itemRef.current, isDisabled), [isDisabled, registerItem, value]);
|
|
197
|
+
const resolvedRole = role ?? (context.selectionMode === 'none' ? 'listitem' : 'option');
|
|
198
|
+
return (_jsx("div", { ref: setRef, role: resolvedRole, tabIndex: isDisabled ? -1 : isActive ? 0 : -1, "aria-disabled": isDisabled || undefined, "aria-selected": context.selectionMode === 'none' ? undefined : isSelected, "data-slot": "list-item", "data-active": isActive || undefined, "data-disabled": isDisabled || undefined, "data-selected": context.selectionMode === 'none' ? undefined : isSelected, "data-value": value, className: cn('group/list-item relative flex min-w-0 cursor-default select-none items-center gap-2 rounded-md px-2.5 py-2 text-sm outline-none transition-colors duration-100', 'hover:bg-accent/60 focus-visible:bg-accent focus-visible:ring-ring/50 focus-visible:ring-[3px]', 'data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground', 'data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50', className), onClick: (event) => {
|
|
199
|
+
onClick?.(event);
|
|
200
|
+
if (event.defaultPrevented ||
|
|
201
|
+
isDisabled ||
|
|
202
|
+
isInteractiveDescendant(event.target, event.currentTarget)) {
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
context.setActiveValue(value);
|
|
206
|
+
event.currentTarget.focus();
|
|
207
|
+
context.select(value);
|
|
208
|
+
}, onDoubleClick: (event) => {
|
|
209
|
+
onDoubleClick?.(event);
|
|
210
|
+
if (event.defaultPrevented ||
|
|
211
|
+
isDisabled ||
|
|
212
|
+
isInteractiveDescendant(event.target, event.currentTarget)) {
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
context.activate(value);
|
|
216
|
+
}, onFocus: (event) => {
|
|
217
|
+
onFocus?.(event);
|
|
218
|
+
if (!event.defaultPrevented && !isDisabled) {
|
|
219
|
+
context.setActiveValue(value);
|
|
220
|
+
}
|
|
221
|
+
}, ...props, children: children }));
|
|
222
|
+
}
|
|
223
|
+
function ListItemContent({ className, ...props }) {
|
|
224
|
+
return (_jsx("div", { "data-slot": "list-item-content", className: cn('min-w-0 flex-1', className), ...props }));
|
|
225
|
+
}
|
|
226
|
+
function ListItemTitle({ className, ...props }) {
|
|
227
|
+
return (_jsx("div", { "data-slot": "list-item-title", className: cn('truncate font-medium', className), ...props }));
|
|
228
|
+
}
|
|
229
|
+
function ListItemDescription({ className, ...props }) {
|
|
230
|
+
return (_jsx("p", { "data-slot": "list-item-description", className: cn('text-muted-foreground truncate text-xs', className), ...props }));
|
|
231
|
+
}
|
|
232
|
+
function ListItemActions({ className, ...props }) {
|
|
233
|
+
return (_jsx("div", { "data-slot": "list-item-actions", className: cn('ml-auto flex shrink-0 items-center gap-1', className), ...props }));
|
|
234
|
+
}
|
|
235
|
+
export { List, ListItem, ListItemActions, ListItemContent, ListItemDescription, ListItemTitle, ListSection, ListSectionHeader, };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const materialVariants: (props?: ({
|
|
4
|
+
shape?: "circle" | "rounded" | "capsule" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
export type MaterialVariant = 'regular' | 'clear';
|
|
7
|
+
export type MaterialShape = NonNullable<VariantProps<typeof materialVariants>['shape']>;
|
|
8
|
+
export type MaterialElevation = 'none' | 'panel' | 'overlay';
|
|
9
|
+
export interface MaterialProps extends React.ComponentPropsWithoutRef<'div'>, VariantProps<typeof materialVariants> {
|
|
10
|
+
/**
|
|
11
|
+
* `regular` is the default for toolbars and control chrome. Reserve `clear`
|
|
12
|
+
* for compact controls floating above media or a richly colored canvas.
|
|
13
|
+
*/
|
|
14
|
+
variant?: MaterialVariant;
|
|
15
|
+
elevation?: MaterialElevation;
|
|
16
|
+
interactive?: boolean;
|
|
17
|
+
asChild?: boolean;
|
|
18
|
+
}
|
|
19
|
+
declare function Material({ asChild, className, elevation, interactive, shape, variant, ...props }: MaterialProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare const materialGroupSpacing: {
|
|
21
|
+
readonly compact: "gap-0.5 p-0.5";
|
|
22
|
+
readonly default: "gap-1 p-1";
|
|
23
|
+
readonly comfortable: "gap-1.5 p-1.5";
|
|
24
|
+
};
|
|
25
|
+
export interface MaterialGroupProps extends Omit<MaterialProps, 'asChild' | 'interactive'> {
|
|
26
|
+
spacing?: keyof typeof materialGroupSpacing;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A single sampled material layer for a related control cluster. Children
|
|
30
|
+
* should be ordinary transparent or ghost controls, not nested Materials.
|
|
31
|
+
*/
|
|
32
|
+
declare function MaterialGroup({ className, spacing, ...props }: MaterialGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export { Material, MaterialGroup, materialVariants };
|
|
34
|
+
//# sourceMappingURL=material.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"material.d.ts","sourceRoot":"","sources":["../../../src/components/ui/material.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAA;AAEjE,QAAA,MAAM,gBAAgB;;8EAWpB,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,OAAO,CAAA;AACjD,MAAM,MAAM,aAAa,GAAG,WAAW,CACrC,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC,OAAO,CAAC,CAC/C,CAAA;AACD,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;AAE5D,MAAM,WAAW,aACf,SAAQ,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAC3C,YAAY,CAAC,OAAO,gBAAgB,CAAC;IACvC;;;OAGG;IACH,OAAO,CAAC,EAAE,eAAe,CAAA;IACzB,SAAS,CAAC,EAAE,iBAAiB,CAAA;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,iBAAS,QAAQ,CAAC,EAChB,OAAe,EACf,SAAS,EACT,SAAmB,EACnB,WAAmB,EACnB,KAAK,EACL,OAAmB,EACnB,GAAG,KAAK,EACT,EAAE,aAAa,2CAcf;AAED,QAAA,MAAM,oBAAoB;;;;CAIhB,CAAA;AAEV,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,aAAa,EAAE,SAAS,GAAG,aAAa,CAAC;IACtD,OAAO,CAAC,EAAE,MAAM,OAAO,oBAAoB,CAAA;CAC5C;AAED;;;GAGG;AACH,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,OAAmB,EACnB,GAAG,KAAK,EACT,EAAE,kBAAkB,2CAYpB;AAED,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
import { cva } from 'class-variance-authority';
|
|
6
|
+
const materialVariants = cva('moldable-material border text-inherit', {
|
|
7
|
+
variants: {
|
|
8
|
+
shape: {
|
|
9
|
+
rounded: 'rounded-overlay',
|
|
10
|
+
capsule: 'rounded-full',
|
|
11
|
+
circle: 'aspect-square rounded-full',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
defaultVariants: {
|
|
15
|
+
shape: 'rounded',
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
function Material({ asChild = false, className, elevation = 'panel', interactive = false, shape, variant = 'regular', ...props }) {
|
|
19
|
+
const Comp = asChild ? Slot : 'div';
|
|
20
|
+
return (_jsx(Comp, { "data-slot": asChild ? undefined : 'material', "data-material": variant, "data-material-elevation": elevation, "data-material-interactive": interactive || undefined, "data-material-shape": shape ?? 'rounded', className: cn(materialVariants({ shape }), className), ...props }));
|
|
21
|
+
}
|
|
22
|
+
const materialGroupSpacing = {
|
|
23
|
+
compact: 'gap-0.5 p-0.5',
|
|
24
|
+
default: 'gap-1 p-1',
|
|
25
|
+
comfortable: 'gap-1.5 p-1.5',
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* A single sampled material layer for a related control cluster. Children
|
|
29
|
+
* should be ordinary transparent or ghost controls, not nested Materials.
|
|
30
|
+
*/
|
|
31
|
+
function MaterialGroup({ className, spacing = 'default', ...props }) {
|
|
32
|
+
return (_jsx(Material, { "data-slot": "material-group", className: cn('inline-flex min-w-0 items-center', materialGroupSpacing[spacing], className), ...props }));
|
|
33
|
+
}
|
|
34
|
+
export { Material, MaterialGroup, materialVariants };
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { MessageScrollerPolicy } from './message-scroller-policy';
|
|
2
|
+
export type MessageScrollerDefaultScrollPosition = 'start' | 'end' | 'last-anchor';
|
|
3
|
+
export type MessageScrollerScrollAlign = 'start' | 'center' | 'end' | 'nearest';
|
|
4
|
+
export type MessageScrollerScrollOptions = {
|
|
5
|
+
align?: MessageScrollerScrollAlign;
|
|
6
|
+
behavior?: ScrollBehavior;
|
|
7
|
+
scrollMargin?: number;
|
|
8
|
+
};
|
|
9
|
+
export type MessageScrollerScrollable = {
|
|
10
|
+
start: boolean;
|
|
11
|
+
end: boolean;
|
|
12
|
+
};
|
|
13
|
+
export type MessageScrollerVisibilityState = {
|
|
14
|
+
currentAnchorId: string | null;
|
|
15
|
+
visibleMessageIds: string[];
|
|
16
|
+
};
|
|
17
|
+
export interface MessageScrollerControllerOptions {
|
|
18
|
+
autoScroll: boolean;
|
|
19
|
+
defaultScrollPosition: MessageScrollerDefaultScrollPosition;
|
|
20
|
+
scrollEdgeThreshold: number;
|
|
21
|
+
scrollPreviousItemPeek: number;
|
|
22
|
+
scrollMargin: number;
|
|
23
|
+
}
|
|
24
|
+
export interface ExternalStore<T> {
|
|
25
|
+
getSnapshot: () => T;
|
|
26
|
+
hasListeners: () => boolean;
|
|
27
|
+
setSnapshot: (next: T) => void;
|
|
28
|
+
subscribe: (listener: () => void, onFirst?: () => void, onLast?: () => void) => () => void;
|
|
29
|
+
}
|
|
30
|
+
export declare function createExternalStore<T>(initial: T, isEqual: (a: T, b: T) => boolean): ExternalStore<T>;
|
|
31
|
+
export type ReadingLeaf = {
|
|
32
|
+
element: HTMLElement;
|
|
33
|
+
top: number;
|
|
34
|
+
bottom: number;
|
|
35
|
+
};
|
|
36
|
+
export declare function isMessageScrollerAtEnd(viewport: HTMLElement, threshold: number): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Snapshot of the stable leaves the reader can currently see, preferring
|
|
39
|
+
* fine-grained `[data-message-scroll-anchor]` leaves (their tops do not move
|
|
40
|
+
* when a disclosure collapses inside the same message) over whole items.
|
|
41
|
+
*/
|
|
42
|
+
export declare function captureReadingLeaves(viewport: HTMLElement, content: HTMLElement, items: HTMLElement[]): ReadingLeaf[];
|
|
43
|
+
/**
|
|
44
|
+
* Re-pins the first still-visible captured leaf after content above it
|
|
45
|
+
* changed size. Native scroll anchoring may already have compensated; the
|
|
46
|
+
* measured delta is zero then and this is deliberately a no-op.
|
|
47
|
+
*/
|
|
48
|
+
export declare function restoreReadingLeaves(viewport: HTMLElement, leaves: readonly ReadingLeaf[]): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* The single DOM-side owner of transcript scrolling. Every behavior that can
|
|
51
|
+
* move the viewport — follow-the-end, turn anchoring, prepend preservation,
|
|
52
|
+
* reading-position stability while rows above collapse — routes through this
|
|
53
|
+
* controller and its {@link MessageScrollerPolicy}, so nothing here can fight
|
|
54
|
+
* the reader (or another controller) for the scroll position.
|
|
55
|
+
*/
|
|
56
|
+
export declare class MessageScrollerController {
|
|
57
|
+
readonly scrollableStore: ExternalStore<MessageScrollerScrollable>;
|
|
58
|
+
readonly visibilityStore: ExternalStore<MessageScrollerVisibilityState>;
|
|
59
|
+
policy: MessageScrollerPolicy;
|
|
60
|
+
options: MessageScrollerControllerOptions;
|
|
61
|
+
preserveScrollOnPrepend: boolean;
|
|
62
|
+
private root;
|
|
63
|
+
private viewport;
|
|
64
|
+
private content;
|
|
65
|
+
private spacer;
|
|
66
|
+
private readonly messageElements;
|
|
67
|
+
private readonly handledTurnAnchors;
|
|
68
|
+
private readonly visibleMessageIds;
|
|
69
|
+
private readonly warmedItems;
|
|
70
|
+
private lastScrollTop;
|
|
71
|
+
private previousFirstItem;
|
|
72
|
+
private previousItemCount;
|
|
73
|
+
private anchoredElement;
|
|
74
|
+
private trackedFirstVisible;
|
|
75
|
+
private readingLeaves;
|
|
76
|
+
private pendingScrollToMessage;
|
|
77
|
+
private defaultPositionApplied;
|
|
78
|
+
private spacerHeight;
|
|
79
|
+
private spacerGap;
|
|
80
|
+
private programmaticDeadline;
|
|
81
|
+
private stateFrame;
|
|
82
|
+
private visibilityFrame;
|
|
83
|
+
private warmupHandle;
|
|
84
|
+
private warmupUsesIdleCallback;
|
|
85
|
+
private intersectionObserver;
|
|
86
|
+
constructor(options: MessageScrollerControllerOptions);
|
|
87
|
+
get viewportElement(): HTMLElement | null;
|
|
88
|
+
setRoot(element: HTMLElement | null): void;
|
|
89
|
+
setViewport(element: HTMLElement | null): void;
|
|
90
|
+
setContent(element: HTMLElement | null): void;
|
|
91
|
+
setSpacer(element: HTMLElement | null): void;
|
|
92
|
+
registerMessage(messageId: string, element: HTMLElement | null, previous: HTMLElement | null): void;
|
|
93
|
+
scrollToEnd: (options?: MessageScrollerScrollOptions) => boolean;
|
|
94
|
+
scrollToStart: (options?: MessageScrollerScrollOptions) => boolean;
|
|
95
|
+
scrollToMessage: (messageId: string, options?: MessageScrollerScrollOptions) => boolean;
|
|
96
|
+
scrollToElement(element: HTMLElement, options?: MessageScrollerScrollOptions, { keepPreviousPeek }?: {
|
|
97
|
+
keepPreviousPeek?: boolean;
|
|
98
|
+
}): boolean;
|
|
99
|
+
handleScroll(): void;
|
|
100
|
+
handleWheel(deltaY: number): void;
|
|
101
|
+
handleTouchMove(): void;
|
|
102
|
+
handleScrollKey(): void;
|
|
103
|
+
/**
|
|
104
|
+
* Content box resized (streaming growth, images decoding, disclosures
|
|
105
|
+
* collapsing, `content-visibility` reveals). Which way the viewport moves
|
|
106
|
+
* — if at all — is entirely the policy's call.
|
|
107
|
+
*/
|
|
108
|
+
handleResize(): void;
|
|
109
|
+
/** Children of the content element changed. Runs before the next paint. */
|
|
110
|
+
handleContentMutation(): void;
|
|
111
|
+
observeVisibility(): void;
|
|
112
|
+
unobserveVisibility(): void;
|
|
113
|
+
resetDefaultPosition(): void;
|
|
114
|
+
updateOptions(options: MessageScrollerControllerOptions): void;
|
|
115
|
+
destroy(): void;
|
|
116
|
+
private applyDefaultPosition;
|
|
117
|
+
private anchorTurn;
|
|
118
|
+
private markTurnAnchorsHandled;
|
|
119
|
+
/**
|
|
120
|
+
* Older rows were inserted above the reader. Compensate the scroll offset
|
|
121
|
+
* by the tracked first-visible row's displacement in the same mutation
|
|
122
|
+
* pass, before the shifted layout can paint.
|
|
123
|
+
*/
|
|
124
|
+
private preservePrependPosition;
|
|
125
|
+
private performScroll;
|
|
126
|
+
/**
|
|
127
|
+
* Snapshot of stable leaves the reader can see. When a disclosure above
|
|
128
|
+
* them collapses (or a hidden row re-measures), the first still-visible
|
|
129
|
+
* leaf is re-pinned so the text under the reader's eyes never shifts.
|
|
130
|
+
*/
|
|
131
|
+
private snapshotReadingLeaves;
|
|
132
|
+
private restoreReadingPosition;
|
|
133
|
+
private trackFirstVisibleItem;
|
|
134
|
+
private scheduleStateCommit;
|
|
135
|
+
/**
|
|
136
|
+
* Once per frame: publish the scrollable edges and refresh the geometry
|
|
137
|
+
* snapshots (tracked first-visible row, reading leaves) that prepend
|
|
138
|
+
* preservation and reading-position restores compare against. Capturing
|
|
139
|
+
* here — instead of on every scroll event — bounds rect reads to one pass
|
|
140
|
+
* per frame.
|
|
141
|
+
*/
|
|
142
|
+
private commitFrameState;
|
|
143
|
+
private applyStateAttributes;
|
|
144
|
+
private scheduleVisibilitySync;
|
|
145
|
+
private computeVisibility;
|
|
146
|
+
/**
|
|
147
|
+
* Rows outside the viewport skip rendering via `content-visibility: auto`
|
|
148
|
+
* and a placeholder intrinsic size. Their first reveal during an upward
|
|
149
|
+
* scroll pays first-time layout of complex markdown — felt as hitches on
|
|
150
|
+
* the first pass through history. Rendering each row once at idle records
|
|
151
|
+
* its real size (the `auto` keyword keeps last-remembered sizes), so the
|
|
152
|
+
* first real scroll finds everything measured and warm.
|
|
153
|
+
*/
|
|
154
|
+
private scheduleWarmup;
|
|
155
|
+
private warmupBatch;
|
|
156
|
+
private cancelWarmup;
|
|
157
|
+
private flushPendingScrollToMessage;
|
|
158
|
+
private setSpacerHeight;
|
|
159
|
+
private itemChildren;
|
|
160
|
+
private isAtEnd;
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=message-scroller-controller.d.ts.map
|