@kumix/ui 0.3.18 → 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 +28 -17
- 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/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/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/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.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/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/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/popover-morph.d.ts +4 -0
- package/dist/components/motion/popover-morph.d.ts.map +1 -1
- package/dist/components/motion/popover-morph.js +31 -8
- 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/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/tabs.d.ts +5 -9
- package/dist/components/motion/tabs.d.ts.map +1 -1
- package/dist/components/motion/tabs.js +13 -4
- package/dist/components/motion/tabs.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/badge.d.ts +2 -2
- 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 +3 -3
- 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-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 +22 -16
- 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 +5 -4
- 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 +58 -20
- package/dist/components/reui/cascader/cascader.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-filter.js +2 -2
- 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 +17 -13
- 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 +1 -1
- 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 +67 -38
- 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 +89 -25
- 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 +156 -37
- 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/event-calendar/event-calendar-nav.js +1 -1
- package/dist/components/reui/filters/filters-advanced.js +1 -1
- 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-chip.js +1 -1
- package/dist/components/reui/filters/filters-lib.d.ts +1 -1
- package/dist/components/reui/frame.d.ts +2 -2
- package/dist/components/reui/gantt/gantt-nav.js +1 -1
- package/dist/components/reui/icon-tile.d.ts +2 -2
- 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/ui/attachment.d.ts +2 -2
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/bubble.d.ts +1 -1
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/field.d.ts +1 -1
- package/dist/components/ui/input-group.d.ts +2 -2
- package/dist/components/ui/item.d.ts +3 -3
- package/dist/components/ui/marker.d.ts +1 -1
- package/dist/components/ui/sidebar.d.ts +1 -1
- package/dist/components/ui/tabs.d.ts +1 -1
- package/dist/components/ui/toggle.d.ts +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/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/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 +9 -9
- package/dist/cascader-types-BnH6wYD-.d.ts.map +0 -1
- package/dist/lib/ease.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -10,6 +10,7 @@ React UI kit for Kumix products. Built on **Base UI**, **Tailwind CSS**, **class
|
|
|
10
10
|
| `src/components/reui/*` | [ReUI](https://reui.io/) registry (`@reui/*`) | [reui.io/docs](https://reui.io/docs) · [components](https://reui.io/components) |
|
|
11
11
|
| `src/components/motion/*` | [beUI](https://beui.dev/) registry (`@beui/*`, Motion-based) | [beui.dev/components/motion](https://beui.dev/components/motion) |
|
|
12
12
|
| `src/components/agents/*` | [beUI](https://beui.dev/) AI agent components (`@beui/*`) | [beui.dev/components/agents](https://beui.dev/components/agents) |
|
|
13
|
+
| `src/components/charts/*` | Financial & data visualization charts | — |
|
|
13
14
|
| `src/components/custom/*` | Hand-written Kumix-specific components | — |
|
|
14
15
|
| `src/hooks/*` | Package helpers (+ ReUI `use-file-upload`, beUI helpers) | — |
|
|
15
16
|
| `src/lib/*` | Shared utilities (beUI `ease`, `tick-sound`, `text-shimmer`, `favicon`, `presence-gate`, `touch`, `command-search`) | — |
|
|
@@ -73,6 +74,9 @@ import { DataGrid } from "@kumix/ui/reui/data-grid/data-grid";
|
|
|
73
74
|
import { TiltCard } from "@kumix/ui/motion/tilt-card";
|
|
74
75
|
import { MorphingModal } from "@kumix/ui/motion/morphing-modal";
|
|
75
76
|
|
|
77
|
+
// charts
|
|
78
|
+
import { Treemap } from "@kumix/ui/charts/treemap";
|
|
79
|
+
|
|
76
80
|
// beUI (agents)
|
|
77
81
|
import { PromptInput } from "@kumix/ui/agents/prompt-input";
|
|
78
82
|
|
|
@@ -100,6 +104,7 @@ Mapped from source:
|
|
|
100
104
|
| `src/components/reui/data-grid/data-grid.tsx` | `@kumix/ui/reui/data-grid/data-grid` |
|
|
101
105
|
| `src/components/motion/tilt-card.tsx` | `@kumix/ui/motion/tilt-card` |
|
|
102
106
|
| `src/components/motion/morphing-modal.tsx` | `@kumix/ui/motion/morphing-modal` |
|
|
107
|
+
| `src/components/charts/treemap.tsx` | `@kumix/ui/charts/treemap` |
|
|
103
108
|
| `src/components/agents/prompt-input.tsx` | `@kumix/ui/agents/prompt-input` |
|
|
104
109
|
| `src/components/custom/confirm-dialog.tsx` | `@kumix/ui/custom/confirm-dialog` |
|
|
105
110
|
| `src/hooks/use-mobile.ts` | `@kumix/ui/hooks/use-mobile` |
|
|
@@ -119,31 +124,37 @@ Base UI / shadcn base-nova. Preview: [ui.shadcn.com](https://ui.shadcn.com/docs/
|
|
|
119
124
|
|
|
120
125
|
Extended patterns. Preview: [reui.io](https://reui.io/docs).
|
|
121
126
|
|
|
122
|
-
| Module
|
|
123
|
-
|
|
|
124
|
-
| `alert` · `badge`
|
|
125
|
-
| `autocomplete`
|
|
126
|
-
| `cascader/*`
|
|
127
|
-
| `data-grid/*`
|
|
128
|
-
| `date-selector`
|
|
129
|
-
| `event-calendar/*`
|
|
130
|
-
| `filters/*`
|
|
131
|
-
| `code-block/*`
|
|
132
|
-
| `frame`
|
|
133
|
-
| `gantt/*`
|
|
134
|
-
| `icon-stack` · `icon-tile` · `kanban` · `number-field` · `phone-input` · `rating` · `scrollspy` · `sortable` · `stepper` · `timeline` · `tree` | — |
|
|
127
|
+
| Module | Notes |
|
|
128
|
+
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
129
|
+
| `alert` · `badge` | Extended variants (info/success/warning/…) |
|
|
130
|
+
| `autocomplete` | Base UI autocomplete |
|
|
131
|
+
| `cascader/*` | Multi-column cascading select, i18n, async |
|
|
132
|
+
| `data-grid/*` | Spreadsheet cell selection (ranges, clipboard, fill handle, editor), i18n, quick-create row, pagination, filters, DnD, virtual (rows + opt-in columns) |
|
|
133
|
+
| `date-selector` | Day / month / quarter / range |
|
|
134
|
+
| `event-calendar/*` | Month, week, day, agenda, resource |
|
|
135
|
+
| `filters/*` | Advanced filter builder (chip, date, DnD) |
|
|
136
|
+
| `code-block/*` | Shiki syntax highlighting, ANSI, collapsible |
|
|
137
|
+
| `frame` | Nested panel layout |
|
|
138
|
+
| `gantt/*` | Day–year scales, resources, DnD |
|
|
139
|
+
| `icon-stack` · `icon-tile` · `kanban` · `number-field` · `phone-input` · `rating` · `scrollspy` · `signature-pad` · `sortable` · `stepper` · `time-picker` · `timeline` · `tree` | — |
|
|
135
140
|
|
|
136
141
|
### beUI (`components/motion`)
|
|
137
142
|
|
|
138
143
|
Animated components built with [Motion](https://motion.dev). Preview: [beui.dev](https://beui.dev/components/motion). Bundled — `motion`, `lenis`, `@paper-design/shaders-react` are included, no extra installs needed.
|
|
139
144
|
|
|
140
|
-
`action-swap` (4 variants: base, blur, cascade, roll) · `adaptive-stepper` (+ `Liquid` easing backdrop) · `animated-badge` · `animated-number` · `animated-sidebar` · `animated-toast-stack` · `attachment-upload` · `availability-scheduler/*` (copy-menu, day-row, time-select) · `bloom-menu` · `bottom-sheet` · `bounce-sidebar` · `bouncy-accordion` · `breadcrumb` · `button/*` (base, magnetic, metallic, stateful, `ButtonLink`) · `card-folder` · `center-morph-modal` · `checkbox` · `chromatic-text-reveal` · `color-selector` · `combobox` + `combobox/*` (trigger, list, content, context) · `command-palette` · `context-menu` · `cylinder-carousel` · `digit-swap` · `dock` · `drawer` · `dynamic-island` · `expandable-action-bar` · `expandable-control` · `expandable-tabs` · `expanding-arrow-button` · `feedback-widget` · `file-tree` · `file-upload` · `hold-action-button` · `infinite-masonry` · `input` (`reserveErrorLine` reserves one validation line) · `liquid` (gooey SVG backdrop: `Liquid`, `LiquidItem`) · `loader` · `magnetic` · `marquee` · `morphing-modal` · `morphing-search` · `morphing-tabs` · `multi-select/*` (composable: trigger, list, content, context — entry `multi-select`) · `not-found/*` (glitch, magnetic, spotlight, stacked, terminal) · `notification-stack` · `number-ticker` · `otp-input` · `overflow-actions` · `parallax` · `popover` · `popover-morph` · `popover-position` (shared popover positioning helper) · `preview-rail` · `project-folder` · `pull-to-refresh` · `radio` · `range-slider` (6 variants) · `scroll-progress` · `scroll-reveal` · `scroll-to` · `select` · `select-morph` · `shader-background` · `shared-layout-bg` · `signup-form` · `slide-action-button` · `smooth-scroll` · `swipeable-list` · `switch` · `table/*` (virtualized, editable, async) · `tabs` · `text-cascade` · `text-reveal` · `text-scramble` · `text-shimmer` · `theme-toggle` · `tilt-card` · `tooltip` (controlled + uncontrolled; `followCursor`; `@floating-ui/dom` positioning; `anchorRef`/`anchorPoint` for chart integration) · `tooltip-surface` (shared animated surface) · `wheel-picker`
|
|
145
|
+
`action-swap` (4 variants: base, blur, cascade, roll) · `adaptive-stepper` (+ `Liquid` easing backdrop) · `alert` · `animated-badge` · `animated-number` · `animated-sidebar` · `animated-toast-stack` · `arc-picker` · `aspect-ratio` · `attachment-upload` · `availability-scheduler/*` (copy-menu, day-row, time-select) · `bloom-menu` · `bottom-sheet` · `bounce-sidebar` · `bouncy-accordion` · `breadcrumb` · `button/*` (base, magnetic, metallic, stateful, `ButtonLink`) · `card-folder` · `center-morph-modal` · `checkbox` · `chromatic-text-reveal` · `collapsible` · `color-selector` · `combobox` + `combobox/*` (trigger, list, content, context) · `command-palette` · `context-menu` · `cylinder-carousel` · `date-range-picker/*` · `digit-swap` · `dock` · `drawer` · `dynamic-island` · `expandable-action-bar` · `expandable-control` · `expandable-tabs` · `expanding-arrow-button` · `feedback-widget` · `file-tree` · `file-upload` · `hold-action-button` · `infinite-masonry` · `input` (`reserveErrorLine` reserves one validation line) · `knockout-bracket` · `knockout-wheel` · `liquid` (gooey SVG backdrop: `Liquid`, `LiquidItem`) · `loader` · `magnetic` · `marquee` · `morphing-lightbox` · `morphing-modal` · `morphing-search` · `morphing-tabs` · `multi-select/*` (composable: trigger, list, content, context — entry `multi-select`) · `not-found/*` (glitch, magnetic, spotlight, stacked, terminal) · `notification-stack` · `number-ticker` · `otp-input` · `overflow-actions` · `parallax` · `popover` · `popover-morph` · `popover-position` (shared popover positioning helper) · `prediction-market` · `prediction-market-card` · `preview-rail` · `project-folder` · `pull-to-refresh` · `radio` · `range-slider` (6 variants) · `scroll-progress` · `scroll-reveal` · `scroll-to` · `select` · `select-morph` · `shader-background` · `shared-layout-bg` · `signup-form` · `slide-action-button` · `smooth-scroll` · `sortable-list` · `sortable-stack` · `swap/*` · `swipeable-list` · `switch` · `table/*` (virtualized, editable, async) · `tabs` · `text-cascade` · `text-reveal` · `text-scramble` · `text-shimmer` · `theme-toggle` · `tilt-card` · `tooltip` (controlled + uncontrolled; `followCursor`; `@floating-ui/dom` positioning; `anchorRef`/`anchorPoint` for chart integration) · `tooltip-surface` (shared animated surface) · `wallet-card/*` · `wheel-picker`
|
|
141
146
|
|
|
142
147
|
### beUI — AI Agents (`components/agents`)
|
|
143
148
|
|
|
144
149
|
AI agent / chat UI components from [beUI](https://beui.dev). Preview: [beui.dev/components/agents](https://beui.dev/components/agents).
|
|
145
150
|
|
|
146
|
-
`agent-code` · `agent-disclosure` · `agent-activity/*` (activity-row) · `ai-sidebar` · `approval-card` · `chat-app` · `citations` · `code-block` · `file-diff` · `image-generation` · `loading-states/*` (agent-progress, reasoning-text, thinking-shimmer) · `message` · `message-bubble` · `message-context` · `message-scroller` · `prompt-input` · `streaming-response` · `todo-list` · `tool-approval` · `tool-result`
|
|
151
|
+
`agent-code` · `agent-disclosure` · `agent-activity/*` (activity-row) · `ai-sidebar` · `approval-card` · `chat-app` · `citations` · `code-block` · `file-diff` · `image-generation` · `loading-states/*` (agent-progress, reasoning-text, thinking-shimmer) · `message` · `message-bubble` · `message-context` · `message-scroller` · `prompt-input` · `streaming-response` · `todo-list` · `tool-approval` · `tool-result` · `voice-orb/*`
|
|
152
|
+
|
|
153
|
+
### Charts (`components/charts`)
|
|
154
|
+
|
|
155
|
+
Financial & data visualization charts.
|
|
156
|
+
|
|
157
|
+
`bump-chart/*` · `composition-chart/*` · `funnel-chart/*` · `heat-calendar/*` · `liquidity-heatmap/*` · `order-book/*` · `price-target-fan/*` · `returns-calendar/*` · `status-bar/*` · `treemap/*` · `volume-profile/*`
|
|
147
158
|
|
|
148
159
|
### Custom (`components/custom`)
|
|
149
160
|
|
|
@@ -155,7 +166,7 @@ Hand-written Kumix-specific composite components (not from any registry).
|
|
|
155
166
|
|
|
156
167
|
### Hooks
|
|
157
168
|
|
|
158
|
-
`use-body-classes` · `use-copy-to-clipboard` · `use-dismiss` · `use-favicon` · `use-file-upload` · `use-hover-capable` · `use-hover-gesture` · `use-hydrated` · `use-intersection-observer` · `use-is-mac` · `use-media-query` · `use-meta-color` · `use-mobile` · `use-mutation-observer` · `use-on-open` · `use-row-cursor` · `use-scroll-position` · `use-slider` · `use-slider-input` · `use-tap-gesture` · `use-touch-capable` · `use-viewport`
|
|
169
|
+
`use-body-classes` · `use-copy-to-clipboard` · `use-dismiss` · `use-favicon` · `use-file-upload` · `use-hover-capable` · `use-hover-gesture` · `use-hydrated` · `use-intersection-observer` · `use-is-mac` · `use-media-query` · `use-meta-color` · `use-mobile` · `use-modal-scope` · `use-mutation-observer` · `use-on-open` · `use-row-cursor` · `use-scroll-position` · `use-slider` · `use-slider-input` · `use-tap-gesture` · `use-touch-capable` · `use-viewport`
|
|
159
170
|
|
|
160
171
|
- `useIsMobile` (`use-mobile`) — fixed `768px` breakpoint; used by `sidebar` / `date-selector`. First paint may be `false` until mount.
|
|
161
172
|
- `useMediaQuery` — arbitrary query string; SSR-safe via `useSyncExternalStore` (server snapshot `false`).
|
|
@@ -199,7 +210,7 @@ bun run add:beui:blocks # precomposed layout blocks
|
|
|
199
210
|
node scripts/fix-imports.mjs # REQUIRED after CLI adds
|
|
200
211
|
```
|
|
201
212
|
|
|
202
|
-
`fix-imports.mjs` rewrites `@/lib/utils` → `@kumix/utils`, converts `@/components/*` / `@/hooks/*` / `@/lib/*` to relative paths, handles all registries (`ui`, `reui`, `motion`, `agents`, `custom`), and prepends `"use client"` when missing.
|
|
213
|
+
`fix-imports.mjs` rewrites `@/lib/utils` → `@kumix/utils`, converts `@/components/*` / `@/hooks/*` / `@/lib/*` to relative paths, handles all registries (`ui`, `reui`, `motion`, `agents`, `charts`, `custom`), and prepends `"use client"` when missing.
|
|
203
214
|
|
|
204
215
|
## License
|
|
205
216
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { cn } from "@kumix/utils";
|
|
2
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/motion/wallet-card/utils.ts
|
|
4
|
+
function diceBearGlassUrl(seed) {
|
|
5
|
+
return `https://api.dicebear.com/9.x/glass/svg?seed=${encodeURIComponent(seed)}`;
|
|
6
|
+
}
|
|
7
|
+
function truncateAddress(address) {
|
|
8
|
+
return address.length > 12 ? `${address.slice(0, 6)}…${address.slice(-4)}` : address;
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/components/motion/wallet-card/account-avatar.tsx
|
|
12
|
+
function AccountAvatar({ account, className }) {
|
|
13
|
+
if (account.avatar) return /* @__PURE__ */ jsx(Fragment, { children: account.avatar });
|
|
14
|
+
return /* @__PURE__ */ jsx("img", {
|
|
15
|
+
src: diceBearGlassUrl(account.id || account.address),
|
|
16
|
+
alt: account.name,
|
|
17
|
+
className: cn("h-7 w-7 shrink-0 rounded-full bg-muted", className)
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { truncateAddress as n, AccountAvatar as t };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=account-avatar-DILzuuvz.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-avatar-DILzuuvz.js","names":[],"sources":["../src/components/motion/wallet-card/utils.ts","../src/components/motion/wallet-card/account-avatar.tsx"],"sourcesContent":["export function diceBearGlassUrl(seed: string) {\n return `https://api.dicebear.com/9.x/glass/svg?seed=${encodeURIComponent(seed)}`;\n}\n\nexport function truncateAddress(address: string) {\n return address.length > 12 ? `${address.slice(0, 6)}…${address.slice(-4)}` : address;\n}\n","\"use client\";\n\nimport { cn } from \"@kumix/utils\";\nimport type { WalletAccount } from \"./types\";\nimport { diceBearGlassUrl } from \"./utils\";\n\nexport function AccountAvatar({\n account,\n className,\n}: {\n account: WalletAccount;\n className?: string;\n}) {\n if (account.avatar) return <>{account.avatar}</>;\n return (\n <img\n src={diceBearGlassUrl(account.id || account.address)}\n alt={account.name}\n className={cn(\"h-7 w-7 shrink-0 rounded-full bg-muted\", className)}\n />\n );\n}\n"],"mappings":";;;AAAA,SAAgB,iBAAiB,MAAc;CAC7C,OAAO,+CAA+C,mBAAmB,IAAI;AAC/E;AAEA,SAAgB,gBAAgB,SAAiB;CAC/C,OAAO,QAAQ,SAAS,KAAK,GAAG,QAAQ,MAAM,GAAG,CAAC,EAAE,GAAG,QAAQ,MAAM,EAAE,MAAM;AAC/E;;;ACAA,SAAgB,cAAc,EAC5B,SACA,aAIC;CACD,IAAI,QAAQ,QAAQ,OAAO,oBAAA,UAAA,EAAA,UAAG,QAAQ,OAAS,CAAA;CAC/C,OACE,oBAAC,OAAD;EACE,KAAK,iBAAiB,QAAQ,MAAM,QAAQ,OAAO;EACnD,KAAK,QAAQ;EACb,WAAW,GAAG,0CAA0C,SAAS;CAClE,CAAA;AAEL"}
|
|
@@ -16,6 +16,7 @@ interface CascaderNode<T = unknown> {
|
|
|
16
16
|
hasChildren?: boolean;
|
|
17
17
|
/** Trailing count. Defaults to known children; set it for async nodes. */
|
|
18
18
|
count?: number;
|
|
19
|
+
/** Listed, never selected or opened; on a branch, its whole subtree too. */
|
|
19
20
|
disabled?: boolean;
|
|
20
21
|
keywords?: string[];
|
|
21
22
|
/**
|
|
@@ -44,7 +45,7 @@ interface CascaderActionItem {
|
|
|
44
45
|
}
|
|
45
46
|
/** Panel layout. See the docs for the keyboard map of each. */
|
|
46
47
|
type CascaderMode = "drill" | "columns" | "tree";
|
|
47
|
-
type CascaderSearchScope = "level" | "deep";
|
|
48
|
+
type CascaderSearchScope = "level" | "deep" | "global";
|
|
48
49
|
/**
|
|
49
50
|
* Which nodes may be committed. The predicate arm is generic over the payload
|
|
50
51
|
* rather than quantified per call: a per-call `<T>` would force every predicate
|
|
@@ -128,7 +129,8 @@ interface CascaderLoadResult<T = unknown> {
|
|
|
128
129
|
/** Argument handed to `onSearch`. */
|
|
129
130
|
interface CascaderSearchContext {
|
|
130
131
|
signal: AbortSignal;
|
|
131
|
-
/** The path the user is searching within, deepest last.
|
|
132
|
+
/** The path the user is searching within, deepest last. Empty under a
|
|
133
|
+
* global search, whose scope is the whole tree. */
|
|
132
134
|
path: string[];
|
|
133
135
|
}
|
|
134
136
|
/**
|
|
@@ -137,6 +139,7 @@ interface CascaderSearchContext {
|
|
|
137
139
|
* force this object to carry the item generic. `*Announcement` is live-region.
|
|
138
140
|
*/
|
|
139
141
|
interface CascaderLabels {
|
|
142
|
+
/** `parentLabel` is absent at the root and under a global search. */
|
|
140
143
|
search: string | ((parentLabel?: string) => string);
|
|
141
144
|
back: string;
|
|
142
145
|
/** A level's FIRST page. `loadingMore` is the next, `loadMore` its idle row. */
|
|
@@ -180,4 +183,4 @@ interface CascaderLabels {
|
|
|
180
183
|
}
|
|
181
184
|
//#endregion
|
|
182
185
|
export { CascaderSelectable as _, CascaderFlatNode as a, CascaderLoadContext as c, CascaderLoadState as d, CascaderMode as f, CascaderSearchScope as g, CascaderSearchContext as h, CascaderCollapse as i, CascaderLoadReason as l, CascaderPathSegment as m, CascaderChangeDetails as n, CascaderIndex as o, CascaderNode as p, CascaderChangeReason as r, CascaderLabels as s, CascaderActionItem as t, CascaderLoadResult as u, CascaderValueDisplay as v };
|
|
183
|
-
//# sourceMappingURL=cascader-types-
|
|
186
|
+
//# sourceMappingURL=cascader-types-DVT-znZ-.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cascader-types-DVT-znZ-.d.ts","names":["React"],"sources":["../src/components/reui/cascader/cascader-types.tsx"],"mappings":";;;;;;;UASiB,aAAa;;EAE5B;EACA;EACA,OAAOA,QAAM;EACb;EACA,WAAW,aAAa;;EAExB;;EAEA;;EAEA;EACA;;;;;EAKA;EACA,OAAO;;;;;;UAOQ;;EAEf;EACA,OAAOA,QAAM;EACb,OAAOA,QAAM;EACb;;EAEA;;EAEA,QAAQ;;EAER;;;KAIU;KAEA;;;;;;;KAQA,mBAAmB,kCAAkC,MAAM,aAAa;KAExE;KAEA;KAEA;;UAGK,sBAAsB;;EAErC,MAAM,aAAa;;EAEnB,MAAM,aAAa;EACnB,OAAO,aAAa;EACpB,QAAQ;;;UAIO,cAAc;EAC7B,SAAS,YAAY,aAAa;;EAElC,YAAY,YAAY,aAAa;EACrC,UAAU;;EAEV,SAAS;;EAET,OAAO,aAAa;;EAEpB,KAAK,aAAa;;UAGH,iBAAiB;EAChC,MAAM,aAAa;EACnB;;EAEA;EACA;;EAEA;;EAEA;;;KAIU,oBAAoB;EAC1B;EAAc,MAAM,aAAa;;EACjC;EAAkB,QAAQ,aAAa;;;;;;;;UAQ5B;EACf;EACA;EACA;;EAEA;;;KAIU;;UAGK;;EAEf,QAAQ;EACR;EACA,SAAS;;;UAIM,mBAAmB;EAClC,OAAO,aAAa;EACpB;;EAEA;;;UAIe;EACf,QAAQ;;;EAGR;;;;;;;UAQe;;EAEf,mBAAmB;EACnB;;EAEA;EACA;EACA;EACA;EACA;EACA;;EAEA,gBAAgB;EAChB;EACA;EACA,aAAa;;EAEb;;EAEA;EACA,YAAY;;EAEZ;;EAEA;;EAEA;EACA;EACA;EACA;EACA;;EAEA,eAAe,MAAM,cAAc;EACnC,mBAAmB;EACnB,uBAAuB,eAAe;EACtC,wBAAwB;EACxB,oBAAoB,qBAAqB,eAAe;EACxD,sBAAsB;EACtB,yBAAyB;;EAEzB,sBAAsB,eAAe,eAAe;EACpD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import { MotionValue } from "motion/react";
|
|
3
|
+
//#region src/components/agents/voice-orb.d.ts
|
|
4
|
+
export type VoiceOrbProps = Omit<ComponentProps<"div">, "children" | "onError"> & {
|
|
5
|
+
/** Normalized activity, from 0 to 1. A MotionValue avoids React render loops. */
|
|
6
|
+
activity?: number | MotionValue<number>;
|
|
7
|
+
/** Optional caller-owned audio analyser. The component never requests a microphone. */
|
|
8
|
+
analyser?: AnalyserNode | null;
|
|
9
|
+
/** Base pigment, highlight and shadow, as #RGB or #RRGGBB hex colors. */
|
|
10
|
+
colors?: readonly [string, string, string];
|
|
11
|
+
/** Pause the material while keeping the current surface visible. */
|
|
12
|
+
active?: boolean;
|
|
13
|
+
speed?: number;
|
|
14
|
+
onError?: (error: Error) => void;
|
|
15
|
+
};
|
|
16
|
+
/** A grainy liquid sphere whose surface and silhouette respond to voice activity. */
|
|
17
|
+
export declare function VoiceOrb({ activity, analyser, colors, active, speed, onError, className, style, "aria-label": label, ...props }: VoiceOrbProps): import("react").JSX.Element;
|
|
18
|
+
//#endregion
|
|
19
|
+
//# sourceMappingURL=voice-orb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voice-orb.d.ts","names":[],"sources":["../../../src/components/agents/voice-orb.tsx"],"mappings":";;;YAiBY,gBAAgB,KAAK;;EAE/B,oBAAoB;;EAEpB,WAAW;;EAEX;;EAEA;EACA;EACA,WAAW,OAAO;;;wBAOJ,WACd,UACA,UACA,QACA,QACA,OACA,SACA,WACA,qBACc,UACX,SACF,gCAAa,IAAA"}
|
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { SPRING_GLIDE } from "../../lib/ease.js";
|
|
3
|
+
import { useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
4
|
+
import { cn } from "@kumix/utils";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { isMotionValue, motion, useMotionValue, useReducedMotion, useSpring, useTransform } from "motion/react";
|
|
7
|
+
//#region src/components/agents/voice-orb/renderer.ts
|
|
8
|
+
const VERTEX = `
|
|
9
|
+
attribute vec2 a_position;
|
|
10
|
+
void main() { gl_Position = vec4(a_position, 0.0, 1.0); }
|
|
11
|
+
`;
|
|
12
|
+
const FRAGMENT = `
|
|
13
|
+
precision highp float;
|
|
14
|
+
uniform vec2 u_resolution;
|
|
15
|
+
uniform float u_time;
|
|
16
|
+
uniform float u_activity;
|
|
17
|
+
uniform vec3 u_base;
|
|
18
|
+
uniform vec3 u_light;
|
|
19
|
+
uniform vec3 u_dark;
|
|
20
|
+
|
|
21
|
+
float hash(vec3 p) {
|
|
22
|
+
p = fract(p * 0.1031);
|
|
23
|
+
p += dot(p, p.yzx + 33.33);
|
|
24
|
+
return fract((p.x + p.y) * p.z);
|
|
25
|
+
}
|
|
26
|
+
float noise(vec3 p) {
|
|
27
|
+
vec3 i = floor(p);
|
|
28
|
+
vec3 f = fract(p);
|
|
29
|
+
f = f * f * (3.0 - 2.0 * f);
|
|
30
|
+
return mix(mix(mix(hash(i), hash(i + vec3(1,0,0)), f.x),
|
|
31
|
+
mix(hash(i + vec3(0,1,0)), hash(i + vec3(1,1,0)), f.x), f.y),
|
|
32
|
+
mix(mix(hash(i + vec3(0,0,1)), hash(i + vec3(1,0,1)), f.x),
|
|
33
|
+
mix(hash(i + vec3(0,1,1)), hash(i + vec3(1,1,1)), f.x), f.y), f.z);
|
|
34
|
+
}
|
|
35
|
+
float fbm(vec3 p) {
|
|
36
|
+
return noise(p) * 0.57 + noise(p * 2.03 + 7.2) * 0.28 + noise(p * 4.07 + 3.1) * 0.15;
|
|
37
|
+
}
|
|
38
|
+
void main() {
|
|
39
|
+
vec2 p = (gl_FragCoord.xy * 2.0 - u_resolution) / min(u_resolution.x, u_resolution.y);
|
|
40
|
+
float t = u_time * 0.38;
|
|
41
|
+
float angle = atan(p.y, p.x);
|
|
42
|
+
float breath = sin(u_time * 1.4) * 0.008;
|
|
43
|
+
float ripple = sin(angle * 3.0 + t * 2.1) * 0.55
|
|
44
|
+
+ sin(angle * 5.0 - t * 1.7) * 0.30
|
|
45
|
+
+ sin(angle * 2.0 + t) * 0.15;
|
|
46
|
+
p /= 0.91 + breath + u_activity * 0.025
|
|
47
|
+
+ ripple * (0.004 + u_activity * 0.024);
|
|
48
|
+
float r2 = dot(p, p);
|
|
49
|
+
float aa = 3.0 / min(u_resolution.x, u_resolution.y);
|
|
50
|
+
float alpha = 1.0 - smoothstep(1.0 - aa, 1.0, r2);
|
|
51
|
+
if (alpha <= 0.0) { gl_FragColor = vec4(0.0); return; }
|
|
52
|
+
vec3 normal = vec3(p, sqrt(max(0.0, 1.0 - r2)));
|
|
53
|
+
vec3 flow = vec3(normal.xy * 1.65, normal.z * 1.4);
|
|
54
|
+
flow.xy += vec2(sin(normal.y * 2.6 + t), cos(normal.x * 2.3 - t * 0.8))
|
|
55
|
+
* (0.25 + u_activity * 0.22);
|
|
56
|
+
vec3 warp = vec3(noise(flow + vec3(0.0, t, t * 0.3)),
|
|
57
|
+
noise(flow + vec3(4.7, -t * 0.7, t)),
|
|
58
|
+
noise(flow + vec3(t * 0.5, 9.2, -t))) - 0.5;
|
|
59
|
+
float pigment = fbm(flow + warp * 1.4 + vec3(t * 0.3, -t * 0.2, t * 0.4));
|
|
60
|
+
float fold = normal.x * 0.50 + normal.y * 0.32
|
|
61
|
+
+ sin(normal.y * 2.6 - t) * 0.30 + (pigment - 0.5) * 0.65;
|
|
62
|
+
float shadow = smoothstep(-0.30, 0.42, fold);
|
|
63
|
+
vec3 color = mix(u_dark, u_base, shadow);
|
|
64
|
+
color = mix(color, u_light, smoothstep(0.40, 0.82, pigment) * 0.34);
|
|
65
|
+
float diffuse = max(0.0, dot(normal, normalize(vec3(-0.4, 0.65, 1.0))));
|
|
66
|
+
color *= 0.64 + 0.46 * diffuse;
|
|
67
|
+
float shine = exp(-pow((fold + 0.06) * 8.0, 2.0)) * pow(normal.z, 0.65);
|
|
68
|
+
float innerLight = exp(-pow((fold - 0.28) * 4.0, 2.0)) * normal.z;
|
|
69
|
+
color = mix(color, u_light, innerLight * (0.18 + u_activity * 0.16));
|
|
70
|
+
color = mix(color, mix(u_light, vec3(1.0), 0.55), shine * 0.78);
|
|
71
|
+
float gleam = pow(max(0.0, dot(normal, normalize(vec3(-0.45, 0.55, 1.0)))), 24.0);
|
|
72
|
+
color += gleam * 0.16;
|
|
73
|
+
float rim = pow(1.0 - normal.z, 3.0);
|
|
74
|
+
color = mix(color, u_light, rim * (0.36 + 0.25 * max(0.0, -normal.x)));
|
|
75
|
+
float grain = hash(vec3(gl_FragCoord.xy, 1.0)) - 0.5;
|
|
76
|
+
color += grain * 0.032;
|
|
77
|
+
gl_FragColor = vec4(clamp(color, 0.0, 1.0), alpha);
|
|
78
|
+
}
|
|
79
|
+
`;
|
|
80
|
+
function rgb(hex) {
|
|
81
|
+
const short = /^#([\da-f])([\da-f])([\da-f])$/i.exec(hex);
|
|
82
|
+
const normalized = short ? `#${short[1]}${short[1]}${short[2]}${short[2]}${short[3]}${short[3]}` : hex;
|
|
83
|
+
if (!/^#[\da-f]{6}$/i.test(normalized)) throw new Error("VoiceOrb colors must be #RGB or #RRGGBB hex colors.");
|
|
84
|
+
const value = Number.parseInt(normalized.slice(1), 16);
|
|
85
|
+
return [
|
|
86
|
+
(value >> 16 & 255) / 255,
|
|
87
|
+
(value >> 8 & 255) / 255,
|
|
88
|
+
(value & 255) / 255
|
|
89
|
+
];
|
|
90
|
+
}
|
|
91
|
+
/** Owns only GPU resources and draw scheduling; it never opens an audio source. */
|
|
92
|
+
function createOrbRenderer(canvas, read, onError) {
|
|
93
|
+
const gl = canvas.getContext("webgl", {
|
|
94
|
+
alpha: true,
|
|
95
|
+
antialias: false,
|
|
96
|
+
premultipliedAlpha: false,
|
|
97
|
+
powerPreference: "low-power"
|
|
98
|
+
});
|
|
99
|
+
if (!gl) throw new Error("WebGL is unavailable in this browser.");
|
|
100
|
+
let disposed = false;
|
|
101
|
+
let frame = 0;
|
|
102
|
+
let elapsed = 0;
|
|
103
|
+
let previous = 0;
|
|
104
|
+
let visible = true;
|
|
105
|
+
let lost = false;
|
|
106
|
+
let failed = false;
|
|
107
|
+
let program = null;
|
|
108
|
+
let buffer = null;
|
|
109
|
+
let shaders = [];
|
|
110
|
+
let uniforms = {};
|
|
111
|
+
let palette = null;
|
|
112
|
+
let size = {
|
|
113
|
+
width: canvas.clientWidth,
|
|
114
|
+
height: canvas.clientHeight
|
|
115
|
+
};
|
|
116
|
+
const destroy = () => {
|
|
117
|
+
if (buffer) gl.deleteBuffer(buffer);
|
|
118
|
+
if (program) gl.deleteProgram(program);
|
|
119
|
+
for (const shader of shaders) gl.deleteShader(shader);
|
|
120
|
+
buffer = null;
|
|
121
|
+
program = null;
|
|
122
|
+
shaders = [];
|
|
123
|
+
};
|
|
124
|
+
const initialize = () => {
|
|
125
|
+
const compile = (type, source) => {
|
|
126
|
+
const shader = gl.createShader(type);
|
|
127
|
+
if (!shader) throw new Error("Could not allocate an orb shader.");
|
|
128
|
+
shaders.push(shader);
|
|
129
|
+
gl.shaderSource(shader, source);
|
|
130
|
+
gl.compileShader(shader);
|
|
131
|
+
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) throw new Error(gl.getShaderInfoLog(shader) || "Could not compile the orb shader.");
|
|
132
|
+
return shader;
|
|
133
|
+
};
|
|
134
|
+
const vertex = compile(gl.VERTEX_SHADER, VERTEX);
|
|
135
|
+
const fragment = compile(gl.FRAGMENT_SHADER, FRAGMENT);
|
|
136
|
+
program = gl.createProgram();
|
|
137
|
+
if (!program) throw new Error("Could not allocate the orb program.");
|
|
138
|
+
gl.attachShader(program, vertex);
|
|
139
|
+
gl.attachShader(program, fragment);
|
|
140
|
+
gl.linkProgram(program);
|
|
141
|
+
if (!gl.getProgramParameter(program, gl.LINK_STATUS)) throw new Error(gl.getProgramInfoLog(program) || "Could not link the orb program.");
|
|
142
|
+
gl.useProgram(program);
|
|
143
|
+
buffer = gl.createBuffer();
|
|
144
|
+
if (!buffer) throw new Error("Could not allocate the orb buffer.");
|
|
145
|
+
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
146
|
+
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
|
|
147
|
+
-1,
|
|
148
|
+
-1,
|
|
149
|
+
1,
|
|
150
|
+
-1,
|
|
151
|
+
-1,
|
|
152
|
+
1,
|
|
153
|
+
-1,
|
|
154
|
+
1,
|
|
155
|
+
1,
|
|
156
|
+
-1,
|
|
157
|
+
1,
|
|
158
|
+
1
|
|
159
|
+
]), gl.STATIC_DRAW);
|
|
160
|
+
const attribute = gl.getAttribLocation(program, "a_position");
|
|
161
|
+
gl.enableVertexAttribArray(attribute);
|
|
162
|
+
gl.vertexAttribPointer(attribute, 2, gl.FLOAT, false, 0, 0);
|
|
163
|
+
uniforms = Object.fromEntries([
|
|
164
|
+
"u_resolution",
|
|
165
|
+
"u_time",
|
|
166
|
+
"u_activity",
|
|
167
|
+
"u_base",
|
|
168
|
+
"u_light",
|
|
169
|
+
"u_dark"
|
|
170
|
+
].map((name) => [name, gl.getUniformLocation(program, name)]));
|
|
171
|
+
palette = null;
|
|
172
|
+
};
|
|
173
|
+
const pause = () => {
|
|
174
|
+
cancelAnimationFrame(frame);
|
|
175
|
+
frame = 0;
|
|
176
|
+
previous = 0;
|
|
177
|
+
};
|
|
178
|
+
const draw = (now) => {
|
|
179
|
+
frame = 0;
|
|
180
|
+
if (disposed || lost || !visible || document.hidden) {
|
|
181
|
+
previous = 0;
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
try {
|
|
185
|
+
const state = read();
|
|
186
|
+
if (state.animated && previous) elapsed += Math.min(.05, (now - previous) / 1e3) * state.speed * (1 + state.activity * .6);
|
|
187
|
+
previous = state.animated ? now : 0;
|
|
188
|
+
const dpr = Math.min(window.devicePixelRatio || 1, 2);
|
|
189
|
+
const width = Math.max(1, Math.round(size.width * dpr));
|
|
190
|
+
const height = Math.max(1, Math.round(size.height * dpr));
|
|
191
|
+
if (canvas.width !== width || canvas.height !== height) {
|
|
192
|
+
canvas.width = width;
|
|
193
|
+
canvas.height = height;
|
|
194
|
+
}
|
|
195
|
+
gl.viewport(0, 0, width, height);
|
|
196
|
+
gl.uniform2f(uniforms.u_resolution ?? null, width, height);
|
|
197
|
+
gl.uniform1f(uniforms.u_time ?? null, elapsed);
|
|
198
|
+
gl.uniform1f(uniforms.u_activity ?? null, state.activity);
|
|
199
|
+
if (!palette || palette.some((color, index) => color !== state.colors[index])) {
|
|
200
|
+
const colors = state.colors.map(rgb);
|
|
201
|
+
gl.uniform3fv(uniforms.u_base ?? null, colors[0]);
|
|
202
|
+
gl.uniform3fv(uniforms.u_light ?? null, colors[1]);
|
|
203
|
+
gl.uniform3fv(uniforms.u_dark ?? null, colors[2]);
|
|
204
|
+
palette = state.colors;
|
|
205
|
+
}
|
|
206
|
+
gl.drawArrays(gl.TRIANGLES, 0, 6);
|
|
207
|
+
if (state.animated) frame = requestAnimationFrame(draw);
|
|
208
|
+
} catch (error) {
|
|
209
|
+
failed = true;
|
|
210
|
+
pause();
|
|
211
|
+
onError(error instanceof Error ? error : new Error(String(error)));
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
const requestDraw = () => {
|
|
215
|
+
if (!disposed && !lost && !failed && visible && !document.hidden && !frame) frame = requestAnimationFrame(draw);
|
|
216
|
+
};
|
|
217
|
+
const visibility = () => {
|
|
218
|
+
if (document.hidden) pause();
|
|
219
|
+
else requestDraw();
|
|
220
|
+
};
|
|
221
|
+
const contextLost = (event) => {
|
|
222
|
+
event.preventDefault();
|
|
223
|
+
lost = true;
|
|
224
|
+
pause();
|
|
225
|
+
};
|
|
226
|
+
const contextRestored = () => {
|
|
227
|
+
try {
|
|
228
|
+
destroy();
|
|
229
|
+
initialize();
|
|
230
|
+
lost = false;
|
|
231
|
+
requestDraw();
|
|
232
|
+
} catch (error) {
|
|
233
|
+
onError(error instanceof Error ? error : new Error(String(error)));
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
try {
|
|
237
|
+
initialize();
|
|
238
|
+
} catch (error) {
|
|
239
|
+
destroy();
|
|
240
|
+
throw error;
|
|
241
|
+
}
|
|
242
|
+
const resize = new ResizeObserver(([entry]) => {
|
|
243
|
+
if (entry) size = {
|
|
244
|
+
width: entry.contentRect.width,
|
|
245
|
+
height: entry.contentRect.height
|
|
246
|
+
};
|
|
247
|
+
requestDraw();
|
|
248
|
+
});
|
|
249
|
+
resize.observe(canvas);
|
|
250
|
+
const intersection = new IntersectionObserver(([entry]) => {
|
|
251
|
+
visible = entry?.isIntersecting ?? true;
|
|
252
|
+
if (visible) requestDraw();
|
|
253
|
+
else pause();
|
|
254
|
+
});
|
|
255
|
+
intersection.observe(canvas);
|
|
256
|
+
canvas.addEventListener("webglcontextlost", contextLost);
|
|
257
|
+
canvas.addEventListener("webglcontextrestored", contextRestored);
|
|
258
|
+
document.addEventListener("visibilitychange", visibility);
|
|
259
|
+
requestDraw();
|
|
260
|
+
return {
|
|
261
|
+
requestDraw,
|
|
262
|
+
dispose: () => {
|
|
263
|
+
disposed = true;
|
|
264
|
+
pause();
|
|
265
|
+
resize.disconnect();
|
|
266
|
+
intersection.disconnect();
|
|
267
|
+
canvas.removeEventListener("webglcontextlost", contextLost);
|
|
268
|
+
canvas.removeEventListener("webglcontextrestored", contextRestored);
|
|
269
|
+
document.removeEventListener("visibilitychange", visibility);
|
|
270
|
+
destroy();
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
//#endregion
|
|
275
|
+
//#region src/components/agents/voice-orb.tsx
|
|
276
|
+
const DEFAULT_COLORS = [
|
|
277
|
+
"#e8754d",
|
|
278
|
+
"#ffe0ac",
|
|
279
|
+
"#346b52"
|
|
280
|
+
];
|
|
281
|
+
const level = (value) => Number.isFinite(value) ? Math.max(0, Math.min(1, value)) : 0;
|
|
282
|
+
/** A grainy liquid sphere whose surface and silhouette respond to voice activity. */
|
|
283
|
+
function VoiceOrb({ activity = 0, analyser = null, colors = DEFAULT_COLORS, active = true, speed = 1, onError, className, style, "aria-label": label, ...props }) {
|
|
284
|
+
const reducedMotion = useReducedMotion();
|
|
285
|
+
const canvas = useRef(null);
|
|
286
|
+
const renderer = useRef(null);
|
|
287
|
+
const [error, setError] = useState(null);
|
|
288
|
+
const target = useMotionValue(0);
|
|
289
|
+
const smooth = useSpring(target, SPRING_GLIDE);
|
|
290
|
+
const transform = useTransform(smooth, (value) => `translate3d(0, ${-value * 2}px, 0) scale(${1 + value * .04}, ${1 - value * .018})`);
|
|
291
|
+
const latest = useRef({
|
|
292
|
+
activity,
|
|
293
|
+
analyser,
|
|
294
|
+
colors,
|
|
295
|
+
active,
|
|
296
|
+
speed,
|
|
297
|
+
reducedMotion,
|
|
298
|
+
onError
|
|
299
|
+
});
|
|
300
|
+
useLayoutEffect(() => {
|
|
301
|
+
latest.current = {
|
|
302
|
+
activity,
|
|
303
|
+
analyser,
|
|
304
|
+
colors,
|
|
305
|
+
active,
|
|
306
|
+
speed,
|
|
307
|
+
reducedMotion,
|
|
308
|
+
onError
|
|
309
|
+
};
|
|
310
|
+
const value = active && !reducedMotion ? level(isMotionValue(activity) ? activity.get() : activity) : 0;
|
|
311
|
+
if (reducedMotion) {
|
|
312
|
+
smooth.jump(0);
|
|
313
|
+
target.set(0);
|
|
314
|
+
} else target.set(value);
|
|
315
|
+
renderer.current?.requestDraw();
|
|
316
|
+
});
|
|
317
|
+
useEffect(() => {
|
|
318
|
+
if (!isMotionValue(activity)) return;
|
|
319
|
+
return activity.on("change", (value) => {
|
|
320
|
+
if (latest.current.active && !latest.current.reducedMotion) target.set(level(value));
|
|
321
|
+
renderer.current?.requestDraw();
|
|
322
|
+
});
|
|
323
|
+
}, [activity, target]);
|
|
324
|
+
useEffect(() => smooth.on("change", () => renderer.current?.requestDraw()), [smooth]);
|
|
325
|
+
useEffect(() => {
|
|
326
|
+
const element = canvas.current;
|
|
327
|
+
if (!element) return;
|
|
328
|
+
let sample = null;
|
|
329
|
+
let audioSource = null;
|
|
330
|
+
const failed = (failure) => {
|
|
331
|
+
setError(failure);
|
|
332
|
+
latest.current.onError?.(failure);
|
|
333
|
+
};
|
|
334
|
+
try {
|
|
335
|
+
renderer.current = createOrbRenderer(element, () => {
|
|
336
|
+
const current = latest.current;
|
|
337
|
+
if (current.analyser && current.active && !current.reducedMotion) {
|
|
338
|
+
if (audioSource !== current.analyser || sample?.length !== current.analyser.fftSize) {
|
|
339
|
+
audioSource = current.analyser;
|
|
340
|
+
sample = new Uint8Array(new ArrayBuffer(current.analyser.fftSize));
|
|
341
|
+
}
|
|
342
|
+
if (sample) {
|
|
343
|
+
current.analyser.getByteTimeDomainData(sample);
|
|
344
|
+
let sum = 0;
|
|
345
|
+
for (const byte of sample) sum += ((byte - 128) / 128) ** 2;
|
|
346
|
+
target.set(level(Math.sqrt(sum / sample.length) * 3));
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
return {
|
|
350
|
+
activity: current.active && !current.reducedMotion ? level(smooth.get()) : 0,
|
|
351
|
+
colors: current.colors,
|
|
352
|
+
speed: Number.isFinite(current.speed) ? Math.max(0, current.speed) : 1,
|
|
353
|
+
animated: current.active && !current.reducedMotion && (current.speed > 0 || !!current.analyser)
|
|
354
|
+
};
|
|
355
|
+
}, failed);
|
|
356
|
+
} catch (failure) {
|
|
357
|
+
failed(failure instanceof Error ? failure : new Error(String(failure)));
|
|
358
|
+
}
|
|
359
|
+
return () => {
|
|
360
|
+
renderer.current?.dispose();
|
|
361
|
+
renderer.current = null;
|
|
362
|
+
};
|
|
363
|
+
}, [smooth, target]);
|
|
364
|
+
return /* @__PURE__ */ jsx("div", {
|
|
365
|
+
...props,
|
|
366
|
+
role: "img",
|
|
367
|
+
"aria-label": label,
|
|
368
|
+
"aria-hidden": label ? void 0 : true,
|
|
369
|
+
"data-slot": "voice-orb",
|
|
370
|
+
"data-render-state": error ? "error" : "ready",
|
|
371
|
+
className: cn("relative aspect-square w-64 shrink-0", className),
|
|
372
|
+
style,
|
|
373
|
+
children: error ? /* @__PURE__ */ jsx("div", {
|
|
374
|
+
className: "flex size-full items-center justify-center rounded-full border border-border bg-card p-8 text-center text-muted-foreground text-xs",
|
|
375
|
+
children: "Orb rendering unavailable"
|
|
376
|
+
}) : /* @__PURE__ */ jsx(motion.div, {
|
|
377
|
+
className: "size-full",
|
|
378
|
+
style: { transform: reducedMotion ? "none" : transform },
|
|
379
|
+
children: /* @__PURE__ */ jsx("canvas", {
|
|
380
|
+
ref: canvas,
|
|
381
|
+
className: "block size-full"
|
|
382
|
+
})
|
|
383
|
+
})
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
//#endregion
|
|
387
|
+
export { VoiceOrb };
|
|
388
|
+
|
|
389
|
+
//# sourceMappingURL=voice-orb.js.map
|