@kumix/ui 0.3.13 → 0.3.15
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 +12 -12
- package/dist/components/agents/agent-activity/activity-row.js +1 -1
- package/dist/components/agents/agent-activity/activity-row.js.map +1 -1
- package/dist/components/agents/agent-activity/index.js +1 -1
- package/dist/components/agents/agent-activity/index.js.map +1 -1
- package/dist/components/agents/agent-code.d.ts.map +1 -1
- package/dist/components/agents/agent-code.js +1 -1
- package/dist/components/agents/agent-code.js.map +1 -1
- package/dist/components/agents/agent-disclosure.js +1 -1
- package/dist/components/agents/agent-disclosure.js.map +1 -1
- package/dist/components/agents/ai-sidebar.js +1 -1
- package/dist/components/agents/ai-sidebar.js.map +1 -1
- package/dist/components/agents/approval-card/index.js +1 -1
- package/dist/components/agents/approval-card/index.js.map +1 -1
- package/dist/components/agents/chat-app.js +1 -1
- package/dist/components/agents/chat-app.js.map +1 -1
- package/dist/components/agents/citations.js +1 -1
- package/dist/components/agents/citations.js.map +1 -1
- package/dist/components/agents/code-block.js +1 -1
- package/dist/components/agents/code-block.js.map +1 -1
- package/dist/components/agents/file-diff.js +1 -1
- package/dist/components/agents/file-diff.js.map +1 -1
- package/dist/components/agents/image-generation.js +1 -1
- package/dist/components/agents/image-generation.js.map +1 -1
- package/dist/components/agents/loading-states/agent-progress.js +1 -1
- package/dist/components/agents/loading-states/agent-progress.js.map +1 -1
- package/dist/components/agents/loading-states/reasoning-text.js +1 -1
- package/dist/components/agents/loading-states/reasoning-text.js.map +1 -1
- package/dist/components/agents/loading-states/thinking-shimmer.js +1 -1
- package/dist/components/agents/loading-states/thinking-shimmer.js.map +1 -1
- package/dist/components/agents/message-bubble.js +1 -1
- package/dist/components/agents/message-bubble.js.map +1 -1
- package/dist/components/agents/message-scroller.js +1 -1
- package/dist/components/agents/message-scroller.js.map +1 -1
- package/dist/components/agents/message.js +1 -1
- package/dist/components/agents/message.js.map +1 -1
- package/dist/components/agents/prompt-input.js +1 -1
- package/dist/components/agents/prompt-input.js.map +1 -1
- package/dist/components/agents/streaming-response.js +1 -1
- package/dist/components/agents/streaming-response.js.map +1 -1
- package/dist/components/agents/todo-list.js +1 -1
- package/dist/components/agents/todo-list.js.map +1 -1
- package/dist/components/agents/tool-approval.js +1 -1
- package/dist/components/agents/tool-approval.js.map +1 -1
- package/dist/components/agents/tool-result.js +1 -1
- package/dist/components/agents/tool-result.js.map +1 -1
- package/dist/components/motion/action-swap.js +1 -1
- package/dist/components/motion/action-swap.js.map +1 -1
- package/dist/components/motion/adaptive-stepper.js +1 -1
- package/dist/components/motion/adaptive-stepper.js.map +1 -1
- package/dist/components/motion/animated-badge.js +1 -1
- package/dist/components/motion/animated-badge.js.map +1 -1
- package/dist/components/motion/animated-number.js +1 -1
- package/dist/components/motion/animated-number.js.map +1 -1
- package/dist/components/motion/animated-sidebar.js +1 -1
- package/dist/components/motion/animated-sidebar.js.map +1 -1
- package/dist/components/motion/animated-toast-stack.js +5 -4
- package/dist/components/motion/animated-toast-stack.js.map +1 -1
- package/dist/components/motion/attachment-upload.js +1 -1
- package/dist/components/motion/attachment-upload.js.map +1 -1
- package/dist/components/motion/availability-scheduler/icon-button.js +1 -1
- package/dist/components/motion/availability-scheduler/icon-button.js.map +1 -1
- package/dist/components/motion/availability-scheduler/index.js +1 -1
- package/dist/components/motion/availability-scheduler/index.js.map +1 -1
- package/dist/components/motion/bloom-menu.js +1 -1
- package/dist/components/motion/bloom-menu.js.map +1 -1
- package/dist/components/motion/bottom-sheet.js +1 -1
- 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 +1 -1
- package/dist/components/motion/bounce-sidebar.js.map +1 -1
- package/dist/components/motion/bouncy-accordion.js +1 -1
- package/dist/components/motion/bouncy-accordion.js.map +1 -1
- package/dist/components/motion/button/base.js +1 -1
- package/dist/components/motion/button/base.js.map +1 -1
- package/dist/components/motion/button/metallic.js +1 -1
- package/dist/components/motion/button/metallic.js.map +1 -1
- package/dist/components/motion/card-folder.js +1 -1
- package/dist/components/motion/card-folder.js.map +1 -1
- package/dist/components/motion/center-morph-modal.js +1 -1
- package/dist/components/motion/center-morph-modal.js.map +1 -1
- package/dist/components/motion/checkbox.js +1 -1
- package/dist/components/motion/checkbox.js.map +1 -1
- package/dist/components/motion/chromatic-text-reveal.js +1 -1
- package/dist/components/motion/chromatic-text-reveal.js.map +1 -1
- package/dist/components/motion/combobox/content.js +1 -1
- package/dist/components/motion/combobox/content.js.map +1 -1
- package/dist/components/motion/combobox/context.js +1 -1
- package/dist/components/motion/combobox/context.js.map +1 -1
- package/dist/components/motion/combobox/list.js +1 -1
- package/dist/components/motion/combobox/list.js.map +1 -1
- package/dist/components/motion/combobox/trigger.js +1 -1
- package/dist/components/motion/combobox/trigger.js.map +1 -1
- package/dist/components/motion/command-palette.d.ts.map +1 -1
- package/dist/components/motion/command-palette.js +3 -22
- package/dist/components/motion/command-palette.js.map +1 -1
- package/dist/components/motion/context-menu.js +1 -1
- package/dist/components/motion/context-menu.js.map +1 -1
- package/dist/components/motion/cylinder-carousel.js +1 -1
- package/dist/components/motion/cylinder-carousel.js.map +1 -1
- package/dist/components/motion/digit-swap.js +1 -1
- package/dist/components/motion/digit-swap.js.map +1 -1
- package/dist/components/motion/dock.js +1 -1
- package/dist/components/motion/dock.js.map +1 -1
- package/dist/components/motion/drawer.js +1 -1
- package/dist/components/motion/drawer.js.map +1 -1
- package/dist/components/motion/dynamic-island.js +1 -1
- package/dist/components/motion/dynamic-island.js.map +1 -1
- package/dist/components/motion/expandable-action-bar.js +1 -1
- package/dist/components/motion/expandable-action-bar.js.map +1 -1
- package/dist/components/motion/expandable-control.d.ts.map +1 -1
- package/dist/components/motion/expandable-control.js +1 -1
- package/dist/components/motion/expandable-control.js.map +1 -1
- package/dist/components/motion/expandable-tabs.js +1 -1
- package/dist/components/motion/expandable-tabs.js.map +1 -1
- package/dist/components/motion/expanding-arrow-button.js +1 -1
- package/dist/components/motion/expanding-arrow-button.js.map +1 -1
- package/dist/components/motion/feedback-widget.js +1 -1
- package/dist/components/motion/feedback-widget.js.map +1 -1
- package/dist/components/motion/file-tree.js +1 -1
- package/dist/components/motion/file-tree.js.map +1 -1
- package/dist/components/motion/file-upload.js +1 -1
- package/dist/components/motion/file-upload.js.map +1 -1
- package/dist/components/motion/hold-action-button.js +1 -1
- package/dist/components/motion/hold-action-button.js.map +1 -1
- package/dist/components/motion/infinite-masonry.js +1 -1
- package/dist/components/motion/infinite-masonry.js.map +1 -1
- package/dist/components/motion/input.d.ts.map +1 -1
- package/dist/components/motion/input.js +1 -1
- package/dist/components/motion/input.js.map +1 -1
- package/dist/components/motion/liquid.js +1 -1
- package/dist/components/motion/liquid.js.map +1 -1
- package/dist/components/motion/loader.js +1 -1
- package/dist/components/motion/loader.js.map +1 -1
- package/dist/components/motion/magnetic.js +1 -1
- package/dist/components/motion/magnetic.js.map +1 -1
- package/dist/components/motion/marquee.d.ts.map +1 -1
- package/dist/components/motion/marquee.js +1 -1
- package/dist/components/motion/marquee.js.map +1 -1
- package/dist/components/motion/morphing-modal.js +1 -1
- package/dist/components/motion/morphing-modal.js.map +1 -1
- package/dist/components/motion/morphing-search.js +1 -1
- package/dist/components/motion/morphing-search.js.map +1 -1
- package/dist/components/motion/morphing-tabs.js +1 -1
- package/dist/components/motion/morphing-tabs.js.map +1 -1
- package/dist/components/motion/multi-select/content.js +1 -1
- package/dist/components/motion/multi-select/content.js.map +1 -1
- package/dist/components/motion/multi-select/context.js +1 -1
- package/dist/components/motion/multi-select/context.js.map +1 -1
- package/dist/components/motion/multi-select/list.js +1 -1
- package/dist/components/motion/multi-select/list.js.map +1 -1
- package/dist/components/motion/multi-select/trigger.js +1 -1
- package/dist/components/motion/multi-select/trigger.js.map +1 -1
- package/dist/components/motion/not-found/magnetic.d.ts.map +1 -1
- package/dist/components/motion/not-found/magnetic.js +1 -1
- package/dist/components/motion/not-found/magnetic.js.map +1 -1
- package/dist/components/motion/not-found/shared.js +1 -1
- package/dist/components/motion/not-found/shared.js.map +1 -1
- package/dist/components/motion/not-found/spotlight.js +1 -1
- package/dist/components/motion/not-found/spotlight.js.map +1 -1
- package/dist/components/motion/notification-stack.js +1 -1
- package/dist/components/motion/notification-stack.js.map +1 -1
- package/dist/components/motion/number-ticker.js +1 -1
- package/dist/components/motion/number-ticker.js.map +1 -1
- package/dist/components/motion/otp-input.js +1 -1
- package/dist/components/motion/otp-input.js.map +1 -1
- package/dist/components/motion/overflow-actions.js +1 -1
- package/dist/components/motion/overflow-actions.js.map +1 -1
- package/dist/components/motion/parallax.d.ts.map +1 -1
- package/dist/components/motion/parallax.js +1 -1
- package/dist/components/motion/parallax.js.map +1 -1
- package/dist/components/motion/popover-morph.js +1 -1
- package/dist/components/motion/popover-morph.js.map +1 -1
- package/dist/components/motion/popover.js +1 -1
- package/dist/components/motion/popover.js.map +1 -1
- package/dist/components/motion/preview-rail.js +1 -1
- package/dist/components/motion/preview-rail.js.map +1 -1
- package/dist/components/motion/project-folder.js +1 -1
- package/dist/components/motion/project-folder.js.map +1 -1
- package/dist/components/motion/pull-to-refresh.js +1 -1
- package/dist/components/motion/pull-to-refresh.js.map +1 -1
- package/dist/components/motion/radio.js +1 -1
- package/dist/components/motion/radio.js.map +1 -1
- package/dist/components/motion/range-slider-bubble.js +1 -1
- package/dist/components/motion/range-slider-bubble.js.map +1 -1
- package/dist/components/motion/range-slider-fluid.js +1 -1
- package/dist/components/motion/range-slider-fluid.js.map +1 -1
- package/dist/components/motion/range-slider-inline.d.ts +18 -0
- package/dist/components/motion/range-slider-inline.d.ts.map +1 -0
- package/dist/components/motion/range-slider-inline.js +267 -0
- package/dist/components/motion/range-slider-inline.js.map +1 -0
- package/dist/components/motion/range-slider-ruler.js +1 -1
- package/dist/components/motion/range-slider-ruler.js.map +1 -1
- package/dist/components/motion/range-slider-wave.js +1 -1
- package/dist/components/motion/range-slider-wave.js.map +1 -1
- package/dist/components/motion/range-slider.d.ts.map +1 -1
- package/dist/components/motion/range-slider.js +27 -11
- package/dist/components/motion/range-slider.js.map +1 -1
- package/dist/components/motion/scroll-progress.js +1 -1
- package/dist/components/motion/scroll-progress.js.map +1 -1
- package/dist/components/motion/scroll-reveal.js +1 -1
- package/dist/components/motion/scroll-reveal.js.map +1 -1
- package/dist/components/motion/scroll-to.js +1 -1
- package/dist/components/motion/scroll-to.js.map +1 -1
- package/dist/components/motion/select-morph.d.ts.map +1 -1
- package/dist/components/motion/select-morph.js +1 -1
- package/dist/components/motion/select-morph.js.map +1 -1
- package/dist/components/motion/select.js +1 -1
- package/dist/components/motion/select.js.map +1 -1
- package/dist/components/motion/shader-background.d.ts.map +1 -1
- package/dist/components/motion/shader-background.js +1 -1
- package/dist/components/motion/shader-background.js.map +1 -1
- package/dist/components/motion/shared-layout-bg.js +1 -1
- package/dist/components/motion/shared-layout-bg.js.map +1 -1
- package/dist/components/motion/signup-form.js +1 -1
- package/dist/components/motion/signup-form.js.map +1 -1
- package/dist/components/motion/slide-action-button.js +1 -1
- package/dist/components/motion/slide-action-button.js.map +1 -1
- package/dist/components/motion/swipeable-list.js +1 -1
- package/dist/components/motion/swipeable-list.js.map +1 -1
- package/dist/components/motion/switch.d.ts.map +1 -1
- package/dist/components/motion/switch.js +1 -1
- package/dist/components/motion/switch.js.map +1 -1
- package/dist/components/motion/table/index.js +1 -1
- package/dist/components/motion/table/index.js.map +1 -1
- package/dist/components/motion/table/skeleton-rows.d.ts.map +1 -1
- package/dist/components/motion/table/skeleton-rows.js +1 -1
- package/dist/components/motion/table/skeleton-rows.js.map +1 -1
- package/dist/components/motion/table/table-header.js +1 -1
- package/dist/components/motion/table/table-header.js.map +1 -1
- package/dist/components/motion/table/table-menu.js +1 -1
- package/dist/components/motion/table/table-menu.js.map +1 -1
- package/dist/components/motion/tabs.js +2 -2
- package/dist/components/motion/tabs.js.map +1 -1
- package/dist/components/motion/text-reveal.js +1 -1
- package/dist/components/motion/text-reveal.js.map +1 -1
- package/dist/components/motion/text-scramble.d.ts.map +1 -1
- package/dist/components/motion/text-scramble.js +1 -1
- package/dist/components/motion/text-scramble.js.map +1 -1
- package/dist/components/motion/text-shimmer.js +1 -1
- package/dist/components/motion/text-shimmer.js.map +1 -1
- package/dist/components/motion/theme-toggle.js +1 -1
- package/dist/components/motion/theme-toggle.js.map +1 -1
- package/dist/components/motion/tilt-card.js +1 -1
- package/dist/components/motion/tilt-card.js.map +1 -1
- package/dist/components/motion/tooltip-surface.d.ts +12 -0
- package/dist/components/motion/tooltip-surface.d.ts.map +1 -0
- package/dist/components/motion/tooltip-surface.js +97 -0
- package/dist/components/motion/tooltip-surface.js.map +1 -0
- package/dist/components/motion/tooltip.d.ts +13 -3
- package/dist/components/motion/tooltip.d.ts.map +1 -1
- package/dist/components/motion/tooltip.js +75 -104
- package/dist/components/motion/tooltip.js.map +1 -1
- package/dist/components/motion/wheel-picker.js +1 -1
- package/dist/components/motion/wheel-picker.js.map +1 -1
- package/dist/components/reui/alert.d.ts +1 -1
- package/dist/components/reui/alert.d.ts.map +1 -1
- package/dist/components/reui/alert.js +1 -1
- package/dist/components/reui/alert.js.map +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 +2 -2
- package/dist/components/reui/autocomplete.js.map +1 -1
- package/dist/components/reui/badge.d.ts +2 -2
- package/dist/components/reui/badge.d.ts.map +1 -1
- package/dist/components/reui/badge.js +1 -1
- package/dist/components/reui/badge.js.map +1 -1
- package/dist/components/reui/cascader/cascader-columns.js +1 -1
- package/dist/components/reui/cascader/cascader-columns.js.map +1 -1
- package/dist/components/reui/cascader/cascader-footer.js +1 -1
- package/dist/components/reui/cascader/cascader-footer.js.map +1 -1
- package/dist/components/reui/cascader/cascader-item.js +1 -1
- package/dist/components/reui/cascader/cascader-item.js.map +1 -1
- package/dist/components/reui/cascader/cascader-nav.js +1 -1
- package/dist/components/reui/cascader/cascader-nav.js.map +1 -1
- package/dist/components/reui/cascader/cascader.js +1 -1
- package/dist/components/reui/cascader/cascader.js.map +1 -1
- package/dist/components/reui/code-block/code-block.js +1 -1
- package/dist/components/reui/code-block/code-block.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-cell-selection.js +1 -1
- package/dist/components/reui/data-grid/data-grid-cell-selection.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-filter.js +1 -1
- package/dist/components/reui/data-grid/data-grid-column-filter.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-header.js +1 -1
- package/dist/components/reui/data-grid/data-grid-column-header.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-pagination.js +1 -1
- package/dist/components/reui/data-grid/data-grid-pagination.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-scroll-area.js +1 -1
- 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.js +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-virtual.js +1 -1
- package/dist/components/reui/data-grid/data-grid-table-virtual.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table.js +1 -1
- package/dist/components/reui/data-grid/data-grid-table.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid.js +1 -1
- package/dist/components/reui/data-grid/data-grid.js.map +1 -1
- package/dist/components/reui/date-selector.js +1 -1
- package/dist/components/reui/date-selector.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-agenda-view.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-agenda-view.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-content.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-content.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-event.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-event.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-month-view.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-month-view.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-nav.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-nav.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-resource-view.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-resource-view.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-time-grid.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-time-grid.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar.js.map +1 -1
- package/dist/components/reui/filters/filters-advanced.js +1 -1
- package/dist/components/reui/filters/filters-advanced.js.map +1 -1
- package/dist/components/reui/filters/filters-builder.js +1 -1
- package/dist/components/reui/filters/filters-builder.js.map +1 -1
- package/dist/components/reui/filters/filters-chip.js +1 -1
- package/dist/components/reui/filters/filters-chip.js.map +1 -1
- package/dist/components/reui/filters/filters-editors.js +1 -1
- package/dist/components/reui/filters/filters-editors.js.map +1 -1
- package/dist/components/reui/filters/filters.js +1 -1
- package/dist/components/reui/filters/filters.js.map +1 -1
- package/dist/components/reui/frame.d.ts +6 -12
- package/dist/components/reui/frame.d.ts.map +1 -1
- package/dist/components/reui/frame.js +10 -17
- package/dist/components/reui/frame.js.map +1 -1
- package/dist/components/reui/gantt/gantt-bar.js +1 -1
- package/dist/components/reui/gantt/gantt-bar.js.map +1 -1
- package/dist/components/reui/gantt/gantt-nav.js +1 -1
- package/dist/components/reui/gantt/gantt-nav.js.map +1 -1
- package/dist/components/reui/gantt/gantt-view.js +1 -1
- package/dist/components/reui/gantt/gantt-view.js.map +1 -1
- package/dist/components/reui/gantt/gantt.js +1 -1
- package/dist/components/reui/gantt/gantt.js.map +1 -1
- package/dist/components/reui/icon-stack.js +1 -1
- package/dist/components/reui/icon-stack.js.map +1 -1
- package/dist/components/reui/icon-tile.d.ts +2 -2
- package/dist/components/reui/icon-tile.d.ts.map +1 -1
- package/dist/components/reui/icon-tile.js +1 -1
- 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 +4 -4
- package/dist/components/reui/number-field.js.map +1 -1
- package/dist/components/reui/phone-input.js +1 -1
- package/dist/components/reui/phone-input.js.map +1 -1
- package/dist/components/reui/rating.d.ts +1 -1
- package/dist/components/reui/rating.d.ts.map +1 -1
- package/dist/components/reui/rating.js +1 -1
- package/dist/components/reui/rating.js.map +1 -1
- package/dist/components/reui/sortable.d.ts.map +1 -1
- package/dist/components/reui/sortable.js +1 -1
- package/dist/components/reui/sortable.js.map +1 -1
- package/dist/components/reui/stepper.d.ts.map +1 -1
- package/dist/components/reui/stepper.js +1 -1
- package/dist/components/reui/stepper.js.map +1 -1
- package/dist/components/reui/timeline.d.ts.map +1 -1
- package/dist/components/reui/timeline.js +1 -1
- package/dist/components/reui/timeline.js.map +1 -1
- package/dist/components/reui/tree.d.ts.map +1 -1
- package/dist/components/reui/tree.js +1 -1
- package/dist/components/reui/tree.js.map +1 -1
- package/dist/components/ui/accordion.d.ts.map +1 -1
- package/dist/components/ui/accordion.js +1 -1
- package/dist/components/ui/accordion.js.map +1 -1
- package/dist/components/ui/alert-dialog.js +1 -1
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/alert.js +1 -1
- package/dist/components/ui/alert.js.map +1 -1
- package/dist/components/ui/aspect-ratio.js +1 -1
- package/dist/components/ui/aspect-ratio.js.map +1 -1
- package/dist/components/ui/attachment.d.ts +1 -1
- package/dist/components/ui/attachment.js +1 -1
- package/dist/components/ui/attachment.js.map +1 -1
- package/dist/components/ui/avatar.d.ts.map +1 -1
- package/dist/components/ui/avatar.js +1 -1
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/badge.js +1 -1
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb.js +1 -1
- package/dist/components/ui/breadcrumb.js.map +1 -1
- package/dist/components/ui/bubble.d.ts +1 -1
- package/dist/components/ui/bubble.d.ts.map +1 -1
- package/dist/components/ui/bubble.js +1 -1
- package/dist/components/ui/bubble.js.map +1 -1
- package/dist/components/ui/button-group.js +1 -1
- package/dist/components/ui/button-group.js.map +1 -1
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/calendar.js +1 -1
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/card.js +1 -1
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/carousel.js +1 -1
- package/dist/components/ui/carousel.js.map +1 -1
- package/dist/components/ui/chart.d.ts.map +1 -1
- package/dist/components/ui/chart.js +1 -1
- package/dist/components/ui/chart.js.map +1 -1
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/combobox.js +1 -1
- package/dist/components/ui/combobox.js.map +1 -1
- package/dist/components/ui/command.js +1 -1
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/context-menu.d.ts.map +1 -1
- package/dist/components/ui/context-menu.js +1 -1
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/dialog.js +1 -1
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/drawer.js +1 -1
- package/dist/components/ui/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +1 -1
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/empty.d.ts.map +1 -1
- package/dist/components/ui/empty.js +1 -1
- package/dist/components/ui/empty.js.map +1 -1
- package/dist/components/ui/field.js +1 -1
- package/dist/components/ui/field.js.map +1 -1
- package/dist/components/ui/hover-card.d.ts.map +1 -1
- package/dist/components/ui/hover-card.js +1 -1
- package/dist/components/ui/hover-card.js.map +1 -1
- package/dist/components/ui/input-group.d.ts +1 -1
- package/dist/components/ui/input-group.js +1 -1
- package/dist/components/ui/input-group.js.map +1 -1
- package/dist/components/ui/input-otp.d.ts.map +1 -1
- package/dist/components/ui/input-otp.js +1 -1
- package/dist/components/ui/input-otp.js.map +1 -1
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/input.js +1 -1
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/item.d.ts +2 -2
- package/dist/components/ui/item.js +1 -1
- package/dist/components/ui/item.js.map +1 -1
- package/dist/components/ui/kbd.js +1 -1
- package/dist/components/ui/kbd.js.map +1 -1
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/label.js +1 -1
- package/dist/components/ui/label.js.map +1 -1
- package/dist/components/ui/marker.d.ts +1 -1
- package/dist/components/ui/marker.d.ts.map +1 -1
- package/dist/components/ui/marker.js +1 -1
- package/dist/components/ui/marker.js.map +1 -1
- package/dist/components/ui/menubar.js +1 -1
- package/dist/components/ui/menubar.js.map +1 -1
- package/dist/components/ui/message-scroller.js +1 -1
- package/dist/components/ui/message-scroller.js.map +1 -1
- package/dist/components/ui/message.d.ts.map +1 -1
- package/dist/components/ui/message.js +1 -1
- package/dist/components/ui/message.js.map +1 -1
- package/dist/components/ui/native-select.d.ts.map +1 -1
- package/dist/components/ui/native-select.js +1 -1
- package/dist/components/ui/native-select.js.map +1 -1
- package/dist/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu.js +1 -1
- package/dist/components/ui/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination.js +1 -1
- package/dist/components/ui/pagination.js.map +1 -1
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +1 -1
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/progress.js +1 -1
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/questionnaire.js +1 -1
- package/dist/components/ui/questionnaire.js.map +1 -1
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group.js +1 -1
- package/dist/components/ui/radio-group.js.map +1 -1
- package/dist/components/ui/resizable.d.ts.map +1 -1
- package/dist/components/ui/resizable.js +1 -1
- package/dist/components/ui/resizable.js.map +1 -1
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.js +1 -1
- package/dist/components/ui/scroll-area.js.map +1 -1
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +1 -1
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/separator.d.ts.map +1 -1
- package/dist/components/ui/separator.js +1 -1
- package/dist/components/ui/separator.js.map +1 -1
- package/dist/components/ui/sheet.js +1 -1
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/components/ui/sidebar.d.ts +1 -1
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/sidebar.js.map +1 -1
- package/dist/components/ui/skeleton.js +1 -1
- package/dist/components/ui/skeleton.js.map +1 -1
- package/dist/components/ui/slider.d.ts.map +1 -1
- package/dist/components/ui/slider.js +1 -1
- package/dist/components/ui/slider.js.map +1 -1
- package/dist/components/ui/spinner.d.ts.map +1 -1
- package/dist/components/ui/spinner.js +1 -1
- package/dist/components/ui/spinner.js.map +1 -1
- package/dist/components/ui/switch.d.ts.map +1 -1
- package/dist/components/ui/switch.js +1 -1
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js +1 -1
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/tabs.d.ts +1 -1
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/tabs.js +1 -1
- package/dist/components/ui/tabs.js.map +1 -1
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea.js +1 -1
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/components/ui/toast.js +1 -1
- package/dist/components/ui/toast.js.map +1 -1
- package/dist/components/ui/toggle-group.js +1 -1
- package/dist/components/ui/toggle-group.js.map +1 -1
- package/dist/components/ui/toggle.d.ts +1 -1
- package/dist/components/ui/toggle.d.ts.map +1 -1
- package/dist/components/ui/toggle.js +1 -1
- package/dist/components/ui/toggle.js.map +1 -1
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip.js +1 -1
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/hooks/use-dismiss.d.ts +1 -1
- package/dist/hooks/use-dismiss.d.ts.map +1 -1
- package/dist/hooks/use-dismiss.js.map +1 -1
- package/dist/lib/command-search.d.ts +10 -0
- package/dist/lib/command-search.d.ts.map +1 -0
- package/dist/lib/command-search.js +52 -0
- package/dist/lib/command-search.js.map +1 -0
- package/package.json +10 -12
|
@@ -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 { cn } from \"cn\";\nimport { addDays, format } from \"date-fns\";\nimport { CalendarIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\";\n\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;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,CACE,oBAAC,gBAAD,EAAgB,QAAQ,SAAW,CAAA,GACnC,oBAAC,gBAAD;EAAgB,MAAM,SAAS;EAAM,WAAW,SAAS;EACtD,UAAA;CACa,CAAA,CACT,EAAA,CAAA;AAEb;AAEA,SAAS,sBA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AC,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 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,SA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IACV,QAAQ,SAAS;IACjB,cAAc,SAAS;GACxB,CAAA;EAEW,CAAA,CACT;;AAEb;;AAKA,SAAS,qBAAqB,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"}
|
|
@@ -6,7 +6,7 @@ import { useEventCalendarGestures, wasRecentChipPress, wasRecentDrag } from "./e
|
|
|
6
6
|
import { EVENT_CALENDAR_GHOST, EVENT_CALENDAR_SLOT_DRAFT, EventCalendarEvent } from "./event-calendar-event.js";
|
|
7
7
|
import { EventCalendarNowIndicator, EventCalendarTimeGutter, minuteBlockStyle } from "./event-calendar-time-grid.js";
|
|
8
8
|
import { useEffect, useMemo, useRef } from "react";
|
|
9
|
-
import { cn } from "
|
|
9
|
+
import { cn } from "@kumix/utils";
|
|
10
10
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
12
12
|
import { useRender } from "@base-ui/react/use-render";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-calendar-resource-view.js","names":[],"sources":["../../../../src/components/reui/event-calendar/event-calendar-resource-view.tsx"],"sourcesContent":["\"use client\";\n\nimport { type CSSProperties, useEffect, useMemo, useRef } from \"react\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { cn } from \"cn\";\nimport { addDays, addMinutes } from \"date-fns\";\n\nimport { ScrollArea } from \"../../ui/scroll-area\";\nimport {\n EventCalendarViewContext,\n useEventCalendar,\n useEventCalendarDay,\n useEventCalendarSelector,\n useEventCalendarSettings,\n useEventCalendarViewConfig,\n useEventCalendarViewSettings,\n} from \"./event-calendar\";\nimport { useEventCalendarGestures, wasRecentChipPress, wasRecentDrag } from \"./event-calendar-dnd\";\nimport {\n EVENT_CALENDAR_GHOST,\n EVENT_CALENDAR_SLOT_DRAFT,\n EventCalendarEvent,\n} from \"./event-calendar-event\";\nimport {\n flattenResources,\n getDayKey,\n getDayTotalMinutes,\n packTimedSegments,\n resolveOffDay,\n snapMinutes,\n toZoned,\n zonedStartOfDay,\n} from \"./event-calendar-lib\";\nimport {\n EventCalendarNowIndicator,\n EventCalendarTimeGutter,\n minuteBlockStyle,\n} from \"./event-calendar-time-grid\";\nimport type { EventCalendarResource, EventCalendarSegment } from \"./event-calendar-types\";\n\nconst EMPTY_ALL_DAY_SEGMENTS: EventCalendarSegment[] = [];\n\ninterface EventCalendarResourceViewProps extends useRender.ComponentProps<\"div\"> {\n dayStartHour?: number;\n dayEndHour?: number;\n showAllDay?: boolean;\n /** Gutter/gridline interval in minutes; defaults to the interval view config. */\n interval?: number;\n}\n\n/** Leaf resources become booking columns for the anchor day. */\nfunction EventCalendarResourceView({\n className,\n render,\n dayStartHour,\n dayEndHour,\n showAllDay = true,\n interval: intervalProp,\n ...props\n}: EventCalendarResourceViewProps) {\n const instance = useEventCalendar();\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const { effective } = useEventCalendarViewSettings();\n const anchorDate = useEventCalendarSelector((state) => state.date, {\n isEqual: (a, b) => a.getTime() === b.getTime(),\n });\n\n const startHour = dayStartHour ?? settings.dayStartHour;\n const endHour = dayEndHour ?? settings.dayEndHour;\n const interval = Math.min(Math.max(intervalProp ?? viewConfig.interval, 5), 240);\n const contained = viewConfig.scrollMode !== \"page\";\n const day = zonedStartOfDay(anchorDate, settings.timeZone);\n\n const resources = useMemo(\n () =>\n flattenResources(settings.resources)\n .filter(({ resource }) => !resource.children?.length)\n .map(({ resource }) => resource),\n [settings.resources],\n );\n\n // Initial scroll + api.scrollToTime (same contract as the time grid)\n const scrollRef = useRef<HTMLDivElement | null>(null);\n useEffect(() => {\n if (!contained) return;\n const el = scrollRef.current;\n if (!el) return;\n const viewport = el.querySelector<HTMLElement>(\"[data-slot=scroll-area-viewport]\");\n const slotRow = el.querySelector<HTMLElement>(\"[data-slot=event-calendar-time-gutter] > div\");\n const slotPx = slotRow?.getBoundingClientRect().height || 64;\n const pxPerMinute = slotPx / interval;\n const scrollTo = (minutes: number) => {\n // keep the hour label above the target line visible (it hangs -top-2)\n viewport?.scrollTo({\n top: Math.max(0, (minutes - startHour * 60) * pxPerMinute - 12),\n });\n };\n scrollTo(viewConfig.scrollToHour * 60);\n instance.internals.registerScrollHandler((time) => {\n const minutes =\n typeof time === \"number\"\n ? time\n : toZoned(time, settings.timeZone).getHours() * 60 +\n toZoned(time, settings.timeZone).getMinutes();\n scrollTo(minutes);\n });\n // Classic (width-consuming) scrollbars squeeze the scrolling track while\n // the header/all-day rows outside keep full width, drifting the column\n // borders. Mirror the measured gutter onto those rows via a CSS var -\n // 0px for overlay scrollbars and the custom ScrollArea, so both modes\n // lay out identically.\n const root = el.closest<HTMLElement>(\n \"[data-slot=event-calendar-time-grid], [data-slot=event-calendar-resource-view]\",\n );\n const syncScrollbarGutter = () => {\n root?.style.setProperty(\n \"--ec-scrollbar-w\",\n `${viewport ? viewport.offsetWidth - viewport.clientWidth : 0}px`,\n );\n };\n syncScrollbarGutter();\n const gutterObserver = viewport ? new ResizeObserver(syncScrollbarGutter) : null;\n if (viewport) gutterObserver?.observe(viewport);\n return () => {\n instance.internals.registerScrollHandler(null);\n gutterObserver?.disconnect();\n };\n }, [contained, instance, settings.timeZone, startHour, interval, viewConfig.scrollToHour]);\n\n const slots = useMemo(() => {\n const result: number[] = [];\n for (let m = startHour * 60; m < endHour * 60; m += interval) {\n result.push(m);\n }\n return result;\n }, [startHour, endHour, interval]);\n\n // All-day segments for renderAllDaySection - the same index bucket the\n // cells read; inert (stable empty array, so the subscription never\n // re-renders) while the override is unset.\n const allDaySegments = useEventCalendarSelector<unknown, EventCalendarSegment[]>(\n () =>\n viewConfig.renderAllDaySection\n ? (instance.internals.getIndex().byDay.get(getDayKey(day, settings.timeZone))?.allDay ??\n EMPTY_ALL_DAY_SEGMENTS)\n : EMPTY_ALL_DAY_SEGMENTS,\n {\n isEqual: (a, b) =>\n a === b || (a.length === b.length && a.every((segment, i) => segment === b[i])),\n },\n );\n\n const gridTemplateColumns = `repeat(${resources.length || 1}, minmax(var(--ec-resource-col-min,8rem), 1fr))`;\n\n const track = (\n <div className=\"relative flex\">\n {/* shared gutter component, so renderTimeGutterSlot and\n classNames.timeGutter customizations apply here too */}\n <EventCalendarTimeGutter\n days={[day]}\n slots={slots}\n startHour={startHour}\n interval={interval}\n />\n <div className=\"grid min-w-0 flex-1\" style={{ gridTemplateColumns }}>\n {resources.map((resource) => (\n <EventCalendarResourceColumn\n key={resource.id}\n resource={resource}\n day={day}\n startHour={startHour}\n endHour={endHour}\n interval={interval}\n />\n ))}\n </div>\n {effective.nowIndicator && (\n <EventCalendarNowIndicator days={[day]} startHour={startHour} endHour={endHour} />\n )}\n </div>\n );\n\n const defaultProps = {\n \"data-slot\": \"event-calendar-resource-view\",\n \"data-view\": \"resource\",\n className: cn(\n \"flex flex-col border-t\",\n contained && \"min-h-0 flex-1 overflow-hidden\",\n viewConfig.classNames?.timeGrid,\n className,\n ),\n style: { \"--ec-hour-height\": \"4rem\" } as CSSProperties,\n children: (\n <>\n {/* Resource header row */}\n <div\n className={cn(\n \"flex border-b pe-(--ec-scrollbar-w,0px)\",\n !contained && \"sticky top-(--ec-sticky-offset,0px) z-20 bg-background\",\n viewConfig.classNames?.timeGridHeader,\n )}\n >\n <div className=\"w-(--ec-gutter-width,4.5rem) shrink-0 border-e\" />\n <div className=\"grid min-w-0 flex-1\" style={{ gridTemplateColumns }}>\n {resources.map((resource) => (\n <div\n key={resource.id}\n data-slot=\"event-calendar-resource-header\"\n className={cn(\n \"min-w-0 truncate border-e px-2 py-1.5 text-center font-medium last:border-e-0\",\n viewConfig.classNames?.resourceHeader,\n )}\n >\n {viewConfig.renderResourceHeader?.({ resource }) ?? resource.title}\n </div>\n ))}\n </div>\n </div>\n {/* All-day row per resource */}\n {showAllDay && (\n <div\n data-slot=\"event-calendar-all-day-section\"\n className={cn(\n \"flex border-b pe-(--ec-scrollbar-w,0px)\",\n viewConfig.classNames?.allDaySection,\n )}\n >\n {viewConfig.renderAllDaySection?.({\n days: [day],\n segments: allDaySegments,\n }) ?? (\n <>\n <div\n className={cn(\n // pt-1.5 matches the all-day cell's top inset; the inner box is\n // one bar-row tall and centers the label so it sits on the SAME\n // baseline as the first all-day chip and stays top-aligned when\n // the chips wrap onto more lanes (mirrors the time-grid label)\n \"w-(--ec-gutter-width,4.5rem) shrink-0 border-e ps-2 pe-2.5 pt-1.5 text-muted-foreground\",\n viewConfig.classNames?.allDayLabel,\n )}\n >\n <span className=\"flex h-[calc(var(--ec-month-bar-h,1.625rem)-0.125rem)] items-center justify-end\">\n {settings.i18n.labels.allDay}\n </span>\n </div>\n <div className=\"grid min-w-0 flex-1\" style={{ gridTemplateColumns }}>\n {resources.map((resource) => (\n <EventCalendarResourceAllDayCell\n key={resource.id}\n resource={resource}\n day={day}\n />\n ))}\n </div>\n </>\n )}\n </div>\n )}\n {contained ? (\n <div ref={scrollRef} className=\"min-h-0 flex-1\">\n {viewConfig.scrollbars === \"native\" ? (\n <div\n data-slot=\"scroll-area-viewport\"\n data-ec-native-scroll=\"\"\n className=\"h-full overflow-y-auto\"\n >\n {track}\n </div>\n ) : (\n <ScrollArea className=\"h-full\">{track}</ScrollArea>\n )}\n </div>\n ) : (\n track\n )}\n </>\n ),\n };\n\n return (\n <EventCalendarViewContext.Provider value={{ view: \"resource\" }}>\n {useRender({\n defaultTagName: \"div\",\n render,\n props: mergeProps<\"div\">(defaultProps, props),\n })}\n </EventCalendarViewContext.Provider>\n );\n}\n\nfunction EventCalendarResourceAllDayCell({\n resource,\n day,\n}: {\n resource: EventCalendarResource;\n day: Date;\n}) {\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const { effective } = useEventCalendarViewSettings();\n const gestures = useEventCalendarGestures();\n const { segments } = useEventCalendarDay(day);\n const mine = segments.allDay.filter(\n (segment) => segment.occurrence.event.resourceId === resource.id,\n );\n const dayStart = zonedStartOfDay(day, settings.timeZone);\n const dayEnd = addDays(toZoned(dayStart, settings.timeZone), 1);\n const isOff = resolveOffDay(\n day,\n settings.timeZone,\n effective.offDays\n ? typeof viewConfig.offDays === \"object\"\n ? viewConfig.offDays\n : true\n : false,\n settings.weekendDays,\n );\n const offClassName =\n (typeof viewConfig.offDays === \"object\" && viewConfig.offDays.className) || \"bg-muted/25\";\n const isDropTarget = useEventCalendarSelector<unknown, \"valid\" | \"invalid\" | null>((state) => {\n const drag = state.drag;\n if (!drag?.proposedDayGranular) return null;\n const covered = drag.proposedStart < dayEnd && drag.proposedEnd > dayStart;\n if (!covered) return null;\n return drag.valid ? \"valid\" : \"invalid\";\n });\n // Slot-draft highlight, mirroring the time-grid all-day cell. The dnd\n // layer's all-day create branch does not plumb resourceId into the draft,\n // so every resource cell covering the day highlights together.\n const inDraft = useEventCalendarSelector<unknown, boolean>((state) => {\n const draft = state.slotDraft;\n if (!draft?.allDay) return false;\n return draft.start < dayEnd && draft.end > dayStart;\n });\n return (\n // biome-ignore lint/a11y/useKeyWithClickEvents: pointer/gesture surface; keyboard via toolbar\n <div\n data-slot=\"event-calendar-all-day-cell\"\n // data-ec-day makes this a DnD day target: without it collectSurface()\n // finds no cells and dragging an all-day chip silently converts it to\n // a timed event via the column branch\n data-ec-day={dayStart.getTime()}\n data-drop-target={isDropTarget ?? undefined}\n data-off={isOff || undefined}\n className={cn(\n // reserve one bar row so the all-day row keeps the same height with or\n // without events, matching the time-grid all-day row (which reserves\n // the same via its bars-grid minHeight)\n \"relative flex min-h-[calc(var(--ec-month-bar-h,1.625rem)+0.625rem)] min-w-0 flex-col gap-0.5 border-e px-1 py-1.5 last:border-e-0\",\n isOff && offClassName,\n viewConfig.dayClassName?.(day),\n inDraft &&\n cn(\n EVENT_CALENDAR_SLOT_DRAFT.surface,\n EVENT_CALENDAR_SLOT_DRAFT.segment,\n EVENT_CALENDAR_SLOT_DRAFT.segmentStart,\n EVENT_CALENDAR_SLOT_DRAFT.segmentEnd,\n viewConfig.classNames?.slotDraft,\n ),\n viewConfig.classNames?.allDayCell,\n )}\n onPointerDown={(e) => {\n if (e.target === e.currentTarget) gestures.beginCreate(e, day, true);\n }}\n onClick={(e) => {\n if (e.target === e.currentTarget && !wasRecentDrag() && !wasRecentChipPress()) {\n settings.onSlotClick?.(\n {\n date: dayStart,\n allDay: true,\n view: \"resource\",\n resourceId: resource.id,\n },\n e,\n );\n }\n }}\n >\n {mine.map((segment) => (\n <EventCalendarEvent\n key={segment.occurrence.key}\n segment={segment}\n // one bar-row tall, matching the time-grid all-day bars so the row\n // height stays identical across views (and equals the reserved min)\n className=\"h-[calc(var(--ec-month-bar-h,1.625rem)-0.125rem)]\"\n />\n ))}\n {isDropTarget && (\n <span\n aria-hidden\n data-slot=\"event-calendar-drop-indicator\"\n data-drop-target={isDropTarget}\n className={cn(\n \"pointer-events-none absolute inset-0.5 z-10 rounded-sm border border-dashed\",\n isDropTarget === \"valid\" ? \"border-primary/50\" : \"border-destructive/60\",\n viewConfig.classNames?.dropIndicator,\n )}\n />\n )}\n </div>\n );\n}\n\nfunction EventCalendarResourceColumn({\n resource,\n day,\n startHour,\n endHour,\n interval,\n}: {\n resource: EventCalendarResource;\n day: Date;\n startHour: number;\n endHour: number;\n interval: number;\n}) {\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const { effective } = useEventCalendarViewSettings();\n const gestures = useEventCalendarGestures();\n const { segments, isToday } = useEventCalendarDay(day);\n const isOff = resolveOffDay(\n day,\n settings.timeZone,\n effective.offDays\n ? typeof viewConfig.offDays === \"object\"\n ? viewConfig.offDays\n : true\n : false,\n settings.weekendDays,\n );\n const offClassName =\n (typeof viewConfig.offDays === \"object\" && viewConfig.offDays.className) || \"bg-muted/25\";\n\n const timeZone = settings.timeZone;\n const dayStart = zonedStartOfDay(day, timeZone);\n const totalMinutes = getDayTotalMinutes(day, timeZone);\n const boundsStartMin = startHour * 60;\n const boundsEndMin = Math.min(endHour * 60, totalMinutes);\n const boundsMinutes = Math.max(60, boundsEndMin - boundsStartMin);\n\n // Filter this resource's timed segments and repack per column.\n // Clones keep the shared index cache untouched. Segments the day bounds clip\n // away are dropped here too, otherwise they hold a column nobody can see and\n // leave a phantom empty half beside the first in-bounds chip.\n const packed = useMemo(() => {\n const mine = segments.timed\n .filter((segment) => {\n if (segment.occurrence.event.resourceId !== resource.id) return false;\n const startMin = Math.max(segment.startMin ?? 0, boundsStartMin);\n const endMin = Math.min(segment.endMin ?? startMin, boundsEndMin);\n return endMin > boundsStartMin && startMin < boundsEndMin;\n })\n .map((segment) => ({ ...segment }) as EventCalendarSegment);\n packTimedSegments(mine);\n return mine;\n }, [segments.timed, resource.id, boundsStartMin, boundsEndMin]);\n\n const dragGhost = useEventCalendarSelector<\n unknown,\n {\n window: [number, number];\n valid: boolean;\n kind: string;\n color?: string;\n title: string;\n occurrence: EventCalendarSegment[\"occurrence\"];\n proposedStart: Date;\n proposedEnd: Date;\n } | null\n >(\n (state) => {\n const drag = state.drag;\n if (!drag || drag.proposedDayGranular) return null;\n // Moves carry a proposedResourceId (they can cross columns); resizes stay\n // in place and leave it undefined, so fall back to the event's own\n // resource - otherwise the resize ghost is filtered out of every column.\n const targetResourceId = drag.proposedResourceId ?? drag.occurrence.event.resourceId;\n if (targetResourceId !== resource.id) return null;\n const from = Math.max(\n (drag.proposedStart.getTime() - dayStart.getTime()) / 60000,\n boundsStartMin,\n );\n const to = Math.min((drag.proposedEnd.getTime() - dayStart.getTime()) / 60000, boundsEndMin);\n if (to <= from) return null;\n return {\n window: [from, to] as [number, number],\n valid: drag.valid,\n kind: drag.kind,\n color: drag.occurrence.event.color,\n title: drag.occurrence.event.title,\n occurrence: drag.occurrence,\n proposedStart: drag.proposedStart,\n proposedEnd: drag.proposedEnd,\n };\n },\n {\n isEqual: (a, b) =>\n a === b ||\n (a !== null &&\n b !== null &&\n a.window[0] === b.window[0] &&\n a.window[1] === b.window[1] &&\n a.valid === b.valid &&\n a.proposedStart.getTime() === b.proposedStart.getTime() &&\n a.proposedEnd.getTime() === b.proposedEnd.getTime()),\n },\n );\n\n // Instants behind `draftWindow` below, for the range readout. Same\n // resource filter, so a draft on a neighbouring resource never labels this\n // column.\n const draftRange = useEventCalendarSelector<unknown, { start: Date; end: Date } | null>(\n (state) => {\n const draft = state.slotDraft;\n if (!draft || draft.allDay || draft.resourceId !== resource.id) {\n return null;\n }\n return { start: draft.start, end: draft.end };\n },\n {\n isEqual: (a, b) =>\n a === b ||\n (a !== null &&\n b !== null &&\n a.start.getTime() === b.start.getTime() &&\n a.end.getTime() === b.end.getTime()),\n },\n );\n\n const draftWindow = useEventCalendarSelector<unknown, [number, number] | null>(\n (state) => {\n const draft = state.slotDraft;\n if (!draft || draft.allDay || draft.resourceId !== resource.id) {\n return null;\n }\n const from = Math.max((draft.start.getTime() - dayStart.getTime()) / 60000, boundsStartMin);\n const to = Math.min((draft.end.getTime() - dayStart.getTime()) / 60000, boundsEndMin);\n return to > from ? [from, to] : null;\n },\n {\n isEqual: (a, b) => a === b || (a !== null && b !== null && a[0] === b[0] && a[1] === b[1]),\n },\n );\n\n return (\n // biome-ignore lint/a11y/useKeyWithClickEvents: pointer/gesture surface; keyboard via toolbar\n <div\n data-slot=\"event-calendar-day-column\"\n data-today={isToday || undefined}\n data-off={isOff || undefined}\n data-ec-day={dayStart.getTime()}\n data-ec-bounds-start={boundsStartMin}\n data-ec-bounds-end={boundsEndMin}\n data-ec-resource={resource.id}\n data-drop-target={dragGhost ? (dragGhost.valid ? \"valid\" : \"invalid\") : undefined}\n role=\"group\"\n aria-label={resource.title}\n className={cn(\n \"relative min-w-0 border-e last:border-e-0\",\n isOff && offClassName,\n // the resource view is a single day, so today gets no column tint (the\n // header marks it); only a consumer todayClassName can tint it\n isToday && viewConfig.todayClassName,\n viewConfig.dayClassName?.(day),\n viewConfig.classNames?.dayColumn,\n )}\n style={{\n height: `calc(var(--ec-hour-height) * ${boundsMinutes / 60})`,\n backgroundImage: `repeating-linear-gradient(to bottom, transparent, transparent calc(var(--ec-hour-height) * ${interval / 60} - var(--ec-slot-line-width, 1px)), var(--ec-slot-line-color, var(--color-border)) calc(var(--ec-hour-height) * ${interval / 60} - var(--ec-slot-line-width, 1px)), var(--ec-slot-line-color, var(--color-border)) calc(var(--ec-hour-height) * ${interval / 60}))`,\n }}\n onPointerDown={(e) => {\n if (e.target === e.currentTarget) gestures.beginCreate(e, day, false);\n }}\n onClick={(e) => {\n if (e.target !== e.currentTarget || wasRecentDrag() || wasRecentChipPress()) return;\n const rect = e.currentTarget.getBoundingClientRect();\n const pxPerMinute = rect.height / boundsMinutes;\n const minutes = snapMinutes(\n boundsStartMin + (e.clientY - rect.top) / pxPerMinute,\n settings.snapDuration,\n );\n const clamped = Math.min(\n Math.max(minutes, boundsStartMin),\n boundsEndMin - settings.slotDuration,\n );\n settings.onSlotClick?.(\n {\n date: addMinutes(dayStart, clamped),\n end: addMinutes(dayStart, clamped + settings.slotDuration),\n allDay: false,\n view: \"resource\",\n resourceId: resource.id,\n },\n e,\n );\n }}\n >\n {packed.map((segment) => {\n const startMin = Math.max(segment.startMin ?? 0, boundsStartMin);\n const endMin = Math.min(segment.endMin ?? startMin, boundsEndMin);\n if (endMin <= boundsStartMin || startMin >= boundsEndMin) return null;\n const columnCount = segment.columnCount ?? 1;\n const column = segment.column ?? 0;\n const span = segment.columnSpan ?? 1;\n const zIndex = segment.occurrence.event.zIndex ?? 10 + column;\n // Strict side-by-side columns - no cascade overlap (fade-truncate +\n // hover reveal carry the legibility); the ring separates neighbors.\n const colPct = 100 / columnCount;\n return (\n <div\n key={segment.occurrence.key}\n // min-h keeps 15-min chips readable (Google-style: the block may\n // slightly outgrow its true window); hover raises a squeezed\n // cascade chip above its overlapping neighbors\n className=\"absolute z-(--ec-z) min-h-(--ec-event-min-h,1.5rem) px-0.5 hover:z-40\"\n style={\n {\n ...minuteBlockStyle(startMin, endMin, boundsStartMin),\n left: `${column * colPct}%`,\n width: `${span * colPct}%`,\n \"--ec-z\": zIndex,\n } as CSSProperties\n }\n >\n <EventCalendarEvent\n segment={segment}\n className={cn(\n columnCount > 1 && \"ring-1 ring-background\",\n // short chips: single centered row, exact-fit line height so\n // the title never slices mid-glyph\n endMin - startMin < viewConfig.compactEventMinutes\n ? \"h-full gap-1 py-0 leading-4\"\n : \"h-full flex-col items-start justify-start gap-0 py-1\",\n viewConfig.classNames?.timedChip,\n )}\n />\n </div>\n );\n })}\n {/* Standardized ghost (EVENT_CALENDAR_GHOST): faint drop placeholder\n for moves (the cursor-attached carry clone owns the visual), dashed\n clone for resizes, destructive marking when invalid. */}\n {dragGhost && (\n <div\n data-slot=\"event-calendar-drag-ghost\"\n data-kind={dragGhost.kind}\n data-drop-invalid={!dragGhost.valid || undefined}\n className={cn(\n \"pointer-events-none absolute inset-x-0.5 z-50 min-h-(--ec-event-min-h,1.5rem)\",\n dragGhost.kind === \"move\"\n ? cn(EVENT_CALENDAR_GHOST.move, !dragGhost.valid && EVENT_CALENDAR_GHOST.invalid)\n : cn(\n EVENT_CALENDAR_GHOST.resize,\n !dragGhost.valid && EVENT_CALENDAR_GHOST.invalidResize,\n ),\n viewConfig.classNames?.dragGhost,\n )}\n style={\n {\n ...minuteBlockStyle(dragGhost.window[0], dragGhost.window[1], boundsStartMin),\n \"--ec-event-color\": dragGhost.color ?? \"var(--color-primary)\",\n } as CSSProperties\n }\n >\n {dragGhost.kind !== \"move\" && (\n <EventCalendarEvent\n preview\n segment={{\n occurrence: {\n ...dragGhost.occurrence,\n start: dragGhost.proposedStart,\n end: dragGhost.proposedEnd,\n allDay: false,\n },\n day,\n isStart: true,\n isEnd: true,\n continuesBefore: false,\n continuesAfter: false,\n startMin: dragGhost.window[0],\n endMin: dragGhost.window[1],\n }}\n className={cn(\n dragGhost.window[1] - dragGhost.window[0] < viewConfig.compactEventMinutes\n ? \"h-full gap-1 py-0 leading-4\"\n : \"h-full flex-col items-start justify-start gap-0 py-1\",\n viewConfig.classNames?.timedChip,\n \"inset-ring-0\",\n !dragGhost.valid && EVENT_CALENDAR_GHOST.invalidContent,\n )}\n />\n )}\n </div>\n )}\n {draftWindow && (\n <div\n data-slot=\"event-calendar-slot-draft\"\n className={cn(\n EVENT_CALENDAR_SLOT_DRAFT.box,\n \"pointer-events-none absolute inset-x-0.5 z-40 overflow-hidden\",\n viewConfig.classNames?.slotDraft,\n )}\n style={minuteBlockStyle(draftWindow[0], draftWindow[1], boundsStartMin)}\n >\n {draftRange && (\n <span className={cn(\"block\", EVENT_CALENDAR_SLOT_DRAFT.label)}>\n {settings.i18n.functions.formatEventTime(\n toZoned(draftRange.start, settings.timeZone),\n toZoned(draftRange.end, settings.timeZone),\n false,\n { locale: settings.locale },\n )}\n </span>\n )}\n </div>\n )}\n </div>\n );\n}\n\nexport type { EventCalendarResourceViewProps };\nexport { EventCalendarResourceView };\n"],"mappings":";;;;;;;;;;;;;;AAyCA,MAAM,yBAAiD,CAAC;;AAWxD,SAAS,0BAA0B,EACjC,WACA,QACA,cACA,YACA,aAAa,MACb,UAAU,cACV,GAAG,SAC8B;CACjC,MAAM,WAAW,iBAAiB;CAClC,MAAM,WAAW,yBAAyB;CAC1C,MAAM,aAAa,2BAA2B;CAC9C,MAAM,EAAE,cAAc,6BAA6B;CACnD,MAAM,aAAa,0BAA0B,UAAU,MAAM,MAAM,EACjE,UAAU,GAAG,MAAM,EAAE,QAAQ,MAAM,EAAE,QAAQ,EAC/C,CAAC;CAED,MAAM,YAAY,gBAAgB,SAAS;CAC3C,MAAM,UAAU,cAAc,SAAS;CACvC,MAAM,WAAW,KAAK,IAAI,KAAK,IAAI,gBAAgB,WAAW,UAAU,CAAC,GAAG,GAAG;CAC/E,MAAM,YAAY,WAAW,eAAe;CAC5C,MAAM,MAAM,gBAAgB,YAAY,SAAS,QAAQ;CAEzD,MAAM,YAAY,cAEd,iBAAiB,SAAS,SAAS,CAAC,CACjC,QAAQ,EAAE,eAAe,CAAC,SAAS,UAAU,MAAM,CAAC,CACpD,KAAK,EAAE,eAAe,QAAQ,GACnC,CAAC,SAAS,SAAS,CACrB;CAGA,MAAM,YAAY,OAA8B,IAAI;CACpD,gBAAgB;EACd,IAAI,CAAC,WAAW;EAChB,MAAM,KAAK,UAAU;EACrB,IAAI,CAAC,IAAI;EACT,MAAM,WAAW,GAAG,cAA2B,kCAAkC;EAGjF,MAAM,eAFU,GAAG,cAA2B,8CACzB,CAAC,EAAE,sBAAsB,CAAC,CAAC,UAAU,MAC7B;EAC7B,MAAM,YAAY,YAAoB;GAEpC,UAAU,SAAS,EACjB,KAAK,KAAK,IAAI,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Y,WACvB,gBACA,CAAC,UAAU,SAAS,qBAAqB,cAC3C;IACD,CAAA;GAEA,CAAA;GAEN,eACC,oBAAC,OAAD;IACE,aAAU;IACV,WAAW,GACT,0BAA0B,KAC1B,iEACA,WAAW,YAAY,SACzB;IACA,OAAO,iBAAiB,YAAY,IAAI,YAAY,IAAI,cAAc;IAErE,UAAA,cACC,oBAAC,QAAD;KAAM,WAAW,GAAG,SAAS,0BAA0B,KAAK;KACzD,UAAA,SAAS,KAAK,UAAU,gBACvB,QAAQ,WAAW,OAAO,SAAS,QAAQ,GAC3C,QAAQ,WAAW,KAAK,SAAS,QAAQ,GACzC,OACA,EAAE,QAAQ,SAAS,OAAO,CAC5B;IACI,CAAA;GAEL,CAAA;EAEJ;;AAET"}
|
|
1
|
+
{"version":3,"file":"event-calendar-resource-view.js","names":[],"sources":["../../../../src/components/reui/event-calendar/event-calendar-resource-view.tsx"],"sourcesContent":["\"use client\";\n\nimport { type CSSProperties, useEffect, useMemo, useRef } from \"react\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { addDays, addMinutes } from \"date-fns\";\n\nimport { cn } from \"@kumix/utils\";\nimport { ScrollArea } from \"../../ui/scroll-area\";\nimport {\n EventCalendarViewContext,\n useEventCalendar,\n useEventCalendarDay,\n useEventCalendarSelector,\n useEventCalendarSettings,\n useEventCalendarViewConfig,\n useEventCalendarViewSettings,\n} from \"./event-calendar\";\nimport { useEventCalendarGestures, wasRecentChipPress, wasRecentDrag } from \"./event-calendar-dnd\";\nimport {\n EVENT_CALENDAR_GHOST,\n EVENT_CALENDAR_SLOT_DRAFT,\n EventCalendarEvent,\n} from \"./event-calendar-event\";\nimport {\n flattenResources,\n getDayKey,\n getDayTotalMinutes,\n packTimedSegments,\n resolveOffDay,\n snapMinutes,\n toZoned,\n zonedStartOfDay,\n} from \"./event-calendar-lib\";\nimport {\n EventCalendarNowIndicator,\n EventCalendarTimeGutter,\n minuteBlockStyle,\n} from \"./event-calendar-time-grid\";\nimport type { EventCalendarResource, EventCalendarSegment } from \"./event-calendar-types\";\n\nconst EMPTY_ALL_DAY_SEGMENTS: EventCalendarSegment[] = [];\n\ninterface EventCalendarResourceViewProps extends useRender.ComponentProps<\"div\"> {\n dayStartHour?: number;\n dayEndHour?: number;\n showAllDay?: boolean;\n /** Gutter/gridline interval in minutes; defaults to the interval view config. */\n interval?: number;\n}\n\n/** Leaf resources become booking columns for the anchor day. */\nfunction EventCalendarResourceView({\n className,\n render,\n dayStartHour,\n dayEndHour,\n showAllDay = true,\n interval: intervalProp,\n ...props\n}: EventCalendarResourceViewProps) {\n const instance = useEventCalendar();\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const { effective } = useEventCalendarViewSettings();\n const anchorDate = useEventCalendarSelector((state) => state.date, {\n isEqual: (a, b) => a.getTime() === b.getTime(),\n });\n\n const startHour = dayStartHour ?? settings.dayStartHour;\n const endHour = dayEndHour ?? settings.dayEndHour;\n const interval = Math.min(Math.max(intervalProp ?? viewConfig.interval, 5), 240);\n const contained = viewConfig.scrollMode !== \"page\";\n const day = zonedStartOfDay(anchorDate, settings.timeZone);\n\n const resources = useMemo(\n () =>\n flattenResources(settings.resources)\n .filter(({ resource }) => !resource.children?.length)\n .map(({ resource }) => resource),\n [settings.resources],\n );\n\n // Initial scroll + api.scrollToTime (same contract as the time grid)\n const scrollRef = useRef<HTMLDivElement | null>(null);\n useEffect(() => {\n if (!contained) return;\n const el = scrollRef.current;\n if (!el) return;\n const viewport = el.querySelector<HTMLElement>(\"[data-slot=scroll-area-viewport]\");\n const slotRow = el.querySelector<HTMLElement>(\"[data-slot=event-calendar-time-gutter] > div\");\n const slotPx = slotRow?.getBoundingClientRect().height || 64;\n const pxPerMinute = slotPx / interval;\n const scrollTo = (minutes: number) => {\n // keep the hour label above the target line visible (it hangs -top-2)\n viewport?.scrollTo({\n top: Math.max(0, (minutes - startHour * 60) * pxPerMinute - 12),\n });\n };\n scrollTo(viewConfig.scrollToHour * 60);\n instance.internals.registerScrollHandler((time) => {\n const minutes =\n typeof time === \"number\"\n ? time\n : toZoned(time, settings.timeZone).getHours() * 60 +\n toZoned(time, settings.timeZone).getMinutes();\n scrollTo(minutes);\n });\n // Classic (width-consuming) scrollbars squeeze the scrolling track while\n // the header/all-day rows outside keep full width, drifting the column\n // borders. Mirror the measured gutter onto those rows via a CSS var -\n // 0px for overlay scrollbars and the custom ScrollArea, so both modes\n // lay out identically.\n const root = el.closest<HTMLElement>(\n \"[data-slot=event-calendar-time-grid], [data-slot=event-calendar-resource-view]\",\n );\n const syncScrollbarGutter = () => {\n root?.style.setProperty(\n \"--ec-scrollbar-w\",\n `${viewport ? viewport.offsetWidth - viewport.clientWidth : 0}px`,\n );\n };\n syncScrollbarGutter();\n const gutterObserver = viewport ? new ResizeObserver(syncScrollbarGutter) : null;\n if (viewport) gutterObserver?.observe(viewport);\n return () => {\n instance.internals.registerScrollHandler(null);\n gutterObserver?.disconnect();\n };\n }, [contained, instance, settings.timeZone, startHour, interval, viewConfig.scrollToHour]);\n\n const slots = useMemo(() => {\n const result: number[] = [];\n for (let m = startHour * 60; m < endHour * 60; m += interval) {\n result.push(m);\n }\n return result;\n }, [startHour, endHour, interval]);\n\n // All-day segments for renderAllDaySection - the same index bucket the\n // cells read; inert (stable empty array, so the subscription never\n // re-renders) while the override is unset.\n const allDaySegments = useEventCalendarSelector<unknown, EventCalendarSegment[]>(\n () =>\n viewConfig.renderAllDaySection\n ? (instance.internals.getIndex().byDay.get(getDayKey(day, settings.timeZone))?.allDay ??\n EMPTY_ALL_DAY_SEGMENTS)\n : EMPTY_ALL_DAY_SEGMENTS,\n {\n isEqual: (a, b) =>\n a === b || (a.length === b.length && a.every((segment, i) => segment === b[i])),\n },\n );\n\n const gridTemplateColumns = `repeat(${resources.length || 1}, minmax(var(--ec-resource-col-min,8rem), 1fr))`;\n\n const track = (\n <div className=\"relative flex\">\n {/* shared gutter component, so renderTimeGutterSlot and\n classNames.timeGutter customizations apply here too */}\n <EventCalendarTimeGutter\n days={[day]}\n slots={slots}\n startHour={startHour}\n interval={interval}\n />\n <div className=\"grid min-w-0 flex-1\" style={{ gridTemplateColumns }}>\n {resources.map((resource) => (\n <EventCalendarResourceColumn\n key={resource.id}\n resource={resource}\n day={day}\n startHour={startHour}\n endHour={endHour}\n interval={interval}\n />\n ))}\n </div>\n {effective.nowIndicator && (\n <EventCalendarNowIndicator days={[day]} startHour={startHour} endHour={endHour} />\n )}\n </div>\n );\n\n const defaultProps = {\n \"data-slot\": \"event-calendar-resource-view\",\n \"data-view\": \"resource\",\n className: cn(\n \"flex flex-col border-t\",\n contained && \"min-h-0 flex-1 overflow-hidden\",\n viewConfig.classNames?.timeGrid,\n className,\n ),\n style: { \"--ec-hour-height\": \"4rem\" } as CSSProperties,\n children: (\n <>\n {/* Resource header row */}\n <div\n className={cn(\n \"flex border-b pe-(--ec-scrollbar-w,0px)\",\n !contained && \"sticky top-(--ec-sticky-offset,0px) z-20 bg-background\",\n viewConfig.classNames?.timeGridHeader,\n )}\n >\n <div className=\"w-(--ec-gutter-width,4.5rem) shrink-0 border-e\" />\n <div className=\"grid min-w-0 flex-1\" style={{ gridTemplateColumns }}>\n {resources.map((resource) => (\n <div\n key={resource.id}\n data-slot=\"event-calendar-resource-header\"\n className={cn(\n \"min-w-0 truncate border-e px-2 py-1.5 text-center font-medium last:border-e-0\",\n viewConfig.classNames?.resourceHeader,\n )}\n >\n {viewConfig.renderResourceHeader?.({ resource }) ?? resource.title}\n </div>\n ))}\n </div>\n </div>\n {/* All-day row per resource */}\n {showAllDay && (\n <div\n data-slot=\"event-calendar-all-day-section\"\n className={cn(\n \"flex border-b pe-(--ec-scrollbar-w,0px)\",\n viewConfig.classNames?.allDaySection,\n )}\n >\n {viewConfig.renderAllDaySection?.({\n days: [day],\n segments: allDaySegments,\n }) ?? (\n <>\n <div\n className={cn(\n // pt-1.5 matches the all-day cell's top inset; the inner box is\n // one bar-row tall and centers the label so it sits on the SAME\n // baseline as the first all-day chip and stays top-aligned when\n // the chips wrap onto more lanes (mirrors the time-grid label)\n \"w-(--ec-gutter-width,4.5rem) shrink-0 border-e ps-2 pe-2.5 pt-1.5 text-muted-foreground\",\n viewConfig.classNames?.allDayLabel,\n )}\n >\n <span className=\"flex h-[calc(var(--ec-month-bar-h,1.625rem)-0.125rem)] items-center justify-end\">\n {settings.i18n.labels.allDay}\n </span>\n </div>\n <div className=\"grid min-w-0 flex-1\" style={{ gridTemplateColumns }}>\n {resources.map((resource) => (\n <EventCalendarResourceAllDayCell\n key={resource.id}\n resource={resource}\n day={day}\n />\n ))}\n </div>\n </>\n )}\n </div>\n )}\n {contained ? (\n <div ref={scrollRef} className=\"min-h-0 flex-1\">\n {viewConfig.scrollbars === \"native\" ? (\n <div\n data-slot=\"scroll-area-viewport\"\n data-ec-native-scroll=\"\"\n className=\"h-full overflow-y-auto\"\n >\n {track}\n </div>\n ) : (\n <ScrollArea className=\"h-full\">{track}</ScrollArea>\n )}\n </div>\n ) : (\n track\n )}\n </>\n ),\n };\n\n return (\n <EventCalendarViewContext.Provider value={{ view: \"resource\" }}>\n {useRender({\n defaultTagName: \"div\",\n render,\n props: mergeProps<\"div\">(defaultProps, props),\n })}\n </EventCalendarViewContext.Provider>\n );\n}\n\nfunction EventCalendarResourceAllDayCell({\n resource,\n day,\n}: {\n resource: EventCalendarResource;\n day: Date;\n}) {\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const { effective } = useEventCalendarViewSettings();\n const gestures = useEventCalendarGestures();\n const { segments } = useEventCalendarDay(day);\n const mine = segments.allDay.filter(\n (segment) => segment.occurrence.event.resourceId === resource.id,\n );\n const dayStart = zonedStartOfDay(day, settings.timeZone);\n const dayEnd = addDays(toZoned(dayStart, settings.timeZone), 1);\n const isOff = resolveOffDay(\n day,\n settings.timeZone,\n effective.offDays\n ? typeof viewConfig.offDays === \"object\"\n ? viewConfig.offDays\n : true\n : false,\n settings.weekendDays,\n );\n const offClassName =\n (typeof viewConfig.offDays === \"object\" && viewConfig.offDays.className) || \"bg-muted/25\";\n const isDropTarget = useEventCalendarSelector<unknown, \"valid\" | \"invalid\" | null>((state) => {\n const drag = state.drag;\n if (!drag?.proposedDayGranular) return null;\n const covered = drag.proposedStart < dayEnd && drag.proposedEnd > dayStart;\n if (!covered) return null;\n return drag.valid ? \"valid\" : \"invalid\";\n });\n // Slot-draft highlight, mirroring the time-grid all-day cell. The dnd\n // layer's all-day create branch does not plumb resourceId into the draft,\n // so every resource cell covering the day highlights together.\n const inDraft = useEventCalendarSelector<unknown, boolean>((state) => {\n const draft = state.slotDraft;\n if (!draft?.allDay) return false;\n return draft.start < dayEnd && draft.end > dayStart;\n });\n return (\n // biome-ignore lint/a11y/useKeyWithClickEvents: pointer/gesture surface; keyboard via toolbar\n <div\n data-slot=\"event-calendar-all-day-cell\"\n // data-ec-day makes this a DnD day target: without it collectSurface()\n // finds no cells and dragging an all-day chip silently converts it to\n // a timed event via the column branch\n data-ec-day={dayStart.getTime()}\n data-drop-target={isDropTarget ?? undefined}\n data-off={isOff || undefined}\n className={cn(\n // reserve one bar row so the all-day row keeps the same height with or\n // without events, matching the time-grid all-day row (which reserves\n // the same via its bars-grid minHeight)\n \"relative flex min-h-[calc(var(--ec-month-bar-h,1.625rem)+0.625rem)] min-w-0 flex-col gap-0.5 border-e px-1 py-1.5 last:border-e-0\",\n isOff && offClassName,\n viewConfig.dayClassName?.(day),\n inDraft &&\n cn(\n EVENT_CALENDAR_SLOT_DRAFT.surface,\n EVENT_CALENDAR_SLOT_DRAFT.segment,\n EVENT_CALENDAR_SLOT_DRAFT.segmentStart,\n EVENT_CALENDAR_SLOT_DRAFT.segmentEnd,\n viewConfig.classNames?.slotDraft,\n ),\n viewConfig.classNames?.allDayCell,\n )}\n onPointerDown={(e) => {\n if (e.target === e.currentTarget) gestures.beginCreate(e, day, true);\n }}\n onClick={(e) => {\n if (e.target === e.currentTarget && !wasRecentDrag() && !wasRecentChipPress()) {\n settings.onSlotClick?.(\n {\n date: dayStart,\n allDay: true,\n view: \"resource\",\n resourceId: resource.id,\n },\n e,\n );\n }\n }}\n >\n {mine.map((segment) => (\n <EventCalendarEvent\n key={segment.occurrence.key}\n segment={segment}\n // one bar-row tall, matching the time-grid all-day bars so the row\n // height stays identical across views (and equals the reserved min)\n className=\"h-[calc(var(--ec-month-bar-h,1.625rem)-0.125rem)]\"\n />\n ))}\n {isDropTarget && (\n <span\n aria-hidden\n data-slot=\"event-calendar-drop-indicator\"\n data-drop-target={isDropTarget}\n className={cn(\n \"pointer-events-none absolute inset-0.5 z-10 rounded-sm border border-dashed\",\n isDropTarget === \"valid\" ? \"border-primary/50\" : \"border-destructive/60\",\n viewConfig.classNames?.dropIndicator,\n )}\n />\n )}\n </div>\n );\n}\n\nfunction EventCalendarResourceColumn({\n resource,\n day,\n startHour,\n endHour,\n interval,\n}: {\n resource: EventCalendarResource;\n day: Date;\n startHour: number;\n endHour: number;\n interval: number;\n}) {\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const { effective } = useEventCalendarViewSettings();\n const gestures = useEventCalendarGestures();\n const { segments, isToday } = useEventCalendarDay(day);\n const isOff = resolveOffDay(\n day,\n settings.timeZone,\n effective.offDays\n ? typeof viewConfig.offDays === \"object\"\n ? viewConfig.offDays\n : true\n : false,\n settings.weekendDays,\n );\n const offClassName =\n (typeof viewConfig.offDays === \"object\" && viewConfig.offDays.className) || \"bg-muted/25\";\n\n const timeZone = settings.timeZone;\n const dayStart = zonedStartOfDay(day, timeZone);\n const totalMinutes = getDayTotalMinutes(day, timeZone);\n const boundsStartMin = startHour * 60;\n const boundsEndMin = Math.min(endHour * 60, totalMinutes);\n const boundsMinutes = Math.max(60, boundsEndMin - boundsStartMin);\n\n // Filter this resource's timed segments and repack per column.\n // Clones keep the shared index cache untouched. Segments the day bounds clip\n // away are dropped here too, otherwise they hold a column nobody can see and\n // leave a phantom empty half beside the first in-bounds chip.\n const packed = useMemo(() => {\n const mine = segments.timed\n .filter((segment) => {\n if (segment.occurrence.event.resourceId !== resource.id) return false;\n const startMin = Math.max(segment.startMin ?? 0, boundsStartMin);\n const endMin = Math.min(segment.endMin ?? startMin, boundsEndMin);\n return endMin > boundsStartMin && startMin < boundsEndMin;\n })\n .map((segment) => ({ ...segment }) as EventCalendarSegment);\n packTimedSegments(mine);\n return mine;\n }, [segments.timed, resource.id, boundsStartMin, boundsEndMin]);\n\n const dragGhost = useEventCalendarSelector<\n unknown,\n {\n window: [number, number];\n valid: boolean;\n kind: string;\n color?: string;\n title: string;\n occurrence: EventCalendarSegment[\"occurrence\"];\n proposedStart: Date;\n proposedEnd: Date;\n } | null\n >(\n (state) => {\n const drag = state.drag;\n if (!drag || drag.proposedDayGranular) return null;\n // Moves carry a proposedResourceId (they can cross columns); resizes stay\n // in place and leave it undefined, so fall back to the event's own\n // resource - otherwise the resize ghost is filtered out of every column.\n const targetResourceId = drag.proposedResourceId ?? drag.occurrence.event.resourceId;\n if (targetResourceId !== resource.id) return null;\n const from = Math.max(\n (drag.proposedStart.getTime() - dayStart.getTime()) / 60000,\n boundsStartMin,\n );\n const to = Math.min((drag.proposedEnd.getTime() - dayStart.getTime()) / 60000, boundsEndMin);\n if (to <= from) return null;\n return {\n window: [from, to] as [number, number],\n valid: drag.valid,\n kind: drag.kind,\n color: drag.occurrence.event.color,\n title: drag.occurrence.event.title,\n occurrence: drag.occurrence,\n proposedStart: drag.proposedStart,\n proposedEnd: drag.proposedEnd,\n };\n },\n {\n isEqual: (a, b) =>\n a === b ||\n (a !== null &&\n b !== null &&\n a.window[0] === b.window[0] &&\n a.window[1] === b.window[1] &&\n a.valid === b.valid &&\n a.proposedStart.getTime() === b.proposedStart.getTime() &&\n a.proposedEnd.getTime() === b.proposedEnd.getTime()),\n },\n );\n\n // Instants behind `draftWindow` below, for the range readout. Same\n // resource filter, so a draft on a neighbouring resource never labels this\n // column.\n const draftRange = useEventCalendarSelector<unknown, { start: Date; end: Date } | null>(\n (state) => {\n const draft = state.slotDraft;\n if (!draft || draft.allDay || draft.resourceId !== resource.id) {\n return null;\n }\n return { start: draft.start, end: draft.end };\n },\n {\n isEqual: (a, b) =>\n a === b ||\n (a !== null &&\n b !== null &&\n a.start.getTime() === b.start.getTime() &&\n a.end.getTime() === b.end.getTime()),\n },\n );\n\n const draftWindow = useEventCalendarSelector<unknown, [number, number] | null>(\n (state) => {\n const draft = state.slotDraft;\n if (!draft || draft.allDay || draft.resourceId !== resource.id) {\n return null;\n }\n const from = Math.max((draft.start.getTime() - dayStart.getTime()) / 60000, boundsStartMin);\n const to = Math.min((draft.end.getTime() - dayStart.getTime()) / 60000, boundsEndMin);\n return to > from ? [from, to] : null;\n },\n {\n isEqual: (a, b) => a === b || (a !== null && b !== null && a[0] === b[0] && a[1] === b[1]),\n },\n );\n\n return (\n // biome-ignore lint/a11y/useKeyWithClickEvents: pointer/gesture surface; keyboard via toolbar\n <div\n data-slot=\"event-calendar-day-column\"\n data-today={isToday || undefined}\n data-off={isOff || undefined}\n data-ec-day={dayStart.getTime()}\n data-ec-bounds-start={boundsStartMin}\n data-ec-bounds-end={boundsEndMin}\n data-ec-resource={resource.id}\n data-drop-target={dragGhost ? (dragGhost.valid ? \"valid\" : \"invalid\") : undefined}\n role=\"group\"\n aria-label={resource.title}\n className={cn(\n \"relative min-w-0 border-e last:border-e-0\",\n isOff && offClassName,\n // the resource view is a single day, so today gets no column tint (the\n // header marks it); only a consumer todayClassName can tint it\n isToday && viewConfig.todayClassName,\n viewConfig.dayClassName?.(day),\n viewConfig.classNames?.dayColumn,\n )}\n style={{\n height: `calc(var(--ec-hour-height) * ${boundsMinutes / 60})`,\n backgroundImage: `repeating-linear-gradient(to bottom, transparent, transparent calc(var(--ec-hour-height) * ${interval / 60} - var(--ec-slot-line-width, 1px)), var(--ec-slot-line-color, var(--color-border)) calc(var(--ec-hour-height) * ${interval / 60} - var(--ec-slot-line-width, 1px)), var(--ec-slot-line-color, var(--color-border)) calc(var(--ec-hour-height) * ${interval / 60}))`,\n }}\n onPointerDown={(e) => {\n if (e.target === e.currentTarget) gestures.beginCreate(e, day, false);\n }}\n onClick={(e) => {\n if (e.target !== e.currentTarget || wasRecentDrag() || wasRecentChipPress()) return;\n const rect = e.currentTarget.getBoundingClientRect();\n const pxPerMinute = rect.height / boundsMinutes;\n const minutes = snapMinutes(\n boundsStartMin + (e.clientY - rect.top) / pxPerMinute,\n settings.snapDuration,\n );\n const clamped = Math.min(\n Math.max(minutes, boundsStartMin),\n boundsEndMin - settings.slotDuration,\n );\n settings.onSlotClick?.(\n {\n date: addMinutes(dayStart, clamped),\n end: addMinutes(dayStart, clamped + settings.slotDuration),\n allDay: false,\n view: \"resource\",\n resourceId: resource.id,\n },\n e,\n );\n }}\n >\n {packed.map((segment) => {\n const startMin = Math.max(segment.startMin ?? 0, boundsStartMin);\n const endMin = Math.min(segment.endMin ?? startMin, boundsEndMin);\n if (endMin <= boundsStartMin || startMin >= boundsEndMin) return null;\n const columnCount = segment.columnCount ?? 1;\n const column = segment.column ?? 0;\n const span = segment.columnSpan ?? 1;\n const zIndex = segment.occurrence.event.zIndex ?? 10 + column;\n // Strict side-by-side columns - no cascade overlap (fade-truncate +\n // hover reveal carry the legibility); the ring separates neighbors.\n const colPct = 100 / columnCount;\n return (\n <div\n key={segment.occurrence.key}\n // min-h keeps 15-min chips readable (Google-style: the block may\n // slightly outgrow its true window); hover raises a squeezed\n // cascade chip above its overlapping neighbors\n className=\"absolute z-(--ec-z) min-h-(--ec-event-min-h,1.5rem) px-0.5 hover:z-40\"\n style={\n {\n ...minuteBlockStyle(startMin, endMin, boundsStartMin),\n left: `${column * colPct}%`,\n width: `${span * colPct}%`,\n \"--ec-z\": zIndex,\n } as CSSProperties\n }\n >\n <EventCalendarEvent\n segment={segment}\n className={cn(\n columnCount > 1 && \"ring-1 ring-background\",\n // short chips: single centered row, exact-fit line height so\n // the title never slices mid-glyph\n endMin - startMin < viewConfig.compactEventMinutes\n ? \"h-full gap-1 py-0 leading-4\"\n : \"h-full flex-col items-start justify-start gap-0 py-1\",\n viewConfig.classNames?.timedChip,\n )}\n />\n </div>\n );\n })}\n {/* Standardized ghost (EVENT_CALENDAR_GHOST): faint drop placeholder\n for moves (the cursor-attached carry clone owns the visual), dashed\n clone for resizes, destructive marking when invalid. */}\n {dragGhost && (\n <div\n data-slot=\"event-calendar-drag-ghost\"\n data-kind={dragGhost.kind}\n data-drop-invalid={!dragGhost.valid || undefined}\n className={cn(\n \"pointer-events-none absolute inset-x-0.5 z-50 min-h-(--ec-event-min-h,1.5rem)\",\n dragGhost.kind === \"move\"\n ? cn(EVENT_CALENDAR_GHOST.move, !dragGhost.valid && EVENT_CALENDAR_GHOST.invalid)\n : cn(\n EVENT_CALENDAR_GHOST.resize,\n !dragGhost.valid && EVENT_CALENDAR_GHOST.invalidResize,\n ),\n viewConfig.classNames?.dragGhost,\n )}\n style={\n {\n ...minuteBlockStyle(dragGhost.window[0], dragGhost.window[1], boundsStartMin),\n \"--ec-event-color\": dragGhost.color ?? \"var(--color-primary)\",\n } as CSSProperties\n }\n >\n {dragGhost.kind !== \"move\" && (\n <EventCalendarEvent\n preview\n segment={{\n occurrence: {\n ...dragGhost.occurrence,\n start: dragGhost.proposedStart,\n end: dragGhost.proposedEnd,\n allDay: false,\n },\n day,\n isStart: true,\n isEnd: true,\n continuesBefore: false,\n continuesAfter: false,\n startMin: dragGhost.window[0],\n endMin: dragGhost.window[1],\n }}\n className={cn(\n dragGhost.window[1] - dragGhost.window[0] < viewConfig.compactEventMinutes\n ? \"h-full gap-1 py-0 leading-4\"\n : \"h-full flex-col items-start justify-start gap-0 py-1\",\n viewConfig.classNames?.timedChip,\n \"inset-ring-0\",\n !dragGhost.valid && EVENT_CALENDAR_GHOST.invalidContent,\n )}\n />\n )}\n </div>\n )}\n {draftWindow && (\n <div\n data-slot=\"event-calendar-slot-draft\"\n className={cn(\n EVENT_CALENDAR_SLOT_DRAFT.box,\n \"pointer-events-none absolute inset-x-0.5 z-40 overflow-hidden\",\n viewConfig.classNames?.slotDraft,\n )}\n style={minuteBlockStyle(draftWindow[0], draftWindow[1], boundsStartMin)}\n >\n {draftRange && (\n <span className={cn(\"block\", EVENT_CALENDAR_SLOT_DRAFT.label)}>\n {settings.i18n.functions.formatEventTime(\n toZoned(draftRange.start, settings.timeZone),\n toZoned(draftRange.end, settings.timeZone),\n false,\n { locale: settings.locale },\n )}\n </span>\n )}\n </div>\n )}\n </div>\n );\n}\n\nexport type { EventCalendarResourceViewProps };\nexport { EventCalendarResourceView };\n"],"mappings":";;;;;;;;;;;;;;AAyCA,MAAM,yBAAiD,CAAC;;AAWxD,SAAS,0BAA0B,EACjC,WACA,QACA,cACA,YACA,aAAa,MACb,UAAU,cACV,GAAG,SAC8B;CACjC,MAAM,WAAW,iBAAiB;CAClC,MAAM,WAAW,yBAAyB;CAC1C,MAAM,aAAa,2BAA2B;CAC9C,MAAM,EAAE,cAAc,6BAA6B;CACnD,MAAM,aAAa,0BAA0B,UAAU,MAAM,MAAM,EACjE,UAAU,GAAG,MAAM,EAAE,QAAQ,MAAM,EAAE,QAAQ,EAC/C,CAAC;CAED,MAAM,YAAY,gBAAgB,SAAS;CAC3C,MAAM,UAAU,cAAc,SAAS;CACvC,MAAM,WAAW,KAAK,IAAI,KAAK,IAAI,gBAAgB,WAAW,UAAU,CAAC,GAAG,GAAG;CAC/E,MAAM,YAAY,WAAW,eAAe;CAC5C,MAAM,MAAM,gBAAgB,YAAY,SAAS,QAAQ;CAEzD,MAAM,YAAY,cAEd,iBAAiB,SAAS,SAAS,CAAC,CACjC,QAAQ,EAAE,eAAe,CAAC,SAAS,UAAU,MAAM,CAAC,CACpD,KAAK,EAAE,eAAe,QAAQ,GACnC,CAAC,SAAS,SAAS,CACrB;CAGA,MAAM,YAAY,OAA8B,IAAI;CACpD,gBAAgB;EACd,IAAI,CAAC,WAAW;EAChB,MAAM,KAAK,UAAU;EACrB,IAAI,CAAC,IAAI;EACT,MAAM,WA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,OAAO;MACP,iBAAiB;MACjB,gBAAgB;MAChB,UAAU,UAAU,OAAO;MAC3B,QAAQ,UAAU,OAAO;KAC3B;KACA,WAAW,GACT,UAAU,OAAO,KAAK,UAAU,OAAO,KAAK,WAAW,sBACnD,gCACA,wDACJ,WAAW,YAAY,WACvB,gBACA,CAAC,UAAU,SAAS,qBAAqB,cAC3C;IACD,CAAA;GAEA,CAAA;GAEN,eACC,oBAAC,OAAD;IACE,aAAU;IACV,WAAW,GACT,0BAA0B,KAC1B,iEACA,WAAW,YAAY,SACzB;IACA,OAAO,iBAAiB,YAAY,IAAI,YAAY,IAAI,cAAc;IAErE,UAAA,cACC,oBAAC,QAAD;KAAM,WAAW,GAAG,SAAS,0BAA0B,KAAK;KACzD,UAAA,SAAS,KAAK,UAAU,gBACvB,QAAQ,WAAW,OAAO,SAAS,QAAQ,GAC3C,QAAQ,WAAW,KAAK,SAAS,QAAQ,GACzC,OACA,EAAE,QAAQ,SAAS,OAAO,CAC5B;IACI,CAAA;GAEL,CAAA;EAEJ;;AAET"}
|
|
@@ -5,7 +5,7 @@ import { EventCalendarViewContext, useEventCalendar, useEventCalendarDay, useEve
|
|
|
5
5
|
import { useEventCalendarGestures, wasRecentChipPress, wasRecentDrag } from "./event-calendar-dnd.js";
|
|
6
6
|
import { EVENT_CALENDAR_GHOST, EVENT_CALENDAR_SLOT_DRAFT, EventCalendarEvent } from "./event-calendar-event.js";
|
|
7
7
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
8
|
-
import { cn } from "
|
|
8
|
+
import { cn } from "@kumix/utils";
|
|
9
9
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
11
11
|
import { useRender } from "@base-ui/react/use-render";
|