@kumix/ui 0.4.0 → 0.4.2
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 +52 -45
- package/dist/{cascader-types-DVT-znZ-.d.ts → cascader-types-zhnUQ4sP.d.ts} +11 -3
- package/dist/cascader-types-zhnUQ4sP.d.ts.map +1 -0
- package/dist/components/agents/agent-code.js +1 -1
- package/dist/components/agents/approval-card/index.d.ts +2 -0
- package/dist/components/agents/approval-card/index.d.ts.map +1 -1
- package/dist/components/agents/approval-card/index.js +2 -0
- package/dist/components/agents/approval-card/index.js.map +1 -1
- package/dist/components/agents/citations.d.ts +14 -2
- package/dist/components/agents/citations.d.ts.map +1 -1
- package/dist/components/agents/citations.js +11 -7
- package/dist/components/agents/citations.js.map +1 -1
- package/dist/components/agents/loading-states/reasoning-text.d.ts.map +1 -1
- package/dist/components/agents/loading-states/reasoning-text.js +3 -0
- package/dist/components/agents/loading-states/reasoning-text.js.map +1 -1
- package/dist/components/charts/bump-chart/context.js +1 -2
- package/dist/components/charts/bump-chart/plot.js +1 -2
- package/dist/components/charts/bump-chart/point.js +1 -1
- package/dist/components/charts/bump-chart/series.d.ts +1 -0
- package/dist/components/charts/candlestick-chart/context.d.ts +79 -0
- package/dist/components/charts/candlestick-chart/context.d.ts.map +1 -0
- package/dist/components/charts/candlestick-chart/context.js +69 -0
- package/dist/components/charts/candlestick-chart/context.js.map +1 -0
- package/dist/components/charts/candlestick-chart/legend.d.ts +12 -0
- package/dist/components/charts/candlestick-chart/legend.d.ts.map +1 -0
- package/dist/components/charts/candlestick-chart/legend.js +56 -0
- package/dist/components/charts/candlestick-chart/legend.js.map +1 -0
- package/dist/components/charts/candlestick-chart/plot.d.ts +9 -0
- package/dist/components/charts/candlestick-chart/plot.d.ts.map +1 -0
- package/dist/components/charts/candlestick-chart/plot.js +218 -0
- package/dist/components/charts/candlestick-chart/plot.js.map +1 -0
- package/dist/components/charts/candlestick-chart.d.ts +18 -0
- package/dist/components/charts/candlestick-chart.d.ts.map +1 -0
- package/dist/components/charts/candlestick-chart.js +34 -0
- package/dist/components/charts/candlestick-chart.js.map +1 -0
- package/dist/components/charts/composition-chart/context.js +1 -2
- package/dist/components/charts/composition-chart/plot.js +1 -1
- package/dist/components/charts/donut-chart/center.d.ts +16 -0
- package/dist/components/charts/donut-chart/center.d.ts.map +1 -0
- package/dist/components/charts/donut-chart/center.js +78 -0
- package/dist/components/charts/donut-chart/center.js.map +1 -0
- package/dist/components/charts/donut-chart/context.d.ts +68 -0
- package/dist/components/charts/donut-chart/context.d.ts.map +1 -0
- package/dist/components/charts/donut-chart/context.js +2 -0
- package/dist/components/charts/donut-chart/legend.d.ts +17 -0
- package/dist/components/charts/donut-chart/legend.d.ts.map +1 -0
- package/dist/components/charts/donut-chart/legend.js +85 -0
- package/dist/components/charts/donut-chart/legend.js.map +1 -0
- package/dist/components/charts/donut-chart/plot.d.ts +10 -0
- package/dist/components/charts/donut-chart/plot.d.ts.map +1 -0
- package/dist/components/charts/donut-chart/plot.js +108 -0
- package/dist/components/charts/donut-chart/plot.js.map +1 -0
- package/dist/components/charts/donut-chart.d.ts +22 -0
- package/dist/components/charts/donut-chart.d.ts.map +1 -0
- package/dist/components/charts/donut-chart.js +37 -0
- package/dist/components/charts/donut-chart.js.map +1 -0
- package/dist/components/charts/funnel-chart.d.ts.map +1 -1
- package/dist/components/charts/funnel-chart.js +1 -2
- package/dist/components/charts/funnel-chart.js.map +1 -1
- package/dist/components/charts/heat-calendar/tooltip.js +1 -1
- package/dist/components/charts/liquidity-heatmap.d.ts.map +1 -1
- package/dist/components/charts/liquidity-heatmap.js +1 -1
- package/dist/components/charts/order-book/depth-row.d.ts +8 -2
- package/dist/components/charts/order-book/depth-row.d.ts.map +1 -1
- package/dist/components/charts/order-book/depth-row.js +11 -3
- package/dist/components/charts/order-book/depth-row.js.map +1 -1
- package/dist/components/charts/order-book.d.ts +33 -1
- package/dist/components/charts/order-book.d.ts.map +1 -1
- package/dist/components/charts/order-book.js +92 -17
- package/dist/components/charts/order-book.js.map +1 -1
- package/dist/components/charts/price-target-fan/tooltip.js +1 -1
- package/dist/components/charts/returns-calendar/tooltip.js +1 -1
- package/dist/components/charts/status-bar/tooltip.js +1 -1
- package/dist/components/charts/treemap/tooltip.js +1 -1
- package/dist/components/charts/treemap.d.ts.map +1 -1
- package/dist/components/charts/volume-profile/tooltip.js +1 -1
- package/dist/components/charts/volume-profile.d.ts.map +1 -1
- package/dist/components/custom/confirm-dialog.d.ts +1 -0
- package/dist/components/custom/toast.d.ts +1 -0
- package/dist/components/motion/action-swap.d.ts +1 -1
- package/dist/components/motion/action-swap.d.ts.map +1 -1
- package/dist/components/motion/action-swap.js +46 -20
- package/dist/components/motion/action-swap.js.map +1 -1
- package/dist/components/motion/animated-badge.d.ts +1 -1
- package/dist/components/motion/animated-badge.d.ts.map +1 -1
- package/dist/components/motion/animated-badge.js +60 -101
- package/dist/components/motion/animated-badge.js.map +1 -1
- package/dist/components/motion/animated-sidebar.d.ts +1 -0
- package/dist/components/motion/animated-sidebar.js +1 -1
- package/dist/components/motion/animated-toast-stack.js +1 -1
- package/dist/components/motion/attachment-upload.d.ts.map +1 -1
- package/dist/components/motion/attachment-upload.js +2 -3
- package/dist/components/motion/attachment-upload.js.map +1 -1
- package/dist/components/motion/availability-scheduler/copy-menu.js +1 -2
- 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.d.ts +1 -0
- package/dist/components/motion/bloom-menu.d.ts.map +1 -1
- package/dist/components/motion/bloom-menu.js +73 -8
- package/dist/components/motion/bloom-menu.js.map +1 -1
- package/dist/components/motion/bottom-sheet.d.ts.map +1 -1
- package/dist/components/motion/bottom-sheet.js +6 -10
- package/dist/components/motion/bottom-sheet.js.map +1 -1
- package/dist/components/motion/bounce-sidebar.d.ts.map +1 -1
- package/dist/components/motion/bounce-sidebar.js +34 -42
- package/dist/components/motion/bounce-sidebar.js.map +1 -1
- package/dist/components/motion/bouncy-accordion.d.ts.map +1 -1
- package/dist/components/motion/bouncy-accordion.js +35 -22
- package/dist/components/motion/bouncy-accordion.js.map +1 -1
- package/dist/components/motion/button/stateful.d.ts.map +1 -1
- package/dist/components/motion/button/stateful.js +3 -0
- package/dist/components/motion/button/stateful.js.map +1 -1
- package/dist/components/motion/card.d.ts +44 -0
- package/dist/components/motion/card.d.ts.map +1 -0
- package/dist/components/motion/card.js +122 -0
- package/dist/components/motion/card.js.map +1 -0
- package/dist/components/motion/center-morph-modal.js +1 -1
- package/dist/components/motion/checkbox.d.ts +3 -1
- package/dist/components/motion/checkbox.d.ts.map +1 -1
- package/dist/components/motion/checkbox.js +18 -6
- package/dist/components/motion/checkbox.js.map +1 -1
- package/dist/components/motion/color-picker.d.ts +110 -0
- package/dist/components/motion/color-picker.d.ts.map +1 -0
- package/dist/components/motion/color-picker.js +1053 -0
- package/dist/components/motion/color-picker.js.map +1 -0
- package/dist/components/motion/color-selector.d.ts.map +1 -1
- package/dist/components/motion/color-selector.js +9 -2
- package/dist/components/motion/color-selector.js.map +1 -1
- package/dist/components/motion/combobox/content.d.ts +1 -0
- package/dist/components/motion/command-palette.js +3 -3
- package/dist/components/motion/command-palette.js.map +1 -1
- package/dist/components/motion/context-menu.d.ts +1 -0
- package/dist/components/motion/context-menu.js +1 -1
- package/dist/components/motion/date-range-picker.d.ts.map +1 -1
- package/dist/components/motion/digit-swap.d.ts +9 -1
- package/dist/components/motion/digit-swap.d.ts.map +1 -1
- package/dist/components/motion/digit-swap.js +18 -7
- package/dist/components/motion/digit-swap.js.map +1 -1
- package/dist/components/motion/drawer.d.ts +1 -1
- package/dist/components/motion/drawer.d.ts.map +1 -1
- package/dist/components/motion/drawer.js +10 -10
- package/dist/components/motion/drawer.js.map +1 -1
- package/dist/components/motion/expandable-action-bar.d.ts.map +1 -1
- package/dist/components/motion/expandable-control.d.ts +1 -0
- package/dist/components/motion/feedback-widget.js +4 -1
- package/dist/components/motion/feedback-widget.js.map +1 -1
- package/dist/components/motion/knockout-wheel.d.ts.map +1 -1
- package/dist/components/motion/knockout-wheel.js +1 -2
- package/dist/components/motion/knockout-wheel.js.map +1 -1
- package/dist/components/motion/morphing-lightbox.d.ts.map +1 -1
- package/dist/components/motion/morphing-lightbox.js +1 -1
- package/dist/components/motion/morphing-modal.d.ts +6 -1
- package/dist/components/motion/morphing-modal.d.ts.map +1 -1
- package/dist/components/motion/morphing-modal.js +37 -5
- package/dist/components/motion/morphing-modal.js.map +1 -1
- package/dist/components/motion/morphing-search-chips.d.ts +54 -0
- package/dist/components/motion/morphing-search-chips.d.ts.map +1 -0
- package/dist/components/motion/morphing-search-chips.js +599 -0
- package/dist/components/motion/morphing-search-chips.js.map +1 -0
- package/dist/components/motion/morphing-search.js +1 -1
- package/dist/components/motion/morphing-tabs.js +1 -1
- package/dist/components/motion/multi-select/content.d.ts +1 -0
- package/dist/components/motion/not-found/shared.d.ts +1 -0
- package/dist/components/motion/number-ticker.d.ts +6 -1
- package/dist/components/motion/number-ticker.d.ts.map +1 -1
- package/dist/components/motion/number-ticker.js +19 -9
- package/dist/components/motion/number-ticker.js.map +1 -1
- package/dist/components/motion/otp-input.js +19 -11
- package/dist/components/motion/otp-input.js.map +1 -1
- package/dist/components/motion/parallax.js.map +1 -1
- package/dist/components/motion/popover-morph.d.ts +5 -3
- package/dist/components/motion/popover-morph.d.ts.map +1 -1
- package/dist/components/motion/popover-morph.js +47 -52
- package/dist/components/motion/popover-morph.js.map +1 -1
- package/dist/components/motion/popover.d.ts +1 -0
- package/dist/components/motion/popover.js +7 -1
- package/dist/components/motion/popover.js.map +1 -1
- package/dist/components/motion/prediction-market-card.js +2 -3
- package/dist/components/motion/prediction-market-card.js.map +1 -1
- package/dist/components/motion/prediction-market.js +1 -1
- package/dist/components/motion/project-folder.js +1 -1
- package/dist/components/motion/radio.d.ts +8 -2
- package/dist/components/motion/radio.d.ts.map +1 -1
- package/dist/components/motion/radio.js +70 -10
- package/dist/components/motion/radio.js.map +1 -1
- package/dist/components/motion/scroll-progress.d.ts +1 -0
- package/dist/components/motion/select-morph.d.ts +1 -1
- package/dist/components/motion/select-morph.d.ts.map +1 -1
- package/dist/components/motion/select-morph.js +89 -21
- package/dist/components/motion/select-morph.js.map +1 -1
- package/dist/components/motion/select.d.ts.map +1 -1
- package/dist/components/motion/select.js +153 -135
- package/dist/components/motion/select.js.map +1 -1
- package/dist/components/motion/shader-background.d.ts +4 -2
- package/dist/components/motion/shader-background.d.ts.map +1 -1
- package/dist/components/motion/shader-background.js +9 -3
- package/dist/components/motion/shader-background.js.map +1 -1
- package/dist/components/motion/shared-layout-bg.d.ts.map +1 -1
- package/dist/components/motion/shared-layout-bg.js +17 -3
- package/dist/components/motion/shared-layout-bg.js.map +1 -1
- package/dist/components/motion/sortable-list.d.ts +1 -0
- package/dist/components/motion/sortable-stack.js +1 -2
- package/dist/components/motion/swipeable-list.d.ts.map +1 -1
- package/dist/components/motion/swipeable-list.js +61 -4
- package/dist/components/motion/swipeable-list.js.map +1 -1
- 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 +13 -3
- package/dist/components/motion/tabs.d.ts.map +1 -1
- package/dist/components/motion/tabs.js +248 -26
- package/dist/components/motion/tabs.js.map +1 -1
- package/dist/components/motion/text-reveal.d.ts +1 -0
- package/dist/components/motion/theme-toggle.js +1 -1
- package/dist/components/motion/tooltip/positioner.d.ts +8 -26
- package/dist/components/motion/tooltip/positioner.d.ts.map +1 -1
- package/dist/components/motion/tooltip/positioner.js +1 -2
- package/dist/components/motion/tooltip.d.ts +62 -20
- package/dist/components/motion/tooltip.d.ts.map +1 -1
- package/dist/components/motion/tooltip.js +1 -135
- package/dist/components/motion/wallet-card/account-avatar.js +1 -2
- package/dist/components/reui/alert.d.ts +1 -1
- package/dist/components/reui/autocomplete.d.ts.map +1 -1
- package/dist/components/reui/autocomplete.js +1 -1
- package/dist/components/reui/autocomplete.js.map +1 -1
- package/dist/components/reui/badge.d.ts +1 -1
- package/dist/components/reui/cascader/cascader-async.d.ts +21 -5
- package/dist/components/reui/cascader/cascader-async.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-async.js +61 -34
- package/dist/components/reui/cascader/cascader-async.js.map +1 -1
- package/dist/components/reui/cascader/cascader-columns.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-columns.js +5 -2
- package/dist/components/reui/cascader/cascader-columns.js.map +1 -1
- package/dist/components/reui/cascader/cascader-context.d.ts +3 -1
- 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 +1 -1
- package/dist/components/reui/cascader/cascader-lib.d.ts +34 -8
- package/dist/components/reui/cascader/cascader-lib.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-lib.js +145 -29
- 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-types.d.ts +1 -1
- package/dist/components/reui/cascader/cascader.d.ts +13 -8
- package/dist/components/reui/cascader/cascader.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader.js +31 -16
- package/dist/components/reui/cascader/cascader.js.map +1 -1
- package/dist/components/reui/code-block/code-block.d.ts.map +1 -1
- package/dist/components/reui/color-picker.d.ts +280 -0
- package/dist/components/reui/color-picker.d.ts.map +1 -0
- package/dist/components/reui/color-picker.js +2013 -0
- package/dist/components/reui/color-picker.js.map +1 -0
- package/dist/components/reui/data-grid/data-grid-cell-selection.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-cell-selection.js +1 -0
- package/dist/components/reui/data-grid/data-grid-cell-selection.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-filter.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-filter.js +1 -0
- 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 +6 -8
- 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 +50 -29
- package/dist/components/reui/data-grid/data-grid-column-header.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-visibility.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-visibility.js +1 -0
- package/dist/components/reui/data-grid/data-grid-column-visibility.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-pagination.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-pagination.js +2 -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 +10 -3
- 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.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js +15 -10
- 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 +1 -1
- 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 +54 -14
- package/dist/components/reui/data-grid/data-grid-table-dnd.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-virtual.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-virtual.js +37 -42
- 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 +174 -16
- package/dist/components/reui/data-grid/data-grid-table.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table.js +223 -89
- package/dist/components/reui/data-grid/data-grid-table.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid.d.ts +55 -1
- package/dist/components/reui/data-grid/data-grid.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid.js +112 -22
- package/dist/components/reui/data-grid/data-grid.js.map +1 -1
- package/dist/components/reui/date-selector.d.ts +1 -0
- package/dist/components/reui/date-selector.d.ts.map +1 -1
- package/dist/components/reui/date-selector.js +22 -16
- package/dist/components/reui/date-selector.js.map +1 -1
- package/dist/components/reui/emoji-picker.d.ts +367 -0
- package/dist/components/reui/emoji-picker.d.ts.map +1 -0
- package/dist/components/reui/emoji-picker.js +1768 -0
- package/dist/components/reui/emoji-picker.js.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-agenda-view.js +3 -5
- package/dist/components/reui/event-calendar/event-calendar-agenda-view.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-i18n.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-nav.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-nav.js +4 -4
- package/dist/components/reui/event-calendar/event-calendar-nav.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar.js +34 -31
- package/dist/components/reui/event-calendar/event-calendar.js.map +1 -1
- package/dist/components/reui/file-type.d.ts +792 -0
- package/dist/components/reui/file-type.d.ts.map +1 -0
- package/dist/components/reui/file-type.js +1367 -0
- package/dist/components/reui/file-type.js.map +1 -0
- package/dist/components/reui/filters/filters-advanced.d.ts +1 -0
- 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.d.ts +5 -1
- package/dist/components/reui/filters/filters-chip.d.ts.map +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/filters/filters-lib.d.ts.map +1 -1
- package/dist/components/reui/frame.d.ts.map +1 -1
- package/dist/components/reui/frame.js.map +1 -1
- package/dist/components/reui/gantt/gantt-nav.d.ts.map +1 -1
- package/dist/components/reui/gantt/gantt-nav.js +4 -4
- package/dist/components/reui/gantt/gantt-nav.js.map +1 -1
- package/dist/components/reui/gantt/gantt.d.ts.map +1 -1
- package/dist/components/reui/gantt/gantt.js +5 -2
- package/dist/components/reui/gantt/gantt.js.map +1 -1
- package/dist/components/reui/icon-tile.d.ts +1 -1
- package/dist/components/reui/icon-tile.js +8 -7
- package/dist/components/reui/icon-tile.js.map +1 -1
- package/dist/components/reui/kanban.d.ts.map +1 -1
- package/dist/components/reui/kanban.js +1 -1
- package/dist/components/reui/kanban.js.map +1 -1
- package/dist/components/reui/number-field.d.ts.map +1 -1
- package/dist/components/reui/number-field.js.map +1 -1
- package/dist/components/reui/phone-input.js +30 -27
- package/dist/components/reui/phone-input.js.map +1 -1
- package/dist/components/reui/scrollspy.d.ts +1 -0
- package/dist/components/reui/time-picker.js +1 -1
- package/dist/components/reui/time-picker.js.map +1 -1
- package/dist/components/ui/attachment.d.ts +1 -1
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/chart.d.ts.map +1 -1
- package/dist/components/ui/code-block.d.ts +29 -0
- package/dist/components/ui/code-block.d.ts.map +1 -0
- package/dist/components/ui/code-block.js +124 -0
- package/dist/components/ui/code-block.js.map +1 -0
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/direction.js +1 -2
- package/dist/components/ui/field.d.ts +1 -1
- package/dist/components/ui/field.js +1 -1
- package/dist/components/ui/input-group.d.ts +1 -1
- package/dist/components/ui/marker.d.ts +1 -1
- package/dist/components/ui/message-scroller.d.ts.map +1 -1
- package/dist/components/ui/questionnaire.d.ts.map +1 -1
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/trace.d.ts +21 -0
- package/dist/components/ui/trace.d.ts.map +1 -0
- package/dist/components/ui/trace.js +77 -0
- package/dist/components/ui/trace.js.map +1 -0
- package/dist/context-BYXeJQnz.d.ts.map +1 -1
- package/dist/context-tTdLKYNf.js +99 -0
- package/dist/context-tTdLKYNf.js.map +1 -0
- package/dist/{copy-menu-C5GaT4Z-.js → copy-menu-DOg9Jh-U.js} +2 -2
- package/dist/{copy-menu-C5GaT4Z-.js.map → copy-menu-DOg9Jh-U.js.map} +1 -1
- package/dist/hooks/use-copy-to-clipboard.d.ts +1 -0
- package/dist/hooks/use-focus-trap.d.ts +22 -0
- package/dist/hooks/use-focus-trap.d.ts.map +1 -0
- package/dist/hooks/use-focus-trap.js +80 -0
- package/dist/hooks/use-focus-trap.js.map +1 -0
- package/dist/hooks/use-highlighted-code.d.ts +5 -0
- package/dist/hooks/use-highlighted-code.d.ts.map +1 -0
- package/dist/hooks/use-highlighted-code.js +128 -0
- package/dist/hooks/use-highlighted-code.js.map +1 -0
- package/dist/hooks/use-hover-gesture.d.ts +1 -0
- package/dist/hooks/use-intersection-observer.d.ts +1 -0
- package/dist/hooks/use-listbox.d.ts +29 -0
- package/dist/hooks/use-listbox.d.ts.map +1 -0
- package/dist/hooks/use-listbox.js +75 -0
- package/dist/hooks/use-listbox.js.map +1 -0
- package/dist/hooks/use-scroll-position.d.ts +1 -0
- package/dist/hooks/use-slider-input.d.ts +1 -0
- package/dist/hooks/use-viewport.d.ts +1 -0
- package/dist/lib/tick-sound.d.ts +1 -0
- package/dist/model-NSIg2p7a.d.ts +20 -0
- package/dist/model-NSIg2p7a.d.ts.map +1 -0
- package/dist/model-_mRyI6V9.d.ts +18 -0
- package/dist/model-_mRyI6V9.d.ts.map +1 -0
- package/dist/{positioner-3mCqiebN.js → positioner-3r3cfkqT.js} +97 -33
- package/dist/positioner-3r3cfkqT.js.map +1 -0
- package/dist/tooltip-Bam5KeYe.js +535 -0
- package/dist/tooltip-Bam5KeYe.js.map +1 -0
- package/dist/tooltip-C01qUgsW.d.ts.map +1 -1
- package/dist/use-position-DOi1gVL0.d.ts +32 -0
- package/dist/use-position-DOi1gVL0.d.ts.map +1 -0
- package/package.json +11 -11
- package/dist/cascader-types-DVT-znZ-.d.ts.map +0 -1
- package/dist/components/motion/tooltip.js.map +0 -1
- package/dist/model-DfeFradZ.d.ts +0 -9
- package/dist/model-DfeFradZ.d.ts.map +0 -1
- package/dist/positioner-3mCqiebN.js.map +0 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect, useLayoutEffect, useRef } from "react";
|
|
3
|
+
//#region src/hooks/use-focus-trap.ts
|
|
4
|
+
const FOCUSABLE = "button:not(:disabled), a[href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])";
|
|
5
|
+
/** Elements inside `container` that Tab can reach, in DOM order. */
|
|
6
|
+
function focusablesIn(container) {
|
|
7
|
+
return Array.from(container?.querySelectorAll(FOCUSABLE) ?? []).filter((element) => element.tabIndex >= 0 && !element.closest("[inert]"));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Open traps, innermost last. Only the innermost one answers Tab, Escape and
|
|
11
|
+
* stray focus: a sheet opened from inside a drawer portals outside the drawer,
|
|
12
|
+
* and a drawer that still pulled focus home would fight the sheet for it.
|
|
13
|
+
*/
|
|
14
|
+
const traps = [];
|
|
15
|
+
/**
|
|
16
|
+
* Moves focus into `panel` when `open` turns true, keeps Tab cycling inside it,
|
|
17
|
+
* pulls focus back if it lands outside, and returns focus to whatever held it
|
|
18
|
+
* before opening once `open` turns false.
|
|
19
|
+
*
|
|
20
|
+
* For overlays rendered in place, where `useModalScope` cannot inert the rest
|
|
21
|
+
* of the page. Pass `open` rather than presence: an exiting panel is already
|
|
22
|
+
* inert through `PresenceGate`, so the trap releases with the same commit.
|
|
23
|
+
* Give the panel `tabIndex={-1}` so it can take focus when it holds nothing
|
|
24
|
+
* focusable.
|
|
25
|
+
*/
|
|
26
|
+
function useFocusTrap(open, panel, { onEscape } = {}) {
|
|
27
|
+
const escapeRef = useRef(onEscape);
|
|
28
|
+
useLayoutEffect(() => {
|
|
29
|
+
escapeRef.current = onEscape;
|
|
30
|
+
});
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (!open || !panel.current) return;
|
|
33
|
+
const self = {};
|
|
34
|
+
traps.push(self);
|
|
35
|
+
const innermost = () => traps[traps.length - 1] === self;
|
|
36
|
+
const returnFocus = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
37
|
+
const focusables = () => focusablesIn(panel.current);
|
|
38
|
+
const focusFirst = () => (focusables()[0] ?? panel.current)?.focus({ preventScroll: true });
|
|
39
|
+
if (!panel.current.contains(document.activeElement)) focusFirst();
|
|
40
|
+
const onFocus = (event) => {
|
|
41
|
+
if (!innermost() || !panel.current || panel.current.closest("[inert]")) return;
|
|
42
|
+
if (event.target instanceof Node && !panel.current.contains(event.target)) focusFirst();
|
|
43
|
+
};
|
|
44
|
+
const onKey = (event) => {
|
|
45
|
+
if (!innermost() || event.defaultPrevented) return;
|
|
46
|
+
if (event.key === "Escape" && escapeRef.current) {
|
|
47
|
+
event.preventDefault();
|
|
48
|
+
escapeRef.current();
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (event.key !== "Tab") return;
|
|
52
|
+
const elements = focusables();
|
|
53
|
+
const first = elements[0];
|
|
54
|
+
const last = elements[elements.length - 1];
|
|
55
|
+
const active = document.activeElement;
|
|
56
|
+
if (!first || !last) {
|
|
57
|
+
event.preventDefault();
|
|
58
|
+
panel.current?.focus({ preventScroll: true });
|
|
59
|
+
} else if (event.shiftKey && (active === first || active === panel.current)) {
|
|
60
|
+
event.preventDefault();
|
|
61
|
+
last.focus();
|
|
62
|
+
} else if (!event.shiftKey && active === last) {
|
|
63
|
+
event.preventDefault();
|
|
64
|
+
first.focus();
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
document.addEventListener("focusin", onFocus);
|
|
68
|
+
document.addEventListener("keydown", onKey);
|
|
69
|
+
return () => {
|
|
70
|
+
document.removeEventListener("focusin", onFocus);
|
|
71
|
+
document.removeEventListener("keydown", onKey);
|
|
72
|
+
traps.splice(traps.indexOf(self), 1);
|
|
73
|
+
if (returnFocus?.isConnected && !returnFocus.closest("[inert]")) returnFocus.focus({ preventScroll: true });
|
|
74
|
+
};
|
|
75
|
+
}, [open, panel]);
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
export { focusablesIn, useFocusTrap };
|
|
79
|
+
|
|
80
|
+
//# sourceMappingURL=use-focus-trap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-focus-trap.js","names":[],"sources":["../../src/hooks/use-focus-trap.ts"],"sourcesContent":["\"use client\";\n\nimport { type RefObject, useEffect, useLayoutEffect, useRef } from \"react\";\n\nconst FOCUSABLE =\n 'button:not(:disabled), a[href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])';\n\n/** Elements inside `container` that Tab can reach, in DOM order. */\nexport function focusablesIn(container: Element | null) {\n return Array.from(container?.querySelectorAll<HTMLElement>(FOCUSABLE) ?? []).filter(\n (element) => element.tabIndex >= 0 && !element.closest(\"[inert]\"),\n );\n}\n\n/**\n * Open traps, innermost last. Only the innermost one answers Tab, Escape and\n * stray focus: a sheet opened from inside a drawer portals outside the drawer,\n * and a drawer that still pulled focus home would fight the sheet for it.\n */\nconst traps: object[] = [];\n\nexport interface FocusTrapOptions {\n /** Called on Escape while this is the innermost open trap. */\n onEscape?: () => void;\n}\n\n/**\n * Moves focus into `panel` when `open` turns true, keeps Tab cycling inside it,\n * pulls focus back if it lands outside, and returns focus to whatever held it\n * before opening once `open` turns false.\n *\n * For overlays rendered in place, where `useModalScope` cannot inert the rest\n * of the page. Pass `open` rather than presence: an exiting panel is already\n * inert through `PresenceGate`, so the trap releases with the same commit.\n * Give the panel `tabIndex={-1}` so it can take focus when it holds nothing\n * focusable.\n */\nexport function useFocusTrap(\n open: boolean,\n panel: RefObject<HTMLElement | null>,\n { onEscape }: FocusTrapOptions = {},\n) {\n const escapeRef = useRef(onEscape);\n useLayoutEffect(() => {\n escapeRef.current = onEscape;\n });\n\n useEffect(() => {\n if (!open || !panel.current) return;\n const self = {};\n traps.push(self);\n const innermost = () => traps[traps.length - 1] === self;\n const returnFocus =\n document.activeElement instanceof HTMLElement ? document.activeElement : null;\n const focusables = () => focusablesIn(panel.current);\n const focusFirst = () => (focusables()[0] ?? panel.current)?.focus({ preventScroll: true });\n if (!panel.current.contains(document.activeElement)) focusFirst();\n\n const onFocus = (event: FocusEvent) => {\n if (!innermost() || !panel.current || panel.current.closest(\"[inert]\")) return;\n if (event.target instanceof Node && !panel.current.contains(event.target)) focusFirst();\n };\n const onKey = (event: KeyboardEvent) => {\n if (!innermost() || event.defaultPrevented) return;\n if (event.key === \"Escape\" && escapeRef.current) {\n event.preventDefault();\n escapeRef.current();\n return;\n }\n if (event.key !== \"Tab\") return;\n const elements = focusables();\n const first = elements[0];\n const last = elements[elements.length - 1];\n const active = document.activeElement;\n if (!first || !last) {\n event.preventDefault();\n panel.current?.focus({ preventScroll: true });\n } else if (event.shiftKey && (active === first || active === panel.current)) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && active === last) {\n event.preventDefault();\n first.focus();\n }\n };\n document.addEventListener(\"focusin\", onFocus);\n document.addEventListener(\"keydown\", onKey);\n return () => {\n document.removeEventListener(\"focusin\", onFocus);\n document.removeEventListener(\"keydown\", onKey);\n traps.splice(traps.indexOf(self), 1);\n if (returnFocus?.isConnected && !returnFocus.closest(\"[inert]\"))\n returnFocus.focus({ preventScroll: true });\n };\n }, [open, panel]);\n}\n"],"mappings":";;;AAIA,MAAM,YACJ;;AAGF,SAAgB,aAAa,WAA2B;CACtD,OAAO,MAAM,KAAK,WAAW,iBAA8B,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,QAC1E,YAAY,QAAQ,YAAY,KAAK,CAAC,QAAQ,QAAQ,SAAS,CAClE;AACF;;;;;;AAOA,MAAM,QAAkB,CAAC;;;;;;;;;;;;AAkBzB,SAAgB,aACd,MACA,OACA,EAAE,aAA+B,CAAC,GAClC;CACA,MAAM,YAAY,OAAO,QAAQ;CACjC,sBAAsB;EACpB,UAAU,UAAU;CACtB,CAAC;CAED,gBAAgB;EACd,IAAI,CAAC,QAAQ,CAAC,MAAM,SAAS;EAC7B,MAAM,OAAO,CAAC;EACd,MAAM,KAAK,IAAI;EACf,MAAM,kBAAkB,MAAM,MAAM,SAAS,OAAO;EACpD,MAAM,cACJ,SAAS,yBAAyB,cAAc,SAAS,gBAAgB;EAC3E,MAAM,mBAAmB,aAAa,MAAM,OAAO;EACnD,MAAM,oBAAoB,WAAW,CAAC,CAAC,MAAM,MAAM,QAAA,EAAU,MAAM,EAAE,eAAe,KAAK,CAAC;EAC1F,IAAI,CAAC,MAAM,QAAQ,SAAS,SAAS,aAAa,GAAG,WAAW;EAEhE,MAAM,WAAW,UAAsB;GACrC,IAAI,CAAC,UAAU,KAAK,CAAC,MAAM,WAAW,MAAM,QAAQ,QAAQ,SAAS,GAAG;GACxE,IAAI,MAAM,kBAAkB,QAAQ,CAAC,MAAM,QAAQ,SAAS,MAAM,MAAM,GAAG,WAAW;EACxF;EACA,MAAM,SAAS,UAAyB;GACtC,IAAI,CAAC,UAAU,KAAK,MAAM,kBAAkB;GAC5C,IAAI,MAAM,QAAQ,YAAY,UAAU,SAAS;IAC/C,MAAM,eAAe;IACrB,UAAU,QAAQ;IAClB;GACF;GACA,IAAI,MAAM,QAAQ,OAAO;GACzB,MAAM,WAAW,WAAW;GAC5B,MAAM,QAAQ,SAAS;GACvB,MAAM,OAAO,SAAS,SAAS,SAAS;GACxC,MAAM,SAAS,SAAS;GACxB,IAAI,CAAC,SAAS,CAAC,MAAM;IACnB,MAAM,eAAe;IACrB,MAAM,SAAS,MAAM,EAAE,eAAe,KAAK,CAAC;GAC9C,OAAO,IAAI,MAAM,aAAa,WAAW,SAAS,WAAW,MAAM,UAAU;IAC3E,MAAM,eAAe;IACrB,KAAK,MAAM;GACb,OAAO,IAAI,CAAC,MAAM,YAAY,WAAW,MAAM;IAC7C,MAAM,eAAe;IACrB,MAAM,MAAM;GACd;EACF;EACA,SAAS,iBAAiB,WAAW,OAAO;EAC5C,SAAS,iBAAiB,WAAW,KAAK;EAC1C,aAAa;GACX,SAAS,oBAAoB,WAAW,OAAO;GAC/C,SAAS,oBAAoB,WAAW,KAAK;GAC7C,MAAM,OAAO,MAAM,QAAQ,IAAI,GAAG,CAAC;GACnC,IAAI,aAAa,eAAe,CAAC,YAAY,QAAQ,SAAS,GAC5D,YAAY,MAAM,EAAE,eAAe,KAAK,CAAC;EAC7C;CACF,GAAG,CAAC,MAAM,KAAK,CAAC;AAClB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
//#region src/hooks/use-highlighted-code.d.ts
|
|
3
|
+
export declare function useHighlightedCode(value: string, language: string): (string | number | bigint | boolean | React$1.JSX.Element[] | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<React$1.ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<React$1.ReactNode> | null | undefined> | null | undefined)[];
|
|
4
|
+
//#endregion
|
|
5
|
+
//# sourceMappingURL=use-highlighted-code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-highlighted-code.d.ts","names":["React"],"sources":["../../src/hooks/use-highlighted-code.ts"],"mappings":";;wBAMgB,mBAAmB,eAAe,yDAAgBA,QAAA,IAAA,YAAAA,QAAA,+BAAAA,QAAA,8BAAA,SAAAA,QAAA,aAAA,6CAAAA,QAAA,cAAAA,QAAA,+BAAAA,QAAA,8BAAA,SAAAA,QAAA"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { createHighlighterCore } from "shiki/core";
|
|
4
|
+
import { createJavaScriptRegexEngine } from "shiki/engine/javascript";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region src/lib/highlighter.tsx
|
|
7
|
+
const languages = {
|
|
8
|
+
bash: () => import("shiki/langs/shellscript.mjs"),
|
|
9
|
+
css: () => import("shiki/langs/css.mjs"),
|
|
10
|
+
diff: () => import("shiki/langs/diff.mjs"),
|
|
11
|
+
html: () => import("shiki/langs/html.mjs"),
|
|
12
|
+
javascript: () => import("shiki/langs/javascript.mjs"),
|
|
13
|
+
json: () => import("shiki/langs/json.mjs"),
|
|
14
|
+
jsx: () => import("shiki/langs/jsx.mjs"),
|
|
15
|
+
markdown: () => import("shiki/langs/markdown.mjs"),
|
|
16
|
+
python: () => import("shiki/langs/python.mjs"),
|
|
17
|
+
sql: () => import("shiki/langs/sql.mjs"),
|
|
18
|
+
tsx: () => import("shiki/langs/tsx.mjs"),
|
|
19
|
+
typescript: () => import("shiki/langs/typescript.mjs"),
|
|
20
|
+
yaml: () => import("shiki/langs/yaml.mjs")
|
|
21
|
+
};
|
|
22
|
+
const aliases = {
|
|
23
|
+
js: "javascript",
|
|
24
|
+
md: "markdown",
|
|
25
|
+
py: "python",
|
|
26
|
+
sh: "bash",
|
|
27
|
+
shell: "bash",
|
|
28
|
+
shellscript: "bash",
|
|
29
|
+
ts: "typescript",
|
|
30
|
+
yml: "yaml",
|
|
31
|
+
zsh: "bash"
|
|
32
|
+
};
|
|
33
|
+
let highlighter;
|
|
34
|
+
function getHighlighter() {
|
|
35
|
+
highlighter ??= createHighlighterCore({
|
|
36
|
+
themes: [import("shiki/themes/github-light.mjs"), import("shiki/themes/github-dark.mjs")],
|
|
37
|
+
langs: [],
|
|
38
|
+
engine: createJavaScriptRegexEngine({ forgiving: true })
|
|
39
|
+
});
|
|
40
|
+
return highlighter;
|
|
41
|
+
}
|
|
42
|
+
function getLanguage(language) {
|
|
43
|
+
const name = language.toLowerCase();
|
|
44
|
+
if (name === "ansi") return name;
|
|
45
|
+
if (name in languages) return name;
|
|
46
|
+
return aliases[name] ?? null;
|
|
47
|
+
}
|
|
48
|
+
async function loadHighlighter(language) {
|
|
49
|
+
const lang = getLanguage(language);
|
|
50
|
+
if (!lang) return null;
|
|
51
|
+
const shiki = await getHighlighter();
|
|
52
|
+
if (lang !== "ansi" && !shiki.getLoadedLanguages().includes(lang)) await shiki.loadLanguage(languages[lang]);
|
|
53
|
+
return { highlight(code, state) {
|
|
54
|
+
const tokenize = (text) => shiki.codeToTokens(text, {
|
|
55
|
+
lang,
|
|
56
|
+
themes: {
|
|
57
|
+
light: "github-light",
|
|
58
|
+
dark: "github-dark"
|
|
59
|
+
},
|
|
60
|
+
defaultColor: false,
|
|
61
|
+
grammarState: state
|
|
62
|
+
}).tokens;
|
|
63
|
+
const tokens = lang === "ansi" ? code.split("\n").flatMap((line) => tokenize(line)) : tokenize(code);
|
|
64
|
+
return {
|
|
65
|
+
lines: tokens.map((line) => line.map((token, index) => /* @__PURE__ */ jsx("span", {
|
|
66
|
+
style: token.htmlStyle,
|
|
67
|
+
className: "text-(--shiki-light) dark:text-(--shiki-dark)",
|
|
68
|
+
children: token.content
|
|
69
|
+
}, index))),
|
|
70
|
+
state: shiki.getLastGrammarState(tokens)
|
|
71
|
+
};
|
|
72
|
+
} };
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/hooks/use-highlighted-code.ts
|
|
76
|
+
function useHighlightedCode(value, language) {
|
|
77
|
+
const code = value.endsWith("\n") ? value.slice(0, -1) : value;
|
|
78
|
+
const [loaded, setLoaded] = React$1.useState(null);
|
|
79
|
+
const highlighter = loaded?.language === language ? loaded.highlighter : null;
|
|
80
|
+
React$1.useEffect(() => {
|
|
81
|
+
let cancelled = false;
|
|
82
|
+
loadHighlighter(language).then((next) => {
|
|
83
|
+
if (!cancelled) setLoaded({
|
|
84
|
+
language,
|
|
85
|
+
highlighter: next
|
|
86
|
+
});
|
|
87
|
+
}).catch(() => {});
|
|
88
|
+
return () => {
|
|
89
|
+
cancelled = true;
|
|
90
|
+
};
|
|
91
|
+
}, [language]);
|
|
92
|
+
const [done, setDone] = React$1.useState({
|
|
93
|
+
highlighter: null,
|
|
94
|
+
text: "",
|
|
95
|
+
lines: []
|
|
96
|
+
});
|
|
97
|
+
let next = done;
|
|
98
|
+
if (next.highlighter !== highlighter || !code.startsWith(next.text)) next = {
|
|
99
|
+
highlighter,
|
|
100
|
+
text: "",
|
|
101
|
+
lines: []
|
|
102
|
+
};
|
|
103
|
+
const end = code.lastIndexOf("\n") + 1;
|
|
104
|
+
if (highlighter && end > next.text.length) {
|
|
105
|
+
const result = highlighter.highlight(code.slice(next.text.length, end - 1), next.state);
|
|
106
|
+
next = {
|
|
107
|
+
highlighter,
|
|
108
|
+
text: code.slice(0, end),
|
|
109
|
+
lines: [...next.lines, ...result.lines],
|
|
110
|
+
state: result.state
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
if (next !== done) setDone(next);
|
|
114
|
+
const tail = code.slice(end);
|
|
115
|
+
return React$1.useMemo(() => {
|
|
116
|
+
if (!highlighter) return code.split("\n");
|
|
117
|
+
return [...next.lines, highlighter.highlight(tail, next.state).lines[0]];
|
|
118
|
+
}, [
|
|
119
|
+
code,
|
|
120
|
+
highlighter,
|
|
121
|
+
next,
|
|
122
|
+
tail
|
|
123
|
+
]);
|
|
124
|
+
}
|
|
125
|
+
//#endregion
|
|
126
|
+
export { useHighlightedCode };
|
|
127
|
+
|
|
128
|
+
//# sourceMappingURL=use-highlighted-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-highlighted-code.js","names":["React"],"sources":["../../src/lib/highlighter.tsx","../../src/hooks/use-highlighted-code.ts"],"sourcesContent":["import type * as React from \"react\";\nimport { createHighlighterCore, type GrammarState, type HighlighterCore } from \"shiki/core\";\nimport { createJavaScriptRegexEngine } from \"shiki/engine/javascript\";\n\n// Add the languages you need. Each one loads the first time it is used.\nconst languages = {\n bash: () => import(\"shiki/langs/shellscript.mjs\"),\n css: () => import(\"shiki/langs/css.mjs\"),\n diff: () => import(\"shiki/langs/diff.mjs\"),\n html: () => import(\"shiki/langs/html.mjs\"),\n javascript: () => import(\"shiki/langs/javascript.mjs\"),\n json: () => import(\"shiki/langs/json.mjs\"),\n jsx: () => import(\"shiki/langs/jsx.mjs\"),\n markdown: () => import(\"shiki/langs/markdown.mjs\"),\n python: () => import(\"shiki/langs/python.mjs\"),\n sql: () => import(\"shiki/langs/sql.mjs\"),\n tsx: () => import(\"shiki/langs/tsx.mjs\"),\n typescript: () => import(\"shiki/langs/typescript.mjs\"),\n yaml: () => import(\"shiki/langs/yaml.mjs\"),\n};\n\nconst aliases: Record<string, keyof typeof languages> = {\n js: \"javascript\",\n md: \"markdown\",\n py: \"python\",\n sh: \"bash\",\n shell: \"bash\",\n shellscript: \"bash\",\n ts: \"typescript\",\n yml: \"yaml\",\n zsh: \"bash\",\n};\n\nlet highlighter: Promise<HighlighterCore> | undefined;\n\nfunction getHighlighter() {\n highlighter ??= createHighlighterCore({\n themes: [import(\"shiki/themes/github-light.mjs\"), import(\"shiki/themes/github-dark.mjs\")],\n langs: [],\n engine: createJavaScriptRegexEngine({ forgiving: true }),\n });\n\n return highlighter;\n}\n\nfunction getLanguage(language: string) {\n const name = language.toLowerCase();\n\n if (name === \"ansi\") {\n return name;\n }\n\n if (name in languages) {\n return name as keyof typeof languages;\n }\n\n return aliases[name] ?? null;\n}\n\n// Loads a language and returns a highlighter for it, or null for a language\n// that is not listed.\nexport async function loadHighlighter(language: string) {\n const lang = getLanguage(language);\n\n if (!lang) {\n return null;\n }\n\n const shiki = await getHighlighter();\n\n if (lang !== \"ansi\" && !shiki.getLoadedLanguages().includes(lang)) {\n await shiki.loadLanguage(languages[lang]);\n }\n\n return {\n // Returns one React node per line, and the grammar state after the last\n // line. Pass that state back to continue where the code left off.\n highlight(code: string, state?: GrammarState) {\n const tokenize = (text: string) =>\n shiki.codeToTokens(text, {\n lang,\n themes: { light: \"github-light\", dark: \"github-dark\" },\n defaultColor: false,\n grammarState: state,\n }).tokens;\n\n // ANSI has no grammar state, so each line is tokenized on its own and\n // gets the same colors whether it arrives in one piece or streams.\n const tokens =\n lang === \"ansi\" ? code.split(\"\\n\").flatMap((line) => tokenize(line)) : tokenize(code);\n\n return {\n lines: tokens.map((line) =>\n line.map((token, index) => (\n <span\n key={index}\n style={token.htmlStyle as React.CSSProperties}\n className=\"text-(--shiki-light) dark:text-(--shiki-dark)\"\n >\n {token.content}\n </span>\n )),\n ),\n state: shiki.getLastGrammarState(tokens),\n };\n },\n };\n}\n\n// Returns one React node per line, or null for a language that is not listed.\nexport async function highlightCode(code: string, language: string) {\n const highlighter = await loadHighlighter(language);\n\n return highlighter ? highlighter.highlight(code).lines : null;\n}\n","\"use client\";\n\nimport * as React from \"react\";\n\nimport { loadHighlighter } from \"../lib/highlighter\";\n\nexport function useHighlightedCode(value: string, language: string) {\n // A trailing newline would render as an extra empty line.\n const code = value.endsWith(\"\\n\") ? value.slice(0, -1) : value;\n const [loaded, setLoaded] = React.useState<{\n language: string;\n highlighter: Awaited<ReturnType<typeof loadHighlighter>>;\n } | null>(null);\n const highlighter = loaded?.language === language ? loaded.highlighter : null;\n\n React.useEffect(() => {\n let cancelled = false;\n\n loadHighlighter(language)\n .then((next) => {\n if (!cancelled) {\n setLoaded({ language, highlighter: next });\n }\n })\n .catch(() => {});\n\n return () => {\n cancelled = true;\n };\n }, [language]);\n\n // The complete lines, highlighted. While the code streams, only the new\n // lines are tokenized, starting from the grammar state of the last one.\n const [done, setDone] = React.useState<{\n highlighter: typeof highlighter;\n text: string;\n lines: React.ReactNode[];\n state?: Parameters<NonNullable<typeof highlighter>[\"highlight\"]>[1];\n }>({ highlighter: null, text: \"\", lines: [] });\n\n let next = done;\n\n if (next.highlighter !== highlighter || !code.startsWith(next.text)) {\n next = { highlighter, text: \"\", lines: [] };\n }\n\n const end = code.lastIndexOf(\"\\n\") + 1;\n\n if (highlighter && end > next.text.length) {\n const result = highlighter.highlight(code.slice(next.text.length, end - 1), next.state);\n\n next = {\n highlighter,\n text: code.slice(0, end),\n lines: [...next.lines, ...result.lines],\n state: result.state,\n };\n }\n\n if (next !== done) {\n setDone(next);\n }\n\n // The last line is still being written, so it is tokenized on every render.\n const tail = code.slice(end);\n\n return React.useMemo(() => {\n if (!highlighter) {\n return code.split(\"\\n\");\n }\n\n return [...next.lines, highlighter.highlight(tail, next.state).lines[0]];\n }, [code, highlighter, next, tail]);\n}\n"],"mappings":";;;;;;AAKA,MAAM,YAAY;CAChB,YAAY,OAAO;CACnB,WAAW,OAAO;CAClB,YAAY,OAAO;CACnB,YAAY,OAAO;CACnB,kBAAkB,OAAO;CACzB,YAAY,OAAO;CACnB,WAAW,OAAO;CAClB,gBAAgB,OAAO;CACvB,cAAc,OAAO;CACrB,WAAW,OAAO;CAClB,WAAW,OAAO;CAClB,kBAAkB,OAAO;CACzB,YAAY,OAAO;AACrB;AAEA,MAAM,UAAkD;CACtD,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACb,IAAI;CACJ,KAAK;CACL,KAAK;AACP;AAEA,IAAI;AAEJ,SAAS,iBAAiB;CACxB,gBAAgB,sBAAsB;EACpC,QAAQ,CAAC,OAAO,kCAAkC,OAAO,+BAA+B;EACxF,OAAO,CAAC;EACR,QAAQ,4BAA4B,EAAE,WAAW,KAAK,CAAC;CACzD,CAAC;CAED,OAAO;AACT;AAEA,SAAS,YAAY,UAAkB;CACrC,MAAM,OAAO,SAAS,YAAY;CAElC,IAAI,SAAS,QACX,OAAO;CAGT,IAAI,QAAQ,WACV,OAAO;CAGT,OAAO,QAAQ,SAAS;AAC1B;AAIA,eAAsB,gBAAgB,UAAkB;CACtD,MAAM,OAAO,YAAY,QAAQ;CAEjC,IAAI,CAAC,MACH,OAAO;CAGT,MAAM,QAAQ,MAAM,eAAe;CAEnC,IAAI,SAAS,UAAU,CAAC,MAAM,mBAAmB,CAAC,CAAC,SAAS,IAAI,GAC9D,MAAM,MAAM,aAAa,UAAU,KAAK;CAG1C,OAAO,EAGL,UAAU,MAAc,OAAsB;EAC5C,MAAM,YAAY,SAChB,MAAM,aAAa,MAAM;GACvB;GACA,QAAQ;IAAE,OAAO;IAAgB,MAAM;GAAc;GACrD,cAAc;GACd,cAAc;EAChB,CAAC,CAAC,CAAC;EAIL,MAAM,SACJ,SAAS,SAAS,KAAK,MAAM,IAAI,CAAC,CAAC,SAAS,SAAS,SAAS,IAAI,CAAC,IAAI,SAAS,IAAI;EAEtF,OAAO;GACL,OAAO,OAAO,KAAK,SACjB,KAAK,KAAK,OAAO,UACf,oBAAC,QAAD;IAEE,OAAO,MAAM;IACb,WAAU;IAET,UAAA,MAAM;GACH,GALC,KAKD,CACP,CACH;GACA,OAAO,MAAM,oBAAoB,MAAM;EACzC;CACF,EACF;AACF;;;ACrGA,SAAgB,mBAAmB,OAAe,UAAkB;CAElE,MAAM,OAAO,MAAM,SAAS,IAAI,IAAI,MAAM,MAAM,GAAG,EAAE,IAAI;CACzD,MAAM,CAAC,QAAQ,aAAaA,QAAM,SAGxB,IAAI;CACd,MAAM,cAAc,QAAQ,aAAa,WAAW,OAAO,cAAc;CAEzE,QAAM,gBAAgB;EACpB,IAAI,YAAY;EAEhB,gBAAgB,QAAQ,CAAC,CACtB,MAAM,SAAS;GACd,IAAI,CAAC,WACH,UAAU;IAAE;IAAU,aAAa;GAAK,CAAC;EAE7C,CAAC,CAAC,CACD,YAAY,CAAC,CAAC;EAEjB,aAAa;GACX,YAAY;EACd;CACF,GAAG,CAAC,QAAQ,CAAC;CAIb,MAAM,CAAC,MAAM,WAAWA,QAAM,SAK3B;EAAE,aAAa;EAAM,MAAM;EAAI,OAAO,CAAC;CAAE,CAAC;CAE7C,IAAI,OAAO;CAEX,IAAI,KAAK,gBAAgB,eAAe,CAAC,KAAK,WAAW,KAAK,IAAI,GAChE,OAAO;EAAE;EAAa,MAAM;EAAI,OAAO,CAAC;CAAE;CAG5C,MAAM,MAAM,KAAK,YAAY,IAAI,IAAI;CAErC,IAAI,eAAe,MAAM,KAAK,KAAK,QAAQ;EACzC,MAAM,SAAS,YAAY,UAAU,KAAK,MAAM,KAAK,KAAK,QAAQ,MAAM,CAAC,GAAG,KAAK,KAAK;EAEtF,OAAO;GACL;GACA,MAAM,KAAK,MAAM,GAAG,GAAG;GACvB,OAAO,CAAC,GAAG,KAAK,OAAO,GAAG,OAAO,KAAK;GACtC,OAAO,OAAO;EAChB;CACF;CAEA,IAAI,SAAS,MACX,QAAQ,IAAI;CAId,MAAM,OAAO,KAAK,MAAM,GAAG;CAE3B,OAAOA,QAAM,cAAc;EACzB,IAAI,CAAC,aACH,OAAO,KAAK,MAAM,IAAI;EAGxB,OAAO,CAAC,GAAG,KAAK,OAAO,YAAY,UAAU,MAAM,KAAK,KAAK,CAAC,CAAC,MAAM,EAAE;CACzE,GAAG;EAAC;EAAM;EAAa;EAAM;CAAI,CAAC;AACpC"}
|
|
@@ -51,4 +51,5 @@ interface IntersectionObserverOptions extends IntersectionObserverInit {
|
|
|
51
51
|
*/
|
|
52
52
|
export declare function useIntersectionObserver(elementRef: React$1.RefObject<Element | null>, { threshold, root, rootMargin, freezeOnceVisible }?: IntersectionObserverOptions): boolean;
|
|
53
53
|
//#endregion
|
|
54
|
+
export {};
|
|
54
55
|
//# sourceMappingURL=use-intersection-observer.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { KeyboardEvent, RefObject } from "react";
|
|
2
|
+
//#region src/hooks/use-listbox.d.ts
|
|
3
|
+
export interface ListboxRow {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Keyboard model for a popup listbox whose options are focusable buttons.
|
|
10
|
+
*
|
|
11
|
+
* The active option is resolved during render through `useRowCursor`, so the
|
|
12
|
+
* roving `tabIndex` and the next key press always agree with what is on
|
|
13
|
+
* screen. Opening starts on the selected option, or the first enabled one.
|
|
14
|
+
* Arrow keys, Home and End move between enabled options, and printable
|
|
15
|
+
* characters jump to the next option whose label starts with what was typed.
|
|
16
|
+
* DOM focus follows the active option while the list is open; each option
|
|
17
|
+
* carries its id in `data-listbox-id` so the list can find it.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useListbox({ open, rows, selected, list }: {
|
|
20
|
+
open: boolean;
|
|
21
|
+
rows: readonly ListboxRow[];
|
|
22
|
+
selected: string | undefined;
|
|
23
|
+
list: RefObject<HTMLElement | null>;
|
|
24
|
+
}): {
|
|
25
|
+
activeId: string;
|
|
26
|
+
onKeyDown: (event: KeyboardEvent) => void;
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
//# sourceMappingURL=use-listbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-listbox.d.ts","names":[],"sources":["../../src/hooks/use-listbox.ts"],"mappings":";;iBAOiB;EACf;EACA;EACA;;;;;;;;;;;;;wBAiBc,aACd,MACA,MACA,UACA;EAEA;EACA,eAAe;EACf;EACA,MAAM,UAAU;;;EAyBU,YAAA,OAAA"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useOnOpen } from "./use-on-open.js";
|
|
3
|
+
import { useRowCursor } from "./use-row-cursor.js";
|
|
4
|
+
import { useEffect, useMemo, useRef } from "react";
|
|
5
|
+
//#region src/hooks/use-listbox.ts
|
|
6
|
+
const TYPEAHEAD_MS = 500;
|
|
7
|
+
/**
|
|
8
|
+
* Keyboard model for a popup listbox whose options are focusable buttons.
|
|
9
|
+
*
|
|
10
|
+
* The active option is resolved during render through `useRowCursor`, so the
|
|
11
|
+
* roving `tabIndex` and the next key press always agree with what is on
|
|
12
|
+
* screen. Opening starts on the selected option, or the first enabled one.
|
|
13
|
+
* Arrow keys, Home and End move between enabled options, and printable
|
|
14
|
+
* characters jump to the next option whose label starts with what was typed.
|
|
15
|
+
* DOM focus follows the active option while the list is open; each option
|
|
16
|
+
* carries its id in `data-listbox-id` so the list can find it.
|
|
17
|
+
*/
|
|
18
|
+
function useListbox({ open, rows, selected, list }) {
|
|
19
|
+
const enabled = useMemo(() => rows.filter((row) => !row.disabled), [rows]);
|
|
20
|
+
const { activeIndex, moveTo, moveActive } = useRowCursor(enabled, "");
|
|
21
|
+
useOnOpen(open, () => moveTo(enabled.some((row) => row.id === selected) ? selected ?? null : null));
|
|
22
|
+
const activeId = enabled[activeIndex]?.id;
|
|
23
|
+
const typed = useRef({
|
|
24
|
+
text: "",
|
|
25
|
+
at: 0
|
|
26
|
+
});
|
|
27
|
+
const openedOnMount = useRef(open);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (!open) openedOnMount.current = false;
|
|
30
|
+
}, [open]);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (!open || activeId === void 0) return;
|
|
33
|
+
if (openedOnMount.current && !list.current?.contains(document.activeElement)) return;
|
|
34
|
+
Array.from(list.current?.querySelectorAll("[data-listbox-id]") ?? []).find((element) => element.dataset.listboxId === activeId)?.focus({ preventScroll: false });
|
|
35
|
+
}, [
|
|
36
|
+
open,
|
|
37
|
+
activeId,
|
|
38
|
+
list
|
|
39
|
+
]);
|
|
40
|
+
const onKeyDown = (event) => {
|
|
41
|
+
const { key } = event;
|
|
42
|
+
if (key === "ArrowDown" || key === "ArrowUp") {
|
|
43
|
+
event.preventDefault();
|
|
44
|
+
moveActive(key === "ArrowDown" ? 1 : -1);
|
|
45
|
+
} else if (key === "Home" || key === "End") {
|
|
46
|
+
event.preventDefault();
|
|
47
|
+
const row = key === "Home" ? enabled[0] : enabled[enabled.length - 1];
|
|
48
|
+
if (row) moveTo(row.id);
|
|
49
|
+
} else if (key.length === 1 && key !== " " && !event.ctrlKey && !event.metaKey && !event.altKey) {
|
|
50
|
+
const now = Date.now();
|
|
51
|
+
const char = key.toLowerCase();
|
|
52
|
+
const text = now - typed.current.at < TYPEAHEAD_MS ? typed.current.text + char : char;
|
|
53
|
+
typed.current = {
|
|
54
|
+
text,
|
|
55
|
+
at: now
|
|
56
|
+
};
|
|
57
|
+
const from = text.length === 1 ? activeIndex + 1 : activeIndex;
|
|
58
|
+
for (let step = 0; step < enabled.length; step++) {
|
|
59
|
+
const row = enabled[(from + step) % enabled.length];
|
|
60
|
+
if (row.label.toLowerCase().startsWith(text)) {
|
|
61
|
+
moveTo(row.id);
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
return {
|
|
68
|
+
activeId,
|
|
69
|
+
onKeyDown
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
export { useListbox };
|
|
74
|
+
|
|
75
|
+
//# sourceMappingURL=use-listbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-listbox.js","names":[],"sources":["../../src/hooks/use-listbox.ts"],"sourcesContent":["\"use client\";\n\nimport { type KeyboardEvent, type RefObject, useEffect, useMemo, useRef } from \"react\";\n\nimport { useOnOpen } from \"./use-on-open\";\nimport { useRowCursor } from \"./use-row-cursor\";\n\nexport interface ListboxRow {\n id: string;\n label: string;\n disabled?: boolean;\n}\n\n// How long typed characters keep building one typeahead query.\nconst TYPEAHEAD_MS = 500;\n\n/**\n * Keyboard model for a popup listbox whose options are focusable buttons.\n *\n * The active option is resolved during render through `useRowCursor`, so the\n * roving `tabIndex` and the next key press always agree with what is on\n * screen. Opening starts on the selected option, or the first enabled one.\n * Arrow keys, Home and End move between enabled options, and printable\n * characters jump to the next option whose label starts with what was typed.\n * DOM focus follows the active option while the list is open; each option\n * carries its id in `data-listbox-id` so the list can find it.\n */\nexport function useListbox({\n open,\n rows,\n selected,\n list,\n}: {\n open: boolean;\n rows: readonly ListboxRow[];\n selected: string | undefined;\n list: RefObject<HTMLElement | null>;\n}) {\n const enabled = useMemo(() => rows.filter((row) => !row.disabled), [rows]);\n const { activeIndex, moveTo, moveActive } = useRowCursor(enabled, \"\");\n useOnOpen(open, () =>\n moveTo(enabled.some((row) => row.id === selected) ? (selected ?? null) : null),\n );\n const activeId = enabled[activeIndex]?.id;\n const typed = useRef({ text: \"\", at: 0 });\n // A list rendered open does not take focus from the page on mount; focus\n // follows only once it has been opened, or once focus is already inside.\n const openedOnMount = useRef(open);\n useEffect(() => {\n if (!open) openedOnMount.current = false;\n }, [open]);\n\n useEffect(() => {\n if (!open || activeId === undefined) return;\n if (openedOnMount.current && !list.current?.contains(document.activeElement)) return;\n const option = Array.from(\n list.current?.querySelectorAll<HTMLElement>(\"[data-listbox-id]\") ?? [],\n ).find((element) => element.dataset.listboxId === activeId);\n option?.focus({ preventScroll: false });\n }, [open, activeId, list]);\n\n const onKeyDown = (event: KeyboardEvent) => {\n const { key } = event;\n if (key === \"ArrowDown\" || key === \"ArrowUp\") {\n event.preventDefault();\n moveActive(key === \"ArrowDown\" ? 1 : -1);\n } else if (key === \"Home\" || key === \"End\") {\n event.preventDefault();\n const row = key === \"Home\" ? enabled[0] : enabled[enabled.length - 1];\n if (row) moveTo(row.id);\n } else if (\n key.length === 1 &&\n key !== \" \" &&\n !event.ctrlKey &&\n !event.metaKey &&\n !event.altKey\n ) {\n const now = Date.now();\n const char = key.toLowerCase();\n const text = now - typed.current.at < TYPEAHEAD_MS ? typed.current.text + char : char;\n typed.current = { text, at: now };\n // A repeated single letter cycles through the options that start with it.\n const from = text.length === 1 ? activeIndex + 1 : activeIndex;\n for (let step = 0; step < enabled.length; step++) {\n const row = enabled[(from + step) % enabled.length];\n if (row.label.toLowerCase().startsWith(text)) {\n moveTo(row.id);\n break;\n }\n }\n }\n };\n\n return { activeId, onKeyDown };\n}\n"],"mappings":";;;;;AAcA,MAAM,eAAe;;;;;;;;;;;;AAarB,SAAgB,WAAW,EACzB,MACA,MACA,UACA,QAMC;CACD,MAAM,UAAU,cAAc,KAAK,QAAQ,QAAQ,CAAC,IAAI,QAAQ,GAAG,CAAC,IAAI,CAAC;CACzE,MAAM,EAAE,aAAa,QAAQ,eAAe,aAAa,SAAS,EAAE;CACpE,UAAU,YACR,OAAO,QAAQ,MAAM,QAAQ,IAAI,OAAO,QAAQ,IAAK,YAAY,OAAQ,IAAI,CAC/E;CACA,MAAM,WAAW,QAAQ,YAAY,EAAE;CACvC,MAAM,QAAQ,OAAO;EAAE,MAAM;EAAI,IAAI;CAAE,CAAC;CAGxC,MAAM,gBAAgB,OAAO,IAAI;CACjC,gBAAgB;EACd,IAAI,CAAC,MAAM,cAAc,UAAU;CACrC,GAAG,CAAC,IAAI,CAAC;CAET,gBAAgB;EACd,IAAI,CAAC,QAAQ,aAAa,KAAA,GAAW;EACrC,IAAI,cAAc,WAAW,CAAC,KAAK,SAAS,SAAS,SAAS,aAAa,GAAG;EAI9E,MAHqB,KACnB,KAAK,SAAS,iBAA8B,mBAAmB,KAAK,CAAC,CACvE,CAAC,CAAC,MAAM,YAAY,QAAQ,QAAQ,cAAc,QAC7C,CAAC,EAAE,MAAM,EAAE,eAAe,MAAM,CAAC;CACxC,GAAG;EAAC;EAAM;EAAU;CAAI,CAAC;CAEzB,MAAM,aAAa,UAAyB;EAC1C,MAAM,EAAE,QAAQ;EAChB,IAAI,QAAQ,eAAe,QAAQ,WAAW;GAC5C,MAAM,eAAe;GACrB,WAAW,QAAQ,cAAc,IAAI,EAAE;EACzC,OAAO,IAAI,QAAQ,UAAU,QAAQ,OAAO;GAC1C,MAAM,eAAe;GACrB,MAAM,MAAM,QAAQ,SAAS,QAAQ,KAAK,QAAQ,QAAQ,SAAS;GACnE,IAAI,KAAK,OAAO,IAAI,EAAE;EACxB,OAAO,IACL,IAAI,WAAW,KACf,QAAQ,OACR,CAAC,MAAM,WACP,CAAC,MAAM,WACP,CAAC,MAAM,QACP;GACA,MAAM,MAAM,KAAK,IAAI;GACrB,MAAM,OAAO,IAAI,YAAY;GAC7B,MAAM,OAAO,MAAM,MAAM,QAAQ,KAAK,eAAe,MAAM,QAAQ,OAAO,OAAO;GACjF,MAAM,UAAU;IAAE;IAAM,IAAI;GAAI;GAEhC,MAAM,OAAO,KAAK,WAAW,IAAI,cAAc,IAAI;GACnD,KAAK,IAAI,OAAO,GAAG,OAAO,QAAQ,QAAQ,QAAQ;IAChD,MAAM,MAAM,SAAS,OAAO,QAAQ,QAAQ;IAC5C,IAAI,IAAI,MAAM,YAAY,CAAC,CAAC,WAAW,IAAI,GAAG;KAC5C,OAAO,IAAI,EAAE;KACb;IACF;GACF;EACF;CACF;CAEA,OAAO;EAAE;EAAU;CAAU;AAC/B"}
|
package/dist/lib/tick-sound.d.ts
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/components/charts/order-book/model.d.ts
|
|
2
|
+
type DepthLevel = {
|
|
3
|
+
price: number;
|
|
4
|
+
size: number;
|
|
5
|
+
total: number;
|
|
6
|
+
};
|
|
7
|
+
type DepthSummary = {
|
|
8
|
+
side: "bid" | "ask";
|
|
9
|
+
/** Number of levels from the best price out to the inspected one. */
|
|
10
|
+
levels: number;
|
|
11
|
+
/** Total base size across those levels. */
|
|
12
|
+
size: number;
|
|
13
|
+
/** Total quote value across those levels. */
|
|
14
|
+
quote: number;
|
|
15
|
+
/** Size-weighted average fill price. */
|
|
16
|
+
averagePrice: number;
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { DepthSummary as n, DepthLevel as t };
|
|
20
|
+
//# sourceMappingURL=model-NSIg2p7a.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-NSIg2p7a.d.ts","names":[],"sources":["../src/components/charts/order-book/model.ts"],"mappings":";KAAY;EAAe;EAAe;EAAc;;KAmB5C;EACV;;EAEA;;EAEA;;EAEA;;EAEA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/components/charts/donut-chart/model.d.ts
|
|
2
|
+
interface DonutSegment {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
/** Any CSS color, such as "#2563eb" or "var(--chart-1)". */
|
|
6
|
+
color: string;
|
|
7
|
+
/** Nonnegative value. Zero and invalid values are left out of the ring. */
|
|
8
|
+
value: number;
|
|
9
|
+
}
|
|
10
|
+
type PlacedSegment = DonutSegment & {
|
|
11
|
+
/** Share of the total, from 0 to 1. */
|
|
12
|
+
share: number;
|
|
13
|
+
/** Centerline arc path in the 200 × 200 viewBox. */
|
|
14
|
+
path: string;
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { PlacedSegment as n, DonutSegment as t };
|
|
18
|
+
//# sourceMappingURL=model-_mRyI6V9.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-_mRyI6V9.d.ts","names":[],"sources":["../src/components/charts/donut-chart/model.ts"],"mappings":";UAAiB;EACf;EACA;;EAEA;;EAEA;;KAGU,gBAAgB;;EAE1B;;EAEA"}
|