@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,76 @@
|
|
|
1
|
+
# Button
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
`Button` starts an immediate action or, with `asChild`, gives button styling and behavior to another interactive element. Use it for commands such as save, run, refresh, connect, archive, and open.
|
|
6
|
+
|
|
7
|
+
Use a link for navigation. Use `Toggle` when the control represents an on/off view state, and `ToggleGroup` when the user chooses among a small set of modes.
|
|
8
|
+
|
|
9
|
+
## Usage patterns
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { Button } from '@moldable-ai/ui'
|
|
13
|
+
import { RefreshCw } from 'lucide-react'
|
|
14
|
+
|
|
15
|
+
<Button type="button" size="sm" className="cursor-pointer">
|
|
16
|
+
Save changes
|
|
17
|
+
</Button>
|
|
18
|
+
|
|
19
|
+
<Button
|
|
20
|
+
type="button"
|
|
21
|
+
variant="ghost"
|
|
22
|
+
size="icon-sm"
|
|
23
|
+
className="cursor-pointer"
|
|
24
|
+
aria-label="Refresh results"
|
|
25
|
+
>
|
|
26
|
+
<RefreshCw />
|
|
27
|
+
</Button>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Keep toolbar actions compact (`xs`, `sm`, `icon-xs`, or `icon-sm`). Reserve `default` or `lg` for the primary action in a form, setup state, or focused control dock. While an async action is running, disable the button, preserve its width, and show a small spinner beside a short status label.
|
|
31
|
+
|
|
32
|
+
For links that should look like buttons:
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
<Button asChild variant="outline" size="sm">
|
|
36
|
+
<a href="/settings">Open settings</a>
|
|
37
|
+
</Button>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## API summary
|
|
41
|
+
|
|
42
|
+
- `variant`: `default`, `destructive`, `outline`, `secondary`, `ghost`, or `link`. Defaults to `default`.
|
|
43
|
+
- `size`: `default`, `xs`, `sm`, `lg`, `icon`, `icon-xs`, `icon-sm`, or `icon-lg`. Defaults to `default`.
|
|
44
|
+
- `asChild`: renders a Radix `Slot` so the child owns the element and semantics.
|
|
45
|
+
- Accepts native button props, including `type`, `disabled`, `aria-*`, and event handlers.
|
|
46
|
+
- `buttonVariants` is exported for cases that need the same visual treatment on another component.
|
|
47
|
+
|
|
48
|
+
## Do
|
|
49
|
+
|
|
50
|
+
- Set `type="button"` unless the control intentionally submits a form.
|
|
51
|
+
- Add `cursor-pointer`; use the real `disabled` attribute for unavailable or busy actions.
|
|
52
|
+
- Give icon-only buttons an `aria-label` and a tooltip.
|
|
53
|
+
- Use a specific Lucide icon that names the action.
|
|
54
|
+
- Put one visually primary action in a local action group.
|
|
55
|
+
- Keep labels literal and verb-led: “Save query”, “Connect account”, “Move to trash”.
|
|
56
|
+
|
|
57
|
+
## Don't
|
|
58
|
+
|
|
59
|
+
- Do not use a button for ordinary navigation without link semantics.
|
|
60
|
+
- Do not rely on color alone to explain a destructive or selected action.
|
|
61
|
+
- Do not use raw color classes, decorative gradients, or oversized call-to-action styling.
|
|
62
|
+
- Do not use `Sparkles` as a generic AI marker.
|
|
63
|
+
- Do not leave a busy button clickable or allow repeated submission.
|
|
64
|
+
- Do not hide essential actions behind hover-only icon buttons.
|
|
65
|
+
|
|
66
|
+
## Moldable considerations
|
|
67
|
+
|
|
68
|
+
Buttons in a fixed bottom dock must remain above the desktop chat:
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
<div style={{ bottom: 'calc(var(--chat-safe-padding, 0px) + 1.5rem)' }}>
|
|
72
|
+
<Button className="cursor-pointer">Apply changes</Button>
|
|
73
|
+
</div>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Keep fixed groups within `max-w-[calc(100vw-2rem)]`. Toolbar buttons should normally fit an `h-8` or `h-9` bar. Important actions should also be exposed through app commands when useful. Do not add an app-local prompt or chat button when the action belongs to Moldable’s desktop chat.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# ColorWell
|
|
2
|
+
|
|
3
|
+
Compact color selection or read-only swatch.
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
<ColorWell aria-label="Project color" value={color} onValueChange={setColor} />
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Use the browser color input as the renderer fallback. `readOnly` presents the
|
|
10
|
+
value without implying interactivity. Never make color the only representation
|
|
11
|
+
of a status or category.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Combobox
|
|
2
|
+
|
|
3
|
+
Searchable single- or multi-value selection for longer option sets.
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
Use `Combobox` when users need to filter options, create values, or manage
|
|
8
|
+
multiple selections. Use `Select` for a short fixed list, `Command` for actions,
|
|
9
|
+
and `Input` for unconstrained text.
|
|
10
|
+
|
|
11
|
+
## Anatomy
|
|
12
|
+
|
|
13
|
+
Compose the root with `ComboboxInput`, `ComboboxContent`, `ComboboxList`, and
|
|
14
|
+
`ComboboxItem`. Optional parts include groups, labels, separators, an empty
|
|
15
|
+
state, clear/trigger controls, and the chips family for multi-value input.
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
<Combobox items={projects}>
|
|
19
|
+
<ComboboxInput placeholder="Choose a project" />
|
|
20
|
+
<ComboboxContent>
|
|
21
|
+
<ComboboxEmpty>No matching projects.</ComboboxEmpty>
|
|
22
|
+
<ComboboxList>
|
|
23
|
+
{(project) => (
|
|
24
|
+
<ComboboxItem key={project.id} value={project}>
|
|
25
|
+
{project.name}
|
|
26
|
+
</ComboboxItem>
|
|
27
|
+
)}
|
|
28
|
+
</ComboboxList>
|
|
29
|
+
</ComboboxContent>
|
|
30
|
+
</Combobox>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Design and behavior
|
|
34
|
+
|
|
35
|
+
- Keep option labels concise and place distinguishing metadata after the name.
|
|
36
|
+
- Show a real loading state for remote results; “no matches” is not a loading
|
|
37
|
+
state.
|
|
38
|
+
- Preserve Base UI keyboard navigation, focus, active-descendant, and
|
|
39
|
+
selection behavior.
|
|
40
|
+
- Label the input visibly or with an accessible name.
|
|
41
|
+
- Do not deep-import the implementation; `Combobox` is exported from the
|
|
42
|
+
package root.
|
|
43
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Date Field
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
`DateField` provides a styled native HTML date input. It keeps platform parsing, keyboard entry, validation, locale-aware presentation, and the browser’s native picker rather than implementing a look-alike calendar.
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { DateField } from '@moldable-ai/ui'
|
|
11
|
+
|
|
12
|
+
<DateField
|
|
13
|
+
aria-label="Due date"
|
|
14
|
+
value={dueDate}
|
|
15
|
+
min="2026-01-01"
|
|
16
|
+
onValueChange={setDueDate}
|
|
17
|
+
clearable
|
|
18
|
+
/>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Values use the native timezone-free `YYYY-MM-DD` form. Use `value`/`onValueChange` for a controlled field or `defaultValue` for an uncontrolled field. Native attributes such as `min`, `max`, `step`, `required`, `disabled`, and `aria-invalid` pass through. `variant` is `default` or `filled`; `density` is `compact`, `default`, or `comfortable`.
|
|
22
|
+
|
|
23
|
+
## Quality bar
|
|
24
|
+
|
|
25
|
+
- Associate the input with a visible label or an accessible `aria-label`.
|
|
26
|
+
- Store the returned value as a calendar date; do not pass it through a UTC timestamp just to format it.
|
|
27
|
+
- Use native constraints and show validation text close to the field.
|
|
28
|
+
- Allow clearing only when an empty date is valid.
|
|
29
|
+
- Use a calendar popover only for workflows that require richer range, availability, or event selection.
|
|
30
|
+
- Do not replace the native picker to imitate a desktop control.
|
|
31
|
+
|
|
32
|
+
A host may later provide a native date capability. Keep that behind an explicit cross-client contract and preserve this web implementation as the portable fallback.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# EdgeFade
|
|
2
|
+
|
|
3
|
+
A non-interactive gradient cue that content continues beneath an edge.
|
|
4
|
+
|
|
5
|
+
Place it inside a relatively positioned scroll container and select the
|
|
6
|
+
matching `edge`. It never replaces a visible scrollbar or keyboard scrolling.
|
|
7
|
+
Keep the fade subtle and omit it when content boundaries are already obvious.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Empty
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
`Empty` describes a normal absence of content or a blocked first-run state. It gives the user a quiet explanation and, when needed, one clear next action.
|
|
6
|
+
|
|
7
|
+
Use `Alert` when an operation failed. Use `Skeleton` or `Spinner` while data is still loading. Do not render an empty state before the initial query has resolved.
|
|
8
|
+
|
|
9
|
+
## Usage patterns
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { Database } from 'lucide-react'
|
|
13
|
+
import {
|
|
14
|
+
Button,
|
|
15
|
+
Empty,
|
|
16
|
+
EmptyContent,
|
|
17
|
+
EmptyDescription,
|
|
18
|
+
EmptyHeader,
|
|
19
|
+
EmptyMedia,
|
|
20
|
+
EmptyTitle,
|
|
21
|
+
} from '@moldable-ai/ui'
|
|
22
|
+
|
|
23
|
+
;<Empty className="pb-[calc(var(--chat-safe-padding,0px)+2rem)]">
|
|
24
|
+
<EmptyHeader>
|
|
25
|
+
<EmptyMedia variant="icon">
|
|
26
|
+
<Database />
|
|
27
|
+
</EmptyMedia>
|
|
28
|
+
<EmptyTitle>Choose a connection</EmptyTitle>
|
|
29
|
+
<EmptyDescription>
|
|
30
|
+
Select a saved connection to browse its tables.
|
|
31
|
+
</EmptyDescription>
|
|
32
|
+
</EmptyHeader>
|
|
33
|
+
<EmptyContent>
|
|
34
|
+
<Button type="button" size="sm" className="cursor-pointer">
|
|
35
|
+
Add connection
|
|
36
|
+
</Button>
|
|
37
|
+
</EmptyContent>
|
|
38
|
+
</Empty>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
For a successful zero state, omit the action when there is nothing useful to do:
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
<Empty>
|
|
45
|
+
<EmptyHeader>
|
|
46
|
+
<EmptyTitle>Inbox clear</EmptyTitle>
|
|
47
|
+
<EmptyDescription>No messages need your attention.</EmptyDescription>
|
|
48
|
+
</EmptyHeader>
|
|
49
|
+
</Empty>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## API summary
|
|
53
|
+
|
|
54
|
+
- `Empty`: centered flex container for the complete state.
|
|
55
|
+
- `EmptyHeader`: groups media, title, and description.
|
|
56
|
+
- `EmptyMedia`: `variant="default"` or `variant="icon"`.
|
|
57
|
+
- `EmptyTitle`: primary label.
|
|
58
|
+
- `EmptyDescription`: supporting text with styled inline links.
|
|
59
|
+
- `EmptyContent`: optional actions or secondary controls.
|
|
60
|
+
- All parts accept native props for their rendered element and a `className`.
|
|
61
|
+
|
|
62
|
+
## Do
|
|
63
|
+
|
|
64
|
+
- Use a one-to-four-word title and at most one sentence of description.
|
|
65
|
+
- Show one primary setup action when the state is blocked.
|
|
66
|
+
- Distinguish first-run, filtered-zero, permission, and successful-zero states.
|
|
67
|
+
- Keep the app’s normal shell or pane structure visible.
|
|
68
|
+
- Add chat-safe padding when the empty state occupies a pane that reaches the bottom.
|
|
69
|
+
|
|
70
|
+
## Don't
|
|
71
|
+
|
|
72
|
+
- Do not use welcome-page copy, feature grids, or marketing language.
|
|
73
|
+
- Do not explain obvious controls.
|
|
74
|
+
- Do not add an illustration only to fill space.
|
|
75
|
+
- Do not show a creation action when silence or completion is the correct state.
|
|
76
|
+
- Do not make the empty state a giant nested card.
|
|
77
|
+
|
|
78
|
+
## Moldable considerations
|
|
79
|
+
|
|
80
|
+
An empty state should feel like part of a local instrument, not a landing page. Keep it visually small even when centered. If the desktop chat can resolve the state, provide specific app context or an explicit “Ask Moldable about this” affordance that prefills desktop chat; do not add another chat box.
|
|
81
|
+
|
|
82
|
+
For scrollable panes, use enough bottom padding to remain visible above chat, commonly `pb-[calc(var(--chat-safe-padding,0px)+1rem)]` or more when a fixed dock is present.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Field
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
The field primitives compose accessible, consistent form rows. Use them to connect labels, controls, descriptions, validation messages, and related groups without wrapping every input in a card.
|
|
6
|
+
|
|
7
|
+
## Usage patterns
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import {
|
|
11
|
+
Field,
|
|
12
|
+
FieldDescription,
|
|
13
|
+
FieldError,
|
|
14
|
+
FieldGroup,
|
|
15
|
+
FieldLabel,
|
|
16
|
+
Input,
|
|
17
|
+
} from '@moldable-ai/ui'
|
|
18
|
+
|
|
19
|
+
;<FieldGroup>
|
|
20
|
+
<Field data-invalid={Boolean(error)}>
|
|
21
|
+
<FieldLabel htmlFor="connection-name">Connection name</FieldLabel>
|
|
22
|
+
<Input
|
|
23
|
+
id="connection-name"
|
|
24
|
+
aria-invalid={Boolean(error)}
|
|
25
|
+
aria-describedby={
|
|
26
|
+
error ? 'connection-name-error' : 'connection-name-help'
|
|
27
|
+
}
|
|
28
|
+
/>
|
|
29
|
+
<FieldDescription id="connection-name-help">
|
|
30
|
+
Used only to identify this connection.
|
|
31
|
+
</FieldDescription>
|
|
32
|
+
<FieldError
|
|
33
|
+
id="connection-name-error"
|
|
34
|
+
errors={error ? [{ message: error }] : []}
|
|
35
|
+
/>
|
|
36
|
+
</Field>
|
|
37
|
+
</FieldGroup>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Use `orientation="horizontal"` for compact checkbox/radio rows and `orientation="responsive"` when the label and control should align horizontally only when the field-group container is wide enough.
|
|
41
|
+
|
|
42
|
+
## API summary
|
|
43
|
+
|
|
44
|
+
- `FieldSet`: semantic `fieldset` for related controls.
|
|
45
|
+
- `FieldLegend`: `variant="legend"` or `"label"` for fieldset headings.
|
|
46
|
+
- `FieldGroup`: container-query-aware vertical group.
|
|
47
|
+
- `Field`: `role="group"` with `orientation="vertical"`, `"horizontal"`, or `"responsive"`.
|
|
48
|
+
- `FieldLabel`: wraps `Label`; supports `htmlFor`.
|
|
49
|
+
- `FieldTitle`: non-label heading for composite controls.
|
|
50
|
+
- `FieldContent`: groups a control with its description and error.
|
|
51
|
+
- `FieldDescription`: supporting text with styled inline links.
|
|
52
|
+
- `FieldError`: accepts `children` or `errors?: Array<{ message?: string } | undefined>`; duplicate messages are removed and multiple messages render as a list.
|
|
53
|
+
- `FieldSeparator`: divider with optional centered text.
|
|
54
|
+
- Each part accepts its native element props and `className`.
|
|
55
|
+
|
|
56
|
+
## Do
|
|
57
|
+
|
|
58
|
+
- Give every control a visible label or an accessible name.
|
|
59
|
+
- Connect labels and descriptions with `htmlFor`, `id`, and `aria-describedby`.
|
|
60
|
+
- Set both `data-invalid` on `Field` and `aria-invalid` on the control.
|
|
61
|
+
- Use real `disabled` state and reflect it on the field group when styling needs it.
|
|
62
|
+
- Place validation directly after the affected control.
|
|
63
|
+
- Group related checkbox or radio controls in `FieldSet` with `FieldLegend`.
|
|
64
|
+
|
|
65
|
+
## Don't
|
|
66
|
+
|
|
67
|
+
- Do not use placeholder text as the only label.
|
|
68
|
+
- Do not show validation only by changing border color.
|
|
69
|
+
- Do not wait until submission to reveal formatting requirements the user needs beforehand.
|
|
70
|
+
- Do not use horizontal fields when labels or values will be cramped.
|
|
71
|
+
- Do not store secrets in ordinary app state when they belong in aivault.
|
|
72
|
+
|
|
73
|
+
## Moldable considerations
|
|
74
|
+
|
|
75
|
+
Forms should be compact and bounded. Use dialogs for small setup or edit workflows, with their body scrolling internally above `--chat-safe-padding`. Put advanced options behind a secondary disclosure.
|
|
76
|
+
|
|
77
|
+
Use plain `Input` or `Textarea` for short values only. Use `MarkdownEditor` for structured prose and Monaco for code, SQL, JSON, or configuration. Async validation and save states should stay local to the field or submit button and must prevent duplicate actions.
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Grid
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
`Grid` is a keyboard-aware, selectable tile collection for artifacts, projects, media, templates, and other visual libraries. It provides two-dimensional arrow navigation, selection, activation, disabled-item behavior, and ARIA grid structure.
|
|
6
|
+
|
|
7
|
+
Use `List` when rows are primarily textual or the container is narrow. Use CSS Grid directly for non-interactive page layout.
|
|
8
|
+
|
|
9
|
+
## Basic usage
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import {
|
|
13
|
+
Grid,
|
|
14
|
+
GridItem,
|
|
15
|
+
GridItemContent,
|
|
16
|
+
GridItemDescription,
|
|
17
|
+
GridItemMedia,
|
|
18
|
+
GridItemTitle,
|
|
19
|
+
} from '@moldable-ai/ui'
|
|
20
|
+
|
|
21
|
+
<Grid
|
|
22
|
+
aria-label="Artifacts"
|
|
23
|
+
columns={3}
|
|
24
|
+
selectionMode="single"
|
|
25
|
+
onAction={(value) => openArtifact(value)}
|
|
26
|
+
>
|
|
27
|
+
{artifacts.map((artifact) => (
|
|
28
|
+
<GridItem key={artifact.id} value={artifact.id}>
|
|
29
|
+
<GridItemMedia>
|
|
30
|
+
<img src={artifact.previewUrl} alt="" />
|
|
31
|
+
</GridItemMedia>
|
|
32
|
+
<GridItemContent>
|
|
33
|
+
<GridItemTitle>{artifact.title}</GridItemTitle>
|
|
34
|
+
<GridItemDescription>{artifact.summary}</GridItemDescription>
|
|
35
|
+
</GridItemContent>
|
|
36
|
+
</GridItem>
|
|
37
|
+
))}
|
|
38
|
+
</Grid>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`GridItem` elements must be direct children. `Grid` groups them into semantic rows according to `columns`.
|
|
42
|
+
|
|
43
|
+
## Responsive columns
|
|
44
|
+
|
|
45
|
+
Keep the `columns` value aligned with the rendered column count because it drives both layout and keyboard movement:
|
|
46
|
+
|
|
47
|
+
```tsx
|
|
48
|
+
const columns = useCompactWindow() ? 1 : 3
|
|
49
|
+
|
|
50
|
+
<Grid columns={columns} aria-label="Projects">
|
|
51
|
+
{/* direct GridItem children */}
|
|
52
|
+
</Grid>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Prefer changing this value at deliberate window breakpoints. A smaller window should normally reduce the number of columns before shrinking card content below its useful size.
|
|
56
|
+
|
|
57
|
+
## Interaction contract
|
|
58
|
+
|
|
59
|
+
- Arrow Left/Right moves one tile.
|
|
60
|
+
- Arrow Up/Down moves by `columns`.
|
|
61
|
+
- Home and End move to the first and last available tile.
|
|
62
|
+
- Space changes selection.
|
|
63
|
+
- Enter changes selection and invokes `onAction`.
|
|
64
|
+
- A single pointer click changes selection. A double click invokes `onAction`.
|
|
65
|
+
- Disabled tiles are skipped.
|
|
66
|
+
- Buttons and links inside a tile preserve their own pointer behavior.
|
|
67
|
+
|
|
68
|
+
## API summary
|
|
69
|
+
|
|
70
|
+
### `Grid`
|
|
71
|
+
|
|
72
|
+
- `columns`: positive integer used for layout, row semantics, and vertical navigation. Defaults to `1`.
|
|
73
|
+
- `selectionMode`: `none`, `single`, or `multiple`. Defaults to `none`.
|
|
74
|
+
- `selectedValues` / `defaultSelectedValues`: controlled or initial selected keys.
|
|
75
|
+
- `onSelectionChange(values)`: receives a new read-only `Set`.
|
|
76
|
+
- `onAction(value)`: invoked by Enter or a double click.
|
|
77
|
+
- `loop`: wraps directional navigation. Defaults to `false`.
|
|
78
|
+
- `disabled`: disables the entire collection.
|
|
79
|
+
|
|
80
|
+
### `GridItem`
|
|
81
|
+
|
|
82
|
+
- `value`: stable application key.
|
|
83
|
+
- `disabled`: removes the tile from focus, selection, and activation.
|
|
84
|
+
|
|
85
|
+
`GridItemMedia`, `GridItemContent`, `GridItemTitle`, and `GridItemDescription` provide a consistent preview-card anatomy.
|
|
86
|
+
|
|
87
|
+
## Do
|
|
88
|
+
|
|
89
|
+
- Provide a collection label.
|
|
90
|
+
- Keep every preview at a consistent aspect ratio within one grid.
|
|
91
|
+
- Preserve titles and essential state at narrow widths; remove decorative metadata first.
|
|
92
|
+
- Use an empty state outside the grid when there are no items.
|
|
93
|
+
- Lazy-load large preview images and provide useful image alternative text when the image conveys information not already in the title.
|
|
94
|
+
|
|
95
|
+
## Don't
|
|
96
|
+
|
|
97
|
+
- Do not use `Grid` as a general page-layout primitive.
|
|
98
|
+
- Do not hide essential actions behind hover alone.
|
|
99
|
+
- Do not make every tile independently tabbable.
|
|
100
|
+
- Do not let visual CSS columns disagree with the `columns` prop.
|
|
101
|
+
- Do not nest interactive tiles.
|
|
102
|
+
|
|
103
|
+
## Window and canvas guidance
|
|
104
|
+
|
|
105
|
+
Give visual grids room to breathe in a primary canvas, but keep their controls in a compact toolbar. Prefer one to three columns in narrow app windows and denser layouts only when previews remain legible. A standalone app window should own its loading, empty, selection, and error states; do not assume a surrounding desktop shell supplies them.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Icon Button
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
`IconButton` is the shared recipe for a compact action represented by one icon. It builds on `Button`, requires an accessible `label`, and standardizes icon sizing, busy state, shape, and density.
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { IconButton } from '@moldable-ai/ui'
|
|
11
|
+
import { RefreshCw } from 'lucide-react'
|
|
12
|
+
|
|
13
|
+
<IconButton
|
|
14
|
+
label="Refresh events"
|
|
15
|
+
tooltip
|
|
16
|
+
size="sm"
|
|
17
|
+
variant="ghost"
|
|
18
|
+
loading={refreshing}
|
|
19
|
+
onClick={refresh}
|
|
20
|
+
>
|
|
21
|
+
<RefreshCw />
|
|
22
|
+
</IconButton>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`size` is `xs`, `sm`, `default`, or `lg`. `shape` is `rounded` or `circle`. `loading` disables the control, exposes `aria-busy`, and replaces the icon with a progress indicator. `tooltip` may be `true` to reuse the label as a native hint or a specific string.
|
|
26
|
+
|
|
27
|
+
## Quality bar
|
|
28
|
+
|
|
29
|
+
- Use an explicit verb-led label, even when the icon seems obvious.
|
|
30
|
+
- Prefer `xs` or `sm` in compact toolbars and inspectors.
|
|
31
|
+
- Use the same icon for the same action throughout an app.
|
|
32
|
+
- Pair unfamiliar actions with the shared `Tooltip`; a native title is only a lightweight fallback.
|
|
33
|
+
- Keep destructive actions visually and textually clear.
|
|
34
|
+
- Do not place text inside `IconButton`, suppress its accessible name, or make an unavailable action appear enabled.
|
|
35
|
+
|
|
36
|
+
The component represents an app action only. Window close, minimize, zoom, sharing, and host menus remain host-owned capabilities.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Inspector
|
|
2
|
+
|
|
3
|
+
Secondary property controls for the current selection.
|
|
4
|
+
|
|
5
|
+
Compose `Inspector`, `InspectorHeader`, `InspectorContent`,
|
|
6
|
+
`InspectorSection`, and aligned `InspectorRow` pairs. Controls should usually
|
|
7
|
+
use compact sizes.
|
|
8
|
+
|
|
9
|
+
The inspector must remain subordinate to the primary pane. Collapse it when
|
|
10
|
+
width is constrained, group related properties, and avoid placing primary
|
|
11
|
+
workflow actions inside it.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Item
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
The item primitives compose dense, scannable object rows with optional media, metadata, actions, and secondary regions. Use them for messages, files, meetings, tasks, records, and settings rows.
|
|
6
|
+
|
|
7
|
+
Use `Table` for strongly tabular data and `Card` only when each object genuinely needs independent framing.
|
|
8
|
+
|
|
9
|
+
## Usage patterns
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { FileText, MoreHorizontal } from 'lucide-react'
|
|
13
|
+
import {
|
|
14
|
+
Button,
|
|
15
|
+
Item,
|
|
16
|
+
ItemActions,
|
|
17
|
+
ItemContent,
|
|
18
|
+
ItemDescription,
|
|
19
|
+
ItemGroup,
|
|
20
|
+
ItemMedia,
|
|
21
|
+
ItemSeparator,
|
|
22
|
+
ItemTitle,
|
|
23
|
+
} from '@moldable-ai/ui'
|
|
24
|
+
|
|
25
|
+
;<ItemGroup>
|
|
26
|
+
<Item size="sm">
|
|
27
|
+
<ItemMedia variant="icon">
|
|
28
|
+
<FileText />
|
|
29
|
+
</ItemMedia>
|
|
30
|
+
<ItemContent className="min-w-0">
|
|
31
|
+
<ItemTitle className="max-w-full truncate">Project notes.md</ItemTitle>
|
|
32
|
+
<ItemDescription className="truncate">
|
|
33
|
+
Edited 8 minutes ago
|
|
34
|
+
</ItemDescription>
|
|
35
|
+
</ItemContent>
|
|
36
|
+
<ItemActions>
|
|
37
|
+
<Button
|
|
38
|
+
type="button"
|
|
39
|
+
variant="ghost"
|
|
40
|
+
size="icon-xs"
|
|
41
|
+
className="cursor-pointer"
|
|
42
|
+
aria-label="More actions"
|
|
43
|
+
>
|
|
44
|
+
<MoreHorizontal />
|
|
45
|
+
</Button>
|
|
46
|
+
</ItemActions>
|
|
47
|
+
</Item>
|
|
48
|
+
<ItemSeparator />
|
|
49
|
+
</ItemGroup>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Use `asChild` when the whole item is a link or another interactive primitive. Avoid putting nested interactive controls inside an item whose entire surface is already a link.
|
|
53
|
+
|
|
54
|
+
## API summary
|
|
55
|
+
|
|
56
|
+
- `ItemGroup`: `role="list"` container.
|
|
57
|
+
- `Item`: `variant="default"`, `"outline"`, or `"muted"`; `size="default"` or `"sm"`; optional `asChild`.
|
|
58
|
+
- `ItemMedia`: `variant="default"`, `"icon"`, or `"image"`.
|
|
59
|
+
- `ItemContent`: flexible title/description column.
|
|
60
|
+
- `ItemTitle`, `ItemDescription`: primary and secondary text.
|
|
61
|
+
- `ItemActions`: trailing controls.
|
|
62
|
+
- `ItemHeader`, `ItemFooter`: full-width secondary rows.
|
|
63
|
+
- `ItemSeparator`: horizontal `Separator`.
|
|
64
|
+
- All components accept native props for their rendered element and `className`.
|
|
65
|
+
|
|
66
|
+
## Do
|
|
67
|
+
|
|
68
|
+
- Keep a stable left-middle-right scan order.
|
|
69
|
+
- Add `min-w-0` to flexible content and truncate or line-clamp unpredictable text.
|
|
70
|
+
- Keep times, counts, and status controls `shrink-0`.
|
|
71
|
+
- Make selected state visible with more than color when practical.
|
|
72
|
+
- Expose hover actions on focus and through a menu or app command.
|
|
73
|
+
- Use separators or a shared group surface for rhythm instead of one floating card per row.
|
|
74
|
+
|
|
75
|
+
## Don't
|
|
76
|
+
|
|
77
|
+
- Do not nest links or buttons inside a whole-row link.
|
|
78
|
+
- Do not let badges and actions push the primary label out of view.
|
|
79
|
+
- Do not make every row tall enough to look like a marketing card.
|
|
80
|
+
- Do not hide the only route to an action behind hover.
|
|
81
|
+
- Do not place unbounded text in a fixed-height row.
|
|
82
|
+
|
|
83
|
+
## Moldable considerations
|
|
84
|
+
|
|
85
|
+
For repeated object browsers, `size="sm"` is the useful baseline; tune row height toward the app archetype rather than adding padding for decoration. A scrolling item group should clear chat with `pb-[calc(var(--chat-safe-padding,0px)+1rem)]`, or more when a bottom dock is present.
|
|
86
|
+
|
|
87
|
+
Use the selected item to update desktop chat instructions with specific object context. Important row actions should be available through Cmd+K or a contextual menu, especially when the visual action is compact or hover-revealed.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# List
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
`List` is a keyboard-aware collection for compact rows such as files, sessions, workspaces, commands, and inspector results. It owns roving focus, optional selection, disabled-item behavior, and activation without forcing an app-specific data model.
|
|
6
|
+
|
|
7
|
+
Use `ItemGroup` for a static group that does not need collection interaction. Use `Command` for filtering and executing a command palette.
|
|
8
|
+
|
|
9
|
+
## Basic usage
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import {
|
|
13
|
+
List,
|
|
14
|
+
ListItem,
|
|
15
|
+
ListItemContent,
|
|
16
|
+
ListItemDescription,
|
|
17
|
+
ListItemTitle,
|
|
18
|
+
} from '@moldable-ai/ui'
|
|
19
|
+
|
|
20
|
+
<List
|
|
21
|
+
aria-label="Documents"
|
|
22
|
+
selectionMode="single"
|
|
23
|
+
defaultSelectedValues={['brief']}
|
|
24
|
+
onAction={(value) => openDocument(value)}
|
|
25
|
+
>
|
|
26
|
+
<ListItem value="brief">
|
|
27
|
+
<ListItemContent>
|
|
28
|
+
<ListItemTitle>Project brief</ListItemTitle>
|
|
29
|
+
<ListItemDescription>Edited 8 minutes ago</ListItemDescription>
|
|
30
|
+
</ListItemContent>
|
|
31
|
+
</ListItem>
|
|
32
|
+
<ListItem value="archive" disabled>
|
|
33
|
+
<ListItemContent>
|
|
34
|
+
<ListItemTitle>Archive</ListItemTitle>
|
|
35
|
+
<ListItemDescription>Unavailable offline</ListItemDescription>
|
|
36
|
+
</ListItemContent>
|
|
37
|
+
</ListItem>
|
|
38
|
+
</List>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
For controlled selection, pass an iterable to `selectedValues` and replace it when `onSelectionChange` fires:
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
const [selected, setSelected] = useState<ReadonlySet<string>>(
|
|
45
|
+
() => new Set(['inbox']),
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
<List
|
|
49
|
+
aria-label="Mailboxes"
|
|
50
|
+
selectionMode="multiple"
|
|
51
|
+
selectedValues={selected}
|
|
52
|
+
onSelectionChange={setSelected}
|
|
53
|
+
>
|
|
54
|
+
{/* ListItem children */}
|
|
55
|
+
</List>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Interaction contract
|
|
59
|
+
|
|
60
|
+
- Arrow Up/Down moves through a vertical list; Arrow Left/Right moves through a horizontal list.
|
|
61
|
+
- Home and End move to the first and last available item.
|
|
62
|
+
- Space changes selection.
|
|
63
|
+
- Enter changes selection and invokes `onAction`.
|
|
64
|
+
- A single pointer click changes selection. A double click invokes `onAction`.
|
|
65
|
+
- Disabled items are skipped during keyboard navigation and cannot be selected or activated.
|
|
66
|
+
- Interactive descendants such as buttons and links keep their own click behavior. They do not select or activate the containing item.
|
|
67
|
+
- Focus uses a roving `tabIndex`, so the collection contributes one stop to the tab order.
|
|
68
|
+
|
|
69
|
+
## API summary
|
|
70
|
+
|
|
71
|
+
### `List`
|
|
72
|
+
|
|
73
|
+
- `selectionMode`: `none`, `single`, or `multiple`. Defaults to `none`.
|
|
74
|
+
- `selectedValues` / `defaultSelectedValues`: controlled or initial selected keys.
|
|
75
|
+
- `onSelectionChange(values)`: receives a new read-only `Set`.
|
|
76
|
+
- `onAction(value)`: invoked by Enter or a double click.
|
|
77
|
+
- `orientation`: `vertical` or `horizontal`. Defaults to `vertical`.
|
|
78
|
+
- `loop`: wraps arrow navigation at collection boundaries. Defaults to `false`.
|
|
79
|
+
- `disabled`: disables the entire collection.
|
|
80
|
+
|
|
81
|
+
### `ListItem`
|
|
82
|
+
|
|
83
|
+
- `value`: stable application key; required and independent of React's `key`.
|
|
84
|
+
- `disabled`: removes the row from focus, selection, and activation.
|
|
85
|
+
- Native `div` props and event handlers are composed before collection behavior. Call `event.preventDefault()` to cancel the built-in response.
|
|
86
|
+
|
|
87
|
+
`ListItemContent`, `ListItemTitle`, `ListItemDescription`, and `ListItemActions` provide compact row layout without changing semantics.
|
|
88
|
+
|
|
89
|
+
## Do
|
|
90
|
+
|
|
91
|
+
- Give every collection a visible label or `aria-label`.
|
|
92
|
+
- Keep values stable when filtering or reordering.
|
|
93
|
+
- Put the primary row identity in `ListItemTitle` and secondary metadata in `ListItemDescription`.
|
|
94
|
+
- Use selection to represent durable collection state and action to open or execute.
|
|
95
|
+
- Keep row actions keyboard reachable; label icon-only controls.
|
|
96
|
+
|
|
97
|
+
## Don't
|
|
98
|
+
|
|
99
|
+
- Do not put a `List` inside another list item.
|
|
100
|
+
- Do not use array indexes as values when rows can reorder.
|
|
101
|
+
- Do not rely on double click as the only way to perform an important action.
|
|
102
|
+
- Do not add a second manual arrow-key handler to the same collection.
|
|
103
|
+
- Do not visually mark focus and selection as if they were the same state.
|
|
104
|
+
|
|
105
|
+
## Window and pane guidance
|
|
106
|
+
|
|
107
|
+
Lists should stay compact in sidebars and inspectors. Let the surrounding pane own its border and material; add a list background only when the list is itself a distinct surface. In narrow windows, preserve the row title and move secondary actions into a menu before truncating the primary label.
|