@adea-ai/ui 0.153.0 → 0.154.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -10
- package/dist/NOTICE +10 -1
- package/dist/components/composites/about-dialog/about-dialog.d.ts.map +1 -1
- package/dist/components/composites/about-dialog/about-dialog.js +3 -1
- package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
- package/dist/components/composites/accent-picker/accent-picker.js +20 -9
- package/dist/components/composites/accent-picker/accent-picker.js.map +1 -1
- package/dist/components/composites/account-menu/account-menu.d.ts.map +1 -1
- package/dist/components/composites/account-menu/account-menu.js +20 -10
- package/dist/components/composites/account-menu/account-menu.js.map +1 -1
- package/dist/components/composites/action-button/action-button.d.ts.map +1 -1
- package/dist/components/composites/action-button/action-button.js +37 -24
- package/dist/components/composites/action-button/action-button.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.js +7 -3
- package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.js +11 -6
- package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.js +8 -3
- package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
- package/dist/components/composites/appearance-editor/font-settings-group.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/font-settings-group.js +8 -4
- package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser-group.d.ts.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser-group.js +7 -3
- package/dist/components/composites/catalog-browser/catalog-browser-group.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser.d.ts.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser.js +8 -4
- package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
- package/dist/components/composites/chain-of-thought/chain-of-thought.d.ts.map +1 -1
- package/dist/components/composites/chain-of-thought/chain-of-thought.js +3 -1
- package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
- package/dist/components/composites/chat/chat.d.ts.map +1 -1
- package/dist/components/composites/chat/chat.js +5 -1
- package/dist/components/composites/chat/chat.js.map +1 -1
- package/dist/components/composites/checkpoint/checkpoint.d.ts.map +1 -1
- package/dist/components/composites/checkpoint/checkpoint.js +3 -1
- package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
- package/dist/components/composites/confirmation/confirmation.d.ts.map +1 -1
- package/dist/components/composites/confirmation/confirmation.js +11 -5
- package/dist/components/composites/confirmation/confirmation.js.map +1 -1
- package/dist/components/composites/context/context.d.ts.map +1 -1
- package/dist/components/composites/context/context.js +7 -4
- package/dist/components/composites/context/context.js.map +1 -1
- package/dist/components/composites/file-tree/file-tree.d.ts.map +1 -1
- package/dist/components/composites/file-tree/file-tree.js +7 -3
- package/dist/components/composites/file-tree/file-tree.js.map +1 -1
- package/dist/components/composites/help-center/help-center.d.ts.map +1 -1
- package/dist/components/composites/help-center/help-center.js +3 -1
- package/dist/components/composites/help-center/help-center.js.map +1 -1
- package/dist/components/composites/icon-picker/icon-picker.d.ts +2 -2
- package/dist/components/composites/icon-picker/icon-picker.d.ts.map +1 -1
- package/dist/components/composites/icon-picker/icon-picker.js +77 -71
- package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
- package/dist/components/composites/icon-picker/shell-icons.d.ts.map +1 -1
- package/dist/components/composites/icon-picker/shell-icons.js +119 -59
- package/dist/components/composites/icon-picker/shell-icons.js.map +1 -1
- package/dist/components/composites/inline-citation/inline-citation.d.ts.map +1 -1
- package/dist/components/composites/inline-citation/inline-citation.js +5 -2
- package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
- package/dist/components/composites/list-row/list-row-control.d.ts.map +1 -1
- package/dist/components/composites/list-row/list-row-control.js +3 -4
- package/dist/components/composites/list-row/list-row-control.js.map +1 -1
- package/dist/components/composites/message-scroller/message-scroller.d.ts.map +1 -1
- package/dist/components/composites/message-scroller/message-scroller.js +5 -2
- package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
- package/dist/components/composites/model-selector/model-selector.d.ts +15 -1
- package/dist/components/composites/model-selector/model-selector.d.ts.map +1 -1
- package/dist/components/composites/model-selector/model-selector.js +271 -33
- package/dist/components/composites/model-selector/model-selector.js.map +1 -1
- package/dist/components/composites/plan/plan.d.ts.map +1 -1
- package/dist/components/composites/plan/plan.js +3 -1
- package/dist/components/composites/plan/plan.js.map +1 -1
- package/dist/components/composites/queue/queue.d.ts.map +1 -1
- package/dist/components/composites/queue/queue.js +11 -5
- package/dist/components/composites/queue/queue.js.map +1 -1
- package/dist/components/composites/reasoning/reasoning.d.ts.map +1 -1
- package/dist/components/composites/reasoning/reasoning.js +3 -1
- package/dist/components/composites/reasoning/reasoning.js.map +1 -1
- package/dist/components/composites/scene-controls/scene-controls.d.ts.map +1 -1
- package/dist/components/composites/scene-controls/scene-controls.js +14 -7
- package/dist/components/composites/scene-controls/scene-controls.js.map +1 -1
- package/dist/components/composites/settings/settings.d.ts.map +1 -1
- package/dist/components/composites/settings/settings.js +77 -67
- package/dist/components/composites/settings/settings.js.map +1 -1
- package/dist/components/composites/sources/sources.d.ts.map +1 -1
- package/dist/components/composites/sources/sources.js +39 -39
- package/dist/components/composites/sources/sources.js.map +1 -1
- package/dist/components/composites/stack-trace/stack-trace.d.ts.map +1 -1
- package/dist/components/composites/stack-trace/stack-trace.js +9 -4
- package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
- package/dist/components/composites/stat/stat.d.ts.map +1 -1
- package/dist/components/composites/stat/stat.js +4 -1
- package/dist/components/composites/stat/stat.js.map +1 -1
- package/dist/components/composites/subagent/subagent.d.ts.map +1 -1
- package/dist/components/composites/subagent/subagent.js +3 -1
- package/dist/components/composites/subagent/subagent.js.map +1 -1
- package/dist/components/composites/task/task.d.ts.map +1 -1
- package/dist/components/composites/task/task.js +3 -1
- package/dist/components/composites/task/task.js.map +1 -1
- package/dist/components/composites/terminal/ansi.d.ts.map +1 -1
- package/dist/components/composites/terminal/ansi.js +16 -0
- package/dist/components/composites/terminal/ansi.js.map +1 -1
- package/dist/components/composites/terminal/terminal.d.ts.map +1 -1
- package/dist/components/composites/terminal/terminal.js +15 -7
- package/dist/components/composites/terminal/terminal.js.map +1 -1
- package/dist/components/composites/test-results/test-results.d.ts.map +1 -1
- package/dist/components/composites/test-results/test-results.js +15 -7
- package/dist/components/composites/test-results/test-results.js.map +1 -1
- package/dist/components/composites/tool/tool.d.ts.map +1 -1
- package/dist/components/composites/tool/tool.js +3 -1
- package/dist/components/composites/tool/tool.js.map +1 -1
- package/dist/components/composites/tree/tree.d.ts.map +1 -1
- package/dist/components/composites/tree/tree.js +3 -1
- package/dist/components/composites/tree/tree.js.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.d.ts.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.js +34 -24
- package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
- package/dist/components/composites/workspace-mark/workspace-mark.d.ts.map +1 -1
- package/dist/components/composites/workspace-mark/workspace-mark.js +17 -12
- package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.d.ts.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js +5 -2
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-switcher.d.ts.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-switcher.js +9 -4
- package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -1
- package/dist/components/conversation/busy-send-button.d.ts.map +1 -1
- package/dist/components/conversation/busy-send-button.js +9 -5
- package/dist/components/conversation/busy-send-button.js.map +1 -1
- package/dist/components/conversation/conversation-avatar.d.ts.map +1 -1
- package/dist/components/conversation/conversation-avatar.js +6 -3
- package/dist/components/conversation/conversation-avatar.js.map +1 -1
- package/dist/components/conversation/conversation-surface.d.ts.map +1 -1
- package/dist/components/conversation/conversation-surface.js +3 -1
- package/dist/components/conversation/conversation-surface.js.map +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.d.ts.map +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.js +9 -4
- package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
- package/dist/components/conversation/message-composer.d.ts.map +1 -1
- package/dist/components/conversation/message-composer.js +9 -4
- package/dist/components/conversation/message-composer.js.map +1 -1
- package/dist/components/conversation/message-row.d.ts.map +1 -1
- package/dist/components/conversation/message-row.js +11 -5
- package/dist/components/conversation/message-row.js.map +1 -1
- package/dist/components/conversation/thread-panel.d.ts.map +1 -1
- package/dist/components/conversation/thread-panel.js +3 -1
- package/dist/components/conversation/thread-panel.js.map +1 -1
- package/dist/components/conversation/transcript-composition.d.ts.map +1 -1
- package/dist/components/conversation/transcript-composition.js +3 -1
- package/dist/components/conversation/transcript-composition.js.map +1 -1
- package/dist/components/layout/floating-preview/floating-preview.d.ts.map +1 -1
- package/dist/components/layout/floating-preview/floating-preview.js +5 -2
- package/dist/components/layout/floating-preview/floating-preview.js.map +1 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.d.ts.map +1 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js +3 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
- package/dist/components/layout/shell-rail/shell-rail.d.ts.map +1 -1
- package/dist/components/layout/shell-rail/shell-rail.js +3 -1
- package/dist/components/layout/shell-rail/shell-rail.js.map +1 -1
- package/dist/components/layout/side-rail/side-rail.d.ts.map +1 -1
- package/dist/components/layout/side-rail/side-rail.js +46 -42
- package/dist/components/layout/side-rail/side-rail.js.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.d.ts.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.js +3 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
- package/dist/components/layout/split-layout/split-layout.d.ts.map +1 -1
- package/dist/components/layout/split-layout/split-layout.js +5 -2
- package/dist/components/layout/split-layout/split-layout.js.map +1 -1
- package/dist/components/layout/top-bar/top-bar.d.ts.map +1 -1
- package/dist/components/layout/top-bar/top-bar.js +16 -13
- package/dist/components/layout/top-bar/top-bar.js.map +1 -1
- package/dist/components/theme/appearance-panel.d.ts.map +1 -1
- package/dist/components/theme/appearance-panel.js +3 -1
- package/dist/components/theme/appearance-panel.js.map +1 -1
- package/dist/components/theme/theme-mode-toggle.d.ts.map +1 -1
- package/dist/components/theme/theme-mode-toggle.js +6 -3
- package/dist/components/theme/theme-mode-toggle.js.map +1 -1
- package/dist/components/theme/theme-toggle.d.ts.map +1 -1
- package/dist/components/theme/theme-toggle.js +6 -3
- package/dist/components/theme/theme-toggle.js.map +1 -1
- package/dist/components/ui/accordion/accordion.d.ts.map +1 -1
- package/dist/components/ui/accordion/accordion.js +3 -1
- package/dist/components/ui/accordion/accordion.js.map +1 -1
- package/dist/components/ui/alert/alert.d.ts.map +1 -1
- package/dist/components/ui/alert/alert.js +15 -9
- package/dist/components/ui/alert/alert.js.map +1 -1
- package/dist/components/ui/annotation-surface/annotation-surface.d.ts.map +1 -1
- package/dist/components/ui/annotation-surface/annotation-surface.js +5 -4
- package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -1
- package/dist/components/ui/attachment/attachment.d.ts.map +1 -1
- package/dist/components/ui/attachment/attachment.js +18 -9
- package/dist/components/ui/attachment/attachment.js.map +1 -1
- package/dist/components/ui/badge/badge.d.ts.map +1 -1
- package/dist/components/ui/badge/badge.js +30 -11
- package/dist/components/ui/badge/badge.js.map +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb.js +5 -2
- package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/ui/button/button.d.ts.map +1 -1
- package/dist/components/ui/button/button.js +37 -13
- package/dist/components/ui/button/button.js.map +1 -1
- package/dist/components/ui/calendar/calendar.d.ts.map +1 -1
- package/dist/components/ui/calendar/calendar.js +5 -2
- package/dist/components/ui/calendar/calendar.js.map +1 -1
- package/dist/components/ui/carousel/carousel.d.ts.map +1 -1
- package/dist/components/ui/carousel/carousel.js +12 -6
- package/dist/components/ui/carousel/carousel.js.map +1 -1
- package/dist/components/ui/checkbox/checkbox.d.ts +13 -0
- package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox/checkbox.js +296 -21
- package/dist/components/ui/checkbox/checkbox.js.map +1 -1
- package/dist/components/ui/code-block/code-block.d.ts.map +1 -1
- package/dist/components/ui/code-block/code-block.js +9 -6
- package/dist/components/ui/code-block/code-block.js.map +1 -1
- package/dist/components/ui/combobox/combobox.d.ts.map +1 -1
- package/dist/components/ui/combobox/combobox.js +8 -11
- package/dist/components/ui/combobox/combobox.js.map +1 -1
- package/dist/components/ui/command/command.d.ts.map +1 -1
- package/dist/components/ui/command/command.js +4 -2
- package/dist/components/ui/command/command.js.map +1 -1
- package/dist/components/ui/detail-panel/detail-panel.d.ts.map +1 -1
- package/dist/components/ui/detail-panel/detail-panel.js +3 -1
- package/dist/components/ui/detail-panel/detail-panel.js.map +1 -1
- package/dist/components/ui/dialog/dialog-layer.d.ts.map +1 -1
- package/dist/components/ui/dialog/dialog-layer.js +10 -10
- package/dist/components/ui/dialog/dialog-layer.js.map +1 -1
- package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog/dialog.js +3 -1
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- package/dist/components/ui/dropdown-menu/menu-parts.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu/menu-parts.js +7 -3
- package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -1
- package/dist/components/ui/empty/empty-state.d.ts.map +1 -1
- package/dist/components/ui/empty/empty-state.js +3 -1
- package/dist/components/ui/empty/empty-state.js.map +1 -1
- package/dist/components/ui/field/field.d.ts.map +1 -1
- package/dist/components/ui/field/field.js +12 -6
- package/dist/components/ui/field/field.js.map +1 -1
- package/dist/components/ui/input/input-control.d.ts +2 -0
- package/dist/components/ui/input/input-control.d.ts.map +1 -1
- package/dist/components/ui/input/input-control.js +24 -6
- package/dist/components/ui/input/input-control.js.map +1 -1
- package/dist/components/ui/input/input.d.ts.map +1 -1
- package/dist/components/ui/input/input.js +47 -48
- package/dist/components/ui/input/input.js.map +1 -1
- package/dist/components/ui/input-group/input-group.d.ts.map +1 -1
- package/dist/components/ui/input-group/input-group.js +1 -8
- package/dist/components/ui/input-group/input-group.js.map +1 -1
- package/dist/components/ui/kbd/kbd.d.ts +23 -10
- package/dist/components/ui/kbd/kbd.d.ts.map +1 -1
- package/dist/components/ui/kbd/kbd.js +42 -11
- package/dist/components/ui/kbd/kbd.js.map +1 -1
- package/dist/components/ui/message/index.d.ts +1 -1
- package/dist/components/ui/message/index.d.ts.map +1 -1
- package/dist/components/ui/message/index.js +2 -2
- package/dist/components/ui/message/message.d.ts.map +1 -1
- package/dist/components/ui/message/message.js +5 -3
- package/dist/components/ui/message/message.js.map +1 -1
- package/dist/components/ui/message/parse-message-text.d.ts +32 -0
- package/dist/components/ui/message/parse-message-text.d.ts.map +1 -1
- package/dist/components/ui/message/parse-message-text.js +63 -3
- package/dist/components/ui/message/parse-message-text.js.map +1 -1
- package/dist/components/ui/native-select/native-select.d.ts.map +1 -1
- package/dist/components/ui/native-select/native-select.js +4 -9
- package/dist/components/ui/native-select/native-select.js.map +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu.js +3 -1
- package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination/pagination.d.ts.map +1 -1
- package/dist/components/ui/pagination/pagination.js +7 -3
- package/dist/components/ui/pagination/pagination.js.map +1 -1
- package/dist/components/ui/questionnaire/questionnaire.d.ts.map +1 -1
- package/dist/components/ui/questionnaire/questionnaire.js +9 -4
- package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
- package/dist/components/ui/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group/radio-group.js +4 -9
- package/dist/components/ui/radio-group/radio-group.js.map +1 -1
- package/dist/components/ui/resizable/resizable.d.ts.map +1 -1
- package/dist/components/ui/resizable/resizable.js +3 -1
- package/dist/components/ui/resizable/resizable.js.map +1 -1
- package/dist/components/ui/select/select.d.ts.map +1 -1
- package/dist/components/ui/select/select.js +7 -3
- package/dist/components/ui/select/select.js.map +1 -1
- package/dist/components/ui/sheet/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet/sheet.js +3 -1
- package/dist/components/ui/sheet/sheet.js.map +1 -1
- package/dist/components/ui/spinner/spinner.d.ts.map +1 -1
- package/dist/components/ui/spinner/spinner.js +3 -1
- package/dist/components/ui/spinner/spinner.js.map +1 -1
- package/dist/components/ui/status-chip/status-chip.d.ts.map +1 -1
- package/dist/components/ui/status-chip/status-chip.js +35 -30
- package/dist/components/ui/status-chip/status-chip.js.map +1 -1
- package/dist/components/ui/switch/switch.d.ts +7 -0
- package/dist/components/ui/switch/switch.d.ts.map +1 -1
- package/dist/components/ui/switch/switch.js +255 -17
- package/dist/components/ui/switch/switch.js.map +1 -1
- package/dist/components/ui/textarea/textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea/textarea.js +1 -8
- package/dist/components/ui/textarea/textarea.js.map +1 -1
- package/dist/components/ui/toast/toast.d.ts.map +1 -1
- package/dist/components/ui/toast/toast.js +3 -1
- package/dist/components/ui/toast/toast.js.map +1 -1
- package/dist/components/ui/tooltip/deferred-tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip/deferred-tooltip.js +10 -4
- package/dist/components/ui/tooltip/deferred-tooltip.js.map +1 -1
- package/dist/components/ui/tooltip/index.d.ts +1 -0
- package/dist/components/ui/tooltip/index.d.ts.map +1 -1
- package/dist/components/ui/tooltip/index.js +2 -1
- package/dist/components/ui/tooltip/lazy-tooltip.d.ts +40 -0
- package/dist/components/ui/tooltip/lazy-tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip/lazy-tooltip.js +61 -0
- package/dist/components/ui/tooltip/lazy-tooltip.js.map +1 -0
- package/dist/components/ui/trace/trace.d.ts.map +1 -1
- package/dist/components/ui/trace/trace.js +82 -68
- package/dist/components/ui/trace/trace.js.map +1 -1
- package/dist/components/ui/typography/typography.d.ts +1 -1
- package/dist/components/ui/typography/typography.d.ts.map +1 -1
- package/dist/components/ui/typography/typography.js +5 -6
- package/dist/components/ui/typography/typography.js.map +1 -1
- package/dist/index.js +3 -2
- package/dist/lib/clipboard.d.ts.map +1 -1
- package/dist/lib/clipboard.js +3 -0
- package/dist/lib/clipboard.js.map +1 -1
- package/dist/lib/fast-icon.d.ts +18 -0
- package/dist/lib/fast-icon.d.ts.map +1 -0
- package/dist/lib/fast-icon.js +75 -0
- package/dist/lib/fast-icon.js.map +1 -0
- package/dist/lib/form-field.d.ts +1 -1
- package/dist/lib/form-field.js +3 -1
- package/dist/lib/form-field.js.map +1 -1
- package/dist/lib/observe-resize.d.ts +14 -0
- package/dist/lib/observe-resize.d.ts.map +1 -0
- package/dist/lib/observe-resize.js +19 -0
- package/dist/lib/observe-resize.js.map +1 -0
- package/dist/lib/overlay.d.ts +1 -1
- package/dist/lib/overlay.d.ts.map +1 -1
- package/dist/lib/overlay.js +1 -1
- package/dist/lib/overlay.js.map +1 -1
- package/dist/lint/index.d.ts +1 -0
- package/dist/lint/index.d.ts.map +1 -1
- package/dist/lint.js +251 -118
- package/dist/lint.js.map +1 -1
- package/dist/r/action-button.json +3 -1
- package/dist/r/floating-preview.json +2 -1
- package/dist/r/icon-picker.json +0 -1
- package/dist/r/lib.json +10 -0
- package/dist/r/model-selector.json +1 -0
- package/dist/r/plan.json +2 -1
- package/dist/r/queue.json +2 -1
- package/dist/r/registry.json +33 -9
- package/dist/r/scene-controls.json +2 -1
- package/dist/r/side-rail.json +1 -0
- package/dist/r/src/components/composites/about-dialog/about-dialog.tsx +5 -1
- package/dist/r/src/components/composites/accent-picker/accent-picker.tsx +22 -17
- package/dist/r/src/components/composites/account-menu/account-menu.tsx +21 -9
- package/dist/r/src/components/composites/action-button/action-button.tsx +38 -21
- package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +7 -1
- package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +13 -1
- package/dist/r/src/components/composites/appearance-editor/appearance-rows.tsx +13 -1
- package/dist/r/src/components/composites/appearance-editor/font-settings-group.tsx +13 -1
- package/dist/r/src/components/composites/catalog-browser/catalog-browser-group.tsx +11 -1
- package/dist/r/src/components/composites/catalog-browser/catalog-browser.tsx +11 -1
- package/dist/r/src/components/composites/chain-of-thought/chain-of-thought.tsx +5 -1
- package/dist/r/src/components/composites/chat/chat.tsx +11 -1
- package/dist/r/src/components/composites/checkpoint/checkpoint.tsx +5 -1
- package/dist/r/src/components/composites/confirmation/confirmation.tsx +15 -1
- package/dist/r/src/components/composites/context/context.tsx +9 -1
- package/dist/r/src/components/composites/file-tree/file-tree.tsx +11 -1
- package/dist/r/src/components/composites/help-center/help-center.tsx +5 -1
- package/dist/r/src/components/composites/icon-picker/icon-picker.tsx +59 -31
- package/dist/r/src/components/composites/icon-picker/shell-icons.ts +121 -59
- package/dist/r/src/components/composites/inline-citation/inline-citation.tsx +6 -1
- package/dist/r/src/components/composites/list-row/list-row-control.tsx +7 -5
- package/dist/r/src/components/composites/message-scroller/message-scroller.tsx +6 -1
- package/dist/r/src/components/composites/model-selector/model-selector.tsx +197 -11
- package/dist/r/src/components/composites/plan/plan.tsx +5 -1
- package/dist/r/src/components/composites/queue/queue.tsx +15 -1
- package/dist/r/src/components/composites/reasoning/reasoning.tsx +5 -1
- package/dist/r/src/components/composites/scene-controls/scene-controls.tsx +17 -1
- package/dist/r/src/components/composites/settings/settings.tsx +23 -14
- package/dist/r/src/components/composites/sources/sources.tsx +27 -20
- package/dist/r/src/components/composites/stack-trace/stack-trace.tsx +13 -1
- package/dist/r/src/components/composites/stat/stat.tsx +9 -1
- package/dist/r/src/components/composites/subagent/subagent.tsx +5 -1
- package/dist/r/src/components/composites/task/task.tsx +5 -1
- package/dist/r/src/components/composites/terminal/ansi.ts +18 -0
- package/dist/r/src/components/composites/terminal/terminal.tsx +17 -7
- package/dist/r/src/components/composites/test-results/test-results.tsx +17 -7
- package/dist/r/src/components/composites/tool/tool.tsx +5 -1
- package/dist/r/src/components/composites/tree/tree.tsx +5 -1
- package/dist/r/src/components/composites/update-dialog/update-dialog.tsx +35 -15
- package/dist/r/src/components/composites/workspace-mark/workspace-mark.tsx +14 -7
- package/dist/r/src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx +6 -1
- package/dist/r/src/components/composites/workspace-switcher/workspace-switcher.tsx +13 -1
- package/dist/r/src/components/conversation/busy-send-button.tsx +11 -1
- package/dist/r/src/components/conversation/conversation-avatar.tsx +7 -1
- package/dist/r/src/components/conversation/conversation-surface.tsx +5 -1
- package/dist/r/src/components/conversation/internal/chat-composer-shell.tsx +13 -1
- package/dist/r/src/components/conversation/message-composer.tsx +13 -1
- package/dist/r/src/components/conversation/message-row.tsx +15 -1
- package/dist/r/src/components/conversation/thread-panel.tsx +5 -1
- package/dist/r/src/components/conversation/transcript-composition.tsx +5 -1
- package/dist/r/src/components/layout/floating-preview/floating-preview.tsx +6 -1
- package/dist/r/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +5 -1
- package/dist/r/src/components/layout/shell-rail/shell-rail.tsx +5 -1
- package/dist/r/src/components/layout/side-rail/side-rail.tsx +16 -19
- package/dist/r/src/components/layout/sidebar-nav/sidebar-nav.tsx +5 -1
- package/dist/r/src/components/layout/split-layout/split-layout.tsx +6 -1
- package/dist/r/src/components/layout/top-bar/top-bar.tsx +8 -8
- package/dist/r/src/components/theme/appearance-panel.tsx +6 -1
- package/dist/r/src/components/theme/theme-mode-toggle.tsx +7 -1
- package/dist/r/src/components/theme/theme-toggle.tsx +7 -1
- package/dist/r/src/components/ui/accordion/accordion.tsx +5 -1
- package/dist/r/src/components/ui/alert/alert.tsx +20 -3
- package/dist/r/src/components/ui/annotation-surface/annotation-surface.tsx +6 -3
- package/dist/r/src/components/ui/attachment/attachment.tsx +19 -8
- package/dist/r/src/components/ui/badge/badge.tsx +24 -8
- package/dist/r/src/components/ui/breadcrumb/breadcrumb.tsx +9 -1
- package/dist/r/src/components/ui/button/button.tsx +47 -16
- package/dist/r/src/components/ui/calendar/calendar.tsx +6 -1
- package/dist/r/src/components/ui/carousel/carousel.tsx +15 -5
- package/dist/r/src/components/ui/checkbox/checkbox.tsx +260 -22
- package/dist/r/src/components/ui/code-block/code-block.tsx +11 -5
- package/dist/r/src/components/ui/combobox/combobox.tsx +8 -9
- package/dist/r/src/components/ui/command/command.tsx +8 -4
- package/dist/r/src/components/ui/detail-panel/detail-panel.tsx +5 -1
- package/dist/r/src/components/ui/dialog/dialog-layer.tsx +16 -18
- package/dist/r/src/components/ui/dialog/dialog.tsx +5 -1
- package/dist/r/src/components/ui/dropdown-menu/menu-parts.tsx +11 -1
- package/dist/r/src/components/ui/empty/empty-state.tsx +5 -1
- package/dist/r/src/components/ui/field/field.tsx +14 -5
- package/dist/r/src/components/ui/input/input-control.tsx +28 -19
- package/dist/r/src/components/ui/input/input.tsx +9 -12
- package/dist/r/src/components/ui/input-group/input-group.tsx +1 -8
- package/dist/r/src/components/ui/kbd/kbd.tsx +53 -12
- package/dist/r/src/components/ui/message/index.ts +3 -0
- package/dist/r/src/components/ui/message/message.tsx +11 -2
- package/dist/r/src/components/ui/message/parse-message-text.ts +94 -2
- package/dist/r/src/components/ui/native-select/native-select.tsx +6 -9
- package/dist/r/src/components/ui/navigation-menu/navigation-menu.tsx +5 -1
- package/dist/r/src/components/ui/pagination/pagination.tsx +11 -1
- package/dist/r/src/components/ui/questionnaire/questionnaire.tsx +13 -1
- package/dist/r/src/components/ui/radio-group/radio-group.tsx +6 -9
- package/dist/r/src/components/ui/resizable/resizable.tsx +5 -1
- package/dist/r/src/components/ui/select/select.tsx +11 -1
- package/dist/r/src/components/ui/sheet/sheet.tsx +5 -1
- package/dist/r/src/components/ui/spinner/spinner.tsx +5 -1
- package/dist/r/src/components/ui/status-chip/status-chip.tsx +14 -7
- package/dist/r/src/components/ui/switch/switch.tsx +235 -28
- package/dist/r/src/components/ui/textarea/textarea.tsx +1 -8
- package/dist/r/src/components/ui/toast/toast.tsx +5 -1
- package/dist/r/src/components/ui/tooltip/deferred-tooltip.tsx +14 -8
- package/dist/r/src/components/ui/tooltip/index.ts +1 -0
- package/dist/r/src/components/ui/tooltip/lazy-tooltip.tsx +73 -0
- package/dist/r/src/components/ui/trace/trace.tsx +61 -28
- package/dist/r/src/components/ui/typography/typography.tsx +6 -5
- package/dist/r/src/lib/clipboard.ts +4 -0
- package/dist/r/src/lib/fast-icon.ts +88 -0
- package/dist/r/src/lib/form-field.ts +7 -7
- package/dist/r/src/lib/observe-resize.ts +28 -0
- package/dist/r/src/lib/overlay.ts +1 -1
- package/dist/r/subagent.json +2 -1
- package/dist/r/tool.json +2 -1
- package/dist/r/tooltip.json +5 -0
- package/dist/r/top-bar.json +1 -0
- package/dist/r/trace.json +0 -1
- package/package.json +1 -1
- package/registry.json +33 -9
- package/src/components/composites/about-dialog/about-dialog.tsx +5 -1
- package/src/components/composites/accent-picker/accent-picker.tsx +22 -17
- package/src/components/composites/account-menu/account-menu.tsx +21 -9
- package/src/components/composites/action-button/action-button.tsx +38 -21
- package/src/components/composites/appearance-editor/appearance-choices.tsx +7 -1
- package/src/components/composites/appearance-editor/appearance-editor.tsx +13 -1
- package/src/components/composites/appearance-editor/appearance-rows.tsx +13 -1
- package/src/components/composites/appearance-editor/font-settings-group.tsx +13 -1
- package/src/components/composites/catalog-browser/catalog-browser-group.tsx +11 -1
- package/src/components/composites/catalog-browser/catalog-browser.tsx +11 -1
- package/src/components/composites/chain-of-thought/chain-of-thought.tsx +5 -1
- package/src/components/composites/chat/chat.tsx +11 -1
- package/src/components/composites/checkpoint/checkpoint.tsx +5 -1
- package/src/components/composites/confirmation/confirmation.tsx +15 -1
- package/src/components/composites/context/context.tsx +9 -1
- package/src/components/composites/file-tree/file-tree.tsx +11 -1
- package/src/components/composites/help-center/help-center.tsx +5 -1
- package/src/components/composites/icon-picker/icon-picker.tsx +59 -31
- package/src/components/composites/icon-picker/shell-icons.ts +121 -59
- package/src/components/composites/inline-citation/inline-citation.tsx +6 -1
- package/src/components/composites/list-row/list-row-control.tsx +7 -5
- package/src/components/composites/message-scroller/message-scroller.tsx +6 -1
- package/src/components/composites/model-selector/model-selector.tsx +197 -11
- package/src/components/composites/plan/plan.tsx +5 -1
- package/src/components/composites/queue/queue.tsx +15 -1
- package/src/components/composites/reasoning/reasoning.tsx +5 -1
- package/src/components/composites/scene-controls/scene-controls.tsx +17 -1
- package/src/components/composites/settings/settings.tsx +23 -14
- package/src/components/composites/sources/sources.tsx +27 -20
- package/src/components/composites/stack-trace/stack-trace.tsx +13 -1
- package/src/components/composites/stat/stat.tsx +9 -1
- package/src/components/composites/subagent/subagent.tsx +5 -1
- package/src/components/composites/task/task.tsx +5 -1
- package/src/components/composites/terminal/ansi.ts +18 -0
- package/src/components/composites/terminal/terminal.tsx +17 -7
- package/src/components/composites/test-results/test-results.tsx +17 -7
- package/src/components/composites/tool/tool.tsx +5 -1
- package/src/components/composites/tree/tree.tsx +5 -1
- package/src/components/composites/update-dialog/update-dialog.tsx +35 -15
- package/src/components/composites/workspace-mark/workspace-mark.tsx +14 -7
- package/src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx +6 -1
- package/src/components/composites/workspace-switcher/workspace-switcher.tsx +13 -1
- package/src/components/conversation/busy-send-button.tsx +11 -1
- package/src/components/conversation/conversation-avatar.tsx +7 -1
- package/src/components/conversation/conversation-surface.tsx +5 -1
- package/src/components/conversation/internal/chat-composer-shell.tsx +13 -1
- package/src/components/conversation/message-composer.tsx +13 -1
- package/src/components/conversation/message-row.tsx +15 -1
- package/src/components/conversation/thread-panel.tsx +5 -1
- package/src/components/conversation/transcript-composition.tsx +5 -1
- package/src/components/layout/floating-preview/floating-preview.tsx +6 -1
- package/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +5 -1
- package/src/components/layout/shell-rail/shell-rail.tsx +5 -1
- package/src/components/layout/side-rail/side-rail.tsx +16 -19
- package/src/components/layout/sidebar-nav/sidebar-nav.tsx +5 -1
- package/src/components/layout/split-layout/split-layout.tsx +6 -1
- package/src/components/layout/top-bar/top-bar.tsx +8 -8
- package/src/components/theme/appearance-panel.tsx +6 -1
- package/src/components/theme/theme-mode-toggle.tsx +7 -1
- package/src/components/theme/theme-toggle.tsx +7 -1
- package/src/components/ui/accordion/accordion.tsx +5 -1
- package/src/components/ui/alert/alert.tsx +20 -3
- package/src/components/ui/annotation-surface/annotation-surface.tsx +6 -3
- package/src/components/ui/attachment/attachment.tsx +19 -8
- package/src/components/ui/badge/badge.tsx +24 -8
- package/src/components/ui/breadcrumb/breadcrumb.tsx +9 -1
- package/src/components/ui/button/button.tsx +47 -16
- package/src/components/ui/calendar/calendar.tsx +6 -1
- package/src/components/ui/carousel/carousel.tsx +15 -5
- package/src/components/ui/checkbox/checkbox.tsx +260 -22
- package/src/components/ui/code-block/code-block.tsx +11 -5
- package/src/components/ui/combobox/combobox.tsx +8 -9
- package/src/components/ui/command/command.tsx +8 -4
- package/src/components/ui/detail-panel/detail-panel.tsx +5 -1
- package/src/components/ui/dialog/dialog-layer.tsx +16 -18
- package/src/components/ui/dialog/dialog.tsx +5 -1
- package/src/components/ui/dropdown-menu/menu-parts.tsx +11 -1
- package/src/components/ui/empty/empty-state.tsx +5 -1
- package/src/components/ui/field/field.tsx +14 -5
- package/src/components/ui/input/input-control.tsx +28 -19
- package/src/components/ui/input/input.tsx +9 -12
- package/src/components/ui/input-group/input-group.tsx +1 -8
- package/src/components/ui/kbd/kbd.tsx +53 -12
- package/src/components/ui/message/index.ts +3 -0
- package/src/components/ui/message/message.tsx +11 -2
- package/src/components/ui/message/parse-message-text.ts +94 -2
- package/src/components/ui/native-select/native-select.tsx +6 -9
- package/src/components/ui/navigation-menu/navigation-menu.tsx +5 -1
- package/src/components/ui/pagination/pagination.tsx +11 -1
- package/src/components/ui/questionnaire/questionnaire.tsx +13 -1
- package/src/components/ui/radio-group/radio-group.tsx +6 -9
- package/src/components/ui/resizable/resizable.tsx +5 -1
- package/src/components/ui/select/select.tsx +11 -1
- package/src/components/ui/sheet/sheet.tsx +5 -1
- package/src/components/ui/spinner/spinner.tsx +5 -1
- package/src/components/ui/status-chip/status-chip.tsx +14 -7
- package/src/components/ui/switch/switch.tsx +235 -28
- package/src/components/ui/textarea/textarea.tsx +1 -8
- package/src/components/ui/toast/toast.tsx +5 -1
- package/src/components/ui/tooltip/deferred-tooltip.tsx +14 -8
- package/src/components/ui/tooltip/index.ts +1 -0
- package/src/components/ui/tooltip/lazy-tooltip.tsx +73 -0
- package/src/components/ui/trace/trace.tsx +61 -28
- package/src/components/ui/typography/typography.tsx +6 -5
- package/src/lib/clipboard.ts +4 -0
- package/src/lib/fast-icon.ts +88 -0
- package/src/lib/form-field.ts +7 -7
- package/src/lib/observe-resize.ts +28 -0
- package/src/lib/overlay.ts +1 -1
- package/src/lint/index.ts +199 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { cn } from "../../../lib/utils.js";
|
|
2
|
+
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
2
3
|
import { createComponent, insert, mergeProps, spread, template } from "solid-js/web";
|
|
3
4
|
import { ChevronRight, MoreHorizontal } from "lucide-solid";
|
|
4
5
|
import { Show, splitProps } from "solid-js";
|
|
@@ -10,6 +11,8 @@ var _tmpl$4 = /*#__PURE__*/ template(`<a data-slot=breadcrumb-link>`);
|
|
|
10
11
|
var _tmpl$5 = /*#__PURE__*/ template(`<span data-slot=breadcrumb-page aria-current=page>`);
|
|
11
12
|
var _tmpl$6 = /*#__PURE__*/ template(`<li data-slot=breadcrumb-separator role=presentation aria-hidden=true>`);
|
|
12
13
|
var _tmpl$7 = /*#__PURE__*/ template(`<span data-slot=breadcrumb-ellipsis role=presentation aria-hidden=true><span class=visually-hidden>More`);
|
|
14
|
+
var ChevronRight$1 = fastIcon(ChevronRight);
|
|
15
|
+
var MoreHorizontal$1 = fastIcon(MoreHorizontal);
|
|
13
16
|
/**
|
|
14
17
|
* Breadcrumb.
|
|
15
18
|
*
|
|
@@ -99,7 +102,7 @@ function BreadcrumbSeparator(props) {
|
|
|
99
102
|
spread(_el$6, mergeProps({ get ["class"]() {
|
|
100
103
|
return cn("[&_svg]:size-3.5", local.class);
|
|
101
104
|
} }, rest), false, true);
|
|
102
|
-
insert(_el$6, () => local.children ?? createComponent(ChevronRight, {}));
|
|
105
|
+
insert(_el$6, () => local.children ?? createComponent(ChevronRight$1, {}));
|
|
103
106
|
return _el$6;
|
|
104
107
|
})();
|
|
105
108
|
}
|
|
@@ -110,7 +113,7 @@ function BreadcrumbEllipsis(props) {
|
|
|
110
113
|
spread(_el$7, mergeProps({ get ["class"]() {
|
|
111
114
|
return cn("flex size-6 items-center justify-center", local.class);
|
|
112
115
|
} }, rest), false, true);
|
|
113
|
-
insert(_el$7, createComponent(MoreHorizontal, { "class": "size-4" }), _el$8);
|
|
116
|
+
insert(_el$7, createComponent(MoreHorizontal$1, { "class": "size-4" }), _el$8);
|
|
114
117
|
return _el$7;
|
|
115
118
|
})();
|
|
116
119
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb.js","names":["ChevronRight","MoreHorizontal","Show","splitProps","cn","Breadcrumb","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","class","BreadcrumbList","_el$2","_tmpl$2","BreadcrumbItem","_el$3","_tmpl$3","current","BreadcrumbLink","_$createComponent","when","fallback","BreadcrumbPage","children","_el$4","_tmpl$4","_el$5","_tmpl$5","BreadcrumbSeparator","_el$6","_tmpl$6","_$insert","BreadcrumbEllipsis","_el$7","_tmpl$7","_el$8","firstChild"],"sources":["../../../../src/components/ui/breadcrumb/breadcrumb.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"breadcrumb.js","names":["ChevronRight","LucideChevronRight","MoreHorizontal","LucideMoreHorizontal","Show","splitProps","cn","fastIcon","Breadcrumb","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","class","BreadcrumbList","_el$2","_tmpl$2","BreadcrumbItem","_el$3","_tmpl$3","current","BreadcrumbLink","_$createComponent","when","fallback","BreadcrumbPage","children","_el$4","_tmpl$4","_el$5","_tmpl$5","BreadcrumbSeparator","_el$6","_tmpl$6","_$insert","BreadcrumbEllipsis","_el$7","_tmpl$7","_el$8","firstChild"],"sources":["../../../../src/components/ui/breadcrumb/breadcrumb.tsx"],"sourcesContent":["import {\n ChevronRight as LucideChevronRight,\n MoreHorizontal as LucideMoreHorizontal,\n} from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { Show, splitProps } 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 ChevronRight = fastIcon(LucideChevronRight)\nconst MoreHorizontal = fastIcon(LucideMoreHorizontal)\n\n/**\n * Breadcrumb.\n *\n * The path to the current view, in a real `<nav>` wrapping an ordered list so\n * the structure is announced rather than read as loose text. The final crumb is\n * the current page and is marked `aria-current=\"page\"` instead of being a link\n * to itself.\n *\n * A long path collapses from the middle: the root says where the user started\n * and the last crumbs say what they are looking at, so those are the parts that\n * have to survive.\n */\nexport function Breadcrumb(props: ComponentProps<'nav'>) {\n const [local, rest] = splitProps(props, ['class', 'aria-label'])\n\n return (\n <nav\n data-slot=\"breadcrumb\"\n aria-label={local['aria-label'] ?? 'Breadcrumb'}\n class={cn('text-muted-foreground', local.class)}\n {...rest}\n />\n )\n}\n\nexport function BreadcrumbList(props: ComponentProps<'ol'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <ol\n data-slot=\"breadcrumb-list\"\n class={cn('flex flex-wrap items-center gap-1.5 text-sm break-words', local.class)}\n {...rest}\n />\n )\n}\n\nexport function BreadcrumbItem(props: ComponentProps<'li'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <li\n data-slot=\"breadcrumb-item\"\n class={cn('inline-flex items-center gap-1.5', local.class)}\n {...rest}\n />\n )\n}\n\nexport type BreadcrumbLinkProps = ComponentProps<'a'> & {\n /** Render as the current page rather than as a link. */\n current?: boolean\n}\n\nexport function BreadcrumbLink(props: BreadcrumbLinkProps) {\n const [local, rest] = splitProps(props, ['class', 'current'])\n\n return (\n <Show\n when={!local.current}\n fallback={<BreadcrumbPage class={local.class} {...(rest as ComponentProps<'span'>)} />}\n >\n <a\n data-slot=\"breadcrumb-link\"\n class={cn(\n 'rounded-sm transition-colors ease-out outline-none hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n local.class\n )}\n {...rest}\n />\n </Show>\n )\n}\n\n/**\n * The current page: the last crumb, as text rather than a link to itself, and\n * marked `aria-current=\"page\"`. The same element `BreadcrumbLink current`\n * renders, for a trail whose last crumb is never a link.\n */\nexport function BreadcrumbPage(props: ComponentProps<'span'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <span\n data-slot=\"breadcrumb-page\"\n aria-current=\"page\"\n class={cn('font-medium text-foreground', local.class)}\n {...rest}\n />\n )\n}\n\nexport function BreadcrumbSeparator(props: ComponentProps<'li'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <li\n data-slot=\"breadcrumb-separator\"\n role=\"presentation\"\n aria-hidden=\"true\"\n class={cn('[&_svg]:size-3.5', local.class)}\n {...rest}\n >\n {local.children ?? <ChevronRight />}\n </li>\n )\n}\n\nexport function BreadcrumbEllipsis(props: ComponentProps<'span'>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <span\n data-slot=\"breadcrumb-ellipsis\"\n role=\"presentation\"\n aria-hidden=\"true\"\n class={cn('flex size-6 items-center justify-center', local.class)}\n {...rest}\n >\n <MoreHorizontal class=\"size-4\" />\n <span class=\"visually-hidden\">More</span>\n </span>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAUA,IAAMA,iBAAeO,SAASN,YAAkB;AAChD,IAAMC,mBAAiBK,SAASJ,cAAoB;;;;;;;;;;;;;AAcpD,SAAgBK,WAAWC,OAA8B;CACvD,MAAM,CAACC,OAAOC,QAAQN,WAAWI,OAAO,CAAC,SAAS,YAAY,CAAC;CAE/D,cAAA;EAAA,IAAAG,OAAAC,OAAA;EAAAC,OAAAF,MAAAG,WAAA;GAAA,KAAA,gBAAA;IAAA,OAGgBL,MAAM,iBAAiB;GAAY;GAAA,KAAA,WAAA;IAAA,OACxCJ,GAAG,yBAAyBI,MAAMM,KAAK;GAAC;EAAA,GAC3CL,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAC;CAAA,EAAA,CAAA;AAGd;AAEA,SAAgBK,eAAeR,OAA6B;CAC1D,MAAM,CAACC,OAAOC,QAAQN,WAAWI,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAS,QAAAC,QAAA;EAAAL,OAAAI,OAAAH,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWT,GAAG,2DAA2DI,MAAMM,KAAK;EAAC,EAAA,GAC7EL,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAO;CAAA,EAAA,CAAA;AAGd;AAEA,SAAgBE,eAAeX,OAA6B;CAC1D,MAAM,CAACC,OAAOC,QAAQN,WAAWI,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAY,QAAAC,QAAA;EAAAR,OAAAO,OAAAN,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWT,GAAG,oCAAoCI,MAAMM,KAAK;EAAC,EAAA,GACtDL,IAAI,GAAA,OA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A,CAAA,CAAG;EAAA,OAAAmC;CAAA,EAAA,CAAA;AAGzC;AAEA,SAAgBG,mBAAmB7B,OAA+B;CAChE,MAAM,CAACC,OAAOC,QAAQN,WAAWI,OAAO,CAAC,OAAO,CAAC;CAEjD,cAAA;EAAA,IAAA8B,QAAAC,QAAA,GAAAC,QAAAF,MAAAG;EAAA5B,OAAAyB,OAAAxB,WAAA,EAAA,KAAA,WAAA;GAAA,OAKWT,GAAG,2CAA2CI,MAAMM,KAAK;EAAC,EAAA,GAC7DL,IAAI,GAAA,OAAA,IAAA;EAAA0B,OAAAE,OAAAd,gBAEPvB,kBAAc,EAAA,SAAA,SAAA,CAAA,GAAAuC,KAAA;EAAA,OAAAF;CAAA,EAAA,CAAA;AAIrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC9E,OAAO,
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC9E,OAAO,EAAqD,KAAK,cAAc,EAAE,MAAM,UAAU,CAAA;AAEjG,OAAO,EAAwC,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAGvF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,cAAc;;;;8EA6D1B,CAAA;AAED,KAAK,kBAAkB,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAA;AAE7D,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,cAAc,GAAG,QAAQ,IAAI,gBAAgB,CAC7E,CAAC,EACD,kBAAkB,GAAG;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CACF,CAAA;AAED,wBAAgB,MAAM,CAAC,CAAC,SAAS,cAAc,GAAG,QAAQ,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,kCAsDhF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { controlInteractive, controlSize, cva } from "../../../lib/variants.js";
|
|
2
2
|
import { cn } from "../../../lib/utils.js";
|
|
3
|
-
import { createComponent, mergeProps } from "solid-js/web";
|
|
4
|
-
import { splitProps } from "solid-js";
|
|
3
|
+
import { createComponent, isServer, mergeProps, spread } from "solid-js/web";
|
|
4
|
+
import { Show, mergeProps as mergeProps$1, splitProps } from "solid-js";
|
|
5
5
|
import { Polymorphic } from "@kobalte/core/polymorphic";
|
|
6
6
|
// src/components/ui/button/button.tsx
|
|
7
7
|
/**
|
|
@@ -72,23 +72,47 @@ var buttonVariants = cva(`${controlInteractive} inline-flex shrink-0 items-cente
|
|
|
72
72
|
});
|
|
73
73
|
function Button(props) {
|
|
74
74
|
const [local, rest] = splitProps(props, [
|
|
75
|
+
"as",
|
|
75
76
|
"variant",
|
|
76
77
|
"size",
|
|
77
78
|
"touchTarget",
|
|
78
79
|
"class"
|
|
79
80
|
]);
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
81
|
+
const className = () => cn(buttonVariants({
|
|
82
|
+
variant: local.variant,
|
|
83
|
+
size: local.size,
|
|
84
|
+
touchTarget: local.touchTarget
|
|
85
|
+
}), local.class);
|
|
86
|
+
const native = () => {
|
|
87
|
+
const element = document.createElement("button");
|
|
88
|
+
spread(element, mergeProps$1({
|
|
89
|
+
type: "button",
|
|
90
|
+
"data-slot": "button"
|
|
91
|
+
}, rest, { get class() {
|
|
92
|
+
return className();
|
|
93
|
+
} }), false, false);
|
|
94
|
+
return element;
|
|
95
|
+
};
|
|
96
|
+
return createComponent(Show, {
|
|
97
|
+
get when() {
|
|
98
|
+
return !isServer && (local.as === void 0 || local.as === "button");
|
|
99
|
+
},
|
|
100
|
+
get fallback() {
|
|
101
|
+
return createComponent(Polymorphic, mergeProps({
|
|
102
|
+
get as() {
|
|
103
|
+
return local.as ?? "button";
|
|
104
|
+
},
|
|
105
|
+
type: "button",
|
|
106
|
+
"data-slot": "button",
|
|
107
|
+
get ["class"]() {
|
|
108
|
+
return className();
|
|
109
|
+
}
|
|
110
|
+
}, rest));
|
|
111
|
+
},
|
|
112
|
+
get children() {
|
|
113
|
+
return native();
|
|
90
114
|
}
|
|
91
|
-
}
|
|
115
|
+
});
|
|
92
116
|
}
|
|
93
117
|
export { Button, buttonVariants };
|
|
94
118
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","names":["Polymorphic","splitProps","cva","controlInteractive","controlSize","cn","buttonVariants","variants","variant","default","secondary","destructive","outline","ghost","toolbar","subtle","success","link","size","xs","sm","md","lg","xl","touchTarget","comfortable","defaultVariants","class","Button","props","local","rest","_$createComponent","_$mergeProps","
|
|
1
|
+
{"version":3,"file":"button.js","names":["Polymorphic","mergeProps","Show","splitProps","isServer","spread","cva","controlInteractive","controlSize","cn","buttonVariants","variants","variant","default","secondary","destructive","outline","ghost","toolbar","subtle","success","link","size","xs","sm","md","lg","xl","touchTarget","comfortable","defaultVariants","class","Button","props","local","rest","as","className","native","element","document","createElement","type","_$createComponent","when","undefined","fallback","_$mergeProps","children"],"sources":["../../../../src/components/ui/button/button.tsx"],"sourcesContent":["import { Polymorphic, type PolymorphicProps } from '@kobalte/core/polymorphic'\nimport { type ComponentProps, mergeProps, Show, splitProps, type ValidComponent } from 'solid-js'\nimport { isServer, spread } from 'solid-js/web'\nimport { cva, controlInteractive, controlSize, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * Button.\n *\n * One appearance ladder shared by every pressable thing in the system: a\n * button, a toolbar control, a dialog action, and a menu row all draw from the\n * same tokens, so a row of them cannot drift apart.\n *\n * The variants answer \"what is this for\", never \"what colour is it\". A caller\n * that wants a red button writes `variant=\"destructive\"`; the red lives here.\n * That is also what lets the design-system linter tell a caller which variant\n * to use instead of only which class was wrong.\n *\n * Polymorphic: pass `as=\"a\"` (or any component) and the button becomes it\n * while keeping the same styling contract. This replaces the React-era\n * `asChild` primitive, which has no Solid equivalent that preserves props.\n */\nexport const buttonVariants = cva(\n `${controlInteractive} inline-flex shrink-0 items-center justify-center rounded-md font-medium whitespace-nowrap select-none [&_svg]:pointer-events-none [&_svg]:shrink-0`,\n {\n variants: {\n variant: {\n /** The one primary action in a view. */\n default: 'bg-primary text-primary-foreground hover:bg-primary-hover',\n secondary: 'bg-secondary text-secondary-foreground hover:bg-surface-hover',\n /** For the action that destroys something. Never the default. */\n destructive:\n 'bg-destructive-action text-destructive-action-foreground hover:bg-destructive-action/90 focus-visible:ring-destructive-subtle',\n /** A bordered button for a surface that already has a fill. */\n outline:\n 'border border-border bg-transparent text-foreground hover:bg-surface-hover hover:border-input',\n /** No chrome until hover. The default for toolbar and row actions. */\n ghost: 'text-foreground hover:bg-surface-hover',\n /**\n * A ghost that opens something: a sheet, menu or popover trigger in a\n * toolbar. While its surface is open it holds the accent's own tint,\n * the same treatment that drives the side rail's active destination,\n * so the open control never reads identical to its closed neighbours\n * and the app's pressed chrome reads as one accent chroma. The\n * compound hover keeps the tint when an open control is pointed at.\n */\n toolbar:\n 'text-foreground hover:bg-surface-hover data-[expanded]:bg-primary-subtle data-[expanded]:text-primary data-[expanded]:hover:bg-primary-subtle',\n /** A tinted primary, for a secondary action inside a primary flow. */\n subtle: 'bg-primary-subtle text-primary hover:bg-primary-subtle/80',\n success: 'bg-success text-success-foreground hover:bg-success/90',\n link: 'text-primary underline-offset-4 hover:underline',\n },\n size: {\n '2xs': `${controlSize['2xs']} [&_svg]:size-3`,\n xs: `${controlSize.xs} [&_svg]:size-3.5`,\n sm: `${controlSize.sm} [&_svg]:size-3.5`,\n md: `${controlSize.md} [&_svg]:size-4`,\n lg: `${controlSize.lg} [&_svg]:size-4`,\n xl: `${controlSize.xl} [&_svg]:size-5`,\n '2xl': `${controlSize['2xl']} [&_svg]:size-6`,\n /* Square, for an icon with no label. The accessible name then has to\n come from `aria-label` or a visually hidden label — an icon-only\n button with neither is the accessibility finding the Storybook lane\n catches on every story. */\n 'icon-2xs': 'size-control-2xs p-0 [&_svg]:size-3',\n 'icon-xs': 'size-control-xs p-0 [&_svg]:size-3.5',\n 'icon-sm': 'size-control-sm p-0 [&_svg]:size-3.5',\n 'icon-md': 'size-control-md p-0 [&_svg]:size-4',\n 'icon-lg': 'size-control-lg p-0 [&_svg]:size-4',\n 'icon-xl': 'size-control-xl p-0 [&_svg]:size-5',\n 'icon-2xl': 'size-control-2xl p-0 [&_svg]:size-6',\n },\n /** Opt in to a stable touch target on devices with any coarse pointer. */\n touchTarget: {\n comfortable: 'touch-target-comfortable',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n }\n)\n\ntype ButtonVariantProps = VariantProps<typeof buttonVariants>\n\nexport type ButtonProps<T extends ValidComponent = 'button'> = PolymorphicProps<\n T,\n ButtonVariantProps & {\n class?: string\n }\n>\n\nexport function Button<T extends ValidComponent = 'button'>(props: ButtonProps<T>) {\n const [local, rest] = splitProps(props as ButtonProps & { as?: ValidComponent }, [\n 'as',\n 'variant',\n 'size',\n 'touchTarget',\n 'class',\n ])\n const className = () =>\n cn(\n buttonVariants({\n variant: local.variant,\n size: local.size,\n touchTarget: local.touchTarget,\n }),\n local.class\n )\n\n // A native button, the common case, is written directly: Polymorphic goes\n // through Dynamic, two prop proxies and a memo per button. It is built with\n // createElement and spread, which is what the compiled JSX would do, so the\n // module holds no template: `buttonVariants` stays importable in plain Node\n // (a server renderer reads the class contract from this entry). A server\n // render has no document, so it takes the Polymorphic path.\n const native = () => {\n const element = document.createElement('button')\n spread(\n element,\n mergeProps({ type: 'button', 'data-slot': 'button' }, rest as ComponentProps<'button'>, {\n get class() {\n return className()\n },\n }),\n false,\n false\n )\n return element\n }\n return (\n <Show\n when={!isServer && (local.as === undefined || local.as === 'button')}\n fallback={\n <Polymorphic\n as={local.as ?? 'button'}\n type=\"button\"\n data-slot=\"button\"\n class={className()}\n {...(rest as ComponentProps<'button'>)}\n />\n }\n >\n {native()}\n </Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAsBA,IAAaU,iBAAiBJ,IAC5B,GAAGC,mBAAkB,sJACrB;CACEI,UAAU;EACRC,SAAS;;GAEPC,SAAS;GACTC,WAAW;;GAEXC,aACE;;GAEFC,SACE;;GAEFC,OAAO;;;;;;;;;GASPC,SACE;;GAEFC,QAAQ;GACRC,SAAS;GACTC,MAAM;EACR;EACAC,MAAM;GACJ,OAAO,GAAGd,YAAY,OAAM;GAC5Be,IAAI,GAAGf,YAAYe,GAAE;GACrBC,IAAI,GAAGhB,YAAYgB,GAAE;GACrBC,IAAI,GAAGjB,YAAYiB,GAAE;GACrBC,IAAI,GAAGlB,YAAYkB,GAAE;GACrBC,IAAI,GAAGnB,YAAYmB,GAAE;GACrB,OAAO,GAAGnB,YAAY,OAAM;GAK5B,YAAY;GACZ,WAAW;GACX,WAAW;GACX,WAAW;GACX,WAAW;GACX,WAAW;GACX,YAAY;EACd;;EAEAoB,aAAa,EACXC,aAAa,2BACf;CACF;CACAC,iBAAiB;EACflB,SAAS;EACTU,MAAM;CACR;AACF,CACF;AAWA,SAAgBU,OAA4CC,OAAuB;CACjF,MAAM,CAACC,OAAOC,QAAQhC,WAAW8B,OAAgD;EAC/E;EACA;EACA;EACA;EACA;CAAO,CACR;CACD,MAAMI,kBACJ5B,GACEC,eAAe;EACbE,SAASsB,MAAMtB;EACfU,MAAMY,MAAMZ;EACZM,aAAaM,MAAMN;CACrB,CAAC,GACDM,MAAMH,KACR;CAQF,MAAMO,eAAe;EACnB,MAAMC,UAAUC,SAASC,cAAc,QAAQ;EAC/CpC,OACEkC,SACAtC,aAAW;GAAEyC,MAAM;GAAU,aAAa;EAAS,GAAGP,MAAkC,EACtF,IAAIJ,QAAQ;GACV,OAAOM,UAAU;EACnB,EACF,CAAC,GACD,OACA,KACF;EACA,OAAOE;CACT;CACA,OAAAI,gBACGzC,MAAI;EAAA,IACH0C,OAAI;GAAA,OAAE,CAACxC,aAAa8B,MAAME,OAAOS,KAAAA,KAAaX,MAAME,OAAO;EAAS;EAAA,IACpEU,WAAQ;GAAA,OAAAH,gBACL3C,aAAW+C,WAAA;IAAA,IACVX,KAAE;KAAA,OAAEF,MAAME,MAAM;IAAQ;IACxBM,MAAI;IAAA,aAAA;IAAA,KAAA,WAAA;KAAA,OAEGL,UAAU;IAAC;GAAA,GACbF,IAAgC,CAAA;EAAA;EAAA,IAAAa,WAAA;GAAA,OAIxCV,OAAO;EAAC;CAAA,CAAA;AAGf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/calendar/calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,cAAc,EAAE,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AAC3F,OAAO,QAAQ,EAAE,EACf,KAAK,SAAS,IAAI,kBAAkB,EACpC,KAAK,eAAe,EACrB,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/calendar/calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,cAAc,EAAE,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AAC3F,OAAO,QAAQ,EAAE,EACf,KAAK,SAAS,IAAI,kBAAkB,EACpC,KAAK,eAAe,EACrB,MAAM,iBAAiB,CAAA;AAOxB,wDAAwD;AACxD,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAA;AAK1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH;;;;GAIG;AACH,KAAK,cAAc,GAAG;IACpB,iFAAiF;IACjF,aAAa,CAAC,EAAE,SA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from "../button/button.js";
|
|
3
4
|
import { className, createComponent, effect, insert, mergeProps, template } from "solid-js/web";
|
|
@@ -14,6 +15,8 @@ var _tmpl$6 = /*#__PURE__*/ template(`<span class=visually-hidden>`);
|
|
|
14
15
|
var _tmpl$7 = /*#__PURE__*/ template(`<div>`);
|
|
15
16
|
var _tmpl$8 = /*#__PURE__*/ template(`<p class="text-xs font-semibold text-foreground">`);
|
|
16
17
|
var _tmpl$9 = /*#__PURE__*/ template(`<div class="flex justify-end gap-2">`);
|
|
18
|
+
var ChevronLeft$1 = fastIcon(ChevronLeft);
|
|
19
|
+
var ChevronRight$1 = fastIcon(ChevronRight);
|
|
17
20
|
var EXTRAS = [
|
|
18
21
|
"weekdayLabels",
|
|
19
22
|
"previousLabel",
|
|
@@ -60,7 +63,7 @@ function CalendarGrid(props) {
|
|
|
60
63
|
return props.previousLabel;
|
|
61
64
|
},
|
|
62
65
|
get children() {
|
|
63
|
-
return createComponent(ChevronLeft, { "aria-hidden": "true" });
|
|
66
|
+
return createComponent(ChevronLeft$1, { "aria-hidden": "true" });
|
|
64
67
|
}
|
|
65
68
|
}), null);
|
|
66
69
|
insert(_el$2, createComponent(Calendar.Label, {
|
|
@@ -81,7 +84,7 @@ function CalendarGrid(props) {
|
|
|
81
84
|
return props.nextLabel;
|
|
82
85
|
},
|
|
83
86
|
get children() {
|
|
84
|
-
return createComponent(ChevronRight, { "aria-hidden": "true" });
|
|
87
|
+
return createComponent(ChevronRight$1, { "aria-hidden": "true" });
|
|
85
88
|
}
|
|
86
89
|
}), null);
|
|
87
90
|
insert(_el$, createComponent(Calendar.Table, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.js","names":["createMemo","For","Show","splitProps","Calendar","ChevronLeft","ChevronRight","cn","Button","weekdayLabels","previousLabel","nextLabel","formatMonth","month","Date","class","EXTRAS","MONTH_FORMAT","Intl","year","defaultWeekdays","format","DateTimeFormat","undefined","weekday","Array","from","length","_","index","CalendarGrid","props","context","useContext","_$createComponent","each","months","children","weekdays","dayFormatter","day","monthLabel","date","_el$","_tmpl$3","_el$2","firstChild","_$insert","Nav","action","as","variant","size","Label","Table","_el$3","_tmpl$","_el$4","label","HeadCell","scope","_el$5","_tmpl$2","weeks","week","_el$6","_tmpl$4","Cell","CellTrigger","_el$7","_tmpl$5","getDate","_el$8","_tmpl$6","CalendarSurface","mode","local","rest","_el$9","_tmpl$7","_$mergeProps","_$effect","_$className","footer","DatePicker","_el$0","when","labelSlot","_el$1","_tmpl$8","value","onValueChange","footerSlot","_el$10","_tmpl$9"],"sources":["../../../../src/components/ui/calendar/calendar.tsx"],"sourcesContent":["import { createMemo, For, Show, splitProps, type ComponentProps, type JSX } from 'solid-js'\nimport Calendar, {\n type RootProps as CorvuCalendarProps,\n type RootSingleProps,\n} from '@corvu/calendar'\n\n/** The three modes corvu's calendar is a union over. */\nexport type CalendarMode = 'single' | 'multiple' | 'range'\nimport { ChevronLeft, ChevronRight } from 'lucide-solid'\nimport { cn } from '#lib/utils'\nimport { Button } from '../button'\n\n/**\n * Calendar.\n *\n * A month grid, over `@corvu/calendar`. The primitive owns the hard part — the\n * roving `tabindex` that makes a grid of days one tab stop rather than 42, the\n * arrow-key navigation, the `aria-selected`/`aria-disabled` bookkeeping, and the\n * `data-*` attributes that carry the states.\n *\n * What this component owns is the *presentation* of those states, and it is worth\n * saying why they are styled from `data-*` rather than from props: a day is today,\n * selected, in range, at a range end, and disabled independently, and a range\n * start that is also today has to read as both. Boolean props cannot express that\n * without a combinatorial explosion; the data attributes can.\n *\n * `mode` is the primitive's discriminated union — `single`, `multiple`, `range` —\n * so `value` and `onValueChange` change type with it. That is why this forwards\n * the props rather than normalising them: a normalised `Date[]` would lose what a\n * range needs to know which end moved.\n *\n * Three things the primitive leaves open, and this closes:\n *\n * 1. **The month caption is a heading**, wired to the grid's `aria-labelledby`, so\n * the grid has a name and a screen reader user can hear which month they are in.\n * 2. **The nav buttons have accessible names.** A bare chevron is not a name.\n * 3. **Today is a ring, not a fill.** A fill would be indistinguishable from\n * selected, and today is often also selected.\n *\n * The sub-components come off the default export as statics (`Calendar.Cell`,\n * `Calendar.CellTrigger`, …) — corvu's shape, and the reason this file does not\n * import seven names.\n */\n\n/**\n * The props this wrapper adds on top of the primitive's own. They are separate so\n * `splitProps` has a fixed list to pull out, and so the mode-specific props stay\n * the primitive's to define.\n */\ntype CalendarExtras = {\n /** Weekday header labels, Sunday first. Defaults to the locale's short names. */\n weekdayLabels?: readonly string[]\n /** Accessible names for the month navigation. Override for a non-English app. */\n previousLabel?: string\n nextLabel?: string\n /** Format a month for the caption. Defaults to `Intl.DateTimeFormat`. */\n formatMonth?: (month: Date) => string\n class?: string\n}\n\n/**\n * `Omit` distributes over a union, which would collapse the three modes into one\n * shape and lose the discriminant. This keeps them apart. `children` is dropped\n * because the surface supplies the grid itself — the caller's job is the value,\n * not the layout.\n */\ntype DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never\n\n/** The props of any of the three modes. `mode` decides the shape of `value`. */\nexport type CalendarProps = DistributiveOmit<CorvuCalendarProps, 'children'> & CalendarExtras\n\nconst EXTRAS = ['weekdayLabels', 'previousLabel', 'nextLabel', 'formatMonth', 'class'] as const\n\nconst MONTH_FORMAT: Intl.DateTimeFormatOptions = { month: 'long', year: 'numeric' }\n\n/** The locale's short weekday names, Sunday first — which is the order corvu's `weeks` use. */\nfunction defaultWeekdays(): string[] {\n const format = new Intl.DateTimeFormat(undefined, { weekday: 'short' })\n // 2024-01-07 is a Sunday, so index 0 is Sunday without arithmetic.\n return Array.from({ length: 7 }, (_, index) => format.format(new Date(2024, 0, 7 + index)))\n}\n\n/**\n * The grid, inside the root's context. A separate component because\n * `Calendar.useContext` is only available to a descendant, and reading `months()`\n * in the same component that provides it renders one month behind.\n */\nfunction CalendarGrid(props: {\n weekdayLabels?: readonly string[]\n previousLabel: string\n nextLabel: string\n formatMonth?: (month: Date) => string\n}) {\n const context = Calendar.useContext()\n return (\n <For each={context.months()}>\n {(month, index) => {\n const weekdays = createMemo(() => props.weekdayLabels ?? defaultWeekdays())\n // Recreate per month so navigation picks up changed locale and time-zone defaults.\n const dayFormatter = new Intl.DateTimeFormat(undefined, {\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n })\n const monthLabel = (date: Date) =>\n props.formatMonth\n ? props.formatMonth(date)\n : new Intl.DateTimeFormat(undefined, MONTH_FORMAT).format(date)\n return (\n <div class=\"flex flex-col gap-2\">\n <div class=\"flex items-center justify-between gap-2\">\n <Calendar.Nav\n action=\"prev-month\"\n as={Button}\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={props.previousLabel}\n >\n <ChevronLeft aria-hidden=\"true\" />\n </Calendar.Nav>\n <Calendar.Label index={index()} class=\"text-sm font-semibold text-foreground\">\n {monthLabel(month.month)}\n </Calendar.Label>\n <Calendar.Nav\n action=\"next-month\"\n as={Button}\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={props.nextLabel}\n >\n <ChevronRight aria-hidden=\"true\" />\n </Calendar.Nav>\n </div>\n <Calendar.Table class=\"w-full border-collapse\">\n <thead>\n <tr>\n <For each={weekdays()}>\n {(label) => (\n <Calendar.HeadCell\n as=\"th\"\n scope=\"col\"\n class=\"pb-1 text-2xs font-medium text-muted-foreground\"\n >\n {label}\n </Calendar.HeadCell>\n )}\n </For>\n </tr>\n </thead>\n <tbody>\n <For each={month.weeks}>\n {(week) => (\n <tr>\n <For each={week}>\n {(day) => (\n <Calendar.Cell as=\"td\" class=\"p-0.5 text-center\">\n <Calendar.CellTrigger\n as=\"button\"\n day={day}\n month={month.month}\n class={cn(\n 'w-full rounded-md text-xs text-foreground transition-colors',\n 'min-h-control-xs',\n 'hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none',\n // Styled from data states, so a day can be a range\n // end and today at once without a prop per pair.\n 'data-selected:bg-primary data-selected:text-primary-foreground',\n // corvu marks every day of a range selected, so the\n // span between the ends steps back to the subtle\n // fill and the ends take the solid one again.\n 'data-in-range:bg-primary-subtle data-in-range:text-foreground',\n 'data-range-start:bg-primary data-range-start:text-primary-foreground',\n 'data-range-end:bg-primary data-range-end:text-primary-foreground',\n 'data-range-start:rounded-r-none data-range-end:rounded-l-none',\n 'data-today:ring-1 data-today:ring-ring',\n 'data-disabled:text-muted-foreground data-disabled:line-through',\n 'data-disabled:hover:bg-transparent'\n )}\n >\n {/*\n The trigger renders no children of its own, so the\n day number is the caller's — without it every cell\n is an unnamed button (`button-name`).\n\n The number is what a sighted reader needs and the\n full date is what a screen reader user needs: \"25\"\n alone is meaningless out of context. So the number\n is hidden from the accessibility tree and the date\n supplies the name.\n */}\n <span aria-hidden=\"true\">{day.getDate()}</span>\n <span class=\"visually-hidden\">{dayFormatter.format(day)}</span>\n </Calendar.CellTrigger>\n </Calendar.Cell>\n )}\n </For>\n </tr>\n )}\n </For>\n </tbody>\n </Calendar.Table>\n </div>\n )\n }}\n </For>\n )\n}\n\n/**\n * Generic over the mode on purpose. `splitProps` cannot carry a discriminant\n * through destructuring — the rest object widens to `mode: 'single' | 'multiple' |\n * 'range'`, which is assignable to no single member of the primitive's union. A\n * type parameter keeps `mode` a literal, so `Extract` resolves the right member\n * and the forwarding stays checked rather than cast.\n */\nexport function CalendarSurface<M extends CalendarMode>(props: CalendarProps & { mode: M }) {\n const [local, rest] = splitProps(props as CalendarProps, [...EXTRAS])\n\n return (\n <div class={cn('w-fit rounded-lg border border-border bg-card p-3', local.class)}>\n <Calendar {...(rest as Extract<CorvuCalendarProps, { mode: M }>)}>\n <CalendarGrid\n weekdayLabels={local.weekdayLabels}\n previousLabel={local.previousLabel ?? 'Previous month'}\n nextLabel={local.nextLabel ?? 'Next month'}\n formatMonth={local.formatMonth}\n />\n </Calendar>\n </div>\n )\n}\n\n/**\n * Built from the primitive's *single* props rather than from `CalendarProps` with\n * `mode` omitted. Omitting a discriminant leaves the other members of the union\n * behind — `value` stays `Date | Date[] | {from,to}` — and the picker would then\n * have to cast to prove what its own name already says.\n */\nexport type DatePickerProps = Omit<RootSingleProps, 'mode' | 'children'> &\n CalendarExtras & {\n /** A labelled heading above the grid. */\n label?: string\n /** A footer slot: the confirm and cancel row a picker usually has. */\n footer?: JSX.Element\n }\n\n/**\n * A single-day picker: the calendar with a name and a footer. Split from\n * `CalendarSurface` because a bare calendar is a control inside a form the caller\n * already owns, while a picker is a thing the caller drops in — and the two want\n * different surroundings.\n */\nexport function DatePicker(props: DatePickerProps) {\n const [local, rest] = splitProps(props, ['value', 'onValueChange', 'label', 'footer', 'class'])\n\n return (\n <div class={cn('grid w-fit gap-2', local.class)}>\n <Show when={local.label}>\n {(labelSlot) => <p class=\"text-xs font-semibold text-foreground\">{labelSlot()}</p>}\n </Show>\n <CalendarSurface\n {...rest}\n mode=\"single\"\n value={local.value}\n onValueChange={local.onValueChange}\n />\n <Show when={local.footer}>\n {(footerSlot) => <div class=\"flex justify-end gap-2\">{footerSlot()}</div>}\n </Show>\n </div>\n )\n}\n\n/** Re-exported so a caller can type a value it holds. */\nexport type { CalendarProps as CorvuCalendarProps }\nexport { Calendar as CalendarRoot }\nexport type CalendarElementProps = ComponentProps<'div'>\n"],"mappings":";;;;;;;;;;;;;;;;AAuEA,IAAMgB,SAAS;CAAC;CAAiB;CAAiB;CAAa;CAAe;AAAO;AAErF,IAAMC,eAA2C;CAAEJ,OAAO;CAAQM,MAAM;AAAU;;AAGlF,SAASC,kBAA4B;CACnC,MAAMC,SAAS,IAAIH,KAAKI,eAAeC,KAAAA,GAAW,EAAEC,SAAS,QAAQ,CAAC;CAEtE,OAAOC,MAAMC,KAAK,EAAEC,QAAQ,EAAE,IAAIC,GAAGC,UAAUR,OAAOA,OAAO,IAAIP,KAAK,MAAM,GAAG,IAAIe,KAAK,CAAC,CAAC;AAC5F;;;;;;AAOA,SAASC,aAAaC,OAKnB;CACD,MAAMC,UAAU5B,SAAS6B,WAAW;CACpC,OAAAC,gBACGjC,KAAG;EAAA,IAACkC,OAAI;GAAA,OAAEH,QAAQI,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;IAAA,OAAEf,MAAMe;GAAa;EAAA,CAAA,CAAA,GAAA,IAAA;EAAA5C,OAAAsC,OAAAnD,gBAEnChC,MAAI;GAAA,IAACoF,OAAI;IAAA,OAAEV,MAAMO;GAAM;GAAA9C,WACpBuD,sBAAU;IAAA,IAAAC,SAAAC,QAAA;IAAA/C,OAAA8C,QAA0CD,UAAU;IAAA,OAAAC;GAAA,EAAA,CAAA;EAAS,CAAA,GAAA,IAAA;EAAAZ,aAAAC,UAAAG,OAXjE9E,GAAG,oBAAoBqE,MAAM7D,KAAK,CAAC,CAAA;EAAA,OAAAsE;CAAA,EAAA,CAAA;AAenD"}
|
|
1
|
+
{"version":3,"file":"calendar.js","names":["createMemo","For","Show","splitProps","Calendar","fastIcon","ChevronLeft","LucideChevronLeft","ChevronRight","LucideChevronRight","cn","Button","weekdayLabels","previousLabel","nextLabel","formatMonth","month","Date","class","EXTRAS","MONTH_FORMAT","Intl","year","defaultWeekdays","format","DateTimeFormat","undefined","weekday","Array","from","length","_","index","CalendarGrid","props","context","useContext","_$createComponent","each","months","children","weekdays","dayFormatter","day","monthLabel","date","_el$","_tmpl$3","_el$2","firstChild","_$insert","Nav","action","as","variant","size","Label","Table","_el$3","_tmpl$","_el$4","label","HeadCell","scope","_el$5","_tmpl$2","weeks","week","_el$6","_tmpl$4","Cell","CellTrigger","_el$7","_tmpl$5","getDate","_el$8","_tmpl$6","CalendarSurface","mode","local","rest","_el$9","_tmpl$7","_$mergeProps","_$effect","_$className","footer","DatePicker","_el$0","when","labelSlot","_el$1","_tmpl$8","value","onValueChange","footerSlot","_el$10","_tmpl$9"],"sources":["../../../../src/components/ui/calendar/calendar.tsx"],"sourcesContent":["import { createMemo, For, Show, splitProps, type ComponentProps, type JSX } from 'solid-js'\nimport Calendar, {\n type RootProps as CorvuCalendarProps,\n type RootSingleProps,\n} from '@corvu/calendar'\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)\n\n/** The three modes corvu's calendar is a union over. */\nexport type CalendarMode = 'single' | 'multiple' | 'range'\nimport { ChevronLeft as LucideChevronLeft, ChevronRight as LucideChevronRight } from 'lucide-solid'\nimport { cn } from '#lib/utils'\nimport { Button } from '../button'\n\n/**\n * Calendar.\n *\n * A month grid, over `@corvu/calendar`. The primitive owns the hard part — the\n * roving `tabindex` that makes a grid of days one tab stop rather than 42, the\n * arrow-key navigation, the `aria-selected`/`aria-disabled` bookkeeping, and the\n * `data-*` attributes that carry the states.\n *\n * What this component owns is the *presentation* of those states, and it is worth\n * saying why they are styled from `data-*` rather than from props: a day is today,\n * selected, in range, at a range end, and disabled independently, and a range\n * start that is also today has to read as both. Boolean props cannot express that\n * without a combinatorial explosion; the data attributes can.\n *\n * `mode` is the primitive's discriminated union — `single`, `multiple`, `range` —\n * so `value` and `onValueChange` change type with it. That is why this forwards\n * the props rather than normalising them: a normalised `Date[]` would lose what a\n * range needs to know which end moved.\n *\n * Three things the primitive leaves open, and this closes:\n *\n * 1. **The month caption is a heading**, wired to the grid's `aria-labelledby`, so\n * the grid has a name and a screen reader user can hear which month they are in.\n * 2. **The nav buttons have accessible names.** A bare chevron is not a name.\n * 3. **Today is a ring, not a fill.** A fill would be indistinguishable from\n * selected, and today is often also selected.\n *\n * The sub-components come off the default export as statics (`Calendar.Cell`,\n * `Calendar.CellTrigger`, …) — corvu's shape, and the reason this file does not\n * import seven names.\n */\n\n/**\n * The props this wrapper adds on top of the primitive's own. They are separate so\n * `splitProps` has a fixed list to pull out, and so the mode-specific props stay\n * the primitive's to define.\n */\ntype CalendarExtras = {\n /** Weekday header labels, Sunday first. Defaults to the locale's short names. */\n weekdayLabels?: readonly string[]\n /** Accessible names for the month navigation. Override for a non-English app. */\n previousLabel?: string\n nextLabel?: string\n /** Format a month for the caption. Defaults to `Intl.DateTimeFormat`. */\n formatMonth?: (month: Date) => string\n class?: string\n}\n\n/**\n * `Omit` distributes over a union, which would collapse the three modes into one\n * shape and lose the discriminant. This keeps them apart. `children` is dropped\n * because the surface supplies the grid itself — the caller's job is the value,\n * not the layout.\n */\ntype DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never\n\n/** The props of any of the three modes. `mode` decides the shape of `value`. */\nexport type CalendarProps = DistributiveOmit<CorvuCalendarProps, 'children'> & CalendarExtras\n\nconst EXTRAS = ['weekdayLabels', 'previousLabel', 'nextLabel', 'formatMonth', 'class'] as const\n\nconst MONTH_FORMAT: Intl.DateTimeFormatOptions = { month: 'long', year: 'numeric' }\n\n/** The locale's short weekday names, Sunday first — which is the order corvu's `weeks` use. */\nfunction defaultWeekdays(): string[] {\n const format = new Intl.DateTimeFormat(undefined, { weekday: 'short' })\n // 2024-01-07 is a Sunday, so index 0 is Sunday without arithmetic.\n return Array.from({ length: 7 }, (_, index) => format.format(new Date(2024, 0, 7 + index)))\n}\n\n/**\n * The grid, inside the root's context. A separate component because\n * `Calendar.useContext` is only available to a descendant, and reading `months()`\n * in the same component that provides it renders one month behind.\n */\nfunction CalendarGrid(props: {\n weekdayLabels?: readonly string[]\n previousLabel: string\n nextLabel: string\n formatMonth?: (month: Date) => string\n}) {\n const context = Calendar.useContext()\n return (\n <For each={context.months()}>\n {(month, index) => {\n const weekdays = createMemo(() => props.weekdayLabels ?? defaultWeekdays())\n // Recreate per month so navigation picks up changed locale and time-zone defaults.\n const dayFormatter = new Intl.DateTimeFormat(undefined, {\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n })\n const monthLabel = (date: Date) =>\n props.formatMonth\n ? props.formatMonth(date)\n : new Intl.DateTimeFormat(undefined, MONTH_FORMAT).format(date)\n return (\n <div class=\"flex flex-col gap-2\">\n <div class=\"flex items-center justify-between gap-2\">\n <Calendar.Nav\n action=\"prev-month\"\n as={Button}\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={props.previousLabel}\n >\n <ChevronLeft aria-hidden=\"true\" />\n </Calendar.Nav>\n <Calendar.Label index={index()} class=\"text-sm font-semibold text-foreground\">\n {monthLabel(month.month)}\n </Calendar.Label>\n <Calendar.Nav\n action=\"next-month\"\n as={Button}\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={props.nextLabel}\n >\n <ChevronRight aria-hidden=\"true\" />\n </Calendar.Nav>\n </div>\n <Calendar.Table class=\"w-full border-collapse\">\n <thead>\n <tr>\n <For each={weekdays()}>\n {(label) => (\n <Calendar.HeadCell\n as=\"th\"\n scope=\"col\"\n class=\"pb-1 text-2xs font-medium text-muted-foreground\"\n >\n {label}\n </Calendar.HeadCell>\n )}\n </For>\n </tr>\n </thead>\n <tbody>\n <For each={month.weeks}>\n {(week) => (\n <tr>\n <For each={week}>\n {(day) => (\n <Calendar.Cell as=\"td\" class=\"p-0.5 text-center\">\n <Calendar.CellTrigger\n as=\"button\"\n day={day}\n month={month.month}\n class={cn(\n 'w-full rounded-md text-xs text-foreground transition-colors',\n 'min-h-control-xs',\n 'hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none',\n // Styled from data states, so a day can be a range\n // end and today at once without a prop per pair.\n 'data-selected:bg-primary data-selected:text-primary-foreground',\n // corvu marks every day of a range selected, so the\n // span between the ends steps back to the subtle\n // fill and the ends take the solid one again.\n 'data-in-range:bg-primary-subtle data-in-range:text-foreground',\n 'data-range-start:bg-primary data-range-start:text-primary-foreground',\n 'data-range-end:bg-primary data-range-end:text-primary-foreground',\n 'data-range-start:rounded-r-none data-range-end:rounded-l-none',\n 'data-today:ring-1 data-today:ring-ring',\n 'data-disabled:text-muted-foreground data-disabled:line-through',\n 'data-disabled:hover:bg-transparent'\n )}\n >\n {/*\n The trigger renders no children of its own, so the\n day number is the caller's — without it every cell\n is an unnamed button (`button-name`).\n\n The number is what a sighted reader needs and the\n full date is what a screen reader user needs: \"25\"\n alone is meaningless out of context. So the number\n is hidden from the accessibility tree and the date\n supplies the name.\n */}\n <span aria-hidden=\"true\">{day.getDate()}</span>\n <span class=\"visually-hidden\">{dayFormatter.format(day)}</span>\n </Calendar.CellTrigger>\n </Calendar.Cell>\n )}\n </For>\n </tr>\n )}\n </For>\n </tbody>\n </Calendar.Table>\n </div>\n )\n }}\n </For>\n )\n}\n\n/**\n * Generic over the mode on purpose. `splitProps` cannot carry a discriminant\n * through destructuring — the rest object widens to `mode: 'single' | 'multiple' |\n * 'range'`, which is assignable to no single member of the primitive's union. A\n * type parameter keeps `mode` a literal, so `Extract` resolves the right member\n * and the forwarding stays checked rather than cast.\n */\nexport function CalendarSurface<M extends CalendarMode>(props: CalendarProps & { mode: M }) {\n const [local, rest] = splitProps(props as CalendarProps, [...EXTRAS])\n\n return (\n <div class={cn('w-fit rounded-lg border border-border bg-card p-3', local.class)}>\n <Calendar {...(rest as Extract<CorvuCalendarProps, { mode: M }>)}>\n <CalendarGrid\n weekdayLabels={local.weekdayLabels}\n previousLabel={local.previousLabel ?? 'Previous month'}\n nextLabel={local.nextLabel ?? 'Next month'}\n formatMonth={local.formatMonth}\n />\n </Calendar>\n </div>\n )\n}\n\n/**\n * Built from the primitive's *single* props rather than from `CalendarProps` with\n * `mode` omitted. Omitting a discriminant leaves the other members of the union\n * behind — `value` stays `Date | Date[] | {from,to}` — and the picker would then\n * have to cast to prove what its own name already says.\n */\nexport type DatePickerProps = Omit<RootSingleProps, 'mode' | 'children'> &\n CalendarExtras & {\n /** A labelled heading above the grid. */\n label?: string\n /** A footer slot: the confirm and cancel row a picker usually has. */\n footer?: JSX.Element\n }\n\n/**\n * A single-day picker: the calendar with a name and a footer. Split from\n * `CalendarSurface` because a bare calendar is a control inside a form the caller\n * already owns, while a picker is a thing the caller drops in — and the two want\n * different surroundings.\n */\nexport function DatePicker(props: DatePickerProps) {\n const [local, rest] = splitProps(props, ['value', 'onValueChange', 'label', 'footer', 'class'])\n\n return (\n <div class={cn('grid w-fit gap-2', local.class)}>\n <Show when={local.label}>\n {(labelSlot) => <p class=\"text-xs font-semibold text-foreground\">{labelSlot()}</p>}\n </Show>\n <CalendarSurface\n {...rest}\n mode=\"single\"\n value={local.value}\n onValueChange={local.onValueChange}\n />\n <Show when={local.footer}>\n {(footerSlot) => <div class=\"flex justify-end gap-2\">{footerSlot()}</div>}\n </Show>\n </div>\n )\n}\n\n/** Re-exported so a caller can type a value it holds. */\nexport type { CalendarProps as CorvuCalendarProps }\nexport { Calendar as CalendarRoot }\nexport type CalendarElementProps = ComponentProps<'div'>\n"],"mappings":";;;;;;;;;;;;;;;;;AAQA,IAAMM,gBAAcD,SAASE,WAAiB;AAC9C,IAAMC,iBAAeH,SAASI,YAAkB;AAmEhD,IAAMU,SAAS;CAAC;CAAiB;CAAiB;CAAa;CAAe;AAAO;AAErF,IAAMC,eAA2C;CAAEJ,OAAO;CAAQM,MAAM;AAAU;;AAGlF,SAASC,kBAA4B;CACnC,MAAMC,SAAS,IAAIH,KAAKI,eAAeC,KAAAA,GAAW,EAAEC,SAAS,QAAQ,CAAC;CAEtE,OAAOC,MAAMC,KAAK,EAAEC,QAAQ,EAAE,IAAIC,GAAGC,UAAUR,OAAOA,OAAO,IAAIP,KAAK,MAAM,GAAG,IAAIe,KAAK,CAAC,CAAC;AAC5F;;;;;;AAOA,SAASC,aAAaC,OAKnB;CACD,MAAMC,UAAU/B,SAASgC,WAAW;CACpC,OAAAC,gBACGpC,KAAG;EAAA,IAACqC,OAAI;GAAA,OAAEH,QAAQI,OAAO;EAAC;EAAAC,WACvBxB,OAAOgB,UAAU;GACjB,MAAMS,WAAWzC,iBAAiBkC,MAAMtB,iBAAiBW,gBAAgB,CAAC;GAE1E,MAAMmB,eAAe,IAAIrB,KAAKI,eAAeC,KAAAA,GAAW;IACtDiB,KAAK;IACL3B,OAAO;IACPM,MAAM;GACR,CAAC;GACD,MAAMsB,cAAcC,SAClBX,MAAMnB,cACFmB,MAAMnB,YAAY8B,IAAI,IACtB,IAAIxB,KAAKI,eAAeC,KAAAA,GAAWN,YAAY,CAAC,CAACI,OAAOqB,IAAI;GAClE,cAAA;I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E;CAAA,EAAA,CAAA;AAenD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/carousel/carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgE,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AAEjG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/carousel/carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgE,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AAEjG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAUvD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,MAAM,MAAM,WAAW,GAAG,iBAAiB,CAAA;AAE3C,MAAM,MAAM,aAAa,GAAG;IAC1B,8EAA8E;IAC9E,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAA;IACrB,yEAAyE;IACzE,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;IACvC,2CAA2C;IAC3C,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;IAClC,mFAAmF;IACnF,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,uCAAuC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,mFAAmF;IACnF,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,gEAAgE;IAChE,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IACpC,mEAAmE;IACnE,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,IAAI,CAAA;IAClC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,eAiI5C;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE;IACnC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAA;IACrB,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,eAWA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { cn } from "../../../lib/utils.js";
|
|
2
2
|
import { Button } from "../button/button.js";
|
|
3
|
+
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
3
4
|
import { className, createComponent, delegateEvents, effect, insert, mergeProps, setAttribute, setStyleProperty, spread, template, use } from "solid-js/web";
|
|
4
5
|
import { ChevronLeft, ChevronRight } from "lucide-solid";
|
|
5
6
|
import { For, Show, createEffect, createSignal, onCleanup, splitProps } from "solid-js";
|
|
@@ -10,6 +11,8 @@ var _tmpl$2 = /*#__PURE__*/ template(`<div class="flex items-center justify-cent
|
|
|
10
11
|
var _tmpl$3 = /*#__PURE__*/ template(`<div role=group aria-roledescription=carousel><div tabindex=0 aria-label=Carousel><div>`);
|
|
11
12
|
var _tmpl$4 = /*#__PURE__*/ template(`<button type=button>`);
|
|
12
13
|
var _tmpl$5 = /*#__PURE__*/ template(`<div role=group aria-roledescription=slide>`);
|
|
14
|
+
var ChevronLeft$1 = fastIcon(ChevronLeft);
|
|
15
|
+
var ChevronRight$1 = fastIcon(ChevronRight);
|
|
13
16
|
function Carousel(props) {
|
|
14
17
|
const [local, rest] = splitProps(props, [
|
|
15
18
|
"children",
|
|
@@ -50,15 +53,18 @@ function Carousel(props) {
|
|
|
50
53
|
setCanPrev(api.canScrollPrev());
|
|
51
54
|
setCanNext(api.canScrollNext());
|
|
52
55
|
};
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
const remeasure = () => {
|
|
57
|
+
setCount(api.scrollSnapList().length);
|
|
58
|
+
sync();
|
|
59
|
+
};
|
|
60
|
+
remeasure();
|
|
55
61
|
api.on("select", sync);
|
|
56
62
|
api.on("scroll", sync);
|
|
57
|
-
api.on("reInit",
|
|
63
|
+
api.on("reInit", remeasure);
|
|
58
64
|
onCleanup(() => {
|
|
59
65
|
api.off("select", sync);
|
|
60
66
|
api.off("scroll", sync);
|
|
61
|
-
api.off("reInit",
|
|
67
|
+
api.off("reInit", remeasure);
|
|
62
68
|
});
|
|
63
69
|
});
|
|
64
70
|
return (() => {
|
|
@@ -85,7 +91,7 @@ function Carousel(props) {
|
|
|
85
91
|
},
|
|
86
92
|
onClick: () => embla()?.scrollPrev(),
|
|
87
93
|
get children() {
|
|
88
|
-
return createComponent(ChevronLeft, {
|
|
94
|
+
return createComponent(ChevronLeft$1, {
|
|
89
95
|
"aria-hidden": "true",
|
|
90
96
|
"class": "rotate-0"
|
|
91
97
|
});
|
|
@@ -132,7 +138,7 @@ function Carousel(props) {
|
|
|
132
138
|
},
|
|
133
139
|
onClick: () => embla()?.scrollNext(),
|
|
134
140
|
get children() {
|
|
135
|
-
return createComponent(ChevronRight, { "aria-hidden": "true" });
|
|
141
|
+
return createComponent(ChevronRight$1, { "aria-hidden": "true" });
|
|
136
142
|
}
|
|
137
143
|
}), null);
|
|
138
144
|
return _el$4;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel.js","names":["createEffect","createSignal","For","onCleanup","Show","splitProps","createEmblaCarousel","ChevronLeft","ChevronRight","cn","Button","children","orientation","slidesToShow","align","loop","controls","dots","previousLabel","nextLabel","dotLabel","index","onApi","api","class","Carousel","props","local","rest","emblaRef","embla","axis","slidesToScroll","containScroll","selected","setSelected","count","setCount","canPrev","setCanPrev","canNext","setCanNext","sync","selectedScrollSnap","canScrollPrev","canScrollNext","scrollSnapList","length","on","off","_el$","_tmpl$3","_el$2","firstChild","_el$3","_$spread","_$mergeProps","_$use","_$insert","_$createComponent","when","_el$4","_tmpl$2","variant","size","disabled","onClick","scrollPrev","_el$5","_tmpl$","each","Array","from","_","_el$6","_tmpl$4","$$click","scrollTo","_$effect","_p$","_v$3","_v$4","_v$5","undefined","e","_$className","t","_$setAttribute","a","scrollNext","_v$","_v$2","CarouselSlide","_el$7","_tmpl$5","_v$6","_v$7","_$setStyleProperty","_$delegateEvents"],"sources":["../../../../src/components/ui/carousel/carousel.tsx"],"sourcesContent":["import { createEffect, createSignal, For, onCleanup, Show, splitProps, type JSX } from 'solid-js'\nimport createEmblaCarousel from 'embla-carousel-solid'\nimport type { EmblaCarouselType } from 'embla-carousel'\nimport { ChevronLeft, ChevronRight } from 'lucide-solid'\nimport { cn } from '#lib/utils'\nimport { Button } from '../button'\n\n/**\n * Carousel.\n *\n * A horizontal scroller with snap points, over embla. The primitive owns the\n * physics, momentum, snapping, drag, and this owns the two things a carousel\n * always needs and embla deliberately leaves to the caller: a keyboard path and a\n * way to tell how far along you are.\n *\n * **It is a scroll container, not a slide show.** `slidesToScroll` defaults to 1\n * and the track is keyboard-focusable, so arrow keys move between slides and a\n * slide that contains a link stays reachable. A carousel that hijacks the arrow\n * keys or hides its off-screen slides from the tab order is the standard\n * accessibility failure of this component, and both are avoided here by not\n * disabling anything: the slides stay in the DOM and in the tab order, and the\n * container scrolls.\n *\n * `orientation=\"vertical\"` exists because embla supports it and a vertical\n * carousel is what a short list of cards becomes on a phone. It is a prop rather\n * than a second component because every part, the track, the previous/next\n * buttons, the dots, has the same relationship to the axis.\n *\n * The dot indicators are buttons, not spans: a carousel with twelve slides and a\n * \"go to slide 7\" affordance is the only way to reach the seventh without\n * dragging through six. Each is labelled, because a row of unlabelled dots is a\n * row of identical controls to a screen reader.\n */\n\nexport type CarouselApi = EmblaCarouselType\n\nexport type CarouselProps = {\n /** The slides. Each is wrapped in its own element so embla can measure it. */\n children: JSX.Element\n /** The axis. Vertical is what a card list becomes on a narrow screen. */\n orientation?: 'horizontal' | 'vertical'\n /** How many slides are visible at once. */\n slidesToShow?: number\n /** Align the active slide to the start, centre, or end of the viewport. */\n align?: 'start' | 'center' | 'end'\n /** Whether dragging past the ends loops. Off by default: a loop hides the ends. */\n loop?: boolean\n /** Show the previous/next controls. */\n controls?: boolean\n /** Show the dot indicators. Off by default, a single-slide carousel needs none. */\n dots?: boolean\n /** Accessible names. Override for a non-English application. */\n previousLabel?: string\n nextLabel?: string\n /** The label for a dot, given a zero-based index. */\n dotLabel?: (index: number) => string\n /** Receives the embla API, for a caller that needs to drive it. */\n onApi?: (api: CarouselApi) => void\n class?: string\n}\n\nexport function Carousel(props: CarouselProps) {\n const [local, rest] = splitProps(props, [\n 'children',\n 'orientation',\n 'slidesToShow',\n 'align',\n 'loop',\n 'controls',\n 'dots',\n 'previousLabel',\n 'nextLabel',\n 'dotLabel',\n 'onApi',\n 'class',\n ])\n\n const orientation = () => local.orientation ?? 'horizontal'\n\n // The first element of the tuple is the ref setter, the second the accessor,\n // so `ref={emblaRef}` is the whole wiring.\n const [emblaRef, embla] = createEmblaCarousel(() => ({\n axis: orientation() === 'vertical' ? 'y' : 'x',\n loop: local.loop ?? false,\n align: local.align ?? 'start',\n slidesToScroll: 1,\n containScroll: 'trimSnaps',\n }))\n\n const [selected, setSelected] = createSignal(0)\n const [count, setCount] = createSignal(0)\n const [canPrev, setCanPrev] = createSignal(false)\n const [canNext, setCanNext] = createSignal(false)\n\n /**\n * The scroll event, not the select event alone: `select` fires on a settle, so a\n * drag in progress would leave the dots behind the thumb. `scroll` covers both.\n */\n createEffect(() => {\n const api = embla()\n if (!api) return\n local.onApi?.(api)\n\n const sync = () => {\n setSelected(api.selectedScrollSnap())\n setCanPrev(api.canScrollPrev())\n setCanNext(api.canScrollNext())\n }\n sync()\n setCount(api.scrollSnapList().length)\n\n api.on('select', sync)\n api.on('scroll', sync)\n api.on('reInit', sync)\n onCleanup(() => {\n api.off('select', sync)\n api.off('scroll', sync)\n api.off('reInit', sync)\n })\n })\n\n return (\n <div\n class={cn('group/carousel relative grid gap-2', local.class)}\n role=\"group\"\n aria-roledescription=\"carousel\"\n {...rest}\n >\n <div\n ref={emblaRef}\n // A scroll container has to be reachable by keyboard, the same\n // requirement the code block's scroller meets.\n tabindex=\"0\"\n class={cn(\n 'scroll-fade overflow-hidden rounded-lg focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none'\n )}\n aria-label=\"Carousel\"\n >\n <div class={cn('flex', orientation() === 'vertical' ? 'flex-col' : 'flex-row')}>\n {local.children}\n </div>\n </div>\n\n <Show when={local.controls ?? true}>\n <div class=\"flex items-center justify-center gap-1\">\n <Button\n variant=\"ghost\"\n size=\"icon-sm\"\n disabled={!canPrev()}\n aria-label={local.previousLabel ?? 'Previous slide'}\n onClick={() => embla()?.scrollPrev()}\n >\n <ChevronLeft aria-hidden=\"true\" class=\"rotate-0\" />\n </Button>\n <Show when={local.dots}>\n <div class=\"flex items-center gap-1 px-1\">\n <For each={Array.from({ length: count() })}>\n {(_, index) => (\n <button\n type=\"button\"\n class={cn(\n 'size-1.5 rounded-full bg-muted-foreground/40 transition-colors hover:bg-muted-foreground',\n selected() === index() && 'bg-primary'\n )}\n aria-label={local.dotLabel?.(index()) ?? `Go to slide ${index() + 1}`}\n aria-current={selected() === index() ? 'true' : undefined}\n onClick={() => embla()?.scrollTo(index())}\n />\n )}\n </For>\n </div>\n </Show>\n <Button\n variant=\"ghost\"\n size=\"icon-sm\"\n disabled={!canNext()}\n aria-label={local.nextLabel ?? 'Next slide'}\n onClick={() => embla()?.scrollNext()}\n >\n <ChevronRight aria-hidden=\"true\" />\n </Button>\n </div>\n </Show>\n </div>\n )\n}\n\n/**\n * One slide. `basis` is what makes `slidesToShow` work: embla measures the slide\n * elements, so a slide that is not sized to a fraction of the viewport would show\n * one per screen regardless of the setting.\n */\nexport function CarouselSlide(props: {\n children: JSX.Element\n /** How many slides share the viewport at this slide's widest breakpoint. */\n slidesToShow?: number\n class?: string\n}) {\n return (\n <div\n class={cn('min-w-0 shrink-0 grow-0', props.class)}\n style={{ 'flex-basis': `${100 / (props.slidesToShow ?? 1)}%` }}\n role=\"group\"\n aria-roledescription=\"slide\"\n >\n {props.children}\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;AA6DA,SAAgByB,SAASC,OAAsB;CAC7C,MAAM,CAACC,OAAOC,QAAQvB,WAAWqB,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAO,CACR;CAED,MAAMd,oBAAoBe,MAAMf,eAAe;CAI/C,MAAM,CAACiB,UAAUC,SAASxB,2BAA2B;EACnDyB,MAAMnB,YAAY,MAAM,aAAa,MAAM;EAC3CG,MAAMY,MAAMZ,QAAQ;EACpBD,OAAOa,MAAMb,SAAS;EACtBkB,gBAAgB;EAChBC,eAAe;CACjB,EAAE;CAEF,MAAM,CAACC,UAAUC,eAAelC,aAAa,CAAC;CAC9C,MAAM,CAACmC,OAAOC,YAAYpC,aAAa,CAAC;CACxC,MAAM,CAACqC,SAASC,cAActC,aAAa,KAAK;CAChD,MAAM,CAACuC,SAASC,cAAcxC,aAAa,KAAK;;;;;CAMhDD,mBAAmB;EACjB,MAAMuB,MAAMO,MAAM;EAClB,IAAI,CAACP,KAAK;EACVI,MAAML,QAAQC,GAAG;EAEjB,MAAMmB,aAAa;GACjBP,YAAYZ,IAAIoB,mBAAmB,CAAC;GACpCJ,WAAWhB,IAAIqB,cAAc,CAAC;GAC9BH,WAAWlB,IAAIsB,cAAc,CAAC;EAChC;EACAH,KAAK;EACLL,SAASd,IAAIuB,eAAe,CAAC,CAACC,MAAM;EAEpCxB,IAAIyB,GAAG,UAAUN,IAAI;EACrBnB,IAAIyB,GAAG,UAAUN,IAAI;EACrBnB,IAAIyB,GAAG,UAAUN,IAAI;EACrBvC,gBAAgB;GACdoB,IAAI0B,IAAI,UAAUP,IAAI;GACtBnB,IAAI0B,IAAI,UAAUP,IAAI;GACtBnB,IAAI0B,IAAI,UAAUP,IAAI;EACxB,CAAC;CACH,CAAC;C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,CAAA;AA+CtF;;;;;;AAOA,SAAgB0C,cAAclE,OAK3B;CACD,cAAA;EAAA,IAAAmE,QAAAC,QAAA;EAAApC,OAAAmC,aAOKnE,MAAMf,QAAQ;EAAAmE,QAAAC,QAAA;GAAA,IAAAgB,OALRtF,GAAG,2BAA2BiB,MAAMF,KAAK,GAACwE,OAC1B,GAAG,OAAOtE,MAAMb,gBAAgB,GAAE;GAAGkF,SAAAhB,IAAAK,KAAAC,UAAAQ,OAAAd,IAAAK,IAAAW,IAAA;GAAAC,SAAAjB,IAAAO,KAAAW,iBAAAJ,OAAA,cAAAd,IAAAO,IAAAU,IAAA;GAAA,OAAAjB;EAAA,GAAA;GAAAK,GAAAD,KAAAA;GAAAG,GAAAH,KAAAA;EAAA,CAAA;EAAA,OAAAU;CAAA,EAAA,CAAA;AAOlE;AAACK,eAAA,CAAA,OAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"carousel.js","names":["createEffect","createSignal","For","onCleanup","Show","splitProps","createEmblaCarousel","ChevronLeft","LucideChevronLeft","ChevronRight","LucideChevronRight","cn","Button","fastIcon","children","orientation","slidesToShow","align","loop","controls","dots","previousLabel","nextLabel","dotLabel","index","onApi","api","class","Carousel","props","local","rest","emblaRef","embla","axis","slidesToScroll","containScroll","selected","setSelected","count","setCount","canPrev","setCanPrev","canNext","setCanNext","sync","selectedScrollSnap","canScrollPrev","canScrollNext","remeasure","scrollSnapList","length","on","off","_el$","_tmpl$3","_el$2","firstChild","_el$3","_$spread","_$mergeProps","_$use","_$insert","_$createComponent","when","_el$4","_tmpl$2","variant","size","disabled","onClick","scrollPrev","_el$5","_tmpl$","each","Array","from","_","_el$6","_tmpl$4","$$click","scrollTo","_$effect","_p$","_v$3","_v$4","_v$5","undefined","e","_$className","t","_$setAttribute","a","scrollNext","_v$","_v$2","CarouselSlide","_el$7","_tmpl$5","_v$6","_v$7","_$setStyleProperty","_$delegateEvents"],"sources":["../../../../src/components/ui/carousel/carousel.tsx"],"sourcesContent":["import { createEffect, createSignal, For, onCleanup, Show, splitProps, type JSX } from 'solid-js'\nimport createEmblaCarousel from 'embla-carousel-solid'\nimport type { EmblaCarouselType } from 'embla-carousel'\nimport { ChevronLeft as LucideChevronLeft, ChevronRight as LucideChevronRight } from 'lucide-solid'\nimport { cn } from '#lib/utils'\nimport { Button } from '../button'\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)\n\n/**\n * Carousel.\n *\n * A horizontal scroller with snap points, over embla. The primitive owns the\n * physics, momentum, snapping, drag, and this owns the two things a carousel\n * always needs and embla deliberately leaves to the caller: a keyboard path and a\n * way to tell how far along you are.\n *\n * **It is a scroll container, not a slide show.** `slidesToScroll` defaults to 1\n * and the track is keyboard-focusable, so arrow keys move between slides and a\n * slide that contains a link stays reachable. A carousel that hijacks the arrow\n * keys or hides its off-screen slides from the tab order is the standard\n * accessibility failure of this component, and both are avoided here by not\n * disabling anything: the slides stay in the DOM and in the tab order, and the\n * container scrolls.\n *\n * `orientation=\"vertical\"` exists because embla supports it and a vertical\n * carousel is what a short list of cards becomes on a phone. It is a prop rather\n * than a second component because every part, the track, the previous/next\n * buttons, the dots, has the same relationship to the axis.\n *\n * The dot indicators are buttons, not spans: a carousel with twelve slides and a\n * \"go to slide 7\" affordance is the only way to reach the seventh without\n * dragging through six. Each is labelled, because a row of unlabelled dots is a\n * row of identical controls to a screen reader.\n */\n\nexport type CarouselApi = EmblaCarouselType\n\nexport type CarouselProps = {\n /** The slides. Each is wrapped in its own element so embla can measure it. */\n children: JSX.Element\n /** The axis. Vertical is what a card list becomes on a narrow screen. */\n orientation?: 'horizontal' | 'vertical'\n /** How many slides are visible at once. */\n slidesToShow?: number\n /** Align the active slide to the start, centre, or end of the viewport. */\n align?: 'start' | 'center' | 'end'\n /** Whether dragging past the ends loops. Off by default: a loop hides the ends. */\n loop?: boolean\n /** Show the previous/next controls. */\n controls?: boolean\n /** Show the dot indicators. Off by default, a single-slide carousel needs none. */\n dots?: boolean\n /** Accessible names. Override for a non-English application. */\n previousLabel?: string\n nextLabel?: string\n /** The label for a dot, given a zero-based index. */\n dotLabel?: (index: number) => string\n /** Receives the embla API, for a caller that needs to drive it. */\n onApi?: (api: CarouselApi) => void\n class?: string\n}\n\nexport function Carousel(props: CarouselProps) {\n const [local, rest] = splitProps(props, [\n 'children',\n 'orientation',\n 'slidesToShow',\n 'align',\n 'loop',\n 'controls',\n 'dots',\n 'previousLabel',\n 'nextLabel',\n 'dotLabel',\n 'onApi',\n 'class',\n ])\n\n const orientation = () => local.orientation ?? 'horizontal'\n\n // The first element of the tuple is the ref setter, the second the accessor,\n // so `ref={emblaRef}` is the whole wiring.\n const [emblaRef, embla] = createEmblaCarousel(() => ({\n axis: orientation() === 'vertical' ? 'y' : 'x',\n loop: local.loop ?? false,\n align: local.align ?? 'start',\n slidesToScroll: 1,\n containScroll: 'trimSnaps',\n }))\n\n const [selected, setSelected] = createSignal(0)\n const [count, setCount] = createSignal(0)\n const [canPrev, setCanPrev] = createSignal(false)\n const [canNext, setCanNext] = createSignal(false)\n\n /**\n * The scroll event, not the select event alone: `select` fires on a settle, so a\n * drag in progress would leave the dots behind the thumb. `scroll` covers both.\n */\n createEffect(() => {\n const api = embla()\n if (!api) return\n local.onApi?.(api)\n\n const sync = () => {\n setSelected(api.selectedScrollSnap())\n setCanPrev(api.canScrollPrev())\n setCanNext(api.canScrollNext())\n }\n // A reInit (slides added or removed, a resize that changes the snaps) can\n // change how many snaps there are, so the dots are recounted with it.\n const remeasure = () => {\n setCount(api.scrollSnapList().length)\n sync()\n }\n remeasure()\n\n api.on('select', sync)\n api.on('scroll', sync)\n api.on('reInit', remeasure)\n onCleanup(() => {\n api.off('select', sync)\n api.off('scroll', sync)\n api.off('reInit', remeasure)\n })\n })\n\n return (\n <div\n class={cn('group/carousel relative grid gap-2', local.class)}\n role=\"group\"\n aria-roledescription=\"carousel\"\n {...rest}\n >\n <div\n ref={emblaRef}\n // A scroll container has to be reachable by keyboard, the same\n // requirement the code block's scroller meets.\n tabindex=\"0\"\n class={cn(\n 'scroll-fade overflow-hidden rounded-lg focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none'\n )}\n aria-label=\"Carousel\"\n >\n <div class={cn('flex', orientation() === 'vertical' ? 'flex-col' : 'flex-row')}>\n {local.children}\n </div>\n </div>\n\n <Show when={local.controls ?? true}>\n <div class=\"flex items-center justify-center gap-1\">\n <Button\n variant=\"ghost\"\n size=\"icon-sm\"\n disabled={!canPrev()}\n aria-label={local.previousLabel ?? 'Previous slide'}\n onClick={() => embla()?.scrollPrev()}\n >\n <ChevronLeft aria-hidden=\"true\" class=\"rotate-0\" />\n </Button>\n <Show when={local.dots}>\n <div class=\"flex items-center gap-1 px-1\">\n <For each={Array.from({ length: count() })}>\n {(_, index) => (\n <button\n type=\"button\"\n class={cn(\n 'size-1.5 rounded-full bg-muted-foreground/40 transition-colors hover:bg-muted-foreground',\n selected() === index() && 'bg-primary'\n )}\n aria-label={local.dotLabel?.(index()) ?? `Go to slide ${index() + 1}`}\n aria-current={selected() === index() ? 'true' : undefined}\n onClick={() => embla()?.scrollTo(index())}\n />\n )}\n </For>\n </div>\n </Show>\n <Button\n variant=\"ghost\"\n size=\"icon-sm\"\n disabled={!canNext()}\n aria-label={local.nextLabel ?? 'Next slide'}\n onClick={() => embla()?.scrollNext()}\n >\n <ChevronRight aria-hidden=\"true\" />\n </Button>\n </div>\n </Show>\n </div>\n )\n}\n\n/**\n * One slide. `basis` is what makes `slidesToShow` work: embla measures the slide\n * elements, so a slide that is not sized to a fraction of the viewport would show\n * one per screen regardless of the setting.\n */\nexport function CarouselSlide(props: {\n children: JSX.Element\n /** How many slides share the viewport at this slide's widest breakpoint. */\n slidesToShow?: number\n class?: string\n}) {\n return (\n <div\n class={cn('min-w-0 shrink-0 grow-0', props.class)}\n style={{ 'flex-basis': `${100 / (props.slidesToShow ?? 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AA;GAAAK,GAAAD,KAAAA;GAAAG,GAAAH,KAAAA;EAAA,CAAA;EAAA,OAAAjC;CAAA,EAAA,CAAA;AA+CtF;;;;;;AAOA,SAAgB0C,cAAcnE,OAK3B;CACD,cAAA;EAAA,IAAAoE,QAAAC,QAAA;EAAApC,OAAAmC,aAOKpE,MAAMf,QAAQ;EAAAoE,QAAAC,QAAA;GAAA,IAAAgB,OALRxF,GAAG,2BAA2BkB,MAAMF,KAAK,GAACyE,OAC1B,GAAG,OAAOvE,MAAMb,gBAAgB,GAAE;GAAGmF,SAAAhB,IAAAK,KAAAC,UAAAQ,OAAAd,IAAAK,IAAAW,IAAA;GAAAC,SAAAjB,IAAAO,KAAAW,iBAAAJ,OAAA,cAAAd,IAAAO,IAAAU,IAAA;GAAA,OAAAjB;EAAA,GAAA;GAAAK,GAAAD,KAAAA;GAAAG,GAAAH,KAAAA;EAAA,CAAA;EAAA,OAAAU;CAAA,EAAA,CAAA;AAOlE;AAACK,eAAA,CAAA,OAAA,CAAA"}
|
|
@@ -27,6 +27,19 @@ export type CheckboxProps = Omit<ComponentProps<typeof KobalteCheckbox>, 'childr
|
|
|
27
27
|
*/
|
|
28
28
|
children?: JSX.Element;
|
|
29
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* Checkbox.
|
|
32
|
+
*
|
|
33
|
+
* Without `children` (the common case: a box, optionally with `label` and
|
|
34
|
+
* `description`) it renders a native checkbox and its painted control directly.
|
|
35
|
+
* Kobalte's Checkbox cost about 1 ms per box in its polymorphic parts and
|
|
36
|
+
* contexts, which a settings page or a selectable list pays once per row. The
|
|
37
|
+
* contract is Kobalte's: `checked`/`defaultChecked`/`onChange(checked)`,
|
|
38
|
+
* `indeterminate`, `name`, `value`, `required`, `disabled`, `readOnly`,
|
|
39
|
+
* `validationState`, and the same `data-*` state attributes on every part.
|
|
40
|
+
* With `children` the parts are composed by the caller, so it renders through
|
|
41
|
+
* Kobalte, whose context `CheckboxLabel` and `CheckboxDescription` need.
|
|
42
|
+
*/
|
|
30
43
|
export declare function Checkbox(props: CheckboxProps): JSX.Element;
|
|
31
44
|
/**
|
|
32
45
|
* The box's own label. Valid only inside a `<Checkbox>`, for the same reason as
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/checkbox/checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/checkbox/checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAoBnD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,EAAE,UAAU,CAAC,GAAG;IACrF,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,KAAK,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACnB,WAAW,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CACvB,CAAA;AAgBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,eA4M5C;AAoFD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,eAGhF;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,eAQ5F"}
|