@kumix/ui 0.3.18 → 0.4.1
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/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/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 +2 -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 +2 -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 +12 -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/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.d.ts +2 -0
- package/dist/components/charts/composition-chart/context.js +2 -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/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 +50 -0
- package/dist/components/charts/funnel-chart.d.ts.map +1 -0
- package/dist/components/charts/funnel-chart.js +215 -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 +19 -0
- package/dist/components/charts/order-book/depth-row.d.ts.map +1 -0
- package/dist/components/charts/order-book/depth-row.js +107 -0
- package/dist/components/charts/order-book/depth-row.js.map +1 -0
- package/dist/components/charts/order-book.d.ts +89 -0
- package/dist/components/charts/order-book.d.ts.map +1 -0
- package/dist/components/charts/order-book.js +282 -0
- package/dist/components/charts/order-book.js.map +1 -0
- package/dist/components/charts/price-target-fan/header.d.ts +8 -0
- package/dist/components/charts/price-target-fan/header.d.ts.map +1 -0
- package/dist/components/charts/price-target-fan/header.js +43 -0
- package/dist/components/charts/price-target-fan/header.js.map +1 -0
- package/dist/components/charts/price-target-fan/plot.d.ts +16 -0
- package/dist/components/charts/price-target-fan/plot.d.ts.map +1 -0
- package/dist/components/charts/price-target-fan/plot.js +142 -0
- package/dist/components/charts/price-target-fan/plot.js.map +1 -0
- package/dist/components/charts/price-target-fan/series.d.ts +15 -0
- package/dist/components/charts/price-target-fan/series.d.ts.map +1 -0
- package/dist/components/charts/price-target-fan/series.js +238 -0
- package/dist/components/charts/price-target-fan/series.js.map +1 -0
- package/dist/components/charts/price-target-fan/tooltip.d.ts +2 -0
- package/dist/components/charts/price-target-fan/tooltip.js +58 -0
- package/dist/components/charts/price-target-fan/tooltip.js.map +1 -0
- package/dist/components/charts/price-target-fan.d.ts +10 -0
- package/dist/components/charts/price-target-fan.d.ts.map +1 -0
- package/dist/components/charts/price-target-fan.js +24 -0
- package/dist/components/charts/price-target-fan.js.map +1 -0
- package/dist/components/charts/returns-calendar/grid.d.ts +8 -0
- package/dist/components/charts/returns-calendar/grid.d.ts.map +1 -0
- package/dist/components/charts/returns-calendar/grid.js +176 -0
- package/dist/components/charts/returns-calendar/grid.js.map +1 -0
- package/dist/components/charts/returns-calendar/tooltip.d.ts +2 -0
- package/dist/components/charts/returns-calendar/tooltip.js +55 -0
- package/dist/components/charts/returns-calendar/tooltip.js.map +1 -0
- package/dist/components/charts/returns-calendar.d.ts +48 -0
- package/dist/components/charts/returns-calendar.d.ts.map +1 -0
- package/dist/components/charts/returns-calendar.js +22 -0
- package/dist/components/charts/returns-calendar.js.map +1 -0
- package/dist/components/charts/status-bar/legend.d.ts +8 -0
- package/dist/components/charts/status-bar/legend.d.ts.map +1 -0
- package/dist/components/charts/status-bar/legend.js +37 -0
- package/dist/components/charts/status-bar/legend.js.map +1 -0
- package/dist/components/charts/status-bar/plot.d.ts +12 -0
- package/dist/components/charts/status-bar/plot.d.ts.map +1 -0
- package/dist/components/charts/status-bar/plot.js +176 -0
- package/dist/components/charts/status-bar/plot.js.map +1 -0
- package/dist/components/charts/status-bar/tooltip.d.ts +2 -0
- package/dist/components/charts/status-bar/tooltip.js +49 -0
- package/dist/components/charts/status-bar/tooltip.js.map +1 -0
- package/dist/components/charts/status-bar.d.ts +9 -0
- package/dist/components/charts/status-bar.d.ts.map +1 -0
- package/dist/components/charts/status-bar.js +64 -0
- package/dist/components/charts/status-bar.js.map +1 -0
- package/dist/components/charts/treemap/legend.d.ts +8 -0
- package/dist/components/charts/treemap/legend.d.ts.map +1 -0
- package/dist/components/charts/treemap/legend.js +35 -0
- package/dist/components/charts/treemap/legend.js.map +1 -0
- package/dist/components/charts/treemap/plot.d.ts +13 -0
- package/dist/components/charts/treemap/plot.d.ts.map +1 -0
- package/dist/components/charts/treemap/plot.js +123 -0
- package/dist/components/charts/treemap/plot.js.map +1 -0
- package/dist/components/charts/treemap/tile.d.ts +10 -0
- package/dist/components/charts/treemap/tile.d.ts.map +1 -0
- package/dist/components/charts/treemap/tile.js +114 -0
- package/dist/components/charts/treemap/tile.js.map +1 -0
- package/dist/components/charts/treemap/tooltip.d.ts +11 -0
- package/dist/components/charts/treemap/tooltip.d.ts.map +1 -0
- package/dist/components/charts/treemap/tooltip.js +73 -0
- package/dist/components/charts/treemap/tooltip.js.map +1 -0
- package/dist/components/charts/treemap.d.ts +56 -0
- package/dist/components/charts/treemap.d.ts.map +1 -0
- package/dist/components/charts/treemap.js +71 -0
- package/dist/components/charts/treemap.js.map +1 -0
- package/dist/components/charts/volume-profile/plot.d.ts +12 -0
- package/dist/components/charts/volume-profile/plot.d.ts.map +1 -0
- package/dist/components/charts/volume-profile/plot.js +211 -0
- package/dist/components/charts/volume-profile/plot.js.map +1 -0
- package/dist/components/charts/volume-profile/summary.d.ts +6 -0
- package/dist/components/charts/volume-profile/summary.d.ts.map +1 -0
- package/dist/components/charts/volume-profile/summary.js +76 -0
- package/dist/components/charts/volume-profile/summary.js.map +1 -0
- package/dist/components/charts/volume-profile/tooltip.d.ts +2 -0
- package/dist/components/charts/volume-profile/tooltip.js +84 -0
- package/dist/components/charts/volume-profile/tooltip.js.map +1 -0
- package/dist/components/charts/volume-profile.d.ts +111 -0
- package/dist/components/charts/volume-profile.d.ts.map +1 -0
- package/dist/components/charts/volume-profile.js +82 -0
- package/dist/components/charts/volume-profile.js.map +1 -0
- package/dist/components/custom/confirm-dialog.d.ts +1 -0
- package/dist/components/custom/toast.d.ts +1 -0
- package/dist/components/motion/action-swap.d.ts.map +1 -1
- package/dist/components/motion/action-swap.js +3 -0
- package/dist/components/motion/action-swap.js.map +1 -1
- package/dist/components/motion/alert.d.ts +40 -0
- package/dist/components/motion/alert.d.ts.map +1 -0
- package/dist/components/motion/alert.js +247 -0
- package/dist/components/motion/alert.js.map +1 -0
- package/dist/components/motion/animated-sidebar.d.ts +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.d.ts.map +1 -1
- package/dist/components/motion/attachment-upload.js +1 -2
- 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/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/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/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/collapsible.d.ts +34 -0
- package/dist/components/motion/collapsible.d.ts.map +1 -0
- package/dist/components/motion/collapsible.js +237 -0
- package/dist/components/motion/collapsible.js.map +1 -0
- package/dist/components/motion/color-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 +2 -2
- package/dist/components/motion/command-palette.js.map +1 -1
- package/dist/components/motion/context-menu.d.ts +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/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/expandable-control.d.ts +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 +1038 -0
- package/dist/components/motion/knockout-wheel.js.map +1 -0
- package/dist/components/motion/morphing-lightbox.d.ts +67 -0
- package/dist/components/motion/morphing-lightbox.d.ts.map +1 -0
- package/dist/components/motion/morphing-lightbox.js +499 -0
- package/dist/components/motion/morphing-lightbox.js.map +1 -0
- package/dist/components/motion/morphing-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/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/parallax.js.map +1 -1
- package/dist/components/motion/popover-morph.d.ts +5 -0
- package/dist/components/motion/popover-morph.d.ts.map +1 -1
- package/dist/components/motion/popover-morph.js +34 -8
- package/dist/components/motion/popover-morph.js.map +1 -1
- package/dist/components/motion/popover.d.ts +1 -0
- 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 +215 -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/radio.d.ts +3 -1
- package/dist/components/motion/radio.d.ts.map +1 -1
- package/dist/components/motion/radio.js +17 -5
- package/dist/components/motion/radio.js.map +1 -1
- package/dist/components/motion/scroll-progress.d.ts +1 -0
- package/dist/components/motion/shader-background.d.ts +1 -0
- package/dist/components/motion/sortable-list.d.ts +54 -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 +2 -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 +6 -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/text-reveal.d.ts +1 -0
- 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.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 +2 -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/autocomplete.d.ts +1 -1
- package/dist/components/reui/autocomplete.d.ts.map +1 -1
- package/dist/components/reui/autocomplete.js.map +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/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-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 +59 -33
- package/dist/components/reui/data-grid/data-grid-column-header.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-visibility.js +1 -1
- package/dist/components/reui/data-grid/data-grid-column-visibility.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-pagination.js +2 -2
- package/dist/components/reui/data-grid/data-grid-pagination.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-scroll-area.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-scroll-area.js +94 -64
- 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 +74 -41
- 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 +135 -32
- 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 +36 -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 +168 -5
- package/dist/components/reui/data-grid/data-grid-table.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table.js +354 -101
- package/dist/components/reui/data-grid/data-grid-table.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid.d.ts +55 -0
- package/dist/components/reui/data-grid/data-grid.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid.js +114 -52
- 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.js +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-i18n.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-nav.js +1 -1
- package/dist/components/reui/file-type.d.ts +496 -0
- package/dist/components/reui/file-type.d.ts.map +1 -0
- package/dist/components/reui/file-type.js +964 -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 +2 -2
- 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.js +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 +3 -3
- 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/rating.d.ts +1 -1
- package/dist/components/reui/scrollspy.d.ts +1 -0
- 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.d.ts +2 -2
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/direction.js +1 -2
- package/dist/components/ui/empty.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/item.d.ts +3 -3
- 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.d.ts +2 -2
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/tabs.d.ts +1 -1
- package/dist/components/ui/toggle.d.ts +2 -2
- 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/context-tTdLKYNf.js +99 -0
- package/dist/context-tTdLKYNf.js.map +1 -0
- package/dist/{copy-menu-C5GaT4Z-.js → copy-menu-BXUh52bu.js} +2 -2
- package/dist/{copy-menu-C5GaT4Z-.js.map → copy-menu-BXUh52bu.js.map} +1 -1
- package/dist/ease-B82HVmio.d.ts +50 -0
- package/dist/ease-B82HVmio.d.ts.map +1 -0
- package/dist/hooks/use-copy-to-clipboard.d.ts +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-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/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/ease.d.ts +2 -49
- package/dist/lib/tick-sound.d.ts +1 -0
- package/dist/model-DlbIqCZg.d.ts +41 -0
- package/dist/model-DlbIqCZg.d.ts.map +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/plot-CdFTbMI_.js +131 -0
- package/dist/plot-CdFTbMI_.js.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-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/use-position-DOi1gVL0.d.ts +32 -0
- package/dist/use-position-DOi1gVL0.d.ts.map +1 -0
- package/dist/utils-B3YXTsDI.js +26 -0
- package/dist/utils-B3YXTsDI.js.map +1 -0
- package/package.json +12 -12
- package/dist/cascader-types-BnH6wYD-.d.ts.map +0 -1
- package/dist/components/motion/tooltip.js.map +0 -1
- package/dist/lib/ease.d.ts.map +0 -1
- package/dist/positioner-3mCqiebN.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cascader-item.js","names":["React","ComboboxPrimitive"],"sources":["../../../../src/components/reui/cascader/cascader-item.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Combobox as ComboboxPrimitive } from \"@base-ui/react\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport {\n CheckIcon,\n ChevronRightIcon,\n LoaderCircleIcon,\n MinusIcon,\n RotateCwIcon,\n} from \"lucide-react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { Spinner } from \"../../ui/spinner\";\nimport { useCascaderActions, useCascaderRender, useCascaderState } from \"./cascader-context\";\nimport {\n getCascaderCount,\n getCascaderMoreParent,\n getCascaderPath,\n isCascaderMoreNode,\n} from \"./cascader-lib\";\nimport type { CascaderLoadState, CascaderNode } from \"./cascader-types\";\n\n// Base UI extends its synthetic events with a handler-veto escape hatch.\ntype VetoableEvent = { preventBaseUIHandler?: () => void };\n\n/** A row press. The veto hook is optional: an `as=\"button\"` row is outside Base\n * UI's listbox and gets a plain React event. */\nexport type CascaderRowEvent = React.MouseEvent<HTMLElement> & VetoableEvent;\n\n// Each style's inline inset, as a variable: a row and its absolutely positioned\n// check have to land on the same number, in LOGICAL properties. These eight\n// numbers MIRROR the shared style sheets; keep them in step with\n// `registry/styles/style-*.css`.\nconst ROW_INSET_CLASS = \"[--cascader-row-inset:6px]\";\n\n// Both insets equal, for a row with no check. `!` because a consumer may not\n// import the sheets into `layer(base)`, where the class would win on order.\nconst ROW_FLUSH_CLASS = \"ps-[var(--cascader-row-inset,8px)]! pe-[var(--cascader-row-inset,8px)]!\";\n\n// The same start inset plus room for the check. A flat `pr-8` is wrong in five\n// of the eight styles: 4px of slack in nova, 8px short in maia, luma and sera,\n// and no gutter at all in mira, whose check then overlaps its own label.\nconst ROW_GUTTER_CLASS =\n \"ps-[var(--cascader-row-inset,8px)]! pe-[calc(var(--cascader-row-inset,8px)*2_+_16px)]!\";\n\n// The check's box, inset to match the row's. A physical `right-2` neither\n// mirrors under RTL nor tracks the style's inset; `right-auto` comes with the\n// logical `end-*`, because width + `left` + `right` is over-constrained.\nconst INDICATOR_CLASS =\n \"pointer-events-none absolute flex items-center justify-center size-4 end-[var(--cascader-row-inset,8px)]! rtl:right-auto!\";\n\n// The row's type, gap, radius and icon size per style. No horizontal padding:\n// every row pairs this with `ROW_FLUSH_CLASS` or `ROW_GUTTER_CLASS`.\nconst ROW_THEME_CLASS =\n \"data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground [&_svg:not([class*='size-'])]:size-4 rounded-md py-1\";\n\n/**\n * The row's gap and type, per style, held apart from the rest of the theme.\n *\n * A row that pins its own gap or text size takes `ROW_SHELL_CLASS` and leaves\n * these out, because a `style-<name>:` utility is emitted AFTER the plain one\n * it would have to lose to. Not receiving the token beats overriding it with\n * `!`, which a consumer then has to fight in turn.\n */\nconst ROW_GAP_CLASS = \"gap-2\";\n\nconst ROW_TEXT_CLASS = \"text-sm\";\n\nconst ROW_SHELL_CLASS = `${ROW_THEME_CLASS} relative flex w-full cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 ${ROW_INSET_CLASS}`;\n\nconst ROW_CLASS = `${ROW_SHELL_CLASS} ${ROW_GAP_CLASS} ${ROW_TEXT_CLASS}`;\n\nconst CASCADER_ACTION_INSET_CLASS = `${ROW_INSET_CLASS} ${ROW_FLUSH_CLASS}`;\n\n/** A footer COMMAND: the row theme, so it cannot drift from the list, plus the\n * hover and `focus-visible` fills a plain button never gets. Fills, never a\n * ring: a ring under rows that all paint with a fill read as a different\n * widget bolted on. `focus-visible`, not `focus`, so a pointer press does not\n * leave a command painted as if it were still hovered. Disabled keys off\n * `aria-disabled`, not `:disabled`, to keep it FOCUSABLE: a footer whose only\n * row is disabled has no tab stop. */\nexport const CASCADER_ACTION_CLASS = `${ROW_SHELL_CLASS} ${ROW_TEXT_CLASS} ${ROW_FLUSH_CLASS} hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground cursor-pointer gap-2 transition-colors aria-disabled:pointer-events-none aria-disabled:opacity-50`;\n\n// The box around the affordances that are not the row. 20px around a 16px icon,\n// the outer 2px cancelled at the call site; 24px would set the row height.\nconst AFFORDANCE_BOX_CLASS = \"flex size-5 shrink-0 items-center justify-center rounded-sm\";\n\n// What makes an affordance read as pressable on an already highlighted row. Not\n// `hover:bg-accent`: the row is `bg-accent` under the pointer, so the chip would\n// be invisible. `!` and `**:` for the `CHECKBOX_MARK_CLASS` reason.\nconst AFFORDANCE_HOVER_CLASS =\n \"transition-[background-color,box-shadow,color] hover:bg-background hover:text-foreground! hover:**:text-foreground! hover:shadow-xs\";\n\n// The selection MARK's colour, pinned so nothing can repaint it: every row\n// carries a DESCENDANT highlight rule, and a mark is STATE. Pinned TWICE\n// because icon sets draw with `fill`/`stroke=\"currentColor\"`, which the\n// `<path>` inherits and resolves against the PATH's own `color`. Both halves\n// are asserted in `cascader-behavior.test.tsx`.\nconst CHECKBOX_MARK_CLASS = \"text-primary-foreground! **:text-primary-foreground!\";\nconst INDICATOR_MARK_CLASS = \"text-foreground! **:text-foreground!\";\n\n// Milliseconds the pointer must rest on a branch row before\n// `expandTrigger=\"hover\"` drills in: long enough that a pointer crossing the\n// column on its way elsewhere opens nothing, short enough to read as immediate.\nconst CASCADER_HOVER_EXPAND_DELAY = 150;\n\nexport interface CascaderItemProps\n extends Omit<\n ComboboxPrimitive.Item.Props,\n \"value\" | \"children\" | \"className\" | \"style\" | \"onClick\" | \"onMouseUp\"\n > {\n /** No state callback: the row merges `className` and `style` itself. */\n className?: string;\n style?: React.CSSProperties;\n onClick?: (event: CascaderRowEvent) => void;\n onMouseUp?: (event: CascaderRowEvent) => void;\n node: CascaderNode;\n /** Explicit render index. Required while virtualized and DELIBERATELY IGNORED\n * otherwise: it self-registers the row and breaks `aria-activedescendant`. */\n index?: number;\n /** Indentation depth. Drives `--cascader-indent` in tree mode. */\n depth?: number;\n /** Renders the ancestor chain under the label, for deep-search results. */\n showPath?: boolean;\n /** `option` renders a real `Combobox.Item`; `button` renders identical markup\n * outside the listbox, for the ancestor columns in columns mode. */\n as?: \"option\" | \"button\";\n /** Tree mode: this row is an expanded branch. */\n expanded?: boolean;\n /** Indent each depth by this many pixels. Tree mode only. */\n indent?: number;\n /** Whether the node has children. Defaults to the cascader's own answer, as do\n * the three below: callers pass them because they already hold the level,\n * which keeps a memoised row off the volatile context. */\n branch?: boolean;\n /** Whether the node may be committed. Defaults to the cascader's own answer. */\n selectable?: boolean;\n /** Whether the node is currently selected. Defaults to the cascader's answer. */\n selected?: boolean;\n /** Some but not all of the loaded subtree selected. `cascade` only. */\n indeterminate?: boolean;\n /** Selected nodes below this one, at any depth. Drives the trailing count. */\n selectedCount?: number;\n /** Paging row only: a request for this level is in flight. */\n loading?: boolean;\n /** Paging row only: this level's last request failed. */\n error?: boolean;\n /** Branch row only: this node's OWN children are being fetched. The chevron\n * (or, in tree mode, the expander) becomes a spinner IN PLACE, in the same\n * 16px box: no skeleton row appears below, nothing reflows. */\n childrenLoading?: boolean;\n /** Branch row only: the last fetch of this node's children failed. The same\n * box becomes the retry. The press path is unchanged: it goes through\n * `navigate`, which refires the failed level rather than moving. */\n childrenError?: boolean;\n children?: React.ReactNode;\n}\n\n/** One row. Branch presses navigate instead of selecting, vetoed here with\n * `preventBaseUIHandler()` on `onClick` (Enter too) and on `onMouseUp`. */\nconst CascaderItem = React.memo(function CascaderItem({\n node,\n index,\n depth,\n showPath = false,\n as = \"option\",\n expanded,\n indent = 16,\n branch: branchProp,\n selectable: selectableProp,\n selected: selectedProp,\n indeterminate: indeterminateProp,\n selectedCount: selectedCountProp,\n loading,\n error,\n childrenLoading = false,\n childrenError = false,\n className,\n children,\n onClick,\n onMouseUp,\n style,\n ...props\n}: CascaderItemProps) {\n // The ACTIONS context only: the state context republishes on every keystroke.\n const {\n index: treeIndex,\n mode,\n labels,\n isBranch,\n isSelectable,\n isSelected,\n isIndeterminate,\n selectedDescendantCount,\n multiple,\n branchesSelectable,\n indicator: indicatorEnabled,\n expandTrigger = \"click\",\n navigate,\n navigateAt,\n toggleExpanded,\n commit,\n virtualized,\n loadMore,\n retryLevel,\n } = useCascaderActions();\n // Render props come from an always-current context, or a closure goes stale.\n const { renderItem, renderLabel } = useCascaderRender();\n\n const branch = branchProp ?? isBranch(node);\n const selectable = selectableProp ?? isSelectable(node);\n const selected = selectedProp ?? isSelected(node);\n // A selected node is never also partially selected (a dash in a filled box).\n const indeterminate = !selected && (indeterminateProp ?? isIndeterminate(node));\n const count = branch ? getCascaderCount(treeIndex, node) : 0;\n const nodeDepth = depth ?? treeIndex.depthOf.get(node.value) ?? 0;\n\n // O(1): the cascader publishes a map of selected-descendant counts, because a\n // row walking its own subtree is `rows x descendants`, paid every keystroke.\n const selectedDescendants = branch ? (selectedCountProp ?? selectedDescendantCount(node)) : 0;\n // `multiple` only: with a single selection the trigger, the breadcrumb and\n // the leaf's own check already say where it is, so swapping a branch's real\n // child total (\"24\") for a permanent \"1\" would trade a useful number away.\n const showsSelectedCount = multiple && selectedDescendants > 0;\n const trailingCount = showsSelectedCount ? selectedDescendants : count;\n // Shown selected or not: suppressing it under a checked branch read as data\n // loss, and the row's TWO trailing columns mean the count never has to share\n // a slot with the check.\n const showCount = trailingCount > 0;\n\n // Where a multi-select tree puts its checkbox: at the HEAD of the row, since a\n // trailing box does not follow the label stagger. Per-LIST, never per-row, or\n // the labels below an unselectable row step back out.\n const leadingCheckbox = mode === \"tree\" && multiple;\n\n // Whether this row draws a MARK, and so whether it reserves the gutter one\n // needs. `|| multiple` is the scope of the opt-out: a checkbox is the\n // selection CONTROL, so `indicator={false}` is a no-op in multi-select.\n const showsIndicator = indicatorEnabled || multiple;\n\n const veto = React.useCallback((event: VetoableEvent) => {\n event.preventBaseUIHandler?.();\n }, []);\n\n const handleClick = React.useCallback(\n (event: CascaderRowEvent) => {\n onClick?.(event);\n if (node.disabled) return;\n if (branch && !selectable) {\n veto(event);\n navigate(node);\n }\n },\n [onClick, node, branch, selectable, veto, navigate],\n );\n\n const handleMouseUp = React.useCallback(\n (event: CascaderRowEvent) => {\n onMouseUp?.(event);\n if (node.disabled) return;\n if (branch && !selectable) veto(event);\n },\n [onMouseUp, node, branch, selectable, veto],\n );\n\n // The tree expander's own press. With `selectable=\"any\"` the row press\n // commits, and under `cascade` that selected a whole subtree while the row\n // stayed collapsed, so expanding needs its own target. `stopPropagation`\n // before the veto, so Base UI's handler never runs, and no role: nesting\n // one in `role=\"option\"` fails axe. `navigate` fetches BEFORE it opens.\n const handleExpanderClick = React.useCallback(\n (event: CascaderRowEvent) => {\n event.stopPropagation();\n veto(event);\n if (node.disabled) return;\n if (expanded) toggleExpanded(node.value);\n else navigate(node);\n },\n [veto, node, expanded, toggleExpanded, navigate],\n );\n\n const handleExpanderMouseUp = React.useCallback(\n (event: CascaderRowEvent) => {\n // Base UI treats a drag-select mouseup as a commit; this is not one.\n event.stopPropagation();\n veto(event);\n },\n [veto],\n );\n\n const handleChevronClick = React.useCallback(\n (event: CascaderRowEvent) => {\n event.stopPropagation();\n veto(event);\n if (node.disabled) return;\n // `navigate` falls through to `pushLevel`, which APPENDS: right in the\n // deepest column, but from an ancestor column it duplicated the level and\n // corrupted the path. `navigateAt` rebuilds the trail from this depth.\n if (as === \"button\") navigateAt(node, depth ?? 0);\n else navigate(node);\n },\n [veto, node, as, navigateAt, depth, navigate],\n );\n\n const handleChevronMouseUp = React.useCallback((event: CascaderRowEvent) => veto(event), [veto]);\n\n // Keeps focus in the search field: Base UI prevents the mousedown default for\n // option rows, and focusing a `tabindex=\"-1\"` trail row kills every key.\n const handleButtonMouseDown = React.useCallback((event: React.MouseEvent<HTMLElement>) => {\n event.preventDefault();\n }, []);\n\n const handleButtonClick = React.useCallback(\n (event: CascaderRowEvent) => {\n onClick?.(event);\n if (node.disabled) return;\n if (branch && !selectable) {\n // Button rows only exist in the columns trail, where `depth` is the\n // column's own depth, so navigating replaces the trail from here.\n navigateAt(node, depth ?? 0);\n return;\n }\n if (selectable) commit(node);\n },\n [onClick, node, branch, selectable, navigateAt, depth, commit],\n );\n\n // The paging row's press, never a selection, whatever `selectable` says.\n const handleMoreClick = React.useCallback(\n (event: CascaderRowEvent) => {\n onClick?.(event);\n veto(event);\n const parent = getCascaderMoreParent(node);\n if (parent == null) return;\n if (error) retryLevel(parent);\n else if (!loading) loadMore(parent);\n },\n [onClick, veto, node, error, loading, retryLevel, loadMore],\n );\n\n // `expandTrigger=\"hover\"`: resting on a BRANCH row in the ACTIVE column drills\n // in after a delay. The deepest column of columns mode only, and it never\n // commits, so a pointer crossing the panel cannot change the value.\n const hoverNavigates =\n expandTrigger === \"hover\" && mode === \"columns\" && as === \"option\" && branch && !node.disabled;\n const hoverTimerRef = React.useRef<number | null>(null);\n\n const cancelHoverNavigate = React.useCallback(() => {\n if (hoverTimerRef.current == null) return;\n window.clearTimeout(hoverTimerRef.current);\n hoverTimerRef.current = null;\n }, []);\n\n const handleHoverPointerEnter = React.useCallback(() => {\n cancelHoverNavigate();\n hoverTimerRef.current = window.setTimeout(() => {\n hoverTimerRef.current = null;\n navigate(node);\n }, CASCADER_HOVER_EXPAND_DELAY);\n }, [cancelHoverNavigate, navigate, node]);\n\n // Drilling in demotes this column to the trail WITHOUT unmounting the row, so\n // a pending timer has to die or it fires `navigate` from an inactive column.\n React.useEffect(() => {\n if (!hoverNavigates) cancelHoverNavigate();\n }, [hoverNavigates, cancelHoverNavigate]);\n React.useEffect(() => cancelHoverNavigate, [cancelHoverNavigate]);\n\n /* ------------------------------- paging row ------------------------------ */\n\n if (isCascaderMoreNode(node)) {\n const text = error\n ? labels.error\n : loading\n ? node.count\n ? labels.loadingMore\n : labels.loading\n : labels.loadMore;\n\n const moreStyle =\n mode === \"tree\" && nodeDepth > 0\n ? ({\n ...style,\n \"--cascader-indent\": `${nodeDepth * indent}px`,\n } as React.CSSProperties)\n : style;\n\n const moreShared = {\n \"data-slot\": \"cascader-item\",\n \"data-more\": \"\",\n \"data-state\": error ? \"error\" : loading ? \"loading\" : \"idle\",\n \"data-depth\": nodeDepth,\n style: moreStyle,\n className: cn(\n ROW_SHELL_CLASS,\n ROW_FLUSH_CLASS,\n \"justify-center gap-1.5 text-muted-foreground text-xs\",\n !error && !loading && \"hover:text-foreground\",\n mode === \"tree\" && \"ps-[calc(var(--cascader-row-inset,8px)_+_var(--cascader-indent,0px))]!\",\n className,\n ),\n };\n\n const moreBody = children ?? (\n <>\n {loading ? <LoaderCircleIcon className=\"size-3.5 animate-spin\" aria-hidden /> : null}\n <span>{text}</span>\n {/* TEXT, not a button: a focusable element inside a `role=\"option\"`\n row is a `nested-interactive` violation. */}\n {error ? <span className=\"font-medium text-foreground\">{labels.retry}</span> : null}\n </>\n );\n\n if (as === \"button\") {\n const buttonProps = { ...(props as React.ComponentProps<\"button\">) };\n delete buttonProps[\"aria-setsize\"];\n delete buttonProps[\"aria-posinset\"];\n delete buttonProps[\"aria-level\"];\n\n return (\n <button\n type=\"button\"\n {...moreShared}\n tabIndex={-1}\n onClick={handleMoreClick}\n {...buttonProps}\n >\n {moreBody}\n </button>\n );\n }\n\n return (\n <ComboboxPrimitive.Item\n {...moreShared}\n value={node}\n {...(virtualized && index != null ? { index } : null)}\n {...(mode === \"tree\" ? { role: \"treeitem\" as const, \"aria-level\": nodeDepth + 1 } : null)}\n onClick={handleMoreClick}\n onMouseUp={veto}\n {...props}\n >\n {moreBody}\n </ComboboxPrimitive.Item>\n );\n }\n\n const itemState = {\n branch,\n selected,\n disabled: !!node.disabled,\n depth: nodeDepth,\n count,\n path: showPath ? getCascaderPath(treeIndex, node.value).slice(0, -1) : [],\n };\n\n const custom = renderItem?.(node, itemState);\n const customLabel = renderLabel?.(node, itemState);\n\n // What the markup cannot say: a branch would announce \"Person 24\", a naked\n // number. Trail rows are outside the listbox, so they need words for state.\n const srDetails = [\n branch ? labels.itemCount(count) : null,\n showsSelectedCount ? labels.selectedCount(selectedDescendants) : null,\n branch && mode !== \"tree\" ? labels.branchAffordance : null,\n as === \"button\" && selected ? labels.selectedState : null,\n // Option rows say this with `aria-checked=\"mixed\"`; `role=\"button\"` allows\n // neither that nor `aria-selected`, so a trail row says it in words.\n as === \"button\" && indeterminate ? labels.partiallySelectedState : null,\n ]\n .filter(Boolean)\n .map((detail) => `, ${detail}`)\n .join(\"\");\n\n // Extracted because tree mode renders it INLINE at the head of the row. It\n // reads `data-selected` off the ROW, so it also works on the trail rows.\n const checkbox = (\n <span\n data-slot=\"cascader-item-checkbox\"\n className=\"flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input in-data-indeterminate:border-primary in-data-selected:border-primary in-data-indeterminate:bg-primary in-data-selected:bg-primary in-data-indeterminate:text-primary-foreground in-data-selected:text-primary-foreground transition-colors\"\n >\n {/* Colour declared ON THE ICON with `!`; see `CHECKBOX_MARK_CLASS`. */}\n {indeterminate ? (\n <MinusIcon data-slot=\"cascader-item-dash\" className={cn(CHECKBOX_MARK_CLASS, \"size-3\")} />\n ) : (\n <CheckIcon\n data-slot=\"cascader-item-tick\"\n className={cn(CHECKBOX_MARK_CLASS, \"size-3 in-data-selected:opacity-100 opacity-0\")}\n />\n )}\n </span>\n );\n\n const indicator = (\n <>\n {multiple ? (\n checkbox\n ) : (\n <CheckIcon\n data-slot=\"cascader-item-check\"\n className={cn(\"pointer-events-none\", INDICATOR_MARK_CLASS)}\n />\n )}\n </>\n );\n\n const body = custom ?? children ?? (\n <>\n {/* Tree mode expands in place, so the branch marker leads the row. */}\n {mode === \"tree\" && branch ? (\n <span\n data-slot=\"cascader-item-expander\"\n /* Pure affordance: the row itself carries `aria-expanded`. */\n aria-hidden=\"true\"\n data-state={childrenError ? \"error\" : childrenLoading ? \"loading\" : \"idle\"}\n onClick={handleExpanderClick}\n onMouseUp={handleExpanderMouseUp}\n className={cn(\n \"-ms-0.5\",\n childrenError ? \"text-destructive\" : \"text-muted-foreground\",\n AFFORDANCE_BOX_CLASS,\n AFFORDANCE_HOVER_CLASS,\n childrenLoading && \"pointer-events-none\",\n )}\n >\n {childrenLoading ? (\n <Spinner aria-hidden=\"true\" className=\"size-4\" />\n ) : childrenError ? (\n <RotateCwIcon className=\"size-4\" />\n ) : (\n <ChevronRightIcon\n className={cn(\n \"size-4 transition-transform\",\n /* Collapsed it points INTO the level, so it mirrors; expanded\n it points DOWN, the same in both writing modes, so the mirror\n has to come off or `scaleX(-1)` composed with `rotate(90deg)`\n lands it pointing up. `rtl:rotate-90` beside `rotate-90` was\n a no-op that only looked like it handled this. */\n expanded ? \"rotate-90\" : \"rtl:-scale-x-100\",\n )}\n />\n )}\n </span>\n ) : mode === \"tree\" ? (\n // A LEAF's expander slot, reserved and empty: without it a leaf's label\n // started 28px off its sibling branches' and read as one level up.\n <span\n data-slot=\"cascader-item-expander-spacer\"\n aria-hidden=\"true\"\n className={cn(\"-ms-0.5\", AFFORDANCE_BOX_CLASS)}\n />\n ) : null}\n\n {/* Tree + multi-select: the box leads the row, and an unselectable row\n still reserves its width. */}\n {leadingCheckbox ? (\n selectable ? (\n checkbox\n ) : (\n <span\n data-slot=\"cascader-item-checkbox-spacer\"\n aria-hidden=\"true\"\n className=\"size-4 shrink-0\"\n />\n )\n ) : null}\n\n {node.icon ? (\n <span\n data-slot=\"cascader-item-icon\"\n className=\"flex shrink-0 items-center justify-center text-muted-foreground\"\n >\n {node.icon}\n </span>\n ) : null}\n\n {/* The row box is sized for pieces side by side; this one stacks, so it\n restates the gap: 8px reads as a paragraph break, not a subtitle. */}\n <span className=\"flex min-w-0 flex-1 flex-col items-start gap-0.5\">\n {customLabel ?? (\n <>\n <span className=\"w-full truncate text-start\">{node.label}</span>\n {node.description ? (\n <span\n data-slot=\"cascader-item-description\"\n className=\"w-full truncate text-start text-muted-foreground text-xs\"\n >\n {node.description}\n </span>\n ) : null}\n </>\n )}\n {showPath ? <CascaderItemPath node={node} /> : null}\n </span>\n\n {/* The count is a bare number, and nothing else says a branch opens. */}\n {srDetails ? (\n <span data-slot=\"cascader-item-details\" className=\"sr-only\">\n {srDetails}\n </span>\n ) : null}\n\n {/* Tree mode expands in place, so it has no drill-in chevron. */}\n {branch && mode !== \"tree\" ? (\n <span\n data-slot=\"cascader-item-trailing\"\n aria-hidden=\"true\"\n className=\"ms-auto flex shrink-0 items-center gap-1 text-muted-foreground text-xs tabular-nums\"\n >\n {showCount ? (\n <span\n data-slot=\"cascader-item-count\"\n /* The marker a consumer (and a test) reads to tell the two\n numbers apart without matching on a colour class. */\n {...(showsSelectedCount ? { \"data-selected-count\": \"\" } : null)}\n className={cn(showsSelectedCount && \"text-primary!\")}\n >\n {trailingCount}\n </span>\n ) : null}\n {/* ONLY the chevron is the drill target: sharing a hit area with the count made a number pressable. */}\n {/** biome-ignore lint/a11y/useKeyWithClickEvents: <> */}\n <span\n data-slot=\"cascader-item-chevron\"\n data-state={childrenError ? \"error\" : childrenLoading ? \"loading\" : \"idle\"}\n onClick={selectable ? handleChevronClick : undefined}\n onMouseUp={selectable ? handleChevronMouseUp : undefined}\n onMouseDown={as === \"button\" ? handleButtonMouseDown : undefined}\n className={cn(\n /* Cancels the box's outer slack, so the icon keeps its column. */\n \"-me-0.5\",\n AFFORDANCE_BOX_CLASS,\n selectable && AFFORDANCE_HOVER_CLASS,\n childrenError && \"text-destructive\",\n childrenLoading && \"pointer-events-none\",\n )}\n >\n {childrenLoading ? (\n <Spinner aria-hidden=\"true\" className=\"size-4\" />\n ) : childrenError ? (\n <RotateCwIcon className=\"size-4\" />\n ) : (\n <ChevronRightIcon className=\"size-4 rtl:-scale-x-100\" />\n )}\n </span>\n </span>\n ) : null}\n\n {branch && mode === \"tree\" && showCount ? (\n <span\n data-slot=\"cascader-item-count\"\n {...(showsSelectedCount ? { \"data-selected-count\": \"\" } : null)}\n /* The count is spoken by the sr-only details span instead. */\n aria-hidden=\"true\"\n className={cn(\n \"ms-auto shrink-0 text-muted-foreground text-xs tabular-nums\",\n showsSelectedCount && \"text-primary!\",\n )}\n >\n {trailingCount}\n </span>\n ) : null}\n\n {/* No trailing indicator when a tree's box led the row, or when\n `indicator={false}` opted out. See `showsIndicator`. */}\n {selectable && !leadingCheckbox && showsIndicator ? (\n as === \"button\" ? (\n // No ItemIndicator outside Base UI: `data-selected` drives it.\n (multiple || selected) && (\n <span data-slot=\"cascader-item-indicator\" className={INDICATOR_CLASS}>\n {indicator}\n </span>\n )\n ) : (\n <ComboboxPrimitive.ItemIndicator\n /* Kept mounted for a partial selection too: the row is not\n selected, so Base UI would unmount the box the dash lives in. */\n keepMounted={multiple || indeterminate}\n render={<span data-slot=\"cascader-item-indicator\" className={INDICATOR_CLASS} />}\n >\n {indicator}\n </ComboboxPrimitive.ItemIndicator>\n )\n ) : null}\n </>\n );\n\n const rowStyle =\n mode === \"tree\" && nodeDepth > 0\n ? ({\n ...style,\n \"--cascader-indent\": `${nodeDepth * indent}px`,\n } as React.CSSProperties)\n : style;\n\n const shared = {\n \"data-slot\": \"cascader-item\",\n \"data-branch\": branch || undefined,\n \"data-selected\": selected || undefined,\n \"data-indeterminate\": indeterminate || undefined,\n \"data-depth\": nodeDepth,\n \"data-expanded\": expanded || undefined,\n // No `aria-level`: `role=\"option\"` allows only `aria-selected`,\n // `aria-checked`, `aria-posinset` and `aria-setsize`, and a `role=\"button\"`\n // trail row allows none of the four. Only tree mode has a role that takes a\n // level, and it adds one below.\n style: rowStyle,\n className: cn(\n ROW_CLASS,\n /* Three separate reasons to hand the check gutter back. A multi-select\n tree's box leads the row, so the gutter would be 24px of dead space;\n `indicator={false}` drops the check, and keeping the gutter would park\n the count and the chevron one gutter in from an edge nothing sits on;\n and for branches the question is per-LIST, not per-row, because the old\n `branch && !selectable` put neighbouring chevrons on 24px and 6px in\n nova. One `pe-*` is emitted either way, so nothing here depends on\n class-merge order. */\n leadingCheckbox || !showsIndicator || (branch && !branchesSelectable)\n ? ROW_FLUSH_CLASS\n : ROW_GUTTER_CLASS,\n /* ADDED to the style's own inset, never substituted: replacing it put\n depth 0 at 12px and depth 1 at 16px in maia, luma and sera, a 4px step.\n `_+_` because Tailwind's parser splits on whitespace. */\n mode === \"tree\" && \"ps-[calc(var(--cascader-row-inset,8px)_+_var(--cascader-indent,0px))]!\",\n className,\n ),\n };\n\n if (as === \"button\") {\n const buttonProps = { ...(props as React.ComponentProps<\"button\">) };\n // `role=\"button\"` allows none of these, so they are dropped, not passed.\n delete buttonProps[\"aria-setsize\"];\n delete buttonProps[\"aria-posinset\"];\n delete buttonProps[\"aria-level\"];\n\n return (\n <button\n type=\"button\"\n {...shared}\n /* Focus stays in the search input; the trail uses ArrowLeft. */\n tabIndex={-1}\n disabled={node.disabled}\n aria-disabled={node.disabled || undefined}\n onClick={handleButtonClick}\n onMouseDown={handleButtonMouseDown}\n {...buttonProps}\n >\n {body}\n </button>\n );\n }\n\n return (\n <ComboboxPrimitive.Item\n {...shared}\n value={node}\n /* THE one gate for the explicit index: supply one outside virtualized mode\n and the first arrow key leaves `aria-activedescendant` pointing at\n nothing. */\n {...(virtualized && index != null ? { index } : null)}\n disabled={node.disabled}\n /* Conditional spread, never `role={... : undefined}`: `mergeProps`\n iterates own keys, so `undefined` would delete `role=\"option\"`. */\n {...(mode === \"tree\"\n ? {\n role: \"treeitem\" as const,\n \"aria-level\": nodeDepth + 1,\n ...(branch ? { \"aria-expanded\": !!expanded } : null),\n }\n : branch\n ? { \"aria-haspopup\": \"listbox\" as const }\n : null)}\n /* Only ever `mixed`: a selected row already says so with `aria-selected`,\n and two selection attributes on one row is noise. */\n {...(indeterminate ? { \"aria-checked\": \"mixed\" as const } : null)}\n {...(hoverNavigates\n ? {\n onPointerEnter: handleHoverPointerEnter,\n onPointerLeave: cancelHoverNavigate,\n }\n : null)}\n onClick={handleClick}\n onMouseUp={handleMouseUp}\n {...props}\n >\n {body}\n </ComboboxPrimitive.Item>\n );\n});\n\n/** Ancestor chain under a deep-search result: \"Name\" alone is ambiguous. */\nfunction CascaderItemPath({ node }: { node: CascaderNode }) {\n const { index, labels } = useCascaderActions();\n const ancestors = getCascaderPath(index, node.value).slice(0, -1);\n if (!ancestors.length) return null;\n\n return (\n <span\n data-slot=\"cascader-item-path\"\n className=\"flex w-full items-center gap-0.5 truncate text-start text-muted-foreground text-xs\"\n >\n {ancestors.map((ancestor, i) => (\n <React.Fragment key={ancestor.value}>\n {i > 0 ? <span aria-hidden=\"true\">{labels.pathSeparator}</span> : null}\n <span className=\"truncate\">{ancestor.label}</span>\n </React.Fragment>\n ))}\n </span>\n );\n}\n\n/** Every load-derived prop a row needs. A PAGING row reports the level it\n * belongs to, a BRANCH row the level it OWNS; mutually exclusive, so one call\n * answers both. Exported because a memoised row cannot read them itself. */\nexport function getCascaderMoreProps(\n node: CascaderNode,\n loadStates: ReadonlyMap<string, CascaderLoadState>,\n): {\n loading: boolean;\n error: boolean;\n childrenLoading: boolean;\n childrenError: boolean;\n} {\n const parent = getCascaderMoreParent(node);\n if (parent == null) {\n const own = loadStates.get(node.value);\n return {\n loading: false,\n error: false,\n childrenLoading: !!own?.loading,\n childrenError: !!own?.error,\n };\n }\n const state = loadStates.get(parent);\n return {\n loading: !!state?.loading,\n error: !!state?.error,\n childrenLoading: false,\n childrenError: false,\n };\n}\n\nexport interface CascaderItemsProps {\n /** Replaces the default row for every item. */\n children?: (node: CascaderNode, index: number) => React.ReactNode;\n}\n\n/** Whatever the active view is: the current level, the deepest column, or the\n * flattened tree rows. Lives here so `cascader.tsx` never imports a row\n * component, which would cycle with the context. `index` is deliberately not\n * passed; see `CascaderItemProps`. */\nfunction CascaderItems({ children }: CascaderItemsProps) {\n const { mode, isBranch, isSelectable, isSelected, isIndeterminate } = useCascaderActions();\n const { renderedItems, deepResults, treeRows, loadStates } = useCascaderState();\n const showPath = deepResults !== null;\n\n // Answered once here, as plain booleans, so `React.memo` can skip a row.\n if (mode === \"tree\") {\n return (\n <>\n {treeRows.map((row, i) =>\n children ? (\n <React.Fragment key={row.node.value}>{children(row.node, i)}</React.Fragment>\n ) : (\n <CascaderItem\n key={row.node.value}\n node={row.node}\n depth={row.depth}\n expanded={row.expanded}\n branch={row.branch}\n selectable={isSelectable(row.node)}\n selected={isSelected(row.node)}\n indeterminate={isIndeterminate(row.node)}\n {...getCascaderMoreProps(row.node, loadStates)}\n aria-setsize={row.setSize}\n aria-posinset={row.posInSet}\n />\n ),\n )}\n </>\n );\n }\n\n return (\n <>\n {renderedItems.map((node, i) =>\n children ? (\n <React.Fragment key={node.value}>{children(node, i)}</React.Fragment>\n ) : (\n <CascaderItem\n key={node.value}\n node={node}\n showPath={showPath}\n branch={isBranch(node)}\n selectable={isSelectable(node)}\n selected={isSelected(node)}\n indeterminate={isIndeterminate(node)}\n {...getCascaderMoreProps(node, loadStates)}\n aria-setsize={renderedItems.length}\n aria-posinset={i + 1}\n />\n ),\n )}\n </>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Group / Label / Separator */\n/* -------------------------------------------------------------------------- */\n\n// Whether a `CascaderLabel` has a group to name: Base UI's `Combobox.GroupLabel`\n// THROWS when there is none, and a heading is useful outside a group.\nconst CascaderGroupContext = React.createContext(false);\n\n// A heading over a run of rows. All eight styles are spelled out because the\n// type is not uniform (sera is uppercase), and the inset is the row's own.\nconst CASCADER_LABEL_CLASS = `text-muted-foreground text-xs py-1.5 ${CASCADER_ACTION_INSET_CLASS} block truncate`;\n\n// A rule between two runs. The inline margin is not the combobox separator's:\n// that cancels the container's padding with a per-style number, wrong in a\n// footer and 4px too much in lyra. `--cascader-list-pad` reaches the edge.\nconst CASCADER_SEPARATOR_CLASS =\n \"h-px bg-border my-1 mx-[calc(var(--cascader-list-pad,4px)*-1)]! shrink-0\";\n\nexport interface CascaderGroupProps extends Omit<ComboboxPrimitive.Group.Props, \"className\"> {\n /** Base UI also accepts a state callback here; the group has no state. */\n className?: string;\n}\n\n/** A run of related rows, named by the `CascaderLabel` inside it: the group is\n * `role=\"group\"` and Base UI points its `aria-labelledby` at the label, where a\n * heading alone inside a listbox is dropped from the accessibility tree.\n * Grouping is composition, not data: `CascaderItems` renders one flat run per\n * level, so its indices line up with `listRef`. */\nfunction CascaderGroup({ className, ...props }: CascaderGroupProps) {\n return (\n <CascaderGroupContext.Provider value={true}>\n <ComboboxPrimitive.Group\n data-slot=\"cascader-group\"\n className={cn(\"flex flex-col\", className)}\n {...props}\n />\n </CascaderGroupContext.Provider>\n );\n}\n\nexport interface CascaderLabelProps\n extends Omit<ComboboxPrimitive.GroupLabel.Props, \"className\" | \"style\"> {\n /** No state callback; outside a group this is not a Base UI part at all. */\n className?: string;\n style?: React.CSSProperties;\n}\n\n/** Inside a group: the real thing, with the id association Base UI wires up. */\nfunction CascaderGroupLabel({ className, ...props }: CascaderLabelProps) {\n return (\n <ComboboxPrimitive.GroupLabel\n data-slot=\"cascader-label\"\n className={cn(CASCADER_LABEL_CLASS, className)}\n {...props}\n />\n );\n}\n\n// Outside a group: the same heading as a plain element. A separate component\n// rather than a branch, so the hook count cannot change when a label moves in.\nfunction CascaderPlainLabel({ className, ...props }: CascaderLabelProps) {\n const defaultProps = {\n \"data-slot\": \"cascader-label\",\n className: cn(CASCADER_LABEL_CLASS, className),\n };\n\n return useRender({\n defaultTagName: \"div\",\n render: props.render,\n props: mergeProps<\"div\">(defaultProps, props),\n });\n}\n\n/** A heading. Inside `CascaderGroup` it is the group's accessible name; outside\n * one (the footer flyout is a menu, not a listbox) it is decoration only. */\nfunction CascaderLabel(props: CascaderLabelProps) {\n const grouped = React.useContext(CascaderGroupContext);\n return grouped ? <CascaderGroupLabel {...props} /> : <CascaderPlainLabel {...props} />;\n}\n\nexport interface CascaderSeparatorProps\n extends Omit<ComboboxPrimitive.Separator.Props, \"className\"> {\n /** Base UI also accepts a state callback here; only the orientation varies. */\n className?: string;\n}\n\n/** Decorative on purpose: Base UI's separator is `role=\"separator\"`, which a\n * `listbox` may not own, and a run that needs separating for a screen reader\n * needs a `CascaderGroup`, not a line. A consumer can pass the role back. */\nfunction CascaderSeparator({ className, ...props }: CascaderSeparatorProps) {\n return (\n <ComboboxPrimitive.Separator\n data-slot=\"cascader-separator\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(CASCADER_SEPARATOR_CLASS, className)}\n {...props}\n />\n );\n}\n\nexport { CascaderGroup, CascaderItem, CascaderItems, CascaderLabel, CascaderSeparator };\n"],"mappings":";;;;;;;;;;;;AAoCA,MAAM,kBAAkB;AAIxB,MAAM,kBAAkB;AAKxB,MAAM,mBACJ;AAKF,MAAM,kBACJ;AAIF,MAAM,kBACJ;;;;;;;;;AAUF,MAAM,gBAAgB;AAEtB,MAAM,iBAAiB;AAEvB,MAAM,kBAAkB,GAAG,gBAAgB,uLAAuL;AAElO,MAAM,YAAY,GAAG,gBAAgB,GAAG,cAAc,GAAG;AAEzD,MAAM,8BAA8B,GAAG,gBAAgB,GAAG;;;;;;;;AAS1D,MAAa,wBAAwB,GAAG,gBAAgB,GAAG,eAAe,GAAG,gBAAgB;AAI7F,MAAM,uBAAuB;AAK7B,MAAM,yBACJ;AAOF,MAAM,sBAAsB;AAC5B,MAAM,uBAAuB;AAK7B,MAAM,8BAA8B;;;AAwDpC,MAAM,eAAeA,QAAM,KAAK,SAAS,aAAa,EACpD,MACA,OACA,OACA,WAAW,OACX,KAAK,UACL,UACA,SAAS,IACT,QAAQ,YACR,YAAY,gBACZ,UAAU,cACV,eAAe,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AAC;AACH;;;AAIA,SAAS,cAAc,OAA2B;CAEhD,OADgBD,QAAM,WAAW,oBACpB,IAAI,oBAAC,oBAAD,EAAoB,GAAI,MAAQ,CAAA,IAAI,oBAAC,oBAAD,EAAoB,GAAI,MAAQ,CAAA;AACvF;;;;AAWA,SAAS,kBAAkB,EAAE,WAAW,GAAG,SAAiC;CAC1E,OACE,oBAACC,SAAkB,WAAnB;EACE,aAAU;EACV,MAAK;EACL,eAAY;EACZ,WAAW,GAAG,0BAA0B,SAAS;EACjD,GAAI;CACL,CAAA;AAEL"}
|
|
1
|
+
{"version":3,"file":"cascader-item.js","names":["React","ComboboxPrimitive"],"sources":["../../../../src/components/reui/cascader/cascader-item.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Combobox as ComboboxPrimitive } from \"@base-ui/react\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport {\n CheckIcon,\n ChevronRightIcon,\n LoaderCircleIcon,\n MinusIcon,\n RotateCwIcon,\n} from \"lucide-react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { Spinner } from \"../../ui/spinner\";\nimport { useCascaderActions, useCascaderRender, useCascaderState } from \"./cascader-context\";\nimport {\n getCascaderCount,\n getCascaderMoreParent,\n getCascaderPath,\n isCascaderMoreNode,\n} from \"./cascader-lib\";\nimport type { CascaderLoadState, CascaderNode } from \"./cascader-types\";\n\n// Base UI extends its synthetic events with a handler-veto escape hatch.\ntype VetoableEvent = { preventBaseUIHandler?: () => void };\n\n/** A row press. The veto hook is optional: an `as=\"button\"` row is outside Base\n * UI's listbox and gets a plain React event. */\nexport type CascaderRowEvent = React.MouseEvent<HTMLElement> & VetoableEvent;\n\n// Each style's inline inset, as a variable: a row and its absolutely positioned\n// check have to land on the same number, in LOGICAL properties. These eight\n// numbers MIRROR the shared style sheets; keep them in step with\n// `registry/styles/style-*.css`.\nconst ROW_INSET_CLASS = \"[--cascader-row-inset:6px]\";\n\n// Both insets equal, for a row with no check. `!` because a consumer may not\n// import the sheets into `layer(base)`, where the class would win on order.\nconst ROW_FLUSH_CLASS = \"ps-[var(--cascader-row-inset,8px)]! pe-[var(--cascader-row-inset,8px)]!\";\n\n// The same start inset plus room for the check. A flat `pr-8` is wrong in five\n// of the eight styles: 4px of slack in nova, 8px short in maia, luma and sera,\n// and no gutter at all in mira, whose check then overlaps its own label.\nconst ROW_GUTTER_CLASS =\n \"ps-[var(--cascader-row-inset,8px)]! pe-[calc(var(--cascader-row-inset,8px)*2_+_16px)]!\";\n\n// The check's box, inset to match the row's. A physical `right-2` neither\n// mirrors under RTL nor tracks the style's inset; `right-auto` comes with the\n// logical `end-*`, because width + `left` + `right` is over-constrained.\nconst INDICATOR_CLASS =\n \"pointer-events-none absolute flex items-center justify-center size-4 end-[var(--cascader-row-inset,8px)]! rtl:right-auto!\";\n\n// The row's type, gap, radius and icon size per style. No horizontal padding:\n// every row pairs this with `ROW_FLUSH_CLASS` or `ROW_GUTTER_CLASS`.\nconst ROW_THEME_CLASS =\n \"data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground [&_svg:not([class*='size-'])]:size-4 rounded-md py-1\";\n\n/**\n * The row's gap and type, per style, held apart from the rest of the theme.\n *\n * A row that pins its own gap or text size takes `ROW_SHELL_CLASS` and leaves\n * these out, because a `style-<name>:` utility is emitted AFTER the plain one\n * it would have to lose to. Not receiving the token beats overriding it with\n * `!`, which a consumer then has to fight in turn.\n */\nconst ROW_GAP_CLASS = \"gap-2\";\n\nconst ROW_TEXT_CLASS = \"text-sm\";\n\nconst ROW_SHELL_CLASS = `${ROW_THEME_CLASS} relative flex w-full cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 ${ROW_INSET_CLASS}`;\n\nconst ROW_CLASS = `${ROW_SHELL_CLASS} ${ROW_GAP_CLASS} ${ROW_TEXT_CLASS}`;\n\nconst CASCADER_ACTION_INSET_CLASS = `${ROW_INSET_CLASS} ${ROW_FLUSH_CLASS}`;\n\n/** A footer COMMAND: the row theme, so it cannot drift from the list, plus the\n * hover and `focus-visible` fills a plain button never gets. Fills, never a\n * ring: a ring under rows that all paint with a fill read as a different\n * widget bolted on. `focus-visible`, not `focus`, so a pointer press does not\n * leave a command painted as if it were still hovered. Disabled keys off\n * `aria-disabled`, not `:disabled`, to keep it FOCUSABLE: a footer whose only\n * row is disabled has no tab stop. */\nexport const CASCADER_ACTION_CLASS = `${ROW_SHELL_CLASS} ${ROW_TEXT_CLASS} ${ROW_FLUSH_CLASS} hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground cursor-pointer gap-2 transition-colors aria-disabled:pointer-events-none aria-disabled:opacity-50`;\n\n// The box around the affordances that are not the row. 20px around a 16px icon,\n// the outer 2px cancelled at the call site; 24px would set the row height.\nconst AFFORDANCE_BOX_CLASS = \"flex size-5 shrink-0 items-center justify-center rounded-sm\";\n\n// What makes an affordance read as pressable on an already highlighted row. Not\n// `hover:bg-accent`: the row is `bg-accent` under the pointer, so the chip would\n// be invisible. `!` and `**:` for the `CHECKBOX_MARK_CLASS` reason.\nconst AFFORDANCE_HOVER_CLASS =\n \"transition-[background-color,box-shadow,color] hover:bg-background hover:text-foreground! hover:**:text-foreground! hover:shadow-xs\";\n\n// The selection MARK's colour, pinned so nothing can repaint it: every row\n// carries a DESCENDANT highlight rule, and a mark is STATE. Pinned TWICE\n// because icon sets draw with `fill`/`stroke=\"currentColor\"`, which the\n// `<path>` inherits and resolves against the PATH's own `color`. Both halves\n// are asserted in `cascader-behavior.test.tsx`.\nconst CHECKBOX_MARK_CLASS = \"text-primary-foreground! **:text-primary-foreground!\";\nconst INDICATOR_MARK_CLASS = \"text-foreground! **:text-foreground!\";\n\n// Milliseconds the pointer must rest on a branch row before\n// `expandTrigger=\"hover\"` drills in: long enough that a pointer crossing the\n// column on its way elsewhere opens nothing, short enough to read as immediate.\nconst CASCADER_HOVER_EXPAND_DELAY = 150;\n\nexport interface CascaderItemProps\n extends Omit<\n ComboboxPrimitive.Item.Props,\n \"value\" | \"children\" | \"className\" | \"style\" | \"onClick\" | \"onMouseUp\"\n > {\n /** No state callback: the row merges `className` and `style` itself. */\n className?: string;\n style?: React.CSSProperties;\n onClick?: (event: CascaderRowEvent) => void;\n onMouseUp?: (event: CascaderRowEvent) => void;\n node: CascaderNode;\n /** Explicit render index. Required while virtualized and DELIBERATELY IGNORED\n * otherwise: it self-registers the row and breaks `aria-activedescendant`. */\n index?: number;\n /** Indentation depth. Drives `--cascader-indent` in tree mode. */\n depth?: number;\n /** Renders the ancestor chain under the label, for deep and global search. */\n showPath?: boolean;\n /** `option` renders a real `Combobox.Item`; `button` renders identical markup\n * outside the listbox, for the ancestor columns in columns mode. */\n as?: \"option\" | \"button\";\n /** Tree mode: this row is an expanded branch. */\n expanded?: boolean;\n /** Indent each depth by this many pixels. Tree mode only. */\n indent?: number;\n /** Whether the node has children. Defaults to the cascader's own answer, as do\n * the three below: callers pass them because they already hold the level,\n * which keeps a memoised row off the volatile context. */\n branch?: boolean;\n /** Whether the node may be committed. Defaults to the cascader's own answer. */\n selectable?: boolean;\n /** Whether the node is currently selected. Defaults to the cascader's answer. */\n selected?: boolean;\n /** Some but not all of the loaded subtree selected. `cascade` only. */\n indeterminate?: boolean;\n /** Selected nodes below this one, at any depth. Drives the trailing count. */\n selectedCount?: number;\n /** Paging row only: a request for this level is in flight. */\n loading?: boolean;\n /** Paging row only: this level's last request failed. */\n error?: boolean;\n /** Branch row only: this node's OWN children are being fetched. The chevron\n * (or, in tree mode, the expander) becomes a spinner IN PLACE, in the same\n * 16px box: no skeleton row appears below, nothing reflows. */\n childrenLoading?: boolean;\n /** Branch row only: the last fetch of this node's children failed. The same\n * box becomes the retry. The press path is unchanged: it goes through\n * `navigate`, which refires the failed level rather than moving. */\n childrenError?: boolean;\n children?: React.ReactNode;\n}\n\n/** One row. Branch presses navigate instead of selecting, vetoed here with\n * `preventBaseUIHandler()` on `onClick` (Enter too) and on `onMouseUp`. */\nconst CascaderItem = React.memo(function CascaderItem({\n node,\n index,\n depth,\n showPath = false,\n as = \"option\",\n expanded,\n indent = 16,\n branch: branchProp,\n selectable: selectableProp,\n selected: selectedProp,\n indeterminate: indeterminateProp,\n selectedCount: selectedCountProp,\n loading,\n error,\n childrenLoading = false,\n childrenError = false,\n className,\n children,\n onClick,\n onMouseUp,\n style,\n ...props\n}: CascaderItemProps) {\n // The ACTIONS context only: the state context republishes on every keystroke.\n const {\n index: treeIndex,\n mode,\n labels,\n isBranch,\n isSelectable,\n isDisabled,\n isSelected,\n isIndeterminate,\n selectedDescendantCount,\n multiple,\n branchesSelectable,\n indicator: indicatorEnabled,\n expandTrigger = \"click\",\n navigate,\n navigateAt,\n toggleExpanded,\n commit,\n getState,\n virtualized,\n loadMore,\n retryLevel,\n } = useCascaderActions();\n // Render props come from an always-current context, or a closure goes stale.\n const { renderItem, renderLabel } = useCascaderRender();\n\n const branch = branchProp ?? isBranch(node);\n const selectable = selectableProp ?? isSelectable(node);\n // An ancestor's flag counts: a search hit or a revealed path can list a row\n // inside a branch nobody may open. Asked here, off the near-stable context,\n // so no new prop and only a row that re-renders pays the ancestor walk.\n const disabled = isDisabled(node);\n const selected = selectedProp ?? isSelected(node);\n // A selected node is never also partially selected (a dash in a filled box).\n const indeterminate = !selected && (indeterminateProp ?? isIndeterminate(node));\n const count = branch ? getCascaderCount(treeIndex, node) : 0;\n const nodeDepth = depth ?? treeIndex.depthOf.get(node.value) ?? 0;\n\n // O(1): the cascader publishes a map of selected-descendant counts, because a\n // row walking its own subtree is `rows x descendants`, paid every keystroke.\n const selectedDescendants = branch ? (selectedCountProp ?? selectedDescendantCount(node)) : 0;\n // `multiple` only: with a single selection the trigger, the breadcrumb and\n // the leaf's own check already say where it is, so swapping a branch's real\n // child total (\"24\") for a permanent \"1\" would trade a useful number away.\n const showsSelectedCount = multiple && selectedDescendants > 0;\n const trailingCount = showsSelectedCount ? selectedDescendants : count;\n // Shown selected or not: suppressing it under a checked branch read as data\n // loss, and the row's TWO trailing columns mean the count never has to share\n // a slot with the check.\n const showCount = trailingCount > 0;\n\n // Where a multi-select tree puts its checkbox: at the HEAD of the row, since a\n // trailing box does not follow the label stagger. Per-LIST, never per-row, or\n // the labels below an unselectable row step back out.\n const leadingCheckbox = mode === \"tree\" && multiple;\n\n // Whether this row draws a MARK, and so whether it reserves the gutter one\n // needs. `|| multiple` is the scope of the opt-out: a checkbox is the\n // selection CONTROL, so `indicator={false}` is a no-op in multi-select.\n const showsIndicator = indicatorEnabled || multiple;\n\n const veto = React.useCallback((event: VetoableEvent) => {\n event.preventBaseUIHandler?.();\n }, []);\n\n const handleClick = React.useCallback(\n (event: CascaderRowEvent) => {\n onClick?.(event);\n if (disabled) return;\n if (branch && !selectable) {\n veto(event);\n navigate(node);\n }\n },\n [onClick, node, disabled, branch, selectable, veto, navigate],\n );\n\n const handleMouseUp = React.useCallback(\n (event: CascaderRowEvent) => {\n onMouseUp?.(event);\n if (disabled) return;\n if (branch && !selectable) veto(event);\n },\n [onMouseUp, disabled, branch, selectable, veto],\n );\n\n // The tree expander's own press. With `selectable=\"any\"` the row press\n // commits, and under `cascade` that selected a whole subtree while the row\n // stayed collapsed, so expanding needs its own target. `stopPropagation`\n // before the veto, so Base UI's handler never runs, and no role: nesting\n // one in `role=\"option\"` fails axe. `navigate` fetches BEFORE it opens.\n // A disabled row may still CLOSE what `expanded` opened, never open: a row\n // only a query holds open is not in `expanded`, and the toggle would add it.\n const handleExpanderClick = React.useCallback(\n (event: CascaderRowEvent) => {\n event.stopPropagation();\n veto(event);\n if (expanded) {\n if (!disabled || getState().expanded.has(node.value)) {\n toggleExpanded(node.value);\n }\n } else if (!disabled) navigate(node);\n },\n [veto, node, disabled, expanded, getState, toggleExpanded, navigate],\n );\n\n const handleExpanderMouseUp = React.useCallback(\n (event: CascaderRowEvent) => {\n // Base UI treats a drag-select mouseup as a commit; this is not one.\n event.stopPropagation();\n veto(event);\n },\n [veto],\n );\n\n const handleChevronClick = React.useCallback(\n (event: CascaderRowEvent) => {\n event.stopPropagation();\n veto(event);\n if (disabled) return;\n // `navigate` falls through to `pushLevel`, which APPENDS: right in the\n // deepest column, but from an ancestor column it duplicated the level and\n // corrupted the path. `navigateAt` rebuilds the trail from this depth.\n if (as === \"button\") navigateAt(node, depth ?? 0);\n else navigate(node);\n },\n [veto, node, disabled, as, navigateAt, depth, navigate],\n );\n\n const handleChevronMouseUp = React.useCallback((event: CascaderRowEvent) => veto(event), [veto]);\n\n // Keeps focus in the search field: Base UI prevents the mousedown default for\n // option rows, and focusing a `tabindex=\"-1\"` trail row kills every key.\n const handleButtonMouseDown = React.useCallback((event: React.MouseEvent<HTMLElement>) => {\n event.preventDefault();\n }, []);\n\n const handleButtonClick = React.useCallback(\n (event: CascaderRowEvent) => {\n onClick?.(event);\n if (disabled) return;\n if (branch && !selectable) {\n // Button rows only exist in the columns trail, where `depth` is the\n // column's own depth, so navigating replaces the trail from here.\n navigateAt(node, depth ?? 0);\n return;\n }\n if (selectable) commit(node);\n },\n [onClick, node, disabled, branch, selectable, navigateAt, depth, commit],\n );\n\n // The paging row's press, never a selection, whatever `selectable` says.\n const handleMoreClick = React.useCallback(\n (event: CascaderRowEvent) => {\n onClick?.(event);\n veto(event);\n const parent = getCascaderMoreParent(node);\n if (parent == null) return;\n if (error) retryLevel(parent);\n else if (!loading) loadMore(parent);\n },\n [onClick, veto, node, error, loading, retryLevel, loadMore],\n );\n\n // `expandTrigger=\"hover\"`: resting on a BRANCH row in the ACTIVE column drills\n // in after a delay. The deepest column of columns mode only, and it never\n // commits, so a pointer crossing the panel cannot change the value.\n const hoverNavigates =\n expandTrigger === \"hover\" && mode === \"columns\" && as === \"option\" && branch && !disabled;\n const hoverTimerRef = React.useRef<number | null>(null);\n\n const cancelHoverNavigate = React.useCallback(() => {\n if (hoverTimerRef.current == null) return;\n window.clearTimeout(hoverTimerRef.current);\n hoverTimerRef.current = null;\n }, []);\n\n const handleHoverPointerEnter = React.useCallback(() => {\n cancelHoverNavigate();\n hoverTimerRef.current = window.setTimeout(() => {\n hoverTimerRef.current = null;\n navigate(node);\n }, CASCADER_HOVER_EXPAND_DELAY);\n }, [cancelHoverNavigate, navigate, node]);\n\n // Drilling in demotes this column to the trail WITHOUT unmounting the row, so\n // a pending timer has to die or it fires `navigate` from an inactive column.\n React.useEffect(() => {\n if (!hoverNavigates) cancelHoverNavigate();\n }, [hoverNavigates, cancelHoverNavigate]);\n React.useEffect(() => cancelHoverNavigate, [cancelHoverNavigate]);\n\n /* ------------------------------- paging row ------------------------------ */\n\n if (isCascaderMoreNode(node)) {\n const text = error\n ? labels.error\n : loading\n ? node.count\n ? labels.loadingMore\n : labels.loading\n : labels.loadMore;\n\n const moreStyle =\n mode === \"tree\" && nodeDepth > 0\n ? ({\n ...style,\n \"--cascader-indent\": `${nodeDepth * indent}px`,\n } as React.CSSProperties)\n : style;\n\n const moreShared = {\n \"data-slot\": \"cascader-item\",\n \"data-more\": \"\",\n \"data-state\": error ? \"error\" : loading ? \"loading\" : \"idle\",\n \"data-depth\": nodeDepth,\n style: moreStyle,\n className: cn(\n ROW_SHELL_CLASS,\n ROW_FLUSH_CLASS,\n \"justify-center gap-1.5 text-muted-foreground text-xs\",\n !error && !loading && \"hover:text-foreground\",\n mode === \"tree\" && \"ps-[calc(var(--cascader-row-inset,8px)_+_var(--cascader-indent,0px))]!\",\n className,\n ),\n };\n\n const moreBody = children ?? (\n <>\n {loading ? <LoaderCircleIcon className=\"size-3.5 animate-spin\" aria-hidden /> : null}\n <span>{text}</span>\n {/* TEXT, not a button: a focusable element inside a `role=\"option\"`\n row is a `nested-interactive` violation. */}\n {error ? <span className=\"font-medium text-foreground\">{labels.retry}</span> : null}\n </>\n );\n\n if (as === \"button\") {\n const buttonProps = { ...(props as React.ComponentProps<\"button\">) };\n delete buttonProps[\"aria-setsize\"];\n delete buttonProps[\"aria-posinset\"];\n delete buttonProps[\"aria-level\"];\n\n return (\n <button\n type=\"button\"\n {...moreShared}\n tabIndex={-1}\n onClick={handleMoreClick}\n {...buttonProps}\n >\n {moreBody}\n </button>\n );\n }\n\n return (\n <ComboboxPrimitive.Item\n {...moreShared}\n value={node}\n {...(virtualized && index != null ? { index } : null)}\n {...(mode === \"tree\" ? { role: \"treeitem\" as const, \"aria-level\": nodeDepth + 1 } : null)}\n onClick={handleMoreClick}\n onMouseUp={veto}\n {...props}\n >\n {moreBody}\n </ComboboxPrimitive.Item>\n );\n }\n\n const itemState = {\n branch,\n selected,\n disabled,\n depth: nodeDepth,\n count,\n path: showPath ? getCascaderPath(treeIndex, node.value).slice(0, -1) : [],\n };\n\n const custom = renderItem?.(node, itemState);\n const customLabel = renderLabel?.(node, itemState);\n\n // What the markup cannot say: a branch would announce \"Person 24\", a naked\n // number. Trail rows are outside the listbox, so they need words for state.\n const srDetails = [\n branch ? labels.itemCount(count) : null,\n showsSelectedCount ? labels.selectedCount(selectedDescendants) : null,\n branch && mode !== \"tree\" ? labels.branchAffordance : null,\n as === \"button\" && selected ? labels.selectedState : null,\n // Option rows say this with `aria-checked=\"mixed\"`; `role=\"button\"` allows\n // neither that nor `aria-selected`, so a trail row says it in words.\n as === \"button\" && indeterminate ? labels.partiallySelectedState : null,\n ]\n .filter(Boolean)\n .map((detail) => `, ${detail}`)\n .join(\"\");\n\n // Extracted because tree mode renders it INLINE at the head of the row. It\n // reads `data-selected` off the ROW, so it also works on the trail rows.\n const checkbox = (\n <span\n data-slot=\"cascader-item-checkbox\"\n className=\"flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input in-data-indeterminate:border-primary in-data-selected:border-primary in-data-indeterminate:bg-primary in-data-selected:bg-primary in-data-indeterminate:text-primary-foreground in-data-selected:text-primary-foreground transition-colors\"\n >\n {/* Colour declared ON THE ICON with `!`; see `CHECKBOX_MARK_CLASS`. */}\n {indeterminate ? (\n <MinusIcon data-slot=\"cascader-item-dash\" className={cn(CHECKBOX_MARK_CLASS, \"size-3\")} />\n ) : (\n <CheckIcon\n data-slot=\"cascader-item-tick\"\n className={cn(CHECKBOX_MARK_CLASS, \"size-3 in-data-selected:opacity-100 opacity-0\")}\n />\n )}\n </span>\n );\n\n const indicator = (\n <>\n {multiple ? (\n checkbox\n ) : (\n <CheckIcon\n data-slot=\"cascader-item-check\"\n className={cn(\"pointer-events-none\", INDICATOR_MARK_CLASS)}\n />\n )}\n </>\n );\n\n const body = custom ?? children ?? (\n <>\n {/* Tree mode expands in place, so the branch marker leads the row. */}\n {mode === \"tree\" && branch ? (\n <span\n data-slot=\"cascader-item-expander\"\n /* Pure affordance: the row itself carries `aria-expanded`. */\n aria-hidden=\"true\"\n data-state={childrenError ? \"error\" : childrenLoading ? \"loading\" : \"idle\"}\n onClick={handleExpanderClick}\n onMouseUp={handleExpanderMouseUp}\n className={cn(\n \"-ms-0.5\",\n childrenError ? \"text-destructive\" : \"text-muted-foreground\",\n AFFORDANCE_BOX_CLASS,\n AFFORDANCE_HOVER_CLASS,\n /* A disabled row is `pointer-events-none`; only while open does its\n expander take the pointer back, to close what `expanded` opened. */\n disabled && expanded && \"pointer-events-auto\",\n childrenLoading && \"pointer-events-none\",\n )}\n >\n {childrenLoading ? (\n <Spinner aria-hidden=\"true\" className=\"size-4\" />\n ) : childrenError ? (\n <RotateCwIcon className=\"size-4\" />\n ) : (\n <ChevronRightIcon\n className={cn(\n \"size-4 transition-transform\",\n /* Collapsed it points INTO the level, so it mirrors; expanded\n it points DOWN, the same in both writing modes, so the mirror\n has to come off or `scaleX(-1)` composed with `rotate(90deg)`\n lands it pointing up. `rtl:rotate-90` beside `rotate-90` was\n a no-op that only looked like it handled this. */\n expanded ? \"rotate-90\" : \"rtl:-scale-x-100\",\n )}\n />\n )}\n </span>\n ) : mode === \"tree\" ? (\n // A LEAF's expander slot, reserved and empty: without it a leaf's label\n // started 28px off its sibling branches' and read as one level up.\n <span\n data-slot=\"cascader-item-expander-spacer\"\n aria-hidden=\"true\"\n className={cn(\"-ms-0.5\", AFFORDANCE_BOX_CLASS)}\n />\n ) : null}\n\n {/* Tree + multi-select: the box leads the row, and an unselectable row\n still reserves its width. */}\n {leadingCheckbox ? (\n selectable ? (\n checkbox\n ) : (\n <span\n data-slot=\"cascader-item-checkbox-spacer\"\n aria-hidden=\"true\"\n className=\"size-4 shrink-0\"\n />\n )\n ) : null}\n\n {node.icon ? (\n <span\n data-slot=\"cascader-item-icon\"\n className=\"flex shrink-0 items-center justify-center text-muted-foreground\"\n >\n {node.icon}\n </span>\n ) : null}\n\n {/* The row box is sized for pieces side by side; this one stacks, so it\n restates the gap: 8px reads as a paragraph break, not a subtitle. */}\n <span className=\"flex min-w-0 flex-1 flex-col items-start gap-0.5\">\n {customLabel ?? (\n <>\n <span className=\"w-full truncate text-start\">{node.label}</span>\n {node.description ? (\n <span\n data-slot=\"cascader-item-description\"\n className=\"w-full truncate text-start text-muted-foreground text-xs\"\n >\n {node.description}\n </span>\n ) : null}\n </>\n )}\n {showPath ? <CascaderItemPath node={node} /> : null}\n </span>\n\n {/* The count is a bare number, and nothing else says a branch opens. */}\n {srDetails ? (\n <span data-slot=\"cascader-item-details\" className=\"sr-only\">\n {srDetails}\n </span>\n ) : null}\n\n {/* Tree mode expands in place, so it has no drill-in chevron. */}\n {branch && mode !== \"tree\" ? (\n <span\n data-slot=\"cascader-item-trailing\"\n aria-hidden=\"true\"\n className=\"ms-auto flex shrink-0 items-center gap-1 text-muted-foreground text-xs tabular-nums\"\n >\n {showCount ? (\n <span\n data-slot=\"cascader-item-count\"\n /* The marker a consumer (and a test) reads to tell the two\n numbers apart without matching on a colour class. */\n {...(showsSelectedCount ? { \"data-selected-count\": \"\" } : null)}\n className={cn(showsSelectedCount && \"text-primary!\")}\n >\n {trailingCount}\n </span>\n ) : null}\n {/* ONLY the chevron is the drill target: sharing a hit area with\n the count made a number pressable. */}\n {/** biome-ignore lint/a11y/useKeyWithClickEvents: <> */}\n <span\n data-slot=\"cascader-item-chevron\"\n data-state={childrenError ? \"error\" : childrenLoading ? \"loading\" : \"idle\"}\n onClick={selectable ? handleChevronClick : undefined}\n onMouseUp={selectable ? handleChevronMouseUp : undefined}\n onMouseDown={as === \"button\" ? handleButtonMouseDown : undefined}\n className={cn(\n /* Cancels the box's outer slack, so the icon keeps its column. */\n \"-me-0.5\",\n AFFORDANCE_BOX_CLASS,\n selectable && AFFORDANCE_HOVER_CLASS,\n childrenError && \"text-destructive\",\n childrenLoading && \"pointer-events-none\",\n )}\n >\n {childrenLoading ? (\n <Spinner aria-hidden=\"true\" className=\"size-4\" />\n ) : childrenError ? (\n <RotateCwIcon className=\"size-4\" />\n ) : (\n <ChevronRightIcon className=\"size-4 rtl:-scale-x-100\" />\n )}\n </span>\n </span>\n ) : null}\n\n {branch && mode === \"tree\" && showCount ? (\n <span\n data-slot=\"cascader-item-count\"\n {...(showsSelectedCount ? { \"data-selected-count\": \"\" } : null)}\n /* The count is spoken by the sr-only details span instead. */\n aria-hidden=\"true\"\n className={cn(\n \"ms-auto shrink-0 text-muted-foreground text-xs tabular-nums\",\n showsSelectedCount && \"text-primary!\",\n )}\n >\n {trailingCount}\n </span>\n ) : null}\n\n {/* No trailing indicator when a tree's box led the row, or when\n `indicator={false}` opted out. See `showsIndicator`. */}\n {selectable && !leadingCheckbox && showsIndicator ? (\n as === \"button\" ? (\n // No ItemIndicator outside Base UI: `data-selected` drives it.\n (multiple || selected) && (\n <span data-slot=\"cascader-item-indicator\" className={INDICATOR_CLASS}>\n {indicator}\n </span>\n )\n ) : (\n <ComboboxPrimitive.ItemIndicator\n /* Kept mounted for a partial selection too: the row is not\n selected, so Base UI would unmount the box the dash lives in. */\n keepMounted={multiple || indeterminate}\n render={<span data-slot=\"cascader-item-indicator\" className={INDICATOR_CLASS} />}\n >\n {indicator}\n </ComboboxPrimitive.ItemIndicator>\n )\n ) : null}\n </>\n );\n\n const rowStyle =\n mode === \"tree\" && nodeDepth > 0\n ? ({\n ...style,\n \"--cascader-indent\": `${nodeDepth * indent}px`,\n } as React.CSSProperties)\n : style;\n\n const shared = {\n \"data-slot\": \"cascader-item\",\n \"data-branch\": branch || undefined,\n \"data-selected\": selected || undefined,\n \"data-indeterminate\": indeterminate || undefined,\n \"data-depth\": nodeDepth,\n \"data-expanded\": expanded || undefined,\n // No `aria-level`: `role=\"option\"` allows only `aria-selected`,\n // `aria-checked`, `aria-posinset` and `aria-setsize`, and a `role=\"button\"`\n // trail row allows none of the four. Only tree mode has a role that takes a\n // level, and it adds one below.\n style: rowStyle,\n className: cn(\n ROW_CLASS,\n /* Three separate reasons to hand the check gutter back. A multi-select\n tree's box leads the row, so the gutter would be 24px of dead space;\n `indicator={false}` drops the check, and keeping the gutter would park\n the count and the chevron one gutter in from an edge nothing sits on;\n and for branches the question is per-LIST, not per-row, because the old\n `branch && !selectable` put neighbouring chevrons on 24px and 6px in\n nova. One `pe-*` is emitted either way, so nothing here depends on\n class-merge order. */\n leadingCheckbox || !showsIndicator || (branch && !branchesSelectable)\n ? ROW_FLUSH_CLASS\n : ROW_GUTTER_CLASS,\n /* ADDED to the style's own inset, never substituted: replacing it put\n depth 0 at 12px and depth 1 at 16px in maia, luma and sera, a 4px step.\n `_+_` because Tailwind's parser splits on whitespace. */\n mode === \"tree\" && \"ps-[calc(var(--cascader-row-inset,8px)_+_var(--cascader-indent,0px))]!\",\n className,\n ),\n };\n\n if (as === \"button\") {\n const buttonProps = { ...(props as React.ComponentProps<\"button\">) };\n // `role=\"button\"` allows none of these, so they are dropped, not passed.\n delete buttonProps[\"aria-setsize\"];\n delete buttonProps[\"aria-posinset\"];\n delete buttonProps[\"aria-level\"];\n\n return (\n <button\n type=\"button\"\n {...shared}\n /* Focus stays in the search input; the trail uses ArrowLeft. */\n tabIndex={-1}\n disabled={disabled}\n aria-disabled={disabled || undefined}\n onClick={handleButtonClick}\n onMouseDown={handleButtonMouseDown}\n {...buttonProps}\n >\n {body}\n </button>\n );\n }\n\n return (\n <ComboboxPrimitive.Item\n {...shared}\n value={node}\n /* THE one gate for the explicit index: supply one outside virtualized mode\n and the first arrow key leaves `aria-activedescendant` pointing at\n nothing. */\n {...(virtualized && index != null ? { index } : null)}\n disabled={disabled}\n /* Conditional spread, never `role={... : undefined}`: `mergeProps`\n iterates own keys, so `undefined` would delete `role=\"option\"`. */\n {...(mode === \"tree\"\n ? {\n role: \"treeitem\" as const,\n \"aria-level\": nodeDepth + 1,\n ...(branch ? { \"aria-expanded\": !!expanded } : null),\n }\n : branch\n ? { \"aria-haspopup\": \"listbox\" as const }\n : null)}\n /* Only ever `mixed`: a selected row already says so with `aria-selected`,\n and two selection attributes on one row is noise. */\n {...(indeterminate ? { \"aria-checked\": \"mixed\" as const } : null)}\n {...(hoverNavigates\n ? {\n onPointerEnter: handleHoverPointerEnter,\n onPointerLeave: cancelHoverNavigate,\n }\n : null)}\n onClick={handleClick}\n onMouseUp={handleMouseUp}\n {...props}\n >\n {body}\n </ComboboxPrimitive.Item>\n );\n});\n\n/** Ancestor chain under a deep or global hit: \"Name\" alone is ambiguous. */\nfunction CascaderItemPath({ node }: { node: CascaderNode }) {\n const { index, labels } = useCascaderActions();\n const ancestors = getCascaderPath(index, node.value).slice(0, -1);\n if (!ancestors.length) return null;\n\n return (\n <span\n data-slot=\"cascader-item-path\"\n className=\"flex w-full items-center gap-0.5 truncate text-start text-muted-foreground text-xs\"\n >\n {ancestors.map((ancestor, i) => (\n <React.Fragment key={ancestor.value}>\n {i > 0 ? <span aria-hidden=\"true\">{labels.pathSeparator}</span> : null}\n <span className=\"truncate\">{ancestor.label}</span>\n </React.Fragment>\n ))}\n </span>\n );\n}\n\n/** Every load-derived prop a row needs. A PAGING row reports the level it\n * belongs to, a BRANCH row the level it OWNS; mutually exclusive, so one call\n * answers both. Exported because a memoised row cannot read them itself. */\nexport function getCascaderMoreProps(\n node: CascaderNode,\n loadStates: ReadonlyMap<string, CascaderLoadState>,\n): {\n loading: boolean;\n error: boolean;\n childrenLoading: boolean;\n childrenError: boolean;\n} {\n const parent = getCascaderMoreParent(node);\n if (parent == null) {\n const own = loadStates.get(node.value);\n return {\n loading: false,\n error: false,\n childrenLoading: !!own?.loading,\n childrenError: !!own?.error,\n };\n }\n const state = loadStates.get(parent);\n return {\n loading: !!state?.loading,\n error: !!state?.error,\n childrenLoading: false,\n childrenError: false,\n };\n}\n\nexport interface CascaderItemsProps {\n /** Replaces the default row for every item. */\n children?: (node: CascaderNode, index: number) => React.ReactNode;\n}\n\n/** Whatever the active view is: the current level, the deepest column, or the\n * flattened tree rows. Lives here so `cascader.tsx` never imports a row\n * component, which would cycle with the context. `index` is deliberately not\n * passed; see `CascaderItemProps`. */\nfunction CascaderItems({ children }: CascaderItemsProps) {\n const { mode, isBranch, isSelectable, isSelected, isIndeterminate } = useCascaderActions();\n const { renderedItems, deepResults, treeRows, loadStates } = useCascaderState();\n const showPath = deepResults !== null;\n\n // Answered once here, as plain booleans, so `React.memo` can skip a row.\n if (mode === \"tree\") {\n return (\n <>\n {treeRows.map((row, i) =>\n children ? (\n <React.Fragment key={row.node.value}>{children(row.node, i)}</React.Fragment>\n ) : (\n <CascaderItem\n key={row.node.value}\n node={row.node}\n depth={row.depth}\n expanded={row.expanded}\n branch={row.branch}\n selectable={isSelectable(row.node)}\n selected={isSelected(row.node)}\n indeterminate={isIndeterminate(row.node)}\n {...getCascaderMoreProps(row.node, loadStates)}\n aria-setsize={row.setSize}\n aria-posinset={row.posInSet}\n />\n ),\n )}\n </>\n );\n }\n\n return (\n <>\n {renderedItems.map((node, i) =>\n children ? (\n <React.Fragment key={node.value}>{children(node, i)}</React.Fragment>\n ) : (\n <CascaderItem\n key={node.value}\n node={node}\n showPath={showPath}\n branch={isBranch(node)}\n selectable={isSelectable(node)}\n selected={isSelected(node)}\n indeterminate={isIndeterminate(node)}\n {...getCascaderMoreProps(node, loadStates)}\n aria-setsize={renderedItems.length}\n aria-posinset={i + 1}\n />\n ),\n )}\n </>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Group / Label / Separator */\n/* -------------------------------------------------------------------------- */\n\n// Whether a `CascaderLabel` has a group to name: Base UI's `Combobox.GroupLabel`\n// THROWS when there is none, and a heading is useful outside a group.\nconst CascaderGroupContext = React.createContext(false);\n\n// A heading over a run of rows. All eight styles are spelled out because the\n// type is not uniform (sera is uppercase), and the inset is the row's own.\nconst CASCADER_LABEL_CLASS = `text-muted-foreground text-xs py-1.5 ${CASCADER_ACTION_INSET_CLASS} block truncate`;\n\n// A rule between two runs. The inline margin is not the combobox separator's:\n// that cancels the container's padding with a per-style number, wrong in a\n// footer and 4px too much in lyra. `--cascader-list-pad` reaches the edge.\nconst CASCADER_SEPARATOR_CLASS =\n \"h-px bg-border my-1 mx-[calc(var(--cascader-list-pad,4px)*-1)]! shrink-0\";\n\nexport interface CascaderGroupProps extends Omit<ComboboxPrimitive.Group.Props, \"className\"> {\n /** Base UI also accepts a state callback here; the group has no state. */\n className?: string;\n}\n\n/** A run of related rows, named by the `CascaderLabel` inside it: the group is\n * `role=\"group\"` and Base UI points its `aria-labelledby` at the label, where a\n * heading alone inside a listbox is dropped from the accessibility tree.\n * Grouping is composition, not data: `CascaderItems` renders one flat run per\n * level, so its indices line up with `listRef`. */\nfunction CascaderGroup({ className, ...props }: CascaderGroupProps) {\n return (\n <CascaderGroupContext.Provider value={true}>\n <ComboboxPrimitive.Group\n data-slot=\"cascader-group\"\n className={cn(\"flex flex-col\", className)}\n {...props}\n />\n </CascaderGroupContext.Provider>\n );\n}\n\nexport interface CascaderLabelProps\n extends Omit<ComboboxPrimitive.GroupLabel.Props, \"className\" | \"style\"> {\n /** No state callback; outside a group this is not a Base UI part at all. */\n className?: string;\n style?: React.CSSProperties;\n}\n\n/** Inside a group: the real thing, with the id association Base UI wires up. */\nfunction CascaderGroupLabel({ className, ...props }: CascaderLabelProps) {\n return (\n <ComboboxPrimitive.GroupLabel\n data-slot=\"cascader-label\"\n className={cn(CASCADER_LABEL_CLASS, className)}\n {...props}\n />\n );\n}\n\n// Outside a group: the same heading as a plain element. A separate component\n// rather than a branch, so the hook count cannot change when a label moves in.\nfunction CascaderPlainLabel({ className, ...props }: CascaderLabelProps) {\n const defaultProps = {\n \"data-slot\": \"cascader-label\",\n className: cn(CASCADER_LABEL_CLASS, className),\n };\n\n return useRender({\n defaultTagName: \"div\",\n render: props.render,\n props: mergeProps<\"div\">(defaultProps, props),\n });\n}\n\n/** A heading. Inside `CascaderGroup` it is the group's accessible name; outside\n * one (the footer flyout is a menu, not a listbox) it is decoration only. */\nfunction CascaderLabel(props: CascaderLabelProps) {\n const grouped = React.useContext(CascaderGroupContext);\n return grouped ? <CascaderGroupLabel {...props} /> : <CascaderPlainLabel {...props} />;\n}\n\nexport interface CascaderSeparatorProps\n extends Omit<ComboboxPrimitive.Separator.Props, \"className\"> {\n /** Base UI also accepts a state callback here; only the orientation varies. */\n className?: string;\n}\n\n/** Decorative on purpose: Base UI's separator is `role=\"separator\"`, which a\n * `listbox` may not own, and a run that needs separating for a screen reader\n * needs a `CascaderGroup`, not a line. A consumer can pass the role back. */\nfunction CascaderSeparator({ className, ...props }: CascaderSeparatorProps) {\n return (\n <ComboboxPrimitive.Separator\n data-slot=\"cascader-separator\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(CASCADER_SEPARATOR_CLASS, className)}\n {...props}\n />\n );\n}\n\nexport { CascaderGroup, CascaderItem, CascaderItems, CascaderLabel, CascaderSeparator };\n"],"mappings":";;;;;;;;;;;;AAoCA,MAAM,kBAAkB;AAIxB,MAAM,kBAAkB;AAKxB,MAAM,mBACJ;AAKF,MAAM,kBACJ;AAIF,MAAM,kBACJ;;;;;;;;;AAUF,MAAM,gBAAgB;AAEtB,MAAM,iBAAiB;AAEvB,MAAM,kBAAkB,GAAG,gBAAgB,uLAAuL;AAElO,MAAM,YAAY,GAAG,gBAAgB,GAAG,cAAc,GAAG;AAEzD,MAAM,8BAA8B,GAAG,gBAAgB,GAAG;;;;;;;;AAS1D,MAAa,wBAAwB,GAAG,gBAAgB,GAA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BAAmB,EAAE,WAAW,GAAG,SAA6B;CACvE,OACE,oBAACA,SAAkB,YAAnB;EACE,aAAU;EACV,WAAW,GAAG,sBAAsB,SAAS;EAC7C,GAAI;CACL,CAAA;AAEL;AAIA,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAA6B;CACvE,MAAM,eAAe;EACnB,aAAa;EACb,WAAW,GAAG,sBAAsB,SAAS;CAC/C;CAEA,OAAO,UAAU;EACf,gBAAgB;EAChB,QAAQ,MAAM;EACd,OAAO,WAAkB,cAAc,KAAK;CAC9C,CAAC;AACH;;;AAIA,SAAS,cAAc,OAA2B;CAEhD,OADgBD,QAAM,WAAW,oBACpB,IAAI,oBAAC,oBAAD,EAAoB,GAAI,MAAQ,CAAA,IAAI,oBAAC,oBAAD,EAAoB,GAAI,MAAQ,CAAA;AACvF;;;;AAWA,SAAS,kBAAkB,EAAE,WAAW,GAAG,SAAiC;CAC1E,OACE,oBAACC,SAAkB,WAAnB;EACE,aAAU;EACV,MAAK;EACL,eAAY;EACZ,WAAW,GAAG,0BAA0B,SAAS;EACjD,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as CascaderSelectable, a as CascaderFlatNode, i as CascaderCollapse, m as CascaderPathSegment, o as CascaderIndex, p as CascaderNode } from "../../../cascader-types-
|
|
1
|
+
import { _ as CascaderSelectable, a as CascaderFlatNode, i as CascaderCollapse, m as CascaderPathSegment, o as CascaderIndex, p as CascaderNode } from "../../../cascader-types-DVT-znZ-.js";
|
|
2
2
|
//#region src/components/reui/cascader/cascader-lib.d.ts
|
|
3
3
|
/** Root level key in `childrenOf`. NUL-prefixed so no real value collides. */
|
|
4
4
|
export declare const CASCADER_ROOT_KEY = "\0root";
|
|
@@ -59,6 +59,13 @@ export declare function getCascaderChildren<T>(index: CascaderIndex<T>, parent?:
|
|
|
59
59
|
export declare function isCascaderBranch<T>(index: CascaderIndex<T>, node: CascaderNode<T>): boolean;
|
|
60
60
|
/** Trailing count for the default row. Explicit `count` wins over the tree. */
|
|
61
61
|
export declare function getCascaderCount<T>(index: CascaderIndex<T>, node: CascaderNode<T>): number;
|
|
62
|
+
/**
|
|
63
|
+
* Whether a node is disabled: its own flag, or any ancestor's, since a disabled
|
|
64
|
+
* branch keeps its whole subtree shut. The index's copy counts as its own, so a
|
|
65
|
+
* server hit that omits the flag `items` sets is still caught. Ancestry is
|
|
66
|
+
* `parentOf`: a detached hit the index has never placed answers for itself.
|
|
67
|
+
*/
|
|
68
|
+
export declare function isCascaderDisabled<T>(index: CascaderIndex<T>, node: CascaderNode<T>): boolean;
|
|
62
69
|
/** Whether a node may be committed as a selection. */
|
|
63
70
|
export declare function isCascaderSelectable<T>(index: CascaderIndex<T>, node: CascaderNode<T>, selectable: CascaderSelectable<T>): boolean;
|
|
64
71
|
/** Ancestor chain for `value`, root first. Empty while async data loads. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cascader-lib.d.ts","names":[],"sources":["../../../../src/components/reui/cascader/cascader-lib.tsx"],"mappings":";;;qBAYa;;;;;qBAMA;;;;;;;;;;;qBAiBA;;;;;;qBAQA;;qBAGA;;qBAIA;;wBAiCG,uBAAuB,OAAO,cAAc;;wBAS5C,qBACd,OAAO,aACP,MAAM,gBACN,qBACC;;;;;wBA0Ba,cAAc,SAAS,SAAS;;;;;wBAYhC,uBAAuB,aACrC,mBACA,uBACC,aAAa;wBAUA,mBAAmB,GAAG,MAAM,aAAa;;wBAKzC,sBAAsB,GAAG,MAAM,aAAa;;wBAM5C,mBAAmB,aACjC,gBAAgB,aAAa,kBAC7B,aAAa,MAAM,aAAa,mCAC/B,cAAc;;;;;;wBAgGD,mBAAmB,aACjC,MAAM,cAAc,IACpB,OAAO,6BAA6B,aAAa,OACjD,WAAW,oBAAoB,aAAa,MAC3C,cAAc;;wBAgFD,oBAAoB,GAClC,OAAO,cAAc,IACrB,yBACC,aAAa;;wBAKA,iBAAiB,GAAG,OAAO,cAAc,IAAI,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aAAa,IAAI;IAEnC,aAAa;;;;;wBA+CA,oBAAoB,GAClC,OAAO,cAAc,IACrB,UAAU,qBACV,YAAY,sBACX,iBAAiB;;wBAuCJ,qBAAqB,GACnC,eAAe,aAAa,MAC5B;EAAW;EAAsB,WAAW;IAC3C,oBAAoB;;;;;wBAqCP,uBAAuB,GACrC,OAAO,cAAc,IACrB,gBACC,aAAa;;;;;;;;wBAwBA,sBAAsB,GACpC,OAAO,cAAc,IACrB,6BACA,eACA,iBACA,gBAAe,MAAM,aAAa;;;;;wBA6CpB,+BAA+B,GAC7C,OAAO,cAAc,IACrB,8BACC;;wBAiBa,6BACd,QAAQ,6BACR,8BACC;;wBAYa,yBAAyB,GACvC,OAAO,cAAc,IACrB,8BACC;;YAKS;;;;;;;wBAQI,yBAAyB,GACvC,OAAO,cAAc,IACrB,6BACA,UAAU;;wBAoBI,4BAA4B,GAAG,gBAAgB,aAAa,OAAO;;wBAyBnE,iBAAiB,aAAa;;wBAQ9B;;iBAKC;;EAEf;;EAEA;;;wBAIc,uBAAuB,GACrC,gBAAgB,aAAa,kBAC7B,aAAa,MAAM,aAAa,mCAC/B"}
|
|
@@ -245,19 +245,27 @@ function getCascaderCount(index, node) {
|
|
|
245
245
|
if (typeof node.count === "number") return node.count;
|
|
246
246
|
return index.childrenOf.get(node.value)?.length ?? 0;
|
|
247
247
|
}
|
|
248
|
+
/**
|
|
249
|
+
* Whether a node is disabled: its own flag, or any ancestor's, since a disabled
|
|
250
|
+
* branch keeps its whole subtree shut. The index's copy counts as its own, so a
|
|
251
|
+
* server hit that omits the flag `items` sets is still caught. Ancestry is
|
|
252
|
+
* `parentOf`: a detached hit the index has never placed answers for itself.
|
|
253
|
+
*/
|
|
254
|
+
function isCascaderDisabled(index, node) {
|
|
255
|
+
if (node.disabled || index.byValue.get(node.value)?.disabled) return true;
|
|
256
|
+
const seen = /* @__PURE__ */ new Set([node.value]);
|
|
257
|
+
let cursor = index.parentOf.get(node.value) ?? null;
|
|
258
|
+
while (cursor != null && !seen.has(cursor)) {
|
|
259
|
+
seen.add(cursor);
|
|
260
|
+
if (index.byValue.get(cursor)?.disabled) return true;
|
|
261
|
+
cursor = index.parentOf.get(cursor) ?? null;
|
|
262
|
+
}
|
|
263
|
+
return false;
|
|
264
|
+
}
|
|
248
265
|
/** Whether a node may be committed as a selection. */
|
|
249
266
|
function isCascaderSelectable(index, node, selectable) {
|
|
250
267
|
if (isCascaderMoreNode(node)) return false;
|
|
251
|
-
if (node
|
|
252
|
-
{
|
|
253
|
-
const seen = /* @__PURE__ */ new Set([node.value]);
|
|
254
|
-
let cursor = index.parentOf.get(node.value) ?? null;
|
|
255
|
-
while (cursor != null && !seen.has(cursor)) {
|
|
256
|
-
seen.add(cursor);
|
|
257
|
-
if (index.byValue.get(cursor)?.disabled) return false;
|
|
258
|
-
cursor = index.parentOf.get(cursor) ?? null;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
268
|
+
if (isCascaderDisabled(index, node)) return false;
|
|
261
269
|
if (typeof selectable === "function") return selectable(node);
|
|
262
270
|
if (selectable === "any") return true;
|
|
263
271
|
return !isCascaderBranch(index, node);
|
|
@@ -571,6 +579,6 @@ function findCascaderDataIssues(items, getParent) {
|
|
|
571
579
|
};
|
|
572
580
|
}
|
|
573
581
|
//#endregion
|
|
574
|
-
export { CASCADER_LIST_HEIGHT_CLASS, CASCADER_LIST_PAD_CLASS, CASCADER_MORE_PREFIX, CASCADER_ROOT_KEY, CASCADER_ROWS_CLASS, CASCADER_SCROLL_CLASS, applyCascadeSelection, buildCascaderIndex, collapseCascaderPath, collectCascaderSubtree, createCascaderMoreNode, filterCascaderLevel, findAmbiguousCascaderLabels, findCascaderDataIssues, flattenCascaderTree, foldCascaderText, getCascaderCheckedValues, getCascaderChildren, getCascaderCount, getCascaderFooterStops, getCascaderIndeterminate, getCascaderIndeterminateFrom, getCascaderMoreParent, getCascaderPath, getCascaderSelectedDescendants, getCascaderTabTarget, isCascaderBranch, isCascaderMoreNode, isCascaderRtl, isCascaderSelectable, matchesCascaderQuery, mergeCascaderIndex, normalizeCascaderQuery, resetCascaderWarnings, searchCascaderDeep, warnCascaderOnce };
|
|
582
|
+
export { CASCADER_LIST_HEIGHT_CLASS, CASCADER_LIST_PAD_CLASS, CASCADER_MORE_PREFIX, CASCADER_ROOT_KEY, CASCADER_ROWS_CLASS, CASCADER_SCROLL_CLASS, applyCascadeSelection, buildCascaderIndex, collapseCascaderPath, collectCascaderSubtree, createCascaderMoreNode, filterCascaderLevel, findAmbiguousCascaderLabels, findCascaderDataIssues, flattenCascaderTree, foldCascaderText, getCascaderCheckedValues, getCascaderChildren, getCascaderCount, getCascaderFooterStops, getCascaderIndeterminate, getCascaderIndeterminateFrom, getCascaderMoreParent, getCascaderPath, getCascaderSelectedDescendants, getCascaderTabTarget, isCascaderBranch, isCascaderDisabled, isCascaderMoreNode, isCascaderRtl, isCascaderSelectable, matchesCascaderQuery, mergeCascaderIndex, normalizeCascaderQuery, resetCascaderWarnings, searchCascaderDeep, warnCascaderOnce };
|
|
575
583
|
|
|
576
584
|
//# sourceMappingURL=cascader-lib.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cascader-lib.js","names":[],"sources":["../../../../src/components/reui/cascader/cascader-lib.tsx"],"sourcesContent":["\"use client\";\n\nimport type {\n CascaderCollapse,\n CascaderFlatNode,\n CascaderIndex,\n CascaderNode,\n CascaderPathSegment,\n CascaderSelectable,\n} from \"./cascader-types\";\n\n/** Root level key in `childrenOf`. NUL-prefixed so no real value collides. */\nexport const CASCADER_ROOT_KEY = \"\\u0000root\";\n\n/**\n * Paging pseudo-node prefix. Written as an escape sequence, not a raw 0x00\n * byte: a literal NUL makes this module read as binary and `grep -I` skips it.\n */\nexport const CASCADER_MORE_PREFIX = \"\\u0000more:\";\n\n/* -------------------------------------------------------------------------- */\n/* Scroll layout */\n/* -------------------------------------------------------------------------- */\n\n/**\n * The four scroll classes. In the lib because `cascader-columns.tsx` needs them\n * too and must not import `cascader.tsx`. Shell > bound > scrollport > rows.\n */\n\n/**\n * The bound. `min()` over an undefined custom property is an INVALID\n * declaration that drops the whole max-height, hence the `100vh` fallback: an\n * inline panel has no positioner, so no `--available-height`. `24rem` is the\n * default cap, so the common case sets no variable at all.\n */\nexport const CASCADER_LIST_HEIGHT_CLASS =\n \"max-h-[min(var(--available-height,100vh),var(--cascader-max-height,24rem))]\";\n\n/**\n * Each style's list padding: rows take it as `padding`, the scrollport as\n * `scroll-padding` floored at 4px so lyra's `0` does not strand a row.\n * Mirrored per style from `registry/styles/style-*.css`; keep them in step.\n */\nexport const CASCADER_LIST_PAD_CLASS = \"[--cascader-list-pad:4px]\";\n\n/** The scrollport: a `max-h-*` on the ScrollArea ROOT bounds nothing. */\nexport const CASCADER_SCROLL_CLASS =\n \"size-full min-h-0 **:data-[slot=scroll-area-viewport]:h-full **:data-[slot=scroll-area-viewport]:overscroll-contain **:data-[slot=scroll-area-viewport]:scroll-py-[max(var(--cascader-list-pad,4px),4px)]\";\n\n/** The rows' box; `data-empty:p-0` keeps an empty state from double inset. */\nexport const CASCADER_ROWS_CLASS = \"p-(--cascader-list-pad,4px) data-empty:p-0\";\n\n/* -------------------------------------------------------------------------- */\n/* Tab order */\n/* -------------------------------------------------------------------------- */\n\n/**\n * What counts as a keyboard stop. Base UI's ScrollArea viewport makes ITSELF\n * tabbable when content overflows (`hiddenState.x && hiddenState.y ? -1 : 0`),\n * an unnamed stop per level that `ui/scroll-area.tsx` will not let us suppress.\n */\nconst CASCADER_TAB_STOP_SELECTOR =\n 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])';\n\n/** The stop to step over: nothing here focuses the scrollport on purpose. */\nconst CASCADER_TAB_SKIP_SELECTOR = '[data-slot=\"scroll-area-viewport\"]';\n\n/** Out of the tab order whatever they contain; layout is never consulted. */\nconst CASCADER_TAB_HIDDEN_SELECTOR = \"[hidden],[inert],[aria-hidden='true']\";\n\n/** The panel's real keyboard stops, in DOM order. */\nfunction getCascaderTabStops(panel: HTMLElement): HTMLElement[] {\n const stops = Array.from(panel.querySelectorAll<HTMLElement>(CASCADER_TAB_STOP_SELECTOR));\n return stops.filter(\n (stop) =>\n // Option and trail rows are real `<button>`s with `tabindex=\"-1\"`.\n stop.getAttribute(\"tabindex\") !== \"-1\" &&\n !stop.matches(CASCADER_TAB_SKIP_SELECTOR) &&\n !stop.closest(CASCADER_TAB_HIDDEN_SELECTOR),\n );\n}\n\n/** The footer's own stops; an `aria-disabled` command still counts as one. */\nexport function getCascaderFooterStops(scope: HTMLElement): HTMLElement[] {\n const footer = scope.matches('[data-slot=\"cascader-footer\"]')\n ? scope\n : scope.querySelector<HTMLElement>('[data-slot=\"cascader-footer\"]');\n if (!footer) return [];\n return getCascaderTabStops(footer);\n}\n\n/** Where Tab lands, or `null` to let the browser out: focus is never trapped. */\nexport function getCascaderTabTarget(\n panel: HTMLElement,\n from: Element | null,\n backwards: boolean,\n): HTMLElement | null {\n const stops = getCascaderTabStops(panel);\n if (stops.length === 0 || !from) return null;\n\n const index = stops.indexOf(from as HTMLElement);\n if (index !== -1) return stops[index + (backwards ? -1 : 1)] ?? null;\n\n if (backwards) {\n for (let i = stops.length - 1; i >= 0; i -= 1) {\n const position = from.compareDocumentPosition(stops[i]);\n if (position & Node.DOCUMENT_POSITION_PRECEDING) return stops[i];\n }\n return null;\n }\n\n for (const stop of stops) {\n const position = from.compareDocumentPosition(stop);\n if (position & Node.DOCUMENT_POSITION_FOLLOWING) return stop;\n }\n return null;\n}\n\n/**\n * The writing direction at `element`. `DirectionProvider` may only vote yes:\n * unmounted it answers `\"ltr\"`, which would override a real `<html dir=\"rtl\">`.\n */\nexport function isCascaderRtl(element: Element, provided: string): boolean {\n if (provided === \"rtl\") return true;\n const explicit = element.closest(\"[dir]\")?.getAttribute(\"dir\")?.toLowerCase();\n if (explicit === \"rtl\") return true;\n if (explicit === \"ltr\") return false;\n return element.ownerDocument?.defaultView?.getComputedStyle(element).direction === \"rtl\";\n}\n\n/**\n * The paging row as a REAL node, not a DOM-only row after the list: every index\n * Base UI hands out indexes the RENDERED array, so a DOM-only row shifts them.\n */\nexport function createCascaderMoreNode<T = unknown>(\n parentKey: string,\n loadedCount = 0,\n): CascaderNode<T> {\n return {\n value: `${CASCADER_MORE_PREFIX}${parentKey}`,\n // Empty on purpose: a typeahead letter must never reach the paging row.\n label: \"\",\n // Feeds the row's \"Loading more...\" wording, with no second prop to thread.\n count: loadedCount,\n };\n}\n\nexport function isCascaderMoreNode<T>(node: CascaderNode<T>): boolean {\n return node.value.startsWith(CASCADER_MORE_PREFIX);\n}\n\n/** The level key a paging pseudo-node belongs to, or `null` for a real node. */\nexport function getCascaderMoreParent<T>(node: CascaderNode<T>): string | null {\n if (!isCascaderMoreNode(node)) return null;\n return node.value.slice(CASCADER_MORE_PREFIX.length);\n}\n\n/** Either input shape into one index. Cycle-guarded depths; first wins. */\nexport function buildCascaderIndex<T = unknown>(\n items: readonly CascaderNode<T>[] | undefined,\n getParent?: (node: CascaderNode<T>) => string | null | undefined,\n): CascaderIndex<T> {\n const byValue = new Map<string, CascaderNode<T>>();\n const childrenOf = new Map<string, CascaderNode<T>[]>();\n const parentOf = new Map<string, string | null>();\n const depthOf = new Map<string, number>();\n const all: CascaderNode<T>[] = [];\n\n const push = (parentKey: string, node: CascaderNode<T>) => {\n const bucket = childrenOf.get(parentKey);\n if (bucket) {\n bucket.push(node);\n } else {\n childrenOf.set(parentKey, [node]);\n }\n };\n\n if (getParent) {\n for (const node of items ?? []) {\n // A nullish entry is a data bug: skip it like a duplicate, say so in dev.\n if (node == null) {\n if (process.env.NODE_ENV !== \"production\") {\n warnCascaderOnce(\n \"nullish-entry\",\n \"Ignored a null or undefined entry in `items` or `children`. Check the arrays you pass in.\",\n );\n }\n continue;\n }\n if (byValue.has(node.value)) continue;\n byValue.set(node.value, node);\n all.push(node);\n }\n\n for (const node of all) {\n const rawParent = getParent(node);\n // An unknown parent makes the node a root rather than dropping the row.\n const parent = rawParent != null && byValue.has(rawParent) ? rawParent : null;\n parentOf.set(node.value, parent);\n push(parent ?? CASCADER_ROOT_KEY, node);\n }\n\n for (const node of all) {\n let depth = 0;\n let cursor = parentOf.get(node.value) ?? null;\n const seen = new Set<string>([node.value]);\n while (cursor != null && !seen.has(cursor)) {\n seen.add(cursor);\n depth += 1;\n cursor = parentOf.get(cursor) ?? null;\n }\n depthOf.set(node.value, depth);\n }\n } else {\n const walk = (\n nodes: readonly CascaderNode<T>[] | undefined,\n parent: string | null,\n depth: number,\n ) => {\n for (const node of nodes ?? []) {\n // Same degradation as the flat path above.\n if (node == null) {\n if (process.env.NODE_ENV !== \"production\") {\n warnCascaderOnce(\n \"nullish-entry\",\n \"Ignored a null or undefined entry in `items` or `children`. Check the arrays you pass in.\",\n );\n }\n continue;\n }\n if (byValue.has(node.value)) continue;\n byValue.set(node.value, node);\n parentOf.set(node.value, parent);\n depthOf.set(node.value, depth);\n all.push(node);\n push(parent ?? CASCADER_ROOT_KEY, node);\n if (node.children?.length) walk(node.children, node.value, depth + 1);\n }\n };\n walk(items, null, 0);\n }\n\n return {\n byValue,\n childrenOf,\n parentOf,\n depthOf,\n roots: childrenOf.get(CASCADER_ROOT_KEY) ?? [],\n all,\n };\n}\n\n/**\n * Folds loaded pages into an index built from `items`, so a re-render with a\n * new `items` array keeps what the user drilled into. Static `items` wins;\n * `detached` is `byValue` ONLY, or deep search doubles it and `childrenOf` lies.\n */\nexport function mergeCascaderIndex<T = unknown>(\n base: CascaderIndex<T>,\n pages: ReadonlyMap<string, readonly CascaderNode<T>[]>,\n detached?: ReadonlyMap<string, CascaderNode<T>>,\n): CascaderIndex<T> {\n // Identity stability: every downstream `useMemo` is keyed on this index.\n if (pages.size === 0 && !detached?.size) return base;\n\n const byValue = new Map(base.byValue);\n const childrenOf = new Map(base.childrenOf);\n const parentOf = new Map(base.parentOf);\n const depthOf = new Map(base.depthOf);\n\n // Copy-on-write per bucket: only levels that got a page pay for a new array.\n const copied = new Set<string>();\n const append = (parentKey: string, node: CascaderNode<T>) => {\n let bucket = childrenOf.get(parentKey);\n if (!copied.has(parentKey)) {\n bucket = bucket ? bucket.slice() : [];\n childrenOf.set(parentKey, bucket);\n copied.add(parentKey);\n }\n bucket!.push(node);\n };\n\n const insert = (parentKey: string, nodes: readonly CascaderNode<T>[]) => {\n for (const node of nodes) {\n if (byValue.has(node.value)) continue;\n byValue.set(node.value, node);\n parentOf.set(node.value, parentKey === CASCADER_ROOT_KEY ? null : parentKey);\n append(parentKey, node);\n if (node.children?.length) insert(node.value, node.children);\n }\n };\n\n for (const [parentKey, nodes] of pages) insert(parentKey, nodes);\n\n for (const value of byValue.keys()) {\n if (depthOf.has(value)) continue;\n let depth = 0;\n let cursor = parentOf.get(value) ?? null;\n const seen = new Set<string>([value]);\n while (cursor != null && !seen.has(cursor)) {\n seen.add(cursor);\n depth += 1;\n cursor = parentOf.get(cursor) ?? null;\n }\n depthOf.set(value, depth);\n }\n\n const roots = childrenOf.get(CASCADER_ROOT_KEY) ?? [];\n\n // Depth first over the MERGED tree, so `all` keeps document order.\n const all: CascaderNode<T>[] = [];\n const visited = new Set<string>();\n const walk = (nodes: readonly CascaderNode<T>[]) => {\n for (const node of nodes) {\n if (visited.has(node.value)) continue;\n visited.add(node.value);\n all.push(node);\n const children = childrenOf.get(node.value);\n if (children?.length) walk(children);\n }\n };\n walk(roots);\n\n // A page whose parent never arrived stays searchable rather than vanishing.\n for (const [value, node] of byValue) {\n if (visited.has(value)) continue;\n visited.add(value);\n all.push(node);\n }\n\n if (detached) {\n for (const [value, node] of detached) {\n if (byValue.has(value)) continue;\n byValue.set(value, node);\n }\n }\n\n return { byValue, childrenOf, parentOf, depthOf, roots, all };\n}\n\n/** Children of `parent`, or the root level when `parent` is nullish. */\nexport function getCascaderChildren<T>(\n index: CascaderIndex<T>,\n parent?: string | null,\n): CascaderNode<T>[] {\n return index.childrenOf.get(parent ?? CASCADER_ROOT_KEY) ?? [];\n}\n\n/** A branch has known children, or `hasChildren` for an unfetched level. */\nexport function isCascaderBranch<T>(index: CascaderIndex<T>, node: CascaderNode<T>): boolean {\n if (node.hasChildren) return true;\n return (index.childrenOf.get(node.value)?.length ?? 0) > 0;\n}\n\n/** Trailing count for the default row. Explicit `count` wins over the tree. */\nexport function getCascaderCount<T>(index: CascaderIndex<T>, node: CascaderNode<T>): number {\n if (typeof node.count === \"number\") return node.count;\n return index.childrenOf.get(node.value)?.length ?? 0;\n}\n\n/** Whether a node may be committed as a selection. */\nexport function isCascaderSelectable<T>(\n index: CascaderIndex<T>,\n node: CascaderNode<T>,\n selectable: CascaderSelectable<T>,\n): boolean {\n // Before the branches a consumer controls: `selectable=\"any\"` says yes to\n // every node, and committing the paging row would select a level's name.\n if (isCascaderMoreNode(node)) return false;\n if (node.disabled) return false;\n // A disabled ANCESTOR refuses the whole subtree: `searchCascaderDeep` still\n // surfaces children of a branch the UI will not let anyone open.\n {\n const seen = new Set<string>([node.value]);\n let cursor = index.parentOf.get(node.value) ?? null;\n while (cursor != null && !seen.has(cursor)) {\n seen.add(cursor);\n if (index.byValue.get(cursor)?.disabled) return false;\n cursor = index.parentOf.get(cursor) ?? null;\n }\n }\n if (typeof selectable === \"function\") return selectable(node);\n if (selectable === \"any\") return true;\n return !isCascaderBranch(index, node);\n}\n\n/** Ancestor chain for `value`, root first. Empty while async data loads. */\nexport function getCascaderPath<T>(\n index: CascaderIndex<T>,\n value: string | null | undefined,\n): CascaderNode<T>[] {\n if (value == null) return [];\n const chain: CascaderNode<T>[] = [];\n const seen = new Set<string>();\n let cursor: string | null | undefined = value;\n while (cursor != null && !seen.has(cursor)) {\n seen.add(cursor);\n const node = index.byValue.get(cursor);\n if (!node) break;\n chain.push(node);\n cursor = index.parentOf.get(cursor) ?? null;\n }\n return chain.reverse();\n}\n\n/**\n * `toLocaleLowerCase`, not `toLowerCase`: the invariant mapping turns Turkish\n * \"I\" into \"i\" not \"ı\", so \"ışık\" would never match \"IŞIK\". Both sides fold here.\n */\nexport function foldCascaderText(text: string): string {\n return text.toLocaleLowerCase();\n}\n\n/** Folds once so callers can hoist the cost out of a per-node loop. */\nexport function normalizeCascaderQuery(query: string): string {\n return foldCascaderText(query.trim());\n}\n\n/** Case-insensitive substring over label and keywords; pre-fold the query. */\nexport function matchesCascaderQuery<T>(node: CascaderNode<T>, normalized: string): boolean {\n if (!normalized) return true;\n // Coerced, not trusted: a label-less node is malformed data, not a crash.\n if (foldCascaderText(node.label ?? \"\").includes(normalized)) return true;\n if (node.keywords) {\n for (const keyword of node.keywords) {\n if (foldCascaderText(keyword).includes(normalized)) return true;\n }\n }\n return false;\n}\n\n/** Filters one level in place-order. Returns the input when the query is empty. */\nexport function filterCascaderLevel<T>(\n nodes: readonly CascaderNode<T>[],\n query: string,\n matches: (node: CascaderNode<T>, normalized: string) => boolean = matchesCascaderQuery,\n): CascaderNode<T>[] {\n const normalized = normalizeCascaderQuery(query);\n if (!normalized) return nodes as CascaderNode<T>[];\n return nodes.filter((node) => matches(node, normalized));\n}\n\n/** Searches every node, optionally under `within`, in one pass over `all`. */\nexport function searchCascaderDeep<T>(\n index: CascaderIndex<T>,\n query: string,\n options: {\n within?: string | null;\n limit?: number;\n matches?: (node: CascaderNode<T>, normalized: string) => boolean;\n } = {},\n): CascaderNode<T>[] {\n const normalized = normalizeCascaderQuery(query);\n if (!normalized) return [];\n\n const { within, limit = 200, matches = matchesCascaderQuery } = options;\n const results: CascaderNode<T>[] = [];\n\n // One memoised ancestry map per query. The provisional `false` written on the\n // way up doubles as the cycle guard; the trail is promoted once `within` hits.\n const ancestry = within == null ? null : new Map<string, boolean>();\n const isWithin = (node: CascaderNode<T>) => {\n if (within == null || !ancestry) return true;\n const trail: string[] = [];\n let answer = false;\n let cursor: string | null | undefined = index.parentOf.get(node.value);\n while (cursor != null) {\n if (cursor === within) {\n answer = true;\n break;\n }\n const cached = ancestry.get(cursor);\n if (cached !== undefined) {\n answer = cached;\n break;\n }\n ancestry.set(cursor, false);\n trail.push(cursor);\n cursor = index.parentOf.get(cursor) ?? null;\n }\n if (answer) for (const value of trail) ancestry.set(value, true);\n return answer;\n };\n\n for (const node of index.all) {\n if (results.length >= limit) break;\n if (!matches(node, normalized)) continue;\n if (!isWithin(node)) continue;\n results.push(node);\n }\n\n return results;\n}\n\n/**\n * Flattens the tree into tree mode's visible rows. A `sentinels` paging row\n * COUNTS as a sibling in `aria-setsize`: it holds an index of its own.\n */\nexport function flattenCascaderTree<T>(\n index: CascaderIndex<T>,\n expanded: ReadonlySet<string>,\n sentinels?: ReadonlySet<string>,\n): CascaderFlatNode<T>[] {\n const rows: CascaderFlatNode<T>[] = [];\n\n const walk = (nodes: readonly CascaderNode<T>[], parentKey: string, depth: number) => {\n const sentinel = sentinels?.has(parentKey) ?? false;\n const setSize = nodes.length + (sentinel ? 1 : 0);\n for (let i = 0; i < nodes.length; i += 1) {\n const node = nodes[i];\n const branch = isCascaderBranch(index, node);\n const isExpanded = branch && expanded.has(node.value);\n rows.push({\n node,\n depth,\n branch,\n expanded: isExpanded,\n setSize,\n posInSet: i + 1,\n });\n if (isExpanded) {\n walk(index.childrenOf.get(node.value) ?? [], node.value, depth + 1);\n }\n }\n if (sentinel) {\n rows.push({\n node: createCascaderMoreNode<T>(parentKey, nodes.length),\n depth,\n branch: false,\n expanded: false,\n setSize,\n posInSet: setSize,\n });\n }\n };\n\n walk(index.roots, CASCADER_ROOT_KEY, 0);\n return rows;\n}\n\n/** Shortens a path; the ellipsis segment still carries the hidden nodes. */\nexport function collapseCascaderPath<T>(\n path: readonly CascaderNode<T>[],\n options: { maxSegments?: number; collapse?: CascaderCollapse } = {},\n): CascaderPathSegment<T>[] {\n const { maxSegments = 3, collapse = \"middle\" } = options;\n\n const asNodes = (nodes: readonly CascaderNode<T>[]): CascaderPathSegment<T>[] =>\n nodes.map((node) => ({ type: \"node\" as const, node }));\n\n if (collapse === \"none\" || maxSegments <= 0 || path.length <= maxSegments) {\n return asNodes(path);\n }\n\n if (collapse === \"start\") {\n const tail = path.slice(path.length - maxSegments);\n return [\n { type: \"ellipsis\", hidden: path.slice(0, path.length - maxSegments) },\n ...asNodes(tail),\n ];\n }\n\n // \"middle\": keep the root for orientation and as much of the tail as fits.\n const head = path.slice(0, 1);\n const tailCount = maxSegments - 1;\n const tail = path.slice(path.length - tailCount);\n const hidden = path.slice(1, path.length - tailCount);\n\n if (hidden.length === 0) return asNodes(path);\n\n return [...asNodes(head), { type: \"ellipsis\", hidden }, ...asNodes(tail)];\n}\n\n/* -------------------------------------------------------------------------- */\n/* Cascade selection */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Every LOADED node under `value`, root first. Reaching an unfetched descendant\n * would mean a network request per level of the subtree on every selection.\n */\nexport function collectCascaderSubtree<T>(\n index: CascaderIndex<T>,\n value: string,\n): CascaderNode<T>[] {\n const root = index.byValue.get(value);\n if (!root) return [];\n\n const out: CascaderNode<T>[] = [];\n const seen = new Set<string>();\n const walk = (node: CascaderNode<T>) => {\n if (seen.has(node.value)) return;\n seen.add(node.value);\n out.push(node);\n const children = index.childrenOf.get(node.value);\n if (children) for (const child of children) walk(child);\n };\n walk(root);\n return out;\n}\n\n/**\n * Toggles `value` with its loaded subtree, then reconciles ancestors. One flat\n * array, no hidden \"checked\" state: a branch is in the selection exactly when\n * every selectable loaded child of it is, which keeps a row's checked state an\n * O(1) lookup. Nodes `isSelectable` rejects are skipped down AND ignored up,\n * the pressed node excepted.\n */\nexport function applyCascadeSelection<T>(\n index: CascaderIndex<T>,\n selected: readonly string[],\n value: string,\n select: boolean,\n isSelectable: (node: CascaderNode<T>) => boolean = () => true,\n): string[] {\n const next = new Set(selected);\n const subtree = collectCascaderSubtree(index, value);\n\n // An unknown value still toggles itself, so an early async selection lands.\n if (subtree.length === 0) {\n if (select) next.add(value);\n else next.delete(value);\n }\n\n for (const node of subtree) {\n // The pressed node is exempt: it was committed, so it is selectable.\n if (node.value !== value && !isSelectable(node)) continue;\n if (select) next.add(node.value);\n else next.delete(node.value);\n }\n\n // Bottom up: a parent can only answer once its children have.\n const seen = new Set<string>([value]);\n let cursor = index.parentOf.get(value) ?? null;\n while (cursor != null && !seen.has(cursor)) {\n seen.add(cursor);\n const parent = index.byValue.get(cursor);\n const children = index.childrenOf.get(cursor) ?? [];\n const selectable = children.filter((child) => isSelectable(child));\n const full =\n selectable.length > 0 &&\n selectable.every((child) => next.has(child.value)) &&\n // Never promote a node the consumer said may not be committed. Under\n // `selectable=\"leaf\"` no branch qualifies, hence the `cascade` warning.\n !!parent &&\n isSelectable(parent);\n if (full) next.add(cursor);\n else next.delete(cursor);\n cursor = index.parentOf.get(cursor) ?? null;\n }\n\n return Array.from(next);\n}\n\n/**\n * How many selected nodes each value has BELOW it, itself excluded. Walks UP\n * from each selection: a per-row subtree scan would be quadratic and re-paid.\n */\nexport function getCascaderSelectedDescendants<T>(\n index: CascaderIndex<T>,\n selected: readonly string[],\n): Map<string, number> {\n const counts = new Map<string, number>();\n\n for (const value of selected) {\n const seen = new Set<string>([value]);\n let cursor = index.parentOf.get(value) ?? null;\n while (cursor != null && !seen.has(cursor)) {\n seen.add(cursor);\n counts.set(cursor, (counts.get(cursor) ?? 0) + 1);\n cursor = index.parentOf.get(cursor) ?? null;\n }\n }\n\n return counts;\n}\n\n/** The PARTIALLY selected values, read off counts the caller already holds. */\nexport function getCascaderIndeterminateFrom(\n counts: ReadonlyMap<string, number>,\n selected: readonly string[],\n): Set<string> {\n const selectedSet = new Set(selected);\n const partial = new Set<string>();\n\n for (const [value, count] of counts) {\n if (count > 0 && !selectedSet.has(value)) partial.add(value);\n }\n\n return partial;\n}\n\n/** The one-call form; the root uses the two halves above and its own counts. */\nexport function getCascaderIndeterminate<T>(\n index: CascaderIndex<T>,\n selected: readonly string[],\n): Set<string> {\n return getCascaderIndeterminateFrom(getCascaderSelectedDescendants(index, selected), selected);\n}\n\n/** How `getCascaderCheckedValues` condenses a full-closure selection. */\nexport type CascaderCheckedStrategy = \"all\" | \"parent\" | \"child\";\n\n/**\n * The cascade selection under a reporting strategy. DERIVED OUTPUT ONLY: the\n * STORED value stays the full closure, which keeps a checked state an O(1)\n * lookup. `\"all\"` is the closure; `\"parent\"` drops a value whose parent is\n * selected; `\"child\"` drops one with a selected child.\n */\nexport function getCascaderCheckedValues<T>(\n index: CascaderIndex<T>,\n selected: readonly string[],\n strategy: CascaderCheckedStrategy,\n): readonly string[] {\n if (strategy === \"all\") return selected;\n\n const set = new Set(selected);\n if (strategy === \"parent\") {\n return selected.filter((value) => {\n const parent = index.parentOf.get(value);\n return parent == null || !set.has(parent);\n });\n }\n\n return selected.filter((value) => {\n const children = index.childrenOf.get(value);\n if (!children?.length) return true;\n return !children.some((child) => set.has(child.value));\n });\n}\n\n/** Values in `nodes` whose label collides, so the chip must show its path. */\nexport function findAmbiguousCascaderLabels<T>(nodes: readonly CascaderNode<T>[]): Set<string> {\n const firstByLabel = new Map<string, string>();\n const ambiguous = new Set<string>();\n\n for (const node of nodes) {\n const first = firstByLabel.get(node.label);\n if (first === undefined) {\n firstByLabel.set(node.label, node.value);\n continue;\n }\n ambiguous.add(node.value);\n ambiguous.add(first);\n }\n\n return ambiguous;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Development only */\n/* -------------------------------------------------------------------------- */\n\n/** Warnings already emitted. Module scoped, or they repeat once per render. */\nconst CASCADER_WARNED = new Set<string>();\n\n/** Warns once per `key`, never in production, never by throwing. */\nexport function warnCascaderOnce(key: string, message: string): void {\n if (process.env.NODE_ENV === \"production\") return;\n if (CASCADER_WARNED.has(key)) return;\n CASCADER_WARNED.add(key);\n console.warn(`[Cascader] ${message}`);\n}\n\n/** Empties the ledger. Tests only; a warning is meant to be seen once. */\nexport function resetCascaderWarnings(): void {\n CASCADER_WARNED.clear();\n}\n\n/** What a dev-time scan of the consumer's `items` found wrong with it. */\nexport interface CascaderDataIssues {\n /** Values appearing more than once. First wins, so a duplicate drops a row. */\n duplicates: string[];\n /** Values on a `getParent` cycle. Depth is clamped, so the tree reads wrong. */\n cycles: string[];\n}\n\n/** Dev-time scan, kept out of `buildCascaderIndex` so the build stays hot. */\nexport function findCascaderDataIssues<T>(\n items: readonly CascaderNode<T>[] | undefined,\n getParent?: (node: CascaderNode<T>) => string | null | undefined,\n): CascaderDataIssues {\n const seen = new Set<string>();\n const duplicates = new Set<string>();\n const flat: CascaderNode<T>[] = [];\n\n const visit = (nodes: readonly CascaderNode<T>[] | undefined) => {\n for (const node of nodes ?? []) {\n // The build skips a nullish entry, and this runs BEFORE its warning.\n if (node == null) continue;\n if (seen.has(node.value)) duplicates.add(node.value);\n else seen.add(node.value);\n flat.push(node);\n // Flat mode walks them too: BOTH `children` and `getParent` is a bug.\n if (node.children?.length) visit(node.children);\n }\n };\n visit(items);\n\n const cycles: string[] = [];\n if (getParent) {\n const parentOf = new Map<string, string | null>();\n for (const node of flat) {\n if (parentOf.has(node.value)) continue;\n const raw = getParent(node);\n parentOf.set(node.value, raw != null && seen.has(raw) ? raw : null);\n }\n for (const node of flat) {\n const walked = new Set<string>([node.value]);\n let cursor = parentOf.get(node.value) ?? null;\n while (cursor != null) {\n if (walked.has(cursor)) {\n cycles.push(node.value);\n break;\n }\n walked.add(cursor);\n cursor = parentOf.get(cursor) ?? null;\n }\n }\n }\n\n return { duplicates: Array.from(duplicates), cycles };\n}\n"],"mappings":";;;AAYA,MAAa,oBAAoB;;;;;AAMjC,MAAa,uBAAuB;;;;;;;;;;;AAiBpC,MAAa,6BACX;;;;;;AAOF,MAAa,0BAA0B;;AAGvC,MAAa,wBACX;;AAGF,MAAa,sBAAsB;;;;;;AAWnC,MAAM,6BACJ;;AAGF,MAAM,6BAA6B;;AAGnC,MAAM,+BAA+B;;AAGrC,SAAS,oBAAoB,OAAmC;CAE9D,OADc,MAAM,KAAK,MAAM,iBAA8B,0BAA0B,CAC5E,CAAC,CAAC,QACV,SAEC,KAAK,aAAa,UAAU,MAAM,QAClC,CAAC,KAAK,QAAQ,0BAA0B,KACxC,CAAC,KAAK,QAAQ,4BAA4B,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O;AACtD"}
|
|
1
|
+
{"version":3,"file":"cascader-lib.js","names":[],"sources":["../../../../src/components/reui/cascader/cascader-lib.tsx"],"sourcesContent":["\"use client\";\n\nimport type {\n CascaderCollapse,\n CascaderFlatNode,\n CascaderIndex,\n CascaderNode,\n CascaderPathSegment,\n CascaderSelectable,\n} from \"./cascader-types\";\n\n/** Root level key in `childrenOf`. NUL-prefixed so no real value collides. */\nexport const CASCADER_ROOT_KEY = \"\\u0000root\";\n\n/**\n * Paging pseudo-node prefix. Written as an escape sequence, not a raw 0x00\n * byte: a literal NUL makes this module read as binary and `grep -I` skips it.\n */\nexport const CASCADER_MORE_PREFIX = \"\\u0000more:\";\n\n/* -------------------------------------------------------------------------- */\n/* Scroll layout */\n/* -------------------------------------------------------------------------- */\n\n/**\n * The four scroll classes. In the lib because `cascader-columns.tsx` needs them\n * too and must not import `cascader.tsx`. Shell > bound > scrollport > rows.\n */\n\n/**\n * The bound. `min()` over an undefined custom property is an INVALID\n * declaration that drops the whole max-height, hence the `100vh` fallback: an\n * inline panel has no positioner, so no `--available-height`. `24rem` is the\n * default cap, so the common case sets no variable at all.\n */\nexport const CASCADER_LIST_HEIGHT_CLASS =\n \"max-h-[min(var(--available-height,100vh),var(--cascader-max-height,24rem))]\";\n\n/**\n * Each style's list padding: rows take it as `padding`, the scrollport as\n * `scroll-padding` floored at 4px so lyra's `0` does not strand a row.\n * Mirrored per style from `registry/styles/style-*.css`; keep them in step.\n */\nexport const CASCADER_LIST_PAD_CLASS = \"[--cascader-list-pad:4px]\";\n\n/** The scrollport: a `max-h-*` on the ScrollArea ROOT bounds nothing. */\nexport const CASCADER_SCROLL_CLASS =\n \"size-full min-h-0 **:data-[slot=scroll-area-viewport]:h-full **:data-[slot=scroll-area-viewport]:overscroll-contain **:data-[slot=scroll-area-viewport]:scroll-py-[max(var(--cascader-list-pad,4px),4px)]\";\n\n/** The rows' box; `data-empty:p-0` keeps an empty state from double inset. */\nexport const CASCADER_ROWS_CLASS = \"p-(--cascader-list-pad,4px) data-empty:p-0\";\n\n/* -------------------------------------------------------------------------- */\n/* Tab order */\n/* -------------------------------------------------------------------------- */\n\n/**\n * What counts as a keyboard stop. Base UI's ScrollArea viewport makes ITSELF\n * tabbable when content overflows (`hiddenState.x && hiddenState.y ? -1 : 0`),\n * an unnamed stop per level that `ui/scroll-area.tsx` will not let us suppress.\n */\nconst CASCADER_TAB_STOP_SELECTOR =\n 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])';\n\n/** The stop to step over: nothing here focuses the scrollport on purpose. */\nconst CASCADER_TAB_SKIP_SELECTOR = '[data-slot=\"scroll-area-viewport\"]';\n\n/** Out of the tab order whatever they contain; layout is never consulted. */\nconst CASCADER_TAB_HIDDEN_SELECTOR = \"[hidden],[inert],[aria-hidden='true']\";\n\n/** The panel's real keyboard stops, in DOM order. */\nfunction getCascaderTabStops(panel: HTMLElement): HTMLElement[] {\n const stops = Array.from(panel.querySelectorAll<HTMLElement>(CASCADER_TAB_STOP_SELECTOR));\n return stops.filter(\n (stop) =>\n // Option and trail rows are real `<button>`s with `tabindex=\"-1\"`.\n stop.getAttribute(\"tabindex\") !== \"-1\" &&\n !stop.matches(CASCADER_TAB_SKIP_SELECTOR) &&\n !stop.closest(CASCADER_TAB_HIDDEN_SELECTOR),\n );\n}\n\n/** The footer's own stops; an `aria-disabled` command still counts as one. */\nexport function getCascaderFooterStops(scope: HTMLElement): HTMLElement[] {\n const footer = scope.matches('[data-slot=\"cascader-footer\"]')\n ? scope\n : scope.querySelector<HTMLElement>('[data-slot=\"cascader-footer\"]');\n if (!footer) return [];\n return getCascaderTabStops(footer);\n}\n\n/** Where Tab lands, or `null` to let the browser out: focus is never trapped. */\nexport function getCascaderTabTarget(\n panel: HTMLElement,\n from: Element | null,\n backwards: boolean,\n): HTMLElement | null {\n const stops = getCascaderTabStops(panel);\n if (stops.length === 0 || !from) return null;\n\n const index = stops.indexOf(from as HTMLElement);\n if (index !== -1) return stops[index + (backwards ? -1 : 1)] ?? null;\n\n if (backwards) {\n for (let i = stops.length - 1; i >= 0; i -= 1) {\n const position = from.compareDocumentPosition(stops[i]);\n if (position & Node.DOCUMENT_POSITION_PRECEDING) return stops[i];\n }\n return null;\n }\n\n for (const stop of stops) {\n const position = from.compareDocumentPosition(stop);\n if (position & Node.DOCUMENT_POSITION_FOLLOWING) return stop;\n }\n return null;\n}\n\n/**\n * The writing direction at `element`. `DirectionProvider` may only vote yes:\n * unmounted it answers `\"ltr\"`, which would override a real `<html dir=\"rtl\">`.\n */\nexport function isCascaderRtl(element: Element, provided: string): boolean {\n if (provided === \"rtl\") return true;\n const explicit = element.closest(\"[dir]\")?.getAttribute(\"dir\")?.toLowerCase();\n if (explicit === \"rtl\") return true;\n if (explicit === \"ltr\") return false;\n return element.ownerDocument?.defaultView?.getComputedStyle(element).direction === \"rtl\";\n}\n\n/**\n * The paging row as a REAL node, not a DOM-only row after the list: every index\n * Base UI hands out indexes the RENDERED array, so a DOM-only row shifts them.\n */\nexport function createCascaderMoreNode<T = unknown>(\n parentKey: string,\n loadedCount = 0,\n): CascaderNode<T> {\n return {\n value: `${CASCADER_MORE_PREFIX}${parentKey}`,\n // Empty on purpose: a typeahead letter must never reach the paging row.\n label: \"\",\n // Feeds the row's \"Loading more...\" wording, with no second prop to thread.\n count: loadedCount,\n };\n}\n\nexport function isCascaderMoreNode<T>(node: CascaderNode<T>): boolean {\n return node.value.startsWith(CASCADER_MORE_PREFIX);\n}\n\n/** The level key a paging pseudo-node belongs to, or `null` for a real node. */\nexport function getCascaderMoreParent<T>(node: CascaderNode<T>): string | null {\n if (!isCascaderMoreNode(node)) return null;\n return node.value.slice(CASCADER_MORE_PREFIX.length);\n}\n\n/** Either input shape into one index. Cycle-guarded depths; first wins. */\nexport function buildCascaderIndex<T = unknown>(\n items: readonly CascaderNode<T>[] | undefined,\n getParent?: (node: CascaderNode<T>) => string | null | undefined,\n): CascaderIndex<T> {\n const byValue = new Map<string, CascaderNode<T>>();\n const childrenOf = new Map<string, CascaderNode<T>[]>();\n const parentOf = new Map<string, string | null>();\n const depthOf = new Map<string, number>();\n const all: CascaderNode<T>[] = [];\n\n const push = (parentKey: string, node: CascaderNode<T>) => {\n const bucket = childrenOf.get(parentKey);\n if (bucket) {\n bucket.push(node);\n } else {\n childrenOf.set(parentKey, [node]);\n }\n };\n\n if (getParent) {\n for (const node of items ?? []) {\n // A nullish entry is a data bug: skip it like a duplicate, say so in dev.\n if (node == null) {\n if (process.env.NODE_ENV !== \"production\") {\n warnCascaderOnce(\n \"nullish-entry\",\n \"Ignored a null or undefined entry in `items` or `children`. Check the arrays you pass in.\",\n );\n }\n continue;\n }\n if (byValue.has(node.value)) continue;\n byValue.set(node.value, node);\n all.push(node);\n }\n\n for (const node of all) {\n const rawParent = getParent(node);\n // An unknown parent makes the node a root rather than dropping the row.\n const parent = rawParent != null && byValue.has(rawParent) ? rawParent : null;\n parentOf.set(node.value, parent);\n push(parent ?? CASCADER_ROOT_KEY, node);\n }\n\n for (const node of all) {\n let depth = 0;\n let cursor = parentOf.get(node.value) ?? null;\n const seen = new Set<string>([node.value]);\n while (cursor != null && !seen.has(cursor)) {\n seen.add(cursor);\n depth += 1;\n cursor = parentOf.get(cursor) ?? null;\n }\n depthOf.set(node.value, depth);\n }\n } else {\n const walk = (\n nodes: readonly CascaderNode<T>[] | undefined,\n parent: string | null,\n depth: number,\n ) => {\n for (const node of nodes ?? []) {\n // Same degradation as the flat path above.\n if (node == null) {\n if (process.env.NODE_ENV !== \"production\") {\n warnCascaderOnce(\n \"nullish-entry\",\n \"Ignored a null or undefined entry in `items` or `children`. Check the arrays you pass in.\",\n );\n }\n continue;\n }\n if (byValue.has(node.value)) continue;\n byValue.set(node.value, node);\n parentOf.set(node.value, parent);\n depthOf.set(node.value, depth);\n all.push(node);\n push(parent ?? CASCADER_ROOT_KEY, node);\n if (node.children?.length) walk(node.children, node.value, depth + 1);\n }\n };\n walk(items, null, 0);\n }\n\n return {\n byValue,\n childrenOf,\n parentOf,\n depthOf,\n roots: childrenOf.get(CASCADER_ROOT_KEY) ?? [],\n all,\n };\n}\n\n/**\n * Folds loaded pages into an index built from `items`, so a re-render with a\n * new `items` array keeps what the user drilled into. Static `items` wins;\n * `detached` is `byValue` ONLY, or deep search doubles it and `childrenOf` lies.\n */\nexport function mergeCascaderIndex<T = unknown>(\n base: CascaderIndex<T>,\n pages: ReadonlyMap<string, readonly CascaderNode<T>[]>,\n detached?: ReadonlyMap<string, CascaderNode<T>>,\n): CascaderIndex<T> {\n // Identity stability: every downstream `useMemo` is keyed on this index.\n if (pages.size === 0 && !detached?.size) return base;\n\n const byValue = new Map(base.byValue);\n const childrenOf = new Map(base.childrenOf);\n const parentOf = new Map(base.parentOf);\n const depthOf = new Map(base.depthOf);\n\n // Copy-on-write per bucket: only levels that got a page pay for a new array.\n const copied = new Set<string>();\n const append = (parentKey: string, node: CascaderNode<T>) => {\n let bucket = childrenOf.get(parentKey);\n if (!copied.has(parentKey)) {\n bucket = bucket ? bucket.slice() : [];\n childrenOf.set(parentKey, bucket);\n copied.add(parentKey);\n }\n bucket!.push(node);\n };\n\n const insert = (parentKey: string, nodes: readonly CascaderNode<T>[]) => {\n for (const node of nodes) {\n if (byValue.has(node.value)) continue;\n byValue.set(node.value, node);\n parentOf.set(node.value, parentKey === CASCADER_ROOT_KEY ? null : parentKey);\n append(parentKey, node);\n if (node.children?.length) insert(node.value, node.children);\n }\n };\n\n for (const [parentKey, nodes] of pages) insert(parentKey, nodes);\n\n for (const value of byValue.keys()) {\n if (depthOf.has(value)) continue;\n let depth = 0;\n let cursor = parentOf.get(value) ?? null;\n const seen = new Set<string>([value]);\n while (cursor != null && !seen.has(cursor)) {\n seen.add(cursor);\n depth += 1;\n cursor = parentOf.get(cursor) ?? null;\n }\n depthOf.set(value, depth);\n }\n\n const roots = childrenOf.get(CASCADER_ROOT_KEY) ?? [];\n\n // Depth first over the MERGED tree, so `all` keeps document order.\n const all: CascaderNode<T>[] = [];\n const visited = new Set<string>();\n const walk = (nodes: readonly CascaderNode<T>[]) => {\n for (const node of nodes) {\n if (visited.has(node.value)) continue;\n visited.add(node.value);\n all.push(node);\n const children = childrenOf.get(node.value);\n if (children?.length) walk(children);\n }\n };\n walk(roots);\n\n // A page whose parent never arrived stays searchable rather than vanishing.\n for (const [value, node] of byValue) {\n if (visited.has(value)) continue;\n visited.add(value);\n all.push(node);\n }\n\n if (detached) {\n for (const [value, node] of detached) {\n if (byValue.has(value)) continue;\n byValue.set(value, node);\n }\n }\n\n return { byValue, childrenOf, parentOf, depthOf, roots, all };\n}\n\n/** Children of `parent`, or the root level when `parent` is nullish. */\nexport function getCascaderChildren<T>(\n index: CascaderIndex<T>,\n parent?: string | null,\n): CascaderNode<T>[] {\n return index.childrenOf.get(parent ?? CASCADER_ROOT_KEY) ?? [];\n}\n\n/** A branch has known children, or `hasChildren` for an unfetched level. */\nexport function isCascaderBranch<T>(index: CascaderIndex<T>, node: CascaderNode<T>): boolean {\n if (node.hasChildren) return true;\n return (index.childrenOf.get(node.value)?.length ?? 0) > 0;\n}\n\n/** Trailing count for the default row. Explicit `count` wins over the tree. */\nexport function getCascaderCount<T>(index: CascaderIndex<T>, node: CascaderNode<T>): number {\n if (typeof node.count === \"number\") return node.count;\n return index.childrenOf.get(node.value)?.length ?? 0;\n}\n\n/**\n * Whether a node is disabled: its own flag, or any ancestor's, since a disabled\n * branch keeps its whole subtree shut. The index's copy counts as its own, so a\n * server hit that omits the flag `items` sets is still caught. Ancestry is\n * `parentOf`: a detached hit the index has never placed answers for itself.\n */\nexport function isCascaderDisabled<T>(index: CascaderIndex<T>, node: CascaderNode<T>): boolean {\n if (node.disabled || index.byValue.get(node.value)?.disabled) return true;\n const seen = new Set<string>([node.value]);\n let cursor = index.parentOf.get(node.value) ?? null;\n while (cursor != null && !seen.has(cursor)) {\n seen.add(cursor);\n if (index.byValue.get(cursor)?.disabled) return true;\n cursor = index.parentOf.get(cursor) ?? null;\n }\n return false;\n}\n\n/** Whether a node may be committed as a selection. */\nexport function isCascaderSelectable<T>(\n index: CascaderIndex<T>,\n node: CascaderNode<T>,\n selectable: CascaderSelectable<T>,\n): boolean {\n // Before the branches a consumer controls: `selectable=\"any\"` says yes to\n // every node, and committing the paging row would select a level's name.\n if (isCascaderMoreNode(node)) return false;\n // Rows render this answer and their presses, keys, `commit`, `navigate` and\n // `navigateAt` check it, so a search lists a disabled subtree none of them\n // opens. The raw setters (`pushLevel`, `setPath`, `toggleExpanded`,\n // `setSelection`) do not ask.\n if (isCascaderDisabled(index, node)) return false;\n if (typeof selectable === \"function\") return selectable(node);\n if (selectable === \"any\") return true;\n return !isCascaderBranch(index, node);\n}\n\n/** Ancestor chain for `value`, root first. Empty while async data loads. */\nexport function getCascaderPath<T>(\n index: CascaderIndex<T>,\n value: string | null | undefined,\n): CascaderNode<T>[] {\n if (value == null) return [];\n const chain: CascaderNode<T>[] = [];\n const seen = new Set<string>();\n let cursor: string | null | undefined = value;\n while (cursor != null && !seen.has(cursor)) {\n seen.add(cursor);\n const node = index.byValue.get(cursor);\n if (!node) break;\n chain.push(node);\n cursor = index.parentOf.get(cursor) ?? null;\n }\n return chain.reverse();\n}\n\n/**\n * `toLocaleLowerCase`, not `toLowerCase`: the invariant mapping turns Turkish\n * \"I\" into \"i\" not \"ı\", so \"ışık\" would never match \"IŞIK\". Both sides fold here.\n */\nexport function foldCascaderText(text: string): string {\n return text.toLocaleLowerCase();\n}\n\n/** Folds once so callers can hoist the cost out of a per-node loop. */\nexport function normalizeCascaderQuery(query: string): string {\n return foldCascaderText(query.trim());\n}\n\n/** Case-insensitive substring over label and keywords; pre-fold the query. */\nexport function matchesCascaderQuery<T>(node: CascaderNode<T>, normalized: string): boolean {\n if (!normalized) return true;\n // Coerced, not trusted: a label-less node is malformed data, not a crash.\n if (foldCascaderText(node.label ?? \"\").includes(normalized)) return true;\n if (node.keywords) {\n for (const keyword of node.keywords) {\n if (foldCascaderText(keyword).includes(normalized)) return true;\n }\n }\n return false;\n}\n\n/** Filters one level in place-order. Returns the input when the query is empty. */\nexport function filterCascaderLevel<T>(\n nodes: readonly CascaderNode<T>[],\n query: string,\n matches: (node: CascaderNode<T>, normalized: string) => boolean = matchesCascaderQuery,\n): CascaderNode<T>[] {\n const normalized = normalizeCascaderQuery(query);\n if (!normalized) return nodes as CascaderNode<T>[];\n return nodes.filter((node) => matches(node, normalized));\n}\n\n/** Searches every node, optionally under `within`, in one pass over `all`. */\nexport function searchCascaderDeep<T>(\n index: CascaderIndex<T>,\n query: string,\n options: {\n within?: string | null;\n limit?: number;\n matches?: (node: CascaderNode<T>, normalized: string) => boolean;\n } = {},\n): CascaderNode<T>[] {\n const normalized = normalizeCascaderQuery(query);\n if (!normalized) return [];\n\n const { within, limit = 200, matches = matchesCascaderQuery } = options;\n const results: CascaderNode<T>[] = [];\n\n // One memoised ancestry map per query. The provisional `false` written on the\n // way up doubles as the cycle guard; the trail is promoted once `within` hits.\n const ancestry = within == null ? null : new Map<string, boolean>();\n const isWithin = (node: CascaderNode<T>) => {\n if (within == null || !ancestry) return true;\n const trail: string[] = [];\n let answer = false;\n let cursor: string | null | undefined = index.parentOf.get(node.value);\n while (cursor != null) {\n if (cursor === within) {\n answer = true;\n break;\n }\n const cached = ancestry.get(cursor);\n if (cached !== undefined) {\n answer = cached;\n break;\n }\n ancestry.set(cursor, false);\n trail.push(cursor);\n cursor = index.parentOf.get(cursor) ?? null;\n }\n if (answer) for (const value of trail) ancestry.set(value, true);\n return answer;\n };\n\n for (const node of index.all) {\n if (results.length >= limit) break;\n if (!matches(node, normalized)) continue;\n if (!isWithin(node)) continue;\n results.push(node);\n }\n\n return results;\n}\n\n/**\n * Flattens the tree into tree mode's visible rows. A `sentinels` paging row\n * COUNTS as a sibling in `aria-setsize`: it holds an index of its own.\n */\nexport function flattenCascaderTree<T>(\n index: CascaderIndex<T>,\n expanded: ReadonlySet<string>,\n sentinels?: ReadonlySet<string>,\n): CascaderFlatNode<T>[] {\n const rows: CascaderFlatNode<T>[] = [];\n\n const walk = (nodes: readonly CascaderNode<T>[], parentKey: string, depth: number) => {\n const sentinel = sentinels?.has(parentKey) ?? false;\n const setSize = nodes.length + (sentinel ? 1 : 0);\n for (let i = 0; i < nodes.length; i += 1) {\n const node = nodes[i];\n const branch = isCascaderBranch(index, node);\n const isExpanded = branch && expanded.has(node.value);\n rows.push({\n node,\n depth,\n branch,\n expanded: isExpanded,\n setSize,\n posInSet: i + 1,\n });\n if (isExpanded) {\n walk(index.childrenOf.get(node.value) ?? [], node.value, depth + 1);\n }\n }\n if (sentinel) {\n rows.push({\n node: createCascaderMoreNode<T>(parentKey, nodes.length),\n depth,\n branch: false,\n expanded: false,\n setSize,\n posInSet: setSize,\n });\n }\n };\n\n walk(index.roots, CASCADER_ROOT_KEY, 0);\n return rows;\n}\n\n/** Shortens a path; the ellipsis segment still carries the hidden nodes. */\nexport function collapseCascaderPath<T>(\n path: readonly CascaderNode<T>[],\n options: { maxSegments?: number; collapse?: CascaderCollapse } = {},\n): CascaderPathSegment<T>[] {\n const { maxSegments = 3, collapse = \"middle\" } = options;\n\n const asNodes = (nodes: readonly CascaderNode<T>[]): CascaderPathSegment<T>[] =>\n nodes.map((node) => ({ type: \"node\" as const, node }));\n\n if (collapse === \"none\" || maxSegments <= 0 || path.length <= maxSegments) {\n return asNodes(path);\n }\n\n if (collapse === \"start\") {\n const tail = path.slice(path.length - maxSegments);\n return [\n { type: \"ellipsis\", hidden: path.slice(0, path.length - maxSegments) },\n ...asNodes(tail),\n ];\n }\n\n // \"middle\": keep the root for orientation and as much of the tail as fits.\n const head = path.slice(0, 1);\n const tailCount = maxSegments - 1;\n const tail = path.slice(path.length - tailCount);\n const hidden = path.slice(1, path.length - tailCount);\n\n if (hidden.length === 0) return asNodes(path);\n\n return [...asNodes(head), { type: \"ellipsis\", hidden }, ...asNodes(tail)];\n}\n\n/* -------------------------------------------------------------------------- */\n/* Cascade selection */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Every LOADED node under `value`, root first. Reaching an unfetched descendant\n * would mean a network request per level of the subtree on every selection.\n */\nexport function collectCascaderSubtree<T>(\n index: CascaderIndex<T>,\n value: string,\n): CascaderNode<T>[] {\n const root = index.byValue.get(value);\n if (!root) return [];\n\n const out: CascaderNode<T>[] = [];\n const seen = new Set<string>();\n const walk = (node: CascaderNode<T>) => {\n if (seen.has(node.value)) return;\n seen.add(node.value);\n out.push(node);\n const children = index.childrenOf.get(node.value);\n if (children) for (const child of children) walk(child);\n };\n walk(root);\n return out;\n}\n\n/**\n * Toggles `value` with its loaded subtree, then reconciles ancestors. One flat\n * array, no hidden \"checked\" state: a branch is in the selection exactly when\n * every selectable loaded child of it is, which keeps a row's checked state an\n * O(1) lookup. Nodes `isSelectable` rejects are skipped down AND ignored up,\n * the pressed node excepted.\n */\nexport function applyCascadeSelection<T>(\n index: CascaderIndex<T>,\n selected: readonly string[],\n value: string,\n select: boolean,\n isSelectable: (node: CascaderNode<T>) => boolean = () => true,\n): string[] {\n const next = new Set(selected);\n const subtree = collectCascaderSubtree(index, value);\n\n // An unknown value still toggles itself, so an early async selection lands.\n if (subtree.length === 0) {\n if (select) next.add(value);\n else next.delete(value);\n }\n\n for (const node of subtree) {\n // The pressed node is exempt: it was committed, so it is selectable.\n if (node.value !== value && !isSelectable(node)) continue;\n if (select) next.add(node.value);\n else next.delete(node.value);\n }\n\n // Bottom up: a parent can only answer once its children have.\n const seen = new Set<string>([value]);\n let cursor = index.parentOf.get(value) ?? null;\n while (cursor != null && !seen.has(cursor)) {\n seen.add(cursor);\n const parent = index.byValue.get(cursor);\n const children = index.childrenOf.get(cursor) ?? [];\n const selectable = children.filter((child) => isSelectable(child));\n const full =\n selectable.length > 0 &&\n selectable.every((child) => next.has(child.value)) &&\n // Never promote a node the consumer said may not be committed. Under\n // `selectable=\"leaf\"` no branch qualifies, hence the `cascade` warning.\n !!parent &&\n isSelectable(parent);\n if (full) next.add(cursor);\n else next.delete(cursor);\n cursor = index.parentOf.get(cursor) ?? null;\n }\n\n return Array.from(next);\n}\n\n/**\n * How many selected nodes each value has BELOW it, itself excluded. Walks UP\n * from each selection: a per-row subtree scan would be quadratic and re-paid.\n */\nexport function getCascaderSelectedDescendants<T>(\n index: CascaderIndex<T>,\n selected: readonly string[],\n): Map<string, number> {\n const counts = new Map<string, number>();\n\n for (const value of selected) {\n const seen = new Set<string>([value]);\n let cursor = index.parentOf.get(value) ?? null;\n while (cursor != null && !seen.has(cursor)) {\n seen.add(cursor);\n counts.set(cursor, (counts.get(cursor) ?? 0) + 1);\n cursor = index.parentOf.get(cursor) ?? null;\n }\n }\n\n return counts;\n}\n\n/** The PARTIALLY selected values, read off counts the caller already holds. */\nexport function getCascaderIndeterminateFrom(\n counts: ReadonlyMap<string, number>,\n selected: readonly string[],\n): Set<string> {\n const selectedSet = new Set(selected);\n const partial = new Set<string>();\n\n for (const [value, count] of counts) {\n if (count > 0 && !selectedSet.has(value)) partial.add(value);\n }\n\n return partial;\n}\n\n/** The one-call form; the root uses the two halves above and its own counts. */\nexport function getCascaderIndeterminate<T>(\n index: CascaderIndex<T>,\n selected: readonly string[],\n): Set<string> {\n return getCascaderIndeterminateFrom(getCascaderSelectedDescendants(index, selected), selected);\n}\n\n/** How `getCascaderCheckedValues` condenses a full-closure selection. */\nexport type CascaderCheckedStrategy = \"all\" | \"parent\" | \"child\";\n\n/**\n * The cascade selection under a reporting strategy. DERIVED OUTPUT ONLY: the\n * STORED value stays the full closure, which keeps a checked state an O(1)\n * lookup. `\"all\"` is the closure; `\"parent\"` drops a value whose parent is\n * selected; `\"child\"` drops one with a selected child.\n */\nexport function getCascaderCheckedValues<T>(\n index: CascaderIndex<T>,\n selected: readonly string[],\n strategy: CascaderCheckedStrategy,\n): readonly string[] {\n if (strategy === \"all\") return selected;\n\n const set = new Set(selected);\n if (strategy === \"parent\") {\n return selected.filter((value) => {\n const parent = index.parentOf.get(value);\n return parent == null || !set.has(parent);\n });\n }\n\n return selected.filter((value) => {\n const children = index.childrenOf.get(value);\n if (!children?.length) return true;\n return !children.some((child) => set.has(child.value));\n });\n}\n\n/** Values in `nodes` whose label collides, so the chip must show its path. */\nexport function findAmbiguousCascaderLabels<T>(nodes: readonly CascaderNode<T>[]): Set<string> {\n const firstByLabel = new Map<string, string>();\n const ambiguous = new Set<string>();\n\n for (const node of nodes) {\n const first = firstByLabel.get(node.label);\n if (first === undefined) {\n firstByLabel.set(node.label, node.value);\n continue;\n }\n ambiguous.add(node.value);\n ambiguous.add(first);\n }\n\n return ambiguous;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Development only */\n/* -------------------------------------------------------------------------- */\n\n/** Warnings already emitted. Module scoped, or they repeat once per render. */\nconst CASCADER_WARNED = new Set<string>();\n\n/** Warns once per `key`, never in production, never by throwing. */\nexport function warnCascaderOnce(key: string, message: string): void {\n if (process.env.NODE_ENV === \"production\") return;\n if (CASCADER_WARNED.has(key)) return;\n CASCADER_WARNED.add(key);\n console.warn(`[Cascader] ${message}`);\n}\n\n/** Empties the ledger. Tests only; a warning is meant to be seen once. */\nexport function resetCascaderWarnings(): void {\n CASCADER_WARNED.clear();\n}\n\n/** What a dev-time scan of the consumer's `items` found wrong with it. */\nexport interface CascaderDataIssues {\n /** Values appearing more than once. First wins, so a duplicate drops a row. */\n duplicates: string[];\n /** Values on a `getParent` cycle. Depth is clamped, so the tree reads wrong. */\n cycles: string[];\n}\n\n/** Dev-time scan, kept out of `buildCascaderIndex` so the build stays hot. */\nexport function findCascaderDataIssues<T>(\n items: readonly CascaderNode<T>[] | undefined,\n getParent?: (node: CascaderNode<T>) => string | null | undefined,\n): CascaderDataIssues {\n const seen = new Set<string>();\n const duplicates = new Set<string>();\n const flat: CascaderNode<T>[] = [];\n\n const visit = (nodes: readonly CascaderNode<T>[] | undefined) => {\n for (const node of nodes ?? []) {\n // The build skips a nullish entry, and this runs BEFORE its warning.\n if (node == null) continue;\n if (seen.has(node.value)) duplicates.add(node.value);\n else seen.add(node.value);\n flat.push(node);\n // Flat mode walks them too: BOTH `children` and `getParent` is a bug.\n if (node.children?.length) visit(node.children);\n }\n };\n visit(items);\n\n const cycles: string[] = [];\n if (getParent) {\n const parentOf = new Map<string, string | null>();\n for (const node of flat) {\n if (parentOf.has(node.value)) continue;\n const raw = getParent(node);\n parentOf.set(node.value, raw != null && seen.has(raw) ? raw : null);\n }\n for (const node of flat) {\n const walked = new Set<string>([node.value]);\n let cursor = parentOf.get(node.value) ?? null;\n while (cursor != null) {\n if (walked.has(cursor)) {\n cycles.push(node.value);\n break;\n }\n walked.add(cursor);\n cursor = parentOf.get(cursor) ?? null;\n }\n }\n }\n\n return { duplicates: Array.from(duplicates), cycles };\n}\n"],"mappings":";;;AAYA,MAAa,oBAAoB;;;;;AAMjC,MAAa,uBAAuB;;;;;;;;;;;AAiBpC,MAAa,6BACX;;;;;;AAOF,MAAa,0BAA0B;;AAGvC,MAAa,wBACX;;AAGF,MAAa,sBAAsB;;;;;;AAWnC,MAAM,6BACJ;;AAGF,MAAM,6BAA6B;;AAGnC,MAAM,+BAA+B;;AAGrC,SAAS,oBAAoB,OAAmC;CAE9D,OADc,MAAM,KAAK,MAAM,iBAA8B,0BAA0B,CAC5E,CAAC,CAAC,QACV,SAEC,KAAK,aAAa,UAAU,MAAM,QAClC,CAAC,KAAK,QAAQ,0BAA0B,KACxC,CAAC,KAAK,QAAQ,4BAA4B,CAC9C;AACF;;AAGA,SAAgB,uBAAuB,OAAmC;CACxE,MAAM,SAAS,MAAM,QAAQ,iCAA+B,IACxD,QACA,MAAM,cAA2B,iCAA+B;CACpE,IAAI,CAAC,QAAQ,OAAO,CAAC;CACrB,OAAO,oBAAoB,MAAM;AACnC;;AAGA,SAAgB,qBACd,OACA,MACA,WACoB;CACpB,MAAM,QAAQ,oBAAoB,KAAK;CACvC,IAAI,MAAM,WAAW,KAAK,CAAC,MAAM,OAAO;CAExC,MAAM,QAAQ,MAAM,QAAQ,IAAmB;CAC/C,IAAI,UAAU,IAAI,OAAO,MAAM,S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O,IAAI,IAAY;CAC7B,MAAM,6BAAa,IAAI,IAAY;CACnC,MAAM,OAA0B,CAAC;CAEjC,MAAM,SAAS,UAAkD;EAC/D,KAAK,MAAM,QAAQ,SAAS,CAAC,GAAG;GAE9B,IAAI,QAAQ,MAAM;GAClB,IAAI,KAAK,IAAI,KAAK,KAAK,GAAG,WAAW,IAAI,KAAK,KAAK;QAC9C,KAAK,IAAI,KAAK,KAAK;GACxB,KAAK,KAAK,IAAI;GAEd,IAAI,KAAK,UAAU,QAAQ,MAAM,KAAK,QAAQ;EAChD;CACF;CACA,MAAM,KAAK;CAEX,MAAM,SAAmB,CAAC;CAC1B,IAAI,WAAW;EACb,MAAM,2BAAW,IAAI,IAA2B;EAChD,KAAK,MAAM,QAAQ,MAAM;GACvB,IAAI,SAAS,IAAI,KAAK,KAAK,GAAG;GAC9B,MAAM,MAAM,UAAU,IAAI;GAC1B,SAAS,IAAI,KAAK,OAAO,OAAO,QAAQ,KAAK,IAAI,GAAG,IAAI,MAAM,IAAI;EACpE;EACA,KAAK,MAAM,QAAQ,MAAM;GACvB,MAAM,yBAAS,IAAI,IAAY,CAAC,KAAK,KAAK,CAAC;GAC3C,IAAI,SAAS,SAAS,IAAI,KAAK,KAAK,KAAK;GACzC,OAAO,UAAU,MAAM;IACrB,IAAI,OAAO,IAAI,MAAM,GAAG;KACtB,OAAO,KAAK,KAAK,KAAK;KACtB;IACF;IACA,OAAO,IAAI,MAAM;IACjB,SAAS,SAAS,IAAI,MAAM,KAAK;GACnC;EACF;CACF;CAEA,OAAO;EAAE,YAAY,MAAM,KAAK,UAAU;EAAG;CAAO;AACtD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as CascaderCollapse, p as CascaderNode, v as CascaderValueDisplay } from "../../../cascader-types-
|
|
1
|
+
import { i as CascaderCollapse, p as CascaderNode, v as CascaderValueDisplay } from "../../../cascader-types-DVT-znZ-.js";
|
|
2
2
|
import * as React$1 from "react";
|
|
3
3
|
import { useRender } from "@base-ui/react/use-render";
|
|
4
4
|
import { Combobox } from "@base-ui/react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cascader-nav.d.ts","names":["React","ComboboxPrimitive"],"sources":["../../../../src/components/reui/cascader/cascader-nav.tsx"],"mappings":";;;;;YAgCY,mBAAmB,UAAU;;;;;iBAMhC,cAAc,cAAc,SAAS,mBAAgBA,QAAA,+BAAAA,QAAA;iBAsB7C,0BAA0B,KAAK,UAAU;EACxD,WAAWA,QAAM;;;iBAIV,eAAe,WAAW,aAAa,SAAS,oBAAiBA,QAAA,+BAAAA,QAAA;iBAmCzD,gCAAgC,KAAK,UAAU;;EAE9D;EACA,WAAW;;EAEX;;;;;;;;iBASO,qBACP,WACA,aACA,UACA,gBACG,SACF,0BAAuBA,QAAA,+BAAAA,QAAA;iBAqFT,2BAA2BC,SAAkB,MAAM;;EAElE;;;;;;iBAUO,gBACP,WACA,UACA,aACA,+BACoB,oBACjB,SACF,qBAAkBD,QAAA,IAAA;
|
|
1
|
+
{"version":3,"file":"cascader-nav.d.ts","names":["React","ComboboxPrimitive"],"sources":["../../../../src/components/reui/cascader/cascader-nav.tsx"],"mappings":";;;;;YAgCY,mBAAmB,UAAU;;;;;iBAMhC,cAAc,cAAc,SAAS,mBAAgBA,QAAA,+BAAAA,QAAA;iBAsB7C,0BAA0B,KAAK,UAAU;EACxD,WAAWA,QAAM;;;iBAIV,eAAe,WAAW,aAAa,SAAS,oBAAiBA,QAAA,+BAAAA,QAAA;iBAmCzD,gCAAgC,KAAK,UAAU;;EAE9D;EACA,WAAW;;EAEX;;;;;;;;iBASO,qBACP,WACA,aACA,UACA,gBACG,SACF,0BAAuBA,QAAA,+BAAAA,QAAA;iBAqFT,2BAA2BC,SAAkB,MAAM;;EAElE;;;;;;iBAUO,gBACP,WACA,UACA,aACA,+BACoB,oBACjB,SACF,qBAAkBD,QAAA,IAAA;iBAwPJ,2BAA2B,KAAK,UAAU;;EAEzD,UAAU;EACV;EACA,WAAW;EACX,YAAYA,QAAM;;EAElB;EACA,cAAcA,QAAM;;EAEpB,YAAY,UAAU,gBAAgB,MAAM,mBAAmBA,QAAM;;;;;;iBAO9D,gBACP,WACA,SACA,aACA,UACA,WACA,UACA,aACA,aACG,SACF,qBAAkBA,QAAA,+BAAAA,QAAA"}
|
|
@@ -104,10 +104,10 @@ function CascaderBreadcrumb({ className, maxSegments = 3, collapse = "middle", i
|
|
|
104
104
|
* the refill from the committed selection that would fight every level swap.
|
|
105
105
|
*/
|
|
106
106
|
function CascaderInput({ className, showBack = true, placeholder, onKeyDown, "aria-describedby": ariaDescribedBy, ...props }) {
|
|
107
|
-
const { labels, popLevel, mode, getHighlighted, isBranch, navigate, index, toggleExpanded, inline, invalid, baseId } = useCascaderActions();
|
|
107
|
+
const { labels, popLevel, mode, getHighlighted, isBranch, isDisabled, navigate, index, toggleExpanded, inline, invalid, baseId, searchScope } = useCascaderActions();
|
|
108
108
|
const direction = useDirection();
|
|
109
|
-
const { currentParent, query, path, renderedItems, treeRows } = useCascaderState();
|
|
110
|
-
const resolvedPlaceholder = placeholder ?? resolveCascaderSearchLabel(labels, currentParent?.label);
|
|
109
|
+
const { currentParent, query, path, expanded, renderedItems, treeRows } = useCascaderState();
|
|
110
|
+
const resolvedPlaceholder = placeholder ?? resolveCascaderSearchLabel(labels, searchScope === "global" ? void 0 : currentParent?.label);
|
|
111
111
|
const backVisible = showBack && mode === "drill" && path.length > 0;
|
|
112
112
|
const hintId = `${baseId}-hint`;
|
|
113
113
|
const listId = `${baseId}-column-${mode === "columns" ? path.length : 0}`;
|
|
@@ -170,7 +170,8 @@ function CascaderInput({ className, showBack = true, placeholder, onKeyDown, "ar
|
|
|
170
170
|
if (child && child.depth === row.depth + 1) moveHighlightTo(field, rowIndex + 1);
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
|
-
|
|
173
|
+
const heldByQuery = isDisabled(row.node) && !expanded.has(row.node.value);
|
|
174
|
+
if (row.branch && row.expanded && !heldByQuery) {
|
|
174
175
|
event.preventDefault();
|
|
175
176
|
toggleExpanded(row.node.value);
|
|
176
177
|
return;
|