@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,101 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export function cartesianMetrics(props, stacked) {
|
|
3
|
+
const w = 720;
|
|
4
|
+
const h = 220;
|
|
5
|
+
const axis = props.axis;
|
|
6
|
+
const showXAxis = axis?.showXAxis ?? true;
|
|
7
|
+
const showYAxis = axis?.showYAxis ?? true;
|
|
8
|
+
const pad = {
|
|
9
|
+
l: showYAxis ? (axis?.yLabel ? 62 : 44) : 20,
|
|
10
|
+
r: 16,
|
|
11
|
+
t: 14,
|
|
12
|
+
b: showXAxis ? (axis?.xLabel ? 46 : 32) : 16,
|
|
13
|
+
};
|
|
14
|
+
const innerW = w - pad.l - pad.r;
|
|
15
|
+
const innerH = h - pad.t - pad.b;
|
|
16
|
+
const yKeys = props.yKeys ?? ['value'];
|
|
17
|
+
const values = stacked
|
|
18
|
+
? props.data
|
|
19
|
+
.map((row) => yKeys.reduce((sum, key) => sum + Math.max(0, Number(row[key] ?? 0)), 0))
|
|
20
|
+
.filter(Number.isFinite)
|
|
21
|
+
: yKeys.flatMap((key) => props.data.map((row) => Number(row[key] ?? 0))).filter(Number.isFinite);
|
|
22
|
+
const max = Math.max(...values, 1);
|
|
23
|
+
const y = (value) => pad.t + innerH * (1 - value / max);
|
|
24
|
+
const x = (index) => props.data.length > 1 ? pad.l + (innerW / (props.data.length - 1)) * index : pad.l + innerW / 2;
|
|
25
|
+
return {
|
|
26
|
+
w,
|
|
27
|
+
h,
|
|
28
|
+
pad,
|
|
29
|
+
innerW,
|
|
30
|
+
innerH,
|
|
31
|
+
max,
|
|
32
|
+
axis,
|
|
33
|
+
showXAxis,
|
|
34
|
+
showYAxis,
|
|
35
|
+
y,
|
|
36
|
+
x,
|
|
37
|
+
valueFormatter: props.valueFormatter,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
const compactNumber = new Intl.NumberFormat(undefined, {
|
|
41
|
+
notation: 'compact',
|
|
42
|
+
maximumFractionDigits: 1,
|
|
43
|
+
});
|
|
44
|
+
function formatCompactNumber(value) {
|
|
45
|
+
return compactNumber.format(Math.round(value));
|
|
46
|
+
}
|
|
47
|
+
export function CartesianGrid({ data, xKey, w, h, pad, innerW, innerH, max, axis, showXAxis, showYAxis, valueFormatter, banded = false, }) {
|
|
48
|
+
const showGrid = axis?.showGrid ?? true;
|
|
49
|
+
const yTickCount = Math.max(2, Math.min(axis?.yTickCount ?? 4, 8, Math.floor(max) + 1));
|
|
50
|
+
const xTickCount = Math.max(2, Math.min(axis?.xTickCount ?? 6, 12));
|
|
51
|
+
const xEvery = Math.max(1, Math.ceil(data.length / xTickCount));
|
|
52
|
+
const format = valueFormatter ?? formatCompactNumber;
|
|
53
|
+
const xPosition = (index) => banded
|
|
54
|
+
? pad.l + (innerW / Math.max(1, data.length)) * (index + 0.5)
|
|
55
|
+
: data.length > 1
|
|
56
|
+
? pad.l + (innerW / (data.length - 1)) * index
|
|
57
|
+
: pad.l + innerW / 2;
|
|
58
|
+
return (_jsxs("g", { "aria-hidden": true, children: [showGrid
|
|
59
|
+
? Array.from({ length: yTickCount }).map((_, index) => {
|
|
60
|
+
const y = pad.t + (innerH / (yTickCount - 1)) * index;
|
|
61
|
+
return (_jsx("line", { x1: pad.l, x2: w - pad.r, y1: y, y2: y, stroke: "currentColor", strokeOpacity: 0.09 }, index));
|
|
62
|
+
})
|
|
63
|
+
: null, showYAxis
|
|
64
|
+
? Array.from({ length: yTickCount }).map((_, index) => {
|
|
65
|
+
const value = max * (1 - index / (yTickCount - 1));
|
|
66
|
+
const y = pad.t + (innerH / (yTickCount - 1)) * index;
|
|
67
|
+
return (_jsx("text", { x: pad.l - 10, y: y + 3, textAnchor: "end", fill: "currentColor", opacity: 0.52, fontSize: "9", children: format(value) }, `y-${index}`));
|
|
68
|
+
})
|
|
69
|
+
: null, showXAxis ? (_jsx(_Fragment, { children: data.map((row, index) => {
|
|
70
|
+
if (index % xEvery !== 0 && index !== data.length - 1)
|
|
71
|
+
return null;
|
|
72
|
+
return (_jsx("text", { x: xPosition(index), y: h - (axis?.xLabel ? 24 : 10), textAnchor: "middle", fill: "currentColor", opacity: 0.58, fontSize: "9", children: String(row[xKey] ?? index + 1) }, `x-${index}`));
|
|
73
|
+
}) })) : null, showXAxis && axis?.xLabel ? (_jsx("text", { x: pad.l + innerW / 2, y: h - 6, textAnchor: "middle", fill: "currentColor", opacity: 0.58, fontSize: "10", children: axis.xLabel })) : null, showYAxis && axis?.yLabel ? (_jsx("text", { x: 16, y: pad.t + innerH / 2, textAnchor: "middle", transform: `rotate(-90 16 ${pad.t + innerH / 2})`, fill: "currentColor", opacity: 0.58, fontSize: "10", children: axis.yLabel })) : null] }));
|
|
74
|
+
}
|
|
75
|
+
export function categoricalMetrics(height) {
|
|
76
|
+
const w = 720;
|
|
77
|
+
const h = Math.max(170, Math.min(height, 420));
|
|
78
|
+
return {
|
|
79
|
+
w,
|
|
80
|
+
h,
|
|
81
|
+
cx: w / 2,
|
|
82
|
+
cy: h / 2,
|
|
83
|
+
r: Math.min(82, h / 2 - 22),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
export function piePath(cx, cy, r, start, end) {
|
|
87
|
+
const large = end - start > Math.PI ? 1 : 0;
|
|
88
|
+
const x1 = cx + Math.cos(start) * r;
|
|
89
|
+
const y1 = cy + Math.sin(start) * r;
|
|
90
|
+
const x2 = cx + Math.cos(end) * r;
|
|
91
|
+
const y2 = cy + Math.sin(end) * r;
|
|
92
|
+
return `M ${cx} ${cy} L ${x1.toFixed(2)} ${y1.toFixed(2)} A ${r} ${r} 0 ${large} 1 ${x2.toFixed(2)} ${y2.toFixed(2)} Z`;
|
|
93
|
+
}
|
|
94
|
+
export function ringArcPath(cx, cy, r, start, end) {
|
|
95
|
+
const large = end - start > Math.PI ? 1 : 0;
|
|
96
|
+
const x1 = cx + Math.cos(start) * r;
|
|
97
|
+
const y1 = cy + Math.sin(start) * r;
|
|
98
|
+
const x2 = cx + Math.cos(end) * r;
|
|
99
|
+
const y2 = cy + Math.sin(end) * r;
|
|
100
|
+
return `M ${x1.toFixed(2)} ${y1.toFixed(2)} A ${r} ${r} 0 ${large} 1 ${x2.toFixed(2)} ${y2.toFixed(2)}`;
|
|
101
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../../lib/cn.js';
|
|
3
|
+
export function ChartLegend({ items, position = 'top', className, }) {
|
|
4
|
+
if (items.length === 0)
|
|
5
|
+
return null;
|
|
6
|
+
return (_jsx("div", { className: cn('text-muted-foreground flex flex-wrap gap-x-4 gap-y-1.5 text-[11px]', position === 'right' && 'content-start', className), children: items.map((item) => (_jsxs("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [_jsx("span", { className: "size-2 shrink-0 rounded-full", style: { backgroundColor: item.color }, "aria-hidden": true }), _jsx("span", { className: "truncate", children: item.label })] }, item.label))) }));
|
|
7
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from 'react';
|
|
3
|
+
import { cn } from '../../lib/cn.js';
|
|
4
|
+
import { chartColor } from './colors.js';
|
|
5
|
+
import { ChartTooltip, useCartesianHover } from './hover.js';
|
|
6
|
+
import { CartesianGrid, cartesianMetrics } from './layout.js';
|
|
7
|
+
export function LineAreaChart(props) {
|
|
8
|
+
const { data, xKey = 'label', yKeys = ['value'], dashedKeys, colors, className, variant } = props;
|
|
9
|
+
const fillId = `chart-fill-${useId().replaceAll(':', '')}`;
|
|
10
|
+
const metrics = cartesianMetrics(props, false);
|
|
11
|
+
const format = props.valueFormatter ?? ((value) => String(value));
|
|
12
|
+
const { state: hoverState, move, clear } = useCartesianHover(metrics, data.length, false);
|
|
13
|
+
const hoveredRow = hoverState ? data[hoverState.index] : undefined;
|
|
14
|
+
return (_jsxs("div", { className: "relative h-full w-full", children: [_jsxs("svg", { viewBox: `0 0 ${metrics.w} ${metrics.h}`, className: cn('h-full w-full overflow-visible', className), role: "img", "aria-label": props.ariaLabel, onPointerMove: move, onPointerLeave: clear, children: [_jsx("defs", { children: yKeys.map((key, index) => (_jsxs("linearGradient", { id: `${fillId}-${index}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [_jsx("stop", { offset: "0%", stopColor: chartColor(colors, index), stopOpacity: "0.22" }), _jsx("stop", { offset: "100%", stopColor: chartColor(colors, index), stopOpacity: "0.02" })] }, key))) }), _jsx(CartesianGrid, { ...metrics, data: data, xKey: xKey }), hoverState ? (_jsx("line", { x1: metrics.x(hoverState.index), x2: metrics.x(hoverState.index), y1: metrics.pad.t, y2: metrics.pad.t + metrics.innerH, stroke: "currentColor", strokeOpacity: 0.18, strokeDasharray: "3 3", "aria-hidden": true })) : null, yKeys.map((key, keyIndex) => {
|
|
15
|
+
const points = data.map((row, index) => row[key] == null ? undefined : { x: metrics.x(index), y: metrics.y(Number(row[key])) });
|
|
16
|
+
const runs = contiguousRuns(points);
|
|
17
|
+
const baseline = metrics.pad.t + metrics.innerH;
|
|
18
|
+
const dashed = dashedKeys?.includes(key) ?? false;
|
|
19
|
+
const hoveredPoint = hoverState ? points[hoverState.index] : undefined;
|
|
20
|
+
return (_jsxs("g", { children: [runs.map((run) => {
|
|
21
|
+
const line = smoothLinePath(run);
|
|
22
|
+
const first = run[0];
|
|
23
|
+
const last = run[run.length - 1];
|
|
24
|
+
if (!first || !last)
|
|
25
|
+
return null;
|
|
26
|
+
const area = `${line} L${last.x.toFixed(2)},${baseline} L${first.x.toFixed(2)},${baseline} Z`;
|
|
27
|
+
return (_jsxs("g", { children: [variant === 'area' ? (_jsx("path", { d: area, fill: `url(#${fillId}-${keyIndex})`, className: "animate-in fade-in origin-bottom duration-500" })) : null, _jsx("path", { d: line, fill: "none", stroke: chartColor(colors, keyIndex), strokeWidth: keyIndex === 0 ? 2.4 : 1.8, strokeDasharray: dashed ? '5 4' : undefined, strokeLinecap: "round", strokeLinejoin: "round", className: "animate-in fade-in duration-500" })] }, first.x));
|
|
28
|
+
}), hoveredPoint ? (_jsx("circle", { cx: hoveredPoint.x, cy: hoveredPoint.y, r: 3.6, fill: chartColor(colors, keyIndex), stroke: "var(--background)", strokeWidth: 1.5, "aria-hidden": true })) : null] }, key));
|
|
29
|
+
})] }), hoverState && hoveredRow ? (_jsx(ChartTooltip, { state: hoverState, row: hoveredRow, xKey: xKey, yKeys: yKeys, colors: colors, format: format })) : null] }));
|
|
30
|
+
}
|
|
31
|
+
function contiguousRuns(points) {
|
|
32
|
+
const runs = [];
|
|
33
|
+
let current = [];
|
|
34
|
+
for (const point of points) {
|
|
35
|
+
if (point) {
|
|
36
|
+
current.push(point);
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
if (current.length)
|
|
40
|
+
runs.push(current);
|
|
41
|
+
current = [];
|
|
42
|
+
}
|
|
43
|
+
if (current.length)
|
|
44
|
+
runs.push(current);
|
|
45
|
+
return runs;
|
|
46
|
+
}
|
|
47
|
+
// Monotone cubic interpolation (Fritsch–Carlson), so the curve never overshoots data points.
|
|
48
|
+
function smoothLinePath(points) {
|
|
49
|
+
const [first] = points;
|
|
50
|
+
if (!first)
|
|
51
|
+
return '';
|
|
52
|
+
if (points.length < 3) {
|
|
53
|
+
return points
|
|
54
|
+
.map((p, i) => `${i === 0 ? 'M' : 'L'}${p.x.toFixed(2)},${p.y.toFixed(2)}`)
|
|
55
|
+
.join(' ');
|
|
56
|
+
}
|
|
57
|
+
const spans = points.slice(0, -1).map((p0, i) => {
|
|
58
|
+
const p1 = points[i + 1] ?? p0;
|
|
59
|
+
const h = p1.x - p0.x;
|
|
60
|
+
return { h, slope: h !== 0 ? (p1.y - p0.y) / h : 0 };
|
|
61
|
+
});
|
|
62
|
+
const tangents = points.map((_, i) => {
|
|
63
|
+
const before = spans[i - 1];
|
|
64
|
+
const after = spans[i];
|
|
65
|
+
if (!before)
|
|
66
|
+
return after?.slope ?? 0;
|
|
67
|
+
if (!after)
|
|
68
|
+
return before.slope;
|
|
69
|
+
if (before.slope * after.slope <= 0)
|
|
70
|
+
return 0;
|
|
71
|
+
return ((3 * (before.h + after.h)) /
|
|
72
|
+
((2 * after.h + before.h) / before.slope + (after.h + 2 * before.h) / after.slope));
|
|
73
|
+
});
|
|
74
|
+
const segments = [`M${first.x.toFixed(2)},${first.y.toFixed(2)}`];
|
|
75
|
+
spans.forEach((span, i) => {
|
|
76
|
+
const p0 = points[i];
|
|
77
|
+
const p1 = points[i + 1];
|
|
78
|
+
if (!p0 || !p1)
|
|
79
|
+
return;
|
|
80
|
+
const h = span.h / 3;
|
|
81
|
+
const c1y = p0.y + (tangents[i] ?? 0) * h;
|
|
82
|
+
const c2y = p1.y - (tangents[i + 1] ?? 0) * h;
|
|
83
|
+
segments.push(`C${(p0.x + h).toFixed(2)},${c1y.toFixed(2)} ${(p1.x - h).toFixed(2)},${c2y.toFixed(2)} ${p1.x.toFixed(2)},${p1.y.toFixed(2)}`);
|
|
84
|
+
});
|
|
85
|
+
return segments.join(' ');
|
|
86
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../../lib/cn.js';
|
|
3
|
+
import { chartColor } from './colors.js';
|
|
4
|
+
import { categoricalMetrics, piePath } from './layout.js';
|
|
5
|
+
export function PieChart({ data, categoryKey = 'label', valueKey = 'value', colors, height = 220, ariaLabel, valueFormatter, className, }) {
|
|
6
|
+
const { w, h, cx, cy, r } = categoricalMetrics(height);
|
|
7
|
+
const total = data.reduce((sum, row) => sum + Math.max(0, Number(row[valueKey] ?? 0)), 0) || 1;
|
|
8
|
+
const format = valueFormatter ?? ((value) => String(value));
|
|
9
|
+
const slices = data.reduce((acc, row, index) => {
|
|
10
|
+
const value = Math.max(0, Number(row[valueKey] ?? 0));
|
|
11
|
+
const start = acc[index - 1]?.end ?? -Math.PI / 2;
|
|
12
|
+
const end = start + (value / total) * Math.PI * 2;
|
|
13
|
+
acc.push({ row, value, start, end, index });
|
|
14
|
+
return acc;
|
|
15
|
+
}, []);
|
|
16
|
+
return (_jsxs("svg", { viewBox: `0 0 ${w} ${h}`, className: cn('h-full w-full overflow-visible', className), role: "img", "aria-label": ariaLabel, children: [slices.map(({ row, value, start, end, index }) => {
|
|
17
|
+
const label = String(row[categoryKey] ?? index + 1);
|
|
18
|
+
const angle = (value / total) * Math.PI * 2;
|
|
19
|
+
const d = angle >= Math.PI * 2 - 0.0001 ? undefined : piePath(cx, cy, r, start, end);
|
|
20
|
+
return d ? (_jsx("path", { d: d, fill: chartColor(colors, index), stroke: "var(--background)", strokeWidth: 1.5, className: "animate-in fade-in zoom-in-95 duration-300 hover:opacity-90", children: _jsx("title", { children: `${label}: ${format(value)}` }) }, label)) : (_jsx("circle", { cx: cx, cy: cy, r: r, fill: chartColor(colors, index), stroke: "var(--background)", strokeWidth: 1.5, transform: `rotate(${start} ${cx} ${cy})`, className: "animate-in fade-in zoom-in-95 duration-300 hover:opacity-90", children: _jsx("title", { children: `${label}: ${format(value)}` }) }, label));
|
|
21
|
+
}), _jsx("circle", { cx: cx, cy: cy, r: r * 0.42, fill: "var(--background)", opacity: 0.94 })] }));
|
|
22
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../../lib/cn.js';
|
|
3
|
+
import { chartColor } from './colors.js';
|
|
4
|
+
import { categoricalMetrics } from './layout.js';
|
|
5
|
+
export function RadarChart({ data, categoryKey = 'label', valueKey = 'value', colors, height = 220, ariaLabel, maxValue, valueFormatter, className, }) {
|
|
6
|
+
const { w, h, cx, cy } = categoricalMetrics(height);
|
|
7
|
+
const r = Math.min(82, h / 2 - 22);
|
|
8
|
+
const observedMax = Math.max(...data.map((row) => Number(row[valueKey] ?? 0)).filter(Number.isFinite), 1);
|
|
9
|
+
const domainMax = maxValue ?? (observedMax <= 10 ? 10 : observedMax <= 100 ? 100 : observedMax);
|
|
10
|
+
const format = valueFormatter ?? ((value) => String(value));
|
|
11
|
+
const points = data.map((row, index) => {
|
|
12
|
+
const angle = -Math.PI / 2 + (index / data.length) * Math.PI * 2;
|
|
13
|
+
const value = Number(row[valueKey] ?? 0);
|
|
14
|
+
const rr = r * (value / domainMax);
|
|
15
|
+
const x = cx + Math.cos(angle) * rr;
|
|
16
|
+
const y = cy + Math.sin(angle) * rr;
|
|
17
|
+
return {
|
|
18
|
+
x,
|
|
19
|
+
y,
|
|
20
|
+
value,
|
|
21
|
+
label: String(row[categoryKey] ?? index + 1),
|
|
22
|
+
point: `${x.toFixed(2)},${y.toFixed(2)}`,
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
return (_jsxs("svg", { viewBox: `0 0 ${w} ${h}`, className: cn('h-full w-full overflow-visible', className), role: "img", "aria-label": ariaLabel, children: [[0.25, 0.5, 0.75, 1].map((scale) => (_jsx("circle", { cx: cx, cy: cy, r: r * scale, fill: "none", stroke: "currentColor", strokeOpacity: 0.1 }, scale))), data.map((_row, index) => {
|
|
26
|
+
const angle = -Math.PI / 2 + (index / data.length) * Math.PI * 2;
|
|
27
|
+
return (_jsx("line", { x1: cx, y1: cy, x2: cx + Math.cos(angle) * r, y2: cy + Math.sin(angle) * r, stroke: "currentColor", strokeOpacity: 0.1 }, index));
|
|
28
|
+
}), _jsx("polygon", { points: points.map((point) => point.point).join(' '), fill: chartColor(colors, 0), fillOpacity: 0.18, stroke: chartColor(colors, 0), strokeWidth: 2, className: "animate-in fade-in zoom-in-95 duration-500" }), points.map((point, index) => (_jsx("circle", { cx: point.x, cy: point.y, r: 3.4, fill: chartColor(colors, index), stroke: "var(--background)", strokeWidth: 1.2, className: "animate-in zoom-in-50 duration-300 hover:opacity-80", children: _jsx("title", { children: `${point.label}: ${format(point.value)}` }) }, point.label)))] }));
|
|
29
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../../lib/cn.js';
|
|
3
|
+
import { chartColor } from './colors.js';
|
|
4
|
+
import { categoricalMetrics, ringArcPath } from './layout.js';
|
|
5
|
+
export function RadialChart({ data, categoryKey = 'label', valueKey = 'value', colors, height = 220, ariaLabel, maxValue, valueFormatter, className, }) {
|
|
6
|
+
const { w, h, cx, cy } = categoricalMetrics(height);
|
|
7
|
+
const values = data.map((row) => Math.max(0, Number(row[valueKey] ?? 0)));
|
|
8
|
+
const observedMax = Math.max(...values, 1);
|
|
9
|
+
const domainMax = maxValue ?? (observedMax <= 100 ? 100 : observedMax);
|
|
10
|
+
const format = valueFormatter ?? ((value) => String(value));
|
|
11
|
+
return (_jsx("svg", { viewBox: `0 0 ${w} ${h}`, className: cn('h-full w-full overflow-visible', className), role: "img", "aria-label": ariaLabel, children: data.slice(0, 5).map((row, index) => {
|
|
12
|
+
const value = values[index] ?? 0;
|
|
13
|
+
const radius = 82 - index * 13;
|
|
14
|
+
const width = 7;
|
|
15
|
+
const progress = Math.max(0.01, Math.min(value / domainMax, 1));
|
|
16
|
+
const label = String(row[categoryKey] ?? index + 1);
|
|
17
|
+
return (_jsxs("g", { children: [_jsx("circle", { cx: cx, cy: cy, r: radius, fill: "none", stroke: "currentColor", strokeOpacity: 0.1, strokeWidth: width }), _jsx("path", { d: ringArcPath(cx, cy, radius, -Math.PI / 2, -Math.PI / 2 + progress * Math.PI * 2), fill: "none", stroke: chartColor(colors, index), strokeLinecap: "round", strokeWidth: width, className: "animate-in fade-in duration-500 hover:opacity-80", children: _jsx("title", { children: `${label}: ${format(value)}` }) })] }, label));
|
|
18
|
+
}) }));
|
|
19
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../../lib/cn.js';
|
|
3
|
+
import { chartColor } from './colors.js';
|
|
4
|
+
import { CartesianGrid, cartesianMetrics } from './layout.js';
|
|
5
|
+
export function ScatterChart(props) {
|
|
6
|
+
const { data, xKey = 'x', valueKey = props.yKeys?.[0] ?? 'value', colors, className } = props;
|
|
7
|
+
const metrics = cartesianMetrics({ ...props, yKeys: [valueKey] }, false);
|
|
8
|
+
const xValues = data.map((row) => Number(row[xKey] ?? 0)).filter(Number.isFinite);
|
|
9
|
+
const xMax = Math.max(...xValues, 1);
|
|
10
|
+
const format = props.valueFormatter ?? ((value) => String(value));
|
|
11
|
+
return (_jsxs("svg", { viewBox: `0 0 ${metrics.w} ${metrics.h}`, className: cn('h-full w-full overflow-visible', className), role: "img", "aria-label": props.ariaLabel, children: [_jsx(CartesianGrid, { ...metrics, data: data, xKey: xKey }), data.map((row, index) => {
|
|
12
|
+
const xv = Number(row[xKey] ?? index + 1);
|
|
13
|
+
const yv = Number(row[valueKey] ?? 0);
|
|
14
|
+
return (_jsx("circle", { cx: metrics.pad.l + metrics.innerW * (xv / xMax), cy: metrics.y(yv), r: 4.5, fill: chartColor(colors, index), opacity: 0.88, className: "animate-in zoom-in-50 duration-300 hover:opacity-100", children: _jsx("title", { children: `${xv}: ${format(yv)}` }) }, index));
|
|
15
|
+
})] }));
|
|
16
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const chartPalette: string[];
|
|
2
|
+
export declare const revenueByMonth: {
|
|
3
|
+
month: string;
|
|
4
|
+
new: number;
|
|
5
|
+
expansion: number;
|
|
6
|
+
services: number;
|
|
7
|
+
}[];
|
|
8
|
+
export declare const pipelineStages: {
|
|
9
|
+
stage: string;
|
|
10
|
+
value: number;
|
|
11
|
+
}[];
|
|
12
|
+
export declare const healthAreas: {
|
|
13
|
+
area: string;
|
|
14
|
+
score: number;
|
|
15
|
+
}[];
|
|
16
|
+
export declare const readinessAreas: {
|
|
17
|
+
area: string;
|
|
18
|
+
score: number;
|
|
19
|
+
}[];
|
|
20
|
+
export declare const scatterRows: {
|
|
21
|
+
calls: number;
|
|
22
|
+
value: number;
|
|
23
|
+
}[];
|
|
24
|
+
export declare function money(value: number): string;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export const chartPalette = [
|
|
2
|
+
'var(--category-1)',
|
|
3
|
+
'var(--category-2)',
|
|
4
|
+
'var(--category-3)',
|
|
5
|
+
'var(--category-4)',
|
|
6
|
+
];
|
|
7
|
+
export const revenueByMonth = [
|
|
8
|
+
{ month: 'Jan', new: 82000, expansion: 28000, services: 12000 },
|
|
9
|
+
{ month: 'Feb', new: 94000, expansion: 36000, services: 18000 },
|
|
10
|
+
{ month: 'Mar', new: 104000, expansion: 42000, services: 22000 },
|
|
11
|
+
{ month: 'Apr', new: 118000, expansion: 47000, services: 26000 },
|
|
12
|
+
{ month: 'May', new: 126000, expansion: 54000, services: 30000 },
|
|
13
|
+
{ month: 'Jun', new: 142000, expansion: 61000, services: 34000 },
|
|
14
|
+
];
|
|
15
|
+
export const pipelineStages = [
|
|
16
|
+
{ stage: 'Discovery', value: 180000 },
|
|
17
|
+
{ stage: 'Security', value: 126000 },
|
|
18
|
+
{ stage: 'Legal', value: 98000 },
|
|
19
|
+
{ stage: 'Procurement', value: 76000 },
|
|
20
|
+
];
|
|
21
|
+
export const healthAreas = [
|
|
22
|
+
{ area: 'Sync', score: 92 },
|
|
23
|
+
{ area: 'Authz', score: 84 },
|
|
24
|
+
{ area: 'Latency', score: 76 },
|
|
25
|
+
{ area: 'Errors', score: 68 },
|
|
26
|
+
];
|
|
27
|
+
export const readinessAreas = [
|
|
28
|
+
{ area: 'Schema', score: 9 },
|
|
29
|
+
{ area: 'Imports', score: 7 },
|
|
30
|
+
{ area: 'Authz', score: 8 },
|
|
31
|
+
{ area: 'Realtime', score: 6 },
|
|
32
|
+
{ area: 'Audit', score: 9 },
|
|
33
|
+
];
|
|
34
|
+
export const scatterRows = [
|
|
35
|
+
{ calls: 8, value: 42000 },
|
|
36
|
+
{ calls: 13, value: 74000 },
|
|
37
|
+
{ calls: 19, value: 126000 },
|
|
38
|
+
{ calls: 27, value: 144000 },
|
|
39
|
+
{ calls: 34, value: 218000 },
|
|
40
|
+
];
|
|
41
|
+
export function money(value) {
|
|
42
|
+
return new Intl.NumberFormat('en', {
|
|
43
|
+
style: 'currency',
|
|
44
|
+
currency: 'EUR',
|
|
45
|
+
maximumFractionDigits: 0,
|
|
46
|
+
notation: 'compact',
|
|
47
|
+
}).format(value);
|
|
48
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export type ChartDatum = Record<string, string | number | null>;
|
|
2
|
+
export interface ChartAxisOptions {
|
|
3
|
+
xLabel?: string;
|
|
4
|
+
yLabel?: string;
|
|
5
|
+
showGrid?: boolean;
|
|
6
|
+
showXAxis?: boolean;
|
|
7
|
+
showYAxis?: boolean;
|
|
8
|
+
xTickCount?: number;
|
|
9
|
+
yTickCount?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface ChartLegendItem {
|
|
12
|
+
label: string;
|
|
13
|
+
color: string;
|
|
14
|
+
}
|
|
15
|
+
export interface CartesianChartProps {
|
|
16
|
+
data: ChartDatum[];
|
|
17
|
+
xKey?: string;
|
|
18
|
+
yKeys?: string[];
|
|
19
|
+
dashedKeys?: string[];
|
|
20
|
+
colors?: string[];
|
|
21
|
+
axis?: ChartAxisOptions;
|
|
22
|
+
height?: number;
|
|
23
|
+
ariaLabel?: string;
|
|
24
|
+
valueFormatter?: (value: number) => string;
|
|
25
|
+
className?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface BarChartProps extends CartesianChartProps {
|
|
28
|
+
stacked?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface ScatterChartProps extends CartesianChartProps {
|
|
31
|
+
valueKey?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface CategoricalChartProps {
|
|
34
|
+
data: ChartDatum[];
|
|
35
|
+
categoryKey?: string;
|
|
36
|
+
valueKey?: string;
|
|
37
|
+
colors?: string[];
|
|
38
|
+
height?: number;
|
|
39
|
+
ariaLabel?: string;
|
|
40
|
+
maxValue?: number;
|
|
41
|
+
valueFormatter?: (value: number) => string;
|
|
42
|
+
className?: string;
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Checkbox as CheckboxPrimitive } from "radix-ui";
|
|
5
|
+
import { CheckIcon } from "lucide-react";
|
|
6
|
+
import { cn } from '../lib/cn.js';
|
|
7
|
+
function Checkbox({ className, ...props }) {
|
|
8
|
+
return (_jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: cn("peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs outline-none transition-shadow focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:bg-input/30 dark:data-checked:bg-primary", className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "flex items-center justify-center text-current", children: _jsx(CheckIcon, { className: "size-3.5", strokeWidth: 2.5 }) }) }));
|
|
9
|
+
}
|
|
10
|
+
export { Checkbox };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const chipVariants: (props?: ({
|
|
4
|
+
variant?: "filter" | "default" | "outline" | null | undefined;
|
|
5
|
+
size?: "sm" | "md" | null | undefined;
|
|
6
|
+
inset?: boolean | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
export interface ChipProps extends Omit<React.ComponentProps<'span'>, 'children'>, VariantProps<typeof chipVariants> {
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
leadingIcon?: React.ReactNode;
|
|
12
|
+
onRemove?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
13
|
+
removeLabel?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ChipLabelProps extends React.ComponentProps<'button'> {
|
|
16
|
+
asChild?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface ChipRemoveProps extends React.ComponentProps<'button'> {
|
|
19
|
+
label?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare const Chip: React.ForwardRefExoticComponent<Omit<ChipProps, "ref"> & React.RefAttributes<HTMLSpanElement>> & {
|
|
22
|
+
Label: React.ForwardRefExoticComponent<Omit<ChipLabelProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
23
|
+
Remove: React.ForwardRefExoticComponent<Omit<ChipRemoveProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
24
|
+
};
|
|
25
|
+
export { chipVariants };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
import { Slot } from 'radix-ui';
|
|
6
|
+
import { X } from 'lucide-react';
|
|
7
|
+
import { cn } from '../lib/cn.js';
|
|
8
|
+
const chipVariants = cva('group/chip inline-flex shrink-0 items-center rounded-md border bg-clip-padding font-normal whitespace-nowrap transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50 has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring/50 [&_svg]:pointer-events-none [&_svg]:shrink-0', {
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: 'border-border/60 bg-muted/40 text-foreground/90',
|
|
12
|
+
outline: 'border-border bg-background text-foreground/90',
|
|
13
|
+
filter: 'border-border/60 bg-muted/40 text-foreground/90',
|
|
14
|
+
},
|
|
15
|
+
size: { sm: 'h-6 text-[11.5px]', md: 'h-7 text-xs' },
|
|
16
|
+
inset: { true: 'gap-1 px-2', false: '' },
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: { variant: 'default', size: 'sm', inset: true },
|
|
19
|
+
});
|
|
20
|
+
const ChipRoot = React.forwardRef(function Chip({ className, variant = 'default', size = 'sm', inset, asChild = false, leadingIcon, onRemove, removeLabel, children, ...props }, ref) {
|
|
21
|
+
const resolvedInset = inset ?? variant !== 'filter';
|
|
22
|
+
const chipClass = cn(chipVariants({ variant, size, inset: resolvedInset, className }));
|
|
23
|
+
if (asChild) {
|
|
24
|
+
return (_jsx(Slot.Root, { ref: ref, "data-slot": "chip", "data-variant": variant, className: chipClass, ...props, children: children }));
|
|
25
|
+
}
|
|
26
|
+
return (_jsxs("span", { ref: ref, "data-slot": "chip", "data-variant": variant, className: chipClass, ...props, children: [leadingIcon ? (_jsx("span", { "data-slot": "chip-icon", className: "flex shrink-0 items-center [&_svg]:size-3", children: leadingIcon })) : null, children, onRemove ? _jsx(ChipRemove, { onClick: onRemove, "aria-label": removeLabel }) : null] }));
|
|
27
|
+
});
|
|
28
|
+
const ChipLabel = React.forwardRef(function ChipLabel({ className, asChild = false, type, ...props }, ref) {
|
|
29
|
+
const Comp = asChild ? Slot.Root : 'button';
|
|
30
|
+
return (_jsx(Comp, { ref: ref, "data-slot": "chip-label", type: asChild ? undefined : (type ?? 'button'), className: cn('inline-flex h-full items-center gap-1 rounded-l-md px-2 text-inherit outline-none transition-colors hover:bg-foreground/5 focus-visible:bg-foreground/5 [&_svg]:size-3', className), ...props }));
|
|
31
|
+
});
|
|
32
|
+
const ChipRemove = React.forwardRef(function ChipRemove({ className, label, 'aria-label': ariaLabel, type, children, ...props }, ref) {
|
|
33
|
+
return (_jsx("button", { ref: ref, "data-slot": "chip-remove", type: type ?? 'button', "aria-label": ariaLabel ?? label, className: cn('inline-flex h-full items-center justify-center rounded-r-md border-l border-transparent px-1.5 text-muted-foreground/70 outline-none transition-colors hover:text-destructive focus-visible:text-destructive group-data-[variant=filter]/chip:border-border/60', className), ...props, children: children ?? _jsx(X, { className: "size-3", strokeWidth: 2, "aria-hidden": true }) }));
|
|
34
|
+
});
|
|
35
|
+
export const Chip = Object.assign(ChipRoot, { Label: ChipLabel, Remove: ChipRemove });
|
|
36
|
+
export { chipVariants };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HighlightStyle } from '@codemirror/language';
|
|
2
|
+
import type { Extension } from '@codemirror/state';
|
|
3
|
+
/**
|
|
4
|
+
* How every CodeMirror surface in atmOS looks.
|
|
5
|
+
*
|
|
6
|
+
* The colours are the app's own tokens rather than a packaged editor theme, so an editor
|
|
7
|
+
* follows the workspace into dark mode and stays the same instrument whether it is holding
|
|
8
|
+
* a SQL statement, a formula, or a file off a machine. A packaged theme would be a second
|
|
9
|
+
* palette to keep in sync with the first, and it would be wrong the moment the app's is.
|
|
10
|
+
*/
|
|
11
|
+
export declare const atmosEditorTheme: Extension;
|
|
12
|
+
/**
|
|
13
|
+
* One palette across every grammar. Markdown gets structure without changing size or
|
|
14
|
+
* family — a heading reads as a heading, but the file still reads as a file, which is the
|
|
15
|
+
* difference between an editor and a preview.
|
|
16
|
+
*/
|
|
17
|
+
export declare const atmosEditorHighlight: HighlightStyle;
|
|
18
|
+
/** The theme and its highlighting, which are only ever wanted together. */
|
|
19
|
+
export declare const atmosEditorAppearance: Extension[];
|