@kumix/ui 0.3.17 → 0.4.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 +30 -18
- package/dist/account-avatar-DILzuuvz.js +23 -0
- package/dist/account-avatar-DILzuuvz.js.map +1 -0
- package/dist/{cascader-types-BnH6wYD-.d.ts → cascader-types-DVT-znZ-.d.ts} +6 -3
- package/dist/cascader-types-DVT-znZ-.d.ts.map +1 -0
- package/dist/components/agents/agent-activity/activity-row.js +1 -1
- package/dist/components/agents/agent-activity/index.js +1 -1
- package/dist/components/agents/agent-code.js +1 -1
- package/dist/components/agents/ai-sidebar.js +1 -1
- package/dist/components/agents/approval-card/index.js +1 -1
- package/dist/components/agents/citations.js +1 -1
- package/dist/components/agents/code-block.js +1 -1
- package/dist/components/agents/file-diff.js +1 -1
- package/dist/components/agents/image-generation.js +1 -1
- package/dist/components/agents/message-bubble.js +1 -1
- package/dist/components/agents/prompt-input.js +1 -1
- package/dist/components/agents/streaming-response.js +1 -1
- package/dist/components/agents/todo-list.js +1 -1
- package/dist/components/agents/tool-approval.js +1 -1
- package/dist/components/agents/tool-result.js +1 -1
- package/dist/components/agents/voice-orb.d.ts +19 -0
- package/dist/components/agents/voice-orb.d.ts.map +1 -0
- package/dist/components/agents/voice-orb.js +389 -0
- package/dist/components/agents/voice-orb.js.map +1 -0
- package/dist/components/charts/bump-chart/context.d.ts +2 -0
- package/dist/components/charts/bump-chart/context.js +3 -0
- package/dist/components/charts/bump-chart/legend.d.ts +6 -0
- package/dist/components/charts/bump-chart/legend.d.ts.map +1 -0
- package/dist/components/charts/bump-chart/legend.js +60 -0
- package/dist/components/charts/bump-chart/legend.js.map +1 -0
- package/dist/components/charts/bump-chart/plot.d.ts +6 -0
- package/dist/components/charts/bump-chart/plot.d.ts.map +1 -0
- package/dist/components/charts/bump-chart/plot.js +3 -0
- package/dist/components/charts/bump-chart/point.d.ts +10 -0
- package/dist/components/charts/bump-chart/point.d.ts.map +1 -0
- package/dist/components/charts/bump-chart/point.js +124 -0
- package/dist/components/charts/bump-chart/point.js.map +1 -0
- package/dist/components/charts/bump-chart/series.d.ts +11 -0
- package/dist/components/charts/bump-chart/series.d.ts.map +1 -0
- package/dist/components/charts/bump-chart/series.js +101 -0
- package/dist/components/charts/bump-chart/series.js.map +1 -0
- package/dist/components/charts/bump-chart.d.ts +10 -0
- package/dist/components/charts/bump-chart.d.ts.map +1 -0
- package/dist/components/charts/bump-chart.js +23 -0
- package/dist/components/charts/bump-chart.js.map +1 -0
- package/dist/components/charts/composition-chart/context.d.ts +2 -0
- package/dist/components/charts/composition-chart/context.js +3 -0
- package/dist/components/charts/composition-chart/legend.d.ts +6 -0
- package/dist/components/charts/composition-chart/legend.d.ts.map +1 -0
- package/dist/components/charts/composition-chart/legend.js +51 -0
- package/dist/components/charts/composition-chart/legend.js.map +1 -0
- package/dist/components/charts/composition-chart/plot.d.ts +6 -0
- package/dist/components/charts/composition-chart/plot.d.ts.map +1 -0
- package/dist/components/charts/composition-chart/plot.js +174 -0
- package/dist/components/charts/composition-chart/plot.js.map +1 -0
- package/dist/components/charts/composition-chart/tooltip-content.d.ts +6 -0
- package/dist/components/charts/composition-chart/tooltip-content.d.ts.map +1 -0
- package/dist/components/charts/composition-chart/tooltip-content.js +63 -0
- package/dist/components/charts/composition-chart/tooltip-content.js.map +1 -0
- package/dist/components/charts/composition-chart.d.ts +9 -0
- package/dist/components/charts/composition-chart.d.ts.map +1 -0
- package/dist/components/charts/composition-chart.js +26 -0
- package/dist/components/charts/composition-chart.js.map +1 -0
- package/dist/components/charts/funnel-chart.d.ts +50 -0
- package/dist/components/charts/funnel-chart.d.ts.map +1 -0
- package/dist/components/charts/funnel-chart.js +216 -0
- package/dist/components/charts/funnel-chart.js.map +1 -0
- package/dist/components/charts/heat-calendar/grid.d.ts +8 -0
- package/dist/components/charts/heat-calendar/grid.d.ts.map +1 -0
- package/dist/components/charts/heat-calendar/grid.js +127 -0
- package/dist/components/charts/heat-calendar/grid.js.map +1 -0
- package/dist/components/charts/heat-calendar/legend.d.ts +6 -0
- package/dist/components/charts/heat-calendar/legend.d.ts.map +1 -0
- package/dist/components/charts/heat-calendar/legend.js +48 -0
- package/dist/components/charts/heat-calendar/legend.js.map +1 -0
- package/dist/components/charts/heat-calendar/tooltip.d.ts +2 -0
- package/dist/components/charts/heat-calendar/tooltip.js +50 -0
- package/dist/components/charts/heat-calendar/tooltip.js.map +1 -0
- package/dist/components/charts/heat-calendar.d.ts +9 -0
- package/dist/components/charts/heat-calendar.d.ts.map +1 -0
- package/dist/components/charts/heat-calendar.js +23 -0
- package/dist/components/charts/heat-calendar.js.map +1 -0
- package/dist/components/charts/liquidity-heatmap.d.ts +51 -0
- package/dist/components/charts/liquidity-heatmap.d.ts.map +1 -0
- package/dist/components/charts/liquidity-heatmap.js +311 -0
- package/dist/components/charts/liquidity-heatmap.js.map +1 -0
- package/dist/components/charts/order-book/depth-row.d.ts +13 -0
- package/dist/components/charts/order-book/depth-row.d.ts.map +1 -0
- package/dist/components/charts/order-book/depth-row.js +99 -0
- package/dist/components/charts/order-book/depth-row.js.map +1 -0
- package/dist/components/charts/order-book.d.ts +57 -0
- package/dist/components/charts/order-book.d.ts.map +1 -0
- package/dist/components/charts/order-book.js +207 -0
- package/dist/components/charts/order-book.js.map +1 -0
- package/dist/components/charts/price-target-fan/header.d.ts +8 -0
- package/dist/components/charts/price-target-fan/header.d.ts.map +1 -0
- package/dist/components/charts/price-target-fan/header.js +43 -0
- package/dist/components/charts/price-target-fan/header.js.map +1 -0
- package/dist/components/charts/price-target-fan/plot.d.ts +16 -0
- package/dist/components/charts/price-target-fan/plot.d.ts.map +1 -0
- package/dist/components/charts/price-target-fan/plot.js +142 -0
- package/dist/components/charts/price-target-fan/plot.js.map +1 -0
- package/dist/components/charts/price-target-fan/series.d.ts +15 -0
- package/dist/components/charts/price-target-fan/series.d.ts.map +1 -0
- package/dist/components/charts/price-target-fan/series.js +238 -0
- package/dist/components/charts/price-target-fan/series.js.map +1 -0
- package/dist/components/charts/price-target-fan/tooltip.d.ts +2 -0
- package/dist/components/charts/price-target-fan/tooltip.js +58 -0
- package/dist/components/charts/price-target-fan/tooltip.js.map +1 -0
- package/dist/components/charts/price-target-fan.d.ts +10 -0
- package/dist/components/charts/price-target-fan.d.ts.map +1 -0
- package/dist/components/charts/price-target-fan.js +24 -0
- package/dist/components/charts/price-target-fan.js.map +1 -0
- package/dist/components/charts/returns-calendar/grid.d.ts +8 -0
- package/dist/components/charts/returns-calendar/grid.d.ts.map +1 -0
- package/dist/components/charts/returns-calendar/grid.js +176 -0
- package/dist/components/charts/returns-calendar/grid.js.map +1 -0
- package/dist/components/charts/returns-calendar/tooltip.d.ts +2 -0
- package/dist/components/charts/returns-calendar/tooltip.js +55 -0
- package/dist/components/charts/returns-calendar/tooltip.js.map +1 -0
- package/dist/components/charts/returns-calendar.d.ts +48 -0
- package/dist/components/charts/returns-calendar.d.ts.map +1 -0
- package/dist/components/charts/returns-calendar.js +22 -0
- package/dist/components/charts/returns-calendar.js.map +1 -0
- package/dist/components/charts/status-bar/legend.d.ts +8 -0
- package/dist/components/charts/status-bar/legend.d.ts.map +1 -0
- package/dist/components/charts/status-bar/legend.js +37 -0
- package/dist/components/charts/status-bar/legend.js.map +1 -0
- package/dist/components/charts/status-bar/plot.d.ts +12 -0
- package/dist/components/charts/status-bar/plot.d.ts.map +1 -0
- package/dist/components/charts/status-bar/plot.js +176 -0
- package/dist/components/charts/status-bar/plot.js.map +1 -0
- package/dist/components/charts/status-bar/tooltip.d.ts +2 -0
- package/dist/components/charts/status-bar/tooltip.js +49 -0
- package/dist/components/charts/status-bar/tooltip.js.map +1 -0
- package/dist/components/charts/status-bar.d.ts +9 -0
- package/dist/components/charts/status-bar.d.ts.map +1 -0
- package/dist/components/charts/status-bar.js +64 -0
- package/dist/components/charts/status-bar.js.map +1 -0
- package/dist/components/charts/treemap/legend.d.ts +8 -0
- package/dist/components/charts/treemap/legend.d.ts.map +1 -0
- package/dist/components/charts/treemap/legend.js +35 -0
- package/dist/components/charts/treemap/legend.js.map +1 -0
- package/dist/components/charts/treemap/plot.d.ts +13 -0
- package/dist/components/charts/treemap/plot.d.ts.map +1 -0
- package/dist/components/charts/treemap/plot.js +123 -0
- package/dist/components/charts/treemap/plot.js.map +1 -0
- package/dist/components/charts/treemap/tile.d.ts +10 -0
- package/dist/components/charts/treemap/tile.d.ts.map +1 -0
- package/dist/components/charts/treemap/tile.js +114 -0
- package/dist/components/charts/treemap/tile.js.map +1 -0
- package/dist/components/charts/treemap/tooltip.d.ts +11 -0
- package/dist/components/charts/treemap/tooltip.d.ts.map +1 -0
- package/dist/components/charts/treemap/tooltip.js +73 -0
- package/dist/components/charts/treemap/tooltip.js.map +1 -0
- package/dist/components/charts/treemap.d.ts +56 -0
- package/dist/components/charts/treemap.d.ts.map +1 -0
- package/dist/components/charts/treemap.js +71 -0
- package/dist/components/charts/treemap.js.map +1 -0
- package/dist/components/charts/volume-profile/plot.d.ts +12 -0
- package/dist/components/charts/volume-profile/plot.d.ts.map +1 -0
- package/dist/components/charts/volume-profile/plot.js +211 -0
- package/dist/components/charts/volume-profile/plot.js.map +1 -0
- package/dist/components/charts/volume-profile/summary.d.ts +6 -0
- package/dist/components/charts/volume-profile/summary.d.ts.map +1 -0
- package/dist/components/charts/volume-profile/summary.js +76 -0
- package/dist/components/charts/volume-profile/summary.js.map +1 -0
- package/dist/components/charts/volume-profile/tooltip.d.ts +2 -0
- package/dist/components/charts/volume-profile/tooltip.js +84 -0
- package/dist/components/charts/volume-profile/tooltip.js.map +1 -0
- package/dist/components/charts/volume-profile.d.ts +111 -0
- package/dist/components/charts/volume-profile.d.ts.map +1 -0
- package/dist/components/charts/volume-profile.js +82 -0
- package/dist/components/charts/volume-profile.js.map +1 -0
- package/dist/components/custom/confirm-dialog.js +1 -1
- package/dist/components/motion/adaptive-stepper.js +1 -1
- package/dist/components/motion/alert.d.ts +40 -0
- package/dist/components/motion/alert.d.ts.map +1 -0
- package/dist/components/motion/alert.js +247 -0
- package/dist/components/motion/alert.js.map +1 -0
- package/dist/components/motion/animated-badge.js +1 -1
- package/dist/components/motion/animated-sidebar.js +1 -1
- package/dist/components/motion/animated-sidebar.js.map +1 -1
- package/dist/components/motion/animated-toast-stack.js +1 -1
- package/dist/components/motion/arc-picker.d.ts +28 -0
- package/dist/components/motion/arc-picker.d.ts.map +1 -0
- package/dist/components/motion/arc-picker.js +569 -0
- package/dist/components/motion/arc-picker.js.map +1 -0
- package/dist/components/motion/aspect-ratio.d.ts +23 -0
- package/dist/components/motion/aspect-ratio.d.ts.map +1 -0
- package/dist/components/motion/aspect-ratio.js +61 -0
- package/dist/components/motion/aspect-ratio.js.map +1 -0
- package/dist/components/motion/attachment-upload.d.ts.map +1 -1
- package/dist/components/motion/attachment-upload.js +2 -2
- package/dist/components/motion/attachment-upload.js.map +1 -1
- package/dist/components/motion/availability-scheduler/copy-menu.js +1 -1
- package/dist/components/motion/availability-scheduler/day-row.js +2 -2
- package/dist/components/motion/availability-scheduler/index.js +1 -1
- package/dist/components/motion/bloom-menu.js +1 -1
- package/dist/components/motion/bottom-sheet.js.map +1 -1
- package/dist/components/motion/bouncy-accordion.js +1 -1
- package/dist/components/motion/breadcrumb.d.ts +37 -0
- package/dist/components/motion/breadcrumb.d.ts.map +1 -0
- package/dist/components/motion/breadcrumb.js +259 -0
- package/dist/components/motion/breadcrumb.js.map +1 -0
- package/dist/components/motion/button/stateful.js +1 -1
- package/dist/components/motion/card-folder.js +1 -1
- package/dist/components/motion/center-morph-modal.js +1 -1
- package/dist/components/motion/collapsible.d.ts +34 -0
- package/dist/components/motion/collapsible.d.ts.map +1 -0
- package/dist/components/motion/collapsible.js +237 -0
- package/dist/components/motion/collapsible.js.map +1 -0
- package/dist/components/motion/color-selector.d.ts +28 -0
- package/dist/components/motion/color-selector.d.ts.map +1 -0
- package/dist/components/motion/color-selector.js +97 -0
- package/dist/components/motion/color-selector.js.map +1 -0
- package/dist/components/motion/combobox/list.js +1 -1
- package/dist/components/motion/combobox/trigger.js +1 -1
- package/dist/components/motion/command-palette.js +1 -1
- package/dist/components/motion/command-palette.js.map +1 -1
- package/dist/components/motion/context-menu.js +1 -1
- package/dist/components/motion/date-range-picker.d.ts +107 -0
- package/dist/components/motion/date-range-picker.d.ts.map +1 -0
- package/dist/components/motion/date-range-picker.js +907 -0
- package/dist/components/motion/date-range-picker.js.map +1 -0
- package/dist/components/motion/drawer.js.map +1 -1
- package/dist/components/motion/feedback-widget.js +1 -1
- package/dist/components/motion/file-tree.js +1 -1
- package/dist/components/motion/file-upload.js +1 -1
- package/dist/components/motion/infinite-masonry.js +1 -1
- package/dist/components/motion/knockout-bracket.d.ts +190 -0
- package/dist/components/motion/knockout-bracket.d.ts.map +1 -0
- package/dist/components/motion/knockout-bracket.js +952 -0
- package/dist/components/motion/knockout-bracket.js.map +1 -0
- package/dist/components/motion/knockout-wheel.d.ts +183 -0
- package/dist/components/motion/knockout-wheel.d.ts.map +1 -0
- package/dist/components/motion/knockout-wheel.js +1039 -0
- package/dist/components/motion/knockout-wheel.js.map +1 -0
- package/dist/components/motion/morphing-lightbox.d.ts +67 -0
- package/dist/components/motion/morphing-lightbox.d.ts.map +1 -0
- package/dist/components/motion/morphing-lightbox.js +499 -0
- package/dist/components/motion/morphing-lightbox.js.map +1 -0
- package/dist/components/motion/morphing-modal.js.map +1 -1
- package/dist/components/motion/morphing-search.js +1 -1
- package/dist/components/motion/morphing-search.js.map +1 -1
- package/dist/components/motion/morphing-tabs.js +1 -1
- package/dist/components/motion/multi-select/list.js +1 -1
- package/dist/components/motion/multi-select/trigger.js +1 -1
- package/dist/components/motion/notification-stack.js +1 -1
- package/dist/components/motion/overflow-actions.js +1 -1
- package/dist/components/motion/popover-morph.d.ts +5 -1
- package/dist/components/motion/popover-morph.d.ts.map +1 -1
- package/dist/components/motion/popover-morph.js +78 -27
- package/dist/components/motion/popover-morph.js.map +1 -1
- package/dist/components/motion/prediction-market-card.d.ts +37 -0
- package/dist/components/motion/prediction-market-card.d.ts.map +1 -0
- package/dist/components/motion/prediction-market-card.js +216 -0
- package/dist/components/motion/prediction-market-card.js.map +1 -0
- package/dist/components/motion/prediction-market.d.ts +49 -0
- package/dist/components/motion/prediction-market.d.ts.map +1 -0
- package/dist/components/motion/prediction-market.js +440 -0
- package/dist/components/motion/prediction-market.js.map +1 -0
- package/dist/components/motion/project-folder.js +1 -1
- package/dist/components/motion/project-folder.js.map +1 -1
- package/dist/components/motion/select-morph.js +1 -1
- package/dist/components/motion/select.js +1 -1
- package/dist/components/motion/signup-form.js +1 -1
- package/dist/components/motion/sortable-list.d.ts +53 -0
- package/dist/components/motion/sortable-list.d.ts.map +1 -0
- package/dist/components/motion/sortable-list.js +254 -0
- package/dist/components/motion/sortable-list.js.map +1 -0
- package/dist/components/motion/sortable-stack.d.ts +2 -0
- package/dist/components/motion/sortable-stack.js +3 -0
- package/dist/components/motion/swap/controls.d.ts +22 -0
- package/dist/components/motion/swap/controls.d.ts.map +1 -0
- package/dist/components/motion/swap/controls.js +167 -0
- package/dist/components/motion/swap/controls.js.map +1 -0
- package/dist/components/motion/swap/field.d.ts +14 -0
- package/dist/components/motion/swap/field.d.ts.map +1 -0
- package/dist/components/motion/swap/field.js +107 -0
- package/dist/components/motion/swap/field.js.map +1 -0
- package/dist/components/motion/swap/quote-row.d.ts +13 -0
- package/dist/components/motion/swap/quote-row.d.ts.map +1 -0
- package/dist/components/motion/swap/quote-row.js +55 -0
- package/dist/components/motion/swap/quote-row.js.map +1 -0
- package/dist/components/motion/swap/token-badges.d.ts +19 -0
- package/dist/components/motion/swap/token-badges.d.ts.map +1 -0
- package/dist/components/motion/swap/token-badges.js +54 -0
- package/dist/components/motion/swap/token-badges.js.map +1 -0
- package/dist/components/motion/swap/token-picker.d.ts +14 -0
- package/dist/components/motion/swap/token-picker.d.ts.map +1 -0
- package/dist/components/motion/swap/token-picker.js +190 -0
- package/dist/components/motion/swap/token-picker.js.map +1 -0
- package/dist/components/motion/swap.d.ts +14 -0
- package/dist/components/motion/swap.d.ts.map +1 -0
- package/dist/components/motion/swap.js +378 -0
- package/dist/components/motion/swap.js.map +1 -0
- package/dist/components/motion/table/row-handle.js +1 -1
- package/dist/components/motion/table/table-header.js +1 -1
- package/dist/components/motion/tabs.d.ts +5 -9
- package/dist/components/motion/tabs.d.ts.map +1 -1
- package/dist/components/motion/tabs.js +14 -5
- package/dist/components/motion/tabs.js.map +1 -1
- package/dist/components/motion/theme-toggle.js +1 -1
- package/dist/components/motion/tooltip/positioner.d.ts +33 -0
- package/dist/components/motion/tooltip/positioner.d.ts.map +1 -0
- package/dist/components/motion/tooltip/positioner.js +3 -0
- package/dist/components/motion/tooltip-surface.d.ts +5 -4
- package/dist/components/motion/tooltip-surface.d.ts.map +1 -1
- package/dist/components/motion/tooltip-surface.js +22 -73
- package/dist/components/motion/tooltip-surface.js.map +1 -1
- package/dist/components/motion/tooltip.d.ts +3 -1
- package/dist/components/motion/tooltip.d.ts.map +1 -1
- package/dist/components/motion/tooltip.js +54 -103
- package/dist/components/motion/tooltip.js.map +1 -1
- package/dist/components/motion/wallet-card/account-avatar.d.ts +8 -0
- package/dist/components/motion/wallet-card/account-avatar.d.ts.map +1 -0
- package/dist/components/motion/wallet-card/account-avatar.js +3 -0
- package/dist/components/motion/wallet-card/account-switcher.d.ts +14 -0
- package/dist/components/motion/wallet-card/account-switcher.d.ts.map +1 -0
- package/dist/components/motion/wallet-card/account-switcher.js +153 -0
- package/dist/components/motion/wallet-card/account-switcher.js.map +1 -0
- package/dist/components/motion/wallet-card/actions.d.ts +12 -0
- package/dist/components/motion/wallet-card/actions.d.ts.map +1 -0
- package/dist/components/motion/wallet-card/actions.js +58 -0
- package/dist/components/motion/wallet-card/actions.js.map +1 -0
- package/dist/components/motion/wallet-card/balance-delta.d.ts +12 -0
- package/dist/components/motion/wallet-card/balance-delta.d.ts.map +1 -0
- package/dist/components/motion/wallet-card/balance-delta.js +72 -0
- package/dist/components/motion/wallet-card/balance-delta.js.map +1 -0
- package/dist/components/motion/wallet-card/copy-button.d.ts +12 -0
- package/dist/components/motion/wallet-card/copy-button.d.ts.map +1 -0
- package/dist/components/motion/wallet-card/copy-button.js +41 -0
- package/dist/components/motion/wallet-card/copy-button.js.map +1 -0
- package/dist/components/motion/wallet-card/index.d.ts +13 -0
- package/dist/components/motion/wallet-card/index.d.ts.map +1 -0
- package/dist/components/motion/wallet-card/index.js +115 -0
- package/dist/components/motion/wallet-card/index.js.map +1 -0
- package/dist/components/motion/wallet-card/search-bar.d.ts +17 -0
- package/dist/components/motion/wallet-card/search-bar.d.ts.map +1 -0
- package/dist/components/motion/wallet-card/search-bar.js +156 -0
- package/dist/components/motion/wallet-card/search-bar.js.map +1 -0
- package/dist/components/reui/alert.d.ts +1 -1
- package/dist/components/reui/alert.js +1 -1
- package/dist/components/reui/autocomplete.js +1 -1
- package/dist/components/reui/badge.d.ts +1 -1
- package/dist/components/reui/cascader/cascader-async.d.ts +3 -2
- package/dist/components/reui/cascader/cascader-async.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-async.js.map +1 -1
- package/dist/components/reui/cascader/cascader-columns.js +4 -4
- package/dist/components/reui/cascader/cascader-columns.js.map +1 -1
- package/dist/components/reui/cascader/cascader-context.d.ts +12 -4
- package/dist/components/reui/cascader/cascader-context.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-context.js.map +1 -1
- package/dist/components/reui/cascader/cascader-footer.js +1 -1
- package/dist/components/reui/cascader/cascader-i18n.d.ts +1 -1
- package/dist/components/reui/cascader/cascader-item.d.ts +2 -2
- package/dist/components/reui/cascader/cascader-item.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-item.js +23 -17
- package/dist/components/reui/cascader/cascader-item.js.map +1 -1
- package/dist/components/reui/cascader/cascader-lib.d.ts +8 -1
- package/dist/components/reui/cascader/cascader-lib.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-lib.js +19 -11
- package/dist/components/reui/cascader/cascader-lib.js.map +1 -1
- package/dist/components/reui/cascader/cascader-nav.d.ts +1 -1
- package/dist/components/reui/cascader/cascader-nav.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-nav.js +6 -5
- package/dist/components/reui/cascader/cascader-nav.js.map +1 -1
- package/dist/components/reui/cascader/cascader-types.d.ts +1 -1
- package/dist/components/reui/cascader/cascader-virtual.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-virtual.js.map +1 -1
- package/dist/components/reui/cascader/cascader.d.ts +6 -2
- package/dist/components/reui/cascader/cascader.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader.js +59 -21
- package/dist/components/reui/cascader/cascader.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-filter.js +3 -3
- package/dist/components/reui/data-grid/data-grid-column-filter.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-header.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-header.js +18 -14
- package/dist/components/reui/data-grid/data-grid-column-header.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-visibility.js +1 -1
- package/dist/components/reui/data-grid/data-grid-column-visibility.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-pagination.js +2 -2
- package/dist/components/reui/data-grid/data-grid-pagination.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-scroll-area.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-scroll-area.js +85 -61
- package/dist/components/reui/data-grid/data-grid-scroll-area.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.d.ts +7 -2
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js +68 -39
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd.d.ts +7 -2
- package/dist/components/reui/data-grid/data-grid-table-dnd.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd.js +90 -26
- package/dist/components/reui/data-grid/data-grid-table-dnd.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-virtual.js +1 -1
- package/dist/components/reui/data-grid/data-grid-table-virtual.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table.js +157 -38
- package/dist/components/reui/data-grid/data-grid-table.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid.d.ts +16 -0
- package/dist/components/reui/data-grid/data-grid.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid.js +81 -51
- package/dist/components/reui/data-grid/data-grid.js.map +1 -1
- package/dist/components/reui/date-selector.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-agenda-view.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-event.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-month-view.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-nav.js +2 -2
- package/dist/components/reui/filters/filters-advanced.js +2 -2
- package/dist/components/reui/filters/filters-advanced.js.map +1 -1
- package/dist/components/reui/filters/filters-builder.d.ts +1 -1
- package/dist/components/reui/filters/filters-builder.js +1 -1
- package/dist/components/reui/filters/filters-chip.js +2 -2
- package/dist/components/reui/filters/filters-editors.js +1 -1
- package/dist/components/reui/filters/filters-lib.d.ts +1 -1
- package/dist/components/reui/filters/filters.js +1 -1
- package/dist/components/reui/frame.js +1 -1
- package/dist/components/reui/gantt/gantt-bar.js +1 -1
- package/dist/components/reui/gantt/gantt-nav.js +2 -2
- package/dist/components/reui/gantt/gantt-view.js +1 -1
- package/dist/components/reui/kanban.d.ts.map +1 -1
- package/dist/components/reui/kanban.js +30 -1
- package/dist/components/reui/kanban.js.map +1 -1
- package/dist/components/reui/number-field.js +1 -1
- package/dist/components/reui/phone-input.js +1 -1
- package/dist/components/reui/rating.js +1 -1
- package/dist/components/reui/signature-pad.d.ts +160 -0
- package/dist/components/reui/signature-pad.d.ts.map +1 -0
- package/dist/components/reui/signature-pad.js +764 -0
- package/dist/components/reui/signature-pad.js.map +1 -0
- package/dist/components/reui/time-picker.d.ts +202 -0
- package/dist/components/reui/time-picker.d.ts.map +1 -0
- package/dist/components/reui/time-picker.js +1002 -0
- package/dist/components/reui/time-picker.js.map +1 -0
- package/dist/components/reui/tree.js +1 -1
- package/dist/components/ui/accordion.js +1 -1
- package/dist/components/ui/alert-dialog.js +1 -1
- package/dist/components/ui/alert.js +1 -1
- package/dist/components/ui/attachment.js +1 -1
- package/dist/components/ui/breadcrumb.js +1 -1
- package/dist/components/ui/bubble.js +1 -1
- package/dist/components/ui/button-group.js +1 -1
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/calendar.js +1 -1
- package/dist/components/ui/carousel.js +1 -1
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/combobox.js +1 -1
- package/dist/components/ui/command.js +1 -1
- package/dist/components/ui/context-menu.js +1 -1
- package/dist/components/ui/dialog.js +1 -1
- package/dist/components/ui/dropdown-menu.js +1 -1
- package/dist/components/ui/empty.js +1 -1
- package/dist/components/ui/field.js +1 -1
- package/dist/components/ui/input-group.d.ts +1 -1
- package/dist/components/ui/input-group.js +1 -1
- package/dist/components/ui/input-otp.js +1 -1
- package/dist/components/ui/item.js +1 -1
- package/dist/components/ui/marker.d.ts +1 -1
- package/dist/components/ui/marker.js +1 -1
- package/dist/components/ui/menubar.js +1 -1
- package/dist/components/ui/message-scroller.js +1 -1
- package/dist/components/ui/native-select.js +1 -1
- package/dist/components/ui/navigation-menu.js +1 -1
- package/dist/components/ui/pagination.js +1 -1
- package/dist/components/ui/questionnaire.js +1 -1
- package/dist/components/ui/select.js +1 -1
- package/dist/components/ui/sheet.js +1 -1
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/spinner.js +1 -1
- package/dist/components/ui/tabs.js +1 -1
- package/dist/components/ui/toast.js +1 -1
- package/dist/components/ui/toggle.js +1 -1
- package/dist/constants-CsKm9sSk.js +30 -0
- package/dist/constants-CsKm9sSk.js.map +1 -0
- package/dist/context-3_vY1jbv.js +141 -0
- package/dist/context-3_vY1jbv.js.map +1 -0
- package/dist/context-BE60udRT.js +99 -0
- package/dist/context-BE60udRT.js.map +1 -0
- package/dist/context-BYXeJQnz.d.ts +150 -0
- package/dist/context-BYXeJQnz.d.ts.map +1 -0
- package/dist/context-Bc6VC1HA.js +181 -0
- package/dist/context-Bc6VC1HA.js.map +1 -0
- package/dist/context-BqjZ1Z_w.js +111 -0
- package/dist/context-BqjZ1Z_w.js.map +1 -0
- package/dist/context-CZfRKkcZ.js +204 -0
- package/dist/context-CZfRKkcZ.js.map +1 -0
- package/dist/context-Cn-00gfW.js +169 -0
- package/dist/context-Cn-00gfW.js.map +1 -0
- package/dist/context-Cnlo53sV.d.ts +92 -0
- package/dist/context-Cnlo53sV.d.ts.map +1 -0
- package/dist/context-Rl5VCYA8.js +257 -0
- package/dist/context-Rl5VCYA8.js.map +1 -0
- package/dist/context-sD8DQga-.js +122 -0
- package/dist/context-sD8DQga-.js.map +1 -0
- package/dist/{copy-menu-TIKvPaAZ.js → copy-menu-C5GaT4Z-.js} +2 -2
- package/dist/{copy-menu-TIKvPaAZ.js.map → copy-menu-C5GaT4Z-.js.map} +1 -1
- package/dist/ease-B82HVmio.d.ts +50 -0
- package/dist/ease-B82HVmio.d.ts.map +1 -0
- package/dist/hooks/use-modal-scope.d.ts +6 -0
- package/dist/hooks/use-modal-scope.d.ts.map +1 -0
- package/dist/hooks/use-modal-scope.js +83 -0
- package/dist/hooks/use-modal-scope.js.map +1 -0
- package/dist/lib/ease.d.ts +2 -49
- package/dist/model-DfeFradZ.d.ts +9 -0
- package/dist/model-DfeFradZ.d.ts.map +1 -0
- package/dist/model-DlbIqCZg.d.ts +41 -0
- package/dist/model-DlbIqCZg.d.ts.map +1 -0
- package/dist/plot-CdFTbMI_.js +131 -0
- package/dist/plot-CdFTbMI_.js.map +1 -0
- package/dist/positioner-3mCqiebN.js +204 -0
- package/dist/positioner-3mCqiebN.js.map +1 -0
- package/dist/tooltip-BarafYiU.d.ts +67 -0
- package/dist/tooltip-BarafYiU.d.ts.map +1 -0
- package/dist/tooltip-BqxVD6D-.d.ts +64 -0
- package/dist/tooltip-BqxVD6D-.d.ts.map +1 -0
- package/dist/tooltip-C01qUgsW.d.ts +133 -0
- package/dist/tooltip-C01qUgsW.d.ts.map +1 -0
- package/dist/tooltip-C6qUs7px.d.ts +36 -0
- package/dist/tooltip-C6qUs7px.d.ts.map +1 -0
- package/dist/tooltip-DQ4DXgeu.d.ts +94 -0
- package/dist/tooltip-DQ4DXgeu.d.ts.map +1 -0
- package/dist/types-B_6p3LXz.d.ts +36 -0
- package/dist/types-B_6p3LXz.d.ts.map +1 -0
- package/dist/types-D6e3gWOA.d.ts +22 -0
- package/dist/types-D6e3gWOA.d.ts.map +1 -0
- package/dist/use-geometry-CH0foIo7.d.ts +9 -0
- package/dist/use-geometry-CH0foIo7.d.ts.map +1 -0
- package/dist/utils-B3YXTsDI.js +26 -0
- package/dist/utils-B3YXTsDI.js.map +1 -0
- package/package.json +14 -9
- package/dist/cascader-types-BnH6wYD-.d.ts.map +0 -1
- package/dist/lib/ease.d.ts.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "@kumix/utils";
|
|
3
|
-
import { cva } from "class-variance-authority";
|
|
4
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
5
|
import { Tabs as Tabs$1 } from "@base-ui/react/tabs";
|
|
6
6
|
//#region src/components/ui/tabs.tsx
|
|
7
7
|
function Tabs({ className, orientation = "horizontal", ...props }) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Button } from "./button.js";
|
|
3
3
|
import { cn } from "@kumix/utils";
|
|
4
|
-
import { CircleCheckIcon, InfoIcon, Loader2Icon, OctagonXIcon, TriangleAlertIcon, XIcon } from "lucide-react";
|
|
5
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { CircleCheckIcon, InfoIcon, Loader2Icon, OctagonXIcon, TriangleAlertIcon, XIcon } from "lucide-react";
|
|
6
6
|
import { Toast as Toast$1 } from "@base-ui/react/toast";
|
|
7
7
|
//#region src/components/ui/toast.tsx
|
|
8
8
|
const toast = Toast$1.createToastManager();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "@kumix/utils";
|
|
3
|
-
import { cva } from "class-variance-authority";
|
|
4
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
5
|
import { Toggle as Toggle$1 } from "@base-ui/react/toggle";
|
|
6
6
|
//#region src/components/ui/toggle.tsx
|
|
7
7
|
const toggleVariants = cva("group/toggle inline-flex items-center justify-center gap-1 whitespace-nowrap rounded-lg font-medium text-sm outline-none transition-all hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-pressed:bg-muted aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//#region src/components/motion/wallet-card/constants.ts
|
|
2
|
+
const MORPH = {
|
|
3
|
+
type: "spring",
|
|
4
|
+
duration: .5,
|
|
5
|
+
bounce: .22
|
|
6
|
+
};
|
|
7
|
+
const LIST = {
|
|
8
|
+
hidden: {},
|
|
9
|
+
show: { transition: {
|
|
10
|
+
staggerChildren: .035,
|
|
11
|
+
delayChildren: .12
|
|
12
|
+
} }
|
|
13
|
+
};
|
|
14
|
+
const ITEM = {
|
|
15
|
+
hidden: {
|
|
16
|
+
opacity: 0,
|
|
17
|
+
y: -6,
|
|
18
|
+
filter: "blur(3px)"
|
|
19
|
+
},
|
|
20
|
+
show: {
|
|
21
|
+
opacity: 1,
|
|
22
|
+
y: 0,
|
|
23
|
+
filter: "blur(0px)"
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const HEAD = "flex items-center gap-2 px-2 py-1.5 text-left";
|
|
27
|
+
//#endregion
|
|
28
|
+
export { MORPH as i, ITEM as n, LIST as r, HEAD as t };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=constants-CsKm9sSk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants-CsKm9sSk.js","names":[],"sources":["../src/components/motion/wallet-card/constants.ts"],"sourcesContent":["import type { Transition, Variants } from \"motion/react\";\n\n// Trigger box grows into the full-width panel and back — one shared surface.\nexport const MORPH: Transition = { type: \"spring\", duration: 0.5, bounce: 0.22 };\n\nexport const LIST: Variants = {\n hidden: {},\n show: { transition: { staggerChildren: 0.035, delayChildren: 0.12 } },\n};\n\nexport const ITEM: Variants = {\n hidden: { opacity: 0, y: -6, filter: \"blur(3px)\" },\n show: { opacity: 1, y: 0, filter: \"blur(0px)\" },\n};\n\n// Shared padding for the account trigger + panel header so the avatar/name stay\n// put as the box morphs — the panel reads as the trigger itself growing open.\nexport const HEAD = \"flex items-center gap-2 px-2 py-1.5 text-left\";\n"],"mappings":";AAGA,MAAa,QAAoB;CAAE,MAAM;CAAU,UAAU;CAAK,QAAQ;AAAK;AAE/E,MAAa,OAAiB;CAC5B,QAAQ,CAAC;CACT,MAAM,EAAE,YAAY;EAAE,iBAAiB;EAAO,eAAe;CAAK,EAAE;AACtE;AAEA,MAAa,OAAiB;CAC5B,QAAQ;EAAE,SAAS;EAAG,GAAG;EAAI,QAAQ;CAAY;CACjD,MAAM;EAAE,SAAS;EAAG,GAAG;EAAG,QAAQ;CAAY;AAChD;AAIA,MAAa,OAAO"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { useHoverCapable } from "./hooks/use-hover-capable.js";
|
|
2
|
+
import { createContext, useCallback, useContext, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { useReducedMotion } from "motion/react";
|
|
4
|
+
//#region src/components/charts/volume-profile/model.ts
|
|
5
|
+
function buildVolumeProfile(data, target) {
|
|
6
|
+
if (target !== false && (!Number.isFinite(target) || target <= 0 || target > 1)) throw new Error("VolumeProfile: valueArea must be a fraction above 0 and at most 1, or false.");
|
|
7
|
+
const bins = [...data].sort((a, b) => a.priceLow - b.priceLow);
|
|
8
|
+
const ids = /* @__PURE__ */ new Set();
|
|
9
|
+
let totalVolume = 0;
|
|
10
|
+
let maxVolume = 0;
|
|
11
|
+
let pocIndex = -1;
|
|
12
|
+
for (const [index, bin] of bins.entries()) {
|
|
13
|
+
if (ids.has(bin.id)) throw new Error(`VolumeProfile: duplicate bin ID "${bin.id}".`);
|
|
14
|
+
ids.add(bin.id);
|
|
15
|
+
if (!Number.isFinite(bin.priceLow) || !Number.isFinite(bin.priceHigh) || bin.priceHigh <= bin.priceLow || !Number.isFinite(bin.volume) || bin.volume < 0) throw new Error("VolumeProfile: bins need finite increasing price bounds and nonnegative volume.");
|
|
16
|
+
if (index > 0 && bin.priceLow < bins[index - 1].priceHigh) throw new Error("VolumeProfile: price ranges must not overlap.");
|
|
17
|
+
totalVolume += bin.volume;
|
|
18
|
+
if (bin.volume > maxVolume) {
|
|
19
|
+
maxVolume = bin.volume;
|
|
20
|
+
pocIndex = index;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const priceLow = bins[0]?.priceLow ?? 0;
|
|
24
|
+
const priceHigh = bins.at(-1)?.priceHigh ?? 1;
|
|
25
|
+
const span = priceHigh - priceLow;
|
|
26
|
+
if (!Number.isFinite(totalVolume) || !Number.isFinite(span)) throw new Error("VolumeProfile: the total volume and price span must remain finite.");
|
|
27
|
+
let lowIndex = pocIndex;
|
|
28
|
+
let highIndex = pocIndex;
|
|
29
|
+
let areaVolume = pocIndex >= 0 ? bins[pocIndex].volume : 0;
|
|
30
|
+
if (target === 1 && pocIndex >= 0) {
|
|
31
|
+
lowIndex = 0;
|
|
32
|
+
highIndex = bins.length - 1;
|
|
33
|
+
areaVolume = totalVolume;
|
|
34
|
+
} else if (target !== false && pocIndex >= 0) {
|
|
35
|
+
const targetVolume = totalVolume * target;
|
|
36
|
+
while (areaVolume < targetVolume) {
|
|
37
|
+
const below = bins[lowIndex - 1];
|
|
38
|
+
const above = bins[highIndex + 1];
|
|
39
|
+
if (!below && !above) break;
|
|
40
|
+
const takeAbove = !below || !!above && (above.volume > below.volume || above.volume === below.volume && highIndex + 1 - pocIndex <= pocIndex - (lowIndex - 1));
|
|
41
|
+
const next = takeAbove ? above : below;
|
|
42
|
+
if (!next || areaVolume + next.volume > targetVolume) break;
|
|
43
|
+
areaVolume += next.volume;
|
|
44
|
+
if (takeAbove) highIndex++;
|
|
45
|
+
else lowIndex--;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
const valueArea = target !== false && pocIndex >= 0 ? {
|
|
49
|
+
priceLow: bins[lowIndex].priceLow,
|
|
50
|
+
priceHigh: bins[highIndex].priceHigh,
|
|
51
|
+
volume: areaVolume,
|
|
52
|
+
share: areaVolume / totalVolume,
|
|
53
|
+
target
|
|
54
|
+
} : null;
|
|
55
|
+
const rows = bins.map((bin, index) => ({
|
|
56
|
+
...bin,
|
|
57
|
+
price: bin.priceLow + (bin.priceHigh - bin.priceLow) / 2,
|
|
58
|
+
top: (priceHigh - bin.priceHigh) / span,
|
|
59
|
+
height: (bin.priceHigh - bin.priceLow) / span,
|
|
60
|
+
center: (priceHigh - (bin.priceLow + (bin.priceHigh - bin.priceLow) / 2)) / span,
|
|
61
|
+
proportion: maxVolume ? bin.volume / maxVolume : 0,
|
|
62
|
+
share: totalVolume ? bin.volume / totalVolume : 0,
|
|
63
|
+
isPoc: index === pocIndex,
|
|
64
|
+
inValueArea: valueArea !== null && index >= lowIndex && index <= highIndex
|
|
65
|
+
}));
|
|
66
|
+
return {
|
|
67
|
+
rows,
|
|
68
|
+
poc: rows[pocIndex] ?? null,
|
|
69
|
+
valueArea,
|
|
70
|
+
totalVolume,
|
|
71
|
+
maxVolume,
|
|
72
|
+
priceLow,
|
|
73
|
+
priceHigh
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/components/charts/volume-profile/context.ts
|
|
78
|
+
const formatNumber = (value) => value.toLocaleString("en-US", { maximumFractionDigits: 2 });
|
|
79
|
+
function useVolumeProfileModel({ data, label = "Volume profile", unit = "units", formatPrice = formatNumber, formatVolume = formatNumber, valueArea = .7, color = "#6366f1", pocColor = "#f59e0b", activeId, defaultActiveId = null, onActiveChange }) {
|
|
80
|
+
const model = useMemo(() => buildVolumeProfile(data, valueArea), [data, valueArea]);
|
|
81
|
+
const [internalId, setInternalId] = useState(defaultActiveId);
|
|
82
|
+
if (internalId !== null && !model.rows.some((row) => row.id === internalId)) setInternalId(null);
|
|
83
|
+
const requestedId = activeId === void 0 ? internalId : activeId;
|
|
84
|
+
const activeIndex = model.rows.findIndex((row) => row.id === requestedId);
|
|
85
|
+
const active = model.rows[activeIndex] ?? null;
|
|
86
|
+
const [tooltipOpen, setTooltipOpen] = useState(false);
|
|
87
|
+
const plotRef = useRef(null);
|
|
88
|
+
const tooltipId = useId();
|
|
89
|
+
const latest = useRef({
|
|
90
|
+
activeId,
|
|
91
|
+
requestedId,
|
|
92
|
+
onActiveChange
|
|
93
|
+
});
|
|
94
|
+
useLayoutEffect(() => {
|
|
95
|
+
latest.current = {
|
|
96
|
+
activeId,
|
|
97
|
+
requestedId,
|
|
98
|
+
onActiveChange
|
|
99
|
+
};
|
|
100
|
+
});
|
|
101
|
+
const setActive = useCallback((id) => {
|
|
102
|
+
const current = latest.current;
|
|
103
|
+
if (current.activeId === void 0) setInternalId(id);
|
|
104
|
+
if (current.requestedId !== id) current.onActiveChange?.(id);
|
|
105
|
+
}, []);
|
|
106
|
+
const describe = (row) => [
|
|
107
|
+
`${formatPrice(row.priceLow)} to ${formatPrice(row.priceHigh)}`,
|
|
108
|
+
`${formatVolume(row.volume)} ${unit}`,
|
|
109
|
+
`${(row.share * 100).toFixed(1)}% of total volume`,
|
|
110
|
+
row.isPoc ? "Point of control" : row.inValueArea ? "Inside value area" : null
|
|
111
|
+
].filter(Boolean).join(". ");
|
|
112
|
+
return {
|
|
113
|
+
...model,
|
|
114
|
+
label,
|
|
115
|
+
unit,
|
|
116
|
+
formatPrice,
|
|
117
|
+
formatVolume,
|
|
118
|
+
color,
|
|
119
|
+
pocColor,
|
|
120
|
+
describe,
|
|
121
|
+
active,
|
|
122
|
+
activeIndex,
|
|
123
|
+
setActive,
|
|
124
|
+
plotRef,
|
|
125
|
+
tooltipId,
|
|
126
|
+
tooltipOpen,
|
|
127
|
+
setTooltipOpen,
|
|
128
|
+
reduce: useReducedMotion(),
|
|
129
|
+
canHover: useHoverCapable()
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
const VolumeProfileContext = createContext(null);
|
|
133
|
+
function useVolumeProfile() {
|
|
134
|
+
const context = useContext(VolumeProfileContext);
|
|
135
|
+
if (!context) throw new Error("Volume profile parts must be rendered inside VolumeProfile.");
|
|
136
|
+
return context;
|
|
137
|
+
}
|
|
138
|
+
//#endregion
|
|
139
|
+
export { useVolumeProfile as n, useVolumeProfileModel as r, VolumeProfileContext as t };
|
|
140
|
+
|
|
141
|
+
//# sourceMappingURL=context-3_vY1jbv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-3_vY1jbv.js","names":[],"sources":["../src/components/charts/volume-profile/model.ts","../src/components/charts/volume-profile/context.ts"],"sourcesContent":["export interface VolumeProfileBin {\n /** Stable identity for this price range across data updates. */\n id: string;\n priceLow: number;\n priceHigh: number;\n /** Executed volume in this range, in the consumer's chosen unit. */\n volume: number;\n}\n\nexport function buildVolumeProfile(data: readonly VolumeProfileBin[], target: number | false) {\n if (target !== false && (!Number.isFinite(target) || target <= 0 || target > 1))\n throw new Error(\"VolumeProfile: valueArea must be a fraction above 0 and at most 1, or false.\");\n const bins = [...data].sort((a, b) => a.priceLow - b.priceLow);\n const ids = new Set<string>();\n let totalVolume = 0;\n let maxVolume = 0;\n let pocIndex = -1;\n for (const [index, bin] of bins.entries()) {\n if (ids.has(bin.id)) throw new Error(`VolumeProfile: duplicate bin ID \"${bin.id}\".`);\n ids.add(bin.id);\n if (\n !Number.isFinite(bin.priceLow) ||\n !Number.isFinite(bin.priceHigh) ||\n bin.priceHigh <= bin.priceLow ||\n !Number.isFinite(bin.volume) ||\n bin.volume < 0\n )\n throw new Error(\n \"VolumeProfile: bins need finite increasing price bounds and nonnegative volume.\",\n );\n if (index > 0 && bin.priceLow < bins[index - 1].priceHigh)\n throw new Error(\"VolumeProfile: price ranges must not overlap.\");\n totalVolume += bin.volume;\n // Equal maxima keep the lower-price bin as a deterministic POC.\n if (bin.volume > maxVolume) {\n maxVolume = bin.volume;\n pocIndex = index;\n }\n }\n const priceLow = bins[0]?.priceLow ?? 0;\n const priceHigh = bins.at(-1)?.priceHigh ?? 1;\n const span = priceHigh - priceLow;\n if (!Number.isFinite(totalVolume) || !Number.isFinite(span))\n throw new Error(\"VolumeProfile: the total volume and price span must remain finite.\");\n let lowIndex = pocIndex;\n let highIndex = pocIndex;\n let areaVolume = pocIndex >= 0 ? bins[pocIndex].volume : 0;\n if (target === 1 && pocIndex >= 0) {\n // A 100% target includes every bin, including empty edge bins, without\n // depending on floating-point summation order during adjacent expansion.\n lowIndex = 0;\n highIndex = bins.length - 1;\n areaVolume = totalVolume;\n } else if (target !== false && pocIndex >= 0) {\n const targetVolume = totalVolume * target;\n // Grow a contiguous area from the POC using the larger adjacent volume.\n // Ties favor the nearer row, then the higher price. Stop before adding a\n // row that would exceed the target; the POC itself is always included.\n while (areaVolume < targetVolume) {\n const below = bins[lowIndex - 1];\n const above = bins[highIndex + 1];\n if (!below && !above) break;\n const takeAbove =\n !below ||\n (!!above &&\n (above.volume > below.volume ||\n (above.volume === below.volume &&\n highIndex + 1 - pocIndex <= pocIndex - (lowIndex - 1))));\n const next = takeAbove ? above : below;\n if (!next || areaVolume + next.volume > targetVolume) break;\n areaVolume += next.volume;\n if (takeAbove) highIndex++;\n else lowIndex--;\n }\n }\n const valueArea =\n target !== false && pocIndex >= 0\n ? {\n priceLow: bins[lowIndex].priceLow,\n priceHigh: bins[highIndex].priceHigh,\n volume: areaVolume,\n share: areaVolume / totalVolume,\n target,\n }\n : null;\n const rows = bins.map((bin, index) => ({\n ...bin,\n price: bin.priceLow + (bin.priceHigh - bin.priceLow) / 2,\n top: (priceHigh - bin.priceHigh) / span,\n height: (bin.priceHigh - bin.priceLow) / span,\n center: (priceHigh - (bin.priceLow + (bin.priceHigh - bin.priceLow) / 2)) / span,\n proportion: maxVolume ? bin.volume / maxVolume : 0,\n share: totalVolume ? bin.volume / totalVolume : 0,\n isPoc: index === pocIndex,\n inValueArea: valueArea !== null && index >= lowIndex && index <= highIndex,\n }));\n return {\n rows,\n poc: rows[pocIndex] ?? null,\n valueArea,\n totalVolume,\n maxVolume,\n priceLow,\n priceHigh,\n };\n}\n\nexport type VolumeProfileRow = ReturnType<typeof buildVolumeProfile>[\"rows\"][number];\n","\"use client\";\n\nimport {\n type ComponentProps,\n createContext,\n useCallback,\n useContext,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { useReducedMotion } from \"motion/react\";\n\nimport { useHoverCapable } from \"../../../hooks/use-hover-capable\";\nimport { buildVolumeProfile, type VolumeProfileBin } from \"./model\";\n\nconst formatNumber = (value: number) => value.toLocaleString(\"en-US\", { maximumFractionDigits: 2 });\n\nexport interface VolumeProfileProps extends ComponentProps<\"section\"> {\n /** Already-aggregated executed volume. Sorted by price; unequal bins and gaps are supported. */\n data: readonly VolumeProfileBin[];\n label?: string;\n unit?: string;\n formatPrice?: (price: number) => string;\n formatVolume?: (volume: number) => string;\n /** Target fraction, default 0.7. Whole bins may cover less; the POC is always included.\n * Set false to hide the value area. Equal-volume POCs favor the lower price. */\n valueArea?: number | false;\n color?: string;\n pocColor?: string;\n activeId?: string | null;\n defaultActiveId?: string | null;\n onActiveChange?: (id: string | null) => void;\n}\n\nexport function useVolumeProfileModel({\n data,\n label = \"Volume profile\",\n unit = \"units\",\n formatPrice = formatNumber,\n formatVolume = formatNumber,\n valueArea = 0.7,\n color = \"#6366f1\",\n pocColor = \"#f59e0b\",\n activeId,\n defaultActiveId = null,\n onActiveChange,\n}: VolumeProfileProps) {\n const model = useMemo(() => buildVolumeProfile(data, valueArea), [data, valueArea]);\n const [internalId, setInternalId] = useState(defaultActiveId);\n if (internalId !== null && !model.rows.some((row) => row.id === internalId)) setInternalId(null);\n const requestedId = activeId === undefined ? internalId : activeId;\n const activeIndex = model.rows.findIndex((row) => row.id === requestedId);\n const active = model.rows[activeIndex] ?? null;\n const [tooltipOpen, setTooltipOpen] = useState(false);\n const plotRef = useRef<HTMLDivElement>(null);\n const tooltipId = useId();\n const latest = useRef({ activeId, requestedId, onActiveChange });\n useLayoutEffect(() => {\n latest.current = { activeId, requestedId, onActiveChange };\n });\n const setActive = useCallback((id: string | null) => {\n const current = latest.current;\n if (current.activeId === undefined) setInternalId(id);\n if (current.requestedId !== id) current.onActiveChange?.(id);\n }, []);\n const describe = (row: (typeof model.rows)[number]) =>\n [\n `${formatPrice(row.priceLow)} to ${formatPrice(row.priceHigh)}`,\n `${formatVolume(row.volume)} ${unit}`,\n `${(row.share * 100).toFixed(1)}% of total volume`,\n row.isPoc ? \"Point of control\" : row.inValueArea ? \"Inside value area\" : null,\n ]\n .filter(Boolean)\n .join(\". \");\n return {\n ...model,\n label,\n unit,\n formatPrice,\n formatVolume,\n color,\n pocColor,\n describe,\n active,\n activeIndex,\n setActive,\n plotRef,\n tooltipId,\n tooltipOpen,\n setTooltipOpen,\n reduce: useReducedMotion(),\n canHover: useHoverCapable(),\n };\n}\n\nexport const VolumeProfileContext = createContext<ReturnType<typeof useVolumeProfileModel> | null>(\n null,\n);\n\nexport function useVolumeProfile() {\n const context = useContext(VolumeProfileContext);\n if (!context) throw new Error(\"Volume profile parts must be rendered inside VolumeProfile.\");\n return context;\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { useHoverCapable } from "./hooks/use-hover-capable.js";
|
|
2
|
+
import { createContext, useCallback, useContext, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { useReducedMotion } from "motion/react";
|
|
4
|
+
//#region src/components/charts/status-bar/context.ts
|
|
5
|
+
const STATUS_BAR_STATUSES = [
|
|
6
|
+
{
|
|
7
|
+
id: "operational",
|
|
8
|
+
label: "Operational",
|
|
9
|
+
color: "#059669"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
id: "degraded",
|
|
13
|
+
label: "Degraded",
|
|
14
|
+
color: "#d97706"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
id: "outage",
|
|
18
|
+
label: "Outage",
|
|
19
|
+
color: "#e11d48"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: "maintenance",
|
|
23
|
+
label: "Maintenance",
|
|
24
|
+
color: "#2563eb"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: "unknown",
|
|
28
|
+
label: "No data",
|
|
29
|
+
color: "var(--muted-foreground)"
|
|
30
|
+
}
|
|
31
|
+
];
|
|
32
|
+
function useStatusBarModel({ data, statuses = STATUS_BAR_STATUSES, label = "Status history", activeId, defaultActiveId = null, onActiveChange }) {
|
|
33
|
+
const rows = useMemo(() => {
|
|
34
|
+
const states = /* @__PURE__ */ new Map();
|
|
35
|
+
for (const status of statuses) {
|
|
36
|
+
if (states.has(status.id)) throw new Error(`StatusBar: duplicate status ID "${status.id}".`);
|
|
37
|
+
states.set(status.id, status);
|
|
38
|
+
}
|
|
39
|
+
const ids = /* @__PURE__ */ new Set();
|
|
40
|
+
return data.map((datum) => {
|
|
41
|
+
if (ids.has(datum.id)) throw new Error(`StatusBar: duplicate period ID "${datum.id}".`);
|
|
42
|
+
ids.add(datum.id);
|
|
43
|
+
const status = states.get(datum.status);
|
|
44
|
+
if (!status) throw new Error(`StatusBar: define the status "${datum.status}" in statuses.`);
|
|
45
|
+
return {
|
|
46
|
+
datum,
|
|
47
|
+
status
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
}, [data, statuses]);
|
|
51
|
+
const [internalId, setInternalId] = useState(defaultActiveId);
|
|
52
|
+
if (internalId !== null && !rows.some(({ datum }) => datum.id === internalId)) setInternalId(null);
|
|
53
|
+
const requestedId = activeId === void 0 ? internalId : activeId;
|
|
54
|
+
const activeIndex = rows.findIndex(({ datum }) => datum.id === requestedId);
|
|
55
|
+
const active = rows[activeIndex] ?? null;
|
|
56
|
+
const [tooltipOpen, setTooltipOpen] = useState(false);
|
|
57
|
+
const plotRef = useRef(null);
|
|
58
|
+
const tooltipId = useId();
|
|
59
|
+
const latest = useRef({
|
|
60
|
+
activeId,
|
|
61
|
+
requestedId,
|
|
62
|
+
onActiveChange
|
|
63
|
+
});
|
|
64
|
+
useLayoutEffect(() => {
|
|
65
|
+
latest.current = {
|
|
66
|
+
activeId,
|
|
67
|
+
requestedId,
|
|
68
|
+
onActiveChange
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
return {
|
|
72
|
+
rows,
|
|
73
|
+
statuses,
|
|
74
|
+
label,
|
|
75
|
+
active,
|
|
76
|
+
activeIndex,
|
|
77
|
+
setActive: useCallback((id) => {
|
|
78
|
+
const current = latest.current;
|
|
79
|
+
if (current.activeId === void 0) setInternalId(id);
|
|
80
|
+
if (current.requestedId !== id) current.onActiveChange?.(id);
|
|
81
|
+
}, []),
|
|
82
|
+
plotRef,
|
|
83
|
+
tooltipId,
|
|
84
|
+
tooltipOpen,
|
|
85
|
+
setTooltipOpen,
|
|
86
|
+
reduce: useReducedMotion(),
|
|
87
|
+
canHover: useHoverCapable()
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
const StatusBarContext = createContext(null);
|
|
91
|
+
function useStatusBar() {
|
|
92
|
+
const context = useContext(StatusBarContext);
|
|
93
|
+
if (!context) throw new Error("Status bar parts must be rendered inside StatusBar.");
|
|
94
|
+
return context;
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
export { useStatusBarModel as i, StatusBarContext as n, useStatusBar as r, STATUS_BAR_STATUSES as t };
|
|
98
|
+
|
|
99
|
+
//# sourceMappingURL=context-BE60udRT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-BE60udRT.js","names":[],"sources":["../src/components/charts/status-bar/context.ts"],"sourcesContent":["\"use client\";\n\nimport {\n type ComponentProps,\n createContext,\n useCallback,\n useContext,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { useReducedMotion } from \"motion/react\";\n\nimport { useHoverCapable } from \"../../../hooks/use-hover-capable\";\n\nexport interface StatusBarDatum {\n /** Stable, unique identity. Keep it when updating a period's status. */\n id: string;\n /** Consumer-formatted period, date, or event label. */\n label: string;\n /** Must match an ID in statuses. */\n status: string;\n description?: string;\n}\n\nexport interface StatusBarStatus {\n id: string;\n label: string;\n /** Any CSS color, including theme variables. */\n color: string;\n}\n\nexport const STATUS_BAR_STATUSES: readonly StatusBarStatus[] = [\n { id: \"operational\", label: \"Operational\", color: \"#059669\" },\n { id: \"degraded\", label: \"Degraded\", color: \"#d97706\" },\n { id: \"outage\", label: \"Outage\", color: \"#e11d48\" },\n { id: \"maintenance\", label: \"Maintenance\", color: \"#2563eb\" },\n { id: \"unknown\", label: \"No data\", color: \"var(--muted-foreground)\" },\n];\n\nexport interface StatusBarProps extends ComponentProps<\"section\"> {\n /** Observations in display order. The chart never generates or aggregates data. */\n data: readonly StatusBarDatum[];\n /** Override the default status labels and colors, or define your own states. */\n statuses?: readonly StatusBarStatus[];\n label?: string;\n activeId?: string | null;\n defaultActiveId?: string | null;\n onActiveChange?: (id: string | null) => void;\n}\n\nexport function useStatusBarModel({\n data,\n statuses = STATUS_BAR_STATUSES,\n label = \"Status history\",\n activeId,\n defaultActiveId = null,\n onActiveChange,\n}: StatusBarProps) {\n const rows = useMemo(() => {\n const states = new Map<string, StatusBarStatus>();\n for (const status of statuses) {\n if (states.has(status.id)) throw new Error(`StatusBar: duplicate status ID \"${status.id}\".`);\n states.set(status.id, status);\n }\n const ids = new Set<string>();\n return data.map((datum) => {\n if (ids.has(datum.id)) throw new Error(`StatusBar: duplicate period ID \"${datum.id}\".`);\n ids.add(datum.id);\n const status = states.get(datum.status);\n if (!status) throw new Error(`StatusBar: define the status \"${datum.status}\" in statuses.`);\n return { datum, status };\n });\n }, [data, statuses]);\n const [internalId, setInternalId] = useState(defaultActiveId);\n // Resolve stale identities during render so returning periods never revive a cursor.\n if (internalId !== null && !rows.some(({ datum }) => datum.id === internalId))\n setInternalId(null);\n const requestedId = activeId === undefined ? internalId : activeId;\n const activeIndex = rows.findIndex(({ datum }) => datum.id === requestedId);\n const active = rows[activeIndex] ?? null;\n const [tooltipOpen, setTooltipOpen] = useState(false);\n const plotRef = useRef<HTMLDivElement>(null);\n const tooltipId = useId();\n const latest = useRef({ activeId, requestedId, onActiveChange });\n useLayoutEffect(() => {\n latest.current = { activeId, requestedId, onActiveChange };\n });\n const setActive = useCallback((id: string | null) => {\n const current = latest.current;\n if (current.activeId === undefined) setInternalId(id);\n if (current.requestedId !== id) current.onActiveChange?.(id);\n }, []);\n return {\n rows,\n statuses,\n label,\n active,\n activeIndex,\n setActive,\n plotRef,\n tooltipId,\n tooltipOpen,\n setTooltipOpen,\n reduce: useReducedMotion(),\n canHover: useHoverCapable(),\n };\n}\n\nexport const StatusBarContext = createContext<ReturnType<typeof useStatusBarModel> | null>(null);\n\nexport function useStatusBar() {\n const context = useContext(StatusBarContext);\n if (!context) throw new Error(\"Status bar parts must be rendered inside StatusBar.\");\n return context;\n}\n"],"mappings":";;;;AAkCA,MAAa,sBAAkD;CAC7D;EAAE,IAAI;EAAe,OAAO;EAAe,OAAO;CAAU;CAC5D;EAAE,IAAI;EAAY,OAAO;EAAY,OAAO;CAAU;CACtD;EAAE,IAAI;EAAU,OAAO;EAAU,OAAO;CAAU;CAClD;EAAE,IAAI;EAAe,OAAO;EAAe,OAAO;CAAU;CAC5D;EAAE,IAAI;EAAW,OAAO;EAAW,OAAO;CAA0B;AACtE;AAaA,SAAgB,kBAAkB,EAChC,MACA,WAAW,qBACX,QAAQ,kBACR,UACA,kBAAkB,MAClB,kBACiB;CACjB,MAAM,OAAO,cAAc;EACzB,MAAM,yBAAS,IAAI,IAA6B;EAChD,KAAK,MAAM,UAAU,UAAU;GAC7B,IAAI,OAAO,IAAI,OAAO,EAAE,GAAG,MAAM,IAAI,MAAM,mCAAmC,OAAO,GAAG,GAAG;GAC3F,OAAO,IAAI,OAAO,IAAI,MAAM;EAC9B;EACA,MAAM,sBAAM,IAAI,IAAY;EAC5B,OAAO,KAAK,KAAK,UAAU;GACzB,IAAI,IAAI,IAAI,MAAM,EAAE,GAAG,MAAM,IAAI,MAAM,mCAAmC,MAAM,GAAG,GAAG;GACtF,IAAI,IAAI,MAAM,EAAE;GAChB,MAAM,SAAS,OAAO,IAAI,MAAM,MAAM;GACtC,IAAI,CAAC,QAAQ,MAAM,IAAI,MAAM,iCAAiC,MAAM,OAAO,eAAe;GAC1F,OAAO;IAAE;IAAO;GAAO;EACzB,CAAC;CACH,GAAG,CAAC,MAAM,QAAQ,CAAC;CACnB,MAAM,CAAC,YAAY,iBAAiB,SAAS,eAAe;CAE5D,IAAI,eAAe,QAAQ,CAAC,KAAK,MAAM,EAAE,YAAY,MAAM,OAAO,UAAU,GAC1E,cAAc,IAAI;CACpB,MAAM,cAAc,aAAa,KAAA,IAAY,aAAa;CAC1D,MAAM,cAAc,KAAK,WAAW,EAAE,YAAY,MAAM,OAAO,WAAW;CAC1E,MAAM,SAAS,KAAK,gBAAgB;CACpC,MAAM,CAAC,aAAa,kBAAkB,SAAS,KAAK;CACpD,MAAM,UAAU,OAAuB,IAAI;CAC3C,MAAM,YAAY,MAAM;CACxB,MAAM,SAAS,OAAO;EAAE;EAAU;EAAa;CAAe,CAAC;CAC/D,sBAAsB;EACpB,OAAO,UAAU;GAAE;GAAU;GAAa;EAAe;CAC3D,CAAC;CAMD,OAAO;EACL;EACA;EACA;EACA;EACA;EACA,WAXgB,aAAa,OAAsB;GACnD,MAAM,UAAU,OAAO;GACvB,IAAI,QAAQ,aAAa,KAAA,GAAW,cAAc,EAAE;GACpD,IAAI,QAAQ,gBAAgB,IAAI,QAAQ,iBAAiB,EAAE;EAC7D,GAAG,CAAC,CAOM;EACR;EACA;EACA;EACA;EACA,QAAQ,iBAAiB;EACzB,UAAU,gBAAgB;CAC5B;AACF;AAEA,MAAa,mBAAmB,cAA2D,IAAI;AAE/F,SAAgB,eAAe;CAC7B,MAAM,UAAU,WAAW,gBAAgB;CAC3C,IAAI,CAAC,SAAS,MAAM,IAAI,MAAM,qDAAqD;CACnF,OAAO;AACT"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/components/charts/composition-chart/model.d.ts
|
|
3
|
+
interface CompositionSeries {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
color: string;
|
|
7
|
+
/** Nonnegative values aligned with periods. Missing/invalid values leave a gap. */
|
|
8
|
+
values: readonly (number | null)[];
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/components/charts/composition-chart/context.d.ts
|
|
12
|
+
interface CompositionChartProps {
|
|
13
|
+
series: readonly CompositionSeries[];
|
|
14
|
+
/** Unique labels in chronological order. */
|
|
15
|
+
periods: readonly string[];
|
|
16
|
+
view?: "bar" | "area";
|
|
17
|
+
period?: string;
|
|
18
|
+
defaultPeriod?: string;
|
|
19
|
+
onPeriodChange?: (period: string) => void;
|
|
20
|
+
formatValue?: (value: number) => string;
|
|
21
|
+
label?: string;
|
|
22
|
+
className?: string;
|
|
23
|
+
children?: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
declare function useCompositionModel({ series, periods, view, period, defaultPeriod, onPeriodChange, formatValue, label }: CompositionChartProps): {
|
|
26
|
+
index: number;
|
|
27
|
+
column: {
|
|
28
|
+
id: string;
|
|
29
|
+
valid: boolean;
|
|
30
|
+
segments: {
|
|
31
|
+
value: number | null;
|
|
32
|
+
share: number;
|
|
33
|
+
offset: number;
|
|
34
|
+
id: string;
|
|
35
|
+
name: string;
|
|
36
|
+
color: string;
|
|
37
|
+
values: readonly (number | null)[];
|
|
38
|
+
}[];
|
|
39
|
+
};
|
|
40
|
+
select: (next: string) => void;
|
|
41
|
+
view: "area" | "bar";
|
|
42
|
+
label: string;
|
|
43
|
+
formatValue: (value: number) => string;
|
|
44
|
+
pinned: string | null;
|
|
45
|
+
setPinned: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
46
|
+
highlight: string | null;
|
|
47
|
+
setHovered: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
48
|
+
setFocused: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
49
|
+
reduce: boolean | null;
|
|
50
|
+
canHover: boolean;
|
|
51
|
+
rows: CompositionSeries[];
|
|
52
|
+
columns: {
|
|
53
|
+
id: string;
|
|
54
|
+
valid: boolean;
|
|
55
|
+
segments: {
|
|
56
|
+
value: number | null;
|
|
57
|
+
share: number;
|
|
58
|
+
offset: number;
|
|
59
|
+
id: string;
|
|
60
|
+
name: string;
|
|
61
|
+
color: string;
|
|
62
|
+
values: readonly (number | null)[];
|
|
63
|
+
}[];
|
|
64
|
+
}[];
|
|
65
|
+
};
|
|
66
|
+
declare const CompositionContext: import("react").Context<{
|
|
67
|
+
index: number;
|
|
68
|
+
column: {
|
|
69
|
+
id: string;
|
|
70
|
+
valid: boolean;
|
|
71
|
+
segments: {
|
|
72
|
+
value: number | null;
|
|
73
|
+
share: number;
|
|
74
|
+
offset: number;
|
|
75
|
+
id: string;
|
|
76
|
+
name: string;
|
|
77
|
+
color: string;
|
|
78
|
+
values: readonly (number | null)[];
|
|
79
|
+
}[];
|
|
80
|
+
};
|
|
81
|
+
select: (next: string) => void;
|
|
82
|
+
view: "area" | "bar";
|
|
83
|
+
label: string;
|
|
84
|
+
formatValue: (value: number) => string;
|
|
85
|
+
pinned: string | null;
|
|
86
|
+
setPinned: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
87
|
+
highlight: string | null;
|
|
88
|
+
setHovered: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
89
|
+
setFocused: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
90
|
+
reduce: boolean | null;
|
|
91
|
+
canHover: boolean;
|
|
92
|
+
rows: CompositionSeries[];
|
|
93
|
+
columns: {
|
|
94
|
+
id: string;
|
|
95
|
+
valid: boolean;
|
|
96
|
+
segments: {
|
|
97
|
+
value: number | null;
|
|
98
|
+
share: number;
|
|
99
|
+
offset: number;
|
|
100
|
+
id: string;
|
|
101
|
+
name: string;
|
|
102
|
+
color: string;
|
|
103
|
+
values: readonly (number | null)[];
|
|
104
|
+
}[];
|
|
105
|
+
}[];
|
|
106
|
+
} | null>;
|
|
107
|
+
declare function useCompositionChart(): {
|
|
108
|
+
index: number;
|
|
109
|
+
column: {
|
|
110
|
+
id: string;
|
|
111
|
+
valid: boolean;
|
|
112
|
+
segments: {
|
|
113
|
+
value: number | null;
|
|
114
|
+
share: number;
|
|
115
|
+
offset: number;
|
|
116
|
+
id: string;
|
|
117
|
+
name: string;
|
|
118
|
+
color: string;
|
|
119
|
+
values: readonly (number | null)[];
|
|
120
|
+
}[];
|
|
121
|
+
};
|
|
122
|
+
select: (next: string) => void;
|
|
123
|
+
view: "area" | "bar";
|
|
124
|
+
label: string;
|
|
125
|
+
formatValue: (value: number) => string;
|
|
126
|
+
pinned: string | null;
|
|
127
|
+
setPinned: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
128
|
+
highlight: string | null;
|
|
129
|
+
setHovered: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
130
|
+
setFocused: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
131
|
+
reduce: boolean | null;
|
|
132
|
+
canHover: boolean;
|
|
133
|
+
rows: CompositionSeries[];
|
|
134
|
+
columns: {
|
|
135
|
+
id: string;
|
|
136
|
+
valid: boolean;
|
|
137
|
+
segments: {
|
|
138
|
+
value: number | null;
|
|
139
|
+
share: number;
|
|
140
|
+
offset: number;
|
|
141
|
+
id: string;
|
|
142
|
+
name: string;
|
|
143
|
+
color: string;
|
|
144
|
+
values: readonly (number | null)[];
|
|
145
|
+
}[];
|
|
146
|
+
}[];
|
|
147
|
+
};
|
|
148
|
+
//#endregion
|
|
149
|
+
export { CompositionSeries as a, useCompositionModel as i, CompositionContext as n, useCompositionChart as r, CompositionChartProps as t };
|
|
150
|
+
//# sourceMappingURL=context-BYXeJQnz.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-BYXeJQnz.d.ts","names":[],"sources":["../src/components/charts/composition-chart/model.ts","../src/components/charts/composition-chart/context.tsx"],"mappings":";;UAAiB;EACf;EACA;EACA;;EAEA;;;;UCGe;EACf,iBAAiB;;EAEjB;EACA;EACA;EACA;EACA,kBAAkB;EAClB,eAAe;EACf;EACA;EACA,WAAW;;iBAIG,sBACd,QACA,SACA,MACA,QACA,eACA,gBACA,aACA,SACC;;;;;;;;;;;;;;;EAeqB,SAAA;;;EA/BA,cAAA;;;;;;;;;;;;;;;;;;;;;;;cAsDX,oCAAkB;;;;;;;;;;;;;;;EAvBP,SAAA;;;EA/BA,cAAA;;;;;;;;QAsDX;;;;;;;;;;;;;;;iBAGG;;;;;;;;;;;;;;;EA1BQ,SAAA;;;EA/BA,cAAA;;;;;;;;QAyDR"}
|