@moldable-ai/ui 0.2.19 → 0.2.20
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-manifest.d.ts +6 -0
- package/dist/catalog/catalog-manifest.d.ts.map +1 -0
- package/dist/catalog/catalog-manifest.js +105 -0
- package/dist/catalog/catalog-types.d.ts +54 -0
- package/dist/catalog/catalog-types.d.ts.map +1 -0
- package/dist/catalog/catalog-types.js +14 -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 +39 -0
- package/dist/catalog/core-catalog.d.ts +6 -0
- package/dist/catalog/core-catalog.d.ts.map +1 -0
- package/dist/catalog/core-catalog.js +105 -0
- package/dist/catalog/index.d.ts +5 -0
- package/dist/catalog/index.d.ts.map +1 -0
- package/dist/catalog/index.js +4 -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 +50 -6
- package/dist/components/chat/chat-panel.d.ts.map +1 -1
- package/dist/components/chat/chat-panel.js +200 -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/app-frame.d.ts +22 -0
- package/dist/components/ui/app-frame.d.ts.map +1 -0
- package/dist/components/ui/app-frame.js +56 -0
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button.js +1 -1
- 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/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/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.js +1 -1
- 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 +234 -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 +19 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +19 -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 +24 -0
- package/dist/components/ui/list.d.ts.map +1 -0
- package/dist/components/ui/list.js +224 -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.d.ts +11 -0
- package/dist/components/ui/message-scroller.d.ts.map +1 -0
- package/dist/components/ui/message-scroller.js +37 -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.js +1 -1
- 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 +61 -0
- 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 +28 -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.js +1 -1
- package/dist/components/ui/toolbar.d.ts +20 -0
- package/dist/components/ui/toolbar.d.ts.map +1 -0
- package/dist/components/ui/toolbar.js +52 -0
- 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 +28 -0
- package/dist/lib/frame-lifecycle.d.ts.map +1 -1
- package/dist/lib/frame-lifecycle.js +84 -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/docs/README.md +37 -0
- package/docs/accessibility.md +32 -0
- package/docs/app-anatomy.md +72 -0
- package/docs/component-catalog.md +59 -0
- package/docs/component-guide-template.md +37 -0
- package/docs/design-tokens.md +172 -0
- package/docs/foundations.md +56 -0
- package/docs/native-integration.md +33 -0
- package/docs/standalone-app-windows.md +128 -0
- package/package.json +9 -3
- package/src/components/ui/alert.md +55 -0
- package/src/components/ui/app-frame.md +33 -0
- package/src/components/ui/badge.md +57 -0
- package/src/components/ui/button.md +76 -0
- package/src/components/ui/color-well.md +11 -0
- package/src/components/ui/combobox.md +43 -0
- package/src/components/ui/date-field.md +32 -0
- package/src/components/ui/edge-fade.md +7 -0
- package/src/components/ui/empty.md +82 -0
- package/src/components/ui/field.md +77 -0
- package/src/components/ui/grid.md +105 -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 +107 -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/resizable.md +66 -0
- package/src/components/ui/scroll-area.md +68 -0
- package/src/components/ui/search-field.md +33 -0
- package/src/components/ui/segmented-control.md +39 -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 +35 -0
- package/src/components/ui/tabs.md +66 -0
- package/src/components/ui/text.md +17 -0
- package/src/components/ui/toggle-group.md +80 -0
- package/src/components/ui/toggle.md +73 -0
- package/src/components/ui/toolbar.md +21 -0
- package/src/styles/index.css +491 -3
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# NotificationDot
|
|
2
|
+
|
|
3
|
+
A tiny, decorative unread or changed-state marker.
|
|
4
|
+
|
|
5
|
+
Pair the dot with adjacent accessible text or an accessible label on its
|
|
6
|
+
container. The dot is intentionally hidden from assistive technology.
|
|
7
|
+
Use `Status` when the state needs a spoken label or semantic tone.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# NumberInput
|
|
2
|
+
|
|
3
|
+
Compact numeric entry with optional unit and stepper actions.
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
<NumberInput
|
|
7
|
+
aria-label="Opacity"
|
|
8
|
+
min={0}
|
|
9
|
+
max={100}
|
|
10
|
+
unit="%"
|
|
11
|
+
value={opacity}
|
|
12
|
+
onValueChange={setOpacity}
|
|
13
|
+
/>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Use in inspectors and settings where the numeric value matters. Use `Slider`
|
|
17
|
+
when relative adjustment matters more than exact entry. Always supply a visible
|
|
18
|
+
label or `aria-label`. Treat `null` as empty input and validate domain-specific
|
|
19
|
+
constraints outside the component.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Panel
|
|
2
|
+
|
|
3
|
+
Semantic app panes with fixed chrome and independently scrolling content.
|
|
4
|
+
|
|
5
|
+
`PanelGroup` lays out panes horizontally or vertically. `Panel` owns the
|
|
6
|
+
surface; `PanelHeader`, `PanelContent`, and `PanelFooter` define its regions.
|
|
7
|
+
Use `surface="sidebar"` for source/navigation panes and reserve `Card` for
|
|
8
|
+
bounded content groups inside a pane.
|
|
9
|
+
|
|
10
|
+
The group and its containing shell need a definite height. Long content belongs
|
|
11
|
+
in `PanelContent`, and chat-safe padding belongs on that scrolling region.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Resizable
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
The resizable primitives create user-adjustable panes for technical and object-heavy workspaces. Use them when two or more views need to stay visible, such as navigation/editor/inspector or query/results.
|
|
6
|
+
|
|
7
|
+
Use a stable flex split when resizing does not materially help. Use `Sidebar` for application navigation that needs collapse and narrow-screen sheet behavior.
|
|
8
|
+
|
|
9
|
+
## Usage patterns
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import {
|
|
13
|
+
ResizableHandle,
|
|
14
|
+
ResizablePanel,
|
|
15
|
+
ResizablePanelGroup,
|
|
16
|
+
} from '@moldable-ai/ui'
|
|
17
|
+
|
|
18
|
+
;<ResizablePanelGroup orientation="horizontal" className="h-full min-h-0">
|
|
19
|
+
<ResizablePanel defaultSize="24%" minSize="14%">
|
|
20
|
+
<nav className="h-full min-h-0 overflow-y-auto pb-[calc(var(--chat-safe-padding,0px)+1rem)]">
|
|
21
|
+
{/* Object browser */}
|
|
22
|
+
</nav>
|
|
23
|
+
</ResizablePanel>
|
|
24
|
+
<ResizableHandle withHandle />
|
|
25
|
+
<ResizablePanel minSize="35%">
|
|
26
|
+
<section className="h-full min-h-0 overflow-hidden">
|
|
27
|
+
{/* Workspace */}
|
|
28
|
+
</section>
|
|
29
|
+
</ResizablePanel>
|
|
30
|
+
</ResizablePanelGroup>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Use `orientation="vertical"` for editor/results splits. Each panel should establish its own overflow behavior; the panel group itself should remain bounded by a full-height parent.
|
|
34
|
+
|
|
35
|
+
## API summary
|
|
36
|
+
|
|
37
|
+
- `ResizablePanelGroup`: wraps `react-resizable-panels` `Group`; `orientation` is `"horizontal"` or `"vertical"` and defaults upstream to horizontal.
|
|
38
|
+
- `ResizablePanel`: wraps `Panel` and accepts its sizing, collapse, callback, id, and ref props.
|
|
39
|
+
- `ResizablePanel` also accepts `groupResizeBehavior` for compatibility, but the current wrapper intentionally does not forward or act on it.
|
|
40
|
+
- `ResizableHandle`: wraps `Separator`; `withHandle` adds a visible grip.
|
|
41
|
+
- All parts accept `className` where supported by their underlying primitive.
|
|
42
|
+
|
|
43
|
+
Refer to the installed `react-resizable-panels` version for precise size units and imperative ref APIs; keep all panels on the same convention.
|
|
44
|
+
|
|
45
|
+
## Do
|
|
46
|
+
|
|
47
|
+
- Give the group and all ancestors a stable `h-full min-h-0`.
|
|
48
|
+
- Set sensible default and minimum sizes based on the content’s real scan width.
|
|
49
|
+
- Use `withHandle` when a one-pixel divider would be difficult to discover.
|
|
50
|
+
- Keep each pane’s toolbar fixed and its content intentionally scrollable.
|
|
51
|
+
- Preserve keyboard focus indication on separators.
|
|
52
|
+
- Collapse or replace secondary panes at narrow widths when necessary.
|
|
53
|
+
|
|
54
|
+
## Don't
|
|
55
|
+
|
|
56
|
+
- Do not make every surface resizable.
|
|
57
|
+
- Do not allow a pane to shrink until labels, editors, or controls become unusable.
|
|
58
|
+
- Do not put document scrolling on the panel group or `body`.
|
|
59
|
+
- Do not animate pane size for decoration.
|
|
60
|
+
- Do not assume resizable desktop panes automatically become a good narrow layout.
|
|
61
|
+
|
|
62
|
+
## Moldable considerations
|
|
63
|
+
|
|
64
|
+
Resizable layouts are the default fit for database, code, file, debugging, and inspector-style apps. Keep pane toolbars around `h-8` or `h-9`, use mono text for code/data, and avoid nested card shells.
|
|
65
|
+
|
|
66
|
+
Every independently scrolling pane that reaches the bottom needs its own `--chat-safe-padding`. A bottom control dock may require additional space beyond the standard pane padding. When selection changes in any pane, keep the other panes, app commands, and desktop chat context synchronized.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Scroll Area
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
`ScrollArea` provides a styled vertical scrollbar while preserving a native-feeling scroll viewport. Use it for bounded lists, object browsers, menus, and panes where consistent scrollbar appearance is useful.
|
|
6
|
+
|
|
7
|
+
For simple content, a native `overflow-y-auto` region is often sufficient. The important design decision is which pane scrolls, not whether every pane uses a custom scrollbar.
|
|
8
|
+
|
|
9
|
+
## Usage patterns
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { ScrollArea } from '@moldable-ai/ui'
|
|
13
|
+
|
|
14
|
+
;<ScrollArea className="h-full min-h-0">
|
|
15
|
+
<div className="px-3 pb-[calc(var(--chat-safe-padding,0px)+1rem)] pt-3">
|
|
16
|
+
{/* Long list */}
|
|
17
|
+
</div>
|
|
18
|
+
</ScrollArea>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
For a grouped list:
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
<ScrollArea className="h-full px-5 pt-3">
|
|
25
|
+
<div className="mx-auto w-full max-w-[44rem] space-y-8 pb-[calc(var(--chat-safe-padding,0px)+6rem)]">
|
|
26
|
+
{/* Groups */}
|
|
27
|
+
</div>
|
|
28
|
+
</ScrollArea>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The current `ScrollArea` composition installs a vertical scrollbar automatically.
|
|
32
|
+
|
|
33
|
+
## API summary
|
|
34
|
+
|
|
35
|
+
- `ScrollArea`: Radix Scroll Area root with a full-size viewport, vertical `ScrollBar`, and corner.
|
|
36
|
+
- Accepts Radix root props, forwarded `ref`, and `className`.
|
|
37
|
+
- `ScrollBar`: exported scrollbar primitive with `orientation="vertical" | "horizontal"`; defaults to vertical.
|
|
38
|
+
- The root’s direct children are rendered inside the viewport.
|
|
39
|
+
- The viewport supplies focus-visible outline and ring treatment.
|
|
40
|
+
|
|
41
|
+
## Do
|
|
42
|
+
|
|
43
|
+
- Give the scroll area a definite height through its own class and full-height ancestors.
|
|
44
|
+
- Put padding on an inner content wrapper when it should scroll with the content.
|
|
45
|
+
- Add `min-h-0` to flex or grid ancestors.
|
|
46
|
+
- Add bottom chat-safe padding inside every scroll region that reaches the webview bottom.
|
|
47
|
+
- Keep sticky headers inside the same scrolling context as their content.
|
|
48
|
+
- Test keyboard, wheel, trackpad, and scrollbar-thumb interaction.
|
|
49
|
+
|
|
50
|
+
## Don't
|
|
51
|
+
|
|
52
|
+
- Do not rely on document/body scrolling for a full Moldable app.
|
|
53
|
+
- Do not nest scroll areas unless each axis or pane has a clear purpose.
|
|
54
|
+
- Do not put fixed controls inside the moving content when they must remain reachable.
|
|
55
|
+
- Do not hide focus outlines.
|
|
56
|
+
- Do not assume padding on a sibling pane protects this viewport from desktop chat.
|
|
57
|
+
- Do not assume adding `ScrollBar` as a child of `ScrollArea` creates a second root scrollbar; children belong to the viewport in the current composition.
|
|
58
|
+
|
|
59
|
+
## Moldable considerations
|
|
60
|
+
|
|
61
|
+
Choose padding based on the surface:
|
|
62
|
+
|
|
63
|
+
- General full-view content: `pb-[calc(var(--chat-safe-padding,0px)+6rem)]`
|
|
64
|
+
- Long document/editor content: `pb-[calc(var(--chat-safe-padding,0px)+8rem)]`
|
|
65
|
+
- Tables and inspectors: `pb-[var(--chat-safe-padding,0px)]`
|
|
66
|
+
- Side panes and object browsers: `pb-[calc(var(--chat-safe-padding,0px)+1rem)]`
|
|
67
|
+
|
|
68
|
+
Increase it when a fixed action dock also occupies the bottom. Empty, error, and loading states rendered in a scroll area need the same clearance as normal content.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Search Field
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
`SearchField` is a native search input with consistent icon, density, loading, clear, invalid, disabled, and focus states. It supports controlled and uncontrolled values without replacing browser text-entry behavior.
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { SearchField } from '@moldable-ai/ui'
|
|
11
|
+
|
|
12
|
+
<SearchField
|
|
13
|
+
aria-label="Search projects"
|
|
14
|
+
value={query}
|
|
15
|
+
onValueChange={setQuery}
|
|
16
|
+
placeholder="Search projects"
|
|
17
|
+
density="compact"
|
|
18
|
+
loading={isSearching}
|
|
19
|
+
/>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Use `value`/`onValueChange` for a controlled field or `defaultValue` for an uncontrolled field. `variant` is `default` or `filled`; `density` is `compact`, `default`, or `comfortable`. `clearable` defaults to true. Escape and the clear action empty a non-empty field, refocus it, and call `onClear`.
|
|
23
|
+
|
|
24
|
+
## Quality bar
|
|
25
|
+
|
|
26
|
+
- Provide a visible label or an accessible `aria-label`.
|
|
27
|
+
- Keep placeholder text short; it is a hint, not the field’s name.
|
|
28
|
+
- Debounce network-backed filtering outside the component and use `loading` while results update.
|
|
29
|
+
- Keep keyboard focus in the field after clearing.
|
|
30
|
+
- Announce result counts or no-results changes in the results region when that feedback matters.
|
|
31
|
+
- Do not add a second clear button, bind Escape to close a parent view while the field contains text, or replace native editing shortcuts.
|
|
32
|
+
|
|
33
|
+
Search fields in narrow toolbars should use compact density and a useful minimum width. A global app or command search may be surfaced by the host, but local collection filtering remains app-owned.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Segmented Control
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
`SegmentedControl` switches between a small set of mutually exclusive modes. It uses radio-group semantics, so one option is selected and arrow keys move selection without requiring custom keyboard code.
|
|
6
|
+
|
|
7
|
+
Use it for choices such as list/grid, week/month, or preview/edit. Use `Tabs` when each option labels a corresponding content panel, and use `RadioGroup` for form choices that need longer supporting text.
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import {
|
|
13
|
+
SegmentedControl,
|
|
14
|
+
SegmentedControlItem,
|
|
15
|
+
} from '@moldable-ai/ui'
|
|
16
|
+
|
|
17
|
+
<SegmentedControl
|
|
18
|
+
aria-label="Calendar view"
|
|
19
|
+
value={view}
|
|
20
|
+
onValueChange={setView}
|
|
21
|
+
density="compact"
|
|
22
|
+
>
|
|
23
|
+
<SegmentedControlItem value="week">Week</SegmentedControlItem>
|
|
24
|
+
<SegmentedControlItem value="month">Month</SegmentedControlItem>
|
|
25
|
+
</SegmentedControl>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The root supports controlled `value`/`onValueChange` and uncontrolled `defaultValue`. `variant` is `muted` or `outline`; `density` is `compact`, `default`, or `comfortable`; `fullWidth` lets each item share the available width.
|
|
29
|
+
|
|
30
|
+
## Quality bar
|
|
31
|
+
|
|
32
|
+
- Keep two to five literal, parallel labels in one group.
|
|
33
|
+
- Give the group an `aria-label` or `aria-labelledby`.
|
|
34
|
+
- Keep icon-only items exceptional. When used, set `iconOnly` and give every item an `aria-label`.
|
|
35
|
+
- Let the radio-group implementation own focus, arrow-key movement, and selected semantics.
|
|
36
|
+
- Use `fullWidth` only when equal-width choices improve scanning in a narrow pane.
|
|
37
|
+
- Do not use a segmented control for commands, independent toggles, or navigation between unrelated destinations.
|
|
38
|
+
|
|
39
|
+
In a standalone app window, keep compact segments in a title toolbar or near the content they change. Do not imitate host window controls or place app actions inside a host-owned control inset.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Sidebar
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
The sidebar primitives build persistent app navigation or an object browser that can collapse on desktop and become a sheet on narrow screens. Use them when users need to switch repeatedly among sections, collections, or saved objects while keeping a working surface visible.
|
|
6
|
+
|
|
7
|
+
Do not add a sidebar to a focused single-workflow app. A list-to-detail layout may need only a stable list pane, while technical workspaces may be better served by `ResizablePanelGroup`.
|
|
8
|
+
|
|
9
|
+
## Usage patterns
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { Inbox } from 'lucide-react'
|
|
13
|
+
import {
|
|
14
|
+
Sidebar,
|
|
15
|
+
SidebarContent,
|
|
16
|
+
SidebarGroup,
|
|
17
|
+
SidebarGroupContent,
|
|
18
|
+
SidebarGroupLabel,
|
|
19
|
+
SidebarInset,
|
|
20
|
+
SidebarMenu,
|
|
21
|
+
SidebarMenuButton,
|
|
22
|
+
SidebarMenuItem,
|
|
23
|
+
SidebarProvider,
|
|
24
|
+
SidebarTrigger,
|
|
25
|
+
} from '@moldable-ai/ui'
|
|
26
|
+
|
|
27
|
+
;<SidebarProvider className="h-full min-h-0">
|
|
28
|
+
<Sidebar collapsible="icon">
|
|
29
|
+
<SidebarContent className="pb-[calc(var(--chat-safe-padding,0px)+1rem)]">
|
|
30
|
+
<SidebarGroup>
|
|
31
|
+
<SidebarGroupLabel>Mailboxes</SidebarGroupLabel>
|
|
32
|
+
<SidebarGroupContent>
|
|
33
|
+
<SidebarMenu>
|
|
34
|
+
<SidebarMenuItem>
|
|
35
|
+
<SidebarMenuButton
|
|
36
|
+
isActive
|
|
37
|
+
tooltip="Inbox"
|
|
38
|
+
className="cursor-pointer"
|
|
39
|
+
>
|
|
40
|
+
<Inbox />
|
|
41
|
+
<span>Inbox</span>
|
|
42
|
+
</SidebarMenuButton>
|
|
43
|
+
</SidebarMenuItem>
|
|
44
|
+
</SidebarMenu>
|
|
45
|
+
</SidebarGroupContent>
|
|
46
|
+
</SidebarGroup>
|
|
47
|
+
</SidebarContent>
|
|
48
|
+
</Sidebar>
|
|
49
|
+
<SidebarInset className="h-full min-h-0 overflow-hidden">
|
|
50
|
+
<header className="border-border/70 flex h-9 shrink-0 items-center border-b px-2">
|
|
51
|
+
<SidebarTrigger className="cursor-pointer" />
|
|
52
|
+
</header>
|
|
53
|
+
{/* Main pane */}
|
|
54
|
+
</SidebarInset>
|
|
55
|
+
</SidebarProvider>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Keep each menu item’s icon and last text span direct children of `SidebarMenuButton`; the component uses that shape for icon sizing and text truncation.
|
|
59
|
+
|
|
60
|
+
## API summary
|
|
61
|
+
|
|
62
|
+
### State and shell
|
|
63
|
+
|
|
64
|
+
- `SidebarProvider`: required context. Supports uncontrolled `defaultOpen`, controlled `open`/`onOpenChange`, and CSS variable overrides through `style`.
|
|
65
|
+
- `useSidebar()`: returns `state`, `open`, `setOpen`, `openMobile`, `setOpenMobile`, `isMobile`, and `toggleSidebar`.
|
|
66
|
+
- `Sidebar`: `side="left" | "right"`, `variant="sidebar" | "floating" | "inset"`, and `collapsible="offcanvas" | "icon" | "none"`.
|
|
67
|
+
- `SidebarInset`: main content surface paired with the sidebar.
|
|
68
|
+
- `SidebarTrigger`: compact toggle button.
|
|
69
|
+
- `SidebarRail`: pointer target along the sidebar edge.
|
|
70
|
+
|
|
71
|
+
### Structure
|
|
72
|
+
|
|
73
|
+
- `SidebarHeader`, `SidebarFooter`, `SidebarContent`, and `SidebarSeparator` divide the vertical shell.
|
|
74
|
+
- `SidebarInput` is a compact search/filter input.
|
|
75
|
+
- `SidebarGroup`, `SidebarGroupLabel`, `SidebarGroupAction`, and `SidebarGroupContent` organize sections.
|
|
76
|
+
|
|
77
|
+
### Menus
|
|
78
|
+
|
|
79
|
+
- `SidebarMenu` and `SidebarMenuItem` provide list structure.
|
|
80
|
+
- `SidebarMenuButton`: `isActive`, `variant="default" | "outline"`, `size="default" | "sm" | "lg"`, optional `asChild`, and `tooltip`.
|
|
81
|
+
- `SidebarMenuAction`: optional `asChild` and `showOnHover`.
|
|
82
|
+
- `SidebarMenuBadge`: compact trailing count.
|
|
83
|
+
- `SidebarMenuSkeleton`: optional `showIcon`.
|
|
84
|
+
- `SidebarMenuSub`, `SidebarMenuSubItem`, and `SidebarMenuSubButton`: one nested level; sub-button size is `sm` or `md`.
|
|
85
|
+
|
|
86
|
+
The provider persists expanded state in the `sidebar_state` cookie and handles Command/Ctrl+B. Collapsed-menu tooltips are built into `SidebarMenuButton` when `tooltip` is provided.
|
|
87
|
+
|
|
88
|
+
## Do
|
|
89
|
+
|
|
90
|
+
- Put the provider around both sidebar and inset.
|
|
91
|
+
- Use one clear active item and update it with navigation state.
|
|
92
|
+
- Add tooltips to icon-collapsible menu buttons.
|
|
93
|
+
- Give group and menu actions accessible names; make hover actions visible on focus.
|
|
94
|
+
- Keep labels in a truncatable span and counts/actions in stable trailing positions.
|
|
95
|
+
- Use `SidebarContent` as the intentional scrolling region.
|
|
96
|
+
- Test expanded, collapsed, off-canvas, and narrow-sheet states.
|
|
97
|
+
|
|
98
|
+
## Don't
|
|
99
|
+
|
|
100
|
+
- Do not restate the app name as a large sidebar or content heading.
|
|
101
|
+
- Do not add more than one meaningful nesting level.
|
|
102
|
+
- Do not use the sidebar as a dumping ground for every command.
|
|
103
|
+
- Do not place the only access to an action in a hover-only control.
|
|
104
|
+
- Do not assume desktop width is always available inside a webview pane.
|
|
105
|
+
- Do not add an app-local chat or assistant section.
|
|
106
|
+
|
|
107
|
+
## Moldable considerations
|
|
108
|
+
|
|
109
|
+
Override the shell for the embedded full-height environment with `h-full min-h-0` and keep the main inset `overflow-hidden`. Add chat-safe bottom padding to `SidebarContent`, because object browsers and navigation lists can extend behind desktop chat independently of the main pane.
|
|
110
|
+
|
|
111
|
+
The built-in Command/Ctrl+B shortcut must not conflict with editor-local bold formatting or another essential command in the same context. If it does, control sidebar state elsewhere or revisit the shortcut at the package level.
|
|
112
|
+
|
|
113
|
+
Use semantic `sidebar-*` tokens already provided by the component. In an object browser, post the active connection, collection, or selected object to desktop chat instructions and expose frequent switches through app commands.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Toasts
|
|
2
|
+
|
|
3
|
+
Mount one `Toaster` near the app root and call the shared `toast` API from
|
|
4
|
+
actions, mutations, and background work.
|
|
5
|
+
|
|
6
|
+
```tsx
|
|
7
|
+
import { Toaster, toast } from '@moldable-ai/ui'
|
|
8
|
+
|
|
9
|
+
function App() {
|
|
10
|
+
return (
|
|
11
|
+
<>
|
|
12
|
+
<Workspace />
|
|
13
|
+
<Toaster position="bottom-center" />
|
|
14
|
+
</>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async function save() {
|
|
19
|
+
await toast.promise(saveDocument(), {
|
|
20
|
+
loading: 'Saving…',
|
|
21
|
+
success: 'Saved',
|
|
22
|
+
error: 'Could not save',
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Recipes
|
|
28
|
+
|
|
29
|
+
- Use a success toast only when the result is not already obvious in the
|
|
30
|
+
canvas.
|
|
31
|
+
- Keep loading, success, and error text stable for a single promise.
|
|
32
|
+
- Put undo in the toast action for reversible destructive work.
|
|
33
|
+
- Use an alert or inline field message when the user must resolve the problem
|
|
34
|
+
before continuing.
|
|
35
|
+
- Keep one `Toaster` per app window. A host shell must not absorb app-owned
|
|
36
|
+
notifications.
|
|
37
|
+
- Toast text must describe the result, not expose transport or server details.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# SplitView
|
|
2
|
+
|
|
3
|
+
Semantic naming over resizable panel primitives.
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
<SplitView orientation="horizontal">
|
|
7
|
+
<SplitViewPane defaultSize="30%">…</SplitViewPane>
|
|
8
|
+
<SplitViewHandle />
|
|
9
|
+
<SplitViewPane>…</SplitViewPane>
|
|
10
|
+
</SplitView>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Use when pane resizing is part of the workflow. Provide sensible minimum and
|
|
14
|
+
default sizes, preserve important content, and persist sizes only when that
|
|
15
|
+
improves repeated work. Use `PanelGroup` for non-resizable layouts.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Status
|
|
2
|
+
|
|
3
|
+
Compact dot-and-label feedback for state.
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
<Status variant="running" animated>Recording</Status>
|
|
7
|
+
<Status variant="success">Synced</Status>
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Use `running` or `pending` animation only for active work. Use `Badge` for
|
|
11
|
+
categories and labels. Keep a text label when the meaning is important; color
|
|
12
|
+
alone is insufficient.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Table
|
|
2
|
+
|
|
3
|
+
Structured, comparable data with shared density and row-selection behavior.
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
<Table density="compact">
|
|
7
|
+
<TableHeader>
|
|
8
|
+
<TableRow>
|
|
9
|
+
<TableHead>Name</TableHead>
|
|
10
|
+
<TableHead>Status</TableHead>
|
|
11
|
+
</TableRow>
|
|
12
|
+
</TableHeader>
|
|
13
|
+
<TableBody>
|
|
14
|
+
{rows.map((row) => (
|
|
15
|
+
<TableRow
|
|
16
|
+
key={row.id}
|
|
17
|
+
selected={selection.has(row.id)}
|
|
18
|
+
onSelectionChange={(selected) => updateSelection(row.id, selected)}
|
|
19
|
+
>
|
|
20
|
+
<TableCell>{row.name}</TableCell>
|
|
21
|
+
<TableCell>{row.status}</TableCell>
|
|
22
|
+
</TableRow>
|
|
23
|
+
))}
|
|
24
|
+
</TableBody>
|
|
25
|
+
</Table>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Use `compact` for inspector-like datasets, `default` for general work, and
|
|
29
|
+
`comfortable` where scanning matters more than density.
|
|
30
|
+
|
|
31
|
+
When a row is selectable, selection is controlled by the caller and can be
|
|
32
|
+
toggled with pointer, Enter, or Space. Put independent actions inside buttons
|
|
33
|
+
and call `event.stopPropagation()` if activating them must not select the row.
|
|
34
|
+
For rich grid navigation, column sorting, or cell editing, use a dedicated data
|
|
35
|
+
grid rather than layering those interactions onto a basic table.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Tabs
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Tabs switch between peer views of the same object or workspace without changing the overall context. Use them for compact modes such as Notes/Transcript, Query/Results, or Details/Activity.
|
|
6
|
+
|
|
7
|
+
Use navigation when each destination is a distinct location. Use `ToggleGroup` for display controls that do not own tab panels.
|
|
8
|
+
|
|
9
|
+
## Usage patterns
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@moldable-ai/ui'
|
|
13
|
+
|
|
14
|
+
;<Tabs defaultValue="notes" className="h-full min-h-0">
|
|
15
|
+
<TabsList aria-label="Meeting view">
|
|
16
|
+
<TabsTrigger value="notes">Notes</TabsTrigger>
|
|
17
|
+
<TabsTrigger value="transcript">Transcript</TabsTrigger>
|
|
18
|
+
</TabsList>
|
|
19
|
+
<TabsContent value="notes" className="min-h-0 overflow-y-auto">
|
|
20
|
+
{/* Notes */}
|
|
21
|
+
</TabsContent>
|
|
22
|
+
<TabsContent value="transcript" className="min-h-0 overflow-y-auto">
|
|
23
|
+
{/* Transcript */}
|
|
24
|
+
</TabsContent>
|
|
25
|
+
</Tabs>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Use the `line` variant in dense app chrome where a filled segmented control would be too prominent:
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
<TabsList variant="line">
|
|
32
|
+
<TabsTrigger value="schema">Schema</TabsTrigger>
|
|
33
|
+
<TabsTrigger value="data">Data</TabsTrigger>
|
|
34
|
+
</TabsList>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## API summary
|
|
38
|
+
|
|
39
|
+
- `Tabs`: Radix Tabs root; supports controlled `value`/`onValueChange`, `defaultValue`, `orientation`, activation direction, and other root props. Orientation defaults to `horizontal`.
|
|
40
|
+
- `TabsList`: `variant="default"` or `"line"`. Defaults to `default`.
|
|
41
|
+
- `TabsTrigger`: requires a `value` matching a content panel; supports `disabled`.
|
|
42
|
+
- `TabsContent`: requires a matching `value`.
|
|
43
|
+
- `tabsListVariants` is exported for compatible composition.
|
|
44
|
+
- Components accept the corresponding Radix primitive props and `className`.
|
|
45
|
+
|
|
46
|
+
## Do
|
|
47
|
+
|
|
48
|
+
- Use short, parallel labels.
|
|
49
|
+
- Keep the number of tabs small enough to fit without ambiguous truncation.
|
|
50
|
+
- Use controlled state when the active tab affects URL state, commands, or desktop chat context.
|
|
51
|
+
- Put scrolling on the active content pane with `min-h-0`, not on the whole app.
|
|
52
|
+
- Preserve keyboard navigation and focus states supplied by Radix.
|
|
53
|
+
|
|
54
|
+
## Don't
|
|
55
|
+
|
|
56
|
+
- Do not use tabs as a substitute for primary navigation or a command toolbar.
|
|
57
|
+
- Do not mix actions such as “Add” or “Refresh” into the tab list.
|
|
58
|
+
- Do not put unrelated workflows behind peer tabs.
|
|
59
|
+
- Do not change tab labels or order unpredictably.
|
|
60
|
+
- Do not rely on a subtle color change alone; retain the active background or line indicator.
|
|
61
|
+
|
|
62
|
+
## Moldable considerations
|
|
63
|
+
|
|
64
|
+
Tabs belong in compact chrome, not a large page header. In document and paneled layouts, keep their bar around `h-8` or `h-9`. When a tab panel scrolls to the bottom of the webview, add `pb-[calc(var(--chat-safe-padding,0px)+1rem)]` or the larger padding appropriate to an editor or dock.
|
|
65
|
+
|
|
66
|
+
Changing tabs should update app commands and chat instructions when it materially changes the active object or mode. Do not create an “AI chat” tab; Moldable’s desktop chat is the conversational surface.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Text
|
|
2
|
+
|
|
3
|
+
Semantic typography for app content and chrome.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
<Text as="h1" variant="heading1">Library</Text>
|
|
9
|
+
<Text variant="small" color="secondary">12 local items</Text>
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Use the `as` prop for correct HTML semantics and `variant` for visual hierarchy.
|
|
13
|
+
`truncate` is appropriate only when the full value remains available through
|
|
14
|
+
context or a tooltip. Use mono variants for identifiers, code, and numeric
|
|
15
|
+
readouts—not body copy.
|
|
16
|
+
|
|
17
|
+
Do not recreate the type scale with arbitrary font sizes.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Toggle Group
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
`ToggleGroup` presents a compact set of related choices. Use it for a mutually exclusive view mode or a small set of independently pressed formatting options.
|
|
6
|
+
|
|
7
|
+
Use `Tabs` when each choice owns a content panel. Use `RadioGroup` when a form choice needs visible labels and conventional form semantics.
|
|
8
|
+
|
|
9
|
+
## Usage patterns
|
|
10
|
+
|
|
11
|
+
Single selection:
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { ToggleGroup, ToggleGroupItem } from '@moldable-ai/ui'
|
|
15
|
+
|
|
16
|
+
;<ToggleGroup
|
|
17
|
+
type="single"
|
|
18
|
+
value={layout}
|
|
19
|
+
onValueChange={(value) => value && setLayout(value)}
|
|
20
|
+
variant="outline"
|
|
21
|
+
size="sm"
|
|
22
|
+
aria-label="Result layout"
|
|
23
|
+
>
|
|
24
|
+
<ToggleGroupItem value="table" className="cursor-pointer">
|
|
25
|
+
Table
|
|
26
|
+
</ToggleGroupItem>
|
|
27
|
+
<ToggleGroupItem value="json" className="cursor-pointer">
|
|
28
|
+
JSON
|
|
29
|
+
</ToggleGroupItem>
|
|
30
|
+
</ToggleGroup>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Multiple selection:
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
<ToggleGroup type="multiple" spacing={1} aria-label="Text formatting">
|
|
37
|
+
<ToggleGroupItem value="bold" className="cursor-pointer" aria-label="Bold">
|
|
38
|
+
<Bold />
|
|
39
|
+
</ToggleGroupItem>
|
|
40
|
+
<ToggleGroupItem
|
|
41
|
+
value="italic"
|
|
42
|
+
className="cursor-pointer"
|
|
43
|
+
aria-label="Italic"
|
|
44
|
+
>
|
|
45
|
+
<Italic />
|
|
46
|
+
</ToggleGroupItem>
|
|
47
|
+
</ToggleGroup>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## API summary
|
|
51
|
+
|
|
52
|
+
- `ToggleGroup`: Radix Toggle Group root. `type="single"` uses a string value; `type="multiple"` uses a string array.
|
|
53
|
+
- Supports controlled `value`/`onValueChange` and uncontrolled `defaultValue`.
|
|
54
|
+
- `variant`: `default` or `outline`, shared with each item.
|
|
55
|
+
- `size`: `default`, `sm`, or `lg`, shared with each item.
|
|
56
|
+
- `spacing`: numeric Tailwind spacing multiplier; defaults to `0`. At zero, items join into one segmented shape.
|
|
57
|
+
- `ToggleGroupItem`: requires `value`; may override `variant` or `size` when the group does not supply them.
|
|
58
|
+
- Both parts accept corresponding Radix primitive props and `className`.
|
|
59
|
+
|
|
60
|
+
## Do
|
|
61
|
+
|
|
62
|
+
- Use `type="single"` for one active display mode and `type="multiple"` only when choices can coexist.
|
|
63
|
+
- In a required single-choice group, ignore an empty `onValueChange` value so the active choice cannot be cleared.
|
|
64
|
+
- Give the group and any icon-only item accessible names.
|
|
65
|
+
- Use `spacing={0}` for a segmented control and positive spacing for separate toolbar toggles.
|
|
66
|
+
- Keep labels short and the item count low.
|
|
67
|
+
|
|
68
|
+
## Don't
|
|
69
|
+
|
|
70
|
+
- Do not use the group for unrelated actions.
|
|
71
|
+
- Do not assume `type="single"` always keeps one choice selected.
|
|
72
|
+
- Do not mix text-heavy and icon-only choices without stable sizing.
|
|
73
|
+
- Do not let the group overflow a narrow toolbar without an alternate layout.
|
|
74
|
+
- Do not use color as the only selected-state cue.
|
|
75
|
+
|
|
76
|
+
## Moldable considerations
|
|
77
|
+
|
|
78
|
+
Use toggle groups in quiet `h-8` or `h-9` toolbars, inspectors, and result panes. Prefer a text label when an icon could be misread; when icons are familiar, pair each with a tooltip.
|
|
79
|
+
|
|
80
|
+
If the selected mode changes the visible dataset or selected object, keep command state and desktop chat instructions in sync. Toggle groups near the bottom of the webview must remain above fixed docks and `--chat-safe-padding`.
|