even-toolkit 0.5.2 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +113 -71
- package/dist/glasses/action-bar.d.ts.map +1 -0
- package/dist/glasses/action-bar.js.map +1 -0
- package/dist/glasses/action-map.d.ts.map +1 -0
- package/dist/glasses/action-map.js.map +1 -0
- package/dist/glasses/bridge.d.ts.map +1 -0
- package/dist/glasses/bridge.js.map +1 -0
- package/dist/glasses/canvas-renderer.d.ts.map +1 -0
- package/dist/glasses/canvas-renderer.js.map +1 -0
- package/dist/glasses/composer.d.ts.map +1 -0
- package/dist/glasses/composer.js.map +1 -0
- package/dist/glasses/gestures.d.ts.map +1 -0
- package/dist/glasses/gestures.js.map +1 -0
- package/dist/glasses/index.d.ts.map +1 -0
- package/dist/glasses/index.js.map +1 -0
- package/dist/glasses/keep-alive.d.ts.map +1 -0
- package/dist/glasses/keep-alive.js.map +1 -0
- package/dist/glasses/keyboard.d.ts.map +1 -0
- package/dist/glasses/keyboard.js.map +1 -0
- package/dist/glasses/layout.d.ts.map +1 -0
- package/dist/glasses/layout.js.map +1 -0
- package/dist/glasses/paginate-text.d.ts.map +1 -0
- package/dist/glasses/paginate-text.js.map +1 -0
- package/dist/glasses/png-utils.d.ts.map +1 -0
- package/dist/glasses/png-utils.js.map +1 -0
- package/dist/glasses/splash.d.ts.map +1 -0
- package/dist/glasses/splash.js.map +1 -0
- package/dist/glasses/text-clean.d.ts.map +1 -0
- package/dist/glasses/text-clean.js.map +1 -0
- package/dist/glasses/text-utils.d.ts.map +1 -0
- package/dist/glasses/text-utils.js.map +1 -0
- package/dist/glasses/timer-display.d.ts.map +1 -0
- package/dist/glasses/timer-display.js.map +1 -0
- package/dist/glasses/types.d.ts.map +1 -0
- package/dist/glasses/types.js.map +1 -0
- package/dist/glasses/useFlashPhase.d.ts.map +1 -0
- package/dist/glasses/useFlashPhase.js.map +1 -0
- package/dist/glasses/useGlasses.d.ts.map +1 -0
- package/dist/glasses/useGlasses.js.map +1 -0
- package/dist/web/components/app-shell.d.ts +15 -0
- package/dist/web/components/app-shell.d.ts.map +1 -0
- package/dist/web/components/app-shell.js +11 -0
- package/dist/web/components/app-shell.js.map +1 -0
- package/dist/web/components/audio-player.d.ts +9 -0
- package/dist/web/components/audio-player.d.ts.map +1 -0
- package/dist/web/components/audio-player.js +54 -0
- package/dist/web/components/audio-player.js.map +1 -0
- package/dist/web/components/badge.d.ts +11 -0
- package/dist/web/components/badge.d.ts.map +1 -0
- package/dist/web/components/badge.js +21 -0
- package/dist/web/components/badge.js.map +1 -0
- package/dist/web/components/bottom-sheet.d.ts +11 -0
- package/dist/web/components/bottom-sheet.d.ts.map +1 -0
- package/dist/web/components/bottom-sheet.js +33 -0
- package/dist/web/components/bottom-sheet.js.map +1 -0
- package/dist/web/components/button.d.ts +12 -0
- package/dist/web/components/button.d.ts.map +1 -0
- package/dist/web/components/button.js +29 -0
- package/dist/web/components/button.js.map +1 -0
- package/dist/web/components/calendar.d.ts +48 -0
- package/dist/web/components/calendar.d.ts.map +1 -0
- package/dist/web/components/calendar.js +86 -0
- package/dist/web/components/calendar.js.map +1 -0
- package/dist/web/components/card.d.ts +12 -0
- package/dist/web/components/card.d.ts.map +1 -0
- package/dist/web/components/card.js +27 -0
- package/dist/web/components/card.js.map +1 -0
- package/dist/web/components/category-filter.d.ts +10 -0
- package/dist/web/components/category-filter.d.ts.map +1 -0
- package/dist/web/components/category-filter.js +9 -0
- package/dist/web/components/category-filter.js.map +1 -0
- package/dist/web/components/chart.d.ts +65 -0
- package/dist/web/components/chart.d.ts.map +1 -0
- package/dist/web/components/chart.js +62 -0
- package/dist/web/components/chart.js.map +1 -0
- package/dist/web/components/chat.d.ts +79 -0
- package/dist/web/components/chat.d.ts.map +1 -0
- package/dist/web/components/chat.js +166 -0
- package/dist/web/components/chat.js.map +1 -0
- package/dist/web/components/checkbox.d.ts +11 -0
- package/dist/web/components/checkbox.d.ts.map +1 -0
- package/dist/web/components/checkbox.js +7 -0
- package/dist/web/components/checkbox.js.map +1 -0
- package/dist/web/components/confirm-dialog.d.ts +14 -0
- package/dist/web/components/confirm-dialog.d.ts.map +1 -0
- package/dist/web/components/confirm-dialog.js +37 -0
- package/dist/web/components/confirm-dialog.js.map +1 -0
- package/dist/web/components/cta-group.d.ts +16 -0
- package/dist/web/components/cta-group.d.ts.map +1 -0
- package/dist/web/components/cta-group.js +22 -0
- package/dist/web/components/cta-group.js.map +1 -0
- package/dist/web/components/dialog.d.ts +19 -0
- package/dist/web/components/dialog.d.ts.map +1 -0
- package/dist/web/components/dialog.js +35 -0
- package/dist/web/components/dialog.js.map +1 -0
- package/dist/web/components/divider.d.ts +11 -0
- package/dist/web/components/divider.d.ts.map +1 -0
- package/dist/web/components/divider.js +19 -0
- package/dist/web/components/divider.js.map +1 -0
- package/dist/web/components/empty-state.d.ts +15 -0
- package/dist/web/components/empty-state.d.ts.map +1 -0
- package/dist/web/components/empty-state.js +7 -0
- package/dist/web/components/empty-state.js.map +1 -0
- package/dist/web/components/file-upload.d.ts +12 -0
- package/dist/web/components/file-upload.d.ts.map +1 -0
- package/dist/web/components/file-upload.js +38 -0
- package/dist/web/components/file-upload.js.map +1 -0
- package/dist/web/components/image-viewer.d.ts +23 -0
- package/dist/web/components/image-viewer.d.ts.map +1 -0
- package/dist/web/components/image-viewer.js +29 -0
- package/dist/web/components/image-viewer.js.map +1 -0
- package/dist/web/components/indicator.d.ts +15 -0
- package/dist/web/components/indicator.d.ts.map +1 -0
- package/dist/web/components/indicator.js +12 -0
- package/dist/web/components/indicator.js.map +1 -0
- package/dist/web/components/input-group.d.ts +9 -0
- package/dist/web/components/input-group.d.ts.map +1 -0
- package/dist/web/components/input-group.js +27 -0
- package/dist/web/components/input-group.js.map +1 -0
- package/dist/web/components/input.d.ts +7 -0
- package/dist/web/components/input.d.ts.map +1 -0
- package/dist/web/components/input.js +7 -0
- package/dist/web/components/input.js.map +1 -0
- package/dist/web/components/kbd.d.ts +9 -0
- package/dist/web/components/kbd.d.ts.map +1 -0
- package/dist/web/components/kbd.js +7 -0
- package/dist/web/components/kbd.js.map +1 -0
- package/dist/web/components/list-item.d.ts +14 -0
- package/dist/web/components/list-item.d.ts.map +1 -0
- package/dist/web/components/list-item.js +57 -0
- package/dist/web/components/list-item.js.map +1 -0
- package/dist/web/components/loading.d.ts +8 -0
- package/dist/web/components/loading.d.ts.map +1 -0
- package/dist/web/components/loading.js +41 -0
- package/dist/web/components/loading.js.map +1 -0
- package/dist/web/components/nav-bar.d.ts +14 -0
- package/dist/web/components/nav-bar.d.ts.map +1 -0
- package/dist/web/components/nav-bar.js +9 -0
- package/dist/web/components/nav-bar.js.map +1 -0
- package/dist/web/components/nav-header.d.ts +11 -0
- package/dist/web/components/nav-header.d.ts.map +1 -0
- package/dist/web/components/nav-header.js +7 -0
- package/dist/web/components/nav-header.js.map +1 -0
- package/dist/web/components/page.d.ts +9 -0
- package/dist/web/components/page.d.ts.map +1 -0
- package/dist/web/components/page.js +7 -0
- package/dist/web/components/page.js.map +1 -0
- package/dist/web/components/pill.d.ts +9 -0
- package/dist/web/components/pill.d.ts.map +1 -0
- package/dist/web/components/pill.js +7 -0
- package/dist/web/components/pill.js.map +1 -0
- package/dist/web/components/progress.d.ts +8 -0
- package/dist/web/components/progress.d.ts.map +1 -0
- package/dist/web/components/progress.js +7 -0
- package/dist/web/components/progress.js.map +1 -0
- package/dist/web/components/radio-group.d.ts +16 -0
- package/dist/web/components/radio-group.d.ts.map +1 -0
- package/dist/web/components/radio-group.js +10 -0
- package/dist/web/components/radio-group.js.map +1 -0
- package/dist/web/components/screen-header.d.ts +11 -0
- package/dist/web/components/screen-header.d.ts.map +1 -0
- package/dist/web/components/screen-header.js +7 -0
- package/dist/web/components/screen-header.js.map +1 -0
- package/dist/web/components/scroll-picker.d.ts +66 -0
- package/dist/web/components/scroll-picker.d.ts.map +1 -0
- package/dist/web/components/scroll-picker.js +243 -0
- package/dist/web/components/scroll-picker.js.map +1 -0
- package/dist/web/components/search-bar.d.ts +9 -0
- package/dist/web/components/search-bar.d.ts.map +1 -0
- package/dist/web/components/search-bar.js +8 -0
- package/dist/web/components/search-bar.js.map +1 -0
- package/dist/web/components/section-header.d.ts +10 -0
- package/dist/web/components/section-header.d.ts.map +1 -0
- package/dist/web/components/section-header.js +7 -0
- package/dist/web/components/section-header.js.map +1 -0
- package/dist/web/components/segmented-control.d.ts +15 -0
- package/dist/web/components/segmented-control.d.ts.map +1 -0
- package/dist/web/components/segmented-control.js +9 -0
- package/dist/web/components/segmented-control.js.map +1 -0
- package/dist/web/components/select.d.ts +13 -0
- package/dist/web/components/select.d.ts.map +1 -0
- package/dist/web/components/select.js +7 -0
- package/dist/web/components/select.js.map +1 -0
- package/dist/web/components/settings-group.d.ts +10 -0
- package/dist/web/components/settings-group.d.ts.map +1 -0
- package/dist/web/components/settings-group.js +7 -0
- package/dist/web/components/settings-group.js.map +1 -0
- package/dist/web/components/skeleton.d.ts +13 -0
- package/dist/web/components/skeleton.d.ts.map +1 -0
- package/dist/web/components/skeleton.js +23 -0
- package/dist/web/components/skeleton.js.map +1 -0
- package/dist/web/components/slider.d.ts +16 -0
- package/dist/web/components/slider.d.ts.map +1 -0
- package/dist/web/components/slider.js +8 -0
- package/dist/web/components/slider.js.map +1 -0
- package/dist/web/components/stat-grid.d.ts +14 -0
- package/dist/web/components/stat-grid.d.ts.map +1 -0
- package/dist/web/components/stat-grid.js +7 -0
- package/dist/web/components/stat-grid.js.map +1 -0
- package/dist/web/components/status-dot.d.ts +8 -0
- package/dist/web/components/status-dot.d.ts.map +1 -0
- package/dist/web/components/status-dot.js +7 -0
- package/dist/web/components/status-dot.js.map +1 -0
- package/dist/web/components/status-progress.d.ts +13 -0
- package/dist/web/components/status-progress.d.ts.map +1 -0
- package/dist/web/components/status-progress.js +7 -0
- package/dist/web/components/status-progress.js.map +1 -0
- package/dist/web/components/step-indicator.d.ts +13 -0
- package/dist/web/components/step-indicator.d.ts.map +1 -0
- package/dist/web/components/step-indicator.js +10 -0
- package/dist/web/components/step-indicator.js.map +1 -0
- package/dist/web/components/table.d.ts +9 -0
- package/dist/web/components/table.d.ts.map +1 -0
- package/dist/web/components/table.js +17 -0
- package/dist/web/components/table.js.map +1 -0
- package/dist/web/components/tag.d.ts +25 -0
- package/dist/web/components/tag.d.ts.map +1 -0
- package/dist/web/components/tag.js +15 -0
- package/dist/web/components/tag.js.map +1 -0
- package/dist/web/components/textarea.d.ts +7 -0
- package/dist/web/components/textarea.d.ts.map +1 -0
- package/dist/web/components/textarea.js +7 -0
- package/dist/web/components/textarea.js.map +1 -0
- package/dist/web/components/timeline.d.ts +17 -0
- package/dist/web/components/timeline.d.ts.map +1 -0
- package/dist/web/components/timeline.js +7 -0
- package/dist/web/components/timeline.js.map +1 -0
- package/dist/web/components/timer-ring.d.ts +12 -0
- package/dist/web/components/timer-ring.d.ts.map +1 -0
- package/dist/web/components/timer-ring.js +15 -0
- package/dist/web/components/timer-ring.js.map +1 -0
- package/dist/web/components/toast.d.ts +14 -0
- package/dist/web/components/toast.d.ts.map +1 -0
- package/dist/web/components/toast.js +21 -0
- package/dist/web/components/toast.js.map +1 -0
- package/dist/web/components/toggle.d.ts +10 -0
- package/dist/web/components/toggle.d.ts.map +1 -0
- package/dist/web/components/toggle.js +21 -0
- package/dist/web/components/toggle.js.map +1 -0
- package/dist/web/components/voice-input.d.ts +17 -0
- package/dist/web/components/voice-input.d.ts.map +1 -0
- package/dist/web/components/voice-input.js +60 -0
- package/dist/web/components/voice-input.js.map +1 -0
- package/dist/web/icons/index.d.ts +29 -0
- package/dist/web/icons/index.d.ts.map +1 -0
- package/dist/web/icons/index.js +47 -0
- package/dist/web/icons/index.js.map +1 -0
- package/dist/web/icons/svg-catalog.d.ts +7 -0
- package/dist/web/icons/svg-catalog.d.ts.map +1 -0
- package/dist/web/icons/svg-catalog.js +1389 -0
- package/dist/web/icons/svg-catalog.js.map +1 -0
- package/dist/web/icons/svg-icons.d.ts +207 -0
- package/dist/web/icons/svg-icons.d.ts.map +1 -0
- package/dist/web/icons/svg-icons.js +398 -0
- package/dist/web/icons/svg-icons.js.map +1 -0
- package/dist/web/index.d.ts +107 -0
- package/dist/web/index.d.ts.map +1 -0
- package/dist/web/index.js +69 -0
- package/dist/web/index.js.map +1 -0
- package/dist/web/utils/cn.d.ts +3 -0
- package/dist/web/utils/cn.d.ts.map +1 -0
- package/dist/web/utils/cn.js +6 -0
- package/dist/web/utils/cn.js.map +1 -0
- package/package.json +289 -46
- package/web/components/app-shell.tsx +29 -0
- package/web/components/audio-player.tsx +117 -0
- package/web/components/badge.tsx +39 -0
- package/web/components/bottom-sheet.tsx +61 -0
- package/web/components/button.tsx +48 -0
- package/web/components/calendar.tsx +333 -0
- package/web/components/card.tsx +42 -0
- package/web/components/category-filter.tsx +33 -0
- package/web/components/chart.tsx +411 -0
- package/web/components/chat.tsx +494 -0
- package/web/components/checkbox.tsx +52 -0
- package/web/components/confirm-dialog.tsx +100 -0
- package/web/components/cta-group.tsx +85 -0
- package/web/components/dialog.tsx +94 -0
- package/web/components/divider.tsx +25 -0
- package/web/components/empty-state.tsx +32 -0
- package/web/components/file-upload.tsx +100 -0
- package/web/components/image-viewer.tsx +131 -0
- package/web/components/indicator.tsx +50 -0
- package/web/components/input-group.tsx +39 -0
- package/web/components/input.tsx +23 -0
- package/web/components/kbd.tsx +22 -0
- package/web/components/list-item.tsx +106 -0
- package/web/components/loading.tsx +79 -0
- package/web/components/nav-bar.tsx +43 -0
- package/web/components/nav-header.tsx +24 -0
- package/web/components/page.tsx +14 -0
- package/web/components/pill.tsx +32 -0
- package/web/components/progress.tsx +26 -0
- package/web/components/radio-group.tsx +59 -0
- package/web/components/screen-header.tsx +26 -0
- package/web/components/scroll-picker.tsx +508 -0
- package/web/components/search-bar.tsx +28 -0
- package/web/components/section-header.tsx +20 -0
- package/web/components/segmented-control.tsx +50 -0
- package/web/components/select.tsx +37 -0
- package/web/components/settings-group.tsx +22 -0
- package/web/components/skeleton.tsx +36 -0
- package/web/components/slider.tsx +69 -0
- package/web/components/stat-grid.tsx +40 -0
- package/web/components/status-dot.tsx +21 -0
- package/web/components/status-progress.tsx +56 -0
- package/web/components/step-indicator.tsx +52 -0
- package/web/components/table.tsx +70 -0
- package/web/components/tag.tsx +72 -0
- package/web/components/textarea.tsx +23 -0
- package/web/components/timeline.tsx +52 -0
- package/web/components/timer-ring.tsx +69 -0
- package/web/components/toast.tsx +38 -0
- package/web/components/toggle.tsx +58 -0
- package/web/components/voice-input.tsx +165 -0
- package/web/icons/README.md +38 -0
- package/web/icons/index.ts +61 -0
- package/web/icons/svg/edit-add.svg +13 -0
- package/web/icons/svg/edit-checklist.svg +3 -0
- package/web/icons/svg/edit-copy.svg +12 -0
- package/web/icons/svg/edit-cross-small.svg +10 -0
- package/web/icons/svg/edit-cross.svg +10 -0
- package/web/icons/svg/edit-cut.svg +10 -0
- package/web/icons/svg/edit-display-adj.svg +3 -0
- package/web/icons/svg/edit-dist-adj.svg +3 -0
- package/web/icons/svg/edit-dot-lists.svg +3 -0
- package/web/icons/svg/edit-edit.svg +3 -0
- package/web/icons/svg/edit-hight-adj.svg +3 -0
- package/web/icons/svg/edit-import.svg +10 -0
- package/web/icons/svg/edit-layout-settings.svg +10 -0
- package/web/icons/svg/edit-multi-selection.svg +10 -0
- package/web/icons/svg/edit-new.svg +3 -0
- package/web/icons/svg/edit-number-list.svg +3 -0
- package/web/icons/svg/edit-options.svg +10 -0
- package/web/icons/svg/edit-paste.svg +10 -0
- package/web/icons/svg/edit-pause.svg +10 -0
- package/web/icons/svg/edit-pin.svg +10 -0
- package/web/icons/svg/edit-play.svg +10 -0
- package/web/icons/svg/edit-redo.svg +10 -0
- package/web/icons/svg/edit-restore.svg +10 -0
- package/web/icons/svg/edit-settings.svg +3 -0
- package/web/icons/svg/edit-share.svg +3 -0
- package/web/icons/svg/edit-sweep.svg +10 -0
- package/web/icons/svg/edit-switch.svg +3 -0
- package/web/icons/svg/edit-trash.svg +10 -0
- package/web/icons/svg/edit-undo.svg +10 -0
- package/web/icons/svg/edit-unpin.svg +3 -0
- package/web/icons/svg/edit-upload-to-cloud.svg +3 -0
- package/web/icons/svg/edit-width.svg +3 -0
- package/web/icons/svg/feat-access-control.svg +10 -0
- package/web/icons/svg/feat-account.svg +10 -0
- package/web/icons/svg/feat-calendar.svg +3 -0
- package/web/icons/svg/feat-camera.svg +3 -0
- package/web/icons/svg/feat-direct-push.svg +3 -0
- package/web/icons/svg/feat-eis.svg +10 -0
- package/web/icons/svg/feat-email.svg +10 -0
- package/web/icons/svg/feat-even-ai.svg +3 -0
- package/web/icons/svg/feat-facial-scan.svg +3 -0
- package/web/icons/svg/feat-feedback.svg +3 -0
- package/web/icons/svg/feat-headup-angle.svg +10 -0
- package/web/icons/svg/feat-inbox.svg +10 -0
- package/web/icons/svg/feat-interface-settings.svg +3 -0
- package/web/icons/svg/feat-languages.svg +10 -0
- package/web/icons/svg/feat-learn-explore.svg +3 -0
- package/web/icons/svg/feat-menu.svg +3 -0
- package/web/icons/svg/feat-message.svg +10 -0
- package/web/icons/svg/feat-navigate.svg +10 -0
- package/web/icons/svg/feat-news.svg +10 -0
- package/web/icons/svg/feat-notification.svg +10 -0
- package/web/icons/svg/feat-personal-info.svg +10 -0
- package/web/icons/svg/feat-phone-call.svg +10 -0
- package/web/icons/svg/feat-phone-voice-input.svg +3 -0
- package/web/icons/svg/feat-privacy.svg +3 -0
- package/web/icons/svg/feat-qr-code.svg +3 -0
- package/web/icons/svg/feat-quick-note.svg +3 -0
- package/web/icons/svg/feat-scan.svg +3 -0
- package/web/icons/svg/feat-screen-off.svg +16 -0
- package/web/icons/svg/feat-services.svg +3 -0
- package/web/icons/svg/feat-stocks.svg +10 -0
- package/web/icons/svg/feat-study.svg +10 -0
- package/web/icons/svg/feat-teleprompt.svg +3 -0
- package/web/icons/svg/feat-theme.svg +10 -0
- package/web/icons/svg/feat-time-counting.svg +10 -0
- package/web/icons/svg/feat-transcribe.svg +3 -0
- package/web/icons/svg/feat-translate.svg +3 -0
- package/web/icons/svg/feat-voice-print.svg +10 -0
- package/web/icons/svg/feat-wear-detect.svg +3 -0
- package/web/icons/svg/feat-weather.svg +10 -0
- package/web/icons/svg/feat-wiki.svg +3 -0
- package/web/icons/svg/guide-back.svg +10 -0
- package/web/icons/svg/guide-chevron-drill-back.svg +10 -0
- package/web/icons/svg/guide-chevron-drill-down.svg +10 -0
- package/web/icons/svg/guide-chevron-drill-up.svg +10 -0
- package/web/icons/svg/guide-chevron-small-back.svg +10 -0
- package/web/icons/svg/guide-chevron-small-drill-back.svg +3 -0
- package/web/icons/svg/guide-chevron-small-drill-down.svg +10 -0
- package/web/icons/svg/guide-chevron-small-drill-in.svg +3 -0
- package/web/icons/svg/guide-chevron-small-drill-up.svg +10 -0
- package/web/icons/svg/guide-double-tap.svg +3 -0
- package/web/icons/svg/guide-go.svg +10 -0
- package/web/icons/svg/guide-long-press.svg +3 -0
- package/web/icons/svg/guide-maximize-card.svg +10 -0
- package/web/icons/svg/guide-maximize.svg +10 -0
- package/web/icons/svg/guide-minimize-card.svg +10 -0
- package/web/icons/svg/guide-minimize.svg +3 -0
- package/web/icons/svg/guide-search.svg +3 -0
- package/web/icons/svg/guide-shift-to-top.svg +10 -0
- package/web/icons/svg/guide-single-tap.svg +3 -0
- package/web/icons/svg/guide-swip.svg +3 -0
- package/web/icons/svg/health-HRV.svg +3 -0
- package/web/icons/svg/health-heart-rate.svg +3 -0
- package/web/icons/svg/health-lift-2.svg +3 -0
- package/web/icons/svg/health-lift-3.svg +3 -0
- package/web/icons/svg/health-lift.svg +3 -0
- package/web/icons/svg/health-run.svg +3 -0
- package/web/icons/svg/health-sleep.svg +10 -0
- package/web/icons/svg/health-spo2.svg +7 -0
- package/web/icons/svg/health-stand.svg +3 -0
- package/web/icons/svg/health-steps.svg +10 -0
- package/web/icons/svg/health-temperature.svg +3 -0
- package/web/icons/svg/health-walk.svg +3 -0
- package/web/icons/svg/menu-even-hub-highlighted.svg +10 -0
- package/web/icons/svg/menu-even-hub.svg +10 -0
- package/web/icons/svg/menu-gear-highlighted.svg +10 -0
- package/web/icons/svg/menu-gear.svg +10 -0
- package/web/icons/svg/menu-healt-highlighted.svg +10 -0
- package/web/icons/svg/menu-healt.svg +10 -0
- package/web/icons/svg/menu-home-highlighted.svg +10 -0
- package/web/icons/svg/menu-home.svg +10 -0
- package/web/icons/svg/nav-bicycle.svg +10 -0
- package/web/icons/svg/nav-bus.svg +10 -0
- package/web/icons/svg/nav-business.svg +10 -0
- package/web/icons/svg/nav-cloth-shop.svg +10 -0
- package/web/icons/svg/nav-coffee-shop.svg +10 -0
- package/web/icons/svg/nav-compass.svg +3 -0
- package/web/icons/svg/nav-crown.svg +3 -0
- package/web/icons/svg/nav-direction.svg +10 -0
- package/web/icons/svg/nav-end-location.svg +3 -0
- package/web/icons/svg/nav-flag.svg +3 -0
- package/web/icons/svg/nav-gift.svg +3 -0
- package/web/icons/svg/nav-groceries.svg +10 -0
- package/web/icons/svg/nav-home-address.svg +10 -0
- package/web/icons/svg/nav-hotel.svg +10 -0
- package/web/icons/svg/nav-location.svg +3 -0
- package/web/icons/svg/nav-office-address.svg +10 -0
- package/web/icons/svg/nav-relocate.svg +10 -0
- package/web/icons/svg/nav-restaurant.svg +10 -0
- package/web/icons/svg/nav-shopping.svg +3 -0
- package/web/icons/svg/nav-train.svg +10 -0
- package/web/icons/svg/nav-walk.svg +3 -0
- package/web/icons/svg/nav-zoom-in.svg +3 -0
- package/web/icons/svg/nav-zoom-out.svg +3 -0
- package/web/icons/svg/status-alert.svg +5 -0
- package/web/icons/svg/status-archived-file.svg +3 -0
- package/web/icons/svg/status-bad-pressed.svg +23 -0
- package/web/icons/svg/status-bad.svg +20 -0
- package/web/icons/svg/status-battery-50.svg +10 -0
- package/web/icons/svg/status-battery-75.svg +10 -0
- package/web/icons/svg/status-battery-dying.svg +15 -0
- package/web/icons/svg/status-battery-full.svg +10 -0
- package/web/icons/svg/status-battery-low.svg +10 -0
- package/web/icons/svg/status-bluetooth-disconnected.svg +3 -0
- package/web/icons/svg/status-bluetooth.svg +10 -0
- package/web/icons/svg/status-brightness-auto.svg +3 -0
- package/web/icons/svg/status-brightness.svg +3 -0
- package/web/icons/svg/status-case-battery.svg +3 -0
- package/web/icons/svg/status-case-charging.svg +14 -0
- package/web/icons/svg/status-case.svg +3 -0
- package/web/icons/svg/status-checkbox.svg +3 -0
- package/web/icons/svg/status-checkmark.svg +3 -0
- package/web/icons/svg/status-clickbox.svg +3 -0
- package/web/icons/svg/status-complete.svg +10 -0
- package/web/icons/svg/status-disconnected.svg +10 -0
- package/web/icons/svg/status-display-adj-off.svg +11 -0
- package/web/icons/svg/status-dot.svg +10 -0
- package/web/icons/svg/status-eye-closed.svg +3 -0
- package/web/icons/svg/status-eye-open.svg +3 -0
- package/web/icons/svg/status-faqs.svg +10 -0
- package/web/icons/svg/status-fast.svg +3 -0
- package/web/icons/svg/status-fav.svg +29 -0
- package/web/icons/svg/status-file.svg +10 -0
- package/web/icons/svg/status-first-floor.svg +3 -0
- package/web/icons/svg/status-glasses-battery.svg +3 -0
- package/web/icons/svg/status-glasses-charging.svg +17 -0
- package/web/icons/svg/status-glasses.svg +3 -0
- package/web/icons/svg/status-good-pressed.svg +29 -0
- package/web/icons/svg/status-good.svg +20 -0
- package/web/icons/svg/status-grabber.svg +10 -0
- package/web/icons/svg/status-head-up.svg +3 -0
- package/web/icons/svg/status-hint.svg +14 -0
- package/web/icons/svg/status-info.svg +10 -0
- package/web/icons/svg/status-login.svg +10 -0
- package/web/icons/svg/status-logout.svg +10 -0
- package/web/icons/svg/status-more.svg +3 -0
- package/web/icons/svg/status-network-error.svg +3 -0
- package/web/icons/svg/status-reset.svg +3 -0
- package/web/icons/svg/status-saved.svg +10 -0
- package/web/icons/svg/status-second-floor.svg +3 -0
- package/web/icons/svg/status-sele.svg +3 -0
- package/web/icons/svg/status-selected-box.svg +3 -0
- package/web/icons/svg/status-selected.svg +3 -0
- package/web/icons/svg/status-slow.svg +3 -0
- package/web/icons/svg/status-speaker-off.svg +3 -0
- package/web/icons/svg/status-speaker-on.svg +3 -0
- package/web/icons/svg/status-text-sizing.svg +3 -0
- package/web/icons/svg/status-unbind.svg +10 -0
- package/web/icons/svg/status-undisturb.svg +10 -0
- package/web/icons/svg/status-unfav.svg +3 -0
- package/web/icons/svg-catalog.ts +1390 -0
- package/web/icons/svg-icons.tsx +2166 -0
- package/web/index.ts +172 -0
- package/web/theme/tokens-dark.css +46 -0
- package/web/theme/tokens-light.css +46 -0
- package/web/theme/typography.css +57 -0
- package/web/theme/utilities.css +46 -0
- package/web/utils/cn.ts +6 -0
- package/dist/action-bar.d.ts.map +0 -1
- package/dist/action-bar.js.map +0 -1
- package/dist/action-map.d.ts.map +0 -1
- package/dist/action-map.js.map +0 -1
- package/dist/bridge.d.ts.map +0 -1
- package/dist/bridge.js.map +0 -1
- package/dist/canvas-renderer.d.ts.map +0 -1
- package/dist/canvas-renderer.js.map +0 -1
- package/dist/composer.d.ts.map +0 -1
- package/dist/composer.js.map +0 -1
- package/dist/gestures.d.ts.map +0 -1
- package/dist/gestures.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/keep-alive.d.ts.map +0 -1
- package/dist/keep-alive.js.map +0 -1
- package/dist/keyboard.d.ts.map +0 -1
- package/dist/keyboard.js.map +0 -1
- package/dist/layout.d.ts.map +0 -1
- package/dist/layout.js.map +0 -1
- package/dist/paginate-text.d.ts.map +0 -1
- package/dist/paginate-text.js.map +0 -1
- package/dist/png-utils.d.ts.map +0 -1
- package/dist/png-utils.js.map +0 -1
- package/dist/splash.d.ts.map +0 -1
- package/dist/splash.js.map +0 -1
- package/dist/text-clean.d.ts.map +0 -1
- package/dist/text-clean.js.map +0 -1
- package/dist/text-utils.d.ts.map +0 -1
- package/dist/text-utils.js.map +0 -1
- package/dist/timer-display.d.ts.map +0 -1
- package/dist/timer-display.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/useFlashPhase.d.ts.map +0 -1
- package/dist/useFlashPhase.js.map +0 -1
- package/dist/useGlasses.d.ts.map +0 -1
- package/dist/useGlasses.js.map +0 -1
- /package/dist/{action-bar.d.ts → glasses/action-bar.d.ts} +0 -0
- /package/dist/{action-bar.js → glasses/action-bar.js} +0 -0
- /package/dist/{action-map.d.ts → glasses/action-map.d.ts} +0 -0
- /package/dist/{action-map.js → glasses/action-map.js} +0 -0
- /package/dist/{bridge.d.ts → glasses/bridge.d.ts} +0 -0
- /package/dist/{bridge.js → glasses/bridge.js} +0 -0
- /package/dist/{canvas-renderer.d.ts → glasses/canvas-renderer.d.ts} +0 -0
- /package/dist/{canvas-renderer.js → glasses/canvas-renderer.js} +0 -0
- /package/dist/{composer.d.ts → glasses/composer.d.ts} +0 -0
- /package/dist/{composer.js → glasses/composer.js} +0 -0
- /package/dist/{gestures.d.ts → glasses/gestures.d.ts} +0 -0
- /package/dist/{gestures.js → glasses/gestures.js} +0 -0
- /package/dist/{index.d.ts → glasses/index.d.ts} +0 -0
- /package/dist/{index.js → glasses/index.js} +0 -0
- /package/dist/{keep-alive.d.ts → glasses/keep-alive.d.ts} +0 -0
- /package/dist/{keep-alive.js → glasses/keep-alive.js} +0 -0
- /package/dist/{keyboard.d.ts → glasses/keyboard.d.ts} +0 -0
- /package/dist/{keyboard.js → glasses/keyboard.js} +0 -0
- /package/dist/{layout.d.ts → glasses/layout.d.ts} +0 -0
- /package/dist/{layout.js → glasses/layout.js} +0 -0
- /package/dist/{paginate-text.d.ts → glasses/paginate-text.d.ts} +0 -0
- /package/dist/{paginate-text.js → glasses/paginate-text.js} +0 -0
- /package/dist/{png-utils.d.ts → glasses/png-utils.d.ts} +0 -0
- /package/dist/{png-utils.js → glasses/png-utils.js} +0 -0
- /package/dist/{splash.d.ts → glasses/splash.d.ts} +0 -0
- /package/dist/{splash.js → glasses/splash.js} +0 -0
- /package/dist/{text-clean.d.ts → glasses/text-clean.d.ts} +0 -0
- /package/dist/{text-clean.js → glasses/text-clean.js} +0 -0
- /package/dist/{text-utils.d.ts → glasses/text-utils.d.ts} +0 -0
- /package/dist/{text-utils.js → glasses/text-utils.js} +0 -0
- /package/dist/{timer-display.d.ts → glasses/timer-display.d.ts} +0 -0
- /package/dist/{timer-display.js → glasses/timer-display.js} +0 -0
- /package/dist/{types.d.ts → glasses/types.d.ts} +0 -0
- /package/dist/{types.js → glasses/types.js} +0 -0
- /package/dist/{useFlashPhase.d.ts → glasses/useFlashPhase.d.ts} +0 -0
- /package/dist/{useFlashPhase.js → glasses/useFlashPhase.js} +0 -0
- /package/dist/{useGlasses.d.ts → glasses/useGlasses.d.ts} +0 -0
- /package/dist/{useGlasses.js → glasses/useGlasses.js} +0 -0
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { cn } from '../utils/cn';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
// ─── Types ──────────────────────────────────────────────────────
|
|
6
|
+
|
|
7
|
+
export interface ToolCall {
|
|
8
|
+
name: string;
|
|
9
|
+
input?: string;
|
|
10
|
+
output?: string;
|
|
11
|
+
status?: 'running' | 'complete' | 'error';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface CodeBlock {
|
|
15
|
+
language?: string;
|
|
16
|
+
content: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface ChatMessage {
|
|
20
|
+
id: string;
|
|
21
|
+
role: 'user' | 'assistant' | 'system';
|
|
22
|
+
content: string;
|
|
23
|
+
timestamp?: number;
|
|
24
|
+
thinking?: string;
|
|
25
|
+
isStreaming?: boolean;
|
|
26
|
+
toolCalls?: ToolCall[];
|
|
27
|
+
codeBlocks?: CodeBlock[];
|
|
28
|
+
diff?: string;
|
|
29
|
+
error?: string;
|
|
30
|
+
command?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// ─── ChatThinking ───────────────────────────────────────────────
|
|
34
|
+
|
|
35
|
+
interface ChatThinkingProps {
|
|
36
|
+
content: string;
|
|
37
|
+
className?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function ChatThinking({ content, className }: ChatThinkingProps) {
|
|
41
|
+
const [expanded, setExpanded] = React.useState(false);
|
|
42
|
+
const summary = content.length > 80 ? content.slice(0, 80) + '...' : content;
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<button
|
|
46
|
+
type="button"
|
|
47
|
+
onClick={() => setExpanded(!expanded)}
|
|
48
|
+
className={cn('text-left w-full', className)}
|
|
49
|
+
>
|
|
50
|
+
<div className="flex items-center gap-1 text-[13px] tracking-[-0.13px] text-text-dim cursor-pointer hover:text-text transition-colors">
|
|
51
|
+
<span>{expanded ? '\u25BE' : '\u25B8'}</span>
|
|
52
|
+
<span className="italic">Thinking...</span>
|
|
53
|
+
</div>
|
|
54
|
+
{expanded && (
|
|
55
|
+
<div className="border-l-2 border-accent pl-3 py-1 mt-1 text-[13px] tracking-[-0.13px] text-text-dim italic whitespace-pre-wrap">
|
|
56
|
+
{content}
|
|
57
|
+
</div>
|
|
58
|
+
)}
|
|
59
|
+
{!expanded && (
|
|
60
|
+
<div className="border-l-2 border-accent pl-3 py-1 mt-1 text-[11px] tracking-[-0.11px] text-text-muted truncate">
|
|
61
|
+
{summary}
|
|
62
|
+
</div>
|
|
63
|
+
)}
|
|
64
|
+
</button>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// ─── ChatCodeBlock ──────────────────────────────────────────────
|
|
69
|
+
|
|
70
|
+
interface ChatCodeBlockProps {
|
|
71
|
+
language?: string;
|
|
72
|
+
content: string;
|
|
73
|
+
className?: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function ChatCodeBlock({ language, content, className }: ChatCodeBlockProps) {
|
|
77
|
+
const lines = content.split('\n');
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<div className={cn('bg-surface-lighter rounded-[6px] overflow-hidden', className)}>
|
|
81
|
+
{language && (
|
|
82
|
+
<div className="px-3 py-1.5 text-[11px] tracking-[-0.11px] text-text-muted border-b border-border/30">
|
|
83
|
+
{language}
|
|
84
|
+
</div>
|
|
85
|
+
)}
|
|
86
|
+
<div className="overflow-x-auto">
|
|
87
|
+
<pre className="px-3 py-2 font-mono text-[13px] tracking-[-0.13px] text-text leading-5">
|
|
88
|
+
{lines.map((line, i) => (
|
|
89
|
+
<div key={i} className="flex">
|
|
90
|
+
<span className="w-8 shrink-0 text-right pr-3 text-text-muted select-none">{i + 1}</span>
|
|
91
|
+
<span className="whitespace-pre-wrap break-all">{line}</span>
|
|
92
|
+
</div>
|
|
93
|
+
))}
|
|
94
|
+
</pre>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// ─── ChatDiff ───────────────────────────────────────────────────
|
|
101
|
+
|
|
102
|
+
interface ChatDiffProps {
|
|
103
|
+
content: string;
|
|
104
|
+
className?: string;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function ChatDiff({ content, className }: ChatDiffProps) {
|
|
108
|
+
const lines = content.split('\n');
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<div className={cn('rounded-[6px] overflow-hidden font-mono text-[13px] tracking-[-0.13px]', className)}>
|
|
112
|
+
{lines.map((line, i) => {
|
|
113
|
+
let bg = '';
|
|
114
|
+
let textColor = 'text-text';
|
|
115
|
+
if (line.startsWith('@@')) {
|
|
116
|
+
bg = 'bg-accent/10';
|
|
117
|
+
textColor = 'text-accent';
|
|
118
|
+
} else if (line.startsWith('+')) {
|
|
119
|
+
bg = 'bg-positive/10';
|
|
120
|
+
textColor = 'text-positive';
|
|
121
|
+
} else if (line.startsWith('-')) {
|
|
122
|
+
bg = 'bg-negative/10';
|
|
123
|
+
textColor = 'text-negative';
|
|
124
|
+
}
|
|
125
|
+
return (
|
|
126
|
+
<div key={i} className={cn('px-3 py-0.5 whitespace-pre-wrap', bg, textColor)}>
|
|
127
|
+
{line}
|
|
128
|
+
</div>
|
|
129
|
+
);
|
|
130
|
+
})}
|
|
131
|
+
</div>
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// ─── ChatToolCall ───────────────────────────────────────────────
|
|
136
|
+
|
|
137
|
+
interface ChatToolCallProps {
|
|
138
|
+
toolCall: ToolCall;
|
|
139
|
+
className?: string;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function ChatToolCall({ toolCall, className }: ChatToolCallProps) {
|
|
143
|
+
const [expanded, setExpanded] = React.useState(false);
|
|
144
|
+
|
|
145
|
+
return (
|
|
146
|
+
<div className={cn('bg-surface-lighter rounded-[6px] overflow-hidden', className)}>
|
|
147
|
+
<button
|
|
148
|
+
type="button"
|
|
149
|
+
onClick={() => setExpanded(!expanded)}
|
|
150
|
+
className="w-full flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-surface-light/50 transition-colors"
|
|
151
|
+
>
|
|
152
|
+
{/* Status indicator */}
|
|
153
|
+
{toolCall.status === 'running' && (
|
|
154
|
+
<div className="w-3 h-3 animate-spin rounded-full border border-surface-lighter border-t-accent shrink-0" />
|
|
155
|
+
)}
|
|
156
|
+
{toolCall.status === 'complete' && (
|
|
157
|
+
<svg viewBox="0 0 12 12" className="w-3 h-3 text-positive shrink-0"><rect x={2} y={6} width={2} height={2} fill="currentColor" /><rect x={4} y={8} width={2} height={2} fill="currentColor" /><rect x={6} y={6} width={2} height={2} fill="currentColor" /><rect x={8} y={4} width={2} height={2} fill="currentColor" /></svg>
|
|
158
|
+
)}
|
|
159
|
+
{toolCall.status === 'error' && (
|
|
160
|
+
<svg viewBox="0 0 12 12" className="w-3 h-3 text-negative shrink-0"><rect x={2} y={2} width={2} height={2} fill="currentColor" /><rect x={4} y={4} width={2} height={2} fill="currentColor" /><rect x={6} y={6} width={2} height={2} fill="currentColor" /><rect x={8} y={8} width={2} height={2} fill="currentColor" /><rect x={8} y={2} width={2} height={2} fill="currentColor" /><rect x={6} y={4} width={2} height={2} fill="currentColor" /><rect x={4} y={6} width={2} height={2} fill="currentColor" /><rect x={2} y={8} width={2} height={2} fill="currentColor" /></svg>
|
|
161
|
+
)}
|
|
162
|
+
{!toolCall.status && (
|
|
163
|
+
<svg viewBox="0 0 12 12" className="w-3 h-3 text-text-dim shrink-0"><rect x={1} y={3} width={4} height={2} fill="currentColor" /><rect x={3} y={5} width={2} height={2} fill="currentColor" /><rect x={5} y={5} width={4} height={2} fill="currentColor" /><rect x={7} y={7} width={2} height={2} fill="currentColor" /></svg>
|
|
164
|
+
)}
|
|
165
|
+
<span className="font-mono text-[13px] tracking-[-0.13px] text-text">{toolCall.name}</span>
|
|
166
|
+
<span className="ml-auto text-[11px] text-text-muted">{expanded ? '\u25BE' : '\u25B8'}</span>
|
|
167
|
+
</button>
|
|
168
|
+
{expanded && (
|
|
169
|
+
<div className="border-t border-border/30 px-3 py-2 font-mono text-[13px] tracking-[-0.13px]">
|
|
170
|
+
{toolCall.input && (
|
|
171
|
+
<div className="mb-2">
|
|
172
|
+
<div className="text-[11px] text-text-muted mb-1">Input</div>
|
|
173
|
+
<pre className="whitespace-pre-wrap text-text-dim">{toolCall.input}</pre>
|
|
174
|
+
</div>
|
|
175
|
+
)}
|
|
176
|
+
{toolCall.output && (
|
|
177
|
+
<div>
|
|
178
|
+
<div className="text-[11px] text-text-muted mb-1">Output</div>
|
|
179
|
+
<pre className="whitespace-pre-wrap text-text-dim">{toolCall.output}</pre>
|
|
180
|
+
</div>
|
|
181
|
+
)}
|
|
182
|
+
</div>
|
|
183
|
+
)}
|
|
184
|
+
</div>
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// ─── ChatCommand ────────────────────────────────────────────────
|
|
189
|
+
|
|
190
|
+
interface ChatCommandProps {
|
|
191
|
+
command: string;
|
|
192
|
+
output?: string;
|
|
193
|
+
className?: string;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function ChatCommand({ command, output, className }: ChatCommandProps) {
|
|
197
|
+
return (
|
|
198
|
+
<div className={cn('font-mono text-[13px] tracking-[-0.13px]', className)}>
|
|
199
|
+
<div className="flex items-center gap-1 text-text">
|
|
200
|
+
<span className="text-text-dim">$</span>
|
|
201
|
+
<span>{command}</span>
|
|
202
|
+
</div>
|
|
203
|
+
{output && (
|
|
204
|
+
<pre className="whitespace-pre-wrap text-text-dim mt-1">{output}</pre>
|
|
205
|
+
)}
|
|
206
|
+
</div>
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// ─── ChatError ──────────────────────────────────────────────────
|
|
211
|
+
|
|
212
|
+
interface ChatErrorProps {
|
|
213
|
+
message: string;
|
|
214
|
+
className?: string;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function ChatError({ message, className }: ChatErrorProps) {
|
|
218
|
+
return (
|
|
219
|
+
<div className={cn('bg-negative/10 text-negative rounded-[6px] px-3 py-2 text-[13px] tracking-[-0.13px]', className)}>
|
|
220
|
+
{message}
|
|
221
|
+
</div>
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// ─── Content Parser ─────────────────────────────────────────────
|
|
226
|
+
|
|
227
|
+
function parseAssistantContent(content: string): ReactNode[] {
|
|
228
|
+
const blocks: ReactNode[] = [];
|
|
229
|
+
const lines = content.split('\n');
|
|
230
|
+
let i = 0;
|
|
231
|
+
let textBuffer: string[] = [];
|
|
232
|
+
|
|
233
|
+
const flushText = () => {
|
|
234
|
+
if (textBuffer.length > 0) {
|
|
235
|
+
blocks.push(<span key={`t-${blocks.length}`}>{textBuffer.join('\n')}</span>);
|
|
236
|
+
textBuffer = [];
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
while (i < lines.length) {
|
|
241
|
+
const line = lines[i];
|
|
242
|
+
|
|
243
|
+
// Code fence
|
|
244
|
+
if (line.startsWith('```')) {
|
|
245
|
+
flushText();
|
|
246
|
+
const lang = line.slice(3).trim() || undefined;
|
|
247
|
+
const codeLines: string[] = [];
|
|
248
|
+
i++;
|
|
249
|
+
while (i < lines.length && !lines[i].startsWith('```')) {
|
|
250
|
+
codeLines.push(lines[i]);
|
|
251
|
+
i++;
|
|
252
|
+
}
|
|
253
|
+
blocks.push(<ChatCodeBlock key={`c-${blocks.length}`} language={lang} content={codeLines.join('\n')} />);
|
|
254
|
+
i++; // skip closing ```
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// Diff block (consecutive +/- lines)
|
|
259
|
+
if ((line.startsWith('@@') || line.startsWith('+') || line.startsWith('-')) && i + 1 < lines.length) {
|
|
260
|
+
const diffStart = i;
|
|
261
|
+
const diffLines: string[] = [];
|
|
262
|
+
while (i < lines.length && (lines[i].startsWith('@@') || lines[i].startsWith('+') || lines[i].startsWith('-') || lines[i].startsWith(' '))) {
|
|
263
|
+
diffLines.push(lines[i]);
|
|
264
|
+
i++;
|
|
265
|
+
// Stop if we've captured a meaningful diff (at least 2 lines starting with +/-)
|
|
266
|
+
if (diffLines.length > 1 && i < lines.length && !lines[i].startsWith('@@') && !lines[i].startsWith('+') && !lines[i].startsWith('-') && !lines[i].startsWith(' ')) break;
|
|
267
|
+
}
|
|
268
|
+
if (diffLines.length >= 2 && diffLines.some(l => l.startsWith('+') || l.startsWith('-'))) {
|
|
269
|
+
flushText();
|
|
270
|
+
blocks.push(<ChatDiff key={`d-${blocks.length}`} content={diffLines.join('\n')} />);
|
|
271
|
+
continue;
|
|
272
|
+
}
|
|
273
|
+
// Not a real diff, treat as text
|
|
274
|
+
i = diffStart;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// Tool call line: >> toolName
|
|
278
|
+
if (line.startsWith('>> ')) {
|
|
279
|
+
flushText();
|
|
280
|
+
const name = line.slice(3).trim();
|
|
281
|
+
blocks.push(<ChatToolCall key={`tc-${blocks.length}`} toolCall={{ name, status: 'complete' }} />);
|
|
282
|
+
i++;
|
|
283
|
+
continue;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// Error line: ! message
|
|
287
|
+
if (line.startsWith('! ')) {
|
|
288
|
+
flushText();
|
|
289
|
+
blocks.push(<ChatError key={`e-${blocks.length}`} message={line.slice(2)} />);
|
|
290
|
+
i++;
|
|
291
|
+
continue;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// Command line: $ command
|
|
295
|
+
if (line.startsWith('$ ')) {
|
|
296
|
+
flushText();
|
|
297
|
+
blocks.push(<ChatCommand key={`cmd-${blocks.length}`} command={line.slice(2)} />);
|
|
298
|
+
i++;
|
|
299
|
+
continue;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
textBuffer.push(line);
|
|
303
|
+
i++;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
flushText();
|
|
307
|
+
return blocks;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// ─── ChatBubble ─────────────────────────────────────────────────
|
|
311
|
+
|
|
312
|
+
interface ChatBubbleProps {
|
|
313
|
+
message: ChatMessage;
|
|
314
|
+
className?: string;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
function ChatBubble({ message, className }: ChatBubbleProps) {
|
|
318
|
+
const { role, content, thinking, isStreaming, toolCalls, codeBlocks, diff, error, command, timestamp } = message;
|
|
319
|
+
|
|
320
|
+
if (role === 'system') {
|
|
321
|
+
return (
|
|
322
|
+
<div className={cn('flex justify-center py-2', className)}>
|
|
323
|
+
<span className="text-[13px] tracking-[-0.13px] text-text-dim">{content}</span>
|
|
324
|
+
</div>
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
const isUser = role === 'user';
|
|
329
|
+
|
|
330
|
+
return (
|
|
331
|
+
<div className={cn('flex', isUser ? 'justify-end' : 'justify-start', 'mb-3', className)}>
|
|
332
|
+
<div className="max-w-[85%] flex flex-col gap-1.5">
|
|
333
|
+
{/* Thinking block */}
|
|
334
|
+
{thinking && <ChatThinking content={thinking} />}
|
|
335
|
+
|
|
336
|
+
{/* Main bubble */}
|
|
337
|
+
<div
|
|
338
|
+
className={cn(
|
|
339
|
+
'px-4 py-3 text-[15px] tracking-[-0.15px]',
|
|
340
|
+
isUser
|
|
341
|
+
? 'bg-accent text-text-highlight rounded-[6px] rounded-br-none'
|
|
342
|
+
: 'bg-surface text-text rounded-[6px] rounded-bl-none',
|
|
343
|
+
)}
|
|
344
|
+
>
|
|
345
|
+
{isUser ? content : (
|
|
346
|
+
<div className="flex flex-col gap-2">
|
|
347
|
+
{parseAssistantContent(content)}
|
|
348
|
+
</div>
|
|
349
|
+
)}
|
|
350
|
+
{isStreaming && (
|
|
351
|
+
<span className="inline-block w-[2px] h-[15px] bg-current ml-0.5 animate-pulse align-text-bottom" />
|
|
352
|
+
)}
|
|
353
|
+
</div>
|
|
354
|
+
|
|
355
|
+
{/* Code blocks (explicit) */}
|
|
356
|
+
{codeBlocks?.map((cb, i) => (
|
|
357
|
+
<ChatCodeBlock key={`cb-${i}`} language={cb.language} content={cb.content} />
|
|
358
|
+
))}
|
|
359
|
+
|
|
360
|
+
{/* Diff (explicit) */}
|
|
361
|
+
{diff && <ChatDiff content={diff} />}
|
|
362
|
+
|
|
363
|
+
{/* Command (explicit) */}
|
|
364
|
+
{command && <ChatCommand command={command} />}
|
|
365
|
+
|
|
366
|
+
{/* Tool calls */}
|
|
367
|
+
{toolCalls?.map((tc, i) => (
|
|
368
|
+
<ChatToolCall key={`tc-${i}`} toolCall={tc} />
|
|
369
|
+
))}
|
|
370
|
+
|
|
371
|
+
{/* Error */}
|
|
372
|
+
{error && <ChatError message={error} />}
|
|
373
|
+
|
|
374
|
+
{/* Timestamp */}
|
|
375
|
+
{timestamp && (
|
|
376
|
+
<span className={cn('text-[11px] tracking-[-0.11px] text-text-muted', isUser ? 'text-right' : 'text-left')}>
|
|
377
|
+
{new Date(timestamp).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}
|
|
378
|
+
</span>
|
|
379
|
+
)}
|
|
380
|
+
</div>
|
|
381
|
+
</div>
|
|
382
|
+
);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
// ─── ChatInput ──────────────────────────────────────────────────
|
|
386
|
+
|
|
387
|
+
interface ChatInputProps {
|
|
388
|
+
value: string;
|
|
389
|
+
onChange: (value: string) => void;
|
|
390
|
+
onSend: () => void;
|
|
391
|
+
placeholder?: string;
|
|
392
|
+
disabled?: boolean;
|
|
393
|
+
className?: string;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
function ChatInput({ value, onChange, onSend, placeholder = 'Type a message...', disabled, className }: ChatInputProps) {
|
|
397
|
+
const textareaRef = React.useRef<HTMLTextAreaElement>(null);
|
|
398
|
+
|
|
399
|
+
const handleKeyDown = (e: React.KeyboardEvent) => {
|
|
400
|
+
if (e.key === 'Enter' && !e.shiftKey) {
|
|
401
|
+
e.preventDefault();
|
|
402
|
+
if (value.trim()) onSend();
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
|
|
406
|
+
// Auto-grow textarea
|
|
407
|
+
React.useEffect(() => {
|
|
408
|
+
const ta = textareaRef.current;
|
|
409
|
+
if (ta) {
|
|
410
|
+
ta.style.height = '0';
|
|
411
|
+
ta.style.height = Math.min(ta.scrollHeight, 120) + 'px';
|
|
412
|
+
}
|
|
413
|
+
}, [value]);
|
|
414
|
+
|
|
415
|
+
return (
|
|
416
|
+
<div className={cn('flex items-end gap-2 p-3 bg-bg', className)}>
|
|
417
|
+
<textarea
|
|
418
|
+
ref={textareaRef}
|
|
419
|
+
value={value}
|
|
420
|
+
onChange={(e) => onChange(e.target.value)}
|
|
421
|
+
onKeyDown={handleKeyDown}
|
|
422
|
+
placeholder={placeholder}
|
|
423
|
+
disabled={disabled}
|
|
424
|
+
rows={1}
|
|
425
|
+
className="flex-1 bg-input-bg text-text rounded-[6px] px-4 py-3 text-[15px] tracking-[-0.15px] outline-none placeholder:text-text-dim resize-none min-h-[44px] max-h-[120px]"
|
|
426
|
+
/>
|
|
427
|
+
<button
|
|
428
|
+
type="button"
|
|
429
|
+
onClick={onSend}
|
|
430
|
+
disabled={disabled || !value.trim()}
|
|
431
|
+
className="shrink-0 h-11 w-11 rounded-[6px] bg-accent text-text-highlight flex items-center justify-center cursor-pointer disabled:opacity-50 disabled:pointer-events-none transition-colors"
|
|
432
|
+
>
|
|
433
|
+
<svg viewBox="0 0 24 24" className="w-5 h-5" fill="none">
|
|
434
|
+
<rect x={10} y={4} width={2} height={2} fill="currentColor" />
|
|
435
|
+
<rect x={10} y={6} width={2} height={2} fill="currentColor" />
|
|
436
|
+
<rect x={10} y={8} width={2} height={2} fill="currentColor" />
|
|
437
|
+
<rect x={10} y={10} width={2} height={2} fill="currentColor" />
|
|
438
|
+
<rect x={10} y={12} width={2} height={2} fill="currentColor" />
|
|
439
|
+
<rect x={10} y={14} width={2} height={2} fill="currentColor" />
|
|
440
|
+
<rect x={10} y={16} width={2} height={2} fill="currentColor" />
|
|
441
|
+
<rect x={8} y={6} width={2} height={2} fill="currentColor" />
|
|
442
|
+
<rect x={12} y={6} width={2} height={2} fill="currentColor" />
|
|
443
|
+
<rect x={6} y={8} width={2} height={2} fill="currentColor" />
|
|
444
|
+
<rect x={14} y={8} width={2} height={2} fill="currentColor" />
|
|
445
|
+
</svg>
|
|
446
|
+
</button>
|
|
447
|
+
</div>
|
|
448
|
+
);
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
// ─── ChatContainer ──────────────────────────────────────────────
|
|
452
|
+
|
|
453
|
+
interface ChatContainerProps {
|
|
454
|
+
messages: ChatMessage[];
|
|
455
|
+
input?: ReactNode;
|
|
456
|
+
className?: string;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
function ChatContainer({ messages, input, className }: ChatContainerProps) {
|
|
460
|
+
const listRef = React.useRef<HTMLDivElement>(null);
|
|
461
|
+
const [autoScroll, setAutoScroll] = React.useState(true);
|
|
462
|
+
|
|
463
|
+
// Auto-scroll to bottom
|
|
464
|
+
React.useEffect(() => {
|
|
465
|
+
if (autoScroll && listRef.current) {
|
|
466
|
+
listRef.current.scrollTop = listRef.current.scrollHeight;
|
|
467
|
+
}
|
|
468
|
+
}, [messages, autoScroll]);
|
|
469
|
+
|
|
470
|
+
const handleScroll = () => {
|
|
471
|
+
const el = listRef.current;
|
|
472
|
+
if (!el) return;
|
|
473
|
+
const atBottom = el.scrollHeight - el.scrollTop - el.clientHeight < 40;
|
|
474
|
+
setAutoScroll(atBottom);
|
|
475
|
+
};
|
|
476
|
+
|
|
477
|
+
return (
|
|
478
|
+
<div className={cn('flex flex-col h-full', className)}>
|
|
479
|
+
<div
|
|
480
|
+
ref={listRef}
|
|
481
|
+
onScroll={handleScroll}
|
|
482
|
+
className="flex-1 overflow-y-auto px-3 py-4"
|
|
483
|
+
>
|
|
484
|
+
{messages.map((msg) => (
|
|
485
|
+
<ChatBubble key={msg.id} message={msg} />
|
|
486
|
+
))}
|
|
487
|
+
</div>
|
|
488
|
+
{input}
|
|
489
|
+
</div>
|
|
490
|
+
);
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
export { ChatContainer, ChatBubble, ChatInput, ChatThinking, ChatCodeBlock, ChatDiff, ChatToolCall, ChatCommand, ChatError };
|
|
494
|
+
export type { ChatContainerProps, ChatBubbleProps, ChatInputProps };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { cn } from '../utils/cn';
|
|
2
|
+
|
|
3
|
+
interface CheckboxProps {
|
|
4
|
+
checked: boolean;
|
|
5
|
+
onChange: (checked: boolean) => void;
|
|
6
|
+
label?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function Checkbox({ checked, onChange, label, disabled, className }: CheckboxProps) {
|
|
12
|
+
return (
|
|
13
|
+
<label
|
|
14
|
+
className={cn(
|
|
15
|
+
'inline-flex items-center gap-3 cursor-pointer select-none',
|
|
16
|
+
disabled && 'opacity-50 pointer-events-none',
|
|
17
|
+
className,
|
|
18
|
+
)}
|
|
19
|
+
>
|
|
20
|
+
<button
|
|
21
|
+
type="button"
|
|
22
|
+
role="checkbox"
|
|
23
|
+
aria-checked={checked}
|
|
24
|
+
disabled={disabled}
|
|
25
|
+
onClick={() => onChange(!checked)}
|
|
26
|
+
className={cn(
|
|
27
|
+
'relative shrink-0 w-5 h-5 rounded-[4px] transition-colors cursor-pointer',
|
|
28
|
+
checked ? 'bg-accent' : 'bg-surface-lighter',
|
|
29
|
+
)}
|
|
30
|
+
>
|
|
31
|
+
{checked && (
|
|
32
|
+
<svg
|
|
33
|
+
viewBox="0 0 12 12"
|
|
34
|
+
className="absolute inset-0 w-full h-full p-0.5"
|
|
35
|
+
fill="none"
|
|
36
|
+
>
|
|
37
|
+
<rect x={2} y={5} width={2} height={2} fill="var(--color-text-highlight)" />
|
|
38
|
+
<rect x={4} y={7} width={2} height={2} fill="var(--color-text-highlight)" />
|
|
39
|
+
<rect x={6} y={5} width={2} height={2} fill="var(--color-text-highlight)" />
|
|
40
|
+
<rect x={8} y={3} width={2} height={2} fill="var(--color-text-highlight)" />
|
|
41
|
+
</svg>
|
|
42
|
+
)}
|
|
43
|
+
</button>
|
|
44
|
+
{label && (
|
|
45
|
+
<span className="text-[15px] tracking-[-0.15px] text-text">{label}</span>
|
|
46
|
+
)}
|
|
47
|
+
</label>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export { Checkbox };
|
|
52
|
+
export type { CheckboxProps };
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { cn } from '../utils/cn';
|
|
3
|
+
|
|
4
|
+
interface ConfirmDialogProps {
|
|
5
|
+
open: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
onConfirm: () => void;
|
|
8
|
+
title: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
confirmLabel?: string;
|
|
11
|
+
cancelLabel?: string;
|
|
12
|
+
variant?: 'default' | 'danger';
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function ConfirmDialog({
|
|
16
|
+
open,
|
|
17
|
+
onClose,
|
|
18
|
+
onConfirm,
|
|
19
|
+
title,
|
|
20
|
+
description,
|
|
21
|
+
confirmLabel = 'Confirm',
|
|
22
|
+
cancelLabel = 'Cancel',
|
|
23
|
+
variant = 'default',
|
|
24
|
+
}: ConfirmDialogProps) {
|
|
25
|
+
const [visible, setVisible] = React.useState(false);
|
|
26
|
+
const [closing, setClosing] = React.useState(false);
|
|
27
|
+
|
|
28
|
+
React.useEffect(() => {
|
|
29
|
+
if (open) {
|
|
30
|
+
setVisible(true);
|
|
31
|
+
setClosing(false);
|
|
32
|
+
} else if (visible) {
|
|
33
|
+
setClosing(true);
|
|
34
|
+
const timer = setTimeout(() => { setVisible(false); setClosing(false); }, 200);
|
|
35
|
+
return () => clearTimeout(timer);
|
|
36
|
+
}
|
|
37
|
+
}, [open]);
|
|
38
|
+
|
|
39
|
+
React.useEffect(() => {
|
|
40
|
+
if (!visible) return;
|
|
41
|
+
const handler = (e: KeyboardEvent) => {
|
|
42
|
+
if (e.key === 'Escape') onClose();
|
|
43
|
+
};
|
|
44
|
+
document.addEventListener('keydown', handler);
|
|
45
|
+
return () => document.removeEventListener('keydown', handler);
|
|
46
|
+
}, [visible, onClose]);
|
|
47
|
+
|
|
48
|
+
if (!visible) return null;
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<div
|
|
52
|
+
className="fixed inset-0 z-50 flex items-end justify-center"
|
|
53
|
+
style={{
|
|
54
|
+
animation: closing ? 'fadeOut 200ms ease forwards' : 'fadeIn 200ms ease',
|
|
55
|
+
}}
|
|
56
|
+
>
|
|
57
|
+
<div className="absolute inset-0 bg-overlay" onClick={onClose} />
|
|
58
|
+
<div
|
|
59
|
+
className="relative z-10 w-full max-w-[393px] bg-bg rounded-t-[6px] shadow-[0px_-4px_12px_0px_rgba(0,0,0,0.12)] pt-3"
|
|
60
|
+
style={{
|
|
61
|
+
animation: closing ? 'slideDown 200ms ease forwards' : 'slideUp 250ms ease',
|
|
62
|
+
}}
|
|
63
|
+
>
|
|
64
|
+
<div className="px-4 py-3">
|
|
65
|
+
<h2 className="text-[17px] tracking-[-0.17px] font-normal text-text text-center">{title}</h2>
|
|
66
|
+
</div>
|
|
67
|
+
{description && (
|
|
68
|
+
<div className="px-3 pb-3">
|
|
69
|
+
<p className="text-[13px] tracking-[-0.13px] text-text-dim text-center">{description}</p>
|
|
70
|
+
</div>
|
|
71
|
+
)}
|
|
72
|
+
<div className="flex flex-col gap-3 px-3 pt-3">
|
|
73
|
+
<button
|
|
74
|
+
type="button"
|
|
75
|
+
onClick={onClose}
|
|
76
|
+
className="w-full h-12 rounded-[6px] text-[17px] tracking-[-0.17px] font-normal cursor-pointer transition-colors bg-surface text-text hover:bg-surface-light"
|
|
77
|
+
>
|
|
78
|
+
{cancelLabel}
|
|
79
|
+
</button>
|
|
80
|
+
<button
|
|
81
|
+
type="button"
|
|
82
|
+
onClick={() => { onConfirm(); onClose(); }}
|
|
83
|
+
className={cn(
|
|
84
|
+
'w-full h-12 rounded-[6px] text-[17px] tracking-[-0.17px] font-normal cursor-pointer transition-colors bg-surface hover:bg-surface-light',
|
|
85
|
+
variant === 'danger' ? 'text-negative' : 'text-text',
|
|
86
|
+
)}
|
|
87
|
+
>
|
|
88
|
+
{confirmLabel}
|
|
89
|
+
</button>
|
|
90
|
+
</div>
|
|
91
|
+
<div className="flex items-center justify-center h-[42px]">
|
|
92
|
+
<div className="w-[139px] h-[5px] rounded-full bg-text" />
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export { ConfirmDialog };
|
|
100
|
+
export type { ConfirmDialogProps };
|