@kumix/ui 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -45
- package/dist/{cascader-types-DVT-znZ-.d.ts → cascader-types-zhnUQ4sP.d.ts} +11 -3
- package/dist/cascader-types-zhnUQ4sP.d.ts.map +1 -0
- package/dist/components/agents/agent-code.js +1 -1
- package/dist/components/agents/approval-card/index.d.ts +2 -0
- package/dist/components/agents/approval-card/index.d.ts.map +1 -1
- package/dist/components/agents/approval-card/index.js +2 -0
- package/dist/components/agents/approval-card/index.js.map +1 -1
- package/dist/components/agents/citations.d.ts +14 -2
- package/dist/components/agents/citations.d.ts.map +1 -1
- package/dist/components/agents/citations.js +11 -7
- package/dist/components/agents/citations.js.map +1 -1
- package/dist/components/agents/loading-states/reasoning-text.d.ts.map +1 -1
- package/dist/components/agents/loading-states/reasoning-text.js +3 -0
- package/dist/components/agents/loading-states/reasoning-text.js.map +1 -1
- package/dist/components/charts/bump-chart/context.js +1 -2
- package/dist/components/charts/bump-chart/plot.js +1 -2
- package/dist/components/charts/bump-chart/point.js +1 -1
- package/dist/components/charts/bump-chart/series.d.ts +1 -0
- package/dist/components/charts/candlestick-chart/context.d.ts +79 -0
- package/dist/components/charts/candlestick-chart/context.d.ts.map +1 -0
- package/dist/components/charts/candlestick-chart/context.js +69 -0
- package/dist/components/charts/candlestick-chart/context.js.map +1 -0
- package/dist/components/charts/candlestick-chart/legend.d.ts +12 -0
- package/dist/components/charts/candlestick-chart/legend.d.ts.map +1 -0
- package/dist/components/charts/candlestick-chart/legend.js +56 -0
- package/dist/components/charts/candlestick-chart/legend.js.map +1 -0
- package/dist/components/charts/candlestick-chart/plot.d.ts +9 -0
- package/dist/components/charts/candlestick-chart/plot.d.ts.map +1 -0
- package/dist/components/charts/candlestick-chart/plot.js +218 -0
- package/dist/components/charts/candlestick-chart/plot.js.map +1 -0
- package/dist/components/charts/candlestick-chart.d.ts +18 -0
- package/dist/components/charts/candlestick-chart.d.ts.map +1 -0
- package/dist/components/charts/candlestick-chart.js +34 -0
- package/dist/components/charts/candlestick-chart.js.map +1 -0
- package/dist/components/charts/composition-chart/context.js +1 -2
- package/dist/components/charts/composition-chart/plot.js +1 -1
- package/dist/components/charts/donut-chart/center.d.ts +16 -0
- package/dist/components/charts/donut-chart/center.d.ts.map +1 -0
- package/dist/components/charts/donut-chart/center.js +78 -0
- package/dist/components/charts/donut-chart/center.js.map +1 -0
- package/dist/components/charts/donut-chart/context.d.ts +68 -0
- package/dist/components/charts/donut-chart/context.d.ts.map +1 -0
- package/dist/components/charts/donut-chart/context.js +2 -0
- package/dist/components/charts/donut-chart/legend.d.ts +17 -0
- package/dist/components/charts/donut-chart/legend.d.ts.map +1 -0
- package/dist/components/charts/donut-chart/legend.js +85 -0
- package/dist/components/charts/donut-chart/legend.js.map +1 -0
- package/dist/components/charts/donut-chart/plot.d.ts +10 -0
- package/dist/components/charts/donut-chart/plot.d.ts.map +1 -0
- package/dist/components/charts/donut-chart/plot.js +108 -0
- package/dist/components/charts/donut-chart/plot.js.map +1 -0
- package/dist/components/charts/donut-chart.d.ts +22 -0
- package/dist/components/charts/donut-chart.d.ts.map +1 -0
- package/dist/components/charts/donut-chart.js +37 -0
- package/dist/components/charts/donut-chart.js.map +1 -0
- package/dist/components/charts/funnel-chart.d.ts.map +1 -1
- package/dist/components/charts/funnel-chart.js +1 -2
- package/dist/components/charts/funnel-chart.js.map +1 -1
- package/dist/components/charts/heat-calendar/tooltip.js +1 -1
- package/dist/components/charts/liquidity-heatmap.d.ts.map +1 -1
- package/dist/components/charts/liquidity-heatmap.js +1 -1
- package/dist/components/charts/order-book/depth-row.d.ts +8 -2
- package/dist/components/charts/order-book/depth-row.d.ts.map +1 -1
- package/dist/components/charts/order-book/depth-row.js +11 -3
- package/dist/components/charts/order-book/depth-row.js.map +1 -1
- package/dist/components/charts/order-book.d.ts +33 -1
- package/dist/components/charts/order-book.d.ts.map +1 -1
- package/dist/components/charts/order-book.js +92 -17
- package/dist/components/charts/order-book.js.map +1 -1
- package/dist/components/charts/price-target-fan/tooltip.js +1 -1
- package/dist/components/charts/returns-calendar/tooltip.js +1 -1
- package/dist/components/charts/status-bar/tooltip.js +1 -1
- package/dist/components/charts/treemap/tooltip.js +1 -1
- package/dist/components/charts/treemap.d.ts.map +1 -1
- package/dist/components/charts/volume-profile/tooltip.js +1 -1
- package/dist/components/charts/volume-profile.d.ts.map +1 -1
- package/dist/components/custom/confirm-dialog.d.ts +1 -0
- package/dist/components/custom/toast.d.ts +1 -0
- package/dist/components/motion/action-swap.d.ts +1 -1
- package/dist/components/motion/action-swap.d.ts.map +1 -1
- package/dist/components/motion/action-swap.js +46 -20
- package/dist/components/motion/action-swap.js.map +1 -1
- package/dist/components/motion/animated-badge.d.ts +1 -1
- package/dist/components/motion/animated-badge.d.ts.map +1 -1
- package/dist/components/motion/animated-badge.js +60 -101
- package/dist/components/motion/animated-badge.js.map +1 -1
- package/dist/components/motion/animated-sidebar.d.ts +1 -0
- package/dist/components/motion/animated-sidebar.js +1 -1
- package/dist/components/motion/animated-toast-stack.js +1 -1
- package/dist/components/motion/attachment-upload.d.ts.map +1 -1
- package/dist/components/motion/attachment-upload.js +2 -3
- package/dist/components/motion/attachment-upload.js.map +1 -1
- package/dist/components/motion/availability-scheduler/copy-menu.js +1 -2
- package/dist/components/motion/availability-scheduler/day-row.js +2 -2
- package/dist/components/motion/availability-scheduler/index.js +1 -1
- package/dist/components/motion/bloom-menu.d.ts +1 -0
- package/dist/components/motion/bloom-menu.d.ts.map +1 -1
- package/dist/components/motion/bloom-menu.js +73 -8
- package/dist/components/motion/bloom-menu.js.map +1 -1
- package/dist/components/motion/bottom-sheet.d.ts.map +1 -1
- package/dist/components/motion/bottom-sheet.js +6 -10
- package/dist/components/motion/bottom-sheet.js.map +1 -1
- package/dist/components/motion/bounce-sidebar.d.ts.map +1 -1
- package/dist/components/motion/bounce-sidebar.js +34 -42
- package/dist/components/motion/bounce-sidebar.js.map +1 -1
- package/dist/components/motion/bouncy-accordion.d.ts.map +1 -1
- package/dist/components/motion/bouncy-accordion.js +35 -22
- package/dist/components/motion/bouncy-accordion.js.map +1 -1
- package/dist/components/motion/button/stateful.d.ts.map +1 -1
- package/dist/components/motion/button/stateful.js +3 -0
- package/dist/components/motion/button/stateful.js.map +1 -1
- package/dist/components/motion/card.d.ts +44 -0
- package/dist/components/motion/card.d.ts.map +1 -0
- package/dist/components/motion/card.js +122 -0
- package/dist/components/motion/card.js.map +1 -0
- package/dist/components/motion/center-morph-modal.js +1 -1
- package/dist/components/motion/checkbox.d.ts +3 -1
- package/dist/components/motion/checkbox.d.ts.map +1 -1
- package/dist/components/motion/checkbox.js +18 -6
- package/dist/components/motion/checkbox.js.map +1 -1
- package/dist/components/motion/color-picker.d.ts +110 -0
- package/dist/components/motion/color-picker.d.ts.map +1 -0
- package/dist/components/motion/color-picker.js +1053 -0
- package/dist/components/motion/color-picker.js.map +1 -0
- package/dist/components/motion/color-selector.d.ts.map +1 -1
- package/dist/components/motion/color-selector.js +9 -2
- package/dist/components/motion/color-selector.js.map +1 -1
- package/dist/components/motion/combobox/content.d.ts +1 -0
- package/dist/components/motion/command-palette.js +3 -3
- package/dist/components/motion/command-palette.js.map +1 -1
- package/dist/components/motion/context-menu.d.ts +1 -0
- package/dist/components/motion/context-menu.js +1 -1
- package/dist/components/motion/date-range-picker.d.ts.map +1 -1
- package/dist/components/motion/digit-swap.d.ts +9 -1
- package/dist/components/motion/digit-swap.d.ts.map +1 -1
- package/dist/components/motion/digit-swap.js +18 -7
- package/dist/components/motion/digit-swap.js.map +1 -1
- package/dist/components/motion/drawer.d.ts +1 -1
- package/dist/components/motion/drawer.d.ts.map +1 -1
- package/dist/components/motion/drawer.js +10 -10
- package/dist/components/motion/drawer.js.map +1 -1
- package/dist/components/motion/expandable-action-bar.d.ts.map +1 -1
- package/dist/components/motion/expandable-control.d.ts +1 -0
- package/dist/components/motion/feedback-widget.js +4 -1
- package/dist/components/motion/feedback-widget.js.map +1 -1
- package/dist/components/motion/knockout-wheel.d.ts.map +1 -1
- package/dist/components/motion/knockout-wheel.js +1 -2
- package/dist/components/motion/knockout-wheel.js.map +1 -1
- package/dist/components/motion/morphing-lightbox.d.ts.map +1 -1
- package/dist/components/motion/morphing-lightbox.js +1 -1
- package/dist/components/motion/morphing-modal.d.ts +6 -1
- package/dist/components/motion/morphing-modal.d.ts.map +1 -1
- package/dist/components/motion/morphing-modal.js +37 -5
- package/dist/components/motion/morphing-modal.js.map +1 -1
- package/dist/components/motion/morphing-search-chips.d.ts +54 -0
- package/dist/components/motion/morphing-search-chips.d.ts.map +1 -0
- package/dist/components/motion/morphing-search-chips.js +599 -0
- package/dist/components/motion/morphing-search-chips.js.map +1 -0
- package/dist/components/motion/morphing-search.js +1 -1
- package/dist/components/motion/morphing-tabs.js +1 -1
- package/dist/components/motion/multi-select/content.d.ts +1 -0
- package/dist/components/motion/not-found/shared.d.ts +1 -0
- package/dist/components/motion/number-ticker.d.ts +6 -1
- package/dist/components/motion/number-ticker.d.ts.map +1 -1
- package/dist/components/motion/number-ticker.js +19 -9
- package/dist/components/motion/number-ticker.js.map +1 -1
- package/dist/components/motion/otp-input.js +19 -11
- package/dist/components/motion/otp-input.js.map +1 -1
- package/dist/components/motion/parallax.js.map +1 -1
- package/dist/components/motion/popover-morph.d.ts +5 -3
- package/dist/components/motion/popover-morph.d.ts.map +1 -1
- package/dist/components/motion/popover-morph.js +47 -52
- package/dist/components/motion/popover-morph.js.map +1 -1
- package/dist/components/motion/popover.d.ts +1 -0
- package/dist/components/motion/popover.js +7 -1
- package/dist/components/motion/popover.js.map +1 -1
- package/dist/components/motion/prediction-market-card.js +2 -3
- package/dist/components/motion/prediction-market-card.js.map +1 -1
- package/dist/components/motion/prediction-market.js +1 -1
- package/dist/components/motion/project-folder.js +1 -1
- package/dist/components/motion/radio.d.ts +8 -2
- package/dist/components/motion/radio.d.ts.map +1 -1
- package/dist/components/motion/radio.js +70 -10
- package/dist/components/motion/radio.js.map +1 -1
- package/dist/components/motion/scroll-progress.d.ts +1 -0
- package/dist/components/motion/select-morph.d.ts +1 -1
- package/dist/components/motion/select-morph.d.ts.map +1 -1
- package/dist/components/motion/select-morph.js +89 -21
- package/dist/components/motion/select-morph.js.map +1 -1
- package/dist/components/motion/select.d.ts.map +1 -1
- package/dist/components/motion/select.js +153 -135
- package/dist/components/motion/select.js.map +1 -1
- package/dist/components/motion/shader-background.d.ts +4 -2
- package/dist/components/motion/shader-background.d.ts.map +1 -1
- package/dist/components/motion/shader-background.js +9 -3
- package/dist/components/motion/shader-background.js.map +1 -1
- package/dist/components/motion/shared-layout-bg.d.ts.map +1 -1
- package/dist/components/motion/shared-layout-bg.js +17 -3
- package/dist/components/motion/shared-layout-bg.js.map +1 -1
- package/dist/components/motion/sortable-list.d.ts +1 -0
- package/dist/components/motion/sortable-stack.js +1 -2
- package/dist/components/motion/swipeable-list.d.ts.map +1 -1
- package/dist/components/motion/swipeable-list.js +61 -4
- package/dist/components/motion/swipeable-list.js.map +1 -1
- package/dist/components/motion/table/row-handle.js +1 -1
- package/dist/components/motion/table/table-header.js +1 -1
- package/dist/components/motion/tabs.d.ts +13 -3
- package/dist/components/motion/tabs.d.ts.map +1 -1
- package/dist/components/motion/tabs.js +248 -26
- package/dist/components/motion/tabs.js.map +1 -1
- package/dist/components/motion/text-reveal.d.ts +1 -0
- package/dist/components/motion/theme-toggle.js +1 -1
- package/dist/components/motion/tooltip/positioner.d.ts +8 -26
- package/dist/components/motion/tooltip/positioner.d.ts.map +1 -1
- package/dist/components/motion/tooltip/positioner.js +1 -2
- package/dist/components/motion/tooltip.d.ts +62 -20
- package/dist/components/motion/tooltip.d.ts.map +1 -1
- package/dist/components/motion/tooltip.js +1 -135
- package/dist/components/motion/wallet-card/account-avatar.js +1 -2
- package/dist/components/reui/alert.d.ts +1 -1
- package/dist/components/reui/autocomplete.d.ts.map +1 -1
- package/dist/components/reui/autocomplete.js +1 -1
- package/dist/components/reui/autocomplete.js.map +1 -1
- package/dist/components/reui/badge.d.ts +1 -1
- package/dist/components/reui/cascader/cascader-async.d.ts +21 -5
- package/dist/components/reui/cascader/cascader-async.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-async.js +61 -34
- package/dist/components/reui/cascader/cascader-async.js.map +1 -1
- package/dist/components/reui/cascader/cascader-columns.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-columns.js +5 -2
- package/dist/components/reui/cascader/cascader-columns.js.map +1 -1
- package/dist/components/reui/cascader/cascader-context.d.ts +3 -1
- package/dist/components/reui/cascader/cascader-context.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-context.js.map +1 -1
- package/dist/components/reui/cascader/cascader-i18n.d.ts +1 -1
- package/dist/components/reui/cascader/cascader-item.d.ts +1 -1
- package/dist/components/reui/cascader/cascader-lib.d.ts +34 -8
- package/dist/components/reui/cascader/cascader-lib.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-lib.js +145 -29
- package/dist/components/reui/cascader/cascader-lib.js.map +1 -1
- package/dist/components/reui/cascader/cascader-nav.d.ts +1 -1
- package/dist/components/reui/cascader/cascader-types.d.ts +1 -1
- package/dist/components/reui/cascader/cascader.d.ts +13 -8
- package/dist/components/reui/cascader/cascader.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader.js +31 -16
- package/dist/components/reui/cascader/cascader.js.map +1 -1
- package/dist/components/reui/code-block/code-block.d.ts.map +1 -1
- package/dist/components/reui/color-picker.d.ts +280 -0
- package/dist/components/reui/color-picker.d.ts.map +1 -0
- package/dist/components/reui/color-picker.js +2013 -0
- package/dist/components/reui/color-picker.js.map +1 -0
- package/dist/components/reui/data-grid/data-grid-cell-selection.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-cell-selection.js +1 -0
- package/dist/components/reui/data-grid/data-grid-cell-selection.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-filter.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-filter.js +1 -0
- package/dist/components/reui/data-grid/data-grid-column-filter.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-header.d.ts +6 -8
- package/dist/components/reui/data-grid/data-grid-column-header.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-header.js +50 -29
- package/dist/components/reui/data-grid/data-grid-column-header.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-visibility.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-visibility.js +1 -0
- package/dist/components/reui/data-grid/data-grid-column-visibility.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-pagination.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-pagination.js +2 -1
- package/dist/components/reui/data-grid/data-grid-pagination.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-scroll-area.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-scroll-area.js +10 -3
- package/dist/components/reui/data-grid/data-grid-scroll-area.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js +15 -10
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd.d.ts +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd.js +54 -14
- package/dist/components/reui/data-grid/data-grid-table-dnd.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-virtual.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-virtual.js +37 -42
- package/dist/components/reui/data-grid/data-grid-table-virtual.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table.d.ts +174 -16
- package/dist/components/reui/data-grid/data-grid-table.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table.js +223 -89
- package/dist/components/reui/data-grid/data-grid-table.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid.d.ts +55 -1
- package/dist/components/reui/data-grid/data-grid.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid.js +112 -22
- package/dist/components/reui/data-grid/data-grid.js.map +1 -1
- package/dist/components/reui/date-selector.d.ts +1 -0
- package/dist/components/reui/date-selector.d.ts.map +1 -1
- package/dist/components/reui/date-selector.js +22 -16
- package/dist/components/reui/date-selector.js.map +1 -1
- package/dist/components/reui/emoji-picker.d.ts +367 -0
- package/dist/components/reui/emoji-picker.d.ts.map +1 -0
- package/dist/components/reui/emoji-picker.js +1768 -0
- package/dist/components/reui/emoji-picker.js.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-agenda-view.js +3 -5
- package/dist/components/reui/event-calendar/event-calendar-agenda-view.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-i18n.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-nav.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-nav.js +4 -4
- package/dist/components/reui/event-calendar/event-calendar-nav.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar.js +34 -31
- package/dist/components/reui/event-calendar/event-calendar.js.map +1 -1
- package/dist/components/reui/file-type.d.ts +792 -0
- package/dist/components/reui/file-type.d.ts.map +1 -0
- package/dist/components/reui/file-type.js +1367 -0
- package/dist/components/reui/file-type.js.map +1 -0
- package/dist/components/reui/filters/filters-advanced.d.ts +1 -0
- package/dist/components/reui/filters/filters-advanced.js +1 -1
- package/dist/components/reui/filters/filters-advanced.js.map +1 -1
- package/dist/components/reui/filters/filters-builder.d.ts +1 -1
- package/dist/components/reui/filters/filters-chip.d.ts +5 -1
- package/dist/components/reui/filters/filters-chip.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-chip.js +1 -1
- package/dist/components/reui/filters/filters-lib.d.ts +1 -1
- package/dist/components/reui/filters/filters-lib.d.ts.map +1 -1
- package/dist/components/reui/frame.d.ts.map +1 -1
- package/dist/components/reui/frame.js.map +1 -1
- package/dist/components/reui/gantt/gantt-nav.d.ts.map +1 -1
- package/dist/components/reui/gantt/gantt-nav.js +4 -4
- package/dist/components/reui/gantt/gantt-nav.js.map +1 -1
- package/dist/components/reui/gantt/gantt.d.ts.map +1 -1
- package/dist/components/reui/gantt/gantt.js +5 -2
- package/dist/components/reui/gantt/gantt.js.map +1 -1
- package/dist/components/reui/icon-tile.d.ts +1 -1
- package/dist/components/reui/icon-tile.js +8 -7
- package/dist/components/reui/icon-tile.js.map +1 -1
- package/dist/components/reui/kanban.d.ts.map +1 -1
- package/dist/components/reui/kanban.js +1 -1
- package/dist/components/reui/kanban.js.map +1 -1
- package/dist/components/reui/number-field.d.ts.map +1 -1
- package/dist/components/reui/number-field.js.map +1 -1
- package/dist/components/reui/phone-input.js +30 -27
- package/dist/components/reui/phone-input.js.map +1 -1
- package/dist/components/reui/scrollspy.d.ts +1 -0
- package/dist/components/reui/time-picker.js +1 -1
- package/dist/components/reui/time-picker.js.map +1 -1
- package/dist/components/ui/attachment.d.ts +1 -1
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/chart.d.ts.map +1 -1
- package/dist/components/ui/code-block.d.ts +29 -0
- package/dist/components/ui/code-block.d.ts.map +1 -0
- package/dist/components/ui/code-block.js +124 -0
- package/dist/components/ui/code-block.js.map +1 -0
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/direction.js +1 -2
- package/dist/components/ui/field.d.ts +1 -1
- package/dist/components/ui/field.js +1 -1
- package/dist/components/ui/input-group.d.ts +1 -1
- package/dist/components/ui/marker.d.ts +1 -1
- package/dist/components/ui/message-scroller.d.ts.map +1 -1
- package/dist/components/ui/questionnaire.d.ts.map +1 -1
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/trace.d.ts +21 -0
- package/dist/components/ui/trace.d.ts.map +1 -0
- package/dist/components/ui/trace.js +77 -0
- package/dist/components/ui/trace.js.map +1 -0
- package/dist/context-BYXeJQnz.d.ts.map +1 -1
- package/dist/context-tTdLKYNf.js +99 -0
- package/dist/context-tTdLKYNf.js.map +1 -0
- package/dist/{copy-menu-C5GaT4Z-.js → copy-menu-DOg9Jh-U.js} +2 -2
- package/dist/{copy-menu-C5GaT4Z-.js.map → copy-menu-DOg9Jh-U.js.map} +1 -1
- package/dist/hooks/use-copy-to-clipboard.d.ts +1 -0
- package/dist/hooks/use-focus-trap.d.ts +22 -0
- package/dist/hooks/use-focus-trap.d.ts.map +1 -0
- package/dist/hooks/use-focus-trap.js +80 -0
- package/dist/hooks/use-focus-trap.js.map +1 -0
- package/dist/hooks/use-highlighted-code.d.ts +5 -0
- package/dist/hooks/use-highlighted-code.d.ts.map +1 -0
- package/dist/hooks/use-highlighted-code.js +128 -0
- package/dist/hooks/use-highlighted-code.js.map +1 -0
- package/dist/hooks/use-hover-gesture.d.ts +1 -0
- package/dist/hooks/use-intersection-observer.d.ts +1 -0
- package/dist/hooks/use-listbox.d.ts +29 -0
- package/dist/hooks/use-listbox.d.ts.map +1 -0
- package/dist/hooks/use-listbox.js +75 -0
- package/dist/hooks/use-listbox.js.map +1 -0
- package/dist/hooks/use-scroll-position.d.ts +1 -0
- package/dist/hooks/use-slider-input.d.ts +1 -0
- package/dist/hooks/use-viewport.d.ts +1 -0
- package/dist/lib/tick-sound.d.ts +1 -0
- package/dist/model-NSIg2p7a.d.ts +20 -0
- package/dist/model-NSIg2p7a.d.ts.map +1 -0
- package/dist/model-_mRyI6V9.d.ts +18 -0
- package/dist/model-_mRyI6V9.d.ts.map +1 -0
- package/dist/{positioner-3mCqiebN.js → positioner-3r3cfkqT.js} +97 -33
- package/dist/positioner-3r3cfkqT.js.map +1 -0
- package/dist/tooltip-Bam5KeYe.js +535 -0
- package/dist/tooltip-Bam5KeYe.js.map +1 -0
- package/dist/tooltip-C01qUgsW.d.ts.map +1 -1
- package/dist/use-position-DOi1gVL0.d.ts +32 -0
- package/dist/use-position-DOi1gVL0.d.ts.map +1 -0
- package/package.json +11 -11
- package/dist/cascader-types-DVT-znZ-.d.ts.map +0 -1
- package/dist/components/motion/tooltip.js.map +0 -1
- package/dist/model-DfeFradZ.d.ts +0 -9
- package/dist/model-DfeFradZ.d.ts.map +0 -1
- package/dist/positioner-3mCqiebN.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-calendar-nav.js","names":[],"sources":["../../../../src/components/reui/event-calendar/event-calendar-nav.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode, useState } from \"react\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { addDays, format } from \"date-fns\";\nimport { CalendarIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { Button } from \"../../ui/button\";\nimport { Calendar } from \"../../ui/calendar\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuTrigger,\n} from \"../../ui/dropdown-menu\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../../ui/popover\";\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from \"../../ui/tooltip\";\nimport {\n useEventCalendarNavigation,\n useEventCalendarSettings,\n useEventCalendarView,\n useEventCalendarViewConfig,\n} from \"./event-calendar\";\nimport { toZoned } from \"./event-calendar-lib\";\nimport type { CalendarView } from \"./event-calendar-types\";\n\n/** Configured nav button variant/size (viewConfig.navButtonVariant/Size)\n * plus the shared classNames.navButton hook, merged on every nav button. */\nfunction useNavButtonProps(): {\n variant: \"ghost\" | \"outline\" | \"secondary\" | \"default\";\n size: \"sm\" | \"default\";\n iconSize: \"icon-sm\" | \"icon\";\n className: string | undefined;\n} {\n const viewConfig = useEventCalendarViewConfig();\n return {\n variant: viewConfig.navButtonVariant,\n size: viewConfig.navButtonSize,\n iconSize: viewConfig.navButtonSize === \"sm\" ? \"icon-sm\" : \"icon\",\n className: viewConfig.classNames?.navButton,\n };\n}\n\n/** Resolved nav tooltip policy (viewConfig.navTooltips + classNames.navTooltip). */\nfunction useNavTooltipConfig(): {\n disabled: boolean;\n side: \"top\" | \"bottom\" | \"left\" | \"right\";\n delay: number;\n closeDelay: number;\n timeout: number;\n className: string | undefined;\n} {\n const viewConfig = useEventCalendarViewConfig();\n const config = viewConfig.navTooltips === false ? undefined : viewConfig.navTooltips;\n return {\n disabled: viewConfig.navTooltips === false,\n // the nav sits at the top of the calendar, so tooltips open upward by\n // default (away from the grid); collision flipping still drops them below\n // when there is no room above\n side: config?.side ?? \"top\",\n delay: config?.delay ?? 600,\n closeDelay: config?.closeDelay ?? 0,\n timeout: config?.timeout ?? 300,\n className: viewConfig.classNames?.navTooltip,\n };\n}\n\ntype NavButtonProps = Omit<useRender.ComponentProps<\"button\">, \"children\"> & {\n children?: ReactNode;\n /**\n * Tooltip policy (the part that usually goes wrong on clickable elements):\n * tooltips appear ONLY on hover or keyboard focus-visible - a pointer click\n * never re-triggers them. Buttons that open overlays (the view switcher)\n * use a hover-only tooltip that is force-closed while the overlay is up and\n * ignores focus, so nothing flashes when focus returns after selection.\n * Icon-only buttons default to their accessible label; Today defaults to\n * the actual current date (info the label doesn't carry). Pass null to\n * disable one, or any node to override; viewConfig.navTooltips=false turns\n * them all off (its object form tunes side/delay/closeDelay/timeout).\n */\n tooltip?: ReactNode | null;\n};\n\n/** Hover/focus-visible tooltip wrapper; renders the bare button when disabled\n * (per-button content=null or viewConfig.navTooltips=false). */\nfunction NavTooltip({\n content,\n children,\n}: {\n content: ReactNode | null;\n children: React.ReactElement;\n}) {\n const tooltips = useNavTooltipConfig();\n if (tooltips.disabled || content === null || content === undefined) return children;\n return (\n <Tooltip>\n <TooltipTrigger render={children} />\n <TooltipContent side={tooltips.side} className={tooltips.className}>\n {content}\n </TooltipContent>\n </Tooltip>\n );\n}\n\nfunction EventCalendarNavToday({ className, render, children, tooltip, ...props }: NavButtonProps) {\n const { today, isToday } = useEventCalendarNavigation();\n const settings = useEventCalendarSettings();\n const nav = useNavButtonProps();\n // display-zone \"today\", like every other today derivation in the calendar\n // (a system-zone new Date() can name a different day than Today opens)\n const defaultTooltip = format(\n toZoned(new Date(), settings.timeZone),\n settings.i18n.formats.dayTitle,\n { locale: settings.locale },\n );\n return (\n <NavTooltip content={tooltip === undefined ? defaultTooltip : tooltip}>\n <Button\n variant={nav.variant}\n size={nav.size}\n data-slot=\"event-calendar-nav-today\"\n data-active={isToday || undefined}\n className={cn(nav.className, className)}\n onClick={today}\n render={render}\n {...props}\n >\n {children ?? settings.i18n.labels.today}\n </Button>\n </NavTooltip>\n );\n}\n\nfunction EventCalendarNavPrev({ className, render, children, tooltip, ...props }: NavButtonProps) {\n const { prev } = useEventCalendarNavigation();\n const settings = useEventCalendarSettings();\n const nav = useNavButtonProps();\n return (\n <NavTooltip content={tooltip === undefined ? settings.i18n.labels.previous : tooltip}>\n <Button\n variant={nav.variant}\n size={nav.iconSize}\n data-slot=\"event-calendar-nav-prev\"\n aria-label={settings.i18n.labels.previous}\n className={cn(nav.className, className)}\n onClick={prev}\n render={render}\n {...props}\n >\n {children ?? <ChevronLeftIcon className=\"size-4\" aria-hidden=\"true\" />}\n </Button>\n </NavTooltip>\n );\n}\n\nfunction EventCalendarNavNext({ className, render, children, tooltip, ...props }: NavButtonProps) {\n const { next } = useEventCalendarNavigation();\n const settings = useEventCalendarSettings();\n const nav = useNavButtonProps();\n return (\n <NavTooltip content={tooltip === undefined ? settings.i18n.labels.next : tooltip}>\n <Button\n variant={nav.variant}\n size={nav.iconSize}\n data-slot=\"event-calendar-nav-next\"\n aria-label={settings.i18n.labels.next}\n className={cn(nav.className, className)}\n onClick={next}\n render={render}\n {...props}\n >\n {children ?? <ChevronRightIcon className=\"size-4\" aria-hidden=\"true\" />}\n </Button>\n </NavTooltip>\n );\n}\n\ninterface EventCalendarTitleProps extends useRender.ComponentProps<\"div\"> {\n format?: (ctx: { title: string }) => ReactNode;\n}\n\nfunction EventCalendarTitle({\n className,\n render,\n format: formatTitle,\n ...props\n}: EventCalendarTitleProps) {\n const { title } = useEventCalendarNavigation();\n const viewConfig = useEventCalendarViewConfig();\n const defaultProps = {\n \"data-slot\": \"event-calendar-title\",\n \"aria-live\": \"polite\" as const,\n className: cn(\n \"min-w-0 truncate font-semibold text-sm\",\n viewConfig.classNames?.title,\n className,\n ),\n children: formatTitle?.({ title }) ?? title,\n };\n return useRender({\n defaultTagName: \"div\",\n render,\n props: mergeProps<\"div\">(defaultProps, props),\n });\n}\n\ninterface EventCalendarViewSwitcherProps\n extends Omit<useRender.ComponentProps<\"button\">, \"children\"> {\n children?: ReactNode;\n /** Hover/focus-visible hint; defaults to the \"Select view\" label. Pass\n * null to disable (overlay-opener policy). */\n tooltip?: ReactNode | null;\n}\n\nfunction EventCalendarViewSwitcher({\n className,\n render,\n children,\n tooltip,\n ...props\n}: EventCalendarViewSwitcherProps) {\n const { view, dayCount, availableViews, setView } = useEventCalendarView();\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const nav = useNavButtonProps();\n const tooltips = useNavTooltipConfig();\n const labels = settings.i18n.labels;\n // Controlled open: selecting a view swaps the whole content subtree in the\n // same click, so closing must not depend on the menu's internal handler.\n const [open, setOpen] = useState(false);\n // Hover-only tooltip: when the menu closes, Base UI focuses the trigger\n // again and a focus-opened tooltip would flash - ignore focus opens.\n const [tipOpen, setTipOpen] = useState(false);\n\n const selectView = (v: CalendarView, opts?: { dayCount?: number }) => {\n setOpen(false);\n setView(v, opts);\n };\n\n const viewLabel = (v: CalendarView) =>\n v === \"days\" ? settings.i18n.viewNames.days(dayCount) : settings.i18n.viewNames[v];\n\n return (\n <DropdownMenu\n open={open}\n onOpenChange={(next: boolean) => {\n setOpen(next);\n if (next) setTipOpen(false);\n }}\n >\n {/* Tooltip on an overlay-opener: hover-only (focus opens ignored) and\n force-closed while the menu is up, so it never lingers or flashes\n when focus returns on close. Inherits the nav TooltipProvider's\n delay/closeDelay/timeout. */}\n <Tooltip\n open={tipOpen && !open}\n onOpenChange={(next: boolean, details: { reason?: string }) => {\n // opens are hover-only; the trigger-focus open that follows a\n // menu close is ignored, closes always land\n if (next && details?.reason !== \"trigger-hover\") return;\n setTipOpen(next);\n }}\n >\n <DropdownMenuTrigger\n render={\n <TooltipTrigger\n render={\n <Button\n variant={nav.variant}\n size={nav.size}\n data-slot=\"event-calendar-view-switcher\"\n aria-label={labels.selectView}\n className={cn(\"gap-1\", nav.className, className)}\n render={render}\n />\n }\n />\n }\n {...props}\n >\n {children ?? (\n <>\n {viewLabel(view)}\n <ChevronDownIcon className=\"size-4 opacity-60\" aria-hidden=\"true\" />\n </>\n )}\n </DropdownMenuTrigger>\n {tipOpen && !open && tooltip !== null && !tooltips.disabled && (\n <TooltipContent side={tooltips.side} className={tooltips.className}>\n {tooltip ?? labels.selectView}\n </TooltipContent>\n )}\n </Tooltip>\n <DropdownMenuContent\n align=\"start\"\n className={cn(\"min-w-44\", viewConfig.classNames?.viewSwitcherContent)}\n >\n {/* Base UI contract: GroupLabel must live inside Menu.Group */}\n <DropdownMenuGroup>\n <DropdownMenuLabel\n className={cn(\n \"font-normal text-muted-foreground\",\n viewConfig.classNames?.viewSwitcherLabel,\n )}\n >\n {settings.i18n.labels.selectView}\n </DropdownMenuLabel>\n {availableViews.map((v) =>\n v === \"days\" ? (\n viewConfig.dayCountPresets.map((count) => (\n <DropdownMenuItem\n key={`days-${count}`}\n data-active={(view === \"days\" && dayCount === count) || undefined}\n onClick={() => selectView(\"days\", { dayCount: count })}\n >\n {settings.i18n.viewNames.days(count)}\n {/* hint derived from the preset itself, not i18n's default */}\n {viewConfig.enableShortcuts && (\n <EventCalendarViewShortcut>{count}</EventCalendarViewShortcut>\n )}\n </DropdownMenuItem>\n ))\n ) : (\n <DropdownMenuItem\n key={v}\n data-active={view === v || undefined}\n onClick={() => selectView(v)}\n >\n {viewLabel(v)}\n {viewConfig.enableShortcuts && (\n <EventCalendarViewShortcut>{labels.viewShortcuts[v]}</EventCalendarViewShortcut>\n )}\n </DropdownMenuItem>\n ),\n )}\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\n/** Outline key badge; theme-token only, so it adapts to every style. */\nfunction EventCalendarViewShortcut({ children }: { children: ReactNode }) {\n const viewConfig = useEventCalendarViewConfig();\n return (\n <kbd\n data-slot=\"event-calendar-view-shortcut\"\n className={cn(\n \"ms-auto inline-flex size-5 shrink-0 items-center justify-center rounded-sm border font-sans text-muted-foreground text-xs\",\n viewConfig.classNames?.viewShortcut,\n )}\n >\n {children}\n </kbd>\n );\n}\n\ninterface EventCalendarDatePickerProps\n extends Omit<useRender.ComponentProps<\"button\">, \"children\"> {\n children?: ReactNode;\n /** \"auto\" (default) resolves per view: range for week/N-days/agenda. */\n mode?: \"auto\" | \"single\" | \"range\";\n /** Hover/focus-visible hint; defaults to null - no tooltip, because the\n * button opens an overlay (see the NavButtonProps tooltip policy). */\n tooltip?: ReactNode | null;\n}\n\n/** Views whose period reads better as a highlighted range. */\nconst RANGE_VIEWS: CalendarView[] = [\"week\", \"days\", \"agenda\"];\n\n/**\n * Optional go-to-date picker (shadcn Calendar in a popover), view-aware:\n * week/N-days/agenda highlight the whole active range (any click re-anchors\n * the period), other views select a single date. Not part of the default\n * nav - compose it yourself (or any external picker driving\n * useEventCalendarNavigation().goTo). No tooltip by default: it opens an\n * overlay (see the NavButtonProps tooltip policy); pass `tooltip` to opt in.\n */\nfunction EventCalendarDatePicker({\n className,\n render,\n children,\n tooltip = null,\n mode,\n ...props\n}: EventCalendarDatePickerProps) {\n const { date, goTo, activeRange } = useEventCalendarNavigation();\n const { view } = useEventCalendarView();\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const nav = useNavButtonProps();\n const [open, setOpen] = useState(false);\n const zoned = toZoned(date, settings.timeZone);\n\n const configured = mode ?? \"auto\";\n const resolved =\n configured === \"auto\" ? (RANGE_VIEWS.includes(view) ? \"range\" : \"single\") : configured;\n\n const pick = (next: Date | undefined) => {\n if (!next) return;\n goTo(next);\n setOpen(false);\n };\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <NavTooltip content={tooltip}>\n <PopoverTrigger\n render={\n <Button\n variant={nav.variant}\n size={nav.iconSize}\n data-slot=\"event-calendar-date-picker\"\n data-mode={resolved}\n aria-label={settings.i18n.labels.goToDate}\n className={cn(nav.className, className)}\n render={render}\n />\n }\n {...props}\n >\n {children ?? <CalendarIcon className=\"size-4\" aria-hidden=\"true\" />}\n </PopoverTrigger>\n </NavTooltip>\n <PopoverContent\n align=\"start\"\n className={cn(\"w-auto p-0!\", viewConfig.classNames?.datePickerContent)}\n >\n {resolved === \"range\" ? (\n <Calendar\n mode=\"range\"\n selected={{\n from: toZoned(activeRange.start, settings.timeZone),\n to: toZoned(addDays(activeRange.end, -1), settings.timeZone),\n }}\n defaultMonth={zoned}\n onDayClick={pick}\n locale={settings.locale}\n weekStartsOn={settings.weekStartsOn}\n />\n ) : (\n <Calendar\n mode=\"single\"\n selected={zoned}\n defaultMonth={zoned}\n onSelect={pick}\n locale={settings.locale}\n weekStartsOn={settings.weekStartsOn}\n />\n )}\n </PopoverContent>\n </Popover>\n );\n}\n\ntype EventCalendarToolbarProps = useRender.ComponentProps<\"div\">;\n\n/** Free slot for consumer toolbar buttons; pure layout shell. */\nfunction EventCalendarToolbar({ className, render, ...props }: EventCalendarToolbarProps) {\n const viewConfig = useEventCalendarViewConfig();\n const defaultProps = {\n \"data-slot\": \"event-calendar-toolbar\",\n className: cn(\"flex items-center gap-2\", viewConfig.classNames?.toolbar, className),\n children: props.children,\n };\n return useRender({\n defaultTagName: \"div\",\n render,\n props: mergeProps<\"div\">(defaultProps, props),\n });\n}\n\ninterface EventCalendarNavProps extends useRender.ComponentProps<\"div\"> {\n /**\n * Render the view switcher in the composed layout. Turn off when the\n * calendar ships with a fixed view (e.g. a month-only embed) and users\n * should not be able to change it.\n * @default true\n */\n showViewSwitcher?: boolean;\n}\n\n/**\n * Default composed nav: Today, prev/next, title, spacer, view switcher.\n * Pass children to use it as a pure layout shell instead.\n */\nfunction EventCalendarNav({\n className,\n render,\n children,\n showViewSwitcher = true,\n ...props\n}: EventCalendarNavProps) {\n const viewConfig = useEventCalendarViewConfig();\n const tooltips = useNavTooltipConfig();\n const defaultProps = {\n \"data-slot\": \"event-calendar-nav\",\n className: cn(\n \"flex min-w-0 flex-wrap items-center gap-1 px-2 py-2\",\n viewConfig.stickyNav && \"sticky top-0 z-30 bg-background\",\n viewConfig.classNames?.nav,\n className,\n ),\n children: children ?? (\n // Shared provider: first tooltip waits, moving between buttons is instant\n <TooltipProvider\n delay={tooltips.delay}\n closeDelay={tooltips.closeDelay}\n timeout={tooltips.timeout}\n >\n <EventCalendarNavToday />\n {showViewSwitcher && <EventCalendarViewSwitcher />}\n <div className=\"flex items-center\">\n <EventCalendarNavPrev />\n <EventCalendarNavNext />\n </div>\n {/* ms-3 sets the title apart from the tight control cluster so the\n period reads as its own group, not another button */}\n <EventCalendarTitle className=\"ms-3\" />\n <div className=\"grow\" />\n </TooltipProvider>\n ),\n };\n return useRender({\n defaultTagName: \"div\",\n render,\n props: mergeProps<\"div\">(defaultProps, props),\n });\n}\n\nexport type {\n EventCalendarNavProps,\n EventCalendarTitleProps,\n EventCalendarToolbarProps,\n EventCalendarViewSwitcherProps,\n};\nexport {\n EventCalendarDatePicker,\n EventCalendarNav,\n EventCalendarNavNext,\n EventCalendarNavPrev,\n EventCalendarNavToday,\n EventCalendarTitle,\n EventCalendarToolbar,\n EventCalendarViewSwitcher,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAgCA,SAAS,oBAKP;CACA,MAAM,aAAa,2BAA2B;CAC9C,OAAO;EACL,SAAS,WAAW;EACpB,MAAM,WAAW;EACjB,UAAU,WAAW,kBAAkB,OAAO,YAAY;EAC1D,WAAW,WAAW,YAAY;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B,EAAE,WAAW,QAAQ,GAAG,SAAoC;CACxF,MAAM,aAAa,2BAA2B;CAC9C,MAAM,eAAe;EACnB,aAAa;EACb,WAAW,GAAG,2BAA2B,WAAW,YAAY,SAAS,SAAS;EAClF,UAAU,MAAM;CAClB;CACA,OAAO,UAAU;EACf,gBAAgB;EAChB;EACA,OAAO,WAAkB,cAAc,KAAK;CAC9C,CAAC;AACH;;;;;AAgBA,SAAS,iBAAiB,EACxB,WACA,QACA,UACA,mBAAmB,MACnB,GAAG,SACqB;CACxB,MAAM,aAAa,2BAA2B;CAC9C,MAAM,WAAW,oBAAoB;CACrC,MAAM,eAAe;EACnB,aAAa;EACb,WAAW,GACT,uDACA,WAAW,aAAa,mCACxB,WAAW,YAAY,KACvB,SACF;EACA,UAAU,YAER,qBAAC,iBAAD;GACE,OAAO,SAAS;GAChB,YAAY,SAAS;GACrB,SAAS,SAAS;GAHpB,UAAA;IAKE,oBAAC,uBAAD,CAAwB,CAAA;IACvB,oBAAoB,oBAAC,2BAAD,CAA4B,CAAA;IACjD,qBAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CACE,oBAAC,sBAAD,CAAuB,CAAA,GACvB,oBAAC,sBAAD,CAAuB,CAAA,CACpB;;IAGL,oBAAC,oBAAD,EAAoB,WAAU,OAAQ,CAAA;IACtC,oBAAC,OAAD,EAAK,WAAU,OAAQ,CAAA;GACR;;CAErB;CACA,OAAO,UAAU;EACf,gBAAgB;EAChB;EACA,OAAO,WAAkB,cAAc,KAAK;CAC9C,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"event-calendar-nav.js","names":[],"sources":["../../../../src/components/reui/event-calendar/event-calendar-nav.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode, useState } from \"react\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { addDays, format } from \"date-fns\";\nimport { CalendarIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { Button } from \"../../ui/button\";\nimport { Calendar } from \"../../ui/calendar\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuTrigger,\n} from \"../../ui/dropdown-menu\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../../ui/popover\";\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from \"../../ui/tooltip\";\nimport {\n useEventCalendarNavigation,\n useEventCalendarSelector,\n useEventCalendarSettings,\n useEventCalendarView,\n useEventCalendarViewConfig,\n} from \"./event-calendar\";\nimport { toZoned } from \"./event-calendar-lib\";\nimport type { CalendarView } from \"./event-calendar-types\";\n\n/** Configured nav button variant/size (viewConfig.navButtonVariant/Size)\n * plus the shared classNames.navButton hook, merged on every nav button. */\nfunction useNavButtonProps(): {\n variant: \"ghost\" | \"outline\" | \"secondary\" | \"default\";\n size: \"sm\" | \"default\";\n iconSize: \"icon-sm\" | \"icon\";\n className: string | undefined;\n} {\n const viewConfig = useEventCalendarViewConfig();\n return {\n variant: viewConfig.navButtonVariant,\n size: viewConfig.navButtonSize,\n iconSize: viewConfig.navButtonSize === \"sm\" ? \"icon-sm\" : \"icon\",\n className: viewConfig.classNames?.navButton,\n };\n}\n\n/** Resolved nav tooltip policy (viewConfig.navTooltips + classNames.navTooltip). */\nfunction useNavTooltipConfig(): {\n disabled: boolean;\n side: \"top\" | \"bottom\" | \"left\" | \"right\";\n delay: number;\n closeDelay: number;\n timeout: number;\n className: string | undefined;\n} {\n const viewConfig = useEventCalendarViewConfig();\n const config = viewConfig.navTooltips === false ? undefined : viewConfig.navTooltips;\n return {\n disabled: viewConfig.navTooltips === false,\n // the nav sits at the top of the calendar, so tooltips open upward by\n // default (away from the grid); collision flipping still drops them below\n // when there is no room above\n side: config?.side ?? \"top\",\n delay: config?.delay ?? 600,\n closeDelay: config?.closeDelay ?? 0,\n timeout: config?.timeout ?? 300,\n className: viewConfig.classNames?.navTooltip,\n };\n}\n\ntype NavButtonProps = Omit<useRender.ComponentProps<\"button\">, \"children\"> & {\n children?: ReactNode;\n /**\n * Tooltip policy (the part that usually goes wrong on clickable elements):\n * tooltips appear ONLY on hover or keyboard focus-visible - a pointer click\n * never re-triggers them. Buttons that open overlays (the view switcher)\n * use a hover-only tooltip that is force-closed while the overlay is up and\n * ignores focus, so nothing flashes when focus returns after selection.\n * Icon-only buttons default to their accessible label; Today defaults to\n * the actual current date (info the label doesn't carry). Pass null to\n * disable one, or any node to override; viewConfig.navTooltips=false turns\n * them all off (its object form tunes side/delay/closeDelay/timeout).\n */\n tooltip?: ReactNode | null;\n};\n\n/** Hover/focus-visible tooltip wrapper; renders the bare button when disabled\n * (per-button content=null or viewConfig.navTooltips=false). */\nfunction NavTooltip({\n content,\n children,\n}: {\n content: ReactNode | null;\n children: React.ReactElement;\n}) {\n const tooltips = useNavTooltipConfig();\n if (tooltips.disabled || content === null || content === undefined) return children;\n return (\n <Tooltip>\n <TooltipTrigger render={children} />\n <TooltipContent side={tooltips.side} className={tooltips.className}>\n {content}\n </TooltipContent>\n </Tooltip>\n );\n}\n\nfunction EventCalendarNavToday({ className, render, children, tooltip, ...props }: NavButtonProps) {\n const { today, isToday } = useEventCalendarNavigation();\n const settings = useEventCalendarSettings();\n const nav = useNavButtonProps();\n // display-zone \"today\", like every other today derivation in the calendar\n // (a system-zone new Date() can name a different day than Today opens).\n // Read in a selector: React Compiler caches a render-time clock read.\n const defaultTooltip = useEventCalendarSelector(() =>\n format(toZoned(new Date(), settings.timeZone), settings.i18n.formats.dayTitle, {\n locale: settings.locale,\n }),\n );\n return (\n <NavTooltip content={tooltip === undefined ? defaultTooltip : tooltip}>\n <Button\n variant={nav.variant}\n size={nav.size}\n data-slot=\"event-calendar-nav-today\"\n data-active={isToday || undefined}\n className={cn(nav.className, className)}\n onClick={today}\n render={render}\n {...props}\n >\n {children ?? settings.i18n.labels.today}\n </Button>\n </NavTooltip>\n );\n}\n\nfunction EventCalendarNavPrev({ className, render, children, tooltip, ...props }: NavButtonProps) {\n const { prev } = useEventCalendarNavigation();\n const settings = useEventCalendarSettings();\n const nav = useNavButtonProps();\n return (\n <NavTooltip content={tooltip === undefined ? settings.i18n.labels.previous : tooltip}>\n <Button\n variant={nav.variant}\n size={nav.iconSize}\n data-slot=\"event-calendar-nav-prev\"\n aria-label={settings.i18n.labels.previous}\n className={cn(nav.className, className)}\n onClick={prev}\n render={render}\n {...props}\n >\n {children ?? <ChevronLeftIcon className=\"size-4\" aria-hidden=\"true\" />}\n </Button>\n </NavTooltip>\n );\n}\n\nfunction EventCalendarNavNext({ className, render, children, tooltip, ...props }: NavButtonProps) {\n const { next } = useEventCalendarNavigation();\n const settings = useEventCalendarSettings();\n const nav = useNavButtonProps();\n return (\n <NavTooltip content={tooltip === undefined ? settings.i18n.labels.next : tooltip}>\n <Button\n variant={nav.variant}\n size={nav.iconSize}\n data-slot=\"event-calendar-nav-next\"\n aria-label={settings.i18n.labels.next}\n className={cn(nav.className, className)}\n onClick={next}\n render={render}\n {...props}\n >\n {children ?? <ChevronRightIcon className=\"size-4\" aria-hidden=\"true\" />}\n </Button>\n </NavTooltip>\n );\n}\n\ninterface EventCalendarTitleProps extends useRender.ComponentProps<\"div\"> {\n format?: (ctx: { title: string }) => ReactNode;\n}\n\nfunction EventCalendarTitle({\n className,\n render,\n format: formatTitle,\n ...props\n}: EventCalendarTitleProps) {\n const { title } = useEventCalendarNavigation();\n const viewConfig = useEventCalendarViewConfig();\n const defaultProps = {\n \"data-slot\": \"event-calendar-title\",\n \"aria-live\": \"polite\" as const,\n className: cn(\n \"min-w-0 truncate font-semibold text-sm\",\n viewConfig.classNames?.title,\n className,\n ),\n children: formatTitle?.({ title }) ?? title,\n };\n return useRender({\n defaultTagName: \"div\",\n render,\n props: mergeProps<\"div\">(defaultProps, props),\n });\n}\n\ninterface EventCalendarViewSwitcherProps\n extends Omit<useRender.ComponentProps<\"button\">, \"children\"> {\n children?: ReactNode;\n /** Hover/focus-visible hint; defaults to the \"Select view\" label. Pass\n * null to disable (overlay-opener policy). */\n tooltip?: ReactNode | null;\n}\n\nfunction EventCalendarViewSwitcher({\n className,\n render,\n children,\n tooltip,\n ...props\n}: EventCalendarViewSwitcherProps) {\n const { view, dayCount, availableViews, setView } = useEventCalendarView();\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const nav = useNavButtonProps();\n const tooltips = useNavTooltipConfig();\n const labels = settings.i18n.labels;\n // Controlled open: selecting a view swaps the whole content subtree in the\n // same click, so closing must not depend on the menu's internal handler.\n const [open, setOpen] = useState(false);\n // Hover-only tooltip: when the menu closes, Base UI focuses the trigger\n // again and a focus-opened tooltip would flash - ignore focus opens.\n const [tipOpen, setTipOpen] = useState(false);\n\n const selectView = (v: CalendarView, opts?: { dayCount?: number }) => {\n setOpen(false);\n setView(v, opts);\n };\n\n const viewLabel = (v: CalendarView) =>\n v === \"days\" ? settings.i18n.viewNames.days(dayCount) : settings.i18n.viewNames[v];\n\n return (\n <DropdownMenu\n open={open}\n onOpenChange={(next: boolean) => {\n setOpen(next);\n if (next) setTipOpen(false);\n }}\n >\n {/* Tooltip on an overlay-opener: hover-only (focus opens ignored) and\n force-closed while the menu is up, so it never lingers or flashes\n when focus returns on close. Inherits the nav TooltipProvider's\n delay/closeDelay/timeout. */}\n <Tooltip\n open={tipOpen && !open}\n onOpenChange={(next: boolean, details: { reason?: string }) => {\n // opens are hover-only; the trigger-focus open that follows a\n // menu close is ignored, closes always land\n if (next && details?.reason !== \"trigger-hover\") return;\n setTipOpen(next);\n }}\n >\n <DropdownMenuTrigger\n render={\n <TooltipTrigger\n render={\n <Button\n variant={nav.variant}\n size={nav.size}\n data-slot=\"event-calendar-view-switcher\"\n aria-label={labels.selectView}\n className={cn(\"gap-1\", nav.className, className)}\n render={render}\n />\n }\n />\n }\n {...props}\n >\n {children ?? (\n <>\n {viewLabel(view)}\n <ChevronDownIcon className=\"size-4 opacity-60\" aria-hidden=\"true\" />\n </>\n )}\n </DropdownMenuTrigger>\n {tipOpen && !open && tooltip !== null && !tooltips.disabled && (\n <TooltipContent side={tooltips.side} className={tooltips.className}>\n {tooltip ?? labels.selectView}\n </TooltipContent>\n )}\n </Tooltip>\n <DropdownMenuContent\n align=\"start\"\n className={cn(\"min-w-44\", viewConfig.classNames?.viewSwitcherContent)}\n >\n {/* Base UI contract: GroupLabel must live inside Menu.Group */}\n <DropdownMenuGroup>\n <DropdownMenuLabel\n className={cn(\n \"font-normal text-muted-foreground\",\n viewConfig.classNames?.viewSwitcherLabel,\n )}\n >\n {settings.i18n.labels.selectView}\n </DropdownMenuLabel>\n {availableViews.map((v) =>\n v === \"days\" ? (\n viewConfig.dayCountPresets.map((count) => (\n <DropdownMenuItem\n key={`days-${count}`}\n data-active={(view === \"days\" && dayCount === count) || undefined}\n onClick={() => selectView(\"days\", { dayCount: count })}\n >\n {settings.i18n.viewNames.days(count)}\n {/* hint derived from the preset itself, not i18n's default */}\n {viewConfig.enableShortcuts && (\n <EventCalendarViewShortcut>{count}</EventCalendarViewShortcut>\n )}\n </DropdownMenuItem>\n ))\n ) : (\n <DropdownMenuItem\n key={v}\n data-active={view === v || undefined}\n onClick={() => selectView(v)}\n >\n {viewLabel(v)}\n {viewConfig.enableShortcuts && (\n <EventCalendarViewShortcut>{labels.viewShortcuts[v]}</EventCalendarViewShortcut>\n )}\n </DropdownMenuItem>\n ),\n )}\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\n/** Outline key badge; theme-token only, so it adapts to every style. */\nfunction EventCalendarViewShortcut({ children }: { children: ReactNode }) {\n const viewConfig = useEventCalendarViewConfig();\n return (\n <kbd\n data-slot=\"event-calendar-view-shortcut\"\n className={cn(\n \"ms-auto inline-flex size-5 shrink-0 items-center justify-center rounded-sm border font-sans text-muted-foreground text-xs\",\n viewConfig.classNames?.viewShortcut,\n )}\n >\n {children}\n </kbd>\n );\n}\n\ninterface EventCalendarDatePickerProps\n extends Omit<useRender.ComponentProps<\"button\">, \"children\"> {\n children?: ReactNode;\n /** \"auto\" (default) resolves per view: range for week/N-days/agenda. */\n mode?: \"auto\" | \"single\" | \"range\";\n /** Hover/focus-visible hint; defaults to null - no tooltip, because the\n * button opens an overlay (see the NavButtonProps tooltip policy). */\n tooltip?: ReactNode | null;\n}\n\n/** Views whose period reads better as a highlighted range. */\nconst RANGE_VIEWS: CalendarView[] = [\"week\", \"days\", \"agenda\"];\n\n/**\n * Optional go-to-date picker (shadcn Calendar in a popover), view-aware:\n * week/N-days/agenda highlight the whole active range (any click re-anchors\n * the period), other views select a single date. Not part of the default\n * nav - compose it yourself (or any external picker driving\n * useEventCalendarNavigation().goTo). No tooltip by default: it opens an\n * overlay (see the NavButtonProps tooltip policy); pass `tooltip` to opt in.\n */\nfunction EventCalendarDatePicker({\n className,\n render,\n children,\n tooltip = null,\n mode,\n ...props\n}: EventCalendarDatePickerProps) {\n const { date, goTo, activeRange } = useEventCalendarNavigation();\n const { view } = useEventCalendarView();\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const nav = useNavButtonProps();\n const [open, setOpen] = useState(false);\n const zoned = toZoned(date, settings.timeZone);\n\n const configured = mode ?? \"auto\";\n const resolved =\n configured === \"auto\" ? (RANGE_VIEWS.includes(view) ? \"range\" : \"single\") : configured;\n\n const pick = (next: Date | undefined) => {\n if (!next) return;\n goTo(next);\n setOpen(false);\n };\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <NavTooltip content={tooltip}>\n <PopoverTrigger\n render={\n <Button\n variant={nav.variant}\n size={nav.iconSize}\n data-slot=\"event-calendar-date-picker\"\n data-mode={resolved}\n aria-label={settings.i18n.labels.goToDate}\n className={cn(nav.className, className)}\n render={render}\n />\n }\n {...props}\n >\n {children ?? <CalendarIcon className=\"size-4\" aria-hidden=\"true\" />}\n </PopoverTrigger>\n </NavTooltip>\n <PopoverContent\n align=\"start\"\n className={cn(\"w-auto p-0!\", viewConfig.classNames?.datePickerContent)}\n >\n {resolved === \"range\" ? (\n <Calendar\n mode=\"range\"\n selected={{\n from: toZoned(activeRange.start, settings.timeZone),\n to: toZoned(addDays(activeRange.end, -1), settings.timeZone),\n }}\n defaultMonth={zoned}\n onDayClick={pick}\n locale={settings.locale}\n weekStartsOn={settings.weekStartsOn}\n />\n ) : (\n <Calendar\n mode=\"single\"\n selected={zoned}\n defaultMonth={zoned}\n onSelect={pick}\n locale={settings.locale}\n weekStartsOn={settings.weekStartsOn}\n />\n )}\n </PopoverContent>\n </Popover>\n );\n}\n\ntype EventCalendarToolbarProps = useRender.ComponentProps<\"div\">;\n\n/** Free slot for consumer toolbar buttons; pure layout shell. */\nfunction EventCalendarToolbar({ className, render, ...props }: EventCalendarToolbarProps) {\n const viewConfig = useEventCalendarViewConfig();\n const defaultProps = {\n \"data-slot\": \"event-calendar-toolbar\",\n className: cn(\"flex items-center gap-2\", viewConfig.classNames?.toolbar, className),\n children: props.children,\n };\n return useRender({\n defaultTagName: \"div\",\n render,\n props: mergeProps<\"div\">(defaultProps, props),\n });\n}\n\ninterface EventCalendarNavProps extends useRender.ComponentProps<\"div\"> {\n /**\n * Render the view switcher in the composed layout. Turn off when the\n * calendar ships with a fixed view (e.g. a month-only embed) and users\n * should not be able to change it.\n * @default true\n */\n showViewSwitcher?: boolean;\n}\n\n/**\n * Default composed nav: Today, prev/next, title, spacer, view switcher.\n * Pass children to use it as a pure layout shell instead.\n */\nfunction EventCalendarNav({\n className,\n render,\n children,\n showViewSwitcher = true,\n ...props\n}: EventCalendarNavProps) {\n const viewConfig = useEventCalendarViewConfig();\n const tooltips = useNavTooltipConfig();\n const defaultProps = {\n \"data-slot\": \"event-calendar-nav\",\n className: cn(\n \"flex min-w-0 flex-wrap items-center gap-1 px-2 py-2\",\n viewConfig.stickyNav && \"sticky top-0 z-30 bg-background\",\n viewConfig.classNames?.nav,\n className,\n ),\n children: children ?? (\n // Shared provider: first tooltip waits, moving between buttons is instant\n <TooltipProvider\n delay={tooltips.delay}\n closeDelay={tooltips.closeDelay}\n timeout={tooltips.timeout}\n >\n <EventCalendarNavToday />\n {showViewSwitcher && <EventCalendarViewSwitcher />}\n <div className=\"flex items-center\">\n <EventCalendarNavPrev />\n <EventCalendarNavNext />\n </div>\n {/* ms-3 sets the title apart from the tight control cluster so the\n period reads as its own group, not another button */}\n <EventCalendarTitle className=\"ms-3\" />\n <div className=\"grow\" />\n </TooltipProvider>\n ),\n };\n return useRender({\n defaultTagName: \"div\",\n render,\n props: mergeProps<\"div\">(defaultProps, props),\n });\n}\n\nexport type {\n EventCalendarNavProps,\n EventCalendarTitleProps,\n EventCalendarToolbarProps,\n EventCalendarViewSwitcherProps,\n};\nexport {\n EventCalendarDatePicker,\n EventCalendarNav,\n EventCalendarNavNext,\n EventCalendarNavPrev,\n EventCalendarNavToday,\n EventCalendarTitle,\n EventCalendarToolbar,\n EventCalendarViewSwitcher,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiCA,SAAS,oBAKP;CACA,MAAM,aAAa,2BAA2B;CAC9C,OAAO;EACL,SAAS,WAAW;EACpB,MAAM,WAAW;EACjB,UAAU,WAAW,kBAAkB,OAAO,YAAY;EAC1D,WAAW,WAAW,YAAY;CACpC;AACF;;AAGA,SAAS,sBAOP;CACA,MAAM,aAAa,2BAA2B;CAC9C,MAAM,SAAS,WAAW,gBAAgB,QAAQ,KAAA,IAAY,WAAW;CACzE,OAAO;EACL,UAAU,WAAW,gBAAgB;EAIrC,MAAM,QAAQ,QAAQ;EACtB,OAAO,QAAQ,SAAS;EACxB,YAAY,QAAQ,cAAc;EAClC,SAAS,QAAQ,WAAW;EAC5B,WAAW,WAAW,YAAY;CACpC;AACF;;;AAoBA,SAAS,WAAW,EAClB,SACA,YAIC;CACD,MAAM,WAAW,oBAAoB;CACrC,IAAI,SAAS,YAAY,YAAY,QAAQ,YAAY,KAAA,GAAW,OAAO;CAC3E,OACE,qBAAC,SAAD,EAAA,UAAA,C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ACxB,WAAW,YAAY,KACvB,SACF;EACA,UAAU,YAER,qBAAC,iBAAD;GACE,OAAO,SAAS;GAChB,YAAY,SAAS;GACrB,SAAS,SAAS;GAHpB,UAAA;IAKE,oBAAC,uBAAD,CAAwB,CAAA;IACvB,oBAAoB,oBAAC,2BAAD,CAA4B,CAAA;IACjD,qBAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CACE,oBAAC,sBAAD,CAAuB,CAAA,GACvB,oBAAC,sBAAD,CAAuB,CAAA,CACpB;;IAGL,oBAAC,oBAAD,EAAoB,WAAU,OAAQ,CAAA;IACtC,oBAAC,OAAD,EAAK,WAAU,OAAQ,CAAA;GACR;;CAErB;CACA,OAAO,UAAU;EACf,gBAAgB;EAChB;EACA,OAAO,WAAkB,cAAc,KAAK;CAC9C,CAAC;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-calendar.d.ts","names":[],"sources":["../../../../src/components/reui/event-calendar/event-calendar.tsx"],"mappings":";;;;;;;cA4DM,YAAY;cACZ,WAAW;UAsCP,uBAAuB;EAC/B,gBAAgB,YAAY,wBAAwB,QAAQ,GAAG,MAAM;EACrE,sBAAsB,YAAY,wBAAwB,QAAQ,GAAG,MAAM;EAC3E,iBAAiB,QAAQ,4BAA4B,WAAW;EAChE,gBAAgB,QAAQ,4BAA4B;;;;;;;;EAQpD,iBACE,YAAY,wBAAwB,QACpC;IACE;IACA;;EAGJ,eAAe,MAAM,uBAAuB,GAAG,MAAM;EACrD,gBAAgB,MAAM;EACtB,iBAAiB,MAAM;EACvB,iBAAiB,MAAM;EACvB,gBAAgB,MAAM;EACtB,gBAAgB,MAAM;EACtB,oBAAoB;EACpB,qBAAqB,WAAW;EAChC,wBAAwB,cAAc;EACtC,wBAAwB,cAAc;EACtC,kBAAkB,QAAQ,cAAc;EACxC,eACE,KAAK,MACL,UAAU,wBAAwB,UAClC,GAAG,MAAM;;UAIH,6BAA6B,yBAAyB,uBAAuB;EACrF,SAAS,cAAc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BAAqB;IAAS,MAAM,uBAAuB;QAAa;EACxE,mBAAmB;IACjB,KAAK;IACL,UAAU,uBAAuB;IACjC;IACA;IACA;IACA,gBAAgB;QACZ;;;;;;EAMN,6BAA6B;IAC3B,KAAK;IACL;IACA;IACA;QACI;EACN,mBAAmB;IAAS,KAAK;IAAM,MAAM;IAAc;QAAuB;EAClF,wBAAwB;IAAS,MAAM;IAAM;IAAc;QAAqB;EAChF,uBAAuB;IACrB,MAAM;IACN,UAAU,qBAAqB;QAC3B;EACN,uBAAuB;IACrB,KAAK;IACL;IACA,UAAU,qBAAqB;QAC3B;;;;;;;EAON,qBAAqB;IACnB,KAAK;IACL,UAAU,qBAAqB;IAC/B;QACI;;;;;;EAMN,4BAA4B,YAAY,wBAAwB,WAAW;EAC3E,sBAAsB;IAAS,MAAM;QAAW;EAChD,uBAAuB;;EAEvB,wBAAwB;IAAS,UAAU;QAA4B;;EAEvE,yBAAyB;IACvB,KAAK;IACL;IACA;IACA;IACA,gBAAgB;QACZ;;EAEN,0BAA0B;IACxB,KAAK;IACL,aAAa,wBAAwB;IACrC;IACA;IACA,gBAAgB;QACZ;;;;;EAKN;;;;;EAKA;IAGM;IACA;IACA;IACA;;;;;;;;EAQN;IAGM;IACA;;;;;;EAMN;;EAEA;;EAEA;;EAEA;;cAGI,qBAAqB;cAsBrB,gDAA8B,QAAA;;iBAO3B,2BAA2B,oBAAoB,wBAAwB;;iBAkDvE;EAAiC,MAAM;;UAQtC,mBAAmB,yBACnB,6BAA6B,QACnC,QAAQ,wBAAwB,SAChC,KAAK,UAAU;;EAEjB,WAAW,sBAAsB;;EAEjC,SAAS,UAAU,iBAAiB;EACpC,WAAW;;;;;;iBAiFJ,cAAc,mBACrB,UACA,QACA,WACA,QACA,aACG,SACF,mBAAmB,yBAAM,IAAA"}
|
|
@@ -546,47 +546,47 @@ function useEventCalendarView() {
|
|
|
546
546
|
*/
|
|
547
547
|
const midnightTicker = (() => {
|
|
548
548
|
const zones = /* @__PURE__ */ new Map();
|
|
549
|
-
let version = 0;
|
|
550
549
|
const arm = (timeZone) => {
|
|
551
550
|
const entry = zones.get(timeZone);
|
|
552
551
|
if (!entry) return;
|
|
553
552
|
const now = /* @__PURE__ */ new Date();
|
|
554
553
|
const next = zonedStartOfDay(addDays(toZoned(now, timeZone), 1), timeZone).getTime();
|
|
555
554
|
entry.timer = setTimeout(() => {
|
|
556
|
-
version++;
|
|
557
555
|
entry.listeners.forEach((listener) => {
|
|
558
556
|
listener();
|
|
559
557
|
});
|
|
560
558
|
arm(timeZone);
|
|
561
559
|
}, Math.max(1e3, next - now.getTime()));
|
|
562
560
|
};
|
|
563
|
-
return {
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
timer: null
|
|
570
|
-
};
|
|
571
|
-
zones.set(timeZone, entry);
|
|
572
|
-
entry.listeners.add(listener);
|
|
573
|
-
arm(timeZone);
|
|
574
|
-
} else entry.listeners.add(listener);
|
|
575
|
-
const current = entry;
|
|
576
|
-
return () => {
|
|
577
|
-
current.listeners.delete(listener);
|
|
578
|
-
if (current.listeners.size > 0) return;
|
|
579
|
-
if (current.timer) clearTimeout(current.timer);
|
|
580
|
-
zones.delete(timeZone);
|
|
561
|
+
return { subscribe(timeZone, listener) {
|
|
562
|
+
let entry = zones.get(timeZone);
|
|
563
|
+
if (!entry) {
|
|
564
|
+
entry = {
|
|
565
|
+
listeners: /* @__PURE__ */ new Set(),
|
|
566
|
+
timer: null
|
|
581
567
|
};
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
568
|
+
zones.set(timeZone, entry);
|
|
569
|
+
entry.listeners.add(listener);
|
|
570
|
+
arm(timeZone);
|
|
571
|
+
} else entry.listeners.add(listener);
|
|
572
|
+
const current = entry;
|
|
573
|
+
return () => {
|
|
574
|
+
current.listeners.delete(listener);
|
|
575
|
+
if (current.listeners.size > 0) return;
|
|
576
|
+
if (current.timer) clearTimeout(current.timer);
|
|
577
|
+
zones.delete(timeZone);
|
|
578
|
+
};
|
|
579
|
+
} };
|
|
585
580
|
})();
|
|
586
|
-
/**
|
|
587
|
-
|
|
581
|
+
/**
|
|
582
|
+
* Today's day key in `timeZone`, re-rendering the caller at the next midnight.
|
|
583
|
+
* The clock is read in the snapshot, never in render: React Compiler caches a
|
|
584
|
+
* render-time `new Date()`, so the wake-up re-rendered yesterday's answer.
|
|
585
|
+
*/
|
|
586
|
+
function useTodayKey(timeZone) {
|
|
588
587
|
const subscribe = useCallback((listener) => midnightTicker.subscribe(timeZone, listener), [timeZone]);
|
|
589
|
-
|
|
588
|
+
const getSnapshot = useCallback(() => getDayKey(/* @__PURE__ */ new Date(), timeZone), [timeZone]);
|
|
589
|
+
return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
590
590
|
}
|
|
591
591
|
function useEventCalendarNavigation() {
|
|
592
592
|
const instance = useEventCalendar();
|
|
@@ -598,8 +598,11 @@ function useEventCalendarNavigation() {
|
|
|
598
598
|
activeRange: state.activeRange
|
|
599
599
|
}), { isEqual: (a, b) => a.date.getTime() === b.date.getTime() && a.view === b.view && getRangeKey(a.visibleRange) === getRangeKey(b.visibleRange) });
|
|
600
600
|
useEventCalendarSettingsVersion(instance);
|
|
601
|
-
|
|
602
|
-
const
|
|
601
|
+
useTodayKey(settings.timeZone);
|
|
602
|
+
const isToday = useEventCalendarSelector((state) => {
|
|
603
|
+
const now = /* @__PURE__ */ new Date();
|
|
604
|
+
return now >= state.activeRange.start && now < state.activeRange.end;
|
|
605
|
+
});
|
|
603
606
|
return {
|
|
604
607
|
date: slice.date,
|
|
605
608
|
title: settings.i18n.functions.formatTitle(slice.view, {
|
|
@@ -614,7 +617,7 @@ function useEventCalendarNavigation() {
|
|
|
614
617
|
prev: instance.api.prev,
|
|
615
618
|
today: instance.api.today,
|
|
616
619
|
goTo: instance.api.goTo,
|
|
617
|
-
isToday
|
|
620
|
+
isToday
|
|
618
621
|
};
|
|
619
622
|
}
|
|
620
623
|
function useEventCalendarSelection() {
|
|
@@ -658,11 +661,11 @@ function useEventCalendarDay(day) {
|
|
|
658
661
|
calendar: instance,
|
|
659
662
|
isEqual: (a, b) => getRangeKey(a) === getRangeKey(b)
|
|
660
663
|
});
|
|
661
|
-
|
|
664
|
+
const todayKey = useTodayKey(timeZone);
|
|
662
665
|
const dayStart = zonedStartOfDay(day, timeZone);
|
|
663
666
|
return {
|
|
664
667
|
segments: bucket,
|
|
665
|
-
isToday:
|
|
668
|
+
isToday: todayKey === dayKey,
|
|
666
669
|
isOutside: dayStart < activeRange.start || dayStart >= activeRange.end
|
|
667
670
|
};
|
|
668
671
|
}
|