@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,26 @@
|
|
|
1
|
+
import { type ComponentProps, type ReactNode } from 'react';
|
|
2
|
+
import { Popover as PopoverPrimitive } from 'radix-ui';
|
|
3
|
+
import { PopoverContent } from './popover.js';
|
|
4
|
+
export type StackKind = 'dialog' | 'control';
|
|
5
|
+
export declare function PopoverStackProvider({ children }: {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
type StackedPopoverProps = ComponentProps<typeof PopoverPrimitive.Root>;
|
|
9
|
+
export declare function StackedPopover({ open, onOpenChange, defaultOpen, kind, children, ...rest }: StackedPopoverProps & {
|
|
10
|
+
kind?: StackKind;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
12
|
+
export declare const StackedPopoverTrigger: import("react").ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
13
|
+
export declare const StackedPopoverAnchor: import("react").ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
14
|
+
type StackedPopoverContentProps = ComponentProps<typeof PopoverContent>;
|
|
15
|
+
export declare function StackedPopoverContent({ className, ...rest }: StackedPopoverContentProps): import("react").JSX.Element;
|
|
16
|
+
export declare function useStackDepthBelow(): number;
|
|
17
|
+
export declare function useStackedPopoverNavigation<TPage extends string>(rootPage: TPage): {
|
|
18
|
+
page: TPage;
|
|
19
|
+
canGoBack: boolean;
|
|
20
|
+
pushPage: (next: TPage) => void;
|
|
21
|
+
replacePage: (next: TPage) => void;
|
|
22
|
+
reset: () => void;
|
|
23
|
+
goBack: () => void;
|
|
24
|
+
onEscapeKeyDown: (event: Event) => void;
|
|
25
|
+
};
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useCallback, useContext, useEffect, useId, useMemo, useState, } from 'react';
|
|
4
|
+
import { Popover as PopoverPrimitive } from 'radix-ui';
|
|
5
|
+
import { PopoverContent } from './popover.js';
|
|
6
|
+
import { cn } from '../lib/cn.js';
|
|
7
|
+
const StackContext = createContext(null);
|
|
8
|
+
const DepthBelowContext = createContext(0);
|
|
9
|
+
export function PopoverStackProvider({ children }) {
|
|
10
|
+
const [stack, setStack] = useState([]);
|
|
11
|
+
const callbacks = useMemo(() => ({
|
|
12
|
+
push: (id, kind) => {
|
|
13
|
+
setStack((s) => (s.some((e) => e.id === id) ? s : [...s, { id, kind }]));
|
|
14
|
+
},
|
|
15
|
+
pop: (id) => {
|
|
16
|
+
setStack((s) => (s.some((e) => e.id === id) ? s.filter((e) => e.id !== id) : s));
|
|
17
|
+
},
|
|
18
|
+
}), []);
|
|
19
|
+
const value = useMemo(() => ({ stack, push: callbacks.push, pop: callbacks.pop }), [stack, callbacks]);
|
|
20
|
+
return _jsx(StackContext.Provider, { value: value, children: children });
|
|
21
|
+
}
|
|
22
|
+
export function StackedPopover({ open, onOpenChange, defaultOpen, kind = 'control', children, ...rest }) {
|
|
23
|
+
const id = useId();
|
|
24
|
+
const ctx = useContext(StackContext);
|
|
25
|
+
const push = ctx?.push;
|
|
26
|
+
const pop = ctx?.pop;
|
|
27
|
+
const stack = ctx?.stack;
|
|
28
|
+
const isControlled = open !== undefined;
|
|
29
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen ?? false);
|
|
30
|
+
const isOpen = isControlled ? open : uncontrolledOpen;
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (!push || !pop)
|
|
33
|
+
return;
|
|
34
|
+
if (isOpen)
|
|
35
|
+
push(id, kind);
|
|
36
|
+
else
|
|
37
|
+
pop(id);
|
|
38
|
+
return () => {
|
|
39
|
+
pop(id);
|
|
40
|
+
};
|
|
41
|
+
}, [isOpen, id, kind, push, pop]);
|
|
42
|
+
const depthBelow = useMemo(() => {
|
|
43
|
+
if (!stack)
|
|
44
|
+
return 0;
|
|
45
|
+
const idx = stack.findIndex((e) => e.id === id);
|
|
46
|
+
if (idx === -1)
|
|
47
|
+
return 0;
|
|
48
|
+
return stack.slice(idx + 1).filter((e) => e.kind === 'dialog').length;
|
|
49
|
+
}, [stack, id]);
|
|
50
|
+
const handleOpenChange = (next) => {
|
|
51
|
+
if (!isControlled)
|
|
52
|
+
setUncontrolledOpen(next);
|
|
53
|
+
onOpenChange?.(next);
|
|
54
|
+
};
|
|
55
|
+
return (_jsx(DepthBelowContext.Provider, { value: depthBelow, children: _jsx(PopoverPrimitive.Root, { open: isOpen, onOpenChange: handleOpenChange, defaultOpen: defaultOpen, ...rest, children: children }) }));
|
|
56
|
+
}
|
|
57
|
+
export const StackedPopoverTrigger = PopoverPrimitive.Trigger;
|
|
58
|
+
export const StackedPopoverAnchor = PopoverPrimitive.Anchor;
|
|
59
|
+
export function StackedPopoverContent({ className, ...rest }) {
|
|
60
|
+
const depthBelow = useContext(DepthBelowContext);
|
|
61
|
+
return (_jsx(PopoverContent, { "data-stack-depth-below": depthBelow, className: cn('transition-[transform,opacity,filter] duration-200 ease-out', 'data-[stack-depth-below="1"]:-translate-y-1.5 data-[stack-depth-below="1"]:scale-[0.96] data-[stack-depth-below="1"]:opacity-80', 'data-[stack-depth-below="2"]:-translate-y-3 data-[stack-depth-below="2"]:scale-[0.92] data-[stack-depth-below="2"]:opacity-65', className), ...rest }));
|
|
62
|
+
}
|
|
63
|
+
export function useStackDepthBelow() {
|
|
64
|
+
return useContext(DepthBelowContext);
|
|
65
|
+
}
|
|
66
|
+
export function useStackedPopoverNavigation(rootPage) {
|
|
67
|
+
const [pages, setPages] = useState([rootPage]);
|
|
68
|
+
const page = pages[pages.length - 1] ?? rootPage;
|
|
69
|
+
const canGoBack = pages.length > 1;
|
|
70
|
+
const pushPage = useCallback((next) => {
|
|
71
|
+
setPages((current) => [...current, next]);
|
|
72
|
+
}, []);
|
|
73
|
+
const replacePage = useCallback((next) => {
|
|
74
|
+
setPages((current) => [...current.slice(0, -1), next]);
|
|
75
|
+
}, []);
|
|
76
|
+
const reset = useCallback(() => {
|
|
77
|
+
setPages([rootPage]);
|
|
78
|
+
}, [rootPage]);
|
|
79
|
+
const goBack = useCallback(() => {
|
|
80
|
+
setPages((current) => (current.length > 1 ? current.slice(0, -1) : current));
|
|
81
|
+
}, []);
|
|
82
|
+
const onEscapeKeyDown = useCallback((event) => {
|
|
83
|
+
if (!canGoBack)
|
|
84
|
+
return;
|
|
85
|
+
event.preventDefault();
|
|
86
|
+
goBack();
|
|
87
|
+
}, [canGoBack, goBack]);
|
|
88
|
+
return { page, canGoBack, pushPage, replacePage, reset, goBack, onEscapeKeyDown };
|
|
89
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Popover as PopoverPrimitive } from 'radix-ui';
|
|
3
|
+
declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
declare function PopoverContent({ className, align, sideOffset, portalled, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content> & {
|
|
6
|
+
portalled?: boolean;
|
|
7
|
+
}): React.JSX.Element;
|
|
8
|
+
declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): React.JSX.Element;
|
|
9
|
+
declare function PopoverHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
10
|
+
declare function PopoverTitle({ className, ...props }: React.ComponentProps<'h2'>): React.JSX.Element;
|
|
11
|
+
declare function PopoverDescription({ className, ...props }: React.ComponentProps<'p'>): React.JSX.Element;
|
|
12
|
+
export { Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Popover as PopoverPrimitive } from 'radix-ui';
|
|
5
|
+
import { cn } from '../lib/cn.js';
|
|
6
|
+
function Popover({ ...props }) {
|
|
7
|
+
return _jsx(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
8
|
+
}
|
|
9
|
+
function PopoverTrigger({ ...props }) {
|
|
10
|
+
return _jsx(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
11
|
+
}
|
|
12
|
+
function PopoverContent({ className, align = 'center', sideOffset = 4, portalled = true, ...props }) {
|
|
13
|
+
const content = (_jsx(PopoverPrimitive.Content, { "data-slot": "popover-content", align: align, sideOffset: sideOffset, className: cn('bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg p-2.5 text-sm shadow-md ring-1 outline-hidden duration-100', className), ...props }));
|
|
14
|
+
if (!portalled) {
|
|
15
|
+
return content;
|
|
16
|
+
}
|
|
17
|
+
return _jsx(PopoverPrimitive.Portal, { children: content });
|
|
18
|
+
}
|
|
19
|
+
function PopoverAnchor({ ...props }) {
|
|
20
|
+
return _jsx(PopoverPrimitive.Anchor, { "data-slot": "popover-anchor", ...props });
|
|
21
|
+
}
|
|
22
|
+
function PopoverHeader({ className, ...props }) {
|
|
23
|
+
return (_jsx("div", { "data-slot": "popover-header", className: cn('flex flex-col gap-0.5 text-sm', className), ...props }));
|
|
24
|
+
}
|
|
25
|
+
function PopoverTitle({ className, ...props }) {
|
|
26
|
+
return _jsx("div", { "data-slot": "popover-title", className: cn('font-medium', className), ...props });
|
|
27
|
+
}
|
|
28
|
+
function PopoverDescription({ className, ...props }) {
|
|
29
|
+
return (_jsx("p", { "data-slot": "popover-description", className: cn('text-muted-foreground', className), ...props }));
|
|
30
|
+
}
|
|
31
|
+
export { Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export declare const PORTAL_NEXT_PARAM = "next";
|
|
3
|
+
export declare function buildPortalLoginHref(loginPath: string, destination: string): string;
|
|
4
|
+
export declare function resolvePortalNext(next: string | null | undefined, fallback: string): string;
|
|
5
|
+
export interface PortalLoginBarrierProps {
|
|
6
|
+
isAuthenticated: boolean;
|
|
7
|
+
loginPath: string;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
fallback?: ReactNode;
|
|
10
|
+
replace?: (href: string) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function PortalLoginBarrier({ isAuthenticated, loginPath, children, fallback, replace, }: PortalLoginBarrierProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
export const PORTAL_NEXT_PARAM = 'next';
|
|
5
|
+
export function buildPortalLoginHref(loginPath, destination) {
|
|
6
|
+
const params = new URLSearchParams({ [PORTAL_NEXT_PARAM]: destination });
|
|
7
|
+
return `${loginPath}?${params.toString()}`;
|
|
8
|
+
}
|
|
9
|
+
export function resolvePortalNext(next, fallback) {
|
|
10
|
+
if (!next)
|
|
11
|
+
return fallback;
|
|
12
|
+
const value = next.trim();
|
|
13
|
+
if (!value.startsWith('/') || value.startsWith('//') || value.startsWith('/\\'))
|
|
14
|
+
return fallback;
|
|
15
|
+
if (/^\/[^/]*:/.test(value))
|
|
16
|
+
return fallback;
|
|
17
|
+
return value;
|
|
18
|
+
}
|
|
19
|
+
export function PortalLoginBarrier({ isAuthenticated, loginPath, children, fallback, replace, }) {
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (isAuthenticated)
|
|
22
|
+
return;
|
|
23
|
+
const pathname = window.location.pathname;
|
|
24
|
+
if (pathname.split('?')[0] === loginPath.split('?')[0])
|
|
25
|
+
return;
|
|
26
|
+
const query = window.location.search.slice(1);
|
|
27
|
+
const destination = query ? `${pathname}?${query}` : pathname;
|
|
28
|
+
const href = buildPortalLoginHref(loginPath, destination);
|
|
29
|
+
if (replace)
|
|
30
|
+
replace(href);
|
|
31
|
+
else
|
|
32
|
+
window.location.replace(href);
|
|
33
|
+
}, [isAuthenticated, loginPath, replace]);
|
|
34
|
+
if (!isAuthenticated) {
|
|
35
|
+
return fallback === undefined ? _jsx(BarrierFallback, {}) : _jsx(_Fragment, { children: fallback });
|
|
36
|
+
}
|
|
37
|
+
return _jsx(_Fragment, { children: children });
|
|
38
|
+
}
|
|
39
|
+
function BarrierFallback() {
|
|
40
|
+
return (_jsx("div", { className: "flex min-h-[40vh] items-center justify-center", role: "status", "aria-live": "polite", children: _jsx("span", { className: "border-primary/30 border-t-primary size-6 animate-spin rounded-full border-2", "aria-hidden": true }) }));
|
|
41
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type PresenceStatus = 'online' | 'idle' | 'busy' | 'dnd' | 'invisible' | 'offline' | 'error';
|
|
2
|
+
export interface PresenceDotProps {
|
|
3
|
+
status: PresenceStatus;
|
|
4
|
+
label: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
overlay?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function PresenceDot({ status, label, className, overlay }: PresenceDotProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Circle, CircleAlert, CircleSlash, EyeOff, Moon, Phone } from 'lucide-react';
|
|
4
|
+
import { cn } from '../lib/cn.js';
|
|
5
|
+
export function PresenceDot({ status, label, className, overlay = false }) {
|
|
6
|
+
return (_jsx("span", { role: "img", "aria-label": label, title: label, "data-presence": status, "data-shape": status === 'idle'
|
|
7
|
+
? 'moon'
|
|
8
|
+
: status === 'busy'
|
|
9
|
+
? 'call'
|
|
10
|
+
: status === 'dnd'
|
|
11
|
+
? 'blocked'
|
|
12
|
+
: status === 'error'
|
|
13
|
+
? 'alert'
|
|
14
|
+
: status, className: cn('relative inline-flex shrink-0 items-center justify-center', overlay ? 'absolute right-0 bottom-0 z-10 size-[37.5%] rounded-full' : 'size-2.5', className), children: status === 'online' ? (_jsx(Circle, { "aria-hidden": true, className: "fill-success-9 text-success-9 size-full", strokeWidth: 2 })) : status === 'idle' ? (_jsx(Moon, { "aria-hidden": true, "data-testid": "presence-idle-icon", className: "fill-warning-9 text-warning-9 size-full", strokeWidth: 2 })) : status === 'busy' ? (_jsx(Phone, { "aria-hidden": true, "data-testid": "presence-busy-icon", className: "fill-background text-info-9 size-full", strokeWidth: 2 })) : status === 'dnd' ? (_jsx(CircleSlash, { "aria-hidden": true, "data-testid": "presence-dnd-icon", className: "fill-background text-destructive size-full", strokeWidth: 2 })) : status === 'error' ? (_jsx(CircleAlert, { "aria-hidden": true, "data-testid": "presence-error-icon", className: "fill-background text-destructive size-full", strokeWidth: 2 })) : status === 'invisible' ? (_jsx(EyeOff, { "aria-hidden": true, className: "fill-background text-muted-foreground size-full", strokeWidth: 2 })) : (_jsx(Circle, { "aria-hidden": true, className: "fill-background text-muted-foreground size-full", strokeWidth: 2 })) }));
|
|
15
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type PresencePrincipalKind = 'user' | 'external' | 'naut';
|
|
3
|
+
export interface ProjectedPresencePeer {
|
|
4
|
+
principalId: string;
|
|
5
|
+
name: string;
|
|
6
|
+
kind: PresencePrincipalKind;
|
|
7
|
+
color: string;
|
|
8
|
+
screenX: number;
|
|
9
|
+
screenY: number;
|
|
10
|
+
ghost?: {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
label?: string;
|
|
16
|
+
} | null;
|
|
17
|
+
}
|
|
18
|
+
export interface PresenceCursorsOverlayProps extends React.ComponentProps<'div'> {
|
|
19
|
+
peers: ProjectedPresencePeer[];
|
|
20
|
+
maxCursors?: number;
|
|
21
|
+
overflowCount?: number;
|
|
22
|
+
overflowLabel?: (count: number) => string;
|
|
23
|
+
nautLabel?: string;
|
|
24
|
+
externalLabel?: string;
|
|
25
|
+
personLabel?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare function PresenceCursorsOverlay({ className, peers, maxCursors, overflowCount, overflowLabel, nautLabel, externalLabel, personLabel, ...props }: PresenceCursorsOverlayProps): React.JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Bot, UserRound, MousePointer2 } from 'lucide-react';
|
|
4
|
+
import { cn } from '../lib/cn.js';
|
|
5
|
+
const DEFAULT_MAX_CURSORS = 20;
|
|
6
|
+
function kindLabel(kind, labels) {
|
|
7
|
+
if (kind === 'naut')
|
|
8
|
+
return labels.naut;
|
|
9
|
+
if (kind === 'external')
|
|
10
|
+
return labels.external;
|
|
11
|
+
return labels.person;
|
|
12
|
+
}
|
|
13
|
+
function KindIcon({ kind }) {
|
|
14
|
+
if (kind === 'naut')
|
|
15
|
+
return _jsx(Bot, { className: "size-3 shrink-0", strokeWidth: 1.75, "aria-hidden": true });
|
|
16
|
+
if (kind === 'external')
|
|
17
|
+
return _jsx(UserRound, { className: "size-3 shrink-0", strokeWidth: 1.75, "aria-hidden": true });
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
export function PresenceCursorsOverlay({ className, peers, maxCursors = DEFAULT_MAX_CURSORS, overflowCount = 0, overflowLabel = (count) => `+${count} more`, nautLabel = 'Naut', externalLabel = 'External', personLabel = 'Person', ...props }) {
|
|
21
|
+
const visible = peers.slice(0, Math.max(0, maxCursors));
|
|
22
|
+
const hiddenPeers = Math.max(0, peers.length - visible.length);
|
|
23
|
+
const overflow = overflowCount + hiddenPeers;
|
|
24
|
+
const labels = { naut: nautLabel, external: externalLabel, person: personLabel };
|
|
25
|
+
return (_jsxs("div", { "data-slot": "presence-cursors-overlay", "aria-hidden": true, role: "presentation", className: cn('pointer-events-none absolute inset-0 overflow-hidden', className), ...props, children: [visible.map((peer) => {
|
|
26
|
+
const showKind = peer.kind === 'naut' || peer.kind === 'external';
|
|
27
|
+
return (_jsxs(React.Fragment, { children: [peer.ghost ? (_jsxs("div", { "data-slot": "presence-ghost", className: "absolute rounded-md border border-dashed transition-[transform,width,height] duration-75 ease-[var(--ease-out-expo)] motion-reduce:transition-none", style: {
|
|
28
|
+
transform: `translate3d(${peer.ghost.x}px, ${peer.ghost.y}px, 0)`,
|
|
29
|
+
width: peer.ghost.width,
|
|
30
|
+
height: peer.ghost.height,
|
|
31
|
+
borderColor: peer.color,
|
|
32
|
+
}, children: [_jsx("div", { className: "absolute inset-0 rounded-md opacity-10", style: { backgroundColor: peer.color } }), peer.ghost.label ? (_jsx("span", { className: "absolute -top-5 left-0 max-w-40 truncate rounded-md px-1.5 py-0.5 text-[11px] leading-none font-medium text-white shadow-sm", style: { backgroundColor: peer.color }, children: peer.ghost.label })) : null] })) : null, _jsxs("div", { "data-slot": "presence-cursor", "data-kind": peer.kind, className: "absolute top-0 left-0 flex items-start gap-1 transition-transform duration-75 ease-[var(--ease-out-expo)] will-change-transform motion-reduce:transition-none", style: { transform: `translate3d(${peer.screenX}px, ${peer.screenY}px, 0)` }, children: [_jsx(MousePointer2, { className: "size-4 shrink-0 drop-shadow-sm", strokeWidth: 1.5, style: { color: peer.color, fill: peer.color }, "aria-hidden": true }), _jsxs("span", { className: "flex max-w-40 items-center gap-1 rounded-md px-1.5 py-0.5 text-[11px] leading-none font-medium text-white shadow-sm", style: { backgroundColor: peer.color }, children: [_jsx(KindIcon, { kind: peer.kind }), showKind ? (_jsx("span", { className: "shrink-0 opacity-75", children: kindLabel(peer.kind, labels) })) : null, _jsx("span", { className: "truncate", children: peer.name })] })] })] }, peer.principalId));
|
|
33
|
+
}), overflow > 0 ? (_jsx("span", { "data-slot": "presence-overflow", className: "border-border bg-background/80 text-muted-foreground absolute top-1.5 right-1.5 rounded-md border px-1.5 py-0.5 text-[11px] leading-none font-medium shadow-sm backdrop-blur-sm", children: overflowLabel(overflow) })) : null] }));
|
|
34
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface PropertyListLabels {
|
|
3
|
+
/** Shown for null / undefined / empty-string values. */
|
|
4
|
+
empty: string;
|
|
5
|
+
/** Shown in place of the whole value when `redacted` is set. */
|
|
6
|
+
redacted: string;
|
|
7
|
+
/** Boolean `true`. */
|
|
8
|
+
yes: string;
|
|
9
|
+
/** Boolean `false`. */
|
|
10
|
+
no: string;
|
|
11
|
+
/** Disclosure summary for a nested object with `n` keys. */
|
|
12
|
+
fields: (n: number) => string;
|
|
13
|
+
/** Disclosure summary for a nested array with `n` items. */
|
|
14
|
+
items: (n: number) => string;
|
|
15
|
+
/** Accessible label for the button that appends an item to a scalar array (editable). */
|
|
16
|
+
addItem?: string;
|
|
17
|
+
/** Accessible label for the button that removes an item from a scalar array (editable). */
|
|
18
|
+
removeItem?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface PropertyListProps extends Omit<React.ComponentProps<'div'>, 'children' | 'onChange'> {
|
|
21
|
+
/** Any JSON-ish value — object, array, or primitive. */
|
|
22
|
+
value: unknown;
|
|
23
|
+
/** Replace the entire rendering with the `redacted` label (e.g. a redacted run result). */
|
|
24
|
+
redacted?: boolean;
|
|
25
|
+
/** Localized copy. App-agnostic: the consumer injects translated strings. */
|
|
26
|
+
labels?: Partial<PropertyListLabels>;
|
|
27
|
+
/** BCP-47 locale for date formatting; defaults to the runtime locale. */
|
|
28
|
+
locale?: string;
|
|
29
|
+
/** Nesting depth (0-based) at and beyond which objects/arrays collapse by default. */
|
|
30
|
+
collapseDepth?: number;
|
|
31
|
+
/** Turn scalar values into inline editors. Requires `onValueChange`. */
|
|
32
|
+
editable?: boolean;
|
|
33
|
+
/** Called with the next root value on every edit (editable mode). */
|
|
34
|
+
onValueChange?: (next: unknown) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Optional per-scalar renderer. Called for every leaf value with its field key;
|
|
37
|
+
* return a node to replace the default formatting, or `undefined` to fall back.
|
|
38
|
+
* App-agnostic: the consumer injects domain rendering (e.g. resolving an id to a
|
|
39
|
+
* human "Kind · Title" chip) without this component knowing the domain.
|
|
40
|
+
*/
|
|
41
|
+
renderScalar?: (value: unknown, key: string) => React.ReactNode | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Optional key-label formatter, replacing the default {@link humanizeKey}. Lets a
|
|
44
|
+
* consumer relabel raw JSON keys for display (e.g. strip an `_id` suffix so
|
|
45
|
+
* `status_id` reads as "Status"). Return the humanized label to show.
|
|
46
|
+
*/
|
|
47
|
+
formatKey?: (key: string) => string;
|
|
48
|
+
}
|
|
49
|
+
export declare function humanizeKey(key: string): string;
|
|
50
|
+
export declare function formatScalar(value: unknown, locale?: string): {
|
|
51
|
+
kind: 'empty' | 'text' | 'url' | 'date' | 'number' | 'bool';
|
|
52
|
+
text: string;
|
|
53
|
+
bool?: boolean;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Renders an arbitrary JSON-ish value as friendly, labeled fields — humanized
|
|
57
|
+
* keys, formatted primitives (dates, links, yes/no), collapsible nested groups.
|
|
58
|
+
* Scalar rows are hybrid: the value sits inline (right-aligned) when it fits the
|
|
59
|
+
* width and drops to its own full-width line when it doesn't, so values never
|
|
60
|
+
* shred vertically in a narrow panel. With `editable`, scalars become inline
|
|
61
|
+
* editors. The non-technical alternative to a raw JSON dump. App-agnostic:
|
|
62
|
+
* inject localized `labels`.
|
|
63
|
+
*/
|
|
64
|
+
export declare function PropertyList({ value, redacted, labels, locale, collapseDepth, editable, onValueChange, renderScalar, formatKey, className, ...props }: PropertyListProps): React.JSX.Element;
|