@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-toggle.js","names":["Monitor","Moon","Sun","For","splitProps","cn","ToggleGroup","ToggleGroupItem","useTheme","withLabels","APPEARANCES","value","label","icon","ThemeToggle","props","local","rest","selection","setSelection","_$createComponent","_$mergeProps","attached","appearance","onChange","class","children","each","variant","size","_$memo","_el$","_tmpl$","_$insert"],"sources":["../../../src/components/theme/theme-toggle.tsx"],"sourcesContent":["import { Monitor, Moon, Sun } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { For, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { ToggleGroup, ToggleGroupItem } from '../ui/toggle-group'\nimport { useTheme } from './theme-context'\n\n/**\n * ThemeToggle.\n *\n * Three states, not two: light, dark, and follow the system. A two-state switch is\n * the common mistake, it forces a choice on someone who wanted the application to\n * track their OS, and it has no way to say \"I have not decided\", so the first click\n * silently overrides a system preference the user set deliberately.\n *\n * The icons carry the state and the accessible name comes from the label, so the\n * control is usable without seeing which glyph is lit.\n */\nexport type ThemeToggleProps = Omit<ComponentProps<typeof ToggleGroup>, 'children'> & {\n /** Draw labels beside the icons. Off by default: a toolbar wants icons. */\n withLabels?: boolean\n}\n\nconst APPEARANCES = [\n { value: 'light', label: 'Light', icon: Sun },\n { value: 'dark', label: 'Dark', icon: Moon },\n { value: 'system', label: 'System', icon: Monitor },\n] as const\n\nexport function ThemeToggle(props: ThemeToggleProps) {\n const [local, rest] = splitProps(props, ['class', 'withLabels'])\n const { selection, setSelection } = useTheme()\n\n return (\n <ToggleGroup\n attached\n value={selection().appearance}\n onChange={(value: string | null) => {\n // A toggle group reports the pressed value or null; null would leave the\n // appearance unset, so a re-press keeps the current one.\n if (typeof value === 'string') {\n setSelection({ appearance: value as 'light' | 'dark' | 'system' })\n }\n }}\n aria-label=\"Appearance\"\n class={cn(local.class)}\n {...rest}\n >\n <For each={APPEARANCES}>\n {(appearance) => (\n <ToggleGroupItem\n value={appearance.value}\n variant=\"outline\"\n size={local.withLabels ? 'sm' : 'icon-sm'}\n aria-label={appearance.label}\n >\n <appearance.icon />\n {local.withLabels ? <span>{appearance.label}</span> : null}\n </ToggleGroupItem>\n )}\n </For>\n </ToggleGroup>\n )\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"theme-toggle.js","names":["Monitor","LucideMonitor","Moon","LucideMoon","Sun","LucideSun","For","splitProps","cn","ToggleGroup","ToggleGroupItem","useTheme","fastIcon","withLabels","APPEARANCES","value","label","icon","ThemeToggle","props","local","rest","selection","setSelection","_$createComponent","_$mergeProps","attached","appearance","onChange","class","children","each","variant","size","_$memo","_el$","_tmpl$","_$insert"],"sources":["../../../src/components/theme/theme-toggle.tsx"],"sourcesContent":["import { Monitor as LucideMonitor, Moon as LucideMoon, Sun as LucideSun } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { For, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { ToggleGroup, ToggleGroupItem } from '../ui/toggle-group'\nimport { useTheme } from './theme-context'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Monitor = fastIcon(LucideMonitor)\nconst Moon = fastIcon(LucideMoon)\nconst Sun = fastIcon(LucideSun)\n\n/**\n * ThemeToggle.\n *\n * Three states, not two: light, dark, and follow the system. A two-state switch is\n * the common mistake, it forces a choice on someone who wanted the application to\n * track their OS, and it has no way to say \"I have not decided\", so the first click\n * silently overrides a system preference the user set deliberately.\n *\n * The icons carry the state and the accessible name comes from the label, so the\n * control is usable without seeing which glyph is lit.\n */\nexport type ThemeToggleProps = Omit<ComponentProps<typeof ToggleGroup>, 'children'> & {\n /** Draw labels beside the icons. Off by default: a toolbar wants icons. */\n withLabels?: boolean\n}\n\nconst APPEARANCES = [\n { value: 'light', label: 'Light', icon: Sun },\n { value: 'dark', label: 'Dark', icon: Moon },\n { value: 'system', label: 'System', icon: Monitor },\n] as const\n\nexport function ThemeToggle(props: ThemeToggleProps) {\n const [local, rest] = splitProps(props, ['class', 'withLabels'])\n const { selection, setSelection } = useTheme()\n\n return (\n <ToggleGroup\n attached\n value={selection().appearance}\n onChange={(value: string | null) => {\n // A toggle group reports the pressed value or null; null would leave the\n // appearance unset, so a re-press keeps the current one.\n if (typeof value === 'string') {\n setSelection({ appearance: value as 'light' | 'dark' | 'system' })\n }\n }}\n aria-label=\"Appearance\"\n class={cn(local.class)}\n {...rest}\n >\n <For each={APPEARANCES}>\n {(appearance) => (\n <ToggleGroupItem\n value={appearance.value}\n variant=\"outline\"\n size={local.withLabels ? 'sm' : 'icon-sm'}\n aria-label={appearance.label}\n >\n <appearance.icon />\n {local.withLabels ? <span>{appearance.label}</span> : null}\n </ToggleGroupItem>\n )}\n </For>\n </ToggleGroup>\n )\n}\n"],"mappings":";;;;;;;;;AASA,IAAMA,YAAUY,SAASX,OAAa;AACtC,IAAMC,SAAOU,SAAST,IAAU;AAmBhC,IAAMW,cAAc;CAClB;EAAEC,OAAO;EAASC,OAAO;EAASC,MAnBxBL,SAASP,GAmBqBD;CAAI;CAC5C;EAAEW,OAAO;EAAQC,OAAO;EAAQC,MAAMf;CAAK;CAC3C;EAAEa,OAAO;EAAUC,OAAO;EAAUC,MAAMjB;CAAQ;AAAC;AAGrD,SAAgBkB,YAAYC,OAAyB;CACnD,MAAM,CAACC,OAAOC,QAAQd,WAAWY,OAAO,CAAC,SAAS,YAAY,CAAC;CAC/D,MAAM,EAAEG,WAAWC,iBAAiBZ,SAAS;CAE7C,OAAAa,gBACGf,aAAWgB,WAAA;EACVC,UAAQ;EAAA,IACRX,QAAK;GAAA,OAAEO,UAAU,CAAC,CAACK;EAAU;EAC7BC,WAAWb,UAAyB;GAGlC,IAAI,OAAOA,UAAU,UACnBQ,aAAa,EAAEI,YAAYZ,MAAqC,CAAC;EAErE;EAAC,cAAA;EAAA,KAAA,WAAA;GAAA,OAEMP,GAAGY,MAAMS,KAAK;EAAC;CAAA,GAClBR,MAAI,EAAA,IAAAS,WAAA;EAAA,OAAAN,gBAEPlB,KAAG;GAACyB,MAAMjB;GAAWgB,WAClBH,eAAUH,gBACTd,iBAAe;IAAA,IACdK,QAAK;KAAA,OAAEY,WAAWZ;IAAK;IACvBiB,SAAO;IAAA,IACPC,OAAI;KAAA,OAAEb,MAAMP,aAAa,OAAO;IAAS;IAAA,KAAA,gBAAA;KAAA,OAC7Bc,WAAWX;IAAK;IAAA,IAAAc,WAAA;KAAA,OAAA,CAAAN,gBAE3BG,WAAWV,MAAI,CAAA,CAAA,GAAAiB,WACfA,WAAA,CAAA,CAAAd,MAAMP,UAAU,CAAA,CAAA,WAAA;MAAA,IAAAsB,OAAAC,OAAA;MAAAC,OAAAF,YAAUR,WAAWX,KAAK;MAAA,OAAAmB;KAAA,EAAA,CAAA,IAAW,IAAI,CAAA;IAAA;GAAA,CAAA;EAE7D,CAAA;CAAA,EAAA,CAAA,CAAA;AAIT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/accordion/accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAEvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/accordion/accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAEvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAQ9C;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,gBAAgB,CAAC,kCAGvE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,kCAQhF;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,kCA4BtF;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,kCAOtF"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { cn } from "../../../lib/utils.js";
|
|
2
|
+
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
2
3
|
import { createComponent, insert, memo, mergeProps, template } from "solid-js/web";
|
|
3
4
|
import { Accordion } from "@kobalte/core/accordion";
|
|
4
5
|
import { ChevronDown } from "lucide-solid";
|
|
5
6
|
import { splitProps } from "solid-js";
|
|
6
7
|
// src/components/ui/accordion/accordion.tsx
|
|
7
8
|
var _tmpl$ = /*#__PURE__*/ template(`<div class="pt-0 pb-3">`);
|
|
9
|
+
var ChevronDown$1 = fastIcon(ChevronDown);
|
|
8
10
|
/**
|
|
9
11
|
* Accordion.
|
|
10
12
|
*
|
|
@@ -36,7 +38,7 @@ function AccordionTrigger(props) {
|
|
|
36
38
|
return createComponent(Accordion.Trigger, mergeProps({ get ["class"]() {
|
|
37
39
|
return cn("group/accordion flex flex-1 items-center justify-between gap-2 py-3 text-left text-sm font-medium", "transition-colors ease-out outline-none", "hover:text-foreground", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle", "disabled:pointer-events-none disabled:opacity-50", local.class);
|
|
38
40
|
} }, rest, { get children() {
|
|
39
|
-
return [memo(() => local.children), createComponent(ChevronDown, {
|
|
41
|
+
return [memo(() => local.children), createComponent(ChevronDown$1, {
|
|
40
42
|
"class": "text-muted-foreground size-4 shrink-0 transition-transform ease-out group-data-[expanded]/accordion:rotate-180",
|
|
41
43
|
"aria-hidden": "true"
|
|
42
44
|
})];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.js","names":["Accordion","KobalteAccordion","ChevronDown","splitProps","cn","props","local","rest","_$createComponent","_$mergeProps","class","AccordionItem","Item","AccordionTrigger","Trigger","Header","children","_$memo","AccordionContent","Content","_el$","_tmpl$","_$insert"],"sources":["../../../../src/components/ui/accordion/accordion.tsx"],"sourcesContent":["import { Accordion as KobalteAccordion } from '@kobalte/core/accordion'\nimport { ChevronDown } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * Accordion.\n *\n * A list of collapsible sections. `collapsible` (the default) lets the user\n * close the open section; without it one section is always open, which is what\n * a settings page usually wants and a FAQ usually does not.\n *\n * The trigger is a real button with `aria-expanded` and the panel is\n * `aria-labelledby` the trigger, so the relationship survives even when the\n * panel is empty.\n */\nexport function Accordion(props: ComponentProps<typeof KobalteAccordion>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteAccordion class={cn('flex w-full flex-col', local.class)} {...rest} />\n}\n\nexport function AccordionItem(props: ComponentProps<typeof KobalteAccordion.Item>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteAccordion.Item\n class={cn('border-b border-border last:border-b-0', local.class)}\n {...rest}\n />\n )\n}\n\nexport function AccordionTrigger(props: ComponentProps<typeof KobalteAccordion.Trigger>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteAccordion.Header class=\"flex\">\n <KobalteAccordion.Trigger\n class={cn(\n // `group/accordion` is what the chevron's `group-data-[expanded]/accordion`\n // reads. Kobalte puts `data-expanded` on this trigger, not on the item, so\n // the trigger is the group; without the class the rotation selector has no\n // ancestor to match and the chevron never turns.\n 'group/accordion flex flex-1 items-center justify-between gap-2 py-3 text-left text-sm font-medium',\n 'transition-colors ease-out outline-none',\n 'hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'disabled:pointer-events-none disabled:opacity-50',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <ChevronDown\n class=\"text-muted-foreground size-4 shrink-0 transition-transform ease-out group-data-[expanded]/accordion:rotate-180\"\n aria-hidden=\"true\"\n />\n </KobalteAccordion.Trigger>\n </KobalteAccordion.Header>\n )\n}\n\nexport function AccordionContent(props: ComponentProps<typeof KobalteAccordion.Content>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteAccordion.Content class={cn('overflow-hidden text-sm', local.class)} {...rest}>\n <div class=\"pt-0 pb-3\">{props.children}</div>\n </KobalteAccordion.Content>\n )\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"accordion.js","names":["Accordion","KobalteAccordion","ChevronDown","LucideChevronDown","splitProps","cn","fastIcon","props","local","rest","_$createComponent","_$mergeProps","class","AccordionItem","Item","AccordionTrigger","Trigger","Header","children","_$memo","AccordionContent","Content","_el$","_tmpl$","_$insert"],"sources":["../../../../src/components/ui/accordion/accordion.tsx"],"sourcesContent":["import { Accordion as KobalteAccordion } from '@kobalte/core/accordion'\nimport { ChevronDown as LucideChevronDown } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { 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 ChevronDown = fastIcon(LucideChevronDown)\n\n/**\n * Accordion.\n *\n * A list of collapsible sections. `collapsible` (the default) lets the user\n * close the open section; without it one section is always open, which is what\n * a settings page usually wants and a FAQ usually does not.\n *\n * The trigger is a real button with `aria-expanded` and the panel is\n * `aria-labelledby` the trigger, so the relationship survives even when the\n * panel is empty.\n */\nexport function Accordion(props: ComponentProps<typeof KobalteAccordion>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteAccordion class={cn('flex w-full flex-col', local.class)} {...rest} />\n}\n\nexport function AccordionItem(props: ComponentProps<typeof KobalteAccordion.Item>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteAccordion.Item\n class={cn('border-b border-border last:border-b-0', local.class)}\n {...rest}\n />\n )\n}\n\nexport function AccordionTrigger(props: ComponentProps<typeof KobalteAccordion.Trigger>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteAccordion.Header class=\"flex\">\n <KobalteAccordion.Trigger\n class={cn(\n // `group/accordion` is what the chevron's `group-data-[expanded]/accordion`\n // reads. Kobalte puts `data-expanded` on this trigger, not on the item, so\n // the trigger is the group; without the class the rotation selector has no\n // ancestor to match and the chevron never turns.\n 'group/accordion flex flex-1 items-center justify-between gap-2 py-3 text-left text-sm font-medium',\n 'transition-colors ease-out outline-none',\n 'hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'disabled:pointer-events-none disabled:opacity-50',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <ChevronDown\n class=\"text-muted-foreground size-4 shrink-0 transition-transform ease-out group-data-[expanded]/accordion:rotate-180\"\n aria-hidden=\"true\"\n />\n </KobalteAccordion.Trigger>\n </KobalteAccordion.Header>\n )\n}\n\nexport function AccordionContent(props: ComponentProps<typeof KobalteAccordion.Content>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteAccordion.Content class={cn('overflow-hidden text-sm', local.class)} {...rest}>\n <div class=\"pt-0 pb-3\">{props.children}</div>\n </KobalteAccordion.Content>\n )\n}\n"],"mappings":";;;;;;;;AAQA,IAAME,gBAAcI,SAASH,WAAiB;;;;;;;;;;;;AAa9C,SAAgBH,YAAUO,OAAgD;CACxE,MAAM,CAACC,OAAOC,QAAQL,WAAWG,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBAAQT,WAAgBU,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQN,GAAG,wBAAwBG,MAAMI,KAAK;CAAC,EAAA,GAAMH,IAAI,CAAA;AACnF;AAEA,SAAgBI,cAAcN,OAAqD;CACjF,MAAM,CAACC,OAAOC,QAAQL,WAAWG,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBACGT,UAAiBa,MAAIH,WAAA,EAAA,KAAA,WAAA;EAAA,OACbN,GAAG,0CAA0CG,MAAMI,KAAK;CAAC,EAAA,GAC5DH,IAAI,CAAA;AAGd;AAEA,SAAgBM,iBAAiBR,OAAwD;CACvF,MAAM,CAACC,OAAOC,QAAQL,WAAWG,OAAO,CAAC,SAAS,UAAU,CAAC;CAE7D,OAAAG,gBACGT,UAAiBgB,QAAM;EAAA,SAAA;EAAA,IAAAC,WAAA;GAAA,OAAAR,gBACrBT,UAAiBe,SAAOL,WAAA,EAAA,KAAA,WAAA;IAAA,OAChBN,GAKL,qGACA,2CACA,yBACA,oFACA,oDACAG,MAAMI,KACR;GAAC,EAAA,GACGH,MAAI,EAAA,IAAAS,WAAA;IAAA,OAAA,CAAAC,WAEPX,MAAMU,QAAQ,GAAAR,gBACdR,eAAW;KAAA,SAAA;KAAA,eAAA;IAAA,CAAA,CAAA;GAAA,EAAA,CAAA,CAAA;EAAA;CAAA,CAAA;AAOpB;AAEA,SAAgBkB,iBAAiBb,OAAwD;CACvF,MAAM,CAACC,OAAOC,QAAQL,WAAWG,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBACGT,UAAiBoB,SAAOV,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQN,GAAG,2BAA2BG,MAAMI,KAAK;CAAC,EAAA,GAAMH,MAAI,EAAA,IAAAS,WAAA;EAAA,IAAAI,OAAAC,OAAA;EAAAC,OAAAF,YAC3Df,MAAMW,QAAQ;EAAA,OAAAI;CAAA,EAAA,CAAA,CAAA;AAG5C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/alert/alert.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/alert/alert.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAEnD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAUtD;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,aAAa;;8EAclB,CAAA;AAkBD,KAAK,iBAAiB,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAA;AAE3D,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,KAAK,CAAC,GAC5C,iBAAiB,GAAG;IAClB,yEAAyE;IACzE,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,IAAI,CAAA;CAC1B,CAAA;AAEH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,eA8BtC;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eAStD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eAS5D;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eASvD;AAED,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { cva } from "../../../lib/variants.js";
|
|
2
2
|
import { cn } from "../../../lib/utils.js";
|
|
3
|
-
import {
|
|
3
|
+
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
4
|
+
import { className, createComponent, effect, insert, memo, mergeProps, spread, template } from "solid-js/web";
|
|
4
5
|
import { AlertCircle, CheckCircle2, Info, TriangleAlert } from "lucide-solid";
|
|
5
6
|
import { children, splitProps } from "solid-js";
|
|
6
7
|
// src/components/ui/alert/alert.tsx
|
|
@@ -9,6 +10,10 @@ var _tmpl$2 = /*#__PURE__*/ template(`<span data-slot=alert-icon>`);
|
|
|
9
10
|
var _tmpl$3 = /*#__PURE__*/ template(`<div data-slot=alert-title>`);
|
|
10
11
|
var _tmpl$4 = /*#__PURE__*/ template(`<div data-slot=alert-description>`);
|
|
11
12
|
var _tmpl$5 = /*#__PURE__*/ template(`<div data-slot=alert-action>`);
|
|
13
|
+
var AlertCircle$1 = fastIcon(AlertCircle);
|
|
14
|
+
var CheckCircle2$1 = fastIcon(CheckCircle2);
|
|
15
|
+
var Info$1 = fastIcon(Info);
|
|
16
|
+
var TriangleAlert$1 = fastIcon(TriangleAlert);
|
|
12
17
|
/**
|
|
13
18
|
* Alert.
|
|
14
19
|
*
|
|
@@ -33,11 +38,11 @@ var alertVariants = cva("relative grid w-full grid-cols-[auto_1fr] items-start g
|
|
|
33
38
|
defaultVariants: { variant: "default" }
|
|
34
39
|
});
|
|
35
40
|
var alertIcons = {
|
|
36
|
-
default: Info,
|
|
37
|
-
destructive: AlertCircle,
|
|
38
|
-
success: CheckCircle2,
|
|
39
|
-
warning: TriangleAlert,
|
|
40
|
-
info: Info
|
|
41
|
+
default: Info$1,
|
|
42
|
+
destructive: AlertCircle$1,
|
|
43
|
+
success: CheckCircle2$1,
|
|
44
|
+
warning: TriangleAlert$1,
|
|
45
|
+
info: Info$1
|
|
41
46
|
};
|
|
42
47
|
var alertIconTones = {
|
|
43
48
|
default: "text-muted-foreground",
|
|
@@ -64,9 +69,10 @@ function Alert(props) {
|
|
|
64
69
|
var _c$ = memo(() => icon() === null);
|
|
65
70
|
return () => _c$() ? null : (() => {
|
|
66
71
|
var _el$2 = _tmpl$2();
|
|
67
|
-
insert(_el$2, () => icon() ??
|
|
68
|
-
|
|
69
|
-
|
|
72
|
+
insert(_el$2, () => icon() ?? (() => {
|
|
73
|
+
const Icon = alertIcons[tone()];
|
|
74
|
+
return createComponent(Icon, {});
|
|
75
|
+
})());
|
|
70
76
|
effect(() => className(_el$2, cn("row-span-2 pt-0.5 [&_svg]:size-4", alertIconTones[tone()])));
|
|
71
77
|
return _el$2;
|
|
72
78
|
})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.js","names":["AlertCircle","CheckCircle2","Info","TriangleAlert","children","resolveChildren","splitProps","
|
|
1
|
+
{"version":3,"file":"alert.js","names":["AlertCircle","LucideAlertCircle","CheckCircle2","LucideCheckCircle2","Info","LucideInfo","TriangleAlert","LucideTriangleAlert","children","resolveChildren","splitProps","cva","cn","fastIcon","alertVariants","variants","variant","default","destructive","success","warning","info","defaultVariants","alertIcons","alertIconTones","icon","Alert","props","local","rest","tone","_el$","_tmpl$","_$spread","_$mergeProps","class","_$insert","_c$","_$memo","_el$2","_tmpl$2","Icon","_$createComponent","_$effect","_$className","AlertTitle","_el$3","_tmpl$3","AlertDescription","_el$4","_tmpl$4","AlertAction","_el$5","_tmpl$5"],"sources":["../../../../src/components/ui/alert/alert.tsx"],"sourcesContent":["import {\n AlertCircle as LucideAlertCircle,\n CheckCircle2 as LucideCheckCircle2,\n Info as LucideInfo,\n TriangleAlert as LucideTriangleAlert,\n} from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { children as resolveChildren, splitProps } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst AlertCircle = fastIcon(LucideAlertCircle)\nconst CheckCircle2 = fastIcon(LucideCheckCircle2)\nconst Info = fastIcon(LucideInfo)\nconst TriangleAlert = fastIcon(LucideTriangleAlert)\n\n/**\n * Alert.\n *\n * A message about the whole surface it sits in — a form's validation summary,\n * a failed sync banner, a permission notice. It is deliberately not a dialog:\n * an alert that must be dismissed before the user can continue is a Dialog.\n *\n * The glyph follows the tone rather than being passed in, so an alert cannot\n * be given a green checkmark on a destructive fill. A caller that genuinely\n * needs a different icon passes `icon`; `icon={null}` removes it. Text stays on\n * the body foreground over the tinted status surface, while the glyph and edge\n * carry the status hue.\n */\nconst alertVariants = cva(\n 'relative grid w-full grid-cols-[auto_1fr] items-start gap-x-3 gap-y-1 rounded-lg border px-3 py-2.5 text-sm',\n {\n variants: {\n variant: {\n default: 'bg-card text-card-foreground border-border',\n destructive: 'bg-destructive-subtle text-foreground border-destructive/30',\n success: 'bg-success-subtle text-foreground border-success/30',\n warning: 'bg-warning-subtle text-foreground border-warning/30',\n info: 'bg-info-subtle text-foreground border-info/30',\n },\n },\n defaultVariants: { variant: 'default' },\n }\n)\n\nconst alertIcons = {\n default: Info,\n destructive: AlertCircle,\n success: CheckCircle2,\n warning: TriangleAlert,\n info: Info,\n} as const\n\nconst alertIconTones = {\n default: 'text-muted-foreground',\n destructive: 'text-destructive',\n success: 'text-success',\n warning: 'text-warning',\n info: 'text-info',\n} as const\n\ntype AlertVariantProps = VariantProps<typeof alertVariants>\n\nexport type AlertProps = ComponentProps<'div'> &\n AlertVariantProps & {\n /** Replace the tone's glyph with your own element. `null` removes it. */\n icon?: JSX.Element | null\n }\n\nexport function Alert(props: AlertProps) {\n const [local, rest] = splitProps(props, ['class', 'variant', 'icon', 'children'])\n\n const tone = () => local.variant ?? 'default'\n const icon = resolveChildren(() => local.icon)\n\n return (\n <div\n data-slot=\"alert\"\n role=\"alert\"\n class={cn(alertVariants({ variant: local.variant }), local.class)}\n {...rest}\n >\n {icon() === null ? null : (\n <span\n data-slot=\"alert-icon\"\n class={cn('row-span-2 pt-0.5 [&_svg]:size-4', alertIconTones[tone()])}\n >\n {icon() ??\n (() => {\n // Called directly rather than through Dynamic: no memo or\n // component wrapper for a glyph that only changes with the tone.\n const Icon = alertIcons[tone()]\n return <Icon />\n })()}\n </span>\n )}\n {local.children}\n </div>\n )\n}\n\nexport function AlertTitle(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"alert-title\"\n class={cn('col-start-2 font-medium tracking-tight', local.class)}\n {...rest}\n />\n )\n}\n\nexport function AlertDescription(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"alert-description\"\n class={cn('col-start-2 text-sm [&_p]:leading-relaxed', local.class)}\n {...rest}\n />\n )\n}\n\n/**\n * The alert's own actions — a Retry, an Open settings, a Cancel — on a row\n * under the text, aligned with the title rather than the glyph. Buttons here\n * are `size=\"xs\" variant=\"outline\"` by convention, so an alert's action reads\n * as part of the message rather than as the page's primary action.\n */\nexport function AlertAction(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"alert-action\"\n class={cn('col-start-2 mt-1 flex flex-wrap items-center gap-2', local.class)}\n {...rest}\n />\n )\n}\n\nexport { alertVariants }\n"],"mappings":";;;;;;;;;;;;AAaA,IAAMA,gBAAca,SAASZ,WAAiB;AAC9C,IAAMC,iBAAeW,SAASV,YAAkB;AAChD,IAAMC,SAAOS,SAASR,IAAU;AAChC,IAAMC,kBAAgBO,SA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AA,OAAAuB;CAAA,EAAA,CAAA;AAGrB;AAEA,SAAgBc,WAAWlB,OAA8B;CACvD,MAAM,CAACC,OAAOC,QAAQnB,WAAWiB,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAmB,QAAAC,QAAA;EAAAd,OAAAa,OAAAZ,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWtB,GAAG,0CAA0CgB,MAAMO,KAAK;EAAC,EAAA,GAC5DN,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAiB;CAAA,EAAA,CAAA;AAGd;AAEA,SAAgBE,iBAAiBrB,OAA8B;CAC7D,MAAM,CAACC,OAAOC,QAAQnB,WAAWiB,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAsB,QAAAC,QAAA;EAAAjB,OAAAgB,OAAAf,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWtB,GAAG,6CAA6CgB,MAAMO,KAAK;EAAC,EAAA,GAC/DN,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAoB;CAAA,EAAA,CAAA;AAGd;;;;;;;AAQA,SAAgBE,YAAYxB,OAA8B;CACxD,MAAM,CAACC,OAAOC,QAAQnB,WAAWiB,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAyB,QAAAC,QAAA;EAAApB,OAAAmB,OAAAlB,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWtB,GAAG,sDAAsDgB,MAAMO,KAAK;EAAC,EAAA,GACxEN,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAuB;CAAA,EAAA,CAAA;AAGd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotation-surface.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/annotation-surface/annotation-surface.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"annotation-surface.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/annotation-surface/annotation-surface.tsx"],"names":[],"mappings":"AAAA,O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AAC,EAAE,OAAO,CAAA;IACrB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1B,mDAAmD;IACnD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,2BAA2B,KAAK,IAAI,CAAA;IACrF,mFAAmF;IACnF,YAAY,CAAC,EAAE,CACb,IAAI,EAAE,qBAAqB,GAAG,SAAS,EACvC,KAAK,EAAE,0BAA0B,EACjC,KAAK,CAAC,EAAE,2BAA2B,KAChC,IAAI,CAAA;IACT,gFAAgF;IAChF,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,8BAA8B,KAAK,IAAI,CAAA;IAC3D,wEAAwE;IACxE,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAA;IACvC,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAYD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,eA+N9D"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn } from "../../../lib/utils.js";
|
|
2
2
|
import { clampSurfaceFraction, normalizedSurfacePoint } from "./geometry.js";
|
|
3
3
|
import { className, createComponent, delegateEvents, effect, insert, memo, setAttribute, template, use } from "solid-js/web";
|
|
4
|
-
import { Show, createEffect, createSignal, createUniqueId, onCleanup, splitProps } from "solid-js";
|
|
4
|
+
import { Show, children, createEffect, createSignal, createUniqueId, onCleanup, splitProps } from "solid-js";
|
|
5
5
|
import "./annotation-surface.css";
|
|
6
6
|
// src/components/ui/annotation-surface/annotation-surface.tsx
|
|
7
7
|
var _tmpl$ = /*#__PURE__*/ template(`<span class="dev-annotation-surface__hint pointer-events-none absolute inset-0 grid place-items-center p-4 text-center text-xs text-muted-foreground">`);
|
|
@@ -45,6 +45,7 @@ function AnnotationSurface(props) {
|
|
|
45
45
|
]);
|
|
46
46
|
const [dragging, setDragging] = createSignal(false);
|
|
47
47
|
const hintId = createUniqueId();
|
|
48
|
+
const hint = children(() => local.hint);
|
|
48
49
|
let activeDrag;
|
|
49
50
|
let previousResetKey = local.resetKey;
|
|
50
51
|
let previousTool = local.tool;
|
|
@@ -167,7 +168,7 @@ function AnnotationSurface(props) {
|
|
|
167
168
|
height: Math.min(clampSurfaceFraction(region.height), 1 - y)
|
|
168
169
|
};
|
|
169
170
|
};
|
|
170
|
-
const describedBy = () => [local["aria-describedby"],
|
|
171
|
+
const describedBy = () => [local["aria-describedby"], hint() && !visibleRegion() ? hintId : void 0].filter(Boolean).join(" ") || void 0;
|
|
171
172
|
return (() => {
|
|
172
173
|
var _el$ = _tmpl$2();
|
|
173
174
|
_el$.$$keydown = handleKeyDown;
|
|
@@ -201,12 +202,12 @@ function AnnotationSurface(props) {
|
|
|
201
202
|
}), null);
|
|
202
203
|
insert(_el$, createComponent(Show, {
|
|
203
204
|
get when() {
|
|
204
|
-
return memo(() => !!
|
|
205
|
+
return memo(() => !!hint())() && !visibleRegion();
|
|
205
206
|
},
|
|
206
207
|
get children() {
|
|
207
208
|
var _el$2 = _tmpl$();
|
|
208
209
|
setAttribute(_el$2, "id", hintId);
|
|
209
|
-
insert(_el$2,
|
|
210
|
+
insert(_el$2, hint);
|
|
210
211
|
return _el$2;
|
|
211
212
|
}
|
|
212
213
|
}), null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotation-surface.js","names":["createEffect","createSignal","createUniqueId","onCleanup","Show","splitProps","cn","clampSurfaceFraction","normalizedSurfacePoint","x","y","width","height","start","current","currentTarget","label","tool","region","hint","interactive","resetKey","onPoint","point","event","onDragChange","drag","onKeyDown","ref","element","class","pointerId","target","pointFrom","bounds","getBoundingClientRect","clientX","clientY","AnnotationSurface","props","local","dragging","setDragging","hintId","activeDrag","previousResetKey","previousTool","isInteractive","releaseCapture","hasPointerCapture","releasePointerCapture","cancelDrag","release","undefined","handlePointerDown","isPrimary","button","preventDefault","focus","preventScroll","setPointerCapture","handlePointerMove","handlePointerUp","handlePointerCancel","handleLostPointerCapture","handleKeyDown","key","defaultPrevented","repeat","isComposing","altKey","ctrlKey","metaKey","visibleRegion","Math","min","describedBy","filter","Boolean","join","_el$","_tmpl$2","$$keydown","addEventListener","$$pointerup","$$pointermove","$$pointerdown","_$use","_$insert","_$createComponent","when","children","_el$3","_tmpl$3","_el$4","firstChild","_$effect","_p$","_v$8","_v$9","_v$0","_v$1","e","_$setAttribute","t","a","o","_$memo","_el$2","_tmpl$","_v$","id","_v$2","_v$3","_v$4","_v$5","_v$6","_v$7","i","n","s","_$className","_$delegateEvents"],"sources":["../../../../src/components/ui/annotation-surface/annotation-surface.tsx"],"sourcesContent":["import {\n createEffect,\n createSignal,\n createUniqueId,\n onCleanup,\n Show,\n splitProps,\n type JSX,\n} from 'solid-js'\nimport { cn } from '#lib/utils'\nimport './annotation-surface.css'\nimport {\n clampSurfaceFraction,\n normalizedSurfacePoint,\n type AnnotationSurfacePoint,\n} from './geometry'\n\nexport type AnnotationSurfaceRegion = Readonly<{\n x: number\n y: number\n width: number\n height: number\n}>\n\nexport type AnnotationSurfaceDrag = Readonly<{\n start: AnnotationSurfacePoint\n current: AnnotationSurfacePoint\n}>\n\nexport type AnnotationSurfaceTool = 'region' | 'point'\nexport type AnnotationSurfaceDragPhase = 'start' | 'move' | 'end' | 'cancel' | 'keyboard'\nexport type AnnotationSurfacePointerEvent = PointerEvent & { currentTarget: HTMLDivElement }\nexport type AnnotationSurfaceKeyboardEvent = KeyboardEvent & { currentTarget: HTMLDivElement }\nexport type AnnotationSurfaceInputEvent =\n | AnnotationSurfacePointerEvent\n | AnnotationSurfaceKeyboardEvent\n\ntype SurfaceElementProps = Pick<JSX.HTMLAttributes<HTMLDivElement>, 'id' | 'aria-describedby'>\n\nexport type AnnotationSurfaceProps = SurfaceElementProps & {\n /** Accessible instructions for the keyboard-operated surface. */\n label: string\n /** Region draws a captured drag; point reports a single placement point. */\n tool: AnnotationSurfaceTool\n /** Normalized 0..1 geometry supplied by the host; absent means no region. */\n region?: AnnotationSurfaceRegion\n /** Visible idle guidance. It is hidden while a region is present. */\n hint?: JSX.Element\n /** Disable new drawing while the host is busy. Defaults to true. */\n interactive?: boolean\n /** Changing this value cancels an in-flight drag owned by the host context. */\n resetKey?: string | number\n /** Receives one normalized point in point mode. */\n onPoint?: (point: AnnotationSurfacePoint, event: AnnotationSurfaceInputEvent) => void\n /** Receives drag phases; cancel has no drag and fires at most once per capture. */\n onDragChange?: (\n drag: AnnotationSurfaceDrag | undefined,\n phase: AnnotationSurfaceDragPhase,\n event?: AnnotationSurfaceInputEvent\n ) => void\n /** Domain keyboard policy stays with the host and receives the native event. */\n onKeyDown?: (event: AnnotationSurfaceKeyboardEvent) => void\n /** Ref to the actual focusable and pointer-capturing HTMLDivElement. */\n ref?: (element: HTMLDivElement) => void\n /** Layout only; appearance remains owned by the shared component. */\n class?: string\n}\n\ntype ActiveDrag = AnnotationSurfaceDrag & {\n pointerId: number\n target: HTMLDivElement\n}\n\nfunction pointFrom(event: PointerEvent, target: HTMLDivElement): AnnotationSurfacePoint {\n const bounds = target.getBoundingClientRect()\n return normalizedSurfacePoint(event.clientX, event.clientY, bounds)\n}\n\n/**\n * AnnotationSurface.\n *\n * A keyboard-focusable, viewport-shaped drawing surface for hosts that own an\n * annotation domain. It renders normalized region geometry and idle guidance,\n * captures region drags, and reports normalized points without reading or\n * rendering screenshot pixels. The host keeps tool policy, domain geometry,\n * persistence and capture commands.\n *\n * This bespoke application widget is necessary because a generic button or\n * slider cannot represent a two-dimensional drawing viewport. Its keyboard\n * behavior is supplied by the host and forwarded as a native key event. Space\n * creates a centered region or places a point at the center; Escape is left to\n * the host first, which can prevent the default gesture cancellation while it\n * applies its own draft and mode rules.\n */\nexport function AnnotationSurface(props: AnnotationSurfaceProps) {\n const [local] = splitProps(props, [\n 'id',\n 'aria-describedby',\n 'label',\n 'tool',\n 'region',\n 'hint',\n 'interactive',\n 'resetKey',\n 'onPoint',\n 'onDragChange',\n 'onKeyDown',\n 'ref',\n 'class',\n ])\n\n const [dragging, setDragging] = createSignal(false)\n const hintId = createUniqueId()\n let activeDrag: ActiveDrag | undefined\n let previousResetKey = local.resetKey\n let previousTool = local.tool\n\n const isInteractive = () => local.interactive ?? true\n\n function releaseCapture(drag: ActiveDrag): void {\n try {\n if (drag.target.hasPointerCapture(drag.pointerId))\n drag.target.releasePointerCapture(drag.pointerId)\n } catch {\n // The browser may release capture while a host reset or unmount is running.\n }\n }\n\n function cancelDrag(event?: AnnotationSurfaceInputEvent, release = true): void {\n const drag = activeDrag\n if (!drag) return\n\n activeDrag = undefined\n setDragging(false)\n if (release) releaseCapture(drag)\n local.onDragChange?.(undefined, 'cancel', event)\n }\n\n createEffect(() => {\n const resetKey = local.resetKey\n const tool = local.tool\n const interactive = isInteractive()\n if (activeDrag && (resetKey !== previousResetKey || tool !== previousTool || !interactive)) {\n cancelDrag()\n }\n previousResetKey = resetKey\n previousTool = tool\n })\n\n onCleanup(() => cancelDrag())\n\n function handlePointerDown(event: AnnotationSurfacePointerEvent): void {\n if (!isInteractive() || !event.isPrimary || event.button !== 0) return\n event.preventDefault()\n event.currentTarget.focus({ preventScroll: true })\n const point = pointFrom(event, event.currentTarget)\n if (activeDrag) return\n\n if (local.tool === 'point') {\n local.onPoint?.(point, event)\n return\n }\n\n try {\n event.currentTarget.setPointerCapture(event.pointerId)\n } catch {\n // A drag without real pointer capture can lose its final coordinates.\n return\n }\n\n const drag: ActiveDrag = {\n pointerId: event.pointerId,\n target: event.currentTarget,\n start: point,\n current: point,\n }\n activeDrag = drag\n setDragging(true)\n local.onDragChange?.({ start: point, current: point }, 'start', event)\n }\n\n function handlePointerMove(event: AnnotationSurfacePointerEvent): void {\n const drag = activeDrag\n if (!drag || drag.pointerId !== event.pointerId) return\n\n const current = pointFrom(event, event.currentTarget)\n activeDrag = { ...drag, current }\n local.onDragChange?.({ start: drag.start, current }, 'move', event)\n }\n\n function handlePointerUp(event: AnnotationSurfacePointerEvent): void {\n const drag = activeDrag\n if (!drag || drag.pointerId !== event.pointerId) return\n\n const current = pointFrom(event, event.currentTarget)\n activeDrag = undefined\n setDragging(false)\n releaseCapture(drag)\n local.onDragChange?.({ start: drag.start, current }, 'end', event)\n }\n\n function handlePointerCancel(event: AnnotationSurfacePointerEvent): void {\n if (activeDrag?.pointerId === event.pointerId) cancelDrag(event)\n }\n\n function handleLostPointerCapture(event: AnnotationSurfacePointerEvent): void {\n if (activeDrag?.pointerId === event.pointerId) cancelDrag(event, false)\n }\n\n function handleKeyDown(event: AnnotationSurfaceKeyboardEvent): void {\n local.onKeyDown?.(event)\n if (event.key === 'Escape') {\n if (!event.defaultPrevented) cancelDrag()\n return\n }\n if (\n event.defaultPrevented ||\n !isInteractive() ||\n event.key !== ' ' ||\n event.repeat ||\n event.isComposing ||\n event.altKey ||\n event.ctrlKey ||\n event.metaKey ||\n activeDrag\n )\n return\n\n event.preventDefault()\n if (local.tool === 'point') {\n local.onPoint?.({ x: 0.5, y: 0.5 }, event)\n return\n }\n\n local.onDragChange?.(\n {\n start: { x: 0.25, y: 0.25 },\n current: { x: 0.75, y: 0.75 },\n },\n 'keyboard',\n event\n )\n }\n\n const visibleRegion = (): AnnotationSurfaceRegion | undefined => {\n const region = local.region\n if (!region) return undefined\n const x = clampSurfaceFraction(region.x)\n const y = clampSurfaceFraction(region.y)\n return {\n x,\n y,\n width: Math.min(clampSurfaceFraction(region.width), 1 - x),\n height: Math.min(clampSurfaceFraction(region.height), 1 - y),\n }\n }\n\n const describedBy = () =>\n [local['aria-describedby'], local.hint && !visibleRegion() ? hintId : undefined]\n .filter(Boolean)\n .join(' ') || undefined\n\n return (\n <div\n id={local.id}\n aria-describedby={describedBy()}\n role=\"application\"\n aria-roledescription=\"annotation surface\"\n aria-label={local.label}\n aria-disabled={isInteractive() ? undefined : 'true'}\n tabIndex={0}\n data-tool={local.tool}\n data-dragging={dragging() ? 'true' : 'false'}\n class={cn(\n 'dev-annotation-surface relative isolate block w-full aspect-video select-none overflow-hidden rounded-md border border-border bg-muted/20 text-muted-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n local.class\n )}\n ref={(element) => local.ref?.(element)}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={handlePointerUp}\n onPointerCancel={handlePointerCancel}\n onLostPointerCapture={handleLostPointerCapture}\n onKeyDown={handleKeyDown}\n >\n <Show when={visibleRegion()}>\n {(region) => (\n <svg\n class=\"dev-annotation-surface__region pointer-events-none absolute inset-0 size-full\"\n viewBox=\"0 0 10000 10000\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n <rect\n class=\"fill-primary-subtle stroke-primary\"\n x={region().x * 10_000}\n y={region().y * 10_000}\n width={region().width * 10_000}\n height={region().height * 10_000}\n stroke-width=\"1.5\"\n vector-effect=\"non-scaling-stroke\"\n />\n </svg>\n )}\n </Show>\n <Show when={local.hint && !visibleRegion()}>\n <span\n id={hintId}\n class=\"dev-annotation-surface__hint pointer-events-none absolute inset-0 grid place-items-center p-4 text-center text-xs text-muted-foreground\"\n >\n {local.hint}\n </span>\n </Show>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;AAyEA,SAASiC,UAAUT,OAAqBQ,QAAgD;CACtF,MAAME,SAASF,OAAOG,sBAAsB;CAC5C,OAAO3B,uBAAuBgB,MAAMY,SAASZ,MAAMa,SAASH,MAAM;AACpE;;;;;;;;;;;;;;;;;AAkBA,SAAgBI,kBAAkBC,OAA+B;CAC/D,MAAM,CAACC,SAASnC,WAAWkC,OAAO;EAChC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAO,CACR;CAED,MAAM,CAACE,UAAUC,eAAezC,aAAa,KAAK;CAClD,MAAM0C,SAASzC,eAAe;CAC9B,IAAI0C;CACJ,IAAIC,mBAAmBL,MAAMnB;CAC7B,IAAIyB,eAAeN,MAAMvB;CAEzB,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,SAAAf,IAAAO,KAAAD,aAAAvB,MAAA,oBAAAiB,IAAAO,IAAAQ,IAAA;GAAAC,SAAAhB,IAAAQ,KAAAF,aAAAvB,MAAA,cAAAiB,IAAAQ,IAAAQ,IAAA;GAAAC,SAAAjB,IAAAS,KAAAH,aAAAvB,MAAA,iBAAAiB,IAAAS,IAAAQ,IAAA;GAAAC,SAAAlB,IAAAqB,KAAAf,aAAAvB,MAAA,aAAAiB,IAAAqB,IAAAH,IAAA;GAAAC,SAAAnB,IAAAsB,KAAAhB,aAAAvB,MAAA,iBAAAiB,IAAAsB,IAAAH,IAAA;GAAAC,SAAApB,IAAAuB,KAAAC,UAAAzC,MAAAiB,IAAAuB,IAAAH,IAAA;GAAA,OAAApB;EAAA,GAAA;GAAAK,GAAAjD,KAAAA;GAAAmD,GAAAnD,KAAAA;GAAAoD,GAAApD,KAAAA;GAAAqD,GAAArD,KAAAA;GAAAiE,GAAAjE,KAAAA;GAAAkE,GAAAlE,KAAAA;GAAAmE,GAAAnE,KAAAA;EAAA,CAAA;EAAA,OAAA2B;CAAA,EAAA,CAAA;AAuCP;AAAC0C,eAAA;CAAA;CAAA;CAAA;CAAA;AAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"annotation-surface.js","names":["children","createEffect","createSignal","createUniqueId","onCleanup","Show","splitProps","cn","clampSurfaceFraction","normalizedSurfacePoint","x","y","width","height","start","current","currentTarget","label","tool","region","hint","interactive","resetKey","onPoint","point","event","onDragChange","drag","onKeyDown","ref","element","class","pointerId","target","pointFrom","bounds","getBoundingClientRect","clientX","clientY","AnnotationSurface","props","local","dragging","setDragging","hintId","activeDrag","previousResetKey","previousTool","isInteractive","releaseCapture","hasPointerCapture","releasePointerCapture","cancelDrag","release","undefined","handlePointerDown","isPrimary","button","preventDefault","focus","preventScroll","setPointerCapture","handlePointerMove","handlePointerUp","handlePointerCancel","handleLostPointerCapture","handleKeyDown","key","defaultPrevented","repeat","isComposing","altKey","ctrlKey","metaKey","visibleRegion","Math","min","describedBy","filter","Boolean","join","_el$","_tmpl$2","$$keydown","addEventListener","$$pointerup","$$pointermove","$$pointerdown","_$use","_$insert","_$createComponent","when","_el$3","_tmpl$3","_el$4","firstChild","_$effect","_p$","_v$8","_v$9","_v$0","_v$1","e","_$setAttribute","t","a","o","_$memo","_el$2","_tmpl$","_v$","id","_v$2","_v$3","_v$4","_v$5","_v$6","_v$7","i","n","s","_$className","_$delegateEvents"],"sources":["../../../../src/components/ui/annotation-surface/annotation-surface.tsx"],"sourcesContent":["import {\n children,\n createEffect,\n createSignal,\n createUniqueId,\n onCleanup,\n Show,\n splitProps,\n type JSX,\n} from 'solid-js'\nimport { cn } from '#lib/utils'\nimport './annotation-surface.css'\nimport {\n clampSurfaceFraction,\n normalizedSurfacePoint,\n type AnnotationSurfacePoint,\n} from './geometry'\n\nexport type AnnotationSurfaceRegion = Readonly<{\n x: number\n y: number\n width: number\n height: number\n}>\n\nexport type AnnotationSurfaceDrag = Readonly<{\n start: AnnotationSurfacePoint\n current: AnnotationSurfacePoint\n}>\n\nexport type AnnotationSurfaceTool = 'region' | 'point'\nexport type AnnotationSurfaceDragPhase = 'start' | 'move' | 'end' | 'cancel' | 'keyboard'\nexport type AnnotationSurfacePointerEvent = PointerEvent & { currentTarget: HTMLDivElement }\nexport type AnnotationSurfaceKeyboardEvent = KeyboardEvent & { currentTarget: HTMLDivElement }\nexport type AnnotationSurfaceInputEvent =\n | AnnotationSurfacePointerEvent\n | AnnotationSurfaceKeyboardEvent\n\ntype SurfaceElementProps = Pick<JSX.HTMLAttributes<HTMLDivElement>, 'id' | 'aria-describedby'>\n\nexport type AnnotationSurfaceProps = SurfaceElementProps & {\n /** Accessible instructions for the keyboard-operated surface. */\n label: string\n /** Region draws a captured drag; point reports a single placement point. */\n tool: AnnotationSurfaceTool\n /** Normalized 0..1 geometry supplied by the host; absent means no region. */\n region?: AnnotationSurfaceRegion\n /** Visible idle guidance. It is hidden while a region is present. */\n hint?: JSX.Element\n /** Disable new drawing while the host is busy. Defaults to true. */\n interactive?: boolean\n /** Changing this value cancels an in-flight drag owned by the host context. */\n resetKey?: string | number\n /** Receives one normalized point in point mode. */\n onPoint?: (point: AnnotationSurfacePoint, event: AnnotationSurfaceInputEvent) => void\n /** Receives drag phases; cancel has no drag and fires at most once per capture. */\n onDragChange?: (\n drag: AnnotationSurfaceDrag | undefined,\n phase: AnnotationSurfaceDragPhase,\n event?: AnnotationSurfaceInputEvent\n ) => void\n /** Domain keyboard policy stays with the host and receives the native event. */\n onKeyDown?: (event: AnnotationSurfaceKeyboardEvent) => void\n /** Ref to the actual focusable and pointer-capturing HTMLDivElement. */\n ref?: (element: HTMLDivElement) => void\n /** Layout only; appearance remains owned by the shared component. */\n class?: string\n}\n\ntype ActiveDrag = AnnotationSurfaceDrag & {\n pointerId: number\n target: HTMLDivElement\n}\n\nfunction pointFrom(event: PointerEvent, target: HTMLDivElement): AnnotationSurfacePoint {\n const bounds = target.getBoundingClientRect()\n return normalizedSurfacePoint(event.clientX, event.clientY, bounds)\n}\n\n/**\n * AnnotationSurface.\n *\n * A keyboard-focusable, viewport-shaped drawing surface for hosts that own an\n * annotation domain. It renders normalized region geometry and idle guidance,\n * captures region drags, and reports normalized points without reading or\n * rendering screenshot pixels. The host keeps tool policy, domain geometry,\n * persistence and capture commands.\n *\n * This bespoke application widget is necessary because a generic button or\n * slider cannot represent a two-dimensional drawing viewport. Its keyboard\n * behavior is supplied by the host and forwarded as a native key event. Space\n * creates a centered region or places a point at the center; Escape is left to\n * the host first, which can prevent the default gesture cancellation while it\n * applies its own draft and mode rules.\n */\nexport function AnnotationSurface(props: AnnotationSurfaceProps) {\n const [local] = splitProps(props, [\n 'id',\n 'aria-describedby',\n 'label',\n 'tool',\n 'region',\n 'hint',\n 'interactive',\n 'resetKey',\n 'onPoint',\n 'onDragChange',\n 'onKeyDown',\n 'ref',\n 'class',\n ])\n\n const [dragging, setDragging] = createSignal(false)\n const hintId = createUniqueId()\n // The hint is JSX: read once, or every check of it builds another copy.\n const hint = children(() => local.hint)\n let activeDrag: ActiveDrag | undefined\n let previousResetKey = local.resetKey\n let previousTool = local.tool\n\n const isInteractive = () => local.interactive ?? true\n\n function releaseCapture(drag: ActiveDrag): void {\n try {\n if (drag.target.hasPointerCapture(drag.pointerId))\n drag.target.releasePointerCapture(drag.pointerId)\n } catch {\n // The browser may release capture while a host reset or unmount is running.\n }\n }\n\n function cancelDrag(event?: AnnotationSurfaceInputEvent, release = true): void {\n const drag = activeDrag\n if (!drag) return\n\n activeDrag = undefined\n setDragging(false)\n if (release) releaseCapture(drag)\n local.onDragChange?.(undefined, 'cancel', event)\n }\n\n createEffect(() => {\n const resetKey = local.resetKey\n const tool = local.tool\n const interactive = isInteractive()\n if (activeDrag && (resetKey !== previousResetKey || tool !== previousTool || !interactive)) {\n cancelDrag()\n }\n previousResetKey = resetKey\n previousTool = tool\n })\n\n onCleanup(() => cancelDrag())\n\n function handlePointerDown(event: AnnotationSurfacePointerEvent): void {\n if (!isInteractive() || !event.isPrimary || event.button !== 0) return\n event.preventDefault()\n event.currentTarget.focus({ preventScroll: true })\n const point = pointFrom(event, event.currentTarget)\n if (activeDrag) return\n\n if (local.tool === 'point') {\n local.onPoint?.(point, event)\n return\n }\n\n try {\n event.currentTarget.setPointerCapture(event.pointerId)\n } catch {\n // A drag without real pointer capture can lose its final coordinates.\n return\n }\n\n const drag: ActiveDrag = {\n pointerId: event.pointerId,\n target: event.currentTarget,\n start: point,\n current: point,\n }\n activeDrag = drag\n setDragging(true)\n local.onDragChange?.({ start: point, current: point }, 'start', event)\n }\n\n function handlePointerMove(event: AnnotationSurfacePointerEvent): void {\n const drag = activeDrag\n if (!drag || drag.pointerId !== event.pointerId) return\n\n const current = pointFrom(event, event.currentTarget)\n activeDrag = { ...drag, current }\n local.onDragChange?.({ start: drag.start, current }, 'move', event)\n }\n\n function handlePointerUp(event: AnnotationSurfacePointerEvent): void {\n const drag = activeDrag\n if (!drag || drag.pointerId !== event.pointerId) return\n\n const current = pointFrom(event, event.currentTarget)\n activeDrag = undefined\n setDragging(false)\n releaseCapture(drag)\n local.onDragChange?.({ start: drag.start, current }, 'end', event)\n }\n\n function handlePointerCancel(event: AnnotationSurfacePointerEvent): void {\n if (activeDrag?.pointerId === event.pointerId) cancelDrag(event)\n }\n\n function handleLostPointerCapture(event: AnnotationSurfacePointerEvent): void {\n if (activeDrag?.pointerId === event.pointerId) cancelDrag(event, false)\n }\n\n function handleKeyDown(event: AnnotationSurfaceKeyboardEvent): void {\n local.onKeyDown?.(event)\n if (event.key === 'Escape') {\n if (!event.defaultPrevented) cancelDrag()\n return\n }\n if (\n event.defaultPrevented ||\n !isInteractive() ||\n event.key !== ' ' ||\n event.repeat ||\n event.isComposing ||\n event.altKey ||\n event.ctrlKey ||\n event.metaKey ||\n activeDrag\n )\n return\n\n event.preventDefault()\n if (local.tool === 'point') {\n local.onPoint?.({ x: 0.5, y: 0.5 }, event)\n return\n }\n\n local.onDragChange?.(\n {\n start: { x: 0.25, y: 0.25 },\n current: { x: 0.75, y: 0.75 },\n },\n 'keyboard',\n event\n )\n }\n\n const visibleRegion = (): AnnotationSurfaceRegion | undefined => {\n const region = local.region\n if (!region) return undefined\n const x = clampSurfaceFraction(region.x)\n const y = clampSurfaceFraction(region.y)\n return {\n x,\n y,\n width: Math.min(clampSurfaceFraction(region.width), 1 - x),\n height: Math.min(clampSurfaceFraction(region.height), 1 - y),\n }\n }\n\n const describedBy = () =>\n [local['aria-describedby'], hint() && !visibleRegion() ? hintId : undefined]\n .filter(Boolean)\n .join(' ') || undefined\n\n return (\n <div\n id={local.id}\n aria-describedby={describedBy()}\n role=\"application\"\n aria-roledescription=\"annotation surface\"\n aria-label={local.label}\n aria-disabled={isInteractive() ? undefined : 'true'}\n tabIndex={0}\n data-tool={local.tool}\n data-dragging={dragging() ? 'true' : 'false'}\n class={cn(\n 'dev-annotation-surface relative isolate block w-full aspect-video select-none overflow-hidden rounded-md border border-border bg-muted/20 text-muted-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n local.class\n )}\n ref={(element) => local.ref?.(element)}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={handlePointerUp}\n onPointerCancel={handlePointerCancel}\n onLostPointerCapture={handleLostPointerCapture}\n onKeyDown={handleKeyDown}\n >\n <Show when={visibleRegion()}>\n {(region) => (\n <svg\n class=\"dev-annotation-surface__region pointer-events-none absolute inset-0 size-full\"\n viewBox=\"0 0 10000 10000\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n <rect\n class=\"fill-primary-subtle stroke-primary\"\n x={region().x * 10_000}\n y={region().y * 10_000}\n width={region().width * 10_000}\n height={region().height * 10_000}\n stroke-width=\"1.5\"\n vector-effect=\"non-scaling-stroke\"\n />\n </svg>\n )}\n </Show>\n <Show when={hint() && !visibleRegion()}>\n <span\n id={hintId}\n class=\"dev-annotation-surface__hint pointer-events-none absolute inset-0 grid place-items-center p-4 text-center text-xs text-muted-foreground\"\n >\n {hint()}\n </span>\n </Show>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;AA0EA,SAASkC,UAAUT,OAAqBQ,QAAgD;CACtF,MAAME,SAASF,OAAOG,sBAAsB;CAC5C,OAAO3B,uBAAuBgB,MAAMY,SAASZ,MAAMa,SAASH,MAAM;AACpE;;;;;;;;;;;;;;;;;AAkBA,SAAgBI,kBAAkBC,OAA+B;CAC/D,MAAM,CAACC,SAASnC,WAAWkC,OAAO;EAChC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAO,CACR;CAED,MAAM,CAACE,UAAUC,eAAezC,aAAa,KAAK;CAClD,MAAM0C,SAASzC,eAAe;CAE9B,MAAMiB,OAAOpB,eAAeyC,MAAMrB,IAAI;CACtC,IAAIyB;CACJ,IAAIC,mBAAmBL,MAAMnB;CAC7B,IAAIyB,eAAeN,MAAMvB;CAEzB,MAAM8B,sBAAsBP,MAAMpB,eAAe;CAEjD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IAAAO,IAAAQ,IAAA;GAAAC,SAAAhB,IAAAQ,KAAAF,aAAAtB,MAAA,cAAAgB,IAAAQ,IAAAQ,IAAA;GAAAC,SAAAjB,IAAAS,KAAAH,aAAAtB,MAAA,iBAAAgB,IAAAS,IAAAQ,IAAA;GAAAC,SAAAlB,IAAAqB,KAAAf,aAAAtB,MAAA,aAAAgB,IAAAqB,IAAAH,IAAA;GAAAC,SAAAnB,IAAAsB,KAAAhB,aAAAtB,MAAA,iBAAAgB,IAAAsB,IAAAH,IAAA;GAAAC,SAAApB,IAAAuB,KAAAC,UAAAxC,MAAAgB,IAAAuB,IAAAH,IAAA;GAAA,OAAApB;EAAA,GAAA;GAAAK,GAAAhD,KAAAA;GAAAkD,GAAAlD,KAAAA;GAAAmD,GAAAnD,KAAAA;GAAAoD,GAAApD,KAAAA;GAAAgE,GAAAhE,KAAAA;GAAAiE,GAAAjE,KAAAA;GAAAkE,GAAAlE,KAAAA;EAAA,CAAA;EAAA,OAAA2B;CAAA,EAAA,CAAA;AAuCP;AAACyC,eAAA;CAAA;CAAA;CAAA;CAAA;AAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/attachment/attachment.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAoB,KAAK,cAAc,EAAE,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/attachment/attachment.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAoB,KAAK,cAAc,EAAE,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AAiB1E;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAA;AACzF,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,WAAW,GAAG,OAAO,GAAG,aAAa,CAAA;AAC9E,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;AAcxD,gFAAgF;AAChF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAGlF;AAED,0CAA0C;AAC1C,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAK5E;AAED,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IACtE,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB,aAAa;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,iBAAiB,CAAA;IAC3B,MAAM,CAAC,EAAE,gBAAgB,CAAA;IACzB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,iEAAiE;IACjE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,eAgKhD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,eAYzD"}
|
|
@@ -2,6 +2,7 @@ import { formatByteSize } from "../../../lib/bytes.js";
|
|
|
2
2
|
import { FETCH_SCHEMES, urlWithScheme } from "../../../lib/url.js";
|
|
3
3
|
import { cn } from "../../../lib/utils.js";
|
|
4
4
|
import { Button } from "../button/button.js";
|
|
5
|
+
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
5
6
|
import { className, createComponent, delegateEvents, effect, insert, memo, mergeProps, setAttribute, spread, template } from "solid-js/web";
|
|
6
7
|
import { Archive, File, FileCode, FileText, Image, LoaderCircle, TriangleAlert, X } from "lucide-solid";
|
|
7
8
|
import { Show, splitProps } from "solid-js";
|
|
@@ -16,13 +17,21 @@ var _tmpl$7 = /*#__PURE__*/ template(`<span class="flex min-w-0 items-center gap
|
|
|
16
17
|
var _tmpl$8 = /*#__PURE__*/ template(`<div data-slot=attachment>`);
|
|
17
18
|
var _tmpl$9 = /*#__PURE__*/ template(`<span class="flex min-w-0 flex-1 items-center gap-2">`);
|
|
18
19
|
var _tmpl$0 = /*#__PURE__*/ template(`<ul role=list data-slot=attachment-list>`);
|
|
20
|
+
var Archive$1 = fastIcon(Archive);
|
|
21
|
+
var FileIcon = fastIcon(File);
|
|
22
|
+
var FileCode$1 = fastIcon(FileCode);
|
|
23
|
+
var FileText$1 = fastIcon(FileText);
|
|
24
|
+
var ImageIcon = fastIcon(Image);
|
|
25
|
+
var LoaderCircle$1 = fastIcon(LoaderCircle);
|
|
26
|
+
var TriangleAlert$1 = fastIcon(TriangleAlert);
|
|
27
|
+
var X$1 = fastIcon(X);
|
|
19
28
|
var KIND_ICON = {
|
|
20
|
-
image:
|
|
21
|
-
document: FileText,
|
|
22
|
-
code: FileCode,
|
|
23
|
-
text: FileText,
|
|
24
|
-
archive: Archive,
|
|
25
|
-
other:
|
|
29
|
+
image: ImageIcon,
|
|
30
|
+
document: FileText$1,
|
|
31
|
+
code: FileCode$1,
|
|
32
|
+
text: FileText$1,
|
|
33
|
+
archive: Archive$1,
|
|
34
|
+
other: FileIcon
|
|
26
35
|
};
|
|
27
36
|
/** The figure as written: whole numbers from 10 up, one decimal below. */
|
|
28
37
|
var shown = (amount) => amount >= 10 ? Math.round(amount) : Math.round(amount * 10) / 10;
|
|
@@ -66,11 +75,11 @@ function Attachment(props) {
|
|
|
66
75
|
const size = () => formatAttachmentSize(local.size);
|
|
67
76
|
const actionable = () => status() === "ready" || status() === "error";
|
|
68
77
|
const mark = () => {
|
|
69
|
-
if (status() === "uploading") return createComponent(LoaderCircle, {
|
|
78
|
+
if (status() === "uploading") return createComponent(LoaderCircle$1, {
|
|
70
79
|
"aria-hidden": "true",
|
|
71
80
|
"class": "motion-safe:animate-spin"
|
|
72
81
|
});
|
|
73
|
-
if (status() === "error") return createComponent(TriangleAlert, { "aria-hidden": "true" });
|
|
82
|
+
if (status() === "error") return createComponent(TriangleAlert$1, { "aria-hidden": "true" });
|
|
74
83
|
const Glyph = Icon();
|
|
75
84
|
return createComponent(Glyph, { "aria-hidden": "true" });
|
|
76
85
|
};
|
|
@@ -158,7 +167,7 @@ function Attachment(props) {
|
|
|
158
167
|
},
|
|
159
168
|
onClick: () => local.onRemove?.(),
|
|
160
169
|
get children() {
|
|
161
|
-
return createComponent(X, { "aria-hidden": "true" });
|
|
170
|
+
return createComponent(X$1, { "aria-hidden": "true" });
|
|
162
171
|
}
|
|
163
172
|
});
|
|
164
173
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment.js","names":["Archive","FileIcon","FileCode","FileText","ImageIcon","LoaderCircle","TriangleAlert","X","Show","splitProps","formatByteSize","FETCH_SCHEMES","urlWithScheme","cn","Button","KIND_ICON","image","document","code","text","archive","other","shown","amount","Math","round","formatAttachmentSize","bytes","undefined","Number","isFinite","value","String","safePreviewSrc","startsWith","test","name","kind","size","variant","status","progress","statusLabel","previewSrc","onOpen","href","onRemove","removeLabel","Attachment","props","local","rest","preview","Icon","actionable","mark","_$createComponent","Glyph","label","_el$","_tmpl$","_$insert","_$effect","_$setAttribute","when","_$memo","fallback","children","_el$3","_tmpl$3","$$click","_el$2","_tmpl$2","_p$","_v$","_v$2","e","t","detail","_el$4","_tmpl$4","_c$","_v$3","_v$4","_$className","remove","type","onClick","_el$5","_tmpl$8","_$spread","_$mergeProps","class","_el$9","_el$0","_tmpl$5","_el$1","_tmpl$9","_el$6","_tmpl$6","_el$7","_el$8","_tmpl$7","AttachmentList","_el$10","_tmpl$0","_$delegateEvents"],"sources":["../../../../src/components/ui/attachment/attachment.tsx"],"sourcesContent":["import {\n Archive,\n File as FileIcon,\n FileCode,\n FileText,\n Image as ImageIcon,\n LoaderCircle,\n TriangleAlert,\n X,\n} from 'lucide-solid'\nimport { Show, splitProps, type ComponentProps, type JSX } from 'solid-js'\nimport { formatByteSize } from '#lib/bytes'\nimport { FETCH_SCHEMES, urlWithScheme } from '#lib/url'\nimport { cn } from '#lib/utils'\nimport { Button } from '../button'\n\n/**\n * Attachment.\n *\n * A file that travels with a message or sits in the composer. Three\n * presentations of one thing: a `chip` (a line, for the composer and for a list\n * of many), a `card` (name, type and size, for a message's attachments), and a\n * `tile` (a preview image with the name beneath, for pictures).\n *\n * ## It only offers what works\n *\n * An attachment is a *claim that a file exists and can be handled*. This\n * component therefore draws an action only when the caller supplied the\n * handler: no `onOpen`/`href` and the name is plain text, not a dead button; no\n * `onRemove` and there is no ✕. A host whose attachments cannot be reopened (a\n * name the runtime echoed back, a file that was never stored) renders honest,\n * static chips instead of controls that do nothing.\n *\n * ## Untrusted metadata\n *\n * Name, type and size come from whoever sent the file. They are rendered as\n * text, the name is never used as a path or URL, and a preview is shown only\n * for `blob:`, `https:`/`http:` or a `data:image/*` raster source (no SVG, which\n * can carry script when opened on its own).\n *\n * `status` states the truth about the file's lifecycle in words (`uploading`,\n * `error`, `unavailable`), not by colour alone.\n */\nexport type AttachmentKind = 'image' | 'document' | 'code' | 'text' | 'archive' | 'other'\nexport type AttachmentStatus = 'ready' | 'uploading' | 'error' | 'unavailable'\nexport type AttachmentVariant = 'chip' | 'card' | 'tile'\n\nconst KIND_ICON = {\n image: ImageIcon,\n document: FileText,\n code: FileCode,\n text: FileText,\n archive: Archive,\n other: FileIcon,\n} as const\n\n/** The figure as written: whole numbers from 10 up, one decimal below. */\nconst shown = (amount: number) => (amount >= 10 ? Math.round(amount) : Math.round(amount * 10) / 10)\n\n/** `1536` → `1.5 KB`. Returns nothing for a value that is not a finite size. */\nexport function formatAttachmentSize(bytes: number | undefined): string | undefined {\n if (bytes === undefined || !Number.isFinite(bytes) || bytes < 0) return undefined\n return formatByteSize(bytes, ['KB', 'MB', 'GB', 'TB'], (value) => String(shown(value)))\n}\n\n/** The only sources a preview may use. */\nexport function safePreviewSrc(value: string | undefined): string | undefined {\n if (!value) return undefined\n if (value.startsWith('blob:')) return value\n if (/^data:image\\/(?:png|jpe?g|gif|webp|avif);base64,[A-Za-z0-9+/=]+$/.test(value)) return value\n return urlWithScheme(value, FETCH_SCHEMES) ? value : undefined\n}\n\nexport type AttachmentProps = Omit<ComponentProps<'div'>, 'children'> & {\n name: string\n kind?: AttachmentKind\n /** Bytes. */\n size?: number\n variant?: AttachmentVariant\n status?: AttachmentStatus\n /** 0–100 while `uploading`; omit for indeterminate. */\n progress?: number\n /** Why it failed or is unavailable, in words. */\n statusLabel?: string\n previewSrc?: string\n /** Open the file in the host. Omit and the name is not a control. */\n onOpen?: () => void\n /** Open the file by address. Omit and the name is not a link. */\n href?: string\n /** Detach it. Omit and there is no remove control. */\n onRemove?: () => void\n removeLabel?: string\n}\n\nexport function Attachment(props: AttachmentProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'name',\n 'kind',\n 'size',\n 'variant',\n 'status',\n 'progress',\n 'statusLabel',\n 'previewSrc',\n 'onOpen',\n 'href',\n 'onRemove',\n 'removeLabel',\n ])\n const variant = () => local.variant ?? 'chip'\n const status = () => local.status ?? 'ready'\n const preview = () => (local.kind === 'image' ? safePreviewSrc(local.previewSrc) : undefined)\n const Icon = () => KIND_ICON[local.kind ?? 'other']\n const size = () => formatAttachmentSize(local.size)\n const actionable = () => status() === 'ready' || status() === 'error'\n\n const mark = (): JSX.Element => {\n if (status() === 'uploading')\n return <LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />\n if (status() === 'error') return <TriangleAlert aria-hidden=\"true\" />\n const Glyph = Icon()\n return <Glyph aria-hidden=\"true\" />\n }\n\n const label = (): JSX.Element => (\n <span class=\"min-w-0 truncate font-medium\" title={local.name}>\n {local.name}\n </span>\n )\n\n const name = (): JSX.Element => (\n <Show\n when={actionable() && (local.href !== undefined || local.onOpen !== undefined)}\n fallback={label()}\n >\n <Show\n when={local.href !== undefined}\n fallback={\n <button\n type=\"button\"\n class=\"min-w-0 truncate rounded-xs text-start font-medium outline-none hover:underline focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n title={local.name}\n onClick={() => local.onOpen?.()}\n >\n {local.name}\n </button>\n }\n >\n <a\n href={local.href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"min-w-0 truncate rounded-xs font-medium outline-none hover:underline focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n title={local.name}\n >\n {local.name}\n </a>\n </Show>\n </Show>\n )\n\n const detail = (): JSX.Element => (\n <Show when={status() !== 'ready' || size()}>\n <span\n class={cn('shrink-0 text-xs', {\n 'text-destructive': status() === 'error',\n 'text-muted-foreground': status() !== 'error',\n })}\n role={status() === 'uploading' || status() === 'error' ? 'status' : undefined}\n >\n {status() === 'uploading'\n ? local.progress === undefined\n ? 'Uploading…'\n : `Uploading ${Math.round(local.progress)}%`\n : status() === 'error'\n ? (local.statusLabel ?? 'Could not attach')\n : status() === 'unavailable'\n ? (local.statusLabel ?? 'Unavailable')\n : size()}\n </span>\n </Show>\n )\n\n const remove = (): JSX.Element => (\n <Show when={local.onRemove}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n class=\"shrink-0\"\n aria-label={local.removeLabel ?? `Remove ${local.name}`}\n onClick={() => local.onRemove?.()}\n >\n <X aria-hidden=\"true\" />\n </Button>\n </Show>\n )\n\n return (\n <div\n data-slot=\"attachment\"\n data-variant={variant()}\n data-status={status()}\n class={cn(\n 'min-w-0 text-sm',\n {\n 'inline-flex max-w-full items-center gap-1.5 rounded-lg border border-border bg-card py-1 ps-2 pe-1':\n variant() === 'chip',\n 'flex w-full max-w-sm items-center gap-2.5 rounded-xl border border-border bg-card p-2':\n variant() === 'card',\n 'flex w-32 flex-col gap-1.5': variant() === 'tile',\n 'border-destructive': status() === 'error',\n 'opacity-70': status() === 'unavailable',\n },\n local.class\n )}\n {...rest}\n >\n <Show\n when={variant() === 'tile'}\n fallback={\n <>\n <span\n class={cn('grid shrink-0 place-items-center text-muted-foreground [&_svg]:size-4', {\n 'size-9 overflow-hidden rounded-lg bg-muted': variant() === 'card',\n 'text-destructive': status() === 'error',\n })}\n >\n <Show when={preview() && variant() === 'card'} fallback={mark()}>\n <img src={preview()} alt=\"\" class=\"size-full object-cover\" />\n </Show>\n </span>\n <span class=\"flex min-w-0 flex-1 items-center gap-2\">\n {name()}\n {detail()}\n </span>\n {remove()}\n </>\n }\n >\n <span class=\"relative grid aspect-square w-full place-items-center overflow-hidden rounded-xl border border-border bg-muted text-muted-foreground [&_svg]:size-6\">\n <Show when={preview()} fallback={mark()}>\n <img src={preview()} alt=\"\" class=\"size-full object-cover\" />\n </Show>\n </span>\n <span class=\"flex min-w-0 items-center gap-1\">\n {name()}\n {remove()}\n </span>\n {detail()}\n </Show>\n </div>\n )\n}\n\nexport function AttachmentList(props: ComponentProps<'ul'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <ul\n role=\"list\"\n data-slot=\"attachment-list\"\n class={cn('m-0 flex min-w-0 list-none flex-wrap gap-2 p-0', local.class)}\n {...rest}\n >\n {local.children}\n </ul>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA+CA,IAAMe,YAAY;CAChBC,OAAOZ;CACPa,UAAUd;CACVe,MAAMhB;CACNiB,MAAMhB;CACNiB,SAASpB;CACTqB,OAAOpB;AACT;;AAGA,IAAMqB,SAASC,WAAoBA,UAAU,KAAKC,KAAKC,MAAMF,MAAM,IAAIC,KAAKC,MAAMF,SAAS,EAAE,IAAI;;AAGjG,SAAg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AAA;KAAA/B,KAERoB,MAAM;IAAA;GAAA;GAAA,IAAAlB,WAAA;IAAA,OAAA;YAAA;MAAA,IAAA+B,QAAAC,QAAA;MAAAtC,OAAAqC,OAAA1C,gBAKRhD,MAAI;OAAA,IAACwD,OAAI;QAAA,OAAEZ,QAAQ;OAAC;OAAA,IAAEc,WAAQ;QAAA,OAAEX,KAAK;OAAC;OAAA,IAAAY,WAAA;QAAA,IAAAiC,QAAAL,QAAA;QAAAjC,aAAAC,aAAAqC,OAAA,OAC3BhD,QAAQ,CAAC,CAAA;QAAA,OAAAgD;OAAA;MAAA,CAAA,CAAA;MAAA,OAAAF;KAAA,EAAA,CAAA;YAAA;MAAA,IAAAG,QAAAC,QAAA;MAAAzC,OAAAwC,OAIpBjE,MAAI,IAAA;MAAAyB,OAAAwC,OACJhB,QAAM,IAAA;MAAA,OAAAgB;KAAA,EAAA,CAAA;KAAApC,WAERa,OAAO,CAAC;IAAA;GAAA;EAAA,CAAA,CAAA;EAAA,OAAAU;CAAA,EAAA,CAAA;AAIjB;AAEA,SAAgBe,eAAetD,OAA6B;CAC1D,MAAM,CAACC,OAAOC,QAAQ1C,WAAWwC,OAAO,CAAC,SAAS,UAAU,CAAC;CAC7D,cAAA;EAAA,IAAAuD,SAAAC,QAAA;EAAAf,OAAAc,QAAAb,WAAA,EAAA,KAAA,WAAA;GAAA,OAIW9E,GAAG,kDAAkDqC,MAAM0C,KAAK;EAAC,EAAA,GACpEzC,IAAI,GAAA,OAAA,IAAA;EAAAU,OAAA2C,cAEPtD,MAAMiB,QAAQ;EAAA,OAAAqC;CAAA,EAAA,CAAA;AAGrB;AAACE,eAAA,CAAA,OAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"attachment.js","names":["Archive","LucideArchive","LucideFileIcon","FileCode","LucideFileCode","FileText","LucideFileText","LucideImageIcon","LoaderCircle","LucideLoaderCircle","TriangleAlert","LucideTriangleAlert","X","LucideX","Show","splitProps","formatByteSize","FETCH_SCHEMES","urlWithScheme","cn","Button","fastIcon","FileIcon","ImageIcon","KIND_ICON","image","document","code","text","archive","other","shown","amount","Math","round","formatAttachmentSize","bytes","undefined","Number","isFinite","value","String","safePreviewSrc","startsWith","test","name","kind","size","variant","status","progress","statusLabel","previewSrc","onOpen","href","onRemove","removeLabel","Attachment","props","local","rest","preview","Icon","actionable","mark","_$createComponent","Glyph","label","_el$","_tmpl$","_$insert","_$effect","_$setAttribute","when","_$memo","fallback","children","_el$3","_tmpl$3","$$click","_el$2","_tmpl$2","_p$","_v$","_v$2","e","t","detail","_el$4","_tmpl$4","_c$","_v$3","_v$4","_$className","remove","type","onClick","_el$5","_tmpl$8","_$spread","_$mergeProps","class","_el$9","_el$0","_tmpl$5","_el$1","_tmpl$9","_el$6","_tmpl$6","_el$7","_el$8","_tmpl$7","AttachmentList","_el$10","_tmpl$0","_$delegateEvents"],"sources":["../../../../src/components/ui/attachment/attachment.tsx"],"sourcesContent":["import {\n Archive as LucideArchive,\n File as LucideFileIcon,\n FileCode as LucideFileCode,\n FileText as LucideFileText,\n Image as LucideImageIcon,\n LoaderCircle as LucideLoaderCircle,\n TriangleAlert as LucideTriangleAlert,\n X as LucideX,\n} from 'lucide-solid'\nimport { Show, splitProps, type ComponentProps, type JSX } from 'solid-js'\nimport { formatByteSize } from '#lib/bytes'\nimport { FETCH_SCHEMES, urlWithScheme } from '#lib/url'\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 Archive = fastIcon(LucideArchive)\nconst FileIcon = fastIcon(LucideFileIcon)\nconst FileCode = fastIcon(LucideFileCode)\nconst FileText = fastIcon(LucideFileText)\nconst ImageIcon = fastIcon(LucideImageIcon)\nconst LoaderCircle = fastIcon(LucideLoaderCircle)\nconst TriangleAlert = fastIcon(LucideTriangleAlert)\nconst X = fastIcon(LucideX)\n\n/**\n * Attachment.\n *\n * A file that travels with a message or sits in the composer. Three\n * presentations of one thing: a `chip` (a line, for the composer and for a list\n * of many), a `card` (name, type and size, for a message's attachments), and a\n * `tile` (a preview image with the name beneath, for pictures).\n *\n * ## It only offers what works\n *\n * An attachment is a *claim that a file exists and can be handled*. This\n * component therefore draws an action only when the caller supplied the\n * handler: no `onOpen`/`href` and the name is plain text, not a dead button; no\n * `onRemove` and there is no ✕. A host whose attachments cannot be reopened (a\n * name the runtime echoed back, a file that was never stored) renders honest,\n * static chips instead of controls that do nothing.\n *\n * ## Untrusted metadata\n *\n * Name, type and size come from whoever sent the file. They are rendered as\n * text, the name is never used as a path or URL, and a preview is shown only\n * for `blob:`, `https:`/`http:` or a `data:image/*` raster source (no SVG, which\n * can carry script when opened on its own).\n *\n * `status` states the truth about the file's lifecycle in words (`uploading`,\n * `error`, `unavailable`), not by colour alone.\n */\nexport type AttachmentKind = 'image' | 'document' | 'code' | 'text' | 'archive' | 'other'\nexport type AttachmentStatus = 'ready' | 'uploading' | 'error' | 'unavailable'\nexport type AttachmentVariant = 'chip' | 'card' | 'tile'\n\nconst KIND_ICON = {\n image: ImageIcon,\n document: FileText,\n code: FileCode,\n text: FileText,\n archive: Archive,\n other: FileIcon,\n} as const\n\n/** The figure as written: whole numbers from 10 up, one decimal below. */\nconst shown = (amount: number) => (amount >= 10 ? Math.round(amount) : Math.round(amount * 10) / 10)\n\n/** `1536` → `1.5 KB`. Returns nothing for a value that is not a finite size. */\nexport function formatAttachmentSize(bytes: number | undefined): string | undefined {\n if (bytes === undefined || !Number.isFinite(bytes) || bytes < 0) return undefined\n return formatByteSize(bytes, ['KB', 'MB', 'GB', 'TB'], (value) => String(shown(value)))\n}\n\n/** The only sources a preview may use. */\nexport function safePreviewSrc(value: string | undefined): string | undefined {\n if (!value) return undefined\n if (value.startsWith('blob:')) return value\n if (/^data:image\\/(?:png|jpe?g|gif|webp|avif);base64,[A-Za-z0-9+/=]+$/.test(value)) return value\n return urlWithScheme(value, FETCH_SCHEMES) ? value : undefined\n}\n\nexport type AttachmentProps = Omit<ComponentProps<'div'>, 'children'> & {\n name: string\n kind?: AttachmentKind\n /** Bytes. */\n size?: number\n variant?: AttachmentVariant\n status?: AttachmentStatus\n /** 0–100 while `uploading`; omit for indeterminate. */\n progress?: number\n /** Why it failed or is unavailable, in words. */\n statusLabel?: string\n previewSrc?: string\n /** Open the file in the host. Omit and the name is not a control. */\n onOpen?: () => void\n /** Open the file by address. Omit and the name is not a link. */\n href?: string\n /** Detach it. Omit and there is no remove control. */\n onRemove?: () => void\n removeLabel?: string\n}\n\nexport function Attachment(props: AttachmentProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'name',\n 'kind',\n 'size',\n 'variant',\n 'status',\n 'progress',\n 'statusLabel',\n 'previewSrc',\n 'onOpen',\n 'href',\n 'onRemove',\n 'removeLabel',\n ])\n const variant = () => local.variant ?? 'chip'\n const status = () => local.status ?? 'ready'\n const preview = () => (local.kind === 'image' ? safePreviewSrc(local.previewSrc) : undefined)\n const Icon = () => KIND_ICON[local.kind ?? 'other']\n const size = () => formatAttachmentSize(local.size)\n const actionable = () => status() === 'ready' || status() === 'error'\n\n const mark = (): JSX.Element => {\n if (status() === 'uploading')\n return <LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />\n if (status() === 'error') return <TriangleAlert aria-hidden=\"true\" />\n const Glyph = Icon()\n return <Glyph aria-hidden=\"true\" />\n }\n\n const label = (): JSX.Element => (\n <span class=\"min-w-0 truncate font-medium\" title={local.name}>\n {local.name}\n </span>\n )\n\n const name = (): JSX.Element => (\n <Show\n when={actionable() && (local.href !== undefined || local.onOpen !== undefined)}\n fallback={label()}\n >\n <Show\n when={local.href !== undefined}\n fallback={\n <button\n type=\"button\"\n class=\"min-w-0 truncate rounded-xs text-start font-medium outline-none hover:underline focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n title={local.name}\n onClick={() => local.onOpen?.()}\n >\n {local.name}\n </button>\n }\n >\n <a\n href={local.href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"min-w-0 truncate rounded-xs font-medium outline-none hover:underline focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n title={local.name}\n >\n {local.name}\n </a>\n </Show>\n </Show>\n )\n\n const detail = (): JSX.Element => (\n <Show when={status() !== 'ready' || size()}>\n <span\n class={cn('shrink-0 text-xs', {\n 'text-destructive': status() === 'error',\n 'text-muted-foreground': status() !== 'error',\n })}\n role={status() === 'uploading' || status() === 'error' ? 'status' : undefined}\n >\n {status() === 'uploading'\n ? local.progress === undefined\n ? 'Uploading…'\n : `Uploading ${Math.round(local.progress)}%`\n : status() === 'error'\n ? (local.statusLabel ?? 'Could not attach')\n : status() === 'unavailable'\n ? (local.statusLabel ?? 'Unavailable')\n : size()}\n </span>\n </Show>\n )\n\n const remove = (): JSX.Element => (\n <Show when={local.onRemove}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n class=\"shrink-0\"\n aria-label={local.removeLabel ?? `Remove ${local.name}`}\n onClick={() => local.onRemove?.()}\n >\n <X aria-hidden=\"true\" />\n </Button>\n </Show>\n )\n\n return (\n <div\n data-slot=\"attachment\"\n data-variant={variant()}\n data-status={status()}\n class={cn(\n 'min-w-0 text-sm',\n {\n 'inline-flex max-w-full items-center gap-1.5 rounded-lg border border-border bg-card py-1 ps-2 pe-1':\n variant() === 'chip',\n 'flex w-full max-w-sm items-center gap-2.5 rounded-xl border border-border bg-card p-2':\n variant() === 'card',\n 'flex w-32 flex-col gap-1.5': variant() === 'tile',\n 'border-destructive': status() === 'error',\n 'opacity-70': status() === 'unavailable',\n },\n local.class\n )}\n {...rest}\n >\n <Show\n when={variant() === 'tile'}\n fallback={\n <>\n <span\n class={cn('grid shrink-0 place-items-center text-muted-foreground [&_svg]:size-4', {\n 'size-9 overflow-hidden rounded-lg bg-muted': variant() === 'card',\n 'text-destructive': status() === 'error',\n })}\n >\n <Show when={preview() && variant() === 'card'} fallback={mark()}>\n <img src={preview()} alt=\"\" class=\"size-full object-cover\" />\n </Show>\n </span>\n <span class=\"flex min-w-0 flex-1 items-center gap-2\">\n {name()}\n {detail()}\n </span>\n {remove()}\n </>\n }\n >\n <span class=\"relative grid aspect-square w-full place-items-center overflow-hidden rounded-xl border border-border bg-muted text-muted-foreground [&_svg]:size-6\">\n <Show when={preview()} fallback={mark()}>\n <img src={preview()} alt=\"\" class=\"size-full object-cover\" />\n </Show>\n </span>\n <span class=\"flex min-w-0 items-center gap-1\">\n {name()}\n {remove()}\n </span>\n {detail()}\n </Show>\n </div>\n )\n}\n\nexport function AttachmentList(props: ComponentProps<'ul'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <ul\n role=\"list\"\n data-slot=\"attachment-list\"\n class={cn('m-0 flex min-w-0 list-none flex-wrap gap-2 p-0', local.class)}\n {...rest}\n >\n {local.children}\n </ul>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,IAAMA,YAAUqB,SAASpB,OAAa;AACtC,IAAMqB,WAAWD,SAASnB,IAAc;AACxC,IAAMC,aAAWkB,SAASjB,QAAc;AACxC,IAAMC,aAAWgB,SAASf,QAAc;AACxC,IAAMiB,YAAYF,SAASd,KAAe;AAC1C,IAAMC,iBAAea,SAASZ,YAAkB;AAChD,IAAMC,kBAAgBW,SAASV,aAAmB;AAClD,IAAMC,MAAIS,SAASR,CAAO;AAiC1B,IAAMW,YAAY;CAChBC,OAAOF;CACPG,UAAUrB;CACVsB,MAAMxB;CACNyB,MAAMvB;CACNwB,SAAS7B;CACT8B,OAAOR;AACT;;AAGA,IAAMS,SAASC,WAAoBA,UAAU,KAAKC,KAAKC,MAAMF,MAAM,IAAIC,KAAKC,MAAMF,SAAS,EAAE,IAAI;;AAGjG,SAAgBG,qBAAqBC,OAA+C;CAClF,IAAIA,UAAUC,KAAAA,KAAa,CAACC,OAAOC,SAASH,KAAK,KAAKA,QAAQ,GAAG,OAAOC,KAAAA;CACxE,OAAOrB,eAAeoB,OAAO;EAAC;EAAM;EAAM;EAAM;CAAI,IAAII,U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AAEZ,QAAQ;OAAC;OAAA,IAAEc,WAAQ;QAAA,OAAEX,KAAK;OAAC;OAAA,IAAAY,WAAA;QAAA,IAAAiC,QAAAL,QAAA;QAAAjC,aAAAC,aAAAqC,OAAA,OAC3BhD,QAAQ,CAAC,CAAA;QAAA,OAAAgD;OAAA;MAAA,CAAA,CAAA;MAAA,OAAAF;KAAA,EAAA,CAAA;YAAA;MAAA,IAAAG,QAAAC,QAAA;MAAAzC,OAAAwC,OAIpBjE,MAAI,IAAA;MAAAyB,OAAAwC,OACJhB,QAAM,IAAA;MAAA,OAAAgB;KAAA,EAAA,CAAA;KAAApC,WAERa,OAAO,CAAC;IAAA;GAAA;EAAA,CAAA,CAAA;EAAA,OAAAU;CAAA,EAAA,CAAA;AAIjB;AAEA,SAAgBe,eAAetD,OAA6B;CAC1D,MAAM,CAACC,OAAOC,QAAQ7C,WAAW2C,OAAO,CAAC,SAAS,UAAU,CAAC;CAC7D,cAAA;EAAA,IAAAuD,SAAAC,QAAA;EAAAf,OAAAc,QAAAb,WAAA,EAAA,KAAA,WAAA;GAAA,OAIWjF,GAAG,kDAAkDwC,MAAM0C,KAAK;EAAC,EAAA,GACpEzC,IAAI,GAAA,OAAA,IAAA;EAAAU,OAAA2C,cAEPtD,MAAMiB,QAAQ;EAAA,OAAAqC;CAAA,EAAA,CAAA;AAGrB;AAACE,eAAA,CAAA,OAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/badge/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC9E,OAAO,
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/badge/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC9E,OAAO,EAAyC,KAAK,cAAc,EAAE,MAAM,UAAU,CAAA;AACrF,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAGtD;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa;;;8EAqCzB,CAAA;AAED,KAAK,iBAAiB,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAA;AAE3D,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,cAAc,GAAG,MAAM,IAAI,gBAAgB,CAC1E,CAAC,EACD,iBAAiB,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CACvC,CAAA;AAED,wBAAgB,KAAK,CAAC,CAAC,SAAS,cAAc,GAAG,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,kCA2B5E"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { 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, mergeProps, spread, template } from "solid-js/web";
|
|
4
|
+
import { Show, splitProps } from "solid-js";
|
|
5
5
|
import { Polymorphic } from "@kobalte/core/polymorphic";
|
|
6
6
|
// src/components/ui/badge/badge.tsx
|
|
7
|
+
var _tmpl$ = /*#__PURE__*/ template(`<span data-slot=badge>`);
|
|
7
8
|
/**
|
|
8
9
|
* Badge.
|
|
9
10
|
*
|
|
@@ -49,20 +50,38 @@ var badgeVariants = cva("inline-flex w-fit shrink-0 items-center justify-center
|
|
|
49
50
|
});
|
|
50
51
|
function Badge(props) {
|
|
51
52
|
const [local, rest] = splitProps(props, [
|
|
53
|
+
"as",
|
|
52
54
|
"variant",
|
|
53
55
|
"size",
|
|
54
56
|
"class"
|
|
55
57
|
]);
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
const className = () => cn(badgeVariants({
|
|
59
|
+
variant: local.variant,
|
|
60
|
+
size: local.size
|
|
61
|
+
}), local.class);
|
|
62
|
+
return createComponent(Show, {
|
|
63
|
+
get when() {
|
|
64
|
+
return local.as === void 0 || local.as === "span";
|
|
65
|
+
},
|
|
66
|
+
get fallback() {
|
|
67
|
+
return createComponent(Polymorphic, mergeProps({
|
|
68
|
+
get as() {
|
|
69
|
+
return local.as;
|
|
70
|
+
},
|
|
71
|
+
"data-slot": "badge",
|
|
72
|
+
get ["class"]() {
|
|
73
|
+
return className();
|
|
74
|
+
}
|
|
75
|
+
}, rest));
|
|
76
|
+
},
|
|
77
|
+
get children() {
|
|
78
|
+
var _el$ = _tmpl$();
|
|
79
|
+
spread(_el$, mergeProps({ get ["class"]() {
|
|
80
|
+
return className();
|
|
81
|
+
} }, rest), false, false);
|
|
82
|
+
return _el$;
|
|
64
83
|
}
|
|
65
|
-
}
|
|
84
|
+
});
|
|
66
85
|
}
|
|
67
86
|
export { Badge, badgeVariants };
|
|
68
87
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","names":["Polymorphic","splitProps","cva","cn","badgeVariants","variants","variant","default","secondary","outline","success","warning","destructive","info","subtle","notification","size","sm","md","lg","defaultVariants","class","Badge","props","local","rest","_$createComponent","_$mergeProps","
|
|
1
|
+
{"version":3,"file":"badge.js","names":["Polymorphic","Show","splitProps","cva","cn","badgeVariants","variants","variant","default","secondary","outline","success","warning","destructive","info","subtle","notification","size","sm","md","lg","defaultVariants","class","Badge","props","local","rest","as","className","_$createComponent","when","undefined","fallback","_$mergeProps","children","_el$","_tmpl$","_$spread"],"sources":["../../../../src/components/ui/badge/badge.tsx"],"sourcesContent":["import { Polymorphic, type PolymorphicProps } from '@kobalte/core/polymorphic'\nimport { type ComponentProps, Show, splitProps, type ValidComponent } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * Badge.\n *\n * A short, non-interactive status label. If it can be clicked it is a Button\n * with `size=\"2xs\"`, not a Badge, the difference matters because a Badge\n * carries no focus or pressed state and must never be the only way to reach an\n * action.\n */\nexport const badgeVariants = cva(\n 'inline-flex w-fit shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-md border border-transparent font-medium transition-colors [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-3',\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground',\n secondary: 'bg-secondary text-secondary-foreground',\n outline: 'border-border text-foreground',\n /**\n * Tinted status fills, for counts and states rather than actions. The\n * word stays in `foreground` for contrast; the glyph takes the status\n * hue, so tags of different tones read apart at a glance.\n */\n success: 'bg-success-subtle text-foreground [&_svg]:text-success',\n warning: 'bg-warning-subtle text-foreground [&_svg]:text-warning',\n destructive: 'bg-destructive-subtle text-foreground [&_svg]:text-destructive',\n info: 'bg-info-subtle text-foreground [&_svg]:text-info',\n subtle: 'bg-primary-subtle text-primary',\n /**\n * A count that asks for attention, pinned to a corner of another control\n * (a workspace mark, a rail icon). At `sm` it is a 2xs label on whatever\n * surface sits behind the corner, where the destructive tint all but\n * disappears, so it takes the solid, contrast-measured action fill.\n */\n notification: 'bg-destructive-action text-destructive-action-foreground',\n },\n size: {\n sm: 'h-4 px-1.5 text-2xs',\n md: 'h-5 px-2 text-xs',\n lg: 'h-6 px-2.5 text-xs',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n }\n)\n\ntype BadgeVariantProps = VariantProps<typeof badgeVariants>\n\nexport type BadgeProps<T extends ValidComponent = 'span'> = PolymorphicProps<\n T,\n BadgeVariantProps & { class?: string }\n>\n\nexport function Badge<T extends ValidComponent = 'span'>(props: BadgeProps<T>) {\n const [local, rest] = splitProps(props as BadgeProps & { as?: ValidComponent }, [\n 'as',\n 'variant',\n 'size',\n 'class',\n ])\n const className = () =>\n cn(badgeVariants({ variant: local.variant, size: local.size }), local.class)\n\n // A plain span, the common case, is written directly: Polymorphic goes\n // through Dynamic, two prop proxies and a memo per badge.\n return (\n <Show\n when={local.as === undefined || local.as === 'span'}\n fallback={\n <Polymorphic\n as={local.as}\n data-slot=\"badge\"\n class={className()}\n {...(rest as ComponentProps<'span'>)}\n />\n }\n >\n <span data-slot=\"badge\" class={className()} {...(rest as ComponentProps<'span'>)} />\n </Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;AAaA,IAAaK,gBAAgBF,IAC3B,iNACA;CACEG,UAAU;EACRC,SAAS;GACPC,SAAS;GACTC,WAAW;GACXC,SAAS;;;;;;GAMTC,SAAS;GACTC,SAAS;GACTC,aAAa;GACbC,MAAM;GACNC,QAAQ;;;;;;;GAORC,cAAc;EAChB;EACAC,MAAM;GACJC,IAAI;GACJC,IAAI;GACJC,IAAI;EACN;CACF;CACAC,iBAAiB;EACfd,SAAS;EACTU,MAAM;CACR;AACF,CACF;AASA,SAAgBM,MAAyCC,OAAsB;CAC7E,MAAM,CAACC,OAAOC,QAAQxB,WAAWsB,OAA+C;EAC9E;EACA;EACA;EACA;CAAO,CACR;CACD,MAAMI,kBACJxB,GAAGC,cAAc;EAAEE,SAASkB,MAAMlB;EAASU,MAAMQ,MAAMR;CAAK,CAAC,GAAGQ,MAAMH,KAAK;CAI7E,OAAAO,gBACG5B,MAAI;EAAA,IACH6B,OAAI;GAAA,OAAEL,MAAME,OAAOI,KAAAA,KAAaN,MAAME,OAAO;EAAM;EAAA,IACnDK,WAAQ;GAAA,OAAAH,gBACL7B,aAAWiC,WAAA;IAAA,IACVN,KAAE;KAAA,OAAEF,MAAME;IAAE;IAAA,aAAA;IAAA,KAAA,WAAA;KAAA,OAELC,UAAU;IAAC;GAAA,GACbF,IAA8B,CAAA;EAAA;EAAA,IAAAQ,WAAA;GAAA,IAAAC,OAAAC,OAAA;GAAAC,OAAAF,MAAAF,WAAA,EAAA,KAAA,WAAA;IAAA,OAIRL,UAAU;GAAC,EAAA,GAAOF,IAA8B,GAAA,OAAA,KAAA;GAAA,OAAAS;EAAA;CAAA,CAAA;AAGrF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/breadcrumb/breadcrumb.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/breadcrumb/breadcrumb.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAS9C;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,kCAWtD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,kCASzD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,kCASzD;AAED,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,GAAG,CAAC,GAAG;IACtD,wDAAwD;IACxD,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,kCAmBxD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,kCAU3D;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,kCAc9D;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,kCAe/D"}
|