@adea-ai/ui 0.162.6 → 0.162.7
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/dist/components/composites/about-dialog/about-dialog.js +5 -5
- package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
- package/dist/components/composites/accent-picker/accent-picker.js +3 -3
- package/dist/components/composites/accent-picker/accent-picker.js.map +1 -1
- package/dist/components/composites/accent-picker/custom-color-popover.js +2 -2
- package/dist/components/composites/accent-picker/custom-color-popover.js.map +1 -1
- package/dist/components/composites/account-menu/account-menu.js +22 -22
- package/dist/components/composites/account-menu/account-menu.js.map +1 -1
- package/dist/components/composites/action-button/action-button.js +2 -2
- package/dist/components/composites/action-button/action-button.js.map +1 -1
- package/dist/components/composites/appearance-editor/accent-swatch-groups.js +3 -3
- package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.js +10 -10
- package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.js +13 -13
- package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.js +12 -12
- package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
- package/dist/components/composites/appearance-editor/font-settings-group.js +13 -13
- package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
- package/dist/components/composites/appearance-editor/theme-preview.js +1 -1
- package/dist/components/composites/appearance-editor/theme-preview.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser-group.js +9 -9
- package/dist/components/composites/catalog-browser/catalog-browser-group.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser.js +10 -10
- package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-detail.js +1 -1
- package/dist/components/composites/catalog-browser/catalog-detail.js.map +1 -1
- package/dist/components/composites/chain-of-thought/chain-of-thought.js +5 -5
- package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
- package/dist/components/composites/chat/chat.js +7 -7
- package/dist/components/composites/chat/chat.js.map +1 -1
- package/dist/components/composites/checkpoint/checkpoint.js +5 -5
- package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
- package/dist/components/composites/confirmation/confirmation.js +13 -13
- package/dist/components/composites/confirmation/confirmation.js.map +1 -1
- package/dist/components/composites/context/context.js +7 -7
- package/dist/components/composites/context/context.js.map +1 -1
- package/dist/components/composites/file-tree/build-file-tree.js +1 -1
- package/dist/components/composites/file-tree/build-file-tree.js.map +1 -1
- package/dist/components/composites/file-tree/file-tree.js +9 -9
- package/dist/components/composites/file-tree/file-tree.js.map +1 -1
- package/dist/components/composites/help-center/help-center.js +5 -5
- package/dist/components/composites/help-center/help-center.js.map +1 -1
- package/dist/components/composites/icon-picker/icon-picker.js +10 -10
- package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
- package/dist/components/composites/icon-picker/image-data-url.js.map +1 -1
- package/dist/components/composites/icon-picker/shell-icons.js +117 -117
- package/dist/components/composites/icon-picker/shell-icons.js.map +1 -1
- package/dist/components/composites/inline-citation/inline-citation.js +7 -7
- package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
- package/dist/components/composites/list-row/list-row-control.js +1 -1
- package/dist/components/composites/list-row/list-row-control.js.map +1 -1
- package/dist/components/composites/list-row/list-row.js +2 -2
- package/dist/components/composites/list-row/list-row.js.map +1 -1
- package/dist/components/composites/message-scroller/message-scroller.js +7 -7
- package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
- package/dist/components/composites/message-scroller/scroll-anchor.js +1 -1
- package/dist/components/composites/message-scroller/scroll-anchor.js.map +1 -1
- package/dist/components/composites/model-selector/model-selector.js +12 -12
- package/dist/components/composites/model-selector/model-selector.js.map +1 -1
- package/dist/components/composites/plan/plan.js +5 -5
- package/dist/components/composites/plan/plan.js.map +1 -1
- package/dist/components/composites/prompt-input/prompt-input.js +3 -3
- package/dist/components/composites/prompt-input/prompt-input.js.map +1 -1
- package/dist/components/composites/queue/queue.js +13 -13
- package/dist/components/composites/queue/queue.js.map +1 -1
- package/dist/components/composites/reasoning/reasoning.js +5 -5
- package/dist/components/composites/reasoning/reasoning.js.map +1 -1
- package/dist/components/composites/scene-controls/scene-controls.js +16 -16
- package/dist/components/composites/scene-controls/scene-controls.js.map +1 -1
- package/dist/components/composites/settings/settings-layout.js +2 -2
- package/dist/components/composites/settings/settings-layout.js.map +1 -1
- package/dist/components/composites/settings/settings-navigation.js +2 -2
- package/dist/components/composites/settings/settings-navigation.js.map +1 -1
- package/dist/components/composites/settings/settings.js +5 -5
- package/dist/components/composites/settings/settings.js.map +1 -1
- package/dist/components/composites/sources/sources.js +5 -5
- package/dist/components/composites/sources/sources.js.map +1 -1
- package/dist/components/composites/stack-trace/parse-stack-trace.js +2 -2
- package/dist/components/composites/stack-trace/parse-stack-trace.js.map +1 -1
- package/dist/components/composites/stack-trace/stack-trace.js +10 -10
- package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
- package/dist/components/composites/stat/stat.js +6 -6
- package/dist/components/composites/stat/stat.js.map +1 -1
- package/dist/components/composites/subagent/subagent.js +5 -5
- package/dist/components/composites/subagent/subagent.js.map +1 -1
- package/dist/components/composites/suggestion/suggestion.js +2 -2
- package/dist/components/composites/suggestion/suggestion.js.map +1 -1
- package/dist/components/composites/task/task.js +5 -5
- package/dist/components/composites/task/task.js.map +1 -1
- package/dist/components/composites/terminal/ansi.js +1 -1
- package/dist/components/composites/terminal/ansi.js.map +1 -1
- package/dist/components/composites/terminal/terminal.js +18 -18
- package/dist/components/composites/terminal/terminal.js.map +1 -1
- package/dist/components/composites/test-results/test-results.js +17 -17
- package/dist/components/composites/test-results/test-results.js.map +1 -1
- package/dist/components/composites/tool/tool.js +5 -5
- package/dist/components/composites/tool/tool.js.map +1 -1
- package/dist/components/composites/tree/tree.js +6 -6
- package/dist/components/composites/tree/tree.js.map +1 -1
- package/dist/components/composites/update-dialog/channel-control.js +1 -1
- package/dist/components/composites/update-dialog/channel-control.js.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.js +23 -23
- package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
- package/dist/components/composites/workspace-mark/workspace-mark.js +2 -2
- package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js +6 -6
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-switcher.js +11 -11
- package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -1
- package/dist/components/conversation/atomic/chat-composer.js +1 -1
- package/dist/components/conversation/busy-send-button.js +10 -10
- package/dist/components/conversation/busy-send-button.js.map +1 -1
- package/dist/components/conversation/chat-composer.js +1 -1
- package/dist/components/conversation/composer-core.js +1 -1
- package/dist/components/conversation/composer-menu.js +2 -2
- package/dist/components/conversation/composer-menu.js.map +1 -1
- package/dist/components/conversation/conversation-avatar.js +7 -7
- package/dist/components/conversation/conversation-avatar.js.map +1 -1
- package/dist/components/conversation/conversation-pane.js +1 -1
- package/dist/components/conversation/conversation-pane.js.map +1 -1
- package/dist/components/conversation/conversation-surface.js +5 -5
- package/dist/components/conversation/conversation-surface.js.map +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.js +9 -9
- package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
- package/dist/components/conversation/message-composer.js +9 -9
- package/dist/components/conversation/message-composer.js.map +1 -1
- package/dist/components/conversation/message-row.js +13 -13
- package/dist/components/conversation/message-row.js.map +1 -1
- package/dist/components/conversation/paste-token-editor.js +1 -1
- package/dist/components/conversation/paste-token-editor.js.map +1 -1
- package/dist/components/conversation/scroll-follow.js +1 -1
- package/dist/components/conversation/thread-panel.js +5 -5
- package/dist/components/conversation/thread-panel.js.map +1 -1
- package/dist/components/conversation/transcript-composition.js +5 -5
- package/dist/components/conversation/transcript-composition.js.map +1 -1
- package/dist/components/layout/app-shell/app-shell.js +1 -1
- package/dist/components/layout/app-shell/app-shell.js.map +1 -1
- package/dist/components/layout/app-shell/skip-link.js +1 -1
- package/dist/components/layout/app-shell/skip-link.js.map +1 -1
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.js +2 -2
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.js.map +1 -1
- package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.js +1 -1
- package/dist/components/layout/floating-preview/floating-preview.js +7 -7
- package/dist/components/layout/floating-preview/floating-preview.js.map +1 -1
- package/dist/components/layout/orbit-layout/orbit-layout.js +1 -1
- package/dist/components/layout/orbit-layout/orbit-layout.js.map +1 -1
- package/dist/components/layout/page/page.js +2 -2
- package/dist/components/layout/page/page.js.map +1 -1
- package/dist/components/layout/panel/panel.js +1 -1
- package/dist/components/layout/panel/panel.js.map +1 -1
- package/dist/components/layout/pixel-pane/pixel-pane.js +1 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js +5 -5
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
- package/dist/components/layout/shell-rail/shell-rail.js +5 -5
- package/dist/components/layout/shell-rail/shell-rail.js.map +1 -1
- package/dist/components/layout/shell-top-bar/shell-top-bar.js +2 -2
- package/dist/components/layout/shell-top-bar/shell-top-bar.js.map +1 -1
- package/dist/components/layout/side-rail/side-rail.js +2 -2
- package/dist/components/layout/side-rail/side-rail.js.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.js +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.js +5 -5
- package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
- package/dist/components/layout/split-layout/pane-focus.js.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core-retry.js +1 -1
- package/dist/components/layout/split-layout/resize-controller-core-retry.js.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core.js +1 -1
- package/dist/components/layout/split-layout/resize-controller-core.js.map +1 -1
- package/dist/components/layout/split-layout/split-layout.js +7 -7
- package/dist/components/layout/split-layout/split-layout.js.map +1 -1
- package/dist/components/layout/status-bar/status-bar.js +1 -1
- package/dist/components/layout/status-bar/status-bar.js.map +1 -1
- package/dist/components/layout/top-bar/top-bar.js +5 -5
- package/dist/components/layout/top-bar/top-bar.js.map +1 -1
- package/dist/components/layout/virtual-window/virtual-window.js +1 -1
- package/dist/components/layout/virtual-window/virtual-window.js.map +1 -1
- package/dist/components/motion/presence.js +1 -1
- package/dist/components/theme/appearance-panel.js +3 -3
- package/dist/components/theme/appearance-panel.js.map +1 -1
- package/dist/components/theme/lazy.js +3 -3
- package/dist/components/theme/lazy.js.map +1 -1
- package/dist/components/theme/script-projection.js +1 -1
- package/dist/components/theme/theme-catalogue-source.js +1 -1
- package/dist/components/theme/theme-document.js.map +1 -1
- package/dist/components/theme/theme-mode-toggle.js +7 -7
- package/dist/components/theme/theme-mode-toggle.js.map +1 -1
- package/dist/components/theme/theme-picker.js +2 -2
- package/dist/components/theme/theme-picker.js.map +1 -1
- package/dist/components/theme/theme-provider-value.js +1 -1
- package/dist/components/theme/theme-provider-value.js.map +1 -1
- package/dist/components/theme/theme-provider.js +1 -1
- package/dist/components/theme/theme-toggle.js +7 -7
- package/dist/components/theme/theme-toggle.js.map +1 -1
- package/dist/components/ui/accordion/accordion.js +13 -13
- package/dist/components/ui/accordion/accordion.js.map +1 -1
- package/dist/components/ui/alert/alert.js +12 -12
- package/dist/components/ui/alert/alert.js.map +1 -1
- package/dist/components/ui/alert-dialog/alert-dialog.js +14 -14
- package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/ui/annotation-surface/annotation-surface.js +2 -2
- package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -1
- package/dist/components/ui/aspect-ratio/aspect-ratio.js +1 -1
- package/dist/components/ui/aspect-ratio/aspect-ratio.js.map +1 -1
- package/dist/components/ui/attachment/attachment.js +16 -16
- package/dist/components/ui/attachment/attachment.js.map +1 -1
- package/dist/components/ui/avatar/avatar.js +1 -1
- package/dist/components/ui/avatar/avatar.js.map +1 -1
- package/dist/components/ui/badge/badge.js +2 -2
- package/dist/components/ui/badge/badge.js.map +1 -1
- package/dist/components/ui/board/board.js +2 -2
- package/dist/components/ui/board/board.js.map +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb.js +7 -7
- package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/ui/bubble/bubble.js +2 -2
- package/dist/components/ui/bubble/bubble.js.map +1 -1
- package/dist/components/ui/button/button.js +2 -2
- package/dist/components/ui/button-group/button-group.js +2 -2
- package/dist/components/ui/button-group/button-group.js.map +1 -1
- package/dist/components/ui/calendar/calendar.js +8 -8
- package/dist/components/ui/calendar/calendar.js.map +1 -1
- package/dist/components/ui/callout/callout.js +2 -2
- package/dist/components/ui/callout/callout.js.map +1 -1
- package/dist/components/ui/card/card.js +2 -2
- package/dist/components/ui/card/card.js.map +1 -1
- package/dist/components/ui/carousel/carousel.js +8 -8
- package/dist/components/ui/carousel/carousel.js.map +1 -1
- package/dist/components/ui/chart/chart.js +2 -2
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/checkbox/checkbox.js +6 -6
- package/dist/components/ui/checkbox/checkbox.js.map +1 -1
- package/dist/components/ui/code-block/code-block.js +6 -6
- package/dist/components/ui/code-block/code-block.js.map +1 -1
- package/dist/components/ui/collapsible/collapsible.js +7 -7
- package/dist/components/ui/collapsible/collapsible.js.map +1 -1
- package/dist/components/ui/combobox/combobox.js +21 -21
- package/dist/components/ui/combobox/combobox.js.map +1 -1
- package/dist/components/ui/combobox/value-combobox.js +1 -1
- package/dist/components/ui/command/command.js +23 -23
- package/dist/components/ui/command/command.js.map +1 -1
- package/dist/components/ui/context-menu/context-menu.js +2 -2
- package/dist/components/ui/detail-panel/detail-panel.js +5 -5
- package/dist/components/ui/detail-panel/detail-panel.js.map +1 -1
- package/dist/components/ui/dialog/dialog-layer.js +2 -2
- package/dist/components/ui/dialog/dialog-layer.js.map +1 -1
- package/dist/components/ui/dialog/dialog.js +21 -21
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- package/dist/components/ui/diff-block/diff-block.js +2 -2
- package/dist/components/ui/diff-block/diff-block.js.map +1 -1
- package/dist/components/ui/drawer/drawer.js +14 -14
- package/dist/components/ui/drawer/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.js +3 -3
- package/dist/components/ui/dropdown-menu/menu-parts.js +10 -10
- package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -1
- package/dist/components/ui/empty/empty-state.js +5 -5
- package/dist/components/ui/empty/empty-state.js.map +1 -1
- package/dist/components/ui/empty/empty.js +1 -1
- package/dist/components/ui/empty/empty.js.map +1 -1
- package/dist/components/ui/entity-icon/entity-icon.js +2 -2
- package/dist/components/ui/entity-icon/entity-icon.js.map +1 -1
- package/dist/components/ui/field/field.js +14 -14
- package/dist/components/ui/field/field.js.map +1 -1
- package/dist/components/ui/field/number-field.js +2 -2
- package/dist/components/ui/field/number-field.js.map +1 -1
- package/dist/components/ui/hover-card/hover-card.js +10 -10
- package/dist/components/ui/hover-card/hover-card.js.map +1 -1
- package/dist/components/ui/input/input-control.js +1 -1
- package/dist/components/ui/input/input-control.js.map +1 -1
- package/dist/components/ui/input/input.js +2 -2
- package/dist/components/ui/input/input.js.map +1 -1
- package/dist/components/ui/input-group/input-group.js +2 -2
- package/dist/components/ui/input-group/input-group.js.map +1 -1
- package/dist/components/ui/input-group/secret-input-group.js +2 -2
- package/dist/components/ui/input-otp/input-otp.js +2 -2
- package/dist/components/ui/input-otp/input-otp.js.map +1 -1
- package/dist/components/ui/item/item.js +2 -2
- package/dist/components/ui/item/item.js.map +1 -1
- package/dist/components/ui/kbd/kbd.js +2 -2
- package/dist/components/ui/kbd/kbd.js.map +1 -1
- package/dist/components/ui/label/label.js +1 -1
- package/dist/components/ui/label/label.js.map +1 -1
- package/dist/components/ui/marker/marker.js +2 -2
- package/dist/components/ui/marker/marker.js.map +1 -1
- package/dist/components/ui/menubar/menubar.js +7 -7
- package/dist/components/ui/menubar/menubar.js.map +1 -1
- package/dist/components/ui/message/message.js +3 -3
- package/dist/components/ui/message/message.js.map +1 -1
- package/dist/components/ui/modal-dialog/modal-dialog.js +2 -2
- package/dist/components/ui/modal-dialog/modal-dialog.js.map +1 -1
- package/dist/components/ui/native-select/native-select.js +5 -5
- package/dist/components/ui/native-select/native-select.js.map +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu.js +18 -18
- package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination/pagination.js +28 -28
- package/dist/components/ui/pagination/pagination.js.map +1 -1
- package/dist/components/ui/popover/popover.js +15 -15
- package/dist/components/ui/popover/popover.js.map +1 -1
- package/dist/components/ui/progress/progress.js +5 -5
- package/dist/components/ui/progress/progress.js.map +1 -1
- package/dist/components/ui/questionnaire/questionnaire.js +10 -10
- package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
- package/dist/components/ui/radio-group/radio-group.js +9 -9
- package/dist/components/ui/radio-group/radio-group.js.map +1 -1
- package/dist/components/ui/resizable/resizable.js +11 -11
- package/dist/components/ui/resizable/resizable.js.map +1 -1
- package/dist/components/ui/scroll-area/scroll-area.js +1 -1
- package/dist/components/ui/scroll-area/scroll-area.js.map +1 -1
- package/dist/components/ui/select/select.js +21 -21
- package/dist/components/ui/select/select.js.map +1 -1
- package/dist/components/ui/separator/separator.js +5 -5
- package/dist/components/ui/separator/separator.js.map +1 -1
- package/dist/components/ui/sheet/sheet.js +6 -6
- package/dist/components/ui/sheet/sheet.js.map +1 -1
- package/dist/components/ui/skeleton/skeleton.js +1 -1
- package/dist/components/ui/skeleton/skeleton.js.map +1 -1
- package/dist/components/ui/slider/slider.js +5 -5
- package/dist/components/ui/slider/slider.js.map +1 -1
- package/dist/components/ui/spinner/spinner.js +5 -5
- package/dist/components/ui/spinner/spinner.js.map +1 -1
- package/dist/components/ui/status-chip/status-chip.js +2 -2
- package/dist/components/ui/status-chip/status-chip.js.map +1 -1
- package/dist/components/ui/switch/switch.js +4 -4
- package/dist/components/ui/switch/switch.js.map +1 -1
- package/dist/components/ui/table/table.js +1 -1
- package/dist/components/ui/table/table.js.map +1 -1
- package/dist/components/ui/tabs/tabs.js +7 -7
- package/dist/components/ui/tabs/tabs.js.map +1 -1
- package/dist/components/ui/text-link/text-link.js +1 -1
- package/dist/components/ui/text-link/text-link.js.map +1 -1
- package/dist/components/ui/textarea/textarea.js +2 -2
- package/dist/components/ui/textarea/textarea.js.map +1 -1
- package/dist/components/ui/toast/toast.js +7 -7
- package/dist/components/ui/toast/toast.js.map +1 -1
- package/dist/components/ui/toggle/toggle.js +6 -6
- package/dist/components/ui/toggle/toggle.js.map +1 -1
- package/dist/components/ui/toggle-group/toggle-group.js +7 -8
- package/dist/components/ui/toggle-group/toggle-group.js.map +1 -1
- package/dist/components/ui/tooltip/deferred-tooltip.js +6 -6
- package/dist/components/ui/tooltip/deferred-tooltip.js.map +1 -1
- package/dist/components/ui/tooltip/lazy-tooltip.js +2 -2
- package/dist/components/ui/tooltip/tooltip.js +10 -10
- package/dist/components/ui/tooltip/tooltip.js.map +1 -1
- package/dist/components/ui/trace/trace.js +19 -19
- package/dist/components/ui/trace/trace.js.map +1 -1
- package/dist/components/ui/typography/typography.js +2 -2
- package/dist/lib/accent-presets.js +1 -1
- package/dist/lib/accent-roles.js +2 -2
- package/dist/lib/async-action.js +1 -1
- package/dist/lib/create-poll.js +1 -1
- package/dist/lib/create-poll.js.map +1 -1
- package/dist/lib/external-link.js +1 -1
- package/dist/lib/external-link.js.map +1 -1
- package/dist/lib/fast-icon.js +1 -1
- package/dist/lib/theme-css.js +1 -1
- package/dist/lib/theme-engine-light.js +1 -1
- package/dist/lib/theme-projection.js +2 -2
- package/dist/lib/theme-records.js +1 -1
- package/dist/lib/themes.js +1 -1
- package/dist/lib/themes.js.map +1 -1
- package/dist/lib/tooltip-focus-gate.js.map +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/vite/source-parser.js +1 -1
- package/dist/vite/tailwind-sources.js +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-menu.js","names":["<NavigationMenuPrimitive\n {...(rest as Record<string, unknown>)}\n value={props.value === undefined ? undefined : props.value}\n defaultValue={props.defaultValue}\n onValueChange={(value: string | null) => props.onValueChange?.(value ?? undefined)}\n orientation={props.orientation}\n delay={props.delayDuration}\n openOnHover={props.openOnHover}\n aria-label={props.label ?? 'Main'}\n class={cn('relative flex max-w-max flex-1 items-center justify-center', props.class)}\n >\n <NavigationMenuListPrimitive class=\"flex items-center gap-1\">\n {props.children}\n </NavigationMenuListPrimitive>\n {/*\n The shared panel surface. Rendered here rather than left to the caller:\n every panel animates through this one element.\n */}\n <NavigationMenuViewport />\n </NavigationMenuPrimitive>","props.value === undefined ? undefined : props.value","onValueChange={(value: string | null) => props.onValueChange?.(value ?? undefined)}","<NavigationMenuListPrimitive class=\"flex items-center gap-1\">\n {props.children}\n </NavigationMenuListPrimitive>","class=\"flex items-center gap-1\"","<NavigationMenuViewport />","<NavigationMenuItemPrimitive {...(props as Record<string, unknown>)} />","<NavigationMenuTriggerPrimitive\n {...(rest as Record<string, unknown>)}\n onFocus={(event: FocusEvent & { currentTarget: HTMLButtonElement; target: Element }) => {\n setFocused(true)\n callHandler(props.onFocus, event)\n }}\n onBlur={(event: FocusEvent & { currentTarget: HTMLButtonElement; target: Element }) => {\n setFocused(false)\n callHandler(props.onBlur, event)\n }}\n render={(part: Record<string, unknown>, state: { open: boolean }) => (\n <button\n {...part}\n data-expanded={state.open ? '' : undefined}\n data-highlighted={focused() ? '' : undefined}\n />\n )}\n class={cn(\n 'inline-flex items-center gap-1 rounded-md px-3 py-1.5 text-sm font-medium text-muted-foreground',\n 'transition-colors ease-out outline-none select-none',\n 'hover:bg-muted hover:text-foreground',\n 'data-[expanded]:bg-muted data-[expanded]:text-foreground',\n 'data-[highlighted]:bg-muted data-[highlighted]:text-foreground',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none',\n props.class\n )}\n >\n {props.children}\n <ChevronDown\n aria-hidden=\"true\"\n class=\"size-3.5 transition-transform duration-200 ease-out [[data-expanded]_&]:rotate-180\"\n />\n </NavigationMenuTriggerPrimitive>","onFocus={(event: FocusEvent & { currentTarget: HTMLButtonElement; target: Element }) => {\n setFocused(true)\n callHandler(props.onFocus, event)\n }}","onBlur={(event: FocusEvent & { currentTarget: HTMLButtonElement; target: Element }) => {\n setFocused(false)\n callHandler(props.onBlur, event)\n }}","render={(part: Record<string, unknown>, state: { open: boolean }) => (\n <button\n {...part}\n data-expanded={state.open ? '' : undefined}\n data-highlighted={focused() ? '' : undefined}\n />\n )}","props.children","<ChevronDown\n aria-hidden=\"true\"\n class=\"size-3.5 transition-transform duration-200 ease-out [[data-expanded]_&]:rotate-180\"\n />","class=\"size-3.5 transition-transform duration-200 ease-out [[data-expanded]_&]:rotate-180\"","<NavigationMenuContentPrimitive\n {...(rest as Record<string, unknown>)}\n render={(part: Record<string, unknown>, state: { open: boolean }) => (\n <div {...part} data-expanded={state.open ? '' : undefined} />\n )}\n class={cn(\n // Absolute so the viewport sizes to the active panel's measured box and\n // animates between panels, rather than stacking them.\n 'absolute top-0 left-0 grid w-max gap-1 outline-none',\n // The viewport is the surface and carries no padding of its own (its\n // measured size is the panel's), so the panel supplies the inset every\n // menu surface shares — the one the separator's bleed is cut for.\n menuContentPadding,\n // The motion is the panel's, not the viewport's: ui-sdk keeps an\n // outgoing panel mounted until its own exit animation ends, so each\n // panel fades and zooms on its own while the viewport resizes.\n overlayMotion,\n // A two-column panel is the shape most menu bars want, and it is opt-in\n // through this hook rather than a prop because the column count is a\n // layout decision the caller's content makes.\n 'data-[wide]:grid-cols-2',\n props.class\n )}\n >\n {props.children}\n </NavigationMenuContentPrimitive>","render={(part: Record<string, unknown>, state: { open: boolean }) => (\n <div {...part} data-expanded={state.open ? '' : undefined} />\n )}","<NavigationMenuViewportPrimitive\n // The 6px gap the surface's `mt-1.5` drew; ui-sdk writes the popup's\n // margin inline, so the gap is the placement's offset now.\n sideOffset={6}\n {...(rest as Record<string, unknown>)}\n data-slot=\"navigation-menu-viewport\"\n class={cn(\n overlaySurface,\n 'isolate z-(--z-menu) box-content list-none overflow-hidden',\n 'h-(--viewport-height) w-(--viewport-width)',\n 'origin-(--transform-origin) transition-[width,height] duration-200 ease-out',\n props.class\n )}\n />","sideOffset={6}","<NavigationMenuLinkPrimitive\n {...(rest as Record<string, unknown>)}\n onFocus={(event: FocusEvent & { currentTarget: HTMLAnchorElement; target: Element }) => {\n setHighlighted(true)\n callHandler(props.onFocus, event)\n }}\n onBlur={(event: FocusEvent & { currentTarget: HTMLAnchorElement; target: Element }) => {\n setHighlighted(false)\n callHandler(props.onBlur, event)\n }}\n onPointerEnter={(\n event: PointerEvent & { currentTarget: HTMLAnchorElement; target: Element }\n ) => {\n setHighlighted(true)\n callHandler(props.onPointerEnter, event)\n }}\n onPointerLeave={(\n event: PointerEvent & { currentTarget: HTMLAnchorElement; target: Element }\n ) => {\n setHighlighted(false)\n callHandler(props.onPointerLeave, event)\n }}\n render={(part: Record<string, unknown>) => (\n <a {...part} data-highlighted={highlighted() ? '' : undefined} />\n )}\n class={cn(\n menuItem,\n // The description sits under the label, in the label's column. Without\n // an icon there is no leading column, and a two-column grid would set\n // the description beside the label instead of beneath it.\n icon() ? 'grid grid-cols-[auto_1fr]' : 'grid grid-cols-1',\n 'items-center gap-x-2 gap-y-0.5',\n props.description && 'grid-rows-[auto_auto] py-2',\n props.class\n )}\n >\n {icon()}\n <span class=\"font-medium\">{props.children}</span>\n {props.description && (\n <span class={cn('text-xs text-muted-foreground', { 'col-start-2': !!icon() })}>\n {props.description}\n </span>\n )}\n </NavigationMenuLinkPrimitive>","onFocus={(event: FocusEvent & { currentTarget: HTMLAnchorElement; target: Element }) => {\n setHighlighted(true)\n callHandler(props.onFocus, event)\n }}","onBlur={(event: FocusEvent & { currentTarget: HTMLAnchorElement; target: Element }) => {\n setHighlighted(false)\n callHandler(props.onBlur, event)\n }}","onPointerEnter={(\n event: PointerEvent & { currentTarget: HTMLAnchorElement; target: Element }\n ) => {\n setHighlighted(true)\n callHandler(props.onPointerEnter, event)\n }}","onPointerLeave={(\n event: PointerEvent & { currentTarget: HTMLAnchorElement; target: Element }\n ) => {\n setHighlighted(false)\n callHandler(props.onPointerLeave, event)\n }}","render={(part: Record<string, unknown>) => (\n <a {...part} data-highlighted={highlighted() ? '' : undefined} />\n )}","icon()","{props.description && (\n <span class={cn('text-xs text-muted-foreground', { 'col-start-2': !!icon() })}>\n {props.description}\n </span>\n )}","<hr {...rest} class={cn(menuSeparator, props.class)} />","id={id ?? undefined}","<span id={id ?? undefined} {...rest} class={cn(menuLabel, props.class)} />","<GroupLabelContext value={labelId}>\n <div role=\"group\" aria-labelledby={labelId} {...rest} class={cn('grid gap-0.5', props.class)}>\n {props.children}\n </div>\n </GroupLabelContext>","value={labelId}","role=\"group\"","<div role=\"group\" aria-labelledby={labelId} {...rest} class={cn('grid gap-0.5', props.class)}>\n {props.children}\n </div>","ChevronDown","LucideChevronDown","NavigationMenu","NavigationMenuViewport","NavigationMenuTrigger","NavigationMenuContent","NavigationMenuItem","resolveChildren","_$readShallow"],"sources":["../../../../src/components/ui/navigation-menu/navigation-menu.tsx"],"sourcesContent":["import {\n children as resolveChildren,\n createContext,\n createSignal,\n createUniqueId,\n omit,\n useContext,\n} from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\nimport {\n NavigationMenu as NavigationMenuPrimitive,\n NavigationMenuContent as NavigationMenuContentPrimitive,\n NavigationMenuItem as NavigationMenuItemPrimitive,\n NavigationMenuLink as NavigationMenuLinkPrimitive,\n NavigationMenuList as NavigationMenuListPrimitive,\n NavigationMenuTrigger as NavigationMenuTriggerPrimitive,\n NavigationMenuViewport as NavigationMenuViewportPrimitive,\n} from '@ui-sdk/solid/navigation-menu'\nimport { ChevronDown as LucideChevronDown } from '@lucide/solid'\nimport { callHandler } from '#lib/events'\nimport { cn } from '#lib/utils'\nimport {\n menuContentPadding,\n menuItem,\n menuLabel,\n menuSeparator,\n overlayMotion,\n overlaySurface,\n} from '#lib/overlay'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ChevronDown = fastIcon(LucideChevronDown)\n\n/**\n * NavigationMenu.\n *\n * A site-style menu bar: top-level triggers that open panels of links. It is the\n * header pattern — a documentation site, a marketing page, an application with\n * several top-level destinations — and it is deliberately *not* a `Menubar`.\n * `Menubar` is a row of application menus (File, Edit, View) whose items are\n * commands; this is a row of destinations whose panels are links. The two have\n * different roles, different keyboard models, and different semantics: this one\n * is ui-sdk's disclosure navigation, a `<nav>` of buttons that show groups of\n * ordinary links.\n *\n * ## Composition\n *\n * ```tsx\n * <NavigationMenu>\n * <NavigationMenuMenu>\n * <NavigationMenuTrigger>Destinations</NavigationMenuTrigger>\n * <NavigationMenuContent>\n * <NavigationMenuItem href=\"/x\">X</NavigationMenuItem>\n * </NavigationMenuContent>\n * </NavigationMenuMenu>\n * </NavigationMenu>\n * ```\n *\n * - `Menu` is one top-level entry, the bar's `<li>`. The bar renders its own\n * `<ul>`, so a caller never writes the list or wraps a trigger in an `<li>`.\n * - `Content` belongs inside its `Menu`, next to the trigger. While open it\n * renders into the one shared viewport, which is what lets the bar animate\n * between panels instead of each popping in place.\n *\n * The wrapper renders the viewport itself, so a caller cannot forget it and\n * get a menu whose panels never paint.\n */\n\nexport type NavigationMenuProps = Omit<\n ComponentProps<'nav'>,\n 'value' | 'defaultValue' | 'onChange' | 'onSelect'\n> & {\n /** The accessible name for the navigation landmark. */\n label?: string\n /** The open entry's value. `null` or `undefined` closes every panel. */\n value?: string | null\n defaultValue?: string | null\n onValueChange?: (value: string | undefined) => void\n /** Which arrow keys move between the entries, and where panels open. */\n orientation?: 'horizontal' | 'vertical'\n /** Milliseconds the pointer rests on a trigger before its panel opens. */\n delayDuration?: number\n /** Whether resting the pointer on a trigger opens its panel. */\n openOnHover?: boolean\n}\n\nexport function NavigationMenu(props: NavigationMenuProps) {\n const rest = omit(\n props,\n 'label',\n 'class',\n 'children',\n 'value',\n 'defaultValue',\n 'onValueChange',\n 'orientation',\n 'delayDuration',\n 'openOnHover'\n )\n\n return (\n <NavigationMenuPrimitive\n {...(rest as Record<string, unknown>)}\n value={props.value === undefined ? undefined : props.value}\n defaultValue={props.defaultValue}\n onValueChange={(value: string | null) => props.onValueChange?.(value ?? undefined)}\n orientation={props.orientation}\n delay={props.delayDuration}\n openOnHover={props.openOnHover}\n aria-label={props.label ?? 'Main'}\n class={cn('relative flex max-w-max flex-1 items-center justify-center', props.class)}\n >\n <NavigationMenuListPrimitive class=\"flex items-center gap-1\">\n {props.children}\n </NavigationMenuListPrimitive>\n {/*\n The shared panel surface. Rendered here rather than left to the caller:\n every panel animates through this one element.\n */}\n <NavigationMenuViewport />\n </NavigationMenuPrimitive>\n )\n}\n\n/** One top-level entry: the bar's `<li>`, holding a trigger and its panel. */\nexport function NavigationMenuMenu(\n props: Omit<ComponentProps<'li'>, 'value'> & {\n /** Names the entry, for the root's `value`. */\n value?: string\n }\n) {\n return <NavigationMenuItemPrimitive {...(props as Record<string, unknown>)} />\n}\n\nexport function NavigationMenuTrigger(props: ComponentProps<'button'>) {\n // Kobalte marked the focused trigger `data-highlighted`; ui-sdk's trigger\n // reports `data-open` only, so the trigger keeps its own.\n const [focused, setFocused] = createSignal(false)\n const rest = omit(props, 'class', 'children', 'onFocus', 'onBlur')\n\n return (\n <NavigationMenuTriggerPrimitive\n {...(rest as Record<string, unknown>)}\n onFocus={(event: FocusEvent & { currentTarget: HTMLButtonElement; target: Element }) => {\n setFocused(true)\n callHandler(props.onFocus, event)\n }}\n onBlur={(event: FocusEvent & { currentTarget: HTMLButtonElement; target: Element }) => {\n setFocused(false)\n callHandler(props.onBlur, event)\n }}\n render={(part: Record<string, unknown>, state: { open: boolean }) => (\n <button\n {...part}\n data-expanded={state.open ? '' : undefined}\n data-highlighted={focused() ? '' : undefined}\n />\n )}\n class={cn(\n 'inline-flex items-center gap-1 rounded-md px-3 py-1.5 text-sm font-medium text-muted-foreground',\n 'transition-colors ease-out outline-none select-none',\n 'hover:bg-muted hover:text-foreground',\n 'data-[expanded]:bg-muted data-[expanded]:text-foreground',\n 'data-[highlighted]:bg-muted data-[highlighted]:text-foreground',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none',\n props.class\n )}\n >\n {props.children}\n <ChevronDown\n aria-hidden=\"true\"\n class=\"size-3.5 transition-transform duration-200 ease-out [[data-expanded]_&]:rotate-180\"\n />\n </NavigationMenuTriggerPrimitive>\n )\n}\n\nexport function NavigationMenuContent(props: ComponentProps<'div'>) {\n const rest = omit(props, 'class', 'children')\n\n return (\n <NavigationMenuContentPrimitive\n {...(rest as Record<string, unknown>)}\n render={(part: Record<string, unknown>, state: { open: boolean }) => (\n <div {...part} data-expanded={state.open ? '' : undefined} />\n )}\n class={cn(\n // Absolute so the viewport sizes to the active panel's measured box and\n // animates between panels, rather than stacking them.\n 'absolute top-0 left-0 grid w-max gap-1 outline-none',\n // The viewport is the surface and carries no padding of its own (its\n // measured size is the panel's), so the panel supplies the inset every\n // menu surface shares — the one the separator's bleed is cut for.\n menuContentPadding,\n // The motion is the panel's, not the viewport's: ui-sdk keeps an\n // outgoing panel mounted until its own exit animation ends, so each\n // panel fades and zooms on its own while the viewport resizes.\n overlayMotion,\n // A two-column panel is the shape most menu bars want, and it is opt-in\n // through this hook rather than a prop because the column count is a\n // layout decision the caller's content makes.\n 'data-[wide]:grid-cols-2',\n props.class\n )}\n >\n {props.children}\n </NavigationMenuContentPrimitive>\n )\n}\n\n/**\n * The shared panel surface. One per menu bar, and the wrapper supplies it — but\n * exported so a caller with an unusual layout can place it themselves.\n *\n * It renders no children: the open panel renders into it. ui-sdk places it\n * under the open trigger and publishes the panel's size as `--viewport-width`\n * and `--viewport-height`, which the surface animates between. `box-content`\n * keeps the border outside that measured size so a panel is never clipped by\n * its own frame.\n */\nexport function NavigationMenuViewport(props: ComponentProps<'div'>) {\n const rest = omit(props, 'class')\n\n return (\n <NavigationMenuViewportPrimitive\n // The 6px gap the surface's `mt-1.5` drew; ui-sdk writes the popup's\n // margin inline, so the gap is the placement's offset now.\n sideOffset={6}\n {...(rest as Record<string, unknown>)}\n data-slot=\"navigation-menu-viewport\"\n class={cn(\n overlaySurface,\n 'isolate z-(--z-menu) box-content list-none overflow-hidden',\n 'h-(--viewport-height) w-(--viewport-width)',\n 'origin-(--transform-origin) transition-[width,height] duration-200 ease-out',\n props.class\n )}\n />\n )\n}\n\n/**\n * A link inside a panel. `href` is the point of the component, so it is a link\n * rather than a button — and the accessible name comes from its text, which is\n * why there is no `aria-label` here.\n */\nexport type NavigationMenuItemProps = ComponentProps<'a'> & {\n /** A one-line description, shown under the label. */\n description?: string\n icon?: JSX.Element\n /** Marks the link as the current page (`aria-current=\"page\"`). */\n current?: boolean\n /** Whether pressing the link closes the menu. */\n closeOnSelect?: boolean\n}\n\nexport function NavigationMenuItem(props: NavigationMenuItemProps) {\n // The row's hover and focus fill keys on `data-highlighted`, which Kobalte\n // set on the row under the pointer or focus; ui-sdk's link is a plain link.\n const [highlighted, setHighlighted] = createSignal(false)\n const rest = omit(\n props,\n 'class',\n 'children',\n 'description',\n 'icon',\n 'onFocus',\n 'onBlur',\n 'onPointerEnter',\n 'onPointerLeave'\n )\n const icon = resolveChildren(() => props.icon)\n\n return (\n <NavigationMenuLinkPrimitive\n {...(rest as Record<string, unknown>)}\n onFocus={(event: FocusEvent & { currentTarget: HTMLAnchorElement; target: Element }) => {\n setHighlighted(true)\n callHandler(props.onFocus, event)\n }}\n onBlur={(event: FocusEvent & { currentTarget: HTMLAnchorElement; target: Element }) => {\n setHighlighted(false)\n callHandler(props.onBlur, event)\n }}\n onPointerEnter={(\n event: PointerEvent & { currentTarget: HTMLAnchorElement; target: Element }\n ) => {\n setHighlighted(true)\n callHandler(props.onPointerEnter, event)\n }}\n onPointerLeave={(\n event: PointerEvent & { currentTarget: HTMLAnchorElement; target: Element }\n ) => {\n setHighlighted(false)\n callHandler(props.onPointerLeave, event)\n }}\n render={(part: Record<string, unknown>) => (\n <a {...part} data-highlighted={highlighted() ? '' : undefined} />\n )}\n class={cn(\n menuItem,\n // The description sits under the label, in the label's column. Without\n // an icon there is no leading column, and a two-column grid would set\n // the description beside the label instead of beneath it.\n icon() ? 'grid grid-cols-[auto_1fr]' : 'grid grid-cols-1',\n 'items-center gap-x-2 gap-y-0.5',\n props.description && 'grid-rows-[auto_auto] py-2',\n props.class\n )}\n >\n {icon()}\n <span class=\"font-medium\">{props.children}</span>\n {props.description && (\n <span class={cn('text-xs text-muted-foreground', { 'col-start-2': !!icon() })}>\n {props.description}\n </span>\n )}\n </NavigationMenuLinkPrimitive>\n )\n}\n\n/** The rule between groups: an `hr`, whose preflight top border is part of its look. */\nexport function NavigationMenuSeparator(props: ComponentProps<'hr'>) {\n const rest = omit(props, 'class')\n return <hr {...rest} class={cn(menuSeparator, props.class)} />\n}\n\nconst GroupLabelContext = createContext<string | null>(null)\n\n/** A non-interactive caption above a group of items, which names its group. */\nexport function NavigationMenuGroupLabel(props: ComponentProps<'span'>) {\n const id = useContext(GroupLabelContext)\n const rest = omit(props, 'class')\n return <span id={id ?? undefined} {...rest} class={cn(menuLabel, props.class)} />\n}\n\nexport function NavigationMenuGroup(props: ComponentProps<'div'>) {\n const labelId = createUniqueId()\n const rest = omit(props, 'class', 'children')\n return (\n <GroupLabelContext value={labelId}>\n <div role=\"group\" aria-labelledby={labelId} {...rest} class={cn('grid gap-0.5', props.class)}>\n {props.children}\n </div>\n </GroupLabelContext>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;AAgCA,IAAMiC,gBAAc,SAASC,WAAiB;AAuD9C,SAAgBC,iBAAe,OAA4B;CACzD,MAAM,OAAO,KACX,OACA,SACA,SACA,YACA,SACA,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,KAAK,OAAO,OAAO;CACzB,IAAA,QAAA,QAAsD;CAA9C,OAAA,OAAA,CAAA,MAAA,EAAM,IAAA,UAAA;EAAO,OAAA,GAAG,eAAe,MAAM,KAAK;CAAC,EAAA,CAAA,GAAA,KAAA;CAA1D,OAAOf;AACT;AAEA,IAAM,oBAAoB,cAA6B,IAAI;;AAG3D,SAAgB,yBAAyB,OAA+B;CACtE,MAAM,KAAK,WAAW,iBAAiB;CACvC,MAAM,OAAO,KAAK,OAAO,OAAO;CACzB,IAAA,QAAA,QAAyE;;EAA9C,EAArBC,IAAI,MAAM,KAAA,EAAmB;EAAJ;EAAM,EAAA,IAAA,UAAA;GAAO,OAAA,GAAG,WAAW,MAAM,KAAK;EAAC,EAAA;;CAA7E,OAAOC;AACT;AAEA,SAAgB,oBAAoB,OAA8B;CAChE,MAAM,UAAU,eAAe;CAC/B,MAAM,OAAO,KAAK,OAAO,SAAS,UAAU;CAC5C,OACEC,gBAAAA,mBAAAA;EAAmBC,OAAO;EAA1B,IAAA,WAAA;GACE,IAAA,QAAA,QAEK;;IAFuC;KAAvCC,MAAAA;KAAa,mBAAiB;IAAiB;IAAJ;IAAM,EAAA,IAAA,UAAA;KAAO,OAAA,GAAG,gBAAgB,MAAM,KAAK;IAAC,EAAA;;GAA5F,OAAA,aACE;IAAC,OAAA,MAAM;GAAQ,CACZ;GAHP,OACEC;EAGiB;;AAEvB"}
|
|
1
|
+
{"version":3,"file":"navigation-menu.js","names":["<NavigationMenuPrimitive\n {...(rest as Record<string, unknown>)}\n value={props.value === undefined ? undefined : props.value}\n defaultValue={props.defaultValue}\n onValueChange={(value: string | null) => props.onValueChange?.(value ?? undefined)}\n orientation={props.orientation}\n delay={props.delayDuration}\n openOnHover={props.openOnHover}\n aria-label={props.label ?? 'Main'}\n class={cn('relative flex max-w-max flex-1 items-center justify-center', props.class)}\n >\n <NavigationMenuListPrimitive class=\"flex items-center gap-1\">\n {props.children}\n </NavigationMenuListPrimitive>\n {/*\n The shared panel surface. Rendered here rather than left to the caller:\n every panel animates through this one element.\n */}\n <NavigationMenuViewport />\n </NavigationMenuPrimitive>","props.value === undefined ? undefined : props.value","onValueChange={(value: string | null) => props.onValueChange?.(value ?? undefined)}","<NavigationMenuListPrimitive class=\"flex items-center gap-1\">\n {props.children}\n </NavigationMenuListPrimitive>","class=\"flex items-center gap-1\"","<NavigationMenuViewport />","<NavigationMenuItemPrimitive {...(props as Record<string, unknown>)} />","<NavigationMenuTriggerPrimitive\n {...(rest as Record<string, unknown>)}\n onFocus={(event: FocusEvent & { currentTarget: HTMLButtonElement; target: Element }) => {\n setFocused(true)\n callHandler(props.onFocus, event)\n }}\n onBlur={(event: FocusEvent & { currentTarget: HTMLButtonElement; target: Element }) => {\n setFocused(false)\n callHandler(props.onBlur, event)\n }}\n render={(part: Record<string, unknown>, state: { open: boolean }) => (\n <button\n {...part}\n data-expanded={state.open ? '' : undefined}\n data-highlighted={focused() ? '' : undefined}\n />\n )}\n class={cn(\n 'inline-flex items-center gap-1 rounded-md px-3 py-1.5 text-sm font-medium text-muted-foreground',\n 'transition-colors ease-out outline-none select-none',\n 'hover:bg-muted hover:text-foreground',\n 'data-[expanded]:bg-muted data-[expanded]:text-foreground',\n 'data-[highlighted]:bg-muted data-[highlighted]:text-foreground',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none',\n props.class\n )}\n >\n {props.children}\n <ChevronDown\n aria-hidden=\"true\"\n class=\"size-3.5 transition-transform duration-200 ease-out [[data-expanded]_&]:rotate-180\"\n />\n </NavigationMenuTriggerPrimitive>","onFocus={(event: FocusEvent & { currentTarget: HTMLButtonElement; target: Element }) => {\n setFocused(true)\n callHandler(props.onFocus, event)\n }}","onBlur={(event: FocusEvent & { currentTarget: HTMLButtonElement; target: Element }) => {\n setFocused(false)\n callHandler(props.onBlur, event)\n }}","render={(part: Record<string, unknown>, state: { open: boolean }) => (\n <button\n {...part}\n data-expanded={state.open ? '' : undefined}\n data-highlighted={focused() ? '' : undefined}\n />\n )}","props.children","<ChevronDown\n aria-hidden=\"true\"\n class=\"size-3.5 transition-transform duration-200 ease-out [[data-expanded]_&]:rotate-180\"\n />","class=\"size-3.5 transition-transform duration-200 ease-out [[data-expanded]_&]:rotate-180\"","<NavigationMenuContentPrimitive\n {...(rest as Record<string, unknown>)}\n render={(part: Record<string, unknown>, state: { open: boolean }) => (\n <div {...part} data-expanded={state.open ? '' : undefined} />\n )}\n class={cn(\n // Absolute so the viewport sizes to the active panel's measured box and\n // animates between panels, rather than stacking them.\n 'absolute top-0 left-0 grid w-max gap-1 outline-none',\n // The viewport is the surface and carries no padding of its own (its\n // measured size is the panel's), so the panel supplies the inset every\n // menu surface shares — the one the separator's bleed is cut for.\n menuContentPadding,\n // The motion is the panel's, not the viewport's: ui-sdk keeps an\n // outgoing panel mounted until its own exit animation ends, so each\n // panel fades and zooms on its own while the viewport resizes.\n overlayMotion,\n // A two-column panel is the shape most menu bars want, and it is opt-in\n // through this hook rather than a prop because the column count is a\n // layout decision the caller's content makes.\n 'data-[wide]:grid-cols-2',\n props.class\n )}\n >\n {props.children}\n </NavigationMenuContentPrimitive>","render={(part: Record<string, unknown>, state: { open: boolean }) => (\n <div {...part} data-expanded={state.open ? '' : undefined} />\n )}","<NavigationMenuViewportPrimitive\n // The 6px gap the surface's `mt-1.5` drew; ui-sdk writes the popup's\n // margin inline, so the gap is the placement's offset now.\n sideOffset={6}\n {...(rest as Record<string, unknown>)}\n data-slot=\"navigation-menu-viewport\"\n class={cn(\n overlaySurface,\n 'isolate z-(--z-menu) box-content list-none overflow-hidden',\n 'h-(--viewport-height) w-(--viewport-width)',\n 'origin-(--transform-origin) transition-[width,height] duration-200 ease-out',\n props.class\n )}\n />","sideOffset={6}","<NavigationMenuLinkPrimitive\n {...(rest as Record<string, unknown>)}\n onFocus={(event: FocusEvent & { currentTarget: HTMLAnchorElement; target: Element }) => {\n setHighlighted(true)\n callHandler(props.onFocus, event)\n }}\n onBlur={(event: FocusEvent & { currentTarget: HTMLAnchorElement; target: Element }) => {\n setHighlighted(false)\n callHandler(props.onBlur, event)\n }}\n onPointerEnter={(\n event: PointerEvent & { currentTarget: HTMLAnchorElement; target: Element }\n ) => {\n setHighlighted(true)\n callHandler(props.onPointerEnter, event)\n }}\n onPointerLeave={(\n event: PointerEvent & { currentTarget: HTMLAnchorElement; target: Element }\n ) => {\n setHighlighted(false)\n callHandler(props.onPointerLeave, event)\n }}\n render={(part: Record<string, unknown>) => (\n <a {...part} data-highlighted={highlighted() ? '' : undefined} />\n )}\n class={cn(\n menuItem,\n // The description sits under the label, in the label's column. Without\n // an icon there is no leading column, and a two-column grid would set\n // the description beside the label instead of beneath it.\n icon() ? 'grid grid-cols-[auto_1fr]' : 'grid grid-cols-1',\n 'items-center gap-x-2 gap-y-0.5',\n props.description && 'grid-rows-[auto_auto] py-2',\n props.class\n )}\n >\n {icon()}\n <span class=\"font-medium\">{props.children}</span>\n {props.description && (\n <span class={cn('text-xs text-muted-foreground', { 'col-start-2': !!icon() })}>\n {props.description}\n </span>\n )}\n </NavigationMenuLinkPrimitive>","onFocus={(event: FocusEvent & { currentTarget: HTMLAnchorElement; target: Element }) => {\n setHighlighted(true)\n callHandler(props.onFocus, event)\n }}","onBlur={(event: FocusEvent & { currentTarget: HTMLAnchorElement; target: Element }) => {\n setHighlighted(false)\n callHandler(props.onBlur, event)\n }}","onPointerEnter={(\n event: PointerEvent & { currentTarget: HTMLAnchorElement; target: Element }\n ) => {\n setHighlighted(true)\n callHandler(props.onPointerEnter, event)\n }}","onPointerLeave={(\n event: PointerEvent & { currentTarget: HTMLAnchorElement; target: Element }\n ) => {\n setHighlighted(false)\n callHandler(props.onPointerLeave, event)\n }}","render={(part: Record<string, unknown>) => (\n <a {...part} data-highlighted={highlighted() ? '' : undefined} />\n )}","icon()","{props.description && (\n <span class={cn('text-xs text-muted-foreground', { 'col-start-2': !!icon() })}>\n {props.description}\n </span>\n )}","<hr {...rest} class={cn(menuSeparator, props.class)} />","id={id ?? undefined}","<span id={id ?? undefined} {...rest} class={cn(menuLabel, props.class)} />","<GroupLabelContext value={labelId}>\n <div role=\"group\" aria-labelledby={labelId} {...rest} class={cn('grid gap-0.5', props.class)}>\n {props.children}\n </div>\n </GroupLabelContext>","value={labelId}","role=\"group\"","<div role=\"group\" aria-labelledby={labelId} {...rest} class={cn('grid gap-0.5', props.class)}>\n {props.children}\n </div>","LucideChevronDown","_$spread","resolveChildren","_$insert","_$effect","_$readShallow","_$className"],"sources":["../../../../src/components/ui/navigation-menu/navigation-menu.tsx"],"sourcesContent":["import {\n children as resolveChildren,\n createContext,\n createSignal,\n createUniqueId,\n omit,\n useContext,\n} from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\nimport {\n NavigationMenu as NavigationMenuPrimitive,\n NavigationMenuContent as NavigationMenuContentPrimitive,\n NavigationMenuItem as NavigationMenuItemPrimitive,\n NavigationMenuLink as NavigationMenuLinkPrimitive,\n NavigationMenuList as NavigationMenuListPrimitive,\n NavigationMenuTrigger as NavigationMenuTriggerPrimitive,\n NavigationMenuViewport as NavigationMenuViewportPrimitive,\n} from '@ui-sdk/solid/navigation-menu'\nimport { ChevronDown as LucideChevronDown } from '@lucide/solid'\nimport { callHandler } from '#lib/events'\nimport { cn } from '#lib/utils'\nimport {\n menuContentPadding,\n menuItem,\n menuLabel,\n menuSeparator,\n overlayMotion,\n overlaySurface,\n} from '#lib/overlay'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ChevronDown = fastIcon(LucideChevronDown)\n\n/**\n * NavigationMenu.\n *\n * A site-style menu bar: top-level triggers that open panels of links. It is the\n * header pattern — a documentation site, a marketing page, an application with\n * several top-level destinations — and it is deliberately *not* a `Menubar`.\n * `Menubar` is a row of application menus (File, Edit, View) whose items are\n * commands; this is a row of destinations whose panels are links. The two have\n * different roles, different keyboard models, and different semantics: this one\n * is ui-sdk's disclosure navigation, a `<nav>` of buttons that show groups of\n * ordinary links.\n *\n * ## Composition\n *\n * ```tsx\n * <NavigationMenu>\n * <NavigationMenuMenu>\n * <NavigationMenuTrigger>Destinations</NavigationMenuTrigger>\n * <NavigationMenuContent>\n * <NavigationMenuItem href=\"/x\">X</NavigationMenuItem>\n * </NavigationMenuContent>\n * </NavigationMenuMenu>\n * </NavigationMenu>\n * ```\n *\n * - `Menu` is one top-level entry, the bar's `<li>`. The bar renders its own\n * `<ul>`, so a caller never writes the list or wraps a trigger in an `<li>`.\n * - `Content` belongs inside its `Menu`, next to the trigger. While open it\n * renders into the one shared viewport, which is what lets the bar animate\n * between panels instead of each popping in place.\n *\n * The wrapper renders the viewport itself, so a caller cannot forget it and\n * get a menu whose panels never paint.\n */\n\nexport type NavigationMenuProps = Omit<\n ComponentProps<'nav'>,\n 'value' | 'defaultValue' | 'onChange' | 'onSelect'\n> & {\n /** The accessible name for the navigation landmark. */\n label?: string\n /** The open entry's value. `null` or `undefined` closes every panel. */\n value?: string | null\n defaultValue?: string | null\n onValueChange?: (value: string | undefined) => void\n /** Which arrow keys move between the entries, and where panels open. */\n orientation?: 'horizontal' | 'vertical'\n /** Milliseconds the pointer rests on a trigger before its panel opens. */\n delayDuration?: number\n /** Whether resting the pointer on a trigger opens its panel. */\n openOnHover?: boolean\n}\n\nexport function NavigationMenu(props: NavigationMenuProps) {\n const rest = omit(\n props,\n 'label',\n 'class',\n 'children',\n 'value',\n 'defaultValue',\n 'onValueChange',\n 'orientation',\n 'delayDuration',\n 'openOnHover'\n )\n\n return (\n <NavigationMenuPrimitive\n {...(rest as Record<string, unknown>)}\n value={props.value === undefined ? undefined : props.value}\n defaultValue={props.defaultValue}\n onValueChange={(value: string | null) => props.onValueChange?.(value ?? undefined)}\n orientation={props.orientation}\n delay={props.delayDuration}\n openOnHover={props.openOnHover}\n aria-label={props.label ?? 'Main'}\n class={cn('relative flex max-w-max flex-1 items-center justify-center', props.class)}\n >\n <NavigationMenuListPrimitive class=\"flex items-center gap-1\">\n {props.children}\n </NavigationMenuListPrimitive>\n {/*\n The shared panel surface. Rendered here rather than left to the caller:\n every panel animates through this one element.\n */}\n <NavigationMenuViewport />\n </NavigationMenuPrimitive>\n )\n}\n\n/** One top-level entry: the bar's `<li>`, holding a trigger and its panel. */\nexport function NavigationMenuMenu(\n props: Omit<ComponentProps<'li'>, 'value'> & {\n /** Names the entry, for the root's `value`. */\n value?: string\n }\n) {\n return <NavigationMenuItemPrimitive {...(props as Record<string, unknown>)} />\n}\n\nexport function NavigationMenuTrigger(props: ComponentProps<'button'>) {\n // Kobalte marked the focused trigger `data-highlighted`; ui-sdk's trigger\n // reports `data-open` only, so the trigger keeps its own.\n const [focused, setFocused] = createSignal(false)\n const rest = omit(props, 'class', 'children', 'onFocus', 'onBlur')\n\n return (\n <NavigationMenuTriggerPrimitive\n {...(rest as Record<string, unknown>)}\n onFocus={(event: FocusEvent & { currentTarget: HTMLButtonElement; target: Element }) => {\n setFocused(true)\n callHandler(props.onFocus, event)\n }}\n onBlur={(event: FocusEvent & { currentTarget: HTMLButtonElement; target: Element }) => {\n setFocused(false)\n callHandler(props.onBlur, event)\n }}\n render={(part: Record<string, unknown>, state: { open: boolean }) => (\n <button\n {...part}\n data-expanded={state.open ? '' : undefined}\n data-highlighted={focused() ? '' : undefined}\n />\n )}\n class={cn(\n 'inline-flex items-center gap-1 rounded-md px-3 py-1.5 text-sm font-medium text-muted-foreground',\n 'transition-colors ease-out outline-none select-none',\n 'hover:bg-muted hover:text-foreground',\n 'data-[expanded]:bg-muted data-[expanded]:text-foreground',\n 'data-[highlighted]:bg-muted data-[highlighted]:text-foreground',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none',\n props.class\n )}\n >\n {props.children}\n <ChevronDown\n aria-hidden=\"true\"\n class=\"size-3.5 transition-transform duration-200 ease-out [[data-expanded]_&]:rotate-180\"\n />\n </NavigationMenuTriggerPrimitive>\n )\n}\n\nexport function NavigationMenuContent(props: ComponentProps<'div'>) {\n const rest = omit(props, 'class', 'children')\n\n return (\n <NavigationMenuContentPrimitive\n {...(rest as Record<string, unknown>)}\n render={(part: Record<string, unknown>, state: { open: boolean }) => (\n <div {...part} data-expanded={state.open ? '' : undefined} />\n )}\n class={cn(\n // Absolute so the viewport sizes to the active panel's measured box and\n // animates between panels, rather than stacking them.\n 'absolute top-0 left-0 grid w-max gap-1 outline-none',\n // The viewport is the surface and carries no padding of its own (its\n // measured size is the panel's), so the panel supplies the inset every\n // menu surface shares — the one the separator's bleed is cut for.\n menuContentPadding,\n // The motion is the panel's, not the viewport's: ui-sdk keeps an\n // outgoing panel mounted until its own exit animation ends, so each\n // panel fades and zooms on its own while the viewport resizes.\n overlayMotion,\n // A two-column panel is the shape most menu bars want, and it is opt-in\n // through this hook rather than a prop because the column count is a\n // layout decision the caller's content makes.\n 'data-[wide]:grid-cols-2',\n props.class\n )}\n >\n {props.children}\n </NavigationMenuContentPrimitive>\n )\n}\n\n/**\n * The shared panel surface. One per menu bar, and the wrapper supplies it — but\n * exported so a caller with an unusual layout can place it themselves.\n *\n * It renders no children: the open panel renders into it. ui-sdk places it\n * under the open trigger and publishes the panel's size as `--viewport-width`\n * and `--viewport-height`, which the surface animates between. `box-content`\n * keeps the border outside that measured size so a panel is never clipped by\n * its own frame.\n */\nexport function NavigationMenuViewport(props: ComponentProps<'div'>) {\n const rest = omit(props, 'class')\n\n return (\n <NavigationMenuViewportPrimitive\n // The 6px gap the surface's `mt-1.5` drew; ui-sdk writes the popup's\n // margin inline, so the gap is the placement's offset now.\n sideOffset={6}\n {...(rest as Record<string, unknown>)}\n data-slot=\"navigation-menu-viewport\"\n class={cn(\n overlaySurface,\n 'isolate z-(--z-menu) box-content list-none overflow-hidden',\n 'h-(--viewport-height) w-(--viewport-width)',\n 'origin-(--transform-origin) transition-[width,height] duration-200 ease-out',\n props.class\n )}\n />\n )\n}\n\n/**\n * A link inside a panel. `href` is the point of the component, so it is a link\n * rather than a button — and the accessible name comes from its text, which is\n * why there is no `aria-label` here.\n */\nexport type NavigationMenuItemProps = ComponentProps<'a'> & {\n /** A one-line description, shown under the label. */\n description?: string\n icon?: JSX.Element\n /** Marks the link as the current page (`aria-current=\"page\"`). */\n current?: boolean\n /** Whether pressing the link closes the menu. */\n closeOnSelect?: boolean\n}\n\nexport function NavigationMenuItem(props: NavigationMenuItemProps) {\n // The row's hover and focus fill keys on `data-highlighted`, which Kobalte\n // set on the row under the pointer or focus; ui-sdk's link is a plain link.\n const [highlighted, setHighlighted] = createSignal(false)\n const rest = omit(\n props,\n 'class',\n 'children',\n 'description',\n 'icon',\n 'onFocus',\n 'onBlur',\n 'onPointerEnter',\n 'onPointerLeave'\n )\n const icon = resolveChildren(() => props.icon)\n\n return (\n <NavigationMenuLinkPrimitive\n {...(rest as Record<string, unknown>)}\n onFocus={(event: FocusEvent & { currentTarget: HTMLAnchorElement; target: Element }) => {\n setHighlighted(true)\n callHandler(props.onFocus, event)\n }}\n onBlur={(event: FocusEvent & { currentTarget: HTMLAnchorElement; target: Element }) => {\n setHighlighted(false)\n callHandler(props.onBlur, event)\n }}\n onPointerEnter={(\n event: PointerEvent & { currentTarget: HTMLAnchorElement; target: Element }\n ) => {\n setHighlighted(true)\n callHandler(props.onPointerEnter, event)\n }}\n onPointerLeave={(\n event: PointerEvent & { currentTarget: HTMLAnchorElement; target: Element }\n ) => {\n setHighlighted(false)\n callHandler(props.onPointerLeave, event)\n }}\n render={(part: Record<string, unknown>) => (\n <a {...part} data-highlighted={highlighted() ? '' : undefined} />\n )}\n class={cn(\n menuItem,\n // The description sits under the label, in the label's column. Without\n // an icon there is no leading column, and a two-column grid would set\n // the description beside the label instead of beneath it.\n icon() ? 'grid grid-cols-[auto_1fr]' : 'grid grid-cols-1',\n 'items-center gap-x-2 gap-y-0.5',\n props.description && 'grid-rows-[auto_auto] py-2',\n props.class\n )}\n >\n {icon()}\n <span class=\"font-medium\">{props.children}</span>\n {props.description && (\n <span class={cn('text-xs text-muted-foreground', { 'col-start-2': !!icon() })}>\n {props.description}\n </span>\n )}\n </NavigationMenuLinkPrimitive>\n )\n}\n\n/** The rule between groups: an `hr`, whose preflight top border is part of its look. */\nexport function NavigationMenuSeparator(props: ComponentProps<'hr'>) {\n const rest = omit(props, 'class')\n return <hr {...rest} class={cn(menuSeparator, props.class)} />\n}\n\nconst GroupLabelContext = createContext<string | null>(null)\n\n/** A non-interactive caption above a group of items, which names its group. */\nexport function NavigationMenuGroupLabel(props: ComponentProps<'span'>) {\n const id = useContext(GroupLabelContext)\n const rest = omit(props, 'class')\n return <span id={id ?? undefined} {...rest} class={cn(menuLabel, props.class)} />\n}\n\nexport function NavigationMenuGroup(props: ComponentProps<'div'>) {\n const labelId = createUniqueId()\n const rest = omit(props, 'class', 'children')\n return (\n <GroupLabelContext value={labelId}>\n <div role=\"group\" aria-labelledby={labelId} {...rest} class={cn('grid gap-0.5', props.class)}>\n {props.children}\n </div>\n </GroupLabelContext>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;AAgCA,IAAM,cAAc,SAASiC,aAAiB;AAuD9C,SAAgB,eAAe,OAA4B;CACzD,MAAM,OAAO,KACX,OACA,SACA,SACA,YACA,SACA,gBACA,iBACA,eACA,iBACA,aACF;CAEA,OACEjC,gBAAAA,kBAAAA,WACO,MADP;EAEE,IAAA,QAAA;GAAOC,OAAAA,WAAAA;IAAM,OAAA,MAAA,UAAU,KAAA;GAAkC,CAAA,CAAC,CAAD,IAAtB,KAAA,IAAY,MAAM;EAAK;EAC1D,IAAA,eAAA;GAAc,OAAA,MAAM;EAAY;EAChCC,gBAAgB,UAAyB,MAAM,gBAAgB,SAAS,KAAA,CAAS;EACjF,IAAA,cAAA;GAAa,OAAA,MAAM;EAAW;EAC9B,IAAA,QAAA;GAAO,OAAA,MAAM;EAAa;EAC1B,IAAA,cAAA;GAAa,OAAA,MAAM;EAAW;EAC9B,IAAA,eAAA;GAAY,OAAA,MAAM,SAAS;EAAM;EACjC,IAAA,UAAA;GAAO,OAAA,GAAG,8DAA8D,MAAM,KAAK;EAAC;EATtF,IAAA,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M,OAAO,KAAK,OAAO,SAAS,UAAU;CAC5C,OACEC,gBAAAA,mBAAAA;EAAmBC,OAAO;EAA1B,IAAA,WAAA;GACE,IAAA,QAAA,QAEK;;IAFuC;KAAvCC,MAAAA;KAAa,mBAAiB;IAAiB;IAAJ;IAAM,EAAA,IAAA,UAAA;KAAO,OAAA,GAAG,gBAAgB,MAAM,KAAK;IAAC,EAAA;;GAA5FK,OAAA,aACE;IAAC,OAAA,MAAM;GAAQ,CACZ;GAHP,OACEJ;EAGiB;;AAEvB"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { cn } from "../../../lib/utils.js";
|
|
2
|
-
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
3
1
|
import { createComponent, memo, mergeProps, template } from "@solidjs/web";
|
|
4
|
-
import {
|
|
2
|
+
import { Pagination as Pagination$1, PaginationEllipsis as PaginationEllipsis$1, PaginationItem as PaginationItem$1, PaginationLink, PaginationList, PaginationNext as PaginationNext$1, PaginationPrevious as PaginationPrevious$1 } from "@ui-sdk/solid/pagination";
|
|
3
|
+
import { ChevronLeft as ChevronLeft$1, ChevronRight as ChevronRight$1, MoreHorizontal as MoreHorizontal$1 } from "@lucide/solid";
|
|
5
4
|
import { For, Show, omit } from "solid-js";
|
|
6
|
-
import {
|
|
5
|
+
import { cn } from "../../../lib/utils.js";
|
|
6
|
+
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
7
7
|
// src/components/ui/pagination/pagination.tsx
|
|
8
8
|
var _tmpl$ = /* @__PURE__ */ template(`<span class="hidden sm:inline">Previous`);
|
|
9
9
|
var _tmpl$2 = /* @__PURE__ */ template(`<span class="hidden sm:inline">Next`);
|
|
10
|
-
var ChevronLeft
|
|
11
|
-
var ChevronRight
|
|
12
|
-
var MoreHorizontal
|
|
10
|
+
var ChevronLeft = fastIcon(ChevronLeft$1);
|
|
11
|
+
var ChevronRight = fastIcon(ChevronRight$1);
|
|
12
|
+
var MoreHorizontal = fastIcon(MoreHorizontal$1);
|
|
13
13
|
var paginationControl = cn("inline-flex h-control-md min-w-(--control-height-md) items-center justify-center gap-1 rounded-md border border-transparent px-2 text-sm tabular-nums", "transition-colors ease-out outline-none select-none", "hover:bg-surface-hover", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle", "disabled:pointer-events-none disabled:opacity-50", "data-[disabled]:pointer-events-none data-[disabled]:opacity-50", "[&_svg]:pointer-events-none [&_svg]:size-4");
|
|
14
|
-
function Pagination
|
|
14
|
+
function Pagination(props) {
|
|
15
15
|
const rest = omit(props, "class", "itemComponent", "ellipsisComponent", "children", "count", "onPageChange", "siblingCount", "showFirst", "showLast");
|
|
16
|
-
return createComponent(Pagination, mergeProps({
|
|
16
|
+
return createComponent(Pagination$1, mergeProps({
|
|
17
17
|
"aria-label": "Pagination",
|
|
18
18
|
get pageCount() {
|
|
19
19
|
return props.count;
|
|
@@ -44,18 +44,18 @@ function Pagination$1(props) {
|
|
|
44
44
|
/** Previous, the numbered run, next: the arrangement every list view wants. */
|
|
45
45
|
function DefaultPaginationControls(state) {
|
|
46
46
|
return [
|
|
47
|
-
createComponent(PaginationPrevious
|
|
47
|
+
createComponent(PaginationPrevious, {}),
|
|
48
48
|
createComponent(For, {
|
|
49
49
|
get each() {
|
|
50
50
|
return state.items;
|
|
51
51
|
},
|
|
52
52
|
children: (item) => typeof item === "number" ? (props.itemComponent ?? defaultItem)({ page: item }) : (props.ellipsisComponent ?? defaultEllipsis)()
|
|
53
53
|
}),
|
|
54
|
-
createComponent(PaginationNext
|
|
54
|
+
createComponent(PaginationNext, {})
|
|
55
55
|
];
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
var defaultItem = (itemProps) => createComponent(PaginationItem
|
|
58
|
+
var defaultItem = (itemProps) => createComponent(PaginationItem, {
|
|
59
59
|
get page() {
|
|
60
60
|
return itemProps.page;
|
|
61
61
|
},
|
|
@@ -63,31 +63,31 @@ var defaultItem = (itemProps) => createComponent(PaginationItem$1, {
|
|
|
63
63
|
return itemProps.page;
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
|
-
var defaultEllipsis = () => createComponent(PaginationEllipsis
|
|
67
|
-
function PaginationPrevious
|
|
66
|
+
var defaultEllipsis = () => createComponent(PaginationEllipsis, {});
|
|
67
|
+
function PaginationPrevious(props) {
|
|
68
68
|
const rest = omit(props, "class", "children");
|
|
69
|
-
return createComponent(PaginationItem, { get children() {
|
|
70
|
-
return createComponent(PaginationPrevious, mergeProps({ get "class"() {
|
|
69
|
+
return createComponent(PaginationItem$1, { get children() {
|
|
70
|
+
return createComponent(PaginationPrevious$1, mergeProps({ get "class"() {
|
|
71
71
|
return cn(paginationControl, "ps-1.5", props.class);
|
|
72
72
|
} }, rest, { get children() {
|
|
73
|
-
return props.children ?? [createComponent(ChevronLeft
|
|
73
|
+
return props.children ?? [createComponent(ChevronLeft, { class: "size-4" }), _tmpl$()];
|
|
74
74
|
} }));
|
|
75
75
|
} });
|
|
76
76
|
}
|
|
77
|
-
function PaginationNext
|
|
77
|
+
function PaginationNext(props) {
|
|
78
78
|
const rest = omit(props, "class", "children");
|
|
79
|
-
return createComponent(PaginationItem, { get children() {
|
|
80
|
-
return createComponent(PaginationNext, mergeProps({ get "class"() {
|
|
79
|
+
return createComponent(PaginationItem$1, { get children() {
|
|
80
|
+
return createComponent(PaginationNext$1, mergeProps({ get "class"() {
|
|
81
81
|
return cn(paginationControl, "pe-1.5", props.class);
|
|
82
82
|
} }, rest, { get children() {
|
|
83
|
-
return props.children ?? [_tmpl$2(), createComponent(ChevronRight
|
|
83
|
+
return props.children ?? [_tmpl$2(), createComponent(ChevronRight, { class: "size-4" })];
|
|
84
84
|
} }));
|
|
85
85
|
} });
|
|
86
86
|
}
|
|
87
87
|
/** One page of the run: a list item holding the page's button (or link, with `getHref`). */
|
|
88
|
-
function PaginationItem
|
|
88
|
+
function PaginationItem(props) {
|
|
89
89
|
const rest = omit(props, "class", "children");
|
|
90
|
-
return createComponent(PaginationItem, { get children() {
|
|
90
|
+
return createComponent(PaginationItem$1, { get children() {
|
|
91
91
|
return createComponent(PaginationLink, mergeProps({ get "class"() {
|
|
92
92
|
return cn(paginationControl, "data-[current]:border-border data-[current]:bg-surface-active data-[current]:font-medium", props.class);
|
|
93
93
|
} }, rest, { get children() {
|
|
@@ -96,16 +96,16 @@ function PaginationItem$1(props) {
|
|
|
96
96
|
} });
|
|
97
97
|
}
|
|
98
98
|
/** A gap in the run. Hidden from screen readers, which hear the page numbers around it. */
|
|
99
|
-
function PaginationEllipsis
|
|
99
|
+
function PaginationEllipsis(props) {
|
|
100
100
|
const rest = omit(props, "class", "children");
|
|
101
|
-
return createComponent(PaginationItem, { get children() {
|
|
102
|
-
return createComponent(PaginationEllipsis, mergeProps({ get "class"() {
|
|
101
|
+
return createComponent(PaginationItem$1, { get children() {
|
|
102
|
+
return createComponent(PaginationEllipsis$1, mergeProps({ get "class"() {
|
|
103
103
|
return cn("flex size-control-md items-center justify-center", props.class);
|
|
104
104
|
} }, rest, { get children() {
|
|
105
|
-
return props.children ?? createComponent(MoreHorizontal
|
|
105
|
+
return props.children ?? createComponent(MoreHorizontal, { class: "size-4" });
|
|
106
106
|
} }));
|
|
107
107
|
} });
|
|
108
108
|
}
|
|
109
|
-
export { Pagination
|
|
109
|
+
export { Pagination, PaginationEllipsis, PaginationItem, PaginationNext, PaginationPrevious };
|
|
110
110
|
|
|
111
111
|
//# sourceMappingURL=pagination.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.js","names":["<SdkPagination\n aria-label=\"Pagination\"\n pageCount={props.count}\n siblings={props.siblingCount ?? 1}\n // ui-sdk shows the same number of pages at both ends; hiding only one\n // end is not something it draws, so either flag keeps a boundary page.\n boundaries={props.showFirst === false && props.showLast === false ? 0 : 1}\n onPageChange={(page) => props.onPageChange?.(page)}\n // The root is a `<nav>` wrapping a `<ul>`, and every control — previous,\n // the page run, next — is an `<li>` inside that list. The row has to be\n // declared on the list: on the `<nav>` alone it lays out one child and\n // the controls stack vertically.\n class={cn(\n 'flex w-full items-center justify-center [&>ul]:m-0 [&>ul]:flex [&>ul]:list-none [&>ul]:items-center [&>ul]:gap-1 [&>ul]:p-0',\n props.class\n )}\n {...rest}\n >\n <SdkPaginationList>\n {(state) => (\n <Show when={props.children} fallback={<DefaultPaginationControls items={state.items} />}>\n {(childrenSlot) => <>{childrenSlot()}</>}\n </Show>\n )}\n </SdkPaginationList>\n </SdkPagination>","onPageChange={(page) => props.onPageChange?.(page)}","<SdkPaginationList>\n {(state) => (\n <Show when={props.children} fallback={<DefaultPaginationControls items={state.items} />}>\n {(childrenSlot) => <>{childrenSlot()}</>}\n </Show>\n )}\n </SdkPaginationList>","<Show when={props.children} fallback={<DefaultPaginationControls items={state.items} />}>\n {(childrenSlot) => <>{childrenSlot()}</>}\n </Show>","<DefaultPaginationControls items={state.items} />","{childrenSlot()}","<PaginationPrevious />","<For each={state.items}>\n {(item) =>\n typeof item === 'number'\n ? (props.itemComponent ?? defaultItem)({ page: item })\n : (props.ellipsisComponent ?? defaultEllipsis)()\n }\n </For>","<PaginationNext />","<PaginationItem page={itemProps.page}>{itemProps.page}</PaginationItem>","<PaginationEllipsis />","<SdkPaginationItem>\n <SdkPaginationPrevious\n class={cn(paginationControl, 'ps-1.5', props.class as string)}\n {...rest}\n >\n {props.children ?? (\n <>\n <ChevronLeft class=\"size-4\" />\n <span class=\"hidden sm:inline\">Previous</span>\n </>\n )}\n </SdkPaginationPrevious>\n </SdkPaginationItem>","<SdkPaginationPrevious\n class={cn(paginationControl, 'ps-1.5', props.class as string)}\n {...rest}\n >\n {props.children ?? (\n <>\n <ChevronLeft class=\"size-4\" />\n <span class=\"hidden sm:inline\">Previous</span>\n </>\n )}\n </SdkPaginationPrevious>","<ChevronLeft class=\"size-4\" />","class=\"size-4\"","<span class=\"hidden sm:inline\">Previous</span>","<SdkPaginationItem>\n <SdkPaginationNext class={cn(paginationControl, 'pe-1.5', props.class as string)} {...rest}>\n {props.children ?? (\n <>\n <span class=\"hidden sm:inline\">Next</span>\n <ChevronRight class=\"size-4\" />\n </>\n )}\n </SdkPaginationNext>\n </SdkPaginationItem>","<SdkPaginationNext class={cn(paginationControl, 'pe-1.5', props.class as string)} {...rest}>\n {props.children ?? (\n <>\n <span class=\"hidden sm:inline\">Next</span>\n <ChevronRight class=\"size-4\" />\n </>\n )}\n </SdkPaginationNext>","<span class=\"hidden sm:inline\">Next</span>","<ChevronRight class=\"size-4\" />","<SdkPaginationItem>\n <SdkPaginationLink\n class={cn(\n paginationControl,\n 'data-[current]:border-border data-[current]:bg-surface-active data-[current]:font-medium',\n props.class as string\n )}\n {...rest}\n >\n {props.children}\n </SdkPaginationLink>\n </SdkPaginationItem>","<SdkPaginationLink\n class={cn(\n paginationControl,\n 'data-[current]:border-border data-[current]:bg-surface-active data-[current]:font-medium',\n props.class as string\n )}\n {...rest}\n >\n {props.children}\n </SdkPaginationLink>","<SdkPaginationItem>\n <SdkPaginationEllipsis\n class={cn('flex size-control-md items-center justify-center', props.class as string)}\n {...rest}\n >\n {props.children ?? <MoreHorizontal class=\"size-4\" />}\n </SdkPaginationEllipsis>\n </SdkPaginationItem>","<SdkPaginationEllipsis\n class={cn('flex size-control-md items-center justify-center', props.class as string)}\n {...rest}\n >\n {props.children ?? <MoreHorizontal class=\"size-4\" />}\n </SdkPaginationEllipsis>","<MoreHorizontal class=\"size-4\" />","ChevronLeft","LucideChevronLeft","ChevronRight","LucideChevronRight","MoreHorizontal","LucideMoreHorizontal","Pagination","PaginationPrevious","PaginationNext","PaginationItem","PaginationEllipsis"],"sources":["../../../../src/components/ui/pagination/pagination.tsx"],"sourcesContent":["import {\n Pagination as SdkPagination,\n PaginationEllipsis as SdkPaginationEllipsis,\n PaginationItem as SdkPaginationItem,\n PaginationLink as SdkPaginationLink,\n PaginationList as SdkPaginationList,\n PaginationNext as SdkPaginationNext,\n PaginationPrevious as SdkPaginationPrevious,\n} from '@ui-sdk/solid/pagination'\nimport {\n ChevronLeft as LucideChevronLeft,\n ChevronRight as LucideChevronRight,\n MoreHorizontal as LucideMoreHorizontal,\n} from '@lucide/solid'\nimport type { ComponentProps, JSX } from '@solidjs/web'\nimport { For, Show, omit } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ChevronLeft = fastIcon(LucideChevronLeft)\nconst ChevronRight = fastIcon(LucideChevronRight)\nconst MoreHorizontal = fastIcon(LucideMoreHorizontal)\n\n/**\n * Pagination.\n *\n * Page navigation for a list the server pages, not for a list the client already\n * holds — slicing an array you have is a filter, and it should not spend a round\n * trip.\n *\n * ui-sdk's Pagination computes the visible page window and the ellipsis\n * positions and emits `aria-current=\"page\"`, so the control announces which\n * page is active instead of leaving it to colour alone. At either end the\n * Previous or Next step stays focusable and says it is unavailable with\n * `aria-disabled`, rather than dropping out of the tab order.\n *\n * The item and ellipsis renderers are *supplied here*, not required of the caller.\n * A headless primitive has no opinion about how a page number should look; a\n * design system does, so the only thing a caller has to pass is `count` — while\n * still being able to override either renderer when a view needs to.\n */\nexport type PaginationProps = Omit<\n ComponentProps<typeof SdkPagination>,\n | 'pageCount'\n | 'siblings'\n | 'boundaries'\n | 'onPageChange'\n | 'onChange'\n | 'children'\n | 'total'\n | 'pageSize'\n> & {\n /** How many pages there are. */\n count: number\n /** Called with the new page, from 1. */\n onPageChange?: (page: number) => void\n /** How many pages show on each side of the current one; 1 by default. */\n siblingCount?: number\n /** Whether the first page always shows; with `showLast`, both default to true. */\n showFirst?: boolean\n /** Whether the last page always shows. */\n showLast?: boolean\n /** Draws one page of the run; `PaginationItem` by default. */\n itemComponent?: (props: { page: number }) => JSX.Element\n /** Draws one gap in the run; `PaginationEllipsis` by default. */\n ellipsisComponent?: () => JSX.Element\n class?: string\n /** Replaces Previous, the page run and Next, inside the list. */\n children?: JSX.Element\n}\n\nconst paginationControl = cn(\n 'inline-flex h-control-md min-w-(--control-height-md) items-center justify-center gap-1 rounded-md border border-transparent px-2 text-sm tabular-nums',\n 'transition-colors ease-out outline-none select-none',\n 'hover:bg-surface-hover',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'disabled:pointer-events-none disabled:opacity-50',\n // A step at its end is `aria-disabled` and stays focusable, so it never\n // matches `:disabled`; it takes the same look from `data-disabled`.\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n '[&_svg]:pointer-events-none [&_svg]:size-4'\n)\n\nexport function Pagination(props: PaginationProps) {\n const rest = omit(\n props,\n 'class',\n 'itemComponent',\n 'ellipsisComponent',\n 'children',\n 'count',\n 'onPageChange',\n 'siblingCount',\n 'showFirst',\n 'showLast'\n )\n\n return (\n <SdkPagination\n aria-label=\"Pagination\"\n pageCount={props.count}\n siblings={props.siblingCount ?? 1}\n // ui-sdk shows the same number of pages at both ends; hiding only one\n // end is not something it draws, so either flag keeps a boundary page.\n boundaries={props.showFirst === false && props.showLast === false ? 0 : 1}\n onPageChange={(page) => props.onPageChange?.(page)}\n // The root is a `<nav>` wrapping a `<ul>`, and every control — previous,\n // the page run, next — is an `<li>` inside that list. The row has to be\n // declared on the list: on the `<nav>` alone it lays out one child and\n // the controls stack vertically.\n class={cn(\n 'flex w-full items-center justify-center [&>ul]:m-0 [&>ul]:flex [&>ul]:list-none [&>ul]:items-center [&>ul]:gap-1 [&>ul]:p-0',\n props.class\n )}\n {...rest}\n >\n <SdkPaginationList>\n {(state) => (\n <Show when={props.children} fallback={<DefaultPaginationControls items={state.items} />}>\n {(childrenSlot) => <>{childrenSlot()}</>}\n </Show>\n )}\n </SdkPaginationList>\n </SdkPagination>\n )\n\n /** Previous, the numbered run, next: the arrangement every list view wants. */\n function DefaultPaginationControls(state: { items: readonly (number | string)[] }) {\n return (\n <>\n <PaginationPrevious />\n <For each={state.items}>\n {(item) =>\n typeof item === 'number'\n ? (props.itemComponent ?? defaultItem)({ page: item })\n : (props.ellipsisComponent ?? defaultEllipsis)()\n }\n </For>\n <PaginationNext />\n </>\n )\n }\n}\n\nconst defaultItem = (itemProps: { page: number }) => (\n <PaginationItem page={itemProps.page}>{itemProps.page}</PaginationItem>\n)\nconst defaultEllipsis = () => <PaginationEllipsis />\n\ntype StepProps = ComponentProps<typeof SdkPaginationPrevious>\n\nexport function PaginationPrevious(props: StepProps) {\n const rest = omit(props, 'class', 'children')\n\n return (\n <SdkPaginationItem>\n <SdkPaginationPrevious\n class={cn(paginationControl, 'ps-1.5', props.class as string)}\n {...rest}\n >\n {props.children ?? (\n <>\n <ChevronLeft class=\"size-4\" />\n <span class=\"hidden sm:inline\">Previous</span>\n </>\n )}\n </SdkPaginationPrevious>\n </SdkPaginationItem>\n )\n}\n\nexport function PaginationNext(props: StepProps) {\n const rest = omit(props, 'class', 'children')\n\n return (\n <SdkPaginationItem>\n <SdkPaginationNext class={cn(paginationControl, 'pe-1.5', props.class as string)} {...rest}>\n {props.children ?? (\n <>\n <span class=\"hidden sm:inline\">Next</span>\n <ChevronRight class=\"size-4\" />\n </>\n )}\n </SdkPaginationNext>\n </SdkPaginationItem>\n )\n}\n\n/** One page of the run: a list item holding the page's button (or link, with `getHref`). */\nexport function PaginationItem(props: ComponentProps<typeof SdkPaginationLink>) {\n const rest = omit(props, 'class', 'children')\n\n return (\n <SdkPaginationItem>\n <SdkPaginationLink\n class={cn(\n paginationControl,\n 'data-[current]:border-border data-[current]:bg-surface-active data-[current]:font-medium',\n props.class as string\n )}\n {...rest}\n >\n {props.children}\n </SdkPaginationLink>\n </SdkPaginationItem>\n )\n}\n\n/** A gap in the run. Hidden from screen readers, which hear the page numbers around it. */\nexport function PaginationEllipsis(\n props: ComponentProps<typeof SdkPaginationEllipsis> & { children?: JSX.Element }\n) {\n const rest = omit(props, 'class', 'children')\n\n return (\n <SdkPaginationItem>\n <SdkPaginationEllipsis\n class={cn('flex size-control-md items-center justify-center', props.class as string)}\n {...rest}\n >\n {props.children ?? <MoreHorizontal class=\"size-4\" />}\n </SdkPaginationEllipsis>\n </Sdk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A,EACE,IAAA,UAAA;GAAO,OAAA,GACL,mBACA,4FACA,MAAM,KACR;EAAC,EAIgB,GAHb,MANN,EAAA,IAAA,WAAA;GAQG,OAAA,MAAM;EACU,EAAA,CAAA,CAAA;CACF,EAAA,CAAA;AAEvB;;AAGA,SAAgBc,qBACd,OACA;CACA,MAAM,OAAO,KAAK,OAAO,SAAS,UAAU;CAE5C,OACEb,gBAAAA,gBAAAA,EAAAA,IAAAA,WAAAA;EACEC,OAAAA,gBAAAA,oBAAAA,WAAAA,EACE,IAAA,UAAA;GAAO,OAAA,GAAG,oDAAoD,MAAM,KAAe;EAAC,EAI/D,GAHjB,MAFN,EAAA,IAAA,WAAA;GAIG,OAAA,MAAM,YAAYC,gBAAAA,kBAAAA,EAAgBV,OAAM,SAAU,CAAA;EAC9B,EAAA,CAAA,CAAA;CACN,EAAA,CAAA;AAEvB"}
|
|
1
|
+
{"version":3,"file":"pagination.js","names":["<SdkPagination\n aria-label=\"Pagination\"\n pageCount={props.count}\n siblings={props.siblingCount ?? 1}\n // ui-sdk shows the same number of pages at both ends; hiding only one\n // end is not something it draws, so either flag keeps a boundary page.\n boundaries={props.showFirst === false && props.showLast === false ? 0 : 1}\n onPageChange={(page) => props.onPageChange?.(page)}\n // The root is a `<nav>` wrapping a `<ul>`, and every control — previous,\n // the page run, next — is an `<li>` inside that list. The row has to be\n // declared on the list: on the `<nav>` alone it lays out one child and\n // the controls stack vertically.\n class={cn(\n 'flex w-full items-center justify-center [&>ul]:m-0 [&>ul]:flex [&>ul]:list-none [&>ul]:items-center [&>ul]:gap-1 [&>ul]:p-0',\n props.class\n )}\n {...rest}\n >\n <SdkPaginationList>\n {(state) => (\n <Show when={props.children} fallback={<DefaultPaginationControls items={state.items} />}>\n {(childrenSlot) => <>{childrenSlot()}</>}\n </Show>\n )}\n </SdkPaginationList>\n </SdkPagination>","onPageChange={(page) => props.onPageChange?.(page)}","<SdkPaginationList>\n {(state) => (\n <Show when={props.children} fallback={<DefaultPaginationControls items={state.items} />}>\n {(childrenSlot) => <>{childrenSlot()}</>}\n </Show>\n )}\n </SdkPaginationList>","<Show when={props.children} fallback={<DefaultPaginationControls items={state.items} />}>\n {(childrenSlot) => <>{childrenSlot()}</>}\n </Show>","<DefaultPaginationControls items={state.items} />","{childrenSlot()}","<PaginationPrevious />","<For each={state.items}>\n {(item) =>\n typeof item === 'number'\n ? (props.itemComponent ?? defaultItem)({ page: item })\n : (props.ellipsisComponent ?? defaultEllipsis)()\n }\n </For>","<PaginationNext />","<PaginationItem page={itemProps.page}>{itemProps.page}</PaginationItem>","<PaginationEllipsis />","<SdkPaginationItem>\n <SdkPaginationPrevious\n class={cn(paginationControl, 'ps-1.5', props.class as string)}\n {...rest}\n >\n {props.children ?? (\n <>\n <ChevronLeft class=\"size-4\" />\n <span class=\"hidden sm:inline\">Previous</span>\n </>\n )}\n </SdkPaginationPrevious>\n </SdkPaginationItem>","<SdkPaginationPrevious\n class={cn(paginationControl, 'ps-1.5', props.class as string)}\n {...rest}\n >\n {props.children ?? (\n <>\n <ChevronLeft class=\"size-4\" />\n <span class=\"hidden sm:inline\">Previous</span>\n </>\n )}\n </SdkPaginationPrevious>","<ChevronLeft class=\"size-4\" />","class=\"size-4\"","<span class=\"hidden sm:inline\">Previous</span>","<SdkPaginationItem>\n <SdkPaginationNext class={cn(paginationControl, 'pe-1.5', props.class as string)} {...rest}>\n {props.children ?? (\n <>\n <span class=\"hidden sm:inline\">Next</span>\n <ChevronRight class=\"size-4\" />\n </>\n )}\n </SdkPaginationNext>\n </SdkPaginationItem>","<SdkPaginationNext class={cn(paginationControl, 'pe-1.5', props.class as string)} {...rest}>\n {props.children ?? (\n <>\n <span class=\"hidden sm:inline\">Next</span>\n <ChevronRight class=\"size-4\" />\n </>\n )}\n </SdkPaginationNext>","<span class=\"hidden sm:inline\">Next</span>","<ChevronRight class=\"size-4\" />","<SdkPaginationItem>\n <SdkPaginationLink\n class={cn(\n paginationControl,\n 'data-[current]:border-border data-[current]:bg-surface-active data-[current]:font-medium',\n props.class as string\n )}\n {...rest}\n >\n {props.children}\n </SdkPaginationLink>\n </SdkPaginationItem>","<SdkPaginationLink\n class={cn(\n paginationControl,\n 'data-[current]:border-border data-[current]:bg-surface-active data-[current]:font-medium',\n props.class as string\n )}\n {...rest}\n >\n {props.children}\n </SdkPaginationLink>","<SdkPaginationItem>\n <SdkPaginationEllipsis\n class={cn('flex size-control-md items-center justify-center', props.class as string)}\n {...rest}\n >\n {props.children ?? <MoreHorizontal class=\"size-4\" />}\n </SdkPaginationEllipsis>\n </SdkPaginationItem>","<SdkPaginationEllipsis\n class={cn('flex size-control-md items-center justify-center', props.class as string)}\n {...rest}\n >\n {props.children ?? <MoreHorizontal class=\"size-4\" />}\n </SdkPaginationEllipsis>","<MoreHorizontal class=\"size-4\" />","LucideChevronLeft","LucideChevronRight","LucideMoreHorizontal"],"sources":["../../../../src/components/ui/pagination/pagination.tsx"],"sourcesContent":["import {\n Pagination as SdkPagination,\n PaginationEllipsis as SdkPaginationEllipsis,\n PaginationItem as SdkPaginationItem,\n PaginationLink as SdkPaginationLink,\n PaginationList as SdkPaginationList,\n PaginationNext as SdkPaginationNext,\n PaginationPrevious as SdkPaginationPrevious,\n} from '@ui-sdk/solid/pagination'\nimport {\n ChevronLeft as LucideChevronLeft,\n ChevronRight as LucideChevronRight,\n MoreHorizontal as LucideMoreHorizontal,\n} from '@lucide/solid'\nimport type { ComponentProps, JSX } from '@solidjs/web'\nimport { For, Show, omit } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ChevronLeft = fastIcon(LucideChevronLeft)\nconst ChevronRight = fastIcon(LucideChevronRight)\nconst MoreHorizontal = fastIcon(LucideMoreHorizontal)\n\n/**\n * Pagination.\n *\n * Page navigation for a list the server pages, not for a list the client already\n * holds — slicing an array you have is a filter, and it should not spend a round\n * trip.\n *\n * ui-sdk's Pagination computes the visible page window and the ellipsis\n * positions and emits `aria-current=\"page\"`, so the control announces which\n * page is active instead of leaving it to colour alone. At either end the\n * Previous or Next step stays focusable and says it is unavailable with\n * `aria-disabled`, rather than dropping out of the tab order.\n *\n * The item and ellipsis renderers are *supplied here*, not required of the caller.\n * A headless primitive has no opinion about how a page number should look; a\n * design system does, so the only thing a caller has to pass is `count` — while\n * still being able to override either renderer when a view needs to.\n */\nexport type PaginationProps = Omit<\n ComponentProps<typeof SdkPagination>,\n | 'pageCount'\n | 'siblings'\n | 'boundaries'\n | 'onPageChange'\n | 'onChange'\n | 'children'\n | 'total'\n | 'pageSize'\n> & {\n /** How many pages there are. */\n count: number\n /** Called with the new page, from 1. */\n onPageChange?: (page: number) => void\n /** How many pages show on each side of the current one; 1 by default. */\n siblingCount?: number\n /** Whether the first page always shows; with `showLast`, both default to true. */\n showFirst?: boolean\n /** Whether the last page always shows. */\n showLast?: boolean\n /** Draws one page of the run; `PaginationItem` by default. */\n itemComponent?: (props: { page: number }) => JSX.Element\n /** Draws one gap in the run; `PaginationEllipsis` by default. */\n ellipsisComponent?: () => JSX.Element\n class?: string\n /** Replaces Previous, the page run and Next, inside the list. */\n children?: JSX.Element\n}\n\nconst paginationControl = cn(\n 'inline-flex h-control-md min-w-(--control-height-md) items-center justify-center gap-1 rounded-md border border-transparent px-2 text-sm tabular-nums',\n 'transition-colors ease-out outline-none select-none',\n 'hover:bg-surface-hover',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'disabled:pointer-events-none disabled:opacity-50',\n // A step at its end is `aria-disabled` and stays focusable, so it never\n // matches `:disabled`; it takes the same look from `data-disabled`.\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n '[&_svg]:pointer-events-none [&_svg]:size-4'\n)\n\nexport function Pagination(props: PaginationProps) {\n const rest = omit(\n props,\n 'class',\n 'itemComponent',\n 'ellipsisComponent',\n 'children',\n 'count',\n 'onPageChange',\n 'siblingCount',\n 'showFirst',\n 'showLast'\n )\n\n return (\n <SdkPagination\n aria-label=\"Pagination\"\n pageCount={props.count}\n siblings={props.siblingCount ?? 1}\n // ui-sdk shows the same number of pages at both ends; hiding only one\n // end is not something it draws, so either flag keeps a boundary page.\n boundaries={props.showFirst === false && props.showLast === false ? 0 : 1}\n onPageChange={(page) => props.onPageChange?.(page)}\n // The root is a `<nav>` wrapping a `<ul>`, and every control — previous,\n // the page run, next — is an `<li>` inside that list. The row has to be\n // declared on the list: on the `<nav>` alone it lays out one child and\n // the controls stack vertically.\n class={cn(\n 'flex w-full items-center justify-center [&>ul]:m-0 [&>ul]:flex [&>ul]:list-none [&>ul]:items-center [&>ul]:gap-1 [&>ul]:p-0',\n props.class\n )}\n {...rest}\n >\n <SdkPaginationList>\n {(state) => (\n <Show when={props.children} fallback={<DefaultPaginationControls items={state.items} />}>\n {(childrenSlot) => <>{childrenSlot()}</>}\n </Show>\n )}\n </SdkPaginationList>\n </SdkPagination>\n )\n\n /** Previous, the numbered run, next: the arrangement every list view wants. */\n function DefaultPaginationControls(state: { items: readonly (number | string)[] }) {\n return (\n <>\n <PaginationPrevious />\n <For each={state.items}>\n {(item) =>\n typeof item === 'number'\n ? (props.itemComponent ?? defaultItem)({ page: item })\n : (props.ellipsisComponent ?? defaultEllipsis)()\n }\n </For>\n <PaginationNext />\n </>\n )\n }\n}\n\nconst defaultItem = (itemProps: { page: number }) => (\n <PaginationItem page={itemProps.page}>{itemProps.page}</PaginationItem>\n)\nconst defaultEllipsis = () => <PaginationEllipsis />\n\ntype StepProps = ComponentProps<typeof SdkPaginationPrevious>\n\nexport function PaginationPrevious(props: StepProps) {\n const rest = omit(props, 'class', 'children')\n\n return (\n <SdkPaginationItem>\n <SdkPaginationPrevious\n class={cn(paginationControl, 'ps-1.5', props.class as string)}\n {...rest}\n >\n {props.children ?? (\n <>\n <ChevronLeft class=\"size-4\" />\n <span class=\"hidden sm:inline\">Previous</span>\n </>\n )}\n </SdkPaginationPrevious>\n </SdkPaginationItem>\n )\n}\n\nexport function PaginationNext(props: StepProps) {\n const rest = omit(props, 'class', 'children')\n\n return (\n <SdkPaginationItem>\n <SdkPaginationNext class={cn(paginationControl, 'pe-1.5', props.class as string)} {...rest}>\n {props.children ?? (\n <>\n <span class=\"hidden sm:inline\">Next</span>\n <ChevronRight class=\"size-4\" />\n </>\n )}\n </SdkPaginationNext>\n </SdkPaginationItem>\n )\n}\n\n/** One page of the run: a list item holding the page's button (or link, with `getHref`). */\nexport function PaginationItem(props: ComponentProps<typeof SdkPaginationLink>) {\n const rest = omit(props, 'class', 'children')\n\n return (\n <SdkPaginationItem>\n <SdkPaginationLink\n class={cn(\n paginationControl,\n 'data-[current]:border-border data-[current]:bg-surface-active data-[current]:font-medium',\n props.class as string\n )}\n {...rest}\n >\n {props.children}\n </SdkPaginationLink>\n </SdkPaginationItem>\n )\n}\n\n/** A gap in the run. Hidden from screen readers, which hear the page numbers around it. */\nexport function PaginationEllipsis(\n props: ComponentProps<typeof SdkPaginationEllipsis> & { children?: JSX.Element }\n) {\n const rest = omit(props, 'class', 'children')\n\n return (\n <SdkPaginationItem>\n <SdkPaginationEllipsis\n class={cn('flex size-control-md items-center justify-center', props.class as string)}\n {...rest}\n >\n {props.children ?? <MoreHorizontal class=\"size-4\" />}\n </SdkPaginationEllipsis>\n </SdkPaginationItem>\n )\n}\n"],"mappings":";;;;;;;;;AAoBA,IAAM,cAAc,SAASyB,aAAiB;AAC9C,IAAM,eAAe,SAASC,cAAkB;AAChD,IAAM,iBAAiB,SAASC,gBAAoB;AAkDpD,IAAM,oBAAoB,GACxB,yJACA,uDACA,0BACA,oFACA,oDAGA,kEACA,4CACF;AAEA,SAAgB,WAAW,OAAwB;CACjD,MAAM,OAAO,KACX,OACA,SACA,iBACA,qBACA,YACA,SACA,gBACA,gBACA,aACA,UACF;CAEA,OACE3B,gBAAAA,cAAAA,WAAAA;EACE,cAAW;EACX,IAAA,YAAA;GAAW,OAAA,MAAM;EAAK;EACtB,IAAA,WAAA;GAAU,OAAA,MAAM,g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BAAAA,EAAgBV,OAAM,SAAU,CAAA;EAC9B,EAAA,CAAA,CAAA;CACN,EAAA,CAAA;AAEvB"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { Dynamic, createComponent, memo, mergeProps } from "@solidjs/web";
|
|
2
|
+
import { Popover as Popover$1, PopoverArrow, PopoverClose, PopoverContent as PopoverContent$1, PopoverDescription as PopoverDescription$1, PopoverTitle as PopoverTitle$1, PopoverTrigger as PopoverTrigger$1, createPopoverController } from "@ui-sdk/solid/popover";
|
|
3
|
+
import { Show, createContext, createSignal, omit, useContext } from "solid-js";
|
|
1
4
|
import { overlaySurface, popoverArrow, popoverMotion } from "../../../lib/overlay.js";
|
|
2
5
|
import { cn } from "../../../lib/utils.js";
|
|
3
6
|
import { ArrowGlyph, arrowPlacement, asRender, expandedDiv, overlayContainer, placementProps, triggerRender } from "../tooltip/tooltip.js";
|
|
4
7
|
import { LayerRootContext, createLayerRoot, layerHandlerProps, layerHandlers, useLayerContent } from "../dialog/dialog-layer.js";
|
|
5
8
|
import { forwardRef } from "../../../lib/refs.js";
|
|
6
|
-
import { Dynamic, createComponent, memo, mergeProps } from "@solidjs/web";
|
|
7
|
-
import { Show, createContext, createSignal, omit, useContext } from "solid-js";
|
|
8
|
-
import { Popover, PopoverArrow, PopoverClose, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger, createPopoverController } from "@ui-sdk/solid/popover";
|
|
9
9
|
// src/components/ui/popover/popover.tsx
|
|
10
10
|
var PopoverPlacementContext = createContext(null);
|
|
11
11
|
/** The Kobalte-era options ui-sdk positions on its own, or does not take. */
|
|
@@ -24,7 +24,7 @@ var legacyRootProps = [
|
|
|
24
24
|
"id",
|
|
25
25
|
"translations"
|
|
26
26
|
];
|
|
27
|
-
function Popover
|
|
27
|
+
function Popover(props) {
|
|
28
28
|
const controller = createPopoverController();
|
|
29
29
|
const layer = createLayerRoot(() => controller.close({ reason: "escape-key" }));
|
|
30
30
|
const [anchor, setAnchor] = createSignal();
|
|
@@ -40,7 +40,7 @@ function Popover$1(props) {
|
|
|
40
40
|
setAnchor: (element) => setAnchor(() => element)
|
|
41
41
|
},
|
|
42
42
|
get children() {
|
|
43
|
-
return createComponent(Popover, mergeProps({ modal: false }, rest, {
|
|
43
|
+
return createComponent(Popover$1, mergeProps({ modal: false }, rest, {
|
|
44
44
|
controller,
|
|
45
45
|
onOpenChange: (open, details) => {
|
|
46
46
|
if (layer.refuses(open, details)) return details.cancel();
|
|
@@ -58,8 +58,8 @@ function Popover$1(props) {
|
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
|
-
function PopoverTrigger
|
|
62
|
-
return createComponent(PopoverTrigger, mergeProps(() => {
|
|
61
|
+
function PopoverTrigger(props) {
|
|
62
|
+
return createComponent(PopoverTrigger$1, mergeProps(() => {
|
|
63
63
|
return omit(props, "as");
|
|
64
64
|
}, { get render() {
|
|
65
65
|
return triggerRender(props.as, "button", () => props["data-slot"]);
|
|
@@ -89,7 +89,7 @@ var contentOwnProps = [
|
|
|
89
89
|
"shift",
|
|
90
90
|
...layerHandlerProps
|
|
91
91
|
];
|
|
92
|
-
function PopoverContent
|
|
92
|
+
function PopoverContent(props) {
|
|
93
93
|
const context = useContext(PopoverPlacementContext);
|
|
94
94
|
let content;
|
|
95
95
|
const rest = omit(props, ...contentOwnProps);
|
|
@@ -108,7 +108,7 @@ function PopoverContent$1(props) {
|
|
|
108
108
|
gutter: 0
|
|
109
109
|
});
|
|
110
110
|
};
|
|
111
|
-
return createComponent(PopoverContent, mergeProps({
|
|
111
|
+
return createComponent(PopoverContent$1, mergeProps({
|
|
112
112
|
get container() {
|
|
113
113
|
return overlayContainer();
|
|
114
114
|
},
|
|
@@ -149,7 +149,7 @@ function PopoverContent$1(props) {
|
|
|
149
149
|
return !props["aria-labelledby"];
|
|
150
150
|
})() && props["aria-label"];
|
|
151
151
|
},
|
|
152
|
-
children: (label) => createComponent(PopoverTitle, {
|
|
152
|
+
children: (label) => createComponent(PopoverTitle$1, {
|
|
153
153
|
class: "sr-only",
|
|
154
154
|
get children() {
|
|
155
155
|
return label();
|
|
@@ -177,8 +177,8 @@ function PopoverContent$1(props) {
|
|
|
177
177
|
];
|
|
178
178
|
} }));
|
|
179
179
|
}
|
|
180
|
-
function PopoverTitle
|
|
181
|
-
return createComponent(PopoverTitle, mergeProps({
|
|
180
|
+
function PopoverTitle(props) {
|
|
181
|
+
return createComponent(PopoverTitle$1, mergeProps({
|
|
182
182
|
get "class"() {
|
|
183
183
|
return cn("px-2 pt-1 pb-1.5 text-sm font-medium", props.class);
|
|
184
184
|
},
|
|
@@ -189,8 +189,8 @@ function PopoverTitle$1(props) {
|
|
|
189
189
|
return omit(props, "class", "as");
|
|
190
190
|
}));
|
|
191
191
|
}
|
|
192
|
-
function PopoverDescription
|
|
193
|
-
return createComponent(PopoverDescription, mergeProps({
|
|
192
|
+
function PopoverDescription(props) {
|
|
193
|
+
return createComponent(PopoverDescription$1, mergeProps({
|
|
194
194
|
get "class"() {
|
|
195
195
|
return cn("text-muted-foreground px-2 pb-1.5 text-sm", props.class);
|
|
196
196
|
},
|
|
@@ -213,6 +213,6 @@ function PopoverCloseButton(props) {
|
|
|
213
213
|
return omit(props, "class", "as");
|
|
214
214
|
}));
|
|
215
215
|
}
|
|
216
|
-
export { Popover
|
|
216
|
+
export { Popover, PopoverAnchor, PopoverCloseButton, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger };
|
|
217
217
|
|
|
218
218
|
//# sourceMappingURL=popover.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.js","names":["<PopoverPlacementContext\n value={{\n placement: () => ({ placement: props.placement, gutter: props.gutter, shift: props.shift }),\n anchor: () => props.anchor ?? props.anchorRef?.() ?? anchor(),\n setAnchor: (element) => setAnchor(() => element),\n }}\n >\n <UiPopover\n // Kobalte's default: a popover leaves the page usable.\n modal={false}\n {...(rest as PopoverOptions)}\n controller={controller}\n onOpenChange={(open, details) => {\n if (layer.refuses(open, details)) return details.cancel()\n props.onOpenChange?.(open, details)\n }}\n >\n <LayerRootContext value={layer}>{props.children}</LayerRootContext>\n </UiPopover>\n </PopoverPlacementContext>","value={{\n placement: () => ({ placement: props.placement, gutter: props.gutter, shift: props.shift }),\n anchor: () => props.anchor ?? props.anchorRef?.() ?? anchor(),\n setAnchor: (element) => setAnchor(() => element),\n }}","<UiPopover\n // Kobalte's default: a popover leaves the page usable.\n modal={false}\n {...(rest as PopoverOptions)}\n controller={controller}\n onOpenChange={(open, details) => {\n if (layer.refuses(open, details)) return details.cancel()\n props.onOpenChange?.(open, details)\n }}\n >\n <LayerRootContext value={layer}>{props.children}</LayerRootContext>\n </UiPopover>","modal={false}","onOpenChange={(open, details) => {\n if (layer.refuses(open, details)) return details.cancel()\n props.onOpenChange?.(open, details)\n }}","<LayerRootContext value={layer}>{props.children}</LayerRootContext>","value={layer}","<UiPopoverTrigger\n {...omit(props, 'as')}\n render={triggerRender(props.as, 'button', () => props['data-slot'])}\n />","<Dynamic\n component={props.as ?? 'div'}\n {...rest}\n ref={(element: HTMLElement) => {\n context?.setAnchor(element)\n forwardRef(() => props.ref, element)\n }}\n />","ref={(element: HTMLElement) => {\n context?.setAnchor(element)\n forwardRef(() => props.ref, element)\n }}","<UiPopoverContent\n container={overlayContainer()}\n anchor={context?.anchor()}\n side={placement().side}\n align={placement().align}\n sideOffset={placement().sideOffset + (props.hideArrow ? 0 : ARROW_OFFSET)}\n alignOffset={placement().alignOffset}\n initialFocus={focus.initialFocus()}\n finalFocus={focus.finalFocus()}\n ref={(element: HTMLDivElement) => {\n content = element\n forwardRef(() => props.ref, element)\n }}\n class={cn(\n overlaySurface,\n popoverMotion,\n 'z-(--z-menu) w-72 origin-(--transform-origin)',\n menuContentPadding,\n props.class\n )}\n render={expandedDiv}\n {...rest}\n >\n {/* ui-sdk names a popup by its title, else by its trigger, through\n `aria-labelledby`, which outranks the caller's `aria-label`. Kobalte\n left an untitled popover to its `aria-label`. A hidden title carrying\n that label keeps the caller's name. */}\n <Show when={!props['aria-labelledby'] && props['aria-label']}>\n {(label) => <UiPopoverTitle class=\"sr-only\">{label()}</UiPopoverTitle>}\n </Show>\n {props.children}\n <Show when={!props.hideArrow}>\n <UiPopoverArrow class={cn(arrowPlacement, popoverArrow)}>\n <ArrowGlyph />\n </UiPopoverArrow>\n </Show>\n </UiPopoverContent>","ref={(element: HTMLDivElement) => {\n content = element\n forwardRef(() => props.ref, element)\n }}","render={expandedDiv}","<Show when={!props['aria-labelledby'] && props['aria-label']}>\n {(label) => <UiPopoverTitle class=\"sr-only\">{label()}</UiPopoverTitle>}\n </Show>","!props['aria-labelledby'] && props['aria-label']","<UiPopoverTitle class=\"sr-only\">{label()}</UiPopoverTitle>","class=\"sr-only\"","props.children","<Show when={!props.hideArrow}>\n <UiPopoverArrow class={cn(arrowPlacement, popoverArrow)}>\n <ArrowGlyph />\n </UiPopoverArrow>\n </Show>","<UiPopoverArrow class={cn(arrowPlacement, popoverArrow)}>\n <ArrowGlyph />\n </UiPopoverArrow>","<ArrowGlyph />","<UiPopoverTitle\n class={cn('px-2 pt-1 pb-1.5 text-sm font-medium', props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />","<UiPopoverDescription\n class={cn('text-muted-foreground px-2 pb-1.5 text-sm', props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />","<UiPopoverClose\n class={cn(props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />","Popover","PopoverTrigger","PopoverContent","PopoverTitle","PopoverDescription"],"sources":["../../../../src/components/ui/popover/popover.tsx"],"sourcesContent":["import {\n createPopoverController,\n Popover as UiPopover,\n PopoverArrow as UiPopoverArrow,\n PopoverClose as UiPopoverClose,\n PopoverContent as UiPopoverContent,\n PopoverDescription as UiPopoverDescription,\n PopoverTitle as UiPopoverTitle,\n PopoverTrigger as UiPopoverTrigger,\n type PopoverContentState,\n type PopoverOptions,\n} from '@ui-sdk/solid/popover'\nimport type { PartProps } from '@ui-sdk/solid/primitive'\nimport type { Anchor, ChangeDetails } from '@ui-sdk/core'\nimport type { Accessor } from 'solid-js'\nimport type { ComponentProps, JSX, ValidComponent } from '@solidjs/web'\nimport { createContext, createSignal, Show, omit, useContext } from 'solid-js'\nimport { Dynamic } from '@solidjs/web'\nimport { menuContentPadding, popoverArrow, popoverMotion, overlaySurface } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport {\n ArrowGlyph,\n ARROW_OFFSET,\n arrowPlacement,\n asRender,\n triggerRender,\n expandedDiv,\n overlayContainer,\n placementProps,\n type OverlayPlacementOptions,\n type WithAs,\n} from '../tooltip/tooltip'\nimport {\n createLayerRoot,\n type LayerHandlers,\n layerHandlerProps,\n layerHandlers,\n LayerRootContext,\n useLayerContent,\n} from '../dialog/dialog-layer'\nimport { forwardRef } from '#lib/refs'\n\n/**\n * Popover.\n *\n * A floating surface with arbitrary content, anchored to a control. Use it for\n * something interactive that would not fit in a menu: a small form, a colour\n * picker, a filter panel. For a list of *actions* use DropdownMenu, which\n * carries the menu keyboard contract; for a sentence of explanation use\n * Tooltip, which is not focusable and cannot hold a control.\n *\n * ui-sdk handles the anchoring, collision flipping, the top layer, the focus\n * trap for modal popovers, and dismissal on outside press, focus leaving and\n * Escape. The content renders into `<body>`, as it always has.\n */\nexport type PopoverProps = Omit<PopoverOptions, 'onOpenChange' | 'controller'> &\n OverlayPlacementOptions & {\n children?: JSX.Element\n /** The popover wants to open or close. The second argument is ui-sdk's change details. */\n onOpenChange?: (open: boolean, details: ChangeDetails<string>) => void\n /**\n * Positions the content against this instead of the trigger: an element, a\n * point (`{ x, y }`) or anything with `getBoundingClientRect()`, such as a\n * text selection's range. Read on every position check, so it can move.\n */\n anchor?: Anchor\n /** Kobalte's form of `anchor`: an accessor for the element to position against. */\n anchorRef?: Accessor<Anchor | undefined>\n }\n\ntype PopoverContext = {\n placement: Accessor<OverlayPlacementOptions>\n anchor: Accessor<Anchor | undefined>\n setAnchor: (element: HTMLElement | undefined) => void\n}\n\nconst PopoverPlacementContext = createContext<PopoverContext | null>(null)\n\n/** The Kobalte-era options ui-sdk positions on its own, or does not take. */\nconst legacyRootProps = [\n 'flip',\n 'slide',\n 'overlap',\n 'sameWidth',\n 'fitViewport',\n 'hideWhenDetached',\n 'detachedPadding',\n 'arrowPadding',\n 'overflowPadding',\n 'preventScroll',\n 'forceMount',\n 'id',\n 'translations',\n] as const\n\nexport function Popover(props: PopoverProps) {\n const controller = createPopoverController()\n const layer = createLayerRoot(() => controller.close({ reason: 'escape-key' }))\n const [anchor, setAnchor] = createSignal<HTMLElement>()\n const rest = omit(\n props as PopoverProps & Record<string, unknown>,\n 'children',\n 'onOpenChange',\n 'placement',\n 'gutter',\n 'shift',\n 'anchor',\n 'anchorRef',\n ...legacyRootProps\n )\n return (\n <PopoverPlacementContext\n value={{\n placement: () => ({ placement: props.placement, gutter: props.gutter, shift: props.shift }),\n anchor: () => props.anchor ?? props.anchorRef?.() ?? anchor(),\n setAnchor: (element) => setAnchor(() => element),\n }}\n >\n <UiPopover\n // Kobalte's default: a popover leaves the page usable.\n modal={false}\n {...(rest as PopoverOptions)}\n controller={controller}\n onOpenChange={(open, details) => {\n if (layer.refuses(open, details)) return details.cancel()\n props.onOpenChange?.(open, details)\n }}\n >\n <LayerRootContext value={layer}>{props.children}</LayerRootContext>\n </UiPopover>\n </PopoverPlacementContext>\n )\n}\n\ntype PolymorphicPartProps<Tag extends keyof JSX.IntrinsicElements, State = object> = PartProps<\n Tag,\n State\n> & {\n /** Render the part as this component, which must forward props and ref to its element. */\n as?: ValidComponent\n [key: string]: unknown\n}\n\nexport function PopoverTrigger(props: WithAs<ComponentProps<typeof UiPopoverTrigger>>) {\n return (\n <UiPopoverTrigger\n {...omit(props, 'as')}\n render={triggerRender(props.as, 'button', () => props['data-slot'])}\n />\n )\n}\n\n/**\n * An element the content is positioned against instead of the trigger: a\n * whole row, say, while the trigger is an icon inside it.\n */\nexport function PopoverAnchor(\n props: JSX.HTMLAttributes<HTMLDivElement> & { as?: ValidComponent; [key: string]: unknown }\n) {\n const context = useContext(PopoverPlacementContext)\n const rest = omit(props, 'as', 'ref')\n return (\n <Dynamic\n component={props.as ?? 'div'}\n {...rest}\n ref={(element: HTMLElement) => {\n context?.setAnchor(element)\n forwardRef(() => props.ref, element)\n }}\n />\n )\n}\n\nexport type PopoverContentProps = Omit<\n PartProps<'div', PopoverContentState>,\n 'class' | 'children' | keyof LayerHandlers | 'render'\n> &\n LayerHandlers &\n OverlayPlacementOptions & {\n class?: string\n children?: JSX.Element\n /** Hide the caret pointing at the trigger. */\n hideArrow?: boolean\n ref?: ((element: HTMLDivElement) => void) | HTMLDivElement\n }\n\nconst contentOwnProps = [\n 'class',\n 'hideArrow',\n 'children',\n 'ref',\n 'placement',\n 'gutter',\n 'shift',\n ...layerHandlerProps,\n] as const\n\nexport function PopoverContent(props: PopoverContentProps) {\n const context = useContext(PopoverPlacementContext)\n let content: HTMLDivElement | undefined\n const rest = omit(props, ...contentOwnProps)\n const focus = useLayerContent({\n content: () => content,\n handlers: layerHandlers(props),\n })\n const placement = () => {\n const root = context?.placement() ?? {}\n return placementProps(\n {\n placement: props.placement ?? root.placement,\n gutter: props.gutter ?? root.gutter,\n shift: props.shift ?? root.shift,\n },\n { placement: 'bottom', gutter: 0 }\n )\n }\n\n return (\n <UiPopoverContent\n container={overlayContainer()}\n anchor={context?.anchor()}\n side={placement().side}\n align={placement().align}\n sideOffset={placement().sideOffset + (props.hideArrow ? 0 : ARROW_OFFSET)}\n alignOffset={placement().alignOffset}\n initialFocus={focus.initialFocus()}\n finalFocus={focus.finalFocus()}\n ref={(element: HTMLDivElement) => {\n content = element\n forwardRef(() => props.ref, element)\n }}\n class={cn(\n overlaySurface,\n popoverMotion,\n 'z-(--z-menu) w-72 origin-(--transform-origin)',\n menuContentPadding,\n props.class\n )}\n render={expandedDiv}\n {...rest}\n >\n {/* ui-sdk names a popup by its title, else by its trigger, through\n `aria-labelledby`, which outranks the caller's `aria-label`. Kobalte\n left an untitled popover to its `aria-label`. A hidden title carrying\n that label keeps the caller's name. */}\n <Show when={!props['aria-labelledby'] && props['aria-label']}>\n {(label) => <UiPopoverTitle class=\"sr-only\">{label()}</UiPopoverTitle>}\n </Show>\n {props.children}\n <Show when={!props.hideArrow}>\n <UiPopoverArrow class={cn(arrowPlacement, popoverArrow)}>\n <ArrowGlyph />\n </UiPopoverArrow>\n </Show>\n </UiPopoverContent>\n )\n}\n\nexport function PopoverTitle(props: PolymorphicPartProps<'h2'> & { class?: string }) {\n return (\n <UiPopoverTitle\n class={cn('px-2 pt-1 pb-1.5 text-sm font-medium', props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />\n )\n}\n\nexport function PopoverDescription(props: PolymorphicPartProps<'p'> & { class?: string }) {\n return (\n <UiPopoverDescription\n class={cn('text-muted-foreground px-2 pb-1.5 text-sm', props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />\n )\n}\n\nexport function PopoverCloseButton(props: WithAs<ComponentProps<typeof UiPopoverClose>>) {\n return (\n <UiPopoverClose\n class={cn(props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />\n )\n}\n"],"mappings":";;;;;;;;;AA4EA,IAAM,0BAA0B,cAAqC,IAAI;;AAGzE,IAAM,kBAAkB;CACtB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,SAAgBwB,UAAQ,OAAqB;CAC3C,MAAM,aAAa,wBAAwB;CAC3C,MAAM,QAAQ,sBAAsB,WAAW,MAAM,EAAE,QAAQ,aAAa,CAAC,CAAC;CAC9E,MAAM,CAAC,QAAQ,aAAa,aAA0B;CACtD,MAAM,OAAO,KACX,OACA,YACA,gBACA,aACA,UACA,SACA,UACA,aACA,GAAG,eACL;CACA,OACExB,gBAA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,WAAAA;IAAM,OAAA,MAAA;GAAO,CAAA;GACdC,gBAAAA,MAAAA;IAAM,IAAA,OAAA;KAAM,OAAA,CAAC,MAAM;IAAS;IAA5B,IAAA,WAAA;KACEC,OAAAA,gBAAAA,cAAAA;MAAgB,IAAA,UAAA;OAAO,OAAA,GAAG,gBAAgB,YAAY;MAAC;MAAvD,IAAA,WAAA;OACEC,OAAAA,gBAAAA,YAAAA,CAAa,CAAA;MACC;;IACZ;;EAZP;CAaiB,EAAA,CAAA,CAAA;AAEtB;AAEA,SAAgBO,eAAa,OAAwD;CACnF,OACEN,gBAAAA,cAAAA,WAAAA;EACE,IAAA,UAAA;GAAO,OAAA,GAAG,wCAAwC,MAAM,KAAK;EAAC;EAC9D,IAAA,SAAA;GAAQ,OAAA,SAAS,MAAM,UAAU,MAAM,YAAY;EAAC;CAErD,SADC;EAAI,OAAA,KAAK,OAAO,SAAS,IAAI;CAAC,CAC/B,CAAA;AAEL;AAEA,SAAgBO,qBAAmB,OAAuD;CACxF,OACEN,gBAAAA,oBAAAA,WAAAA;EACE,IAAA,UAAA;GAAO,OAAA,GAAG,6CAA6C,MAAM,KAAK;EAAC;EACnE,IAAA,SAAA;GAAQ,OAAA,SAAS,MAAM,UAAU,MAAM,YAAY;EAAC;CAErD,SADC;EAAI,OAAA,KAAK,OAAO,SAAS,IAAI;CAAC,CAC/B,CAAA;AAEL;AAEA,SAAgB,mBAAmB,OAAsD;CACvF,OACEC,gBAAAA,cAAAA,WAAAA;EACE,IAAA,UAAA;GAAO,OAAA,GAAG,MAAM,KAAK;EAAC;EACtB,IAAA,SAAA;GAAQ,OAAA,SAAS,MAAM,UAAU,MAAM,YAAY;EAAC;CAErD,SADC;EAAI,OAAA,KAAK,OAAO,SAAS,IAAI;CAAC,CAC/B,CAAA;AAEL"}
|
|
1
|
+
{"version":3,"file":"popover.js","names":["<PopoverPlacementContext\n value={{\n placement: () => ({ placement: props.placement, gutter: props.gutter, shift: props.shift }),\n anchor: () => props.anchor ?? props.anchorRef?.() ?? anchor(),\n setAnchor: (element) => setAnchor(() => element),\n }}\n >\n <UiPopover\n // Kobalte's default: a popover leaves the page usable.\n modal={false}\n {...(rest as PopoverOptions)}\n controller={controller}\n onOpenChange={(open, details) => {\n if (layer.refuses(open, details)) return details.cancel()\n props.onOpenChange?.(open, details)\n }}\n >\n <LayerRootContext value={layer}>{props.children}</LayerRootContext>\n </UiPopover>\n </PopoverPlacementContext>","value={{\n placement: () => ({ placement: props.placement, gutter: props.gutter, shift: props.shift }),\n anchor: () => props.anchor ?? props.anchorRef?.() ?? anchor(),\n setAnchor: (element) => setAnchor(() => element),\n }}","<UiPopover\n // Kobalte's default: a popover leaves the page usable.\n modal={false}\n {...(rest as PopoverOptions)}\n controller={controller}\n onOpenChange={(open, details) => {\n if (layer.refuses(open, details)) return details.cancel()\n props.onOpenChange?.(open, details)\n }}\n >\n <LayerRootContext value={layer}>{props.children}</LayerRootContext>\n </UiPopover>","modal={false}","onOpenChange={(open, details) => {\n if (layer.refuses(open, details)) return details.cancel()\n props.onOpenChange?.(open, details)\n }}","<LayerRootContext value={layer}>{props.children}</LayerRootContext>","value={layer}","<UiPopoverTrigger\n {...omit(props, 'as')}\n render={triggerRender(props.as, 'button', () => props['data-slot'])}\n />","<Dynamic\n component={props.as ?? 'div'}\n {...rest}\n ref={(element: HTMLElement) => {\n context?.setAnchor(element)\n forwardRef(() => props.ref, element)\n }}\n />","ref={(element: HTMLElement) => {\n context?.setAnchor(element)\n forwardRef(() => props.ref, element)\n }}","<UiPopoverContent\n container={overlayContainer()}\n anchor={context?.anchor()}\n side={placement().side}\n align={placement().align}\n sideOffset={placement().sideOffset + (props.hideArrow ? 0 : ARROW_OFFSET)}\n alignOffset={placement().alignOffset}\n initialFocus={focus.initialFocus()}\n finalFocus={focus.finalFocus()}\n ref={(element: HTMLDivElement) => {\n content = element\n forwardRef(() => props.ref, element)\n }}\n class={cn(\n overlaySurface,\n popoverMotion,\n 'z-(--z-menu) w-72 origin-(--transform-origin)',\n menuContentPadding,\n props.class\n )}\n render={expandedDiv}\n {...rest}\n >\n {/* ui-sdk names a popup by its title, else by its trigger, through\n `aria-labelledby`, which outranks the caller's `aria-label`. Kobalte\n left an untitled popover to its `aria-label`. A hidden title carrying\n that label keeps the caller's name. */}\n <Show when={!props['aria-labelledby'] && props['aria-label']}>\n {(label) => <UiPopoverTitle class=\"sr-only\">{label()}</UiPopoverTitle>}\n </Show>\n {props.children}\n <Show when={!props.hideArrow}>\n <UiPopoverArrow class={cn(arrowPlacement, popoverArrow)}>\n <ArrowGlyph />\n </UiPopoverArrow>\n </Show>\n </UiPopoverContent>","ref={(element: HTMLDivElement) => {\n content = element\n forwardRef(() => props.ref, element)\n }}","render={expandedDiv}","<Show when={!props['aria-labelledby'] && props['aria-label']}>\n {(label) => <UiPopoverTitle class=\"sr-only\">{label()}</UiPopoverTitle>}\n </Show>","!props['aria-labelledby'] && props['aria-label']","<UiPopoverTitle class=\"sr-only\">{label()}</UiPopoverTitle>","class=\"sr-only\"","props.children","<Show when={!props.hideArrow}>\n <UiPopoverArrow class={cn(arrowPlacement, popoverArrow)}>\n <ArrowGlyph />\n </UiPopoverArrow>\n </Show>","<UiPopoverArrow class={cn(arrowPlacement, popoverArrow)}>\n <ArrowGlyph />\n </UiPopoverArrow>","<ArrowGlyph />","<UiPopoverTitle\n class={cn('px-2 pt-1 pb-1.5 text-sm font-medium', props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />","<UiPopoverDescription\n class={cn('text-muted-foreground px-2 pb-1.5 text-sm', props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />","<UiPopoverClose\n class={cn(props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />"],"sources":["../../../../src/components/ui/popover/popover.tsx"],"sourcesContent":["import {\n createPopoverController,\n Popover as UiPopover,\n PopoverArrow as UiPopoverArrow,\n PopoverClose as UiPopoverClose,\n PopoverContent as UiPopoverContent,\n PopoverDescription as UiPopoverDescription,\n PopoverTitle as UiPopoverTitle,\n PopoverTrigger as UiPopoverTrigger,\n type PopoverContentState,\n type PopoverOptions,\n} from '@ui-sdk/solid/popover'\nimport type { PartProps } from '@ui-sdk/solid/primitive'\nimport type { Anchor, ChangeDetails } from '@ui-sdk/core'\nimport type { Accessor } from 'solid-js'\nimport type { ComponentProps, JSX, ValidComponent } from '@solidjs/web'\nimport { createContext, createSignal, Show, omit, useContext } from 'solid-js'\nimport { Dynamic } from '@solidjs/web'\nimport { menuContentPadding, popoverArrow, popoverMotion, overlaySurface } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport {\n ArrowGlyph,\n ARROW_OFFSET,\n arrowPlacement,\n asRender,\n triggerRender,\n expandedDiv,\n overlayContainer,\n placementProps,\n type OverlayPlacementOptions,\n type WithAs,\n} from '../tooltip/tooltip'\nimport {\n createLayerRoot,\n type LayerHandlers,\n layerHandlerProps,\n layerHandlers,\n LayerRootContext,\n useLayerContent,\n} from '../dialog/dialog-layer'\nimport { forwardRef } from '#lib/refs'\n\n/**\n * Popover.\n *\n * A floating surface with arbitrary content, anchored to a control. Use it for\n * something interactive that would not fit in a menu: a small form, a colour\n * picker, a filter panel. For a list of *actions* use DropdownMenu, which\n * carries the menu keyboard contract; for a sentence of explanation use\n * Tooltip, which is not focusable and cannot hold a control.\n *\n * ui-sdk handles the anchoring, collision flipping, the top layer, the focus\n * trap for modal popovers, and dismissal on outside press, focus leaving and\n * Escape. The content renders into `<body>`, as it always has.\n */\nexport type PopoverProps = Omit<PopoverOptions, 'onOpenChange' | 'controller'> &\n OverlayPlacementOptions & {\n children?: JSX.Element\n /** The popover wants to open or close. The second argument is ui-sdk's change details. */\n onOpenChange?: (open: boolean, details: ChangeDetails<string>) => void\n /**\n * Positions the content against this instead of the trigger: an element, a\n * point (`{ x, y }`) or anything with `getBoundingClientRect()`, such as a\n * text selection's range. Read on every position check, so it can move.\n */\n anchor?: Anchor\n /** Kobalte's form of `anchor`: an accessor for the element to position against. */\n anchorRef?: Accessor<Anchor | undefined>\n }\n\ntype PopoverContext = {\n placement: Accessor<OverlayPlacementOptions>\n anchor: Accessor<Anchor | undefined>\n setAnchor: (element: HTMLElement | undefined) => void\n}\n\nconst PopoverPlacementContext = createContext<PopoverContext | null>(null)\n\n/** The Kobalte-era options ui-sdk positions on its own, or does not take. */\nconst legacyRootProps = [\n 'flip',\n 'slide',\n 'overlap',\n 'sameWidth',\n 'fitViewport',\n 'hideWhenDetached',\n 'detachedPadding',\n 'arrowPadding',\n 'overflowPadding',\n 'preventScroll',\n 'forceMount',\n 'id',\n 'translations',\n] as const\n\nexport function Popover(props: PopoverProps) {\n const controller = createPopoverController()\n const layer = createLayerRoot(() => controller.close({ reason: 'escape-key' }))\n const [anchor, setAnchor] = createSignal<HTMLElement>()\n const rest = omit(\n props as PopoverProps & Record<string, unknown>,\n 'children',\n 'onOpenChange',\n 'placement',\n 'gutter',\n 'shift',\n 'anchor',\n 'anchorRef',\n ...legacyRootProps\n )\n return (\n <PopoverPlacementContext\n value={{\n placement: () => ({ placement: props.placement, gutter: props.gutter, shift: props.shift }),\n anchor: () => props.anchor ?? props.anchorRef?.() ?? anchor(),\n setAnchor: (element) => setAnchor(() => element),\n }}\n >\n <UiPopover\n // Kobalte's default: a popover leaves the page usable.\n modal={false}\n {...(rest as PopoverOptions)}\n controller={controller}\n onOpenChange={(open, details) => {\n if (layer.refuses(open, details)) return details.cancel()\n props.onOpenChange?.(open, details)\n }}\n >\n <LayerRootContext value={layer}>{props.children}</LayerRootContext>\n </UiPopover>\n </PopoverPlacementContext>\n )\n}\n\ntype PolymorphicPartProps<Tag extends keyof JSX.IntrinsicElements, State = object> = PartProps<\n Tag,\n State\n> & {\n /** Render the part as this component, which must forward props and ref to its element. */\n as?: ValidComponent\n [key: string]: unknown\n}\n\nexport function PopoverTrigger(props: WithAs<ComponentProps<typeof UiPopoverTrigger>>) {\n return (\n <UiPopoverTrigger\n {...omit(props, 'as')}\n render={triggerRender(props.as, 'button', () => props['data-slot'])}\n />\n )\n}\n\n/**\n * An element the content is positioned against instead of the trigger: a\n * whole row, say, while the trigger is an icon inside it.\n */\nexport function PopoverAnchor(\n props: JSX.HTMLAttributes<HTMLDivElement> & { as?: ValidComponent; [key: string]: unknown }\n) {\n const context = useContext(PopoverPlacementContext)\n const rest = omit(props, 'as', 'ref')\n return (\n <Dynamic\n component={props.as ?? 'div'}\n {...rest}\n ref={(element: HTMLElement) => {\n context?.setAnchor(element)\n forwardRef(() => props.ref, element)\n }}\n />\n )\n}\n\nexport type PopoverContentProps = Omit<\n PartProps<'div', PopoverContentState>,\n 'class' | 'children' | keyof LayerHandlers | 'render'\n> &\n LayerHandlers &\n OverlayPlacementOptions & {\n class?: string\n children?: JSX.Element\n /** Hide the caret pointing at the trigger. */\n hideArrow?: boolean\n ref?: ((element: HTMLDivElement) => void) | HTMLDivElement\n }\n\nconst contentOwnProps = [\n 'class',\n 'hideArrow',\n 'children',\n 'ref',\n 'placement',\n 'gutter',\n 'shift',\n ...layerHandlerProps,\n] as const\n\nexport function PopoverContent(props: PopoverContentProps) {\n const context = useContext(PopoverPlacementContext)\n let content: HTMLDivElement | undefined\n const rest = omit(props, ...contentOwnProps)\n const focus = useLayerContent({\n content: () => content,\n handlers: layerHandlers(props),\n })\n const placement = () => {\n const root = context?.placement() ?? {}\n return placementProps(\n {\n placement: props.placement ?? root.placement,\n gutter: props.gutter ?? root.gutter,\n shift: props.shift ?? root.shift,\n },\n { placement: 'bottom', gutter: 0 }\n )\n }\n\n return (\n <UiPopoverContent\n container={overlayContainer()}\n anchor={context?.anchor()}\n side={placement().side}\n align={placement().align}\n sideOffset={placement().sideOffset + (props.hideArrow ? 0 : ARROW_OFFSET)}\n alignOffset={placement().alignOffset}\n initialFocus={focus.initialFocus()}\n finalFocus={focus.finalFocus()}\n ref={(element: HTMLDivElement) => {\n content = element\n forwardRef(() => props.ref, element)\n }}\n class={cn(\n overlaySurface,\n popoverMotion,\n 'z-(--z-menu) w-72 origin-(--transform-origin)',\n menuContentPadding,\n props.class\n )}\n render={expandedDiv}\n {...rest}\n >\n {/* ui-sdk names a popup by its title, else by its trigger, through\n `aria-labelledby`, which outranks the caller's `aria-label`. Kobalte\n left an untitled popover to its `aria-label`. A hidden title carrying\n that label keeps the caller's name. */}\n <Show when={!props['aria-labelledby'] && props['aria-label']}>\n {(label) => <UiPopoverTitle class=\"sr-only\">{label()}</UiPopoverTitle>}\n </Show>\n {props.children}\n <Show when={!props.hideArrow}>\n <UiPopoverArrow class={cn(arrowPlacement, popoverArrow)}>\n <ArrowGlyph />\n </UiPopoverArrow>\n </Show>\n </UiPopoverContent>\n )\n}\n\nexport function PopoverTitle(props: PolymorphicPartProps<'h2'> & { class?: string }) {\n return (\n <UiPopoverTitle\n class={cn('px-2 pt-1 pb-1.5 text-sm font-medium', props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />\n )\n}\n\nexport function PopoverDescription(props: PolymorphicPartProps<'p'> & { class?: string }) {\n return (\n <UiPopoverDescription\n class={cn('text-muted-foreground px-2 pb-1.5 text-sm', props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />\n )\n}\n\nexport function PopoverCloseButton(props: WithAs<ComponentProps<typeof UiPopoverClose>>) {\n return (\n <UiPopoverClose\n class={cn(props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />\n )\n}\n"],"mappings":";;;;;;;;;AA4EA,IAAM,0BAA0B,cAAqC,IAAI;;AAGzE,IAAM,kBAAkB;CACtB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,SAAgB,QAAQ,OAAqB;CAC3C,MAAM,aAAa,wBAAwB;CAC3C,MAAM,QAAQ,sBAAsB,WAAW,MAAM,EAAE,QAAQ,aAAa,CAAC,CAAC;CAC9E,MAAM,CAAC,QAA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10 @@
|
|
|
1
|
-
import { cn } from "../../../lib/utils.js";
|
|
2
1
|
import { createComponent, insert, memo, mergeProps, template } from "@solidjs/web";
|
|
2
|
+
import { Progress as Progress$1, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue } from "@ui-sdk/solid/progress";
|
|
3
3
|
import { Show, omit } from "solid-js";
|
|
4
|
-
import {
|
|
4
|
+
import { cn } from "../../../lib/utils.js";
|
|
5
5
|
// src/components/ui/progress/progress.tsx
|
|
6
6
|
var _tmpl$ = /* @__PURE__ */ template(`<div class="flex items-center justify-between gap-3"><!><!>`);
|
|
7
|
-
function Progress
|
|
7
|
+
function Progress(props) {
|
|
8
8
|
const rest = omit(props, "class", "trackClass", "indicatorClass", "hideValue", "label", "value", "minValue", "maxValue", "indeterminate", "getValueLabel");
|
|
9
9
|
const min = () => props.minValue ?? 0;
|
|
10
10
|
const max = () => props.maxValue ?? 100;
|
|
@@ -13,7 +13,7 @@ function Progress$1(props) {
|
|
|
13
13
|
min: min(),
|
|
14
14
|
max: max()
|
|
15
15
|
});
|
|
16
|
-
return createComponent(Progress, mergeProps({
|
|
16
|
+
return createComponent(Progress$1, mergeProps({
|
|
17
17
|
"data-slot": "progress",
|
|
18
18
|
get "class"() {
|
|
19
19
|
return cn("flex w-full flex-col gap-1.5", props.class);
|
|
@@ -80,6 +80,6 @@ function Progress$1(props) {
|
|
|
80
80
|
})];
|
|
81
81
|
} }));
|
|
82
82
|
}
|
|
83
|
-
export { Progress
|
|
83
|
+
export { Progress };
|
|
84
84
|
|
|
85
85
|
//# sourceMappingURL=progress.js.map
|