@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,100 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { HighlightStyle, syntaxHighlighting } from '@codemirror/language';
|
|
3
|
+
import { EditorView } from '@codemirror/view';
|
|
4
|
+
import { tags as t } from '@lezer/highlight';
|
|
5
|
+
/**
|
|
6
|
+
* How every CodeMirror surface in atmOS looks.
|
|
7
|
+
*
|
|
8
|
+
* The colours are the app's own tokens rather than a packaged editor theme, so an editor
|
|
9
|
+
* follows the workspace into dark mode and stays the same instrument whether it is holding
|
|
10
|
+
* a SQL statement, a formula, or a file off a machine. A packaged theme would be a second
|
|
11
|
+
* palette to keep in sync with the first, and it would be wrong the moment the app's is.
|
|
12
|
+
*/
|
|
13
|
+
export const atmosEditorTheme = EditorView.theme({
|
|
14
|
+
'&': {
|
|
15
|
+
color: 'var(--foreground)',
|
|
16
|
+
backgroundColor: 'transparent',
|
|
17
|
+
},
|
|
18
|
+
'&.cm-focused': { outline: 'none' },
|
|
19
|
+
'.cm-scroller': {
|
|
20
|
+
fontFamily: 'var(--font-mono, ui-monospace, monospace)',
|
|
21
|
+
lineHeight: '1.6',
|
|
22
|
+
},
|
|
23
|
+
'.cm-content': {
|
|
24
|
+
fontFamily: 'var(--font-mono, ui-monospace, monospace)',
|
|
25
|
+
caretColor: 'var(--foreground)',
|
|
26
|
+
padding: '8px 0',
|
|
27
|
+
},
|
|
28
|
+
'.cm-cursor, .cm-dropCursor': { borderLeftColor: 'var(--foreground)' },
|
|
29
|
+
'.cm-placeholder': { color: 'var(--muted-foreground)' },
|
|
30
|
+
'.cm-selectionBackground, &.cm-focused .cm-selectionBackground, .cm-content ::selection': {
|
|
31
|
+
backgroundColor: 'color-mix(in oklch, var(--primary) 22%, transparent)',
|
|
32
|
+
},
|
|
33
|
+
'.cm-activeLine': {
|
|
34
|
+
backgroundColor: 'color-mix(in oklch, var(--muted) 45%, transparent)',
|
|
35
|
+
},
|
|
36
|
+
'.cm-gutters': {
|
|
37
|
+
backgroundColor: 'transparent',
|
|
38
|
+
color: 'color-mix(in oklch, var(--muted-foreground) 70%, transparent)',
|
|
39
|
+
border: 'none',
|
|
40
|
+
},
|
|
41
|
+
'.cm-activeLineGutter': {
|
|
42
|
+
backgroundColor: 'color-mix(in oklch, var(--muted) 45%, transparent)',
|
|
43
|
+
color: 'var(--foreground)',
|
|
44
|
+
},
|
|
45
|
+
'.cm-lineNumbers .cm-gutterElement': { padding: '0 8px 0 12px', minWidth: '0' },
|
|
46
|
+
'.cm-matchingBracket': {
|
|
47
|
+
backgroundColor: 'color-mix(in oklch, var(--primary) 18%, transparent)',
|
|
48
|
+
outline: 'none',
|
|
49
|
+
color: 'inherit',
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
/**
|
|
53
|
+
* One palette across every grammar. Markdown gets structure without changing size or
|
|
54
|
+
* family — a heading reads as a heading, but the file still reads as a file, which is the
|
|
55
|
+
* difference between an editor and a preview.
|
|
56
|
+
*/
|
|
57
|
+
export const atmosEditorHighlight = HighlightStyle.define([
|
|
58
|
+
{
|
|
59
|
+
tag: [t.keyword, t.modifier, t.operatorKeyword, t.controlKeyword, t.definitionKeyword],
|
|
60
|
+
color: 'var(--cm-keyword)',
|
|
61
|
+
fontWeight: '600',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
tag: [t.typeName, t.standard(t.name), t.number, t.bool, t.null, t.atom],
|
|
65
|
+
color: 'var(--cm-number)',
|
|
66
|
+
},
|
|
67
|
+
{ tag: [t.string, t.special(t.string), t.character], color: 'var(--cm-string)' },
|
|
68
|
+
{
|
|
69
|
+
tag: [t.function(t.variableName), t.function(t.propertyName), t.special(t.name)],
|
|
70
|
+
color: 'var(--cm-function)',
|
|
71
|
+
},
|
|
72
|
+
{ tag: [t.propertyName, t.attributeName], color: 'var(--cm-name)' },
|
|
73
|
+
{ tag: [t.name, t.variableName], color: 'var(--cm-ident)' },
|
|
74
|
+
{
|
|
75
|
+
tag: [
|
|
76
|
+
t.operator,
|
|
77
|
+
t.punctuation,
|
|
78
|
+
t.separator,
|
|
79
|
+
t.paren,
|
|
80
|
+
t.bracket,
|
|
81
|
+
t.squareBracket,
|
|
82
|
+
t.brace,
|
|
83
|
+
],
|
|
84
|
+
color: 'var(--cm-operator)',
|
|
85
|
+
},
|
|
86
|
+
{ tag: [t.comment, t.lineComment, t.blockComment], color: 'var(--muted-foreground)', fontStyle: 'italic' },
|
|
87
|
+
{ tag: t.heading, color: 'var(--cm-keyword)', fontWeight: '600' },
|
|
88
|
+
{ tag: t.strong, fontWeight: '600' },
|
|
89
|
+
{ tag: t.emphasis, fontStyle: 'italic' },
|
|
90
|
+
{ tag: t.link, color: 'var(--cm-function)', textDecoration: 'underline' },
|
|
91
|
+
{ tag: t.url, color: 'var(--cm-string)' },
|
|
92
|
+
{ tag: t.monospace, color: 'var(--cm-string)' },
|
|
93
|
+
{ tag: [t.meta, t.processingInstruction], color: 'var(--muted-foreground)' },
|
|
94
|
+
{ tag: t.invalid, color: 'var(--destructive)' },
|
|
95
|
+
]);
|
|
96
|
+
/** The theme and its highlighting, which are only ever wanted together. */
|
|
97
|
+
export const atmosEditorAppearance = [
|
|
98
|
+
atmosEditorTheme,
|
|
99
|
+
syntaxHighlighting(atmosEditorHighlight),
|
|
100
|
+
];
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const headerVariants: (props?: ({
|
|
4
|
+
size?: "panel" | "settings" | null | undefined;
|
|
5
|
+
variant?: "section" | "row" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export type CollapsibleSectionHeaderVariant = 'section' | 'row';
|
|
8
|
+
type CollapsibleSectionHeaderContainerProps = Omit<React.ComponentPropsWithoutRef<'div'>, 'children' | 'className'> & {
|
|
9
|
+
[key: `data-${string}`]: string | number | boolean | undefined;
|
|
10
|
+
};
|
|
11
|
+
type CollapsibleSectionHeaderCommonProps = Omit<React.ComponentProps<'button'>, 'onClick' | 'onToggle'> & VariantProps<typeof headerVariants> & {
|
|
12
|
+
open: boolean;
|
|
13
|
+
onToggle: () => void;
|
|
14
|
+
label: React.ReactNode;
|
|
15
|
+
leadingIcon?: React.ReactNode;
|
|
16
|
+
depth?: number;
|
|
17
|
+
badge?: React.ReactNode;
|
|
18
|
+
action?: React.ReactNode;
|
|
19
|
+
actionVisibility?: 'hover' | 'persistent' | 'always';
|
|
20
|
+
containerProps?: CollapsibleSectionHeaderContainerProps;
|
|
21
|
+
labelClassName?: string;
|
|
22
|
+
className?: string;
|
|
23
|
+
};
|
|
24
|
+
export type CollapsibleSectionHeaderProps = CollapsibleSectionHeaderCommonProps & ({
|
|
25
|
+
onLabelClick: React.MouseEventHandler<HTMLElement>;
|
|
26
|
+
labelProps?: Omit<React.ComponentPropsWithoutRef<'button'>, 'children' | 'onClick'>;
|
|
27
|
+
toggleLabel: string;
|
|
28
|
+
onClick?: never;
|
|
29
|
+
} | {
|
|
30
|
+
onLabelClick?: never;
|
|
31
|
+
labelProps?: never;
|
|
32
|
+
toggleLabel?: string;
|
|
33
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
34
|
+
});
|
|
35
|
+
export declare const CollapsibleSectionHeader: React.ForwardRefExoticComponent<(Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "onClick" | "onToggle"> & VariantProps<(props?: ({
|
|
36
|
+
size?: "panel" | "settings" | null | undefined;
|
|
37
|
+
variant?: "section" | "row" | null | undefined;
|
|
38
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
|
|
39
|
+
open: boolean;
|
|
40
|
+
onToggle: () => void;
|
|
41
|
+
label: React.ReactNode;
|
|
42
|
+
leadingIcon?: React.ReactNode;
|
|
43
|
+
depth?: number;
|
|
44
|
+
badge?: React.ReactNode;
|
|
45
|
+
action?: React.ReactNode;
|
|
46
|
+
actionVisibility?: "hover" | "persistent" | "always";
|
|
47
|
+
containerProps?: CollapsibleSectionHeaderContainerProps;
|
|
48
|
+
labelClassName?: string;
|
|
49
|
+
className?: string;
|
|
50
|
+
} & {
|
|
51
|
+
onLabelClick: React.MouseEventHandler<HTMLElement>;
|
|
52
|
+
labelProps?: Omit<React.ComponentPropsWithoutRef<"button">, "children" | "onClick">;
|
|
53
|
+
toggleLabel: string;
|
|
54
|
+
onClick?: never;
|
|
55
|
+
}, "ref"> | Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "onClick" | "onToggle"> & VariantProps<(props?: ({
|
|
56
|
+
size?: "panel" | "settings" | null | undefined;
|
|
57
|
+
variant?: "section" | "row" | null | undefined;
|
|
58
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
|
|
59
|
+
open: boolean;
|
|
60
|
+
onToggle: () => void;
|
|
61
|
+
label: React.ReactNode;
|
|
62
|
+
leadingIcon?: React.ReactNode;
|
|
63
|
+
depth?: number;
|
|
64
|
+
badge?: React.ReactNode;
|
|
65
|
+
action?: React.ReactNode;
|
|
66
|
+
actionVisibility?: "hover" | "persistent" | "always";
|
|
67
|
+
containerProps?: CollapsibleSectionHeaderContainerProps;
|
|
68
|
+
labelClassName?: string;
|
|
69
|
+
className?: string;
|
|
70
|
+
} & {
|
|
71
|
+
onLabelClick?: never;
|
|
72
|
+
labelProps?: never;
|
|
73
|
+
toggleLabel?: string;
|
|
74
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
75
|
+
}, "ref">) & React.RefAttributes<HTMLDivElement>>;
|
|
76
|
+
export interface CollapsibleSectionContentProps extends React.ComponentProps<'div'> {
|
|
77
|
+
open?: boolean;
|
|
78
|
+
innerClassName?: string;
|
|
79
|
+
unmountOnExit?: boolean;
|
|
80
|
+
}
|
|
81
|
+
export declare const CollapsibleSectionContent: React.ForwardRefExoticComponent<Omit<CollapsibleSectionContentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
82
|
+
export { headerVariants as collapsibleSectionHeaderVariants };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ChevronRight } from 'lucide-react';
|
|
5
|
+
import { cva } from 'class-variance-authority';
|
|
6
|
+
import { cn } from '../lib/cn.js';
|
|
7
|
+
import { RowTrailing } from './row-trailing.js';
|
|
8
|
+
import { NavigableListItem } from './navigable-list.js';
|
|
9
|
+
import { sidePanelRowClassName } from './side-panel-tokens.js';
|
|
10
|
+
const headerVariants = cva('text-muted-foreground/75 flex min-w-0 cursor-pointer items-center font-medium outline-none transition-colors group-hover/section-header:text-foreground focus-visible:text-foreground', {
|
|
11
|
+
variants: {
|
|
12
|
+
size: {
|
|
13
|
+
panel: 'h-7 px-2 text-[11px]',
|
|
14
|
+
settings: 'h-6 px-2 text-[10.5px] text-muted-foreground/75',
|
|
15
|
+
},
|
|
16
|
+
variant: {
|
|
17
|
+
section: 'flex-1 gap-1.5',
|
|
18
|
+
// A row takes its left inset from the container, which is where depth is counted,
|
|
19
|
+
// so the trigger adds none of its own and lands on the same x as a labelled row.
|
|
20
|
+
row: 'gap-1 px-0 text-[12.5px] text-muted-foreground',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: { size: 'panel', variant: 'section' },
|
|
24
|
+
});
|
|
25
|
+
const Chevron = ({ open }) => (_jsx(ChevronRight, { "data-slot": "collapsible-section-chevron", className: cn('text-muted-foreground/70 size-2.5 shrink-0 opacity-0 transition-[opacity,transform] duration-125 ease-[var(--ease-out-expo)] group-hover/section-header:opacity-100 group-has-[:focus-visible]/section-header:opacity-100 motion-reduce:transition-none', open && 'rotate-90'), strokeWidth: 1.5, "aria-hidden": true }));
|
|
26
|
+
export const CollapsibleSectionHeader = React.forwardRef(function CollapsibleSectionHeader({ open, onToggle, label, leadingIcon, depth = 0, badge, action, actionVisibility = 'hover', onLabelClick, labelProps, toggleLabel, containerProps, size, variant = 'section', className, labelClassName, onKeyDown, ...props }, ref) {
|
|
27
|
+
const actionSwapsWithBadge = Boolean(action) && actionVisibility === 'hover';
|
|
28
|
+
const labelId = React.useId();
|
|
29
|
+
const { style: containerStyle, ...restContainerProps } = containerProps ?? {};
|
|
30
|
+
const depthStyle = {
|
|
31
|
+
...containerStyle,
|
|
32
|
+
...(variant === 'row' ? { paddingLeft: 8 + depth * 12 } : {}),
|
|
33
|
+
};
|
|
34
|
+
const handleDisclosureKeyDown = (event, additionalHandler) => {
|
|
35
|
+
additionalHandler?.(event);
|
|
36
|
+
onKeyDown?.(event);
|
|
37
|
+
if (event.defaultPrevented)
|
|
38
|
+
return;
|
|
39
|
+
if (event.key === 'ArrowRight' && !open) {
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
onToggle();
|
|
42
|
+
}
|
|
43
|
+
else if (event.key === 'ArrowLeft' && open) {
|
|
44
|
+
event.preventDefault();
|
|
45
|
+
onToggle();
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
return (_jsxs("div", { ref: ref, "data-slot": "collapsible-section-header", "data-open": open, "data-variant": variant, "data-depth": depth, className: cn(sidePanelRowClassName(), 'group/section-header group/side-panel-item cursor-pointer px-0 pr-1', variant === 'row' && 'font-normal', className), style: depthStyle, ...restContainerProps, children: [onLabelClick ? (_jsxs("div", { "data-slot": "collapsible-section-label-trigger", className: cn('relative flex min-w-0 flex-1 items-center',
|
|
49
|
+
// The toggle-button branch takes its left gutter from headerVariants; this
|
|
50
|
+
// branch has no such button, so it carries the same gutter itself — without
|
|
51
|
+
// it a clickable-label header sits a padding to the left of every sibling row.
|
|
52
|
+
variant === 'row' ? 'gap-2' : 'pl-2'), children: [_jsx(NavigableListItem, { children: _jsx("button", { type: "button", ...labelProps, "aria-labelledby": labelProps?.['aria-label'] ? undefined : labelId, onClick: onLabelClick, onKeyDown: (event) => handleDisclosureKeyDown(event, labelProps?.onKeyDown), className: cn('absolute inset-0 w-full rounded-md outline-none', labelProps?.className), ...props }) }), leadingIcon ? (_jsx("span", { "data-slot": "collapsible-section-leading-icon", className: "pointer-events-none relative flex size-4 shrink-0 items-center justify-center", children: leadingIcon })) : null, _jsx("span", { id: labelId, "data-slot": "collapsible-section-label", className: cn('pointer-events-none relative truncate text-[12.5px] font-medium', labelClassName), children: label }), _jsx("button", { type: "button", "aria-label": toggleLabel, "aria-expanded": open, onPointerDown: (event) => event.stopPropagation(), onClick: (event) => {
|
|
53
|
+
event.stopPropagation();
|
|
54
|
+
onToggle();
|
|
55
|
+
}, onKeyDown: handleDisclosureKeyDown, className: "relative flex size-7 shrink-0 items-center justify-center rounded-sm outline-none", children: _jsx(Chevron, { open: open }) }), actionSwapsWithBadge ? null : badge] })) : (_jsx(NavigableListItem, { children: _jsxs("button", { type: "button", "aria-expanded": open, onClick: onToggle, onKeyDown: handleDisclosureKeyDown, className: cn(headerVariants({ size, variant }), 'flex-1'), ...props, children: [leadingIcon ? (_jsx("span", { "data-slot": "collapsible-section-leading-icon", className: "flex size-4 shrink-0 items-center justify-center", children: leadingIcon })) : null, _jsx("span", { "data-slot": "collapsible-section-label", className: cn('truncate', labelClassName), children: label }), _jsx(Chevron, { open: open }), actionSwapsWithBadge || !badge ? null : _jsx("span", { className: "ml-auto", children: badge })] }) })), actionSwapsWithBadge ? (_jsx(RowTrailing, { className: "mr-1.5", resting: badge, actions: action })) : action ? (_jsx("span", { className: cn('ml-auto flex items-center gap-0.5', actionVisibility === 'persistent' &&
|
|
56
|
+
'opacity-60 transition-opacity group-hover/section-header:opacity-100 group-has-[:focus-visible]/section-header:opacity-100'), children: action })) : null] }));
|
|
57
|
+
});
|
|
58
|
+
export const CollapsibleSectionContent = React.forwardRef(function CollapsibleSectionContent({ open = true, unmountOnExit = false, className, innerClassName, children, onTransitionEnd, ...props }, ref) {
|
|
59
|
+
const [present, setPresent] = React.useState(open);
|
|
60
|
+
React.useEffect(() => {
|
|
61
|
+
const reduceMotion = !open &&
|
|
62
|
+
unmountOnExit &&
|
|
63
|
+
typeof window.matchMedia === 'function' &&
|
|
64
|
+
window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
65
|
+
if (!open && !reduceMotion)
|
|
66
|
+
return;
|
|
67
|
+
const frame = window.requestAnimationFrame(() => setPresent(open));
|
|
68
|
+
return () => window.cancelAnimationFrame(frame);
|
|
69
|
+
}, [open, unmountOnExit]);
|
|
70
|
+
return (_jsx("div", { ref: ref, ...props, "data-slot": "collapsible-section-content", "data-open": open, "aria-hidden": open ? undefined : true, inert: open ? undefined : true, className: cn('grid overflow-hidden transition-[grid-template-rows,opacity] duration-150 ease-[var(--ease-out-expo)] motion-reduce:transition-none', open ? 'grid-rows-[1fr] opacity-100' : 'grid-rows-[0fr] opacity-0', className), onTransitionEnd: (event) => {
|
|
71
|
+
onTransitionEnd?.(event);
|
|
72
|
+
if (unmountOnExit &&
|
|
73
|
+
!open &&
|
|
74
|
+
event.target === event.currentTarget &&
|
|
75
|
+
event.propertyName === 'grid-template-rows') {
|
|
76
|
+
setPresent(false);
|
|
77
|
+
}
|
|
78
|
+
}, children: _jsx("div", { className: "min-h-0 overflow-hidden", children: _jsx("div", { className: cn('origin-top transition-[opacity,transform] duration-125 ease-[var(--ease-out-expo)] motion-reduce:transition-none', open
|
|
79
|
+
? 'translate-y-0 scale-100 opacity-100 delay-50'
|
|
80
|
+
: '-translate-y-0.5 scale-[0.97] opacity-0', innerClassName), children: !unmountOnExit || open || present ? children : null }) }) }));
|
|
81
|
+
});
|
|
82
|
+
export { headerVariants as collapsibleSectionHeaderVariants };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { GroupItemOrder } from '../../lib/view-query/index.js';
|
|
3
|
+
export declare const collectionViewSettingsRowClass: string;
|
|
4
|
+
export interface CollectionViewSettingsGroupAxis {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export interface CollectionViewSettingsGroupItem {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
icon?: ReactNode;
|
|
13
|
+
empty?: boolean;
|
|
14
|
+
hidden?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface CollectionViewSettingsGroupLabels {
|
|
17
|
+
groupBy: string;
|
|
18
|
+
groupOrder: string;
|
|
19
|
+
orderManual: string;
|
|
20
|
+
orderAlphabetical: string;
|
|
21
|
+
orderItemCount: string;
|
|
22
|
+
hideEmptyGroups: string;
|
|
23
|
+
groups: string;
|
|
24
|
+
showAllGroups: string;
|
|
25
|
+
removeGrouping: string;
|
|
26
|
+
reorder: string;
|
|
27
|
+
showGroup: (group: string) => string;
|
|
28
|
+
hideGroup: (group: string) => string;
|
|
29
|
+
}
|
|
30
|
+
export interface CollectionViewSettingsGroupAxisPageLabels {
|
|
31
|
+
search: string;
|
|
32
|
+
noMatches: string;
|
|
33
|
+
}
|
|
34
|
+
export interface CollectionViewSettingsGroupAxisPageProps {
|
|
35
|
+
axes: readonly CollectionViewSettingsGroupAxis[];
|
|
36
|
+
value?: string;
|
|
37
|
+
onSelect: (id: string) => void;
|
|
38
|
+
labels: CollectionViewSettingsGroupAxisPageLabels;
|
|
39
|
+
testIdPrefix: string;
|
|
40
|
+
}
|
|
41
|
+
export interface CollectionViewSettingsSelectRowOption {
|
|
42
|
+
id: string;
|
|
43
|
+
label: string;
|
|
44
|
+
icon?: ReactNode;
|
|
45
|
+
}
|
|
46
|
+
export interface CollectionViewSettingsSelectRowProps {
|
|
47
|
+
icon: ReactNode;
|
|
48
|
+
label: string;
|
|
49
|
+
value: string;
|
|
50
|
+
options: readonly CollectionViewSettingsSelectRowOption[];
|
|
51
|
+
selectedId: string;
|
|
52
|
+
onSelect?: (id: string) => void;
|
|
53
|
+
testId: string;
|
|
54
|
+
}
|
|
55
|
+
export interface CollectionViewSettingsGroupPageProps {
|
|
56
|
+
axes: readonly CollectionViewSettingsGroupAxis[];
|
|
57
|
+
value: string;
|
|
58
|
+
items: readonly CollectionViewSettingsGroupItem[];
|
|
59
|
+
itemOrder: GroupItemOrder;
|
|
60
|
+
hideEmptyGroups: boolean;
|
|
61
|
+
labels: CollectionViewSettingsGroupLabels;
|
|
62
|
+
testIdPrefix: string;
|
|
63
|
+
onOpenAxisPage: () => void;
|
|
64
|
+
onRemoveGrouping: () => void;
|
|
65
|
+
onItemOrderChange?: (next: GroupItemOrder) => void;
|
|
66
|
+
onReorderItems?: (ids: string[]) => void;
|
|
67
|
+
onHideEmptyGroupsChange?: (next: boolean) => void;
|
|
68
|
+
onToggleItemVisibility?: (id: string) => void;
|
|
69
|
+
onShowAllItems?: () => void;
|
|
70
|
+
}
|
|
71
|
+
export declare function CollectionViewSettingsSelectRow({ icon, label, value, options, selectedId, onSelect, testId, }: CollectionViewSettingsSelectRowProps): React.ReactElement;
|
|
72
|
+
export declare function CollectionViewSettingsGroupAxisPage({ axes, value, onSelect, labels, testIdPrefix, }: CollectionViewSettingsGroupAxisPageProps): React.ReactElement;
|
|
73
|
+
export declare function CollectionViewSettingsGroupPage({ axes, value, items, itemOrder, hideEmptyGroups, labels, testIdPrefix, onOpenAxisPage, onRemoveGrouping, onItemOrderChange, onReorderItems, onHideEmptyGroupsChange, onToggleItemVisibility, onShowAllItems, }: CollectionViewSettingsGroupPageProps): React.ReactElement;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { ArrowDownUp, ChevronRight, Eye, EyeOff, GripVertical, Trash2, Type, } from 'lucide-react';
|
|
5
|
+
import { Button } from '../button.js';
|
|
6
|
+
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, } from '../command.js';
|
|
7
|
+
import { DragHandle, SortableList } from '../sortable.js';
|
|
8
|
+
import { Switch } from '../switch.js';
|
|
9
|
+
import { CollectionViewSettingsSectionRow } from './collection-view-settings.js';
|
|
10
|
+
import { viewListRowClass } from '../../lib/view-chrome.js';
|
|
11
|
+
import { cn } from '../../lib/cn.js';
|
|
12
|
+
export const collectionViewSettingsRowClass = cn(viewListRowClass, 'flex w-full items-center gap-2 text-left leading-none');
|
|
13
|
+
const NO_GROUPING_AXIS_ID = 'none';
|
|
14
|
+
export function CollectionViewSettingsSelectRow({ icon, label, value, options, selectedId, onSelect, testId, }) {
|
|
15
|
+
const [open, setOpen] = useState(false);
|
|
16
|
+
return (_jsxs("div", { className: "relative", children: [_jsxs("button", { type: "button", onClick: () => setOpen((prev) => !prev), className: cn(collectionViewSettingsRowClass, 'text-foreground hover:bg-muted/55'), "data-testid": testId, children: [_jsx("span", { className: "text-muted-foreground", children: icon }), _jsx("span", { className: "min-w-0 flex-1 truncate", children: label }), _jsx("span", { className: "text-muted-foreground max-w-[126px] truncate", children: value }), _jsx(ChevronRight, { className: cn('text-muted-foreground/70 size-4 shrink-0 transition-transform', open && 'rotate-90'), strokeWidth: 1.8 })] }), open ? (_jsx("div", { className: "border-border/60 bg-background mx-2 mb-1 grid gap-0.5 rounded-lg border p-1", children: options.map((option) => (_jsxs("button", { type: "button", onClick: () => {
|
|
17
|
+
onSelect?.(option.id);
|
|
18
|
+
setOpen(false);
|
|
19
|
+
}, "data-checked": option.id === selectedId ? 'true' : undefined, className: cn(collectionViewSettingsRowClass, option.id === selectedId
|
|
20
|
+
? 'text-foreground'
|
|
21
|
+
: 'text-muted-foreground hover:text-foreground'), children: [option.icon ? _jsx("span", { className: "text-muted-foreground", children: option.icon }) : null, _jsx("span", { className: "min-w-0 flex-1 truncate", children: option.label })] }, option.id))) })) : null] }));
|
|
22
|
+
}
|
|
23
|
+
export function CollectionViewSettingsGroupAxisPage({ axes, value, onSelect, labels, testIdPrefix, }) {
|
|
24
|
+
return (_jsxs(Command, { className: "rounded-none bg-transparent p-0 pt-1", children: [_jsx(CommandInput, { variant: "boxed", placeholder: labels.search }), _jsxs(CommandList, { className: "max-h-[336px] px-2 pb-2", children: [_jsx(CommandEmpty, { className: "text-muted-foreground py-6 text-[12px]", children: labels.noMatches }), _jsx(CommandGroup, { className: "p-0", children: axes
|
|
25
|
+
.filter((axis) => axis.id !== NO_GROUPING_AXIS_ID)
|
|
26
|
+
.map((axis) => {
|
|
27
|
+
const active = value === axis.id;
|
|
28
|
+
return (_jsxs(CommandItem, { value: axis.label, "data-checked": active ? 'true' : undefined, onSelect: () => onSelect(axis.id), className: cn('text-[13px]', active ? 'text-foreground' : 'text-muted-foreground hover:text-foreground'), "data-testid": `${testIdPrefix}-groupby-${axis.id}`, children: [axis.icon ? _jsx("span", { className: "inline-flex shrink-0", children: axis.icon }) : null, _jsx("span", { className: "min-w-0 flex-1 truncate", children: axis.label })] }, axis.id));
|
|
29
|
+
}) })] })] }));
|
|
30
|
+
}
|
|
31
|
+
export function CollectionViewSettingsGroupPage({ axes, value, items, itemOrder, hideEmptyGroups, labels, testIdPrefix, onOpenAxisPage, onRemoveGrouping, onItemOrderChange, onReorderItems, onHideEmptyGroupsChange, onToggleItemVisibility, onShowAllItems, }) {
|
|
32
|
+
const currentAxis = axes.find((axis) => axis.id === value);
|
|
33
|
+
const orderOptions = [
|
|
34
|
+
{
|
|
35
|
+
id: 'manual',
|
|
36
|
+
label: labels.orderManual,
|
|
37
|
+
icon: _jsx(GripVertical, { className: "size-4", strokeWidth: 1.7 }),
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: 'alphabetical',
|
|
41
|
+
label: labels.orderAlphabetical,
|
|
42
|
+
icon: _jsx(Type, { className: "size-4", strokeWidth: 1.7 }),
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: 'item_count',
|
|
46
|
+
label: labels.orderItemCount,
|
|
47
|
+
icon: _jsx(ArrowDownUp, { className: "size-4", strokeWidth: 1.7 }),
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
const hiddenCount = items.filter((item) => item.hidden).length;
|
|
51
|
+
return (_jsxs("div", { className: "grid gap-0", children: [_jsx(CollectionViewSettingsSectionRow, { icon: currentAxis?.icon, label: labels.groupBy, summary: currentAxis?.label, onClick: onOpenAxisPage, testId: `${testIdPrefix}-group-setting-axis` }), _jsx(CollectionViewSettingsSelectRow, { icon: _jsx(GripVertical, { className: "size-4", strokeWidth: 1.7 }), label: labels.groupOrder, value: orderOptions.find((option) => option.id === itemOrder)?.label ?? labels.orderManual, options: orderOptions, selectedId: itemOrder, onSelect: (next) => onItemOrderChange?.(next), testId: `${testIdPrefix}-group-setting-order` }), _jsxs("label", { className: cn(collectionViewSettingsRowClass, 'text-foreground hover:bg-muted/55 cursor-pointer'), children: [_jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.hideEmptyGroups }), _jsx(Switch, { size: "sm", checked: hideEmptyGroups, onCheckedChange: (next) => onHideEmptyGroupsChange?.(next), "aria-label": labels.hideEmptyGroups, "data-testid": `${testIdPrefix}-hide-empty-groups` })] }), _jsx("div", { className: "bg-border/60 mx-1 my-2 h-px" }), _jsxs("div", { className: "flex h-8 items-center justify-between gap-2 px-2", children: [_jsx("span", { className: "text-muted-foreground text-[12px] font-medium", children: labels.groups }), hiddenCount > 0 ? (_jsx(Button, { type: "button", variant: "link", onClick: onShowAllItems, className: "h-auto p-0 text-[12px]", "data-testid": `${testIdPrefix}-show-all-groups`, children: labels.showAllGroups })) : null] }), _jsx(SortableList, { items: [...items], keyOf: (item) => item.id, handle: true, disabled: !onReorderItems || items.length < 2, onReorder: (_, detail) => onReorderItems?.(detail.nextIds), className: "grid max-h-[176px] gap-0.5 overflow-y-auto pr-1", renderItem: (item, args) => (_jsx(GroupItemRow, { item: item, dragHandleProps: args.dragHandleProps, isDragging: args.isDragging, onToggleVisibility: onToggleItemVisibility, visibilityLabel: item.hidden ? labels.showGroup(item.label) : labels.hideGroup(item.label), reorderLabel: labels.reorder, testIdPrefix: testIdPrefix })) }), _jsx("div", { className: "bg-border/60 mx-1 my-2 h-px" }), _jsxs("button", { type: "button", onClick: onRemoveGrouping, className: cn(collectionViewSettingsRowClass, 'text-muted-foreground hover:bg-muted/55 hover:text-foreground'), "data-testid": `${testIdPrefix}-remove-grouping`, children: [_jsx(Trash2, { className: "size-4", strokeWidth: 1.7 }), _jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.removeGrouping })] })] }));
|
|
52
|
+
}
|
|
53
|
+
function GroupItemRow({ item, dragHandleProps, isDragging, onToggleVisibility, visibilityLabel, reorderLabel, testIdPrefix, }) {
|
|
54
|
+
return (_jsxs("div", { className: cn(collectionViewSettingsRowClass, 'group', item.hidden && 'text-muted-foreground/60', isDragging && 'relative z-10 opacity-70 shadow-sm'), children: [_jsx(DragHandle, { dragHandleProps: dragHandleProps, "aria-label": reorderLabel, className: "text-muted-foreground/60 size-4 shrink-0 opacity-100" }), item.icon ? _jsx("span", { className: "inline-flex shrink-0 items-center", children: item.icon }) : null, _jsx("span", { className: cn('min-w-0 flex-1 truncate text-[13px]', item.hidden ? 'line-through' : 'text-foreground/90', item.empty && !item.hidden && 'text-muted-foreground'), children: item.label }), _jsx(Button, { type: "button", variant: "ghost", size: "icon-xs", onClick: () => onToggleVisibility?.(item.id), "aria-pressed": !item.hidden, "aria-label": visibilityLabel, title: visibilityLabel, disabled: !onToggleVisibility, className: "text-muted-foreground hover:text-foreground size-6 rounded-lg", "data-testid": `${testIdPrefix}-toggle-group-${item.id}`, children: item.hidden ? (_jsx(EyeOff, { className: "size-3.5", strokeWidth: 1.7 })) : (_jsx(Eye, { className: "size-3.5", strokeWidth: 1.7 })) })] }));
|
|
55
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { type ComponentProps, type ReactNode } from 'react';
|
|
2
|
+
import { StackedPopoverContent } from '../popover-stack.js';
|
|
3
|
+
import { Button } from '../button.js';
|
|
4
|
+
export interface CollectionViewSettingsLabels {
|
|
5
|
+
settings: string;
|
|
6
|
+
back: string;
|
|
7
|
+
close: string;
|
|
8
|
+
searchFields: string;
|
|
9
|
+
noFields: string;
|
|
10
|
+
refineSearch: string;
|
|
11
|
+
}
|
|
12
|
+
export interface CollectionViewSettingsSection {
|
|
13
|
+
id: string;
|
|
14
|
+
label: string;
|
|
15
|
+
icon?: ReactNode;
|
|
16
|
+
summary?: ReactNode;
|
|
17
|
+
content: ReactNode;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
showInRoot?: boolean;
|
|
20
|
+
testId?: string;
|
|
21
|
+
contentPadding?: 'default' | 'none';
|
|
22
|
+
}
|
|
23
|
+
export interface CollectionViewSettingsProps {
|
|
24
|
+
labels: CollectionViewSettingsLabels;
|
|
25
|
+
sections: readonly CollectionViewSettingsSection[];
|
|
26
|
+
identity?: CollectionViewSettingsIdentityProps;
|
|
27
|
+
open?: boolean;
|
|
28
|
+
defaultOpen?: boolean;
|
|
29
|
+
onOpenChange?: (open: boolean) => void;
|
|
30
|
+
align?: ComponentProps<typeof StackedPopoverContent>['align'];
|
|
31
|
+
triggerTestId?: string;
|
|
32
|
+
triggerClassName?: string;
|
|
33
|
+
contentClassName?: string;
|
|
34
|
+
showTriggerLabel?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface CollectionViewSettingsIdentityProps {
|
|
37
|
+
name: string;
|
|
38
|
+
icon?: ReactNode;
|
|
39
|
+
renameLabel: string;
|
|
40
|
+
readOnly?: boolean;
|
|
41
|
+
onRename?: (name: string) => void | Promise<void>;
|
|
42
|
+
}
|
|
43
|
+
export interface CollectionViewSettingsChoice<TValue extends string> {
|
|
44
|
+
value: TValue;
|
|
45
|
+
label: string;
|
|
46
|
+
icon?: ReactNode;
|
|
47
|
+
}
|
|
48
|
+
export interface CollectionViewSettingsChoiceGroupProps<TValue extends string> {
|
|
49
|
+
value: TValue;
|
|
50
|
+
choices: readonly CollectionViewSettingsChoice<TValue>[];
|
|
51
|
+
onChange: (value: TValue) => void;
|
|
52
|
+
columns?: 2 | 3;
|
|
53
|
+
presentation?: 'row' | 'tile';
|
|
54
|
+
testIdPrefix?: string;
|
|
55
|
+
className?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface CollectionViewSettingsNavigation {
|
|
58
|
+
page: string;
|
|
59
|
+
openPage: (page: string) => void;
|
|
60
|
+
replacePage: (page: string) => void;
|
|
61
|
+
goBack: () => void;
|
|
62
|
+
close: () => void;
|
|
63
|
+
}
|
|
64
|
+
export declare function useCollectionViewSettingsNavigation(): CollectionViewSettingsNavigation;
|
|
65
|
+
export declare function CollectionViewSettings({ labels, sections, identity, open: controlledOpen, defaultOpen, onOpenChange, align, triggerTestId, triggerClassName, contentClassName, showTriggerLabel, }: CollectionViewSettingsProps): React.ReactElement;
|
|
66
|
+
export declare function CollectionViewSettingsIdentity({ name, icon, renameLabel, readOnly, onRename, }: CollectionViewSettingsIdentityProps): React.ReactElement;
|
|
67
|
+
export declare function CollectionViewSettingsChoiceGroup<TValue extends string>({ value, choices, onChange, columns, presentation, testIdPrefix, className, }: CollectionViewSettingsChoiceGroupProps<TValue>): React.ReactElement;
|
|
68
|
+
export declare function CollectionViewSettingsSectionRow({ label, icon, summary, disabled, testId, onClick, }: Omit<CollectionViewSettingsSection, 'id' | 'content'> & {
|
|
69
|
+
onClick: () => void;
|
|
70
|
+
}): import("react").JSX.Element;
|
|
71
|
+
export declare function CollectionViewSettingsPage({ className, padding, ...props }: ComponentProps<'div'> & {
|
|
72
|
+
padding?: 'default' | 'none';
|
|
73
|
+
}): React.ReactElement;
|
|
74
|
+
export declare function CollectionViewSettingsAddAction({ children, className, ...props }: ComponentProps<typeof Button>): React.ReactElement;
|
|
75
|
+
export interface CollectionViewSettingsField<TField extends string = string> {
|
|
76
|
+
id: TField;
|
|
77
|
+
label: string;
|
|
78
|
+
icon?: ReactNode;
|
|
79
|
+
keywords?: readonly string[];
|
|
80
|
+
disabled?: boolean;
|
|
81
|
+
}
|
|
82
|
+
export interface CollectionViewSettingsFieldPickerProps<TField extends string = string> {
|
|
83
|
+
fields: readonly CollectionViewSettingsField<TField>[];
|
|
84
|
+
labels: Pick<CollectionViewSettingsLabels, 'searchFields' | 'noFields' | 'refineSearch'>;
|
|
85
|
+
onSelect: (field: TField) => void;
|
|
86
|
+
selectedField?: TField;
|
|
87
|
+
selectedFields?: ReadonlySet<TField>;
|
|
88
|
+
className?: string;
|
|
89
|
+
}
|
|
90
|
+
export declare function CollectionViewSettingsFieldPicker<TField extends string>({ fields, labels, onSelect, selectedField, selectedFields, className, }: CollectionViewSettingsFieldPickerProps<TField>): React.ReactElement;
|
|
91
|
+
export interface CollectionViewSettingsSort<TField extends string = string> {
|
|
92
|
+
id: string;
|
|
93
|
+
field: TField;
|
|
94
|
+
dir: 'asc' | 'desc';
|
|
95
|
+
}
|
|
96
|
+
export interface CollectionViewSettingsSortPageProps<TField extends string = string> {
|
|
97
|
+
sorts: readonly CollectionViewSettingsSort<TField>[];
|
|
98
|
+
fields: readonly CollectionViewSettingsField<TField>[];
|
|
99
|
+
labels: {
|
|
100
|
+
addSort: string;
|
|
101
|
+
ascending: string;
|
|
102
|
+
descending: string;
|
|
103
|
+
chooseField: string;
|
|
104
|
+
remove: string;
|
|
105
|
+
reorder: string;
|
|
106
|
+
searchFields: string;
|
|
107
|
+
};
|
|
108
|
+
onChange: (sorts: CollectionViewSettingsSort<TField>[]) => void;
|
|
109
|
+
createSort: (field: TField) => CollectionViewSettingsSort<TField>;
|
|
110
|
+
className?: string;
|
|
111
|
+
addButtonTestId?: string;
|
|
112
|
+
noFieldsLabel?: string;
|
|
113
|
+
refineSearchLabel: string;
|
|
114
|
+
}
|
|
115
|
+
export declare function CollectionViewSettingsSortPage<TField extends string>({ sorts, fields, labels, onChange, createSort, className, addButtonTestId, noFieldsLabel, refineSearchLabel, }: CollectionViewSettingsSortPageProps<TField>): React.ReactElement;
|