@atmos.build/ui 0.1.0
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 +45 -0
- package/dist/components/alert-dialog.d.ts +14 -0
- package/dist/components/alert-dialog.js +40 -0
- package/dist/components/at-search.d.ts +35 -0
- package/dist/components/at-search.js +57 -0
- package/dist/components/attachment-thumbnail-stack.d.ts +13 -0
- package/dist/components/attachment-thumbnail-stack.js +23 -0
- package/dist/components/audio-preview.d.ts +33 -0
- package/dist/components/audio-preview.js +176 -0
- package/dist/components/avatar-uploader.d.ts +29 -0
- package/dist/components/avatar-uploader.js +67 -0
- package/dist/components/avatar.d.ts +12 -0
- package/dist/components/avatar.js +38 -0
- package/dist/components/badge.d.ts +9 -0
- package/dist/components/badge.js +25 -0
- package/dist/components/button-group.d.ts +12 -0
- package/dist/components/button-group.js +29 -0
- package/dist/components/button.d.ts +10 -0
- package/dist/components/button.js +42 -0
- package/dist/components/calendar.d.ts +26 -0
- package/dist/components/calendar.js +154 -0
- package/dist/components/channel-list.d.ts +33 -0
- package/dist/components/channel-list.js +40 -0
- package/dist/components/charts/area-chart.d.ts +2 -0
- package/dist/components/charts/area-chart.js +5 -0
- package/dist/components/charts/bar-chart.d.ts +2 -0
- package/dist/components/charts/bar-chart.js +58 -0
- package/dist/components/charts/colors.d.ts +2 -0
- package/dist/components/charts/colors.js +42 -0
- package/dist/components/charts/hover.d.ts +20 -0
- package/dist/components/charts/hover.js +31 -0
- package/dist/components/charts/index.d.ts +10 -0
- package/dist/components/charts/index.js +9 -0
- package/dist/components/charts/layout.d.ts +35 -0
- package/dist/components/charts/layout.js +101 -0
- package/dist/components/charts/legend.d.ts +6 -0
- package/dist/components/charts/legend.js +7 -0
- package/dist/components/charts/line-area-chart.d.ts +4 -0
- package/dist/components/charts/line-area-chart.js +86 -0
- package/dist/components/charts/line-chart.d.ts +2 -0
- package/dist/components/charts/line-chart.js +5 -0
- package/dist/components/charts/pie-chart.d.ts +2 -0
- package/dist/components/charts/pie-chart.js +22 -0
- package/dist/components/charts/radar-chart.d.ts +2 -0
- package/dist/components/charts/radar-chart.js +29 -0
- package/dist/components/charts/radial-chart.d.ts +2 -0
- package/dist/components/charts/radial-chart.js +19 -0
- package/dist/components/charts/scatter-chart.d.ts +2 -0
- package/dist/components/charts/scatter-chart.js +16 -0
- package/dist/components/charts/story-data.d.ts +24 -0
- package/dist/components/charts/story-data.js +48 -0
- package/dist/components/charts/types.d.ts +43 -0
- package/dist/components/charts/types.js +1 -0
- package/dist/components/checkbox.d.ts +4 -0
- package/dist/components/checkbox.js +10 -0
- package/dist/components/chip.d.ts +25 -0
- package/dist/components/chip.js +36 -0
- package/dist/components/code-editor-theme.d.ts +19 -0
- package/dist/components/code-editor-theme.js +100 -0
- package/dist/components/collapsible-section-header.d.ts +82 -0
- package/dist/components/collapsible-section-header.js +82 -0
- package/dist/components/collection-view/collection-view-group-settings.d.ts +73 -0
- package/dist/components/collection-view/collection-view-group-settings.js +55 -0
- package/dist/components/collection-view/collection-view-settings.d.ts +115 -0
- package/dist/components/collection-view/collection-view-settings.js +146 -0
- package/dist/components/collection-view/collection-view.d.ts +87 -0
- package/dist/components/collection-view/collection-view.js +95 -0
- package/dist/components/collection-view/index.d.ts +6 -0
- package/dist/components/collection-view/index.js +6 -0
- package/dist/components/collection-view/use-collection-detail-navigation.d.ts +11 -0
- package/dist/components/collection-view/use-collection-detail-navigation.js +12 -0
- package/dist/components/collection-view/use-collection-escape.d.ts +9 -0
- package/dist/components/collection-view/use-collection-escape.js +20 -0
- package/dist/components/collection-view/use-collection-selection.d.ts +42 -0
- package/dist/components/collection-view/use-collection-selection.js +203 -0
- package/dist/components/color-picker.d.ts +18 -0
- package/dist/components/color-picker.js +77 -0
- package/dist/components/color-swatch-list.d.ts +16 -0
- package/dist/components/color-swatch-list.js +60 -0
- package/dist/components/combobox/combobox.d.ts +4 -0
- package/dist/components/combobox/combobox.js +70 -0
- package/dist/components/combobox/compound.d.ts +68 -0
- package/dist/components/combobox/compound.js +151 -0
- package/dist/components/combobox/context.d.ts +34 -0
- package/dist/components/combobox/context.js +123 -0
- package/dist/components/combobox/create-step.d.ts +12 -0
- package/dist/components/combobox/create-step.js +8 -0
- package/dist/components/combobox/index.d.ts +10 -0
- package/dist/components/combobox/index.js +5 -0
- package/dist/components/combobox/inline-create-form.d.ts +24 -0
- package/dist/components/combobox/inline-create-form.js +43 -0
- package/dist/components/combobox/types.d.ts +57 -0
- package/dist/components/combobox/types.js +10 -0
- package/dist/components/command.d.ts +35 -0
- package/dist/components/command.js +76 -0
- package/dist/components/comment-pin.d.ts +13 -0
- package/dist/components/comment-pin.js +33 -0
- package/dist/components/confidence-meter.d.ts +11 -0
- package/dist/components/confidence-meter.js +24 -0
- package/dist/components/context-menu.d.ts +31 -0
- package/dist/components/context-menu.js +54 -0
- package/dist/components/copy-button.d.ts +12 -0
- package/dist/components/copy-button.js +32 -0
- package/dist/components/date-picker.d.ts +29 -0
- package/dist/components/date-picker.js +86 -0
- package/dist/components/date-tile.d.ts +11 -0
- package/dist/components/date-tile.js +16 -0
- package/dist/components/date-time-picker.d.ts +25 -0
- package/dist/components/date-time-picker.js +153 -0
- package/dist/components/detail-breadcrumb-utils.d.ts +2 -0
- package/dist/components/detail-breadcrumb-utils.js +18 -0
- package/dist/components/detail-nav-bar.d.ts +28 -0
- package/dist/components/detail-nav-bar.js +28 -0
- package/dist/components/detail-top-bar.d.ts +49 -0
- package/dist/components/detail-top-bar.js +41 -0
- package/dist/components/dialog.d.ts +22 -0
- package/dist/components/dialog.js +51 -0
- package/dist/components/dropdown-menu.d.ts +29 -0
- package/dist/components/dropdown-menu.js +52 -0
- package/dist/components/editable-doc-title.d.ts +17 -0
- package/dist/components/editable-doc-title.js +147 -0
- package/dist/components/empty-state.d.ts +12 -0
- package/dist/components/empty-state.js +6 -0
- package/dist/components/filter-condition-editor.d.ts +18 -0
- package/dist/components/filter-condition-editor.js +102 -0
- package/dist/components/form-dialog.d.ts +30 -0
- package/dist/components/form-dialog.js +52 -0
- package/dist/components/formula-editor.d.ts +18 -0
- package/dist/components/formula-editor.js +154 -0
- package/dist/components/hover-card.d.ts +52 -0
- package/dist/components/hover-card.js +51 -0
- package/dist/components/icon-button.d.ts +15 -0
- package/dist/components/icon-button.js +18 -0
- package/dist/components/inline-alert.d.ts +11 -0
- package/dist/components/inline-alert.js +17 -0
- package/dist/components/input.d.ts +3 -0
- package/dist/components/input.js +7 -0
- package/dist/components/kanban-board.d.ts +27 -0
- package/dist/components/kanban-board.js +145 -0
- package/dist/components/kbd.d.ts +3 -0
- package/dist/components/kbd.js +8 -0
- package/dist/components/label.d.ts +4 -0
- package/dist/components/label.js +9 -0
- package/dist/components/markdown-editor/index.d.ts +4 -0
- package/dist/components/markdown-editor/index.js +2 -0
- package/dist/components/markdown-editor/markdown-editor.d.ts +16 -0
- package/dist/components/markdown-editor/markdown-editor.js +53 -0
- package/dist/components/markdown-editor/serialize.d.ts +12 -0
- package/dist/components/markdown-editor/serialize.js +122 -0
- package/dist/components/markdown-editor/vim.d.ts +8 -0
- package/dist/components/markdown-editor/vim.js +394 -0
- package/dist/components/metric-grid.d.ts +41 -0
- package/dist/components/metric-grid.js +39 -0
- package/dist/components/microphone-priority.d.ts +29 -0
- package/dist/components/microphone-priority.js +15 -0
- package/dist/components/middle-truncate.d.ts +6 -0
- package/dist/components/middle-truncate.js +15 -0
- package/dist/components/multi-combobox.d.ts +48 -0
- package/dist/components/multi-combobox.js +221 -0
- package/dist/components/naut-avatar-engine.d.ts +83 -0
- package/dist/components/naut-avatar-engine.js +803 -0
- package/dist/components/naut-avatar.d.ts +31 -0
- package/dist/components/naut-avatar.js +108 -0
- package/dist/components/navigable-list.d.ts +4 -0
- package/dist/components/navigable-list.js +20 -0
- package/dist/components/note-icon-picker.d.ts +20 -0
- package/dist/components/note-icon-picker.js +84 -0
- package/dist/components/note-icon.d.ts +690 -0
- package/dist/components/note-icon.js +353 -0
- package/dist/components/note-row.d.ts +33 -0
- package/dist/components/note-row.js +29 -0
- package/dist/components/overlapping-dots.d.ts +10 -0
- package/dist/components/overlapping-dots.js +13 -0
- package/dist/components/overview-card.d.ts +12 -0
- package/dist/components/overview-card.js +9 -0
- package/dist/components/panel-header.d.ts +8 -0
- package/dist/components/panel-header.js +6 -0
- package/dist/components/panel-section-states.d.ts +9 -0
- package/dist/components/panel-section-states.js +10 -0
- package/dist/components/person-avatar.d.ts +10 -0
- package/dist/components/person-avatar.js +23 -0
- package/dist/components/photo-avatar.d.ts +11 -0
- package/dist/components/photo-avatar.js +24 -0
- package/dist/components/picker-field.d.ts +23 -0
- package/dist/components/picker-field.js +24 -0
- package/dist/components/popover-stack.d.ts +26 -0
- package/dist/components/popover-stack.js +89 -0
- package/dist/components/popover.d.ts +12 -0
- package/dist/components/popover.js +31 -0
- package/dist/components/portal-login-barrier.d.ts +12 -0
- package/dist/components/portal-login-barrier.js +41 -0
- package/dist/components/presence-dot.d.ts +8 -0
- package/dist/components/presence-dot.js +15 -0
- package/dist/components/presence-overlay.d.ts +27 -0
- package/dist/components/presence-overlay.js +34 -0
- package/dist/components/property-list.d.ts +64 -0
- package/dist/components/property-list.js +313 -0
- package/dist/components/property-panel.d.ts +54 -0
- package/dist/components/property-panel.js +87 -0
- package/dist/components/property-selector.d.ts +36 -0
- package/dist/components/property-selector.js +141 -0
- package/dist/components/provenance-chip.d.ts +12 -0
- package/dist/components/provenance-chip.js +17 -0
- package/dist/components/qr-code.d.ts +13 -0
- package/dist/components/qr-code.js +42 -0
- package/dist/components/qr-encode.d.ts +2 -0
- package/dist/components/qr-encode.js +469 -0
- package/dist/components/quantity-stepper.d.ts +25 -0
- package/dist/components/quantity-stepper.js +43 -0
- package/dist/components/radio-group.d.ts +5 -0
- package/dist/components/radio-group.js +13 -0
- package/dist/components/rename-dialog.d.ts +19 -0
- package/dist/components/rename-dialog.js +35 -0
- package/dist/components/row-surface.d.ts +1 -0
- package/dist/components/row-surface.js +5 -0
- package/dist/components/row-trailing.d.ts +30 -0
- package/dist/components/row-trailing.js +59 -0
- package/dist/components/run-status-badge.d.ts +16 -0
- package/dist/components/run-status-badge.js +43 -0
- package/dist/components/scroll-area.d.ts +5 -0
- package/dist/components/scroll-area.js +12 -0
- package/dist/components/select.d.ts +15 -0
- package/dist/components/select.js +39 -0
- package/dist/components/selectable-card.d.ts +33 -0
- package/dist/components/selectable-card.js +66 -0
- package/dist/components/separator.d.ts +3 -0
- package/dist/components/separator.js +8 -0
- package/dist/components/settings-dialog-shell.d.ts +46 -0
- package/dist/components/settings-dialog-shell.js +48 -0
- package/dist/components/shimmer-text.d.ts +8 -0
- package/dist/components/shimmer-text.js +26 -0
- package/dist/components/side-panel-tokens.d.ts +27 -0
- package/dist/components/side-panel-tokens.js +26 -0
- package/dist/components/side-panel.d.ts +94 -0
- package/dist/components/side-panel.js +106 -0
- package/dist/components/skeleton.d.ts +2 -0
- package/dist/components/skeleton.js +6 -0
- package/dist/components/sortable.d.ts +65 -0
- package/dist/components/sortable.js +110 -0
- package/dist/components/spec-strip.d.ts +18 -0
- package/dist/components/spec-strip.js +15 -0
- package/dist/components/speech-playback.d.ts +25 -0
- package/dist/components/speech-playback.js +35 -0
- package/dist/components/sql-editor.d.ts +13 -0
- package/dist/components/sql-editor.js +228 -0
- package/dist/components/stat-tile.d.ts +7 -0
- package/dist/components/stat-tile.js +6 -0
- package/dist/components/status-badge.d.ts +17 -0
- package/dist/components/status-badge.js +8 -0
- package/dist/components/status-tone.d.ts +9 -0
- package/dist/components/status-tone.js +10 -0
- package/dist/components/sticky-header-fade.d.ts +8 -0
- package/dist/components/sticky-header-fade.js +11 -0
- package/dist/components/swatch-button.d.ts +14 -0
- package/dist/components/swatch-button.js +25 -0
- package/dist/components/switch.d.ts +6 -0
- package/dist/components/switch.js +9 -0
- package/dist/components/system-load/index.d.ts +6 -0
- package/dist/components/system-load/index.js +6 -0
- package/dist/components/system-load/load-block.d.ts +20 -0
- package/dist/components/system-load/load-block.js +23 -0
- package/dist/components/system-load/load-grid.d.ts +16 -0
- package/dist/components/system-load/load-grid.js +23 -0
- package/dist/components/system-load/load-meter.d.ts +25 -0
- package/dist/components/system-load/load-meter.js +29 -0
- package/dist/components/system-load/load-tone.d.ts +21 -0
- package/dist/components/system-load/load-tone.js +29 -0
- package/dist/components/system-load/meter-row.d.ts +31 -0
- package/dist/components/system-load/meter-row.js +29 -0
- package/dist/components/system-load/resource-meter.d.ts +19 -0
- package/dist/components/system-load/resource-meter.js +15 -0
- package/dist/components/tab-title-bar.d.ts +12 -0
- package/dist/components/tab-title-bar.js +9 -0
- package/dist/components/table.d.ts +10 -0
- package/dist/components/table.js +29 -0
- package/dist/components/tabs.d.ts +11 -0
- package/dist/components/tabs.js +97 -0
- package/dist/components/template-chip-input.d.ts +36 -0
- package/dist/components/template-chip-input.js +271 -0
- package/dist/components/template-input.d.ts +24 -0
- package/dist/components/template-input.js +57 -0
- package/dist/components/terminal-spinner.d.ts +11 -0
- package/dist/components/terminal-spinner.js +48 -0
- package/dist/components/textarea.d.ts +3 -0
- package/dist/components/textarea.js +7 -0
- package/dist/components/time-column.d.ts +24 -0
- package/dist/components/time-column.js +60 -0
- package/dist/components/timestamped-transcript.d.ts +38 -0
- package/dist/components/timestamped-transcript.js +29 -0
- package/dist/components/timezone-picker.d.ts +22 -0
- package/dist/components/timezone-picker.js +60 -0
- package/dist/components/tooltip.d.ts +11 -0
- package/dist/components/tooltip.js +29 -0
- package/dist/components/transcription-overlay.d.ts +47 -0
- package/dist/components/transcription-overlay.js +30 -0
- package/dist/components/usage-bar.d.ts +17 -0
- package/dist/components/usage-bar.js +26 -0
- package/dist/components/view-query-bar.d.ts +13 -0
- package/dist/components/view-query-bar.js +13 -0
- package/dist/components/view-query-controls.d.ts +159 -0
- package/dist/components/view-query-controls.js +109 -0
- package/dist/components/view-save-menu.d.ts +20 -0
- package/dist/components/view-save-menu.js +13 -0
- package/dist/components/view-sort-editor.d.ts +40 -0
- package/dist/components/view-sort-editor.js +47 -0
- package/dist/components/voice-line.d.ts +37 -0
- package/dist/components/voice-line.js +293 -0
- package/dist/components/weekly-schedule-editor.d.ts +15 -0
- package/dist/components/weekly-schedule-editor.js +28 -0
- package/dist/flow/canvas/canvas-frame.d.ts +160 -0
- package/dist/flow/canvas/canvas-frame.js +521 -0
- package/dist/flow/canvas/collaborator-layer.d.ts +12 -0
- package/dist/flow/canvas/collaborator-layer.js +43 -0
- package/dist/flow/canvas/connector-edge.d.ts +22 -0
- package/dist/flow/canvas/connector-edge.js +61 -0
- package/dist/flow/canvas/editor-context.d.ts +23 -0
- package/dist/flow/canvas/editor-context.js +6 -0
- package/dist/flow/canvas/graph-core.d.ts +60 -0
- package/dist/flow/canvas/graph-core.js +296 -0
- package/dist/flow/canvas/minimap-sticky-overlay.d.ts +4 -0
- package/dist/flow/canvas/minimap-sticky-overlay.js +45 -0
- package/dist/flow/canvas/node-card.d.ts +46 -0
- package/dist/flow/canvas/node-card.js +56 -0
- package/dist/flow/canvas/node-library.d.ts +40 -0
- package/dist/flow/canvas/node-library.js +54 -0
- package/dist/flow/canvas/sticky-notes.d.ts +25 -0
- package/dist/flow/canvas/sticky-notes.js +101 -0
- package/dist/flow/collaborative-graph-presence.d.ts +28 -0
- package/dist/flow/collaborative-graph-presence.js +55 -0
- package/dist/flow/collaborative-graph-sync.d.ts +40 -0
- package/dist/flow/collaborative-graph-sync.js +127 -0
- package/dist/flow/editor/adapter.d.ts +64 -0
- package/dist/flow/editor/adapter.js +1 -0
- package/dist/flow/editor/command-registry.d.ts +10 -0
- package/dist/flow/editor/command-registry.js +35 -0
- package/dist/flow/editor/dag-canvas.d.ts +18 -0
- package/dist/flow/editor/dag-canvas.js +33 -0
- package/dist/flow/editor/flow-editor.d.ts +54 -0
- package/dist/flow/editor/flow-editor.js +199 -0
- package/dist/flow/editor/issues-popover.d.ts +11 -0
- package/dist/flow/editor/issues-popover.js +70 -0
- package/dist/flow/editor/library-rail.d.ts +19 -0
- package/dist/flow/editor/library-rail.js +25 -0
- package/dist/flow/editor/make-controller.d.ts +18 -0
- package/dist/flow/editor/make-controller.js +44 -0
- package/dist/flow/editor/node-chip.d.ts +2 -0
- package/dist/flow/editor/node-chip.js +16 -0
- package/dist/flow/editor/save-publish-bar.d.ts +27 -0
- package/dist/flow/editor/save-publish-bar.js +14 -0
- package/dist/flow/editor/settings-dialog.d.ts +11 -0
- package/dist/flow/editor/settings-dialog.js +11 -0
- package/dist/flow/editor/settings-shell.d.ts +21 -0
- package/dist/flow/editor/settings-shell.js +20 -0
- package/dist/flow/editor/side-rail.d.ts +22 -0
- package/dist/flow/editor/side-rail.js +15 -0
- package/dist/flow/editor/use-dag-editor.d.ts +94 -0
- package/dist/flow/editor/use-dag-editor.js +502 -0
- package/dist/flow/index.d.ts +25 -0
- package/dist/flow/index.js +25 -0
- package/dist/flow/presence-motion.d.ts +10 -0
- package/dist/flow/presence-motion.js +88 -0
- package/dist/flow/styles.css +1 -0
- package/dist/flow/use-collaborative-graph.d.ts +61 -0
- package/dist/flow/use-collaborative-graph.js +396 -0
- package/dist/flow/use-debounced-value.d.ts +1 -0
- package/dist/flow/use-debounced-value.js +10 -0
- package/dist/hooks/use-detail-nav.d.ts +11 -0
- package/dist/hooks/use-detail-nav.js +49 -0
- package/dist/hooks/use-flush-on-hide.d.ts +1 -0
- package/dist/hooks/use-flush-on-hide.js +21 -0
- package/dist/hooks/use-media-query.d.ts +1 -0
- package/dist/hooks/use-media-query.js +20 -0
- package/dist/hooks/use-virtualizer.d.ts +1 -0
- package/dist/hooks/use-virtualizer.js +1 -0
- package/dist/index.d.ts +139 -0
- package/dist/index.js +139 -0
- package/dist/lib/brand-style.d.ts +6 -0
- package/dist/lib/brand-style.js +16 -0
- package/dist/lib/cn.d.ts +2 -0
- package/dist/lib/cn.js +5 -0
- package/dist/lib/composited-glint.d.ts +7 -0
- package/dist/lib/composited-glint.js +98 -0
- package/dist/lib/date-time-format.d.ts +2 -0
- package/dist/lib/date-time-format.js +21 -0
- package/dist/lib/disclosure-state.d.ts +11 -0
- package/dist/lib/disclosure-state.js +22 -0
- package/dist/lib/label-swatches.d.ts +10 -0
- package/dist/lib/label-swatches.js +24 -0
- package/dist/lib/local-ui-state.d.ts +10 -0
- package/dist/lib/local-ui-state.js +95 -0
- package/dist/lib/parse-loose-datetime.d.ts +1 -0
- package/dist/lib/parse-loose-datetime.js +180 -0
- package/dist/lib/parse-loose-time.d.ts +6 -0
- package/dist/lib/parse-loose-time.js +53 -0
- package/dist/lib/parse-loose.d.ts +1 -0
- package/dist/lib/parse-loose.js +170 -0
- package/dist/lib/react-19-jsx.d.ts +8 -0
- package/dist/lib/react-19-jsx.js +1 -0
- package/dist/lib/view-chrome.d.ts +5 -0
- package/dist/lib/view-chrome.js +5 -0
- package/dist/lib/view-query/config.d.ts +26 -0
- package/dist/lib/view-query/config.js +162 -0
- package/dist/lib/view-query/evaluate.d.ts +11 -0
- package/dist/lib/view-query/evaluate.js +196 -0
- package/dist/lib/view-query/group-order.d.ts +25 -0
- package/dist/lib/view-query/group-order.js +49 -0
- package/dist/lib/view-query/index.d.ts +6 -0
- package/dist/lib/view-query/index.js +6 -0
- package/dist/lib/view-query/model.d.ts +34 -0
- package/dist/lib/view-query/model.js +88 -0
- package/dist/lib/view-query/sort.d.ts +7 -0
- package/dist/lib/view-query/sort.js +30 -0
- package/dist/lib/view-query/types.d.ts +70 -0
- package/dist/lib/view-query/types.js +12 -0
- package/dist/lib/weekly-schedule.d.ts +8 -0
- package/dist/lib/weekly-schedule.js +10 -0
- package/dist/mcp-app/index.d.ts +4 -0
- package/dist/mcp-app/index.js +3 -0
- package/dist/mcp-app/shadcn.css +629 -0
- package/dist/mcp-app/styles.css +72 -0
- package/dist/mcp-app/theme.d.ts +2 -0
- package/dist/mcp-app/theme.js +62 -0
- package/dist/mcp-app/use-atmos-mcp-app.d.ts +109 -0
- package/dist/mcp-app/use-atmos-mcp-app.js +30 -0
- package/dist/mcp-app/vite.d.ts +7 -0
- package/dist/mcp-app/vite.js +30 -0
- package/dist/tokens/index.d.ts +7 -0
- package/dist/tokens/index.js +7 -0
- package/dist/tokens/semantic.css +110 -0
- package/dist/tokens/tokens.css +195 -0
- package/package.json +98 -0
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { CircleDashed, Loader2, Mic, RotateCcw, Volume2 } from 'lucide-react';
|
|
5
|
+
import { cn } from '../lib/cn.js';
|
|
6
|
+
import { COMPOSITED_GLINT_BANDS, useCompositedGlint } from '../lib/composited-glint.js';
|
|
7
|
+
const TONES = {
|
|
8
|
+
idle: {
|
|
9
|
+
chip: 'bg-muted text-muted-foreground',
|
|
10
|
+
wave: 'text-muted-foreground/50',
|
|
11
|
+
ring: 'border-border/70',
|
|
12
|
+
glow: '',
|
|
13
|
+
caret: 'bg-muted-foreground',
|
|
14
|
+
},
|
|
15
|
+
generating: {
|
|
16
|
+
chip: 'bg-muted text-muted-foreground',
|
|
17
|
+
wave: 'text-muted-foreground/60',
|
|
18
|
+
ring: 'border-border/70',
|
|
19
|
+
glow: '',
|
|
20
|
+
caret: 'bg-muted-foreground',
|
|
21
|
+
},
|
|
22
|
+
speaking: {
|
|
23
|
+
chip: 'bg-primary/15 text-primary',
|
|
24
|
+
wave: 'text-primary',
|
|
25
|
+
ring: 'border-primary/40 ring-1 ring-primary/15',
|
|
26
|
+
glow: 'shadow-[0_12px_40px_-16px] shadow-primary/40',
|
|
27
|
+
caret: 'bg-primary',
|
|
28
|
+
},
|
|
29
|
+
listening: {
|
|
30
|
+
chip: 'bg-primary/15 text-primary',
|
|
31
|
+
wave: 'text-primary',
|
|
32
|
+
ring: 'border-primary/40 ring-1 ring-primary/15',
|
|
33
|
+
glow: 'shadow-[0_12px_40px_-16px] shadow-primary/40',
|
|
34
|
+
caret: 'bg-primary',
|
|
35
|
+
},
|
|
36
|
+
verifying: {
|
|
37
|
+
chip: 'bg-muted text-muted-foreground',
|
|
38
|
+
wave: 'text-muted-foreground/60',
|
|
39
|
+
ring: 'border-border/70',
|
|
40
|
+
glow: '',
|
|
41
|
+
caret: 'bg-muted-foreground',
|
|
42
|
+
},
|
|
43
|
+
reprompt: {
|
|
44
|
+
chip: 'bg-destructive/10 text-destructive',
|
|
45
|
+
wave: 'text-destructive',
|
|
46
|
+
ring: 'border-destructive/40 ring-1 ring-destructive/15',
|
|
47
|
+
glow: 'shadow-[0_12px_40px_-16px] shadow-destructive/40',
|
|
48
|
+
caret: 'bg-destructive',
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
const GLYPHS = {
|
|
52
|
+
idle: CircleDashed,
|
|
53
|
+
generating: Loader2,
|
|
54
|
+
speaking: Volume2,
|
|
55
|
+
listening: Mic,
|
|
56
|
+
verifying: Loader2,
|
|
57
|
+
reprompt: RotateCcw,
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* The unified voice line — one dynamic-island pill whose tint, glyph, caption and
|
|
61
|
+
* waveform cross-fade between speaking → listening → verifying → reprompt. It is a
|
|
62
|
+
* single morphing surface (never two stacked boxes): the system's spoken line and the
|
|
63
|
+
* caller's transcribed line share it. Presentational; the caption is announced via
|
|
64
|
+
* aria-live so the spoken/heard line reaches a screen reader.
|
|
65
|
+
*/
|
|
66
|
+
export function VoiceLine({ state, caption, who, icon, partial = false, analyser = null, active = false, micLevel, countdownMs, layout = 'stacked', loadingVisualization = 'ripple', bars, className, ...props }) {
|
|
67
|
+
const tone = TONES[state];
|
|
68
|
+
const Glyph = icon ?? GLYPHS[state];
|
|
69
|
+
const spinning = state === 'verifying' || state === 'generating';
|
|
70
|
+
const showRing = state === 'listening' && typeof countdownMs === 'number' && countdownMs > 0;
|
|
71
|
+
if (layout === 'waveform') {
|
|
72
|
+
return (_jsxs("div", { "data-slot": "voice-line", "data-state": state, "data-layout": layout, className: cn('bg-card/80 relative flex min-h-8 items-center gap-2 overflow-hidden rounded-full border px-2.5 py-1.5', 'transition-[box-shadow,border-color] duration-500 motion-reduce:transition-none', tone.ring, tone.glow, className), ...props, children: [who ? (_jsxs("span", { className: cn('inline-flex shrink-0 items-center gap-1.5 rounded-full px-2 py-1 text-[11px] font-medium', 'transition-colors duration-300 motion-reduce:transition-none', tone.chip), children: [_jsx(Glyph, { className: cn('size-3.5', spinning && 'motion-safe:animate-spin'), strokeWidth: 1.6, "aria-hidden": true }), who] })) : null, _jsx(Waveform, { analyser: analyser, active: active, state: state, micLevel: micLevel, bars: bars, loadingVisualization: loadingVisualization, className: cn('h-5 min-w-16 flex-1', tone.wave) }), caption ? (_jsx("span", { className: "sr-only", "aria-live": "polite", children: caption })) : null, state === 'generating' && loadingVisualization !== 'shimmer-bars' ? (_jsx("span", { "aria-hidden": true, className: "via-primary/[0.06] pointer-events-none absolute inset-0 bg-gradient-to-r from-transparent to-transparent motion-safe:animate-pulse" })) : null] }));
|
|
73
|
+
}
|
|
74
|
+
return (_jsxs("div", { "data-slot": "voice-line", "data-state": state, "data-layout": layout, className: cn('bg-card/80 relative flex flex-col gap-3 overflow-hidden rounded-2xl border px-4 py-3.5', 'transition-[box-shadow,border-color] duration-500 motion-reduce:transition-none', tone.ring, tone.glow, className), ...props, children: [who || showRing ? (_jsxs("div", { className: "flex items-center gap-2", children: [who ? (_jsxs("span", { className: cn('inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-medium', 'transition-colors duration-300 motion-reduce:transition-none', tone.chip), children: [_jsx(Glyph, { className: cn('size-3.5', spinning && 'motion-safe:animate-spin'), strokeWidth: 1.6, "aria-hidden": true }), who] })) : null, showRing ? _jsx(CountdownRing, { ms: countdownMs, className: tone.wave }) : null] })) : null, _jsx(Waveform, { analyser: analyser, active: active, state: state, micLevel: micLevel, bars: bars, loadingVisualization: loadingVisualization, className: cn('h-8 w-full', tone.wave) }), _jsxs("p", { "aria-live": "polite", className: cn('min-h-[2.5rem] text-[13.5px] leading-relaxed tracking-[-0.005em] transition-opacity duration-300 motion-reduce:transition-none', partial ? 'text-muted-foreground' : 'text-foreground'), children: [caption, partial ? (_jsx("span", { "aria-hidden": true, className: cn('ml-0.5 inline-block h-[1em] w-0.5 -translate-y-px align-middle', tone.caret, 'motion-safe:animate-pulse') })) : null] }), state === 'generating' ? (_jsx("span", { "aria-hidden": true, className: "via-primary/[0.06] pointer-events-none absolute inset-0 bg-gradient-to-r from-transparent to-transparent motion-safe:animate-pulse" })) : null] }));
|
|
75
|
+
}
|
|
76
|
+
function CountdownRing({ ms, className }) {
|
|
77
|
+
const arcRef = React.useRef(null);
|
|
78
|
+
const CIRC = 2 * Math.PI * 9;
|
|
79
|
+
React.useEffect(() => {
|
|
80
|
+
const arc = arcRef.current;
|
|
81
|
+
if (!arc)
|
|
82
|
+
return;
|
|
83
|
+
const reduce = typeof window !== 'undefined' && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
84
|
+
if (reduce) {
|
|
85
|
+
arc.style.strokeDashoffset = String(CIRC * 0.5);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
let raf = 0;
|
|
89
|
+
const start = performance.now();
|
|
90
|
+
const step = (now) => {
|
|
91
|
+
const p = Math.min(1, (now - start) / ms);
|
|
92
|
+
arc.style.strokeDashoffset = String(CIRC * p);
|
|
93
|
+
if (p < 1)
|
|
94
|
+
raf = requestAnimationFrame(step);
|
|
95
|
+
};
|
|
96
|
+
arc.style.strokeDashoffset = '0';
|
|
97
|
+
raf = requestAnimationFrame(step);
|
|
98
|
+
return () => cancelAnimationFrame(raf);
|
|
99
|
+
}, [ms, CIRC]);
|
|
100
|
+
return (_jsxs("svg", { className: cn('ml-auto size-[22px] -rotate-90', className), viewBox: "0 0 22 22", "aria-hidden": true, children: [_jsx("circle", { cx: "11", cy: "11", r: "9", fill: "none", stroke: "currentColor", strokeOpacity: 0.2, strokeWidth: 2 }), _jsx("circle", { ref: arcRef, cx: "11", cy: "11", r: "9", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeDasharray: CIRC })] }));
|
|
101
|
+
}
|
|
102
|
+
// The one waveform: real TTS frequency bars while speaking, center-weighted mic bars
|
|
103
|
+
// while listening, a loading ripple while generating/checking, and a single static frame at rest.
|
|
104
|
+
function Waveform({ analyser, active, state, micLevel, bars, loadingVisualization, className, }) {
|
|
105
|
+
const canvasRef = React.useRef(null);
|
|
106
|
+
const barsRef = React.useRef([]);
|
|
107
|
+
const levelRef = React.useRef(micLevel ?? 0);
|
|
108
|
+
React.useEffect(() => {
|
|
109
|
+
if (micLevel !== undefined)
|
|
110
|
+
levelRef.current = micLevel;
|
|
111
|
+
}, [micLevel]);
|
|
112
|
+
const listening = state === 'listening';
|
|
113
|
+
const speaking = state === 'speaking';
|
|
114
|
+
const generating = state === 'generating';
|
|
115
|
+
const verifying = state === 'verifying';
|
|
116
|
+
const loading = generating || verifying;
|
|
117
|
+
React.useEffect(() => {
|
|
118
|
+
const canvas = canvasRef.current;
|
|
119
|
+
if (!canvas)
|
|
120
|
+
return;
|
|
121
|
+
const ctx = canvas.getContext('2d');
|
|
122
|
+
if (!ctx)
|
|
123
|
+
return;
|
|
124
|
+
const reduce = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
125
|
+
const color = getComputedStyle(canvas).color;
|
|
126
|
+
const barWidth = listening ? 3.6 : 3;
|
|
127
|
+
const step = barWidth + (listening ? 3.1 : 2.7);
|
|
128
|
+
const freq = analyser ? new Uint8Array(analyser.frequencyBinCount) : null;
|
|
129
|
+
const target = [];
|
|
130
|
+
let phase = 0;
|
|
131
|
+
let raf = 0;
|
|
132
|
+
const animate = !reduce && (speaking || listening || loading);
|
|
133
|
+
const render = () => {
|
|
134
|
+
const dpr = window.devicePixelRatio || 1;
|
|
135
|
+
const w = canvas.clientWidth;
|
|
136
|
+
const h = canvas.clientHeight;
|
|
137
|
+
if (canvas.width !== w * dpr || canvas.height !== h * dpr) {
|
|
138
|
+
canvas.width = w * dpr;
|
|
139
|
+
canvas.height = h * dpr;
|
|
140
|
+
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
|
|
141
|
+
}
|
|
142
|
+
const centerY = h / 2;
|
|
143
|
+
const barCount = bars ?? Math.max(1, Math.floor(w / step));
|
|
144
|
+
const stepPx = bars ? w / bars : step;
|
|
145
|
+
const half = Math.max(1, Math.floor(barCount / 2));
|
|
146
|
+
const analyserActive = active && speaking && analyser && freq;
|
|
147
|
+
const barsActive = analyserActive || listening || (active && speaking);
|
|
148
|
+
if (!barsActive && !(loading && loadingVisualization === 'shimmer-bars')) {
|
|
149
|
+
ctx.clearRect(0, 0, w, h);
|
|
150
|
+
barsRef.current.length = 0;
|
|
151
|
+
phase += 0.09;
|
|
152
|
+
const rippleWidth = Math.max(12, w * 0.32);
|
|
153
|
+
const travelStart = Math.min(w / 2, rippleWidth * 0.35);
|
|
154
|
+
const travelEnd = Math.max(travelStart, w - travelStart);
|
|
155
|
+
const moving = loading && !reduce;
|
|
156
|
+
const travelProgress = (Math.sin(phase) + 1) / 2;
|
|
157
|
+
const rippleCenter = moving
|
|
158
|
+
? travelStart + travelProgress * (travelEnd - travelStart)
|
|
159
|
+
: w / 2;
|
|
160
|
+
ctx.strokeStyle = color;
|
|
161
|
+
ctx.lineCap = 'round';
|
|
162
|
+
ctx.lineWidth = 1.25;
|
|
163
|
+
ctx.globalAlpha = 0.22;
|
|
164
|
+
ctx.beginPath();
|
|
165
|
+
ctx.moveTo(0, centerY);
|
|
166
|
+
ctx.lineTo(w, centerY);
|
|
167
|
+
ctx.stroke();
|
|
168
|
+
ctx.globalAlpha = 0.75;
|
|
169
|
+
ctx.beginPath();
|
|
170
|
+
for (let x = 0; x <= w; x += 1) {
|
|
171
|
+
const dist = x - rippleCenter;
|
|
172
|
+
const envelope = moving
|
|
173
|
+
? Math.exp(-((dist * dist) / (2 * rippleWidth * rippleWidth * 0.18)))
|
|
174
|
+
: 0;
|
|
175
|
+
const y = centerY + Math.sin(dist * 0.42) * envelope * h * 0.16;
|
|
176
|
+
if (x === 0)
|
|
177
|
+
ctx.moveTo(x, y);
|
|
178
|
+
else
|
|
179
|
+
ctx.lineTo(x, y);
|
|
180
|
+
}
|
|
181
|
+
ctx.stroke();
|
|
182
|
+
ctx.globalAlpha = 1;
|
|
183
|
+
if (animate)
|
|
184
|
+
raf = requestAnimationFrame(render);
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
target.length = barCount;
|
|
188
|
+
if (analyserActive && analyser && freq) {
|
|
189
|
+
analyser.getByteFrequencyData(freq);
|
|
190
|
+
const start = Math.floor(freq.length * 0.05);
|
|
191
|
+
const span = Math.floor(freq.length * 0.5) - start;
|
|
192
|
+
for (let i = 0; i < barCount; i++) {
|
|
193
|
+
const mirrored = Math.abs(i - half) / half;
|
|
194
|
+
const idx = start + Math.floor(mirrored * span);
|
|
195
|
+
target[i] = Math.max(0.08, (freq[idx] ?? 0) / 255);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
phase += reduce ? 0 : 0.08;
|
|
200
|
+
let micAmp = Math.min(0.5, levelRef.current);
|
|
201
|
+
if (analyser && freq) {
|
|
202
|
+
analyser.getByteTimeDomainData(freq);
|
|
203
|
+
let sum = 0;
|
|
204
|
+
for (let i = 0; i < freq.length; i++) {
|
|
205
|
+
const v = ((freq[i] ?? 128) - 128) / 128;
|
|
206
|
+
sum += v * v;
|
|
207
|
+
}
|
|
208
|
+
micAmp = Math.min(0.6, Math.sqrt(sum / freq.length) * 2.4);
|
|
209
|
+
}
|
|
210
|
+
const amp = Math.min(1, 0.24 + micAmp * 1.25);
|
|
211
|
+
for (let i = 0; i < barCount; i++) {
|
|
212
|
+
const centered = (i - half) / half;
|
|
213
|
+
const mirrored = Math.abs(centered);
|
|
214
|
+
const centerWeight = Math.exp(-((centered * centered) / 0.18));
|
|
215
|
+
const breath = reduce ? 0.72 : 0.72 + Math.sin(phase + mirrored * Math.PI * 1.2) * 0.12;
|
|
216
|
+
target[i] = centerWeight < 0.035 ? 0.01 : 0.035 + centerWeight * amp * breath;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
const prev = barsRef.current;
|
|
220
|
+
prev.length = barCount;
|
|
221
|
+
for (let i = 0; i < barCount; i++) {
|
|
222
|
+
const p = prev[i] ?? 0.08;
|
|
223
|
+
prev[i] = p + ((target[i] ?? 0.08) - p) * 0.35;
|
|
224
|
+
}
|
|
225
|
+
ctx.clearRect(0, 0, w, h);
|
|
226
|
+
const offset = offsetForBars(w, barCount, stepPx);
|
|
227
|
+
ctx.fillStyle = color;
|
|
228
|
+
for (let i = 0; i < barCount; i++) {
|
|
229
|
+
const value = prev[i] ?? 0.08;
|
|
230
|
+
if (!analyserActive && value < 0.045)
|
|
231
|
+
continue;
|
|
232
|
+
const barHeight = Math.max(listening ? 3.25 : 2, value * h);
|
|
233
|
+
const x = offset + i * stepPx;
|
|
234
|
+
ctx.globalAlpha = listening ? Math.min(0.95, 0.16 + value * 1.2) : 0.35 + value * 0.65;
|
|
235
|
+
ctx.beginPath();
|
|
236
|
+
ctx.roundRect(x, centerY - barHeight / 2, barWidth, barHeight, barWidth / 2);
|
|
237
|
+
ctx.fill();
|
|
238
|
+
}
|
|
239
|
+
ctx.globalAlpha = 1;
|
|
240
|
+
if (animate)
|
|
241
|
+
raf = requestAnimationFrame(render);
|
|
242
|
+
};
|
|
243
|
+
if (animate)
|
|
244
|
+
raf = requestAnimationFrame(render);
|
|
245
|
+
else
|
|
246
|
+
render();
|
|
247
|
+
return () => cancelAnimationFrame(raf);
|
|
248
|
+
}, [
|
|
249
|
+
analyser,
|
|
250
|
+
active,
|
|
251
|
+
state,
|
|
252
|
+
listening,
|
|
253
|
+
speaking,
|
|
254
|
+
generating,
|
|
255
|
+
verifying,
|
|
256
|
+
loading,
|
|
257
|
+
loadingVisualization,
|
|
258
|
+
bars,
|
|
259
|
+
]);
|
|
260
|
+
if (loading && loadingVisualization === 'shimmer-bars') {
|
|
261
|
+
return _jsx(VoiceShimmerBars, { bars: bars, className: className });
|
|
262
|
+
}
|
|
263
|
+
return _jsx("canvas", { ref: canvasRef, className: cn('block h-full', className), "aria-hidden": true });
|
|
264
|
+
}
|
|
265
|
+
function offsetForBars(width, count, step) {
|
|
266
|
+
return (width - count * step) / 2;
|
|
267
|
+
}
|
|
268
|
+
const SHIMMER_BAR_STEP = 5.7;
|
|
269
|
+
const SHIMMER_BAR_WIDTH = 3;
|
|
270
|
+
const SHIMMER_BAR_HEIGHTS = ['35%', '55%', '76%'];
|
|
271
|
+
function VoiceShimmerBars({ bars, className }) {
|
|
272
|
+
const rootRef = React.useRef(null);
|
|
273
|
+
const [barCount, setBarCount] = React.useState(bars ?? 24);
|
|
274
|
+
const resolvedBarCount = bars ?? barCount;
|
|
275
|
+
useCompositedGlint(rootRef);
|
|
276
|
+
React.useLayoutEffect(() => {
|
|
277
|
+
if (bars !== undefined)
|
|
278
|
+
return;
|
|
279
|
+
const root = rootRef.current;
|
|
280
|
+
if (!root || typeof ResizeObserver === 'undefined')
|
|
281
|
+
return;
|
|
282
|
+
const update = () => {
|
|
283
|
+
setBarCount(Math.max(1, Math.floor(root.clientWidth / SHIMMER_BAR_STEP)));
|
|
284
|
+
};
|
|
285
|
+
const observer = new ResizeObserver(update);
|
|
286
|
+
observer.observe(root);
|
|
287
|
+
return () => observer.disconnect();
|
|
288
|
+
}, [bars]);
|
|
289
|
+
return (_jsxs("div", { ref: rootRef, "data-slot": "voice-shimmer-bars", "data-glint-active": "false", className: cn('relative block h-full overflow-hidden', className), "aria-hidden": true, children: [_jsx(VoiceShimmerBarGroup, { count: resolvedBarCount, height: "22%", className: "opacity-[0.16]" }), COMPOSITED_GLINT_BANDS.map((band, index) => (_jsx("span", { "data-composited-glint-window": true, "data-composited-glint-width": band.width, "data-composited-glint-opacity": band.opacity, className: "pointer-events-none absolute inset-y-0 left-0 overflow-hidden opacity-0", style: { width: `${band.width * 100}%` }, children: _jsx(VoiceShimmerBarGroup, { "data-composited-glint-copy": true, count: resolvedBarCount, height: SHIMMER_BAR_HEIGHTS[index] ?? '76%', className: "absolute inset-y-0 left-0", style: { width: `${100 / band.width}%` } }) }, band.width)))] }));
|
|
290
|
+
}
|
|
291
|
+
function VoiceShimmerBarGroup({ count, height, className, style, ...props }) {
|
|
292
|
+
return (_jsx("span", { className: cn('absolute inset-0 flex items-center justify-center gap-[2.7px]', className), style: style, ...props, children: Array.from({ length: count }, (_, index) => (_jsx("span", { className: "block shrink-0 rounded-full bg-current", style: { width: SHIMMER_BAR_WIDTH, height, minHeight: 3 } }, index))) }));
|
|
293
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Weekday, type WeeklySchedule } from '../lib/weekly-schedule.js';
|
|
2
|
+
export interface WeeklyScheduleEditorLabels {
|
|
3
|
+
days: Record<Weekday, string>;
|
|
4
|
+
closed: string;
|
|
5
|
+
addInterval: string;
|
|
6
|
+
removeInterval: string;
|
|
7
|
+
openLabel: (dayLabel: string) => string;
|
|
8
|
+
closeLabel: (dayLabel: string) => string;
|
|
9
|
+
}
|
|
10
|
+
export interface WeeklyScheduleEditorProps {
|
|
11
|
+
schedule: WeeklySchedule;
|
|
12
|
+
onChange: (next: WeeklySchedule) => void;
|
|
13
|
+
labels: WeeklyScheduleEditorLabels;
|
|
14
|
+
}
|
|
15
|
+
export declare function WeeklyScheduleEditor({ schedule, onChange, labels, }: WeeklyScheduleEditorProps): React.ReactElement;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { Plus, Trash2 } from 'lucide-react';
|
|
4
|
+
import { WEEKDAY_ORDER, } from '../lib/weekly-schedule.js';
|
|
5
|
+
import { Button } from './button.js';
|
|
6
|
+
import { Input } from './input.js';
|
|
7
|
+
export function WeeklyScheduleEditor({ schedule, onChange, labels, }) {
|
|
8
|
+
const setDayIntervals = (day, intervals) => {
|
|
9
|
+
const next = {};
|
|
10
|
+
for (const candidate of WEEKDAY_ORDER) {
|
|
11
|
+
const value = candidate === day ? intervals : schedule[candidate];
|
|
12
|
+
if (value?.length)
|
|
13
|
+
next[candidate] = value;
|
|
14
|
+
}
|
|
15
|
+
onChange(next);
|
|
16
|
+
};
|
|
17
|
+
return (_jsx("div", { className: "flex flex-col gap-1.5", children: WEEKDAY_ORDER.map((day) => (_jsx(WeekdayRow, { day: day, intervals: schedule[day] ?? [], labels: labels, onChange: (intervals) => setDayIntervals(day, intervals) }, day))) }));
|
|
18
|
+
}
|
|
19
|
+
function WeekdayRow({ day, intervals, labels, onChange, }) {
|
|
20
|
+
const dayLabel = labels.days[day];
|
|
21
|
+
const setInterval = (index, patch) => onChange(intervals.map((interval, candidate) => candidate === index ? { ...interval, ...patch } : interval));
|
|
22
|
+
const addInterval = () => onChange([...intervals, { start: '09:00', end: '17:00' }]);
|
|
23
|
+
const removeInterval = (index) => onChange(intervals.filter((_, candidate) => candidate !== index));
|
|
24
|
+
return (_jsxs("div", { className: "border-border/60 grid grid-cols-[88px_1fr] items-start gap-3 rounded-lg border px-3 py-2.5", children: [_jsx("span", { className: "text-foreground pt-1.5 text-[12.5px] font-medium", children: dayLabel }), _jsx("div", { className: "flex flex-col gap-1.5", children: intervals.length === 0 ? (_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("span", { className: "text-muted-foreground text-[12px]", children: labels.closed }), _jsxs(Button, { type: "button", size: "xs", variant: "ghost", className: "text-muted-foreground gap-1 text-[11.5px]", onClick: addInterval, children: [_jsx(Plus, { className: "size-3", strokeWidth: 1.8 }), labels.addInterval] })] })) : (_jsxs(_Fragment, { children: [intervals.map((interval, index) => (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(TimeField, { value: interval.start, ariaLabel: labels.openLabel(dayLabel), onChange: (start) => setInterval(index, { start }) }), _jsx("span", { className: "text-muted-foreground text-[12px]", children: "\u2013" }), _jsx(TimeField, { value: interval.end, ariaLabel: labels.closeLabel(dayLabel), onChange: (end) => setInterval(index, { end }) }), _jsx(Button, { type: "button", size: "icon", variant: "ghost", className: "text-muted-foreground hover:text-destructive size-7 shrink-0", "aria-label": labels.removeInterval, onClick: () => removeInterval(index), children: _jsx(Trash2, { className: "size-3.5", strokeWidth: 1.8 }) })] }, index))), _jsxs(Button, { type: "button", size: "xs", variant: "ghost", className: "text-muted-foreground -ml-1 w-fit gap-1 text-[11.5px]", onClick: addInterval, children: [_jsx(Plus, { className: "size-3", strokeWidth: 1.8 }), labels.addInterval] })] })) })] }));
|
|
25
|
+
}
|
|
26
|
+
function TimeField({ value, ariaLabel, onChange, }) {
|
|
27
|
+
return (_jsx(Input, { type: "time", value: value, onChange: (event) => onChange(event.target.value), "aria-label": ariaLabel, className: "w-[124px]" }));
|
|
28
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { type Dispatch, type ReactNode, type SetStateAction } from 'react';
|
|
2
|
+
import { type Connection, type EdgeTypes, type Edge as RfEdge, type Node as RfNode, type NodeTypes, type OnEdgesChange, type OnNodesChange } from 'reactflow';
|
|
3
|
+
import { type StickyNotesController, type StickyNoteLabels } from './sticky-notes.js';
|
|
4
|
+
export type CanvasMode = 'move' | 'select';
|
|
5
|
+
export declare const FLOW_NODE_DND_MIME = "application/atmos-flow-node";
|
|
6
|
+
export type DropAddContext = {
|
|
7
|
+
flow: {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
};
|
|
11
|
+
screen: {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
};
|
|
15
|
+
from?: {
|
|
16
|
+
sourceId: string;
|
|
17
|
+
handleId: string | null;
|
|
18
|
+
};
|
|
19
|
+
to?: {
|
|
20
|
+
targetId: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
/** A node a peer is dragging live, in flow/world coordinates. */
|
|
24
|
+
export type FlowNodeDragPreview = {
|
|
25
|
+
nodeId: string;
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
};
|
|
31
|
+
export type FlowCollaborator = {
|
|
32
|
+
id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
color: string;
|
|
35
|
+
/** Pointer in flow/world coordinates (projected to screen at render). */
|
|
36
|
+
pointer?: {
|
|
37
|
+
x: number;
|
|
38
|
+
y: number;
|
|
39
|
+
} | null;
|
|
40
|
+
selectedNodeIds?: readonly string[];
|
|
41
|
+
drag?: FlowNodeDragPreview | null;
|
|
42
|
+
};
|
|
43
|
+
export interface FlowCanvasController<TData = unknown, TEdge = unknown> {
|
|
44
|
+
nodes: RfNode<TData>[];
|
|
45
|
+
edges: RfEdge<TEdge>[];
|
|
46
|
+
onNodesChange: OnNodesChange;
|
|
47
|
+
onEdgesChange: OnEdgesChange;
|
|
48
|
+
onConnect: (connection: Connection) => void;
|
|
49
|
+
isValidConnection: (connection: Connection) => boolean;
|
|
50
|
+
setNodes: Dispatch<SetStateAction<RfNode<TData>[]>>;
|
|
51
|
+
setEdges: Dispatch<SetStateAction<RfEdge<TEdge>[]>>;
|
|
52
|
+
insertNodeOnEdge: (edgeId: string, kind: string, title: string) => void;
|
|
53
|
+
addConnectedNodeAt: (args: {
|
|
54
|
+
kind: string;
|
|
55
|
+
title: string;
|
|
56
|
+
at: {
|
|
57
|
+
x: number;
|
|
58
|
+
y: number;
|
|
59
|
+
};
|
|
60
|
+
from?: {
|
|
61
|
+
sourceId: string;
|
|
62
|
+
handleId?: string | null;
|
|
63
|
+
};
|
|
64
|
+
to?: {
|
|
65
|
+
targetId: string;
|
|
66
|
+
};
|
|
67
|
+
}) => void;
|
|
68
|
+
removeNode: (id: string) => void;
|
|
69
|
+
removeNodesAndEdges: (nodeIds: readonly string[], edgeIds?: readonly string[]) => void;
|
|
70
|
+
duplicateNode: (id: string) => void;
|
|
71
|
+
undo: () => void;
|
|
72
|
+
redo: () => void;
|
|
73
|
+
canUndo: boolean;
|
|
74
|
+
canRedo: boolean;
|
|
75
|
+
tidy: () => void;
|
|
76
|
+
deselectAll: () => void;
|
|
77
|
+
focusRequest: {
|
|
78
|
+
id: string;
|
|
79
|
+
seq: number;
|
|
80
|
+
} | null;
|
|
81
|
+
annotations?: StickyNotesController['annotations'];
|
|
82
|
+
addAnnotation?: (at?: {
|
|
83
|
+
x: number;
|
|
84
|
+
y: number;
|
|
85
|
+
}) => void;
|
|
86
|
+
updateAnnotation?: StickyNotesController['updateAnnotation'];
|
|
87
|
+
commitAnnotation?: StickyNotesController['commitAnnotation'];
|
|
88
|
+
removeAnnotation?: StickyNotesController['removeAnnotation'];
|
|
89
|
+
}
|
|
90
|
+
export type FlowCanvasLabels = {
|
|
91
|
+
modeMove: string;
|
|
92
|
+
modeSelect: string;
|
|
93
|
+
copy: string;
|
|
94
|
+
paste: string;
|
|
95
|
+
undo: string;
|
|
96
|
+
redo: string;
|
|
97
|
+
tidy: string;
|
|
98
|
+
addNote: string;
|
|
99
|
+
minimapShow: string;
|
|
100
|
+
minimapHide: string;
|
|
101
|
+
closePicker: string;
|
|
102
|
+
stickyNotes: StickyNoteLabels;
|
|
103
|
+
};
|
|
104
|
+
type PickerActions = {
|
|
105
|
+
onPick: (kind: string) => void;
|
|
106
|
+
onClose: () => void;
|
|
107
|
+
};
|
|
108
|
+
export type FlowCanvasFrameProps<TData = unknown, TEdge = unknown> = {
|
|
109
|
+
controller: FlowCanvasController<TData, TEdge>;
|
|
110
|
+
nodeTypes: NodeTypes;
|
|
111
|
+
edgeTypes: EdgeTypes;
|
|
112
|
+
labels: FlowCanvasLabels;
|
|
113
|
+
titleForKind: (kind: string) => string;
|
|
114
|
+
renderDropPicker: (ctx: DropAddContext, actions: PickerActions) => ReactNode;
|
|
115
|
+
renderInsertPicker: (edgeId: string, actions: PickerActions) => ReactNode;
|
|
116
|
+
collaborators?: FlowCollaborator[];
|
|
117
|
+
onPointer?: (pointer: {
|
|
118
|
+
x: number;
|
|
119
|
+
y: number;
|
|
120
|
+
} | null) => void;
|
|
121
|
+
onNodeDragPreview?: (drag: FlowNodeDragPreview | null) => void;
|
|
122
|
+
highlightedNodeId?: string | null;
|
|
123
|
+
highlightedEdgeIds?: ReadonlySet<string>;
|
|
124
|
+
invalidNodeIds?: ReadonlySet<string>;
|
|
125
|
+
showStickyNotes?: boolean;
|
|
126
|
+
onAddPickerReady?: (openAddPicker: () => void) => void;
|
|
127
|
+
onCopySelection?: () => void | Promise<void>;
|
|
128
|
+
onPasteSelection?: () => void | Promise<void>;
|
|
129
|
+
toolbarExtras?: ReactNode;
|
|
130
|
+
rightPanel?: ReactNode;
|
|
131
|
+
onPaneDrop?: (kind: string, flowPosition: {
|
|
132
|
+
x: number;
|
|
133
|
+
y: number;
|
|
134
|
+
}) => void;
|
|
135
|
+
testId?: string;
|
|
136
|
+
collaboratorCursorTestIdPrefix?: string;
|
|
137
|
+
className?: string;
|
|
138
|
+
minimapDefaultThreshold?: number;
|
|
139
|
+
dropPickerWidth?: number;
|
|
140
|
+
dropPickerHeight?: number;
|
|
141
|
+
/** Read-only run replay overlay: disables editing and colors the live graph by run status. */
|
|
142
|
+
replay?: boolean;
|
|
143
|
+
statusByNode?: Readonly<Record<string, string>>;
|
|
144
|
+
durationByNode?: Readonly<Record<string, number>>;
|
|
145
|
+
takenHandlesByNode?: Readonly<Record<string, readonly string[]>>;
|
|
146
|
+
traversedEdgeIds?: ReadonlySet<string>;
|
|
147
|
+
/** Replay-only step selection: a node id on node click, null on pane click. */
|
|
148
|
+
onReplayNodeClick?: (nodeId: string | null) => void;
|
|
149
|
+
/** Content of the replay mode banner (status + exit control), rendered in place of the toolbar. */
|
|
150
|
+
replayBanner?: ReactNode;
|
|
151
|
+
};
|
|
152
|
+
export declare function FlowCanvasFrame<TData = unknown, TEdge = unknown>({ controller, nodeTypes, edgeTypes, labels, titleForKind, renderDropPicker, renderInsertPicker, collaborators, onPointer, onNodeDragPreview, highlightedNodeId, highlightedEdgeIds, invalidNodeIds, showStickyNotes, onAddPickerReady, onCopySelection, onPasteSelection, toolbarExtras, rightPanel, onPaneDrop, testId, collaboratorCursorTestIdPrefix, className, minimapDefaultThreshold, dropPickerWidth, dropPickerHeight, replay, statusByNode, durationByNode, takenHandlesByNode, traversedEdgeIds, onReplayNodeClick, replayBanner, }: FlowCanvasFrameProps<TData, TEdge>): import("react").JSX.Element;
|
|
153
|
+
export declare function ToolbarButton({ active, disabled, title, onClick, children, }: {
|
|
154
|
+
active?: boolean;
|
|
155
|
+
disabled?: boolean;
|
|
156
|
+
title: string;
|
|
157
|
+
onClick: () => void;
|
|
158
|
+
children: ReactNode;
|
|
159
|
+
}): import("react").JSX.Element;
|
|
160
|
+
export {};
|